Wildmeshing Toolkit
RegularSpaceOptions.cpp
Go to the documentation of this file.
2 
3 #include <wmtk/utils/Logger.hpp>
4 
6 
8 {
9  j = {
10  {"input", o.input},
11  {"output", o.output},
12  {"attributes", o.attributes},
13  {"values", o.values},
14  {"pass_through", o.pass_through}};
15 }
16 
18 {
19  o.input = j.at("input");
20  o.output = j.at("output");
21  o.attributes = j.at("attributes");
22  j.at("values").get_to(o.values);
23  j.at("pass_through").get_to(o.pass_through);
24 
25  if (o.attributes.size() != o.values.size()) {
27  "One value must be given for each attribute. Attributes: {}, values{}.",
28  o.attributes.size(),
29  o.values.size());
30  }
31 }
32 
33 } // 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
nlohmann::json json
Definition: input.cpp:9