CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual void addTo (FWConfiguration &) const
 
 FW3DViewBase (TEveWindowSlot *, FWViewType::EType, unsigned int version=8)
 
FW3DViewDistanceMeasureToolgetDMT ()
 
virtual void populateController (ViewerParameterGUI &) const
 
virtual bool requestGLHandlerPick () const
 
void setClip (float eta, float phi)
 
virtual void setContext (const fireworks::Context &)
 
void setCurrentDMTVertex (double x, double y, double z)
 
virtual void setFrom (const FWConfiguration &)
 
void showEcalBarrel (bool)
 
void updateGlobalSceneScaleParameters ()
 
virtual ~FW3DViewBase ()
 
- Public Member Functions inherited from FWEveView
const fireworks::Contextcontext ()
 
virtual
FWViewContextMenuHandlerBase
contextMenuHandler () const
 
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 ()
 
virtual void saveImageTo (const std::string &iName) const
 
virtual void setBackgroundColor (Color_t)
 
virtual void setupEnergyScale ()
 
virtual void useGlobalEnergyScaleChanged ()
 
FWViewContextviewContext ()
 
TEveViewer * viewer ()
 
TGLViewer * viewerGL () const
 
virtual void voteCaloMaxVal ()
 
virtual ~FWEveView ()
 
- 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
 
virtual ~FWConfigurableParameterizable ()
 
- 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 ()
 

Private Attributes

FWEnumParameter m_cameraType
 
FWDoubleParameter m_clipDelta1
 
FWDoubleParameter m_clipDelta2
 
FWBoolParameter m_clipEnable
 
FWDoubleParameter m_clipEta
 
FWDoubleParameter m_clipPhi
 
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
virtual ~FWViewBase ()
 
- 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 97 of file FW3DViewBase.cc.

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

97  :
98  FWEveView(iParent, typeId, version ),
99  m_geometry(0),
100  m_glClip(0),
101  m_showMuonBarrel(this, "Show Muon Barrel", 0l, 0l, 2l ),
102  m_showMuonEndcap(this, "Show Muon Endcap", false ),
103  m_showPixelBarrel(this, "Show Pixel Barrel", false ),
104  m_showPixelEndcap(this, "Show Pixel Endcap", false),
105  m_showTrackerBarrel(this, "Show Tracker Barrel", false ),
106  m_showTrackerEndcap(this, "Show Tracker Endcap", false),
107  m_ecalBarrel(0),
108  m_showEcalBarrel(this, "Show Ecal Barrel", typeId == FWViewType::kISpy ? true : false),
109  m_rnrStyle(this, "Render Style", 0l, 0l, 2l),
110  m_selectable(this, "Enable Tooltips", false),
111  m_cameraType(this, "Camera Type", 0l, 0l, 5l),
112  m_clipEnable(this, "Enable Clip", false),
113  m_clipEta(this, "Clip Eta", 0.0, -5.0, 5.0),
114  m_clipPhi(this, "Clip Phi", 0.0, -2.0, 2.0),
115  m_clipDelta1(this, "Clip Delta1", 0.2, 0.01, 2),
116  m_clipDelta2(this, "Clip Delta2", 0.2, 0.01, 2),
117  m_DMT(0),
118  m_DMTline(0)
119 {
120  viewerGL()->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
122 
123  m_showMuonBarrel.addEntry(0, "Hide");
124  m_showMuonBarrel.addEntry(1, "Simplified");
125  m_showMuonBarrel.addEntry(2, "Full");
126  m_showMuonBarrel.changed_.connect(boost::bind(&FW3DViewBase::showMuonBarrel,this,_1));
127 
128  m_rnrStyle.addEntry(TGLRnrCtx::kFill, "Fill");
129  m_rnrStyle.addEntry(TGLRnrCtx::kOutline, "Outline");
130  m_rnrStyle.addEntry(TGLRnrCtx::kWireFrame, "WireFrame");
131  m_rnrStyle.changed_.connect(boost::bind(&FW3DViewBase::rnrStyle,this, _1));
132 
133  m_selectable.changed_.connect(boost::bind(&FW3DViewBase::selectable,this, _1));
134 
135 
136  m_cameraType.addEntry(TGLViewer::kCameraPerspXOZ,"PerspXOZ" );
137  m_cameraType.addEntry(TGLViewer::kCameraOrthoXOY,"OrthoXOY");
138  m_cameraType.addEntry(TGLViewer::kCameraOrthoXOZ,"OrthoXOZ");
139  m_cameraType.addEntry(TGLViewer::kCameraOrthoZOY,"OrthoZOY" );
140  m_cameraType.addEntry(TGLViewer::kCameraOrthoXnOY,"OrthoXnOY");
141  m_cameraType.addEntry(TGLViewer::kCameraOrthoXnOZ,"OrthoXnOZ");
142  m_cameraType.addEntry(TGLViewer::kCameraOrthoZnOY,"OrthoZnOY" );
143  m_cameraType.changed_.connect(boost::bind(&FW3DViewBase::setCameraType,this, _1));
144 
145  m_clipEnable.changed_.connect(boost::bind(&FW3DViewBase::enableSceneClip,this, _1));
146  m_clipEta.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this));
147  m_clipPhi.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this));
148  m_clipDelta1.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this));
149  m_clipDelta2.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this));
150 
151 
152  m_ecalBarrel = new TEveBoxSet("ecalBarrel");
153  m_ecalBarrel->UseSingleColor();
154  m_ecalBarrel->SetMainColor(kAzure+10);
155  m_ecalBarrel->SetMainTransparency(98);
156  geoScene()->AddElement(m_ecalBarrel);
157 }
FWDoubleParameter m_clipEta
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:194
sigc::signal< void, T > changed_
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:102
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()
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:81
TGLClip * m_glClip
Definition: FW3DViewBase.h:77
TEveLine * m_DMTline
Definition: FW3DViewBase.h:103
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
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:41
FW3DViewBase::~FW3DViewBase ( )
virtual

Definition at line 159 of file FW3DViewBase.cc.

References m_glClip.

160 {
161  delete m_glClip;
162 }
TGLClip * m_glClip
Definition: FW3DViewBase.h:77
FW3DViewBase::FW3DViewBase ( const FW3DViewBase )
private

Member Function Documentation

void FW3DViewBase::addTo ( FWConfiguration iTo) const
virtual

Reimplemented from FWEveView.

Definition at line 332 of file FW3DViewBase.cc.

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

333 {
334  // take care of parameters
335  FWEveView::addTo(iTo);
336  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
337  if (camera)
338  addToPerspectiveCamera(camera, "Plain3D", iTo);
339 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
virtual void addTo(FWConfiguration &) const
Definition: FWEveView.cc:346
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
Definition: FWEveView.cc:474
void FW3DViewBase::enableSceneClip ( bool  x)
private

Definition at line 226 of file FW3DViewBase.cc.

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

Referenced by FW3DViewBase().

227 {
228  if (m_glClip == 0) {
229  m_glClip = new Clipsi(viewerGL()->GetRnrCtx());
230 
231  m_glClip->SetMode(TGLClip::kOutside);
232  }
233 
234  geoScene()->GetGLScene()->SetClip(x ? m_glClip : 0);
235  for (TEveElement::List_i it =gEve->GetScenes()->BeginChildren(); it != gEve->GetScenes()->EndChildren(); ++it )
236  {
237  if (strncmp((*it)->GetElementName(), "TopGeoNodeScene", 15) == 0)
238  ((TEveScene*)(*it))->GetGLScene()->SetClip(x ? m_glClip : 0);
239  }
240  eventScene()->GetGLScene()->SetClip(x ? m_glClip : 0);
242  viewerGL()->RequestDraw();
243 }
TEveScene * eventScene()
Definition: FWEveView.h:82
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
void updateClipPlanes()
TEveScene * geoScene()
Definition: FWEveView.h:83
TGLClip * m_glClip
Definition: FW3DViewBase.h:77
Definition: DDAxes.h:10
FW3DViewDistanceMeasureTool* FW3DViewBase::getDMT ( )
inline

Definition at line 62 of file FW3DViewBase.h.

References m_DMT.

62 { return m_DMT;}
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:102
const FW3DViewBase& FW3DViewBase::operator= ( const FW3DViewBase )
private
void FW3DViewBase::populateController ( ViewerParameterGUI gui) const
virtual

Reimplemented from FWEveView.

Reimplemented in FWISpyView.

Definition at line 382 of file FW3DViewBase.cc.

References ViewerParameterGUI::addParam(), FW3DViewDistanceMeasureTool::buildGUI(), ViewerParameterGUI::getTabContainer(), m_cameraType, m_clipDelta1, m_clipDelta2, m_clipEnable, m_clipEta, m_clipPhi, 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().

383 {
385 
386  gui.requestTab("Detector").
387  addParam(&m_showMuonBarrel).
388  addParam(&m_showMuonEndcap).
389  addParam(&m_showTrackerBarrel).
390  addParam(&m_showTrackerEndcap).
391  addParam(&m_showPixelBarrel).
392  addParam(&m_showPixelEndcap).
393  addParam(&m_showEcalBarrel).
394  addParam(&m_rnrStyle).
395  addParam(&m_selectable).
396  separator().
397  addParam(&m_clipEnable).
398  addParam(&m_clipEta).
399  addParam(&m_clipPhi).
400  addParam(&m_clipDelta1).
401  addParam(&m_clipDelta2);
402 
403 
404  gui.requestTab("Style").separator();
405  gui.getTabContainer()->AddFrame(new TGTextButton(gui.getTabContainer(), "Root controls",
406  Form("TEveGedEditor::SpawnNewEditor((TGLViewer*)0x%lx)", (unsigned long)viewerGL())));
407 
408  gui.requestTab("Tools").addParam(&m_cameraType).separator();
409  gui.getTabContainer()->AddFrame(m_DMT->buildGUI( gui.getTabContainer()), new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
410 }
FWDoubleParameter m_clipEta
Definition: FW3DViewBase.h:96
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:81
virtual void populateController(ViewerParameterGUI &) const
Definition: FWEveView.cc:556
ViewerParameterGUI & requestTab(const char *)
ViewerParameterGUI & separator()
TGCompositeFrame * buildGUI(TGCompositeFrame *p)
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:84
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:102
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
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:85
FWDoubleParameter m_clipDelta2
Definition: FW3DViewBase.h:99
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:82
bool FW3DViewBase::requestGLHandlerPick ( ) const
virtual
void FW3DViewBase::rnrStyle ( long  x)
private

Definition at line 213 of file FW3DViewBase.cc.

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

Referenced by FW3DViewBase().

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

Definition at line 221 of file FW3DViewBase.cc.

References FWEveView::geoScene().

Referenced by FW3DViewBase().

222 {
223  geoScene()->GetGLScene()->SetSelectable(x);
224 }
TEveScene * geoScene()
Definition: FWEveView.h:83
Definition: DDAxes.h:10
void FW3DViewBase::setCameraType ( long  x)
private

Definition at line 203 of file FW3DViewBase.cc.

References FWEveView::viewerGL().

Referenced by FW3DViewBase().

204 {
205  viewerGL()->RefCamera(TGLViewer::ECameraType(x)).IncTimeStamp();
206  viewerGL()->SetCurrentCamera(TGLViewer::ECameraType(x));
207 
208  //if (viewerGL()->CurrentCamera().IsOrthographic())
209  // ((TGLOrthoCamera*)(&viewerGL()->CurrentCamera()))->SetEnableRotate(1);
210 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
Definition: DDAxes.h:10
void FW3DViewBase::setClip ( float  eta,
float  phi 
)

Definition at line 246 of file FW3DViewBase.cc.

References m_clipEnable, m_clipEta, m_clipPhi, and FWGenericParameter< T >::set().

Referenced by FWGUIManager::open3DRegion().

247 {
248  // called from popup menu via FWGUIManager
249  /*
250  m_showMuonBarrel.set(1);
251  m_showMuonEndcap.set(true);
252  m_showPixelBarrel.set(true);
253  m_showPixelEndcap.set(true);
254  m_showTrackerBarrel.set(true);
255  */
256  m_clipEta.set(eta);
257  m_clipPhi.set(phi);
258  m_clipEnable.set(true);
259 }
FWDoubleParameter m_clipEta
Definition: FW3DViewBase.h:96
T eta() const
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:97
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:95
Definition: DDAxes.h:10
void FW3DViewBase::setContext ( const fireworks::Context context)
virtual

Reimplemented from FWEveView.

Reimplemented in FW3DView, and FWISpyView.

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

165 {
166  FWEveView::setContext(context);
167 
168  m_geometry = new FW3DViewGeometry(context);
169  geoScene()->AddElement(m_geometry);
170 
176  m_showEcalBarrel.changed_.connect(boost::bind(&FW3DViewBase::showEcalBarrel, this,_1));
177 
178  // don't clip event scene -- ideally, would have TGLClipNoClip in root
179  TGLClipPlane* c=new TGLClipPlane();
180  c->Setup(TGLVector3(1e10,0,0), TGLVector3(-1,0,0));
181  eventScene()->GetGLScene()->SetClip(c);
182 
183  m_DMTline = new TEveLine();
184  m_DMTline->SetLineColor(1016);
185  m_DMTline->SetLineStyle(5);
186 
187 
188  m_DMTline->SetPoint(0, 0, 0, 0);
189  m_DMTline->SetPoint(1, 0, 0, 0);
190  eventScene()->AddElement(m_DMTline);
192 }
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:103
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:76
virtual void setContext(const fireworks::Context &x)
Definition: FWEveView.cc:275
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 368 of file FW3DViewBase.cc.

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

Referenced by FWGLEventHandler::HandleButton().

369 {
371  printf( "ERROR!!!! FW3DViewBase::setCurrentDMTVertex \n");
372 
373  m_DMTline->SetPoint(m_DMT->m_action, x, y, z);
374  m_DMTline->ElementChanged();
375  viewerGL()->RequestDraw();
376 
377  m_DMT->refCurrentVertex().Set(x, y,z);
378  m_DMT->resetAction();
379 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:102
float float float z
TEveLine * m_DMTline
Definition: FW3DViewBase.h:103
Definition: DDAxes.h:10
void FW3DViewBase::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWEveView.

Definition at line 343 of file FW3DViewBase.cc.

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

344 {
345  // take care of parameters
346  FWEveView::setFrom(iFrom);
347 
348  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
349  if (camera)
350  setFromPerspectiveCamera(camera, "Plain3D", iFrom);
351 
352  if (iFrom.version() < 5)
353  {
354  // transparency moved to common preferences in FWEveView version 5
355  std::string tName("Detector Transparency");
356  std::istringstream s(iFrom.valueForKey(tName)->value());
357  int transp;
358  s>> transp;
359  context().colorManager()->setGeomTransparency(transp, false);
360  }
361 }
FWColorManager * colorManager() const
Definition: Context.h:65
virtual void setFrom(const FWConfiguration &)
Definition: FWEveView.cc:364
unsigned int version() const
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
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 setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
Definition: FWEveView.cc:503
const FWConfiguration * valueForKey(const std::string &iKey) const
void FW3DViewBase::showEcalBarrel ( bool  x)

Definition at line 412 of file FW3DViewBase.cc.

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

Referenced by setContext().

412  {
413  if (x && m_ecalBarrel->GetPlex()->Size() == 0) {
414  const FWGeometry* geom = context().getGeom();
415  std::vector<unsigned int> ids = geom->getMatchedIds(FWGeometry::Detector::Ecal, FWGeometry::SubDetector::PixelBarrel);
416  m_ecalBarrel->Reset(TEveBoxSet::kBT_FreeBox, true, ids.size() );
417  for (std::vector<unsigned int>::iterator it = ids.begin(); it != ids.end(); ++it) {
418  const float* cor = context().getGeom()->getCorners(*it);
419  m_ecalBarrel->AddBox(cor);
420  }
421  m_ecalBarrel->RefitPlex();
422  }
423 
424  if (m_ecalBarrel->GetRnrSelf() != x) {
425  m_ecalBarrel->SetRnrSelf(x);
426  gEve->Redraw3D();
427  }
428 
429  // disable enable grid in 3DView
430  if (typeId() == FWViewType::k3D) {
431  TEveElement* calo = eventScene()->FindChild("calo barrel");
432  if (calo) {
433  TEveCalo3D* c3d = dynamic_cast<TEveCalo3D*>(calo);
434  c3d->SetRnrFrame(!x, !x);
435  c3d->ElementChanged();
436  }
437  }
438 }
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:280
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:197
TEveBoxSet * m_ecalBarrel
Definition: FW3DViewBase.h:87
Definition: DDAxes.h:10
FWViewType::EType typeId() const
Definition: FWViewBase.h:41
void FW3DViewBase::showMuonBarrel ( long  x)
private

Definition at line 194 of file FW3DViewBase.cc.

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

Referenced by FW3DViewBase().

195 {
196  if (m_geometry)
197  {
198  m_geometry->showMuonBarrel(x == 1);
200  }
201 }
void showMuonBarrel(bool)
void showMuonBarrelFull(bool)
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:76
Definition: DDAxes.h:10
void FW3DViewBase::updateClipPlanes ( )
private

Definition at line 262 of file FW3DViewBase.cc.

References EnergyCorrector::c, eta(), FWEveView::eventScene(), i, recoMuon::in, m_clipDelta1, m_clipDelta2, m_clipEnable, m_clipEta, m_clipPhi, m_glClip, cmsHarvester::marker, phi, and FWGenericParameter< T >::value().

Referenced by enableSceneClip(), and FW3DViewBase().

263 {
264  // TEveScene* gs = (TEveScene*)gEve->GetScenes()->FindChild(TString("TopGeoNodeScene"));
265  //printf("node scene %p\n", gs);
266  if (m_clipEnable.value())
267  {
268  float eta = m_clipEta.value();
269  float phi = m_clipPhi.value();
270  using namespace TMath;
271  TEveVector in(Sin(eta)*Cos(phi), Sin(eta)*Sin(phi), Cos(eta));
272 
273  // one side of cross section plane is paralel to XY plane
274  TEveVector normXY(0., 1., 0);
275  TEveVector b0 = in.Cross(normXY);
276  TEveVector b1 = in.Cross(b0);
277 
278  float delta1 = m_clipDelta1.value();
279  float delta2 = m_clipDelta2.value();
280  b0.Normalize();
281  b0 *= Sin(delta1);
282  b1.Normalize();
283  b1 *= Sin(delta2);
284 
285  TEveVector c[4];
286  c[0] += b0; c[0] += b1;
287  c[1] -= b0; c[1] += b1;
288  c[2] -= b0; c[2] -= b1;
289  c[3] += b0; c[3] -= b1;
290  for (int i = 0; i < 4; ++i)
291  c[i] += in;
292 
293  ((Clipsi*)m_glClip)->SetPlaneInfo(&c[0]);
294 
295  /*
296  // debug
297  TEveStraightLineSet* ls = (TEveStraightLineSet*)eventScene()->FindChild(TString("Frust"));
298  if (!ls) {
299  ls = new TEveStraightLineSet("Frust");
300  eventScene()->AddElement(ls);
301  ls->SetMainColor(kWhite);
302  }
303 
304  in *= 500;
305  ls->AddLine(0, 0, 0, in.fX, in.fY, in.fZ);
306  */
307 
308 
309  TEvePointSet* psi = (TEvePointSet*)eventScene()->FindChild(TString("marker"));
310  TEvePointSet* marker = (TEvePointSet*)(psi);
311  if (!marker) {
312  marker = new TEvePointSet(8);
313  marker->Reset(4);
314  marker->SetName("marker");
315  marker->SetMarkerColor(kOrange);
316  marker->SetMarkerStyle(3);
317  marker->SetMarkerSize(0.2);
318  }
319  for (int i = 0; i < 4; ++i)
320  marker->SetPoint(i, c[i].fX, c[i].fY, c[i].fZ);
321  eventScene()->AddElement(marker);
322  }
323  /*
324  else {
325  fwLog(fwlog::kError) << "Clipping is not enabled!\n";
326  }
327  */
328 }
FWDoubleParameter m_clipEta
Definition: FW3DViewBase.h:96
int i
Definition: DBlmapReader.cc:9
TEveScene * eventScene()
Definition: FWEveView.h:82
T eta() const
std::map< std::string, int, std::less< std::string > > psi
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:97
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:95
FWDoubleParameter m_clipDelta1
Definition: FW3DViewBase.h:98
TGLClip * m_glClip
Definition: FW3DViewBase.h:77
FWDoubleParameter m_clipDelta2
Definition: FW3DViewBase.h:99
Definition: DDAxes.h:10
void FW3DViewBase::updateGlobalSceneScaleParameters ( )

Member Data Documentation

FWEnumParameter FW3DViewBase::m_cameraType
private

Definition at line 93 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

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_clipEta
private

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

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

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