DGtal 1.4.0
Loading...
Searching...
No Matches
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)
35#define SetOfSurfels_RECURSES
36
37#if !defined SetOfSurfels_h
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
53namespace 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
111
115 const Surfel & current() 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
191
198 SetOfSurfels ( const SetOfSurfels & other );
199
213 const Adjacency & adj,
214 SurfelSet aSetOfSurfels = SurfelSet() );
215
216 // Mutator to set of surfels.
218 // Accessor to set of surfels.
219 const SurfelSet & surfelSet() const;
220
222 const Adjacency & surfelAdjacency() const;
227
228 // --------- CDigitalSurfaceContainer realization -------------------------
229 public:
230
232 const KSpace & space() const;
237 bool isInside( const Surfel & s ) const;
238
242
246
250
253 bool empty() const;
254
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:
295
296 // ------------------------- Hidden services ------------------------------
297 protected:
298
299 private:
300
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)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition ConstAlias.h:187
NumberTraits< Integer >::UnsignedVersion Size
Type used to represent sizes in the digital space.
std::set< Cell > CellSet
Preferred type for defining a set of Cell(s).
std::set< SCell > SCellSet
Preferred type for defining a set of SCell(s).
SurfelNeighborhood< KSpace > Neighborhood
const DigitalSurfaceContainer & surface() const
Tracker(const Tracker &other)
Dimension orthDir() const
uint8_t adjacent(Surfel &s, Dimension d, bool pos) const
Tracker(ConstAlias< DigitalSurfaceContainer > aSurface, const Surfel &s)
const DigitalSurfaceContainer & mySurface
SetOfSurfels< TKSpace, TSurfelSet > DigitalSurfaceContainer
void move(const Surfel &s)
const Surfel & current() const
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as connected surfels....
KSpace::SCellSet SCellSet
functors::SurfelSetPredicate< SurfelSet, Surfel > SurfelPredicate
KSpace::Space Space
SurfelConstIterator begin() const
Adjacency & surfelAdjacency()
mutator to surfel adjacency.
KSpace::Size Size
Type for sizes (unsigned integral type).
DigitalSurfaceTracker * newTracker(const Surfel &s) const
SurfelConstIterator end() const
bool empty() const
const SurfelSet & surfelSet() const
KSpace::Point Point
Tracker DigitalSurfaceTracker
SurfelSet mySurfelSet
the set of surfels
KSpace::SCell SCell
KSpace::CellSet CellSet
SurfelSet & surfelSet()
bool isValid() const
Adjacency mySurfelAdjacency
the surfel adjacency used to determine neighbors.
SetOfSurfels(const SetOfSurfels &other)
TKSpace KSpace
Model of cellular grid space.
KSpace::SCell Surfel
Type for surfels.
SetOfSurfels< TKSpace, TSurfelSet > Self
const SurfelPredicate & surfelPredicate() const
accessor to surfel predicate.
SurfelSet::const_iterator SurfelConstIterator
SurfelPredicate mySurfelPredicate
the surfel predicate defining the shape (related to mySurfelSet).
SurfelAdjacency< KSpace::dimension > Adjacency
const KSpace & myKSpace
a reference to the cellular space.
const KSpace & space() const
Connectedness connectedness() const
Size nbSurfels() const
SetOfSurfels(ConstAlias< KSpace > aKSpace, const Adjacency &adj, SurfelSet aSetOfSurfels=SurfelSet())
void selfDisplay(std::ostream &out) const
bool isInside(const Surfel &s) const
const Adjacency & surfelAdjacency() const
accessor to surfel adjacency.
SetOfSurfels & operator=(const SetOfSurfels &other)
Aim: Represent adjacencies between surfel elements, telling if it follows an interior to exterior ord...
Aim: This helper class is useful to compute the neighboring surfels of a given surfel,...
DGtal is the top-level namespace which contains all DGtal functions and types.
boost::uint8_t uint8_t
unsigned 8-bit integer.
Definition BasicTypes.h:59
Connectedness
Definition Topology.h:51
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::uint32_t Dimension
Definition Common.h:136
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Aim: The predicate returning true iff the point is in the domain given at construction.