30#if defined(DigitalShapesDecorator_RECURSES)
31#error Recursive header files inclusion detected in DigitalShapesDecorator.h
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>
81 typedef typename ShapeA::Space
Space;
82 typedef typename ShapeA::Point
Point;
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;
346#undef DigitalShapesDecorator_RECURSES
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
void plus(ConstAlias< ShapeB > b)
DigitalShapesCSG & operator=(const DigitalShapesCSG &other)
std::vector< std::pair< e_operator, CountedConstPtrOrConstPtr< ShapeB > > > v_shapes
Vector of all operations (ordered) of ShapeB.
CountedConstPtrOrConstPtr< ShapeA > myShapeA
Base Shape.
void selfDisplay(std::ostream &out) const
Point getLowerBound() const
DigitalShapesCSG(ConstAlias< ShapeA > a)
Point myUpperBound
Domain upper bound.
BOOST_CONCEPT_ASSERT((concepts::CDigitalOrientedShape< ShapeA >))
Orientation orientation(const Point &p) const
Point myLowerBound
Domain lower bound.
DigitalShapesCSG(const DigitalShapesCSG &other)
void minus(ConstAlias< ShapeB > b)
void intersection(ConstAlias< ShapeB > b)
void setParams(ConstAlias< ShapeA > a)
bool bIsValid
if the CSG is valid.
Point getUpperBound() const
BOOST_CONCEPT_ASSERT((concepts::CDigitalBoundedShape< ShapeA >))
static const Dimension dimension
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::uint32_t Dimension
Aim: designs the concept of bounded shapes in DGtal (shape for which upper and lower bounding bounds ...
Aim: characterizes models of digital oriented shapes. For example, models should provide an orientati...