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

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

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

Public Types

typedef ImplicitNorm1Ball< TSpace > Self
 
typedef TSpace Space
 
typedef Space::RealPoint RealPoint
 
typedef double Value
 

Public Member Functions

 ImplicitNorm1Ball (const RealPoint &aCenter, const double &aHalfWidth)
 
 ~ImplicitNorm1Ball ()
 
double 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

 ImplicitNorm1Ball ()
 

Private Member Functions

ImplicitNorm1Balloperator= (const ImplicitNorm1Ball &other)
 

Private Attributes

RealPoint myCenter
 
double myHalfWidth
 

Detailed Description

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

Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create a ball for the L_1 norm in nD.

Description of template class 'ImplicitNorm1Ball'

Template Parameters
TSpacethe Digital space definition.

Definition at line 59 of file ImplicitNorm1Ball.h.

Member Typedef Documentation

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

Definition at line 65 of file ImplicitNorm1Ball.h.

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

Definition at line 63 of file ImplicitNorm1Ball.h.

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

Definition at line 64 of file ImplicitNorm1Ball.h.

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

Definition at line 66 of file ImplicitNorm1Ball.h.

Constructor & Destructor Documentation

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

Constructor. Contructs a ball with center aCenter and width aWidth.

Parameters
aCenterthe cube center.
aHalfWidththe cube half-width.

Definition at line 75 of file ImplicitNorm1Ball.h.

75  :
76  myCenter(aCenter),
77  myHalfWidth(aHalfWidth)
78  {};
RealPoint myCenter
Ball center.
double myHalfWidth
Ball HalfWidth.
template<typename TSpace >
DGtal::ImplicitNorm1Ball< TSpace >::~ImplicitNorm1Ball ( )

Destructor.

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

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

Member Function Documentation

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

Returns the lower bound of the Shape bounding box.

Returns
the lower bound point.

Definition at line 137 of file ImplicitNorm1Ball.h.

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

138  {
140  }
static Self diagonal(Component val=1)
RealPoint myCenter
Ball center.
double myHalfWidth
Ball HalfWidth.
template<typename TSpace >
RealPoint DGtal::ImplicitNorm1Ball< TSpace >::getUpperBound ( ) const
inline

Returns the upper bound of the Shape bounding box.

Returns
the upper bound point.

Definition at line 149 of file ImplicitNorm1Ball.h.

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

150  {
152  }
static Self diagonal(Component val=1)
RealPoint myCenter
Ball center.
double myHalfWidth
Ball HalfWidth.
template<typename TSpace >
bool DGtal::ImplicitNorm1Ball< TSpace >::isInside ( const RealPoint aPoint) const
inline

Return true if the given point belongs to the shape.

Parameters
aPointthe point to evalute the function at.
Returns
true if aPoint belongs to the shape.

Definition at line 111 of file ImplicitNorm1Ball.h.

References DGtal::ImplicitNorm1Ball< TSpace >::operator()().

112  {
113  return this->operator()(aPoint) >0.0;
114  }
double operator()(const RealPoint &aPoint) const
template<typename TSpace >
bool DGtal::ImplicitNorm1Ball< TSpace >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename TSpace >
double DGtal::ImplicitNorm1Ball< TSpace >::operator() ( const RealPoint aPoint) const
inline

Operator() of the implicit function. Given a point, it returns the function value at p. In Shapes, positive values are used to construct a set.

Parameters
aPointthe point to evalute the function at.
Returns
the distance of aPoint to the ball center.

Definition at line 99 of file ImplicitNorm1Ball.h.

References DGtal::PointVector< dim, TEuclideanRing, TContainer >::L_1, and DGtal::ImplicitNorm1Ball< TSpace >::myCenter.

Referenced by DGtal::ImplicitNorm1Ball< TSpace >::isInside().

100  {
101  return (aPoint - myCenter ).norm(RealPoint::L_1);
102  }
RealPoint myCenter
Ball center.
template<typename TSpace >
ImplicitNorm1Ball& DGtal::ImplicitNorm1Ball< TSpace >::operator= ( const ImplicitNorm1Ball< TSpace > &  other)
private

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.
template<typename TSpace >
Orientation DGtal::ImplicitNorm1Ball< TSpace >::orientation ( const RealPoint aPoint) const
inline

Definition at line 119 of file ImplicitNorm1Ball.h.

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

120  {
121  if (this->operator()(aPoint) > 0.0)
122  return INSIDE;
123  else
124  if (this->operator()(aPoint) < 0.0)
125  return OUTSIDE;
126  else
127  return ON;
128  }
template<typename TSpace >
void DGtal::ImplicitNorm1Ball< 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::ImplicitNorm1Ball< TSpace >::myCenter
private
template<typename TSpace >
double DGtal::ImplicitNorm1Ball< TSpace >::myHalfWidth
private

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