00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGraphDelaunay
00013 #define ROOT_TGraphDelaunay
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef ROOT_TNamed
00026 #include "TNamed.h"
00027 #endif
00028
00029 class TGraph2D;
00030 class TView;
00031
00032 class TGraphDelaunay : public TNamed {
00033
00034 private:
00035
00036 TGraphDelaunay(const TGraphDelaunay&);
00037 TGraphDelaunay& operator=(const TGraphDelaunay&);
00038
00039 protected:
00040
00041 Int_t fNdt;
00042 Int_t fNpoints;
00043 Int_t fNhull;
00044 Double_t *fX;
00045 Double_t *fY;
00046 Double_t *fZ;
00047 Double_t *fXN;
00048 Double_t *fYN;
00049 Double_t fXNmin;
00050 Double_t fXNmax;
00051 Double_t fYNmin;
00052 Double_t fYNmax;
00053 Double_t fXoffset;
00054 Double_t fYoffset;
00055 Double_t fXScaleFactor;
00056 Double_t fYScaleFactor;
00057 Double_t fZout;
00058 Double_t *fDist;
00059 Int_t fMaxIter;
00060 Int_t fTriedSize;
00061 Int_t *fPTried;
00062 Int_t *fNTried;
00063 Int_t *fMTried;
00064 Int_t *fHullPoints;
00065 Int_t *fOrder;
00066 Bool_t fAllTri;
00067 Bool_t fInit;
00068 TGraph2D *fGraph2D;
00069
00070 void CreateTrianglesDataStructure();
00071 Bool_t Enclose(Int_t T1, Int_t T2, Int_t T3, Int_t Ex) const;
00072 void FileIt(Int_t P, Int_t N, Int_t M);
00073 void FindHull();
00074 Bool_t InHull(Int_t E, Int_t X) const;
00075 Double_t InterpolateOnPlane(Int_t TI1, Int_t TI2, Int_t TI3, Int_t E) const;
00076
00077 public:
00078
00079 TGraphDelaunay();
00080 TGraphDelaunay(TGraph2D *g);
00081
00082 virtual ~TGraphDelaunay();
00083
00084 Double_t ComputeZ(Double_t x, Double_t y);
00085 void FindAllTriangles();
00086 TGraph2D *GetGraph2D() const {return fGraph2D;}
00087 Double_t GetMarginBinsContent() const {return fZout;}
00088 Int_t GetNdt() const {return fNdt;}
00089 Int_t *GetPTried() const {return fPTried;}
00090 Int_t *GetNTried() const {return fNTried;}
00091 Int_t *GetMTried() const {return fMTried;}
00092 Double_t *GetXN() const {return fXN;}
00093 Double_t *GetYN() const {return fYN;}
00094 Double_t GetXNmin() const {return fXNmin;}
00095 Double_t GetXNmax() const {return fXNmax;}
00096 Double_t GetYNmin() const {return fYNmin;}
00097 Double_t GetYNmax() const {return fYNmax;}
00098 Double_t Interpolate(Double_t x, Double_t y);
00099 void SetMaxIter(Int_t n=100000);
00100 void SetMarginBinsContent(Double_t z=0.);
00101
00102 ClassDef(TGraphDelaunay,1)
00103 };
00104
00105 #endif