CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWISpyView.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: cmsShow36
4 // Class : FWISpyView
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Alja Mrak-Tadel
10 // Created: Wed Apr 7 14:40:31 CEST 2010
11 //
12 
13 // system include files
14 #include <boost/bind.hpp>
15 
16 // user include files
17 #include "TGLViewer.h"
22 #include "TEveBoxSet.h"
23 #include "TEveScene.h"
24 #include "TEveManager.h"
25 
26 
27 //
28 // constants, enums and typedefs
29 //
30 
31 //
32 // static data member definitions
33 //
34 
35 //
36 // constructors and destructor
37 //
38 FWISpyView::FWISpyView(TEveWindowSlot* slot, FWViewType::EType typeId, unsigned int version):
39  FW3DViewBase(slot, typeId, version),
40  m_ecalBarrel(0),
41  m_showEcalBarrel(this, "Show Ecal Barrel", true )
42 {
43  m_ecalBarrel = new TEveBoxSet("ecalBarrel");
44  m_ecalBarrel->UseSingleColor();
45  m_ecalBarrel->SetMainColor(kAzure+10);
46  m_ecalBarrel->SetMainTransparency(98);
47  geoScene()->AddElement(m_ecalBarrel);
48 }
49 
50 
51 // FWISpyView::FWISpyView(const FWISpyView& rhs)
52 // {
53 // // do actual copying here;
54 // }
55 
57 {
58 }
59 
60 
62 {
64  m_showEcalBarrel.changed_.connect(boost::bind(&FWISpyView::showEcalBarrel, this,_1));
65 
67 
68 }
69 
71  if (x && m_ecalBarrel->GetPlex()->Size() == 0) {
72  const FWGeometry* geom = context().getGeom();
73  std::vector<unsigned int> ids = geom->getMatchedIds(FWGeometry::Detector::Ecal, FWGeometry::SubDetector::PixelBarrel);
74  m_ecalBarrel->Reset(TEveBoxSet::kBT_FreeBox, true, ids.size() );
75  for (std::vector<unsigned int>::iterator it = ids.begin(); it != ids.end(); ++it) {
76  const float* cor = context().getGeom()->getCorners(*it);
77  m_ecalBarrel->AddBox(cor);
78  }
79  m_ecalBarrel->RefitPlex();
80  }
81 
82  if (m_ecalBarrel->GetRnrSelf() != x) {
83  m_ecalBarrel->SetRnrSelf(x);
84  gEve->Redraw3D();
85  }
86 }
87 
88 
89 void
91 {
93 
94  gui.requestTab("Detector").separator().
95  addParam(&m_showEcalBarrel);
96 }
virtual void setContext(const fireworks::Context &x)
Definition: FWISpyView.cc:61
FWBoolParameter m_showEcalBarrel
Definition: FWISpyView.h:51
const FWGeometry * getGeom() const
Definition: Context.h:83
ViewerParameterGUI & requestTab(const char *)
ViewerParameterGUI & separator()
sigc::signal< void, T > changed_
virtual void populateController(ViewerParameterGUI &) const
virtual ~FWISpyView()
Definition: FWISpyView.cc:56
virtual void setContext(const fireworks::Context &)
void showEcalBarrel(bool)
Definition: FWISpyView.cc:70
FWISpyView(TEveWindowSlot *, FWViewType::EType, unsigned int version=9)
Definition: FWISpyView.cc:38
const fireworks::Context & context()
Definition: FWEveView.h:67
TEveBoxSet * m_ecalBarrel
Definition: FWISpyView.h:50
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:280
TEveScene * geoScene()
Definition: FWEveView.h:83
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:197
Definition: DDAxes.h:10
virtual void populateController(ViewerParameterGUI &) const
Definition: FWISpyView.cc:90