DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Protected Attributes
DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface > Struct Template Reference

#include <CanonicDigitalSurfaceEmbedder.h>

Public Types

typedef
CanonicDigitalSurfaceEmbedder
< TDigitalSurface > 
Self
typedef TDigitalSurface Surface
typedef Surface::KSpace KSpace
typedef KSpace::SCell SCell
typedef KSpace::Space Space
typedef Space::RealPoint RealPoint
typedef SCell Argument
typedef RealPoint Value
typedef Space::Integer Integer
typedef Space::Point Point

Public Member Functions

 BOOST_CONCEPT_ASSERT ((CCellularGridSpaceND< KSpace >))
 ~CanonicDigitalSurfaceEmbedder ()
 CanonicDigitalSurfaceEmbedder ()
 CanonicDigitalSurfaceEmbedder (const Surface &aSurface)
 CanonicDigitalSurfaceEmbedder (const Self &other)
Selfoperator= (const Self &other)
const Surfacesurface () const
RealPoint embed (const SCell &cell) const
RealPoint operator() (const SCell &cell) const
void selfDisplay (std::ostream &out) const
bool isValid () const

Protected Attributes

const SurfacemySurface

Detailed Description

template<typename TDigitalSurface>
struct DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >

Aim: A trivial embedder for digital surfaces, which corresponds to the canonic injection of cell centroids into Rn.

Description of class 'CanonicDigitalSurfaceEmbedder'

Model of CCanonicDigitalSurfaceEmbedder (and thus of CSCellEmbedder).

Template Parameters:
TDigitalSurfacethe type of digital surface where the embedder works.

Definition at line 64 of file CanonicDigitalSurfaceEmbedder.h.


Member Typedef Documentation

template<typename TDigitalSurface>
typedef SCell DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::Argument

Definition at line 75 of file CanonicDigitalSurfaceEmbedder.h.

template<typename TDigitalSurface>
typedef Space::Integer DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::Integer

Definition at line 78 of file CanonicDigitalSurfaceEmbedder.h.

template<typename TDigitalSurface>
typedef Surface::KSpace DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::KSpace

Definition at line 70 of file CanonicDigitalSurfaceEmbedder.h.

template<typename TDigitalSurface>
typedef Space::Point DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::Point

Definition at line 79 of file CanonicDigitalSurfaceEmbedder.h.

template<typename TDigitalSurface>
typedef Space::RealPoint DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::RealPoint

Definition at line 74 of file CanonicDigitalSurfaceEmbedder.h.

template<typename TDigitalSurface>
typedef KSpace::SCell DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::SCell

Definition at line 72 of file CanonicDigitalSurfaceEmbedder.h.

template<typename TDigitalSurface>
typedef CanonicDigitalSurfaceEmbedder<TDigitalSurface> DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::Self

Definition at line 67 of file CanonicDigitalSurfaceEmbedder.h.

template<typename TDigitalSurface>
typedef KSpace::Space DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::Space

Definition at line 73 of file CanonicDigitalSurfaceEmbedder.h.

template<typename TDigitalSurface>
typedef TDigitalSurface DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::Surface

Definition at line 69 of file CanonicDigitalSurfaceEmbedder.h.

template<typename TDigitalSurface>
typedef RealPoint DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::Value

Definition at line 76 of file CanonicDigitalSurfaceEmbedder.h.


Constructor & Destructor Documentation

template<typename TDigitalSurface >
DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::~CanonicDigitalSurfaceEmbedder ( )
inline

Destructor. Nothing special.

Definition at line 47 of file CanonicDigitalSurfaceEmbedder.ih.

{}
template<typename TDigitalSurface >
DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::CanonicDigitalSurfaceEmbedder ( )
inline

Default constructor. The object is not valid.

Definition at line 53 of file CanonicDigitalSurfaceEmbedder.ih.

: mySurface( 0 )
{}
template<typename TDigitalSurface >
DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::CanonicDigitalSurfaceEmbedder ( const Surface aSurface)
inline

Constructor from surface.

Definition at line 60 of file CanonicDigitalSurfaceEmbedder.ih.

: mySurface( &aSurface )
{}
template<typename TDigitalSurface >
DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::CanonicDigitalSurfaceEmbedder ( const Self other)
inline

Copy constructor.

Parameters:
otherthe object to clone.

Definition at line 67 of file CanonicDigitalSurfaceEmbedder.ih.

: mySurface( other.mySurface )
{}

Member Function Documentation

template<typename TDigitalSurface>
DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::BOOST_CONCEPT_ASSERT ( (CCellularGridSpaceND< KSpace >)  )
template<typename TDigitalSurface >
DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::RealPoint DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::embed ( const SCell cell) const
inline

Map a signed cell to its corresponding point in the Euclidean space.

Parameters:
cellany signed cell in the digital space.
Returns:
its canconical embedding in the Euclidean space.

Definition at line 93 of file CanonicDigitalSurfaceEmbedder.ih.

{
return this->operator()( scell );
}
template<typename TDigitalSurface >
bool DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::isValid ( ) const
inline

Checks the validity/consistency of the object.

Returns:
'true' if the object is valid, 'false' otherwise.

Definition at line 114 of file CanonicDigitalSurfaceEmbedder.ih.

{
return mySurface != 0;
}
template<typename TDigitalSurface >
DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::RealPoint DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::operator() ( const SCell cell) const
inline

Map a signed cell to its corresponding point in the Euclidean space.

Parameters:
cellany signed cell in the digital space.
Returns:
its canconical embedding in the Euclidean space.

Definition at line 101 of file CanonicDigitalSurfaceEmbedder.ih.

{
ASSERT( this->isValid() );
Point dp = mySurface->container().space().sKCoords( scell );
RealPoint p;
for ( Dimension i = 0; i < dp.size(); ++i )
p[ i ] = NumberTraits<Integer>::castToDouble( dp[ i ] ) / 2;
return p;
}
template<typename TDigitalSurface >
DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::Self & DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::operator= ( const Self other)
inline

Assignment.

Parameters:
otherthe object to clone.
Returns:
a reference to 'this'.

Definition at line 75 of file CanonicDigitalSurfaceEmbedder.ih.

References DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::mySurface.

{
mySurface = other.mySurface;
return *this;
}
template<typename TDigitalSurface>
void DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.
template<typename TDigitalSurface >
const DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::Surface & DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::surface ( ) const
inline
Returns:
the digital surface.

Definition at line 84 of file CanonicDigitalSurfaceEmbedder.ih.

{
ASSERT( this->isValid() );
return *mySurface;
}

Field Documentation

template<typename TDigitalSurface>
const Surface* DGtal::CanonicDigitalSurfaceEmbedder< TDigitalSurface >::mySurface
protected

The documentation for this struct was generated from the following files: