Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-03 04:09:59

0001 #ifndef Fireworks_Core_FWViewManagerBase_h
0002 #define Fireworks_Core_FWViewManagerBase_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Core
0006 // Class  :     FWViewManagerBase
0007 //
0008 /**\class FWViewManagerBase FWViewManagerBase.h Fireworks/Core/interface/FWViewManagerBase.h
0009 
0010    Description: Base class for a Manger for a specific type of View
0011 
0012    Usage:
0013     <usage>
0014 
0015  */
0016 //
0017 // Original Author:
0018 //         Created:  Sat Jan  5 10:29:00 EST 2008
0019 //
0020 
0021 // system include files
0022 #include <string>
0023 #include <vector>
0024 #include <set>
0025 #include <map>
0026 
0027 // user include files
0028 
0029 //Needed for gccxml
0030 #include "Fireworks/Core/interface/FWTypeToRepresentations.h"
0031 
0032 // forward declarations
0033 class FWEventItem;
0034 class TClass;
0035 class FWGeometry;
0036 class FWModelId;
0037 class FWModelChangeManager;
0038 class FWColorManager;
0039 class FWTypeToRepresentations;
0040 
0041 namespace fireworks {
0042   class Context;
0043 }
0044 
0045 class FWViewManagerBase {
0046 public:
0047   virtual ~FWViewManagerBase();
0048 
0049   // ---------- const member functions ---------------------
0050   virtual FWTypeToRepresentations supportedTypesAndRepresentations() const = 0;
0051   // ---------- static member functions --------------------
0052 
0053   // ---------- member functions ---------------------------
0054   virtual void newItem(const FWEventItem*) = 0;
0055 
0056   virtual void setContext(const fireworks::Context* x) { m_context = x; }
0057 
0058   void setChangeManager(FWModelChangeManager* iCM);
0059   void setColorManager(FWColorManager* iCM);
0060 
0061   void modelChangesComingSlot();
0062   void modelChangesDoneSlot();
0063   void colorsChangedSlot();
0064   virtual void eventBegin(){};
0065   virtual void eventEnd(){};
0066 
0067   // ---------- const member functions ---------------------
0068 
0069   const fireworks::Context& context() const { return *m_context; }
0070 
0071 protected:
0072   FWViewManagerBase();
0073 
0074   /**handles dynamic loading of a library or macro containing the class
0075       named iNameOfClass which inherits from iBaseClass.  The returned
0076       void* will correspond to the address of the 'BaseClass'
0077    */
0078   void* createInstanceOf(const TClass* iBaseClass, const char* iNameOfClass);
0079 
0080   /** called when models have changed and so the display must be updated*/
0081   virtual void modelChangesComing() = 0;
0082   virtual void modelChangesDone() = 0;
0083   virtual void colorsChanged() = 0;
0084 
0085   FWModelChangeManager& changeManager() const;
0086   FWColorManager& colorManager() const;
0087 
0088 public:
0089   FWViewManagerBase(const FWViewManagerBase&) = delete;  // stop default
0090 
0091   const FWViewManagerBase& operator=(const FWViewManagerBase&) = delete;  // stop default
0092 
0093 private:
0094   // ---------- member data --------------------------------
0095   const fireworks::Context* m_context;
0096 
0097   FWModelChangeManager* m_changeManager;
0098   FWColorManager* m_colorManager;
0099 };
0100 
0101 #endif