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 (bool resetCamera)
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from FWParameterizable
typedef std::vector
< FWParameterBase * >
::const_iterator 
const_iterator
 
- Public Attributes inherited from FWViewBase
sigc::signal< void, const
FWViewBase * > 
beingDestroyed_
 
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
 
- Protected Member Functions inherited from FWEveView
void addToOrthoCamera (TGLOrthoCamera *, FWConfiguration &) const
 
void addToPerspectiveCamera (TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
 
virtual void cameraGuideChanged ()
 
virtual TEveCaloViz * getEveCalo () const
 
virtual void pointLineScalesChanged ()
 
virtual void resetCamera ()
 
void setFromOrthoCamera (TGLOrthoCamera *, const FWConfiguration &)
 
void setFromPerspectiveCamera (TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
 
- Protected Member Functions inherited from FWViewBase
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_clipPhi, m_clipTheta, 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_clipTheta(this, "Clip Theta", 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_clipTheta.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this, false));
147  m_clipPhi.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this, false));
148  m_clipDelta1.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this, false));
149  m_clipDelta2.changed_.connect(boost::bind(&FW3DViewBase::updateClipPlanes,this, false));
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_clipTheta
Definition: FW3DViewBase.h:96
void showMuonBarrel(long)
void rnrStyle(long)
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:81
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:84
TGLViewer * viewerGL() const
Definition: FWEveView.cc: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(bool resetCamera)
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:95
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:83
FWDoubleParameter m_clipDelta1
Definition: FW3DViewBase.h:98
bool addEntry(Long_t id, const std::string &txt)
FWBoolParameter m_showEcalBarrel
Definition: FW3DViewBase.h:88
TEveScene * geoScene()
Definition: FWEveView.h:83
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
Definition: FWEveView.cc: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 384 of file FW3DViewBase.cc.

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

385 {
386  // take care of parameters
387  FWEveView::addTo(iTo);
388  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
389  if (camera)
390  addToPerspectiveCamera(camera, "Plain3D", iTo);
391 }
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);
241  updateClipPlanes(true);
242  viewerGL()->RequestDraw();
243 }
TEveScene * eventScene()
Definition: FWEveView.h:82
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
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 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 434 of file FW3DViewBase.cc.

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

Referenced by FWISpyView::populateController().

435 {
437 
438  gui.requestTab("Detector").
439  addParam(&m_showMuonBarrel).
440  addParam(&m_showMuonEndcap).
441  addParam(&m_showTrackerBarrel).
442  addParam(&m_showTrackerEndcap).
443  addParam(&m_showPixelBarrel).
444  addParam(&m_showPixelEndcap).
445  addParam(&m_showEcalBarrel).
446  addParam(&m_rnrStyle).
447  addParam(&m_selectable).
448  separator().
449  addParam(&m_clipEnable).
450  addParam(&m_clipTheta).
451  addParam(&m_clipPhi).
452  addParam(&m_clipDelta1).
453  addParam(&m_clipDelta2);
454 
455 
456  gui.requestTab("Style").separator();
457  gui.getTabContainer()->AddFrame(new TGTextButton(gui.getTabContainer(), "Root controls",
458  Form("TEveGedEditor::SpawnNewEditor((TGLViewer*)0x%lx)", (unsigned long)viewerGL())));
459 
460  gui.requestTab("Tools").addParam(&m_cameraType).separator();
461  gui.getTabContainer()->AddFrame(m_DMT->buildGUI( gui.getTabContainer()), new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));
462 }
FWDoubleParameter m_clipTheta
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
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
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
void FW3DViewBase::setClip ( float  eta,
float  phi 
)

Definition at line 246 of file FW3DViewBase.cc.

References newFWLiteAna::base, m_clipEnable, m_clipPhi, m_clipTheta, and FWGenericParameter< T >::set().

247 {
248  // called from popup menu via FWGUIManager
249 
250  // limit to 2 decimals, else TGNumber entry in the view controller shows only last 5 irrelevant digits
251  double base = 100.0;
252  int thetaInt = theta*base;
253  int phiInt = phi*base;
254  m_clipTheta.set(thetaInt/base);
255  m_clipPhi.set(phiInt/base);
256  m_clipEnable.set(true);
257 }
tuple base
Main Program
Definition: newFWLiteAna.py:92
FWDoubleParameter m_clipTheta
Definition: FW3DViewBase.h:96
Geom::Theta< T > theta() const
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:97
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:95
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 420 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().

421 {
423  printf( "ERROR!!!! FW3DViewBase::setCurrentDMTVertex \n");
424 
425  m_DMTline->SetPoint(m_DMT->m_action, x, y, z);
426  m_DMTline->ElementChanged();
427  viewerGL()->RequestDraw();
428 
429  m_DMT->refCurrentVertex().Set(x, y,z);
430  m_DMT->resetAction();
431 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
FW3DViewDistanceMeasureTool * m_DMT
Definition: FW3DViewBase.h:102
TEveLine * m_DMTline
Definition: FW3DViewBase.h:103
void FW3DViewBase::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWEveView.

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

396 {
397  // take care of parameters
398  FWEveView::setFrom(iFrom);
399 
400  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
401  if (camera)
402  setFromPerspectiveCamera(camera, "Plain3D", iFrom);
403 
404  if (iFrom.version() < 5)
405  {
406  // transparency moved to common preferences in FWEveView version 5
407  std::string tName("Detector Transparency");
408  std::istringstream s(iFrom.valueForKey(tName)->value());
409  int transp;
410  s>> transp;
411  context().colorManager()->setGeomTransparency(transp, false);
412  }
413 }
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 464 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().

464  {
465  if (x && m_ecalBarrel->GetPlex()->Size() == 0) {
466  const FWGeometry* geom = context().getGeom();
467  std::vector<unsigned int> ids = geom->getMatchedIds(FWGeometry::Detector::Ecal, FWGeometry::SubDetector::PixelBarrel);
468  m_ecalBarrel->Reset(TEveBoxSet::kBT_FreeBox, true, ids.size() );
469  for (std::vector<unsigned int>::iterator it = ids.begin(); it != ids.end(); ++it) {
470  const float* cor = context().getGeom()->getCorners(*it);
471  m_ecalBarrel->AddBox(cor);
472  }
473  m_ecalBarrel->RefitPlex();
474  }
475 
476  if (m_ecalBarrel->GetRnrSelf() != x) {
477  m_ecalBarrel->SetRnrSelf(x);
478  gEve->Redraw3D();
479  }
480 
481  // disable enable grid in 3DView
482  if (typeId() == FWViewType::k3D) {
483  TEveElement* calo = eventScene()->FindChild("calo barrel");
484  if (calo) {
485  TEveCalo3D* c3d = dynamic_cast<TEveCalo3D*>(calo);
486  c3d->SetRnrFrame(!x, !x);
487  c3d->ElementChanged();
488  }
489  }
490 }
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
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
void FW3DViewBase::updateClipPlanes ( bool  resetCamera)
private

Definition at line 315 of file FW3DViewBase.cc.

References EnergyCorrector::c, FWEveView::eventScene(), FWEveView::geoScene(), trackerHitRTTI::gs, i, recoMuon::in, 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  {
321  float theta = m_clipTheta.value();
322  float phi = m_clipPhi.value();
323  using namespace TMath;
324  TEveVector in(Sin(theta)*Cos(phi), Sin(theta)*Sin(phi), Cos(theta));
325 
326  // one side of cross section plane is paralel to XY plane
327  TEveVector normXY(0., 1., 0);
328  TEveVector b0 = in.Cross(normXY);
329  TEveVector b1 = in.Cross(b0);
330 
331  float delta1 = m_clipDelta1.value();
332  float delta2 = m_clipDelta2.value();
333  b0.Normalize();
334  b0 *= Sin(delta1);
335  b1.Normalize();
336  b1 *= Sin(delta2);
337 
338  TEveVector c[4];
339  c[0] += b0; c[0] += b1;
340  c[1] -= b0; c[1] += b1;
341  c[2] -= b0; c[2] -= b1;
342  c[3] += b0; c[3] -= b1;
343  for (int i = 0; i < 4; ++i)
344  c[i] += in;
345 
346  ((Clipsi*)m_glClip)->SetPlaneInfo(&c[0]);
347 
348 
349  if (resetCamera) {
350  TGLBoundingBox bbox;
351  float es = getBBoxLineLength(eventScene(), in);
352  float gs = getBBoxLineLength(geoScene(), in);
353  setBBoxClipped(bbox, in, b0, b1, TMath::Max(es, gs));
354 
355  /*
356  TEvePointSet* bmarker = new TEvePointSet(8);
357  bmarker->Reset(4);
358  bmarker->SetName("bbox");
359  bmarker->SetMarkerColor(kOrange);
360  bmarker->SetMarkerStyle(3);
361  bmarker->SetMarkerSize(0.2);
362  for (int i = 0; i < 8; ++i)
363  bmarker->SetPoint(i, bbox[i].X(), bbox[i].Y(), bbox[i].Z());
364  eventScene()->AddElement(bmarker);
365  */
366 
367 
368  TGLCamera& cam = viewerGL()->CurrentCamera();
369  cam.SetExternalCenter(true);
370  cam.SetCenterVec(bbox.Center().X(), bbox.Center().Y(), bbox.Center().Z());
371  cam.Setup(bbox, true);
372  }
373  else {
374  eventScene()->Repaint();
375  }
376  }
377 
378  gEve->Redraw3D();
379 
380 }
FWDoubleParameter m_clipTheta
Definition: FW3DViewBase.h:96
int i
Definition: DBlmapReader.cc:9
TEveScene * eventScene()
Definition: FWEveView.h:82
Geom::Theta< T > theta() const
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
FWDoubleParameter m_clipPhi
Definition: FW3DViewBase.h:97
FWBoolParameter m_clipEnable
Definition: FW3DViewBase.h:95
FWDoubleParameter m_clipDelta1
Definition: FW3DViewBase.h:98
virtual void resetCamera()
Definition: FWEveView.cc:268
T Max(T a, T b)
Definition: MathUtil.h:44
TEveScene * geoScene()
Definition: FWEveView.h:83
TGLClip * m_glClip
Definition: FW3DViewBase.h:77
FWDoubleParameter m_clipDelta2
Definition: FW3DViewBase.h:99
void FW3DViewBase::updateGlobalSceneScaleParameters ( )

Member Data Documentation

FWEnumParameter FW3DViewBase::m_cameraType
private

Definition at line 93 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWDoubleParameter FW3DViewBase::m_clipDelta1
private

Definition at line 98 of file FW3DViewBase.h.

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

FWDoubleParameter FW3DViewBase::m_clipDelta2
private

Definition at line 99 of file FW3DViewBase.h.

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

FWBoolParameter FW3DViewBase::m_clipEnable
private

Definition at line 95 of file FW3DViewBase.h.

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

FWDoubleParameter FW3DViewBase::m_clipPhi
private

Definition at line 97 of file FW3DViewBase.h.

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

FWDoubleParameter FW3DViewBase::m_clipTheta
private

Definition at line 96 of file FW3DViewBase.h.

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

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

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