DGtal 1.3.0
|
Aim: Constructive Solid Geometry (CSG) between models of CEuclideanBoundedShape and CEuclideanOrientedShape Use CSG operation (union, intersection, minus) from a shape of Type ShapeA with one (or more) shapes of Type ShapeB. Can combine differents operations. Limitations: Since we don't have a class derived by all shapes, operations can be done by only one type of shapes. Use CSG of CSG to go beyond this limitation. 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 >)) | |
EuclideanShapesCSG () | |
EuclideanShapesCSG (const EuclideanShapesCSG &other) | |
EuclideanShapesCSG (ConstAlias< ShapeA > a) | |
EuclideanShapesCSG & | operator= (const EuclideanShapesCSG &other) |
void | setParams (ConstAlias< ShapeA > a) |
void | plus (ConstAlias< ShapeB > b) |
void | intersection (ConstAlias< ShapeB > b) |
void | minus (ConstAlias< ShapeB > b) |
RealPoint | getLowerBound () const |
RealPoint | getUpperBound () const |
Orientation | orientation (const RealPoint &p) const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Protected Types | |
enum | e_operator { e_plus , e_intersection , e_minus } |
Private Attributes | |
CountedConstPtrOrConstPtr< ShapeA > | myShapeA |
Base Shape. More... | |
std::vector< std::pair< e_operator, CountedConstPtrOrConstPtr< ShapeB > > > | v_shapes |
Vector of all operations (ordered) of ShapeB. More... | |
RealPoint | myLowerBound |
Domain lower bound. More... | |
RealPoint | myUpperBound |
Domain upper bound. More... | |
bool | bIsValid |
if the CSG is valid. More... | |
Aim: Constructive Solid Geometry (CSG) between models of CEuclideanBoundedShape and CEuclideanOrientedShape Use CSG operation (union, intersection, minus) from a shape of Type ShapeA with one (or more) shapes of Type ShapeB. Can combine differents operations. Limitations: Since we don't have a class derived by all shapes, operations can be done by only one type of shapes. Use CSG of CSG to go beyond this limitation.
Description of template class 'EuclideanShapesCSG'
ShapeA | type of a first shape. Must be a model of CEuclideanBoundedShape and CEuclideanOrientedShape |
ShapeB | type of a second shape. Must be a model of CEuclideanBoundedShape and CEuclideanOrientedShape |
Definition at line 67 of file EuclideanShapesDecorator.h.
typedef ShapeA::RealPoint DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::RealPoint |
Definition at line 82 of file EuclideanShapesDecorator.h.
typedef ShapeA::Space DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::Space |
Definition at line 81 of file EuclideanShapesDecorator.h.
|
protected |
Enumerator | |
---|---|
e_plus | |
e_intersection | |
e_minus |
Definition at line 70 of file EuclideanShapesDecorator.h.
|
inline |
Default constructor. EuclideanShapesCSG will be not valid without setParams(ShapeA).
Definition at line 88 of file EuclideanShapesDecorator.h.
|
inline |
Copy constructor.
[in] | other | a EuclideanShapesCSG to copy |
Definition at line 97 of file EuclideanShapesDecorator.h.
|
inline |
Constructor. EuclideanShapesCSG will be valid.
[in] | a | a model of CEuclideanBoundedShape and CEuclideanOrientedShape |
Definition at line 108 of file EuclideanShapesDecorator.h.
References DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::bIsValid, DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::myLowerBound, DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::myShapeA, and DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::myUpperBound.
DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT | ( | (concepts::CEuclideanBoundedShape< ShapeA >) | ) |
DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT | ( | (concepts::CEuclideanOrientedShape< ShapeA >) | ) |
|
inline |
Definition at line 222 of file EuclideanShapesDecorator.h.
References DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::isValid(), and DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::myLowerBound.
|
inline |
Definition at line 233 of file EuclideanShapesDecorator.h.
References DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::isValid(), and DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::myUpperBound.
|
inline |
Intersection between a (ShapeA) and b (ShapeB). If an operation was already set, the intersection will be between the CSG shape and b (ShapeB).
[in] | b | a ShapeB, model of CEuclideanBoundedShape and CEuclideanOrientedShape |
Definition at line 182 of file EuclideanShapesDecorator.h.
References DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT(), DGtal::SpaceND< dim, TInteger >::dimension, DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::e_intersection, DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::isValid(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::myLowerBound, DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::myUpperBound, and DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::v_shapes.
|
inline |
Checks the validity/consistency of the object.
Definition at line 314 of file EuclideanShapesDecorator.h.
References DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::bIsValid.
Referenced by DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::getLowerBound(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::getUpperBound(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::intersection(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::minus(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::orientation(), and DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::plus().
|
inline |
Minus between a (ShapeA) and b (ShapeB). If an operation was already set, the minus will be between the CSG shape and b (ShapeB).
[in] | b | a ShapeB, model of CEuclideanBoundedShape and CEuclideanOrientedShape |
Definition at line 206 of file EuclideanShapesDecorator.h.
References DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::e_minus, DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::isValid(), and DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::v_shapes.
|
inline |
Copy operator.
[in] | other | a EuclideanShapesCSG to copy |
Definition at line 124 of file EuclideanShapesDecorator.h.
References DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::bIsValid, DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::myLowerBound, DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::myShapeA, DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::myUpperBound, and DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::v_shapes.
|
inline |
Return the orientation of a point with respect to a shape. Resolve all operations done with operators in the order they are set.
[in] | p | input point |
e_plus
Definition at line 248 of file EuclideanShapesDecorator.h.
References DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::e_intersection, DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::e_minus, DGtal::INSIDE, DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::isValid(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::myShapeA, DGtal::ON, DGtal::OUTSIDE, and DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::v_shapes.
|
inline |
Union between a shape (ShapeA, gived at construction) and b (ShapeB). If an operation was already set, the union will be between the CSG shape and b (ShapeB).
[in] | b | a ShapeB, model of CEuclideanBoundedShape and CEuclideanOrientedShape |
Definition at line 158 of file EuclideanShapesDecorator.h.
References DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::BOOST_CONCEPT_ASSERT(), DGtal::SpaceND< dim, TInteger >::dimension, DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::e_plus, DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::isValid(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::myLowerBound, DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::myUpperBound, and DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::v_shapes.
void DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
|
inline |
Add a (unique) ShapeA for the CSG computation. EuclideanShapesCSG will be valid after. If a ShapeA was already set, the previous one will be override.
[in] | a | a ShapeA, model of CEuclideanBoundedShape and CEuclideanOrientedShape |
Definition at line 142 of file EuclideanShapesDecorator.h.
References DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::bIsValid, DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::myLowerBound, DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::myShapeA, and DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::myUpperBound.
|
private |
if the CSG is valid.
Definition at line 335 of file EuclideanShapesDecorator.h.
Referenced by DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::EuclideanShapesCSG(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::isValid(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::operator=(), and DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::setParams().
|
private |
Domain lower bound.
Definition at line 329 of file EuclideanShapesDecorator.h.
Referenced by DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::EuclideanShapesCSG(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::getLowerBound(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::intersection(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::operator=(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::plus(), and DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::setParams().
|
private |
Base Shape.
Definition at line 323 of file EuclideanShapesDecorator.h.
Referenced by DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::EuclideanShapesCSG(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::operator=(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::orientation(), and DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::setParams().
|
private |
Domain upper bound.
Definition at line 332 of file EuclideanShapesDecorator.h.
Referenced by DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::EuclideanShapesCSG(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::getUpperBound(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::intersection(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::operator=(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::plus(), and DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::setParams().
|
private |
Vector of all operations (ordered) of ShapeB.
Definition at line 326 of file EuclideanShapesDecorator.h.
Referenced by DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::intersection(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::minus(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::operator=(), DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::orientation(), and DGtal::EuclideanShapesCSG< ShapeA, ShapeB >::plus().