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)
 
FWTEveViewerfwViewer ()
 
FWTGLViewerfwViewerGL () const
 
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
 
FWTEveViewerm_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 55 of file FWEveView.h.

Constructor & Destructor Documentation

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

Definition at line 81 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(), FWTEveViewer::SpawnFWTGLViewer(), FWViewBase::typeName(), useGlobalEnergyScaleChanged(), and viewerGL().

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

Definition at line 177 of file FWEveView.cc.

References m_eventScene, m_geoScene, and m_viewer.

178 {
179  m_geoScene->RemoveElements();
180  m_eventScene->RemoveElements();
181  m_viewer->DestroyWindowAndSlot();
182 }
TEveScene * m_geoScene
Definition: FWEveView.h:123
FWTEveViewer * m_viewer
Definition: FWEveView.h:120
TEveScene * m_eventScene
Definition: FWEveView.h:121
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 346 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().

347 {
348  // take care of parameters
350 
351  {
352  assert ( m_overlayEventInfo );
354  }
355  {
356  assert ( m_overlayLogo );
357  m_overlayLogo->addTo(iTo);
358  }
359 
360  m_viewContext->getEnergyScale()->addTo(iTo);
361 }
FWEventAnnotation * m_overlayEventInfo
Definition: FWEveView.h:125
std::auto_ptr< FWViewContext > m_viewContext
Definition: FWEveView.h:149
virtual void addTo(FWConfiguration &) const
virtual void addTo(FWConfiguration &) const
CmsAnnotation * m_overlayLogo
Definition: FWEveView.h:126
virtual void addTo(FWConfiguration &) const
void FWEveView::addToOrthoCamera ( TGLOrthoCamera *  camera,
FWConfiguration iTo 
) const
protected

Definition at line 418 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().

419 {
420  // zoom
421  std::ostringstream s;
422  s<<(camera->fZoom);
423  std::string name("cameraZoom");
424  iTo.addKeyValue(name+typeName(),FWConfiguration(s.str()));
425 
426  // transformation matrix
427  std::string matrixName("cameraMatrix");
428  for ( unsigned int i = 0; i < 16; ++i ) {
429  std::ostringstream osIndex;
430  osIndex << i;
431  std::ostringstream osValue;
432  osValue << camera->GetCamTrans()[i];
433  iTo.addKeyValue(matrixName+osIndex.str()+typeName(),FWConfiguration(osValue.str()));
434  }
435 }
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 474 of file FWEveView.cc.

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

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

475 {
476  // transformation matrix
477  std::string matrixName("cameraMatrix");
478  for ( unsigned int i = 0; i < 16; ++i ){
479  std::ostringstream osIndex;
480  osIndex << i;
481  std::ostringstream osValue;
482  osValue << (cam->GetCamTrans())[i];
483  iTo.addKeyValue(matrixName+osIndex.str()+name,FWConfiguration(osValue.str()));
484  }
485 
486  // transformation matrix base
487  matrixName = "cameraMatrixBase";
488  for ( unsigned int i = 0; i < 16; ++i ){
489  std::ostringstream osIndex;
490  osIndex << i;
491  std::ostringstream osValue;
492  osValue << (cam->GetCamBase())[i];
493  iTo.addKeyValue(matrixName+osIndex.str()+name,FWConfiguration(osValue.str()));
494  }
495  {
496  std::ostringstream osValue;
497  osValue << cam->fFOV;
498  iTo.addKeyValue(name+" FOV",FWConfiguration(osValue.str()));
499  }
500 }
int i
Definition: DBlmapReader.cc:9
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
void FWEveView::cameraGuideChanged ( )
protectedvirtual

Definition at line 242 of file FWEveView.cc.

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

Referenced by FWEveView().

243 {
244  m_cameraGuide->SetBinaryState(m_showCameraGuide.value());
245  viewerGL()->Changed();
246  gEve->Redraw3D();
247 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
FWBoolParameter m_showCameraGuide
Definition: FWEveView.h:145
TGLCameraGuide * m_cameraGuide
Definition: FWEveView.h:128
const fireworks::Context& FWEveView::context ( )
inline
FWViewContextMenuHandlerBase * FWEveView::contextMenuHandler ( ) const
virtual

Reimplemented from FWViewBase.

Definition at line 189 of file FWEveView.cc.

References m_viewContextMenu.

189  {
190  return dynamic_cast<FWViewContextMenuHandlerBase*> (m_viewContextMenu.get());
191 }
boost::shared_ptr< FWViewContextMenuHandlerGL > m_viewContextMenu
Definition: FWEveView.h:148
void FWEveView::eventBegin ( )
virtual

Reimplemented in FWRPZView.

Definition at line 250 of file FWEveView.cc.

251 {
252 }
void FWEveView::eventEnd ( )
virtual

Definition at line 255 of file FWEveView.cc.

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

256 {
259 }
FWEventAnnotation * m_overlayEventInfo
Definition: FWEveView.h:125
virtual void setupEnergyScale()
Definition: FWEveView.cc:307
TEveScene* FWEveView::eventScene ( )
inline
FWTEveViewer* FWEveView::fwViewer ( )
inline

Definition at line 80 of file FWEveView.h.

References m_viewer.

80 { return m_viewer; }
FWTEveViewer * m_viewer
Definition: FWEveView.h:120
FWTGLViewer * FWEveView::fwViewerGL ( ) const

Definition at line 206 of file FWEveView.cc.

References FWTEveViewer::fwGlViewer(), and m_viewer.

207 {
208  return m_viewer->fwGlViewer();
209 }
FWTGLViewer * fwGlViewer()
Definition: FWTEveViewer.h:53
FWTEveViewer * m_viewer
Definition: FWEveView.h:120
TEveScene* FWEveView::geoScene ( )
inline
virtual TEveCaloViz* FWEveView::getEveCalo ( ) const
inlineprotectedvirtual

Reimplemented in FWLegoViewBase, FWRPZView, and FW3DView.

Definition at line 102 of file FWEveView.h.

Referenced by setupEnergyScale(), and voteCaloMaxVal().

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

Definition at line 285 of file FWEveView.cc.

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

286 {
287  return m_useGlobalEnergyScale.value();
288 }
FWBoolParameter m_useGlobalEnergyScale
Definition: FWEveView.h:146
const FWEveView& FWEveView::operator= ( const FWEveView )
private
TEveElement* FWEveView::ownedProducts ( )
inline

Definition at line 85 of file FWEveView.h.

References m_ownedProducts.

Referenced by FWEveViewManager::finishViewCreate().

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

Definition at line 229 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().

230 {
231  viewerGL()->SetSmoothPoints(m_pointSmooth.value());
232  viewerGL()->SetPointScale (m_pointSize.value());
233  viewerGL()->SetSmoothLines (m_lineSmooth.value());
234  viewerGL()->SetLineScale (m_lineWidth.value());
235  viewerGL()->SetOLLineW (m_lineOutlineScale.value());
236  viewerGL()->SetWFLineW (m_lineWireframeScale.value());
237  viewerGL()->Changed();
238  gEve->Redraw3D();
239 }
FWDoubleParameter m_pointSize
Definition: FWEveView.h:139
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
FWBoolParameter m_lineSmooth
Definition: FWEveView.h:140
FWBoolParameter m_pointSmooth
Definition: FWEveView.h:138
FWDoubleParameter m_lineOutlineScale
Definition: FWEveView.h:142
FWDoubleParameter m_lineWidth
Definition: FWEveView.h:141
FWDoubleParameter m_lineWireframeScale
Definition: FWEveView.h:143
void FWEveView::populateController ( ViewerParameterGUI gui) const
virtual

Reimplemented from FWViewBase.

Reimplemented in FWLegoViewBase, FW3DViewBase, FWRPZView, and FWISpyView.

Definition at line 556 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().

557 {
558  gui.requestTab("Style").
559  addParam(&m_eventInfoLevel).
560  addParam(&m_drawCMSLogo).
561  addParam(&m_showCameraGuide).
562  separator().
563 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)
564  addParam(&m_imageScale).
565 #endif
566  addParam(&m_pointSize).
567  addParam(&m_pointSmooth).
568  addParam(&m_lineSmooth).
569  addParam(&m_lineWidth).
570  addParam(&m_lineOutlineScale).
571  addParam(&m_lineWireframeScale);
572 
573 
574  gui.requestTab("Scales").
575  addParam(&m_useGlobalEnergyScale);
576 
580 }
ViewerParameterGUI & requestTab(const char *)
FWViewEnergyScaleEditor * m_viewEnergyScaleEditor
Definition: FWEveView.h:152
void addFrameToContainer(TGCompositeFrame *)
FWDoubleParameter m_pointSize
Definition: FWEveView.h:139
FWBoolParameter m_lineSmooth
Definition: FWEveView.h:140
FWBoolParameter m_showCameraGuide
Definition: FWEveView.h:145
FWBoolParameter m_useGlobalEnergyScale
Definition: FWEveView.h:146
FWBoolParameter m_drawCMSLogo
Definition: FWEveView.h:136
std::auto_ptr< FWViewEnergyScale > m_localEnergyScale
Definition: FWEveView.h:150
FWBoolParameter m_pointSmooth
Definition: FWEveView.h:138
FWDoubleParameter m_imageScale
Definition: FWEveView.h:133
FWDoubleParameter m_lineOutlineScale
Definition: FWEveView.h:142
TGCompositeFrame * getTabContainer()
FWEnumParameter m_eventInfoLevel
Definition: FWEveView.h:135
static bool isLego(int)
Definition: FWViewType.cc:135
FWDoubleParameter m_lineWidth
Definition: FWEveView.h:141
FWDoubleParameter m_lineWireframeScale
Definition: FWEveView.h:143
FWViewType::EType typeId() const
Definition: FWViewBase.h:41
virtual bool FWEveView::requestGLHandlerPick ( ) const
inlinevirtual

Reimplemented in FW3DViewBase.

Definition at line 94 of file FWEveView.h.

Referenced by FWGLEventHandler::HandleButton().

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

Definition at line 268 of file FWEveView.cc.

References viewerGL().

269 {
270  viewerGL()->ResetCurrentCamera();
271 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
void FWEveView::saveImageTo ( const std::string &  iName) const
virtual

Implements FWViewBase.

Definition at line 212 of file FWEveView.cc.

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

213 {
214  bool succeeded = false;
215 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)
216  succeeded = viewerGL()->SavePictureScale(iName, m_imageScale.value());
217 #else
218  succeeded = viewerGL()->SavePicture(iName.c_str());
219 #endif
220 
221  if(!succeeded) {
222  throw std::runtime_error("Unable to save picture");
223  }
224  fwLog(fwlog::kInfo) << "Saved image " << iName << std::endl;
225 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
FWDoubleParameter m_imageScale
Definition: FWEveView.h:133
#define fwLog(_level_)
Definition: fwLog.h:50
void FWEveView::setBackgroundColor ( Color_t  iColor)
virtual

Reimplemented in FWEveLegoView.

Definition at line 262 of file FWEveView.cc.

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

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

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

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

Definition at line 275 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().

276 {
277  m_context = &x ;
278 
279  // in constructor view context has local scale
281  m_viewContext->setEnergyScale(context().commonPrefs()->getEnergyScale());
282 }
std::auto_ptr< FWViewContext > m_viewContext
Definition: FWEveView.h:149
const fireworks::Context * m_context
Definition: FWEveView.h:111
FWBoolParameter m_useGlobalEnergyScale
Definition: FWEveView.h:146
const fireworks::Context & context()
Definition: FWEveView.h:67
Definition: DDAxes.h:10
void FWEveView::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWConfigurableParameterizable.

Reimplemented in FW3DViewBase, FWRPZView, FWLegoViewBase, and FWGlimpseView.

Definition at line 364 of file FWEveView.cc.

References FWParameterizable::begin(), fireworks::Context::commonPrefs(), context(), FWParameterizable::end(), CmsShowCommon::getDarkColorSet(), CmsShowCommon::getLightColorSet(), counter::lcs, 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().

365 {
366  // Make sure you change the version ranges here
367  // whenever you update the logic.
368  // The rationale should be:
369  // (version range supported by the next block) && (version range in the configuration file)
370  //
371  // This is not "forward" compatible, but I don't think
372  // we care.
373  if (version() >= 2 && iFrom.version() >= 1)
374  {
375  for(const_iterator it =begin(), itEnd = end();
376  it != itEnd;
377  ++it) {
378  (*it)->setFrom(iFrom);
379  }
380  }
381  if (iFrom.version() > 1)
382  {
383  assert( m_overlayEventInfo);
384  m_overlayEventInfo->setFrom(iFrom);
385  }
386  {
387  assert( m_overlayLogo);
388  m_overlayLogo->setFrom(iFrom);
389  }
390 
391  if (iFrom.version() > 4)
392  {
393  m_localEnergyScale->setFrom(iFrom);
394  }
395 
396 
397  // selection clors
398  {
399  const TGLColorSet& lcs = context().commonPrefs()->getLightColorSet();
400  const TGLColorSet& dcs = context().commonPrefs()->getDarkColorSet();
401  const UChar_t* ca = 0;
402 
403  ca = lcs.Selection(1).CArr();
404  viewerGL()->RefLightColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
405  ca = lcs.Selection(3).CArr();
406  viewerGL()->RefLightColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
407  ca = dcs.Selection(1).CArr();
408  viewerGL()->RefDarkColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
409  ca = dcs.Selection(3).CArr();
410  viewerGL()->RefDarkColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
411  }
412 }
FWEventAnnotation * m_overlayEventInfo
Definition: FWEveView.h:125
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:194
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:150
const fireworks::Context & context()
Definition: FWEveView.h:67
const TGLColorSet & getDarkColorSet() const
Definition: CmsShowCommon.h:70
CmsShowCommon * commonPrefs() const
Definition: Context.cc:178
tuple lcs
Definition: counter.py:138
CmsAnnotation * m_overlayLogo
Definition: FWEveView.h:126
void FWEveView::setFromOrthoCamera ( TGLOrthoCamera *  camera,
const FWConfiguration iFrom 
)
protected

Definition at line 438 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().

439 {
440  try {
441  // zoom
442  std::string zoomName("cameraZoom"); zoomName += typeName();
443  if (iFrom.valueForKey(zoomName) == 0 )
444  {
445  throw std::runtime_error("can't restore parameter cameraZoom");
446  }
447  std::istringstream s(iFrom.valueForKey(zoomName)->value());
448  s>>(camera->fZoom);
449 
450  // transformation matrix
451  std::string matrixName("cameraMatrix");
452  for ( unsigned int i = 0; i < 16; ++i ) {
453  std::ostringstream os;
454  os << i;
455  const FWConfiguration* value = iFrom.valueForKey( matrixName + os.str() + typeName() );
456  if ( value == 0 )
457  {
458  throw std::runtime_error ("can't restore parameter cameraMatrix.");
459  }
460  std::istringstream s(value->value());
461  s>> (camera->RefCamTrans()[i]);
462  }
463  }
464  catch (const std::runtime_error& iException)
465  {
466  fwLog(fwlog::kInfo) << "Caught exception while restoring camera parameters in view " << typeName() << "\n.";
467  viewerGL()->ResetCamerasAfterNextUpdate();
468 
469  }
470  camera->IncTimeStamp();
471 }
int i
Definition: DBlmapReader.cc:9
const std::string & typeName() const
Definition: FWViewBase.cc:120
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
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 503 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().

504 {
505  try {
506  std::string matrixName("cameraMatrix");
507  for ( unsigned int i = 0; i < 16; ++i ){
508  std::ostringstream os;
509  os << i;
510  const FWConfiguration* value = iFrom.valueForKey( matrixName + os.str() + name );
511  if ( value == 0 )
512  {
513  throw std::runtime_error ("can't restore parameter cameraMatrix.");
514  }
515  std::istringstream s(value->value());
516  s>>((cam->RefCamTrans())[i]);
517  }
518 
519  // transformation matrix base
520  matrixName = "cameraMatrixBase";
521  for ( unsigned int i = 0; i < 16; ++i ){
522  std::ostringstream os;
523  os << i;
524  const FWConfiguration* value = iFrom.valueForKey( matrixName + os.str() + name );
525  if ( value == 0 )
526  {
527  throw std::runtime_error ("can't restore parameter cameraMatrixBase.");
528  }
529 
530  std::istringstream s(value->value());
531  s>>((cam->RefCamBase())[i]);
532  }
533 
534  {
535  const FWConfiguration* value = iFrom.valueForKey( name + " FOV" );
536  if ( value == 0 )
537  {
538  throw std::runtime_error ("can't restore parameter cameraMatrixBase.");
539  }
540  std::istringstream s(value->value());
541  s>>cam->fFOV;
542  }
543 
544  cam->IncTimeStamp();
545  }
546  catch (const std::runtime_error& iException)
547  {
548  fwLog(fwlog::kInfo) << "Caught exception while restoring camera parameters in view " << typeName() << "\n.";
549  viewerGL()->ResetCamerasAfterNextUpdate();
550  fwLog(fwlog::kDebug) << "Reset camera fo view " << typeName() << "\n.";
551  }
552 }
int i
Definition: DBlmapReader.cc:9
const std::string & typeName() const
Definition: FWViewBase.cc:120
TGLViewer * viewerGL() const
Definition: FWEveView.cc:194
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 307 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().

308 {
309  // Called at end of event OR if scale parameters changed.
310 
311  FWViewEnergyScale* energyScale = viewContext()->getEnergyScale();
312  // printf("setupEnergyScale %s >> scale name %s\n", typeName().c_str(), energyScale->name().c_str());
313  voteCaloMaxVal();
314 
315  // set cache for energy to lenght conversion
316  float maxVal = context().getMaxEnergyInEvent(energyScale->getPlotEt());
317  energyScale->updateScaleFactors(maxVal);
318  // printf("max event val %f \n", maxVal);
319  // printf("scales lego %f \n", energyScale->getScaleFactorLego());
320 
321  // configure TEveCaloViz
322  TEveCaloViz* calo = getEveCalo();
323  if (calo)
324  {
325  calo->SetPlotEt(energyScale->getPlotEt());
326  if (FWViewType::isLego(typeId()))
327  {
328  float f = energyScale->getScaleFactorLego();
329  calo->SetMaxValAbs(TMath::Pi()/f);
330  }
331  else
332  {
333  float f = energyScale->getScaleFactor3D();
334  calo->SetMaxValAbs(100/f);
335  }
336  calo->ElementChanged();
337  }
338 
339  // emit signal to proxy builders
341  gEve->Redraw3D();
342 }
void scaleChanged()
const double Pi
float getScaleFactor3D() const
virtual TEveCaloViz * getEveCalo() const
Definition: FWEveView.h:102
FWViewEnergyScale * getEnergyScale() const
void updateScaleFactors(float iMaxVal)
virtual void voteCaloMaxVal()
Definition: FWEveView.cc:299
float getScaleFactorLego() const
double f[11][100]
float getMaxEnergyInEvent(bool isEt) const
Definition: Context.cc:200
const fireworks::Context & context()
Definition: FWEveView.h:67
FWViewContext * viewContext()
Definition: FWEveView.h:86
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 291 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().

292 {
296 }
std::auto_ptr< FWViewContext > m_viewContext
Definition: FWEveView.h:149
FWViewEnergyScaleEditor * m_viewEnergyScaleEditor
Definition: FWEveView.h:152
virtual void setupEnergyScale()
Definition: FWEveView.cc:307
FWBoolParameter m_useGlobalEnergyScale
Definition: FWEveView.h:146
std::auto_ptr< FWViewEnergyScale > m_localEnergyScale
Definition: FWEveView.h:150
const fireworks::Context & context()
Definition: FWEveView.h:67
FWViewEnergyScale * getEnergyScale() const
Definition: CmsShowCommon.h:67
CmsShowCommon * commonPrefs() const
Definition: Context.cc:178
FWViewContext* FWEveView::viewContext ( )
inline

Definition at line 86 of file FWEveView.h.

References m_viewContext.

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

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

Definition at line 200 of file FWEveView.cc.

References m_viewer.

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

201 {
202  return m_viewer;
203 }
FWTEveViewer * m_viewer
Definition: FWEveView.h:120
TGLViewer * FWEveView::viewerGL ( ) const
void FWEveView::voteCaloMaxVal ( )
virtual

Reimplemented in FWRPZView.

Definition at line 299 of file FWEveView.cc.

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

Referenced by setupEnergyScale().

300 {
301  TEveCaloViz* calo = getEveCalo();
302  if (calo)
303  context().voteMaxEtAndEnergy(calo->GetData()->GetMaxVal(1), calo->GetData()->GetMaxVal(0));
304 }
virtual TEveCaloViz * getEveCalo() const
Definition: FWEveView.h:102
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:184
const fireworks::Context & context()
Definition: FWEveView.h:67

Member Data Documentation

TGLCameraGuide* FWEveView::m_cameraGuide
private

Definition at line 128 of file FWEveView.h.

Referenced by cameraGuideChanged(), and FWEveView().

const fireworks::Context* FWEveView::m_context
protected

Definition at line 111 of file FWEveView.h.

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

FWBoolParameter FWEveView::m_drawCMSLogo
private

Definition at line 136 of file FWEveView.h.

Referenced by FWEveView(), and populateController().

ScaleAnnotation* FWEveView::m_energyMaxValAnnotation
private

Definition at line 127 of file FWEveView.h.

Referenced by FWEveView().

FWEnumParameter FWEveView::m_eventInfoLevel
private

Definition at line 135 of file FWEveView.h.

Referenced by FWEveView(), and populateController().

TEveScene* FWEveView::m_eventScene
private

Definition at line 121 of file FWEveView.h.

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

TEveScene* FWEveView::m_geoScene
private

Definition at line 123 of file FWEveView.h.

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

FWDoubleParameter FWEveView::m_imageScale
private

Definition at line 133 of file FWEveView.h.

Referenced by populateController(), and saveImageTo().

FWDoubleParameter FWEveView::m_lineOutlineScale
private

Definition at line 142 of file FWEveView.h.

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

FWBoolParameter FWEveView::m_lineSmooth
private

Definition at line 140 of file FWEveView.h.

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

FWDoubleParameter FWEveView::m_lineWidth
private

Definition at line 141 of file FWEveView.h.

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

FWDoubleParameter FWEveView::m_lineWireframeScale
private

Definition at line 143 of file FWEveView.h.

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

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

Definition at line 150 of file FWEveView.h.

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

FWEventAnnotation* FWEveView::m_overlayEventInfo
private

Definition at line 125 of file FWEveView.h.

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

CmsAnnotation* FWEveView::m_overlayLogo
private

Definition at line 126 of file FWEveView.h.

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

TEveElement* FWEveView::m_ownedProducts
private

Definition at line 122 of file FWEveView.h.

Referenced by FWEveView(), and ownedProducts().

FWDoubleParameter FWEveView::m_pointSize
private

Definition at line 139 of file FWEveView.h.

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

FWBoolParameter FWEveView::m_pointSmooth
private

Definition at line 138 of file FWEveView.h.

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

FWBoolParameter FWEveView::m_showCameraGuide
private

Definition at line 145 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 149 of file FWEveView.h.

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

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

Definition at line 148 of file FWEveView.h.

Referenced by contextMenuHandler(), and FWEveView().

FWViewEnergyScaleEditor* FWEveView::m_viewEnergyScaleEditor
mutableprivate

Definition at line 152 of file FWEveView.h.

Referenced by populateController(), and useGlobalEnergyScaleChanged().

FWTEveViewer* FWEveView::m_viewer
private

Definition at line 120 of file FWEveView.h.

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