DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::Shapes< TDomain > Class Template Reference

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

#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

Member Typedef Documentation

◆ ConstIterator

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

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

◆ Domain

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

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

◆ Integer

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

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

◆ Point

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

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

◆ Predicate

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

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

◆ RealPoint

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

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

◆ Space

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

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

◆ UnsignedInteger

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

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

◆ Vector

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

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

Constructor & Destructor Documentation

◆ ~Shapes()

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

Destructor.

◆ Shapes() [1/2]

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

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

◆ Shapes() [2/2]

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

◆ addNorm1Ball()

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.

Referenced by main(), main(), main(), testBreadthFirstPropagation(), testDepthFirstPropagation(), testDistancePropagation(), testSetTable(), testSimplePoints2D(), and testSurfelAdjacency().

◆ addNorm2Ball()

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.

Referenced by main(), main(), SCENARIO(), SCENARIO(), SCENARIO(), SCENARIO(), testBreadthFirstPropagation(), testDepthFirstPropagation(), testDigitalSetBoundary(), testDigitalSurface(), testDistancePropagation(), testFindABel(), and testKanungo2D().

◆ BOOST_CONCEPT_ASSERT()

template<typename TDomain >
DGtal::Shapes< TDomain >::BOOST_CONCEPT_ASSERT ( (concepts::CDomain< TDomain >) )
private

◆ digitalShaper()

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.

Referenced by getComplex(), main(), main(), and testDigitization().

◆ euclideanShaper()

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.

Referenced by alphaShape(), convexHull(), testDTFromSet(), testImplicitShape(), and testImplicitShape3D().

◆ isValid()

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.

◆ makeSetFromPointPredicate()

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.

Referenced by checkCut(), checkOutputConvexHullBorder(), main(), specificTestLatticePolytope2D(), and testLatticePolytope2D().

◆ operator=()

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.

◆ removeNorm1Ball()

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.

◆ removeNorm2Ball()

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.

Referenced by testDigitalSetBoundary(), and testDigitalSurface().

◆ selfDisplay()

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: