30 #if defined(DigitalShapesDecorator_RECURSES)
31 #error Recursive header files inclusion detected in DigitalShapesDecorator.h
32 #else // defined(DigitalShapesDecorator_RECURSES)
34 #define DigitalShapesDecorator_RECURSES
36 #if !defined DigitalShapesDecorator_h
38 #define DigitalShapesDecorator_h
43 #include "DGtal/base/Common.h"
44 #include "DGtal/base/ConstAlias.h"
46 #include "DGtal/shapes/CDigitalBoundedShape.h"
47 #include "DGtal/shapes/CDigitalOrientedShape.h"
66 template <
typename ShapeA,
typename ShapeB>
164 FATAL_ERROR_MSG(
isValid(),
"Operation invalid. Maybe you don't set a ShapeA object." );
166 std::pair<e_operator, CountedConstPtrOrConstPtr< ShapeB > > shape(
e_plus, b );
188 FATAL_ERROR_MSG(
isValid(),
"Operation invalid. Maybe you don't set a ShapeA object." );
190 std::pair<e_operator, CountedConstPtrOrConstPtr< ShapeB > > shape(
e_intersection, b );
212 FATAL_ERROR_MSG(
isValid(),
"Operation invalid. Maybe you don't set a ShapeA object." );
214 std::pair<e_operator, CountedConstPtrOrConstPtr< ShapeB > > shape(
e_minus, b );
226 FATAL_ERROR_MSG(
isValid(),
"Operation invalid. Maybe you don't set a ShapeA object." );
237 FATAL_ERROR_MSG(
isValid(),
"Operation invalid. Maybe you don't set a ShapeA object." );
252 FATAL_ERROR_MSG(
isValid(),
"Operation invalid. Maybe you don't set a ShapeA object." );
256 for(
unsigned int i = 0; i <
v_shapes.size(); ++i)
271 else if ((
v_shapes[i].second->orientation( p ) ==
ON ) && ( orient !=
OUTSIDE ))
290 else if (( orient ==
ON ) || (
v_shapes[i].second->orientation( p ) ==
ON ))
328 std::vector< std::pair<e_operator, CountedConstPtrOrConstPtr< ShapeB > > >
v_shapes;
353 template <
typename ShapeA,
typename ShapeB>
380 for (
unsigned int i = 0; i <
myLowerBound.size(); ++i )
382 myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
491 template <
typename ShapeA,
typename ShapeB>
518 for (
unsigned int i = 0; i <
myLowerBound.size(); ++i )
520 myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
635 template <
typename ShapeA,
typename ShapeB>
662 for (
unsigned int i = 0; i <
myLowerBound.size(); ++i )
664 myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
768 template <
typename ShapeA,
typename ShapeB>
772 template <
typename ShapeA,
typename ShapeB>
776 template <
typename ShapeA,
typename ShapeB>
784 #endif // !defined DigitalShapesDecorator_h
786 #undef DigitalShapesDecorator_RECURSES
787 #endif // else defined(DigitalShapesDecorator_RECURSES)
std::vector< std::pair< e_operator, CountedConstPtrOrConstPtr< ShapeB > > > v_shapes
Vector of all operations (ordered) of ShapeB.
Point getUpperBound() const
DigitalShapesIntersection & operator=(const DigitalShapesIntersection &other)
DigitalShapesIntersection()
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Aim: Intersection between two models of CDigitalBoundedShape and CDigitalOrientedShape.
Orientation orientation(const Point &p) const
void selfDisplay(std::ostream &out) const
Point getUpperBound() const
DigitalShapesMinus & operator=(const DigitalShapesMinus &other)
DigitalShapesUnion & operator=(const DigitalShapesUnion &other)
DGtal::uint32_t Dimension
Aim: Minus between two models of CDigitalBoundedShape and CDigitalOrientedShape.
void intersection(ConstAlias< ShapeB > b)
Point getLowerBound() const
BOOST_CONCEPT_ASSERT((concepts::CDigitalBoundedShape< ShapeA >))
Point getLowerBound() const
Aim: Union between two models of CDigitalBoundedShape and CDigitalOrientedShape.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
void plus(ConstAlias< ShapeB > b)
Point getLowerBound() const
DigitalShapesUnion(ConstAlias< ShapeA > a, ConstAlias< ShapeB > b)
BOOST_CONCEPT_ASSERT((concepts::CDigitalBoundedShape< ShapeA >))
Point getUpperBound() const
void setParams(ConstAlias< ShapeA > a)
DGtal is the top-level namespace which contains all DGtal functions and types.
void minus(ConstAlias< ShapeB > b)
Orientation orientation(const Point &p) const
~DigitalShapesIntersection()
Aim: characterizes models of digital oriented shapes. For example, models should provide an orientati...
DigitalShapesCSG(ConstAlias< ShapeA > a)
static const Dimension dimension
static constants to store the dimension.
Aim: Constructive Solid Geometry (CSG) between models of CDigitalBoundedShape and CDigitalOrientedSha...
bool bIsValid
if the CSG is valid.
void selfDisplay(std::ostream &out) const
void selfDisplay(std::ostream &out) const
DigitalShapesIntersection(ConstAlias< ShapeA > a, ConstAlias< ShapeB > b)
Point getUpperBound() const
CountedConstPtrOrConstPtr< ShapeA > myShapeA
Base Shape.
Point getLowerBound() const
Point myLowerBound
Domain lower bound.
DigitalShapesCSG & operator=(const DigitalShapesCSG &other)
Orientation orientation(const Point &p) const
void selfDisplay(std::ostream &out) const
DigitalShapesMinus(ConstAlias< ShapeA > a, ConstAlias< ShapeB > b)
Aim: designs the concept of bounded shapes in DGtal (shape for which upper and lower bounding bounds ...
Point myUpperBound
Domain upper bound.
BOOST_CONCEPT_ASSERT((concepts::CDigitalBoundedShape< ShapeA >))
Orientation orientation(const Point &p) const
DigitalShapesCSG(const DigitalShapesCSG &other)
BOOST_CONCEPT_ASSERT((concepts::CDigitalBoundedShape< ShapeA >))