30#if defined(EuclideanShapesDecorator_RECURSES)
31#error Recursive header files inclusion detected in EuclideanShapesDecorator.h
34#define EuclideanShapesDecorator_RECURSES
36#if !defined EuclideanShapesDecorator_h
38#define EuclideanShapesDecorator_h
43#include "DGtal/base/Common.h"
44#include "DGtal/base/ConstAlias.h"
46#include "DGtal/shapes/CEuclideanBoundedShape.h"
47#include "DGtal/shapes/CEuclideanOrientedShape.h"
66 template <
typename ShapeA,
typename ShapeB>
81 typedef typename ShapeA::Space
Space;
163 FATAL_ERROR_MSG(
isValid(),
"Operation invalid. Maybe you don't set a ShapeA object." );
165 std::pair<e_operator, CountedConstPtrOrConstPtr< ShapeB > > shape(
e_plus, b );
187 FATAL_ERROR_MSG(
isValid(),
"Operation invalid. Maybe you don't set a ShapeA object." );
189 std::pair<e_operator, CountedConstPtrOrConstPtr< ShapeB > > shape(
e_intersection, b );
211 FATAL_ERROR_MSG(
isValid(),
"Operation invalid. Maybe you don't set a ShapeA object." );
213 std::pair<e_operator, CountedConstPtrOrConstPtr< ShapeB > > shape(
e_minus, b );
224 FATAL_ERROR_MSG(
isValid(),
"Operation invalid. Maybe you don't set a ShapeA object." );
235 FATAL_ERROR_MSG(
isValid(),
"Operation invalid. Maybe you don't set a ShapeA object." );
250 FATAL_ERROR_MSG(
isValid(),
"Operation invalid. Maybe you don't set a ShapeA object." );
254 for(
unsigned int i = 0; i <
v_shapes.size(); ++i)
269 else if ((
v_shapes[i].second->orientation( p ) ==
ON ) && ( orient !=
OUTSIDE ))
288 else if (( orient ==
ON ) || (
v_shapes[i].second->orientation( p ) ==
ON ))
326 std::vector< std::pair<e_operator, CountedConstPtrOrConstPtr< ShapeB > > >
v_shapes;
351 template <
typename ShapeA,
typename ShapeB>
361 typedef typename ShapeA::Space
Space;
378 for (
unsigned int i = 0; i <
myLowerBound.size(); ++i )
380 myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
381 myUpperBound[ i ] = std::max( shapeAUpperBoundary[ i ], shapeBUpperBoundary[ i ] );
488 template <
typename ShapeA,
typename ShapeB>
498 typedef typename ShapeA::Space
Space;
515 for (
unsigned int i = 0; i <
myLowerBound.size(); ++i )
517 myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
518 myUpperBound[ i ] = std::max( shapeAUpperBoundary[ i ], shapeBUpperBoundary[ i ] );
632 template <
typename ShapeA,
typename ShapeB>
642 typedef typename ShapeA::Space
Space;
659 for (
unsigned int i = 0; i <
myLowerBound.size(); ++i )
661 myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
662 myUpperBound[ i ] = std::max( shapeAUpperBoundary[ i ], shapeBUpperBoundary[ i ] );
767 template <
typename ShapeA,
typename ShapeB>
771 template <
typename ShapeA,
typename ShapeB>
775 template <
typename ShapeA,
typename ShapeB>
787#undef EuclideanShapesDecorator_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 CEuclideanBoundedShape and CEuclideanOriente...
std::vector< std::pair< e_operator, CountedConstPtrOrConstPtr< ShapeB > > > v_shapes
Vector of all operations (ordered) of ShapeB.
bool bIsValid
if the CSG is valid.
void selfDisplay(std::ostream &out) const
Orientation orientation(const RealPoint &p) const
void intersection(ConstAlias< ShapeB > b)
BOOST_CONCEPT_ASSERT((concepts::CEuclideanOrientedShape< ShapeA >))
EuclideanShapesCSG(ConstAlias< ShapeA > a)
void setParams(ConstAlias< ShapeA > a)
RealPoint getLowerBound() const
RealPoint myLowerBound
Domain lower bound.
RealPoint myUpperBound
Domain upper bound.
void plus(ConstAlias< ShapeB > b)
EuclideanShapesCSG & operator=(const EuclideanShapesCSG &other)
ShapeA::RealPoint RealPoint
BOOST_CONCEPT_ASSERT((concepts::CEuclideanBoundedShape< ShapeA >))
RealPoint getUpperBound() const
CountedConstPtrOrConstPtr< ShapeA > myShapeA
Base Shape.
EuclideanShapesCSG(const EuclideanShapesCSG &other)
void minus(ConstAlias< ShapeB > b)
static const Dimension dimension
static constants to store the dimension.
Aim: Intersection between two models of CEuclideanBoundedShape and CEuclideanOrientedShape.
BOOST_CONCEPT_ASSERT((concepts::CEuclideanOrientedShape< ShapeA >))
Orientation orientation(const RealPoint &p) const
EuclideanShapesIntersection(ConstAlias< ShapeA > a, ConstAlias< ShapeB > b)
ShapeA::RealPoint RealPoint
EuclideanShapesIntersection & operator=(const EuclideanShapesIntersection &other)
BOOST_CONCEPT_ASSERT((concepts::CEuclideanOrientedShape< ShapeB >))
~EuclideanShapesIntersection()
RealPoint getUpperBound() const
BOOST_CONCEPT_ASSERT((concepts::CEuclideanBoundedShape< ShapeB >))
BOOST_CONCEPT_ASSERT((concepts::CEuclideanBoundedShape< ShapeA >))
RealPoint getLowerBound() const
void selfDisplay(std::ostream &out) const
EuclideanShapesIntersection(const EuclideanShapesIntersection &other)
EuclideanShapesIntersection()
Aim: Minus between two models of CEuclideanBoundedShape and CEuclideanOrientedShape.
RealPoint getLowerBound() const
EuclideanShapesMinus & operator=(const EuclideanShapesMinus &other)
EuclideanShapesMinus(ConstAlias< ShapeA > a, ConstAlias< ShapeB > b)
ShapeA::RealPoint RealPoint
BOOST_CONCEPT_ASSERT((concepts::CEuclideanOrientedShape< ShapeB >))
BOOST_CONCEPT_ASSERT((concepts::CEuclideanBoundedShape< ShapeA >))
void selfDisplay(std::ostream &out) const
Orientation orientation(const RealPoint &p) const
BOOST_CONCEPT_ASSERT((concepts::CEuclideanOrientedShape< ShapeA >))
BOOST_CONCEPT_ASSERT((concepts::CEuclideanBoundedShape< ShapeB >))
EuclideanShapesMinus(const EuclideanShapesMinus &other)
RealPoint getUpperBound() const
Aim: Union between two models of CEuclideanBoundedShape and CEuclideanOrientedShape.
RealPoint getLowerBound() const
EuclideanShapesUnion & operator=(const EuclideanShapesUnion &other)
RealPoint getUpperBound() const
EuclideanShapesUnion(ConstAlias< ShapeA > a, ConstAlias< ShapeB > b)
EuclideanShapesUnion(const EuclideanShapesUnion &other)
Orientation orientation(const RealPoint &p) const
ShapeA::RealPoint RealPoint
void selfDisplay(std::ostream &out) const
BOOST_CONCEPT_ASSERT((concepts::CEuclideanOrientedShape< ShapeA >))
BOOST_CONCEPT_ASSERT((concepts::CEuclideanBoundedShape< ShapeB >))
BOOST_CONCEPT_ASSERT((concepts::CEuclideanBoundedShape< ShapeA >))
BOOST_CONCEPT_ASSERT((concepts::CEuclideanOrientedShape< ShapeB >))
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: characterizes models of digital oriented shapes. For example, models should provide an orientati...