DGtal  1.1.0
SurfelNeighborhood.h
1 
17 #pragma once
18 
31 #if defined(SurfelNeighborhood_RECURSES)
32 #error Recursive header files inclusion detected in SurfelNeighborhood.h
33 #else // defined(SurfelNeighborhood_RECURSES)
34 
35 #define SurfelNeighborhood_RECURSES
36 
37 #if !defined SurfelNeighborhood_h
38 
39 #define SurfelNeighborhood_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/topology/SurfelAdjacency.h"
47 
48 namespace DGtal
49 {
50 
52  // template class SurfelNeighborhood
67  template <typename TKSpace>
69  {
70  // ----------------------- Types ------------------------------
71  public:
72 
73  typedef TKSpace KSpace;
74  typedef typename KSpace::Point Point;
75  typedef typename KSpace::Cell Cell;
76  typedef typename KSpace::SCell SCell;
77 
78  // ----------------------- Standard services ------------------------------
79  public:
80 
85 
90 
96 
103 
111  void init( const KSpace* space,
113  const SCell & aSurfel );
114 
119  void setSurfel( const SCell & aSurfel );
120 
122  const SCell & surfel() const;
123 
126 
127  //----------------------- spel services -------------------------
128  public:
130  SCell innerSpel() const;
131 
133  SCell outerSpel() const;
134 
145  SCell innerAdjacentSpel( Dimension track_dir, bool pos ) const;
146 
157  SCell outerAdjacentSpel( Dimension track_dir, bool pos ) const;
158 
159  //----------------------- follower services -------------------------
160  public:
169  SCell follower1( Dimension track_dir, bool pos ) const;
170 
179  SCell follower2( Dimension track_dir, bool pos ) const;
180 
189  SCell follower3( Dimension track_dir, bool pos ) const;
190 
191 
192  // ----------------------- Surfel adjacency services --------------------
193  public:
194 
214  template <typename SpelSet>
215  unsigned int getAdjacentOnSpelSet( SCell & adj_surfel,
216  const SpelSet & obj,
217  Dimension track_dir,
218  bool pos ) const;
219 
239  template <typename DigitalSet>
240  unsigned int getAdjacentOnDigitalSet( SCell & adj_surfel,
241  const DigitalSet & obj,
242  Dimension track_dir,
243  bool pos ) const;
244 
270  template <typename PointPredicate>
271  unsigned int getAdjacentOnPointPredicate( SCell & adj_surfel,
272  const PointPredicate & pp,
273  Dimension track_dir,
274  bool pos ) const;
275 
299  template <typename SurfelPredicate>
300  unsigned int getAdjacentOnSurfelPredicate( SCell & adj_surfel,
301  const SurfelPredicate & sp,
302  Dimension track_dir,
303  bool pos ) const;
304 
305  // ----------------------- Interface --------------------------------------
306  public:
307 
312  void selfDisplay ( std::ostream & out ) const;
313 
318  bool isValid() const;
319 
320  // ------------------------- Protected Datas ------------------------------
321  private:
322  // ------------------------- Private Datas --------------------------------
323  private:
324 
326  const KSpace* mySpace;
336 
337  // ------------------------- Hidden services ------------------------------
338  protected:
339 
340 
341  // ------------------------- Internals ------------------------------------
342  private:
343 
344  }; // end of class SurfelNeighborhood
345 
346 
353  template <typename T>
354  std::ostream&
355  operator<< ( std::ostream & out, const SurfelNeighborhood<T> & object );
356 
357 } // namespace DGtal
358 
359 
361 // Includes inline functions.
362 #include "DGtal/topology/SurfelNeighborhood.ih"
363 
364 // //
366 
367 #endif // !defined SurfelNeighborhood_h
368 
369 #undef SurfelNeighborhood_RECURSES
370 #endif // else defined(SurfelNeighborhood_RECURSES)
DGtal::SurfelNeighborhood::innerSpel
SCell innerSpel() const
DGtal::SurfelNeighborhood::SurfelNeighborhood
SurfelNeighborhood(const SurfelNeighborhood &other)
DGtal::SurfelNeighborhood
Aim: This helper class is useful to compute the neighboring surfels of a given surfel,...
Definition: SurfelNeighborhood.h:69
DGtal::SurfelNeighborhood::myOrthDir
Dimension myOrthDir
Definition: SurfelNeighborhood.h:332
DGtal::SurfelNeighborhood::mySurfelAdj
const SurfelAdjacency< KSpace::dimension > * mySurfelAdj
Definition: SurfelNeighborhood.h:328
DGtal::SurfelNeighborhood::getAdjacentOnPointPredicate
unsigned int getAdjacentOnPointPredicate(SCell &adj_surfel, const PointPredicate &pp, Dimension track_dir, bool pos) const
DGtal::SurfelAdjacency< KSpace::dimension >
DGtal::SurfelNeighborhood::Point
KSpace::Point Point
Definition: SurfelNeighborhood.h:74
DGtal::SurfelNeighborhood::outerSpel
SCell outerSpel() const
DGtal::Dimension
DGtal::uint32_t Dimension
Definition: Common.h:133
DGtal::SurfelNeighborhood::SCell
KSpace::SCell SCell
Definition: SurfelNeighborhood.h:76
DGtal::SurfelNeighborhood::orthDir
Dimension orthDir() const
DGtal::SurfelNeighborhood::getAdjacentOnSurfelPredicate
unsigned int getAdjacentOnSurfelPredicate(SCell &adj_surfel, const SurfelPredicate &sp, Dimension track_dir, bool pos) const
DGtal::SurfelNeighborhood::isValid
bool isValid() const
DGtal::SignedKhalimskyCell
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Definition: KhalimskySpaceND.h:209
DGtal::SurfelNeighborhood::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::SurfelNeighborhood::follower2
SCell follower2(Dimension track_dir, bool pos) const
DGtal::SurfelNeighborhood::follower1
SCell follower1(Dimension track_dir, bool pos) const
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::SurfelNeighborhood::mySpace
const KSpace * mySpace
Definition: SurfelNeighborhood.h:326
DGtal::SurfelNeighborhood::mySurfel
SCell mySurfel
Definition: SurfelNeighborhood.h:330
DGtal::SurfelNeighborhood::Cell
KSpace::Cell Cell
Definition: SurfelNeighborhood.h:75
DGtal::SurfelNeighborhood::KSpace
TKSpace KSpace
Definition: SurfelNeighborhood.h:73
DGtal::SurfelNeighborhood::surfel
const SCell & surfel() const
DGtal::SurfelNeighborhood::init
void init(const KSpace *space, const SurfelAdjacency< KSpace::dimension > *adj, const SCell &aSurfel)
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::SurfelNeighborhood::outerAdjacentSpel
SCell outerAdjacentSpel(Dimension track_dir, bool pos) const
DGtal::SurfelNeighborhood::myOrthDirect
bool myOrthDirect
Definition: SurfelNeighborhood.h:335
DGtal::PointVector< dim, Integer >
DGtal::SurfelNeighborhood::operator=
SurfelNeighborhood & operator=(const SurfelNeighborhood &other)
DGtal::SurfelNeighborhood::SurfelNeighborhood
SurfelNeighborhood()
DGtal::SurfelNeighborhood::~SurfelNeighborhood
~SurfelNeighborhood()
DGtal::SurfelNeighborhood::innerAdjacentSpel
SCell innerAdjacentSpel(Dimension track_dir, bool pos) const
DGtal::SurfelNeighborhood::follower3
SCell follower3(Dimension track_dir, bool pos) const
DGtal::SurfelNeighborhood::getAdjacentOnSpelSet
unsigned int getAdjacentOnSpelSet(SCell &adj_surfel, const SpelSet &obj, Dimension track_dir, bool pos) const
DGtal::SurfelNeighborhood::setSurfel
void setSurfel(const SCell &aSurfel)
DGtal::KhalimskyCell< dim, Integer >
DGtal::SurfelNeighborhood::getAdjacentOnDigitalSet
unsigned int getAdjacentOnDigitalSet(SCell &adj_surfel, const DigitalSet &obj, Dimension track_dir, bool pos) const