DGtal 2.0.0
Loading...
Searching...
No Matches
DGtal::CellGeometryFunctions< TKSpace, 2, 3 > Struct Template Reference

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

Inheritance diagram for DGtal::CellGeometryFunctions< TKSpace, 2, 3 >:
[legend]

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

Member Typedef Documentation

◆ Cell

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

Definition at line 810 of file CellGeometry.h.

◆ KSpace

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

Definition at line 808 of file CellGeometry.h.

◆ Point

Definition at line 447 of file CellGeometry.h.

◆ Space

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

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

822 {
824 for ( auto it = itB; it != itE; ++it )
825 {
826 auto pointel = *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.

◆ getIncidentCellsToPoints()

template<typename TKSpace>
template<typename PointIterator>
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 856 of file CellGeometry.h.

858 {
859 std::cout << "<2,3> specialization" << std::endl;
861 for ( auto it = itB; it != itE; ++it )
862 {
863 auto pointel = K.uPointel( *it );
864 auto linelxp = K.uIncident( pointel, 0, true );
865 auto linelxm = K.uIncident( pointel, 0, false );
866 auto linelyp = K.uIncident( pointel, 1, true );
867 auto linelym = K.uIncident( pointel, 1, false );
868 cells.insert( K.uIncident( linelxp, 1, true ) );
869 cells.insert( K.uIncident( linelxp, 1, false ) );
870 cells.insert( K.uIncident( linelxp, 2, true ) );
871 cells.insert( K.uIncident( linelxp, 2, false ) );
872 cells.insert( K.uIncident( linelxm, 1, true ) );
873 cells.insert( K.uIncident( linelxm, 1, false ) );
874 cells.insert( K.uIncident( linelxm, 2, true ) );
875 cells.insert( K.uIncident( linelxm, 2, false ) );
876 cells.insert( K.uIncident( linelyp, 2, true ) );
877 cells.insert( K.uIncident( linelyp, 2, false ) );
878 cells.insert( K.uIncident( linelym, 2, true ) );
879 cells.insert( K.uIncident( linelym, 2, false ) );
880 }
881 return cells;
882 }

References K.

◆ getIncidentKPointsToPoints()

template<typename TKSpace>
template<typename PointIterator>
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 893 of file CellGeometry.h.

895 {
898 for ( auto it = itB; it != itE; ++it )
899 {
900 auto kp = K.uKCoords( K.uPointel( *it ) );
901 kpoints.emplace( kp[ 0 ] - 1, kp[ 1 ] - 1, kp[ 2 ] );
902 kpoints.emplace( kp[ 0 ] + 1, kp[ 1 ] - 1, kp[ 2 ] );
903 kpoints.emplace( kp[ 0 ] - 1, kp[ 1 ] + 1, kp[ 2 ] );
904 kpoints.emplace( kp[ 0 ] + 1, kp[ 1 ] + 1, kp[ 2 ] );
905 kpoints.emplace( kp[ 0 ] - 1, kp[ 1 ] , kp[ 2 ] - 1 );
906 kpoints.emplace( kp[ 0 ] + 1, kp[ 1 ] , kp[ 2 ] - 1 );
907 kpoints.emplace( kp[ 0 ] - 1, kp[ 1 ] , kp[ 2 ] + 1 );
908 kpoints.emplace( kp[ 0 ] + 1, kp[ 1 ] , kp[ 2 ] + 1 );
909 kpoints.emplace( kp[ 0 ] , kp[ 1 ] - 1, kp[ 2 ] - 1 );
910 kpoints.emplace( kp[ 0 ] , kp[ 1 ] + 1, kp[ 2 ] - 1 );
911 kpoints.emplace( kp[ 0 ] , kp[ 1 ] - 1, kp[ 2 ] + 1 );
912 kpoints.emplace( kp[ 0 ] , kp[ 1 ] + 1, kp[ 2 ] + 1 );
913 }
914 return kpoints;
915 }

References K.


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