DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DGtal::ImplicitBall< TSpace > Class Template Reference

#include <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
bool isInside (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:
topology/frontierAndBoundary.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.

: myCenter(aCenter),
myRadius(aRadius)
{};
template<typename T >
DGtal::ImplicitBall< T >::~ImplicitBall ( )
inline

Destructor.

Definition at line 46 of file ImplicitBall.ih.

{
}
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 120 of file ImplicitBall.h.

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

{
return (myCenter - RealPoint::diagonal(myRadius));
}
template<typename TSpace>
RealPoint DGtal::ImplicitBall< TSpace >::getUpperBound ( ) const
inline

Definition at line 126 of file ImplicitBall.h.

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

{
return (myCenter + RealPoint::diagonal(myRadius));
}
template<typename TSpace>
bool DGtal::ImplicitBall< TSpace >::isInside ( const RealPoint aPoint) const
inline

Definition at line 102 of file ImplicitBall.h.

{
return (this->operator()(aPoint) > 0.0);
}
template<typename T >
bool DGtal::ImplicitBall< T >::isValid ( ) const
inline

Checks the validity/consistency of the object.

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

Definition at line 72 of file ImplicitBall.ih.

{
return true;
}
template<typename TSpace>
Value DGtal::ImplicitBall< TSpace >::operator() ( const RealPoint aPoint) const
inline
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 108 of file ImplicitBall.h.

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

{
if (this->operator()(aPoint) > 0.0)
return INSIDE;
else
if (this->operator()(aPoint) < 0.0)
return OUTSIDE;
else
return ON;
}
template<typename T >
void DGtal::ImplicitBall< T >::selfDisplay ( std::ostream &  out) const
inline

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.

Definition at line 60 of file ImplicitBall.ih.

{
out << "[ImplicitBall] center="<<myCenter<<" radius="<<myRadius;
}

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 files: