DGtal 1.3.0
Loading...
Searching...
No Matches
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 }
KSpace K

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

◆ 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 }
PointVector< dim, Integer > Point

References K.


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