#include <objlib.h>
Convert class contents to JSON object.
Returns a json11 JSON object of the class
- Returns
- A json11 JSON object containing every member variable within the class
157 {
"groups" , d_groups },
std::map< std::string, Json > object
Definition: json11.hpp:88
Vector normal
Definition: objlib.h:147
double area
Definition: objlib.h:148
vector< size_t > groups
Definition: objlib.h:144
vector< vertex > vertices
Definition: objlib.h:145
Vector com
Definition: objlib.h:146
void Cosmos::wavefront::face::from_json |
( |
const string & |
s | ) |
|
|
inline |
Set class contents from JSON string.
Parses the provided JSON-formatted string and sets the class data. String should be formatted like the string returned from to_json()
- Parameters
-
s | JSON-formatted string to set class contents to |
- Returns
- n/a
175 for(
size_t i = 0;
i <
groups.size(); ++
i) {
176 if(!p[
"groups"][
i].is_null())
177 groups[
i] = static_cast<size_t>(p[
"groups"][
i].number_value());
184 if(!p[
"area"].is_null())
area = p[
"area"].number_value();
186 cerr<<
"ERROR: <"<<error<<
">"<<endl;
Definition: json11.hpp:79
int i
Definition: rw_test.cpp:37
Vector normal
Definition: objlib.h:147
void from_json(const string &s)
Set class contents from JSON string.
Definition: objlib.h:171
static double * p
Definition: gauss_jackson_test.cpp:42
void dump(std::string &out) const
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:783
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
double area
Definition: objlib.h:148
static void dump(NullStruct, string &out)
Definition: json11.cpp:53
vector< size_t > groups
Definition: objlib.h:144
vector< vertex > vertices
Definition: objlib.h:145
Vector com
Definition: objlib.h:146
vector<size_t> Cosmos::wavefront::face::groups |
vector<vertex> Cosmos::wavefront::face::vertices |
Vector Cosmos::wavefront::face::com |
Vector Cosmos::wavefront::face::normal |
double Cosmos::wavefront::face::area = 0. |
The documentation for this struct was generated from the following file: