DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Private Types | Private Attributes
DGtal::SCellToPoint< KSpace > Class Template Reference

#include <SCellsFunctors.h>

Public Member Functions

 SCellToPoint ()
 SCellToPoint (const 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::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 71 of file SCellsFunctors.h.


Member Typedef Documentation

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

Definition at line 75 of file SCellsFunctors.h.

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

Definition at line 74 of file SCellsFunctors.h.


Constructor & Destructor Documentation

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

Default constructor.

Definition at line 88 of file SCellsFunctors.h.

: myK(NULL) { }
template<typename KSpace>
DGtal::SCellToPoint< KSpace >::SCellToPoint ( const KSpace &  aK)
inline

Constructor.

Parameters:
aKa Khalimsky space

Definition at line 93 of file SCellsFunctors.h.

: myK(&aK) { }
template<typename KSpace>
DGtal::SCellToPoint< KSpace >::SCellToPoint ( const SCellToPoint< KSpace > &  other)
inline

Copy constructor.

Parameters:
otherany SCellToPoint functor

Definition at line 99 of file SCellsFunctors.h.

: myK(other.myK) { }

Member Function Documentation

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

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

Parameters:
sa scell
Returns:
the corresponding point.

Definition at line 123 of file SCellsFunctors.h.

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

{
ASSERT( myK );
Input s = aSCell;
while ( myK->sDim(s) > 0 )
{
Input tmp( myK->sIndirectIncident( s, *myK->sDirs( s ) ) );
ASSERT( myK->sDim(tmp) < myK->sDim(s) );
s = tmp;
}
return Output( myK->sCoords(s) );
}
template<typename KSpace>
SCellToPoint& DGtal::SCellToPoint< KSpace >::operator= ( const SCellToPoint< KSpace > &  other)
inline

Assignment.

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

Definition at line 108 of file SCellsFunctors.h.

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

{
if (this != &other)
{
myK = other.myK;
}
return *this;
}

Field Documentation

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

Aliasing pointer on the Khalimsky space.

Definition at line 81 of file SCellsFunctors.h.

Referenced by DGtal::SCellToPoint< KSpace >::operator()(), and DGtal::SCellToPoint< KSpace >::operator=().


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