Vuo 2.4.4
Loading...
Searching...
No Matches
VuoDistribution3d.c
Go to the documentation of this file.
1
10#include "VuoDistribution3d.h"
11
13#ifdef VUO_COMPILER
15 "title" : "3D Distribution",
16 "description" : "A distribution of points in 3D space.",
17 "keywords" : [ ],
18 "version" : "1.0.0",
19 "dependencies" : [
20 "VuoList_VuoDistribution3d"
21 ]
22 });
23#endif
25
34{
35 const char *valueAsString = "";
36 if (json_object_get_type(js) == json_type_string)
37 valueAsString = json_object_get_string(js);
38
39 VuoDistribution3d value = VuoDistribution3d_CubeVolume;
40
41 if (strcmp(valueAsString, "cube-surface") == 0)
42 value = VuoDistribution3d_CubeSurface;
43 else if (strcmp(valueAsString, "sphere-volume") == 0)
44 value = VuoDistribution3d_SphereVolume;
45 else if (strcmp(valueAsString, "sphere-surface") == 0)
46 value = VuoDistribution3d_SphereSurface;
47
48 return value;
49}
50
55{
56 char *valueAsString = "cube-volume";
57
58 if (value == VuoDistribution3d_CubeSurface)
59 valueAsString = "cube-surface";
60 else if (value == VuoDistribution3d_SphereVolume)
61 valueAsString = "sphere-volume";
62 else if (value == VuoDistribution3d_SphereSurface)
63 valueAsString = "sphere-surface";
64
65 return json_object_new_string(valueAsString);
66}
67
72{
74 VuoListAppendValue_VuoDistribution3d(l, VuoDistribution3d_CubeVolume);
75 VuoListAppendValue_VuoDistribution3d(l, VuoDistribution3d_CubeSurface);
76 VuoListAppendValue_VuoDistribution3d(l, VuoDistribution3d_SphereVolume);
77 VuoListAppendValue_VuoDistribution3d(l, VuoDistribution3d_SphereSurface);
78 return l;
79}
80
85{
86 char *valueAsString = "Cube Volume";
87
88 if (value == VuoDistribution3d_CubeSurface)
89 valueAsString = "Cube Surface";
90 else if (value == VuoDistribution3d_SphereVolume)
91 valueAsString = "Sphere Volume";
92 else if (value == VuoDistribution3d_SphereSurface)
93 valueAsString = "Sphere Surface";
94
95 return strdup(valueAsString);
96}
97
102{
103 return valueA == valueB;
104}
105
110{
111 return valueA < valueB;
112}