Logo ROOT   6.08/07
Reference Guide
TVirtualGeoPainter.cxx
Go to the documentation of this file.
1 // @(#)root/geom:$Id$
2 // Author: Andrei Gheata 11/01/02
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 /** \class TVirtualGeoPainter
13 \ingroup Geometry_classes
14 
15 Abstract class for geometry painters
16 */
17 
18 #include "TROOT.h"
19 #include "TVirtualGeoPainter.h"
20 #include "TPluginManager.h"
21 #include "TGeoManager.h"
22 
24 
26 
27 ////////////////////////////////////////////////////////////////////////////////
28 /// Geometry painter default constructor
29 
31 {
32 }
33 
34 ////////////////////////////////////////////////////////////////////////////////
35 /// Geometry painter default destructor
36 
38 {
39  fgGeoPainter = 0;
40 }
41 
42 
43 ////////////////////////////////////////////////////////////////////////////////
44 /// Static function returning a pointer to the geometry painter.
45 /// The painter will paint objects from the specified geometry.
46 /// If the geometry painter does not exist a default painter is created.
47 
49 {
50  // if no painter set yet, create a default painter via the PluginManager
51  if (!fgGeoPainter) {
53  if ((h = gROOT->GetPluginManager()->FindHandler("TVirtualGeoPainter"))) {
54  if (h->LoadPlugin() == -1)
55  return 0;
57  }
58  }
59  return fgGeoPainter;
60 }
61 
62 ////////////////////////////////////////////////////////////////////////////////
63 /// Static function to set an alternative histogram painter.
64 
66 {
67  fgGeoPainter = (TVirtualGeoPainter*)painter;
68 }
The manager class for any TGeo geometry.
Definition: TGeoManager.h:38
static TVirtualGeoPainter * GeoPainter()
Static function returning a pointer to the geometry painter.
static TVirtualGeoPainter * fgGeoPainter
TH1 * h
Definition: legend2.C:5
#define gROOT
Definition: TROOT.h:364
Int_t LoadPlugin()
Load the plugin library for this handler.
Long_t ExecPlugin(int nargs, const T &... params)
#define ClassImp(name)
Definition: Rtypes.h:279
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:554
Abstract class for geometry painters.
static void SetPainter(const TVirtualGeoPainter *painter)
Static function to set an alternative histogram painter.
virtual ~TVirtualGeoPainter()
Geometry painter default destructor.