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>
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 );
167 for(
Dimension i =0; i < Space::dimension; ++i)
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 );
191 for(
Dimension i=0; i < Space::dimension; ++i)
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>
378 for (
unsigned int i = 0; i <
myLowerBound.size(); ++i )
380 myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
488 template <
typename ShapeA,
typename ShapeB>
515 for (
unsigned int i = 0; i <
myLowerBound.size(); ++i )
517 myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ i ] );
632 template <
typename ShapeA,
typename ShapeB>
659 for (
unsigned int i = 0; i <
myLowerBound.size(); ++i )
661 myLowerBound[ i ] = std::min( shapeALowerBoundary[ i ], shapeBLowerBoundary[ 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)
ShapeA::RealPoint RealPoint
BOOST_CONCEPT_ASSERT((concepts::CEuclideanBoundedShape< ShapeA >))
RealPoint getUpperBound() const
CountedConstPtrOrConstPtr< ShapeA > myShapeA
Base Shape.
EuclideanShapesCSG & operator=(const EuclideanShapesCSG &other)
EuclideanShapesCSG(const EuclideanShapesCSG &other)
void minus(ConstAlias< ShapeB > b)
Aim: Intersection between two models of CEuclideanBoundedShape and CEuclideanOrientedShape.
BOOST_CONCEPT_ASSERT((concepts::CEuclideanOrientedShape< ShapeA >))
EuclideanShapesIntersection & operator=(const EuclideanShapesIntersection &other)
Orientation orientation(const RealPoint &p) const
EuclideanShapesIntersection(ConstAlias< ShapeA > a, ConstAlias< ShapeB > b)
ShapeA::RealPoint RealPoint
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(ConstAlias< ShapeA > a, ConstAlias< ShapeB > b)
ShapeA::RealPoint RealPoint
BOOST_CONCEPT_ASSERT((concepts::CEuclideanOrientedShape< ShapeB >))
BOOST_CONCEPT_ASSERT((concepts::CEuclideanBoundedShape< ShapeA >))
EuclideanShapesMinus & operator=(const EuclideanShapesMinus &other)
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 ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::uint32_t Dimension
Aim: characterizes models of digital oriented shapes. For example, models should provide an orientati...
PointVector< 3, double > RealPoint