DGtal  0.9.4beta
Public Types | Public Member Functions | Private Member Functions | Private Attributes
DGtal::CircleFrom3Points< TPoint > Class Template Reference

#include <DGtal/shapes/fromPoints/CircleFrom3Points.h>

Inheritance diagram for DGtal::CircleFrom3Points< TPoint >:
[legend]
Collaboration diagram for DGtal::CircleFrom3Points< TPoint >:
[legend]

Public Types

typedef TPoint::Coordinate Coordinate
 
typedef Coordinate Distance
 
typedef TPoint Point
 
typedef TPoint Vector
 

Public Member Functions

 CircleFrom3Points ()
 
 CircleFrom3Points (const Point &aFirstPoint, const Point &aSecondPoint, const Point &aThirdPoint)
 
void init (const Point &aFirstPoint, const Point &aSecondPoint, const Point &aThirdPoint)
 
 CircleFrom3Points (const CircleFrom3Points &other)
 
CircleFrom3Pointsoperator= (const CircleFrom3Points &other)
 
 ~CircleFrom3Points ()
 
Distance signedDistance (const Point &aP) const
 
bool isValid () const
 
void getParameters (double &cx, double &cy, double &rr) const
 
double getCurvature () const
 
const Pointp () const
 
const Pointq () const
 
const Pointr () const
 
void selfDisplay (std::ostream &out) const
 
std::string className () const
 

Private Member Functions

 BOOST_STATIC_ASSERT ((TPoint::dimension==2))
 

Private Attributes

Point myP
 
Point myQ
 
Point myR
 

Detailed Description

template<typename TPoint>
class DGtal::CircleFrom3Points< TPoint >

Aim: Represents a circle uniquely defined by three 2D points and that is able to return for any given 2D point its signed distance to itself.

Template Parameters
TPointa type of points.

Definition at line 66 of file CircleFrom3Points.h.

Member Typedef Documentation

template<typename TPoint>
typedef TPoint::Coordinate DGtal::CircleFrom3Points< TPoint >::Coordinate

Definition at line 74 of file CircleFrom3Points.h.

template<typename TPoint>
typedef Coordinate DGtal::CircleFrom3Points< TPoint >::Distance

Definition at line 75 of file CircleFrom3Points.h.

template<typename TPoint>
typedef TPoint DGtal::CircleFrom3Points< TPoint >::Point

Definition at line 76 of file CircleFrom3Points.h.

template<typename TPoint>
typedef TPoint DGtal::CircleFrom3Points< TPoint >::Vector

Definition at line 77 of file CircleFrom3Points.h.

Constructor & Destructor Documentation

template<typename TPoint>
DGtal::CircleFrom3Points< TPoint >::CircleFrom3Points ( )

Default constructor.

template<typename TPoint>
DGtal::CircleFrom3Points< TPoint >::CircleFrom3Points ( const Point aFirstPoint,
const Point aSecondPoint,
const Point aThirdPoint 
)

Constructor.

Parameters
aFirstPointa point
aSecondPointa second point
aThirdPointa third point
template<typename TPoint>
DGtal::CircleFrom3Points< TPoint >::CircleFrom3Points ( const CircleFrom3Points< TPoint > &  other)

Copy constructor.

Parameters
otherthe object to clone.
template<typename TPoint>
DGtal::CircleFrom3Points< TPoint >::~CircleFrom3Points ( )

Destructor. Does nothing

Member Function Documentation

template<typename TPoint>
DGtal::CircleFrom3Points< TPoint >::BOOST_STATIC_ASSERT ( (TPoint::dimension==2)  )
private
template<typename TPoint>
std::string DGtal::CircleFrom3Points< TPoint >::className ( ) const
Returns
the style name used for drawing this object.
template<typename TPoint>
double DGtal::CircleFrom3Points< TPoint >::getCurvature ( ) const
Returns
circle curvature
template<typename TPoint>
void DGtal::CircleFrom3Points< TPoint >::getParameters ( double &  cx,
double &  cy,
double &  rr 
) const

Computes the parameters of the circle

Parameters
cxreturned x-coordinate of the circle
cyreturned y-coordinate of the circle
rrreturned radius of the circle
template<typename TPoint>
void DGtal::CircleFrom3Points< TPoint >::init ( const Point aFirstPoint,
const Point aSecondPoint,
const Point aThirdPoint 
)

Init.

Parameters
aFirstPointa point
aSecondPointa second point
aThirdPointa third point
template<typename TPoint>
bool DGtal::CircleFrom3Points< TPoint >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename TPoint>
CircleFrom3Points& DGtal::CircleFrom3Points< TPoint >::operator= ( const CircleFrom3Points< TPoint > &  other)

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.
template<typename TPoint>
const Point& DGtal::CircleFrom3Points< TPoint >::p ( ) const
inline
Returns
the first point through which the circle passes.

Definition at line 157 of file CircleFrom3Points.h.

158  {
159  return myP;
160  };
template<typename TPoint>
const Point& DGtal::CircleFrom3Points< TPoint >::q ( ) const
inline
Returns
the second point through which the circle passes.

Definition at line 165 of file CircleFrom3Points.h.

166  {
167  return myQ;
168  };
template<typename TPoint>
const Point& DGtal::CircleFrom3Points< TPoint >::r ( ) const
inline
Returns
the third point through which the circle passes.

Definition at line 173 of file CircleFrom3Points.h.

174  {
175  return myR;
176  };
template<typename TPoint>
void DGtal::CircleFrom3Points< TPoint >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.
template<typename TPoint>
Distance DGtal::CircleFrom3Points< TPoint >::signedDistance ( const Point aP) const

Computes the signed distance of aP to the circle

Parameters
aPthe point to be tested.
Returns
the signed distance.

Field Documentation

template<typename TPoint>
Point DGtal::CircleFrom3Points< TPoint >::myP
private

First point through which the circle passes

Definition at line 201 of file CircleFrom3Points.h.

Referenced by DGtal::CircleFrom3Points< Point >::p().

template<typename TPoint>
Point DGtal::CircleFrom3Points< TPoint >::myQ
private

Second point through which the circle passes

Definition at line 205 of file CircleFrom3Points.h.

Referenced by DGtal::CircleFrom3Points< Point >::q().

template<typename TPoint>
Point DGtal::CircleFrom3Points< TPoint >::myR
private

Third point through which the circle passes

Definition at line 209 of file CircleFrom3Points.h.

Referenced by DGtal::CircleFrom3Points< Point >::r().


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