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
uiNodeGraphNode.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/uiNodeGraphNode.h"
2#ifndef UFE_UINODEGRAPHNODE_H
3#define UFE_UINODEGRAPHNODE_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 "sceneItem.h"
15#include "types.h"
16#include "undoableCommand.h"
17
19
29{
30public:
31 typedef std::shared_ptr<UINodeGraphNode> Ptr;
32
39 static Ptr uiNodeGraphNode(const SceneItem::Ptr& item);
40
42 UINodeGraphNode() = default;
43
44 // Destructor.
45 virtual ~UINodeGraphNode() = default;
46
54
56 virtual SceneItem::Ptr sceneItem() const = 0;
57
59 virtual bool hasPosition() const = 0;
60
62 virtual bool hasSize() const = 0;
63
65 virtual bool hasDisplayColor() const = 0;
66
68 virtual Ufe::Vector2f getPosition() const = 0;
69
71 virtual Ufe::Vector2f getSize() const = 0;
72
74 virtual Ufe::Color3f getDisplayColor() const = 0;
75
77 virtual void setPosition(const Ufe::Vector2f& pos) {
78 auto cmd = setPositionCmd(pos);
79 if (cmd) {
80 cmd->execute();
81 }
82 }
83
84 inline void setPosition(float x, float y) {
85 setPosition(Vector2f(x, y));
86 }
87
89 virtual void setSize(const Ufe::Vector2f& size) {
90 auto cmd = setSizeCmd(size);
91 if (cmd) {
92 cmd->execute();
93 }
94 }
95
96 inline void setSize(float x, float y) {
97 setSize(Vector2f(x, y));
98 }
99
101 virtual void setDisplayColor(const Ufe::Color3f& color) {
102 auto cmd = setDisplayColorCmd(color);
103 if (cmd)
104 cmd->execute();
105 }
106
107 inline void setDisplayColor(float r, float g, float b) {
108 setDisplayColor(Color3f(r, g, b));
109 }
110
114
118
122};
123
124}
125
126#endif /* UFE_UINODEGRAPHNODE_H */
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:45
Abstract base class for UINodeGraphNode interface.
virtual void setPosition(const Ufe::Vector2f &pos)
Set the UINodeGraphNode's position.
virtual Ufe::Vector2f getSize() const =0
virtual void setSize(const Ufe::Vector2f &size)
Set the UINodeGraphNode's size.
virtual SceneItem::Ptr sceneItem() const =0
UINodeGraphNode(const UINodeGraphNode &)=delete
std::shared_ptr< UINodeGraphNode > Ptr
virtual ~UINodeGraphNode()=default
UINodeGraphNode(UINodeGraphNode &&)=delete
void setPosition(float x, float y)
static Ptr uiNodeGraphNode(const SceneItem::Ptr &item)
void setDisplayColor(float r, float g, float b)
virtual UndoableCommand::Ptr setDisplayColorCmd(const Ufe::Color3f &color)=0
virtual UndoableCommand::Ptr setPositionCmd(const Ufe::Vector2f &pos)=0
virtual bool hasDisplayColor() const =0
virtual bool hasPosition() const =0
UINodeGraphNode()=default
Constructor.
virtual Ufe::Color3f getDisplayColor() const =0
virtual Ufe::Vector2f getPosition() const =0
UINodeGraphNode & operator=(UINodeGraphNode &&)=delete
virtual void setDisplayColor(const Ufe::Color3f &color)
Set the UINodeGraphNode's display color.
void setSize(float x, float y)
virtual UndoableCommand::Ptr setSizeCmd(const Ufe::Vector2f &size)=0
virtual bool hasSize() const =0
UINodeGraphNode & operator=(const UINodeGraphNode &)=delete
std::shared_ptr< UndoableCommand > Ptr
TypedColorN< float, 3 > Color3f
Definition: types.h:235
TypedVectorN< float, 2 > Vector2f
Definition: types.h:142
Typed vector template for creating a specialized vector with N elements.
Definition: types.h:44
#define UFE_NS_DEF
Definition: ufe.h:36
Definition of macros for symbol visibility.
#define UFE_SDK_DECL
Definition: ufeExport.h:35