13 #include <boost/bind.hpp>
18 #include "TGLScenePad.h"
19 #include "TGLViewer.h"
21 #include "TGLPerspectiveCamera.h"
22 #include "TEveManager.h"
23 #include "TEveElement.h"
25 #include "TEveScene.h"
26 #include "TGLLogicalShape.h"
37 class TGLClipsiLogical :
public TGLLogicalShape
40 virtual void DirectDraw(TGLRnrCtx & rnrCtx)
const{}
43 TGLClipsiLogical() : TGLLogicalShape() {}
44 virtual ~TGLClipsiLogical() {}
45 void Resize(Double_t ext){}
48 const float fgColor[4] = { 1.0, 0.6, 0.2, 0.5 };
50 class Clipsi :
public TGLClip
54 Clipsi(
const Clipsi&);
55 Clipsi& operator=(
const Clipsi&);
58 Clipsi(TGLRnrCtx* ctx):TGLClip(* new TGLClipsiLogical, TGLMatrix(), fgColor), m_rnrCtx(ctx){}
60 virtual void Setup(
const TGLBoundingBox & bbox) {}
61 virtual void PlaneSet(TGLPlaneSet_t & planeSet)
const
63 TGLCamera& cam = m_rnrCtx->RefCamera();
67 f[0] = Intersection(cam.FrustumPlane(TGLCamera::kFar),
68 cam.FrustumPlane(TGLCamera::kBottom),
71 f[1] = Intersection(cam.FrustumPlane(TGLCamera::kFar),
72 cam.FrustumPlane(TGLCamera::kBottom),
75 f[2] = Intersection(cam.FrustumPlane(TGLCamera::kFar),
76 cam.FrustumPlane(TGLCamera::kTop),
79 f[3] = Intersection(cam.FrustumPlane(TGLCamera::kFar),
80 cam.FrustumPlane(TGLCamera::kTop),
83 TGLVector3
dd = cam.FrustumPlane(TGLCamera::kNear).Norm();
84 dd *= (cam.GetFarClip() -cam.GetNearClip() );
92 planeSet.push_back(TGLPlane(c, f[0], f[1]));
93 planeSet.push_back(TGLPlane(c, f[1], f[2]));
94 planeSet.push_back(TGLPlane(c, f[2], f[3]));
95 planeSet.push_back(TGLPlane(c, f[3], f[0]));
112 m_showMuonBarrel(this,
"Show Muon Barrel", 0
l, 0
l, 2
l ),
113 m_showMuonEndcap(this,
"Show Muon Endcap",
false ),
114 m_showPixelBarrel(this,
"Show Pixel Barrel",
false ),
115 m_showPixelEndcap(this,
"Show Pixel Endcap",
false),
116 m_showTrackerBarrel(this,
"Show Tracker Barrel",
false ),
117 m_showTrackerEndcap(this,
"Show Tracker Endcap",
false),
118 m_rnrStyle(this,
"Render Style", 0
l, 0
l, 2
l),
119 m_clipParam(this,
"View dependent Clip",
false),
120 m_selectable(this,
"Enable Tooltips",
false),
121 m_cameraType(this,
"Camera Type", 0
l, 0
l, 5
l),
125 viewerGL()->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
171 TGLClipPlane* c=
new TGLClipPlane();
172 c->Setup(TGLVector3(1e10,0,0), TGLVector3(-1,0,0));
196 viewerGL()->RefCamera(TGLViewer::ECameraType(x)).IncTimeStamp();
197 viewerGL()->SetCurrentCamera(TGLViewer::ECameraType(x));
206 geoScene()->GetGLScene()->SetStyle(x);
214 geoScene()->GetGLScene()->SetSelectable(x);
224 for (TEveElement::List_i it =gEve->GetScenes()->BeginChildren(); it != gEve->GetScenes()->EndChildren(); ++it )
226 if (strncmp((*it)->GetElementName(),
"TopGeoNodeScene", 15) == 0)
227 ((TEveScene*)(*it))->GetGLScene()->SetClip(x ? m_glClip : 0);
238 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->CurrentCamera()));
250 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->CurrentCamera()));
273 printf(
"ERROR!!!! FW3DViewBase::setCurrentDMTVertex \n");
303 Form(
"TEveGedEditor::SpawnNewEditor((TGLViewer*)0x%lx)", (
unsigned long)
viewerGL())));
virtual bool requestGLHandlerPick() const
void showMuonBarrel(long)
virtual void setFrom(const FWConfiguration &)
FWBoolParameter m_showMuonEndcap
void showMuonBarrel(bool)
virtual void populateController(ViewerParameterGUI &) const
FWBoolParameter m_clipParam
FWColorManager * colorManager() const
ViewerParameterGUI & requestTab(const char *)
void showTrackerEndcap(bool)
virtual void setFrom(const FWConfiguration &)
ViewerParameterGUI & separator()
unsigned int version() const
void setCurrentDMTVertex(double x, double y, double z)
FWBoolParameter m_showTrackerBarrel
TGLViewer * viewerGL() const
sigc::signal< void, T > changed_
FW3DViewDistanceMeasureTool * m_DMT
void showMuonBarrelFull(bool)
void showTrackerBarrel(bool)
void setGeomTransparency(Color_t idx, bool projectedType)
U second(std::pair< T, U > const &p)
virtual void addTo(FWConfiguration &) const
virtual void populateController(ViewerParameterGUI &) const
void showMuonEndcap(bool)
FWEnumParameter m_rnrStyle
FWBoolParameter m_showPixelEndcap
bool addEntry(Long_t id, const std::string &txt)
virtual void setContext(const fireworks::Context &)
const std::string & value(unsigned int iIndex=0) const
const fireworks::Context & context()
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
void showPixelBarrel(bool)
ViewerParameterGUI & addParam(const FWParameterBase *)
TGCompositeFrame * getTabContainer()
void showPixelEndcap(bool)
FWEnumParameter m_showMuonBarrel
FW3DViewGeometry * m_geometry
const FWConfiguration * valueForKey(const std::string &iKey) const
FWBoolParameter m_selectable
FWEnumParameter m_cameraType
FW3DViewBase(TEveWindowSlot *, FWViewType::EType)
virtual void addTo(FWConfiguration &) const
virtual void setContext(const fireworks::Context &x)
FWBoolParameter m_showTrackerEndcap
FWBoolParameter m_showPixelBarrel
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const