6#include "./../../vector.h"
7#include "./../../third_party/nlohmann/json.hpp"
36 j[
"portId"] =
static_cast<int>(
portId);
49 port.portIndex = data.value(
"portIndex", 0);
50 port.radius = data.value(
"radius", 4.0f);
51 port.isOutput = data.value(
"isOutput",
false);
52 if (data.contains(
"position"))
54 port.position.x = data[
"position"].value(
"x", 0.0f);
55 port.position.y = data[
"position"].value(
"y", 0.0f);
56 port.position.z = data[
"position"].value(
"z", 0.0f);
109 void SetProperty(
const std::string&
key,
const std::string& value);
117 const std::vector<NodePort>&
GetPorts()
const;
ComponentTypeID GetComponentTypeID_Static()
< Provides AssetID and INVALID_ASSET_ID
@ Vector
3-component vector (Vector from vector.h)
const PortId InvalidPortId
const NodeId InvalidNodeId
bool HasProperty(const std::string &key) const
std::string GetProperty(const std::string &key) const
std::map< std::string, std::string > properties
std::vector< NodePort > ports
Vector GetCurrentColor() const
const std::vector< NodePort > & GetPorts() const
std::string componentType
bool operator!=(const ComponentNode &other) const
NodePort * FindPort(PortId portId)
static ComponentNode FromJson(const json &data)
void SetProperty(const std::string &key, const std::string &value)
std::string componentName
void InitializePorts(uint32_t numInputPorts=1, uint32_t numOutputPorts=1)
bool operator==(const ComponentNode &other) const
std::string ToDisplayString() const
NodePort(NodeId nodeId, uint32_t index, bool isOutput=false)
static NodePort FromJson(const json &data, NodeId nodeId)