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"
24 #include "TEveScene.h"
25 #include "TGLLogicalShape.h"
35 class TGLClipsiLogical :
public TGLLogicalShape
38 virtual void DirectDraw(TGLRnrCtx & rnrCtx)
const{}
41 TGLClipsiLogical() : TGLLogicalShape() {}
42 virtual ~TGLClipsiLogical() {}
43 void Resize(Double_t ext){}
46 const float fgColor[4] = { 1.0, 0.6, 0.2, 0.5 };
48 class Clipsi :
public TGLClip
52 Clipsi(
const Clipsi&);
56 Clipsi(TGLRnrCtx* ctx):TGLClip(* new TGLClipsiLogical, TGLMatrix(), fgColor), m_rnrCtx(ctx){}
58 virtual void Setup(
const TGLBoundingBox & bbox) {}
59 virtual void PlaneSet(TGLPlaneSet_t & planeSet)
const
61 TGLCamera& cam = m_rnrCtx->RefCamera();
65 f[0] = Intersection(cam.FrustumPlane(TGLCamera::kFar),
66 cam.FrustumPlane(TGLCamera::kBottom),
69 f[1] = Intersection(cam.FrustumPlane(TGLCamera::kFar),
70 cam.FrustumPlane(TGLCamera::kBottom),
73 f[2] = Intersection(cam.FrustumPlane(TGLCamera::kFar),
74 cam.FrustumPlane(TGLCamera::kTop),
77 f[3] = Intersection(cam.FrustumPlane(TGLCamera::kFar),
78 cam.FrustumPlane(TGLCamera::kTop),
81 TGLVector3
dd = cam.FrustumPlane(TGLCamera::kNear).Norm();
82 dd *= (cam.GetFarClip() -cam.GetNearClip() );
90 planeSet.push_back(TGLPlane(c, f[0], f[1]));
91 planeSet.push_back(TGLPlane(c, f[1], f[2]));
92 planeSet.push_back(TGLPlane(c, f[2], f[3]));
93 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)
122 viewerGL()->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
158 TGLClipPlane* c=
new TGLClipPlane();
159 c->Setup(TGLVector3(1e10,0,0), TGLVector3(-1,0,0));
175 geoScene()->GetGLScene()->SetStyle(x);
183 geoScene()->GetGLScene()->SetSelectable(x);
193 for (TEveElement::List_i it =gEve->GetScenes()->BeginChildren(); it != gEve->GetScenes()->EndChildren(); ++it )
195 if (strncmp((*it)->GetElementName(),
"TopGeoNodeScene", 15) == 0)
196 ((TEveScene*)(*it))->GetGLScene()->SetClip(x ? m_glClip : 0);
207 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->CurrentCamera()));
219 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->CurrentCamera()));
226 std::string tName(
"Detector Transparency");
255 Form(
"TEveGedEditor::SpawnNewEditor((TGLViewer*)0x%lx)", (
unsigned long)
viewerGL())));
nocap nocap const skelname & operator=(const skelname &)
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
FWBoolParameter m_showTrackerBarrel
TGLViewer * viewerGL() const
sigc::signal< void, T > changed_
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)
TGCompositeFrame * getTabContainer()
void showPixelEndcap(bool)
FWEnumParameter m_showMuonBarrel
FW3DViewGeometry * m_geometry
const FWConfiguration * valueForKey(const std::string &iKey) const
FWBoolParameter m_selectable
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