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
uiNodeGraphNode.h
Go to the documentation of this file.
1 #line 1 "S:/jenkins/workspace/ECP/ufe/ufe-full-python3.10-windows/ufe/include/uiNodeGraphNode.h"
2 #ifndef _ufe_uiNodeGraphNode
3 #define _ufe_uiNodeGraphNode
4 
5 // =======================================================================
6 // Copyright 2022 Autodesk, Inc. All rights reserved.
7 //
8 // This computer source code and related instructions and comments are the
9 // unpublished confidential and proprietary information of Autodesk, Inc.
10 // and are protected under applicable copyright and trade secret law. They
11 // may not be disclosed to, copied or used by any third party without the
12 // prior written consent of Autodesk, Inc.
13 // =======================================================================
14 
15 #include "common/ufeExport.h"
16 #include "sceneItem.h"
17 #include "types.h"
18 #include "undoableCommand.h"
19 
20 UFE_NS_DEF {
21 
31 {
32 public:
33  typedef std::shared_ptr<UINodeGraphNode> Ptr;
34 
41  static Ptr uiNodeGraphNode(const SceneItem::Ptr& item);
42 
44  UINodeGraphNode() = default;
45 
46  // Destructor.
47  virtual ~UINodeGraphNode() = default;
48 
50  UINodeGraphNode(const UINodeGraphNode&) = delete;
52  UINodeGraphNode& operator=(const UINodeGraphNode&) = delete;
53  UINodeGraphNode(UINodeGraphNode&&) = delete;
54  UINodeGraphNode& operator=(UINodeGraphNode&&) = delete;
56 
58  virtual SceneItem::Ptr sceneItem() const = 0;
59 
61  virtual bool hasPosition() const = 0;
62 
64  virtual Ufe::Vector2f getPosition() const = 0;
65 
67  virtual void setPosition(const Ufe::Vector2f& pos) {
68  auto cmd = setPositionCmd(pos);
69  if (cmd) {
70  cmd->execute();
71  }
72  }
73 
74  inline void setPosition(float x, float y) {
75  setPosition(Vector2f(x, y));
76  }
77 
78  virtual UndoableCommand::Ptr setPositionCmd(const Ufe::Vector2f& pos) = 0;
79 };
80 
82 {
83 public:
84  typedef std::shared_ptr<UINodeGraphNode_v4_1> Ptr;
85 
92  static Ptr uiNodeGraphNode(const SceneItem::Ptr& item);
93 
95  UINodeGraphNode_v4_1() = default;
96 
97  // Destructor.
98  ~UINodeGraphNode_v4_1() override = default;
99 
107 
109  virtual bool hasSize() const = 0;
110 
112  virtual Ufe::Vector2f getSize() const = 0;
113 
115  virtual void setSize(const Ufe::Vector2f& size) {
116  auto cmd = setSizeCmd(size);
117  if (cmd) {
118  cmd->execute();
119  }
120  }
121 
122  inline void setSize(float x, float y) {
123  setSize(Vector2f(x, y));
124  }
125 
126  virtual UndoableCommand::Ptr setSizeCmd(const Ufe::Vector2f& size) = 0;
127 };
128 
129 }
130 
131 #endif /* _ufe_uiNodeGraphNode */
std::shared_ptr< UINodeGraphNode > Ptr
std::shared_ptr< UndoableCommand > Ptr
virtual void setSize(const Ufe::Vector2f &size)
Set the UINodeGraphNode&#39;s size.
Definition of macros for symbol visibility.
Typed vector template for creating a specialized vector with N elements.
Definition: types.h:24
virtual void setPosition(const Ufe::Vector2f &pos)
Set the UINodeGraphNode&#39;s position.
void setPosition(float x, float y)
#define UFE_NS_DEF
Definition: ufe.h:35
void setSize(float x, float y)
std::shared_ptr< UINodeGraphNode_v4_1 > Ptr
TypedVectorN< float, 2 > Vector2f
Definition: types.h:100
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:40
UINodeGraphNode & operator=(const UINodeGraphNode &)=delete
No copy or move constructor/assignment.
Abstract base class for UINodeGraphNode interface.
static Ptr uiNodeGraphNode(const SceneItem::Ptr &item)
#define UFE_SDK_DECL
Definition: ufeExport.h:36