DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::GaussDigitizer< TSpace, TEuclideanShape > Class Template Reference

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). More...

#include <DGtal/shapes/GaussDigitizer.h>

Inheritance 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 (ConstAlias< 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

CountedConstPtrOrConstPtr< EuclideanShapemyEShape
 The referenced shape or 0 if not initialized.
 
RegularPointEmbedder< SpacemyPointEmbedder
 The embedder.
 
Point myLowerPoint
 Digital lowest point.
 
Point myUpperPoint
 Digital uppest point.
 

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
dec/exampleHeatLaplace.cpp, geometry/curves/estimation/exampleCurvature.cpp, shapes/exampleEuclideanShapesDecorator.cpp, topology/frontierAndBoundary.cpp, topology/trackImplicitPolynomialSurfaceToOFF.cpp, and tutorial-examples/AreaSurfaceEstimation-final.cpp.

Definition at line 79 of file GaussDigitizer.h.

Member Typedef Documentation

◆ Domain

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

Definition at line 90 of file GaussDigitizer.h.

◆ EuclideanShape

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

Definition at line 89 of file GaussDigitizer.h.

◆ Integer

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

Definition at line 84 of file GaussDigitizer.h.

◆ Point

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

Definition at line 85 of file GaussDigitizer.h.

◆ PointEmbedder

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

Definition at line 91 of file GaussDigitizer.h.

◆ RealPoint

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

Definition at line 87 of file GaussDigitizer.h.

◆ RealVector

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

Definition at line 88 of file GaussDigitizer.h.

◆ Space

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

Definition at line 83 of file GaussDigitizer.h.

◆ Vector

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

Definition at line 86 of file GaussDigitizer.h.

Constructor & Destructor Documentation

◆ ~GaussDigitizer()

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

Destructor.

◆ GaussDigitizer()

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

Constructor. The object is not valid.

Member Function Documentation

◆ attach()

◆ BOOST_CONCEPT_ASSERT()

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

◆ ceil()

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 ).

◆ embed()

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< TSpace, TEuclideanShape >::orientation().

◆ floor()

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 ).

◆ getDomain()

◆ getLowerBound()

template<typename TSpace , typename TEuclideanShape >
const Point & DGtal::GaussDigitizer< TSpace, TEuclideanShape >::getLowerBound ( ) const

◆ getUpperBound()

template<typename TSpace , typename TEuclideanShape >
const Point & DGtal::GaussDigitizer< TSpace, TEuclideanShape >::getUpperBound ( ) const

◆ gridSteps()

template<typename TSpace , typename TEuclideanShape >
RealVector DGtal::GaussDigitizer< TSpace, TEuclideanShape >::gridSteps ( ) const
Returns
the grid steps in each direction.

◆ init() [1/2]

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.

◆ init() [2/2]

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
geometry/curves/estimation/exampleCurvature.cpp.

Referenced by estimatorOnShapeDigitization(), laplace_sphere(), main(), TEST_CASE(), testCombinatorialSurface(), testCompareEstimator(), testCurvature2d(), testDigitalSurfaceBoostGraphInterface(), testDigitization(), testEstimatorCache(), testGaussianCurvature3d(), testMeanCurvature3d(), testPrincipalCurvatures3d(), testRaySurface(), testTrueLocalEstimatorOnShapeDigitization(), and testUmbrellaComputer().

◆ isValid()

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.

◆ operator()()

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.

◆ operator=()

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'.

◆ orientation()

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 194 of file GaussDigitizer.h.

195 {
196 return myEShape->orientation(embed(p));
197 }
CountedConstPtrOrConstPtr< EuclideanShape > myEShape
The referenced shape or 0 if not initialized.
RealPoint embed(const Point &p) const

References DGtal::GaussDigitizer< TSpace, TEuclideanShape >::embed(), and DGtal::GaussDigitizer< TSpace, TEuclideanShape >::myEShape.

Referenced by TEST_CASE().

◆ pointEmbedder()

template<typename TSpace , typename TEuclideanShape >
const PointEmbedder & DGtal::GaussDigitizer< TSpace, TEuclideanShape >::pointEmbedder ( ) const
Returns
the associated point embedder.

Referenced by main().

◆ resolution()

template<typename TSpace , typename TEuclideanShape >
Vector DGtal::GaussDigitizer< TSpace, TEuclideanShape >::resolution ( ) const
Returns
the resolution in each direction.

◆ round()

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.

◆ selfDisplay()

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

◆ myEShape

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

The referenced shape or 0 if not initialized.

Definition at line 248 of file GaussDigitizer.h.

Referenced by DGtal::GaussDigitizer< TSpace, TEuclideanShape >::orientation().

◆ myLowerPoint

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

Digital lowest point.

Definition at line 254 of file GaussDigitizer.h.

◆ myPointEmbedder

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

The embedder.

Definition at line 251 of file GaussDigitizer.h.

◆ myUpperPoint

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

Digital uppest point.

Definition at line 257 of file GaussDigitizer.h.


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