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;
353template <
typename ShapeA,
typename ShapeB>
363 typedef typename ShapeA::Space
Space;
364 typedef typename ShapeA::Point
Point;
380 for (
unsigned int i = 0; i <
myLowerBound.size(); ++i )
382 myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
383 myUpperBound[ i ] = std::max( shapeAUpperBoundary[ i ], shapeBUpperBoundary[ i ] );
491template <
typename ShapeA,
typename ShapeB>
501 typedef typename ShapeA::Space
Space;
502 typedef typename ShapeA::Point
Point;
518 for (
unsigned int i = 0; i <
myLowerBound.size(); ++i )
520 myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
521 myUpperBound[ i ] = std::max( shapeAUpperBoundary[ i ], shapeBUpperBoundary[ i ] );
635template <
typename ShapeA,
typename ShapeB>
645 typedef typename ShapeA::Space
Space;
646 typedef typename ShapeA::Point
Point;
662 for (
unsigned int i = 0; i <
myLowerBound.size(); ++i )
664 myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
665 myUpperBound[ i ] = std::max( shapeAUpperBoundary[ i ], shapeBUpperBoundary[ i ] );
768 template <
typename ShapeA,
typename ShapeB>
772 template <
typename ShapeA,
typename ShapeB>
776 template <
typename ShapeA,
typename ShapeB>
786#undef DigitalShapesDecorator_RECURSES
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Aim: Constructive Solid Geometry (CSG) between models of CDigitalBoundedShape and CDigitalOrientedSha...
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
static constants to store the dimension.
Aim: Intersection between two models of CDigitalBoundedShape and CDigitalOrientedShape.
BOOST_CONCEPT_ASSERT((concepts::CDigitalOrientedShape< ShapeA >))
DigitalShapesIntersection(const DigitalShapesIntersection &other)
Orientation orientation(const Point &p) const
void selfDisplay(std::ostream &out) const
BOOST_CONCEPT_ASSERT((concepts::CDigitalBoundedShape< ShapeA >))
DigitalShapesIntersection()
DigitalShapesIntersection(ConstAlias< ShapeA > a, ConstAlias< ShapeB > b)
Point getLowerBound() const
BOOST_CONCEPT_ASSERT((concepts::CDigitalBoundedShape< ShapeB >))
Point getUpperBound() const
BOOST_CONCEPT_ASSERT((concepts::CDigitalOrientedShape< ShapeB >))
DigitalShapesIntersection & operator=(const DigitalShapesIntersection &other)
~DigitalShapesIntersection()
Aim: Minus between two models of CDigitalBoundedShape and CDigitalOrientedShape.
BOOST_CONCEPT_ASSERT((concepts::CDigitalBoundedShape< ShapeA >))
void selfDisplay(std::ostream &out) const
BOOST_CONCEPT_ASSERT((concepts::CDigitalOrientedShape< ShapeA >))
Point getLowerBound() const
Point getUpperBound() const
DigitalShapesMinus & operator=(const DigitalShapesMinus &other)
DigitalShapesMinus(ConstAlias< ShapeA > a, ConstAlias< ShapeB > b)
BOOST_CONCEPT_ASSERT((concepts::CDigitalBoundedShape< ShapeB >))
BOOST_CONCEPT_ASSERT((concepts::CDigitalOrientedShape< ShapeB >))
DigitalShapesMinus(const DigitalShapesMinus &other)
Orientation orientation(const Point &p) const
Aim: Union between two models of CDigitalBoundedShape and CDigitalOrientedShape.
DigitalShapesUnion & operator=(const DigitalShapesUnion &other)
void selfDisplay(std::ostream &out) const
BOOST_CONCEPT_ASSERT((concepts::CDigitalBoundedShape< ShapeA >))
BOOST_CONCEPT_ASSERT((concepts::CDigitalBoundedShape< ShapeB >))
BOOST_CONCEPT_ASSERT((concepts::CDigitalOrientedShape< ShapeA >))
DigitalShapesUnion(const DigitalShapesUnion &other)
Orientation orientation(const Point &p) const
Point getUpperBound() const
BOOST_CONCEPT_ASSERT((concepts::CDigitalOrientedShape< ShapeB >))
Point getLowerBound() const
DigitalShapesUnion(ConstAlias< ShapeA > a, ConstAlias< ShapeB > b)
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
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...