ufe 5.5
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.11-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
19
21
26{
27public:
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
55protected:
58private:
60};
61
63
68{
69public:
72
74 ObjectAdd(const ObjectAdd&) = default;
75
77 ~ObjectAdd() override;
78
81
83 Path changedPath() const override;
84
85private:
87};
88
90
99{
100public:
102 None = SubOpTypeNone,
106 };
107
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
126protected:
128 ObjectDelete(const Path& path, SubOpType objectDeleteOpType);
129
130private:
131 const Path fPath;
133};
134
136
142{
143public:
146
149
152
155
156private:
158};
159
161
167{
168public:
171
174
177
180
181private:
183};
184
186
192{
193public:
196
199
202};
203
205
212{
213public:
215 None = SubOpTypeNone,
220 };
221
224
227
230
232 SubOpStorageType subOpType() const override;
233
234protected:
236 ObjectPathChange(SubOpType objectPathChangeOpType);
238};
239
241
248{
249public:
251 ObjectRename(const SceneItem::Ptr& item, const Path& previousPath);
252
254 ObjectRename(const ObjectRename&) = default;
255
257 ~ObjectRename() override;
258
261
264
266 Path changedPath() const override;
267
268private:
271};
272
274
292{
293public:
295 ObjectReparent(const SceneItem::Ptr& item, const Path& previousPath);
296
299
301 ~ObjectReparent() override;
302
305
308
310 Path changedPath() const override;
311
312private:
315};
316
318
328{
329public:
332
334 ObjectPathAdd(const ObjectPathAdd&) = default;
335
337 ~ObjectPathAdd() override;
338
341
343 Path changedPath() const override;
344
345private:
347};
348
350
361{
362public:
364 ObjectPathRemove(const Path& removedPath);
365
368
371
374
376 Path changedPath() const override;
377
378private:
380};
381
383
396{
397public:
400
403
406
409
411 Path changedPath() const override;
412
413private:
415};
416
417
419
427{
428public:
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
454 };
455
456 typedef std::list<Op> Ops;
457
460
463
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
486 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
494private:
496};
497
498}
499
500#endif /* _ufeSceneNotification */
Base class for all notifications.
Definition: notification.h:29
Base class for object add scene notifications.
const SceneItem::Ptr fItem
ObjectAdd(const SceneItem::Ptr &item)
Constructor.
SceneItem::Ptr item() const
ObjectAdd(const ObjectAdd &)=default
Default copy constructor.
Path changedPath() const override
~ObjectAdd() override
Destructor.
Base class for object delete scene notifications.
ObjectDelete(const Path &path)
Constructor.
Path changedPath() const override
Path path() const
ObjectDelete(const Path &path, SubOpType objectDeleteOpType)
Constructor.
const SubOpType fSubOpType
SubOpStorageType subOpType() const override
~ObjectDelete() override
Destructor.
ObjectDelete(const ObjectDelete &)=default
Default copy constructor.
Object destroyed scene notification that occurs once an object is destroyed.
ObjectDestroyed(const Path &path)
Constructor.
~ObjectDestroyed() override
Destructor.
ObjectDestroyed(const ObjectDestroyed &)=default
Default copy constructor.
Path added to object scene notification.
Path changedPath() const override
const SceneItem::Ptr fItem
ObjectPathAdd(const SceneItem::Ptr &item)
Constructor.
~ObjectPathAdd() override
Destructor.
ObjectPathAdd(const ObjectPathAdd &)=default
Default copy constructor.
SceneItem::Ptr item() const
Base class for object path change scene notifications.
ObjectPathChange(SubOpType objectPathChangeOpType)
Constructor.
SubOpStorageType subOpType() const override
~ObjectPathChange() override
Destructor.
ObjectPathChange()
Constructor.
ObjectPathChange(const ObjectPathChange &)=default
Default copy constructor.
const SubOpType fSubOpType
Path removed from object scene notification.
Path changedPath() const override
ObjectPathRemove(const ObjectPathRemove &)=default
Default copy constructor.
Path removedPath() const
ObjectPathRemove(const Path &removedPath)
Constructor.
~ObjectPathRemove() override
Destructor.
Object delete scene notifications that occur after the object was deleted.
SceneItem::Ptr item() const
~ObjectPostDelete() override
Destructor.
const SceneItem::Ptr fItem
ObjectPostDelete(const SceneItem::Ptr &item)
Constructor.
ObjectPostDelete(const ObjectPostDelete &)=default
Default copy constructor.
Object delete scene notifications that occur before the object is deleted.
ObjectPreDelete(const ObjectPreDelete &)=default
Default copy constructor.
ObjectPreDelete(const SceneItem::Ptr &item)
Constructor.
const SceneItem::Ptr fItem
SceneItem::Ptr item() const
~ObjectPreDelete() override
Destructor.
Object renamed scene notification.
const SceneItem::Ptr fItem
SceneItem::Ptr item() const
ObjectRename(const SceneItem::Ptr &item, const Path &previousPath)
Constructor.
Path changedPath() const override
ObjectRename(const ObjectRename &)=default
Default copy constructor.
~ObjectRename() override
Destructor.
Path previousPath() const
Object reparented scene notification.
SceneItem::Ptr item() const
ObjectReparent(const SceneItem::Ptr &item, const Path &previousPath)
Constructor.
~ObjectReparent() override
Destructor.
ObjectReparent(const ObjectReparent &)=default
Default copy constructor.
const SceneItem::Ptr fItem
Path previousPath() const
Path changedPath() const override
Identify an object or 3D path in the scene.
Definition: path.h:38
Base class for all scene notifications.
OpType opType() const
const OpType fOpType
~SceneChanged() override
Destructor.
SceneChanged(OpType opType)
Constructor.
virtual SubOpStorageType subOpType() const
virtual Path changedPath() const
SceneChanged(const SceneChanged &)=default
Default copy constructor.
unsigned char SubOpStorageType
SceneChanged composite notification.
Ops::const_iterator begin() const
void appendSceneChanged(const SceneChanged &sceneChanged)
Ops::const_iterator cbegin() const
Iteration interface on operations.
Ops::const_iterator end() const
SceneCompositeNotification()
Constructor.
Ops::const_iterator cend() const
SceneCompositeNotification(const SceneCompositeNotification &)=default
Default copy constructor.
~SceneCompositeNotification() override
Destructor.
Path changedPath() const override
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:44
Subtree invalidate notification.
SubtreeInvalidate(const SceneItem::Ptr &item)
Constructor.
SubtreeInvalidate(const SubtreeInvalidate &)=default
Default copy constructor.
const SceneItem::Ptr fRoot
Path changedPath() const override
~SubtreeInvalidate() override
Destructor.
SceneItem::Ptr root() const
Path path(const std::string &pathString)
Op(const SceneChanged &sceneChanged)
Op(OpType opTypeArg, const Path &pathArg)
Op(OpType opTypeArg, const SceneItem::Ptr &itemArg)
Op(OpType opTypeArg, SubOpStorageType subOpTypeArg)
Op(OpType opTypeArg, SubOpStorageType subOpTypeArg, const SceneItem::Ptr &itemArg)
Op(OpType opTypeArg, SubOpStorageType subOpTypeArg, const SceneItem::Ptr &itemArg, const Path &pathArg)
Op(OpType opTypeArg, SubOpStorageType subOpTypeArg, const Path &pathArg)
#define UFE_NS_DEF
Definition: ufe.h:35
#define UFE_SDK_DECL
Definition: ufeExport.h:36