ufe 5.5
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.11-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
21
31{
32public:
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
56
58 virtual SceneItem::Ptr sceneItem() const = 0;
59
61 virtual bool hasPosition() const = 0;
62
64 virtual bool hasSize() const = 0;
65
67 virtual bool hasDisplayColor() const = 0;
68
70 virtual Ufe::Vector2f getPosition() const = 0;
71
73 virtual Ufe::Vector2f getSize() const = 0;
74
76 virtual Ufe::Color3f getDisplayColor() const = 0;
77
79 virtual void setPosition(const Ufe::Vector2f& pos) {
80 auto cmd = setPositionCmd(pos);
81 if (cmd) {
82 cmd->execute();
83 }
84 }
85
86 inline void setPosition(float x, float y) {
87 setPosition(Vector2f(x, y));
88 }
89
91 virtual void setSize(const Ufe::Vector2f& size) {
92 auto cmd = setSizeCmd(size);
93 if (cmd) {
94 cmd->execute();
95 }
96 }
97
98 inline void setSize(float x, float y) {
99 setSize(Vector2f(x, y));
100 }
101
103 virtual void setDisplayColor(const Ufe::Color3f& color) {
104 auto cmd = setDisplayColorCmd(color);
105 if (cmd)
106 cmd->execute();
107 }
108
109 inline void setDisplayColor(float r, float g, float b) {
110 setDisplayColor(Color3f(r, g, b));
111 }
112
116
120
124};
125
126}
127
128#endif /* _ufe_uiNodeGraphNode */
std::shared_ptr< SceneItem > Ptr
Definition: sceneItem.h:44
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
No copy or move constructor/assignment.
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:191
TypedVectorN< float, 2 > Vector2f
Definition: types.h:118
Typed vector template for creating a specialized vector with N elements.
Definition: types.h:40
#define UFE_NS_DEF
Definition: ufe.h:35
Definition of macros for symbol visibility.
#define UFE_SDK_DECL
Definition: ufeExport.h:36