DGtal 2.1.0
Loading...
Searching...
No Matches
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 441 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 446 of file CellGeometry.h.

◆ KSpace

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

Definition at line 444 of file CellGeometry.h.

◆ Point

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

Definition at line 447 of file CellGeometry.h.

◆ Space

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

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

460 {
461 std::unordered_set<typename KSpace::Cell> cells;
462 if ( i == 0 )
463 for ( auto it = itB; it != itE; ++it )
464 cells.insert( *it );
465 else
466 for ( auto it = itB; it != itE; ++it )
467 {
468 auto pointel = *it;
469 auto cofaces = K.uCoFaces( pointel );
470 for ( auto&& f : cofaces )
471 if ( K.uDim( f ) == i ) cells.insert( f );
472 }
473 return cells;
474 }
KSpace K
void insert(VContainer1 &c1, LContainer2 &c2, unsigned int idx, double v)

References K.

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

487 {
488 std::unordered_set<typename KSpace::Cell> cells;
489 if ( i == 0 )
490 for ( auto it = itB; it != itE; ++it )
491 cells.insert( K.uPointel( *it ) );
492 else
493 for ( auto it = itB; it != itE; ++it )
494 {
495 auto pointel = K.uPointel( *it );
496 auto cofaces = K.uCoFaces( pointel );
497 for ( auto&& f : cofaces )
498 if ( K.uDim( f ) == i ) cells.insert( f );
499 }
500 return cells;
501 }

References K.

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

515 {
516 UnorderedSetByBlock< typename KSpace::Point,
517 Splitter< typename KSpace::Point, uint64_t > > kpoints;
518 if ( i == 0 )
519 for ( auto it = itB; it != itE; ++it )
520 kpoints.insert( K.uKCoords( K.uPointel( *it ) ) );
521 else
522 for ( auto it = itB; it != itE; ++it )
523 {
524 auto pointel = K.uPointel( *it );
525 auto cofaces = K.uCoFaces( pointel );
526 for ( auto&& f : cofaces )
527 if ( K.uDim( f ) == i ) kpoints.insert( K.uKCoords( f ) );
528 }
529 return kpoints;
530 }
PointVector< dim, Integer > Point

References K.


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