DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DGtal::deprecated::EuclideanShapesIntersection< ShapeA, ShapeB > Class Template Reference

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

Protected Member Functions

 EuclideanShapesIntersection ()
 

Private Member Functions

 EuclideanShapesIntersection (const EuclideanShapesIntersection &other)
 
EuclideanShapesIntersectionoperator= (const EuclideanShapesIntersection &other)
 

Private Attributes

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

Detailed Description

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

Aim: Intersection between two models of CEuclideanBoundedShape and CEuclideanOrientedShape.

Description of template class 'EuclideanShapesIntersection'

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

Member Typedef Documentation

◆ RealPoint

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

Definition at line 499 of file EuclideanShapesDecorator.h.

◆ Space

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

Definition at line 498 of file EuclideanShapesDecorator.h.

Constructor & Destructor Documentation

◆ EuclideanShapesIntersection() [1/3]

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

508 : myShapeA( a ),
509 myShapeB( b )
510 {
511 RealPoint shapeALowerBoundary = myShapeA.getLowerBound();
512 RealPoint shapeBLowerBoundary = myShapeB.getLowerBound();
513 RealPoint shapeAUpperBoundary = myShapeA.getUpperBound();
514 RealPoint shapeBUpperBoundary = myShapeB.getUpperBound();
515 for ( unsigned int i = 0; i < myLowerBound.size(); ++i )
516 {
517 myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
518 myUpperBound[ i ] = std::max( shapeAUpperBoundary[ i ], shapeBUpperBoundary[ i ] );
519 }
520 }
Z2i::RealPoint RealPoint

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

◆ ~EuclideanShapesIntersection()

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

Destructor.

Definition at line 570 of file EuclideanShapesDecorator.h.

570{}

◆ EuclideanShapesIntersection() [2/3]

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

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

◆ EuclideanShapesIntersection() [3/3]

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

◆ BOOST_CONCEPT_ASSERT() [2/4]

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

◆ BOOST_CONCEPT_ASSERT() [3/4]

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

◆ BOOST_CONCEPT_ASSERT() [4/4]

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

◆ getLowerBound()

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

Definition at line 527 of file EuclideanShapesDecorator.h.

528 {
529 return myLowerBound;
530 }

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

◆ getUpperBound()

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

Definition at line 536 of file EuclideanShapesDecorator.h.

537 {
538 return myUpperBound;
539 }

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

◆ isValid()

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

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

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

◆ selfDisplay()

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

template<typename ShapeA , typename ShapeB >
RealPoint DGtal::deprecated::EuclideanShapesIntersection< ShapeA, ShapeB >::myLowerBound
private

◆ myShapeA

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

◆ myShapeB

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

◆ myUpperBound

template<typename ShapeA , typename ShapeB >
RealPoint DGtal::deprecated::EuclideanShapesIntersection< ShapeA, ShapeB >::myUpperBound
private

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