ROOT  6.06/09
Reference Guide
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | List of all members
ROOT::Math::Delaunay2D Class Reference

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 73 of file Delaunay2D.h.

Classes

struct  Triangle
 

Public Types

typedef std::vector< TriangleTriangles
 

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 More...
 
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 More...
 
double Interpolate (double x, double y)
 Return the Interpolated z value corresponding to the (x,y) point. More...
 
void FindAllTriangles ()
 Find all triangles. More...
 
Int_t NumberOfTriangles () const
 return the number of triangles More...
 
double XMin () const
 
double XMax () const
 
double YMin () const
 
double YMax () const
 
void SetZOuterValue (double z=0.)
 set z value to be returned for points outside the region More...
 
double ZOuterValue () const
 return the user defined Z-outer value More...
 
Triangles::const_iterator begin () const
 
Triangles::const_iterator end () const
 

Protected Member Functions

unsigned int Cell (UInt_t x, UInt_t y) const
 grid cells with containing triangles More...
 
int CellX (double x) const
 
int CellY (double y) const
 

Protected Attributes

Int_t fNdt
 
Int_t fNpoints
 Number of Delaunay triangles found. More...
 
const doublefX
 Number of data points. More...
 
const doublefY
 Pointer to X array (managed externally) More...
 
const doublefZ
 Pointer to Y array. More...
 
double fXNmin
 Pointer to Z array. More...
 
double fXNmax
 Minimum value of fXN. More...
 
double fYNmin
 Maximum value of fXN. More...
 
double fYNmax
 Minimum value of fYN. More...
 
double fOffsetX
 Maximum value of fYN. More...
 
double fOffsetY
 Normalization offset X. More...
 
double fScaleFactorX
 Normalization offset Y. More...
 
double fScaleFactorY
 Normalization factor X. More...
 
double fZout
 Normalization factor Y. More...
 
Bool_t fInit
 Height for points lying outside the convex hull. More...
 
Triangles fTriangles
 True if FindAllTriangels() has been performed. More...
 
std::vector< doublefXN
 Triangles of Triangulation. More...
 
std::vector< doublefYN
 normalized X More...
 
double fXCellStep
 number of cells to divide the normalized space More...
 
double fYCellStep
 inverse denominator to calculate X cell = fNCells / (fXNmax - fXNmin) More...
 
std::set< UInt_tfCells [(fNCells+1)*(fNCells+1)]
 inverse denominator to calculate X cell = fNCells / (fYNmax - fYNmin) More...
 

Static Protected Attributes

static const int fNCells = 25
 normalized Y More...
 

Private Member Functions

double Linear_transform (double x, double offset, double factor)
 
void DoNormalizePoints ()
 internal function to normalize the points More...
 
void DoFindTriangles ()
 internal function to find the triangle use Triangle or CGAL if flag is set More...
 
double DoInterpolateNormalized (double x, double y)
 internal method to compute the interpolation More...
 
 Delaunay2D (const Delaunay2D &)
 
Delaunay2Doperator= (const Delaunay2D &)
 

#include <Math/Delaunay2D.h>

+ Collaboration diagram for ROOT::Math::Delaunay2D:

Member Typedef Documentation

Definition at line 87 of file Delaunay2D.h.

Constructor & Destructor Documentation

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 32 of file Delaunay2D.cxx.

ROOT::Math::Delaunay2D::Delaunay2D ( const Delaunay2D )
private

Member Function Documentation

Triangles::const_iterator ROOT::Math::Delaunay2D::begin ( ) const
inline

Definition at line 118 of file Delaunay2D.h.

Referenced by TGraphDelaunay2D::begin().

unsigned int ROOT::Math::Delaunay2D::Cell ( UInt_t  x,
UInt_t  y 
) const
inlineprotected

grid cells with containing triangles

Definition at line 276 of file Delaunay2D.h.

Referenced by DoFindTriangles(), and DoInterpolateNormalized().

int ROOT::Math::Delaunay2D::CellX ( double  x) const
inlineprotected

Definition at line 280 of file Delaunay2D.h.

Referenced by DoFindTriangles(), and DoInterpolateNormalized().

int ROOT::Math::Delaunay2D::CellY ( double  y) const
inlineprotected

Definition at line 284 of file Delaunay2D.h.

Referenced by DoFindTriangles(), and DoInterpolateNormalized().

void ROOT::Math::Delaunay2D::DoFindTriangles ( )
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 253 of file Delaunay2D.cxx.

Referenced by FindAllTriangles().

double ROOT::Math::Delaunay2D::DoInterpolateNormalized ( double  xx,
double  yy 
)
private

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 376 of file Delaunay2D.cxx.

Referenced by Interpolate().

void ROOT::Math::Delaunay2D::DoNormalizePoints ( )
private

internal function to normalize the points

Triangle implementation for normalizing the points.

Definition at line 241 of file Delaunay2D.cxx.

Referenced by FindAllTriangles().

Triangles::const_iterator ROOT::Math::Delaunay2D::end ( ) const
inline

Definition at line 119 of file Delaunay2D.h.

Referenced by TGraphDelaunay2D::end().

void ROOT::Math::Delaunay2D::FindAllTriangles ( )

Find all triangles.

Definition at line 125 of file Delaunay2D.cxx.

Referenced by TGraphDelaunay2D::FindAllTriangles(), and Interpolate().

double ROOT::Math::Delaunay2D::Interpolate ( double  x,
double  y 
)

Return the Interpolated z value corresponding to the (x,y) point.

Definition at line 101 of file Delaunay2D.cxx.

Referenced by TGraphDelaunay2D::ComputeZ().

double ROOT::Math::Delaunay2D::Linear_transform ( double  x,
double  offset,
double  factor 
)
inlineprivate

Definition at line 127 of file Delaunay2D.h.

Referenced by DoNormalizePoints(), Interpolate(), and SetInputPoints().

Int_t ROOT::Math::Delaunay2D::NumberOfTriangles ( ) const
inline

return the number of triangles

Definition at line 104 of file Delaunay2D.h.

Referenced by TGraphDelaunay2D::GetNdt().

Delaunay2D& ROOT::Math::Delaunay2D::operator= ( const Delaunay2D )
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 56 of file Delaunay2D.cxx.

Referenced by Delaunay2D().

void ROOT::Math::Delaunay2D::SetZOuterValue ( double  z = 0.)
inline

set z value to be returned for points outside the region

Definition at line 112 of file Delaunay2D.h.

Referenced by TGraphDelaunay2D::SetMarginBinsContent().

double ROOT::Math::Delaunay2D::XMax ( ) const
inline

Definition at line 107 of file Delaunay2D.h.

Referenced by TGraphDelaunay2D::GetXNmax().

double ROOT::Math::Delaunay2D::XMin ( ) const
inline

Definition at line 106 of file Delaunay2D.h.

Referenced by TGraphDelaunay2D::GetXNmin().

double ROOT::Math::Delaunay2D::YMax ( ) const
inline

Definition at line 109 of file Delaunay2D.h.

Referenced by TGraphDelaunay2D::GetYNmax().

double ROOT::Math::Delaunay2D::YMin ( ) const
inline

Definition at line 108 of file Delaunay2D.h.

Referenced by TGraphDelaunay2D::GetYNmin().

double ROOT::Math::Delaunay2D::ZOuterValue ( ) const
inline

return the user defined Z-outer value

Definition at line 115 of file Delaunay2D.h.

Referenced by TGraphDelaunay2D::GetMarginBinsContent().

Member Data Documentation

std::set<UInt_t> ROOT::Math::Delaunay2D::fCells[(fNCells+1)*(fNCells+1)]
protected

inverse denominator to calculate X cell = fNCells / (fYNmax - fYNmin)

Definition at line 274 of file Delaunay2D.h.

Referenced by DoFindTriangles(), and DoInterpolateNormalized().

Bool_t ROOT::Math::Delaunay2D::fInit
protected

Height for points lying outside the convex hull.

Definition at line 181 of file Delaunay2D.h.

Referenced by FindAllTriangles(), and SetInputPoints().

const int ROOT::Math::Delaunay2D::fNCells = 25
staticprotected

normalized Y

Definition at line 271 of file Delaunay2D.h.

Referenced by DoInterpolateNormalized(), and DoNormalizePoints().

Int_t ROOT::Math::Delaunay2D::fNdt
protected

Definition at line 152 of file Delaunay2D.h.

Referenced by Delaunay2D(), FindAllTriangles(), and NumberOfTriangles().

Int_t ROOT::Math::Delaunay2D::fNpoints
protected

Number of Delaunay triangles found.

Definition at line 153 of file Delaunay2D.h.

Referenced by Delaunay2D(), DoFindTriangles(), and DoNormalizePoints().

double ROOT::Math::Delaunay2D::fOffsetX
protected

Maximum value of fYN.

Definition at line 167 of file Delaunay2D.h.

Referenced by Delaunay2D(), DoNormalizePoints(), Interpolate(), and SetInputPoints().

double ROOT::Math::Delaunay2D::fOffsetY
protected

Normalization offset X.

Definition at line 168 of file Delaunay2D.h.

Referenced by Delaunay2D(), DoNormalizePoints(), Interpolate(), and SetInputPoints().

double ROOT::Math::Delaunay2D::fScaleFactorX
protected

Normalization offset Y.

Definition at line 170 of file Delaunay2D.h.

Referenced by Delaunay2D(), DoNormalizePoints(), Interpolate(), and SetInputPoints().

double ROOT::Math::Delaunay2D::fScaleFactorY
protected

Normalization factor X.

Definition at line 171 of file Delaunay2D.h.

Referenced by Delaunay2D(), DoNormalizePoints(), Interpolate(), and SetInputPoints().

Triangles ROOT::Math::Delaunay2D::fTriangles
protected

True if FindAllTriangels() has been performed.

Definition at line 185 of file Delaunay2D.h.

Referenced by begin(), DoFindTriangles(), DoInterpolateNormalized(), end(), and FindAllTriangles().

const double* ROOT::Math::Delaunay2D::fX
protected

Number of data points.

Definition at line 155 of file Delaunay2D.h.

Referenced by Delaunay2D(), and DoNormalizePoints().

double ROOT::Math::Delaunay2D::fXCellStep
protected

number of cells to divide the normalized space

Definition at line 272 of file Delaunay2D.h.

Referenced by CellX(), DoNormalizePoints(), and SetInputPoints().

std::vector<double> ROOT::Math::Delaunay2D::fXN
protected

Triangles of Triangulation.

Definition at line 263 of file Delaunay2D.h.

Referenced by DoFindTriangles(), and DoNormalizePoints().

double ROOT::Math::Delaunay2D::fXNmax
protected

Minimum value of fXN.

Definition at line 160 of file Delaunay2D.h.

Referenced by Delaunay2D(), DoNormalizePoints(), SetInputPoints(), and XMax().

double ROOT::Math::Delaunay2D::fXNmin
protected

Pointer to Z array.

Definition at line 159 of file Delaunay2D.h.

Referenced by Delaunay2D(), DoNormalizePoints(), SetInputPoints(), and XMin().

const double* ROOT::Math::Delaunay2D::fY
protected

Pointer to X array (managed externally)

Definition at line 156 of file Delaunay2D.h.

Referenced by Delaunay2D(), and DoNormalizePoints().

double ROOT::Math::Delaunay2D::fYCellStep
protected

inverse denominator to calculate X cell = fNCells / (fXNmax - fXNmin)

Definition at line 273 of file Delaunay2D.h.

Referenced by CellY(), DoNormalizePoints(), and SetInputPoints().

std::vector<double> ROOT::Math::Delaunay2D::fYN
protected

normalized X

Definition at line 264 of file Delaunay2D.h.

Referenced by DoFindTriangles(), and DoNormalizePoints().

double ROOT::Math::Delaunay2D::fYNmax
protected

Minimum value of fYN.

Definition at line 162 of file Delaunay2D.h.

Referenced by Delaunay2D(), DoNormalizePoints(), SetInputPoints(), and YMax().

double ROOT::Math::Delaunay2D::fYNmin
protected

Maximum value of fXN.

Definition at line 161 of file Delaunay2D.h.

Referenced by Delaunay2D(), DoNormalizePoints(), SetInputPoints(), and YMin().

const double* ROOT::Math::Delaunay2D::fZ
protected

Pointer to Y array.

Definition at line 157 of file Delaunay2D.h.

Referenced by Delaunay2D(), and DoInterpolateNormalized().

double ROOT::Math::Delaunay2D::fZout
protected

Normalization factor Y.

Definition at line 173 of file Delaunay2D.h.

Referenced by DoInterpolateNormalized(), SetZOuterValue(), and ZOuterValue().


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