13 #include <boost/bind.hpp>
16 #include "TGLPerspectiveCamera.h"
17 #include "TGLViewer.h"
18 #include "TGLScenePad.h"
19 #include "TEveScene.h"
20 #include "TEveViewer.h"
22 #include "TEveManager.h"
23 #include "TEveElement.h"
26 #include "TGLFontManager.h"
28 #include "TEveTrans.h"
30 #include "TEveGeoNode.h"
31 #include "TEveStraightLineSet.h"
52 m_showAxes(this,
"Show Axes",
true ),
53 m_showCylinder(this,
"Show Cylinder",
true)
58 TEveScene* wns = gEve->SpawnNewScene(Form(
"Wireframe Scene %s",
typeName().c_str()));
60 TGLScene* gls = wns->GetGLScene();
61 gls->SetStyle(TGLRnrCtx::kWireFrame);
62 gls->SetLOD(TGLRnrCtx::kLODMed);
63 gls->SetSelectable(kFALSE);
65 TEveGeoManagerHolder gmgr(TEveGeoShape::GetGeoMangeur());
66 TGeoTube* tube =
new TGeoTube(129,130,310);
73 ev->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
91 TEveElementList* axisHolder =
new TEveElementList(
"GlimpseAxisHolder");
93 TGLFont::EMode fontMode = TGLFont::kPixmap;
95 Color_t fcol = kGray+1;
98 TEveStraightLineSet* xAxis =
new TEveStraightLineSet(
"GlimpseXAxis" );
99 xAxis->SetPickable(kTRUE);
100 xAxis->SetTitle(
"Energy Scale, 100 GeV, X-axis (LHC center)");
101 xAxis->SetLineStyle(3);
102 xAxis->SetLineColor(fcol);
103 xAxis->AddLine(-100,0,0,100,0,0);
104 axisHolder->AddElement(xAxis);
106 TEveText* xTxt =
new TEveText(
"X+" );
107 xTxt->PtrMainTrans()->SetPos(100-fs, -fs, 0);
108 xTxt->SetFontMode(fontMode);
109 xTxt->SetMainColor(fcol);
110 axisHolder->AddElement(xTxt);
113 TEveStraightLineSet* yAxis =
new TEveStraightLineSet(
"GlimpseYAxis" );
114 yAxis->SetPickable(kTRUE);
115 yAxis->SetTitle(
"Energy Scale, 100 GeV, Y-axis (upward)");
116 yAxis->SetLineColor(fcol);
117 yAxis->SetLineStyle(3);
118 yAxis->AddLine(0,-100,0,0,100,0);
119 axisHolder->AddElement(yAxis);
121 TEveText* yTxt =
new TEveText(
"Y+" );
122 yTxt->PtrMainTrans()->SetPos(0, 100-fs, 0);
123 yTxt->SetFontMode(fontMode);
124 yTxt->SetMainColor(fcol);
125 axisHolder->AddElement(yTxt);
128 TEveStraightLineSet*
zAxis =
new TEveStraightLineSet(
"GlimpseZAxis" );
129 zAxis->SetPickable(kTRUE);
130 zAxis->SetTitle(
"Energy Scale, 100 GeV, Z-axis (west, along beam)");
131 zAxis->SetLineColor(fcol);
132 zAxis->AddLine(0,0,-100,0,0,100);
133 axisHolder->AddElement(zAxis);
135 TEveText* zTxt =
new TEveText(
"Z+" );
136 zTxt->PtrMainTrans()->SetPos(0, -fs, 100 - zTxt->GetExtrude()*2);
137 zTxt->SetFontMode(fontMode);
138 zTxt->SetMainColor(fcol);
139 axisHolder->AddElement(zTxt);
149 viewerGL()->SetGuideState(TGLUtil::kAxesOrigin, kTRUE, kFALSE, 0);
151 viewerGL()->SetGuideState(TGLUtil::kAxesNone, kTRUE, kFALSE, 0);
171 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->CurrentCamera()));
180 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
FWBoolParameter m_showAxes
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const