DGtal 2.0.0
Loading...
Searching...
No Matches
DGtal::functors::SCellToPoint< KSpace > Class Template Reference

Aim: transforms a scell into a point. More...

#include <DGtal/topology/SCellsFunctors.h>

Public Types

typedef KSpace::Point Output
typedef KSpace::SCell Input

Public Member Functions

 SCellToPoint ()
 SCellToPoint (ConstAlias< KSpace > aK)
 SCellToPoint (const SCellToPoint &other)
SCellToPointoperator= (const SCellToPoint &other)
Output operator() (const Input &aSCell) const

Private Attributes

const KSpacemyK

Detailed Description

template<typename KSpace>
class DGtal::functors::SCellToPoint< KSpace >

Aim: transforms a scell into a point.

Description of template class 'SCellToPoint'

Template Parameters
KSpacethe Khalimsky space
KSpace aKSpace;
typename KSpace::SCell aSCell;
...
aPoint = f(aSCell);
PointVector< dim, Integer > Point
SignedKhalimskyCell< dim, Integer > SCell
const Point aPoint(3, 4)
See also
ConstIteratorAdapter KhalimskySpaceND PointVector

Definition at line 74 of file SCellsFunctors.h.

Member Typedef Documentation

◆ Input

template<typename KSpace>
typedef KSpace::SCell DGtal::functors::SCellToPoint< KSpace >::Input

Definition at line 78 of file SCellsFunctors.h.

◆ Output

template<typename KSpace>
typedef KSpace::Point DGtal::functors::SCellToPoint< KSpace >::Output

Definition at line 77 of file SCellsFunctors.h.

Constructor & Destructor Documentation

◆ SCellToPoint() [1/3]

template<typename KSpace>
DGtal::functors::SCellToPoint< KSpace >::SCellToPoint ( )
inline

Default constructor.

Definition at line 91 of file SCellsFunctors.h.

91: myK(NULL) { }
Aim: transforms a scell into a point.

References myK.

Referenced by operator=(), and SCellToPoint().

◆ SCellToPoint() [2/3]

template<typename KSpace>
DGtal::functors::SCellToPoint< KSpace >::SCellToPoint ( ConstAlias< KSpace > aK)
inline

Constructor.

Parameters
aKa Khalimsky space

Definition at line 96 of file SCellsFunctors.h.

96: myK(&aK) { }

References myK.

◆ SCellToPoint() [3/3]

template<typename KSpace>
DGtal::functors::SCellToPoint< KSpace >::SCellToPoint ( const SCellToPoint< KSpace > & other)
inline

Copy constructor.

Parameters
otherany SCellToPoint functor

Definition at line 102 of file SCellsFunctors.h.

103 : myK(other.myK) { }

References myK, and SCellToPoint().

Member Function Documentation

◆ operator()()

template<typename KSpace>
Output DGtal::functors::SCellToPoint< KSpace >::operator() ( const Input & aSCell) const
inline

Returns a point (with integer coordinates) from a scell (with khalimsky coordinates)

Parameters
aSCella scell
Returns
the corresponding point.

Definition at line 126 of file SCellsFunctors.h.

127 {
128 ASSERT( myK );
129 Input s = aSCell;
130 while ( myK->sDim(s) > 0 )
131 {
132 Input tmp( myK->sIndirectIncident( s, *myK->sDirs( s ) ) );
133 ASSERT( myK->sDim(tmp) < myK->sDim(s) );
134 s = tmp;
135 }
136 return Output( myK->sCoords(s) );
137 }

References myK.

◆ operator=()

template<typename KSpace>
SCellToPoint & DGtal::functors::SCellToPoint< KSpace >::operator= ( const SCellToPoint< KSpace > & other)
inline

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.

Definition at line 111 of file SCellsFunctors.h.

112 {
113 if (this != &other)
114 {
115 myK = other.myK;
116 }
117 return *this;
118 }

References myK, and SCellToPoint().

Field Documentation

◆ myK

template<typename KSpace>
const KSpace* DGtal::functors::SCellToPoint< KSpace >::myK
private

Aliasing pointer on the Khalimsky space.

Definition at line 84 of file SCellsFunctors.h.

Referenced by operator()(), operator=(), SCellToPoint(), SCellToPoint(), and SCellToPoint().


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