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

void addTo (FWConfiguration &) const override
 
 FWGlimpseView (TEveWindowSlot *, FWViewType::EType)
 
void setFrom (const FWConfiguration &) override
 
 ~FWGlimpseView () override
 
- 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
 
 ~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 createAxis ()
 
 FWGlimpseView (const FWGlimpseView &)=delete
 
const FWGlimpseViewoperator= (const FWGlimpseView &)=delete
 
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
 ~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 35 of file FWGlimpseView.h.

Constructor & Destructor Documentation

◆ FWGlimpseView() [1/2]

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

Definition at line 49 of file FWGlimpseView.cc.

50  : FWEveView(iParent, typeId),
51  m_cylinder(nullptr),
52  m_showAxes(this, "Show Axes", true),
53  m_showCylinder(this, "Show Cylinder", true) {
54  createAxis();
55 
56  // made new wireframe scene
57  TEveScene* wns = gEve->SpawnNewScene(Form("Wireframe Scene %s", typeName().c_str()));
58  viewer()->AddScene(wns);
59  TGLScene* gls = wns->GetGLScene();
60  gls->SetStyle(TGLRnrCtx::kWireFrame);
61  gls->SetLOD(TGLRnrCtx::kLODMed);
62  gls->SetSelectable(kFALSE);
63 
64  TEveGeoManagerHolder gmgr(TEveGeoShape::GetGeoMangeur());
65  TGeoTube* tube = new TGeoTube(129, 130, 310);
66  m_cylinder = fireworks::getShape("Detector outline", tube, kWhite);
67  m_cylinder->SetPickable(kFALSE);
68  m_cylinder->SetMainColor(kGray + 3);
69  wns->AddElement(m_cylinder);
70 
71  TGLViewer* ev = viewerGL();
72  ev->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
73  m_showAxes.changed_.connect(std::bind(&FWGlimpseView::showAxes, this));
74  m_showCylinder.changed_.connect(std::bind(&FWGlimpseView::showCylinder, this));
75 }

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

◆ ~FWGlimpseView()

FWGlimpseView::~FWGlimpseView ( )
override

Definition at line 77 of file FWGlimpseView.cc.

77 {}

◆ FWGlimpseView() [2/2]

FWGlimpseView::FWGlimpseView ( const FWGlimpseView )
privatedelete

Member Function Documentation

◆ addTo()

void FWGlimpseView::addTo ( FWConfiguration iTo) const
overridevirtual

Reimplemented from FWEveView.

Definition at line 154 of file FWGlimpseView.cc.

154  {
155  FWEveView::addTo(iTo);
156  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
157  if (camera)
158  addToPerspectiveCamera(camera, typeName(), iTo);
159 }

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

◆ createAxis()

void FWGlimpseView::createAxis ( )
private

Definition at line 83 of file FWGlimpseView.cc.

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

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

Referenced by FWGlimpseView().

◆ operator=()

const FWGlimpseView& FWGlimpseView::operator= ( const FWGlimpseView )
privatedelete

◆ setFrom()

void FWGlimpseView::setFrom ( const FWConfiguration iFrom)
overridevirtual

Reimplemented from FWEveView.

Definition at line 161 of file FWGlimpseView.cc.

161  {
162  FWEveView::setFrom(iFrom);
163  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
164  if (camera)
165  setFromPerspectiveCamera(camera, typeName(), iFrom);
166 }

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

◆ showAxes()

void FWGlimpseView::showAxes ( )
private

Definition at line 138 of file FWGlimpseView.cc.

138  {
139  if (m_showAxes.value())
140  viewerGL()->SetGuideState(TGLUtil::kAxesOrigin, kTRUE, kFALSE, nullptr);
141  else
142  viewerGL()->SetGuideState(TGLUtil::kAxesNone, kTRUE, kFALSE, nullptr);
143 }

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

Referenced by FWGlimpseView().

◆ showCylinder()

void FWGlimpseView::showCylinder ( )
private

Definition at line 145 of file FWGlimpseView.cc.

145  {
146  if (m_showCylinder.value())
147  m_cylinder->SetRnrState(kTRUE);
148  else
149  m_cylinder->SetRnrState(kFALSE);
150 
151  gEve->Redraw3D();
152 }

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

Referenced by FWGlimpseView().

Member Data Documentation

◆ m_cylinder

TEveGeoShape* FWGlimpseView::m_cylinder
private

Definition at line 56 of file FWGlimpseView.h.

Referenced by FWGlimpseView(), and showCylinder().

◆ m_showAxes

FWBoolParameter FWGlimpseView::m_showAxes
private

Definition at line 59 of file FWGlimpseView.h.

Referenced by FWGlimpseView(), and showAxes().

◆ m_showCylinder

FWBoolParameter FWGlimpseView::m_showCylinder
private

Definition at line 60 of file FWGlimpseView.h.

Referenced by FWGlimpseView(), and showCylinder().

FWGlimpseView::createAxis
void createAxis()
Definition: FWGlimpseView.cc:83
FWGlimpseView::m_showCylinder
FWBoolParameter m_showCylinder
Definition: FWGlimpseView.h:60
FWViewBase::typeName
const std::string & typeName() const
Definition: FWViewBase.cc:107
FWEveView::setFrom
void setFrom(const FWConfiguration &) override
Definition: FWEveView.cc:307
fireworks::getShape
TEveGeoShape * getShape(const char *name, TGeoBBox *shape, Color_t color)
Definition: BuilderUtils.cc:44
FWGlimpseView::showAxes
void showAxes()
Definition: FWGlimpseView.cc:138
FWViewBase::typeId
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
FWGenericParameter::changed_
sigc::signal< void, T > changed_
Definition: FWGenericParameter.h:75
FWEveView::setFromPerspectiveCamera
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
Definition: FWEveView.cc:420
HLT_FULL_cff.zAxis
zAxis
Definition: HLT_FULL_cff.py:46178
FWEveView::viewer
TEveViewer * viewer()
Definition: FWEveView.cc:179
HLT_FULL_cff.yAxis
yAxis
Definition: HLT_FULL_cff.py:46179
FWEveView::FWEveView
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
Definition: FWEveView.cc:70
FWGenericParameter::value
T value() const
Definition: FWGenericParameter.h:50
FWEveView::addToPerspectiveCamera
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
Definition: FWEveView.cc:397
FWEveView::addTo
void addTo(FWConfiguration &) const override
Definition: FWEveView.cc:291
FWGlimpseView::m_showAxes
FWBoolParameter m_showAxes
Definition: FWGlimpseView.h:59
ev
bool ev
Definition: Hydjet2Hadronizer.cc:97
HLT_FULL_cff.xAxis
xAxis
Definition: HLT_FULL_cff.py:46177
FWEveView::viewerGL
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
FWEveView::geoScene
TEveScene * geoScene()
Definition: FWEveView.h:80
FWGlimpseView::m_cylinder
TEveGeoShape * m_cylinder
Definition: FWGlimpseView.h:56
FWGlimpseView::showCylinder
void showCylinder()
Definition: FWGlimpseView.cc:145