3 #include <SimoxUtility/algorithm/string.h>
6 #include <ArmarXCore/interface/core/BasicVectorTypes.h>
15 {OVERRIDE_MATERIAL,
"Override_Material"},
20 {ORIGINAL,
"Original"},
21 {COLLISION,
"Collision"},
22 {OVERRIDE_COLOR,
"Override_Color"},
28 j[
"x"] = coloredPoint.x;
29 j[
"y"] = coloredPoint.y;
30 j[
"z"] = coloredPoint.z;
31 j[
"color"] = coloredPoint.color;
38 coloredPoint.x = j.at(
"x");
39 coloredPoint.y = j.at(
"y");
40 coloredPoint.z = j.at(
"z");
41 coloredPoint.color = j.at(
"color");
48 j[
"length"] = arrow.length;
49 j[
"width"] = arrow.width;
56 arrow.length = j.at(
"length");
57 arrow.width = j.at(
"width");
64 j[
"radius"] = arrowCircle.radius;
65 j[
"completion"] = arrowCircle.completion;
66 j[
"width"] = arrowCircle.width;
73 arrowCircle.radius = j.at(
"radius");
74 arrowCircle.completion = j.at(
"completion");
75 arrowCircle.width = j.at(
"width");
89 box.size = j.at(
"size").get<armarx::Vector3f>();
96 j[
"height"] = cylinder.height;
97 j[
"radius"] = cylinder.radius;
104 cylinder.height = j.at(
"height");
105 cylinder.radius = j.at(
"radius");
112 j[
"height"] = cylindroid.height;
113 j[
"axisLengths"] = cylindroid.axisLengths;
114 j[
"curvature"] = cylindroid.curvature;
121 cylindroid.height = j.at(
"height");
122 cylindroid.axisLengths = j.at(
"axisLengths").get<armarx::Vector2f>();
123 cylindroid.curvature = j.at(
"curvature").get<armarx::Vector2f>();
130 j[
"from"] = line.from;
132 j[
"lineWidth"] = line.lineWidth;
139 line.from = j.at(
"from").get<armarx::Vector3f>();
140 line.to = j.at(
"to").get<armarx::Vector3f>();
141 line.lineWidth = j.at(
"lineWidth").get<
float>();
148 j[
"# Vertices"] = mesh.vertices.size();
149 j[
"# Colors"] = mesh.colors.size();
150 j[
"# Faces"] = mesh.faces.size();
167 j[
"transparency"] = pointCloud.transparency;
168 j[
"pointSizeInPixels"] = pointCloud.pointSizeInPixels;
170 std::size_t numPoints = pointCloud.points.size() /
sizeof(ColoredPoint);
171 j[
"# Points"] = numPoints;
174 ColoredPoint
const* begin = (ColoredPoint
const*)pointCloud.points.data();
175 ColoredPoint
const* end = begin +
std::min(std::size_t(10), numPoints);
176 j[
"Points[0:10]"] = ColoredPointList(begin, end);
183 pointCloud.transparency = j.at(
"transparency");
184 pointCloud.pointSizeInPixels = j.at(
"pointSizeInPixels");
191 j[
"lineColor"] = polygon.lineColor;
193 j[
"lineWidth"] = polygon.lineWidth;
194 j[
"points"] = polygon.points;
201 polygon.lineColor = j.at(
"lineColor");
202 polygon.lineWidth = j.at(
"lineWidth");
203 polygon.points = j.at(
"points").get<std::vector<armarx::Vector3f>>();
222 j[
"points"] = path.points;
229 path.points = j.at(
"points").get<armarx::Vector3fSeq>();
236 j[
"radius"] = sphere.radius;
243 sphere.radius = j.at(
"radius");
250 j[
"axisLengths"] = ellipsoid.axisLengths;
251 j[
"curvature"] = ellipsoid.curvature;
258 ellipsoid.axisLengths = j.at(
"axisLengths");
259 ellipsoid.curvature = j.at(
"curvature");
266 j[
"text"] = text.text;
273 text.text = j.at(
"text");
276 namespace data::ModelDrawStyle
281 std::vector<std::string> flag_names;
282 for (
int flag :
names.values())
284 if (drawStyle == flag
287 flag_names.push_back(
names.to_name(flag));
290 return simox::alg::join(flag_names,
" | ");
296 bool trim_elements =
true;
301 flag |=
names.from_name(
s);
311 j[
"project"] =
object.project;
312 j[
"filename"] =
object.filename;
323 object.project = j.at(
"project");
324 object.filename = j.at(
"filename");
332 j[
"project"] = robot.project;
333 j[
"filename"] = robot.filename;
334 j[
"jointValues"] = robot.jointValues;
344 robot.project = j.at(
"project");
345 robot.filename = j.at(
"filename");
346 robot.jointValues = j.at(
"jointValues").get<armarx::StringFloatDictionary>();