DGtal  0.9.4beta
Public Types | Public Member Functions | Protected Attributes
DGtal::GaussDigitizer< TSpace, TEuclideanShape > Class Template Reference

#include <DGtal/shapes/GaussDigitizer.h>

Inheritance diagram for DGtal::GaussDigitizer< TSpace, TEuclideanShape >:
[legend]
Collaboration diagram for DGtal::GaussDigitizer< TSpace, TEuclideanShape >:
[legend]

Public Types

typedef TSpace Space
 
typedef Space::Integer Integer
 
typedef Space::Point Point
 
typedef Space::Vector Vector
 
typedef Space::RealPoint RealPoint
 
typedef Space::RealPoint RealVector
 
typedef TEuclideanShape EuclideanShape
 
typedef HyperRectDomain< SpaceDomain
 
typedef RegularPointEmbedder< SpacePointEmbedder
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CEuclideanOrientedShape< TEuclideanShape >))
 
 ~GaussDigitizer ()
 
 GaussDigitizer ()
 
GaussDigitizeroperator= (const GaussDigitizer &other)
 
void attach (const EuclideanShape &shape)
 
void init (const RealPoint &xLow, const RealPoint &xUp, typename RealVector::Component gridStep)
 
void init (const RealPoint &xLow, const RealPoint &xUp, const RealVector &gridSteps)
 
const PointEmbedderpointEmbedder () const
 
Domain getDomain () const
 
Point floor (const RealPoint &p) const
 
Point ceil (const RealPoint &p) const
 
Point round (const RealPoint &p) const
 
RealPoint embed (const Point &p) const
 
Orientation orientation (const Point &p) const
 
bool operator() (const Point &p) const
 
const PointgetLowerBound () const
 
const PointgetUpperBound () const
 
Vector resolution () const
 
RealVector gridSteps () const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Attributes

const EuclideanShapemyEShape
 
RegularPointEmbedder< SpacemyPointEmbedder
 
Point myLowerPoint
 
Point myUpperPoint
 

Detailed Description

template<typename TSpace, typename TEuclideanShape>
class DGtal::GaussDigitizer< TSpace, TEuclideanShape >

Aim: A class for computing the Gauss digitization of some Euclidean shape, i.e. its intersection with some \( h_1 Z \times h_2 Z \times \cdots \times h_n Z \). Note that the real point (0,...,0) is mapped onto the digital point (0,...,0).

Description of template class 'GaussDigitizer'

GaussDigitizer is a model of CDigitalEuclideanShape and CDigitalBoundedShape. It is thus a model of concepts::CPointPredicate. A Gauss digitizer owns a RegularPointEmbedder, a model of CPointEmbedder.

Template Parameters
TSpacethe type of digital Space where the digitized object lies.
TEuclideanShapea model of CEuclideanOrientedShape and CEuclideanBoundedShape
Examples:
geometry/curves/estimation/exampleCurvature.cpp, shapes/exampleEuclideanShapesDecorator.cpp, topology/frontierAndBoundary.cpp, topology/trackImplicitPolynomialSurfaceToOFF.cpp, and tutorial-examples/AreaSurfaceEstimation-final.cpp.

Definition at line 77 of file GaussDigitizer.h.

Member Typedef Documentation

template<typename TSpace, typename TEuclideanShape>
typedef HyperRectDomain<Space> DGtal::GaussDigitizer< TSpace, TEuclideanShape >::Domain

Definition at line 88 of file GaussDigitizer.h.

template<typename TSpace, typename TEuclideanShape>
typedef TEuclideanShape DGtal::GaussDigitizer< TSpace, TEuclideanShape >::EuclideanShape

Definition at line 87 of file GaussDigitizer.h.

template<typename TSpace, typename TEuclideanShape>
typedef Space::Integer DGtal::GaussDigitizer< TSpace, TEuclideanShape >::Integer

Definition at line 82 of file GaussDigitizer.h.

template<typename TSpace, typename TEuclideanShape>
typedef Space::Point DGtal::GaussDigitizer< TSpace, TEuclideanShape >::Point

Definition at line 83 of file GaussDigitizer.h.

template<typename TSpace, typename TEuclideanShape>
typedef RegularPointEmbedder<Space> DGtal::GaussDigitizer< TSpace, TEuclideanShape >::PointEmbedder

Definition at line 89 of file GaussDigitizer.h.

template<typename TSpace, typename TEuclideanShape>
typedef Space::RealPoint DGtal::GaussDigitizer< TSpace, TEuclideanShape >::RealPoint

Definition at line 85 of file GaussDigitizer.h.

template<typename TSpace, typename TEuclideanShape>
typedef Space::RealPoint DGtal::GaussDigitizer< TSpace, TEuclideanShape >::RealVector

Definition at line 86 of file GaussDigitizer.h.

template<typename TSpace, typename TEuclideanShape>
typedef TSpace DGtal::GaussDigitizer< TSpace, TEuclideanShape >::Space

Definition at line 81 of file GaussDigitizer.h.

template<typename TSpace, typename TEuclideanShape>
typedef Space::Vector DGtal::GaussDigitizer< TSpace, TEuclideanShape >::Vector

Definition at line 84 of file GaussDigitizer.h.

Constructor & Destructor Documentation

template<typename TSpace, typename TEuclideanShape>
DGtal::GaussDigitizer< TSpace, TEuclideanShape >::~GaussDigitizer ( )

Destructor.

template<typename TSpace, typename TEuclideanShape>
DGtal::GaussDigitizer< TSpace, TEuclideanShape >::GaussDigitizer ( )

Constructor. The object is not valid.

Member Function Documentation

template<typename TSpace, typename TEuclideanShape>
void DGtal::GaussDigitizer< TSpace, TEuclideanShape >::attach ( const EuclideanShape shape)
template<typename TSpace, typename TEuclideanShape>
DGtal::GaussDigitizer< TSpace, TEuclideanShape >::BOOST_CONCEPT_ASSERT ( (concepts::CEuclideanOrientedShape< TEuclideanShape >)  )
template<typename TSpace, typename TEuclideanShape>
Point DGtal::GaussDigitizer< TSpace, TEuclideanShape >::ceil ( const RealPoint p) const
Parameters
pany point in the Euclidean space.
Returns
the digital point ceil( p / gridSteps ).
template<typename TSpace, typename TEuclideanShape>
RealPoint DGtal::GaussDigitizer< TSpace, TEuclideanShape >::embed ( const Point p) const

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.

Referenced by DGtal::GaussDigitizer< Space, MyEuclideanShape >::orientation().

template<typename TSpace, typename TEuclideanShape>
Point DGtal::GaussDigitizer< TSpace, TEuclideanShape >::floor ( const RealPoint p) const
Parameters
pany point in the Euclidean space.
Returns
the digital point floor( p / gridSteps ).
template<typename TSpace, typename TEuclideanShape>
Domain DGtal::GaussDigitizer< TSpace, TEuclideanShape >::getDomain ( ) const
template<typename TSpace, typename TEuclideanShape>
const Point& DGtal::GaussDigitizer< TSpace, TEuclideanShape >::getLowerBound ( ) const
Returns
the lowest admissible digital point.
See also
init
template<typename TSpace, typename TEuclideanShape>
const Point& DGtal::GaussDigitizer< TSpace, TEuclideanShape >::getUpperBound ( ) const
Returns
the highest admissible digital point.
See also
init
template<typename TSpace, typename TEuclideanShape>
RealVector DGtal::GaussDigitizer< TSpace, TEuclideanShape >::gridSteps ( ) const
Returns
the grid steps in each direction.
template<typename TSpace, typename TEuclideanShape>
void DGtal::GaussDigitizer< TSpace, TEuclideanShape >::init ( const RealPoint xLow,
const RealPoint xUp,
typename RealVector::Component  gridStep 
)

Initializes the digital bounds of the digitizer so as to cover at least the space specified by [xLow] and [xUp]. The real value [gridStep] specifies the same grid step in every direction.

Parameters
xLowEuclidean lower bound for the digitizer.
xUpEuclidean upper bound for the digitizer.
gridStepthe grid step (distance between two embedded adjacent digital points) identical in every direction.
Examples:
topology/frontierAndBoundary.cpp, topology/trackImplicitPolynomialSurfaceToOFF.cpp, and tutorial-examples/AreaSurfaceEstimation-final.cpp.
template<typename TSpace, typename TEuclideanShape>
void DGtal::GaussDigitizer< TSpace, TEuclideanShape >::init ( const RealPoint xLow,
const RealPoint xUp,
const RealVector gridSteps 
)

Initializes the digital bounds of the digitizer so as to cover at least the space specified by [xLow] and [xUp]. The real vector [gridSteps] specifies the grid steps in each direction.

Parameters
xLowEuclidean lower bound for the digitizer.
xUpEuclidean upper bound for the digitizer.
gridStepsthe grid steps in each direction.
template<typename TSpace, typename TEuclideanShape>
bool DGtal::GaussDigitizer< TSpace, TEuclideanShape >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename TSpace, typename TEuclideanShape>
bool DGtal::GaussDigitizer< TSpace, TEuclideanShape >::operator() ( const Point p) const
Parameters
pany point in the digital plane.
Returns
'true' if the point is inside the shape, 'false' if it is strictly outside.
template<typename TSpace, typename TEuclideanShape>
GaussDigitizer& DGtal::GaussDigitizer< TSpace, TEuclideanShape >::operator= ( const GaussDigitizer< TSpace, TEuclideanShape > &  other)

Assignment. Required by concepts::CPointPredicate.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.
template<typename TSpace, typename TEuclideanShape>
Orientation DGtal::GaussDigitizer< TSpace, TEuclideanShape >::orientation ( const Point p) const
inline

Orientation method to match with CDigitalOrientedShape concept.

Parameters
pa digital point
Returns
negative orientation if the point is inside the shape, 0 if it is on the shape and positive orientation otherwise.

Definition at line 196 of file GaussDigitizer.h.

197  {
198  return myEShape->orientation(embed(p));
199  }
const EuclideanShape * myEShape
The referenced shape or 0 if not initialized.
RealPoint embed(const Point &p) const
template<typename TSpace, typename TEuclideanShape>
const PointEmbedder& DGtal::GaussDigitizer< TSpace, TEuclideanShape >::pointEmbedder ( ) const
Returns
the associated point embedder.
template<typename TSpace, typename TEuclideanShape>
Vector DGtal::GaussDigitizer< TSpace, TEuclideanShape >::resolution ( ) const
Returns
the resolution in each direction.
template<typename TSpace, typename TEuclideanShape>
Point DGtal::GaussDigitizer< TSpace, TEuclideanShape >::round ( const RealPoint p) const
Parameters
pany point in the Euclidean space.
Returns
the digital point round( p / gridSteps ), i.e. the "closest" digital point.
template<typename TSpace, typename TEuclideanShape>
void DGtal::GaussDigitizer< TSpace, TEuclideanShape >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

Field Documentation

template<typename TSpace, typename TEuclideanShape>
const EuclideanShape* DGtal::GaussDigitizer< TSpace, TEuclideanShape >::myEShape
protected

The referenced shape or 0 if not initialized.

Definition at line 250 of file GaussDigitizer.h.

Referenced by DGtal::GaussDigitizer< Space, MyEuclideanShape >::orientation().

template<typename TSpace, typename TEuclideanShape>
Point DGtal::GaussDigitizer< TSpace, TEuclideanShape >::myLowerPoint
protected

Digital lowest point.

Definition at line 256 of file GaussDigitizer.h.

template<typename TSpace, typename TEuclideanShape>
RegularPointEmbedder<Space> DGtal::GaussDigitizer< TSpace, TEuclideanShape >::myPointEmbedder
protected

The embedder.

Definition at line 253 of file GaussDigitizer.h.

template<typename TSpace, typename TEuclideanShape>
Point DGtal::GaussDigitizer< TSpace, TEuclideanShape >::myUpperPoint
protected

Digital uppest point.

Definition at line 259 of file GaussDigitizer.h.


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