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

#include <DGtal/topology/SCellsFunctors.h>

Public Types

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

Public Member Functions

 SCellToMidPoint ()
 
 SCellToMidPoint (ConstAlias< 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::functors::deprecated::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 166 of file SCellsFunctors.h.

Member Typedef Documentation

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

Definition at line 172 of file SCellsFunctors.h.

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

Definition at line 171 of file SCellsFunctors.h.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 185 of file SCellsFunctors.h.

185 : myK(NULL) { }
template<typename KSpace >
DGtal::functors::deprecated::SCellToMidPoint< KSpace >::SCellToMidPoint ( ConstAlias< KSpace >  aK)
inline

Constructor.

Parameters
aKa Khalimsky space

Definition at line 190 of file SCellsFunctors.h.

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

Copy constructor.

Parameters
otherany SCellToMidPoint functor

Definition at line 196 of file SCellsFunctors.h.

197  : myK(other.myK) { }

Member Function Documentation

template<typename KSpace >
Output DGtal::functors::deprecated::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 218 of file SCellsFunctors.h.

219  {
220  ASSERT( myK );
221  Output o( myK->sKCoords(s) );
222  o /= 2;
223  for( unsigned int i = 0; i < o.dimension; ++i )
224  o[i] -= 0.5;
225  return o;
226  }
template<typename KSpace >
SCellToMidPoint& DGtal::functors::deprecated::SCellToMidPoint< KSpace >::operator= ( const SCellToMidPoint< KSpace > &  other)
inline

Assignment.

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

Definition at line 204 of file SCellsFunctors.h.

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

205  {
206  if (this != &other)
207  {
208  myK = other.myK;
209  }
210  return *this;
211  }

Field Documentation

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

Aliasing pointer on the Khalimsky space.

Definition at line 178 of file SCellsFunctors.h.

Referenced by DGtal::functors::deprecated::SCellToMidPoint< KSpace >::operator=().


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