TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ Save()

nlohmann::json CurveNode::Save ( )
virtual

Implements NodeEditorNode.

Definition at line 72 of file CurveNode.cpp.

73{
74 nlohmann::json data;
76 data["type"] = MeshNodeEditor::MeshNodeType::Curve;
77 int i = 0;
78
79 for (ImVec2 point : curve)
80 {
81 nlohmann::json tmp2;
82 tmp2["x"] = point.x;
83 tmp2["y"] = point.y;
84 tmp2["index"] = i++;
85 tmp.push_back(tmp2);
86 }
87
88 data["curve"] = tmp;
89 data["curveSize"] = curve.size();
90 data["maxPoints"] = maxPoints;
91 data["axis"] = axis;
92 return data;
93}
size_type size() const noexcept
returns the number of elements
Definition: json.hpp:22912
void push_back(basic_json &&val)
add an object to an array
Definition: json.hpp:23148
a class to store JSON values
Definition: json.hpp:17860