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;
564 const std::array<Closure, dim> & closure );
599 const Point & lowerBound()
const;
605 const Point & upperBound()
const;
611 const Cell & lowerCell()
const;
617 const Cell & upperCell()
const;
629 bool uIsValid(
const PreCell & c,
Dimension k )
const;
640 bool uIsValid(
const PreCell & c )
const;
652 bool sIsValid(
const SPreCell & c,
Dimension k )
const;
663 bool sIsValid(
const SPreCell & c )
const;
673 bool cIsValid(
const Point & p,
Dimension k )
const;
682 bool cIsValid(
const Point & p )
const;
695 bool isSpaceClosed()
const;
706 bool isSpacePeriodic()
const;
712 bool isSpacePeriodic(
Dimension k )
const;
717 bool isAnyDimensionPeriodic()
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;
874 Cell uPointel( Point p )
const;
891 SCell sPointel( Point p, Sign sign = POS )
const;
906 Integer uKCoord(
const Cell & c,
Dimension k )
const;
914 Integer uCoord(
const Cell & c,
Dimension k )
const;
921 const Point & uKCoords(
const Cell & c )
const;
928 Point uCoords(
const Cell & c )
const;
936 Integer sKCoord(
const SCell & c,
Dimension k )
const;
944 Integer sCoord(
const SCell & c,
Dimension k )
const;
951 const Point & sKCoords(
const SCell & c )
const;
958 Point sCoords(
const SCell & c )
const;
965 Sign sSign(
const SCell & c )
const;
983 void uSetKCoord( Cell & c,
Dimension k, Integer i )
const;
993 void sSetKCoord( SCell & c,
Dimension k, Integer i )
const;
1003 void uSetCoord( Cell & c,
Dimension k, Integer i )
const;
1013 void sSetCoord( SCell & c,
Dimension k, Integer i )
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;
1120 Dimension sDim(
const SCell & p )
const;
1126 bool uIsSurfel(
const Cell & b )
const;
1132 bool sIsSurfel(
const SCell & b )
const;
1139 bool uIsOpen(
const Cell & p,
Dimension k )
const;
1146 bool sIsOpen(
const SCell & p,
Dimension k )
const;
1242 Dimension uOrthDir(
const Cell & s )
const;
1250 Dimension sOrthDir(
const SCell & s )
const;
1265 Integer uFirst(
const PreCell & p,
Dimension k )
const;
1272 Cell uFirst(
const PreCell & p )
const;
1279 Integer uLast(
const PreCell & p,
Dimension k )
const;
1286 Cell uLast(
const PreCell & p )
const;
1296 Cell uGetIncr(
const Cell & p,
Dimension k )
const;
1307 bool uIsMax(
const Cell & p,
Dimension k )
const;
1317 bool uIsInside(
const PreCell & p,
Dimension k )
const;
1326 bool uIsInside(
const PreCell & p )
const;
1335 bool cIsInside(
const Point & p,
Dimension k )
const;
1344 bool cIsInside(
const Point & p )
const;
1355 Cell uGetMax( Cell p,
Dimension k )
const;
1365 Cell uGetDecr(
const Cell & p,
Dimension k )
const;
1375 bool uIsMin(
const Cell & p,
Dimension k )
const;
1386 Cell uGetMin( Cell p,
Dimension k )
const;
1398 Cell uGetAdd(
const Cell & p,
Dimension k, Integer x )
const;
1409 Cell uGetSub(
const Cell & p,
Dimension k, Integer x )
const;
1418 Integer uDistanceToMax(
const Cell & p,
Dimension k )
const;
1428 Integer uDistanceToMin(
const Cell & p,
Dimension k )
const;
1438 Cell uTranslation(
const Cell & p,
const Vector & vec )
const;
1450 Cell uProjection(
const Cell & p,
const Cell & bound,
Dimension k )
const;
1461 void uProject( Cell & p,
const Cell & bound,
Dimension k )
const;
1484 bool uNext( Cell & p,
const Cell &
lower,
const Cell &
upper )
const;
1499 Integer sFirst(
const SPreCell & p,
Dimension k )
const;
1506 SCell sFirst(
const SPreCell & p )
const;
1513 Integer sLast(
const SPreCell & p,
Dimension k )
const;
1520 SCell sLast(
const SPreCell & p )
const;
1530 SCell sGetIncr(
const SCell & p,
Dimension k )
const;
1540 bool sIsMax(
const SCell & p,
Dimension k )
const;
1548 bool sIsInside(
const SPreCell & p,
Dimension k )
const;
1556 bool sIsInside(
const SPreCell & p )
const;
1567 SCell sGetMax( SCell p,
Dimension k )
const;
1577 SCell sGetDecr(
const SCell & p,
Dimension k )
const;
1588 bool sIsMin(
const SCell & p,
Dimension k )
const;
1598 SCell sGetMin( SCell p,
Dimension k )
const;
1609 SCell sGetAdd(
const SCell & p,
Dimension k, Integer x )
const;
1620 SCell sGetSub(
const SCell & p,
Dimension k, Integer x )
const;
1629 Integer sDistanceToMax(
const SCell & p,
Dimension k )
const;
1639 Integer sDistanceToMin(
const SCell & p,
Dimension k )
const;
1649 SCell sTranslation(
const SCell & p,
const Vector & vec )
const;
1661 SCell sProjection(
const SCell & p,
const SCell & bound,
Dimension k )
const;
1672 void sProject( SCell & p,
const SCell & bound,
Dimension k )
const;
1695 bool sNext( SCell & p,
const SCell &
lower,
const SCell &
upper )
const;
1714 Cells uNeighborhood(
const Cell & cell )
const;
1725 SCells sNeighborhood(
const SCell & cell )
const;
1737 Cells uProperNeighborhood(
const Cell & cell )
const;
1749 SCells sProperNeighborhood(
const SCell & cell )
const;
1762 Cell uAdjacent(
const Cell & p,
Dimension k,
bool up )
const;
1775 SCell sAdjacent(
const SCell & p,
Dimension k,
bool up )
const;
1797 Cell uIncident(
const Cell & c,
Dimension k,
bool up )
const;
1814 SCell sIncident(
const SCell & c,
Dimension k,
bool up )
const;
1822 Cells uLowerIncident(
const Cell & c )
const;
1830 Cells uUpperIncident(
const Cell & c )
const;
1839 SCells sLowerIncident(
const SCell & c )
const;
1848 SCells sUpperIncident(
const SCell & c )
const;
1856 Cells uFaces(
const Cell & c )
const;
1864 Cells uCoFaces(
const Cell & c )
const;
1880 bool sDirect(
const SCell & p,
Dimension k )
const;
1891 SCell sDirectIncident(
const SCell & p,
Dimension k )
const;
1902 SCell sIndirectIncident(
const SCell & p,
Dimension k )
const;
1916 void selfDisplay ( std::ostream & out )
const;
1922 bool isValid()
const;
1952 void uAddFaces( Cells& faces,
const Cell& c,
Dimension axis )
const;
1957 void uAddCoFaces( Cells& cofaces,
const Cell& c,
Dimension axis )
const;
1981 #include "DGtal/topology/KhalimskySpaceND.ih" 1986 #endif // !defined KhalimskySpaceND_h 1988 #undef KhalimskySpaceND_RECURSES 1989 #endif // else defined(KhalimskySpaceND_RECURSES)
bool operator<(const KhalimskyCell &other) const
PointVector< dim, Integer > Vector
typename NumberTraits< Integer >::UnsignedVersion UnsignedInteger
std::set< SCell > SCellSet
Preferred type for defining a set of SCell(s).
KhalimskySpaceNDHelper< KhalimskySpaceND< dim, TInteger > > Helper
Features basic operations on coordinates, especially for periodic dimensions.
Aim: SpaceND is a utility class that defines the fundamental structure of a Digital Space in ND...
std::set< SCell > SurfelSet
Preferred type for defining a set of surfels (always signed cells).
DGtal::uint32_t Dimension
bool operator==(const KhalimskyCell &other) const
Vector lower(const Vector &z, unsigned int k)
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInteger >))
bool operator!=(const KhalimskyCell &other) const
KhalimskyPreSpaceND< dim, Integer > PreCellularGridSpace
std::map< SCell, Value > Type
Aim: This class is a model of CPreCellularGridSpaceND. It represents the cubical grid as a cell compl...
std::array< Closure, dimension > myClosure
NumberTraits< Integer >::UnsignedVersion Size
Type used to represent sizes in the digital space.
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
K init(Point(0, 0, 0), Point(512, 512, 512), true)
KhalimskySpaceND< dim, Integer > CellularGridSpace
Closure
Boundaries closure type.
PreCellDirectionIterator< dim, Integer > DirIterator
KhalimskyPreCell< dim, Integer > PreCell
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
Aim: The traits class for all models of Cinteger.
KhalimskyCell< dim, Integer > Cell
PreCell const & preCell() const
Returns the underlying constant pre-cell.
SignedKhalimskyCell< dim, Integer > SCell
SpaceND< dim, Integer > Space
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.
std::map< Cell, Value > Type
unsigned int dim(const Vector &z)
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value...
PointVector< dim, Integer > Point
SignedKhalimskyPreCell< dim, Integer > SPreCell
KhalimskyCell & operator=(const KhalimskyCell &other)=default
typename NumberTraits< Integer >::UnsignedVersion UnsignedInteger
typename PreCellularGridSpace::DirIterator DirIterator
boost::int32_t int32_t
signed 32-bit integer.
Vector upper(const Vector &z, unsigned int k)
typename PreCellularGridSpace::template AnyCellCollection< CellType > AnyCellCollection
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.
AnyCellCollection< SCell > SCells
AnyCellCollection< Cell > Cells
std::string className() const
The dimension is closed and non-periodic.
TInteger Integer
Arithmetic ring induced by (+,-,*) and Integer numbers.