DGtal  0.9.4beta
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions
DGtal::Shapes< TDomain > Class Template Reference

#include <DGtal/shapes/Shapes.h>

Public Types

typedef TDomain Domain
 
typedef Domain::Space Space
 
typedef Domain::Space::RealPoint RealPoint
 
typedef Domain::Point Point
 
typedef Domain::Vector Vector
 
typedef Domain::Predicate Predicate
 
typedef Domain::ConstIterator ConstIterator
 
typedef Space::Integer Integer
 
typedef Space::UnsignedInteger UnsignedInteger
 

Public Member Functions

 ~Shapes ()
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Static Public Member Functions

template<typename TDigitalSet , typename TShapeFunctor >
static void digitalShaper (TDigitalSet &aSet, const TShapeFunctor &aFunctor)
 
template<typename TDigitalSet , typename TShapeFunctor >
static void euclideanShaper (TDigitalSet &aSet, const TShapeFunctor &aFunctor, const double h=1.0)
 
template<typename DigitalSet , typename PointPredicate >
static void makeSetFromPointPredicate (DigitalSet &aSet, const PointPredicate &aPP)
 
template<typename TDigitalSet >
static void addNorm1Ball (TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
 
template<typename TDigitalSet >
static void addNorm2Ball (TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
 
template<typename TDigitalSet >
static void removeNorm1Ball (TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
 
template<typename TDigitalSet >
static void removeNorm2Ball (TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
 

Protected Member Functions

 Shapes ()
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CDomain< TDomain >))
 
 Shapes (const Shapes &other)
 
Shapesoperator= (const Shapes &other)
 

Detailed Description

template<typename TDomain>
class DGtal::Shapes< TDomain >

Aim: A utility class for constructing different shapes (balls, diamonds, and others).

Description of template class 'Shapes'

Template Parameters
TDomainthe type of the domain in which shapes are created.
Examples:
geometry/tools/exampleAlphaShape.cpp, geometry/tools/exampleConvexHull2D.cpp, graph/graphTraversal.cpp, io/boards/dgtalBoard2D-2-sets.cpp, io/boards/dgtalBoard2D-4-colormaps.cpp, io/boards/dgtalBoard3D-6-clipping.cpp, io/boards/dgtalBoard3DTo2D-2-sets.cpp, io/boards/dgtalBoard3DTo2D-2bis-sets.cpp, io/boards/dgtalBoard3DTo2D-3-objects.cpp, io/boards/dgtalBoard3DTo2D-6.cpp, io/viewers/viewer3D-2-sets.cpp, io/viewers/viewer3D-3-objects.cpp, io/viewers/viewer3D-6-clipping.cpp, shapes/exampleEuclideanShapesDecorator.cpp, and topology/digitalSetToCubicalComplexes2D.cpp.

Definition at line 71 of file DGtal/shapes/Shapes.h.

Member Typedef Documentation

template<typename TDomain >
typedef Domain::ConstIterator DGtal::Shapes< TDomain >::ConstIterator

Definition at line 84 of file DGtal/shapes/Shapes.h.

template<typename TDomain >
typedef TDomain DGtal::Shapes< TDomain >::Domain

Definition at line 78 of file DGtal/shapes/Shapes.h.

template<typename TDomain >
typedef Space::Integer DGtal::Shapes< TDomain >::Integer

Definition at line 86 of file DGtal/shapes/Shapes.h.

template<typename TDomain >
typedef Domain::Point DGtal::Shapes< TDomain >::Point

Definition at line 81 of file DGtal/shapes/Shapes.h.

template<typename TDomain >
typedef Domain::Predicate DGtal::Shapes< TDomain >::Predicate

Definition at line 83 of file DGtal/shapes/Shapes.h.

template<typename TDomain >
typedef Domain::Space::RealPoint DGtal::Shapes< TDomain >::RealPoint

Definition at line 80 of file DGtal/shapes/Shapes.h.

template<typename TDomain >
typedef Domain::Space DGtal::Shapes< TDomain >::Space

Definition at line 79 of file DGtal/shapes/Shapes.h.

template<typename TDomain >
typedef Space::UnsignedInteger DGtal::Shapes< TDomain >::UnsignedInteger

Definition at line 87 of file DGtal/shapes/Shapes.h.

template<typename TDomain >
typedef Domain::Vector DGtal::Shapes< TDomain >::Vector

Definition at line 82 of file DGtal/shapes/Shapes.h.

Constructor & Destructor Documentation

template<typename TDomain >
DGtal::Shapes< TDomain >::~Shapes ( )

Destructor.

template<typename TDomain >
DGtal::Shapes< TDomain >::Shapes ( )
protected

Constructor. Forbidden by default (protected to avoid g++ warnings).

template<typename TDomain >
DGtal::Shapes< TDomain >::Shapes ( const Shapes< TDomain > &  other)
private

Copy constructor.

Parameters
otherthe object to clone. Forbidden by default.

Member Function Documentation

template<typename TDomain >
template<typename TDigitalSet >
static void DGtal::Shapes< TDomain >::addNorm1Ball ( TDigitalSet &  aSet,
const Point aCenter,
UnsignedInteger  aRadius 
)
static

Adds the discrete ball (norm-1) of center [aCenter] and radius [aRadius] to the (perhaps non empty) set [aSet].

Warning
deprecated Use implicitShaper instead.
Template Parameters
TDigitalSetthe type chosen for the digital set.
Parameters
aSetthe set (modified) which will contain the discrete ball.
aCenterthe center of the ball.
aRadiusthe radius of the ball.
template<typename TDomain >
template<typename TDigitalSet >
static void DGtal::Shapes< TDomain >::addNorm2Ball ( TDigitalSet &  aSet,
const Point aCenter,
UnsignedInteger  aRadius 
)
static

Adds the discrete ball (norm-2) of center [aCenter] and radius [aRadius] to the (perhaps non empty) set [aSet].

Warning
deprecated Use implicitShaper instead.
Template Parameters
TDigitalSetthe type chosen for the digital set.
Parameters
aSetthe set (modified) which will contain the discrete ball.
aCenterthe center of the ball.
aRadiusthe radius of the ball.
template<typename TDomain >
DGtal::Shapes< TDomain >::BOOST_CONCEPT_ASSERT ( (concepts::CDomain< TDomain >)  )
private
template<typename TDomain >
template<typename TDigitalSet , typename TShapeFunctor >
static void DGtal::Shapes< TDomain >::digitalShaper ( TDigitalSet &  aSet,
const TShapeFunctor &  aFunctor 
)
static

Adds to the (perhaps non empty) set [aSet] an shape defined by an instance of ShapeFunctor. Add Points where orientation is inside. The shape functor must be a model of CDigitalOrientedShape and CDigitalBoundedShape.

Parameters
aSetthe set (modified) which will contain the shape.
aFunctora functor defining the shape.
Template Parameters
TDigitalSeta model of CDigitalSet.
TShapeFunctora model of CDigitalBoundedShape and CDigitalOrientedShape.
template<typename TDomain >
template<typename TDigitalSet , typename TShapeFunctor >
static void DGtal::Shapes< TDomain >::euclideanShaper ( TDigitalSet &  aSet,
const TShapeFunctor &  aFunctor,
const double  h = 1.0 
)
static

Adds to the (perhaps non empty) set [aSet] an shape defined by an instance of ShapeFunctor. Add Points where orientation is inside. The shape functor must be a model of CEuclideanOrientedShape and CEuclideanBoundedShape. The underlying digitization process is a Gauss Digitizer with grid step h.

Parameters
aSetthe set (modified) which will contain the shape.
aFunctora functor defining the shape.
hgrid step for the Gauss digitization.
Template Parameters
TDigitalSeta model of CDigitalSet.
TShapeFunctora model of CEuclideanBoundedShape and CEuclideanOrientedShape.
template<typename TDomain >
bool DGtal::Shapes< TDomain >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename TDomain >
template<typename DigitalSet , typename PointPredicate >
static void DGtal::Shapes< TDomain >::makeSetFromPointPredicate ( DigitalSet &  aSet,
const PointPredicate &  aPP 
)
static

Add to the set aSet the points of the domain that satisfies the predicate aPP.

Parameters
aSet(modified) the digital set that will contain the points.
aPPa predicate on point.
Template Parameters
DigitalSeta model of CDigitalSet such that DigitalSet::Domain is Domain.
PointPredicatea model of concepts::CPointPredicate such that PointPredicate::Point is Point.
Examples:
arithmetic/lower-integer-convex-hull.cpp.
template<typename TDomain >
Shapes& DGtal::Shapes< TDomain >::operator= ( const Shapes< TDomain > &  other)
private

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.
template<typename TDomain >
template<typename TDigitalSet >
static void DGtal::Shapes< TDomain >::removeNorm1Ball ( TDigitalSet &  aSet,
const Point aCenter,
UnsignedInteger  aRadius 
)
static

Removes the discrete ball (norm-1) of center [aCenter] and radius [aRadius] to the (perhaps non empty) set [aSet].

Template Parameters
TDigitalSetthe type chosen for the digital set.
Parameters
aSetthe set (modified) which will contain the discrete ball.
aCenterthe center of the ball.
aRadiusthe radius of the ball.
template<typename TDomain >
template<typename TDigitalSet >
static void DGtal::Shapes< TDomain >::removeNorm2Ball ( TDigitalSet &  aSet,
const Point aCenter,
UnsignedInteger  aRadius 
)
static

Removes the discrete ball (norm-2) of center [aCenter] and radius [aRadius] to the (perhaps non empty) set [aSet].

Template Parameters
TDigitalSetthe type chosen for the digital set.
Parameters
aSetthe set (modified) which will contain the discrete ball.
aCenterthe center of the ball.
aRadiusthe radius of the ball.
template<typename TDomain >
void DGtal::Shapes< TDomain >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

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