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

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

Collaboration diagram for DGtal::CircleFrom2Points< TPoint >:
[legend]

Public Types

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

Public Member Functions

 CircleFrom2Points (const Point &aPole)
 
 CircleFrom2Points (const Point &aPole, const Point &aFirstPoint, const Point &aSecondPoint)
 
void init (const Point &aFirstPoint, const Point &aSecondPoint)
 
 CircleFrom2Points (const CircleFrom2Points &other)
 
CircleFrom2Pointsoperator= (const CircleFrom2Points &other)
 
 ~CircleFrom2Points ()
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 
Distance signedDistance (const Point &aP) const
 
void getParameters (double &cx, double &cy, double &r) const
 
const Pointpole () const
 
const Pointp () const
 
const Pointq () const
 
std::string className () const
 

Private Attributes

Point myPole
 
Point myP
 
Point myQ
 

Detailed Description

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

Aim: Represents a circle that passes through a given point and that is thus uniquely defined by two other points. It is able to return for any given point its signed distance to itself.

Template Parameters
TPointa type of points.
Examples:
geometry/tools/examplePreimage.cpp.

Definition at line 67 of file CircleFrom2Points.h.

Member Typedef Documentation

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

Definition at line 73 of file CircleFrom2Points.h.

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

Definition at line 74 of file CircleFrom2Points.h.

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

Definition at line 75 of file CircleFrom2Points.h.

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

Definition at line 76 of file CircleFrom2Points.h.

Constructor & Destructor Documentation

template<typename TPoint>
DGtal::CircleFrom2Points< TPoint >::CircleFrom2Points ( const Point aPole)

Constructor.

Parameters
aPolea point
template<typename TPoint>
DGtal::CircleFrom2Points< TPoint >::CircleFrom2Points ( const Point aPole,
const Point aFirstPoint,
const Point aSecondPoint 
)

Constructor with initialization.

Parameters
aPolea point
aFirstPointa point
aSecondPointa second point
template<typename TPoint>
DGtal::CircleFrom2Points< TPoint >::CircleFrom2Points ( const CircleFrom2Points< TPoint > &  other)

Copy constructor.

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

Destructor. Does nothing

Member Function Documentation

template<typename TPoint>
std::string DGtal::CircleFrom2Points< TPoint >::className ( ) const

Default drawing style object.

Returns
the dyn. alloc. default style for this object.
the style name used for drawing this object.
template<typename TPoint>
void DGtal::CircleFrom2Points< TPoint >::getParameters ( double &  cx,
double &  cy,
double &  r 
) const

Computes the parameters of the circle

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

Init.

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

Checks the validity/consistency of the object.

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

Assignment.

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

Definition at line 163 of file CircleFrom2Points.h.

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

164  {
165  return myP;
166  };
template<typename TPoint>
const Point& DGtal::CircleFrom2Points< TPoint >::pole ( ) const
inline
Returns
the first (and not mutable) point through which the circle passes.

Definition at line 155 of file CircleFrom2Points.h.

References DGtal::CircleFrom2Points< TPoint >::myPole.

156  {
157  return myPole;
158  };
template<typename TPoint>
const Point& DGtal::CircleFrom2Points< TPoint >::q ( ) const
inline
Returns
the third point through which the circle passes.

Definition at line 171 of file CircleFrom2Points.h.

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

172  {
173  return myQ;
174  };
template<typename TPoint>
void DGtal::CircleFrom2Points< 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::CircleFrom2Points< 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::CircleFrom2Points< TPoint >::myP
private

Second point through which the circle passes

Definition at line 200 of file CircleFrom2Points.h.

Referenced by DGtal::CircleFrom2Points< TPoint >::p().

template<typename TPoint>
Point DGtal::CircleFrom2Points< TPoint >::myPole
private

First (and not mutable) point through which the circle passes

Definition at line 196 of file CircleFrom2Points.h.

Referenced by DGtal::CircleFrom2Points< TPoint >::pole().

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

Third point through which the circle passes

Definition at line 204 of file CircleFrom2Points.h.

Referenced by DGtal::CircleFrom2Points< TPoint >::q().


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