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){}
59 virtual void Setup(
const TGLBoundingBox & bbox)
override {}
60 virtual void PlaneSet(TGLPlaneSet_t & planeSet)
const override
62 TGLCamera& cam = m_rnrCtx->RefCamera();
66 f[0] = Intersection(cam.FrustumPlane(TGLCamera::kFar),
67 cam.FrustumPlane(TGLCamera::kBottom),
70 f[1] = Intersection(cam.FrustumPlane(TGLCamera::kFar),
71 cam.FrustumPlane(TGLCamera::kBottom),
74 f[2] = Intersection(cam.FrustumPlane(TGLCamera::kFar),
75 cam.FrustumPlane(TGLCamera::kTop),
78 f[3] = Intersection(cam.FrustumPlane(TGLCamera::kFar),
79 cam.FrustumPlane(TGLCamera::kTop),
82 TGLVector3
dd = cam.FrustumPlane(TGLCamera::kNear).Norm();
83 dd *= (cam.GetFarClip() -cam.GetNearClip() );
91 planeSet.push_back(TGLPlane(c, f[0], f[1]));
92 planeSet.push_back(TGLPlane(c, f[1], f[2]));
93 planeSet.push_back(TGLPlane(c, f[2], f[3]));
94 planeSet.push_back(TGLPlane(c, f[3], f[0]));
111 m_showMuonBarrel(this,
"Show Muon Barrel", 0
l, 0
l, 2
l ),
112 m_showMuonEndcap(this,
"Show Muon Endcap",
false ),
113 m_showPixelBarrel(this,
"Show Pixel Barrel",
false ),
114 m_showPixelEndcap(this,
"Show Pixel Endcap",
false),
115 m_showTrackerBarrel(this,
"Show Tracker Barrel",
false ),
116 m_showTrackerEndcap(this,
"Show Tracker Endcap",
false),
117 m_rnrStyle(this,
"Render Style", 0
l, 0
l, 2
l),
118 m_clipParam(this,
"View dependent Clip",
false),
119 m_selectable(this,
"Enable Tooltips",
false),
120 m_cameraType(this,
"Camera Type", 0
l, 0
l, 5
l),
124 viewerGL()->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
170 TGLClipPlane* c=
new TGLClipPlane();
171 c->Setup(TGLVector3(1e10,0,0), TGLVector3(-1,0,0));
195 viewerGL()->RefCamera(TGLViewer::ECameraType(x)).IncTimeStamp();
196 viewerGL()->SetCurrentCamera(TGLViewer::ECameraType(x));
205 geoScene()->GetGLScene()->SetStyle(x);
213 geoScene()->GetGLScene()->SetSelectable(x);
223 for (TEveElement::List_i it =gEve->GetScenes()->BeginChildren(); it != gEve->GetScenes()->EndChildren(); ++it )
225 if (strncmp((*it)->GetElementName(),
"TopGeoNodeScene", 15) == 0)
226 ((TEveScene*)(*it))->GetGLScene()->SetClip(x ? m_glClip : 0);
237 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->CurrentCamera()));
249 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->CurrentCamera()));
272 printf(
"ERROR!!!! FW3DViewBase::setCurrentDMTVertex \n");
302 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
volatile std::atomic< bool > shutdown_flag false
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