Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-13 10:28:17

0001 // @(#)root/histpainter:$Id: TGraphPainter.h,v 1.00
0002 // Author: Olivier Couet
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_TGraphPainter
0013 #define ROOT_TGraphPainter
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TGraphPainter                                                        //
0019 //                                                                      //
0020 // helper class to draw graphs                                          //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TVirtualGraphPainter.h"
0025 #include <vector>
0026 
0027 class TGraph;
0028 class TF1;
0029 class TScatter;
0030 class TScatter2D;
0031 
0032 class TGraphPainter : public TVirtualGraphPainter {
0033 
0034 public:
0035 
0036    TGraphPainter();
0037 
0038    ~TGraphPainter() override;
0039 
0040    void           ComputeLogs(Int_t npoints, Int_t opt);
0041    Int_t          DistancetoPrimitiveHelper(TGraph *theGraph, Int_t px, Int_t py) override;
0042    void           DrawPanelHelper(TGraph *theGraph) override;
0043    void           ExecuteEventHelper(TGraph *theGraph, Int_t event, Int_t px, Int_t py) override;
0044    char          *GetObjectInfoHelper(TGraph *theGraph, Int_t px, Int_t py) const override;
0045    virtual Int_t  GetHighlightPoint(TGraph *theGraph) const;
0046    virtual void   HighlightPoint(TGraph *theGraph, Int_t hpoint, Int_t distance);
0047    virtual void   PaintHighlightPoint(TGraph *theGraph, Option_t *option);
0048    void           PaintHelper(TGraph *theGraph, Option_t *option) override;
0049    void           PaintGraph(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt) override;
0050    void           PaintGrapHist(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt) override;
0051    void           PaintGraphAsymmErrors(TGraph *theGraph, Option_t *option);
0052    void           PaintGraphMultiErrors(TGraph *theGraph, Option_t *option);
0053    void           PaintGraphBentErrors(TGraph *theGraph, Option_t *option);
0054    void           PaintGraphErrors(TGraph *theGraph, Option_t *option);
0055    void           PaintGraphPolar(TGraph *theGraph, Option_t *option);
0056    void           PaintGraphQQ(TGraph *theGraph, Option_t *option);
0057    void           PaintGraphReverse(TGraph *theGraph, Option_t *option);
0058    void           PaintGraphSimple(TGraph *theGraph, Option_t *option);
0059    void           PaintScatter(TScatter *theScatter, Option_t *option) override;
0060    void           PaintScatter2D(TScatter2D *theScatter, Option_t *option) override;
0061    void           PaintPolyLineHatches(TGraph *theGraph, Int_t n, const Double_t *x, const Double_t *y);
0062    void           PaintStats(TGraph *theGraph, TF1 *fit) override;
0063    void           SetHighlight(TGraph *theGraph) override;
0064    void           Smooth(TGraph *theGraph, Int_t npoints, Double_t *x, Double_t *y, Int_t drawtype);
0065    static void    SetMaxPointsPerLine(Int_t maxp=50);
0066 
0067 protected:
0068 
0069    static Int_t   fgMaxPointsPerLine;  ///< Number of points per chunks' line when drawing a graph.
0070 
0071    std::vector<Double_t> gxwork, gywork, gxworkl, gyworkl; ///< Internal buffers for coordinates. Used for graphs painting.
0072 
0073    ClassDefOverride(TGraphPainter,0)  // TGraph painter
0074 };
0075 
0076 #endif