DGtal  1.2.0
Public Types | Public Member Functions | Static Public Member Functions
DGtal::CellGeometryFunctions< TKSpace, 2, 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==2)
 

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, 2, 3 >

Specialization for 2-cells in 3D.

Template Parameters
TKSpacean arbitrary model of CCellularGridSpaceND.

Definition at line 767 of file CellGeometry.h.

Member Typedef Documentation

◆ Cell

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

Definition at line 773 of file CellGeometry.h.

◆ KSpace

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

Definition at line 771 of file CellGeometry.h.

◆ Space

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

Definition at line 772 of file CellGeometry.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

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

◆ BOOST_STATIC_ASSERT()

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

◆ getIncidentCellsToPointels()

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

Definition at line 783 of file CellGeometry.h.

785  {
786  std::unordered_set<typename KSpace::Cell> cells;
787  for ( auto it = itB; it != itE; ++it )
788  {
789  auto pointel = *it;
790  auto linelxp = K.uIncident( pointel, 0, true );
791  auto linelxm = K.uIncident( pointel, 0, false );
792  auto linelyp = K.uIncident( pointel, 1, true );
793  auto linelym = K.uIncident( pointel, 1, false );
794  cells.insert( K.uIncident( linelxp, 1, true ) );
795  cells.insert( K.uIncident( linelxp, 1, false ) );
796  cells.insert( K.uIncident( linelxp, 2, true ) );
797  cells.insert( K.uIncident( linelxp, 2, false ) );
798  cells.insert( K.uIncident( linelxm, 1, true ) );
799  cells.insert( K.uIncident( linelxm, 1, false ) );
800  cells.insert( K.uIncident( linelxm, 2, true ) );
801  cells.insert( K.uIncident( linelxm, 2, false ) );
802  cells.insert( K.uIncident( linelyp, 2, true ) );
803  cells.insert( K.uIncident( linelyp, 2, false ) );
804  cells.insert( K.uIncident( linelym, 2, true ) );
805  cells.insert( K.uIncident( linelym, 2, false ) );
806  }
807  return cells;
808  }
KSpace K

References K.

◆ getIncidentCellsToPoints()

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

Definition at line 819 of file CellGeometry.h.

821  {
822  std::cout << "<2,3> specialization" << std::endl;
823  std::unordered_set<typename KSpace::Cell> cells;
824  for ( auto it = itB; it != itE; ++it )
825  {
826  auto pointel = K.uPointel( *it );
827  auto linelxp = K.uIncident( pointel, 0, true );
828  auto linelxm = K.uIncident( pointel, 0, false );
829  auto linelyp = K.uIncident( pointel, 1, true );
830  auto linelym = K.uIncident( pointel, 1, false );
831  cells.insert( K.uIncident( linelxp, 1, true ) );
832  cells.insert( K.uIncident( linelxp, 1, false ) );
833  cells.insert( K.uIncident( linelxp, 2, true ) );
834  cells.insert( K.uIncident( linelxp, 2, false ) );
835  cells.insert( K.uIncident( linelxm, 1, true ) );
836  cells.insert( K.uIncident( linelxm, 1, false ) );
837  cells.insert( K.uIncident( linelxm, 2, true ) );
838  cells.insert( K.uIncident( linelxm, 2, false ) );
839  cells.insert( K.uIncident( linelyp, 2, true ) );
840  cells.insert( K.uIncident( linelyp, 2, false ) );
841  cells.insert( K.uIncident( linelym, 2, true ) );
842  cells.insert( K.uIncident( linelym, 2, false ) );
843  }
844  return cells;
845  }

References K.

◆ getIncidentKPointsToPoints()

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

Definition at line 856 of file CellGeometry.h.

858  {
859  UnorderedSetByBlock< typename KSpace::Point,
860  Splitter< typename KSpace::Point, uint64_t> > kpoints;
861  for ( auto it = itB; it != itE; ++it )
862  {
863  auto kp = K.uKCoords( K.uPointel( *it ) );
864  kpoints.emplace( kp[ 0 ] - 1, kp[ 1 ] - 1, kp[ 2 ] );
865  kpoints.emplace( kp[ 0 ] + 1, kp[ 1 ] - 1, kp[ 2 ] );
866  kpoints.emplace( kp[ 0 ] - 1, kp[ 1 ] + 1, kp[ 2 ] );
867  kpoints.emplace( kp[ 0 ] + 1, kp[ 1 ] + 1, kp[ 2 ] );
868  kpoints.emplace( kp[ 0 ] - 1, kp[ 1 ] , kp[ 2 ] - 1 );
869  kpoints.emplace( kp[ 0 ] + 1, kp[ 1 ] , kp[ 2 ] - 1 );
870  kpoints.emplace( kp[ 0 ] - 1, kp[ 1 ] , kp[ 2 ] + 1 );
871  kpoints.emplace( kp[ 0 ] + 1, kp[ 1 ] , kp[ 2 ] + 1 );
872  kpoints.emplace( kp[ 0 ] , kp[ 1 ] - 1, kp[ 2 ] - 1 );
873  kpoints.emplace( kp[ 0 ] , kp[ 1 ] + 1, kp[ 2 ] - 1 );
874  kpoints.emplace( kp[ 0 ] , kp[ 1 ] - 1, kp[ 2 ] + 1 );
875  kpoints.emplace( kp[ 0 ] , kp[ 1 ] + 1, kp[ 2 ] + 1 );
876  }
877  return kpoints;
878  }
MyPointD Point
Definition: testClone2.cpp:383

References K.


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