28 #include "../include/Coordinate.h"
34 Coordinate::Coordinate() :
35 X(0), Y(0), increasing(true), repeated(1,1), delta(0.0) {
40 X(x), Y(y), increasing(true), repeated(1,1), delta(0.0) {
74 bool success = reader.parse( value, root );
77 throw InvalidJSON(
"JSON could not be parsed (or is invalid)",
"");
87 throw InvalidJSON(
"JSON is invalid (missing keys or invalid data types)",
"");
95 if (!root[
"X"].isNull())
96 X = root[
"X"].asDouble();
97 if (!root[
"Y"].isNull())
98 Y = root[
"Y"].asDouble();
99 if (!root[
"increasing"].isNull())
100 increasing = root[
"increasing"].asBool();
101 if (!root[
"repeated"].isNull() && root[
"repeated"].isObject())
103 if (!root[
"repeated"][
"num"].isNull())
104 repeated.
num = root[
"repeated"][
"num"].asInt();
105 if (!root[
"repeated"][
"den"].isNull())
106 repeated.
den = root[
"repeated"][
"den"].asInt();
108 if (!root[
"delta"].isNull())
109 delta = root[
"delta"].asDouble();