ufe  2.0
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
scene.h
Go to the documentation of this file.
1 #line 1 "S:/jenkins/workspace/ufe-full-windows/ufe/include/scene.h"
2 #ifndef _scene
3 #define _scene
4 // ===========================================================================
5 // Copyright 2018 Autodesk, Inc. All rights reserved.
6 //
7 // Use of this software is subject to the terms of the Autodesk license
8 // agreement provided at the time of installation or download, or which
9 // otherwise accompanies this software in either electronic or hard copy form.
10 // ===========================================================================
11 
12 #include "common/ufeExport.h"
13 
14 #include "sceneItem.h"
15 #include "subject.h"
16 
17 #include <memory>
18 
19 UFE_NS_DEF {
20 
21 class ObjectAdd;
22 class ObjectDelete;
23 class ObjectPathChange;
24 class SubtreeInvalidate;
25 class Path;
26 class SceneCompositeNotification;
27 
29 
42 class UFE_SDK_DECL Scene : public Subject
43 {
44 public:
45 
46  typedef std::shared_ptr<Scene> Ptr;
47 
49  static Scene& instance();
50 
56  static void initializeInstance(const Ptr& instance);
57 
59  ~Scene() override;
60 
62  Scene(const Scene&) = delete;
64  Scene& operator=(const Scene&) = delete;
65 
67  void notify(const Notification& notification) override;
68 
71  bool inCompositeNotification() const override;
72 
73 protected:
74 
76  Scene();
77 
82  virtual void postNotifyObjectAdd(const ObjectAdd& notification);
83 
88  virtual void postNotifyObjectDelete(const ObjectDelete& notification);
89 
94  virtual void postNotifyObjectPathChange(const ObjectPathChange& notification);
95 
100  virtual void postNotifySubtreeInvalidate(const SubtreeInvalidate& notification);
101 
106  virtual void postNotifySceneCompositeChange(const SceneCompositeNotification& notification);
107 
109  void beginNotificationGuard() override;
113  void endNotificationGuard() override;
115 
116 private:
118  std::unique_ptr<SceneCompositeNotification> fCompositeNotification;
119 };
120 
121 }
122 
123 #endif /* _scene */
Base class for object add scene notifications.
virtual void notify(const Notification &notification)
Singleton class to manage UFE scenes.
Definition: scene.h:42
Definition of macros for symbol visibility.
virtual bool inCompositeNotification() const
Observer pattern Subject class.
Definition: subject.h:40
Base class for object path change scene notifications.
Subtree invalidate notification.
Subject & operator=(const Subject &)
Assignment operator. Does nothing, as observers are not copied.
SceneChanged composite notification.
#define UFE_NS_DEF
Definition: ufe.h:35
Base class for all notifications.
Definition: notification.h:27
std::shared_ptr< Scene > Ptr
Definition: scene.h:46
void initializeInstance(const Ptr &globalSelection)
virtual void beginNotificationGuard()
Notification guard interface. Implementation in this class is a no-op.
std::unique_ptr< SceneCompositeNotification > fCompositeNotification
Composite notification, when within the scope of a guard.
Definition: scene.h:118
Base class for object delete scene notifications.
#define UFE_SDK_DECL
Definition: ufeExport.h:36
virtual void endNotificationGuard()
Notification guard interface. Implementation in this class is a no-op.