DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Private Attributes
DGtal::CircleFrom2Points< TPoint > Class Template Reference

#include <CircleFrom2Points.h>

Collaboration diagram for DGtal::CircleFrom2Points< TPoint >:
Collaboration graph
[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.

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)
inline

Constructor.

Parameters:
aPolea point

Definition at line 49 of file CircleFrom2Points.ih.

: myPole(aPole)
{
}
template<typename TPoint >
DGtal::CircleFrom2Points< TPoint >::CircleFrom2Points ( const Point aPole,
const Point aFirstPoint,
const Point aSecondPoint 
)
inline

Constructor with initialization.

Parameters:
aPolea point
aFirstPointa point
aSecondPointa second point

Definition at line 67 of file CircleFrom2Points.ih.

:
myPole(aPole),
myP(aFirstPoint),
myQ(aSecondPoint)
{
}
template<typename TPoint >
DGtal::CircleFrom2Points< TPoint >::CircleFrom2Points ( const CircleFrom2Points< TPoint > &  other)
inline

Copy constructor.

Parameters:
otherthe object to clone.

Definition at line 80 of file CircleFrom2Points.ih.

:
myPole(other.myPole),
myP(other.myP),
myQ(other.myQ)
{
}
template<typename TPoint >
DGtal::CircleFrom2Points< TPoint >::~CircleFrom2Points ( )
inline

Destructor. Does nothing

Definition at line 43 of file CircleFrom2Points.ih.

{
}

Member Function Documentation

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

Default drawing style object.

Returns:
the dyn. alloc. default style for this object.
the style name used for drawing this object.

Definition at line 127 of file CircleFrom2Points.ih.

{
return "CircleFrom2Points";
}
template<typename TPoint >
void DGtal::CircleFrom2Points< TPoint >::getParameters ( double &  cx,
double &  cy,
double &  r 
) const
inline

Computes the parameters of the circle

Parameters:
cxreturned x-coordinate of the circle
cyreturned y-coordinate of the circle
rreturned radius of the circle

Definition at line 115 of file CircleFrom2Points.ih.

References DGtal::CircleFrom3Points< TPoint >::getParameters().

{
CircleFrom3Points<Point> c(myPole,myP,myQ);
c.getParameters(cx,cy,r);
}
template<typename TPoint >
void DGtal::CircleFrom2Points< TPoint >::init ( const Point aFirstPoint,
const Point aSecondPoint 
)
inline

Init.

Parameters:
aFirstPointa point
aSecondPointa second point

Definition at line 56 of file CircleFrom2Points.ih.

{
myP = aFirstPoint;
myQ = aSecondPoint;
}
template<typename TPoint >
bool DGtal::CircleFrom2Points< TPoint >::isValid ( ) const
inline

Checks the validity/consistency of the object.

Returns:
'true' if the object is valid, 'false' otherwise.

Definition at line 144 of file CircleFrom2Points.ih.

{
return true;
}
template<typename TPoint >
DGtal::CircleFrom2Points< TPoint > & DGtal::CircleFrom2Points< TPoint >::operator= ( const CircleFrom2Points< TPoint > &  other)
inline

Assignment.

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

Definition at line 92 of file CircleFrom2Points.ih.

References DGtal::CircleFrom2Points< TPoint >::myP, DGtal::CircleFrom2Points< TPoint >::myPole, and DGtal::CircleFrom2Points< TPoint >::myQ.

{
myP = other.myP;
myQ = other.myQ;
myPole = other.myPole;
return *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.

Referenced by DGtal::Display2DFactory::draw().

{
return myP;
};
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.

Referenced by DGtal::Display2DFactory::draw().

{
return myPole;
};
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.

Referenced by DGtal::Display2DFactory::draw().

{
return myQ;
};
template<typename TPoint >
void DGtal::CircleFrom2Points< TPoint >::selfDisplay ( std::ostream &  out) const
inline

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.

Definition at line 135 of file CircleFrom2Points.ih.

{
out << "[CircleFrom2Points] passing through:\n";
out << "pole " << myPole << " and " << myP << myQ;
}
template<typename TPoint >
DGtal::CircleFrom2Points< TPoint >::Distance DGtal::CircleFrom2Points< TPoint >::signedDistance ( const Point aP) const
inline

Computes the signed distance of to the circle

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

Definition at line 106 of file CircleFrom2Points.ih.

References DGtal::CircleFrom3Points< TPoint >::signedDistance().

{
CircleFrom3Points<Point> c(myPole,myP,myQ);
return c.signedDistance(aP);
}

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 >::operator=(), and 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 >::operator=(), and 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 >::operator=(), and DGtal::CircleFrom2Points< TPoint >::q().


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