ufe 7.0
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.13-windows/ufe/include/baseUndoableCommands.h"
2#ifndef UFE_BASEUNDOABLECOMMANDS_H
3#define UFE_BASEUNDOABLECOMMANDS_H
4
5// ===========================================================================
6// Copyright 2025 Autodesk, Inc. All rights reserved.
7//
8// The use of this software is subject to the Autodesk Terms of Use or other
9// license agreement provided at the time of installation or download, or
10// which otherwise accompanies this software.
11// ===========================================================================
12
13#include "common/ufeExport.h"
14#include "undoableCommand.h"
15#include "hierarchy.h"
16#include "path.h"
17#include "types.h"
18
19#include <memory>
20
22{
24 //
25 // Set operation commands do not hold onto a SceneItem, because that item
26 // might be stale when undo or redo is executed. This is for two reasons:
27 // - redo and undo of commands later in the undo stack may make the item stale
28 // - operations between the point of creation of the set command and its
29 // execution may make the item stale.
30 //
32 {
33 public:
36
38 inline void setPath(const Path &path) { fPath = path; }
39
41 inline const Path &path() const { return fPath; }
42
45
46 private:
48 };
49
51 template <typename VALUE_TYPE>
53 {
54 public:
55 typedef std::shared_ptr<SetValueUndoableCommand> Ptr;
56 typedef VALUE_TYPE ValueType;
57
62
63 std::string commandString() const override { return "SetValue"; }
64
68
69 virtual bool set(VALUE_TYPE v) = 0;
70 };
71
73 template <typename VALUE_TYPE>
75 {
76 public:
77 typedef std::shared_ptr<SetValue2UndoableCommand> Ptr;
78 typedef VALUE_TYPE ValueType;
79
84
85 std::string commandString() const override { return "SetValue"; }
86
91
92 virtual bool set(VALUE_TYPE x, VALUE_TYPE y) = 0;
93 };
94
96 template <typename VALUE_TYPE>
98 {
99 public:
100 typedef std::shared_ptr<SetValue3UndoableCommand> Ptr;
101 typedef VALUE_TYPE ValueType;
102
107
108 std::string commandString() const override { return "SetValue"; }
109
115
116 virtual bool set(VALUE_TYPE x, VALUE_TYPE y, VALUE_TYPE z) = 0;
117 };
118
120 template <typename VALUE_TYPE>
122 {
123 public:
124 typedef std::shared_ptr<SetValue4UndoableCommand> Ptr;
125 typedef VALUE_TYPE ValueType;
126
131
132 std::string commandString() const override { return "SetValue"; }
133
140
141 virtual bool set(VALUE_TYPE x, VALUE_TYPE y, VALUE_TYPE z, VALUE_TYPE w) = 0;
142 };
143
156}
157
158#endif /* UFE_BASEUNDOABLECOMMANDS_H */
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:40
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:45
Abstract class for set Value2 command.
SetValue2UndoableCommand(const Path &path)
Constructor.
std::string commandString() const override
Get a user friendly string representation of the command.
~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::string commandString() const override
Get a user friendly string representation of the command.
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::string commandString() const override
Get a user friendly string representation of the command.
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
std::string commandString() const override
Get a user friendly string representation of the command.
~SetValueUndoableCommand() override
Destructor.
SetValueUndoableCommand(const Path &path)
Constructor.
Abstract base class for undoable commands.
std::string string(const Path &path)
Path path(const std::string &pathString)
#define UFE_NS_DEF
Definition: ufe.h:36
Definition of macros for symbol visibility.
#define UFE_SDK_DECL
Definition: ufeExport.h:35