DGtal  1.4.beta
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 796 of file CellGeometry.h.

Member Typedef Documentation

◆ Cell

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

Definition at line 802 of file CellGeometry.h.

◆ KSpace

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

Definition at line 800 of file CellGeometry.h.

◆ Space

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

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

814  {
815  std::unordered_set<typename KSpace::Cell> cells;
816  for ( auto it = itB; it != itE; ++it )
817  {
818  auto pointel = *it;
819  auto linelxp = K.uIncident( pointel, 0, true );
820  auto linelxm = K.uIncident( pointel, 0, false );
821  auto linelyp = K.uIncident( pointel, 1, true );
822  auto linelym = K.uIncident( pointel, 1, false );
823  cells.insert( K.uIncident( linelxp, 1, true ) );
824  cells.insert( K.uIncident( linelxp, 1, false ) );
825  cells.insert( K.uIncident( linelxp, 2, true ) );
826  cells.insert( K.uIncident( linelxp, 2, false ) );
827  cells.insert( K.uIncident( linelxm, 1, true ) );
828  cells.insert( K.uIncident( linelxm, 1, false ) );
829  cells.insert( K.uIncident( linelxm, 2, true ) );
830  cells.insert( K.uIncident( linelxm, 2, false ) );
831  cells.insert( K.uIncident( linelyp, 2, true ) );
832  cells.insert( K.uIncident( linelyp, 2, false ) );
833  cells.insert( K.uIncident( linelym, 2, true ) );
834  cells.insert( K.uIncident( linelym, 2, false ) );
835  }
836  return cells;
837  }
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 848 of file CellGeometry.h.

850  {
851  std::cout << "<2,3> specialization" << std::endl;
852  std::unordered_set<typename KSpace::Cell> cells;
853  for ( auto it = itB; it != itE; ++it )
854  {
855  auto pointel = K.uPointel( *it );
856  auto linelxp = K.uIncident( pointel, 0, true );
857  auto linelxm = K.uIncident( pointel, 0, false );
858  auto linelyp = K.uIncident( pointel, 1, true );
859  auto linelym = K.uIncident( pointel, 1, false );
860  cells.insert( K.uIncident( linelxp, 1, true ) );
861  cells.insert( K.uIncident( linelxp, 1, false ) );
862  cells.insert( K.uIncident( linelxp, 2, true ) );
863  cells.insert( K.uIncident( linelxp, 2, false ) );
864  cells.insert( K.uIncident( linelxm, 1, true ) );
865  cells.insert( K.uIncident( linelxm, 1, false ) );
866  cells.insert( K.uIncident( linelxm, 2, true ) );
867  cells.insert( K.uIncident( linelxm, 2, false ) );
868  cells.insert( K.uIncident( linelyp, 2, true ) );
869  cells.insert( K.uIncident( linelyp, 2, false ) );
870  cells.insert( K.uIncident( linelym, 2, true ) );
871  cells.insert( K.uIncident( linelym, 2, false ) );
872  }
873  return cells;
874  }

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

887  {
888  UnorderedSetByBlock< typename KSpace::Point,
889  Splitter< typename KSpace::Point, uint64_t> > kpoints;
890  for ( auto it = itB; it != itE; ++it )
891  {
892  auto kp = K.uKCoords( K.uPointel( *it ) );
893  kpoints.emplace( kp[ 0 ] - 1, kp[ 1 ] - 1, kp[ 2 ] );
894  kpoints.emplace( kp[ 0 ] + 1, kp[ 1 ] - 1, kp[ 2 ] );
895  kpoints.emplace( kp[ 0 ] - 1, kp[ 1 ] + 1, kp[ 2 ] );
896  kpoints.emplace( kp[ 0 ] + 1, kp[ 1 ] + 1, kp[ 2 ] );
897  kpoints.emplace( kp[ 0 ] - 1, kp[ 1 ] , kp[ 2 ] - 1 );
898  kpoints.emplace( kp[ 0 ] + 1, kp[ 1 ] , kp[ 2 ] - 1 );
899  kpoints.emplace( kp[ 0 ] - 1, kp[ 1 ] , kp[ 2 ] + 1 );
900  kpoints.emplace( kp[ 0 ] + 1, kp[ 1 ] , kp[ 2 ] + 1 );
901  kpoints.emplace( kp[ 0 ] , kp[ 1 ] - 1, kp[ 2 ] - 1 );
902  kpoints.emplace( kp[ 0 ] , kp[ 1 ] + 1, kp[ 2 ] - 1 );
903  kpoints.emplace( kp[ 0 ] , kp[ 1 ] - 1, kp[ 2 ] + 1 );
904  kpoints.emplace( kp[ 0 ] , kp[ 1 ] + 1, kp[ 2 ] + 1 );
905  }
906  return kpoints;
907  }
MyPointD Point
Definition: testClone2.cpp:383

References K.


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