DGtal  0.9.2
DigitalSetDomain.h
1 
17 #pragma once
18 
31 #if defined(DigitalSetDomain_RECURSES)
32 #error Recursive header files inclusion detected in DigitalSetDomain.h
33 #else // defined(DigitalSetDomain_RECURSES)
34 
35 #define DigitalSetDomain_RECURSES
36 
37 #if !defined DigitalSetDomain_h
38 
39 #define DigitalSetDomain_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/ConstAlias.h"
46 #include "DGtal/kernel/NumberTraits.h"
48 
49 namespace DGtal
50 {
51 
53  // template class DigitalSetDomain
58  template <typename TDigitalSet>
60  {
61  // ----------------------- associated types -------------------------------
62  public:
63  typedef TDigitalSet DigitalSet;
64  typedef typename DigitalSet::Domain Domain;
65  typedef typename Domain::Space Space;
66  typedef typename Domain::Integer Integer;
68  typedef typename Domain::Point Point;
69  typedef typename Domain::Vector Vector;
70  typedef typename Domain::Size Size;
71  typedef typename Domain::Dimension Dimension;
72  typedef typename DigitalSet::ConstIterator ConstIterator;
73  typedef DigitalSet Predicate; // since 0.6, DigitalSet are PointPredicate
74 
75  // ----------------------- Standard services ------------------------------
76  public:
77 
82 
88 
89 
94  DigitalSetDomain ( const DigitalSetDomain & other );
95 
96  // ----------------------- Domain services --------------------------------
97  public:
98 
103  ConstIterator begin(const Point &aPoint) const;
104 
108  ConstIterator begin() const;
109 
113  ConstIterator end() const;
114 
119  const Point &lowerBound() const;
120 
125  const Point &upperBound() const ;
126 
131  Size size() const ;
132 
137  bool isInside( const Point & p ) const;
138 
142  const Predicate & predicate() const;
143 
144 
145  // ----------------------- Interface --------------------------------------
146  public:
147 
152  void selfDisplay ( std::ostream & out ) const;
153 
158  bool isValid() const;
159 
160  // ------------------------- Protected Datas ------------------------------
161  private:
162  // ------------------------- Private Datas --------------------------------
163  private:
164 
168  const DigitalSet* mySet;
169 
174 
179 
180  // ------------------------- Hidden services ------------------------------
181  protected:
182 
188 
189  private:
190 
197  DigitalSetDomain & operator= ( const DigitalSetDomain & other );
198 
199  // ------------------------- Internals ------------------------------------
200  private:
201 
202 
203  }; // end of class DigitalSetDomain
204 
205 
212  template <typename T>
213  std::ostream&
214  operator<< ( std::ostream & out, const DigitalSetDomain<T> & object );
215 
216 } // namespace DGtal
217 
218 
220 // Includes inline functions.
221 #include "DGtal/kernel/sets/DigitalSetDomain.ih"
222 
223 // //
225 
226 #endif // !defined DigitalSetDomain_h
227 
228 #undef DigitalSetDomain_RECURSES
229 #endif // else defined(DigitalSetDomain_RECURSES)
DigitalSet::ConstIterator ConstIterator
ConstIterator begin() const
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:186
const Point & lowerBound() const
DigitalSetDomain & operator=(const DigitalSetDomain &other)
void selfDisplay(std::ostream &out) const
NumberTraits< Integer >::IsBounded IsBounded
ConstIterator end() const
Domain::Dimension Dimension
const Predicate & predicate() const
Aim: The traits class for all models of Cinteger.
Definition: NumberTraits.h:69
const DigitalSet * mySet
Aim: Constructs a domain limited to the given digital set.
DGtal is the top-level namespace which contains all DGtal functions and types.
bool isInside(const Point &p) const
const Point & upperBound() const
DigitalSet::Domain Domain