DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes
DGtal::CircleFrom2Points< TPoint > Class Template Reference

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

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

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

◆ Coordinate

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

Definition at line 73 of file CircleFrom2Points.h.

◆ Distance

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

Definition at line 74 of file CircleFrom2Points.h.

◆ Point

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

Definition at line 75 of file CircleFrom2Points.h.

◆ Vector

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

Definition at line 76 of file CircleFrom2Points.h.

Constructor & Destructor Documentation

◆ CircleFrom2Points() [1/3]

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

Constructor.

Parameters
aPolea point

◆ CircleFrom2Points() [2/3]

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

◆ CircleFrom2Points() [3/3]

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

Copy constructor.

Parameters
otherthe object to clone.

◆ ~CircleFrom2Points()

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

Destructor. Does nothing

Member Function Documentation

◆ className()

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.

◆ getParameters()

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

◆ init()

template<typename TPoint >
void DGtal::CircleFrom2Points< TPoint >::init ( const Point aFirstPoint,
const Point aSecondPoint 
)

Init.

Parameters
aFirstPointa point
aSecondPointa second point

◆ isValid()

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.

◆ operator=()

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

Assignment.

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

◆ p()

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.

164 {
165 return myP;
166 };

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

◆ pole()

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.

156 {
157 return myPole;
158 };

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

◆ q()

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.

172 {
173 return myQ;
174 };

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

◆ selfDisplay()

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.

◆ signedDistance()

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

◆ myP

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().

◆ myPole

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().

◆ myQ

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: