DGtal  1.3.beta
DGtal/shapes/Shapes.h
1 
17 #pragma once
18 
31 #if defined(Shapes_RECURSES)
32 #error Recursive header files inclusion detected in Shapes.h
33 #else // defined(Shapes_RECURSES)
34 
35 #define Shapes_RECURSES
36 
37 #if !defined Shapes_h
38 
39 #define Shapes_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/kernel/NumberTraits.h"
46 #include "DGtal/kernel/domains/CDomain.h"
47 #include "DGtal/kernel/domains/HyperRectDomain.h"
48 #include "DGtal/topology/KhalimskySpaceND.h"
49 #include "DGtal/topology/SurfelAdjacency.h"
50 #include "DGtal/topology/helpers/Surfaces.h"
51 #include "DGtal/shapes/CDigitalOrientedShape.h"
52 #include "DGtal/shapes/CDigitalBoundedShape.h"
53 #include "DGtal/shapes/CEuclideanOrientedShape.h"
54 #include "DGtal/shapes/CEuclideanBoundedShape.h"
55 #include "DGtal/shapes/GaussDigitizer.h"
57 
58 namespace DGtal
59 {
60 
62  // template class Shapes
70  template <typename TDomain>
71  class Shapes
72  {
73  // Concept checks
75 
76  // ----------------------- public types ------------------------------
77  public:
78  typedef TDomain Domain;
79  typedef typename Domain::Space Space;
81  typedef typename Domain::Point Point;
82  typedef typename Domain::Vector Vector;
83  typedef typename Domain::Predicate Predicate;
85  //Arithmetic
86  typedef typename Space::Integer Integer;
88 
89  // ----------------------- Static services ------------------------------
90  public:
91 
104  template <typename TDigitalSet, typename TShapeFunctor>
105  static void digitalShaper( TDigitalSet & aSet,
106  const TShapeFunctor & aFunctor);
107 
123  template <typename TDigitalSet, typename TShapeFunctor>
124  static void euclideanShaper( TDigitalSet & aSet,
125  const TShapeFunctor & aFunctor,
126  const double h = 1.0);
127 
141  template < typename DigitalSet, typename PointPredicate >
142  static
143  void makeSetFromPointPredicate( DigitalSet & aSet,
144  const PointPredicate & aPP );
145 
146 
157  template<typename TDigitalSet>
158  static void addNorm1Ball( TDigitalSet & aSet,
159  const Point & aCenter,
160  UnsignedInteger aRadius );
161 
172  template <typename TDigitalSet>
173  static void addNorm2Ball( TDigitalSet & aSet,
174  const Point & aCenter,
175  UnsignedInteger aRadius );
176 
186  template <typename TDigitalSet>
187  static void removeNorm1Ball( TDigitalSet & aSet,
188  const Point & aCenter,
189  UnsignedInteger aRadius );
190 
200  template <typename TDigitalSet>
201  static void removeNorm2Ball( TDigitalSet & aSet,
202  const Point & aCenter,
203  UnsignedInteger aRadius );
204 
205 
206  // ----------------------- Standard services ------------------------------
207  public:
208 
212  ~Shapes();
213 
214  // ----------------------- Interface --------------------------------------
215  public:
216 
221  void selfDisplay ( std::ostream & out ) const;
222 
227  bool isValid() const;
228 
229  // ------------------------- Protected Datas ------------------------------
230  private:
231  // ------------------------- Private Datas --------------------------------
232  private:
233 
234  // ------------------------- Hidden services ------------------------------
235  protected:
236 
241  Shapes();
242 
243  private:
244 
250  Shapes ( const Shapes & other );
251 
258  Shapes & operator= ( const Shapes & other );
259 
260  // ------------------------- Internals ------------------------------------
261  private:
262 
263  }; // end of class Shapes
264 
265 
272  template <typename TDomain>
273  std::ostream&
274  operator<< ( std::ostream & out, const Shapes<TDomain> & object );
275 
276 } // namespace DGtal
277 
278 
280 // Includes inline functions.
281 #include "DGtal/shapes/Shapes.ih"
282 
283 // //
285 
286 #endif // !defined Shapes_h
287 
288 #undef Shapes_RECURSES
289 #endif // else defined(Shapes_RECURSES)
DGtal::HyperRectDomain< Space >::Space
Space Space
Definition: HyperRectDomain.h:110
DGtal::Shapes::Space
Domain::Space Space
Definition: DGtal/shapes/Shapes.h:79
DGtal::Shapes::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::Shapes::makeSetFromPointPredicate
static void makeSetFromPointPredicate(DigitalSet &aSet, const PointPredicate &aPP)
DGtal::Shapes::~Shapes
~Shapes()
DGtal::Shapes::Shapes
Shapes()
DGtal::functors::IsWithinPointPredicate< Point >
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::Shapes::Predicate
Domain::Predicate Predicate
Definition: DGtal/shapes/Shapes.h:83
DGtal::Shapes::removeNorm2Ball
static void removeNorm2Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
DGtal::concepts::CDomain
Aim: This concept represents a digital domain, i.e. a non mutable subset of points of the given digit...
Definition: CDomain.h:129
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::Shapes::Point
Domain::Point Point
Definition: DGtal/shapes/Shapes.h:81
DGtal::Shapes::RealPoint
Domain::Space::RealPoint RealPoint
Definition: DGtal/shapes/Shapes.h:80
DGtal::Shapes::isValid
bool isValid() const
DGtal::Shapes::UnsignedInteger
Space::UnsignedInteger UnsignedInteger
Definition: DGtal/shapes/Shapes.h:87
DGtal::Shapes::digitalShaper
static void digitalShaper(TDigitalSet &aSet, const TShapeFunctor &aFunctor)
DGtal::SpaceND::UnsignedInteger
NumberTraits< Integer >::UnsignedVersion UnsignedInteger
Unsigned version of the Integers.
Definition: SpaceND.h:104
DGtal::Shapes::addNorm1Ball
static void addNorm1Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
DGtal::Shapes
Aim: A utility class for constructing different shapes (balls, diamonds, and others).
Definition: DGtal/shapes/Shapes.h:71
DGtal::HyperRectDomain_Iterator
Iterator for HyperRectDomain.
Definition: HyperRectDomain_Iterator.h:142
DGtal::Shapes::Vector
Domain::Vector Vector
Definition: DGtal/shapes/Shapes.h:82
DGtal::Shapes::ConstIterator
Domain::ConstIterator ConstIterator
Definition: DGtal/shapes/Shapes.h:84
DGtal::PointVector< dim, Integer >
DGtal::Shapes::Integer
Space::Integer Integer
Definition: DGtal/shapes/Shapes.h:86
DGtal::Shapes::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CDomain< TDomain >))
DGtal::Shapes::removeNorm1Ball
static void removeNorm1Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
DGtal::Shapes::Domain
TDomain Domain
Definition: DGtal/shapes/Shapes.h:78
DGtal::Shapes::addNorm2Ball
static void addNorm2Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
DGtal::Shapes::operator=
Shapes & operator=(const Shapes &other)
RealPoint
Z2i::RealPoint RealPoint
Definition: testAstroid2D.cpp:46
DGtal::Shapes::euclideanShaper
static void euclideanShaper(TDigitalSet &aSet, const TShapeFunctor &aFunctor, const double h=1.0)
DGtal::SpaceND::Integer
TInteger Integer
Arithmetic ring induced by (+,-,*) and Integer numbers.
Definition: SpaceND.h:102