CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
FWEveView Class Reference

#include <FWEveView.h>

Inheritance diagram for FWEveView:
FWViewBase FWConfigurableParameterizable FWParameterizable FWConfigurable FW3DViewBase FWGlimpseView FWLegoViewBase FWRPZView FW3DView FWISpyView FWEveLegoView FWHFView

Public Member Functions

virtual void addTo (FWConfiguration &) const
 
const fireworks::Contextcontext ()
 
virtual
FWViewContextMenuHandlerBase
contextMenuHandler () const
 
virtual void eventBegin ()
 
virtual void eventEnd ()
 
TEveScene * eventScene ()
 
 FWEveView (TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
 
TEveScene * geoScene ()
 
virtual bool isEnergyScaleGlobal () const
 
TEveElement * ownedProducts ()
 
virtual void populateController (ViewerParameterGUI &) const
 
virtual bool requestGLHandlerPick () const
 
virtual void saveImageTo (const std::string &iName) const
 
virtual void setBackgroundColor (Color_t)
 
virtual void setContext (const fireworks::Context &x)
 
virtual void setFrom (const FWConfiguration &)
 
virtual void setupEnergyScale ()
 
virtual void useGlobalEnergyScaleChanged ()
 
FWViewContextviewContext ()
 
TEveViewer * viewer ()
 
TGLViewer * viewerGL () const
 
virtual void voteCaloMaxVal ()
 
virtual ~FWEveView ()
 
- 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 ()
 

Protected Member Functions

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

const fireworks::Contextm_context
 
- Protected Attributes inherited from FWViewBase
FWViewType m_type
 

Private Member Functions

 FWEveView (const FWEveView &)
 
const FWEveViewoperator= (const FWEveView &)
 

Private Attributes

TGLCameraGuide * m_cameraGuide
 
FWBoolParameter m_drawCMSLogo
 
ScaleAnnotationm_energyMaxValAnnotation
 
FWEnumParameter m_eventInfoLevel
 
TEveScene * m_eventScene
 
TEveScene * m_geoScene
 
FWDoubleParameter m_imageScale
 
FWDoubleParameter m_lineOutlineScale
 
FWBoolParameter m_lineSmooth
 
FWDoubleParameter m_lineWidth
 
FWDoubleParameter m_lineWireframeScale
 
std::auto_ptr< FWViewEnergyScalem_localEnergyScale
 
FWEventAnnotationm_overlayEventInfo
 
CmsAnnotationm_overlayLogo
 
TEveElement * m_ownedProducts
 
FWDoubleParameter m_pointSize
 
FWBoolParameter m_pointSmooth
 
FWBoolParameter m_showCameraGuide
 
FWBoolParameter m_useGlobalEnergyScale
 
std::auto_ptr< FWViewContextm_viewContext
 
boost::shared_ptr
< FWViewContextMenuHandlerGL
m_viewContextMenu
 
FWViewEnergyScaleEditorm_viewEnergyScaleEditor
 
TEveViewer * m_viewer
 

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_
 

Detailed Description

Definition at line 52 of file FWEveView.h.

Constructor & Destructor Documentation

FWEveView::FWEveView ( TEveWindowSlot *  iParent,
FWViewType::EType  type,
unsigned int  version = 7 
)

Definition at line 79 of file FWEveView.cc.

References FWEnumParameter::addEntry(), cameraGuideChanged(), FWGenericParameter< T >::changed_, m_cameraGuide, m_drawCMSLogo, m_energyMaxValAnnotation, m_eventInfoLevel, m_eventScene, m_geoScene, m_lineOutlineScale, m_lineSmooth, m_lineWidth, m_lineWireframeScale, m_localEnergyScale, m_overlayEventInfo, m_overlayLogo, m_ownedProducts, m_pointSize, m_pointSmooth, m_showCameraGuide, m_useGlobalEnergyScale, m_viewContext, m_viewContextMenu, m_viewer, FWGLEventHandler::openSelectedModelContextMenu_, FWViewBase::openSelectedModelContextMenu_, pointLineScalesChanged(), FWEventAnnotation::setLevel(), setupEnergyScale(), FWGLEventHandler::setViewer(), CmsAnnotation::setVisible(), FWViewBase::typeName(), useGlobalEnergyScaleChanged(), and viewerGL().

79  :
81  m_context(0),
82  m_viewer(0),
83  m_eventScene(0),
84  m_ownedProducts(0),
85  m_geoScene(0),
87  m_overlayLogo(0),
89  m_cameraGuide(0),
90  // style
91 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)
92  m_imageScale(this, "Image Scale", 1.0, 1.0, 6.0),
93 #endif
94  m_eventInfoLevel(this, "Overlay Event Info", 0l, 0l, 2l),
95  m_drawCMSLogo(this,"Show Logo",false),
96  m_pointSmooth(this, "Smooth points", false),
97  m_pointSize(this, "Point size", 1.0, 1.0, 10.0),
98  m_lineSmooth(this, "Smooth lines", false),
99  m_lineWidth(this,"Line width",1.0,1.0,10.0),
100  m_lineOutlineScale(this, "Outline width scale", 1.0, 0.01, 10.0),
101  m_lineWireframeScale(this, "Wireframe width scale", 1.0, 0.01, 10.0),
102  m_showCameraGuide(this,"Show Camera Guide",false),
103  m_useGlobalEnergyScale(this, "UseGlobalEnergyScale", true),
107 {
108  m_viewer = new TEveViewer(typeName().c_str());
109 
110  TGLEmbeddedViewer* embeddedViewer;
111 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,25,4)
112  embeddedViewer = m_viewer->SpawnGLEmbeddedViewer(0);
113 #else
114  embeddedViewer = m_viewer->SpawnGLEmbeddedViewer();
115 #endif
116  iParent->ReplaceWindow(m_viewer);
117  gEve->GetViewers()->AddElement(m_viewer);
118 
119  m_eventScene = gEve->SpawnNewScene(Form("EventScene %s", typeName().c_str()));
120  m_ownedProducts = new TEveElementList("ViewSpecificProducts");
121  m_eventScene->AddElement(m_ownedProducts);
122 
123  m_viewer->AddScene(m_eventScene);
124 
125  // spawn geo scene
126  m_geoScene = gEve->SpawnNewScene(Form("GeoScene %s", typeName().c_str()));
127  m_geoScene->GetGLScene()->SetSelectable(kFALSE);
128  m_viewer->AddScene(m_geoScene);
129 
130  FWGLEventHandler* eh = new FWGLEventHandler((TGWindow*)embeddedViewer->GetGLWidget(), (TObject*)embeddedViewer);
131  embeddedViewer->SetEventHandler(eh);
132  eh->setViewer(this);
134  eh->SetDoInternalSelection(kFALSE);
136  // ctxHand->setPickCameraCenter(true);
137  m_viewContextMenu.reset(ctxHand);
138 
139  m_energyMaxValAnnotation = new ScaleAnnotation(viewerGL(), "empty", 0.1, 0.9);
140  m_energyMaxValAnnotation->SetRole(TGLOverlayElement::kViewer);
141  m_energyMaxValAnnotation->SetState(TGLOverlayElement::kInvisible);
142  m_energyMaxValAnnotation->SetUseColorSet(false);
143  m_energyMaxValAnnotation->SetTextSize(0.05);
144  m_energyMaxValAnnotation->SetTextColor(kMagenta);
145 
146  // style params
147 
148  m_overlayEventInfo = new FWEventAnnotation(embeddedViewer);
150 
151  m_eventInfoLevel.addEntry(0, "Nothing");
152  m_eventInfoLevel.addEntry(1, "Run / event");
153  m_eventInfoLevel.addEntry(2, "Run / event / lumi");
154  m_eventInfoLevel.addEntry(3, "Full");
156 
157  m_overlayLogo = new CmsAnnotation(embeddedViewer, 0.02, 0.98);
158  m_overlayLogo->setVisible(false);
160 
161  m_cameraGuide = new TGLCameraGuide(0.9, 0.1, 0.08);
162  m_cameraGuide->SetState(TGLOverlayElement::kInvisible);
163  embeddedViewer->AddOverlayElement(m_cameraGuide);
164  m_showCameraGuide.changed_.connect(boost::bind(&FWEveView::cameraGuideChanged,this));
165 
166  m_pointSmooth.changed_.connect(boost::bind(&FWEveView::pointLineScalesChanged,this));
167  m_pointSize.changed_.connect(boost::bind(&FWEveView::pointLineScalesChanged,this));
168  m_lineSmooth.changed_.connect(boost::bind(&FWEveView::pointLineScalesChanged,this));
169  m_lineWidth.changed_.connect(boost::bind(&FWEveView::pointLineScalesChanged,this));
172 
173 
174  // create scale for view ..
175  m_viewContext->setEnergyScale(m_localEnergyScale.get());
177  m_localEnergyScale->parameterChanged_.connect(boost::bind(&FWEveView::setupEnergyScale, this));
178 }
type
Definition: HCALResponse.h:21
FWEventAnnotation * m_overlayEventInfo
Definition: FWEveView.h:118
virtual void useGlobalEnergyScaleChanged()
Definition: FWEveView.cc:282
std::auto_ptr< FWViewContext > m_viewContext
Definition: FWEveView.h:145
TEveViewer * m_viewer
Definition: FWEveView.h:113
virtual void pointLineScalesChanged()
Definition: FWEveView.cc:220
const std::string & typeName() const
Definition: FWViewBase.cc:120
TEveScene * m_geoScene
Definition: FWEveView.h:116
FWViewEnergyScaleEditor * m_viewEnergyScaleEditor
Definition: FWEveView.h:148
virtual void setupEnergyScale()
Definition: FWEveView.cc:298
FWDoubleParameter m_pointSize
Definition: FWEveView.h:135
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
sigc::signal< void, T > changed_
const fireworks::Context * m_context
Definition: FWEveView.h:104
TEveElement * m_ownedProducts
Definition: FWEveView.h:115
FWBoolParameter m_lineSmooth
Definition: FWEveView.h:136
FWBoolParameter m_showCameraGuide
Definition: FWEveView.h:141
FWBoolParameter m_useGlobalEnergyScale
Definition: FWEveView.h:142
virtual void cameraGuideChanged()
Definition: FWEveView.cc:233
ScaleAnnotation * m_energyMaxValAnnotation
Definition: FWEveView.h:120
bool addEntry(Long_t id, const std::string &txt)
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
FWBoolParameter m_drawCMSLogo
Definition: FWEveView.h:132
void setViewer(FWEveView *ev)
std::auto_ptr< FWViewEnergyScale > m_localEnergyScale
Definition: FWEveView.h:146
FWBoolParameter m_pointSmooth
Definition: FWEveView.h:134
FWDoubleParameter m_imageScale
Definition: FWEveView.h:129
FWDoubleParameter m_lineOutlineScale
Definition: FWEveView.h:138
TEveScene * m_eventScene
Definition: FWEveView.h:114
FWEnumParameter m_eventInfoLevel
Definition: FWEveView.h:131
static const std::string & idToName(int)
Definition: FWViewType.cc:89
boost::shared_ptr< FWViewContextMenuHandlerGL > m_viewContextMenu
Definition: FWEveView.h:144
FWDoubleParameter m_lineWidth
Definition: FWEveView.h:137
FWDoubleParameter m_lineWireframeScale
Definition: FWEveView.h:139
void setVisible(bool x)
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
Definition: FWViewBase.h:56
TGLCameraGuide * m_cameraGuide
Definition: FWEveView.h:121
FWViewBase(FWViewType::EType, unsigned int iVersion=1)
Definition: FWViewBase.cc:33
CmsAnnotation * m_overlayLogo
Definition: FWEveView.h:119
FWEveView::~FWEveView ( )
virtual

Definition at line 180 of file FWEveView.cc.

References m_eventScene, m_geoScene, and m_viewer.

181 {
182  m_geoScene->RemoveElements();
183  m_eventScene->RemoveElements();
184  m_viewer->DestroyWindowAndSlot();
185 }
TEveViewer * m_viewer
Definition: FWEveView.h:113
TEveScene * m_geoScene
Definition: FWEveView.h:116
TEveScene * m_eventScene
Definition: FWEveView.h:114
FWEveView::FWEveView ( const FWEveView )
private

Member Function Documentation

void FWEveView::addTo ( FWConfiguration iTo) const
virtual

Reimplemented from FWConfigurableParameterizable.

Reimplemented in FWLegoViewBase, FW3DViewBase, FWRPZView, and FWGlimpseView.

Definition at line 337 of file FWEveView.cc.

References CmsAnnotation::addTo(), FWEventAnnotation::addTo(), FWConfigurableParameterizable::addTo(), m_overlayEventInfo, m_overlayLogo, and m_viewContext.

Referenced by FWGlimpseView::addTo(), FWRPZView::addTo(), FW3DViewBase::addTo(), and FWLegoViewBase::addTo().

338 {
339  // take care of parameters
341 
342  {
343  assert ( m_overlayEventInfo );
345  }
346  {
347  assert ( m_overlayLogo );
348  m_overlayLogo->addTo(iTo);
349  }
350 
351  m_viewContext->getEnergyScale()->addTo(iTo);
352 }
FWEventAnnotation * m_overlayEventInfo
Definition: FWEveView.h:118
std::auto_ptr< FWViewContext > m_viewContext
Definition: FWEveView.h:145
virtual void addTo(FWConfiguration &) const
virtual void addTo(FWConfiguration &) const
CmsAnnotation * m_overlayLogo
Definition: FWEveView.h:119
virtual void addTo(FWConfiguration &) const
void FWEveView::addToOrthoCamera ( TGLOrthoCamera *  camera,
FWConfiguration iTo 
) const
protected

Definition at line 409 of file FWEveView.cc.

References FWConfiguration::addKeyValue(), i, mergeVDriftHistosByStation::name, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, and FWViewBase::typeName().

Referenced by FWRPZView::addTo(), and FWLegoViewBase::addTo().

410 {
411  // zoom
412  std::ostringstream s;
413  s<<(camera->fZoom);
414  std::string name("cameraZoom");
415  iTo.addKeyValue(name+typeName(),FWConfiguration(s.str()));
416 
417  // transformation matrix
418  std::string matrixName("cameraMatrix");
419  for ( unsigned int i = 0; i < 16; ++i ) {
420  std::ostringstream osIndex;
421  osIndex << i;
422  std::ostringstream osValue;
423  osValue << camera->GetCamTrans()[i];
424  iTo.addKeyValue(matrixName+osIndex.str()+typeName(),FWConfiguration(osValue.str()));
425  }
426 }
int i
Definition: DBlmapReader.cc:9
const std::string & typeName() const
Definition: FWViewBase.cc:120
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
void FWEveView::addToPerspectiveCamera ( TGLPerspectiveCamera *  cam,
const std::string &  name,
FWConfiguration iTo 
) const
protected

Definition at line 465 of file FWEveView.cc.

References FWConfiguration::addKeyValue(), i, mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by FWGlimpseView::addTo(), FW3DViewBase::addTo(), and FWLegoViewBase::addTo().

466 {
467  // transformation matrix
468  std::string matrixName("cameraMatrix");
469  for ( unsigned int i = 0; i < 16; ++i ){
470  std::ostringstream osIndex;
471  osIndex << i;
472  std::ostringstream osValue;
473  osValue << (cam->GetCamTrans())[i];
474  iTo.addKeyValue(matrixName+osIndex.str()+name,FWConfiguration(osValue.str()));
475  }
476 
477  // transformation matrix base
478  matrixName = "cameraMatrixBase";
479  for ( unsigned int i = 0; i < 16; ++i ){
480  std::ostringstream osIndex;
481  osIndex << i;
482  std::ostringstream osValue;
483  osValue << (cam->GetCamBase())[i];
484  iTo.addKeyValue(matrixName+osIndex.str()+name,FWConfiguration(osValue.str()));
485  }
486  {
487  std::ostringstream osValue;
488  osValue << cam->fFOV;
489  iTo.addKeyValue(name+" FOV",FWConfiguration(osValue.str()));
490  }
491 }
int i
Definition: DBlmapReader.cc:9
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
void FWEveView::cameraGuideChanged ( )
protectedvirtual

Definition at line 233 of file FWEveView.cc.

References m_cameraGuide, m_showCameraGuide, FWGenericParameter< T >::value(), and viewerGL().

Referenced by FWEveView().

234 {
235  m_cameraGuide->SetBinaryState(m_showCameraGuide.value());
236  viewerGL()->Changed();
237  gEve->Redraw3D();
238 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
FWBoolParameter m_showCameraGuide
Definition: FWEveView.h:141
TGLCameraGuide * m_cameraGuide
Definition: FWEveView.h:121
const fireworks::Context& FWEveView::context ( )
inline
FWViewContextMenuHandlerBase * FWEveView::contextMenuHandler ( ) const
virtual

Reimplemented from FWViewBase.

Definition at line 192 of file FWEveView.cc.

References m_viewContextMenu.

192  {
193  return dynamic_cast<FWViewContextMenuHandlerBase*> (m_viewContextMenu.get());
194 }
boost::shared_ptr< FWViewContextMenuHandlerGL > m_viewContextMenu
Definition: FWEveView.h:144
void FWEveView::eventBegin ( )
virtual

Reimplemented in FWRPZView.

Definition at line 241 of file FWEveView.cc.

242 {
243 }
void FWEveView::eventEnd ( )
virtual

Reimplemented in FWRPZView.

Definition at line 246 of file FWEveView.cc.

References m_overlayEventInfo, FWEventAnnotation::setEvent(), and setupEnergyScale().

Referenced by FWRPZView::eventEnd().

247 {
250 }
FWEventAnnotation * m_overlayEventInfo
Definition: FWEveView.h:118
virtual void setupEnergyScale()
Definition: FWEveView.cc:298
TEveScene* FWEveView::eventScene ( )
inline
TEveScene* FWEveView::geoScene ( )
inline
virtual TEveCaloViz* FWEveView::getEveCalo ( ) const
inlineprotectedvirtual

Reimplemented in FWLegoViewBase, FWRPZView, and FW3DView.

Definition at line 95 of file FWEveView.h.

Referenced by setupEnergyScale(), and voteCaloMaxVal().

95 { return 0; }
bool FWEveView::isEnergyScaleGlobal ( ) const
virtual

Definition at line 276 of file FWEveView.cc.

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

277 {
278  return m_useGlobalEnergyScale.value();
279 }
FWBoolParameter m_useGlobalEnergyScale
Definition: FWEveView.h:142
const FWEveView& FWEveView::operator= ( const FWEveView )
private
TEveElement* FWEveView::ownedProducts ( )
inline

Definition at line 78 of file FWEveView.h.

References m_ownedProducts.

Referenced by FWEveViewManager::finishViewCreate().

78 { return m_ownedProducts; }
TEveElement * m_ownedProducts
Definition: FWEveView.h:115
void FWEveView::pointLineScalesChanged ( )
protectedvirtual

Definition at line 220 of file FWEveView.cc.

References m_lineOutlineScale, m_lineSmooth, m_lineWidth, m_lineWireframeScale, m_pointSize, m_pointSmooth, FWGenericParameter< T >::value(), and viewerGL().

Referenced by FWEveView().

221 {
222  viewerGL()->SetSmoothPoints(m_pointSmooth.value());
223  viewerGL()->SetPointScale (m_pointSize.value());
224  viewerGL()->SetSmoothLines (m_lineSmooth.value());
225  viewerGL()->SetLineScale (m_lineWidth.value());
226  viewerGL()->SetOLLineW (m_lineOutlineScale.value());
227  viewerGL()->SetWFLineW (m_lineWireframeScale.value());
228  viewerGL()->Changed();
229  gEve->Redraw3D();
230 }
FWDoubleParameter m_pointSize
Definition: FWEveView.h:135
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
FWBoolParameter m_lineSmooth
Definition: FWEveView.h:136
FWBoolParameter m_pointSmooth
Definition: FWEveView.h:134
FWDoubleParameter m_lineOutlineScale
Definition: FWEveView.h:138
FWDoubleParameter m_lineWidth
Definition: FWEveView.h:137
FWDoubleParameter m_lineWireframeScale
Definition: FWEveView.h:139
void FWEveView::populateController ( ViewerParameterGUI gui) const
virtual

Reimplemented from FWViewBase.

Reimplemented in FWLegoViewBase, FW3DViewBase, and FWRPZView.

Definition at line 547 of file FWEveView.cc.

References ViewerParameterGUI::addFrameToContainer(), ViewerParameterGUI::getTabContainer(), FWViewType::isLego(), m_drawCMSLogo, m_eventInfoLevel, m_imageScale, m_lineOutlineScale, m_lineSmooth, m_lineWidth, m_lineWireframeScale, m_localEnergyScale, m_pointSize, m_pointSmooth, m_showCameraGuide, m_useGlobalEnergyScale, m_viewEnergyScaleEditor, ViewerParameterGUI::requestTab(), FWViewEnergyScaleEditor::setEnabled(), FWViewBase::typeId(), and FWGenericParameter< T >::value().

Referenced by FW3DViewBase::populateController(), FWRPZView::populateController(), and FWLegoViewBase::populateController().

548 {
549  gui.requestTab("Style").
550  addParam(&m_eventInfoLevel).
551  addParam(&m_drawCMSLogo).
552  addParam(&m_showCameraGuide).
553  separator().
554 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)
555  addParam(&m_imageScale).
556 #endif
557  addParam(&m_pointSize).
558  addParam(&m_pointSmooth).
559  addParam(&m_lineSmooth).
560  addParam(&m_lineWidth).
561  addParam(&m_lineOutlineScale).
562  addParam(&m_lineWireframeScale);
563 
564 
565  gui.requestTab("Scales").
566  addParam(&m_useGlobalEnergyScale);
567 
571 }
ViewerParameterGUI & requestTab(const char *)
FWViewEnergyScaleEditor * m_viewEnergyScaleEditor
Definition: FWEveView.h:148
void addFrameToContainer(TGCompositeFrame *)
FWDoubleParameter m_pointSize
Definition: FWEveView.h:135
FWBoolParameter m_lineSmooth
Definition: FWEveView.h:136
FWBoolParameter m_showCameraGuide
Definition: FWEveView.h:141
FWBoolParameter m_useGlobalEnergyScale
Definition: FWEveView.h:142
FWBoolParameter m_drawCMSLogo
Definition: FWEveView.h:132
std::auto_ptr< FWViewEnergyScale > m_localEnergyScale
Definition: FWEveView.h:146
FWBoolParameter m_pointSmooth
Definition: FWEveView.h:134
FWDoubleParameter m_imageScale
Definition: FWEveView.h:129
FWDoubleParameter m_lineOutlineScale
Definition: FWEveView.h:138
TGCompositeFrame * getTabContainer()
FWEnumParameter m_eventInfoLevel
Definition: FWEveView.h:131
static bool isLego(int)
Definition: FWViewType.cc:135
FWDoubleParameter m_lineWidth
Definition: FWEveView.h:137
FWDoubleParameter m_lineWireframeScale
Definition: FWEveView.h:139
FWViewType::EType typeId() const
Definition: FWViewBase.h:41
virtual bool FWEveView::requestGLHandlerPick ( ) const
inlinevirtual

Reimplemented in FW3DViewBase.

Definition at line 87 of file FWEveView.h.

Referenced by FWGLEventHandler::HandleButton().

87 { return 0;}
void FWEveView::resetCamera ( )
protectedvirtual

Definition at line 259 of file FWEveView.cc.

References viewerGL().

260 {
261  viewerGL()->ResetCurrentCamera();
262 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
void FWEveView::saveImageTo ( const std::string &  iName) const
virtual

Implements FWViewBase.

Definition at line 203 of file FWEveView.cc.

References fwLog, fwlog::kInfo, m_imageScale, summarizeEdmComparisonLogfiles::succeeded, FWGenericParameter< T >::value(), and viewerGL().

204 {
205  bool succeeded = false;
206 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)
207  succeeded = viewerGL()->SavePictureScale(iName, m_imageScale.value());
208 #else
209  succeeded = viewerGL()->SavePicture(iName.c_str());
210 #endif
211 
212  if(!succeeded) {
213  throw std::runtime_error("Unable to save picture");
214  }
215  fwLog(fwlog::kInfo) << "Saved image " << iName << std::endl;
216 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
FWDoubleParameter m_imageScale
Definition: FWEveView.h:129
#define fwLog(_level_)
Definition: fwLog.h:50
void FWEveView::setBackgroundColor ( Color_t  iColor)
virtual

Reimplemented in FWEveLegoView.

Definition at line 253 of file FWEveView.cc.

References FWColorManager::setColorSetViewer(), and viewerGL().

Referenced by Vispa.Plugins.EdmBrowser.EventContentView.LabelItem::__init__(), and FWEveLegoView::setBackgroundColor().

254 {
256 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
static Bool_t setColorSetViewer(TGLViewer *, Color_t)
void FWEveView::setContext ( const fireworks::Context x)
virtual

Reimplemented in FW3DViewBase, FWRPZView, FWLegoViewBase, FW3DView, FWHFView, and FWEveLegoView.

Definition at line 266 of file FWEveView.cc.

References context(), m_context, m_useGlobalEnergyScale, m_viewContext, FWGenericParameter< T >::value(), and x.

Referenced by FWEveViewManager::finishViewCreate(), FWLegoViewBase::setContext(), FWRPZView::setContext(), and FW3DViewBase::setContext().

267 {
268  m_context = &x ;
269 
270  // in constructor view context has local scale
272  m_viewContext->setEnergyScale(context().commonPrefs()->getEnergyScale());
273 }
std::auto_ptr< FWViewContext > m_viewContext
Definition: FWEveView.h:145
const fireworks::Context * m_context
Definition: FWEveView.h:104
FWBoolParameter m_useGlobalEnergyScale
Definition: FWEveView.h:142
const fireworks::Context & context()
Definition: FWEveView.h:64
Definition: DDAxes.h:10
void FWEveView::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWConfigurableParameterizable.

Reimplemented in FW3DViewBase, FWRPZView, FWLegoViewBase, and FWGlimpseView.

Definition at line 355 of file FWEveView.cc.

References FWParameterizable::begin(), fireworks::Context::commonPrefs(), context(), FWParameterizable::end(), CmsShowCommon::getDarkColorSet(), CmsShowCommon::getLightColorSet(), m_localEnergyScale, m_overlayEventInfo, m_overlayLogo, CmsAnnotation::setFrom(), FWEventAnnotation::setFrom(), FWConfigurableParameterizable::version(), FWConfiguration::version(), and viewerGL().

Referenced by FWGlimpseView::setFrom(), FWLegoViewBase::setFrom(), FWRPZView::setFrom(), and FW3DViewBase::setFrom().

356 {
357  // Make sure you change the version ranges here
358  // whenever you update the logic.
359  // The rationale should be:
360  // (version range supported by the next block) && (version range in the configuration file)
361  //
362  // This is not "forward" compatible, but I don't think
363  // we care.
364  if (version() >= 2 && iFrom.version() >= 1)
365  {
366  for(const_iterator it =begin(), itEnd = end();
367  it != itEnd;
368  ++it) {
369  (*it)->setFrom(iFrom);
370  }
371  }
372  if (iFrom.version() > 1)
373  {
374  assert( m_overlayEventInfo);
375  m_overlayEventInfo->setFrom(iFrom);
376  }
377  {
378  assert( m_overlayLogo);
379  m_overlayLogo->setFrom(iFrom);
380  }
381 
382  if (iFrom.version() > 4)
383  {
384  m_localEnergyScale->setFrom(iFrom);
385  }
386 
387 
388  // selection clors
389  {
390  const TGLColorSet& lcs = context().commonPrefs()->getLightColorSet();
391  const TGLColorSet& dcs = context().commonPrefs()->getDarkColorSet();
392  const UChar_t* ca = 0;
393 
394  ca = lcs.Selection(1).CArr();
395  viewerGL()->RefLightColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
396  ca = lcs.Selection(3).CArr();
397  viewerGL()->RefLightColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
398  ca = dcs.Selection(1).CArr();
399  viewerGL()->RefDarkColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
400  ca = dcs.Selection(3).CArr();
401  viewerGL()->RefDarkColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
402  }
403 }
FWEventAnnotation * m_overlayEventInfo
Definition: FWEveView.h:118
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator begin() const
virtual void setFrom(const FWConfiguration &)
unsigned int version() const
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
virtual void setFrom(const FWConfiguration &)
const_iterator end() const
const TGLColorSet & getLightColorSet() const
Definition: CmsShowCommon.h:69
std::auto_ptr< FWViewEnergyScale > m_localEnergyScale
Definition: FWEveView.h:146
const fireworks::Context & context()
Definition: FWEveView.h:64
const TGLColorSet & getDarkColorSet() const
Definition: CmsShowCommon.h:70
CmsShowCommon * commonPrefs() const
Definition: Context.cc:178
CmsAnnotation * m_overlayLogo
Definition: FWEveView.h:119
void FWEveView::setFromOrthoCamera ( TGLOrthoCamera *  camera,
const FWConfiguration iFrom 
)
protected

Definition at line 429 of file FWEveView.cc.

References fwLog, i, fwlog::kInfo, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, FWViewBase::typeName(), FWConfiguration::value(), relativeConstraints::value, FWConfiguration::valueForKey(), and viewerGL().

Referenced by FWLegoViewBase::setFrom(), and FWRPZView::setFrom().

430 {
431  try {
432  // zoom
433  std::string zoomName("cameraZoom"); zoomName += typeName();
434  if (iFrom.valueForKey(zoomName) == 0 )
435  {
436  throw std::runtime_error("can't restore parameter cameraZoom");
437  }
438  std::istringstream s(iFrom.valueForKey(zoomName)->value());
439  s>>(camera->fZoom);
440 
441  // transformation matrix
442  std::string matrixName("cameraMatrix");
443  for ( unsigned int i = 0; i < 16; ++i ) {
444  std::ostringstream os;
445  os << i;
446  const FWConfiguration* value = iFrom.valueForKey( matrixName + os.str() + typeName() );
447  if ( value == 0 )
448  {
449  throw std::runtime_error ("can't restore parameter cameraMatrix.");
450  }
451  std::istringstream s(value->value());
452  s>> (camera->RefCamTrans()[i]);
453  }
454  }
455  catch (const std::runtime_error& iException)
456  {
457  fwLog(fwlog::kInfo) << "Caught exception while restoring camera parameters in view " << typeName() << "\n.";
458  viewerGL()->ResetCamerasAfterNextUpdate();
459 
460  }
461  camera->IncTimeStamp();
462 }
int i
Definition: DBlmapReader.cc:9
const std::string & typeName() const
Definition: FWViewBase.cc:120
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
const std::string & value(unsigned int iIndex=0) const
#define fwLog(_level_)
Definition: fwLog.h:50
const FWConfiguration * valueForKey(const std::string &iKey) const
void FWEveView::setFromPerspectiveCamera ( TGLPerspectiveCamera *  cam,
const std::string &  name,
const FWConfiguration iFrom 
)
protected

Definition at line 494 of file FWEveView.cc.

References fwLog, i, fwlog::kDebug, fwlog::kInfo, mergeVDriftHistosByStation::name, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, FWViewBase::typeName(), FWConfiguration::value(), relativeConstraints::value, FWConfiguration::valueForKey(), and viewerGL().

Referenced by FWGlimpseView::setFrom(), FWLegoViewBase::setFrom(), and FW3DViewBase::setFrom().

495 {
496  try {
497  std::string matrixName("cameraMatrix");
498  for ( unsigned int i = 0; i < 16; ++i ){
499  std::ostringstream os;
500  os << i;
501  const FWConfiguration* value = iFrom.valueForKey( matrixName + os.str() + name );
502  if ( value == 0 )
503  {
504  throw std::runtime_error ("can't restore parameter cameraMatrix.");
505  }
506  std::istringstream s(value->value());
507  s>>((cam->RefCamTrans())[i]);
508  }
509 
510  // transformation matrix base
511  matrixName = "cameraMatrixBase";
512  for ( unsigned int i = 0; i < 16; ++i ){
513  std::ostringstream os;
514  os << i;
515  const FWConfiguration* value = iFrom.valueForKey( matrixName + os.str() + name );
516  if ( value == 0 )
517  {
518  throw std::runtime_error ("can't restore parameter cameraMatrixBase.");
519  }
520 
521  std::istringstream s(value->value());
522  s>>((cam->RefCamBase())[i]);
523  }
524 
525  {
526  const FWConfiguration* value = iFrom.valueForKey( name + " FOV" );
527  if ( value == 0 )
528  {
529  throw std::runtime_error ("can't restore parameter cameraMatrixBase.");
530  }
531  std::istringstream s(value->value());
532  s>>cam->fFOV;
533  }
534 
535  cam->IncTimeStamp();
536  }
537  catch (const std::runtime_error& iException)
538  {
539  fwLog(fwlog::kInfo) << "Caught exception while restoring camera parameters in view " << typeName() << "\n.";
540  viewerGL()->ResetCamerasAfterNextUpdate();
541  fwLog(fwlog::kDebug) << "Reset camera fo view " << typeName() << "\n.";
542  }
543 }
int i
Definition: DBlmapReader.cc:9
const std::string & typeName() const
Definition: FWViewBase.cc:120
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
const std::string & value(unsigned int iIndex=0) const
#define fwLog(_level_)
Definition: fwLog.h:50
const FWConfiguration * valueForKey(const std::string &iKey) const
void FWEveView::setupEnergyScale ( )
virtual

Definition at line 298 of file FWEveView.cc.

References context(), f, FWViewContext::getEnergyScale(), getEveCalo(), fireworks::Context::getMaxEnergyInEvent(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactor3D(), FWViewEnergyScale::getScaleFactorLego(), FWViewType::isLego(), Pi, FWViewContext::scaleChanged(), FWViewBase::typeId(), FWViewEnergyScale::updateScaleFactors(), viewContext(), and voteCaloMaxVal().

Referenced by eventEnd(), FWEveView(), FWRPZView::setEtaRng(), and useGlobalEnergyScaleChanged().

299 {
300  // Called at end of event OR if scale parameters changed.
301 
302  FWViewEnergyScale* energyScale = viewContext()->getEnergyScale();
303  // printf("setupEnergyScale %s >> scale name %s\n", typeName().c_str(), energyScale->name().c_str());
304  voteCaloMaxVal();
305 
306  // set cache for energy to lenght conversion
307  float maxVal = context().getMaxEnergyInEvent(energyScale->getPlotEt());
308  energyScale->updateScaleFactors(maxVal);
309  // printf("max event val %f \n", maxVal);
310  // printf("scales lego %f \n", energyScale->getScaleFactorLego());
311 
312  // configure TEveCaloViz
313  TEveCaloViz* calo = getEveCalo();
314  if (calo)
315  {
316  calo->SetPlotEt(energyScale->getPlotEt());
317  if (FWViewType::isLego(typeId()))
318  {
319  float f = energyScale->getScaleFactorLego();
320  calo->SetMaxValAbs(TMath::Pi()/f);
321  }
322  else
323  {
324  float f = energyScale->getScaleFactor3D();
325  calo->SetMaxValAbs(100/f);
326  }
327  calo->ElementChanged();
328  }
329 
330  // emit signal to proxy builders
332  gEve->Redraw3D();
333 }
void scaleChanged()
const double Pi
float getScaleFactor3D() const
virtual TEveCaloViz * getEveCalo() const
Definition: FWEveView.h:95
FWViewEnergyScale * getEnergyScale() const
void updateScaleFactors(float iMaxVal)
virtual void voteCaloMaxVal()
Definition: FWEveView.cc:290
float getScaleFactorLego() const
double f[11][100]
float getMaxEnergyInEvent(bool isEt) const
Definition: Context.cc:200
const fireworks::Context & context()
Definition: FWEveView.h:64
FWViewContext * viewContext()
Definition: FWEveView.h:79
static bool isLego(int)
Definition: FWViewType.cc:135
bool getPlotEt() const
FWViewType::EType typeId() const
Definition: FWViewBase.h:41
void FWEveView::useGlobalEnergyScaleChanged ( )
virtual

Definition at line 282 of file FWEveView.cc.

References fireworks::Context::commonPrefs(), context(), CmsShowCommon::getEnergyScale(), m_localEnergyScale, m_useGlobalEnergyScale, m_viewContext, m_viewEnergyScaleEditor, FWViewEnergyScaleEditor::setEnabled(), setupEnergyScale(), and FWGenericParameter< T >::value().

Referenced by FWEveView().

283 {
287 }
std::auto_ptr< FWViewContext > m_viewContext
Definition: FWEveView.h:145
FWViewEnergyScaleEditor * m_viewEnergyScaleEditor
Definition: FWEveView.h:148
virtual void setupEnergyScale()
Definition: FWEveView.cc:298
FWBoolParameter m_useGlobalEnergyScale
Definition: FWEveView.h:142
std::auto_ptr< FWViewEnergyScale > m_localEnergyScale
Definition: FWEveView.h:146
const fireworks::Context & context()
Definition: FWEveView.h:64
FWViewEnergyScale * getEnergyScale() const
Definition: CmsShowCommon.h:67
CmsShowCommon * commonPrefs() const
Definition: Context.cc:178
FWViewContext* FWEveView::viewContext ( )
inline

Definition at line 79 of file FWEveView.h.

References m_viewContext.

Referenced by FWEveViewManager::beingDestroyed(), FWEveViewManager::newItem(), and setupEnergyScale().

79 { return m_viewContext.get(); }
std::auto_ptr< FWViewContext > m_viewContext
Definition: FWEveView.h:145
TEveViewer* FWEveView::viewer ( )
inline

Definition at line 74 of file FWEveView.h.

References m_viewer.

Referenced by FWGlimpseView::FWGlimpseView(), FWGLEventHandler::HandleCrossing(), and FWGLEventHandler::HandleFocusChange().

74 { return m_viewer; }
TEveViewer * m_viewer
Definition: FWEveView.h:113
TGLViewer * FWEveView::viewerGL ( ) const
void FWEveView::voteCaloMaxVal ( )
virtual

Reimplemented in FWRPZView.

Definition at line 290 of file FWEveView.cc.

References context(), getEveCalo(), and fireworks::Context::voteMaxEtAndEnergy().

Referenced by setupEnergyScale().

291 {
292  TEveCaloViz* calo = getEveCalo();
293  if (calo)
294  context().voteMaxEtAndEnergy(calo->GetData()->GetMaxVal(1), calo->GetData()->GetMaxVal(0));
295 }
virtual TEveCaloViz * getEveCalo() const
Definition: FWEveView.h:95
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:184
const fireworks::Context & context()
Definition: FWEveView.h:64

Member Data Documentation

TGLCameraGuide* FWEveView::m_cameraGuide
private

Definition at line 121 of file FWEveView.h.

Referenced by cameraGuideChanged(), and FWEveView().

const fireworks::Context* FWEveView::m_context
protected

Definition at line 104 of file FWEveView.h.

Referenced by context(), FWRPZView::populateController(), and setContext().

FWBoolParameter FWEveView::m_drawCMSLogo
private

Definition at line 132 of file FWEveView.h.

Referenced by FWEveView(), and populateController().

ScaleAnnotation* FWEveView::m_energyMaxValAnnotation
private

Definition at line 120 of file FWEveView.h.

Referenced by FWEveView().

FWEnumParameter FWEveView::m_eventInfoLevel
private

Definition at line 131 of file FWEveView.h.

Referenced by FWEveView(), and populateController().

TEveScene* FWEveView::m_eventScene
private

Definition at line 114 of file FWEveView.h.

Referenced by eventScene(), FWEveView(), and ~FWEveView().

TEveScene* FWEveView::m_geoScene
private

Definition at line 116 of file FWEveView.h.

Referenced by FWEveView(), geoScene(), and ~FWEveView().

FWDoubleParameter FWEveView::m_imageScale
private

Definition at line 129 of file FWEveView.h.

Referenced by populateController(), and saveImageTo().

FWDoubleParameter FWEveView::m_lineOutlineScale
private

Definition at line 138 of file FWEveView.h.

Referenced by FWEveView(), pointLineScalesChanged(), and populateController().

FWBoolParameter FWEveView::m_lineSmooth
private

Definition at line 136 of file FWEveView.h.

Referenced by FWEveView(), pointLineScalesChanged(), and populateController().

FWDoubleParameter FWEveView::m_lineWidth
private

Definition at line 137 of file FWEveView.h.

Referenced by FWEveView(), pointLineScalesChanged(), and populateController().

FWDoubleParameter FWEveView::m_lineWireframeScale
private

Definition at line 139 of file FWEveView.h.

Referenced by FWEveView(), pointLineScalesChanged(), and populateController().

std::auto_ptr<FWViewEnergyScale> FWEveView::m_localEnergyScale
private

Definition at line 146 of file FWEveView.h.

Referenced by FWEveView(), populateController(), setFrom(), and useGlobalEnergyScaleChanged().

FWEventAnnotation* FWEveView::m_overlayEventInfo
private

Definition at line 118 of file FWEveView.h.

Referenced by addTo(), eventEnd(), FWEveView(), and setFrom().

CmsAnnotation* FWEveView::m_overlayLogo
private

Definition at line 119 of file FWEveView.h.

Referenced by addTo(), FWEveView(), and setFrom().

TEveElement* FWEveView::m_ownedProducts
private

Definition at line 115 of file FWEveView.h.

Referenced by FWEveView(), and ownedProducts().

FWDoubleParameter FWEveView::m_pointSize
private

Definition at line 135 of file FWEveView.h.

Referenced by FWEveView(), pointLineScalesChanged(), and populateController().

FWBoolParameter FWEveView::m_pointSmooth
private

Definition at line 134 of file FWEveView.h.

Referenced by FWEveView(), pointLineScalesChanged(), and populateController().

FWBoolParameter FWEveView::m_showCameraGuide
private

Definition at line 141 of file FWEveView.h.

Referenced by cameraGuideChanged(), FWEveView(), and populateController().

FWBoolParameter FWEveView::m_useGlobalEnergyScale
private
std::auto_ptr<FWViewContext> FWEveView::m_viewContext
private

Definition at line 145 of file FWEveView.h.

Referenced by addTo(), FWEveView(), setContext(), useGlobalEnergyScaleChanged(), and viewContext().

boost::shared_ptr<FWViewContextMenuHandlerGL> FWEveView::m_viewContextMenu
private

Definition at line 144 of file FWEveView.h.

Referenced by contextMenuHandler(), and FWEveView().

FWViewEnergyScaleEditor* FWEveView::m_viewEnergyScaleEditor
mutableprivate

Definition at line 148 of file FWEveView.h.

Referenced by populateController(), and useGlobalEnergyScaleChanged().

TEveViewer* FWEveView::m_viewer
private

Definition at line 113 of file FWEveView.h.

Referenced by FWEveView(), viewer(), viewerGL(), and ~FWEveView().