Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TVirtualHistPainter.cxx
Go to the documentation of this file.
1// @(#)root/hist:$Id$
2// Author: Rene Brun 30/08/99
3/*************************************************************************
4 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#include "TROOT.h"
12#include "TVirtualHistPainter.h"
13#include "TPluginManager.h"
14
16
17
18
19/** \class TVirtualHistPainter
20 \ingroup Histpainter
21 Abstract interface to a histogram painter
22*/
23
24
25////////////////////////////////////////////////////////////////////////////////
26/// Static function returning a pointer to the current histogram painter.
27/// The painter will paint the specified obj. If the histogram painter
28/// does not exist a default painter 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("TVirtualHistPainter"))) {
36 if (h->LoadPlugin() == -1)
37 return nullptr;
39 if (!fgPainter) return nullptr;
40 } else {
41 // fgPainter is still null
42 return nullptr;
43 }
44 }
45
46 //create an instance of the histogram painter
48 if (p) p->SetHistogram(obj);
49 return p;
50}
51
52////////////////////////////////////////////////////////////////////////////////
53/// Static function to set an alternative histogram painter.
54
#define h(i)
Definition RSha256.hxx:106
winID h TVirtualViewer3D TVirtualGLPainter p
#define gROOT
Definition TROOT.h:411
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition TClass.cxx:2973
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:109
Abstract interface to a histogram painter.
static TClass * fgPainter
Pointer to class painter.
static void SetPainter(const char *painter)
Static function to set an alternative histogram painter.
static TVirtualHistPainter * HistPainter(TH1 *obj)
Static function returning a pointer to the current histogram painter.