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

#include <RegularPointEmbedder.h>

Inheritance diagram for DGtal::RegularPointEmbedder< TSpace >:
Inheritance graph
[legend]

Public Types

typedef TSpace Space
typedef Space::Point Point
typedef Space::RealPoint RealPoint
typedef Point Argument
typedef RealPoint Value
typedef Space::Integer Integer
typedef Space::RealVector RealVector

Public Member Functions

 ~RegularPointEmbedder ()
 RegularPointEmbedder ()
RegularPointEmbedderoperator= (const RegularPointEmbedder &other)
void init (typename RealVector::Component gridStep)
void init (const RealVector &gridSteps)
Point floor (const RealPoint &p) const
Point ceil (const RealPoint &p) const
Point round (const RealPoint &p) const
RealPoint embed (const Point &p) const
RealPoint operator() (const Point &p) const
RealVector gridSteps () const
void selfDisplay (std::ostream &out) const
bool isValid () const

Protected Attributes

RealVector myGridSteps

Private Member Functions

 BOOST_CONCEPT_ASSERT ((CSpace< TSpace >))

Detailed Description

template<typename TSpace>
class DGtal::RegularPointEmbedder< TSpace >

Aim: A simple point embedder where grid steps are given for each axis. Note that the real point (0,...,0) is mapped onto the digital point (0,...,0).

Description of template class 'RegularPointEmbedder'

RegularPointEmbedder is a model of CPointEmbedder.

Template Parameters:
TSpacethe type of digital Space where the digitized object lies. A model of CSpace.

Definition at line 68 of file RegularPointEmbedder.h.


Member Typedef Documentation

template<typename TSpace>
typedef Point DGtal::RegularPointEmbedder< TSpace >::Argument

Definition at line 77 of file RegularPointEmbedder.h.

template<typename TSpace>
typedef Space::Integer DGtal::RegularPointEmbedder< TSpace >::Integer

Definition at line 80 of file RegularPointEmbedder.h.

template<typename TSpace>
typedef Space::Point DGtal::RegularPointEmbedder< TSpace >::Point

Definition at line 75 of file RegularPointEmbedder.h.

template<typename TSpace>
typedef Space::RealPoint DGtal::RegularPointEmbedder< TSpace >::RealPoint

Definition at line 76 of file RegularPointEmbedder.h.

template<typename TSpace>
typedef Space::RealVector DGtal::RegularPointEmbedder< TSpace >::RealVector

Definition at line 81 of file RegularPointEmbedder.h.

template<typename TSpace>
typedef TSpace DGtal::RegularPointEmbedder< TSpace >::Space

Definition at line 74 of file RegularPointEmbedder.h.

template<typename TSpace>
typedef RealPoint DGtal::RegularPointEmbedder< TSpace >::Value

Definition at line 78 of file RegularPointEmbedder.h.


Constructor & Destructor Documentation

template<typename TSpace >
DGtal::RegularPointEmbedder< TSpace >::~RegularPointEmbedder ( )
inline

Destructor.

Definition at line 46 of file RegularPointEmbedder.ih.

{
}
template<typename TSpace >
DGtal::RegularPointEmbedder< TSpace >::RegularPointEmbedder ( )
inline

Constructor. The object is not valid.

Definition at line 52 of file RegularPointEmbedder.ih.

{}

Member Function Documentation

template<typename TSpace>
DGtal::RegularPointEmbedder< TSpace >::BOOST_CONCEPT_ASSERT ( (CSpace< TSpace >)  )
private
template<typename TSpace >
DGtal::RegularPointEmbedder< TSpace >::Point DGtal::RegularPointEmbedder< TSpace >::ceil ( const RealPoint p) const
inline
Parameters:
pany point in the Euclidean space.
Returns:
the digital point ceil( p / gridSteps ).

Definition at line 102 of file RegularPointEmbedder.ih.

{
Point aPoint;
for ( Dimension i = 0; i < Space::dimension; ++i )
aPoint[ i ] = (Integer) ::ceil( p[ i ] / myGridSteps[ i ] );
return aPoint;
}
template<typename TSpace >
DGtal::RegularPointEmbedder< TSpace >::RealPoint DGtal::RegularPointEmbedder< TSpace >::embed ( const Point p) const
inline

Map a digital point to its corresponding point in the Eucldiean space.

Parameters:
pany digital point in the digital space.
Returns:
its centroid embedding in the Euclidean space.

Definition at line 126 of file RegularPointEmbedder.ih.

{
return this->operator()( p );
}
template<typename TSpace >
DGtal::RegularPointEmbedder< TSpace >::Point DGtal::RegularPointEmbedder< TSpace >::floor ( const RealPoint p) const
inline
Parameters:
pany point in the Euclidean space.
Returns:
the digital point floor( p / gridSteps ).

Definition at line 90 of file RegularPointEmbedder.ih.

{
Point aPoint;
for ( Dimension i = 0; i < Space::dimension; ++i )
aPoint[ i ] = (Integer) ::floor( p[ i ] / myGridSteps[ i ] );
return aPoint;
}
template<typename TSpace >
DGtal::RegularPointEmbedder< TSpace >::RealVector DGtal::RegularPointEmbedder< TSpace >::gridSteps ( ) const
inline
Returns:
the grid steps in each direction.

Definition at line 148 of file RegularPointEmbedder.ih.

{
return myGridSteps;
}
template<typename TSpace >
void DGtal::RegularPointEmbedder< TSpace >::init ( typename RealVector::Component  gridStep)
inline

Initializes the embedder. The real value [gridStep] specifies the same grid step in every direction.

Parameters:
gridStepthe grid step (distance between two embedded adjacent digital points) identical in every direction.

Definition at line 72 of file RegularPointEmbedder.ih.

{
myGridSteps = RealVector::diagonal( gridStep );
}
template<typename TSpace >
void DGtal::RegularPointEmbedder< TSpace >::init ( const RealVector gridSteps)
inline

Initializes the embedder. The real vector [gridSteps] specifies the grid steps in each direction.

Parameters:
gridStepsthe grid steps in each direction.

Definition at line 81 of file RegularPointEmbedder.ih.

{
myGridSteps = aGridSteps;
}
template<typename TSpace >
bool DGtal::RegularPointEmbedder< TSpace >::isValid ( ) const
inline

Checks the validity/consistency of the object.

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

Definition at line 176 of file RegularPointEmbedder.ih.

{
return true;
}
template<typename TSpace >
DGtal::RegularPointEmbedder< TSpace >::RealPoint DGtal::RegularPointEmbedder< TSpace >::operator() ( const Point p) const
inline

Map a digital point to its corresponding point in the Eucldiean space.

Parameters:
pany digital point in the digital space.
Returns:
its centroid embedding in the Euclidean space.

Definition at line 135 of file RegularPointEmbedder.ih.

{
RealPoint aRealPoint;
for ( Dimension i = 0; i < Space::dimension; ++i )
aRealPoint[ i ] = NumberTraits<Integer>::castToDouble( p[ i ] )
* myGridSteps[ i ];
return aRealPoint;
}
template<typename TSpace >
DGtal::RegularPointEmbedder< TSpace > & DGtal::RegularPointEmbedder< TSpace >::operator= ( const RegularPointEmbedder< TSpace > &  other)
inline

Assignment. Required by CPointPredicate.

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

Definition at line 59 of file RegularPointEmbedder.ih.

References DGtal::RegularPointEmbedder< TSpace >::myGridSteps.

{
if ( this != &other )
{
}
return *this;
}
template<typename TSpace >
DGtal::RegularPointEmbedder< TSpace >::Point DGtal::RegularPointEmbedder< TSpace >::round ( const RealPoint p) const
inline
Parameters:
pany point in the Euclidean space.
Returns:
the digital point round( p / gridSteps ), i.e. the "closest" digital point.

Definition at line 114 of file RegularPointEmbedder.ih.

{
Point aPoint;
for ( Dimension i = 0; i < Space::dimension; ++i )
aPoint[ i ] = (Integer) ::round( p[ i ] / myGridSteps[ i ] );
return aPoint;
}
template<typename TSpace >
void DGtal::RegularPointEmbedder< TSpace >::selfDisplay ( std::ostream &  out) const
inline

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.

Definition at line 164 of file RegularPointEmbedder.ih.

{
out << "[RegularPointEmbedder]";
}

Field Documentation

template<typename TSpace>
RealVector DGtal::RegularPointEmbedder< TSpace >::myGridSteps
protected

The grid steps.

Definition at line 180 of file RegularPointEmbedder.h.

Referenced by DGtal::RegularPointEmbedder< TSpace >::operator=().


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