ufe 6.2
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
baseUndoableCommands.h
Go to the documentation of this file.
1#line 1 "D:/Jenkins/workspace/EMS/ECG/ufe/full/ufe-full-python3.11-windows/ufe/include/baseUndoableCommands.h"
2#ifndef _baseUndoableCommands
3#define _baseUndoableCommands
4// ===========================================================================
5// Copyright 2020 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#include "undoableCommand.h"
14#include "hierarchy.h"
15#include "path.h"
16#include "types.h"
17
18#include <memory>
19
21{
23 //
24 // Set operation commands do not hold onto a SceneItem, because that item
25 // might be stale when undo or redo is executed. This is for two reasons:
26 // - redo and undo of commands later in the undo stack may make the item stale
27 // - operations between the point of creation of the set command and its
28 // execution may make the item stale.
29 //
31 {
32 public:
35
37 inline void setPath(const Path &path) { fPath = path; }
38
40 inline const Path &path() const { return fPath; }
41
44
45 private:
47 };
48
50 template <typename VALUE_TYPE>
52 {
53 public:
54 typedef std::shared_ptr<SetValueUndoableCommand> Ptr;
55 typedef VALUE_TYPE ValueType;
56
61
65
66 virtual bool set(VALUE_TYPE v) = 0;
67 };
68
70 template <typename VALUE_TYPE>
72 {
73 public:
74 typedef std::shared_ptr<SetValue2UndoableCommand> Ptr;
75 typedef VALUE_TYPE ValueType;
76
81
86
87 virtual bool set(VALUE_TYPE x, VALUE_TYPE y) = 0;
88 };
89
91 template <typename VALUE_TYPE>
93 {
94 public:
95 typedef std::shared_ptr<SetValue3UndoableCommand> Ptr;
96 typedef VALUE_TYPE ValueType;
97
102
108
109 virtual bool set(VALUE_TYPE x, VALUE_TYPE y, VALUE_TYPE z) = 0;
110 };
111
113 template <typename VALUE_TYPE>
115 {
116 public:
117 typedef std::shared_ptr<SetValue4UndoableCommand> Ptr;
118 typedef VALUE_TYPE ValueType;
119
124
131
132 virtual bool set(VALUE_TYPE x, VALUE_TYPE y, VALUE_TYPE z, VALUE_TYPE w) = 0;
133 };
134
147}
148
149#endif /* _baseUndoableCommands */
Base class for undoable set operation commands.
void setPath(const Path &path)
Set the path of the object onto which the command is applied.
Ufe::SceneItem::Ptr sceneItem() const
const Path & path() const
BaseUndoableCommand(const Path &path)
~BaseUndoableCommand() override
static SceneItem::Ptr createItem(const Path &path)
Identify an object or 3D path in the scene.
Definition: path.h:38
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:44
Abstract class for set Value2 command.
SetValue2UndoableCommand(const Path &path)
Constructor.
~SetValue2UndoableCommand() override
Destructor.
std::shared_ptr< SetValue2UndoableCommand > Ptr
virtual bool set(VALUE_TYPE x, VALUE_TYPE y)=0
Abstract class for set Value3 command.
SetValue3UndoableCommand(const Path &path)
Constructor.
~SetValue3UndoableCommand() override
Destructor.
virtual bool set(VALUE_TYPE x, VALUE_TYPE y, VALUE_TYPE z)=0
std::shared_ptr< SetValue3UndoableCommand > Ptr
Abstract class for set Value4 command.
SetValue4UndoableCommand(const Path &path)
Constructor.
virtual bool set(VALUE_TYPE x, VALUE_TYPE y, VALUE_TYPE z, VALUE_TYPE w)=0
std::shared_ptr< SetValue4UndoableCommand > Ptr
~SetValue4UndoableCommand() override
Destructor.
Abstract class for set value command.
virtual bool set(VALUE_TYPE v)=0
std::shared_ptr< SetValueUndoableCommand > Ptr
~SetValueUndoableCommand() override
Destructor.
SetValueUndoableCommand(const Path &path)
Constructor.
Abstract base class for undoable commands.
Path path(const std::string &pathString)
#define UFE_NS_DEF
Definition: ufe.h:35
Definition of macros for symbol visibility.
#define UFE_SDK_DECL
Definition: ufeExport.h:36