14 #include <boost/bind.hpp>
17 #include "TGLPerspectiveCamera.h"
18 #include "TGLViewer.h"
19 #include "TGLScenePad.h"
20 #include "TEveScene.h"
21 #include "TEveViewer.h"
23 #include "TEveManager.h"
24 #include "TEveElement.h"
27 #include "TGLFontManager.h"
29 #include "TEveTrans.h"
31 #include "TEveGeoNode.h"
32 #include "TEveStraightLineSet.h"
53 m_showAxes(this,
"Show Axes",
true ),
54 m_showCylinder(this,
"Show Cylinder",
true)
59 TEveScene* wns = gEve->SpawnNewScene(Form(
"Wireframe Scene %s",
typeName().c_str()));
61 TGLScene* gls = wns->GetGLScene();
62 gls->SetStyle(TGLRnrCtx::kWireFrame);
63 gls->SetLOD(TGLRnrCtx::kLODMed);
64 gls->SetSelectable(kFALSE);
66 TEveGeoManagerHolder gmgr(TEveGeoShape::GetGeoMangeur());
67 TGeoTube* tube =
new TGeoTube(129,130,310);
74 ev->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
92 TEveElementList* axisHolder =
new TEveElementList(
"GlimpseAxisHolder");
94 TGLFont::EMode fontMode = TGLFont::kPixmap;
96 Color_t fcol = kGray+1;
99 TEveStraightLineSet* xAxis =
new TEveStraightLineSet(
"GlimpseXAxis" );
100 xAxis->SetPickable(kTRUE);
101 xAxis->SetTitle(
"Energy Scale, 100 GeV, X-axis (LHC center)");
102 xAxis->SetLineStyle(3);
103 xAxis->SetLineColor(fcol);
104 xAxis->AddLine(-100,0,0,100,0,0);
105 axisHolder->AddElement(xAxis);
107 TEveText* xTxt =
new TEveText(
"X+" );
108 xTxt->PtrMainTrans()->SetPos(100-fs, -fs, 0);
109 xTxt->SetFontMode(fontMode);
110 xTxt->SetMainColor(fcol);
111 axisHolder->AddElement(xTxt);
114 TEveStraightLineSet* yAxis =
new TEveStraightLineSet(
"GlimpseYAxis" );
115 yAxis->SetPickable(kTRUE);
116 yAxis->SetTitle(
"Energy Scale, 100 GeV, Y-axis (upward)");
117 yAxis->SetLineColor(fcol);
118 yAxis->SetLineStyle(3);
119 yAxis->AddLine(0,-100,0,0,100,0);
120 axisHolder->AddElement(yAxis);
122 TEveText* yTxt =
new TEveText(
"Y+" );
123 yTxt->PtrMainTrans()->SetPos(0, 100-fs, 0);
124 yTxt->SetFontMode(fontMode);
125 yTxt->SetMainColor(fcol);
126 axisHolder->AddElement(yTxt);
129 TEveStraightLineSet* zAxis =
new TEveStraightLineSet(
"GlimpseZAxis" );
130 zAxis->SetPickable(kTRUE);
131 zAxis->SetTitle(
"Energy Scale, 100 GeV, Z-axis (west, along beam)");
132 zAxis->SetLineColor(fcol);
133 zAxis->AddLine(0,0,-100,0,0,100);
134 axisHolder->AddElement(zAxis);
136 TEveText* zTxt =
new TEveText(
"Z+" );
137 zTxt->PtrMainTrans()->SetPos(0, -fs, 100 - zTxt->GetExtrude()*2);
138 zTxt->SetFontMode(fontMode);
139 zTxt->SetMainColor(fcol);
140 axisHolder->AddElement(zTxt);
150 viewerGL()->SetGuideState(TGLUtil::kAxesOrigin, kTRUE, kFALSE, 0);
152 viewerGL()->SetGuideState(TGLUtil::kAxesNone, kTRUE, kFALSE, 0);
172 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->CurrentCamera()));
181 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->CurrentCamera()));
virtual void addTo(FWConfiguration &) const
virtual void setFrom(const FWConfiguration &)
const std::string & typeName() const
TGLViewer * viewerGL() const
sigc::signal< void, T > changed_
virtual void setFrom(const FWConfiguration &)
TEveGeoShape * m_cylinder
FWGlimpseView(TEveWindowSlot *, FWViewType::EType)
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
FWBoolParameter m_showCylinder
TEveGeoShape * getShape(const char *name, TGeoBBox *shape, Color_t color)
virtual void addTo(FWConfiguration &) const
FWViewType::EType typeId() const
FWBoolParameter m_showAxes
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const