12 #include <boost/bind.hpp>
17 #include "TGLScenePad.h"
18 #include "TGLViewer.h"
20 #include "TGLPerspectiveCamera.h"
21 #include "TEveManager.h"
22 #include "TEveElement.h"
24 #include "TEveScene.h"
25 #include "TGLLogicalShape.h"
36 class TGLClipsiLogical :
public TGLLogicalShape
39 virtual void DirectDraw(TGLRnrCtx & rnrCtx)
const override{}
42 TGLClipsiLogical() : TGLLogicalShape() {}
43 virtual ~TGLClipsiLogical() {}
44 void Resize(Double_t ext){}
47 const float fgColor[4] = { 1.0, 0.6, 0.2, 0.5 };
49 class Clipsi :
public TGLClip
53 Clipsi(
const Clipsi&);
54 Clipsi& operator=(
const Clipsi&);
57 Clipsi(TGLRnrCtx* ctx):TGLClip(* new TGLClipsiLogical, TGLMatrix(), fgColor), m_rnrCtx(ctx){}
60 virtual void Setup(
const TGLBoundingBox & bbox)
override {}
62 using TGLClip::PlaneSet;
63 virtual void PlaneSet(TGLPlaneSet_t & planeSet)
const override
65 TGLCamera& cam = m_rnrCtx->RefCamera();
69 f[0] = Intersection(cam.FrustumPlane(TGLCamera::kFar),
70 cam.FrustumPlane(TGLCamera::kBottom),
71 cam.FrustumPlane(TGLCamera::kLeft)).
second;
73 f[1] = Intersection(cam.FrustumPlane(TGLCamera::kFar),
74 cam.FrustumPlane(TGLCamera::kBottom),
75 cam.FrustumPlane(TGLCamera::kRight)).
second;
77 f[2] = Intersection(cam.FrustumPlane(TGLCamera::kFar),
78 cam.FrustumPlane(TGLCamera::kTop),
79 cam.FrustumPlane(TGLCamera::kRight)).
second;
81 f[3] = Intersection(cam.FrustumPlane(TGLCamera::kFar),
82 cam.FrustumPlane(TGLCamera::kTop),
83 cam.FrustumPlane(TGLCamera::kLeft)).
second;
85 TGLVector3
dd = cam.FrustumPlane(TGLCamera::kNear).Norm();
86 dd *= (cam.GetFarClip() -cam.GetNearClip() );
94 planeSet.push_back(TGLPlane(c, f[0], f[1]));
95 planeSet.push_back(TGLPlane(c, f[1], f[2]));
96 planeSet.push_back(TGLPlane(c, f[2], f[3]));
97 planeSet.push_back(TGLPlane(c, f[3], f[0]));
114 m_showMuonBarrel(this,
"Show Muon Barrel", 0
l, 0
l, 2
l ),
115 m_showMuonEndcap(this,
"Show Muon Endcap",
false ),
116 m_showPixelBarrel(this,
"Show Pixel Barrel",
false ),
117 m_showPixelEndcap(this,
"Show Pixel Endcap",
false),
118 m_showTrackerBarrel(this,
"Show Tracker Barrel",
false ),
119 m_showTrackerEndcap(this,
"Show Tracker Endcap",
false),
120 m_rnrStyle(this,
"Render Style", 0
l, 0
l, 2
l),
121 m_clipParam(this,
"View dependent Clip",
false),
122 m_selectable(this,
"Enable Tooltips",
false),
123 m_cameraType(this,
"Camera Type", 0
l, 0
l, 5
l),
127 viewerGL()->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
173 TGLClipPlane* c=
new TGLClipPlane();
174 c->Setup(TGLVector3(1e10,0,0), TGLVector3(-1,0,0));
198 viewerGL()->RefCamera(TGLViewer::ECameraType(x)).IncTimeStamp();
199 viewerGL()->SetCurrentCamera(TGLViewer::ECameraType(x));
208 geoScene()->GetGLScene()->SetStyle(x);
216 geoScene()->GetGLScene()->SetSelectable(x);
226 for (TEveElement::List_i it =gEve->GetScenes()->BeginChildren(); it != gEve->GetScenes()->EndChildren(); ++it )
228 if (strncmp((*it)->GetElementName(),
"TopGeoNodeScene", 15) == 0)
229 ((TEveScene*)(*it))->GetGLScene()->SetClip(x ? m_glClip : 0);
240 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->CurrentCamera()));
252 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->CurrentCamera()));
275 printf(
"ERROR!!!! FW3DViewBase::setCurrentDMTVertex \n");
305 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
FW3DViewBase(TEveWindowSlot *, FWViewType::EType, unsigned int version=8)
FW3DViewGeometry * m_geometry
const FWConfiguration * valueForKey(const std::string &iKey) const
volatile std::atomic< bool > shutdown_flag false
FWBoolParameter m_selectable
FWEnumParameter m_cameraType
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