ufe  4.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.10-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 #include <bitset>
17 
18 UFE_NS_DEF {
19 
21 
26 {
27 public:
28  enum OpType : unsigned char {
34  };
35 
36  using SubOpStorageType = unsigned char;
37  constexpr static SubOpStorageType SubOpTypeNone = 0;
38 
40  SceneChanged(const SceneChanged&) = default;
41 
43  ~SceneChanged() override;
44 
47  virtual Path changedPath() const;
48 
50  OpType opType() const;
51 
53  virtual SubOpStorageType subOpType() const;
54 
55 protected:
57  SceneChanged(OpType opType);
58 private:
59  const OpType fOpType;
60 };
61 
63 
68 {
69 public:
71  ObjectAdd(const SceneItem::Ptr& item);
72 
74  ObjectAdd(const ObjectAdd&) = default;
75 
77  ~ObjectAdd() override;
78 
80  SceneItem::Ptr item() const;
81 
83  Path changedPath() const override;
84 
85 private:
87 };
88 
90 
99 {
100 public:
106  };
107 
109  ObjectDelete(const Path& path);
110 
112  ObjectDelete(const ObjectDelete&) = default;
113 
115  ~ObjectDelete() override;
116 
118  Path path() const;
119 
121  Path changedPath() const override;
122 
124  SubOpStorageType subOpType() const override;
125 
126 protected:
128  ObjectDelete(const Path& path, SubOpType objectDeleteOpType);
129 
130 private:
131  const Path fPath;
133 };
134 
136 
142 {
143 public:
145  ObjectPostDelete(const SceneItem::Ptr& item);
146 
148  ObjectPostDelete(const ObjectPostDelete&) = default;
149 
151  ~ObjectPostDelete() override;
152 
154  SceneItem::Ptr item() const;
155 
156 private:
158 };
159 
161 
167 {
168 public:
170  ObjectPreDelete(const SceneItem::Ptr& item);
171 
173  ObjectPreDelete(const ObjectPreDelete&) = default;
174 
176  ~ObjectPreDelete() override;
177 
179  SceneItem::Ptr item() const;
180 
181 private:
183 };
184 
186 
192 {
193 public:
195  ObjectDestroyed(const Path& path);
196 
198  ObjectDestroyed(const ObjectDestroyed&) = default;
199 
201  ~ObjectDestroyed() override;
202 };
203 
205 
212 {
213 public:
220  };
221 
224 
226  ObjectPathChange(const ObjectPathChange&) = default;
227 
229  ~ObjectPathChange() override;
230 
232  SubOpStorageType subOpType() const override;
233 
234 protected:
236  ObjectPathChange(SubOpType objectPathChangeOpType);
238 };
239 
241 
248 {
249 public:
251  ObjectRename(const SceneItem::Ptr& item, const Path& previousPath);
252 
254  ObjectRename(const ObjectRename&) = default;
255 
257  ~ObjectRename() override;
258 
260  SceneItem::Ptr item() const;
261 
263  Path previousPath() const;
264 
266  Path changedPath() const override;
267 
268 private:
271 };
272 
274 
292 {
293 public:
295  ObjectReparent(const SceneItem::Ptr& item, const Path& previousPath);
296 
298  ObjectReparent(const ObjectReparent&) = default;
299 
301  ~ObjectReparent() override;
302 
304  SceneItem::Ptr item() const;
305 
307  Path previousPath() const;
308 
310  Path changedPath() const override;
311 
312 private:
315 };
316 
318 
328 {
329 public:
331  ObjectPathAdd(const SceneItem::Ptr& item);
332 
334  ObjectPathAdd(const ObjectPathAdd&) = default;
335 
337  ~ObjectPathAdd() override;
338 
340  SceneItem::Ptr item() const;
341 
343  Path changedPath() const override;
344 
345 private:
347 };
348 
350 
361 {
362 public:
364  ObjectPathRemove(const Path& removedPath);
365 
367  ObjectPathRemove(const ObjectPathRemove&) = default;
368 
370  ~ObjectPathRemove() override;
371 
373  Path removedPath() const;
374 
376  Path changedPath() const override;
377 
378 private:
380 };
381 
383 
396 {
397 public:
399  SubtreeInvalidate(const SceneItem::Ptr& item);
400 
402  SubtreeInvalidate(const SubtreeInvalidate&) = default;
403 
405  ~SubtreeInvalidate() override;
406 
408  SceneItem::Ptr root() const;
409 
411  Path changedPath() const override;
412 
413 private:
415 };
416 
417 
419 
427 {
428 public:
429  struct UFE_SDK_DECL Op {
430  Op(OpType opTypeArg, SubOpStorageType subOpTypeArg)
431  : opType(opTypeArg), subOpType(subOpTypeArg){}
432 
433  Op(OpType opTypeArg, const SceneItem::Ptr& itemArg)
434  : opType(opTypeArg), item(itemArg), path(itemArg->path()) {}
435 
436  Op(OpType opTypeArg, SubOpStorageType subOpTypeArg, const SceneItem::Ptr& itemArg)
437  : opType(opTypeArg), subOpType(subOpTypeArg), item(itemArg), path(itemArg->path()) {}
438 
439  Op(OpType opTypeArg, const Path& pathArg)
440  : opType(opTypeArg), path(pathArg){}
441 
442  Op(OpType opTypeArg, SubOpStorageType subOpTypeArg, const Path& pathArg)
443  : opType(opTypeArg), subOpType(subOpTypeArg), path(pathArg){}
444 
445  Op(OpType opTypeArg, SubOpStorageType subOpTypeArg, const SceneItem::Ptr& itemArg, const Path& pathArg)
446  : opType(opTypeArg), subOpType(subOpTypeArg), item(itemArg), path(pathArg){}
447 
448  Op(const SceneChanged& sceneChanged);
449 
450  OpType opType;
454  };
455 
456  typedef std::list<Op> Ops;
457 
460 
463 
465  ~SceneCompositeNotification() override;
466 
469  Path changedPath() const override;
470 
471  void appendSceneChanged(const SceneChanged& sceneChanged);
472 
473  void appendOp(const Op& op);
474 
476  inline Ops opsList() const { return fOps; }
477 
479  std::size_t size() const;
480 
482  bool empty() const;
483 
485  Ops::const_iterator cbegin() const;
487  Ops::const_iterator begin() const;
488  Ops::const_iterator cend() const;
489  Ops::const_iterator end() const;
490  Ops::iterator begin();
491  Ops::iterator end();
493 
494 private:
496 };
497 
498 }
499 
500 #endif /* _ufeSceneNotification */
Op(OpType opTypeArg, SubOpStorageType subOpTypeArg, const SceneItem::Ptr &itemArg, const Path &pathArg)
Object renamed scene notification.
Base class for object add scene notifications.
const SubOpType fSubOpType
const SceneItem::Ptr fItem
const OpType fOpType
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
Op(OpType opTypeArg, SubOpStorageType subOpTypeArg, const SceneItem::Ptr &itemArg)
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.
unsigned char SubOpStorageType
Base class for object path change scene notifications.
Op(OpType opTypeArg, SubOpStorageType subOpTypeArg)
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:28
const SubOpType fSubOpType
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:40
Op(OpType opTypeArg, SubOpStorageType subOpTypeArg, const Path &pathArg)
const SceneItem::Ptr fItem
Object delete scene notifications that occur after the object was deleted.
Path path(const std::string &pathString)
Base class for object delete scene notifications.
static constexpr SubOpStorageType SubOpTypeNone
virtual SubOpStorageType subOpType() const
#define UFE_SDK_DECL
Definition: ufeExport.h:36