DGtal  0.9.3beta
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DGtal::ImplicitBall< TSpace > Class Template Reference

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

Collaboration diagram for DGtal::ImplicitBall< TSpace >:
[legend]

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
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Member Functions

 ImplicitBall ()
 

Private Member Functions

ImplicitBalloperator= (const ImplicitBall &other)
 

Private Attributes

RealPoint myCenter
 
double myRadius
 

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

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

Definition at line 71 of file ImplicitBall.h.

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

Definition at line 70 of file ImplicitBall.h.

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

Definition at line 68 of file ImplicitBall.h.

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

Definition at line 69 of file ImplicitBall.h.

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

Definition at line 72 of file ImplicitBall.h.

Constructor & Destructor Documentation

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  {};
RealPoint myCenter
Ball center.
Definition: ImplicitBall.h:148
double myRadius
Ball Radius.
Definition: ImplicitBall.h:151
template<typename TSpace>
DGtal::ImplicitBall< TSpace >::~ImplicitBall ( )

Destructor.

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

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

Member Function Documentation

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

Definition at line 114 of file ImplicitBall.h.

References DGtal::PointVector< dim, TEuclideanRing, TContainer >::diagonal(), DGtal::ImplicitBall< TSpace >::myCenter, and DGtal::ImplicitBall< TSpace >::myRadius.

115  {
117  }
RealPoint myCenter
Ball center.
Definition: ImplicitBall.h:148
static Self diagonal(Component val=1)
double myRadius
Ball Radius.
Definition: ImplicitBall.h:151
template<typename TSpace>
RealPoint DGtal::ImplicitBall< TSpace >::getUpperBound ( ) const
inline

Definition at line 120 of file ImplicitBall.h.

References DGtal::PointVector< dim, TEuclideanRing, TContainer >::diagonal(), DGtal::ImplicitBall< TSpace >::myCenter, and DGtal::ImplicitBall< TSpace >::myRadius.

121  {
123  }
RealPoint myCenter
Ball center.
Definition: ImplicitBall.h:148
static Self diagonal(Component val=1)
double myRadius
Ball Radius.
Definition: ImplicitBall.h:151
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.
template<typename TSpace>
Value DGtal::ImplicitBall< TSpace >::operator() ( const RealPoint aPoint) const
inline

Definition at line 96 of file ImplicitBall.h.

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

97  {
98  return myRadius - (aPoint - myCenter ).norm();
99  }
RealPoint myCenter
Ball center.
Definition: ImplicitBall.h:148
double myRadius
Ball Radius.
Definition: ImplicitBall.h:151
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.
template<typename TSpace>
Orientation DGtal::ImplicitBall< TSpace >::orientation ( const RealPoint aPoint) const
inline

Definition at line 102 of file ImplicitBall.h.

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

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  }
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

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

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