DGtal  1.3.beta
SetOfSurfels.h
1 
17 #pragma once
18 
31 #if defined(SetOfSurfels_RECURSES)
32 #error Recursive header files inclusion detected in SetOfSurfels.h
33 #else // defined(SetOfSurfels_RECURSES)
34 
35 #define SetOfSurfels_RECURSES
36 
37 #if !defined SetOfSurfels_h
38 
39 #define SetOfSurfels_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <vector>
45 #include "DGtal/base/Common.h"
46 #include "DGtal/base/ConstAlias.h"
47 #include "DGtal/topology/Topology.h"
48 #include "DGtal/topology/SurfelAdjacency.h"
49 #include "DGtal/topology/SurfelNeighborhood.h"
50 #include "DGtal/topology/SurfelSetPredicate.h"
52 
53 namespace DGtal
54 {
55 
57  // template class SetOfSurfels
71  template < typename TKSpace,
72  typename TSurfelSet = typename TKSpace::SurfelSet >
74  {
75  public:
76 
80  class Tracker
81  {
82  public:
83  // -------------------- associated types --------------------
84  typedef Tracker Self;
86  typedef typename TKSpace::SCell Surfel;
87 
88  // -------------------- inner types --------------------
89  typedef TKSpace KSpace;
91 
92  public:
99  const Surfel & s );
100 
105  Tracker( const Tracker & other );
106 
110  ~Tracker();
111 
113  const DigitalSurfaceContainer & surface() const;
115  const Surfel & current() const;
117  Dimension orthDir() const;
118 
124  void move( const Surfel & s );
125 
142  uint8_t adjacent( Surfel & s, Dimension d, bool pos ) const;
143 
144  private:
151 
152  };
153 
154  // ----------------------- associated types ------------------------------
155  public:
158  typedef TKSpace KSpace;
160  typedef typename KSpace::SCell Surfel;
162  typedef typename KSpace::Size Size;
163  // Model of CSurfelSet
164  typedef TSurfelSet SurfelSet;
165 
166  // BOOST_CONCEPT_ASSERT(( CCellularGridSpaceND< KSpace > ));
167  // BOOST_CONCEPT_ASSERT(( CSurfelSet< SurfelSet > ));
168 
169  // -------------------- specific types ------------------------------
170  typedef typename SurfelSet::const_iterator SurfelConstIterator;
171  typedef typename KSpace::Space Space;
172  typedef typename KSpace::Point Point;
174 
175  // ----------------------- other types ------------------------------
176  public:
178  typedef typename KSpace::Cell Cell;
179  typedef typename KSpace::SCell SCell;
180  typedef typename KSpace::CellSet CellSet;
181  typedef typename KSpace::SCellSet SCellSet;
183 
184  // ----------------------- Standard services ------------------------------
185  public:
186 
190  ~SetOfSurfels();
191 
198  SetOfSurfels ( const SetOfSurfels & other );
199 
213  const Adjacency & adj,
214  SurfelSet aSetOfSurfels = SurfelSet() );
215 
216  // Mutator to set of surfels.
217  SurfelSet & surfelSet();
218  // Accessor to set of surfels.
219  const SurfelSet & surfelSet() const;
220 
222  const Adjacency & surfelAdjacency() const;
226  const SurfelPredicate & surfelPredicate() const;
227 
228  // --------- CDigitalSurfaceContainer realization -------------------------
229  public:
230 
232  const KSpace & space() const;
237  bool isInside( const Surfel & s ) const;
238 
241  SurfelConstIterator begin() const;
242 
245  SurfelConstIterator end() const;
246 
249  Size nbSurfels() const;
250 
253  bool empty() const;
254 
260  DigitalSurfaceTracker* newTracker( const Surfel & s ) const;
261 
267 
268  // ----------------------- Interface --------------------------------------
269  public:
270 
275  void selfDisplay ( std::ostream & out ) const;
276 
281  bool isValid() const;
282 
283  // ------------------------- Protected Datas ------------------------------
284  private:
285  // ------------------------- Private Datas --------------------------------
286  private:
288  const KSpace & myKSpace;
295 
296  // ------------------------- Hidden services ------------------------------
297  protected:
298 
299  private:
300 
307  SetOfSurfels & operator= ( const SetOfSurfels & other );
308 
309  // ------------------------- Internals ------------------------------------
310  private:
311 
312  }; // end of class SetOfSurfels
313 
314 
327  template <typename TKSpace, typename TSurfelSet>
328  std::ostream&
329  operator<< ( std::ostream & out,
330  const SetOfSurfels<TKSpace, TSurfelSet> & object );
331 
332 } // namespace DGtal
333 
334 
336 // Includes inline functions.
337 #include "DGtal/topology/SetOfSurfels.ih"
338 
339 // //
341 
342 #endif // !defined SetOfSurfels_h
343 
344 #undef SetOfSurfels_RECURSES
345 #endif // else defined(SetOfSurfels_RECURSES)
DGtal::SetOfSurfels::begin
SurfelConstIterator begin() const
DGtal::SetOfSurfels::nbSurfels
Size nbSurfels() const
DGtal::SetOfSurfels::Tracker::Neighborhood
SurfelNeighborhood< KSpace > Neighborhood
Definition: SetOfSurfels.h:90
DGtal::SetOfSurfels::SCellSet
KSpace::SCellSet SCellSet
Definition: SetOfSurfels.h:181
DGtal::ConstAlias
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:186
DGtal::SurfelNeighborhood< KSpace >
DGtal::SetOfSurfels::empty
bool empty() const
DGtal::SetOfSurfels::Adjacency
SurfelAdjacency< KSpace::dimension > Adjacency
Definition: SetOfSurfels.h:177
DGtal::SetOfSurfels::Point
KSpace::Point Point
Definition: SetOfSurfels.h:172
DGtal::SetOfSurfels::Self
SetOfSurfels< TKSpace, TSurfelSet > Self
Definition: SetOfSurfels.h:156
DGtal::SurfelAdjacency< KSpace::dimension >
DGtal::SetOfSurfels::Tracker::move
void move(const Surfel &s)
DGtal::SetOfSurfels::mySurfelSet
SurfelSet mySurfelSet
the set of surfels
Definition: SetOfSurfels.h:290
DGtal::SetOfSurfels::mySurfelAdjacency
Adjacency mySurfelAdjacency
the surfel adjacency used to determine neighbors.
Definition: SetOfSurfels.h:294
DGtal::Dimension
DGtal::uint32_t Dimension
Definition: Common.h:137
DGtal::SetOfSurfels::Tracker::surface
const DigitalSurfaceContainer & surface() const
DGtal::SetOfSurfels::Tracker::~Tracker
~Tracker()
DGtal::SetOfSurfels::DigitalSurfaceTracker
Tracker DigitalSurfaceTracker
Definition: SetOfSurfels.h:173
SCell
Z3i::SCell SCell
Definition: fullConvexityShortestPaths3D.cpp:83
DGtal::SetOfSurfels::Tracker::mySurface
const DigitalSurfaceContainer & mySurface
Definition: SetOfSurfels.h:147
DGtal::SetOfSurfels::SetOfSurfels
SetOfSurfels(const SetOfSurfels &other)
DGtal::SetOfSurfels::Tracker::Self
Tracker Self
Definition: SetOfSurfels.h:84
DGtal::SignedKhalimskyCell
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Definition: KhalimskySpaceND.h:208
DGtal::SetOfSurfels::surfelAdjacency
const Adjacency & surfelAdjacency() const
accessor to surfel adjacency.
DGtal::Connectedness
Connectedness
Definition: Topology.h:50
DGtal::SetOfSurfels::Tracker::myNeighborhood
Neighborhood myNeighborhood
Definition: SetOfSurfels.h:150
DGtal::SetOfSurfels::mySurfelPredicate
SurfelPredicate mySurfelPredicate
the surfel predicate defining the shape (related to mySurfelSet).
Definition: SetOfSurfels.h:292
DGtal::SetOfSurfels::Tracker::DigitalSurfaceContainer
SetOfSurfels< TKSpace, TSurfelSet > DigitalSurfaceContainer
Definition: SetOfSurfels.h:85
DGtal::SetOfSurfels::Tracker::Surfel
TKSpace::SCell Surfel
Definition: SetOfSurfels.h:86
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::SetOfSurfels::myKSpace
const KSpace & myKSpace
a reference to the cellular space.
Definition: SetOfSurfels.h:288
DGtal::SetOfSurfels::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::KhalimskySpaceND::SCellSet
std::set< SCell > SCellSet
Preferred type for defining a set of SCell(s).
Definition: KhalimskySpaceND.h:447
DGtal::SpaceND
Definition: SpaceND.h:95
DGtal::SetOfSurfels::Surfel
KSpace::SCell Surfel
Type for surfels.
Definition: SetOfSurfels.h:160
DGtal::KhalimskySpaceND::CellSet
std::set< Cell > CellSet
Preferred type for defining a set of Cell(s).
Definition: KhalimskySpaceND.h:444
DGtal::SetOfSurfels::KSpace
TKSpace KSpace
Model of cellular grid space.
Definition: SetOfSurfels.h:158
DGtal::SetOfSurfels::connectedness
Connectedness connectedness() const
DGtal::SetOfSurfels::end
SurfelConstIterator end() const
DGtal::functors::SurfelSetPredicate< SurfelSet, Surfel >
DGtal::KhalimskySpaceND::Size
NumberTraits< Integer >::UnsignedVersion Size
Type used to represent sizes in the digital space.
Definition: KhalimskySpaceND.h:407
DGtal::SetOfSurfels::isInside
bool isInside(const Surfel &s) const
DGtal::SetOfSurfels::Tracker::Tracker
Tracker(ConstAlias< DigitalSurfaceContainer > aSurface, const Surfel &s)
DGtal::SetOfSurfels::Space
KSpace::Space Space
Definition: SetOfSurfels.h:171
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::SetOfSurfels::SCell
KSpace::SCell SCell
Definition: SetOfSurfels.h:179
DGtal::SetOfSurfels::CellSet
KSpace::CellSet CellSet
Definition: SetOfSurfels.h:180
DGtal::SetOfSurfels::SurfelPredicate
functors::SurfelSetPredicate< SurfelSet, Surfel > SurfelPredicate
Definition: SetOfSurfels.h:182
DGtal::SetOfSurfels::Tracker::current
const Surfel & current() const
DGtal::SetOfSurfels::Tracker::adjacent
uint8_t adjacent(Surfel &s, Dimension d, bool pos) const
DGtal::SetOfSurfels::Tracker::orthDir
Dimension orthDir() const
DGtal::SetOfSurfels::Tracker
Definition: SetOfSurfels.h:80
DGtal::SetOfSurfels::Size
KSpace::Size Size
Type for sizes (unsigned integral type).
Definition: SetOfSurfels.h:162
DGtal::SetOfSurfels::isValid
bool isValid() const
DGtal::SetOfSurfels::surfelPredicate
const SurfelPredicate & surfelPredicate() const
accessor to surfel predicate.
DGtal::SetOfSurfels::Cell
KSpace::Cell Cell
Definition: SetOfSurfels.h:178
DGtal::SetOfSurfels::newTracker
DigitalSurfaceTracker * newTracker(const Surfel &s) const
DGtal::SetOfSurfels::operator=
SetOfSurfels & operator=(const SetOfSurfels &other)
DGtal::PointVector< dim, Integer >
DGtal::SetOfSurfels::Tracker::KSpace
TKSpace KSpace
Definition: SetOfSurfels.h:89
DGtal::SetOfSurfels::SurfelSet
TSurfelSet SurfelSet
Definition: SetOfSurfels.h:164
DGtal::SetOfSurfels::surfelSet
SurfelSet & surfelSet()
DGtal::SetOfSurfels
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as connected surfels....
Definition: SetOfSurfels.h:73
DGtal::SetOfSurfels::SurfelConstIterator
SurfelSet::const_iterator SurfelConstIterator
Definition: SetOfSurfels.h:170
DGtal::SetOfSurfels::~SetOfSurfels
~SetOfSurfels()
DGtal::SetOfSurfels::space
const KSpace & space() const
DGtal::KhalimskyCell< dim, Integer >
SurfelSet
MyDigitalSurface::SurfelSet SurfelSet
Definition: greedy-plane-segmentation-ex2.cpp:95
DGtal::uint8_t
boost::uint8_t uint8_t
unsigned 8-bit integer.
Definition: BasicTypes.h:59