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

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

#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 KSpacemyK
 

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

◆ Input

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

Definition at line 248 of file SCellsFunctors.h.

◆ Output

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

Definition at line 247 of file SCellsFunctors.h.

◆ Point

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

Definition at line 245 of file SCellsFunctors.h.

◆ Vector

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

Definition at line 246 of file SCellsFunctors.h.

Constructor & Destructor Documentation

◆ SCellToArrow() [1/3]

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

Default constructor.

Definition at line 261 of file SCellsFunctors.h.

261 : myK(NULL) { }

◆ SCellToArrow() [2/3]

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

◆ SCellToArrow() [3/3]

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

◆ operator()()

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  }

References DGtal::functors::SCellToArrow< KSpace >::myK, DGtal::KhalimskySpaceND< dim, TInteger >::sCoords(), DGtal::KhalimskySpaceND< dim, TInteger >::sDirs(), DGtal::KhalimskySpaceND< dim, TInteger >::sIndirectIncident(), and DGtal::KhalimskySpaceND< dim, TInteger >::sKCoords().

◆ operator=()

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.

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

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

Field Documentation

◆ myK

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()(), and DGtal::functors::SCellToArrow< KSpace >::operator=().


The documentation for this class was generated from the following file:
DGtal::KhalimskySpaceND::sIndirectIncident
SCell sIndirectIncident(const SCell &p, Dimension k) const
Return the indirect incident cell of [p] along [k] (the incident cell along [k] whose sign is negativ...
DGtal::functors::SCellToArrow::Input
KSpace::SCell Input
Definition: SCellsFunctors.h:248
DGtal::KhalimskySpaceND::sDirs
DirIterator sDirs(const SCell &p) const
Given a signed cell [p], returns an iterator to iterate over each coordinate the cell spans.
DGtal::functors::SCellToArrow::Output
std::pair< Point, Vector > Output
Definition: SCellsFunctors.h:247
DGtal::KhalimskySpaceND::sCoords
Point sCoords(const SCell &c) const
Return its digital coordinates.
DGtal::KhalimskySpaceND::sKCoords
const Point & sKCoords(const SCell &c) const
Return its Khalimsky coordinates.
Vector
FreemanChain< int >::Vector Vector
Definition: testCombinDSS.cpp:60
DGtal::functors::SCellToArrow::myK
const KSpace * myK
Definition: SCellsFunctors.h:254
Point
MyPointD Point
Definition: testClone2.cpp:383