33 #if defined(KhalimskySpaceND_RECURSES)
34 #error Recursive header files inclusion detected in KhalimskySpaceND.h
35 #else // defined(KhalimskySpaceND_RECURSES)
37 #define KhalimskySpaceND_RECURSES
39 #if !defined KhalimskySpaceND_h
41 #define KhalimskySpaceND_h
49 #include <DGtal/base/Common.h>
50 #include <DGtal/kernel/CInteger.h>
51 #include <DGtal/kernel/PointVector.h>
52 #include <DGtal/kernel/SpaceND.h>
53 #include <DGtal/topology/KhalimskyPreSpaceND.h>
70 template <
class TKhalimskySpace >
123 operator PreCell const& ()
const;
130 explicit operator PreCell & ();
431 static const constexpr Sign
POS =
true;
432 static const constexpr Sign
NEG =
false;
434 template <
typename CellType >
454 typedef std::map<Cell,Value>
Type;
460 typedef std::map<SCell,Value>
Type;
466 typedef std::map<SCell,Value>
Type;
530 bool init(
const Point & lower,
546 bool init(
const Point & lower,
562 bool init(
const Point & lower,
564 const std::array<Closure, dim> & closure );
640 bool uIsValid(
const PreCell & c )
const;
663 bool sIsValid(
const SPreCell & c )
const;
682 bool cIsValid(
const Point & p )
const;
747 Cell
uCell(
const PreCell & c )
const;
762 Cell
uCell(
const Point & kp )
const;
779 Cell
uCell( Point p,
const PreCell & c )
const;
795 SCell
sCell(
const SPreCell & c )
const;
811 SCell
sCell(
const Point & kp, Sign sign = POS )
const;
828 SCell
sCell( Point p,
const SPreCell & c )
const;
843 Cell
uSpel( Point p )
const;
859 SCell
sSpel( Point p, Sign sign = POS )
const;
891 SCell
sPointel( Point p, Sign sign = POS )
const;
921 const Point &
uKCoords(
const Cell & c )
const;
928 Point
uCoords(
const Cell & c )
const;
951 const Point &
sKCoords(
const SCell & c )
const;
958 Point
sCoords(
const SCell & c )
const;
965 Sign
sSign(
const SCell & c )
const;
1023 void uSetKCoords( Cell & c,
const Point & kp )
const;
1032 void sSetKCoords( SCell & c,
const Point & kp )
const;
1041 void uSetCoords( Cell & c,
const Point & kp )
const;
1050 void sSetCoords( SCell & c,
const Point & kp )
const;
1056 void sSetSign( SCell & c, Sign s )
const;
1072 SCell
signs(
const Cell & p, Sign s )
const;
1080 Cell
unsigns(
const SCell & p )
const;
1089 SCell
sOpp(
const SCell & p )
const;
1102 Integer
uTopology(
const Cell & p )
const;
1108 Integer
sTopology(
const SCell & p )
const;
1132 bool sIsSurfel(
const SCell & b )
const;
1272 Cell
uFirst(
const PreCell & p )
const;
1286 Cell
uLast(
const PreCell & p )
const;
1326 bool uIsInside(
const PreCell & p )
const;
1344 bool cIsInside(
const Point & p )
const;
1438 Cell
uTranslation(
const Cell & p,
const Vector & vec )
const;
1484 bool uNext( Cell & p,
const Cell & lower,
const Cell & upper )
const;
1506 SCell
sFirst(
const SPreCell & p )
const;
1520 SCell
sLast(
const SPreCell & p )
const;
1556 bool sIsInside(
const SPreCell & p )
const;
1649 SCell
sTranslation(
const SCell & p,
const Vector & vec )
const;
1695 bool sNext( SCell & p,
const SCell & lower,
const SCell & upper )
const;
1856 Cells
uFaces(
const Cell & c )
const;
1864 Cells
uCoFaces(
const Cell & c )
const;
1981 #include "DGtal/topology/KhalimskySpaceND.ih"
1986 #endif // !defined KhalimskySpaceND_h
1988 #undef KhalimskySpaceND_RECURSES
1989 #endif // else defined(KhalimskySpaceND_RECURSES)
Sign sSign(const SCell &c) const
void uAddCoFaces(Cells &cofaces, const Cell &c, Dimension axis) const
void sSetKCoords(SCell &c, const Point &kp) const
void sSetCoords(SCell &c, const Point &kp) const
std::string className() const
SCell sPointel(Point p, Sign sign=POS) const
PointVector< dim, Integer > Vector
typename NumberTraits< Integer >::UnsignedVersion UnsignedInteger
std::set< SCell > SCellSet
Preferred type for defining a set of SCell(s).
SignedKhalimskyCell & operator=(const SignedKhalimskyCell &other)=default
Integer sLast(const SPreCell &p, Dimension k) const
bool operator!=(const KhalimskyCell &other) const
Integer uCoord(const Cell &c, Dimension k) const
KhalimskySpaceNDHelper< KhalimskySpaceND< dim, TInteger > > Helper
Features basic operations on coordinates, especially for periodic dimensions.
bool sIsInside(const SPreCell &p, Dimension k) const
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInteger >))
const Point & sKCoords(const SCell &c) const
Aim: SpaceND is a utility class that defines the fundamental structure of a Digital Space in ND...
bool uIsOpen(const Cell &p, Dimension k) const
const Cell & lowerCell() const
Cell uGetMax(Cell p, Dimension k) const
Cell uGetDecr(const Cell &p, Dimension k) const
SCell sCell(const SPreCell &c) const
std::set< SCell > SurfelSet
Preferred type for defining a set of surfels (always signed cells).
DGtal::uint32_t Dimension
Cells uNeighborhood(const Cell &cell) const
Cells uCoFaces(const Cell &c) const
Cells uLowerIncident(const Cell &c) const
PreCell const & preCell() const
Returns the underlying constant pre-cell.
DirIterator uDirs(const Cell &p) const
Cell uGetAdd(const Cell &p, Dimension k, Integer x) const
Cell uAdjacent(const Cell &p, Dimension k, bool up) const
const Cell & upperCell() const
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInteger >))
KhalimskyPreSpaceND< dim, Integer > PreCellularGridSpace
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
std::map< SCell, Value > Type
std::string className() const
bool uIsMax(const Cell &p, Dimension k) const
Dimension uDim(const Cell &p) const
Aim: This class is a model of CPreCellularGridSpaceND. It represents the cubical grid as a cell compl...
SCell sProjection(const SCell &p, const SCell &bound, Dimension k) const
SCells sLowerIncident(const SCell &c) const
The dimension is periodic.
SCell signs(const Cell &p, Sign s) const
SCell sDirectIncident(const SCell &p, Dimension k) const
void sSetSign(SCell &c, Sign s) const
std::array< Closure, dimension > myClosure
void selfDisplay(std::ostream &out) const
NumberTraits< Integer >::UnsignedVersion Size
Type used to represent sizes in the digital space.
bool isSpacePeriodic() const
void uProject(Cell &p, const Cell &bound, Dimension k) const
Integer min(Dimension k) const
Integer uDistanceToMin(const Cell &p, Dimension k) const
const Point & lowerBound() const
DirIterator uOrthDirs(const Cell &p) const
Cell uCell(const PreCell &c) const
Integer sDistanceToMax(const SCell &p, Dimension k) const
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
bool operator<(const SignedKhalimskyCell &other) const
Cell uGetMin(Cell p, Dimension k) const
bool sIsMin(const SCell &p, Dimension k) const
SCell sOpp(const SCell &p) const
KhalimskySpaceND< dim, Integer > CellularGridSpace
Cell uPointel(Point p) const
Integer max(Dimension k) const
bool isAnyDimensionPeriodic() const
DirIterator sDirs(const SCell &p) const
bool sIsMax(const SCell &p, Dimension k) const
static const constexpr Dimension DIM
Closure
Boundaries closure type.
bool uIsSurfel(const Cell &b) const
const Point & uKCoords(const Cell &c) const
Dimension sOrthDir(const SCell &s) const
Dimension uOrthDir(const Cell &s) const
void uSetCoord(Cell &c, Dimension k, Integer i) const
PreCellDirectionIterator< dim, Integer > DirIterator
void sProject(SCell &p, const SCell &bound, Dimension k) const
SCell sSpel(Point p, Sign sign=POS) const
bool init(const Point &lower, const Point &upper, bool isClosed)
KhalimskyPreCell< dim, Integer > PreCell
bool sNext(SCell &p, const SCell &lower, const SCell &upper) const
bool sIsValid(const SPreCell &c, Dimension k) const
bool uIsValid(const PreCell &c, Dimension k) const
bool operator<(const KhalimskyCell &other) const
Cell uGetSub(const Cell &p, Dimension k, Integer x) const
bool operator==(const SignedKhalimskyCell &other) const
const Point & upperBound() const
Aim: The traits class for all models of Cinteger.
bool cIsValid(const Point &p, Dimension k) const
bool uIsInside(const PreCell &p, Dimension k) const
KhalimskyCell< dim, Integer > Cell
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInteger >))
DirIterator sOrthDirs(const SCell &p) const
Cell uIncident(const Cell &c, Dimension k, bool up) const
SCell sIncident(const SCell &c, Dimension k, bool up) const
SignedKhalimskyCell< dim, Integer > SCell
SpaceND< dim, Integer > Space
Integer uDistanceToMax(const Cell &p, Dimension k) const
SCell sAdjacent(const SCell &p, Dimension k, bool up) const
Point uCoords(const Cell &c) const
Integer sDistanceToMin(const SCell &p, Dimension k) const
SPreCell const & preCell() const
Returns the underlying constant signed pre-cell.
void uSetCoords(Cell &c, const Point &kp) const
SCell sGetMin(SCell p, Dimension k) const
Point sCoords(const SCell &c) const
bool sIsSurfel(const SCell &b) const
std::map< SCell, Value > Type
std::set< Cell > CellSet
Preferred type for defining a set of Cell(s).
DGtal is the top-level namespace which contains all DGtal functions and types.
SCell sGetIncr(const SCell &p, Dimension k) const
Cells uProperNeighborhood(const Cell &cell) const
std::map< Cell, Value > Type
bool uIsMin(const Cell &p, Dimension k) const
Integer uFirst(const PreCell &p, Dimension k) const
void uAddFaces(Cells &faces, const Cell &c, Dimension axis) const
Integer uKCoord(const Cell &c, Dimension k) const
Integer sKCoord(const SCell &c, Dimension k) const
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value...
SCell sGetMax(SCell p, Dimension k) const
void sSetCoord(SCell &c, Dimension k, Integer i) const
Cell uProjection(const Cell &p, const Cell &bound, Dimension k) const
PointVector< dim, Integer > Point
SignedKhalimskyPreCell< dim, Integer > SPreCell
SCell sIndirectIncident(const SCell &p, Dimension k) const
static const constexpr Sign POS
SCells sUpperIncident(const SCell &c) const
Integer sTopology(const SCell &p) const
Dimension sDim(const SCell &p) const
KhalimskyCell & operator=(const KhalimskyCell &other)=default
bool uNext(Cell &p, const Cell &lower, const Cell &upper) const
void uSetKCoord(Cell &c, Dimension k, Integer i) const
bool cIsInside(const Point &p, Dimension k) const
SignedKhalimskyCell(const Point &aPoint, bool positive)
typename NumberTraits< Integer >::UnsignedVersion UnsignedInteger
Integer uLast(const PreCell &p, Dimension k) const
Cells uFaces(const Cell &c) const
Closure getClosure(Dimension k) const
bool isSpaceClosed() const
Cell unsigns(const SCell &p) const
SCell sGetDecr(const SCell &p, Dimension k) const
typename PreCellularGridSpace::DirIterator DirIterator
Cell uSpel(Point p) const
void sSetKCoord(SCell &c, Dimension k, Integer i) const
boost::int32_t int32_t
signed 32-bit integer.
Cells uUpperIncident(const Cell &c) const
Integer sFirst(const SPreCell &p, Dimension k) const
static const constexpr Dimension dimension
typename PreCellularGridSpace::template AnyCellCollection< CellType > AnyCellCollection
SCell sTranslation(const SCell &p, const Vector &vec) const
bool sIsOpen(const SCell &p, Dimension k) const
bool operator!=(const SignedKhalimskyCell &other) const
static const constexpr Sign NEG
KhalimskyCell(const Point &aPoint)
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex...
Represents an (unsigned) cell in a cellular grid space by its Khalimsky coordinates.
bool operator==(const KhalimskyCell &other) const
Integer sCoord(const SCell &c, Dimension k) const
bool sDirect(const SCell &p, Dimension k) const
SCells sProperNeighborhood(const SCell &cell) const
AnyCellCollection< SCell > SCells
SCell sGetAdd(const SCell &p, Dimension k, Integer x) const
void uSetKCoords(Cell &c, const Point &kp) const
Integer uTopology(const Cell &p) const
SCells sNeighborhood(const SCell &cell) const
AnyCellCollection< Cell > Cells
The dimension is closed and non-periodic.
SCell sGetSub(const SCell &p, Dimension k, Integer x) const
TInteger Integer
Arithmetic ring induced by (+,-,*) and Integer numbers.
KhalimskySpaceND & operator=(const KhalimskySpaceND &other)=default
Size size(Dimension k) const
Cell uTranslation(const Cell &p, const Vector &vec) const
Cell uGetIncr(const Cell &p, Dimension k) const