00001 iterplugin *plugin = 0; 00002 00003 void runplugin() 00004 { 00005 //+ Creates and runs a simple iterator plugin connected to TGeoPainter iterator. 00006 // It demonstrates the possibility to dynamically change the color of drawn 00007 // volumes acording some arbitrary criteria *WITHOUT* changing the color of the 00008 // same volume drawn on branches that do not match the criteria. 00009 // 00010 // To run: 00011 // root[0] .L iterplugin.cxx+ 00012 // root[1] .x runplugin.C 00013 // root[2] select(2,kMagenta); 00014 // root[3] select(3,kBlue) 00015 // ... 00016 00017 gROOT->ProcessLine(".x $ROOTSYS/tutorials/geom/rootgeom.C"); 00018 plugin = new iterplugin(); 00019 gGeoManager->GetGeomPainter()->SetIteratorPlugin(plugin); 00020 } 00021 00022 void select(Int_t replica=1, Int_t color=kGreen) 00023 { 00024 // Change current color. Replica range: 1-4 00025 plugin->Select(replica, color); 00026 gGeoManager->GetGeomPainter()->ModifiedPad(); 00027 }