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)
 
 FWGlimpseView (const FWGlimpseView &)=delete
 
const FWGlimpseViewoperator= (const FWGlimpseView &)=delete
 
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)
 
 FWEveView (const FWEveView &)=delete
 
FWTEveViewerfwViewer ()
 
FWTGLViewerfwViewerGL () const
 
TEveScene * geoScene ()
 
virtual bool isEnergyScaleGlobal () const
 
const FWEveViewoperator= (const FWEveView &)=delete
 
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)
 
 FWViewBase (const FWViewBase &)=delete
 
const FWViewBaseoperator= (const FWViewBase &)=delete
 
void promptForSaveImageTo (TGFrame *) const
 
FWViewType::EType typeId () const
 
const std::string & typeName () const
 
- Public Member Functions inherited from FWConfigurableParameterizable
 FWConfigurableParameterizable (unsigned int iVersion=1)
 
 FWConfigurableParameterizable (const FWConfigurableParameterizable &)=delete
 
const FWConfigurableParameterizableoperator= (const FWConfigurableParameterizable &)=delete
 
unsigned int version () const
 
 ~FWConfigurableParameterizable () override
 
- Public Member Functions inherited from FWParameterizable
void add (FWParameterBase *)
 
const_iterator begin () const
 
const_iterator end () const
 
 FWParameterizable ()
 
 FWParameterizable (const FWParameterizable &)=delete
 
const FWParameterizableoperator= (const FWParameterizable &)=delete
 
virtual ~FWParameterizable ()
 
- Public Member Functions inherited from FWConfigurable
 FWConfigurable ()
 
 FWConfigurable (const FWConfigurable &)=delete
 
const FWConfigurableoperator= (const FWConfigurable &)=delete
 
virtual ~FWConfigurable ()
 

Private Member Functions

void createAxis ()
 
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.

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

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 }
TEveViewer * viewer()
Definition: FWEveView.cc:179
TEveGeoShape * m_cylinder
Definition: FWGlimpseView.h:56
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
Definition: FWEveView.cc:70
FWBoolParameter m_showCylinder
Definition: FWGlimpseView.h:60
sigc::signal< void(T)> changed_
TEveGeoShape * getShape(const char *name, TGeoBBox *shape, Color_t color)
Definition: BuilderUtils.cc:44
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
const std::string & typeName() const
Definition: FWViewBase.cc:107
FWBoolParameter m_showAxes
Definition: FWGlimpseView.h:59

◆ ~FWGlimpseView()

FWGlimpseView::~FWGlimpseView ( )
override

Definition at line 77 of file FWGlimpseView.cc.

77 {}

◆ FWGlimpseView() [2/2]

FWGlimpseView::FWGlimpseView ( const FWGlimpseView )
delete

Member Function Documentation

◆ addTo()

void FWGlimpseView::addTo ( FWConfiguration iTo) const
overridevirtual

Reimplemented from FWEveView.

Definition at line 154 of file FWGlimpseView.cc.

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

154  {
155  FWEveView::addTo(iTo);
156  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
157  if (camera)
158  addToPerspectiveCamera(camera, typeName(), iTo);
159 }
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
Definition: FWEveView.cc:397
void addTo(FWConfiguration &) const override
Definition: FWEveView.cc:291
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
const std::string & typeName() const
Definition: FWViewBase.cc:107

◆ createAxis()

void FWGlimpseView::createAxis ( )
private

Definition at line 83 of file FWGlimpseView.cc.

References compareTotals::fs, FWEveView::geoScene(), HLT_2023v11_cff::xAxis, HLT_2023v11_cff::yAxis, and HLT_2023v11_cff::zAxis.

Referenced by FWGlimpseView().

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 }
TEveScene * geoScene()
Definition: FWEveView.h:80

◆ operator=()

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

◆ setFrom()

void FWGlimpseView::setFrom ( const FWConfiguration iFrom)
overridevirtual

Reimplemented from FWEveView.

Definition at line 161 of file FWGlimpseView.cc.

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

161  {
162  FWEveView::setFrom(iFrom);
163  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
164  if (camera)
165  setFromPerspectiveCamera(camera, typeName(), iFrom);
166 }
void setFrom(const FWConfiguration &) override
Definition: FWEveView.cc:307
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
Definition: FWEveView.cc:420
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
const std::string & typeName() const
Definition: FWViewBase.cc:107

◆ showAxes()

void FWGlimpseView::showAxes ( )
private

Definition at line 138 of file FWGlimpseView.cc.

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

Referenced by FWGlimpseView().

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 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:177
FWBoolParameter m_showAxes
Definition: FWGlimpseView.h:59

◆ showCylinder()

void FWGlimpseView::showCylinder ( )
private

Definition at line 145 of file FWGlimpseView.cc.

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

Referenced by FWGlimpseView().

145  {
146  if (m_showCylinder.value())
147  m_cylinder->SetRnrState(kTRUE);
148  else
149  m_cylinder->SetRnrState(kFALSE);
150 
151  gEve->Redraw3D();
152 }
TEveGeoShape * m_cylinder
Definition: FWGlimpseView.h:56
FWBoolParameter m_showCylinder
Definition: FWGlimpseView.h:60

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().