A barrel and a few jets are projected in RhoPhi and RhoZ, and each projected view gets an axis. Ticks sit at round numbers in the original space and are drawn where the projection puts them, so with a non-zero distortion their spacing on screen is uneven. Change the distortion with the <<< and >>> buttons in each view, or from the ROOT prompt:
The browser relayouts the labels on zoom and pan. Only a change of the projection goes back to the server. The axes and buttons are in overlay scenes, which are drawn in front of the geometry.
static const char *kAxisFont = "LiberationSerif-Regular";
void pa_distortion(
float d)
{
for (auto mng : {gPaRPhi, gPaRhoZ}) {
if (!mng)
continue;
mng->GetProjection()->SetDistortion(
d);
mng->UpdateName();
mng->ProjectChildren();
}
for (auto ax : {gPaAxisRPhi, gPaAxisRhoZ}) {
if (!ax)
continue;
ax->UpdateTicks();
ax->UpdateDistortionLabel();
}
}
{
b->SetShape(
new TGeoTube(kR_min, kR_max, kZ_d));
b->SetMainTransparency(60);
for (int i = 0; i < 4; ++i) {
jet->SetCylinder(2 * kR_max, 2 * kZ_d);
jet->AddEllipticCone(
r.Uniform(-2.5, 2.5),
r.Uniform(0,
TMath::TwoPi()),
r.Uniform(0.05, 0.2),
jet->SetFillColor(
kPink - 8);
holder->AddElement(jet);
}
eveMng->GetEventScene()->AddElement(holder);
return holder;
}
{
auto scene = eveMng->SpawnNewScene(
Form(
"%s Scene",
name),
name);
mng->ImportElements(content, scene);
eveMng->GetWorld()->AddElement(mng);
auto ovl = eveMng->SpawnNewScene(
Form(
"%s Axis",
name),
name);
ovl->SetIsOverlay(true);
axis->SetFontSize(0.022);
axis->SetFont(kAxisFont);
ovl->AddElement(axis);
{
auto mkbtn = [&](
const char *label,
Float_t x,
const char *mir) {
b->SetTextAlign(REveText::kCenterH, REveText::kBottom);
if (mir)
b->SetClickAction(mir, mng);
};
mkbtn("<<<", 0.26f, "BumpDistortion(-1)");
auto val = mkbtn("0.0", 0.50f, nullptr);
mkbtn(">>>", 0.74f, "BumpDistortion(1)");
axis->SetDistortionLabel(val);
}
auto view = eveMng->SpawnNewViewer(
Form(
"%s View",
name),
"");
view->SetCameraType(REveViewer::kCameraOrthoXOY);
view->AddScene(scene);
view->AddScene(ovl);
}
void projection_axes()
{
auto eveMng = REveManager::Create();
eveMng->AllowMultipleRemoteConnections(false, false);
REveText::AssertSdfFont(kAxisFont, rf + kAxisFont + ".ttf");
auto content = makeSceneContent(eveMng);
makeProjectedView(eveMng, content, REveProjection::kPT_RPhi, "RPhi", gPaRPhi, gPaAxisRPhi);
makeProjectedView(eveMng, content, REveProjection::kPT_RhoZ, "RhoZ", gPaRhoZ, gPaAxisRhoZ);
eveMng->Show();
}
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Base class for REveUtil visualization elements, providing hierarchy management, rendering control and...
Wrapper for TGeoShape with absolute positioning and color attributes allowing display of extracted TG...
Draws a jet cone with leading particle is specified in (eta,phi) and cone radius is given.
RAII guard for locking Eve manager (ctor) and processing changes (dtor).
Central application manager for web-based REve.
Scales and tick labels for a projected view, the REve counterpart of TEveProjectionAxes.
Manager class for steering of projections and managing projected objects.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
static const TString & GetDataDir()
Get the data directory in the installation. Static utility function.
This is the base class for the ROOT Random number generators.
Namespace for ROOT features in testing.
constexpr Double_t TwoPi()