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

Aim: Minus between two models of CDigitalBoundedShape and CDigitalOrientedShape. More...

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

Protected Member Functions

 DigitalShapesMinus ()
 

Private Member Functions

 DigitalShapesMinus (const DigitalShapesMinus &other)
 
DigitalShapesMinusoperator= (const DigitalShapesMinus &other)
 

Private Attributes

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

Detailed Description

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

Aim: Minus between two models of CDigitalBoundedShape and CDigitalOrientedShape.

Description of template class 'DigitalShapesMinus'

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 636 of file DigitalShapesDecorator.h.

Member Typedef Documentation

◆ Point

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

Definition at line 646 of file DigitalShapesDecorator.h.

◆ Space

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

Definition at line 645 of file DigitalShapesDecorator.h.

Constructor & Destructor Documentation

◆ DigitalShapesMinus() [1/3]

template<typename ShapeA , typename ShapeB >
DGtal::deprecated::DigitalShapesMinus< ShapeA, ShapeB >::DigitalShapesMinus ( 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 654 of file DigitalShapesDecorator.h.

655  : myShapeA( a ),
656  myShapeB( b )
657  {
658  Point shapeALowerBoundary = myShapeA.getLowerBound();
659  Point shapeBLowerBoundary = myShapeB.getLowerBound();
660  Point shapeAUpperBoundary = myShapeA.getUpperBound();
661  Point shapeBUpperBoundary = myShapeB.getUpperBound();
662  for ( unsigned int i = 0; i < myLowerBound.size(); ++i )
663  {
664  myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
665  myUpperBound[ i ] = std::max( shapeAUpperBoundary[ i ], shapeBUpperBoundary[ i ] );
666  }
667  }
int max(int a, int b)
MyPointD Point
Definition: testClone2.cpp:383

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

◆ ~DigitalShapesMinus()

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

Destructor.

Definition at line 708 of file DigitalShapesDecorator.h.

708 {}

◆ DigitalShapesMinus() [2/3]

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

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

◆ DigitalShapesMinus() [3/3]

template<typename ShapeA , typename ShapeB >
DGtal::deprecated::DigitalShapesMinus< ShapeA, ShapeB >::DigitalShapesMinus ( const DigitalShapesMinus< 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::DigitalShapesMinus< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT ( (concepts::CDigitalBoundedShape< ShapeA >)  )

◆ BOOST_CONCEPT_ASSERT() [2/4]

template<typename ShapeA , typename ShapeB >
DGtal::deprecated::DigitalShapesMinus< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT ( (concepts::CDigitalBoundedShape< ShapeB >)  )

◆ BOOST_CONCEPT_ASSERT() [3/4]

template<typename ShapeA , typename ShapeB >
DGtal::deprecated::DigitalShapesMinus< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT ( (concepts::CDigitalOrientedShape< ShapeA >)  )

◆ BOOST_CONCEPT_ASSERT() [4/4]

template<typename ShapeA , typename ShapeB >
DGtal::deprecated::DigitalShapesMinus< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT ( (concepts::CDigitalOrientedShape< ShapeB >)  )

◆ getLowerBound()

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

Definition at line 674 of file DigitalShapesDecorator.h.

675  {
676  return myLowerBound;
677  }

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

◆ getUpperBound()

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

Definition at line 683 of file DigitalShapesDecorator.h.

684  {
685  return myUpperBound;
686  }

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

◆ isValid()

template<typename ShapeA , typename ShapeB >
bool DGtal::deprecated::DigitalShapesMinus< 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 >
DigitalShapesMinus& DGtal::deprecated::DigitalShapesMinus< ShapeA, ShapeB >::operator= ( const DigitalShapesMinus< 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::DigitalShapesMinus< 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 695 of file DigitalShapesDecorator.h.

696  {
697  if (( myShapeB.orientation( p ) == INSIDE ) || ( myShapeB.orientation( p ) == ON ))
698  {
699  return OUTSIDE;
700  }
701  return myShapeA.orientation( p );
702  }
@ INSIDE
Definition: Common.h:141
@ OUTSIDE
Definition: Common.h:141
@ ON
Definition: Common.h:141

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

◆ selfDisplay()

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

◆ myShapeB

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

◆ myUpperBound


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