Logo ROOT   6.10/09
Reference Guide
runplugin.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_geom
3 /// Creates and runs a simple iterator plugin connected to TGeoPainter iterator.
4 ///
5 /// It demonstrates the possibility to dynamically change the color of drawn
6 /// volumes according some arbitrary criteria *WITHOUT* changing the color of the
7 /// same volume drawn on branches that do not match the criteria.
8 ///
9 /// ~~~{.cpp}
10 /// To run:
11 /// root[0] .L iterplugin.cxx+
12 /// root[1] .x runplugin.C
13 /// root[2] select(2,kMagenta);
14 /// root[3] select(3,kBlue)
15 /// ...
16 /// ~~~
17 ///
18 /// \macro_code
19 ///
20 /// \author Andrei Gheata
21 
22 #include "iterplugin.cxx"
23 
24 iterplugin *plugin = 0;
25 
26 void runplugin()
27 {
28 
29 
30  TString tutdir = gROOT->GetTutorialDir();
31  gROOT->ProcessLine(".x " + tutdir + "/geom/rootgeom.C");
32  plugin = new iterplugin();
34 }
35 
36 void select(Int_t replica=1, Int_t color=kGreen)
37 {
38 // Change current color. Replica range: 1-4
39  plugin->Select(replica, color);
41 }
virtual void ModifiedPad(Bool_t update=kFALSE) const =0
#define gROOT
Definition: TROOT.h:375
Basic string class.
Definition: TString.h:129
int Int_t
Definition: RtypesCore.h:41
Definition: Rtypes.h:56
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:553
virtual void SetIteratorPlugin(TGeoIteratorPlugin *plugin)=0
TVirtualGeoPainter * GetGeomPainter()
Make a default painter if none present. Returns pointer to it.