ROOT  6.06/09
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 //______________________________________________________________________________
13 // TVirtualGeoPainter
14 // ==================
15 // ABC for geometry painters
16 //______________________________________________________________________________
17 
18 #include "TROOT.h"
19 #include "TVirtualGeoPainter.h"
20 #include "TPluginManager.h"
21 #include "TGeoManager.h"
22 
23 TVirtualGeoPainter *TVirtualGeoPainter::fgGeoPainter = 0;
24 
26 
27 ////////////////////////////////////////////////////////////////////////////////
28 ///*-*-*-*-*-*-*-*-*-*-*Geometry painter default constructor*-*-*-*-*-*-*-*-*
29 ///*-* ====================================
30 
32 {
33 }
34 
35 ////////////////////////////////////////////////////////////////////////////////
36 ///*-*-*-*-*-*-*-*-*-*-*Geometry painter default destructor*-*-*-*-*-*-*-*-*
37 ///*-* ===================================
38 
40 {
41  fgGeoPainter = 0;
42 }
43 
44 
45 ////////////////////////////////////////////////////////////////////////////////
46 /// Static function returning a pointer to the geometry painter.
47 /// The painter will paint objects from the specified geometry.
48 /// If the geometry painter does not exist a default painter is created.
49 
51 {
52  // if no painter set yet, create a default painter via the PluginManager
53  if (!fgGeoPainter) {
55  if ((h = gROOT->GetPluginManager()->FindHandler("TVirtualGeoPainter"))) {
56  if (h->LoadPlugin() == -1)
57  return 0;
59  }
60  }
61  return fgGeoPainter;
62 }
63 
64 ////////////////////////////////////////////////////////////////////////////////
65 /// Static function to set an alternative histogram painter.
66 
68 {
69  fgGeoPainter = (TVirtualGeoPainter*)painter;
70 }
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:340
Int_t LoadPlugin()
Load the plugin library for this handler.
Long_t ExecPlugin(int nargs, const T &...params)
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:556
static void SetPainter(const TVirtualGeoPainter *painter)
Static function to set an alternative histogram painter.
ClassImp(TVirtualGeoPainter) TVirtualGeoPainter
*-*-*-*-*-*-*-*-*-*-*Geometry painter default constructor*-*-*-*-*-*-*-*-* *-* ======================...
virtual ~TVirtualGeoPainter()
*-*-*-*-*-*-*-*-*-*-*Geometry painter default destructor*-*-*-*-*-*-*-*-* *-* =======================...