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

#include <DGtal/topology/SCellsFunctors.h>

Public Types

typedef KSpace::Point Point
 
typedef KSpace::Vector Vector
 
typedef std::pair< Point, VectorOutput
 
typedef KSpace::SCell Input
 

Public Member Functions

 SCellToArrow ()
 
 SCellToArrow (ConstAlias< KSpace > aK)
 
 SCellToArrow (const SCellToArrow &other)
 
SCellToArrowoperator= (const SCellToArrow &other)
 
Output operator() (const Input &s) const
 

Private Attributes

const KSpace * myK
 

Detailed Description

template<typename KSpace>
class DGtal::functors::SCellToArrow< KSpace >

Aim: transforms a signed cell into an arrow, ie. a pair point-vector.

Description of template class 'SCellToArrow'

Template Parameters
KSpacethe Khalimsky space
See also
SCellToPoint ConstIteratorAdapter KhalimskySpaceND PointVector

Definition at line 240 of file SCellsFunctors.h.

Member Typedef Documentation

template<typename KSpace>
typedef KSpace::SCell DGtal::functors::SCellToArrow< KSpace >::Input

Definition at line 248 of file SCellsFunctors.h.

template<typename KSpace>
typedef std::pair<Point,Vector> DGtal::functors::SCellToArrow< KSpace >::Output

Definition at line 247 of file SCellsFunctors.h.

template<typename KSpace>
typedef KSpace::Point DGtal::functors::SCellToArrow< KSpace >::Point

Definition at line 245 of file SCellsFunctors.h.

template<typename KSpace>
typedef KSpace::Vector DGtal::functors::SCellToArrow< KSpace >::Vector

Definition at line 246 of file SCellsFunctors.h.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 261 of file SCellsFunctors.h.

261 : myK(NULL) { }
template<typename KSpace>
DGtal::functors::SCellToArrow< KSpace >::SCellToArrow ( ConstAlias< KSpace >  aK)
inline

Constructor.

Parameters
aKa Khalimsky space

Definition at line 266 of file SCellsFunctors.h.

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

Copy constructor.

Parameters
otherany SCellToArrow modifier

Definition at line 272 of file SCellsFunctors.h.

273  : myK(other.myK) { }

Member Function Documentation

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

Get an arrow, ie a pair point-vector with integer coordinates from a scell in khalimsky coordinates

Parameters
sa scell
Returns
the corresponding point.

Definition at line 295 of file SCellsFunctors.h.

296  {
297  ASSERT( myK );
298  //starting point of the arrow
299  Input pointel( myK->sIndirectIncident( s, *myK->sDirs( s ) ) );
300  Point p( myK->sCoords( pointel ) ); //integer coordinates
301  //displacement vector
302  Vector v( myK->sKCoords( s ) - myK->sKCoords( pointel ) );
303  return Output(p,v);
304  }
std::pair< Point, Vector > Output
template<typename KSpace>
SCellToArrow& DGtal::functors::SCellToArrow< KSpace >::operator= ( const SCellToArrow< KSpace > &  other)
inline

Assignment.

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

Definition at line 280 of file SCellsFunctors.h.

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

281  {
282  if (this != &other)
283  {
284  myK = other.myK;
285  }
286  return *this;
287  }

Field Documentation

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

Aliasing pointer on the Khalimsky space.

Definition at line 254 of file SCellsFunctors.h.

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


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