3#include "./../../third_party/imgui/imgui.h"
4#include "../../system/system_utils.h"
60 const std::vector<ComponentNode>& nodes =
document->GetAllNodes();
61 for (
size_t i = 0;
i < nodes.size(); ++
i)
133 if (
drawList ==
nullptr) {
return; }
153 (color.
x * 1.3f > 1.0f) ? 1.0f : color.
x * 1.3f,
154 (color.
y * 1.3f > 1.0f) ? 1.0f : color.
y * 1.3f,
155 (color.
z * 1.3f > 1.0f) ? 1.0f : color.
z * 1.3f,
190 (color.
x * 0.8f > 1.0f) ? 1.0f : color.
x * 0.8f,
191 (color.
y * 0.8f > 1.0f) ? 1.0f : color.
y * 0.8f,
192 (color.
z * 0.8f > 1.0f) ? 1.0f : color.
z * 0.8f,
207 if (
drawList ==
nullptr) {
return; }
225 const char* label =
node.componentType.c_str();
234 std::string
propText =
" " +
it->first +
": " +
it->second;
238 if (
node.properties.size() > 3)
249 if (
drawList ==
nullptr) {
return; }
299 return node.GetCurrentColor();
304 const std::vector<NodePort>& ports =
node.GetPorts();
305 for (
const auto&
port : ports)
314 if (
drawList ==
nullptr) {
return; }
325 for (
const auto&
p :
node.GetPorts())
390 const std::vector<NodePort>& ports =
node.GetPorts();
392 for (
const auto&
port : ports)
401 for (
const auto&
p :
node.GetPorts())
507 float t =
static_cast<float>(
i) /
static_cast<float>(
numSamples);
ComponentTypeID GetComponentTypeID_Static()
void SetTextColor(const Vector &color)
float GetDistanceToConnection(const Vector &testPoint, const Vector &connectionStart, const Vector &connectionEnd, Vector *outClosestPoint=nullptr) const
const ComponentNodeStyle & GetNodeStyle() const
void RenderConnectionLine(const Vector &from, const Vector &to, bool isHovered=false)
void SetBorderWidth(float width)
void SetNodeStyle(const ComponentNodeStyle &style)
void SetCanvasScreenPos(const ImVec2 &screenPos)
Vector GetCanvasOffset() const
void RenderNodeLabel(const ComponentNode &node)
void RenderNodePorts(const ComponentNode &node)
void SetNormalColor(const Vector &color)
ImVec2 GetCanvasScreenPos() const
Vector CanvasToScreen(const Vector &canvasPos) const
ComponentNodeStyle m_style
void SetShowLabels(bool show)
bool GetNodeBounds(const ComponentNode &node, Vector &outMin, Vector &outMax) const
float GetCanvasZoom() const
void RenderConnections(const EntityPrefabGraphDocument *document, int hoveredConnectionIndex=-1)
bool IsPointInNode(const Vector &point, const ComponentNode &node) const
void SetCanvasTransform(const Vector &offset, float zoom)
bool GetShowProperties() const
void RenderPort(const ComponentNode &node, const NodePort &port)
float GetNodeScale() const
void SetCornerRadius(float radius)
bool GetShowLabels() const
void SetDisabledColor(const Vector &color)
void UpdatePortPositions(ComponentNode &node) const
Vector GetNodeColor(const ComponentNode &node) const
void RenderNodes(const EntityPrefabGraphDocument *document)
void RenderNode(const ComponentNode &node)
void RenderNodeBox(const ComponentNode &node)
void SetShowProperties(bool show)
void SetNodeScale(float scale)
bool IsPointInPort(const Vector &point, const ComponentNode &node, PortId &outPortId) const
void SetSelectedColor(const Vector &color)
void SetHoverColor(const Vector &color)
< Provides AssetID and INVALID_ASSET_ID
@ Vector
3-component vector (Vector from vector.h)
const PortId InvalidPortId