Debian Codegraph @

packages/seacas/libraries/ioss/src/visualization/catalyst/test/parser/ImageSetOperationValidTests.cxx

raw
1 // Copyright(C) 1999-2021 National Technology & Engineering Solutions
2 // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 // NTESS, the U.S. Government retains certain rights in this software.
4 //
5 // See packages/seacas/LICENSE for details
6
7 #include "CatalystTestFixture.h"
8 #include "catch.hpp"
9 #include "ImageSetOperationValidTests.h"
10
11 TEST_CASE_METHOD(CatalystTestFixture, "ImagesetOperationThreshold1", "[ImageSetOperationValid]")
12 {
13 Json::Value dj = getDefaultImageSetWithCameraJSON();
14
15 Json::Value &imageset = dj["imageset blocks"]["fooImageset"];
16 Json::Value th;
17 th[0] = "scalar";
18 th[1] = "VON_MISES";
19 th[2] = "keep between";
20 Json::Value kb;
21 kb[0] = 28.5;
22 kb[1] = 30.5;
23 th[3] = kb;
24 imageset["threshold"] = th;
25
26 checkPhactoriStringValidParse(ImagesetOperationThreshold1, dj);
27 }
28
29 TEST_CASE_METHOD(CatalystTestFixture, "ImagesetOperationThreshold2", "[ImageSetOperationValid]")
30 {
31 Json::Value dj = getDefaultImageSetWithCameraJSON();
32
33 Json::Value &imageset = dj["imageset blocks"]["fooImageset"];
34 Json::Value th;
35 th[0] = "vector magnitude";
36 th[1] = "displ";
37 th[2] = "keep between";
38 Json::Value kb;
39 kb[0] = 0.003;
40 kb[1] = 0.008;
41 th[3] = kb;
42 imageset["threshold"] = th;
43
44 checkPhactoriStringValidParse(ImagesetOperationThreshold2, dj);
45 }
46
47 TEST_CASE_METHOD(CatalystTestFixture, "ImagesetOperationThreshold3", "[ImageSetOperationValid]")
48 {
49 Json::Value dj = getDefaultImageSetWithCameraJSON();
50
51 Json::Value &imageset = dj["imageset blocks"]["fooImageset"];
52 Json::Value th;
53 th[0] = "vector component";
54 th[1] = "displ_x";
55 th[2] = "keep between";
56 Json::Value kb;
57 kb[0] = 0.003;
58 kb[1] = 0.008;
59 th[3] = kb;
60 imageset["threshold"] = th;
61
62 checkPhactoriStringValidParse(ImagesetOperationThreshold3, dj);
63 }
64
65 TEST_CASE_METHOD(CatalystTestFixture, "ImagesetOperationThreshold4", "[ImageSetOperationValid]")
66 {
67 Json::Value dj = getDefaultImageSetWithCameraJSON();
68
69 Json::Value &imageset = dj["imageset blocks"]["fooImageset"];
70 Json::Value th;
71 th[0] = "tensor component";
72 th[1] = "stress_xy";
73 th[2] = "keep between";
74 Json::Value kb;
75 kb[0] = 1.0;
76 kb[1] = 1.7;
77 th[3] = kb;
78 imageset["threshold"] = th;
79
80 checkPhactoriStringValidParse(ImagesetOperationThreshold4, dj);
81 }
82
83 TEST_CASE_METHOD(CatalystTestFixture, "ImagesetOperationThreshold5", "[ImageSetOperationValid]")
84 {
85 Json::Value dj = getDefaultImageSetWithCameraJSON();
86
87 Json::Value &imageset = dj["imageset blocks"]["fooImageset"];
88 Json::Value th;
89 th[0] = "scalar";
90 th[1] = "VON_MISES";
91 th[2] = "keep above";
92 Json::Value ka;
93 ka[0] = 28.5;
94 th[3] = ka;
95 imageset["threshold"] = th;
96
97 checkPhactoriStringValidParse(ImagesetOperationThreshold5, dj);
98 }
99
100 TEST_CASE_METHOD(CatalystTestFixture, "ImagesetOperationThreshold6", "[ImageSetOperationValid]")
101 {
102 Json::Value dj = getDefaultImageSetWithCameraJSON();
103
104 Json::Value &imageset = dj["imageset blocks"]["fooImageset"];
105 Json::Value th;
106 th[0] = "scalar";
107 th[1] = "VON_MISES";
108 th[2] = "keep below";
109 Json::Value kb;
110 kb[0] = 28.5;
111 th[3] = kb;
112 imageset["threshold"] = th;
113
114 checkPhactoriStringValidParse(ImagesetOperationThreshold6, dj);
115 }
116
117 TEST_CASE_METHOD(CatalystTestFixture, "ImagesetOperationBoxClip1", "[ImageSetOperationValid]")
118 {
119 Json::Value dj = getDefaultImageSetWithCameraJSON();
120
121 Json::Value &imageset = dj["imageset blocks"]["fooImageset"];
122 Json::Value bc;
123 Json::Value center;
124 center[0] = 4.0;
125 center[1] = 1.0;
126 center[2] = -0.61;
127 bc[0] = center;
128 Json::Value extents;
129 extents[0] = 6.0;
130 extents[1] = 1.5;
131 extents[2] = 2.0;
132 bc[1] = extents;
133 bc[2] = "keep inside";
134 imageset["boxclip"] = bc;
135
136 checkPhactoriStringValidParse(ImagesetOperationBoxClip1, dj);
137 }
138
139 TEST_CASE_METHOD(CatalystTestFixture, "ImagesetOperationClip1", "[ImageSetOperationValid]")
140 {
141 Json::Value dj = getDefaultImageSetWithCameraJSON();
142
143 Json::Value &imageset = dj["imageset blocks"]["fooImageset"];
144 Json::Value c;
145 Json::Value point;
146 point[0] = 0.0;
147 point[1] = 1.0;
148 point[2] = 2.0;
149 c[0] = point;
150 Json::Value normal;
151 normal[0] = 3.0;
152 normal[1] = 4.0;
153 normal[2] = 5.0;
154 c[1] = normal;
155 imageset["clip"] = c;
156
157 checkPhactoriStringValidParse(ImagesetOperationClip1, dj);
158 }
159
160 TEST_CASE_METHOD(CatalystTestFixture, "ImagesetOperationSlice1", "[ImageSetOperationValid]")
161 {
162 Json::Value dj = getDefaultImageSetWithCameraJSON();
163
164 Json::Value &imageset = dj["imageset blocks"]["fooImageset"];
165 Json::Value s;
166 Json::Value point;
167 point[0] = 0.0;
168 point[1] = 1.0;
169 point[2] = 2.0;
170 s[0] = point;
171 Json::Value normal;
172 normal[0] = 3.0;
173 normal[1] = 4.0;
174 normal[2] = 5.0;
175 s[1] = normal;
176 imageset["slice"] = s;
177
178 checkPhactoriStringValidParse(ImagesetOperationSlice1, dj);
179 }
180
181 TEST_CASE_METHOD(CatalystTestFixture, "ImagesetOperationContour1", "[ImageSetOperationValid]")
182 {
183 Json::Value dj = getDefaultImageSetWithCameraJSON();
184 Json::Value &camera = dj["camera blocks"]["singletestcamera"];
185 Json::Value direction;
186 direction[0] = -1.0;
187 direction[1] = -1.0;
188 direction[2] = -1.0;
189 camera["look direction"] = direction;
190 Json::Value point;
191 point[0] = 5.0;
192 point[1] = 1.0;
193 point[2] = 0.0;
194 camera["look at absolute point"] = point;
195 camera["look at absolute distance"] = 10.0;
196
197 Json::Value &imageset = dj["imageset blocks"]["fooImageset"];
198 Json::Value c;
199 c[0] = "scalar";
200 c[1] = "VON_MISES";
201 Json::Value valueList;
202 valueList[0] = 30.0;
203 c[2] = "value list";
204 c[3] = valueList;
205 imageset["contour"] = c;
206
207 checkPhactoriStringValidParse(ImagesetOperationContour1, dj);
208 }
209
210 TEST_CASE_METHOD(CatalystTestFixture, "ImagesetOperationContour2", "[ImageSetOperationValid]")
211 {
212 Json::Value dj = getDefaultImageSetWithCameraJSON();
213
214 Json::Value &imageset = dj["imageset blocks"]["fooImageset"];
215 Json::Value c;
216 c[0] = "vector magnitude";
217 c[1] = "displ";
218 Json::Value valueList;
219 valueList[0] = 0.0001;
220 valueList[1] = 0.0021;
221 valueList[2] = 0.0041;
222 valueList[3] = 0.0061;
223 valueList[4] = 0.0081;
224 valueList[5] = 0.011;
225 c[2] = "value list";
226 c[3] = valueList;
227 imageset["contour"] = c;
228
229 checkPhactoriStringValidParse(ImagesetOperationContour2, dj);
230 }
231
232 TEST_CASE_METHOD(CatalystTestFixture, "ImagesetOperationContour3", "[ImageSetOperationValid]")
233 {
234 Json::Value dj = getDefaultImageSetWithCameraJSON();
235
236 Json::Value &imageset = dj["imageset blocks"]["fooImageset"];
237 Json::Value c;
238 c[0] = "vector component";
239 c[1] = "displ_x";
240 Json::Value valueList;
241 valueList[0] = 0.0001;
242 valueList[1] = 0.0021;
243 valueList[2] = 0.0041;
244 valueList[3] = 0.0061;
245 valueList[4] = 0.0081;
246 valueList[5] = 0.011;
247 c[2] = "value list";
248 c[3] = valueList;
249 imageset["contour"] = c;
250
251 checkPhactoriStringValidParse(ImagesetOperationContour3, dj);
252 }
253
254 TEST_CASE_METHOD(CatalystTestFixture, "ImagesetOperationContour4", "[ImageSetOperationValid]")
255 {
256 Json::Value dj = getDefaultImageSetWithCameraJSON();
257
258 Json::Value &imageset = dj["imageset blocks"]["fooImageset"];
259 Json::Value c;
260 c[0] = "tensor component";
261 c[1] = "stress_xy";
262 Json::Value valueList;
263 valueList[0] = 0.1;
264 valueList[1] = 0.5;
265 valueList[2] = 1.0;
266 valueList[3] = 1.5;
267 valueList[4] = 1.8;
268 c[2] = "value list";
269 c[3] = valueList;
270 imageset["contour"] = c;
271
272 checkPhactoriStringValidParse(ImagesetOperationContour4, dj);
273 }
274
275 TEST_CASE_METHOD(CatalystTestFixture, "ImagesetOperationContour5", "[ImageSetOperationValid]")
276 {
277 Json::Value dj = getDefaultImageSetWithCameraJSON();
278
279 Json::Value &imageset = dj["imageset blocks"]["fooImageset"];
280 Json::Value c;
281 c[0] = "vector component";
282 c[1] = "displ_x";
283 Json::Value valueList;
284 valueList[0] = 0.0001;
285 valueList[1] = 0.0011;
286 valueList[2] = 0.0021;
287 valueList[3] = 0.0031;
288 valueList[4] = 0.0041;
289 valueList[5] = 0.0051;
290 valueList[6] = 0.0061;
291 valueList[7] = 0.0071;
292 valueList[8] = 0.0081;
293 valueList[9] = 0.0091;
294 valueList[10] = 0.0101;
295
296 c[2] = "value list";
297 c[3] = valueList;
298 imageset["contour"] = c;
299
300 checkPhactoriStringValidParse(ImagesetOperationContour5, dj);
301 }
302
303 TEST_CASE_METHOD(CatalystTestFixture, "ImagesetOperationContour6", "[notWorking]")
304 {
305 Json::Value dj = getDefaultImageSetWithCameraJSON();
306
307 Json::Value &imageset = dj["imageset blocks"]["fooImageset"];
308 Json::Value c;
309 c[0] = "vector component";
310 c[1] = "displ_x";
311 Json::Value valueList;
312 valueList[0] = 0.0001;
313 valueList[1] = 0.001;
314 valueList[2] = 0.03;
315
316 c[2] = "value list";
317 c[3] = valueList;
318 imageset["contour"] = c;
319
320 checkPhactoriStringValidParse(ImagesetOperationContour6, dj);
321 }