FWViewManagerBase

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
#ifndef Fireworks_Core_FWViewManagerBase_h
#define Fireworks_Core_FWViewManagerBase_h
// -*- C++ -*-
//
// Package:     Core
// Class  :     FWViewManagerBase
//
/**\class FWViewManagerBase FWViewManagerBase.h Fireworks/Core/interface/FWViewManagerBase.h

   Description: Base class for a Manger for a specific type of View

   Usage:
    <usage>

 */
//
// Original Author:
//         Created:  Sat Jan  5 10:29:00 EST 2008
//

// system include files
#include <string>
#include <vector>
#include <set>
#include <map>

// user include files

//Needed for gccxml
#include "Fireworks/Core/interface/FWTypeToRepresentations.h"

// forward declarations
class FWEventItem;
class TClass;
class FWGeometry;
class FWModelId;
class FWModelChangeManager;
class FWColorManager;
class FWTypeToRepresentations;

namespace fireworks {
  class Context;
}

class FWViewManagerBase {
public:
  virtual ~FWViewManagerBase();

  // ---------- const member functions ---------------------
  virtual FWTypeToRepresentations supportedTypesAndRepresentations() const = 0;
  // ---------- static member functions --------------------

  // ---------- member functions ---------------------------
  virtual void newItem(const FWEventItem*) = 0;

  virtual void setContext(const fireworks::Context* x) { m_context = x; }

  void setChangeManager(FWModelChangeManager* iCM);
  void setColorManager(FWColorManager* iCM);

  void modelChangesComingSlot();
  void modelChangesDoneSlot();
  void colorsChangedSlot();
  virtual void eventBegin() {}
  virtual void eventEnd() {}

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

  const fireworks::Context& context() const { return *m_context; }

protected:
  FWViewManagerBase();

  /**handles dynamic loading of a library or macro containing the class
      named iNameOfClass which inherits from iBaseClass.  The returned
      void* will correspond to the address of the 'BaseClass'
   */
  void* createInstanceOf(const TClass* iBaseClass, const char* iNameOfClass);

  /** called when models have changed and so the display must be updated*/
  virtual void modelChangesComing() = 0;
  virtual void modelChangesDone() = 0;
  virtual void colorsChanged() = 0;

  FWModelChangeManager& changeManager() const;
  FWColorManager& colorManager() const;

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

  const FWViewManagerBase& operator=(const FWViewManagerBase&) = delete;  // stop default

private:
  // ---------- member data --------------------------------
  const fireworks::Context* m_context;

  FWModelChangeManager* m_changeManager;
  FWColorManager* m_colorManager;
};

#endif