DGtal  1.1.0
Public Types | Public Member Functions | Static Public Member Functions
DGtal::CellGeometryFunctions< TKSpace, i, N > Struct Template Reference

#include <DGtal/geometry/volumes/CellGeometry.h>

Public Types

typedef TKSpace KSpace
 
typedef KSpace::Space Space
 
typedef KSpace::Cell Cell
 
typedef KSpace::Point Point
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CCellularGridSpaceND< TKSpace >))
 

Static Public Member Functions

template<typename PointelIterator >
static std::unordered_set< typename KSpace::CellgetIncidentCellsToPointels (const KSpace &K, PointelIterator itB, PointelIterator itE)
 
template<typename PointIterator >
static std::unordered_set< typename KSpace::CellgetIncidentCellsToPoints (const KSpace &K, PointIterator itB, PointIterator itE)
 
template<typename PointIterator >
static UnorderedSetByBlock< typename KSpace::Point, Splitter< typename KSpace::Point, uint64_t > > getIncidentKPointsToPoints (const KSpace &K, PointIterator itB, PointIterator itE)
 

Detailed Description

template<typename TKSpace, int i, int N>
struct DGtal::CellGeometryFunctions< TKSpace, i, N >

Utility class gathering some useful functions related to cell geometry and digital or cell convexity. It is meant to be specialized for low dimensions.

Template Parameters
TKSpacean arbitrary model of CCellularGridSpaceND.
ithe integer specifying the dimension of cells.
Nthe integer specifying the dimension of the digital space.

Definition at line 404 of file CellGeometry.h.

Member Typedef Documentation

◆ Cell

template<typename TKSpace , int i, int N>
typedef KSpace::Cell DGtal::CellGeometryFunctions< TKSpace, i, N >::Cell

Definition at line 409 of file CellGeometry.h.

◆ KSpace

template<typename TKSpace , int i, int N>
typedef TKSpace DGtal::CellGeometryFunctions< TKSpace, i, N >::KSpace

Definition at line 407 of file CellGeometry.h.

◆ Point

template<typename TKSpace , int i, int N>
typedef KSpace::Point DGtal::CellGeometryFunctions< TKSpace, i, N >::Point

Definition at line 410 of file CellGeometry.h.

◆ Space

template<typename TKSpace , int i, int N>
typedef KSpace::Space DGtal::CellGeometryFunctions< TKSpace, i, N >::Space

Definition at line 408 of file CellGeometry.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename TKSpace , int i, int N>
DGtal::CellGeometryFunctions< TKSpace, i, N >::BOOST_CONCEPT_ASSERT ( (concepts::CCellularGridSpaceND< TKSpace >)  )

◆ getIncidentCellsToPointels()

template<typename TKSpace , int i, int N>
template<typename PointelIterator >
static std::unordered_set<typename KSpace::Cell> DGtal::CellGeometryFunctions< TKSpace, i, N >::getIncidentCellsToPointels ( const KSpace K,
PointelIterator  itB,
PointelIterator  itE 
)
inlinestatic
Template Parameters
PointelIteratorany model of forward iterator on pointels.
Parameters
Ka valid cellular grid space large enough to hold the cells.
itBthe start of a range of pointels.
itEpast the end of a range of pointels.
Returns
the incident i-cells to the given range of pointels [itB, itE).
Note
General method. Note as efficient as specializations.

Definition at line 421 of file CellGeometry.h.

423  {
424  std::unordered_set<typename KSpace::Cell> cells;
425  if ( i == 0 )
426  for ( auto it = itB; it != itE; ++it )
427  cells.insert( *it );
428  else
429  for ( auto it = itB; it != itE; ++it )
430  {
431  auto pointel = *it;
432  auto cofaces = K.uCoFaces( pointel );
433  for ( auto&& f : cofaces )
434  if ( K.uDim( f ) == i ) cells.insert( f );
435  }
436  return cells;
437  }

References K, DGtal::KhalimskySpaceND< dim, TInteger >::uCoFaces(), and DGtal::KhalimskySpaceND< dim, TInteger >::uDim().

◆ getIncidentCellsToPoints()

template<typename TKSpace , int i, int N>
template<typename PointIterator >
static std::unordered_set<typename KSpace::Cell> DGtal::CellGeometryFunctions< TKSpace, i, N >::getIncidentCellsToPoints ( const KSpace K,
PointIterator  itB,
PointIterator  itE 
)
inlinestatic
Template Parameters
PointIteratorany model of forward iterator on points.
Parameters
Ka valid cellular grid space large enough to hold the cells.
itBthe start of a range of points.
itEpast the end of a range of points.
Returns
the incident i-cells to the given range of points [itB, itE).
Note
General method. Note as efficient as specializations.

Definition at line 448 of file CellGeometry.h.

450  {
451  std::unordered_set<typename KSpace::Cell> cells;
452  if ( i == 0 )
453  for ( auto it = itB; it != itE; ++it )
454  cells.insert( K.uPointel( *it ) );
455  else
456  for ( auto it = itB; it != itE; ++it )
457  {
458  auto pointel = K.uPointel( *it );
459  auto cofaces = K.uCoFaces( pointel );
460  for ( auto&& f : cofaces )
461  if ( K.uDim( f ) == i ) cells.insert( f );
462  }
463  return cells;
464  }

References K, DGtal::KhalimskySpaceND< dim, TInteger >::uCoFaces(), DGtal::KhalimskySpaceND< dim, TInteger >::uDim(), and DGtal::KhalimskySpaceND< dim, TInteger >::uPointel().

◆ getIncidentKPointsToPoints()

template<typename TKSpace , int i, int N>
template<typename PointIterator >
static UnorderedSetByBlock< typename KSpace::Point, Splitter< typename KSpace::Point, uint64_t > > DGtal::CellGeometryFunctions< TKSpace, i, N >::getIncidentKPointsToPoints ( const KSpace K,
PointIterator  itB,
PointIterator  itE 
)
inlinestatic
Template Parameters
PointIteratorany model of forward iterator on points.
Parameters
Ka valid cellular grid space large enough to hold the cells.
itBthe start of a range of points.
itEpast the end of a range of points.
Returns
the incident i-kpoints to the given range of points [itB, itE).
Note
General method. Note as efficient as specializations.

Definition at line 476 of file CellGeometry.h.

478  {
479  UnorderedSetByBlock< typename KSpace::Point,
480  Splitter< typename KSpace::Point, uint64_t > > kpoints;
481  if ( i == 0 )
482  for ( auto it = itB; it != itE; ++it )
483  kpoints.insert( K.uKCoords( K.uPointel( *it ) ) );
484  else
485  for ( auto it = itB; it != itE; ++it )
486  {
487  auto pointel = K.uPointel( *it );
488  auto cofaces = K.uCoFaces( pointel );
489  for ( auto&& f : cofaces )
490  if ( K.uDim( f ) == i ) kpoints.insert( K.uKCoords( f ) );
491  }
492  return kpoints;
493  }

References K, DGtal::KhalimskySpaceND< dim, TInteger >::uCoFaces(), DGtal::KhalimskySpaceND< dim, TInteger >::uDim(), DGtal::KhalimskySpaceND< dim, TInteger >::uKCoords(), and DGtal::KhalimskySpaceND< dim, TInteger >::uPointel().


The documentation for this struct was generated from the following file:
DGtal::KhalimskySpaceND::uDim
Dimension uDim(const Cell &p) const
Return the dimension of the cell [p].
K
KSpace K
Definition: testCubicalComplex.cpp:62
DGtal::KhalimskySpaceND::Point
PointVector< dim, Integer > Point
Definition: KhalimskySpaceND.h:425
DGtal::KhalimskySpaceND::uCoFaces
Cells uCoFaces(const Cell &c) const
Return the proper cofaces of [c] (chain of upper incidence) that belong to the space.
DGtal::KhalimskySpaceND::uKCoords
const Point & uKCoords(const Cell &c) const
Return its Khalimsky coordinates.
DGtal::KhalimskySpaceND::uPointel
Cell uPointel(Point p) const
From the digital coordinates of a point in Zn, builds the corresponding pointel (cell of dimension 0)...