DGtal  1.2.0
Public Types | Public Member Functions | Static Public Member Functions
DGtal::CellGeometryFunctions< TKSpace, 1, 3 > Struct Template Reference

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

Public Types

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

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CCellularGridSpaceND< TKSpace >))
 
 BOOST_STATIC_ASSERT (TKSpace::dimension==3)
 

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>
struct DGtal::CellGeometryFunctions< TKSpace, 1, 3 >

Specialization for 1-cells in 3D.

Template Parameters
TKSpacean arbitrary model of CCellularGridSpaceND.

Definition at line 585 of file CellGeometry.h.

Member Typedef Documentation

◆ Cell

template<typename TKSpace >
typedef KSpace::Cell DGtal::CellGeometryFunctions< TKSpace, 1, 3 >::Cell

Definition at line 591 of file CellGeometry.h.

◆ KSpace

template<typename TKSpace >
typedef TKSpace DGtal::CellGeometryFunctions< TKSpace, 1, 3 >::KSpace

Definition at line 589 of file CellGeometry.h.

◆ Space

template<typename TKSpace >
typedef KSpace::Space DGtal::CellGeometryFunctions< TKSpace, 1, 3 >::Space

Definition at line 590 of file CellGeometry.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename TKSpace >
DGtal::CellGeometryFunctions< TKSpace, 1, 3 >::BOOST_CONCEPT_ASSERT ( (concepts::CCellularGridSpaceND< TKSpace >)  )

◆ BOOST_STATIC_ASSERT()

template<typename TKSpace >
DGtal::CellGeometryFunctions< TKSpace, 1, 3 >::BOOST_STATIC_ASSERT ( TKSpace::dimension  = =3)

◆ getIncidentCellsToPointels()

template<typename TKSpace >
template<typename PointelIterator >
static std::unordered_set<typename KSpace::Cell> DGtal::CellGeometryFunctions< TKSpace, 1, 3 >::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 1-cells to the given range of pointels [itB, itE).

Definition at line 601 of file CellGeometry.h.

603  {
604  std::unordered_set<typename KSpace::Cell> cells;
605  for ( auto it = itB; it != itE; ++it )
606  {
607  auto pointel = *it;
608  cells.insert( K.uIncident( pointel, 0, true ) );
609  cells.insert( K.uIncident( pointel, 0, false ) );
610  cells.insert( K.uIncident( pointel, 1, true ) );
611  cells.insert( K.uIncident( pointel, 1, false ) );
612  cells.insert( K.uIncident( pointel, 2, true ) );
613  cells.insert( K.uIncident( pointel, 2, false ) );
614  }
615  return cells;
616  }
KSpace K

References K.

◆ getIncidentCellsToPoints()

template<typename TKSpace >
template<typename PointIterator >
static std::unordered_set<typename KSpace::Cell> DGtal::CellGeometryFunctions< TKSpace, 1, 3 >::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 1-cells to the given range of points [itB, itE).
Note
General method. Note as efficient as specializations.

Definition at line 627 of file CellGeometry.h.

629  {
630  std::cout << "<1,3> specialization" << std::endl;
631  std::unordered_set<typename KSpace::Cell> cells;
632  for ( auto it = itB; it != itE; ++it )
633  {
634  auto pointel = K.uPointel( *it );
635  cells.insert( K.uIncident( pointel, 0, true ) );
636  cells.insert( K.uIncident( pointel, 0, false ) );
637  cells.insert( K.uIncident( pointel, 1, true ) );
638  cells.insert( K.uIncident( pointel, 1, false ) );
639  cells.insert( K.uIncident( pointel, 2, true ) );
640  cells.insert( K.uIncident( pointel, 2, false ) );
641  }
642  return cells;
643  }

References K.

◆ getIncidentKPointsToPoints()

template<typename TKSpace >
template<typename PointIterator >
static UnorderedSetByBlock< typename KSpace::Point, Splitter< typename KSpace::Point, uint64_t > > DGtal::CellGeometryFunctions< TKSpace, 1, 3 >::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 1-kpoints to the given range of points [itB, itE).

Definition at line 654 of file CellGeometry.h.

656  {
657  UnorderedSetByBlock< typename KSpace::Point,
658  Splitter< typename KSpace::Point, uint64_t > > kpoints;
659  for ( auto it = itB; it != itE; ++it )
660  {
661  auto kp = K.uKCoords( K.uPointel( *it ) );
662  kpoints.emplace( kp[ 0 ] - 1, kp[ 1 ] , kp[ 2 ] );
663  kpoints.emplace( kp[ 0 ] + 1, kp[ 1 ] , kp[ 2 ] );
664  kpoints.emplace( kp[ 0 ] , kp[ 1 ] - 1, kp[ 2 ] );
665  kpoints.emplace( kp[ 0 ] , kp[ 1 ] + 1, kp[ 2 ] );
666  kpoints.emplace( kp[ 0 ] , kp[ 1 ] , kp[ 2 ] - 1 );
667  kpoints.emplace( kp[ 0 ] , kp[ 1 ] , kp[ 2 ] + 1 );
668  }
669  return kpoints;
670  }
MyPointD Point
Definition: testClone2.cpp:383

References K.


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