-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathGroupComment.h
More file actions
74 lines (52 loc) · 1.6 KB
/
GroupComment.h
File metadata and controls
74 lines (52 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#pragma once
#include "VisualNodeFactory.h"
namespace VisNodeSys
{
#define GROUP_COMMENT_CAPTION_MAX_LENGTH 1024
#define GROUP_COMMENT_TITLE_HEIGHT 30.0f
class VISUAL_NODE_SYSTEM_API GroupComment
{
protected:
friend class NodeSystem;
friend class NodeArea;
NodeArea* ParentArea = nullptr;
std::string ID;
ImVec2 Position;
ImVec2 Size;
bool bHovered = false;
bool bCaptionHovered = false;
bool bSelected = false;
virtual void Draw();
std::string Caption;
bool bIsRenamingActive = false;
bool bLastFrameRenameEditWasVisible = false;
bool bVerticalResizeActive = false;
bool bHorizontalResizeActive = false;
static char GroupCommentRename[GROUP_COMMENT_CAPTION_MAX_LENGTH];
float GetCaptionHeight(float Zoom) const;
ImVec2 GetCaptionSize(float Zoom) const;
// Temporary storage for moving.
std::vector<Node*> AttachedNodes;
std::vector<RerouteNode*> AttachedRerouteNodes;
std::vector<GroupComment*> AttachedGroupComments;
ImVec4 BackgroundColor = ImVec4(0.0f, 0.0f, 0.0f, 0.0f);
bool bMoveElementsWithComment = true;
public:
GroupComment(std::string ID = "");
GroupComment(const GroupComment& Other);
std::string GetID();
ImVec2 GetPosition() const;
void SetPosition(ImVec2 NewValue);
ImVec2 GetSize() const;
void SetSize(ImVec2 NewValue);
NodeArea* GetParentArea() const;
Json::Value ToJson();
void FromJson(Json::Value Json);
bool IsHovered() const;
bool IsSelected() const;
void SetCaption(std::string NewValue);
std::string GetCaption() const;
bool MoveElementsWithComment() const;
void SetMoveElementsWithComment(bool NewValue);
};
}