25 #include <SimoxUtility/color/Color.h>
26 #include <SimoxUtility/color/json.h>
27 #include <SimoxUtility/json/util.h>
37 #include <VisionX/libraries/armem_human/aron/Profile.aron.generated.h>
45 j[
"firstName"] = arondto.firstName;
46 j[
"lastName"] = arondto.lastName;
47 j[
"names"] = arondto.names;
48 j[
"gender"] = arondto.gender;
49 j[
"handedness"] = arondto.handedness;
52 birthday = arondto.birthday;
53 j[
"birthday"] = birthday;
55 j[
"heightInMillimeters"] = arondto.heightInMillimeters;
56 j[
"weightInGrams"] = arondto.weightInGrams;
60 j[
"favouriteColor"] = favouriteColor;
63 j[
"roles"] = arondto.roles;
65 if (arondto.attributes)
71 j[
"attributes"] = simox::json::json::object();
78 using namespace simox::json;
80 get_to_if_exists(j,
"firstName", arondto.firstName);
81 get_to_if_exists(j,
"lastName", arondto.lastName);
83 get_to_if_exists(j,
"names", arondto.names);
85 get_to_if_exists(j,
"gender", arondto.gender, Gender::DIVERSE);
86 get_to_if_exists(j,
"handedness", arondto.handedness, Handedness::BOTH);
90 arondto.birthday = birthday;
92 get_to_if_exists(j,
"heightInMillimeters", arondto.heightInMillimeters, -1);
93 get_to_if_exists(j,
"weightInGrams", arondto.weightInGrams, -1);
97 get_to_if_exists(j,
"favouriteColor", favouriteColor, simox::Color::gray());
101 get_to_if_exists(j,
"roles", arondto.roles);
103 if (j.count(
"attributes"))
107 if (
auto dict = std::dynamic_pointer_cast<aron::data::Dict>(
data))
109 arondto.attributes = dict;
113 arondto.attributes =
nullptr;
118 arondto.attributes =
nullptr;
124 j = simox::alg::to_lower(arondto.toString());
129 arondto.fromString(simox::alg::to_upper(j.get<std::string>()));
134 j = simox::alg::to_lower(arondto.toString());
139 arondto.fromString(simox::alg::to_upper(j.get<std::string>()));