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::SCellToArrow< KSpace > Class Template Reference

#include <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 (const 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::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 228 of file SCellsFunctors.h.


Member Typedef Documentation

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

Definition at line 236 of file SCellsFunctors.h.

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

Definition at line 235 of file SCellsFunctors.h.

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

Definition at line 233 of file SCellsFunctors.h.

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

Definition at line 234 of file SCellsFunctors.h.


Constructor & Destructor Documentation

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

Default constructor.

Definition at line 249 of file SCellsFunctors.h.

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

Constructor.

Parameters:
aKa Khalimsky space

Definition at line 254 of file SCellsFunctors.h.

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

Copy constructor.

Parameters:
otherany SCellToArrow modifier

Definition at line 260 of file SCellsFunctors.h.

: myK(other.myK) { }

Member Function Documentation

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

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

{
ASSERT( myK );
//starting point of the arrow
Input pointel( myK->sIndirectIncident( s, *myK->sDirs( s ) ) );
Point p( myK->sCoords( pointel ) ); //integer coordinates
//displacement vector
Vector v( myK->sKCoords( s ) - myK->sKCoords( pointel ) );
return Output(p,v);
}
template<typename KSpace>
SCellToArrow& DGtal::SCellToArrow< KSpace >::operator= ( const SCellToArrow< KSpace > &  other)
inline

Assignment.

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

Definition at line 268 of file SCellsFunctors.h.

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

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

Field Documentation

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

Aliasing pointer on the Khalimsky space.

Definition at line 242 of file SCellsFunctors.h.

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


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