DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::KhalimskyPreSpaceND< dim, TInteger > Class Template Reference

Aim: This class is a model of CPreCellularGridSpaceND. It represents the cubical grid as a cell complex, whose cells are defined as an array of integers. The topology of the cells is defined by the parity of the coordinates (even: closed, odd: open). More...

#include <DGtal/topology/KhalimskyPreSpaceND.h>

Data Structures

struct  AnyCellCollection
 
struct  CellMap
 
struct  SCellMap
 
struct  SurfelMap
 

Public Types

using Integer = TInteger
 Arithmetic ring induced by (+,-,*) and Integer numbers.
 
using Cell = KhalimskyPreCell< dim, Integer >
 
using SCell = SignedKhalimskyPreCell< dim, Integer >
 
using Surfel = SCell
 
using Sign = bool
 
using DirIterator = PreCellDirectionIterator< dim, Integer >
 
using Point = PointVector< dim, Integer >
 
using Vector = PointVector< dim, Integer >
 
using Space = SpaceND<dim, Integer>
 
using PreCellularGridSpace = KhalimskyPreSpaceND<dim, Integer>
 
using Cells = AnyCellCollection<Cell>
 
using SCells = AnyCellCollection<SCell>
 
using CellSet = std::set<Cell>
 Preferred type for defining a set of Cell(s).
 
using SCellSet = std::set<SCell>
 Preferred type for defining a set of SCell(s).
 
using SurfelSet = std::set<SCell>
 Preferred type for defining a set of surfels (always signed cells).
 

Static Public Member Functions

Pre-cell creation services (static methods)
static Cell uCell (const Point &kp)
 From the Khalimsky coordinates of a cell, builds the corresponding unsigned pre-cell.
 
static Cell uCell (Point p, const Cell &c)
 From the digital coordinates of a point in Zn and a cell type, builds the corresponding unsigned pre-cell.
 
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 SCell sCell (Point p, const SCell &c)
 From the digital coordinates of a point in Zn and a signed cell type, builds the corresponding signed pre-cell.
 
static Cell uSpel (Point p)
 From the digital coordinates of a point in Zn, builds the corresponding pre-spel (pre-cell of maximal dimension).
 
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 dimension).
 
static Cell uPointel (Point p)
 From the digital coordinates of a point in Zn, builds the corresponding pre-pointel (pre-cell of dimension 0).
 
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 dimension 0).
 
Read accessors to pre-cells
static Integer uKCoord (const Cell &c, Dimension k)
 Return its Khalimsky coordinate along [k].
 
static Integer uCoord (const Cell &c, Dimension k)
 Return its digital coordinate along [k].
 
static const PointuKCoords (const Cell &c)
 Return its Khalimsky coordinates.
 
static Point uCoords (const Cell &c)
 Return its digital coordinates.
 
static Integer sKCoord (const SCell &c, Dimension k)
 Return its Khalimsky coordinate along [k].
 
static Integer sCoord (const SCell &c, Dimension k)
 Return its digital coordinate along [k].
 
static const PointsKCoords (const SCell &c)
 Return its Khalimsky coordinates.
 
static Point sCoords (const SCell &c)
 Return its digital coordinates.
 
static Sign sSign (const SCell &c)
 Return its sign.
 
Write accessors to pre-cells
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 void uSetCoord (Cell &c, Dimension k, Integer i)
 Sets the [k]-th digital coordinate of [c] to [i].
 
static void sSetCoord (SCell &c, Dimension k, Integer i)
 Sets the [k]-th digital coordinate of [c] to [i].
 
static void uSetKCoords (Cell &c, const Point &kp)
 Sets the Khalimsky coordinates of [c] to [kp].
 
static void sSetKCoords (SCell &c, const Point &kp)
 Sets the Khalimsky coordinates of [c] to [kp].
 
static void uSetCoords (Cell &c, const Point &kp)
 Sets the digital coordinates of [c] to [kp].
 
static void sSetCoords (SCell &c, const Point &kp)
 Sets the digital coordinates of [c] to [kp].
 
static void sSetSign (SCell &c, Sign s)
 Sets the sign of the pre-cell.
 
Conversion signed/unsigned
static SCell signs (const Cell &p, Sign s)
 Creates a signed pre-cell from an unsigned one and a given sign.
 
static Cell unsigns (const SCell &p)
 Creates an unsigned pre-cell from a signed one.
 
static SCell sOpp (const SCell &p)
 Creates the signed pre-cell with the inverse sign of [p].
 
Pre-cell topology services
static Integer uTopology (const Cell &p)
 Return the topology word of [p].
 
static Integer sTopology (const SCell &p)
 Return the topology word of [p].
 
static Dimension uDim (const Cell &p)
 Return the dimension of the pre-cell [p].
 
static Dimension sDim (const SCell &p)
 Return the dimension of the pre-cell [p].
 
static bool uIsSurfel (const Cell &b)
 Return 'true' if [b] is a surfel (spans all but one coordinate).
 
static bool sIsSurfel (const SCell &b)
 Return 'true' if [b] is a surfel (spans all but one coordinate).
 
static bool uIsOpen (const Cell &p, Dimension k)
 Return 'true' if [p] is open along the direction [k].
 
static bool sIsOpen (const SCell &p, Dimension k)
 Return 'true' if [p] is open along the direction [k].
 
Iterator services for cells
static DirIterator uDirs (const Cell &p)
 Given an unsigned pre-cell [p], returns an iterator to iterate over each coordinate the cell spans. (A spel spans all coordinates; a surfel all but one, etc).
 
static DirIterator sDirs (const SCell &p)
 Given a signed pre-cell [p], returns an iterator to iterate over each coordinate the cell spans. (A spel spans all coordinates; a surfel all but one, etc).
 
static DirIterator uOrthDirs (const Cell &p)
 Given an unsigned pre-cell [p], returns an iterator to iterate over each coordinate the cell does not span. (A spel spans all coordinates; a surfel all but one, etc).
 
static DirIterator sOrthDirs (const SCell &p)
 Given a signed pre-cell [p], returns an iterator to iterate over each coordinate the cell does not span. (A spel spans all coordinates; a surfel all but one, etc).
 
static Dimension uOrthDir (const Cell &s)
 Given an unsigned pre-surfel [s], returns its orthogonal direction (ie, the coordinate where the surfel is closed).
 
static Dimension sOrthDir (const SCell &s)
 Given a signed pre-surfel [s], returns its orthogonal direction (ie, the coordinate where the surfel is closed).
 
Unsigned pre-cell geometry services
static Cell uGetIncr (Cell p, Dimension k)
 Return the same element as [p] except for the incremented coordinate [k].
 
static bool uIsMax (const Cell &p, Dimension k)
 Useful to check if you are going out of the space.
 
static bool uIsInside (const Cell &p, Dimension k)
 Useful to check if you are going out of the space.
 
static bool uIsInside (const Cell &p)
 Useful to check if you are going out of the space.
 
static Cell uGetDecr (Cell p, Dimension k)
 Return the same element as [p] except for an decremented coordinate [k].
 
static bool uIsMin (const Cell &p, Dimension k)
 Useful to check if you are going out of the space.
 
static Cell uGetAdd (Cell p, Dimension k, Integer x)
 Return the same element as [p] except for a coordinate [k] incremented with x.
 
static Cell uGetSub (Cell p, Dimension k, Integer x)
 Return the same element as [p] except for a coordinate [k] decremented with x.
 
static Cell uTranslation (Cell p, const Vector &vec)
 Add the vector [vec] to [p].
 
static Cell uProjection (Cell p, const Cell &bound, Dimension k)
 Return the projection of [p] along the [k]th direction toward [bound].
 
static void uProject (Cell &p, const Cell &bound, Dimension k)
 Projects [p] along the [k]th direction toward [bound].
 
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).
 
Signed pre-cell geometry services
static SCell sGetIncr (SCell p, Dimension k)
 Return the same element as [p] except for the incremented coordinate [k].
 
static bool sIsMax (const SCell &p, Dimension k)
 Useful to check if you are going out of the space.
 
static bool sIsInside (const SCell &p, Dimension k)
 Useful to check if you are going out of the space.
 
static bool sIsInside (const SCell &p)
 Useful to check if you are going out of the space.
 
static SCell sGetDecr (SCell p, Dimension k)
 Return the same element as [p] except for an decremented coordinate [k].
 
static bool sIsMin (const SCell &p, Dimension k)
 Useful to check if you are going out of the space.
 
static SCell sGetAdd (SCell p, Dimension k, Integer x)
 Return the same element as [p] except for a coordinate [k] incremented with x.
 
static SCell sGetSub (SCell p, Dimension k, Integer x)
 Return the same element as [p] except for a coordinate [k] decremented with x.
 
static SCell sTranslation (SCell p, const Vector &vec)
 Add the vector [vec] to [p].
 
static SCell sProjection (SCell p, const SCell &bound, Dimension k)
 Return the projection of [p] along the [k]th direction toward [bound].
 
static void sProject (SCell &p, const SCell &bound, Dimension k)
 Projects [p] along the [k]th direction toward [bound].
 
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).
 
Neighborhood services
static Cells uNeighborhood (const Cell &cell)
 Computes the 1-neighborhood of the pre-cell [c] and returns it.
 
static SCells sNeighborhood (const SCell &cell)
 Computes the 1-neighborhood of the pre-cell [c] and returns it.
 
static Cells uProperNeighborhood (const Cell &cell)
 Computes the proper 1-neighborhood of the pre-cell [c] and returns it.
 
static SCells sProperNeighborhood (const SCell &cell)
 Computes the proper 1-neighborhood of the pre-cell [c] and returns it.
 
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.
 
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.
 
Incidence services
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 sIncident (SCell c, Dimension k, bool up)
 Return the forward or backward signed pre-cell incident to [c] along axis [k], depending on [up].
 
static Cells uLowerIncident (const Cell &c)
 Return the pre-cells directly low incident to c.
 
static Cells uUpperIncident (const Cell &c)
 Return the pre-cells directly up incident to c.
 
static SCells sLowerIncident (const SCell &c)
 Return the signed pre-cells directly low incident to c.
 
static SCells sUpperIncident (const SCell &c)
 Return the signed pre-cells directly up incident to c.
 
static Cells uFaces (const Cell &c)
 Return the proper faces of [c] (chain of lower incidence).
 
static Cells uCoFaces (const Cell &c)
 Return the proper cofaces of [c] (chain of upper incidence).
 
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 SCell sDirectIncident (SCell p, Dimension k)
 Return the direct incident pre-cell of [p] along [k] (the incident pre-cell along [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 negative).
 
static Point interiorVoxel (const SCell &c)
 For a given surfel ((n-1)-signed cell), returns its interior voxel (point in Z^d given by the direct incident n-cell to the given cell).
 
static Point exteriorVoxel (const SCell &c)
 For a given surfel ((n-1)-signed cell), returns its exterior voxel (point in Z^d given by the indirect incident n-cell to the given cell).
 
DGtal interface
static void selfDisplay (std::ostream &out)
 Writes/Displays the object on an output stream.
 
static constexpr bool isValid ()
 Checks the validity/consistency of the object.
 

Static Public Attributes

static constexpr const Dimension dimension = dim
 
static constexpr const Dimension DIM = dim
 
static constexpr const Sign POS = true
 
static constexpr const Sign NEG = false
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CInteger< TInteger >))
 Integer must be signed to characterize a ring.
 

Static Private Member Functions

Internals
static void uAddFaces (Cells &faces, const Cell &c, Dimension axis)
 Used by uFaces for computing incident faces.
 
static void uAddCoFaces (Cells &cofaces, const Cell &c, Dimension axis)
 Used by uCoFaces for computing incident cofaces.
 

Detailed Description

template<Dimension dim, typename TInteger>
class DGtal::KhalimskyPreSpaceND< dim, TInteger >

Aim: This class is a model of CPreCellularGridSpaceND. It represents the cubical grid as a cell complex, whose cells are defined as an array of integers. The topology of the cells is defined by the parity of the coordinates (even: closed, odd: open).

Description of template class 'KhalimskyPreSpaceND'

This cellular grid space has no bounds (depending on the Integer type) and thus only provides static methods.

Template Parameters
dimthe dimension of the digital space.
TIntegerthe Integer class used to specify the arithmetic computations (default type = int32).
Note
Essentially a backport from ImaGene.
See also
KhalimskySpaceND
Examples
topology/khalimskySpaceScanner.cpp.

Definition at line 378 of file KhalimskyPreSpaceND.h.

Member Typedef Documentation

◆ Cell

template<Dimension dim, typename TInteger >
using DGtal::KhalimskyPreSpaceND< dim, TInteger >::Cell = KhalimskyPreCell< dim, Integer >

Definition at line 388 of file KhalimskyPreSpaceND.h.

◆ Cells

template<Dimension dim, typename TInteger >
using DGtal::KhalimskyPreSpaceND< dim, TInteger >::Cells = AnyCellCollection<Cell>

Definition at line 417 of file KhalimskyPreSpaceND.h.

◆ CellSet

template<Dimension dim, typename TInteger >
using DGtal::KhalimskyPreSpaceND< dim, TInteger >::CellSet = std::set<Cell>

Preferred type for defining a set of Cell(s).

Definition at line 422 of file KhalimskyPreSpaceND.h.

◆ DirIterator

template<Dimension dim, typename TInteger >
using DGtal::KhalimskyPreSpaceND< dim, TInteger >::DirIterator = PreCellDirectionIterator< dim, Integer >

Definition at line 393 of file KhalimskyPreSpaceND.h.

◆ Integer

template<Dimension dim, typename TInteger >
using DGtal::KhalimskyPreSpaceND< dim, TInteger >::Integer = TInteger

Arithmetic ring induced by (+,-,*) and Integer numbers.

Definition at line 385 of file KhalimskyPreSpaceND.h.

◆ Point

template<Dimension dim, typename TInteger >
using DGtal::KhalimskyPreSpaceND< dim, TInteger >::Point = PointVector< dim, Integer >

Definition at line 396 of file KhalimskyPreSpaceND.h.

◆ PreCellularGridSpace

template<Dimension dim, typename TInteger >
using DGtal::KhalimskyPreSpaceND< dim, TInteger >::PreCellularGridSpace = KhalimskyPreSpaceND<dim, Integer>

Definition at line 400 of file KhalimskyPreSpaceND.h.

◆ SCell

template<Dimension dim, typename TInteger >
using DGtal::KhalimskyPreSpaceND< dim, TInteger >::SCell = SignedKhalimskyPreCell< dim, Integer >

Definition at line 389 of file KhalimskyPreSpaceND.h.

◆ SCells

template<Dimension dim, typename TInteger >
using DGtal::KhalimskyPreSpaceND< dim, TInteger >::SCells = AnyCellCollection<SCell>

Definition at line 418 of file KhalimskyPreSpaceND.h.

◆ SCellSet

template<Dimension dim, typename TInteger >
using DGtal::KhalimskyPreSpaceND< dim, TInteger >::SCellSet = std::set<SCell>

Preferred type for defining a set of SCell(s).

Definition at line 425 of file KhalimskyPreSpaceND.h.

◆ Sign

template<Dimension dim, typename TInteger >
using DGtal::KhalimskyPreSpaceND< dim, TInteger >::Sign = bool

Definition at line 392 of file KhalimskyPreSpaceND.h.

◆ Space

template<Dimension dim, typename TInteger >
using DGtal::KhalimskyPreSpaceND< dim, TInteger >::Space = SpaceND<dim, Integer>

Definition at line 399 of file KhalimskyPreSpaceND.h.

◆ Surfel

template<Dimension dim, typename TInteger >
using DGtal::KhalimskyPreSpaceND< dim, TInteger >::Surfel = SCell

Definition at line 391 of file KhalimskyPreSpaceND.h.

◆ SurfelSet

template<Dimension dim, typename TInteger >
using DGtal::KhalimskyPreSpaceND< dim, TInteger >::SurfelSet = std::set<SCell>

Preferred type for defining a set of surfels (always signed cells).

Definition at line 428 of file KhalimskyPreSpaceND.h.

◆ Vector

template<Dimension dim, typename TInteger >
using DGtal::KhalimskyPreSpaceND< dim, TInteger >::Vector = PointVector< dim, Integer >

Definition at line 397 of file KhalimskyPreSpaceND.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<Dimension dim, typename TInteger >
DGtal::KhalimskyPreSpaceND< dim, TInteger >::BOOST_CONCEPT_ASSERT ( (concepts::CInteger< TInteger >) )
private

Integer must be signed to characterize a ring.

◆ exteriorVoxel()

template<Dimension dim, typename TInteger >
static Point DGtal::KhalimskyPreSpaceND< dim, TInteger >::exteriorVoxel ( const SCell & c)
static

For a given surfel ((n-1)-signed cell), returns its exterior voxel (point in Z^d given by the indirect incident n-cell to the given cell).

Parameters
cany signed pre-cell.
Returns
the outer voxel.

◆ interiorVoxel()

template<Dimension dim, typename TInteger >
static Point DGtal::KhalimskyPreSpaceND< dim, TInteger >::interiorVoxel ( const SCell & c)
static

For a given surfel ((n-1)-signed cell), returns its interior voxel (point in Z^d given by the direct incident n-cell to the given cell).

Parameters
cany signed pre-cell.
Returns
the inner voxel.

◆ isValid()

template<Dimension dim, typename TInteger >
static constexpr bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::isValid ( )
staticconstexpr

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ sAdjacent()

template<Dimension dim, typename TInteger >
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sAdjacent ( const SCell & p,
Dimension k,
bool up )
static

Return the adjacent element to [p] along axis [k] in the given direction and orientation.

Parameters
pany pre-cell.
kthe coordinate that is changed.
upif 'true' the orientation is forward along axis [k], otherwise backward.
Returns
the adjacent element to [p] along axis [k] in the given direction and orientation.
Note
It is an alias to 'up ? sGetIncr( p, k ) : sGetDecr( p, k )'.

◆ sCell() [1/2]

template<Dimension dim, typename TInteger >
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sCell ( const Point & kp,
Sign sign = POS )
static

From the Khalimsky coordinates of a cell and a sign, builds the corresponding signed pre-cell.

Parameters
kpan integer point (Khalimsky coordinates of cell).
signthe sign of the cell (either POS or NEG).
Returns
the signed pre-cell.

◆ sCell() [2/2]

template<Dimension dim, typename TInteger >
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sCell ( Point p,
const SCell & c )
static

From the digital coordinates of a point in Zn and a signed cell type, builds the corresponding signed pre-cell.

Parameters
pan integer point (digital coordinates of cell).
canother cell defining the topology and sign.
Returns
the pre-cell having the topology and sign of [c] and the given digital coordinates [p].

◆ sCoord()

template<Dimension dim, typename TInteger >
static Integer DGtal::KhalimskyPreSpaceND< dim, TInteger >::sCoord ( const SCell & c,
Dimension k )
static

Return its digital coordinate along [k].

Parameters
cany signed pre-cell.
kany valid dimension.
Returns
its digital coordinate along [k].

◆ sCoords()

template<Dimension dim, typename TInteger >
static Point DGtal::KhalimskyPreSpaceND< dim, TInteger >::sCoords ( const SCell & c)
static

Return its digital coordinates.

Parameters
cany signed pre-cell.
Returns
its digital coordinates.

◆ sDim()

template<Dimension dim, typename TInteger >
static Dimension DGtal::KhalimskyPreSpaceND< dim, TInteger >::sDim ( const SCell & p)
static

Return the dimension of the pre-cell [p].

Parameters
pany signed pre-cell.
Returns
the dimension of the pre-cell [p].

◆ sDirect()

template<Dimension dim, typename TInteger >
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::sDirect ( const SCell & p,
Dimension k )
static

Return 'true' if the direct orientation of [p] along [k] is in the positive coordinate direction.

The direct orientation in a direction allows to go from positive incident pre-cells to positive incident pre-cells. This means that

KPreSpace::sSign( KPreSpace::sIncident( p, k, KPreSpace::sDirect( p, k ) ) ) == KPreSpace::POS

is always true.

Parameters
pany signed pre-cell.
kany coordinate.
Returns
the direct orientation of [p] along [k] (true is upward, false is backward).

◆ sDirectIncident()

template<Dimension dim, typename TInteger >
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sDirectIncident ( SCell p,
Dimension k )
static

Return the direct incident pre-cell of [p] along [k] (the incident pre-cell along [k])

Parameters
pany signed pre-cell.
kany coordinate.
Returns
the direct incident pre-cell of [p] along [k] (the incident pre-cell along [k])

◆ sDirs()

template<Dimension dim, typename TInteger >
static DirIterator DGtal::KhalimskyPreSpaceND< dim, TInteger >::sDirs ( const SCell & p)
static

Given a signed pre-cell [p], returns an iterator to iterate over each coordinate the cell spans. (A spel spans all coordinates; a surfel all but one, etc).

Example:

KPreSpace::SCell p;
...
for ( auto q = KPreSpace::uDirs( p ); q != 0; ++q )
{
Dimension dir = *q;
...
}
DGtal::uint32_t Dimension
Definition Common.h:136
Parameters
pany signed pre-cell.
Returns
an iterator that points on the first coordinate spanned by the pre-cell.

◆ selfDisplay()

template<Dimension dim, typename TInteger >
static void DGtal::KhalimskyPreSpaceND< dim, TInteger >::selfDisplay ( std::ostream & out)
static

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ sGetAdd()

template<Dimension dim, typename TInteger >
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sGetAdd ( SCell p,
Dimension k,
Integer x )
static

Return the same element as [p] except for a coordinate [k] incremented with x.

Parameters
pany pre-cell.
kthe coordinate that is changed.
xthe increment.
Returns
the same element as [p] except for a coordinate [k] incremented with x.

◆ sGetDecr()

template<Dimension dim, typename TInteger >
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sGetDecr ( SCell p,
Dimension k )
static

Return the same element as [p] except for an decremented coordinate [k].

Parameters
pany pre-cell.
kthe coordinate that is changed.
Returns
the same element as [p] except for an decremented coordinate [k].

◆ sGetIncr()

template<Dimension dim, typename TInteger >
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sGetIncr ( SCell p,
Dimension k )
static

Return the same element as [p] except for the incremented coordinate [k].

Parameters
pany pre-cell.
kthe coordinate that is changed.
Returns
the same element as [p] except for the incremented coordinate [k].

◆ sGetSub()

template<Dimension dim, typename TInteger >
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sGetSub ( SCell p,
Dimension k,
Integer x )
static

Return the same element as [p] except for a coordinate [k] decremented with x.

Parameters
pany pre-cell.
kthe coordinate that is changed.
xthe decrement.
Returns
the same element as [p] except for a coordinate [k] decremented with x.

◆ signs()

template<Dimension dim, typename TInteger >
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::signs ( const Cell & p,
Sign s )
static

Creates a signed pre-cell from an unsigned one and a given sign.

Parameters
pany unsigned pre-cell.
sa sign.
Returns
the signed version of the pre-cell [p] with sign [s].

◆ sIncident()

template<Dimension dim, typename TInteger >
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sIncident ( SCell c,
Dimension k,
bool up )
static

Return the forward or backward signed pre-cell incident to [c] along axis [k], depending on [up].

Parameters
cany signed pre-cell.
kany coordinate.
upif 'true' the orientation is forward along axis [k], otherwise backward.
Returns
the forward or backward signed pre-cell incident to [c] along axis [k], depending on [up]. It is worthy to note that the forward and backward pre-cell have opposite sign. Furthermore, the sign of these pre-cells is defined so as to satisfy a boundary operator.
Note
It may be a lower incident pre-cell if [c] is open along axis [k], else an upper incident pre-cell.

◆ sIndirectIncident()

template<Dimension dim, typename TInteger >
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sIndirectIncident ( SCell p,
Dimension k )
static

Return the indirect incident pre-cell of [p] along [k] (the incident cell along [k] whose sign is negative).

Parameters
pany signed pre-cell.
kany coordinate.
Returns
the indirect incident pre-cell of [p] along [k] (the incident cell along [k] whose sign is negative).

◆ sIsInside() [1/2]

template<Dimension dim, typename TInteger >
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::sIsInside ( const SCell & p)
static

Useful to check if you are going out of the space.

Only for compatibility reasons.

Parameters
pany pre-cell.
Returns
always true.

◆ sIsInside() [2/2]

template<Dimension dim, typename TInteger >
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::sIsInside ( const SCell & p,
Dimension k )
static

Useful to check if you are going out of the space.

Only for compatibility reasons.

Parameters
pany pre-cell.
kthe tested coordinate.
Returns
always true.

◆ sIsMax()

template<Dimension dim, typename TInteger >
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::sIsMax ( const SCell & p,
Dimension k )
static

Useful to check if you are going out of the space.

Only for compatibility reasons.

Parameters
pany pre-cell.
kthe tested coordinate.
Returns
always false.

◆ sIsMin()

template<Dimension dim, typename TInteger >
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::sIsMin ( const SCell & p,
Dimension k )
static

Useful to check if you are going out of the space.

Only for compatibility reasons.

Parameters
pany pre-cell.
kthe tested coordinate.
Returns
always false.

◆ sIsOpen()

template<Dimension dim, typename TInteger >
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::sIsOpen ( const SCell & p,
Dimension k )
static

Return 'true' if [p] is open along the direction [k].

Parameters
pany signed pre-cell.
kany direction.
Returns
'true' if [p] is open along the direction [k].

◆ sIsSurfel()

template<Dimension dim, typename TInteger >
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::sIsSurfel ( const SCell & b)
static

Return 'true' if [b] is a surfel (spans all but one coordinate).

Parameters
bany signed pre-cell.
Returns
'true' if [b] is a surfel (spans all but one coordinate).

◆ sKCoord()

template<Dimension dim, typename TInteger >
static Integer DGtal::KhalimskyPreSpaceND< dim, TInteger >::sKCoord ( const SCell & c,
Dimension k )
static

Return its Khalimsky coordinate along [k].

Parameters
cany signed pre-cell.
kany valid dimension.
Returns
its Khalimsky coordinate along [k].

◆ sKCoords()

template<Dimension dim, typename TInteger >
static const Point & DGtal::KhalimskyPreSpaceND< dim, TInteger >::sKCoords ( const SCell & c)
static

Return its Khalimsky coordinates.

Parameters
cany signed pre-cell.
Returns
its Khalimsky coordinates.

◆ sLowerIncident()

template<Dimension dim, typename TInteger >
static SCells DGtal::KhalimskyPreSpaceND< dim, TInteger >::sLowerIncident ( const SCell & c)
static

Return the signed pre-cells directly low incident to c.

Parameters
cany signed pre-cell.
Returns
the signed pre-cells directly low incident to c.
Note
it is the lower boundary of c expressed as a list of signed pre-cells.

◆ sNeighborhood()

template<Dimension dim, typename TInteger >
static SCells DGtal::KhalimskyPreSpaceND< dim, TInteger >::sNeighborhood ( const SCell & cell)
static

Computes the 1-neighborhood of the pre-cell [c] and returns it.

It is the set of pre-cells with same topology that are adjacent to [c].

Parameters
cellthe signed pre-cell of interest.
Returns
the pre-cells of the 1-neighborhood of [cell].

◆ sNext()

template<Dimension dim, typename TInteger >
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::sNext ( SCell & p,
const SCell & lower,
const SCell & upper )
static

Increment the pre-cell [p] to its next position (as classically done in a scanning).

Example:

Cell first, last; // lower and upper bounds
Cell p = first;
do
{ // ... whatever [p] is the current cell
}
while ( KPreSpace::uNext( p, first, last ) );
Parameters
pany pre-cell.
lowerthe lower bound.
upperthe upper bound.
Returns
true if p is still within the bounds, false if the scanning is finished.
Precondition
sTopology(p) == sTopology(lower) == sTopology(upper).

◆ sOpp()

template<Dimension dim, typename TInteger >
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sOpp ( const SCell & p)
static

Creates the signed pre-cell with the inverse sign of [p].

Parameters
pany signed pre-cell.
Returns
the pre-cell [p] with opposite sign.

◆ sOrthDir()

template<Dimension dim, typename TInteger >
static Dimension DGtal::KhalimskyPreSpaceND< dim, TInteger >::sOrthDir ( const SCell & s)
static

Given a signed pre-surfel [s], returns its orthogonal direction (ie, the coordinate where the surfel is closed).

Parameters
sa signed pre-surfel
Returns
the orthogonal direction of [s]

◆ sOrthDirs()

template<Dimension dim, typename TInteger >
static DirIterator DGtal::KhalimskyPreSpaceND< dim, TInteger >::sOrthDirs ( const SCell & p)
static

Given a signed pre-cell [p], returns an iterator to iterate over each coordinate the cell does not span. (A spel spans all coordinates; a surfel all but one, etc).

Example:

KPreSpace::SCell p;
...
for ( auto q = KPreSpace::uOrthDirs( p ); q != 0; ++q )
{
Dimension dir = *q;
...
}
Parameters
pany signed pre-cell.
Returns
an iterator that points on the first coordinate spanned by the cell.

◆ sPointel()

template<Dimension dim, typename TInteger >
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sPointel ( Point p,
Sign sign = POS )
static

From the digital coordinates of a point in Zn, builds the corresponding pre-pointel (pre-cell of dimension 0).

Parameters
pan integer point (digital coordinates of cell).
signthe sign of the cell (either POS or NEG).
Returns
the signed pre-pointel having the given digital coordinates [p].

◆ sProject()

template<Dimension dim, typename TInteger >
static void DGtal::KhalimskyPreSpaceND< dim, TInteger >::sProject ( SCell & p,
const SCell & bound,
Dimension k )
static

Projects [p] along the [k]th direction toward [bound].

Otherwise said, p[ k ] == bound[ k ] afterwards.

Parameters
pany pre-cell.
boundthe element acting as bound (same topology as p).
kthe concerned coordinate.
Precondition
sIsOpen(p, k) == sIsOpen(bound, k)

◆ sProjection()

template<Dimension dim, typename TInteger >
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sProjection ( SCell p,
const SCell & bound,
Dimension k )
static

Return the projection of [p] along the [k]th direction toward [bound].

Otherwise said, p[ k ] == bound[ k ] afterwards.

Parameters
pany pre-cell.
boundthe element acting as bound (same topology as p).
kthe concerned coordinate.
Returns
the projection.
Precondition
sIsOpen(p, k) == sIsOpen(bound, k)
Postcondition
sTopology(p) == sTopology(sProjection(p, bound, k)).

◆ sProperNeighborhood()

template<Dimension dim, typename TInteger >
static SCells DGtal::KhalimskyPreSpaceND< dim, TInteger >::sProperNeighborhood ( const SCell & cell)
static

Computes the proper 1-neighborhood of the pre-cell [c] and returns it.

It is the set of pre-cells with same topology that are adjacent to [c] and different from [c].

Parameters
cellthe signed pre-cell of interest.
Returns
the pre-cells of the proper 1-neighborhood of [cell].

◆ sSetCoord()

template<Dimension dim, typename TInteger >
static void DGtal::KhalimskyPreSpaceND< dim, TInteger >::sSetCoord ( SCell & c,
Dimension k,
Integer i )
static

Sets the [k]-th digital coordinate of [c] to [i].

Parameters
cany signed pre-cell.
kany valid dimension.
ian integer coordinate.

◆ sSetCoords()

template<Dimension dim, typename TInteger >
static void DGtal::KhalimskyPreSpaceND< dim, TInteger >::sSetCoords ( SCell & c,
const Point & kp )
static

Sets the digital coordinates of [c] to [kp].

Parameters
cany signed pre-cell.
kpthe new digital coordinates for [c].

◆ sSetKCoord()

template<Dimension dim, typename TInteger >
static void DGtal::KhalimskyPreSpaceND< dim, TInteger >::sSetKCoord ( SCell & c,
Dimension k,
Integer i )
static

Sets the [k]-th Khalimsky coordinate of [c] to [i].

Parameters
cany signed pre-cell.
kany valid dimension.
ian integer coordinate.

◆ sSetKCoords()

template<Dimension dim, typename TInteger >
static void DGtal::KhalimskyPreSpaceND< dim, TInteger >::sSetKCoords ( SCell & c,
const Point & kp )
static

Sets the Khalimsky coordinates of [c] to [kp].

Parameters
cany signed pre-cell.
kpthe new Khalimsky coordinates for [c].

◆ sSetSign()

template<Dimension dim, typename TInteger >
static void DGtal::KhalimskyPreSpaceND< dim, TInteger >::sSetSign ( SCell & c,
Sign s )
static

Sets the sign of the pre-cell.

Parameters
c(modified) any signed pre-cell.
sany sign.

◆ sSign()

template<Dimension dim, typename TInteger >
static Sign DGtal::KhalimskyPreSpaceND< dim, TInteger >::sSign ( const SCell & c)
static

Return its sign.

Parameters
cany signed pre-cell.
Returns
its sign.

◆ sSpel()

template<Dimension dim, typename TInteger >
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sSpel ( Point p,
Sign sign = POS )
static

From the digital coordinates of a point in Zn, builds the corresponding pre-spel (pre-cell of maximal dimension).

Parameters
pan integer point (digital coordinates of cell).
signthe sign of the cell (either POS or NEG).
Returns
the signed pre-spel having the given digital coordinates [p].

◆ sTopology()

template<Dimension dim, typename TInteger >
static Integer DGtal::KhalimskyPreSpaceND< dim, TInteger >::sTopology ( const SCell & p)
static

Return the topology word of [p].

Parameters
pany signed pre-cell.
Returns
the topology word of [p].

◆ sTranslation()

template<Dimension dim, typename TInteger >
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sTranslation ( SCell p,
const Vector & vec )
static

Add the vector [vec] to [p].

Parameters
pany pre-cell.
vecany pointel.
Returns
the signed code of the cell [p] translated by [coord].

◆ sUpperIncident()

template<Dimension dim, typename TInteger >
static SCells DGtal::KhalimskyPreSpaceND< dim, TInteger >::sUpperIncident ( const SCell & c)
static

Return the signed pre-cells directly up incident to c.

Parameters
cany signed pre-cell.
Returns
the signed pre-cells directly up incident to c.
Note
it is the upper boundary of c expressed as a list of signed pre-cells.

◆ uAddCoFaces()

template<Dimension dim, typename TInteger >
static void DGtal::KhalimskyPreSpaceND< dim, TInteger >::uAddCoFaces ( Cells & cofaces,
const Cell & c,
Dimension axis )
staticprivate

Used by uCoFaces for computing incident cofaces.

◆ uAddFaces()

template<Dimension dim, typename TInteger >
static void DGtal::KhalimskyPreSpaceND< dim, TInteger >::uAddFaces ( Cells & faces,
const Cell & c,
Dimension axis )
staticprivate

Used by uFaces for computing incident faces.

◆ uAdjacent()

template<Dimension dim, typename TInteger >
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uAdjacent ( const Cell & p,
Dimension k,
bool up )
static

Return the adjacent element to [p] along axis [k] in the given direction and orientation.

Parameters
pany pre-cell.
kthe coordinate that is changed.
upif 'true' the orientation is forward along axis [k], otherwise backward.
Returns
the adjacent element to [p] along axis [k] in the given direction and orientation.
Note
It is an alias to 'up ? uGetIncr( p, k ) : uGetDecr( p, k )'.

◆ uCell() [1/2]

template<Dimension dim, typename TInteger >
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uCell ( const Point & kp)
static

From the Khalimsky coordinates of a cell, builds the corresponding unsigned pre-cell.

Parameters
kpan integer point (Khalimsky coordinates of cell).
Returns
the unsigned pre-cell.
Examples
topology/khalimskySpaceScanner.cpp.

◆ uCell() [2/2]

template<Dimension dim, typename TInteger >
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uCell ( Point p,
const Cell & c )
static

From the digital coordinates of a point in Zn and a cell type, builds the corresponding unsigned pre-cell.

Parameters
pan integer point (digital coordinates of cell).
canother cell defining the topology.
Returns
the pre-cell having the topology of [c] and the given digital coordinates [p].

◆ uCoFaces()

template<Dimension dim, typename TInteger >
static Cells DGtal::KhalimskyPreSpaceND< dim, TInteger >::uCoFaces ( const Cell & c)
static

Return the proper cofaces of [c] (chain of upper incidence).

Parameters
cany unsigned ipre-cell.
Returns
the proper cofaces of [c] (chain of upper incidence).

◆ uCoord()

template<Dimension dim, typename TInteger >
static Integer DGtal::KhalimskyPreSpaceND< dim, TInteger >::uCoord ( const Cell & c,
Dimension k )
static

Return its digital coordinate along [k].

Parameters
cany unsigned pre-cell.
kany valid dimension.
Returns
its digital coordinate along [k].

◆ uCoords()

template<Dimension dim, typename TInteger >
static Point DGtal::KhalimskyPreSpaceND< dim, TInteger >::uCoords ( const Cell & c)
static

Return its digital coordinates.

Parameters
cany unsigned pre-cell.
Returns
its digital coordinates.

◆ uDim()

template<Dimension dim, typename TInteger >
static Dimension DGtal::KhalimskyPreSpaceND< dim, TInteger >::uDim ( const Cell & p)
static

Return the dimension of the pre-cell [p].

Parameters
pany unsigned pre-cell.
Returns
the dimension of the pre-cell [p].

◆ uDirs()

template<Dimension dim, typename TInteger >
static DirIterator DGtal::KhalimskyPreSpaceND< dim, TInteger >::uDirs ( const Cell & p)
static

Given an unsigned pre-cell [p], returns an iterator to iterate over each coordinate the cell spans. (A spel spans all coordinates; a surfel all but one, etc).

Example:

KPreSpace::Cell p;
...
for ( auto q = KPreSpace::uDirs( p ); q != 0; ++q )
{
Dimension dir = *q;
...
}
Parameters
pany unsigned pre-cell.
Returns
an iterator that points on the first coordinate spanned by the pre-cell.

◆ uFaces()

template<Dimension dim, typename TInteger >
static Cells DGtal::KhalimskyPreSpaceND< dim, TInteger >::uFaces ( const Cell & c)
static

Return the proper faces of [c] (chain of lower incidence).

Parameters
cany unsigned pre-cell.
Returns
the proper faces of [c] (chain of lower incidence).

◆ uGetAdd()

template<Dimension dim, typename TInteger >
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uGetAdd ( Cell p,
Dimension k,
Integer x )
static

Return the same element as [p] except for a coordinate [k] incremented with x.

Parameters
pany pre-cell.
kthe coordinate that is changed.
xthe increment.
Returns
the same element as [p] except for a coordinate [k] incremented with x.

◆ uGetDecr()

template<Dimension dim, typename TInteger >
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uGetDecr ( Cell p,
Dimension k )
static

Return the same element as [p] except for an decremented coordinate [k].

Parameters
pany pre-cell.
kthe coordinate that is changed.
Returns
the same element as [p] except for an decremented coordinate [k].

◆ uGetIncr()

template<Dimension dim, typename TInteger >
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uGetIncr ( Cell p,
Dimension k )
static

Return the same element as [p] except for the incremented coordinate [k].

Parameters
pany pre-cell.
kthe coordinate that is changed.
Returns
the same element as [p] except for the incremented coordinate [k].

◆ uGetSub()

template<Dimension dim, typename TInteger >
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uGetSub ( Cell p,
Dimension k,
Integer x )
static

Return the same element as [p] except for a coordinate [k] decremented with x.

Parameters
pany pre-cell.
kthe coordinate that is changed.
xthe decrement.
Returns
the same element as [p] except for a coordinate [k] decremented with x.

◆ uIncident()

template<Dimension dim, typename TInteger >
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uIncident ( Cell c,
Dimension k,
bool up )
static

Return the forward or backward unsigned pre-cell incident to [c] along axis [k], depending on [up].

Parameters
cany unsigned pre-cell.
kany coordinate.
upif 'true' the orientation is forward along axis [k], otherwise backward.
Returns
the forward or backward unsigned pre-cell incident to [c] along axis [k], depending on [up].
Note
It may be a lower incident pre-cell if [c] is open along axis [k], else an upper incident pre-cell.

◆ uIsInside() [1/2]

template<Dimension dim, typename TInteger >
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::uIsInside ( const Cell & p)
static

Useful to check if you are going out of the space.

Only for compatibility reasons.

Parameters
pany pre-cell.
Returns
always true.

◆ uIsInside() [2/2]

template<Dimension dim, typename TInteger >
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::uIsInside ( const Cell & p,
Dimension k )
static

Useful to check if you are going out of the space.

Only for compatibility reasons.

Parameters
pany pre-cell.
kthe tested coordinate.
Returns
always true.

◆ uIsMax()

template<Dimension dim, typename TInteger >
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::uIsMax ( const Cell & p,
Dimension k )
static

Useful to check if you are going out of the space.

Only for compatibility reasons.

Parameters
pany pre-cell.
kthe tested coordinate.
Returns
always false.

◆ uIsMin()

template<Dimension dim, typename TInteger >
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::uIsMin ( const Cell & p,
Dimension k )
static

Useful to check if you are going out of the space.

Only for compatibility reasons.

Parameters
pany pre-cell.
kthe tested coordinate.
Returns
always false.

◆ uIsOpen()

template<Dimension dim, typename TInteger >
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::uIsOpen ( const Cell & p,
Dimension k )
static

Return 'true' if [p] is open along the direction [k].

Parameters
pany pre-cell.
kany direction.
Returns
'true' if [p] is open along the direction [k].

◆ uIsSurfel()

template<Dimension dim, typename TInteger >
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::uIsSurfel ( const Cell & b)
static

Return 'true' if [b] is a surfel (spans all but one coordinate).

Parameters
bany unsigned pre-cell.
Returns
'true' if [b] is a surfel (spans all but one coordinate).

◆ uKCoord()

template<Dimension dim, typename TInteger >
static Integer DGtal::KhalimskyPreSpaceND< dim, TInteger >::uKCoord ( const Cell & c,
Dimension k )
static

Return its Khalimsky coordinate along [k].

Parameters
cany unsigned pre-cell.
kany valid dimension.
Returns
its Khalimsky coordinate along [k].

◆ uKCoords()

template<Dimension dim, typename TInteger >
static const Point & DGtal::KhalimskyPreSpaceND< dim, TInteger >::uKCoords ( const Cell & c)
static

Return its Khalimsky coordinates.

Parameters
cany unsigned pre-cell.
Returns
its Khalimsky coordinates.

◆ uLowerIncident()

template<Dimension dim, typename TInteger >
static Cells DGtal::KhalimskyPreSpaceND< dim, TInteger >::uLowerIncident ( const Cell & c)
static

Return the pre-cells directly low incident to c.

Parameters
cany unsigned pre-cell.
Returns
the pre-cells directly low incident to c.

◆ uNeighborhood()

template<Dimension dim, typename TInteger >
static Cells DGtal::KhalimskyPreSpaceND< dim, TInteger >::uNeighborhood ( const Cell & cell)
static

Computes the 1-neighborhood of the pre-cell [c] and returns it.

It is the set of cells with same topology that are adjacent to [c].

Parameters
cellthe unsigned pre-cell of interest.
Returns
the pre-cells of the 1-neighborhood of [cell].

◆ uNext()

template<Dimension dim, typename TInteger >
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::uNext ( Cell & p,
const Cell & lower,
const Cell & upper )
static

Increment the pre-cell [p] to its next position (as classically done in a scanning).

Example:

Cell first, last; // lower and upper bounds
Cell p = first;
do
{ // ... whatever [p] is the current cell
}
while ( KPreSpace::uNext( p, first, last ) );
Parameters
pany pre-cell.
lowerthe lower bound.
upperthe upper bound.
Returns
true if p is still within the bounds, false if the scanning is finished.
Precondition
uTopology(p) == uTopology(lower) == uTopology(upper).

◆ unsigns()

template<Dimension dim, typename TInteger >
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::unsigns ( const SCell & p)
static

Creates an unsigned pre-cell from a signed one.

Parameters
pany signed pre-cell.
Returns
the unsigned version of the pre-cell [p].

◆ uOrthDir()

template<Dimension dim, typename TInteger >
static Dimension DGtal::KhalimskyPreSpaceND< dim, TInteger >::uOrthDir ( const Cell & s)
static

Given an unsigned pre-surfel [s], returns its orthogonal direction (ie, the coordinate where the surfel is closed).

Parameters
san unsigned pre-surfel
Returns
the orthogonal direction of [s]

◆ uOrthDirs()

template<Dimension dim, typename TInteger >
static DirIterator DGtal::KhalimskyPreSpaceND< dim, TInteger >::uOrthDirs ( const Cell & p)
static

Given an unsigned pre-cell [p], returns an iterator to iterate over each coordinate the cell does not span. (A spel spans all coordinates; a surfel all but one, etc).

Example:

KPreSpace::Cell p;
...
for ( auto q = KPreSpace::uOrthDirs( p ); q != 0; ++q )
{
Dimension dir = *q;
...
}
Parameters
pany unsigned pre-cell.
Returns
an iterator that points on the first coordinate spanned by the cell.

◆ uPointel()

template<Dimension dim, typename TInteger >
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uPointel ( Point p)
static

From the digital coordinates of a point in Zn, builds the corresponding pre-pointel (pre-cell of dimension 0).

Parameters
pan integer point (digital coordinates of cell).
Returns
the pre-pointel having the given digital coordinates [p].

◆ uProject()

template<Dimension dim, typename TInteger >
static void DGtal::KhalimskyPreSpaceND< dim, TInteger >::uProject ( Cell & p,
const Cell & bound,
Dimension k )
static

Projects [p] along the [k]th direction toward [bound].

Otherwise said, p[ k ] == bound[ k ] afterwards

Parameters
[in,out]pany pre-cell.
[in]boundthe element acting as bound (same topology as p).
[in]kthe concerned coordinate.
Precondition
uIsOpen(p, k) == uIsOpen(bound, k)

◆ uProjection()

template<Dimension dim, typename TInteger >
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uProjection ( Cell p,
const Cell & bound,
Dimension k )
static

Return the projection of [p] along the [k]th direction toward [bound].

Otherwise said, p[ k ] == bound[ k ] afterwards.

Parameters
pany pre-cell.
boundthe element acting as bound (same topology as p).
kthe concerned coordinate.
Returns
the projection.
Precondition
uIsOpen(p, k) == uIsOpen(bound, k)
Postcondition
uTopology(p) == uTopology(uProjection(p, bound, k)).

◆ uProperNeighborhood()

template<Dimension dim, typename TInteger >
static Cells DGtal::KhalimskyPreSpaceND< dim, TInteger >::uProperNeighborhood ( const Cell & cell)
static

Computes the proper 1-neighborhood of the pre-cell [c] and returns it.

It is the set of pre-cells with same topology that are adjacent to [c] and different from [c].

Parameters
cellthe unsigned pre-cell of interest.
Returns
the pre-cells of the proper 1-neighborhood of [cell].

◆ uSetCoord()

template<Dimension dim, typename TInteger >
static void DGtal::KhalimskyPreSpaceND< dim, TInteger >::uSetCoord ( Cell & c,
Dimension k,
Integer i )
static

Sets the [k]-th digital coordinate of [c] to [i].

Parameters
cany unsigned pre-cell.
kany valid dimension.
ian integer coordinate.

◆ uSetCoords()

template<Dimension dim, typename TInteger >
static void DGtal::KhalimskyPreSpaceND< dim, TInteger >::uSetCoords ( Cell & c,
const Point & kp )
static

Sets the digital coordinates of [c] to [kp].

Parameters
cany unsigned pre-cell.
kpthe new digital coordinates for [c].

◆ uSetKCoord()

template<Dimension dim, typename TInteger >
static void DGtal::KhalimskyPreSpaceND< dim, TInteger >::uSetKCoord ( Cell & c,
Dimension k,
Integer i )
static

Sets the [k]-th Khalimsky coordinate of [c] to [i].

Parameters
cany unsigned pre-cell.
kany valid dimension.
ian integer coordinate.

◆ uSetKCoords()

template<Dimension dim, typename TInteger >
static void DGtal::KhalimskyPreSpaceND< dim, TInteger >::uSetKCoords ( Cell & c,
const Point & kp )
static

Sets the Khalimsky coordinates of [c] to [kp].

Parameters
cany unsigned pre-cell.
kpthe new Khalimsky coordinates for [c].

◆ uSpel()

template<Dimension dim, typename TInteger >
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uSpel ( Point p)
static

From the digital coordinates of a point in Zn, builds the corresponding pre-spel (pre-cell of maximal dimension).

Parameters
pan integer point (digital coordinates of cell).
Returns
the pre-spel having the given digital coordinates [p].

◆ uTopology()

template<Dimension dim, typename TInteger >
static Integer DGtal::KhalimskyPreSpaceND< dim, TInteger >::uTopology ( const Cell & p)
static

Return the topology word of [p].

Parameters
pany unsigned pre-cell.
Returns
the topology word of [p].

◆ uTranslation()

template<Dimension dim, typename TInteger >
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uTranslation ( Cell p,
const Vector & vec )
static

Add the vector [vec] to [p].

Parameters
pany pre-cell.
vecany pointel.
Returns
the unsigned copy of the pre-cell [p] translated by [coord].

◆ uUpperIncident()

template<Dimension dim, typename TInteger >
static Cells DGtal::KhalimskyPreSpaceND< dim, TInteger >::uUpperIncident ( const Cell & c)
static

Return the pre-cells directly up incident to c.

Parameters
cany unsigned pre-cell.
Returns
the pre-cells directly up incident to c.

Field Documentation

◆ DIM

template<Dimension dim, typename TInteger >
const Dimension DGtal::KhalimskyPreSpaceND< dim, TInteger >::DIM = dim
staticconstexpr

Definition at line 404 of file KhalimskyPreSpaceND.h.

◆ dimension

template<Dimension dim, typename TInteger >
const Dimension DGtal::KhalimskyPreSpaceND< dim, TInteger >::dimension = dim
staticconstexpr

Definition at line 403 of file KhalimskyPreSpaceND.h.

◆ NEG

template<Dimension dim, typename TInteger >
const Sign DGtal::KhalimskyPreSpaceND< dim, TInteger >::NEG = false
staticconstexpr

Definition at line 406 of file KhalimskyPreSpaceND.h.

◆ POS

template<Dimension dim, typename TInteger >
const Sign DGtal::KhalimskyPreSpaceND< dim, TInteger >::POS = true
staticconstexpr

Definition at line 405 of file KhalimskyPreSpaceND.h.


The documentation for this class was generated from the following file: