Public Member Functions | Private Member Functions | Private Attributes

DGtal::MeasureOfStraightLines Class Reference

#include <MeasureOfStraightLines.h>

Public Member Functions

 MeasureOfStraightLines ()
 ~MeasureOfStraightLines ()
void selfDisplay (std::ostream &out) const
bool isValid () const
double computeMeasure (const std::vector< double > &a, const std::vector< double > &b)
double computeCentroidA (const std::vector< double > &a, const std::vector< double > &b)
double computeCentroidB (const std::vector< double > &a, const std::vector< double > &b)
void setEpsilon (const double aValue)

Private Member Functions

 MeasureOfStraightLines (const MeasureOfStraightLines &other)
MeasureOfStraightLinesoperator= (const MeasureOfStraightLines &other)
double computeMeasureEdge (double a0, double b0, double a1, double b1)
double computeCentroidEdge_a (double a0, double b0, double a1, double b1)
double computeCentroidEdge_b (double a0, double b0, double a1, double b1)
double __computeCentroidTriApprox_b (double a0, double b0, double a1, double b1)
double __computeCentroidEdgeApprox_b (double a0, double b0, double a1, double b1)
double __computeCentroidSquare_b (double x1, double y1, double x2, double y2)
int sign (double a)

Private Attributes

double myEpsilon

Detailed Description

Description of class 'MeasureOfStraightLines'

Aim:

The aim of this class is to compute the measure in the Lebesgues sense of the set of straight lines associated to domains defined as polygons in the (a,b)-parameter space. This parameter space maps the line $ax-y+b=0$ to the point $(a,b)$.

   * @inproceedings{COEURJOLLY:2009:HAL-00432711:1,
   *   title = { {M}easure of {S}traight {L}ines and its {A}pplications in {D}igital {G}eometry},
   *   author = {{C}oeurjolly, {D}avid and {S}ivignon, {I}sabelle},
   *   booktitle = {13th {I}nternational {W}orkshop on {C}ombinatorial {I}mage {A}nalysis 13th {I}nternational {W}orkshop on {C}ombinatorial {I}mage {A}nalysis },
   *   publisher = {{R}esearch {P}ublishing {S}ervices },
   *   pages = {1-12 },
   *   address = {{C}ancun {M}exique },
   *   audience = {internationale },
   *   year = {2009},
   *   URL = {http://hal.archives-ouvertes.fr/hal-00432711/PDF/mesure.pdf},
   * }
   * 
See also:
testMeasure.cpp
Todo:
Create a vector<Point> interface

Constructor & Destructor Documentation

DGtal::MeasureOfStraightLines::MeasureOfStraightLines (  ) 

Constructor.

Default value

References myEpsilon.

DGtal::MeasureOfStraightLines::~MeasureOfStraightLines (  ) 

Destructor.

DGtal::MeasureOfStraightLines::MeasureOfStraightLines ( const MeasureOfStraightLines other  )  [private]

Copy constructor.

Parameters:
other the object to clone. Forbidden by default.

Member Function Documentation

double DGtal::MeasureOfStraightLines::__computeCentroidEdgeApprox_b ( double  a0,
double  b0,
double  a1,
double  b1 
) [private]

Approximate the centroid on 'b' on the trapezioid (a0,0)-(a0,b0)-(a1,b1)-(a1,0) (internal function)

double DGtal::MeasureOfStraightLines::__computeCentroidSquare_b ( double  x1,
double  y1,
double  x2,
double  y2 
) [private]

Compute the centroid on 'b' on the rectangular domain with vertices (x1,,y1) - (x2,y2) PRECONDITION: y1<y2

double DGtal::MeasureOfStraightLines::__computeCentroidTriApprox_b ( double  a0,
double  b0,
double  a1,
double  b1 
) [private]

Approximate the centroid on 'b' on the triangle (0,0)-(a0,b0)-(a1,b1) (internal function)

double DGtal::MeasureOfStraightLines::computeCentroidA ( const std::vector< double > &  a,
const std::vector< double > &  b 
)

Compute the abscissa of the centroid of the polygon {(a_i,b_i)} in the (a,b)-parameter space with respect to the measure of lines.

REQUIREMENTS:

  • The polygon is given counter-clockwise
  • a_i > 0
Parameters:
a the a-value of polygon vertices
b the b-value of polygon vertices
Returns:
the measure value (positive value)

Referenced by testUnitSquareCentroid().

double DGtal::MeasureOfStraightLines::computeCentroidB ( const std::vector< double > &  a,
const std::vector< double > &  b 
)

Compute the ordinate of the centroid of the polygon {(a_i,b_i)} in the (a,b)-parameter space with respect to the measure of lines. Note that there is a numerical approximation is performed.

REQUIREMENTS:

  • The polygon is given counter-clockwise
  • a_i > 0
Parameters:
a the a-value of polygon vertices
b the b-value of polygon vertices
Returns:
the measure value (positive value)

Referenced by testUnitSquareCentroid().

double DGtal::MeasureOfStraightLines::computeCentroidEdge_a ( double  a0,
double  b0,
double  a1,
double  b1 
) [private]

Compute the abscissa of the centroid associated to an edge (a0,b0)-(a1,b1) It returns the measure of the triangle defined by the origin and the edge.

Parameters:
a0 
b0 
a1 
b1 
Returns:
the measure
double DGtal::MeasureOfStraightLines::computeCentroidEdge_b ( double  a0,
double  b0,
double  a1,
double  b1 
) [private]

Compute the ordinate of the centroid associated to an edge (a0,b0)-(a1,b1) It returns the measure of the triangle defined by the origin and the edge.

Parameters:
a0 
b0 
a1 
b1 
Returns:
the measure
double DGtal::MeasureOfStraightLines::computeMeasure ( const std::vector< double > &  a,
const std::vector< double > &  b 
)

Compute the measure of the polygon {(a_i,b_i)} in the (a,b)-parameter space

REQUIREMENTS:

  • The polygon is given counter-clockwise
  • a_i > 0
Parameters:
a the a-value of polygon vertices
b the b-value of polygon vertices
Returns:
the measure value (positive value)

Referenced by testUnitSquare().

double DGtal::MeasureOfStraightLines::computeMeasureEdge ( double  a0,
double  b0,
double  a1,
double  b1 
) [private]

Compute the measure associated to an edge (a0,b0)-(a1,b1) It returns the measure of the triangle defined by the origin and the edge.

Parameters:
a0 
b0 
a1 
b1 
Returns:
the measure
bool DGtal::MeasureOfStraightLines::isValid (  )  const

Checks the validity/consistency of the object.

Returns:
'true' if the object is valid, 'false' otherwise.
MeasureOfStraightLines& DGtal::MeasureOfStraightLines::operator= ( const MeasureOfStraightLines other  )  [private]

Assignment.

Parameters:
other the object to copy.
Returns:
a reference on 'this'. Forbidden by default.
void DGtal::MeasureOfStraightLines::selfDisplay ( std::ostream &  out  )  const

Writes/Displays the object on an output stream.

Parameters:
out the output stream where the object is written.
void DGtal::MeasureOfStraightLines::setEpsilon ( const double  aValue  ) 

Set the internal Epsilon threshold for the numerical approximation.

Parameters:
aValue the new epsilon value
int DGtal::MeasureOfStraightLines::sign ( double  a  )  [private]
Returns:
the sign of a number (1 or -1)

Field Documentation

Referenced by MeasureOfStraightLines().


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