DGtal  0.9.4beta
Data Structures | Public Types | Static Public Attributes | Private Member Functions
DGtal::KhalimskyPreSpaceND< dim, TInteger > Class Template Reference

#include <DGtal/topology/KhalimskyPreSpaceND.h>

Data Structures

struct  AnyCellCollection
 
struct  CellMap
 
struct  SCellMap
 
struct  SurfelMap
 

Public Types

using Integer = TInteger
 
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 >
 
using SCellSet = std::set< SCell >
 
using SurfelSet = std::set< SCell >
 

Static Public Member Functions

Pre-cell creation services (static methods)
static Cell uCell (const Point &kp)
 
static Cell uCell (Point p, const Cell &c)
 
static SCell sCell (const Point &kp, Sign sign=POS)
 
static SCell sCell (Point p, const SCell &c)
 
static Cell uSpel (Point p)
 
static SCell sSpel (Point p, Sign sign=POS)
 
static Cell uPointel (Point p)
 
static SCell sPointel (Point p, Sign sign=POS)
 
Read accessors to pre-cells
static Integer uKCoord (const Cell &c, Dimension k)
 
static Integer uCoord (const Cell &c, Dimension k)
 
static const PointuKCoords (const Cell &c)
 
static Point uCoords (const Cell &c)
 
static Integer sKCoord (const SCell &c, Dimension k)
 
static Integer sCoord (const SCell &c, Dimension k)
 
static const PointsKCoords (const SCell &c)
 
static Point sCoords (const SCell &c)
 
static Sign sSign (const SCell &c)
 
Write accessors to pre-cells
static void uSetKCoord (Cell &c, Dimension k, Integer i)
 
static void sSetKCoord (SCell &c, Dimension k, Integer i)
 
static void uSetCoord (Cell &c, Dimension k, Integer i)
 
static void sSetCoord (SCell &c, Dimension k, Integer i)
 
static void uSetKCoords (Cell &c, const Point &kp)
 
static void sSetKCoords (SCell &c, const Point &kp)
 
static void uSetCoords (Cell &c, const Point &kp)
 
static void sSetCoords (SCell &c, const Point &kp)
 
static void sSetSign (SCell &c, Sign s)
 
Conversion signed/unsigned
static SCell signs (const Cell &p, Sign s)
 
static Cell unsigns (const SCell &p)
 
static SCell sOpp (const SCell &p)
 
Pre-cell topology services
static Integer uTopology (const Cell &p)
 
static Integer sTopology (const SCell &p)
 
static Dimension uDim (const Cell &p)
 
static Dimension sDim (const SCell &p)
 
static bool uIsSurfel (const Cell &b)
 
static bool sIsSurfel (const SCell &b)
 
static bool uIsOpen (const Cell &p, Dimension k)
 
static bool sIsOpen (const SCell &p, Dimension k)
 
Iterator services for cells
static DirIterator uDirs (const Cell &p)
 
static DirIterator sDirs (const SCell &p)
 
static DirIterator uOrthDirs (const Cell &p)
 
static DirIterator sOrthDirs (const SCell &p)
 
static Dimension uOrthDir (const Cell &s)
 
static Dimension sOrthDir (const SCell &s)
 
Unsigned pre-cell geometry services
static Cell uGetIncr (Cell p, Dimension k)
 
static bool uIsMax (const Cell &p, Dimension k)
 
static bool uIsInside (const Cell &p, Dimension k)
 
static bool uIsInside (const Cell &p)
 
static Cell uGetDecr (Cell p, Dimension k)
 
static bool uIsMin (const Cell &p, Dimension k)
 
static Cell uGetAdd (Cell p, Dimension k, Integer x)
 
static Cell uGetSub (Cell p, Dimension k, Integer x)
 
static Cell uTranslation (Cell p, const Vector &vec)
 
static Cell uProjection (Cell p, const Cell &bound, Dimension k)
 
static void uProject (Cell &p, const Cell &bound, Dimension k)
 
static bool uNext (Cell &p, const Cell &lower, const Cell &upper)
 
Signed pre-cell geometry services
static SCell sGetIncr (SCell p, Dimension k)
 
static bool sIsMax (const SCell &p, Dimension k)
 
static bool sIsInside (const SCell &p, Dimension k)
 
static bool sIsInside (const SCell &p)
 
static SCell sGetDecr (SCell p, Dimension k)
 
static bool sIsMin (const SCell &p, Dimension k)
 
static SCell sGetAdd (SCell p, Dimension k, Integer x)
 
static SCell sGetSub (SCell p, Dimension k, Integer x)
 
static SCell sTranslation (SCell p, const Vector &vec)
 
static SCell sProjection (SCell p, const SCell &bound, Dimension k)
 
static void sProject (SCell &p, const SCell &bound, Dimension k)
 
static bool sNext (SCell &p, const SCell &lower, const SCell &upper)
 
Neighborhood services
static Cells uNeighborhood (const Cell &cell)
 
static SCells sNeighborhood (const SCell &cell)
 
static Cells uProperNeighborhood (const Cell &cell)
 
static SCells sProperNeighborhood (const SCell &cell)
 
static Cell uAdjacent (const Cell &p, Dimension k, bool up)
 
static SCell sAdjacent (const SCell &p, Dimension k, bool up)
 
Incidence services
static Cell uIncident (Cell c, Dimension k, bool up)
 
static SCell sIncident (SCell c, Dimension k, bool up)
 
static Cells uLowerIncident (const Cell &c)
 
static Cells uUpperIncident (const Cell &c)
 
static SCells sLowerIncident (const SCell &c)
 
static SCells sUpperIncident (const SCell &c)
 
static Cells uFaces (const Cell &c)
 
static Cells uCoFaces (const Cell &c)
 
static bool sDirect (const SCell &p, Dimension k)
 
static SCell sDirectIncident (SCell p, Dimension k)
 
static SCell sIndirectIncident (SCell p, Dimension k)
 
DGtal interface
static void selfDisplay (std::ostream &out)
 
static constexpr bool isValid ()
 

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 >))
 

Static Private Member Functions

Internals
static void uAddFaces (Cells &faces, const Cell &c, Dimension axis)
 
static void uAddCoFaces (Cells &cofaces, const Cell &c, Dimension axis)
 

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 61 of file KhalimskyPreSpaceND.h.

Member Typedef Documentation

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

Definition at line 382 of file KhalimskyPreSpaceND.h.

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

Definition at line 411 of file KhalimskyPreSpaceND.h.

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 416 of file KhalimskyPreSpaceND.h.

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

Definition at line 387 of file KhalimskyPreSpaceND.h.

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

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

Definition at line 379 of file KhalimskyPreSpaceND.h.

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

Definition at line 390 of file KhalimskyPreSpaceND.h.

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

Definition at line 394 of file KhalimskyPreSpaceND.h.

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

Definition at line 383 of file KhalimskyPreSpaceND.h.

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

Definition at line 412 of file KhalimskyPreSpaceND.h.

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 419 of file KhalimskyPreSpaceND.h.

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

Definition at line 386 of file KhalimskyPreSpaceND.h.

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

Definition at line 393 of file KhalimskyPreSpaceND.h.

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

Definition at line 385 of file KhalimskyPreSpaceND.h.

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 422 of file KhalimskyPreSpaceND.h.

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

Definition at line 391 of file KhalimskyPreSpaceND.h.

Member Function Documentation

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

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<Dimension dim, typename TInteger>
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sAdjacent ( const SCell p,
Dimension  k,
bool  up 
)
static
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 )'.
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.
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].
template<Dimension dim, typename TInteger>
static Integer DGtal::KhalimskyPreSpaceND< dim, TInteger >::sCoord ( const SCell c,
Dimension  k 
)
static
Parameters
cany signed pre-cell.
kany valid dimension.
Returns
its digital coordinate along [k].
template<Dimension dim, typename TInteger>
static Point DGtal::KhalimskyPreSpaceND< dim, TInteger >::sCoords ( const SCell c)
static
Parameters
cany signed pre-cell.
Returns
its digital coordinates.
template<Dimension dim, typename TInteger>
static Dimension DGtal::KhalimskyPreSpaceND< dim, TInteger >::sDim ( const SCell p)
static
Parameters
pany signed pre-cell.
Returns
the dimension of the pre-cell [p].
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).
template<Dimension dim, typename TInteger>
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sDirectIncident ( SCell  p,
Dimension  k 
)
static
Parameters
pany signed pre-cell.
kany coordinate.
Returns
the direct incident pre-cell of [p] along [k] (the incident pre-cell along [k])
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;
...
}
Parameters
pany signed pre-cell.
Returns
an iterator that points on the first coordinate spanned by the pre-cell.
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.
template<Dimension dim, typename TInteger>
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sGetAdd ( SCell  p,
Dimension  k,
Integer  x 
)
static
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.
template<Dimension dim, typename TInteger>
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sGetDecr ( SCell  p,
Dimension  k 
)
static
Parameters
pany pre-cell.
kthe coordinate that is changed.
Returns
the same element as [p] except for an decremented coordinate [k].
template<Dimension dim, typename TInteger>
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sGetIncr ( SCell  p,
Dimension  k 
)
static
Parameters
pany pre-cell.
kthe coordinate that is changed.
Returns
the same element as [p] except for the incremented coordinate [k].
template<Dimension dim, typename TInteger>
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sGetSub ( SCell  p,
Dimension  k,
Integer  x 
)
static
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.
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].
template<Dimension dim, typename TInteger>
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sIncident ( SCell  c,
Dimension  k,
bool  up 
)
static
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.
template<Dimension dim, typename TInteger>
static SCell DGtal::KhalimskyPreSpaceND< dim, TInteger >::sIndirectIncident ( SCell  p,
Dimension  k 
)
static
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).
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.
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.
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.
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.
template<Dimension dim, typename TInteger>
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::sIsOpen ( const SCell p,
Dimension  k 
)
static
Parameters
pany signed pre-cell.
kany direction.
Returns
'true' if [p] is open along the direction [k].
template<Dimension dim, typename TInteger>
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::sIsSurfel ( const SCell b)
static
Parameters
bany signed pre-cell.
Returns
'true' if [b] is a surfel (spans all but one coordinate).
template<Dimension dim, typename TInteger>
static Integer DGtal::KhalimskyPreSpaceND< dim, TInteger >::sKCoord ( const SCell c,
Dimension  k 
)
static
Parameters
cany signed pre-cell.
kany valid dimension.
Returns
its Khalimsky coordinate along [k].
template<Dimension dim, typename TInteger>
static const Point& DGtal::KhalimskyPreSpaceND< dim, TInteger >::sKCoords ( const SCell c)
static
Parameters
cany signed pre-cell.
Returns
its Khalimsky coordinates.
template<Dimension dim, typename TInteger>
static SCells DGtal::KhalimskyPreSpaceND< dim, TInteger >::sLowerIncident ( const SCell c)
static
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.
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].
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).
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.
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]
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.
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].
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)
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)).
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].
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.
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 Khalimsky coordinates for [c].
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.
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].
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.
template<Dimension dim, typename TInteger>
static Sign DGtal::KhalimskyPreSpaceND< dim, TInteger >::sSign ( const SCell c)
static
Parameters
cany signed pre-cell.
Returns
its sign.
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].
template<Dimension dim, typename TInteger>
static Integer DGtal::KhalimskyPreSpaceND< dim, TInteger >::sTopology ( const SCell p)
static
Parameters
pany signed pre-cell.
Returns
the topology word of [p].
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].
template<Dimension dim, typename TInteger>
static SCells DGtal::KhalimskyPreSpaceND< dim, TInteger >::sUpperIncident ( const SCell c)
static
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.
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.

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.

template<Dimension dim, typename TInteger>
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uAdjacent ( const Cell p,
Dimension  k,
bool  up 
)
static
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 )'.
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.
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].
template<Dimension dim, typename TInteger>
static Cells DGtal::KhalimskyPreSpaceND< dim, TInteger >::uCoFaces ( const Cell c)
static
Parameters
cany unsigned ipre-cell.
Returns
the proper cofaces of [c] (chain of upper incidence).
template<Dimension dim, typename TInteger>
static Integer DGtal::KhalimskyPreSpaceND< dim, TInteger >::uCoord ( const Cell c,
Dimension  k 
)
static
Parameters
cany unsigned pre-cell.
kany valid dimension.
Returns
its digital coordinate along [k].
template<Dimension dim, typename TInteger>
static Point DGtal::KhalimskyPreSpaceND< dim, TInteger >::uCoords ( const Cell c)
static
Parameters
cany unsigned pre-cell.
Returns
its digital coordinates.
template<Dimension dim, typename TInteger>
static Dimension DGtal::KhalimskyPreSpaceND< dim, TInteger >::uDim ( const Cell p)
static
Parameters
pany unsigned pre-cell.
Returns
the dimension of the pre-cell [p].
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.
template<Dimension dim, typename TInteger>
static Cells DGtal::KhalimskyPreSpaceND< dim, TInteger >::uFaces ( const Cell c)
static
Parameters
cany unsigned pre-cell.
Returns
the proper faces of [c] (chain of lower incidence).
template<Dimension dim, typename TInteger>
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uGetAdd ( Cell  p,
Dimension  k,
Integer  x 
)
static
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.
template<Dimension dim, typename TInteger>
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uGetDecr ( Cell  p,
Dimension  k 
)
static
Parameters
pany pre-cell.
kthe coordinate that is changed.
Returns
the same element as [p] except for an decremented coordinate [k].
template<Dimension dim, typename TInteger>
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uGetIncr ( Cell  p,
Dimension  k 
)
static
Parameters
pany pre-cell.
kthe coordinate that is changed.
Returns
the same element as [p] except for the incremented coordinate [k].
template<Dimension dim, typename TInteger>
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uGetSub ( Cell  p,
Dimension  k,
Integer  x 
)
static
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.
template<Dimension dim, typename TInteger>
static Cell DGtal::KhalimskyPreSpaceND< dim, TInteger >::uIncident ( Cell  c,
Dimension  k,
bool  up 
)
static
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.
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.
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.
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.
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.
template<Dimension dim, typename TInteger>
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::uIsOpen ( const Cell p,
Dimension  k 
)
static
Parameters
pany pre-cell.
kany direction.
Returns
'true' if [p] is open along the direction [k].
template<Dimension dim, typename TInteger>
static bool DGtal::KhalimskyPreSpaceND< dim, TInteger >::uIsSurfel ( const Cell b)
static
Parameters
bany unsigned pre-cell.
Returns
'true' if [b] is a surfel (spans all but one coordinate).
template<Dimension dim, typename TInteger>
static Integer DGtal::KhalimskyPreSpaceND< dim, TInteger >::uKCoord ( const Cell c,
Dimension  k 
)
static
Parameters
cany unsigned pre-cell.
kany valid dimension.
Returns
its Khalimsky coordinate along [k].
template<Dimension dim, typename TInteger>
static const Point& DGtal::KhalimskyPreSpaceND< dim, TInteger >::uKCoords ( const Cell c)
static
Parameters
cany unsigned pre-cell.
Returns
its Khalimsky coordinates.
template<Dimension dim, typename TInteger>
static Cells DGtal::KhalimskyPreSpaceND< dim, TInteger >::uLowerIncident ( const Cell c)
static
Parameters
cany unsigned pre-cell.
Returns
the pre-cells directly low incident to c.
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].
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).
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].
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]
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.
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].
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)
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)).
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].
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.
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 Khalimsky coordinates for [c].
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.
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].
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].
template<Dimension dim, typename TInteger>
static Integer DGtal::KhalimskyPreSpaceND< dim, TInteger >::uTopology ( const Cell p)
static
Parameters
pany unsigned pre-cell.
Returns
the topology word of [p].
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].
template<Dimension dim, typename TInteger>
static Cells DGtal::KhalimskyPreSpaceND< dim, TInteger >::uUpperIncident ( const Cell c)
static
Parameters
cany unsigned pre-cell.
Returns
the pre-cells directly up incident to c.

Field Documentation

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

Definition at line 398 of file KhalimskyPreSpaceND.h.

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

Definition at line 397 of file KhalimskyPreSpaceND.h.

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

Definition at line 400 of file KhalimskyPreSpaceND.h.

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

Definition at line 399 of file KhalimskyPreSpaceND.h.


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