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

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

#include <DGtal/topology/SCellsFunctors.h>

Collaboration diagram for DGtal::functors::deprecated::SCellToMidPoint< KSpace >:
[legend]

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 KSpacemyK
 

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

Definition at line 166 of file SCellsFunctors.h.

Member Typedef Documentation

◆ Input

Definition at line 172 of file SCellsFunctors.h.

◆ Output

Definition at line 171 of file SCellsFunctors.h.

Constructor & Destructor Documentation

◆ SCellToMidPoint() [1/3]

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

Default constructor.

Definition at line 185 of file SCellsFunctors.h.

185 : myK(NULL) { }

◆ SCellToMidPoint() [2/3]

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) { }

◆ SCellToMidPoint() [3/3]

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

◆ operator()()

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  }
const Point & sKCoords(const SCell &c) const
Return its Khalimsky coordinates.

References DGtal::functors::deprecated::SCellToMidPoint< KSpace >::myK, and DGtal::KhalimskySpaceND< dim, TInteger >::sKCoords().

◆ operator=()

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.

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

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

Field Documentation

◆ myK

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

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