DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes
DGtal::deprecated::SCellToCode< KSpace > Class Template Reference

#include <Modifier.h>

Public Types

typedef KSpace::Point Point
typedef KSpace::Vector Vector
typedef char Output
typedef KSpace::SCell Input

Public Member Functions

 SCellToCode ()
 SCellToCode (KSpace aK)
 SCellToCode (const SCellToCode &other)
SCellToCodeoperator= (const SCellToCode &other)
Output get (const Input &s) const

Private Member Functions

 BOOST_STATIC_ASSERT (KSpace::dimension==2)

Private Attributes

KSpace myK

Detailed Description

template<typename KSpace>
class DGtal::deprecated::SCellToCode< KSpace >

Aim: transforms a 2d scell, basically a linel, into a code (0,1,2 or 3),.

Description of template class 'SCellToCode'

Template Parameters:
KSpace,the2d Khalimsky space
See also:
ConstIteratorAdapter KhalimskySpaceND

Definition at line 624 of file Modifier.h.


Member Typedef Documentation

template<typename KSpace >
typedef KSpace::SCell DGtal::deprecated::SCellToCode< KSpace >::Input

Definition at line 635 of file Modifier.h.

template<typename KSpace >
typedef char DGtal::deprecated::SCellToCode< KSpace >::Output

Definition at line 633 of file Modifier.h.

template<typename KSpace >
typedef KSpace::Point DGtal::deprecated::SCellToCode< KSpace >::Point

Definition at line 631 of file Modifier.h.

template<typename KSpace >
typedef KSpace::Vector DGtal::deprecated::SCellToCode< KSpace >::Vector

Definition at line 632 of file Modifier.h.


Constructor & Destructor Documentation

template<typename KSpace >
DGtal::deprecated::SCellToCode< KSpace >::SCellToCode ( )
inline

Default constructor.

Definition at line 645 of file Modifier.h.

{ }
template<typename KSpace >
DGtal::deprecated::SCellToCode< KSpace >::SCellToCode ( KSpace  aK)
inline

Constructor.

Parameters:
aKa Khalimsky space

Definition at line 650 of file Modifier.h.

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

Copy constructor.

Parameters:
otherany SCellToCode modifier

Definition at line 656 of file Modifier.h.

: myK(other.myK) { }

Member Function Documentation

template<typename KSpace >
DGtal::deprecated::SCellToCode< KSpace >::BOOST_STATIC_ASSERT ( KSpace::dimension  = =2)
private
template<typename KSpace >
Output DGtal::deprecated::SCellToCode< KSpace >::get ( const Input s) const
inline

Get a code from a linel

Parameters:
sa linel
Returns:
the corresponding code

Definition at line 678 of file Modifier.h.

References DGtal::deprecated::SCellToCode< KSpace >::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 ) );
if (v == Vector(1,0)) return '0';
else if (v == Vector(0,1)) return '1';
else if (v == Vector(-1,0)) return '2';
else if (v == Vector(0,-1)) return '3';
else return 'e'; //e for error!
}
template<typename KSpace >
SCellToCode& DGtal::deprecated::SCellToCode< KSpace >::operator= ( const SCellToCode< KSpace > &  other)
inline

Assignment.

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

Definition at line 664 of file Modifier.h.

References DGtal::deprecated::SCellToCode< KSpace >::myK.

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

Field Documentation

template<typename KSpace >
KSpace DGtal::deprecated::SCellToCode< KSpace >::myK
private

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