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

#include <SCellsFunctors.h>

Public Types

typedef KSpace::Space::RealPoint Output
typedef KSpace::SCell Input

Public Member Functions

 SCellToMidPoint ()
 SCellToMidPoint (const KSpace &aK)
 SCellToMidPoint (const SCellToMidPoint &other)
SCellToMidPointoperator= (const SCellToMidPoint &other)
Output operator() (const Input &s) const

Private Attributes

const KSpace * myK

Detailed Description

template<typename KSpace>
class DGtal::SCellToMidPoint< KSpace >

Aim: transforms a scell into a real point (the coordinates are divided by 2)

Description of template class 'SCellToMidPoint'

Template Parameters:
KSpacethe Khalimsky space
KSpace aKSpace;
typename KSpace::SCell aSCell;
typename KSpace::Space::RealPoint aPoint;
SCellToMidPoint<KSpace> f(aKSpace);
...
aPoint = f(aSCell);
See also:
ConstIteratorAdapter KhalimskySpaceND PointVector

Definition at line 156 of file SCellsFunctors.h.


Member Typedef Documentation

template<typename KSpace>
typedef KSpace::SCell DGtal::SCellToMidPoint< KSpace >::Input

Definition at line 162 of file SCellsFunctors.h.

template<typename KSpace>
typedef KSpace::Space::RealPoint DGtal::SCellToMidPoint< KSpace >::Output

Definition at line 161 of file SCellsFunctors.h.


Constructor & Destructor Documentation

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

Default constructor.

Definition at line 175 of file SCellsFunctors.h.

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

Constructor.

Parameters:
aKa Khalimsky space

Definition at line 180 of file SCellsFunctors.h.

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

Copy constructor.

Parameters:
otherany SCellToMidPoint functor

Definition at line 186 of file SCellsFunctors.h.

: myK(other.myK) { }

Member Function Documentation

template<typename KSpace>
Output DGtal::SCellToMidPoint< KSpace >::operator() ( const Input s) const
inline

Return a real point (double coordinates) from a scell (khalimsky coordinates)

Parameters:
sa scell
Returns:
the corresponding point.

Definition at line 208 of file SCellsFunctors.h.

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

{
ASSERT( myK );
Output o( myK->sKCoords(s) );
o /= 2;
return o;
}
template<typename KSpace>
SCellToMidPoint& DGtal::SCellToMidPoint< KSpace >::operator= ( const SCellToMidPoint< KSpace > &  other)
inline

Assignment.

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

Definition at line 194 of file SCellsFunctors.h.

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

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

Field Documentation

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

Aliasing pointer on the Khalimsky space.

Definition at line 168 of file SCellsFunctors.h.

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


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