Logo ROOT   6.08/07
Reference Guide
TVirtualGraphPainter.cxx
Go to the documentation of this file.
1 // @(#)root/hist:$Id$
2 // Author: Olivier Couet 20/05/08
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 #include "TROOT.h"
13 #include "TVirtualGraphPainter.h"
14 #include "TPluginManager.h"
15 #include "TClass.h"
16 
18 
20 
21 /** \class TVirtualGraphPainter
22  \ingroup Hist
23  Abstract interface to a histogram painter
24 */
25 
26 ////////////////////////////////////////////////////////////////////////////////
27 /// Static function returning a pointer to the current graph painter.
28 /// If the graph painter does not exist a default painter (singleton) is created.
29 
31 {
32  // if no painter set yet, create a default painter via the PluginManager
33  if (!fgPainter) {
35  if ((h = gROOT->GetPluginManager()->FindHandler("TVirtualGraphPainter"))) {
36  if (h->LoadPlugin() == -1) return 0;
37  fgPainter = (TVirtualGraphPainter*)gROOT->GetClass("TGraphPainter")->New();
38  }
39  }
40 
41  // Create an instance of the graph painter
42  return fgPainter;
43 }
44 
45 ////////////////////////////////////////////////////////////////////////////////
46 /// Static function to set an alternative histogram painter.
47 
49 {
50  fgPainter = painter;
51 }
Abstract interface to a histogram painter.
TH1 * h
Definition: legend2.C:5
#define gROOT
Definition: TROOT.h:364
Int_t LoadPlugin()
Load the plugin library for this handler.
static void SetPainter(TVirtualGraphPainter *painter)
Static function to set an alternative histogram painter.
static TVirtualGraphPainter * fgPainter
#define ClassImp(name)
Definition: Rtypes.h:279