#ifndef ROOT_TGraphDelaunay
#define ROOT_TGraphDelaunay
#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
class TGraph2D;
class TView;
class TGraphDelaunay : public TNamed {
private:
TGraphDelaunay(const TGraphDelaunay&);
TGraphDelaunay& operator=(const TGraphDelaunay&);
protected:
Int_t fNdt;
Int_t fNpoints;
Int_t fNhull;
Double_t *fX;
Double_t *fY;
Double_t *fZ;
Double_t *fXN;
Double_t *fYN;
Double_t fXNmin;
Double_t fXNmax;
Double_t fYNmin;
Double_t fYNmax;
Double_t fXoffset;
Double_t fYoffset;
Double_t fXScaleFactor;
Double_t fYScaleFactor;
Double_t fZout;
Double_t *fDist;
Int_t fMaxIter;
Int_t fTriedSize;
Int_t *fPTried;
Int_t *fNTried;
Int_t *fMTried;
Int_t *fHullPoints;
Int_t *fOrder;
Bool_t fAllTri;
Bool_t fInit;
TGraph2D *fGraph2D;
void CreateTrianglesDataStructure();
Bool_t Enclose(Int_t T1, Int_t T2, Int_t T3, Int_t Ex) const;
void FileIt(Int_t P, Int_t N, Int_t M);
void FindHull();
Bool_t InHull(Int_t E, Int_t X) const;
Double_t InterpolateOnPlane(Int_t TI1, Int_t TI2, Int_t TI3, Int_t E) const;
public:
TGraphDelaunay();
TGraphDelaunay(TGraph2D *g);
virtual ~TGraphDelaunay();
Double_t ComputeZ(Double_t x, Double_t y);
void FindAllTriangles();
TGraph2D *GetGraph2D() const {return fGraph2D;}
Double_t GetMarginBinsContent() const {return fZout;}
Int_t GetNdt() const {return fNdt;}
Int_t *GetPTried() const {return fPTried;}
Int_t *GetNTried() const {return fNTried;}
Int_t *GetMTried() const {return fMTried;}
Double_t *GetXN() const {return fXN;}
Double_t *GetYN() const {return fYN;}
Double_t GetXNmin() const {return fXNmin;}
Double_t GetXNmax() const {return fXNmax;}
Double_t GetYNmin() const {return fYNmin;}
Double_t GetYNmax() const {return fYNmax;}
Double_t Interpolate(Double_t x, Double_t y);
void SetMaxIter(Int_t n=100000);
void SetMarginBinsContent(Double_t z=0.);
ClassDef(TGraphDelaunay,1)
};
#endif