Logo ROOT  
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;
56  fgGeoPainter = (TVirtualGeoPainter*)h->ExecPlugin(1,gGeoManager);
57  }
58  }
59  return fgGeoPainter;
60 }
61 
62 ////////////////////////////////////////////////////////////////////////////////
63 /// Static function to set an alternative histogram painter.
64 
66 {
67  fgGeoPainter = (TVirtualGeoPainter*)painter;
68 }
gGeoManager
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:602
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TVirtualGeoPainter::SetPainter
static void SetPainter(const TVirtualGeoPainter *painter)
Static function to set an alternative histogram painter.
Definition: TVirtualGeoPainter.cxx:65
TROOT.h
TPluginHandler
Definition: TPluginManager.h:101
TVirtualGeoPainter::~TVirtualGeoPainter
virtual ~TVirtualGeoPainter()
Geometry painter default destructor.
Definition: TVirtualGeoPainter.cxx:37
h
#define h(i)
Definition: RSha256.hxx:124
TVirtualGeoPainter::fgGeoPainter
static TVirtualGeoPainter * fgGeoPainter
Definition: TVirtualGeoPainter.h:35
TGeoManager.h
TVirtualGeoPainter::GeoPainter
static TVirtualGeoPainter * GeoPainter()
Static function returning a pointer to the geometry painter.
Definition: TVirtualGeoPainter.cxx:48
TVirtualGeoPainter.h
TVirtualGeoPainter
Definition: TVirtualGeoPainter.h:32
TPluginManager.h
TVirtualGeoPainter::TVirtualGeoPainter
TVirtualGeoPainter(TGeoManager *manager)
Geometry painter default constructor.
Definition: TVirtualGeoPainter.cxx:30
TGeoManager
Definition: TGeoManager.h:44
gROOT
#define gROOT
Definition: TROOT.h:406