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>
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 );
168 for(
Dimension i =0; i < Space::dimension; ++i)
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 );
192 for(
Dimension i=0; i < Space::dimension; ++i)
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>
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)
std::vector< std::pair< e_operator, CountedConstPtrOrConstPtr< ShapeB > > > v_shapes
Vector of all operations (ordered) of ShapeB.
CountedConstPtrOrConstPtr< ShapeA > myShapeA
Base Shape.
DigitalShapesCSG & operator=(const DigitalShapesCSG &other)
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 >))
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
DigitalShapesIntersection & operator=(const DigitalShapesIntersection &other)
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()
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(ConstAlias< ShapeA > a, ConstAlias< ShapeB > b)
BOOST_CONCEPT_ASSERT((concepts::CDigitalBoundedShape< ShapeB >))
DigitalShapesMinus & operator=(const DigitalShapesMinus &other)
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.
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)
DigitalShapesUnion & operator=(const DigitalShapesUnion &other)
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &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...