ufe  3.2
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
sceneNotification.h
Go to the documentation of this file.
1 #line 1 "S:/jenkins/workspace/ECP/ufe/ufe-full-python3.9-windows/ufe/include/sceneNotification.h"
2 #ifndef _ufeSceneNotification
3 #define _ufeSceneNotification
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 "notification.h"
13 #include "sceneItem.h"
14 
15 #include <list>
16 
17 UFE_NS_DEF {
18 
20 
26 {
27 public:
29  SceneChanged();
30 
32  SceneChanged(const SceneChanged&) = default;
33 
35  ~SceneChanged() override;
36 
39  virtual Path changedPath() const;
40 };
41 
43 
48 {
49 public:
51  ObjectAdd(const SceneItem::Ptr& item);
52 
54  ObjectAdd(const ObjectAdd&) = default;
55 
57  ~ObjectAdd() override;
58 
60  SceneItem::Ptr item() const;
61 
63  Path changedPath() const override;
64 
65 private:
67 };
68 
70 
79 {
80 public:
82  ObjectDelete(const Path& path);
83 
85  ObjectDelete(const ObjectDelete&) = default;
86 
88  ~ObjectDelete() override;
89 
91  Path path() const;
92 
94  Path changedPath() const override;
95 
96 private:
97  const Path fPath;
98 };
99 
101 
107 {
108 public:
110  ObjectPostDelete(const SceneItem::Ptr& item);
111 
113  ObjectPostDelete(const ObjectPostDelete&) = default;
114 
116  ~ObjectPostDelete() override;
117 
119  SceneItem::Ptr item() const;
120 
121 private:
123 };
124 
126 
132 {
133 public:
135  ObjectPreDelete(const SceneItem::Ptr& item);
136 
138  ObjectPreDelete(const ObjectPreDelete&) = default;
139 
141  ~ObjectPreDelete() override;
142 
144  SceneItem::Ptr item() const;
145 
146 private:
148 };
149 
151 
157 {
158 public:
161 };
162 
164 
171 {
172 public:
175 
177  ObjectPathChange(const ObjectPathChange&) = default;
178 
180  ~ObjectPathChange() override;
181 };
182 
184 
191 {
192 public:
194  ObjectRename(const SceneItem::Ptr& item, const Path& previousPath);
195 
197  ObjectRename(const ObjectRename&) = default;
198 
200  ~ObjectRename() override;
201 
203  SceneItem::Ptr item() const;
204 
206  Path previousPath() const;
207 
209  Path changedPath() const override;
210 
211 private:
214 };
215 
217 
235 {
236 public:
238  ObjectReparent(const SceneItem::Ptr& item, const Path& previousPath);
239 
241  ObjectReparent(const ObjectReparent&) = default;
242 
244  ~ObjectReparent() override;
245 
247  SceneItem::Ptr item() const;
248 
250  Path previousPath() const;
251 
253  Path changedPath() const override;
254 
255 private:
258 };
259 
261 
271 {
272 public:
274  ObjectPathAdd(const SceneItem::Ptr& item);
275 
277  ObjectPathAdd(const ObjectPathAdd&) = default;
278 
280  ~ObjectPathAdd() override;
281 
283  SceneItem::Ptr item() const;
284 
286  Path changedPath() const override;
287 
288 private:
290 };
291 
293 
304 {
305 public:
307  ObjectPathRemove(const Path& removedPath);
308 
310  ObjectPathRemove(const ObjectPathRemove&) = default;
311 
313  ~ObjectPathRemove() override;
314 
316  Path removedPath() const;
317 
319  Path changedPath() const override;
320 
321 private:
323 };
324 
326 
339 {
340 public:
342  SubtreeInvalidate(const SceneItem::Ptr& item);
343 
345  SubtreeInvalidate(const SubtreeInvalidate&) = default;
346 
348  ~SubtreeInvalidate() override;
349 
351  SceneItem::Ptr root() const;
352 
354  Path changedPath() const override;
355 
356 private:
358 };
359 
360 
362 
370 {
371 public:
372  enum class OpType {
373  ObjectAdd,
374  ObjectDelete,
378  ObjectRename,
383  };
384 
385  struct Op {
386 
387  Op(OpType opTypeArg)
388  : opType(opTypeArg){}
389 
390  Op(OpType opTypeArg, const SceneItem::Ptr& itemArg)
391  : opType(opTypeArg), item(itemArg), path(itemArg->path()) {}
392 
393  Op(OpType opTypeArg, const Path& pathArg)
394  : opType(opTypeArg), path(pathArg){}
395 
396  Op(OpType opTypeArg, const SceneItem::Ptr& itemArg, const Path& pathArg)
397  : opType(opTypeArg), item(itemArg), path(pathArg){}
398 
402  };
403 
404  typedef std::list<Op> Ops;
405 
408 
411 
413  ~SceneCompositeNotification() override;
414 
417  Path changedPath() const override;
418 
420  void appendObjectAdd(const SceneItem::Ptr& item);
421 
423  void appendObjectDelete(const Path& path);
424 
426  void appendObjectPostDelete(const SceneItem::Ptr& item);
427 
429  void appendObjectPreDelete(const SceneItem::Ptr& item);
430 
432  void appendObjectDestroyed(const Path& path);
433 
435  void appendObjectRename(const SceneItem::Ptr& item, const Path& previousPath);
436 
438  void appendObjectReparent(const SceneItem::Ptr& item, const Path& previousPath);
439 
441  void appendObjectPathAdd(const SceneItem::Ptr& item);
442 
444  void appendObjectPathRemove(const Path& path);
445 
447  void appendSubtreeInvalidate(const SceneItem::Ptr& item);
448 
450  inline Ops opsList() const { return fOps; }
451 
453  std::size_t size() const;
454 
456  bool empty() const;
457 
459  Ops::const_iterator cbegin() const;
461  Ops::const_iterator begin() const;
462  Ops::const_iterator cend() const;
463  Ops::const_iterator end() const;
464  Ops::iterator begin();
465  Ops::iterator end();
467 
468 private:
470 };
471 
472 }
473 
474 #endif /* _ufeSceneNotification */
ObjectDelete(const Path &path)
Constructor.
Object renamed scene notification.
Base class for object add scene notifications.
const SceneItem::Ptr fItem
Path removed from object scene notification.
const SceneItem::Ptr fItem
Object delete scene notifications that occur before the object is deleted.
Path added to object scene notification.
Op(OpType opTypeArg, const Path &pathArg)
const SceneItem::Ptr fItem
Op(OpType opTypeArg, const SceneItem::Ptr &itemArg)
const SceneItem::Ptr fRoot
virtual Path changedPath() const
const SceneItem::Ptr fItem
const SceneItem::Ptr fItem
Base class for all scene notifications.
Identify an object or 3D path in the scene.
Definition: path.h:37
Object destroyed scene notification that occurs once an object is destroyed.
Base class for object path change scene notifications.
Subtree invalidate notification.
SceneChanged composite notification.
Object reparented scene notification.
#define UFE_NS_DEF
Definition: ufe.h:35
Base class for all notifications.
Definition: notification.h:27
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:40
const SceneItem::Ptr fItem
Object delete scene notifications that occur after the object was deleted.
Op(OpType opTypeArg, const SceneItem::Ptr &itemArg, const Path &pathArg)
Path path(const std::string &pathString)
Base class for object delete scene notifications.
#define UFE_SDK_DECL
Definition: ufeExport.h:36