Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGraphPainter.h
Go to the documentation of this file.
1// @(#)root/histpainter:$Id: TGraphPainter.h,v 1.00
2// Author: Olivier Couet
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TGraphPainter
13#define ROOT_TGraphPainter
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TGraphPainter //
19// //
20// helper class to draw graphs //
21// //
22//////////////////////////////////////////////////////////////////////////
23
25#include <vector>
26
27class TGraph;
28class TF1;
29class TScatter;
30
32
33public:
34
36
37 ~TGraphPainter() override;
38
39 void ComputeLogs(Int_t npoints, Int_t opt);
40 Int_t DistancetoPrimitiveHelper(TGraph *theGraph, Int_t px, Int_t py) override;
41 void DrawPanelHelper(TGraph *theGraph) override;
42 void ExecuteEventHelper(TGraph *theGraph, Int_t event, Int_t px, Int_t py) override;
43 char *GetObjectInfoHelper(TGraph *theGraph, Int_t px, Int_t py) const override;
44 virtual Int_t GetHighlightPoint(TGraph *theGraph) const;
45 virtual void HighlightPoint(TGraph *theGraph, Int_t hpoint, Int_t distance);
46 virtual void PaintHighlightPoint(TGraph *theGraph, Option_t *option);
47 void PaintHelper(TGraph *theGraph, Option_t *option) override;
48 void PaintGraph(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt) override;
49 void PaintGrapHist(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt) override;
53 void PaintGraphErrors(TGraph *theGraph, Option_t *option);
54 void PaintGraphPolar(TGraph *theGraph, Option_t *option);
55 void PaintGraphQQ(TGraph *theGraph, Option_t *option);
56 void PaintGraphReverse(TGraph *theGraph, Option_t *option);
57 void PaintGraphSimple(TGraph *theGraph, Option_t *option);
58 void PaintScatter(TScatter *theScatter, Option_t *option) override;
59 void PaintPolyLineHatches(TGraph *theGraph, Int_t n, const Double_t *x, const Double_t *y);
60 void PaintStats(TGraph *theGraph, TF1 *fit) override;
61 void SetHighlight(TGraph *theGraph) override;
62 void Smooth(TGraph *theGraph, Int_t npoints, Double_t *x, Double_t *y, Int_t drawtype);
63 static void SetMaxPointsPerLine(Int_t maxp=50);
64
65protected:
66
67 static Int_t fgMaxPointsPerLine; ///< Number of points per chunks' line when drawing a graph.
68
69 std::vector<Double_t> gxwork, gywork, gxworkl, gyworkl; ///< Internal buffers for coordinates. Used for graphs painting.
70
71 ClassDefOverride(TGraphPainter,0) // TGraph painter
72};
73
74#endif
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
1-Dim function class
Definition TF1.h:214
The graph painter class.
void PaintGraphPolar(TGraph *theGraph, Option_t *option)
Paint this TGraphPolar with its current attributes.
void PaintGraph(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt) override
Control function to draw a graph.
void PaintGraphErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphErrors with its current attributes.
void PaintGraphAsymmErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphAsymmErrors with its current attributes.
void PaintGraphMultiErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphMultiErrors with its current attributes.
virtual void PaintHighlightPoint(TGraph *theGraph, Option_t *option)
Paint highlight point as TMarker object (open circle)
void PaintGraphReverse(TGraph *theGraph, Option_t *option)
Paint theGraph reverting values along X and/or Y axis. a new graph is created.
void PaintGrapHist(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt) override
This is a service method used by THistPainter to paint 1D histograms.
static Int_t fgMaxPointsPerLine
Number of points per chunks' line when drawing a graph.
void PaintStats(TGraph *theGraph, TF1 *fit) override
Paint the statistics box with the fit info.
void PaintPolyLineHatches(TGraph *theGraph, Int_t n, const Double_t *x, const Double_t *y)
Paint a polyline with hatches on one side showing an exclusion zone.
void DrawPanelHelper(TGraph *theGraph) override
Display a panel with all histogram drawing options.
char * GetObjectInfoHelper(TGraph *theGraph, Int_t px, Int_t py) const override
void ExecuteEventHelper(TGraph *theGraph, Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
virtual void HighlightPoint(TGraph *theGraph, Int_t hpoint, Int_t distance)
Check on highlight point.
void ComputeLogs(Int_t npoints, Int_t opt)
Compute the logarithm of variables gxwork and gywork according to the value of Options and put the re...
std::vector< Double_t > gxworkl
Int_t DistancetoPrimitiveHelper(TGraph *theGraph, Int_t px, Int_t py) override
Compute distance from point px,py to a graph.
std::vector< Double_t > gxwork
std::vector< Double_t > gywork
void PaintScatter(TScatter *theScatter, Option_t *option) override
Paint a scatter plot.
void Smooth(TGraph *theGraph, Int_t npoints, Double_t *x, Double_t *y, Int_t drawtype)
Smooth a curve given by N points.
std::vector< Double_t > gyworkl
Internal buffers for coordinates. Used for graphs painting.
void SetHighlight(TGraph *theGraph) override
Set highlight (enable/disable) mode for theGraph.
virtual Int_t GetHighlightPoint(TGraph *theGraph) const
Return the highlighted point for theGraph.
void PaintGraphSimple(TGraph *theGraph, Option_t *option)
Paint a simple graph, without errors bars.
void PaintGraphQQ(TGraph *theGraph, Option_t *option)
Paint this graphQQ. No options for the time being.
~TGraphPainter() override
Destructor.
static void SetMaxPointsPerLine(Int_t maxp=50)
Static function to set fgMaxPointsPerLine for graph painting.
void PaintGraphBentErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphBentErrors with its current attributes.
TGraphPainter()
Default constructor.
void PaintHelper(TGraph *theGraph, Option_t *option) override
Paint a any kind of TGraph.
A TGraph is an object made of two arrays X and Y with npoints each.
Definition TGraph.h:41
A TScatter is able to draw four variables scatter plot on a single plot.
Definition TScatter.h:32
Abstract interface to a histogram painter.
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16