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

#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 >))
 
 EuclideanShapesMinus (ConstAlias< ShapeA > a, ConstAlias< ShapeB > b)
 
RealPoint getLowerBound () const
 
RealPoint getUpperBound () const
 
Orientation orientation (const RealPoint &p) const
 
 ~EuclideanShapesMinus ()
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Member Functions

 EuclideanShapesMinus ()
 

Private Member Functions

 EuclideanShapesMinus (const EuclideanShapesMinus &other)
 
EuclideanShapesMinusoperator= (const EuclideanShapesMinus &other)
 

Private Attributes

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

Detailed Description

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

Aim: Minus between two models of CEuclideanBoundedShape and CEuclideanOrientedShape.

Description of template class 'EuclideanShapesMinus'

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 633 of file EuclideanShapesDecorator.h.

Member Typedef Documentation

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

Definition at line 643 of file EuclideanShapesDecorator.h.

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

Definition at line 642 of file EuclideanShapesDecorator.h.

Constructor & Destructor Documentation

template<typename ShapeA , typename ShapeB >
DGtal::deprecated::EuclideanShapesMinus< ShapeA, ShapeB >::EuclideanShapesMinus ( 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 651 of file EuclideanShapesDecorator.h.

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

652  : myShapeA( a ),
653  myShapeB( b )
654  {
655  RealPoint shapeALowerBoundary = myShapeA.getLowerBound();
656  RealPoint shapeBLowerBoundary = myShapeB.getLowerBound();
657  RealPoint shapeAUpperBoundary = myShapeA.getUpperBound();
658  RealPoint shapeBUpperBoundary = myShapeB.getUpperBound();
659  for ( unsigned int i = 0; i < myLowerBound.size(); ++i )
660  {
661  myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
662  myUpperBound[ i ] = std::max( shapeAUpperBoundary[ i ], shapeBUpperBoundary[ i ] );
663  }
664  }
template<typename ShapeA , typename ShapeB >
DGtal::deprecated::EuclideanShapesMinus< ShapeA, ShapeB >::~EuclideanShapesMinus ( )
inline

Destructor.

Definition at line 704 of file EuclideanShapesDecorator.h.

704 {}
template<typename ShapeA , typename ShapeB >
DGtal::deprecated::EuclideanShapesMinus< ShapeA, ShapeB >::EuclideanShapesMinus ( )
protected

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

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

Copy constructor.

Parameters
otherthe object to clone. Forbidden by default.

Member Function Documentation

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

Definition at line 670 of file EuclideanShapesDecorator.h.

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

671  {
672  return myLowerBound;
673  }
template<typename ShapeA , typename ShapeB >
RealPoint DGtal::deprecated::EuclideanShapesMinus< ShapeA, ShapeB >::getUpperBound ( ) const
inline
Returns
the upper bound of the shape bounding box.

Definition at line 679 of file EuclideanShapesDecorator.h.

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

680  {
681  return myUpperBound;
682  }
template<typename ShapeA , typename ShapeB >
bool DGtal::deprecated::EuclideanShapesMinus< 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 >
EuclideanShapesMinus& DGtal::deprecated::EuclideanShapesMinus< ShapeA, ShapeB >::operator= ( const EuclideanShapesMinus< 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::EuclideanShapesMinus< 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 691 of file EuclideanShapesDecorator.h.

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

692  {
693  if (( myShapeB.orientation( p ) == INSIDE ) || ( myShapeB.orientation( p ) == ON ))
694  {
695  return OUTSIDE;
696  }
697  return myShapeA.orientation( p );
698  }
template<typename ShapeA , typename ShapeB >
void DGtal::deprecated::EuclideanShapesMinus< 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 >
RealPoint DGtal::deprecated::EuclideanShapesMinus< ShapeA, ShapeB >::myLowerBound
private
template<typename ShapeA , typename ShapeB >
const ShapeA& DGtal::deprecated::EuclideanShapesMinus< ShapeA, ShapeB >::myShapeA
private
template<typename ShapeA , typename ShapeB >
const ShapeB& DGtal::deprecated::EuclideanShapesMinus< ShapeA, ShapeB >::myShapeB
private
template<typename ShapeA , typename ShapeB >
RealPoint DGtal::deprecated::EuclideanShapesMinus< ShapeA, ShapeB >::myUpperBound
private

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