DGtal  1.5.beta
DGtal::ImplicitNorm1Ball< TSpace > Class Template Reference

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

#include <DGtal/shapes/implicit/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
 
RealPoint center () const
 
void moveTo (const RealPoint &newCenter)
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Member Functions

 ImplicitNorm1Ball ()
 

Private Member Functions

ImplicitNorm1Balloperator= (const ImplicitNorm1Ball &other)
 

Private Attributes

RealPoint myCenter
 Ball center. More...
 
double myHalfWidth
 Ball HalfWidth. More...
 

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

◆ RealPoint

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

Definition at line 65 of file ImplicitNorm1Ball.h.

◆ Self

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

Definition at line 63 of file ImplicitNorm1Ball.h.

◆ Space

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

Definition at line 64 of file ImplicitNorm1Ball.h.

◆ Value

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

Definition at line 66 of file ImplicitNorm1Ball.h.

Constructor & Destructor Documentation

◆ ImplicitNorm1Ball() [1/2]

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.

◆ ~ImplicitNorm1Ball()

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

Destructor.

◆ ImplicitNorm1Ball() [2/2]

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

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

Member Function Documentation

◆ center()

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

Definition at line 157 of file ImplicitNorm1Ball.h.

158  {
159  return myCenter;
160  }

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

◆ getLowerBound()

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.

138  {
140  }
static Self diagonal(Component val=1)

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

◆ getUpperBound()

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.

150  {
152  }

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

◆ isInside()

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.

112  {
113  return this->operator()(aPoint) >0.0;
114  }
double operator()(const RealPoint &aPoint) const
const Point aPoint(3, 4)

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

◆ isValid()

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.

◆ moveTo()

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

Modify the shape center

Parameters
newCenterthe new center position

Definition at line 167 of file ImplicitNorm1Ball.h.

168  {
169  myCenter = newCenter;
170  }

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

◆ operator()()

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.

100  {
101  return (aPoint - myCenter ).norm(RealPoint::L_1);
102  }

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

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

◆ operator=()

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.

◆ orientation()

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

Definition at line 119 of file ImplicitNorm1Ball.h.

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

◆ myCenter

◆ myHalfWidth

template<typename TSpace >
double DGtal::ImplicitNorm1Ball< TSpace >::myHalfWidth
private

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