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)
 
void updateHGCalVisibility (bool)
 

Private Attributes

FWEnumParameter m_cameraType
 
FWLongParameter m_clipAppexOffset
 
FWDoubleParameter m_clipDelta1
 
FWDoubleParameter m_clipDelta2
 
FWBoolParameter m_clipEnable
 
FWLongParameter m_clipHGCalLayerBegin
 
FWLongParameter m_clipHGCalLayerEnd
 
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
 
FWBoolParameter m_showHGCalEE
 
FWBoolParameter m_showHGCalHSc
 
FWBoolParameter m_showHGCalHSi
 
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 107 of file FW3DViewBase.cc.

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

Referenced by getDMT().

107  :
108  FWEveView(iParent, typeId, version ),
109  m_geometry(nullptr),
110  m_glClip(nullptr),
111  m_showMuonBarrel(this, "Show Muon Barrel", 0l, 0l, 2l ),
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_showHGCalEE(this, "Show HGCalEE", false),
118  m_showHGCalHSi(this, "Show HGCalHSi", false),
119  m_showHGCalHSc(this, "Show HGCalHSc", false),
120  m_ecalBarrel(nullptr),
121  m_showEcalBarrel(this, "Show Ecal Barrel", false),
122  m_rnrStyle(this, "Render Style", 0l, 0l, 2l),
123  m_selectable(this, "Enable Tooltips", false),
124  m_cameraType(this, "Camera Type", 0l, 0l, 5l),
125  m_clipEnable(this, "Enable Clip", false),
126  m_clipTheta(this, "Clip Theta", 0.0, -5.0, 5.0),
127  m_clipPhi(this, "Clip Phi", 0.0, -2.0, 2.0),
128  m_clipDelta1(this, "Clip Delta1", 0.2, 0.01, 2),
129  m_clipDelta2(this, "Clip Delta2", 0.2, 0.01, 2),
130  m_clipAppexOffset(this, "Appex Offset", 10l, 0l, 50l),
131  m_clipHGCalLayerBegin(this, "HGCal Lower Bound", 1l, 1l, 52l),
132  m_clipHGCalLayerEnd(this, "HGCal Upper Bound", 52l, 1l, 52l),
133  m_DMT(nullptr),
134  m_DMTline(nullptr)
135 {
136  viewerGL()->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
138 
139  m_showMuonBarrel.addEntry(0, "Hide");
140  m_showMuonBarrel.addEntry(1, "Simplified");
141  m_showMuonBarrel.addEntry(2, "Full");
142  m_showMuonBarrel.changed_.connect(boost::bind(&FW3DViewBase::showMuonBarrel,this,_1));
143 
144  m_rnrStyle.addEntry(TGLRnrCtx::kFill, "Fill");
145  m_rnrStyle.addEntry(TGLRnrCtx::kOutline, "Outline");
146  m_rnrStyle.addEntry(TGLRnrCtx::kWireFrame, "WireFrame");
147  m_rnrStyle.changed_.connect(boost::bind(&FW3DViewBase::rnrStyle,this, _1));
148 
149  m_selectable.changed_.connect(boost::bind(&FW3DViewBase::selectable,this, _1));
150 
151 
152  m_cameraType.addEntry(TGLViewer::kCameraPerspXOZ,"PerspXOZ" );
153  m_cameraType.addEntry(TGLViewer::kCameraOrthoXOY,"OrthoXOY");
154  m_cameraType.addEntry(TGLViewer::kCameraOrthoXOZ,"OrthoXOZ");
155  m_cameraType.addEntry(TGLViewer::kCameraOrthoZOY,"OrthoZOY" );
156  m_cameraType.addEntry(TGLViewer::kCameraOrthoXnOY,"OrthoXnOY");
157  m_cameraType.addEntry(TGLViewer::kCameraOrthoXnOZ,"OrthoXnOZ");
158  m_cameraType.addEntry(TGLViewer::kCameraOrthoZnOY,"OrthoZnOY" );
159  m_cameraType.changed_.connect(boost::bind(&FW3DViewBase::setCameraType,this, _1));
160 
161  m_clipEnable.changed_.connect(boost::bind(&FW3DViewBase::enableSceneClip,this, _1));
162  m_clipTheta.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this, false));
163  m_clipPhi.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this, false));
164  m_clipDelta1.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this, false));
165  m_clipDelta2.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this, false));
166  m_clipAppexOffset.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this, false));
167  m_clipHGCalLayerBegin.changed_.connect(boost::bind(&FW3DViewBase::updateHGCalVisibility,this, false));
168  m_clipHGCalLayerEnd.changed_.connect(boost::bind(&FW3DViewBase::updateHGCalVisibility,this, false));
169 
170  m_ecalBarrel = new TEveBoxSet("ecalBarrel");
171  m_ecalBarrel->UseSingleColor();
172  m_ecalBarrel->SetMainColor(kAzure+10);
173  m_ecalBarrel->SetMainTransparency(98);
174  geoScene()->AddElement(m_ecalBarrel);
175 }
FWDoubleParameter m_clipTheta
Definition: FW3DViewBase.h:99
void updateHGCalVisibility(bool)
void showMuonBarrel(long)
void rnrStyle(long)
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:81
FWBoolParameter m_showHGCalEE
Definition: FW3DViewBase.h:86
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:107
void selectable(bool)
void setCameraType(long)
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:100
void enableSceneClip(bool)
FWEnumParameter m_rnrStyle
Definition: FW3DViewBase.h:93
void updateClipPlanes(bool resetCamera)
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:98
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:83
FWDoubleParameter m_clipDelta1
Definition: FW3DViewBase.h:101
bool addEntry(Long_t id, const std::string &txt)
FWLongParameter m_clipHGCalLayerBegin
Definition: FW3DViewBase.h:104
FWBoolParameter m_showHGCalHSi
Definition: FW3DViewBase.h:87
FWBoolParameter m_showHGCalHSc
Definition: FW3DViewBase.h:88
FWBoolParameter m_showEcalBarrel
Definition: FW3DViewBase.h:91
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:108
TEveBoxSet * m_ecalBarrel
Definition: FW3DViewBase.h:90
FWEnumParameter m_showMuonBarrel
Definition: FW3DViewBase.h:80
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:76
FWBoolParameter m_selectable
Definition: FW3DViewBase.h:94
FWLongParameter m_clipHGCalLayerEnd
Definition: FW3DViewBase.h:105
FWEnumParameter m_cameraType
Definition: FW3DViewBase.h:96
FWLongParameter m_clipAppexOffset
Definition: FW3DViewBase.h:103
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:85
FWDoubleParameter m_clipDelta2
Definition: FW3DViewBase.h:102
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:82
FWViewType::EType typeId() const
Definition: FWViewBase.h:43
FW3DViewBase::~FW3DViewBase ( )
override

Definition at line 177 of file FW3DViewBase.cc.

References m_glClip.

178 {
179  delete m_glClip;
180 }
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 452 of file FW3DViewBase.cc.

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

453 {
454  // take care of parameters
455  FWEveView::addTo(iTo);
456  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
457  if (camera)
458  addToPerspectiveCamera(camera, "Plain3D", iTo);
459 }
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 247 of file FW3DViewBase.cc.

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

Referenced by FW3DViewBase().

248 {
249  if (m_glClip == nullptr) {
250  m_glClip = new Clipsi(viewerGL()->GetRnrCtx());
251 
252  m_glClip->SetMode(TGLClip::kOutside);
253  }
254 
255  geoScene()->GetGLScene()->SetClip(x ? m_glClip : nullptr);
256  for (TEveElement::List_i it =gEve->GetScenes()->BeginChildren(); it != gEve->GetScenes()->EndChildren(); ++it )
257  {
258  if (strncmp((*it)->GetElementName(), "TopGeoNodeScene", 15) == 0)
259  ((TEveScene*)(*it))->GetGLScene()->SetClip(x ? m_glClip : nullptr);
260  }
261  eventScene()->GetGLScene()->SetClip(x ? m_glClip : nullptr);
262  updateClipPlanes(true);
263  updateHGCalVisibility(false);
264  viewerGL()->RequestDraw();
265 }
void updateHGCalVisibility(bool)
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:107
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 502 of file FW3DViewBase.cc.

References ViewerParameterGUI::addParam(), FW3DViewDistanceMeasureTool::buildGUI(), ViewerParameterGUI::getTabContainer(), m_cameraType, m_clipAppexOffset, m_clipDelta1, m_clipDelta2, m_clipEnable, m_clipHGCalLayerBegin, m_clipHGCalLayerEnd, m_clipPhi, m_clipTheta, m_DMT, m_rnrStyle, m_selectable, m_showEcalBarrel, m_showHGCalEE, m_showHGCalHSc, m_showHGCalHSi, 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().

503 {
505 
506 
507  gui.requestTab("Detector").
508  addParam(&m_showMuonBarrel).
509  addParam(&m_showMuonEndcap).
510  addParam(&m_showTrackerBarrel).
511  addParam(&m_showTrackerEndcap).
512  addParam(&m_showHGCalEE).
513  addParam(&m_showHGCalHSi).
514  addParam(&m_showHGCalHSc).
515  addParam(&m_showPixelBarrel).
516  addParam(&m_showPixelEndcap).
517  addParam(&m_showEcalBarrel).
518  addParam(&m_rnrStyle).
519  addParam(&m_selectable);
520 
521  gui.requestTab("Clipping").
522  addParam(&m_clipEnable).
523  addParam(&m_clipTheta).
524  addParam(&m_clipPhi).
525  addParam(&m_clipDelta1).
526  addParam(&m_clipDelta2).
527  addParam(&m_clipAppexOffset).
528  addParam(&m_clipHGCalLayerBegin).
529  addParam(&m_clipHGCalLayerEnd);
530 
531 
532  gui.requestTab("Style").separator();
533  gui.getTabContainer()->AddFrame(new TGTextButton(gui.getTabContainer(), "Root controls",
534  Form("TEveGedEditor::SpawnNewEditor((TGLViewer*)0x%lx)", (unsigned long)viewerGL())));
535 
536  gui.requestTab("Tools").addParam(&m_cameraType).separator();
537  gui.getTabContainer()->AddFrame(m_DMT->buildGUI( gui.getTabContainer()), new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
538 }
FWDoubleParameter m_clipTheta
Definition: FW3DViewBase.h:99
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:81
FWBoolParameter m_showHGCalEE
Definition: FW3DViewBase.h:86
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:107
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:100
FWEnumParameter m_rnrStyle
Definition: FW3DViewBase.h:93
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:98
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:83
FWDoubleParameter m_clipDelta1
Definition: FW3DViewBase.h:101
FWLongParameter m_clipHGCalLayerBegin
Definition: FW3DViewBase.h:104
FWBoolParameter m_showHGCalHSi
Definition: FW3DViewBase.h:87
FWBoolParameter m_showHGCalHSc
Definition: FW3DViewBase.h:88
FWBoolParameter m_showEcalBarrel
Definition: FW3DViewBase.h:91
ViewerParameterGUI & addParam(const FWParameterBase *)
TGCompositeFrame * getTabContainer()
FWEnumParameter m_showMuonBarrel
Definition: FW3DViewBase.h:80
FWBoolParameter m_selectable
Definition: FW3DViewBase.h:94
FWLongParameter m_clipHGCalLayerEnd
Definition: FW3DViewBase.h:105
FWEnumParameter m_cameraType
Definition: FW3DViewBase.h:96
FWLongParameter m_clipAppexOffset
Definition: FW3DViewBase.h:103
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:85
FWDoubleParameter m_clipDelta2
Definition: FW3DViewBase.h:102
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 234 of file FW3DViewBase.cc.

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

Referenced by FW3DViewBase().

235 {
236  geoScene()->GetGLScene()->SetStyle(x);
237  viewerGL()->Changed();
238  gEve->Redraw3D();
239 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
TEveScene * geoScene()
Definition: FWEveView.h:83
void FW3DViewBase::selectable ( bool  x)
private

Definition at line 242 of file FW3DViewBase.cc.

References FWEveView::geoScene().

Referenced by FW3DViewBase().

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

Definition at line 224 of file FW3DViewBase.cc.

References FWEveView::viewerGL().

Referenced by FW3DViewBase().

225 {
226  viewerGL()->RefCamera(TGLViewer::ECameraType(x)).IncTimeStamp();
227  viewerGL()->SetCurrentCamera(TGLViewer::ECameraType(x));
228 
229  //if (viewerGL()->CurrentCamera().IsOrthographic())
230  // ((TGLOrthoCamera*)(&viewerGL()->CurrentCamera()))->SetEnableRotate(1);
231 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
void FW3DViewBase::setClip ( float  eta,
float  phi 
)

Definition at line 268 of file FW3DViewBase.cc.

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

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

269 {
270  // called from popup menu via FWGUIManager
271 
272  // limit to 2 decimals, else TGNumber entry in the view controller shows only last 5 irrelevant digits
273  double base = 100.0;
274  int thetaInt = theta*base;
275  int phiInt = phi*base;
276  m_clipTheta.set(thetaInt/base);
277  m_clipPhi.set(phiInt/base);
278  m_clipEnable.set(true);
279 }
FWDoubleParameter m_clipTheta
Definition: FW3DViewBase.h:99
Geom::Theta< T > theta() const
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:100
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:98
base
Make Sure CMSSW is Setup ##.
void FW3DViewBase::setContext ( const fireworks::Context context)
overridevirtual

Reimplemented from FWEveView.

Reimplemented in FWISpyView.

Definition at line 182 of file FW3DViewBase.cc.

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

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

183 {
184  FWEveView::setContext(context);
185 
186  m_geometry = new FW3DViewGeometry(context);
187  geoScene()->AddElement(m_geometry);
188 
197  m_showEcalBarrel.changed_.connect(boost::bind(&FW3DViewBase::showEcalBarrel, this,_1));
198 
199  // don't clip event scene -- ideally, would have TGLClipNoClip in root
200  TGLClipPlane* c=new TGLClipPlane();
201  c->Setup(TGLVector3(1e10,0,0), TGLVector3(-1,0,0));
202  eventScene()->GetGLScene()->SetClip(c);
203 
204  m_DMTline = new TEveLine();
205  m_DMTline->SetLineColor(1016);
206  m_DMTline->SetLineStyle(5);
207 
208 
209  m_DMTline->SetPoint(0, 0, 0, 0);
210  m_DMTline->SetPoint(1, 0, 0, 0);
211  eventScene()->AddElement(m_DMTline);
213 }
TEveScene * eventScene()
Definition: FWEveView.h:82
void showEcalBarrel(bool)
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:81
FWBoolParameter m_showHGCalEE
Definition: FW3DViewBase.h:86
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
FWBoolParameter m_showHGCalHSi
Definition: FW3DViewBase.h:87
void showPixelBarrel(bool)
FWBoolParameter m_showHGCalHSc
Definition: FW3DViewBase.h:88
FWBoolParameter m_showEcalBarrel
Definition: FW3DViewBase.h:91
TEveScene * geoScene()
Definition: FWEveView.h:83
void showPixelEndcap(bool)
TEveLine * m_DMTline
Definition: FW3DViewBase.h:108
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 488 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().

489 {
491  printf( "ERROR!!!! FW3DViewBase::setCurrentDMTVertex \n");
492 
493  m_DMTline->SetPoint(m_DMT->m_action, x, y, z);
494  m_DMTline->ElementChanged();
495  viewerGL()->RequestDraw();
496 
497  m_DMT->refCurrentVertex().Set(x, y,z);
498  m_DMT->resetAction();
499 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:107
TEveLine * m_DMTline
Definition: FW3DViewBase.h:108
void FW3DViewBase::setFrom ( const FWConfiguration iFrom)
overridevirtual

Implements FWConfigurable.

Definition at line 463 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().

464 {
465  // take care of parameters
466  FWEveView::setFrom(iFrom);
467 
468  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
469  if (camera)
470  setFromPerspectiveCamera(camera, "Plain3D", iFrom);
471 
472  if (iFrom.version() < 5)
473  {
474  // transparency moved to common preferences in FWEveView version 5
475  std::string tName("Detector Transparency");
476  std::istringstream s(iFrom.valueForKey(tName)->value());
477  int transp;
478  s>> transp;
479  context().colorManager()->setGeomTransparency(transp, false);
480  }
481 }
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 540 of file FW3DViewBase.cc.

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

Referenced by getDMT(), and setContext().

540  {
541  if (x && m_ecalBarrel->GetPlex()->Size() == 0) {
542  const FWGeometry* geom = context().getGeom();
543  std::vector<unsigned int> ids = geom->getMatchedIds(FWGeometry::Detector::Ecal, FWGeometry::SubDetector::PixelBarrel);
544  m_ecalBarrel->Reset(TEveBoxSet::kBT_FreeBox, true, ids.size() );
545  for (std::vector<unsigned int>::iterator it = ids.begin(); it != ids.end(); ++it) {
546  const float* cor = context().getGeom()->getCorners(*it);
547  m_ecalBarrel->AddBox(cor);
548  }
549  m_ecalBarrel->RefitPlex();
550  }
551 
552  if (m_ecalBarrel->GetRnrSelf() != x) {
553  m_ecalBarrel->SetRnrSelf(x);
554  gEve->Redraw3D();
555  }
556 
557  // disable enable grid in 3DView
558  if (typeId() == FWViewType::k3D) {
559  TEveElement* calo = eventScene()->FindChild("calo barrel");
560  if (calo) {
561  TEveCalo3D* c3d = dynamic_cast<TEveCalo3D*>(calo);
562  c3d->SetRnrFrame(!x, !x);
563  c3d->ElementChanged();
564  }
565  }
566 }
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:430
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:214
TEveBoxSet * m_ecalBarrel
Definition: FW3DViewBase.h:90
FWViewType::EType typeId() const
Definition: FWViewBase.h:43
void FW3DViewBase::showMuonBarrel ( long  x)
private

Definition at line 215 of file FW3DViewBase.cc.

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

Referenced by FW3DViewBase().

216 {
217  if (m_geometry)
218  {
219  m_geometry->showMuonBarrel(x == 1);
221  }
222 }
void showMuonBarrel(bool)
void showMuonBarrelFull(bool)
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:76
void FW3DViewBase::updateClipPlanes ( bool  resetCamera)
private

Definition at line 337 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().

338 {
339  // TEveScene* gs = (TEveScene*)gEve->GetScenes()->FindChild(TString("TopGeoNodeScene"));
340  //printf("node scene %p\n", gs);
341  if (m_clipEnable.value())
342  {
343  float theta = m_clipTheta.value();
344  float phi = m_clipPhi.value();
345  using namespace TMath;
346  TEveVector in(Sin(theta)*Cos(phi), Sin(theta)*Sin(phi), Cos(theta));
347 
348  // one side of cross section plane is paralel to XY plane
349  TEveVector normXY(0., 1., 0);
350  TEveVector b0 = in.Cross(normXY);
351  TEveVector b1 = in.Cross(b0);
352 
353  float delta1 = m_clipDelta1.value();
354  float delta2 = m_clipDelta2.value();
355  b0.Normalize();
356  b0 *= Sin(delta1);
357  b1.Normalize();
358  b1 *= Sin(delta2);
359 
360  TEveVector c[4];
361  c[0] += b0; c[0] += b1;
362  c[1] -= b0; c[1] += b1;
363  c[2] -= b0; c[2] -= b1;
364  c[3] += b0; c[3] -= b1;
365  for (int i = 0; i < 4; ++i)
366  c[i] += in;
367 
368  TEveVector aOff = in; aOff.NegateXYZ();
369  aOff.Normalize(); aOff *= m_clipAppexOffset.value();
370  ((Clipsi*)m_glClip)->SetAppexOffset(aOff);
371 
372 
373  ((Clipsi*)m_glClip)->SetPlaneInfo(&c[0]);
374 
375  if (resetCamera) {
376  TGLBoundingBox bbox;
377  float es = getBBoxLineLength(eventScene(), in);
378  float gs = getBBoxLineLength(geoScene(), in);
379  setBBoxClipped(bbox, in, b0, b1, TMath::Max(es, gs));
380 
381  /*
382  TEvePointSet* bmarker = new TEvePointSet(8);
383  bmarker->Reset(4);
384  bmarker->SetName("bbox");
385  bmarker->SetMarkerColor(kOrange);
386  bmarker->SetMarkerStyle(3);
387  bmarker->SetMarkerSize(0.2);
388  for (int i = 0; i < 8; ++i)
389  bmarker->SetPoint(i, bbox[i].X(), bbox[i].Y(), bbox[i].Z());
390  eventScene()->AddElement(bmarker);
391  */
392 
393 
394  TGLCamera& cam = viewerGL()->CurrentCamera();
395  cam.SetExternalCenter(true);
396  cam.SetCenterVec(bbox.Center().X(), bbox.Center().Y(), bbox.Center().Z());
397  cam.Setup(bbox, true);
398  }
399  else {
400  eventScene()->Repaint();
401  }
402  }
403 
404  gEve->Redraw3D();
405 
406 }
FWDoubleParameter m_clipTheta
Definition: FW3DViewBase.h:99
TEveScene * eventScene()
Definition: FWEveView.h:82
Geom::Theta< T > theta() const
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:100
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:98
FWDoubleParameter m_clipDelta1
Definition: FW3DViewBase.h:101
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:45
FWLongParameter m_clipAppexOffset
Definition: FW3DViewBase.h:103
FWDoubleParameter m_clipDelta2
Definition: FW3DViewBase.h:102
void FW3DViewBase::updateGlobalSceneScaleParameters ( )
void FW3DViewBase::updateHGCalVisibility ( bool  )
private

Definition at line 409 of file FW3DViewBase.cc.

References FW3DViewGeometry::getHGCalEE(), FW3DViewGeometry::getHGCalHSc(), FW3DViewGeometry::getHGCalHSi(), m_clipEnable, m_clipHGCalLayerBegin, m_clipHGCalLayerEnd, m_geometry, SiStripPI::max, min(), AlCaHLTBitMon_QueryRunRegistry::string, fftjetcommon_cfi::title, and FWGenericParameter< T >::value().

Referenced by enableSceneClip(), and FW3DViewBase().

409  {
410 
411  if (!m_clipEnable.value()) return;
412 
413  long lmin = m_clipHGCalLayerBegin.value();
414  long lmax = m_clipHGCalLayerEnd.value();
415 
416  // real min, max
417  long r_lmin = std::min(lmin, lmax);
418  long r_lmax = std::max(lmin, lmax);
419 
420  TEveElementList const * const HGCalEE = m_geometry->getHGCalEE();
421  if(HGCalEE){
422  for (const auto & it : HGCalEE->RefChildren()){
423  std::string title(it->GetElementTitle());
424  int layer = stoi(title.substr(title.length() - 2));
425  it->SetRnrState(layer >= r_lmin && layer <= r_lmax);
426  }
427  }
428 
429  TEveElementList const * const HGCalHSi = m_geometry->getHGCalHSi();
430  if(HGCalHSi){
431  for (const auto & it : HGCalHSi->RefChildren()){
432  std::string title(it->GetElementTitle());
433  int layer = stoi(title.substr(title.length() - 2)) + 28;
434  it->SetRnrState(layer >= r_lmin && layer <= r_lmax);
435  }
436  }
437 
438  TEveElementList const * const HGCalHSc = m_geometry->getHGCalHSc();
439  if(HGCalHSc){
440  for (const auto & it : HGCalHSc->RefChildren()){
441  std::string title(it->GetElementTitle());
442  int layer = stoi(title.substr(title.length() - 2)) + 28;
443  it->SetRnrState(layer >= r_lmin && layer <= r_lmax);
444  }
445  }
446 
447  gEve->Redraw3D();
448 }
TEveElementList const *const getHGCalHSc()
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:98
TEveElementList const *const getHGCalHSi()
T min(T a, T b)
Definition: MathUtil.h:58
FWLongParameter m_clipHGCalLayerBegin
Definition: FW3DViewBase.h:104
TEveElementList const *const getHGCalEE()
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:76
FWLongParameter m_clipHGCalLayerEnd
Definition: FW3DViewBase.h:105

Member Data Documentation

FWEnumParameter FW3DViewBase::m_cameraType
private

Definition at line 96 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWLongParameter FW3DViewBase::m_clipAppexOffset
private

Definition at line 103 of file FW3DViewBase.h.

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

FWDoubleParameter FW3DViewBase::m_clipDelta1
private

Definition at line 101 of file FW3DViewBase.h.

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

FWDoubleParameter FW3DViewBase::m_clipDelta2
private

Definition at line 102 of file FW3DViewBase.h.

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

FWBoolParameter FW3DViewBase::m_clipEnable
private
FWLongParameter FW3DViewBase::m_clipHGCalLayerBegin
private

Definition at line 104 of file FW3DViewBase.h.

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

FWLongParameter FW3DViewBase::m_clipHGCalLayerEnd
private

Definition at line 105 of file FW3DViewBase.h.

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

FWDoubleParameter FW3DViewBase::m_clipPhi
private

Definition at line 100 of file FW3DViewBase.h.

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

FWDoubleParameter FW3DViewBase::m_clipTheta
private

Definition at line 99 of file FW3DViewBase.h.

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

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

Definition at line 108 of file FW3DViewBase.h.

Referenced by setContext(), and setCurrentDMTVertex().

TEveBoxSet* FW3DViewBase::m_ecalBarrel
private

Definition at line 90 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(), showMuonBarrel(), and updateHGCalVisibility().

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 93 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWBoolParameter FW3DViewBase::m_selectable
private

Definition at line 94 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWBoolParameter FW3DViewBase::m_showEcalBarrel
private

Definition at line 91 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showHGCalEE
private

Definition at line 86 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showHGCalHSc
private

Definition at line 88 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showHGCalHSi
private

Definition at line 87 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().