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 99 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().

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

Definition at line 167 of file FW3DViewBase.cc.

References m_glClip.

167 { delete m_glClip; }
TGLClip * m_glClip
Definition: FW3DViewBase.h:76
FW3DViewBase::FW3DViewBase ( const FW3DViewBase )
private

Member Function Documentation

void FW3DViewBase::addTo ( FWConfiguration iTo) const
overridevirtual

Implements FWConfigurable.

Definition at line 429 of file FW3DViewBase.cc.

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

429  {
430  // take care of parameters
431  FWEveView::addTo(iTo);
432  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
433  if (camera)
434  addToPerspectiveCamera(camera, "Plain3D", iTo);
435 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
void addTo(FWConfiguration &) const override
Definition: FWEveView.cc:291
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
Definition: FWEveView.cc:397
void FW3DViewBase::enableSceneClip ( bool  x)
private

Definition at line 222 of file FW3DViewBase.cc.

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

Referenced by FW3DViewBase().

222  {
223  if (m_glClip == nullptr) {
224  m_glClip = new Clipsi(viewerGL()->GetRnrCtx());
225 
226  m_glClip->SetMode(TGLClip::kOutside);
227  }
228 
229  geoScene()->GetGLScene()->SetClip(x ? m_glClip : nullptr);
230  for (TEveElement::List_i it = gEve->GetScenes()->BeginChildren(); it != gEve->GetScenes()->EndChildren(); ++it) {
231  if (strncmp((*it)->GetElementName(), "TopGeoNodeScene", 15) == 0)
232  ((TEveScene*)(*it))->GetGLScene()->SetClip(x ? m_glClip : nullptr);
233  }
234  eventScene()->GetGLScene()->SetClip(x ? m_glClip : nullptr);
235  updateClipPlanes(true);
236  updateHGCalVisibility(false);
237  viewerGL()->RequestDraw();
238 }
void updateHGCalVisibility(bool)
TEveScene * eventScene()
Definition: FWEveView.h:79
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
void updateClipPlanes(bool resetCamera)
TEveScene * geoScene()
Definition: FWEveView.h:80
TGLClip * m_glClip
Definition: FW3DViewBase.h:76
FW3DViewDistanceMeasureTool* FW3DViewBase::getDMT ( )
inline

Definition at line 61 of file FW3DViewBase.h.

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

61 { return m_DMT; }
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:106
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 470 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().

470  {
472 
473  gui.requestTab("Detector")
486 
487  gui.requestTab("Clipping")
496 
497  gui.requestTab("Style").separator();
498  gui.getTabContainer()->AddFrame(
499  new TGTextButton(gui.getTabContainer(),
500  "Root controls",
501  Form("TEveGedEditor::SpawnNewEditor((TGLViewer*)0x%lx)", (unsigned long)viewerGL())));
502 
503  gui.requestTab("Tools").addParam(&m_cameraType).separator();
504  gui.getTabContainer()->AddFrame(m_DMT->buildGUI(gui.getTabContainer()),
505  new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
506 }
FWDoubleParameter m_clipTheta
Definition: FW3DViewBase.h:98
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:80
FWBoolParameter m_showHGCalEE
Definition: FW3DViewBase.h:85
ViewerParameterGUI & requestTab(const char *)
ViewerParameterGUI & separator()
TGCompositeFrame * buildGUI(TGCompositeFrame *p)
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:83
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:106
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:99
FWEnumParameter m_rnrStyle
Definition: FW3DViewBase.h:92
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:97
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:82
FWDoubleParameter m_clipDelta1
Definition: FW3DViewBase.h:100
FWLongParameter m_clipHGCalLayerBegin
Definition: FW3DViewBase.h:103
FWBoolParameter m_showHGCalHSi
Definition: FW3DViewBase.h:86
FWBoolParameter m_showHGCalHSc
Definition: FW3DViewBase.h:87
FWBoolParameter m_showEcalBarrel
Definition: FW3DViewBase.h:90
ViewerParameterGUI & addParam(const FWParameterBase *)
TGCompositeFrame * getTabContainer()
FWEnumParameter m_showMuonBarrel
Definition: FW3DViewBase.h:79
FWBoolParameter m_selectable
Definition: FW3DViewBase.h:93
FWLongParameter m_clipHGCalLayerEnd
Definition: FW3DViewBase.h:104
FWEnumParameter m_cameraType
Definition: FW3DViewBase.h:95
FWLongParameter m_clipAppexOffset
Definition: FW3DViewBase.h:102
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:84
FWDoubleParameter m_clipDelta2
Definition: FW3DViewBase.h:101
void populateController(ViewerParameterGUI &) const override
Definition: FWEveView.cc:466
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:81
bool FW3DViewBase::requestGLHandlerPick ( ) const
overridevirtual
void FW3DViewBase::rnrStyle ( long  x)
private

Definition at line 215 of file FW3DViewBase.cc.

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

Referenced by FW3DViewBase().

215  {
216  geoScene()->GetGLScene()->SetStyle(x);
217  viewerGL()->Changed();
218  gEve->Redraw3D();
219 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
TEveScene * geoScene()
Definition: FWEveView.h:80
void FW3DViewBase::selectable ( bool  x)
private

Definition at line 221 of file FW3DViewBase.cc.

References FWEveView::geoScene().

Referenced by FW3DViewBase().

221 { geoScene()->GetGLScene()->SetSelectable(x); }
TEveScene * geoScene()
Definition: FWEveView.h:80
void FW3DViewBase::setCameraType ( long  x)
private

Definition at line 207 of file FW3DViewBase.cc.

References FWEveView::viewerGL().

Referenced by FW3DViewBase().

207  {
208  viewerGL()->RefCamera(TGLViewer::ECameraType(x)).IncTimeStamp();
209  viewerGL()->SetCurrentCamera(TGLViewer::ECameraType(x));
210 
211  //if (viewerGL()->CurrentCamera().IsOrthographic())
212  // ((TGLOrthoCamera*)(&viewerGL()->CurrentCamera()))->SetEnableRotate(1);
213 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
void FW3DViewBase::setClip ( float  eta,
float  phi 
)

Definition at line 240 of file FW3DViewBase.cc.

References parametrizedMagneticField_OAE85l_cfi::b0, newFWLiteAna::base, DeadROC_duringRun::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().

240  {
241  // called from popup menu via FWGUIManager
242 
243  // limit to 2 decimals, else TGNumber entry in the view controller shows only last 5 irrelevant digits
244  double base = 100.0;
245  int thetaInt = theta * base;
246  int phiInt = phi * base;
247  m_clipTheta.set(thetaInt / base);
248  m_clipPhi.set(phiInt / base);
249  m_clipEnable.set(true);
250 }
FWDoubleParameter m_clipTheta
Definition: FW3DViewBase.h:98
base
Main Program
Definition: newFWLiteAna.py:92
Geom::Theta< T > theta() const
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:99
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:97
void FW3DViewBase::setContext ( const fireworks::Context context)
overridevirtual

Reimplemented from FWEveView.

Reimplemented in FWISpyView.

Definition at line 169 of file FW3DViewBase.cc.

References HltBtagPostValidation_cff::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().

169  {
170  FWEveView::setContext(context);
171 
172  m_geometry = new FW3DViewGeometry(context);
173  geoScene()->AddElement(m_geometry);
174 
183  m_showEcalBarrel.changed_.connect(boost::bind(&FW3DViewBase::showEcalBarrel, this, _1));
184 
185  // don't clip event scene -- ideally, would have TGLClipNoClip in root
186  TGLClipPlane* c = new TGLClipPlane();
187  c->Setup(TGLVector3(1e10, 0, 0), TGLVector3(-1, 0, 0));
188  eventScene()->GetGLScene()->SetClip(c);
189 
190  m_DMTline = new TEveLine();
191  m_DMTline->SetLineColor(1016);
192  m_DMTline->SetLineStyle(5);
193 
194  m_DMTline->SetPoint(0, 0, 0, 0);
195  m_DMTline->SetPoint(1, 0, 0, 0);
196  eventScene()->AddElement(m_DMTline);
198 }
TEveScene * eventScene()
Definition: FWEveView.h:79
void showEcalBarrel(bool)
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:80
FWBoolParameter m_showHGCalEE
Definition: FW3DViewBase.h:85
void showTrackerEndcap(bool)
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:83
void showTrackerBarrel(bool)
void showMuonEndcap(bool)
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:82
FWBoolParameter m_showHGCalHSi
Definition: FW3DViewBase.h:86
void showPixelBarrel(bool)
FWBoolParameter m_showHGCalHSc
Definition: FW3DViewBase.h:87
FWBoolParameter m_showEcalBarrel
Definition: FW3DViewBase.h:90
TEveScene * geoScene()
Definition: FWEveView.h:80
void showPixelEndcap(bool)
sigc::signal< void, T > changed_
TEveLine * m_DMTline
Definition: FW3DViewBase.h:107
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:75
virtual void setContext(const fireworks::Context &x)
Definition: FWEveView.cc:227
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:84
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:81
void FW3DViewBase::setCurrentDMTVertex ( double  x,
double  y,
double  z 
)

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

458  {
460  printf("ERROR!!!! FW3DViewBase::setCurrentDMTVertex \n");
461 
462  m_DMTline->SetPoint(m_DMT->m_action, x, y, z);
463  m_DMTline->ElementChanged();
464  viewerGL()->RequestDraw();
465 
466  m_DMT->refCurrentVertex().Set(x, y, z);
467  m_DMT->resetAction();
468 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:106
TEveLine * m_DMTline
Definition: FW3DViewBase.h:107
void FW3DViewBase::setFrom ( const FWConfiguration iFrom)
overridevirtual

Implements FWConfigurable.

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

438  {
439  // take care of parameters
440  FWEveView::setFrom(iFrom);
441 
442  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
443  if (camera)
444  setFromPerspectiveCamera(camera, "Plain3D", iFrom);
445 
446  if (iFrom.version() < 5) {
447  // transparency moved to common preferences in FWEveView version 5
448  std::string tName("Detector Transparency");
449  std::istringstream s(iFrom.valueForKey(tName)->value());
450  int transp;
451  s >> transp;
452  context().colorManager()->setGeomTransparency(transp, false);
453  }
454 }
FWColorManager * colorManager() const
Definition: Context.h:58
unsigned int version() const
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
void setGeomTransparency(Color_t idx, bool projectedType)
const std::string & value(unsigned int iIndex=0) const
const fireworks::Context & context()
Definition: FWEveView.h:64
void setFrom(const FWConfiguration &) override
Definition: FWEveView.cc:307
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
Definition: FWEveView.cc:420
const FWConfiguration * valueForKey(const std::string &iKey) const
void FW3DViewBase::showEcalBarrel ( bool  x)

Definition at line 508 of file FW3DViewBase.cc.

References FWEveView::context(), 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().

508  {
509  if (x && m_ecalBarrel->GetPlex()->Size() == 0) {
510  const FWGeometry* geom = context().getGeom();
511  std::vector<unsigned int> ids =
512  geom->getMatchedIds(FWGeometry::Detector::Ecal, FWGeometry::SubDetector::PixelBarrel);
513  m_ecalBarrel->Reset(TEveBoxSet::kBT_FreeBox, true, ids.size());
514  for (std::vector<unsigned int>::iterator it = ids.begin(); it != ids.end(); ++it) {
515  const float* cor = context().getGeom()->getCorners(*it);
516  m_ecalBarrel->AddBox(cor);
517  }
518  m_ecalBarrel->RefitPlex();
519  }
520 
521  if (m_ecalBarrel->GetRnrSelf() != x) {
522  m_ecalBarrel->SetRnrSelf(x);
523  gEve->Redraw3D();
524  }
525 
526  // disable enable grid in 3DView
527  if (typeId() == FWViewType::k3D) {
528  TEveElement* calo = eventScene()->FindChild("calo barrel");
529  if (calo) {
530  TEveCalo3D* c3d = dynamic_cast<TEveCalo3D*>(calo);
531  c3d->SetRnrFrame(!x, !x);
532  c3d->ElementChanged();
533  }
534  }
535 }
TEveScene * eventScene()
Definition: FWEveView.h:79
const fireworks::Context & context()
Definition: FWEveView.h:64
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:463
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:250
TEveBoxSet * m_ecalBarrel
Definition: FW3DViewBase.h:89
FWGeometry * getGeom() const
Definition: Context.h:72
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
void FW3DViewBase::showMuonBarrel ( long  x)
private

Definition at line 200 of file FW3DViewBase.cc.

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

Referenced by FW3DViewBase().

200  {
201  if (m_geometry) {
202  m_geometry->showMuonBarrel(x == 1);
204  }
205 }
void showMuonBarrel(bool)
void showMuonBarrelFull(bool)
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:75
void FW3DViewBase::updateClipPlanes ( bool  resetCamera)
private

Definition at line 316 of file FW3DViewBase.cc.

References parametrizedMagneticField_OAE85l_cfi::b0, HltBtagPostValidation_cff::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().

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

Definition at line 387 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, overlapproblemtsosanalyzer_cfi::title, and FWGenericParameter< T >::value().

Referenced by enableSceneClip(), and FW3DViewBase().

387  {
388  if (!m_clipEnable.value())
389  return;
390 
391  long lmin = m_clipHGCalLayerBegin.value();
392  long lmax = m_clipHGCalLayerEnd.value();
393 
394  // real min, max
395  long r_lmin = std::min(lmin, lmax);
396  long r_lmax = std::max(lmin, lmax);
397 
398  TEveElementList const* const HGCalEE = m_geometry->getHGCalEE();
399  if (HGCalEE) {
400  for (const auto& it : HGCalEE->RefChildren()) {
401  std::string title(it->GetElementTitle());
402  int layer = stoi(title.substr(title.length() - 2));
403  it->SetRnrState(layer >= r_lmin && layer <= r_lmax);
404  }
405  }
406 
407  TEveElementList const* const HGCalHSi = m_geometry->getHGCalHSi();
408  if (HGCalHSi) {
409  for (const auto& it : HGCalHSi->RefChildren()) {
410  std::string title(it->GetElementTitle());
411  int layer = stoi(title.substr(title.length() - 2)) + 28;
412  it->SetRnrState(layer >= r_lmin && layer <= r_lmax);
413  }
414  }
415 
416  TEveElementList const* const HGCalHSc = m_geometry->getHGCalHSc();
417  if (HGCalHSc) {
418  for (const auto& it : HGCalHSc->RefChildren()) {
419  std::string title(it->GetElementTitle());
420  int layer = stoi(title.substr(title.length() - 2)) + 28;
421  it->SetRnrState(layer >= r_lmin && layer <= r_lmax);
422  }
423  }
424 
425  gEve->Redraw3D();
426 }
TEveElementList const *const getHGCalHSc()
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:97
TEveElementList const *const getHGCalHSi()
T min(T a, T b)
Definition: MathUtil.h:58
FWLongParameter m_clipHGCalLayerBegin
Definition: FW3DViewBase.h:103
TEveElementList const *const getHGCalEE()
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:75
FWLongParameter m_clipHGCalLayerEnd
Definition: FW3DViewBase.h:104

Member Data Documentation

FWEnumParameter FW3DViewBase::m_cameraType
private

Definition at line 95 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWLongParameter FW3DViewBase::m_clipAppexOffset
private

Definition at line 102 of file FW3DViewBase.h.

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

FWDoubleParameter FW3DViewBase::m_clipDelta1
private

Definition at line 100 of file FW3DViewBase.h.

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

FWDoubleParameter FW3DViewBase::m_clipDelta2
private

Definition at line 101 of file FW3DViewBase.h.

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

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

Definition at line 103 of file FW3DViewBase.h.

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

FWLongParameter FW3DViewBase::m_clipHGCalLayerEnd
private

Definition at line 104 of file FW3DViewBase.h.

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

FWDoubleParameter FW3DViewBase::m_clipPhi
private

Definition at line 99 of file FW3DViewBase.h.

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

FWDoubleParameter FW3DViewBase::m_clipTheta
private

Definition at line 98 of file FW3DViewBase.h.

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

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

Definition at line 107 of file FW3DViewBase.h.

Referenced by setContext(), and setCurrentDMTVertex().

TEveBoxSet* FW3DViewBase::m_ecalBarrel
private

Definition at line 89 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and showEcalBarrel().

FW3DViewGeometry* FW3DViewBase::m_geometry
private

Definition at line 75 of file FW3DViewBase.h.

Referenced by setContext(), showMuonBarrel(), and updateHGCalVisibility().

TGLClip* FW3DViewBase::m_glClip
private

Definition at line 76 of file FW3DViewBase.h.

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

FWEnumParameter FW3DViewBase::m_rnrStyle
private

Definition at line 92 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWBoolParameter FW3DViewBase::m_selectable
private

Definition at line 93 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWBoolParameter FW3DViewBase::m_showEcalBarrel
private

Definition at line 90 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showHGCalEE
private

Definition at line 85 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showHGCalHSc
private

Definition at line 87 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showHGCalHSi
private

Definition at line 86 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWEnumParameter FW3DViewBase::m_showMuonBarrel
private

Definition at line 79 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWBoolParameter FW3DViewBase::m_showMuonEndcap
private

Definition at line 80 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showPixelBarrel
private

Definition at line 81 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showPixelEndcap
private

Definition at line 82 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showTrackerBarrel
private

Definition at line 83 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showTrackerEndcap
private

Definition at line 84 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().