DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::ImplicitBall< TSpace > Class Template Reference

Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create a ball in nD.. More...

#include <DGtal/shapes/implicit/ImplicitBall.h>

Public Types

typedef ImplicitBall< TSpace > Self
 
typedef TSpace Space
 
typedef Space::RealPoint RealPoint
 
typedef Space::Integer Integer
 
typedef double Value
 

Public Member Functions

 ImplicitBall (const RealPoint &aCenter, const double &aRadius)
 
 ~ImplicitBall ()
 
Value operator() (const RealPoint &aPoint) const
 
Orientation orientation (const RealPoint &aPoint) const
 
RealPoint getLowerBound () const
 
RealPoint getUpperBound () const
 
RealPoint center () const
 
void moveTo (const RealPoint &newCenter)
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Member Functions

 ImplicitBall ()
 

Private Member Functions

ImplicitBalloperator= (const ImplicitBall &other)
 

Private Attributes

RealPoint myCenter
 Ball center.
 
double myRadius
 Ball Radius.
 

Detailed Description

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

Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create a ball in nD..

Description of template class 'ImplicitBall'

Model of CImplicitFunction

Template Parameters
TSpacethe Digital space definition.
Examples
shapes/exampleEuclideanShapesDecorator.cpp, topology/frontierAndBoundary.cpp, and tutorial-examples/volDTGranulo.cpp.

Definition at line 64 of file ImplicitBall.h.

Member Typedef Documentation

◆ Integer

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

Definition at line 71 of file ImplicitBall.h.

◆ RealPoint

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

Definition at line 70 of file ImplicitBall.h.

◆ Self

template<typename TSpace >
typedef ImplicitBall<TSpace> DGtal::ImplicitBall< TSpace >::Self

Definition at line 68 of file ImplicitBall.h.

◆ Space

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

Definition at line 69 of file ImplicitBall.h.

◆ Value

template<typename TSpace >
typedef double DGtal::ImplicitBall< TSpace >::Value

Definition at line 72 of file ImplicitBall.h.

Constructor & Destructor Documentation

◆ ImplicitBall() [1/2]

template<typename TSpace >
DGtal::ImplicitBall< TSpace >::ImplicitBall ( const RealPoint & aCenter,
const double & aRadius )
inline

Constructor. Contructs a ball with center aCenter and radius aRadius.

Parameters
aCenterthe ball center.
aRadiusthe ball radius.

Definition at line 81 of file ImplicitBall.h.

81 : myCenter(aCenter),
82 myRadius(aRadius)
83 {};
double myRadius
Ball Radius.
RealPoint myCenter
Ball center.

◆ ~ImplicitBall()

template<typename TSpace >
DGtal::ImplicitBall< TSpace >::~ImplicitBall ( )

Destructor.

◆ ImplicitBall() [2/2]

template<typename TSpace >
DGtal::ImplicitBall< TSpace >::ImplicitBall ( )
protected

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

Member Function Documentation

◆ center()

template<typename TSpace >
RealPoint DGtal::ImplicitBall< TSpace >::center ( ) const
inline
Returns
the center of the star-shaped object.

Definition at line 128 of file ImplicitBall.h.

129 {
130 return myCenter;
131 }

References DGtal::ImplicitBall< TSpace >::myCenter.

◆ getLowerBound()

template<typename TSpace >
RealPoint DGtal::ImplicitBall< TSpace >::getLowerBound ( ) const
inline

◆ getUpperBound()

template<typename TSpace >
RealPoint DGtal::ImplicitBall< TSpace >::getUpperBound ( ) const
inline

◆ isValid()

template<typename TSpace >
bool DGtal::ImplicitBall< TSpace >::isValid ( ) const

Checks the validity/consistency of the object.

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

◆ moveTo()

template<typename TSpace >
void DGtal::ImplicitBall< TSpace >::moveTo ( const RealPoint & newCenter)
inline

Modify the shape center

Parameters
newCenterthe new center position

Definition at line 138 of file ImplicitBall.h.

139 {
140 myCenter = newCenter;
141 }

References DGtal::ImplicitBall< TSpace >::myCenter.

◆ operator()()

template<typename TSpace >
Value DGtal::ImplicitBall< TSpace >::operator() ( const RealPoint & aPoint) const
inline

Definition at line 96 of file ImplicitBall.h.

97 {
98 return myRadius - (aPoint - myCenter ).norm();
99 }
const Point aPoint(3, 4)

References aPoint(), DGtal::ImplicitBall< TSpace >::myCenter, and DGtal::ImplicitBall< TSpace >::myRadius.

◆ operator=()

template<typename TSpace >
ImplicitBall & DGtal::ImplicitBall< TSpace >::operator= ( const ImplicitBall< TSpace > & other)
private

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.

◆ orientation()

template<typename TSpace >
Orientation DGtal::ImplicitBall< TSpace >::orientation ( const RealPoint & aPoint) const
inline

Definition at line 102 of file ImplicitBall.h.

103 {
104 if (this->operator()(aPoint) > 0.0)
105 return INSIDE;
106 else
107 if (this->operator()(aPoint) < 0.0)
108 return OUTSIDE;
109 else
110 return ON;
111 }
@ INSIDE
Definition Common.h:141
@ OUTSIDE
Definition Common.h:141
@ ON
Definition Common.h:141

References DGtal::INSIDE, DGtal::ON, and DGtal::OUTSIDE.

◆ selfDisplay()

template<typename TSpace >
void DGtal::ImplicitBall< TSpace >::selfDisplay ( std::ostream & out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

Field Documentation

◆ myCenter

◆ myRadius

template<typename TSpace >
double DGtal::ImplicitBall< TSpace >::myRadius
private

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