31 return !(*
this ==
other);
43 result +=
" [Disabled]";
51 j[
"nodeId"] =
static_cast<int>(
nodeId);
61 j[
"properties"] = json::object();
64 j[
"properties"][
it->first] =
it->second;
67 j[
"ports"] = json::array();
70 j[
"ports"].push_back(
port.ToJson());
80 if (data.contains(
"nodeId"))
85 node.componentType = data.value(
"componentType",
"");
86 node.componentName = data.value(
"componentName",
"");
87 node.selected = data.value(
"selected",
false);
88 node.enabled = data.value(
"enabled",
true);
90 if (data.contains(
"position"))
92 node.position.x = data[
"position"].value(
"x", 0.0f);
93 node.position.y = data[
"position"].value(
"y", 0.0f);
96 if (data.contains(
"size"))
98 node.size.x = data[
"size"].value(
"x", 150.0f);
99 node.size.y = data[
"size"].value(
"y", 80.0f);
102 if (data.contains(
"properties"))
107 node.properties[
it.key()] =
it.value().dump();
111 if (data.contains(
"ports"))
114 for (
const auto&
portJson : data[
"ports"])
122 node.InitializePorts(1, 1);
196 if (
port.portId == portId)
208 if (
port.portId == portId)
ComponentTypeID GetComponentTypeID_Static()
< Provides AssetID and INVALID_ASSET_ID
@ Vector
3-component vector (Vector from vector.h)
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
static NodePort FromJson(const json &data, NodeId nodeId)