Script demonstrating geometry color schemes.
*/
#include <string>
#include <algorithm>
{
}
void help()
{
printf(
"In the viewer window:\n"
" - de-select \"Reset on update\"\n"
" - in the \"Clipping\" tab, select \"Plane\"\n"
" - rotate the image as uou wish and zoom using the mouse wheel\n"
" - click on the different default color schemes in control bar menu\n"
" - the \"gray\" function demonstrates overriding the Z-based fallback colors\n"
" - the \"override\" function demonstrates color override from a scheme by using a hook\n"
" - the \"transparency\" function demonstrates transparency override\n");
}
{
return;
}
{
return;
}
{
return;
}
void gray()
{
return;
float g = std::min(1.f, Z / 100.f);
});
}
{
return;
return -1;
if (
m->GetDensity() < 0.1)
std::transform(
n.
begin(),
n.
end(),
n.
begin(), [](
unsigned char c) { return (char)std::tolower(c); });
if (
n.find(
"cable") != std::string::npos ||
n.find(
"cables") != std::string::npos)
if (
n.find(
"tungsten") != std::string::npos ||
n.find(
"_w") != std::string::npos)
}
});
} else {
}
}
{
return;
return -1;
if (std::string(
m->
GetName()).find(
"ITS_GEN") != std::string::npos)
return -1;
});
}
{
bar->
AddButton(
"How to run ",
"help()",
"Instructions for running this macro");
"A natural color scheme with name-based/Z-binned lookup for material classification");
bar->
AddButton(
"Flashy ",
"flashy()",
"Flashy, high-contrast, presentation-friendly colors");
bar->
AddButton(
"High contrast ",
"high_contrast()",
"Darker, saturated colors suited for light backgrounds");
bar->
AddButton(
"Gray fallback ",
"gray()",
"Demonstrates overriding the Z-based fallback colors");
bar->
AddButton(
"Color override ",
"color_override()",
"Demonstrates color override from a scheme by using a hook");
bar->
AddButton(
"Transparency ON/OFF ",
"transparent()",
"Demonstrates transparency override from a scheme by using a hook");
}
bool Bool_t
Boolean (0=false, 1=true) (bool)
int Int_t
Signed integer 4 bytes (int)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
EGeoColorSet
Enumeration of predefined geometry color schemes.
@ kNatural
Natural, material-inspired colors (default)
@ kFlashy
Bright, high-contrast colors for presentations.
@ kHighContrast
Dark, saturated colors for light backgrounds.
R__EXTERN TGeoManager * gGeoManager
const_iterator begin() const
const_iterator end() const
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
A Control Bar is a fully user configurable tool which provides fast access to frequently used operati...
void Show()
Show control bar.
void AddButton(TControlBarButton *button)
Add button.
Strategy object for assigning colors and transparency to geometry volumes.
static const TGeoMaterial * GetMaterial(const TGeoVolume *vol)
Retrieve the material associated with a geometry volume.
void SetVisLevel(Int_t level=3)
set default level down to which visualization is performed
static TGeoManager * Import(const char *filename, const char *name="", Option_t *option="")
static function Import a geometry from a gdml or ROOT file
TGeoVolume * GetVolume(const char *name) const
Search for a named volume. All trailing blanks stripped.
void DefaultColors(const TGeoColorScheme *cs=nullptr)
Set default volume colors according to A of material.
Base class describing materials.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
void Draw(Option_t *option="") override
draw top volume according to option
virtual const char * GetName() const
Returns name of object.