DGtal  0.9.3beta
Public Member Functions | Private Types | Private Attributes
DGtal::functors::SCellToPoint< KSpace > Class Template Reference

#include <DGtal/topology/SCellsFunctors.h>

Public Member Functions

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

Private Types

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

Private Attributes

const KSpace * myK
 

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;
typename KSpace::Point aPoint;
SCellToPoint<KSpace> f(aKSpace);
...
aPoint = f(aSCell);
See also
ConstIteratorAdapter KhalimskySpaceND PointVector

Definition at line 74 of file SCellsFunctors.h.

Member Typedef Documentation

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

Definition at line 78 of file SCellsFunctors.h.

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

Definition at line 77 of file SCellsFunctors.h.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 91 of file SCellsFunctors.h.

91 : myK(NULL) { }
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) { }
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) { }

Member Function Documentation

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  }
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.

References DGtal::functors::SCellToPoint< KSpace >::myK.

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

Field Documentation

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 DGtal::functors::SCellToPoint< KSpace >::operator=().


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