CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWGlimpseView Class Reference

#include <Fireworks/Core/interface/FWGlimpseView.h>

Inheritance diagram for FWGlimpseView:
FWEveView FWViewBase FWConfigurableParameterizable FWParameterizable FWConfigurable

Public Member Functions

virtual void addTo (FWConfiguration &) const
 
 FWGlimpseView (TEveWindowSlot *, FWViewType::EType)
 
virtual void setFrom (const FWConfiguration &)
 
virtual ~FWGlimpseView ()
 
- Public Member Functions inherited from FWEveView
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
 
virtual bool requestGLHandlerPick () const
 
void saveImageTo (const std::string &iName) const override
 
virtual void setBackgroundColor (Color_t)
 
virtual void setContext (const fireworks::Context &x)
 
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
 
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 createAxis ()
 
 FWGlimpseView (const FWGlimpseView &)
 
const FWGlimpseViewoperator= (const FWGlimpseView &)
 
void showAxes ()
 
void showCylinder ()
 

Private Attributes

TEveGeoShape * m_cylinder
 
FWBoolParameter m_showAxes
 
FWBoolParameter m_showCylinder
 

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 35 of file FWGlimpseView.h.

Constructor & Destructor Documentation

FWGlimpseView::FWGlimpseView ( TEveWindowSlot *  iParent,
FWViewType::EType  typeId 
)

Definition at line 49 of file FWGlimpseView.cc.

References FWGenericParameter< T >::changed_, createAxis(), ev, fireworks::getShape(), m_cylinder, m_showAxes, m_showCylinder, showAxes(), showCylinder(), FWViewBase::typeName(), FWEveView::viewer(), and FWEveView::viewerGL().

49  :
50  FWEveView(iParent, typeId),
51  m_cylinder(0),
52  m_showAxes(this, "Show Axes", true ),
53  m_showCylinder(this, "Show Cylinder", true)
54 {
55  createAxis();
56 
57  // made new wireframe scene
58  TEveScene* wns = gEve->SpawnNewScene(Form("Wireframe Scene %s", typeName().c_str()));
59  viewer()->AddScene(wns);
60  TGLScene* gls = wns->GetGLScene();
61  gls->SetStyle(TGLRnrCtx::kWireFrame);
62  gls->SetLOD(TGLRnrCtx::kLODMed);
63  gls->SetSelectable(kFALSE);
64 
65  TEveGeoManagerHolder gmgr(TEveGeoShape::GetGeoMangeur());
66  TGeoTube* tube = new TGeoTube(129,130,310);
67  m_cylinder = fireworks::getShape("Detector outline", tube, kWhite);
68  m_cylinder->SetPickable(kFALSE);
69  m_cylinder->SetMainColor(kGray+3);
70  wns->AddElement(m_cylinder);
71 
72  TGLViewer* ev = viewerGL();
73  ev->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
74  m_showAxes.changed_.connect(boost::bind(&FWGlimpseView::showAxes,this));
75  m_showCylinder.changed_.connect(boost::bind(&FWGlimpseView::showCylinder,this));
76 }
const std::string & typeName() const
Definition: FWViewBase.cc:120
bool ev
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
sigc::signal< void, T > changed_
TEveViewer * viewer()
Definition: FWEveView.cc:196
TEveGeoShape * m_cylinder
Definition: FWGlimpseView.h:57
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
Definition: FWEveView.cc:77
FWBoolParameter m_showCylinder
Definition: FWGlimpseView.h:61
TEveGeoShape * getShape(const char *name, TGeoBBox *shape, Color_t color)
Definition: BuilderUtils.cc:42
FWViewType::EType typeId() const
Definition: FWViewBase.h:43
FWBoolParameter m_showAxes
Definition: FWGlimpseView.h:60
FWGlimpseView::~FWGlimpseView ( )
virtual

Definition at line 78 of file FWGlimpseView.cc.

79 {
80 }
FWGlimpseView::FWGlimpseView ( const FWGlimpseView )
private

Member Function Documentation

void FWGlimpseView::addTo ( FWConfiguration iTo) const
virtual

Reimplemented from FWEveView.

Definition at line 168 of file FWGlimpseView.cc.

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

169 {
170  FWEveView::addTo(iTo);
171  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
172  if (camera)
173  addToPerspectiveCamera(camera, typeName(), iTo);
174 }
const std::string & typeName() const
Definition: FWViewBase.cc:120
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
void addTo(FWConfiguration &) const override
Definition: FWEveView.cc:351
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
Definition: FWEveView.cc:477
void FWGlimpseView::createAxis ( )
private

Definition at line 88 of file FWGlimpseView.cc.

References FWEveView::geoScene(), MuonErrorMatrixValues_cff::xAxis, MuonErrorMatrixValues_cff::yAxis, and MetAnalyzer::zAxis.

Referenced by FWGlimpseView().

89 {
90  // create 3D axes
91  TEveElementList* axisHolder = new TEveElementList("GlimpseAxisHolder");
92 
93  TGLFont::EMode fontMode = TGLFont::kPixmap;
94  Int_t fs = 14;
95  Color_t fcol = kGray+1;
96 
97  // X axis
98  TEveStraightLineSet* xAxis = new TEveStraightLineSet( "GlimpseXAxis" );
99  xAxis->SetPickable(kTRUE);
100  xAxis->SetTitle("Energy Scale, 100 GeV, X-axis (LHC center)");
101  xAxis->SetLineStyle(3);
102  xAxis->SetLineColor(fcol);
103  xAxis->AddLine(-100,0,0,100,0,0);
104  axisHolder->AddElement(xAxis);
105 
106  TEveText* xTxt = new TEveText( "X+" );
107  xTxt->PtrMainTrans()->SetPos(100-fs, -fs, 0);
108  xTxt->SetFontMode(fontMode);
109  xTxt->SetMainColor(fcol);
110  axisHolder->AddElement(xTxt);
111 
112  // Y axis
113  TEveStraightLineSet* yAxis = new TEveStraightLineSet( "GlimpseYAxis" );
114  yAxis->SetPickable(kTRUE);
115  yAxis->SetTitle("Energy Scale, 100 GeV, Y-axis (upward)");
116  yAxis->SetLineColor(fcol);
117  yAxis->SetLineStyle(3);
118  yAxis->AddLine(0,-100,0,0,100,0);
119  axisHolder->AddElement(yAxis);
120 
121  TEveText* yTxt = new TEveText( "Y+" );
122  yTxt->PtrMainTrans()->SetPos(0, 100-fs, 0);
123  yTxt->SetFontMode(fontMode);
124  yTxt->SetMainColor(fcol);
125  axisHolder->AddElement(yTxt);
126 
127  // Z axis
128  TEveStraightLineSet* zAxis = new TEveStraightLineSet( "GlimpseZAxis" );
129  zAxis->SetPickable(kTRUE);
130  zAxis->SetTitle("Energy Scale, 100 GeV, Z-axis (west, along beam)");
131  zAxis->SetLineColor(fcol);
132  zAxis->AddLine(0,0,-100,0,0,100);
133  axisHolder->AddElement(zAxis);
134 
135  TEveText* zTxt = new TEveText( "Z+" );
136  zTxt->PtrMainTrans()->SetPos(0, -fs, 100 - zTxt->GetExtrude()*2);
137  zTxt->SetFontMode(fontMode);
138  zTxt->SetMainColor(fcol);
139  axisHolder->AddElement(zTxt);
140 
141  geoScene()->AddElement(axisHolder);
142 }
TEveScene * geoScene()
Definition: FWEveView.h:83
const FWGlimpseView& FWGlimpseView::operator= ( const FWGlimpseView )
private
void FWGlimpseView::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWEveView.

Definition at line 177 of file FWGlimpseView.cc.

References FWEveView::setFrom(), FWEveView::setFromPerspectiveCamera(), FWViewBase::typeName(), and FWEveView::viewerGL().

178 {
179  FWEveView::setFrom(iFrom);
180  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
181  if (camera)
182  setFromPerspectiveCamera(camera, typeName(), iFrom);
183 }
const std::string & typeName() const
Definition: FWViewBase.cc:120
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
void setFrom(const FWConfiguration &) override
Definition: FWEveView.cc:369
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
Definition: FWEveView.cc:504
void FWGlimpseView::showAxes ( )
private

Definition at line 146 of file FWGlimpseView.cc.

References m_showAxes, FWGenericParameter< T >::value(), and FWEveView::viewerGL().

Referenced by FWGlimpseView().

147 {
148  if ( m_showAxes.value() )
149  viewerGL()->SetGuideState(TGLUtil::kAxesOrigin, kTRUE, kFALSE, 0);
150  else
151  viewerGL()->SetGuideState(TGLUtil::kAxesNone, kTRUE, kFALSE, 0);
152 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:190
FWBoolParameter m_showAxes
Definition: FWGlimpseView.h:60
void FWGlimpseView::showCylinder ( )
private

Definition at line 156 of file FWGlimpseView.cc.

References m_cylinder, m_showCylinder, and FWGenericParameter< T >::value().

Referenced by FWGlimpseView().

157 {
158  if ( m_showCylinder.value() )
159  m_cylinder->SetRnrState(kTRUE);
160  else
161  m_cylinder->SetRnrState(kFALSE);
162 
163  gEve->Redraw3D();
164 }
TEveGeoShape * m_cylinder
Definition: FWGlimpseView.h:57
FWBoolParameter m_showCylinder
Definition: FWGlimpseView.h:61

Member Data Documentation

TEveGeoShape* FWGlimpseView::m_cylinder
private

Definition at line 57 of file FWGlimpseView.h.

Referenced by FWGlimpseView(), and showCylinder().

FWBoolParameter FWGlimpseView::m_showAxes
private

Definition at line 60 of file FWGlimpseView.h.

Referenced by FWGlimpseView(), and showAxes().

FWBoolParameter FWGlimpseView::m_showCylinder
private

Definition at line 61 of file FWGlimpseView.h.

Referenced by FWGlimpseView(), and showCylinder().