DGtal  1.5.beta
DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB > Class Template Reference

Aim: Union between two models of CEuclideanBoundedShape and CEuclideanOrientedShape. More...

#include <DGtal/shapes/EuclideanShapesDecorator.h>

Public Types

typedef ShapeA::Space Space
 
typedef ShapeA::RealPoint RealPoint
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CEuclideanBoundedShape< ShapeA >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CEuclideanOrientedShape< ShapeA >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CEuclideanBoundedShape< ShapeB >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CEuclideanOrientedShape< ShapeB >))
 
 EuclideanShapesUnion (ConstAlias< ShapeA > a, ConstAlias< ShapeB > b)
 
RealPoint getLowerBound () const
 
RealPoint getUpperBound () const
 
Orientation orientation (const RealPoint &p) const
 
 ~EuclideanShapesUnion ()
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Member Functions

 EuclideanShapesUnion ()
 

Private Member Functions

 EuclideanShapesUnion (const EuclideanShapesUnion &other)
 
EuclideanShapesUnionoperator= (const EuclideanShapesUnion &other)
 

Private Attributes

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

Detailed Description

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

Aim: Union between two models of CEuclideanBoundedShape and CEuclideanOrientedShape.

Description of template class 'EuclideanShapesDecorator'

Template Parameters
ShapeAtype of the first shape. Must be a model of CEuclideanBoundedShape and CEuclideanOrientedShape
ShapeBtype of the second shape. Must be a model of CEuclideanBoundedShape and CEuclideanOrientedShape

Definition at line 352 of file EuclideanShapesDecorator.h.

Member Typedef Documentation

◆ RealPoint

template<typename ShapeA , typename ShapeB >
typedef ShapeA::RealPoint DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::RealPoint

Definition at line 362 of file EuclideanShapesDecorator.h.

◆ Space

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

Definition at line 361 of file EuclideanShapesDecorator.h.

Constructor & Destructor Documentation

◆ EuclideanShapesUnion() [1/3]

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

Constructor.

Parameters
[in]aa model of CEuclideanBoundedShape and CEuclideanOrientedShape
[in]ba model of CEuclideanBoundedShape and CEuclideanOrientedShape

Definition at line 370 of file EuclideanShapesDecorator.h.

371  : myShapeA( a ),
372  myShapeB( b )
373  {
374  RealPoint shapeALowerBoundary = myShapeA.getLowerBound();
375  RealPoint shapeBLowerBoundary = myShapeB.getLowerBound();
376  RealPoint shapeAUpperBoundary = myShapeA.getUpperBound();
377  RealPoint shapeBUpperBoundary = myShapeB.getUpperBound();
378  for ( unsigned int i = 0; i < myLowerBound.size(); ++i )
379  {
380  myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
381  myUpperBound[ i ] = std::max( shapeAUpperBoundary[ i ], shapeBUpperBoundary[ i ] );
382  }
383  }
int max(int a, int b)
PointVector< 3, double > RealPoint

References max(), DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::myLowerBound, DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::myShapeA, DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::myShapeB, and DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::myUpperBound.

◆ ~EuclideanShapesUnion()

template<typename ShapeA , typename ShapeB >
DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::~EuclideanShapesUnion ( )
inline

Destructor.

Definition at line 426 of file EuclideanShapesDecorator.h.

426 {}

◆ EuclideanShapesUnion() [2/3]

template<typename ShapeA , typename ShapeB >
DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::EuclideanShapesUnion ( )
protected

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

◆ EuclideanShapesUnion() [3/3]

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

Copy constructor.

Parameters
otherthe object to clone. Forbidden by default.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT() [1/4]

template<typename ShapeA , typename ShapeB >
DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT ( (concepts::CEuclideanBoundedShape< ShapeA >)  )

◆ BOOST_CONCEPT_ASSERT() [2/4]

template<typename ShapeA , typename ShapeB >
DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT ( (concepts::CEuclideanBoundedShape< ShapeB >)  )

◆ BOOST_CONCEPT_ASSERT() [3/4]

template<typename ShapeA , typename ShapeB >
DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT ( (concepts::CEuclideanOrientedShape< ShapeA >)  )

◆ BOOST_CONCEPT_ASSERT() [4/4]

template<typename ShapeA , typename ShapeB >
DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT ( (concepts::CEuclideanOrientedShape< ShapeB >)  )

◆ getLowerBound()

template<typename ShapeA , typename ShapeB >
RealPoint DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::getLowerBound ( ) const
inline
Returns
the lower bound of the shape bounding box.

Definition at line 389 of file EuclideanShapesDecorator.h.

390  {
391  return myLowerBound;
392  }

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

◆ getUpperBound()

template<typename ShapeA , typename ShapeB >
RealPoint DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::getUpperBound ( ) const
inline
Returns
the upper bound of the shape bounding box.

Definition at line 398 of file EuclideanShapesDecorator.h.

399  {
400  return myUpperBound;
401  }

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

◆ isValid()

template<typename ShapeA , typename ShapeB >
bool DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ operator=()

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

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.

◆ orientation()

template<typename ShapeA , typename ShapeB >
Orientation DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::orientation ( const RealPoint 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 410 of file EuclideanShapesDecorator.h.

411  {
412  if (( myShapeA.orientation( p ) == INSIDE ) || ( myShapeB.orientation( p ) == INSIDE ))
413  {
414  return INSIDE;
415  }
416  else if (( myShapeA.orientation( p ) == ON ) || ( myShapeB.orientation( p ) == ON ))
417  {
418  return ON;
419  }
420  return OUTSIDE;
421  }
@ INSIDE
Definition: Common.h:141
@ OUTSIDE
Definition: Common.h:141
@ ON
Definition: Common.h:141

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

◆ selfDisplay()

template<typename ShapeA , typename ShapeB >
void DGtal::deprecated::EuclideanShapesUnion< 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

◆ myLowerBound

◆ myShapeA

template<typename ShapeA , typename ShapeB >
const ShapeA& DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::myShapeA
private

◆ myShapeB

template<typename ShapeA , typename ShapeB >
const ShapeB& DGtal::deprecated::EuclideanShapesUnion< ShapeA, ShapeB >::myShapeB
private

◆ myUpperBound


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