TGraphDelaunay.h

Go to the documentation of this file.
00001 // @(#)root/hist:$Id: TGraphDelaunay.h,v 1.00
00002 // Author: Olivier Couet, Luke Jones (Royal Holloway, University of London)
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TGraphDelaunay
00013 #define ROOT_TGraphDelaunay
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TGraphDelaunay                                                       //
00019 //                                                                      //
00020 // This class uses the Delaunay triangles technique to interpolate and  //
00021 // render the data set.                                                 //
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&); // Not implemented
00037    TGraphDelaunay& operator=(const TGraphDelaunay&); // Not implemented
00038 
00039 protected:
00040 
00041    Int_t       fNdt;         //!Number of Delaunay triangles found
00042    Int_t       fNpoints;     //!Number of data points in fGraph2D
00043    Int_t       fNhull;       //!Number of points in the hull
00044    Double_t   *fX;           //!Pointer to fGraph2D->fX
00045    Double_t   *fY;           //!Pointer to fGraph2D->fY
00046    Double_t   *fZ;           //!Pointer to fGraph2D->fZ
00047    Double_t   *fXN;          //!fGraph2D vectors normalized of size fNpoints
00048    Double_t   *fYN;          //!fGraph2D vectors normalized of size fNpoints
00049    Double_t    fXNmin;       //!Minimum value of fXN
00050    Double_t    fXNmax;       //!Maximum value of fXN
00051    Double_t    fYNmin;       //!Minimum value of fYN
00052    Double_t    fYNmax;       //!Maximum value of fYN
00053    Double_t    fXoffset;     //!
00054    Double_t    fYoffset;     //!Parameters used to normalize user data
00055    Double_t    fXScaleFactor; //!
00056    Double_t    fYScaleFactor; //!
00057    Double_t    fZout;        //!Histogram bin height for points lying outside the convex hull
00058    Double_t   *fDist;        //!Array used to order mass points by distance
00059    Int_t       fMaxIter;     //!Maximum number of iterations to find Delaunay triangles
00060    Int_t       fTriedSize;   //!Real size of the fxTried arrays
00061    Int_t      *fPTried;      //!
00062    Int_t      *fNTried;      //!Delaunay triangles storage of size fNdt
00063    Int_t      *fMTried;      //!
00064    Int_t      *fHullPoints;  //!Hull points of size fNhull
00065    Int_t      *fOrder;       //!Array used to order mass points by distance
00066    Bool_t      fAllTri;      //!True if FindAllTriangles() has been performed on fGraph2D
00067    Bool_t      fInit;        //!True if CreateTrianglesDataStructure() and FindHull() have been performed
00068    TGraph2D   *fGraph2D;     //!2D graph containing the user data
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)  // Delaunay triangulation
00103 };
00104 
00105 #endif

Generated on Tue Jul 5 14:22:50 2011 for ROOT_528-00b_version by  doxygen 1.5.1