DGtal  1.5.beta
DGtal::CircleFrom3Points< TPoint > Class Template Reference

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. More...

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

Inheritance 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

◆ Coordinate

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

Definition at line 74 of file CircleFrom3Points.h.

◆ Distance

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

Definition at line 75 of file CircleFrom3Points.h.

◆ Point

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

Definition at line 76 of file CircleFrom3Points.h.

◆ Vector

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

Definition at line 77 of file CircleFrom3Points.h.

Constructor & Destructor Documentation

◆ CircleFrom3Points() [1/3]

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

Default constructor.

◆ CircleFrom3Points() [2/3]

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

◆ CircleFrom3Points() [3/3]

template<typename TPoint >
DGtal::CircleFrom3Points< TPoint >::CircleFrom3Points ( const CircleFrom3Points< TPoint > &  other)

Copy constructor.

Parameters
otherthe object to clone.

◆ ~CircleFrom3Points()

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

Destructor. Does nothing

Member Function Documentation

◆ BOOST_STATIC_ASSERT()

template<typename TPoint >
DGtal::CircleFrom3Points< TPoint >::BOOST_STATIC_ASSERT ( (TPoint::dimension==2)  )
private

◆ className()

template<typename TPoint >
std::string DGtal::CircleFrom3Points< TPoint >::className ( ) const
Returns
the style name used for drawing this object.

◆ getCurvature()

template<typename TPoint >
double DGtal::CircleFrom3Points< TPoint >::getCurvature ( ) const
Returns
circle curvature

◆ getParameters()

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

◆ init()

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

◆ isValid()

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.

◆ operator=()

template<typename TPoint >
CircleFrom3Points& DGtal::CircleFrom3Points< TPoint >::operator= ( const CircleFrom3Points< TPoint > &  other)

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.

◆ p()

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  };

References DGtal::CircleFrom3Points< TPoint >::myP.

◆ q()

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  };

References DGtal::CircleFrom3Points< TPoint >::myQ.

◆ r()

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  };

References DGtal::CircleFrom3Points< TPoint >::myR.

◆ selfDisplay()

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.

◆ signedDistance()

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

◆ myP

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< TPoint >::p().

◆ myQ

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< TPoint >::q().

◆ myR

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< TPoint >::r().


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