DGtal 2.1.0
Loading...
Searching...
No Matches
DGtal::CellGeometryFunctions< TKSpace, 2, 2 > 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, 2 >

Specialization for 2-cells in 2D.

Template Parameters
TKSpacean arbitrary model of CCellularGridSpaceND.

Definition at line 714 of file CellGeometry.h.

Member Typedef Documentation

◆ Cell

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

Definition at line 720 of file CellGeometry.h.

◆ KSpace

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

Definition at line 718 of file CellGeometry.h.

◆ Space

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

Definition at line 719 of file CellGeometry.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

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

◆ BOOST_STATIC_ASSERT()

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

◆ getIncidentCellsToPointels()

template<typename TKSpace >
template<typename PointelIterator >
static std::unordered_set< typename KSpace::Cell > DGtal::CellGeometryFunctions< TKSpace, 2, 2 >::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 730 of file CellGeometry.h.

732 {
733 std::unordered_set<typename KSpace::Cell> cells;
734 for ( auto it = itB; it != itE; ++it )
735 {
736 auto pointel = *it;
737 auto linelxp = K.uIncident( pointel, 0, true );
738 auto linelxm = K.uIncident( pointel, 0, false );
739 cells.insert( K.uIncident( linelxp, 1, true ) );
740 cells.insert( K.uIncident( linelxp, 1, false ) );
741 cells.insert( K.uIncident( linelxm, 1, true ) );
742 cells.insert( K.uIncident( linelxm, 1, false ) );
743 }
744 return cells;
745 }
KSpace K

References K.

◆ getIncidentCellsToPoints()

template<typename TKSpace >
template<typename PointIterator >
static std::unordered_set< typename KSpace::Cell > DGtal::CellGeometryFunctions< TKSpace, 2, 2 >::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 756 of file CellGeometry.h.

758 {
759 std::cout << "<2,2> specialization" << std::endl;
760 std::unordered_set<typename KSpace::Cell> cells;
761 for ( auto it = itB; it != itE; ++it )
762 {
763 auto pointel = K.uPointel( *it );
764 auto linelxp = K.uIncident( pointel, 0, true );
765 auto linelxm = K.uIncident( pointel, 0, false );
766 cells.insert( K.uIncident( linelxp, 1, true ) );
767 cells.insert( K.uIncident( linelxp, 1, false ) );
768 cells.insert( K.uIncident( linelxm, 1, true ) );
769 cells.insert( K.uIncident( linelxm, 1, false ) );
770 }
771 return cells;
772 }

References K.

◆ getIncidentKPointsToPoints()

template<typename TKSpace >
template<typename PointIterator >
static UnorderedSetByBlock< typename KSpace::Point, Splitter< typename KSpace::Point, uint64_t > > DGtal::CellGeometryFunctions< TKSpace, 2, 2 >::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 783 of file CellGeometry.h.

785 {
786 UnorderedSetByBlock< typename KSpace::Point,
787 Splitter< typename KSpace::Point, uint64_t> > kpoints;
788 for ( auto it = itB; it != itE; ++it )
789 {
790 auto kp = K.uKCoords( K.uPointel( *it ) );
791 kpoints.emplace( kp[ 0 ] - 1, kp[ 1 ] - 1 );
792 kpoints.emplace( kp[ 0 ] + 1, kp[ 1 ] - 1 );
793 kpoints.emplace( kp[ 0 ] - 1, kp[ 1 ] + 1 );
794 kpoints.emplace( kp[ 0 ] + 1, kp[ 1 ] + 1 );
795 }
796 return kpoints;
797 }
PointVector< dim, Integer > Point

References K.


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