Logo ROOT   6.10/09
Reference Guide
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 
24 #include "TVirtualGraphPainter.h"
25 
26 class TGraph;
27 class TF1;
28 
30 
31 public:
32 
33  TGraphPainter();
34 
35  virtual ~TGraphPainter();
36 
37  void ComputeLogs(Int_t npoints, Int_t opt);
38  virtual Int_t DistancetoPrimitiveHelper(TGraph *theGraph, Int_t px, Int_t py);
39  virtual void DrawPanelHelper(TGraph *theGraph);
40  virtual void ExecuteEventHelper(TGraph *theGraph, Int_t event, Int_t px, Int_t py);
41  virtual char *GetObjectInfoHelper(TGraph *theGraph, Int_t px, Int_t py) const;
42  void PaintHelper(TGraph *theGraph, Option_t *option);
43  virtual void PaintGraph(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt);
44  virtual void PaintGrapHist(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt);
45  void PaintGraphAsymmErrors(TGraph *theGraph, Option_t *option);
46  void PaintGraphBentErrors(TGraph *theGraph, Option_t *option);
47  void PaintGraphErrors(TGraph *theGraph, Option_t *option);
48  void PaintGraphPolar(TGraph *theGraph, Option_t *option);
49  void PaintGraphQQ(TGraph *theGraph, Option_t *option);
50  void PaintGraphReverse(TGraph *theGraph, Option_t *option);
51  void PaintGraphSimple(TGraph *theGraph, Option_t *option);
52  void PaintPolyLineHatches(TGraph *theGraph, Int_t n, const Double_t *x, const Double_t *y);
53  void PaintStats(TGraph *theGraph, TF1 *fit);
54  void Smooth(TGraph *theGraph, Int_t npoints, Double_t *x, Double_t *y, Int_t drawtype);
55  static void SetMaxPointsPerLine(Int_t maxp=50);
56 
57 protected:
58 
59  static Int_t fgMaxPointsPerLine; //Number of points per chunks' line when drawing a graph.
60 
61  ClassDef(TGraphPainter,0) // TGraph painter
62 };
63 
64 #endif
Abstract interface to a histogram painter.
virtual Int_t DistancetoPrimitiveHelper(TGraph *theGraph, Int_t px, Int_t py)
Compute distance from point px,py to a graph.
virtual void ExecuteEventHelper(TGraph *theGraph, Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
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 Smooth(TGraph *theGraph, Int_t npoints, Double_t *x, Double_t *y, Int_t drawtype)
Smooth a curve given by N points.
const char Option_t
Definition: RtypesCore.h:62
static Int_t fgMaxPointsPerLine
Definition: TGraphPainter.h:59
void PaintStats(TGraph *theGraph, TF1 *fit)
Paint the statistics box with the fit info.
int Int_t
Definition: RtypesCore.h:41
void PaintGraphPolar(TGraph *theGraph, Option_t *option)
[Paint this TGraphPolar with its current attributes.]($GP04)
static void SetMaxPointsPerLine(Int_t maxp=50)
Static function to set fgMaxPointsPerLine for graph painting.
virtual ~TGraphPainter()
Destructor.
TGraphPainter()
Default constructor.
void PaintGraphAsymmErrors(TGraph *theGraph, Option_t *option)
Paint this TGraphAsymmErrors with its current attributes.
virtual void DrawPanelHelper(TGraph *theGraph)
Display a panel with all histogram drawing options.
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:297
virtual void PaintGrapHist(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
This is a service method used by THistPainter to paint 1D histograms.
virtual char * GetObjectInfoHelper(TGraph *theGraph, Int_t px, Int_t py) const
void PaintHelper(TGraph *theGraph, Option_t *option)
Paint a any kind of TGraph.
void PaintGraphErrors(TGraph *theGraph, Option_t *option)
[Paint this TGraphErrors with its current attributes.]($GP03)
void PaintGraphQQ(TGraph *theGraph, Option_t *option)
Paint this graphQQ. No options for the time being.
void PaintGraphBentErrors(TGraph *theGraph, Option_t *option)
[Paint this TGraphBentErrors with its current attributes.]($GP03)
void ComputeLogs(Int_t npoints, Int_t opt)
Compute the logarithm of global variables gxwork and gywork according to the value of Options and put...
double Double_t
Definition: RtypesCore.h:55
Double_t y[n]
Definition: legend1.C:17
virtual void PaintGraph(TGraph *theGraph, Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
[Control function to draw a graph.]($GP01)
1-Dim function class
Definition: TF1.h:150
A Graph is a graphics object made of two arrays X and Y with npoints each.
Definition: TGraph.h:41
The graph painter class.
Definition: TGraphPainter.h:29
const Int_t n
Definition: legend1.C:16
void PaintGraphSimple(TGraph *theGraph, Option_t *option)
Paint a simple graph, without errors bars.
void PaintGraphReverse(TGraph *theGraph, Option_t *option)
Paint theGraph reverting values along X and/or Y axis. a new graph is created.