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 48 of file FWGlimpseView.cc.

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

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 76 of file FWGlimpseView.cc.

76 {}

◆ 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 153 of file FWGlimpseView.cc.

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

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

◆ createAxis()

void FWGlimpseView::createAxis ( )
private

Definition at line 82 of file FWGlimpseView.cc.

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

References FWEveView::geoScene(), HLT_2018_cff::xAxis, HLT_2018_cff::yAxis, and HLT_2018_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 160 of file FWGlimpseView.cc.

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

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

◆ showAxes()

void FWGlimpseView::showAxes ( )
private

Definition at line 137 of file FWGlimpseView.cc.

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

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

Referenced by FWGlimpseView().

◆ showCylinder()

void FWGlimpseView::showCylinder ( )
private

Definition at line 144 of file FWGlimpseView.cc.

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

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:82
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:43
FWGlimpseView::showAxes
void showAxes()
Definition: FWGlimpseView.cc:137
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
FWEveView::viewer
TEveViewer * viewer()
Definition: FWEveView.cc:179
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
HLT_2018_cff.xAxis
xAxis
Definition: HLT_2018_cff.py:44410
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:95
FWEveView::viewerGL
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
FWEveView::geoScene
TEveScene * geoScene()
Definition: FWEveView.h:80
HLT_2018_cff.yAxis
yAxis
Definition: HLT_2018_cff.py:44412
HLT_2018_cff.zAxis
zAxis
Definition: HLT_2018_cff.py:44411
FWGlimpseView::m_cylinder
TEveGeoShape * m_cylinder
Definition: FWGlimpseView.h:56
FWGlimpseView::showCylinder
void showCylinder()
Definition: FWGlimpseView.cc:144