Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TGraphDelaunay2D.h
Go to the documentation of this file.
1 // @(#)root/hist:$Id: TGraphDelaunay2D.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_TGraphDelaunay2D
13 #define ROOT_TGraphDelaunay2D
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TGraphDelaunay2D //
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 #include "Math/Delaunay2D.h"
28 
29 class TGraph2D;
30 class TView;
31 
32 class TGraphDelaunay2D : public TNamed {
33 
34 public:
35 
36 
37 private:
38  TGraphDelaunay2D(const TGraphDelaunay2D&); // Not implemented
39  TGraphDelaunay2D& operator=(const TGraphDelaunay2D&); // Not implemented
40 
41 protected:
42 
43  TGraph2D *fGraph2D; ///<!2D graph containing the user data
44  ROOT::Math::Delaunay2D fDelaunay; ///<! Delaunay interpolator class
45 
46 public:
47 
48  typedef ROOT::Math::Delaunay2D::Triangles Triangles;
49 
50  TGraphDelaunay2D(TGraph2D *g = 0);
51 
52  Double_t ComputeZ(Double_t x, Double_t y) { return fDelaunay.Interpolate(x,y); }
53  void FindAllTriangles() { fDelaunay.FindAllTriangles(); }
54 
55  TGraph2D *GetGraph2D() const {return fGraph2D;}
56  Double_t GetMarginBinsContent() const {return fDelaunay.ZOuterValue();}
57  Int_t GetNdt() const {return fDelaunay.NumberOfTriangles(); }
58  Double_t GetXNmin() const {return fDelaunay.XMin();}
59  Double_t GetXNmax() const {return fDelaunay.XMax();}
60  Double_t GetYNmin() const {return fDelaunay.YMin();}
61  Double_t GetYNmax() const {return fDelaunay.YMax();}
62 
63  void SetMarginBinsContent(Double_t z=0.) { fDelaunay.SetZOuterValue(z); }
64 
65  Triangles::const_iterator begin() const { return fDelaunay.begin(); }
66  Triangles::const_iterator end() const { return fDelaunay.end(); }
67 
68  ClassDef(TGraphDelaunay2D,1) // Delaunay triangulation
69 
70 private:
71 
72 
73 };
74 
75 #endif