Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-14 11:45:00

0001 #ifndef Fireworks_Core_CmsShowCommon_h
0002 #define Fireworks_Core_CmsShowCommon_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Core
0006 // Class  :     CmsShowCommon
0007 //
0008 /**\class CmsShowCommon CmsShowCommon.h Fireworks/Core/interface/CmsShowCommon.h
0009 
0010  Description: [one line class summary]
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Alja Mrak-Tadel
0018 //         Created:  Fri Sep 10 14:51:07 CEST 2010
0019 //
0020 
0021 #include <sigc++/signal.h>
0022 #include <sigc++/sigc++.h>
0023 
0024 #include "Rtypes.h"
0025 #include "TGLUtil.h"
0026 #include "TEveVector.h"
0027 
0028 #include "Fireworks/Core/interface/FWConfigurableParameterizable.h"
0029 #include "Fireworks/Core/interface/FWBoolParameter.h"
0030 #include "Fireworks/Core/interface/FWLongParameter.h"
0031 #include "Fireworks/Core/interface/FWEnumParameter.h"
0032 #include "Fireworks/Core/interface/FWColorManager.h"
0033 #include "Fireworks/Core/interface/FWViewContext.h"
0034 #include "Fireworks/Core/interface/FWBeamSpot.h"
0035 
0036 class CmsShowCommonPopup;
0037 class FWViewEnergyScale;
0038 class FWColorManager;
0039 namespace fireworks {
0040   class Context;
0041 }
0042 
0043 class CmsShowCommon : public FWConfigurableParameterizable {
0044   friend class CmsShowCommonPopup;
0045 
0046 public:
0047   CmsShowCommon(fireworks::Context*);
0048   ~CmsShowCommon() override;
0049 
0050   // ---------- const member functions ---------------------
0051   void addTo(FWConfiguration&) const override;
0052 
0053   // ---------- static member functions --------------------
0054 
0055   // ---------- member functions ---------------------------
0056   void setFrom(const FWConfiguration&) override;
0057 
0058   void setTrackBreakMode();
0059   void setDrawBreakMarkers();
0060 
0061   int gamma() { return m_gamma.value(); }
0062   void setGamma();
0063   void switchBackground();
0064   void permuteColors();
0065   void randomizeColors();
0066   void loopPalettes();
0067 
0068   void setGeomColor(FWGeomColorIndex, Color_t);
0069   void setGeomTransparency(int val, bool projected);
0070   FWViewEnergyScale* getEnergyScale() const { return m_viewContext.getEnergyScale(); }
0071 
0072   const TGLColorSet& getLightColorSet() const { return m_lightColorSet; }
0073   const TGLColorSet& getDarkColorSet() const { return m_darkColorSet; }
0074 
0075   UChar_t getProjTrackBreaking() const { return m_trackBreak.value(); }
0076   bool getRnrPTBMarkers() const { return m_drawBreakPoints.value(); }
0077 
0078   void setView(CmsShowCommonPopup* x) { m_view = x; }
0079 
0080   void getEventCenter(float* inC) const;
0081   void setEventCenter(float, float, float);
0082   void resetEventCenter();
0083 
0084   mutable sigc::signal<void(const CmsShowCommon*)> eventCenterChanged_;
0085 
0086 protected:
0087   const FWColorManager* colorManager() const;
0088   void setPalette();
0089   // ---------- member data --------------------------------
0090 
0091   CmsShowCommonPopup* m_view;
0092   fireworks::Context* m_context;
0093 
0094   FWEnumParameter m_trackBreak;
0095   FWBoolParameter m_drawBreakPoints;
0096 
0097   // general colors
0098   mutable FWLongParameter m_backgroundColor;  // can be set via Ctr+b key binding
0099   FWLongParameter m_gamma;
0100   mutable FWEnumParameter m_palette;
0101 
0102   // geom colors
0103   FWLongParameter m_geomTransparency2D;
0104   FWLongParameter m_geomTransparency3D;
0105   FWLongParameter* m_geomColors[kFWGeomColorSize];
0106 
0107   TGLColorSet m_lightColorSet;
0108   TGLColorSet m_darkColorSet;
0109 
0110   FWViewContext m_viewContext;
0111 
0112   bool m_useBeamSpot;
0113   TEveVector m_externalEventCenter;  //cached
0114 
0115 public:
0116   CmsShowCommon(const CmsShowCommon&) = delete;                   // stop default
0117   const CmsShowCommon& operator=(const CmsShowCommon&) = delete;  // stop default
0118 };
0119 
0120 #endif