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

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

Protected Member Functions

 DigitalShapesIntersection ()
 

Private Member Functions

 DigitalShapesIntersection (const DigitalShapesIntersection &other)
 
DigitalShapesIntersectionoperator= (const DigitalShapesIntersection &other)
 

Private Attributes

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

Detailed Description

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

Aim: Intersection between two models of CDigitalBoundedShape and CDigitalOrientedShape.

Description of template class 'DigitalShapesIntersection'

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

Member Typedef Documentation

◆ Point

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

Definition at line 502 of file DigitalShapesDecorator.h.

◆ Space

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

Definition at line 501 of file DigitalShapesDecorator.h.

Constructor & Destructor Documentation

◆ DigitalShapesIntersection() [1/3]

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

511  : myShapeA( a ),
512  myShapeB( b )
513  {
514  Point shapeALowerBoundary = myShapeA.getLowerBound();
515  Point shapeBLowerBoundary = myShapeB.getLowerBound();
516  Point shapeAUpperBoundary = myShapeA.getUpperBound();
517  Point shapeBUpperBoundary = myShapeB.getUpperBound();
518  for ( unsigned int i = 0; i < myLowerBound.size(); ++i )
519  {
520  myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
521  myUpperBound[ i ] = std::max( shapeAUpperBoundary[ i ], shapeBUpperBoundary[ i ] );
522  }
523  }
int max(int a, int b)
MyPointD Point
Definition: testClone2.cpp:383

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

◆ ~DigitalShapesIntersection()

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

Destructor.

Definition at line 573 of file DigitalShapesDecorator.h.

573 {}

◆ DigitalShapesIntersection() [2/3]

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

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

◆ DigitalShapesIntersection() [3/3]

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

◆ BOOST_CONCEPT_ASSERT() [2/4]

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

◆ BOOST_CONCEPT_ASSERT() [3/4]

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

◆ BOOST_CONCEPT_ASSERT() [4/4]

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

◆ getLowerBound()

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

Definition at line 530 of file DigitalShapesDecorator.h.

531  {
532  return myLowerBound;
533  }

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

◆ getUpperBound()

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

Definition at line 539 of file DigitalShapesDecorator.h.

540  {
541  return myUpperBound;
542  }

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

◆ isValid()

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

552  {
553  if (( myShapeA.orientation( p ) == ON ) && ( myShapeB.orientation( p ) != OUTSIDE ))
554  {
555  return ON;
556  }
557  else if (( myShapeB.orientation( p ) == ON ) && ( myShapeA.orientation( p ) != OUTSIDE ))
558  {
559  return ON;
560  }
561  else if (( myShapeA.orientation( p ) == INSIDE ) && ( myShapeB.orientation( p ) == INSIDE ))
562  {
563  return INSIDE;
564  }
565 
566  return OUTSIDE;
567  }
@ INSIDE
Definition: Common.h:141
@ OUTSIDE
Definition: Common.h:141
@ ON
Definition: Common.h:141

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

◆ selfDisplay()

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

◆ myShapeB

◆ myUpperBound


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