Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
runplugin.C File Reference

Detailed Description

Creates and runs a simple iterator plugin connected to TGeoPainter iterator.

It demonstrates the possibility to dynamically change the color of drawn volumes according some arbitrary criteria WITHOUT changing the color of the same volume drawn on branches that do not match the criteria.

To run:
root[0] .L iterplugin.cxx+
root[1] .x runplugin.C
root[2] select(2,kMagenta);
root[3] select(3,kBlue)
...
@ kMagenta
Definition Rtypes.h:67
@ kBlue
Definition Rtypes.h:67
#include "iterplugin.cxx"
iterplugin *plugin = nullptr;
void runplugin()
{
TString tutdir = gROOT->GetTutorialDir();
gROOT->ProcessLine(".x " + tutdir + "/visualisation/geom/rootgeom.C");
plugin = new iterplugin();
gGeoManager->GetGeomPainter()->SetIteratorPlugin(plugin);
}
void select(Int_t replica = 1, Int_t color = kGreen)
{
// Change current color. Replica range: 1-4
plugin->Select(replica, color);
gGeoManager->GetGeomPainter()->ModifiedPad();
}
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
@ kGreen
Definition Rtypes.h:67
externTGeoManager * gGeoManager
#define gROOT
Definition TROOT.h:417
Basic string class.
Definition TString.h:138
void Select(Int_t replica, Int_t color)
Author
Andrei Gheata

Definition in file runplugin.C.