Wildmeshing Toolkit
Loading...
Searching...
No Matches
TagIntersectionOptions.cpp
Go to the documentation of this file.
2
4
6
7void to_json(nlohmann::json& j, TagIntersectionOptions& o)
8{
9 j = {
10 {"input", o.input},
11 {"output", o.output},
12 {"attributes", o.attributes},
13 {"values", o.values},
14 {"output_attributes", o.output_attributes},
15 {"output_values", o.output_values},
16 {"pass_through", o.pass_through}};
17}
18
19void from_json(const nlohmann::json& j, TagIntersectionOptions& o)
20{
21 o.input = j.at("input");
22 o.output = j.at("output");
23 o.attributes = j.at("attributes");
24 j.at("values").get_to(o.values);
25 o.output_attributes = j.at("output_attributes");
26 j.at("output_values").get_to(o.output_values);
27 j.at("pass_through").get_to(o.pass_through);
28
29 if ((o.attributes.vertex_labels.size() != o.values.vertex_values.size()) ||
30 (o.attributes.edge_labels.size() != o.values.edge_values.size()) ||
31 (o.attributes.face_labels.size() != o.values.face_values.size()) ||
34 "One value must be given for each attribute.\n vertex_labels: {}, vertex_values: {}\n "
35 " edge_labels: {}, edge_values: {}\n face_labels: {}, face_values: {}\n "
36 "tetrahedron_labels: {}, tetrahedron_values: {}",
38 o.values.vertex_values.size(),
39 o.attributes.edge_labels.size(),
40 o.values.edge_values.size(),
41 o.attributes.face_labels.size(),
42 o.values.face_values.size(),
44 o.values.tetrahedron_values.size());
45 }
52 "One output value must be given for each output attribute.\n vertex_labels: {}, "
53 "vertex_values: {}\n edge_labels: {}, edge_values: {}\n face_labels: {}, face_values: "
54 "{}\n tetrahedron_labels: {}, tetrahedron_values: {}",
63 }
64}
65
66} // namespace wmtk::components::internal
void from_json(const nlohmann::json &j, RegularSpaceOptions &o)
void to_json(nlohmann::json &j, RegularSpaceOptions &o)
void log_and_throw_error(const std::string &msg)
Definition Logger.cpp:101