DGtal  1.3.beta
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 433 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 438 of file CellGeometry.h.

◆ KSpace

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

Definition at line 436 of file CellGeometry.h.

◆ Point

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

Definition at line 439 of file CellGeometry.h.

◆ Space

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

Definition at line 437 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 450 of file CellGeometry.h.

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

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 477 of file CellGeometry.h.

479  {
480  std::unordered_set<typename KSpace::Cell> cells;
481  if ( i == 0 )
482  for ( auto it = itB; it != itE; ++it )
483  cells.insert( 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 ) cells.insert( f );
491  }
492  return cells;
493  }

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 505 of file CellGeometry.h.

507  {
508  UnorderedSetByBlock< typename KSpace::Point,
509  Splitter< typename KSpace::Point, uint64_t > > kpoints;
510  if ( i == 0 )
511  for ( auto it = itB; it != itE; ++it )
512  kpoints.insert( K.uKCoords( K.uPointel( *it ) ) );
513  else
514  for ( auto it = itB; it != itE; ++it )
515  {
516  auto pointel = K.uPointel( *it );
517  auto cofaces = K.uCoFaces( pointel );
518  for ( auto&& f : cofaces )
519  if ( K.uDim( f ) == i ) kpoints.insert( K.uKCoords( f ) );
520  }
521  return kpoints;
522  }

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