ROOT
Version master
master
v6.34
v6.32
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
v6.04
Reference Guide
►
ROOT
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
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
=
nullptr
;
25
26
void
runplugin
()
27
{
28
29
TString
tutdir
=
gROOT
->GetTutorialDir();
30
gROOT
->ProcessLine(
".x "
+
tutdir
+
"/visualisation/geom/rootgeom.C"
);
31
plugin
=
new
iterplugin
();
32
gGeoManager
->
GetGeomPainter
()->
SetIteratorPlugin
(
plugin
);
33
}
34
35
void
select
(
Int_t
replica
= 1,
Int_t
color =
kGreen
)
36
{
37
// Change current color. Replica range: 1-4
38
plugin
->Select(
replica
, color);
39
gGeoManager
->
GetGeomPainter
()->
ModifiedPad
();
40
}
Int_t
int Int_t
Definition
RtypesCore.h:45
kGreen
@ kGreen
Definition
Rtypes.h:66
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
gGeoManager
R__EXTERN TGeoManager * gGeoManager
Definition
TGeoManager.h:608
gROOT
#define gROOT
Definition
TROOT.h:406
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TGeoManager::GetGeomPainter
TVirtualGeoPainter * GetGeomPainter()
Make a default painter if none present. Returns pointer to it.
Definition
TGeoManager.cxx:2916
TString
Basic string class.
Definition
TString.h:139
TVirtualGeoPainter::ModifiedPad
virtual void ModifiedPad(Bool_t update=kFALSE) const =0
TVirtualGeoPainter::SetIteratorPlugin
virtual void SetIteratorPlugin(TGeoIteratorPlugin *plugin)=0
iterplugin
Definition
iterplugin.cxx:9
iterplugin.cxx
tutorials
visualisation
geom
runplugin.C
ROOT master - Reference Guide Generated on Mon Mar 3 2025 04:37:57 (GVA Time) using Doxygen 1.10.0