Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGraphDelaunay2D.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/hist:$Id: TGraphDelaunay2D.h,v 1.00
0002 // Author: Olivier Couet, Luke Jones (Royal Holloway, University of London)
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGraphDelaunay2D
0013 #define ROOT_TGraphDelaunay2D
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TGraphDelaunay2D                                                     //
0019 //                                                                      //
0020 // This class uses the Delaunay triangles technique to interpolate and  //
0021 // render the data set.                                                 //
0022 //                                                                      //
0023 //////////////////////////////////////////////////////////////////////////
0024 
0025 #include "TNamed.h"
0026 
0027 #include "Math/Delaunay2D.h"
0028 
0029 class TGraph2D;
0030 class TView;
0031 
0032 class TGraphDelaunay2D : public TNamed {
0033 
0034 public:
0035 
0036 
0037 private:
0038    TGraphDelaunay2D(const TGraphDelaunay2D&) = delete;
0039    TGraphDelaunay2D& operator=(const TGraphDelaunay2D&) = delete;
0040 
0041 protected:
0042 
0043    TGraph2D   *fGraph2D;               ///<! 2D graph containing the user data
0044    ROOT::Math::Delaunay2D   fDelaunay; ///<! Delaunay interpolator class
0045 
0046 public:
0047 
0048    typedef  ROOT::Math::Delaunay2D::Triangles Triangles;
0049 
0050    TGraphDelaunay2D(TGraph2D *g = nullptr);
0051 
0052    Double_t  ComputeZ(Double_t x, Double_t y) { return fDelaunay.Interpolate(x,y); }
0053    void      FindAllTriangles() { fDelaunay.FindAllTriangles(); }
0054 
0055    TGraph2D *GetGraph2D() const {return fGraph2D;}
0056    Double_t  GetMarginBinsContent() const {return fDelaunay.ZOuterValue();}
0057    Int_t     GetNdt() const {return fDelaunay.NumberOfTriangles(); }
0058    Double_t  GetXNmin() const {return fDelaunay.XMin();}
0059    Double_t  GetXNmax() const {return fDelaunay.XMax();}
0060    Double_t  GetYNmin() const {return fDelaunay.YMin();}
0061    Double_t  GetYNmax() const {return fDelaunay.YMax();}
0062 
0063    void      SetMarginBinsContent(Double_t z=0.) { fDelaunay.SetZOuterValue(z); }
0064 
0065    Triangles::const_iterator begin() const { return fDelaunay.begin(); }
0066    Triangles::const_iterator end()  const { return fDelaunay.end(); }
0067 
0068    ClassDefOverride(TGraphDelaunay2D,1)  // Delaunay triangulation
0069 
0070 private:
0071 
0072 
0073 };
0074 
0075 #endif