#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
string name
Definition: objlib.h:256
std::map< std::string, Json > object
Definition: json11.hpp:88
float density
Definition: objlib.h:257
Vector specular
Definition: objlib.h:260
Vector diffuse
Definition: objlib.h:259
Vector ambient
Definition: objlib.h:258
void Cosmos::wavefront::material::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
286 if(!p[
"name"].is_null())
name = p[
"name"].string_value();
287 if(!p[
"density"].is_null())
density = p[
"density"].number_value();
292 cerr<<
"ERROR: <"<<error<<
">"<<endl;
string name
Definition: objlib.h:256
Definition: json11.hpp:79
float density
Definition: objlib.h:257
Vector specular
Definition: objlib.h:260
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)
Vector diffuse
Definition: objlib.h:259
Vector ambient
Definition: objlib.h:258
string Cosmos::wavefront::material::name = "" |
float Cosmos::wavefront::material::density = 0.f |
Vector Cosmos::wavefront::material::ambient |
Vector Cosmos::wavefront::material::diffuse |
Vector Cosmos::wavefront::material::specular |
The documentation for this struct was generated from the following file: