Class to generate a Delaunay triangulation of a 2D set of points.
Algorithm based on Triangle, a two-dimensional quality mesh generator and Delaunay triangulator from Jonathan Richard Shewchuk.
See [http://www.cs.cmu.edu/~quake/triangle.html]
Definition at line 71 of file Delaunay2D.h.
Classes | |
struct | Triangle |
Public Types | |
typedef std::vector< Triangle > | Triangles |
Public Member Functions | |
Delaunay2D (int n, const double *x, const double *y, const double *z, double xmin=0, double xmax=0, double ymin=0, double ymax=0) | |
class constructor from array of data points | |
Triangles::const_iterator | begin () const |
Triangles::const_iterator | end () const |
void | FindAllTriangles () |
Find all triangles. | |
double | Interpolate (double x, double y) |
Return the Interpolated z value corresponding to the (x,y) point. | |
Int_t | NumberOfTriangles () const |
return the number of triangles | |
void | SetInputPoints (int n, const double *x, const double *y, const double *z, double xmin=0, double xmax=0, double ymin=0, double ymax=0) |
set the input points for building the graph | |
void | SetZOuterValue (double z=0.) |
set z value to be returned for points outside the region | |
double | XMax () const |
double | XMin () const |
double | YMax () const |
double | YMin () const |
double | ZOuterValue () const |
return the user defined Z-outer value | |
Protected Member Functions | |
unsigned int | Cell (UInt_t x, UInt_t y) const |
grid cells with containing triangles | |
int | CellX (double x) const |
int | CellY (double y) const |
Protected Attributes | |
std::set< UInt_t > | fCells [(fNCells+1) *(fNCells+1)] |
inverse denominator to calculate X cell = fNCells / (fYNmax - fYNmin) | |
Bool_t | fInit |
Height for points lying outside the convex hull. | |
Int_t | fNdt |
Int_t | fNpoints |
Number of Delaunay triangles found. | |
double | fOffsetX |
Maximum value of fYN. | |
double | fOffsetY |
Normalization offset X. | |
double | fScaleFactorX |
Normalization offset Y. | |
double | fScaleFactorY |
Normalization factor X. | |
Triangles | fTriangles |
True if FindAllTriangels() has been performed. | |
const double * | fX |
Number of data points. | |
double | fXCellStep |
number of cells to divide the normalized space | |
std::vector< double > | fXN |
Triangles of Triangulation. | |
double | fXNmax |
Minimum value of fXN. | |
double | fXNmin |
Pointer to Z array. | |
const double * | fY |
Pointer to X array (managed externally) | |
double | fYCellStep |
inverse denominator to calculate X cell = fNCells / (fXNmax - fXNmin) | |
std::vector< double > | fYN |
normalized X | |
double | fYNmax |
Minimum value of fYN. | |
double | fYNmin |
Maximum value of fXN. | |
const double * | fZ |
Pointer to Y array. | |
double | fZout |
Normalization factor Y. | |
Static Protected Attributes | |
static const int | fNCells = 25 |
normalized Y | |
Private Member Functions | |
Delaunay2D (const Delaunay2D &) | |
void | DoFindTriangles () |
internal function to find the triangle use Triangle or CGAL if flag is set | |
double | DoInterpolateNormalized (double x, double y) |
internal method to compute the interpolation | |
void | DoNormalizePoints () |
internal function to normalize the points | |
double | Linear_transform (double x, double offset, double factor) |
Delaunay2D & | operator= (const Delaunay2D &) |
#include <Math/Delaunay2D.h>
typedef std::vector<Triangle> ROOT::Math::Delaunay2D::Triangles |
Definition at line 85 of file Delaunay2D.h.
ROOT::Math::Delaunay2D::Delaunay2D | ( | int | n, |
const double * | x, | ||
const double * | y, | ||
const double * | z, | ||
double | xmin = 0 , |
||
double | xmax = 0 , |
||
double | ymin = 0 , |
||
double | ymax = 0 |
||
) |
class constructor from array of data points
Definition at line 34 of file Delaunay2D.cxx.
|
private |
|
inline |
Definition at line 116 of file Delaunay2D.h.
grid cells with containing triangles
Definition at line 274 of file Delaunay2D.h.
Definition at line 278 of file Delaunay2D.h.
Definition at line 282 of file Delaunay2D.h.
|
private |
internal function to find the triangle use Triangle or CGAL if flag is set
Triangle implementation for finding all the triangles.
Definition at line 256 of file Delaunay2D.cxx.
internal method to compute the interpolation
Triangle implementation for interpolation Finds the Delaunay triangle that the point (xi,yi) sits in (if any) and calculate a z-value for it by linearly interpolating the z-values that make up that triangle.
Definition at line 379 of file Delaunay2D.cxx.
|
private |
internal function to normalize the points
Triangle implementation for normalizing the points.
Definition at line 244 of file Delaunay2D.cxx.
|
inline |
Definition at line 117 of file Delaunay2D.h.
void ROOT::Math::Delaunay2D::FindAllTriangles | ( | ) |
Find all triangles.
Definition at line 128 of file Delaunay2D.cxx.
Return the Interpolated z value corresponding to the (x,y) point.
Definition at line 104 of file Delaunay2D.cxx.
|
inlineprivate |
Definition at line 125 of file Delaunay2D.h.
|
inline |
return the number of triangles
Definition at line 102 of file Delaunay2D.h.
|
private |
void ROOT::Math::Delaunay2D::SetInputPoints | ( | int | n, |
const double * | x, | ||
const double * | y, | ||
const double * | z, | ||
double | xmin = 0 , |
||
double | xmax = 0 , |
||
double | ymin = 0 , |
||
double | ymax = 0 |
||
) |
set the input points for building the graph
set the input points
Definition at line 59 of file Delaunay2D.cxx.
set z value to be returned for points outside the region
Definition at line 110 of file Delaunay2D.h.
|
inline |
Definition at line 105 of file Delaunay2D.h.
|
inline |
Definition at line 104 of file Delaunay2D.h.
|
inline |
Definition at line 107 of file Delaunay2D.h.
|
inline |
Definition at line 106 of file Delaunay2D.h.
|
inline |
return the user defined Z-outer value
Definition at line 113 of file Delaunay2D.h.
inverse denominator to calculate X cell = fNCells / (fYNmax - fYNmin)
Definition at line 272 of file Delaunay2D.h.
|
protected |
Height for points lying outside the convex hull.
Definition at line 179 of file Delaunay2D.h.
|
staticprotected |
normalized Y
Definition at line 269 of file Delaunay2D.h.
|
protected |
Definition at line 150 of file Delaunay2D.h.
|
protected |
Number of Delaunay triangles found.
Definition at line 151 of file Delaunay2D.h.
|
protected |
Maximum value of fYN.
Definition at line 165 of file Delaunay2D.h.
|
protected |
Normalization offset X.
Definition at line 166 of file Delaunay2D.h.
|
protected |
Normalization offset Y.
Definition at line 168 of file Delaunay2D.h.
|
protected |
Normalization factor X.
Definition at line 169 of file Delaunay2D.h.
|
protected |
True if FindAllTriangels() has been performed.
Definition at line 183 of file Delaunay2D.h.
|
protected |
Number of data points.
Definition at line 153 of file Delaunay2D.h.
|
protected |
number of cells to divide the normalized space
Definition at line 270 of file Delaunay2D.h.
|
protected |
Triangles of Triangulation.
Definition at line 261 of file Delaunay2D.h.
|
protected |
Minimum value of fXN.
Definition at line 158 of file Delaunay2D.h.
|
protected |
Pointer to Z array.
Definition at line 157 of file Delaunay2D.h.
|
protected |
Pointer to X array (managed externally)
Definition at line 154 of file Delaunay2D.h.
|
protected |
inverse denominator to calculate X cell = fNCells / (fXNmax - fXNmin)
Definition at line 271 of file Delaunay2D.h.
|
protected |
normalized X
Definition at line 262 of file Delaunay2D.h.
|
protected |
Minimum value of fYN.
Definition at line 160 of file Delaunay2D.h.
|
protected |
Maximum value of fXN.
Definition at line 159 of file Delaunay2D.h.
|
protected |
Pointer to Y array.
Definition at line 155 of file Delaunay2D.h.
|
protected |
Normalization factor Y.
Definition at line 171 of file Delaunay2D.h.