CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FW3DViewBase Class Reference

#include <Fireworks/Core/interface/FW3DViewBase.h>

Inheritance diagram for FW3DViewBase:
FWEveView FWViewBase FWConfigurableParameterizable FWParameterizable FWConfigurable FW3DView FWISpyView

Public Member Functions

void addTo (FWConfiguration &) const override
 
 FW3DViewBase (TEveWindowSlot *, FWViewType::EType, unsigned int version=8)
 
FW3DViewDistanceMeasureToolgetDMT ()
 
void populateController (ViewerParameterGUI &) const override
 
bool requestGLHandlerPick () const override
 
void setClip (float eta, float phi)
 
void setContext (const fireworks::Context &) override
 
void setCurrentDMTVertex (double x, double y, double z)
 
void setFrom (const FWConfiguration &) override
 
void showEcalBarrel (bool)
 
void updateGlobalSceneScaleParameters ()
 
 ~FW3DViewBase () override
 
- Public Member Functions inherited from FWEveView
void addTo (FWConfiguration &) const override
 
const fireworks::Contextcontext ()
 
FWViewContextMenuHandlerBasecontextMenuHandler () const override
 
virtual void eventBegin ()
 
virtual void eventEnd ()
 
TEveScene * eventScene ()
 
 FWEveView (TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
 
FWTEveViewerfwViewer ()
 
FWTGLViewerfwViewerGL () const
 
TEveScene * geoScene ()
 
virtual bool isEnergyScaleGlobal () const
 
TEveElement * ownedProducts ()
 
void populateController (ViewerParameterGUI &) const override
 
void saveImageTo (const std::string &iName) const override
 
virtual void setBackgroundColor (Color_t)
 
void setFrom (const FWConfiguration &) override
 
virtual void setupEnergyScale ()
 
virtual void setupEventCenter ()
 
virtual void useGlobalEnergyScaleChanged ()
 
FWViewContextviewContext ()
 
TEveViewer * viewer ()
 
TGLViewer * viewerGL () const
 
virtual void voteCaloMaxVal ()
 
 ~FWEveView () override
 
- Public Member Functions inherited from FWViewBase
void destroy ()
 
 FWViewBase (FWViewType::EType, unsigned int iVersion=1)
 
void promptForSaveImageTo (TGFrame *) const
 
FWViewType::EType typeId () const
 
const std::string & typeName () const
 
- Public Member Functions inherited from FWConfigurableParameterizable
 FWConfigurableParameterizable (unsigned int iVersion=1)
 
unsigned int version () const
 
 ~FWConfigurableParameterizable () override
 
- Public Member Functions inherited from FWParameterizable
void add (FWParameterBase *)
 
const_iterator begin () const
 
const_iterator end () const
 
 FWParameterizable ()
 
virtual ~FWParameterizable ()
 
- Public Member Functions inherited from FWConfigurable
 FWConfigurable ()
 
virtual ~FWConfigurable ()
 

Private Member Functions

void enableSceneClip (bool)
 
 FW3DViewBase (const FW3DViewBase &)
 
const FW3DViewBaseoperator= (const FW3DViewBase &)
 
void rnrStyle (long)
 
void selectable (bool)
 
void setCameraType (long)
 
void showMuonBarrel (long)
 
void updateClipPlanes (bool resetCamera)
 

Private Attributes

FWEnumParameter m_cameraType
 
FWLongParameter m_clipAppexOffset
 
FWDoubleParameter m_clipDelta1
 
FWDoubleParameter m_clipDelta2
 
FWBoolParameter m_clipEnable
 
FWDoubleParameter m_clipPhi
 
FWDoubleParameter m_clipTheta
 
FW3DViewDistanceMeasureToolm_DMT
 
TEveLine * m_DMTline
 
TEveBoxSet * m_ecalBarrel
 
FW3DViewGeometrym_geometry
 
TGLClip * m_glClip
 
FWEnumParameter m_rnrStyle
 
FWBoolParameter m_selectable
 
FWBoolParameter m_showEcalBarrel
 
FWEnumParameter m_showMuonBarrel
 
FWBoolParameter m_showMuonEndcap
 
FWBoolParameter m_showPixelBarrel
 
FWBoolParameter m_showPixelEndcap
 
FWBoolParameter m_showTrackerBarrel
 
FWBoolParameter m_showTrackerEndcap
 

Additional Inherited Members

- Public Types inherited from FWParameterizable
typedef std::vector< FWParameterBase * >::const_iterator const_iterator
 
- Public Attributes inherited from FWViewBase
sigc::signal< void, const FWViewBase * > beingDestroyed_
 
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
 
- Protected Member Functions inherited from FWEveView
void addToOrthoCamera (TGLOrthoCamera *, FWConfiguration &) const
 
void addToPerspectiveCamera (TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
 
virtual void cameraGuideChanged ()
 
virtual TEveCaloViz * getEveCalo () const
 
virtual void pointLineScalesChanged ()
 
virtual void resetCamera ()
 
void setFromOrthoCamera (TGLOrthoCamera *, const FWConfiguration &)
 
void setFromPerspectiveCamera (TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
 
- Protected Member Functions inherited from FWViewBase
 ~FWViewBase () override
 
- Protected Attributes inherited from FWEveView
const fireworks::Contextm_context
 
- Protected Attributes inherited from FWViewBase
FWViewType m_type
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 42 of file FW3DViewBase.h.

Constructor & Destructor Documentation

FW3DViewBase::FW3DViewBase ( TEveWindowSlot *  iParent,
FWViewType::EType  typeId,
unsigned int  version = 8 
)

Definition at line 105 of file FW3DViewBase.cc.

References FWEnumParameter::addEntry(), FWGenericParameter< T >::changed_, enableSceneClip(), FWEveView::geoScene(), m_cameraType, m_clipAppexOffset, m_clipDelta1, m_clipDelta2, m_clipEnable, m_clipPhi, m_clipTheta, m_DMT, m_ecalBarrel, m_rnrStyle, m_selectable, m_showMuonBarrel, rnrStyle(), selectable(), setCameraType(), showMuonBarrel(), updateClipPlanes(), and FWEveView::viewerGL().

Referenced by getDMT().

105  :
106  FWEveView(iParent, typeId, version ),
107  m_geometry(nullptr),
108  m_glClip(nullptr),
109  m_showMuonBarrel(this, "Show Muon Barrel", 0l, 0l, 2l ),
110  m_showMuonEndcap(this, "Show Muon Endcap", false ),
111  m_showPixelBarrel(this, "Show Pixel Barrel", false ),
112  m_showPixelEndcap(this, "Show Pixel Endcap", false),
113  m_showTrackerBarrel(this, "Show Tracker Barrel", false ),
114  m_showTrackerEndcap(this, "Show Tracker Endcap", false),
115  m_ecalBarrel(nullptr),
116  m_showEcalBarrel(this, "Show Ecal Barrel", false),
117  m_rnrStyle(this, "Render Style", 0l, 0l, 2l),
118  m_selectable(this, "Enable Tooltips", false),
119  m_cameraType(this, "Camera Type", 0l, 0l, 5l),
120  m_clipEnable(this, "Enable Clip", false),
121  m_clipTheta(this, "Clip Theta", 0.0, -5.0, 5.0),
122  m_clipPhi(this, "Clip Phi", 0.0, -2.0, 2.0),
123  m_clipDelta1(this, "Clip Delta1", 0.2, 0.01, 2),
124  m_clipDelta2(this, "Clip Delta2", 0.2, 0.01, 2),
125  m_clipAppexOffset(this, "Appex Offset", 10l, 0l, 50l),
126  m_DMT(nullptr),
127  m_DMTline(nullptr)
128 {
129  viewerGL()->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
131 
132  m_showMuonBarrel.addEntry(0, "Hide");
133  m_showMuonBarrel.addEntry(1, "Simplified");
134  m_showMuonBarrel.addEntry(2, "Full");
135  m_showMuonBarrel.changed_.connect(boost::bind(&FW3DViewBase::showMuonBarrel,this,_1));
136 
137  m_rnrStyle.addEntry(TGLRnrCtx::kFill, "Fill");
138  m_rnrStyle.addEntry(TGLRnrCtx::kOutline, "Outline");
139  m_rnrStyle.addEntry(TGLRnrCtx::kWireFrame, "WireFrame");
140  m_rnrStyle.changed_.connect(boost::bind(&FW3DViewBase::rnrStyle,this, _1));
141 
142  m_selectable.changed_.connect(boost::bind(&FW3DViewBase::selectable,this, _1));
143 
144 
145  m_cameraType.addEntry(TGLViewer::kCameraPerspXOZ,"PerspXOZ" );
146  m_cameraType.addEntry(TGLViewer::kCameraOrthoXOY,"OrthoXOY");
147  m_cameraType.addEntry(TGLViewer::kCameraOrthoXOZ,"OrthoXOZ");
148  m_cameraType.addEntry(TGLViewer::kCameraOrthoZOY,"OrthoZOY" );
149  m_cameraType.addEntry(TGLViewer::kCameraOrthoXnOY,"OrthoXnOY");
150  m_cameraType.addEntry(TGLViewer::kCameraOrthoXnOZ,"OrthoXnOZ");
151  m_cameraType.addEntry(TGLViewer::kCameraOrthoZnOY,"OrthoZnOY" );
152  m_cameraType.changed_.connect(boost::bind(&FW3DViewBase::setCameraType,this, _1));
153 
154  m_clipEnable.changed_.connect(boost::bind(&FW3DViewBase::enableSceneClip,this, _1));
155  m_clipTheta.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this, false));
156  m_clipPhi.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this, false));
157  m_clipDelta1.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this, false));
158  m_clipDelta2.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this, false));
159  m_clipAppexOffset.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this, false));
160 
161 
162  m_ecalBarrel = new TEveBoxSet("ecalBarrel");
163  m_ecalBarrel->UseSingleColor();
164  m_ecalBarrel->SetMainColor(kAzure+10);
165  m_ecalBarrel->SetMainTransparency(98);
166  geoScene()->AddElement(m_ecalBarrel);
167 }
FWDoubleParameter m_clipTheta
Definition: FW3DViewBase.h:96
void showMuonBarrel(long)
void rnrStyle(long)
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:81
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:84
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
sigc::signal< void, T > changed_
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:103
void selectable(bool)
void setCameraType(long)
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:97
void enableSceneClip(bool)
FWEnumParameter m_rnrStyle
Definition: FW3DViewBase.h:90
void updateClipPlanes(bool resetCamera)
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:95
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:83
FWDoubleParameter m_clipDelta1
Definition: FW3DViewBase.h:98
bool addEntry(Long_t id, const std::string &txt)
FWBoolParameter m_showEcalBarrel
Definition: FW3DViewBase.h:88
TEveScene * geoScene()
Definition: FWEveView.h:83
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
Definition: FWEveView.cc:77
TGLClip * m_glClip
Definition: FW3DViewBase.h:77
TEveLine * m_DMTline
Definition: FW3DViewBase.h:104
TEveBoxSet * m_ecalBarrel
Definition: FW3DViewBase.h:87
FWEnumParameter m_showMuonBarrel
Definition: FW3DViewBase.h:80
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:76
FWBoolParameter m_selectable
Definition: FW3DViewBase.h:91
FWEnumParameter m_cameraType
Definition: FW3DViewBase.h:93
FWLongParameter m_clipAppexOffset
Definition: FW3DViewBase.h:100
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:85
FWDoubleParameter m_clipDelta2
Definition: FW3DViewBase.h:99
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:82
FWViewType::EType typeId() const
Definition: FWViewBase.h:43
FW3DViewBase::~FW3DViewBase ( )
override

Definition at line 169 of file FW3DViewBase.cc.

References m_glClip.

170 {
171  delete m_glClip;
172 }
TGLClip * m_glClip
Definition: FW3DViewBase.h:77
FW3DViewBase::FW3DViewBase ( const FW3DViewBase )
private

Member Function Documentation

void FW3DViewBase::addTo ( FWConfiguration iTo) const
overridevirtual

Implements FWConfigurable.

Definition at line 398 of file FW3DViewBase.cc.

References FWEveView::addTo(), FWEveView::addToPerspectiveCamera(), and FWEveView::viewerGL().

399 {
400  // take care of parameters
401  FWEveView::addTo(iTo);
402  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
403  if (camera)
404  addToPerspectiveCamera(camera, "Plain3D", iTo);
405 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
void addTo(FWConfiguration &) const override
Definition: FWEveView.cc:351
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
Definition: FWEveView.cc:477
void FW3DViewBase::enableSceneClip ( bool  x)
private

Definition at line 236 of file FW3DViewBase.cc.

References FWEveView::eventScene(), FWEveView::geoScene(), m_glClip, updateClipPlanes(), and FWEveView::viewerGL().

Referenced by FW3DViewBase().

237 {
238  if (m_glClip == nullptr) {
239  m_glClip = new Clipsi(viewerGL()->GetRnrCtx());
240 
241  m_glClip->SetMode(TGLClip::kOutside);
242  }
243 
244  geoScene()->GetGLScene()->SetClip(x ? m_glClip : nullptr);
245  for (TEveElement::List_i it =gEve->GetScenes()->BeginChildren(); it != gEve->GetScenes()->EndChildren(); ++it )
246  {
247  if (strncmp((*it)->GetElementName(), "TopGeoNodeScene", 15) == 0)
248  ((TEveScene*)(*it))->GetGLScene()->SetClip(x ? m_glClip : nullptr);
249  }
250  eventScene()->GetGLScene()->SetClip(x ? m_glClip : nullptr);
251  updateClipPlanes(true);
252  viewerGL()->RequestDraw();
253 }
TEveScene * eventScene()
Definition: FWEveView.h:82
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
void updateClipPlanes(bool resetCamera)
TEveScene * geoScene()
Definition: FWEveView.h:83
TGLClip * m_glClip
Definition: FW3DViewBase.h:77
FW3DViewDistanceMeasureTool* FW3DViewBase::getDMT ( )
inline

Definition at line 62 of file FW3DViewBase.h.

References PVValHelper::eta, FW3DViewBase(), m_DMT, operator=(), phi, requestGLHandlerPick(), setClip(), setCurrentDMTVertex(), showEcalBarrel(), x, y, and z.

62 { return m_DMT;}
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:103
const FW3DViewBase& FW3DViewBase::operator= ( const FW3DViewBase )
private

Referenced by getDMT().

void FW3DViewBase::populateController ( ViewerParameterGUI gui) const
overridevirtual

Reimplemented from FWViewBase.

Reimplemented in FWISpyView.

Definition at line 448 of file FW3DViewBase.cc.

References ViewerParameterGUI::addParam(), FW3DViewDistanceMeasureTool::buildGUI(), ViewerParameterGUI::getTabContainer(), m_cameraType, m_clipAppexOffset, m_clipDelta1, m_clipDelta2, m_clipEnable, m_clipPhi, m_clipTheta, m_DMT, m_rnrStyle, m_selectable, m_showEcalBarrel, m_showMuonBarrel, m_showMuonEndcap, m_showPixelBarrel, m_showPixelEndcap, m_showTrackerBarrel, m_showTrackerEndcap, FWEveView::populateController(), ViewerParameterGUI::requestTab(), ViewerParameterGUI::separator(), and FWEveView::viewerGL().

Referenced by FWISpyView::populateController().

449 {
451 
452 
453  gui.requestTab("Detector").
454  addParam(&m_showMuonBarrel).
455  addParam(&m_showMuonEndcap).
456  addParam(&m_showTrackerBarrel).
457  addParam(&m_showTrackerEndcap).
458  addParam(&m_showPixelBarrel).
459  addParam(&m_showPixelEndcap).
460  addParam(&m_showEcalBarrel).
461  addParam(&m_rnrStyle).
462  addParam(&m_selectable);
463 
464  gui.requestTab("Clipping").
465  addParam(&m_clipEnable).
466  addParam(&m_clipTheta).
467  addParam(&m_clipPhi).
468  addParam(&m_clipDelta1).
469  addParam(&m_clipDelta2).
470  addParam(&m_clipAppexOffset);
471 
472 
473  gui.requestTab("Style").separator();
474  gui.getTabContainer()->AddFrame(new TGTextButton(gui.getTabContainer(), "Root controls",
475  Form("TEveGedEditor::SpawnNewEditor((TGLViewer*)0x%lx)", (unsigned long)viewerGL())));
476 
477  gui.requestTab("Tools").addParam(&m_cameraType).separator();
478  gui.getTabContainer()->AddFrame(m_DMT->buildGUI( gui.getTabContainer()), new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
479 }
FWDoubleParameter m_clipTheta
Definition: FW3DViewBase.h:96
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:81
ViewerParameterGUI & requestTab(const char *)
ViewerParameterGUI & separator()
TGCompositeFrame * buildGUI(TGCompositeFrame *p)
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:84
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:103
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:97
FWEnumParameter m_rnrStyle
Definition: FW3DViewBase.h:90
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:95
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:83
FWDoubleParameter m_clipDelta1
Definition: FW3DViewBase.h:98
FWBoolParameter m_showEcalBarrel
Definition: FW3DViewBase.h:88
ViewerParameterGUI & addParam(const FWParameterBase *)
TGCompositeFrame * getTabContainer()
FWEnumParameter m_showMuonBarrel
Definition: FW3DViewBase.h:80
FWBoolParameter m_selectable
Definition: FW3DViewBase.h:91
FWEnumParameter m_cameraType
Definition: FW3DViewBase.h:93
FWLongParameter m_clipAppexOffset
Definition: FW3DViewBase.h:100
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:85
FWDoubleParameter m_clipDelta2
Definition: FW3DViewBase.h:99
void populateController(ViewerParameterGUI &) const override
Definition: FWEveView.cc:556
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:82
bool FW3DViewBase::requestGLHandlerPick ( ) const
overridevirtual
void FW3DViewBase::rnrStyle ( long  x)
private

Definition at line 223 of file FW3DViewBase.cc.

References FWEveView::geoScene(), and FWEveView::viewerGL().

Referenced by FW3DViewBase().

224 {
225  geoScene()->GetGLScene()->SetStyle(x);
226  viewerGL()->Changed();
227  gEve->Redraw3D();
228 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
TEveScene * geoScene()
Definition: FWEveView.h:83
void FW3DViewBase::selectable ( bool  x)
private

Definition at line 231 of file FW3DViewBase.cc.

References FWEveView::geoScene().

Referenced by FW3DViewBase().

232 {
233  geoScene()->GetGLScene()->SetSelectable(x);
234 }
TEveScene * geoScene()
Definition: FWEveView.h:83
void FW3DViewBase::setCameraType ( long  x)
private

Definition at line 213 of file FW3DViewBase.cc.

References FWEveView::viewerGL().

Referenced by FW3DViewBase().

214 {
215  viewerGL()->RefCamera(TGLViewer::ECameraType(x)).IncTimeStamp();
216  viewerGL()->SetCurrentCamera(TGLViewer::ECameraType(x));
217 
218  //if (viewerGL()->CurrentCamera().IsOrthographic())
219  // ((TGLOrthoCamera*)(&viewerGL()->CurrentCamera()))->SetEnableRotate(1);
220 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
void FW3DViewBase::setClip ( float  eta,
float  phi 
)

Definition at line 256 of file FW3DViewBase.cc.

References runEdmFileComparison::base, dir, mps_fire::i, recoMuon::in, geometryCSVtoXML::line, m_clipEnable, m_clipPhi, m_clipTheta, alignCSCRings::r, and FWGenericParameter< T >::set().

Referenced by getDMT(), and FWGUIManager::open3DRegion().

257 {
258  // called from popup menu via FWGUIManager
259 
260  // limit to 2 decimals, else TGNumber entry in the view controller shows only last 5 irrelevant digits
261  double base = 100.0;
262  int thetaInt = theta*base;
263  int phiInt = phi*base;
264  m_clipTheta.set(thetaInt/base);
265  m_clipPhi.set(phiInt/base);
266  m_clipEnable.set(true);
267 }
FWDoubleParameter m_clipTheta
Definition: FW3DViewBase.h:96
Geom::Theta< T > theta() const
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:97
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:95
base
Make Sure CMSSW is Setup ##.
void FW3DViewBase::setContext ( const fireworks::Context context)
overridevirtual

Reimplemented from FWEveView.

Reimplemented in FWISpyView.

Definition at line 174 of file FW3DViewBase.cc.

References EnergyCorrector::c, FWGenericParameter< T >::changed_, FWEveView::eventScene(), FWEveView::geoScene(), m_DMTline, m_geometry, m_showEcalBarrel, m_showMuonEndcap, m_showPixelBarrel, m_showPixelEndcap, m_showTrackerBarrel, m_showTrackerEndcap, FWEveView::setContext(), showEcalBarrel(), FW3DViewGeometry::showMuonEndcap(), FW3DViewGeometry::showPixelBarrel(), FW3DViewGeometry::showPixelEndcap(), FW3DViewGeometry::showTrackerBarrel(), FW3DViewGeometry::showTrackerEndcap(), and FWGenericParameter< T >::value().

Referenced by FWISpyView::setContext(), and FW3DView::setContext().

175 {
176  FWEveView::setContext(context);
177 
178  m_geometry = new FW3DViewGeometry(context);
179  geoScene()->AddElement(m_geometry);
180 
186  m_showEcalBarrel.changed_.connect(boost::bind(&FW3DViewBase::showEcalBarrel, this,_1));
187 
188  // don't clip event scene -- ideally, would have TGLClipNoClip in root
189  TGLClipPlane* c=new TGLClipPlane();
190  c->Setup(TGLVector3(1e10,0,0), TGLVector3(-1,0,0));
191  eventScene()->GetGLScene()->SetClip(c);
192 
193  m_DMTline = new TEveLine();
194  m_DMTline->SetLineColor(1016);
195  m_DMTline->SetLineStyle(5);
196 
197 
198  m_DMTline->SetPoint(0, 0, 0, 0);
199  m_DMTline->SetPoint(1, 0, 0, 0);
200  eventScene()->AddElement(m_DMTline);
202 }
TEveScene * eventScene()
Definition: FWEveView.h:82
void showEcalBarrel(bool)
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:81
void showTrackerEndcap(bool)
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:84
sigc::signal< void, T > changed_
void showTrackerBarrel(bool)
void showMuonEndcap(bool)
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:83
void showPixelBarrel(bool)
FWBoolParameter m_showEcalBarrel
Definition: FW3DViewBase.h:88
TEveScene * geoScene()
Definition: FWEveView.h:83
void showPixelEndcap(bool)
TEveLine * m_DMTline
Definition: FW3DViewBase.h:104
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:76
virtual void setContext(const fireworks::Context &x)
Definition: FWEveView.cc:271
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:85
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:82
void FW3DViewBase::setCurrentDMTVertex ( double  x,
double  y,
double  z 
)

Definition at line 434 of file FW3DViewBase.cc.

References FW3DViewDistanceMeasureTool::kNone, FW3DViewDistanceMeasureTool::m_action, m_DMT, m_DMTline, FW3DViewDistanceMeasureTool::refCurrentVertex(), FW3DViewDistanceMeasureTool::resetAction(), and FWEveView::viewerGL().

Referenced by getDMT(), and FWGLEventHandler::HandleButton().

435 {
437  printf( "ERROR!!!! FW3DViewBase::setCurrentDMTVertex \n");
438 
439  m_DMTline->SetPoint(m_DMT->m_action, x, y, z);
440  m_DMTline->ElementChanged();
441  viewerGL()->RequestDraw();
442 
443  m_DMT->refCurrentVertex().Set(x, y,z);
444  m_DMT->resetAction();
445 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:103
TEveLine * m_DMTline
Definition: FW3DViewBase.h:104
void FW3DViewBase::setFrom ( const FWConfiguration iFrom)
overridevirtual

Implements FWConfigurable.

Definition at line 409 of file FW3DViewBase.cc.

References fireworks::Context::colorManager(), FWEveView::context(), alignCSCRings::s, FWEveView::setFrom(), FWEveView::setFromPerspectiveCamera(), FWColorManager::setGeomTransparency(), AlCaHLTBitMon_QueryRunRegistry::string, simpleEdmComparison::tName, FWConfiguration::value(), FWConfiguration::valueForKey(), FWConfiguration::version(), and FWEveView::viewerGL().

410 {
411  // take care of parameters
412  FWEveView::setFrom(iFrom);
413 
414  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
415  if (camera)
416  setFromPerspectiveCamera(camera, "Plain3D", iFrom);
417 
418  if (iFrom.version() < 5)
419  {
420  // transparency moved to common preferences in FWEveView version 5
421  std::string tName("Detector Transparency");
422  std::istringstream s(iFrom.valueForKey(tName)->value());
423  int transp;
424  s>> transp;
425  context().colorManager()->setGeomTransparency(transp, false);
426  }
427 }
FWColorManager * colorManager() const
Definition: Context.h:65
unsigned int version() const
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
void setGeomTransparency(Color_t idx, bool projectedType)
const std::string & value(unsigned int iIndex=0) const
const fireworks::Context & context()
Definition: FWEveView.h:67
void setFrom(const FWConfiguration &) override
Definition: FWEveView.cc:369
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
Definition: FWEveView.cc:504
const FWConfiguration * valueForKey(const std::string &iKey) const
void FW3DViewBase::showEcalBarrel ( bool  x)

Definition at line 481 of file FW3DViewBase.cc.

References FWEveView::context(), ModuleToSequenceAssign::Ecal, FWEveView::eventScene(), relativeConstraints::geom, FWGeometry::getCorners(), fireworks::Context::getGeom(), FWGeometry::getMatchedIds(), photons_cff::ids, FWViewType::k3D, m_ecalBarrel, GeomDetEnumerators::PixelBarrel, FWViewBase::typeId(), and x.

Referenced by getDMT(), and setContext().

481  {
482  if (x && m_ecalBarrel->GetPlex()->Size() == 0) {
483  const FWGeometry* geom = context().getGeom();
485  m_ecalBarrel->Reset(TEveBoxSet::kBT_FreeBox, true, ids.size() );
486  for (std::vector<unsigned int>::iterator it = ids.begin(); it != ids.end(); ++it) {
487  const float* cor = context().getGeom()->getCorners(*it);
488  m_ecalBarrel->AddBox(cor);
489  }
490  m_ecalBarrel->RefitPlex();
491  }
492 
493  if (m_ecalBarrel->GetRnrSelf() != x) {
494  m_ecalBarrel->SetRnrSelf(x);
495  gEve->Redraw3D();
496  }
497 
498  // disable enable grid in 3DView
499  if (typeId() == FWViewType::k3D) {
500  TEveElement* calo = eventScene()->FindChild("calo barrel");
501  if (calo) {
502  TEveCalo3D* c3d = dynamic_cast<TEveCalo3D*>(calo);
503  c3d->SetRnrFrame(!x, !x);
504  c3d->ElementChanged();
505  }
506  }
507 }
TEveScene * eventScene()
Definition: FWEveView.h:82
const FWGeometry * getGeom() const
Definition: Context.h:83
const fireworks::Context & context()
Definition: FWEveView.h:67
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:297
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:214
TEveBoxSet * m_ecalBarrel
Definition: FW3DViewBase.h:87
FWViewType::EType typeId() const
Definition: FWViewBase.h:43
void FW3DViewBase::showMuonBarrel ( long  x)
private

Definition at line 204 of file FW3DViewBase.cc.

References m_geometry, FW3DViewGeometry::showMuonBarrel(), and FW3DViewGeometry::showMuonBarrelFull().

Referenced by FW3DViewBase().

205 {
206  if (m_geometry)
207  {
208  m_geometry->showMuonBarrel(x == 1);
210  }
211 }
void showMuonBarrel(bool)
void showMuonBarrelFull(bool)
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:76
void FW3DViewBase::updateClipPlanes ( bool  resetCamera)
private

Definition at line 325 of file FW3DViewBase.cc.

References EnergyCorrector::c, FWEveView::eventScene(), FWEveView::geoScene(), mps_fire::i, recoMuon::in, m_clipAppexOffset, m_clipDelta1, m_clipDelta2, m_clipEnable, m_clipPhi, m_clipTheta, m_glClip, Max(), phi, theta(), FWGenericParameter< T >::value(), and FWEveView::viewerGL().

Referenced by enableSceneClip(), and FW3DViewBase().

326 {
327  // TEveScene* gs = (TEveScene*)gEve->GetScenes()->FindChild(TString("TopGeoNodeScene"));
328  //printf("node scene %p\n", gs);
329  if (m_clipEnable.value())
330  {
331  float theta = m_clipTheta.value();
332  float phi = m_clipPhi.value();
333  using namespace TMath;
334  TEveVector in(Sin(theta)*Cos(phi), Sin(theta)*Sin(phi), Cos(theta));
335 
336  // one side of cross section plane is paralel to XY plane
337  TEveVector normXY(0., 1., 0);
338  TEveVector b0 = in.Cross(normXY);
339  TEveVector b1 = in.Cross(b0);
340 
341  float delta1 = m_clipDelta1.value();
342  float delta2 = m_clipDelta2.value();
343  b0.Normalize();
344  b0 *= Sin(delta1);
345  b1.Normalize();
346  b1 *= Sin(delta2);
347 
348  TEveVector c[4];
349  c[0] += b0; c[0] += b1;
350  c[1] -= b0; c[1] += b1;
351  c[2] -= b0; c[2] -= b1;
352  c[3] += b0; c[3] -= b1;
353  for (int i = 0; i < 4; ++i)
354  c[i] += in;
355 
356  TEveVector aOff = in; aOff.NegateXYZ();
357  aOff.Normalize(); aOff *= m_clipAppexOffset.value();
358  ((Clipsi*)m_glClip)->SetAppexOffset(aOff);
359 
360 
361  ((Clipsi*)m_glClip)->SetPlaneInfo(&c[0]);
362 
363  if (resetCamera) {
364  TGLBoundingBox bbox;
365  float es = getBBoxLineLength(eventScene(), in);
366  float gs = getBBoxLineLength(geoScene(), in);
367  setBBoxClipped(bbox, in, b0, b1, TMath::Max(es, gs));
368 
369  /*
370  TEvePointSet* bmarker = new TEvePointSet(8);
371  bmarker->Reset(4);
372  bmarker->SetName("bbox");
373  bmarker->SetMarkerColor(kOrange);
374  bmarker->SetMarkerStyle(3);
375  bmarker->SetMarkerSize(0.2);
376  for (int i = 0; i < 8; ++i)
377  bmarker->SetPoint(i, bbox[i].X(), bbox[i].Y(), bbox[i].Z());
378  eventScene()->AddElement(bmarker);
379  */
380 
381 
382  TGLCamera& cam = viewerGL()->CurrentCamera();
383  cam.SetExternalCenter(true);
384  cam.SetCenterVec(bbox.Center().X(), bbox.Center().Y(), bbox.Center().Z());
385  cam.Setup(bbox, true);
386  }
387  else {
388  eventScene()->Repaint();
389  }
390  }
391 
392  gEve->Redraw3D();
393 
394 }
FWDoubleParameter m_clipTheta
Definition: FW3DViewBase.h:96
TEveScene * eventScene()
Definition: FWEveView.h:82
Geom::Theta< T > theta() const
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:97
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:95
FWDoubleParameter m_clipDelta1
Definition: FW3DViewBase.h:98
virtual void resetCamera()
Definition: FWEveView.cc:264
T Max(T a, T b)
Definition: MathUtil.h:44
TEveScene * geoScene()
Definition: FWEveView.h:83
TGLClip * m_glClip
Definition: FW3DViewBase.h:77
Definition: AbsArchive.cc:53
FWLongParameter m_clipAppexOffset
Definition: FW3DViewBase.h:100
FWDoubleParameter m_clipDelta2
Definition: FW3DViewBase.h:99
void FW3DViewBase::updateGlobalSceneScaleParameters ( )

Member Data Documentation

FWEnumParameter FW3DViewBase::m_cameraType
private

Definition at line 93 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWLongParameter FW3DViewBase::m_clipAppexOffset
private

Definition at line 100 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), populateController(), and updateClipPlanes().

FWDoubleParameter FW3DViewBase::m_clipDelta1
private

Definition at line 98 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), populateController(), and updateClipPlanes().

FWDoubleParameter FW3DViewBase::m_clipDelta2
private

Definition at line 99 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), populateController(), and updateClipPlanes().

FWBoolParameter FW3DViewBase::m_clipEnable
private

Definition at line 95 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), populateController(), setClip(), and updateClipPlanes().

FWDoubleParameter FW3DViewBase::m_clipPhi
private

Definition at line 97 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), populateController(), setClip(), and updateClipPlanes().

FWDoubleParameter FW3DViewBase::m_clipTheta
private

Definition at line 96 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), populateController(), setClip(), and updateClipPlanes().

FW3DViewDistanceMeasureTool* FW3DViewBase::m_DMT
private
TEveLine* FW3DViewBase::m_DMTline
private

Definition at line 104 of file FW3DViewBase.h.

Referenced by setContext(), and setCurrentDMTVertex().

TEveBoxSet* FW3DViewBase::m_ecalBarrel
private

Definition at line 87 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and showEcalBarrel().

FW3DViewGeometry* FW3DViewBase::m_geometry
private

Definition at line 76 of file FW3DViewBase.h.

Referenced by setContext(), and showMuonBarrel().

TGLClip* FW3DViewBase::m_glClip
private

Definition at line 77 of file FW3DViewBase.h.

Referenced by enableSceneClip(), updateClipPlanes(), and ~FW3DViewBase().

FWEnumParameter FW3DViewBase::m_rnrStyle
private

Definition at line 90 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWBoolParameter FW3DViewBase::m_selectable
private

Definition at line 91 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWBoolParameter FW3DViewBase::m_showEcalBarrel
private

Definition at line 88 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWEnumParameter FW3DViewBase::m_showMuonBarrel
private

Definition at line 80 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWBoolParameter FW3DViewBase::m_showMuonEndcap
private

Definition at line 81 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showPixelBarrel
private

Definition at line 82 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showPixelEndcap
private

Definition at line 83 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showTrackerBarrel
private

Definition at line 84 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showTrackerEndcap
private

Definition at line 85 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().