Proposal for a new TGraph(s) structure


The TGraph(s) class(es) now contain the basic data and methods building the graphs, but also the graphics methods needed to paint them. Therefore, when a graph is created, the graphics libraries are loaded even if the graph is not paint. Like for the histograms the graphical part of the graphs should be moved apart in a dedicaded class.

List of graphics methods which should be moved apart from the TGraph(s) code:

From TGraph:

   virtual void  PaintGraph(Int_t npoints, const Double_t *x, const Double_t *y, Option_t *option="");

   virtual void  PaintGrapHist(Int_t npoints, const Double_t *x, const Double_t *y, Option_t *option="");

   virtual void  PaintPolyLineHatches(Int_t n, const Double_t *x, const Double_t *y);

   virtual void  PaintFit(TF1* fit)
      This method paint the statistics as PaintStats does in THistPainter.
      May be it should be renamed PaintStats in the new schema.

From TGraphErrors:

   virtual void  Paint(Option_t* chopt = ""); 
      should be renamed PaintGraphErrors.

From TGraphAsymmErrors:

   virtual void  Paint(Option_t* chopt = ""); 
      should be renamed PaintGraphAsymmErrors.

From TGraphBentErrors:

   virtual void  Paint(Option_t* chopt = ""); 
      should be renamed PaintGraphBentErrors.

These methods can go in TGraphPainter which sits in hist/histpainter.

TGraphPainter is now used only to paint TGraph2D.

TGraphPainter is loaded via THistPainter. If the TGraph painting methods go in TGraphPainter it will have to be loaded direclty and, like we now have TVirtualHistPainter for histograms, a vitual class TVirtualGraphPainter will be needed.

Once the graphics methods will have been moved into TGraphPainter the following classes will have to be moved into hist/hist (they are now in graf2d/graf):

TGraphAsymmErrors, TGraphFitInterface, TGraphBentErrors, TGraphPolar,
TGraph.cxx, TGraphQQ, TGraphErrors, TGraphSmooth.

Graphics interaction:

TGraphPainter should contain the code now in TGraph::DistancetoPrimitive and TGraph::ExecuteEvent. These two methods will remain in TGraph but they will simply call the ones in TGraphPainter.


Last update: Tue May 6 17:34:33 CEST 2008