19 "description" :
"A floating-point 4-dimensional Cartesian spatial location.",
20 "keywords" : [
"coordinate" ],
45 VuoPoint4d point = {0,0,0,0};
47 json_type t = json_object_get_type(js);
48 if (t == json_type_string)
50 const char *s = json_object_get_string(js);
52 sscanf(s,
"%20g, %20g, %20g, %20g", &x, &y, &z, &w);
53 return (VuoPoint4d){x, y, z, w};
55 else if (t == json_type_array)
57 int len = json_object_array_length(js);
59 point.x = json_object_get_double(json_object_array_get_idx(js, 0));
61 point.y = json_object_get_double(json_object_array_get_idx(js, 1));
63 point.z = json_object_get_double(json_object_array_get_idx(js, 2));
65 point.w = json_object_get_double(json_object_array_get_idx(js, 3));
71 if (json_object_object_get_ex(js,
"x", &o))
73 else if (json_object_object_get_ex(js,
"X", &o))
76 if (json_object_object_get_ex(js,
"y", &o))
78 else if (json_object_object_get_ex(js,
"Y", &o))
81 if (json_object_object_get_ex(js,
"z", &o))
83 else if (json_object_object_get_ex(js,
"Z", &o))
86 if (json_object_object_get_ex(js,
"w", &o))
88 else if (json_object_object_get_ex(js,
"W", &o))
103 json_object_object_add(js,
"x", xObject);
106 json_object_object_add(js,
"y", yObject);
109 json_object_object_add(js,
"z", zObject);
112 json_object_object_add(js,
"w", wObject);
123 return VuoText_format(
"%g, %g, %g, %g", value.x, value.y, value.z, value.w);