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::CanonicCellEmbedder< TKSpace > Struct Template Reference

#include <CanonicCellEmbedder.h>

Public Types

typedef CanonicCellEmbedder
< TKSpace > 
Self
typedef TKSpace KSpace
typedef KSpace::Cell Cell
typedef KSpace::Space Space
typedef Space::RealPoint RealPoint
typedef Cell Argument
typedef RealPoint Value
typedef Space::Integer Integer
typedef Space::Point Point

Public Member Functions

 BOOST_CONCEPT_ASSERT ((CCellularGridSpaceND< TKSpace >))
 ~CanonicCellEmbedder ()
 CanonicCellEmbedder ()
 CanonicCellEmbedder (const KSpace &aKSpace)
 CanonicCellEmbedder (const Self &other)
Selfoperator= (const Self &other)
const KSpacespace () const
RealPoint embed (const Cell &cell) const
RealPoint operator() (const Cell &cell) const
void selfDisplay (std::ostream &out) const
bool isValid () const

Protected Attributes

const KSpacemyKSpace

Detailed Description

template<typename TKSpace>
struct DGtal::CanonicCellEmbedder< TKSpace >

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

Description of class 'CanonicCellEmbedder'

Model of CCellEmbedder.

Template Parameters:
TKSpacethe type of cellular grid space where the embedder works, a model of CCellularGridSpaceND.

Definition at line 64 of file CanonicCellEmbedder.h.


Member Typedef Documentation

template<typename TKSpace>
typedef Cell DGtal::CanonicCellEmbedder< TKSpace >::Argument

Definition at line 74 of file CanonicCellEmbedder.h.

template<typename TKSpace>
typedef KSpace::Cell DGtal::CanonicCellEmbedder< TKSpace >::Cell

Definition at line 71 of file CanonicCellEmbedder.h.

template<typename TKSpace>
typedef Space::Integer DGtal::CanonicCellEmbedder< TKSpace >::Integer

Definition at line 77 of file CanonicCellEmbedder.h.

template<typename TKSpace>
typedef TKSpace DGtal::CanonicCellEmbedder< TKSpace >::KSpace

Definition at line 70 of file CanonicCellEmbedder.h.

template<typename TKSpace>
typedef Space::Point DGtal::CanonicCellEmbedder< TKSpace >::Point

Definition at line 78 of file CanonicCellEmbedder.h.

template<typename TKSpace>
typedef Space::RealPoint DGtal::CanonicCellEmbedder< TKSpace >::RealPoint

Definition at line 73 of file CanonicCellEmbedder.h.

template<typename TKSpace>
typedef CanonicCellEmbedder<TKSpace> DGtal::CanonicCellEmbedder< TKSpace >::Self

Definition at line 67 of file CanonicCellEmbedder.h.

template<typename TKSpace>
typedef KSpace::Space DGtal::CanonicCellEmbedder< TKSpace >::Space

Definition at line 72 of file CanonicCellEmbedder.h.

template<typename TKSpace>
typedef RealPoint DGtal::CanonicCellEmbedder< TKSpace >::Value

Definition at line 75 of file CanonicCellEmbedder.h.


Constructor & Destructor Documentation

template<typename TKSpace >
DGtal::CanonicCellEmbedder< TKSpace >::~CanonicCellEmbedder ( )
inline

Destructor. Nothing special.

Definition at line 47 of file CanonicCellEmbedder.ih.

{}
template<typename TKSpace >
DGtal::CanonicCellEmbedder< TKSpace >::CanonicCellEmbedder ( )
inline

Default constructor. The object is not valid.

Definition at line 53 of file CanonicCellEmbedder.ih.

: myKSpace( 0 )
{}
template<typename TKSpace >
DGtal::CanonicCellEmbedder< TKSpace >::CanonicCellEmbedder ( const KSpace aKSpace)
inline

Constructor from space.

Definition at line 60 of file CanonicCellEmbedder.ih.

: myKSpace( &aKSpace )
{}
template<typename TKSpace >
DGtal::CanonicCellEmbedder< TKSpace >::CanonicCellEmbedder ( const Self other)
inline

Copy constructor.

Parameters:
otherthe object to clone.

Definition at line 67 of file CanonicCellEmbedder.ih.

: myKSpace( other.myKSpace )
{}

Member Function Documentation

template<typename TKSpace>
DGtal::CanonicCellEmbedder< TKSpace >::BOOST_CONCEPT_ASSERT ( (CCellularGridSpaceND< TKSpace >)  )
template<typename TKSpace >
DGtal::CanonicCellEmbedder< TKSpace >::RealPoint DGtal::CanonicCellEmbedder< TKSpace >::embed ( const Cell cell) const
inline

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

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

Definition at line 93 of file CanonicCellEmbedder.ih.

{
return this->operator()( cell );
}
template<typename TKSpace >
bool DGtal::CanonicCellEmbedder< TKSpace >::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 CanonicCellEmbedder.ih.

{
return myKSpace != 0;
}
template<typename TKSpace >
DGtal::CanonicCellEmbedder< TKSpace >::RealPoint DGtal::CanonicCellEmbedder< TKSpace >::operator() ( const Cell cell) const
inline

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

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

Definition at line 101 of file CanonicCellEmbedder.ih.

{
ASSERT( this->isValid() );
Point dp = myKSpace->uKCoords( cell );
RealPoint p;
for ( Dimension i = 0; i < dp.size(); ++i )
p[ i ] = NumberTraits<Integer>::castToDouble( dp[ i ] ) / 2;
return p;
}
template<typename TKSpace >
DGtal::CanonicCellEmbedder< TKSpace >::Self & DGtal::CanonicCellEmbedder< TKSpace >::operator= ( const Self other)
inline

Assignment.

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

Definition at line 75 of file CanonicCellEmbedder.ih.

References DGtal::CanonicCellEmbedder< TKSpace >::myKSpace.

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

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.
template<typename TKSpace >
const DGtal::CanonicCellEmbedder< TKSpace >::KSpace & DGtal::CanonicCellEmbedder< TKSpace >::space ( ) const
inline
Returns:
the cellular grid space.

Definition at line 84 of file CanonicCellEmbedder.ih.

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

Field Documentation

template<typename TKSpace>
const KSpace* DGtal::CanonicCellEmbedder< TKSpace >::myKSpace
protected

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