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::ImplicitNorm1Ball< TSpace > Class Template Reference

#include <ImplicitNorm1Ball.h>

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.

:
myCenter(aCenter),
myHalfWidth(aHalfWidth)
{};
template<typename T >
DGtal::ImplicitNorm1Ball< T >::~ImplicitNorm1Ball ( )
inline

Destructor.

Definition at line 46 of file ImplicitNorm1Ball.ih.

{
}
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::ImplicitNorm1Ball< TSpace >::myCenter, and DGtal::ImplicitNorm1Ball< TSpace >::myHalfWidth.

{
return (myCenter - RealPoint::diagonal(myHalfWidth));
}
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::ImplicitNorm1Ball< TSpace >::myCenter, and DGtal::ImplicitNorm1Ball< TSpace >::myHalfWidth.

{
return (myCenter + RealPoint::diagonal(myHalfWidth));
}
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()().

{
return this->operator()(aPoint) >0.0;
}
template<typename T >
bool DGtal::ImplicitNorm1Ball< 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 ImplicitNorm1Ball.ih.

{
return true;
}
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::ImplicitNorm1Ball< TSpace >::myCenter.

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

{
return (aPoint - myCenter ).norm(RealPoint::L_1);
}
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.

{
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::ImplicitNorm1Ball< 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 ImplicitNorm1Ball.ih.

{
out << "[ImplicitNorm1Ball] center="<<myCenter<<" radius="<<myHalfWidth;
}

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