Logo ROOT  
Reference Guide
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)
...
#include "iterplugin.cxx"
iterplugin *plugin = 0;
void runplugin()
{
TString tutdir = gROOT->GetTutorialDir();
gROOT->ProcessLine(".x " + tutdir + "/geom/rootgeom.C");
plugin = new iterplugin();
}
void select(Int_t replica=1, Int_t color=kGreen)
{
// Change current color. Replica range: 1-4
plugin->Select(replica, color);
}
Author
Andrei Gheata

Definition in file runplugin.C.

TVirtualGeoPainter::SetIteratorPlugin
virtual void SetIteratorPlugin(TGeoIteratorPlugin *plugin)=0
kGreen
@ kGreen
Definition: Rtypes.h:66
gGeoManager
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:602
Int_t
int Int_t
Definition: RtypesCore.h:45
iterplugin.cxx
TString
Definition: TString.h:136
kMagenta
@ kMagenta
Definition: Rtypes.h:66
TGeoManager::GetGeomPainter
TVirtualGeoPainter * GetGeomPainter()
Make a default painter if none present. Returns pointer to it.
Definition: TGeoManager.cxx:2685
kBlue
@ kBlue
Definition: Rtypes.h:66
TVirtualGeoPainter::ModifiedPad
virtual void ModifiedPad(Bool_t update=kFALSE) const =0
gROOT
#define gROOT
Definition: TROOT.h:406