Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:31

0001 // -*- C++ -*-
0002 //
0003 // Package:     Core
0004 // Class  :     FWEveView
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:  Alja Mrak-Tadel
0010 //         Created:  Thu Mar 16 14:11:32 CET 2010
0011 //
0012 
0013 #ifndef Fireworks_Core_FWEveView_h
0014 #define Fireworks_Core_FWEveView_h
0015 
0016 // user include files
0017 #include "Fireworks/Core/interface/FWViewBase.h"
0018 #include "Fireworks/Core/interface/FWDoubleParameter.h"
0019 #include "Fireworks/Core/interface/FWBoolParameter.h"
0020 #include "Fireworks/Core/interface/FWLongParameter.h"
0021 #include "Fireworks/Core/interface/FWEnumParameter.h"
0022 #include "Fireworks/Core/interface/FWEvePtr.h"
0023 
0024 // forward declarations
0025 class TGLViewer;
0026 class TGLOrthoCamera;
0027 class TGLPerspectiveCamera;
0028 class TGLCameraGuide;
0029 class TGLAnnotation;
0030 class TEveViewer;
0031 class TEveElementList;
0032 class TEveScene;
0033 class TEveWindowSlot;
0034 class TEveCaloViz;
0035 
0036 class FWTGLViewer;
0037 class FWTEveViewer;
0038 
0039 class FWEventAnnotation;
0040 class CmsAnnotation;
0041 class FWViewContextMenuHandlerGL;
0042 class FWColorManager;
0043 class FWViewContext;
0044 class ViewerParameterGUI;
0045 class FWViewEnergyScale;
0046 class ScaleAnnotation;
0047 class FWViewEnergyScaleEditor;
0048 
0049 namespace fireworks {
0050   class Context;
0051 }
0052 
0053 class FWEveView : public FWViewBase {
0054 public:
0055   FWEveView(TEveWindowSlot*, FWViewType::EType, unsigned int version = 7);
0056   ~FWEveView() override;
0057 
0058   void setFrom(const FWConfiguration&) override;
0059   virtual void setBackgroundColor(Color_t);
0060   virtual void eventEnd();
0061   virtual void eventBegin();
0062 
0063   virtual void setContext(const fireworks::Context& x);
0064   const fireworks::Context& context() { return *m_context; }
0065 
0066   // ---------- const member functions ---------------------
0067 
0068   void addTo(FWConfiguration&) const override;
0069   FWViewContextMenuHandlerBase* contextMenuHandler() const override;
0070   void saveImageTo(const std::string& iName) const override;
0071   void populateController(ViewerParameterGUI&) const override;
0072 
0073   TGLViewer* viewerGL() const;
0074   TEveViewer* viewer();
0075 
0076   FWTGLViewer* fwViewerGL() const;
0077   FWTEveViewer* fwViewer() { return m_viewer; }
0078 
0079   TEveScene* eventScene() { return m_eventScene; }
0080   TEveScene* geoScene() { return m_geoScene; }
0081 
0082   TEveElement* ownedProducts() { return m_ownedProducts; }
0083   FWViewContext* viewContext() { return m_viewContext.get(); }
0084 
0085   // ---------- static member functions --------------------
0086   virtual void useGlobalEnergyScaleChanged();
0087   virtual bool isEnergyScaleGlobal() const;
0088   virtual void setupEnergyScale();
0089   virtual void setupEventCenter();
0090   virtual void voteCaloMaxVal();
0091 
0092   virtual bool requestGLHandlerPick() const { return false; }
0093 
0094 protected:
0095   virtual void resetCamera();
0096   virtual void pointLineScalesChanged();
0097   virtual void cameraGuideChanged();
0098 
0099   // scales
0100   virtual TEveCaloViz* getEveCalo() const { return nullptr; }
0101 
0102   // config
0103   void addToOrthoCamera(TGLOrthoCamera*, FWConfiguration&) const;
0104   void setFromOrthoCamera(TGLOrthoCamera*, const FWConfiguration&);
0105   void addToPerspectiveCamera(TGLPerspectiveCamera*, const std::string&, FWConfiguration&) const;
0106   void setFromPerspectiveCamera(TGLPerspectiveCamera*, const std::string&, const FWConfiguration&);
0107 
0108 protected:
0109   const fireworks::Context* m_context;
0110 
0111 public:
0112   FWEveView(const FWEveView&) = delete;                   // stop default
0113   const FWEveView& operator=(const FWEveView&) = delete;  // stop default
0114 
0115 private:
0116   // ---------- member data --------------------------------
0117 
0118   FWTEveViewer* m_viewer;
0119   TEveScene* m_eventScene;
0120   TEveElement* m_ownedProducts;
0121   TEveScene* m_geoScene;
0122 
0123   FWEventAnnotation* m_overlayEventInfo;
0124   CmsAnnotation* m_overlayLogo;
0125   ScaleAnnotation* m_energyMaxValAnnotation;
0126   TGLCameraGuide* m_cameraGuide;
0127 
0128 private:
0129   // style parameters
0130 #if ROOT_VERSION_CODE >= ROOT_VERSION(5, 26, 0)
0131   FWDoubleParameter m_imageScale;
0132 #endif
0133   FWEnumParameter m_eventInfoLevel;
0134   FWBoolParameter m_drawCMSLogo;
0135 
0136   FWBoolParameter m_pointSmooth;
0137   FWDoubleParameter m_pointSize;
0138   FWBoolParameter m_lineSmooth;
0139   FWDoubleParameter m_lineWidth;
0140   FWDoubleParameter m_lineOutlineScale;
0141   FWDoubleParameter m_lineWireframeScale;
0142 
0143   FWBoolParameter m_showCameraGuide;
0144   FWBoolParameter m_useGlobalEnergyScale;
0145 
0146   std::shared_ptr<FWViewContextMenuHandlerGL> m_viewContextMenu;
0147   std::unique_ptr<FWViewContext> m_viewContext;
0148   std::unique_ptr<FWViewEnergyScale> m_localEnergyScale;
0149 
0150   mutable FWViewEnergyScaleEditor* m_viewEnergyScaleEditor;
0151 };
0152 
0153 #endif