FWEveView

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
// -*- C++ -*-
//
// Package:     Core
// Class  :     FWEveView
//
// Implementation:
//     [Notes on implementation]
//
// Original Author:  Alja Mrak-Tadel
//         Created:  Thu Mar 16 14:11:32 CET 2010
//

#ifndef Fireworks_Core_FWEveView_h
#define Fireworks_Core_FWEveView_h

// user include files
#include "Fireworks/Core/interface/FWViewBase.h"
#include "Fireworks/Core/interface/FWDoubleParameter.h"
#include "Fireworks/Core/interface/FWBoolParameter.h"
#include "Fireworks/Core/interface/FWLongParameter.h"
#include "Fireworks/Core/interface/FWEnumParameter.h"
#include "Fireworks/Core/interface/FWEvePtr.h"

// forward declarations
class TGLViewer;
class TGLOrthoCamera;
class TGLPerspectiveCamera;
class TGLCameraGuide;
class TGLAnnotation;
class TEveViewer;
class TEveElementList;
class TEveScene;
class TEveWindowSlot;
class TEveCaloViz;

class FWTGLViewer;
class FWTEveViewer;

class FWEventAnnotation;
class CmsAnnotation;
class FWViewContextMenuHandlerGL;
class FWColorManager;
class FWViewContext;
class ViewerParameterGUI;
class FWViewEnergyScale;
class ScaleAnnotation;
class FWViewEnergyScaleEditor;

namespace fireworks {
  class Context;
}

class FWEveView : public FWViewBase {
public:
  FWEveView(TEveWindowSlot*, FWViewType::EType, unsigned int version = 7);
  ~FWEveView() override;

  void setFrom(const FWConfiguration&) override;
  virtual void setBackgroundColor(Color_t);
  virtual void eventEnd();
  virtual void eventBegin();

  virtual void setContext(const fireworks::Context& x);
  const fireworks::Context& context() { return *m_context; }

  // ---------- const member functions ---------------------

  void addTo(FWConfiguration&) const override;
  FWViewContextMenuHandlerBase* contextMenuHandler() const override;
  void saveImageTo(const std::string& iName) const override;
  void populateController(ViewerParameterGUI&) const override;

  TGLViewer* viewerGL() const;
  TEveViewer* viewer();

  FWTGLViewer* fwViewerGL() const;
  FWTEveViewer* fwViewer() { return m_viewer; }

  TEveScene* eventScene() { return m_eventScene; }
  TEveScene* geoScene() { return m_geoScene; }

  TEveElement* ownedProducts() { return m_ownedProducts; }
  FWViewContext* viewContext() { return m_viewContext.get(); }

  // ---------- static member functions --------------------
  virtual void useGlobalEnergyScaleChanged();
  virtual bool isEnergyScaleGlobal() const;
  virtual void setupEnergyScale();
  virtual void setupEventCenter();
  virtual void voteCaloMaxVal();

  virtual bool requestGLHandlerPick() const { return false; }

protected:
  virtual void resetCamera();
  virtual void pointLineScalesChanged();
  virtual void cameraGuideChanged();

  // scales
  virtual TEveCaloViz* getEveCalo() const { return nullptr; }

  // config
  void addToOrthoCamera(TGLOrthoCamera*, FWConfiguration&) const;
  void setFromOrthoCamera(TGLOrthoCamera*, const FWConfiguration&);
  void addToPerspectiveCamera(TGLPerspectiveCamera*, const std::string&, FWConfiguration&) const;
  void setFromPerspectiveCamera(TGLPerspectiveCamera*, const std::string&, const FWConfiguration&);

protected:
  const fireworks::Context* m_context;

public:
  FWEveView(const FWEveView&) = delete;                   // stop default
  const FWEveView& operator=(const FWEveView&) = delete;  // stop default

private:
  // ---------- member data --------------------------------

  FWTEveViewer* m_viewer;
  TEveScene* m_eventScene;
  TEveElement* m_ownedProducts;
  TEveScene* m_geoScene;

  FWEventAnnotation* m_overlayEventInfo;
  CmsAnnotation* m_overlayLogo;
  ScaleAnnotation* m_energyMaxValAnnotation;
  TGLCameraGuide* m_cameraGuide;

private:
  // style parameters
#if ROOT_VERSION_CODE >= ROOT_VERSION(5, 26, 0)
  FWDoubleParameter m_imageScale;
#endif
  FWEnumParameter m_eventInfoLevel;
  FWBoolParameter m_drawCMSLogo;

  FWBoolParameter m_pointSmooth;
  FWDoubleParameter m_pointSize;
  FWBoolParameter m_lineSmooth;
  FWDoubleParameter m_lineWidth;
  FWDoubleParameter m_lineOutlineScale;
  FWDoubleParameter m_lineWireframeScale;

  FWBoolParameter m_showCameraGuide;
  FWBoolParameter m_useGlobalEnergyScale;

  std::shared_ptr<FWViewContextMenuHandlerGL> m_viewContextMenu;
  std::unique_ptr<FWViewContext> m_viewContext;
  std::unique_ptr<FWViewEnergyScale> m_localEnergyScale;

  mutable FWViewEnergyScaleEditor* m_viewEnergyScaleEditor;
};

#endif