25 #include <SimoxUtility/algorithm/string/string_tools.h>
26 #include <SimoxUtility/color/Color.h>
27 #include <SimoxUtility/color/json.h>
28 #include <SimoxUtility/json/util.h>
38 #include <VisionX/libraries/armem_human/aron/Profile.aron.generated.h>
46 j[
"firstName"] = arondto.firstName;
47 j[
"lastName"] = arondto.lastName;
48 j[
"names"] = arondto.names;
49 j[
"gender"] = arondto.gender;
50 j[
"handedness"] = arondto.handedness;
53 birthday = arondto.birthday;
54 j[
"birthday"] = birthday;
56 j[
"heightInMillimeters"] = arondto.heightInMillimeters;
57 j[
"weightInGrams"] = arondto.weightInGrams;
61 j[
"favouriteColor"] = favouriteColor;
64 j[
"roles"] = arondto.roles;
66 if (arondto.attributes)
73 j[
"attributes"] = simox::json::json::object();
80 using namespace simox::json;
82 get_to_if_exists(j,
"firstName", arondto.firstName);
83 get_to_if_exists(j,
"lastName", arondto.lastName);
85 get_to_if_exists(j,
"names", arondto.names);
87 get_to_if_exists(j,
"gender", arondto.gender, Gender::DIVERSE);
88 get_to_if_exists(j,
"handedness", arondto.handedness, Handedness::BOTH);
92 arondto.birthday = birthday;
94 get_to_if_exists(j,
"heightInMillimeters", arondto.heightInMillimeters, -1);
95 get_to_if_exists(j,
"weightInGrams", arondto.weightInGrams, -1);
99 get_to_if_exists(j,
"favouriteColor", favouriteColor, simox::Color::gray());
103 get_to_if_exists(j,
"roles", arondto.roles);
105 if (j.count(
"attributes"))
110 if (
auto dict = std::dynamic_pointer_cast<aron::data::Dict>(
data))
112 arondto.attributes = dict;
116 arondto.attributes =
nullptr;
121 arondto.attributes =
nullptr;
128 j = simox::alg::to_lower(arondto.toString());
134 arondto.fromString(simox::alg::to_upper(j.get<std::string>()));
140 j = simox::alg::to_lower(arondto.toString());
146 arondto.fromString(simox::alg::to_upper(j.get<std::string>()));