Logo ROOT  
Reference Guide
TGraphDelaunay.h
Go to the documentation of this file.
1 // @(#)root/hist:$Id: TGraphDelaunay.h,v 1.00
2 // Author: Olivier Couet, Luke Jones (Royal Holloway, University of London)
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGraphDelaunay
13 #define ROOT_TGraphDelaunay
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TGraphDelaunay //
19 // //
20 // This class uses the Delaunay triangles technique to interpolate and //
21 // render the data set. //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #include "TNamed.h"
26 
27 class TGraph2D;
28 class TView;
29 
30 class TGraphDelaunay : public TNamed {
31 
32 private:
33 
34  TGraphDelaunay(const TGraphDelaunay&); // Not implemented
35  TGraphDelaunay& operator=(const TGraphDelaunay&); // Not implemented
36 
37 protected:
38 
39  Int_t fNdt; ///<!Number of Delaunay triangles found
40  Int_t fNpoints; ///<!Number of data points in fGraph2D
41  Int_t fNhull; ///<!Number of points in the hull
42  Double_t *fX; ///<!Pointer to fGraph2D->fX
43  Double_t *fY; ///<!Pointer to fGraph2D->fY
44  Double_t *fZ; ///<!Pointer to fGraph2D->fZ
45  Double_t *fXN; ///<!fGraph2D vectors normalized of size fNpoints
46  Double_t *fYN; ///<!fGraph2D vectors normalized of size fNpoints
47  Double_t fXNmin; ///<!Minimum value of fXN
48  Double_t fXNmax; ///<!Maximum value of fXN
49  Double_t fYNmin; ///<!Minimum value of fYN
50  Double_t fYNmax; ///<!Maximum value of fYN
52  Double_t fYoffset; ///<!Parameters used to normalize user data
55  Double_t fZout; ///<!Histogram bin height for points lying outside the convex hull
56  Double_t *fDist; ///<!Array used to order mass points by distance
57  Int_t fMaxIter; ///<!Maximum number of iterations to find Delaunay triangles
58  Int_t fTriedSize; ///<!Real size of the fxTried arrays
59  Int_t *fPTried; ///<!
60  Int_t *fNTried; ///<!Delaunay triangles storage of size fNdt
61  Int_t *fMTried; ///<!
62  Int_t *fHullPoints; ///<!Hull points of size fNhull
63  Int_t *fOrder; ///<!Array used to order mass points by distance
64  Bool_t fAllTri; ///<!True if FindAllTriangles() has been performed on fGraph2D
65  Bool_t fInit; ///<!True if CreateTrianglesDataStructure() and FindHull() have been performed
66  TGraph2D *fGraph2D; ///<!2D graph containing the user data
67 
69  Bool_t Enclose(Int_t T1, Int_t T2, Int_t T3, Int_t Ex) const;
70  void FileIt(Int_t P, Int_t N, Int_t M);
71  void FindHull();
72  Bool_t InHull(Int_t E, Int_t X) const;
73  Double_t InterpolateOnPlane(Int_t TI1, Int_t TI2, Int_t TI3, Int_t E) const;
74 
75 public:
76 
79 
80  virtual ~TGraphDelaunay();
81 
83  void FindAllTriangles();
84  TGraph2D *GetGraph2D() const {return fGraph2D;}
86  Int_t GetNdt() const {return fNdt;}
87  Int_t *GetPTried() const {return fPTried;}
88  Int_t *GetNTried() const {return fNTried;}
89  Int_t *GetMTried() const {return fMTried;}
90  Double_t *GetXN() const {return fXN;}
91  Double_t *GetYN() const {return fYN;}
92  Double_t GetXNmin() const {return fXNmin;}
93  Double_t GetXNmax() const {return fXNmax;}
94  Double_t GetYNmin() const {return fYNmin;}
95  Double_t GetYNmax() const {return fYNmax;}
97  void SetMaxIter(Int_t n=100000);
98  void SetMarginBinsContent(Double_t z=0.);
99 
100  ClassDef(TGraphDelaunay,1) // Delaunay triangulation
101 };
102 
103 #endif
TGraphDelaunay::TGraphDelaunay
TGraphDelaunay(const TGraphDelaunay &)
n
const Int_t n
Definition: legend1.C:16
TGraphDelaunay::CreateTrianglesDataStructure
void CreateTrianglesDataStructure()
Function used internally only.
Definition: TGraphDelaunay.cxx:178
TGraphDelaunay::Enclose
Bool_t Enclose(Int_t T1, Int_t T2, Int_t T3, Int_t Ex) const
Is point e inside the triangle t1-t2-t3 ?
Definition: TGraphDelaunay.cxx:215
TGraphDelaunay::fX
Double_t * fX
!Pointer to fGraph2D->fX
Definition: TGraphDelaunay.h:42
TGraphDelaunay::GetNdt
Int_t GetNdt() const
Definition: TGraphDelaunay.h:86
TGraphDelaunay::SetMarginBinsContent
void SetMarginBinsContent(Double_t z=0.)
Sets the histogram bin height for points lying outside the convex hull ie: the bins in the margin.
Definition: TGraphDelaunay.cxx:943
TGraphDelaunay::fNpoints
Int_t fNpoints
!Number of data points in fGraph2D
Definition: TGraphDelaunay.h:40
TGraphDelaunay::fYNmax
Double_t fYNmax
!Maximum value of fYN
Definition: TGraphDelaunay.h:50
ROOT::Math::Cephes::P
static double P[]
Definition: SpecFuncCephes.cxx:285
TGraphDelaunay::fZout
Double_t fZout
!Histogram bin height for points lying outside the convex hull
Definition: TGraphDelaunay.h:55
TGraphDelaunay::fY
Double_t * fY
!Pointer to fGraph2D->fY
Definition: TGraphDelaunay.h:43
TGraphDelaunay::FindAllTriangles
void FindAllTriangles()
Attempt to find all the Delaunay triangles of the point set.
Definition: TGraphDelaunay.cxx:290
TGraphDelaunay::fAllTri
Bool_t fAllTri
!True if FindAllTriangles() has been performed on fGraph2D
Definition: TGraphDelaunay.h:64
TGraphDelaunay::GetGraph2D
TGraph2D * GetGraph2D() const
Definition: TGraphDelaunay.h:84
TNamed.h
TGraphDelaunay::fGraph2D
TGraph2D * fGraph2D
!2D graph containing the user data
Definition: TGraphDelaunay.h:66
TGraphDelaunay::fDist
Double_t * fDist
!Array used to order mass points by distance
Definition: TGraphDelaunay.h:56
T3
#define T3
Definition: md5.inl:147
TGraphDelaunay::fYoffset
Double_t fYoffset
!Parameters used to normalize user data
Definition: TGraphDelaunay.h:52
TGraphDelaunay::fXNmin
Double_t fXNmin
!Minimum value of fXN
Definition: TGraphDelaunay.h:47
TGraphDelaunay::operator=
TGraphDelaunay & operator=(const TGraphDelaunay &)
Int_t
int Int_t
Definition: RtypesCore.h:45
N
#define N
x
Double_t x[n]
Definition: legend1.C:17
TGraphDelaunay::fYNmin
Double_t fYNmin
!Minimum value of fYN
Definition: TGraphDelaunay.h:49
TGraphDelaunay::GetXN
Double_t * GetXN() const
Definition: TGraphDelaunay.h:90
TGraphDelaunay::fOrder
Int_t * fOrder
!Array used to order mass points by distance
Definition: TGraphDelaunay.h:63
TGraphDelaunay::GetYNmax
Double_t GetYNmax() const
Definition: TGraphDelaunay.h:95
TGraphDelaunay::ComputeZ
Double_t ComputeZ(Double_t x, Double_t y)
Return the z value corresponding to the (x,y) point in fGraph2D.
Definition: TGraphDelaunay.cxx:148
TGraphDelaunay::GetMTried
Int_t * GetMTried() const
Definition: TGraphDelaunay.h:89
TGraphDelaunay::fHullPoints
Int_t * fHullPoints
!Hull points of size fNhull
Definition: TGraphDelaunay.h:62
bool
TGraphDelaunay::Interpolate
Double_t Interpolate(Double_t x, Double_t y)
Finds the Delaunay triangle that the point (xi,yi) sits in (if any) and calculate a z-value for it by...
Definition: TGraphDelaunay.cxx:595
TGraphDelaunay::fYScaleFactor
Double_t fYScaleFactor
!
Definition: TGraphDelaunay.h:54
TGraphDelaunay::GetXNmin
Double_t GetXNmin() const
Definition: TGraphDelaunay.h:92
TGraphDelaunay::GetPTried
Int_t * GetPTried() const
Definition: TGraphDelaunay.h:87
TGraphDelaunay::fInit
Bool_t fInit
!True if CreateTrianglesDataStructure() and FindHull() have been performed
Definition: TGraphDelaunay.h:65
TGraphDelaunay::GetYNmin
Double_t GetYNmin() const
Definition: TGraphDelaunay.h:94
TGraph2D
Graphics object made of three arrays X, Y and Z with the same number of points each.
Definition: TGraph2D.h:41
TView
See TView3D.
Definition: TView.h:25
TGraphDelaunay
TGraphDelaunay generates a Delaunay triangulation of a TGraph2D.
Definition: TGraphDelaunay.h:30
TGraphDelaunay::TGraphDelaunay
TGraphDelaunay()
TGraphDelaunay default constructor.
Definition: TGraphDelaunay.cxx:49
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TGraphDelaunay::fYN
Double_t * fYN
!fGraph2D vectors normalized of size fNpoints
Definition: TGraphDelaunay.h:46
TGraphDelaunay::SetMaxIter
void SetMaxIter(Int_t n=100000)
Defines the number of triangles tested for a Delaunay triangle (number of iterations) before abandoni...
Definition: TGraphDelaunay.cxx:932
TGraphDelaunay::fXScaleFactor
Double_t fXScaleFactor
!
Definition: TGraphDelaunay.h:53
TGraphDelaunay::fMaxIter
Int_t fMaxIter
!Maximum number of iterations to find Delaunay triangles
Definition: TGraphDelaunay.h:57
y
Double_t y[n]
Definition: legend1.C:17
T2
#define T2
Definition: md5.inl:146
TGraphDelaunay::FindHull
void FindHull()
Finds those points which make up the convex hull of the set.
Definition: TGraphDelaunay.cxx:421
TGraphDelaunay::GetNTried
Int_t * GetNTried() const
Definition: TGraphDelaunay.h:88
TGraphDelaunay::fNhull
Int_t fNhull
!Number of points in the hull
Definition: TGraphDelaunay.h:41
TGraphDelaunay::fPTried
Int_t * fPTried
!
Definition: TGraphDelaunay.h:59
Double_t
double Double_t
Definition: RtypesCore.h:59
TGraphDelaunay::InterpolateOnPlane
Double_t InterpolateOnPlane(Int_t TI1, Int_t TI2, Int_t TI3, Int_t E) const
Finds the z-value at point e given that it lies on the plane defined by t1,t2,t3.
Definition: TGraphDelaunay.cxx:556
TGraphDelaunay::~TGraphDelaunay
virtual ~TGraphDelaunay()
TGraphDelaunay destructor.
Definition: TGraphDelaunay.cxx:123
TGraphDelaunay::GetMarginBinsContent
Double_t GetMarginBinsContent() const
Definition: TGraphDelaunay.h:85
T1
#define T1
Definition: md5.inl:145
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGraphDelaunay::fZ
Double_t * fZ
!Pointer to fGraph2D->fZ
Definition: TGraphDelaunay.h:44
TGraphDelaunay::fMTried
Int_t * fMTried
!
Definition: TGraphDelaunay.h:61
TGraphDelaunay::fXNmax
Double_t fXNmax
!Maximum value of fXN
Definition: TGraphDelaunay.h:48
TGraphDelaunay::GetXNmax
Double_t GetXNmax() const
Definition: TGraphDelaunay.h:93
TGraphDelaunay::InHull
Bool_t InHull(Int_t E, Int_t X) const
Is point e inside the hull defined by all points apart from x ?
Definition: TGraphDelaunay.cxx:448
TGraphDelaunay::FileIt
void FileIt(Int_t P, Int_t N, Int_t M)
Files the triangle defined by the 3 vertices p, n and m into the fxTried arrays.
Definition: TGraphDelaunay.cxx:237
TMath::E
constexpr Double_t E()
Base of natural log:
Definition: TMath.h:96
TGraphDelaunay::fXN
Double_t * fXN
!fGraph2D vectors normalized of size fNpoints
Definition: TGraphDelaunay.h:45
TGraphDelaunay::fXoffset
Double_t fXoffset
!
Definition: TGraphDelaunay.h:51
TGraphDelaunay::GetYN
Double_t * GetYN() const
Definition: TGraphDelaunay.h:91
TGraphDelaunay::fNdt
Int_t fNdt
!Number of Delaunay triangles found
Definition: TGraphDelaunay.h:39
TGraphDelaunay::fTriedSize
Int_t fTriedSize
!Real size of the fxTried arrays
Definition: TGraphDelaunay.h:58
int
TGraphDelaunay::fNTried
Int_t * fNTried
!Delaunay triangles storage of size fNdt
Definition: TGraphDelaunay.h:60
g
#define g(i)
Definition: RSha256.hxx:105