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
baseUndoableCommands.h
Go to the documentation of this file.
1 #line 1 "S:/jenkins/workspace/ECP/ufe/ufe-full-python3.9-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 {
22 
23  struct Matrix4d;
24 
26  //
27  // Set operation commands do not hold onto a SceneItem, because that item
28  // might be stale when undo or redo is executed. This is for two reasons:
29  // - redo and undo of commands later in the undo stack may make the item stale
30  // - operations between the point of creation of the set command and its
31  // execution may make the item stale.
32  //
34  {
35  public:
37  virtual ~BaseUndoableCommand();
38 
40  inline void setPath(const Path &path) { fPath = path; }
41 
43  inline const Path &path() const { return fPath; }
44 
47 
48  private:
50  };
51 
53  template <typename VALUE_TYPE>
55  {
56  public:
57  typedef std::shared_ptr<SetValueUndoableCommand> Ptr;
58  typedef VALUE_TYPE ValueType;
59 
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<SetValue3UndoableCommand> Ptr;
78  typedef VALUE_TYPE ValueType;
79 
84 
90 
91  virtual bool set(VALUE_TYPE x, VALUE_TYPE y, VALUE_TYPE z) = 0;
92  };
93 
102 }
103 
104 #endif /* _baseUndoableCommands */
std::shared_ptr< SetValue3UndoableCommand > Ptr
Abstract class for set Value3 command.
Definition of macros for symbol visibility.
SetValueUndoableCommand(const Path &path)
Constructor.
static SceneItem::Ptr createItem(const Path &path)
std::shared_ptr< SetValueUndoableCommand > Ptr
Identify an object or 3D path in the scene.
Definition: path.h:37
Ufe::SceneItem::Ptr sceneItem() const
Abstract class for set value command.
const Path & path() const
virtual ~SetValue3UndoableCommand()
Destructor.
#define UFE_NS_DEF
Definition: ufe.h:35
Abstract base class for undoable commands.
SetValue3UndoableCommand(const Path &path)
Constructor.
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:40
void setPath(const Path &path)
Set the path of the object onto which the command is applied.
Path path(const std::string &pathString)
#define UFE_SDK_DECL
Definition: ufeExport.h:36
virtual ~SetValueUndoableCommand()
Destructor.
Base class for undoable set operation commands.