DGtal  0.9.4beta
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB > Class Template Reference

#include <DGtal/shapes/DigitalShapesDecorator.h>

Public Types

typedef ShapeA::Space Space
 
typedef ShapeA::Point Point
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CDigitalBoundedShape< ShapeA >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CDigitalOrientedShape< ShapeA >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CDigitalBoundedShape< ShapeB >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CDigitalOrientedShape< ShapeB >))
 
 DigitalShapesUnion (ConstAlias< ShapeA > a, ConstAlias< ShapeB > b)
 
Point getLowerBound () const
 
Point getUpperBound () const
 
Orientation orientation (const Point &p) const
 
 ~DigitalShapesUnion ()
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Member Functions

 DigitalShapesUnion ()
 

Private Member Functions

 DigitalShapesUnion (const DigitalShapesUnion &other)
 
DigitalShapesUnionoperator= (const DigitalShapesUnion &other)
 

Private Attributes

const ShapeA & myShapeA
 
const ShapeB & myShapeB
 
Point myLowerBound
 
Point myUpperBound
 

Detailed Description

template<typename ShapeA, typename ShapeB>
class DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >

Aim: Union between two models of CDigitalBoundedShape and CDigitalOrientedShape.

Description of template class 'DigitalShapesUnion'

Template Parameters
ShapeAtype of the first shape. Must be a model of CDigitalBoundedShape and CDigitalOrientedShape
ShapeBtype of the second shape. Must be a model of CDigitalBoundedShape and CDigitalOrientedShape

Definition at line 354 of file DigitalShapesDecorator.h.

Member Typedef Documentation

template<typename ShapeA , typename ShapeB >
typedef ShapeA::Point DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::Point

Definition at line 364 of file DigitalShapesDecorator.h.

template<typename ShapeA , typename ShapeB >
typedef ShapeA::Space DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::Space

Definition at line 363 of file DigitalShapesDecorator.h.

Constructor & Destructor Documentation

template<typename ShapeA , typename ShapeB >
DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::DigitalShapesUnion ( ConstAlias< ShapeA >  a,
ConstAlias< ShapeB >  b 
)
inline

Constructor.

Parameters
[in]aa model of CDigitalBoundedShape and CDigitalOrientedShape
[in]ba model of CDigitalBoundedShape and CDigitalOrientedShape

Definition at line 372 of file DigitalShapesDecorator.h.

References DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::myLowerBound, DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::myShapeA, DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::myShapeB, and DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::myUpperBound.

373  : myShapeA( a ),
374  myShapeB( b )
375  {
376  Point shapeALowerBoundary = myShapeA.getLowerBound();
377  Point shapeBLowerBoundary = myShapeB.getLowerBound();
378  Point shapeAUpperBoundary = myShapeA.getUpperBound();
379  Point shapeBUpperBoundary = myShapeB.getUpperBound();
380  for ( unsigned int i = 0; i < myLowerBound.size(); ++i )
381  {
382  myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
383  myUpperBound[ i ] = std::max( shapeAUpperBoundary[ i ], shapeBUpperBoundary[ i ] );
384  }
385  }
template<typename ShapeA , typename ShapeB >
DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::~DigitalShapesUnion ( )
inline

Destructor.

Definition at line 429 of file DigitalShapesDecorator.h.

429 {}
template<typename ShapeA , typename ShapeB >
DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::DigitalShapesUnion ( )
protected

Constructor. Forbidden by default (protected to avoid g++ warnings).

template<typename ShapeA , typename ShapeB >
DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::DigitalShapesUnion ( const DigitalShapesUnion< ShapeA, ShapeB > &  other)
private

Copy constructor.

Parameters
otherthe object to clone. Forbidden by default.

Member Function Documentation

template<typename ShapeA , typename ShapeB >
DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT ( (concepts::CDigitalBoundedShape< ShapeA >)  )
template<typename ShapeA , typename ShapeB >
DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT ( (concepts::CDigitalOrientedShape< ShapeA >)  )
template<typename ShapeA , typename ShapeB >
DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT ( (concepts::CDigitalBoundedShape< ShapeB >)  )
template<typename ShapeA , typename ShapeB >
DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT ( (concepts::CDigitalOrientedShape< ShapeB >)  )
template<typename ShapeA , typename ShapeB >
Point DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::getLowerBound ( ) const
inline
Returns
the lower bound of the shape bounding box.

Definition at line 392 of file DigitalShapesDecorator.h.

References DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::myLowerBound.

393  {
394  return myLowerBound;
395  }
template<typename ShapeA , typename ShapeB >
Point DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::getUpperBound ( ) const
inline
Returns
the upper bound of the shape bounding box.

Definition at line 401 of file DigitalShapesDecorator.h.

References DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::myUpperBound.

402  {
403  return myUpperBound;
404  }
template<typename ShapeA , typename ShapeB >
bool DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename ShapeA , typename ShapeB >
DigitalShapesUnion& DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::operator= ( const DigitalShapesUnion< ShapeA, ShapeB > &  other)
private

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.
template<typename ShapeA , typename ShapeB >
Orientation DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::orientation ( const Point p) const
inline

Return the orientation of a point with respect to a shape.

Parameters
[in]pinput point
Returns
the orientation of the point (0 = INSIDE, 1 = ON, 2 = OUTSIDE)

Definition at line 413 of file DigitalShapesDecorator.h.

References DGtal::INSIDE, DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::myShapeA, DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::myShapeB, DGtal::ON, and DGtal::OUTSIDE.

414  {
415  if (( myShapeA.orientation( p ) == INSIDE ) || ( myShapeB.orientation( p ) == INSIDE ))
416  {
417  return INSIDE;
418  }
419  else if (( myShapeA.orientation( p ) == ON ) || ( myShapeB.orientation( p ) == ON ))
420  {
421  return ON;
422  }
423  return OUTSIDE;
424  }
template<typename ShapeA , typename ShapeB >
void DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

Field Documentation

template<typename ShapeA , typename ShapeB >
Point DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::myLowerBound
private
template<typename ShapeA , typename ShapeB >
const ShapeA& DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::myShapeA
private
template<typename ShapeA , typename ShapeB >
const ShapeB& DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::myShapeB
private
template<typename ShapeA , typename ShapeB >
Point DGtal::deprecated::DigitalShapesUnion< ShapeA, ShapeB >::myUpperBound
private

The documentation for this class was generated from the following file: