15 #include "TGLPerspectiveCamera.h" 16 #include "TGLViewer.h" 17 #include "TGLScenePad.h" 18 #include "TEveScene.h" 19 #include "TEveViewer.h" 21 #include "TEveManager.h" 22 #include "TEveElement.h" 25 #include "TGLFontManager.h" 27 #include "TEveTrans.h" 29 #include "TEveGeoNode.h" 30 #include "TEveGeoShape.h" 31 #include "TEveStraightLineSet.h" 52 m_showAxes(this,
"Show Axes",
true),
53 m_showCylinder(this,
"Show Cylinder",
true) {
57 TEveScene* wns = gEve->SpawnNewScene(Form(
"Wireframe Scene %s",
typeName().c_str()));
59 TGLScene* gls = wns->GetGLScene();
60 gls->SetStyle(TGLRnrCtx::kWireFrame);
61 gls->SetLOD(TGLRnrCtx::kLODMed);
62 gls->SetSelectable(kFALSE);
64 TEveGeoManagerHolder gmgr(TEveGeoShape::GetGeoMangeur());
65 TGeoTube* tube =
new TGeoTube(129, 130, 310);
72 ev->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
85 TEveElementList* axisHolder =
new TEveElementList(
"GlimpseAxisHolder");
87 TGLFont::EMode fontMode = TGLFont::kPixmap;
89 Color_t fcol = kGray + 1;
92 TEveStraightLineSet*
xAxis =
new TEveStraightLineSet(
"GlimpseXAxis");
93 xAxis->SetPickable(kTRUE);
94 xAxis->SetTitle(
"Energy Scale, 100 GeV, X-axis (LHC center)");
95 xAxis->SetLineStyle(3);
96 xAxis->SetLineColor(fcol);
97 xAxis->AddLine(-100, 0, 0, 100, 0, 0);
98 axisHolder->AddElement(
xAxis);
100 TEveText* xTxt =
new TEveText(
"X+");
101 xTxt->PtrMainTrans()->SetPos(100 -
fs, -
fs, 0);
102 xTxt->SetFontMode(fontMode);
103 xTxt->SetMainColor(fcol);
104 axisHolder->AddElement(xTxt);
107 TEveStraightLineSet*
yAxis =
new TEveStraightLineSet(
"GlimpseYAxis");
108 yAxis->SetPickable(kTRUE);
109 yAxis->SetTitle(
"Energy Scale, 100 GeV, Y-axis (upward)");
110 yAxis->SetLineColor(fcol);
111 yAxis->SetLineStyle(3);
112 yAxis->AddLine(0, -100, 0, 0, 100, 0);
113 axisHolder->AddElement(
yAxis);
115 TEveText* yTxt =
new TEveText(
"Y+");
116 yTxt->PtrMainTrans()->SetPos(0, 100 -
fs, 0);
117 yTxt->SetFontMode(fontMode);
118 yTxt->SetMainColor(fcol);
119 axisHolder->AddElement(yTxt);
122 TEveStraightLineSet*
zAxis =
new TEveStraightLineSet(
"GlimpseZAxis");
123 zAxis->SetPickable(kTRUE);
124 zAxis->SetTitle(
"Energy Scale, 100 GeV, Z-axis (west, along beam)");
125 zAxis->SetLineColor(fcol);
126 zAxis->AddLine(0, 0, -100, 0, 0, 100);
127 axisHolder->AddElement(
zAxis);
129 TEveText* zTxt =
new TEveText(
"Z+");
130 zTxt->PtrMainTrans()->SetPos(0, -
fs, 100 - zTxt->GetExtrude() * 2);
131 zTxt->SetFontMode(fontMode);
132 zTxt->SetMainColor(fcol);
133 axisHolder->AddElement(zTxt);
140 viewerGL()->SetGuideState(TGLUtil::kAxesOrigin, kTRUE, kFALSE,
nullptr);
142 viewerGL()->SetGuideState(TGLUtil::kAxesNone, kTRUE, kFALSE,
nullptr);
156 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->CurrentCamera()));
163 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->CurrentCamera()));
void setFrom(const FWConfiguration &) override
TEveGeoShape * m_cylinder
FWGlimpseView(TEveWindowSlot *, FWViewType::EType)
void addTo(FWConfiguration &) const override
void setFrom(const FWConfiguration &) override
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
FWBoolParameter m_showCylinder
sigc::signal< void(T)> changed_
TEveGeoShape * getShape(const char *name, TGeoBBox *shape, Color_t color)
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
void addTo(FWConfiguration &) const override
TGLViewer * viewerGL() const
const std::string & typeName() const
~FWGlimpseView() override
FWBoolParameter m_showAxes