DGtal  1.0.0
KhalimskyPreSpaceND.h
1 
17 #pragma once
18 
31 #if defined(KhalimskyPreSpaceND_RECURSES)
32 #error Recursive header files inclusion detected in KhalimskyPreSpaceND.h
33 #else // defined(KhalimskyPreSpaceND_RECURSES)
34 
35 #define KhalimskyPreSpaceND_RECURSES
36 
37 #if !defined KhalimskyPreSpaceND_h
38 
39 #define KhalimskyPreSpaceND_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <set>
45 #include <map>
46 #include <DGtal/base/Common.h>
47 #include <DGtal/kernel/CInteger.h>
48 #include <DGtal/kernel/PointVector.h>
49 #include <DGtal/kernel/SpaceND.h>
51 
52 namespace DGtal
53 {
54 
56  // Pre-declaration
57  template <
58  Dimension dim,
59  typename TInteger = DGtal::int32_t
60  >
62 
64 
70  template < Dimension dim,
71  typename TInteger = DGtal::int32_t >
73  {
74 
77 
78  // Aliases
79  public:
80  using Integer = TInteger;
84  using PreCell = Self;
87 
88  // Public members
89  public:
91 
92  // Standard interface
93  public:
94 
96  PreCell const& preCell() const;
97 
99  explicit KhalimskyPreCell( Integer dummy = 0 );
100 
101 
105  KhalimskyPreCell( Point const& aPoint );
106 
110  KhalimskyPreCell( KhalimskyPreCell const& aCell ) = default;
111 
115  KhalimskyPreCell & operator=( KhalimskyPreCell const& aCell ) = default;
116 
120  KhalimskyPreCell( KhalimskyPreCell && aCell ) = default;
121 
125  KhalimskyPreCell & operator=( KhalimskyPreCell && aCell ) = default;
126 
131  bool operator==( const KhalimskyPreCell & other ) const;
132 
137  bool operator!=( const KhalimskyPreCell & other ) const;
138 
143  bool operator<( const KhalimskyPreCell & other ) const;
144 
145  // --------------- CDrawableWithBoard2D realization -------------------
146  public:
147 
152  std::string className() const;
153 
154  }; // KhalimskyPreCell
155 
156  template < Dimension dim,
157  typename TInteger >
158  std::ostream &
159  operator<<( std::ostream & out,
160  const KhalimskyPreCell< dim, TInteger > & object );
161 
168  template < Dimension dim,
169  typename TInteger = DGtal::int32_t >
171  {
172 
173  // Integer must be a model of the concept CInteger.
175 
176  // Aliases
177  public:
178  using Integer = TInteger;
182  using SPreCell = Self;
185 
186  // Public members
187  public:
189  bool positive;
190 
191  // Standard interface
192  public:
193 
195  SPreCell const& preCell() const;
196 
198  explicit SignedKhalimskyPreCell( Integer dummy = 0 );
199 
206 
210  SignedKhalimskyPreCell( SignedKhalimskyPreCell const& aCell ) = default;
211 
215  SignedKhalimskyPreCell & operator=( SignedKhalimskyPreCell const& aCell ) = default;
216 
220  SignedKhalimskyPreCell( SignedKhalimskyPreCell && aCell ) = default;
221 
226 
231  bool operator==( const SignedKhalimskyPreCell & other ) const;
232 
237  bool operator!=( const SignedKhalimskyPreCell & other ) const;
238 
243  bool operator<( const SignedKhalimskyPreCell & other ) const;
244 
245  // --------------- CDrawableWithBoard2D realization -------------------
246  public:
247 
252  std::string className() const;
253 
254  }; // SignedKhalimskyPreCell
255 
256  template < Dimension dim,
257  typename TInteger >
258  std::ostream &
259  operator<<( std::ostream & out,
261 
279  template < Dimension dim,
280  typename TInteger = DGtal::int32_t >
282  {
283  public:
284  typedef TInteger Integer;
285  // Cells
288 
289  public:
295  explicit PreCellDirectionIterator( Cell cell, bool open = true );
296 
302  explicit PreCellDirectionIterator( SCell scell, bool open = true );
303 
308  Dimension operator*() const;
309 
312 
320  bool operator!=( const Integer ) const;
321 
326  bool end() const;
327 
332  bool operator!=( const PreCellDirectionIterator & other ) const;
333 
338  bool operator==( const PreCellDirectionIterator & other ) const;
339 
340  private:
348  bool myOpen;
349 
350  private:
352  void find();
353  };
354 
356  // template class KhalimskyPreSpaceND
375  template <
376  Dimension dim,
377  typename TInteger
378  >
379  class KhalimskyPreSpaceND
380  {
383 
384  public:
386  using Integer = TInteger;
387 
388  // Cells
391 
392  using Surfel = SCell;
393  using Sign = bool;
395 
396  // Points and Vectors
399 
402 
403  // static constants
404  static constexpr const Dimension dimension = dim;
405  static constexpr const Dimension DIM = dim;
406  static constexpr const Sign POS = true;
407  static constexpr const Sign NEG = false;
408 
409  template <typename CellType>
410  struct AnyCellCollection : public std::deque<CellType> {
411  using Value = CellType;
412  using Container = typename std::deque<CellType>;
413  using Iterator = typename std::deque<CellType>::iterator;
414  using ConstIterator = typename std::deque<CellType>::const_iterator;
415  };
416 
417  // Neighborhoods, Incident cells, Faces and Cofaces
420 
421  // Sets, Maps
423  using CellSet = std::set<Cell>;
424 
426  using SCellSet = std::set<SCell>;
427 
429  using SurfelSet = std::set<SCell>;
430 
433  template <typename Value> struct CellMap {
434  typedef std::map<Cell,Value> Type;
435  };
436 
439  template <typename Value> struct SCellMap {
440  typedef std::map<SCell,Value> Type;
441  };
442 
445  template <typename Value> struct SurfelMap {
446  typedef std::map<SCell,Value> Type;
447  };
448 
449  // ----------------------- Pre-cell creation services --------------------------
453  public:
454 
461  static Cell uCell( const Point & kp );
462 
471  static Cell uCell( Point p, const Cell & c );
472 
480  static SCell sCell( const Point & kp, Sign sign = POS );
481 
490  static SCell sCell( Point p, const SCell & c );
491 
498  static Cell uSpel( Point p );
499 
507  static SCell sSpel( Point p, Sign sign = POS );
508 
515  static Cell uPointel( Point p );
516 
524  static SCell sPointel( Point p, Sign sign = POS );
525 
527 
528  // ----------------------- Read accessors to pre-cells ------------------------
532  public:
539  static Integer uKCoord( const Cell & c, Dimension k );
540 
547  static Integer uCoord( const Cell & c, Dimension k );
548 
554  static const Point & uKCoords( const Cell & c );
555 
561  static Point uCoords( const Cell & c );
562 
569  static Integer sKCoord( const SCell & c, Dimension k );
570 
577  static Integer sCoord( const SCell & c, Dimension k );
578 
584  static const Point & sKCoords( const SCell & c );
585 
591  static Point sCoords( const SCell & c );
592 
598  static Sign sSign( const SCell & c );
599 
601 
602  // ----------------------- Write accessors to pre-cells ------------------------
606  public:
607 
613  static void uSetKCoord( Cell & c, Dimension k, Integer i );
614 
620  static void sSetKCoord( SCell & c, Dimension k, Integer i );
621 
627  static void uSetCoord( Cell & c, Dimension k, Integer i );
628 
634  static void sSetCoord( SCell & c, Dimension k, Integer i );
635 
640  static void uSetKCoords( Cell & c, const Point & kp );
641 
646  static void sSetKCoords( SCell & c, const Point & kp );
647 
652  static void uSetCoords( Cell & c, const Point & kp );
653 
658  static void sSetCoords( SCell & c, const Point & kp );
659 
664  static void sSetSign( SCell & c, Sign s );
665 
667 
668  // -------------------- Conversion signed/unsigned ------------------------
672  public:
678  static SCell signs( const Cell & p, Sign s );
679 
684  static Cell unsigns( const SCell & p );
685 
690  static SCell sOpp( const SCell & p );
691 
693 
694  // ------------------------- Pre-cell topology services -----------------------
698  public:
703  static Integer uTopology( const Cell & p );
704 
710  static Integer sTopology( const SCell & p );
711 
717  static Dimension uDim( const Cell & p );
718 
724  static Dimension sDim( const SCell & p );
725 
731  static bool uIsSurfel( const Cell & b );
732 
738  static bool sIsSurfel( const SCell & b );
739 
746  static bool uIsOpen( const Cell & p, Dimension k );
747 
754  static bool sIsOpen( const SCell & p, Dimension k );
755 
757 
758  // -------------------- Iterator services for pre-cells ------------------------
762  public:
763 
784  static DirIterator uDirs( const Cell & p );
785 
806  static DirIterator sDirs( const SCell & p );
807 
828  static DirIterator uOrthDirs( const Cell & p );
829 
850  static DirIterator sOrthDirs( const SCell & p );
851 
858  static Dimension uOrthDir( const Cell & s );
859 
866  static Dimension sOrthDir( const SCell & s );
867 
869 
870  // -------------------- Unsigned pre-cell geometry services --------------------
874  public:
875 
884  static Cell uGetIncr( Cell p, Dimension k );
885 
894  static bool uIsMax( const Cell & p, Dimension k );
895 
896 
905  static bool uIsInside( const Cell & p, Dimension k );
906 
907 
915  static bool uIsInside( const Cell & p );
916 
925  static Cell uGetDecr( Cell p, Dimension k );
926 
935  static bool uIsMin( const Cell & p, Dimension k );
936 
946  static Cell uGetAdd( Cell p, Dimension k, Integer x );
947 
957  static Cell uGetSub( Cell p, Dimension k, Integer x );
958 
965  static Cell uTranslation( Cell p, const Vector & vec );
966 
979  static Cell uProjection( Cell p, const Cell & bound, Dimension k );
980 
990  static void uProject( Cell & p, const Cell & bound, Dimension k );
991 
1013  static bool uNext( Cell & p, const Cell & lower, const Cell & upper );
1014 
1016 
1017  // -------------------- Signed pre-cell geometry services --------------------
1021  public:
1022 
1031  static SCell sGetIncr( SCell p, Dimension k );
1032 
1041  static bool sIsMax( const SCell & p, Dimension k );
1042 
1043 
1052  static bool sIsInside( const SCell & p, Dimension k );
1053 
1054 
1062  static bool sIsInside( const SCell & p );
1063 
1072  static SCell sGetDecr( SCell p, Dimension k );
1073 
1082  static bool sIsMin( const SCell & p, Dimension k );
1083 
1093  static SCell sGetAdd( SCell p, Dimension k, Integer x );
1094 
1104  static SCell sGetSub( SCell p, Dimension k, Integer x );
1105 
1112  static SCell sTranslation( SCell p, const Vector & vec );
1113 
1126  static SCell sProjection( SCell p, const SCell & bound, Dimension k );
1127 
1137  static void sProject( SCell & p, const SCell & bound, Dimension k );
1138 
1160  static bool sNext( SCell & p, const SCell & lower, const SCell & upper );
1161 
1163 
1164  // ----------------------- Neighborhood services --------------------------
1168  public:
1169 
1178  static Cells uNeighborhood( const Cell & cell );
1179 
1188  static SCells sNeighborhood( const SCell & cell );
1189 
1199  static Cells uProperNeighborhood( const Cell & cell );
1200 
1210  static SCells sProperNeighborhood( const SCell & cell );
1211 
1223  static Cell uAdjacent( const Cell & p, Dimension k, bool up );
1224 
1236  static SCell sAdjacent( const SCell & p, Dimension k, bool up );
1237 
1239 
1240  // ----------------------- Incidence services --------------------------
1244  public:
1245 
1257  static Cell uIncident( Cell c, Dimension k, bool up );
1258 
1274  static SCell sIncident( SCell c, Dimension k, bool up );
1275 
1281  static Cells uLowerIncident( const Cell & c );
1282 
1288  static Cells uUpperIncident( const Cell & c );
1289 
1296  static SCells sLowerIncident( const SCell & c );
1297 
1304  static SCells sUpperIncident( const SCell & c );
1305 
1311  static Cells uFaces( const Cell & c );
1312 
1318  static Cells uCoFaces( const Cell & c );
1319 
1336  static bool sDirect( const SCell & p, Dimension k );
1337 
1346  static SCell sDirectIncident( SCell p, Dimension k );
1347 
1356  static SCell sIndirectIncident( SCell p, Dimension k );
1357 
1359 
1360 
1361  // ------------------------- Internals ------------------------------------
1365  private:
1369  static void uAddFaces( Cells & faces, const Cell & c, Dimension axis );
1370 
1374  static void uAddCoFaces( Cells & cofaces, const Cell & c, Dimension axis );
1375 
1377 
1378  // ----------------------- Interface --------------------------------------
1382  public:
1383 
1388  static void selfDisplay ( std::ostream & out );
1389 
1394  static constexpr bool isValid();
1395 
1397 
1398  }; // end of class KhalimskyPreSpaceND
1399 
1406  template < Dimension dim,
1407  typename TInteger >
1408  std::ostream&
1409  operator<< ( std::ostream & out,
1410  const KhalimskyPreSpaceND<dim, TInteger > & object );
1411 
1412 } // namespace DGtal
1413 
1414 
1416 // Includes inline functions.
1417 #include "DGtal/topology/KhalimskyPreSpaceND.ih"
1418 
1419 // //
1421 
1422 #endif // !defined KhalimskyPreSpaceND_h
1423 
1424 #undef KhalimskyPreSpaceND_RECURSES
1425 #endif // else defined(KhalimskyPreSpaceND_RECURSES)
static bool sIsSurfel(const SCell &b)
Return 'true' if [b] is a surfel (spans all but one coordinate).
const Point aPoint(3, 4)
bool operator<(const KhalimskyPreCell &other) const
Inferior operator. (lexicographic order).
static SCell sOpp(const SCell &p)
Creates the signed pre-cell with the inverse sign of [p].
static Cell uTranslation(Cell p, const Vector &vec)
Add the vector [vec] to [p].
static SCell sGetSub(SCell p, Dimension k, Integer x)
Return the same element as [p] except for a coordinate [k] decremented with x.
Dimension myDir
the current direction.
SignedKhalimskyPreCell< dim, Integer > SCell
static SCell sGetAdd(SCell p, Dimension k, Integer x)
Return the same element as [p] except for a coordinate [k] incremented with x.
static DirIterator uDirs(const Cell &p)
Given an unsigned pre-cell [p], returns an iterator to iterate over each coordinate the cell spans....
Point coordinates
Khalimsky coordinates of the cell. Public to allow easy coordinate manipulations.
static bool sIsMax(const SCell &p, Dimension k)
Useful to check if you are going out of the space.
static SCell sGetIncr(SCell p, Dimension k)
Return the same element as [p] except for the incremented coordinate [k].
static Sign sSign(const SCell &c)
Return its sign.
Dimension operator *() const
Return the current direction.
static void sProject(SCell &p, const SCell &bound, Dimension k)
Projects [p] along the [k]th direction toward [bound].
static Integer sCoord(const SCell &c, Dimension k)
Return its digital coordinate along [k].
static void selfDisplay(std::ostream &out)
Writes/Displays the object on an output stream.
DGtal::uint32_t Dimension
Definition: Common.h:127
bool operator!=(const Integer) const
Fast comparison with unsigned integer (unused parameter).
KhalimskyPreCell< dim, Integer > Cell
static SCell sSpel(Point p, Sign sign=POS)
From the digital coordinates of a point in Zn, builds the corresponding pre-spel (pre-cell of maximal...
static SCells sLowerIncident(const SCell &c)
Return the signed pre-cells directly low incident to c.
static Cell uPointel(Point p)
From the digital coordinates of a point in Zn, builds the corresponding pre-pointel (pre-cell of dime...
static Cell uGetAdd(Cell p, Dimension k, Integer x)
Return the same element as [p] except for a coordinate [k] incremented with x.
SignedKhalimskyPreCell(Integer dummy=0)
Default constructor.
static SCell sIncident(SCell c, Dimension k, bool up)
Return the forward or backward signed pre-cell incident to [c] along axis [k], depending on [up].
std::string className() const
Return the style name used for drawing this object.
Vector lower(const Vector &z, unsigned int k)
static Cell uSpel(Point p)
From the digital coordinates of a point in Zn, builds the corresponding pre-spel (pre-cell of maximal...
std::set< SCell > SurfelSet
Preferred type for defining a set of surfels (always signed cells).
typename NumberTraits< Integer >::UnsignedVersion UnsignedInteger
static Dimension sDim(const SCell &p)
Return the dimension of the pre-cell [p].
static void uSetCoord(Cell &c, Dimension k, Integer i)
Sets the [k]-th digital coordinate of [c] to [i].
static Cells uLowerIncident(const Cell &c)
Return the pre-cells directly low incident to c.
static SCell sGetDecr(SCell p, Dimension k)
Return the same element as [p] except for an decremented coordinate [k].
static DirIterator sOrthDirs(const SCell &p)
Given a signed pre-cell [p], returns an iterator to iterate over each coordinate the cell does not sp...
Aim: This class is a model of CPreCellularGridSpaceND. It represents the cubical grid as a cell compl...
SignedKhalimskyPreCell< dim, Integer > SCell
typename NumberTraits< Integer >::UnsignedVersion UnsignedInteger
static Cell uCell(const Point &kp)
From the Khalimsky coordinates of a cell, builds the corresponding unsigned pre-cell.
bool operator==(const KhalimskyPreCell &other) const
Equality operator.
static Point sCoords(const SCell &c)
Return its digital coordinates.
typename std::deque< CellType >::iterator Iterator
bool myOpen
If 'true', returns open coordinates, otherwise returns closed coordinates.
This class is useful for looping on all "interesting" coordinates of a pre-cell.
Represents an unsigned cell in an unbounded cellular grid space by its Khalimsky coordinates.
void find()
Look for next valid coordinate.
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
Definition: CInteger.h:87
SignedKhalimskyPreCell< dim, Integer > Self
static bool sDirect(const SCell &p, Dimension k)
Return 'true' if the direct orientation of [p] along [k] is in the positive coordinate direction.
static void uAddCoFaces(Cells &cofaces, const Cell &c, Dimension axis)
Used by uCoFaces for computing incident cofaces.
static SCell sTranslation(SCell p, const Vector &vec)
Add the vector [vec] to [p].
static Dimension uOrthDir(const Cell &s)
Given an unsigned pre-surfel [s], returns its orthogonal direction (ie, the coordinate where the surf...
PreCellDirectionIterator(Cell cell, bool open=true)
Constructor from a pre-cell.
TInteger Integer
Arithmetic ring induced by (+,-,*) and Integer numbers.
static DirIterator sDirs(const SCell &p)
Given a signed pre-cell [p], returns an iterator to iterate over each coordinate the cell spans....
KhalimskyPreSpaceND< dim, TInteger > PreCellularGridSpace
static Point uCoords(const Cell &c)
Return its digital coordinates.
static Cell uGetIncr(Cell p, Dimension k)
Return the same element as [p] except for the incremented coordinate [k].
static SCell sIndirectIncident(SCell p, Dimension k)
Return the indirect incident pre-cell of [p] along [k] (the incident cell along [k] whose sign is neg...
KhalimskyPreCell< dim, Integer > Self
bool end() const
Return 'true' if the iteration is ended.
static Cells uFaces(const Cell &c)
Return the proper faces of [c] (chain of lower incidence).
static SCell sAdjacent(const SCell &p, Dimension k, bool up)
Return the adjacent element to [p] along axis [k] in the given direction and orientation.
static bool uNext(Cell &p, const Cell &lower, const Cell &upper)
Increment the pre-cell [p] to its next position (as classically done in a scanning).
static void sSetCoords(SCell &c, const Point &kp)
Sets the digital coordinates of [c] to [kp].
static const Point & uKCoords(const Cell &c)
Return its Khalimsky coordinates.
static bool sIsOpen(const SCell &p, Dimension k)
Return 'true' if [p] is open along the direction [k].
bool operator==(const SignedKhalimskyPreCell &other) const
Equality operator.
Represents a signed cell in an unbounded cellular grid space by its Khalimsky coordinates and a boole...
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
Aim: The traits class for all models of Cinteger.
Definition: NumberTraits.h:531
Point coordinates
Khalimsky coordinates of the cell.
bool operator==(const PreCellDirectionIterator &other) const
Slow comparison with other iterator.
bool operator!=(const KhalimskyPreCell &other) const
Difference operator.
static bool uIsMin(const Cell &p, Dimension k)
Useful to check if you are going out of the space.
static Cells uCoFaces(const Cell &c)
Return the proper cofaces of [c] (chain of upper incidence).
PreCellDirectionIterator & operator++()
Pre-increment. Go to next direction.
static SCell signs(const Cell &p, Sign s)
Creates a signed pre-cell from an unsigned one and a given sign.
static Cells uProperNeighborhood(const Cell &cell)
Computes the proper 1-neighborhood of the pre-cell [c] and returns it.
static Integer uKCoord(const Cell &c, Dimension k)
Return its Khalimsky coordinate along [k].
static Cell uIncident(Cell c, Dimension k, bool up)
Return the forward or backward unsigned pre-cell incident to [c] along axis [k], depending on [up].
static SCell sDirectIncident(SCell p, Dimension k)
Return the direct incident pre-cell of [p] along [k] (the incident pre-cell along [k])
static DirIterator uOrthDirs(const Cell &p)
Given an unsigned pre-cell [p], returns an iterator to iterate over each coordinate the cell does not...
static bool uIsInside(const Cell &p, Dimension k)
Useful to check if you are going out of the space.
SignedKhalimskyPreCell & operator=(SignedKhalimskyPreCell const &aCell)=default
Copy operator.
static Integer sKCoord(const SCell &c, Dimension k)
Return its Khalimsky coordinate along [k].
static constexpr const Sign POS
static void sSetSign(SCell &c, Sign s)
Sets the sign of the pre-cell.
static Dimension uDim(const Cell &p)
Return the dimension of the pre-cell [p].
static void uAddFaces(Cells &faces, const Cell &c, Dimension axis)
Used by uFaces for computing incident faces.
static Cell unsigns(const SCell &p)
Creates an unsigned pre-cell from a signed one.
bool operator<(const SignedKhalimskyPreCell &other) const
Inferior operator. (lexicographic order).
DGtal is the top-level namespace which contains all DGtal functions and types.
static Integer uCoord(const Cell &c, Dimension k)
Return its digital coordinate along [k].
static void sSetKCoords(SCell &c, const Point &kp)
Sets the Khalimsky coordinates of [c] to [kp].
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInteger >))
static void uProject(Cell &p, const Cell &bound, Dimension k)
Projects [p] along the [k]th direction toward [bound].
static bool sIsInside(const SCell &p, Dimension k)
Useful to check if you are going out of the space.
KhalimskyPreCell & operator=(KhalimskyPreCell const &aCell)=default
Copy operator.
static void sSetCoord(SCell &c, Dimension k, Integer i)
Sets the [k]-th digital coordinate of [c] to [i].
static Cells uNeighborhood(const Cell &cell)
Computes the 1-neighborhood of the pre-cell [c] and returns it.
unsigned int dim(const Vector &z)
std::string className() const
Return the style name used for drawing this object.
static constexpr const Sign NEG
std::set< SCell > SCellSet
Preferred type for defining a set of SCell(s).
static Cell uGetSub(Cell p, Dimension k, Integer x)
Return the same element as [p] except for a coordinate [k] decremented with x.
static Integer uTopology(const Cell &p)
Return the topology word of [p].
KhalimskyPreCell(Integer dummy=0)
Default constructor.
static SCell sPointel(Point p, Sign sign=POS)
From the digital coordinates of a point in Zn, builds the corresponding pre-pointel (pre-cell of dime...
static Cell uAdjacent(const Cell &p, Dimension k, bool up)
Return the adjacent element to [p] along axis [k] in the given direction and orientation.
bool operator!=(const SignedKhalimskyPreCell &other) const
Difference operator.
static bool sIsMin(const SCell &p, Dimension k)
Useful to check if you are going out of the space.
static bool uIsOpen(const Cell &p, Dimension k)
Return 'true' if [p] is open along the direction [k].
static Cells uUpperIncident(const Cell &c)
Return the pre-cells directly up incident to c.
static constexpr const Dimension dimension
SPreCell const & preCell() const
Returns the underlying constant pre-cell, itself in fact.
static bool sNext(SCell &p, const SCell &lower, const SCell &upper)
Increment the pre-cell [p] to its next position (as classically done in a scanning).
static void uSetKCoord(Cell &c, Dimension k, Integer i)
Sets the [k]-th Khalimsky coordinate of [c] to [i].
static void sSetKCoord(SCell &c, Dimension k, Integer i)
Sets the [k]-th Khalimsky coordinate of [c] to [i].
static bool uIsSurfel(const Cell &b)
Return 'true' if [b] is a surfel (spans all but one coordinate).
static Cell uGetDecr(Cell p, Dimension k)
Return the same element as [p] except for an decremented coordinate [k].
static const Point & sKCoords(const SCell &c)
Return its Khalimsky coordinates.
static Integer sTopology(const SCell &p)
Return the topology word of [p].
static void uSetKCoords(Cell &c, const Point &kp)
Sets the Khalimsky coordinates of [c] to [kp].
KhalimskyPreSpaceND< dim, TInteger > PreCellularGridSpace
boost::int32_t int32_t
signed 32-bit integer.
Definition: BasicTypes.h:72
static Cell uProjection(Cell p, const Cell &bound, Dimension k)
Return the projection of [p] along the [k]th direction toward [bound].
static SCells sUpperIncident(const SCell &c)
Return the signed pre-cells directly up incident to c.
static Dimension sOrthDir(const SCell &s)
Given a signed pre-surfel [s], returns its orthogonal direction (ie, the coordinate where the surfel ...
static void uSetCoords(Cell &c, const Point &kp)
Sets the digital coordinates of [c] to [kp].
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInteger >))
Integer must be signed to characterize a ring.
static bool uIsMax(const Cell &p, Dimension k)
Useful to check if you are going out of the space.
static SCells sProperNeighborhood(const SCell &cell)
Computes the proper 1-neighborhood of the pre-cell [c] and returns it.
Vector upper(const Vector &z, unsigned int k)
static SCell sProjection(SCell p, const SCell &bound, Dimension k)
Return the projection of [p] along the [k]th direction toward [bound].
PreCell const & preCell() const
Returns the underlying constant pre-cell, itself in fact.
typename std::deque< CellType >::const_iterator ConstIterator
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInteger >))
Integer must be a model of the concept CInteger.
static SCells sNeighborhood(const SCell &cell)
Computes the 1-neighborhood of the pre-cell [c] and returns it.
std::set< Cell > CellSet
Preferred type for defining a set of Cell(s).
static SCell sCell(const Point &kp, Sign sign=POS)
From the Khalimsky coordinates of a cell and a sign, builds the corresponding signed pre-cell.
static constexpr bool isValid()
Checks the validity/consistency of the object.
static constexpr const Dimension DIM