1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """Module for generating OpenDX files."""
24
25
26 from lib.io import open_write_file
27
28
30 """Creating the OpenDX .cfg program configuration file.
31
32 @keyword file_prefix: The base part of the file name without extension.
33 @type file_prefix: str
34 @keyword dir: The directory to place the file in.
35 @type dir: str or None
36 @keyword date: The date string to include in the configuration.
37 @type date: str
38 """
39
40
41 print("\nCreating the OpenDX .cfg program configuration file.")
42
43
44 file = open_write_file(file_name=file_prefix+".cfg", dir=dir, force=True)
45
46
47 file.write("//\n")
48 file.write("//\n")
49 file.write("// time: %s\n" % date)
50 file.write("//\n")
51 file.write("// version: 3.2.0 (format), 4.3.2 (DX)\n")
52 file.write("//\n")
53 file.write("//\n")
54 file.write("// panel[0]: position = (0.0164,0.0000), size = 0.2521x0.1933, startup = 1, devstyle = 1\n")
55 file.write("// title: value = Control Panel\n")
56 file.write("//\n")
57 file.write("// workspace: width = 251, height = 142\n")
58 file.write("// layout: snap = 0, width = 50, height = 50, align = NN\n")
59 file.write("//\n")
60 file.write("// interactor Selector[1]: num_components = 1, value = 1 \n")
61 file.write("// selections: maximum = 2, current = 0 \n")
62 file.write("// option[0]: name = \"Colour\", value = 1\n")
63 file.write("// option[1]: name = \"Grey\", value = 2\n")
64 file.write("// instance: panel = 0, x = 81, y = 6, style = Scrolled List, vertical = 1, size = 170x136\n")
65 file.write("// label: value = Colour Selector\n")
66 file.write("//\n")
67 file.write("// node Image[3]:\n")
68 file.write("// title: value = Surface\n")
69 file.write("// depth: value = 24\n")
70 file.write("// window: position = (0.0000,0.0400), size = 0.9929x0.9276\n")
71
72
73 file.close()
74
75
77 """Create the OpenDX .general file for a 3D map.
78
79 @keyword file_prefix: The base part of the file name without extension.
80 @type file_prefix: str
81 @keyword dir: The directory to place the file in.
82 @type dir: str or None
83 @keyword inc: The number of increments in the 3D map.
84 @type inc: int
85 """
86
87
88 print("\nCreating the OpenDX .general file.")
89
90
91 file = open_write_file(file_name=file_prefix+".general", dir=dir, force=True)
92
93
94 file.write("file = %s\n" % file_prefix)
95 file.write("grid = %s x %s x %s\n" % (inc+1, inc+1, inc+1))
96 file.write("format = ascii\n")
97 file.write("interleaving = field\n")
98 file.write("majority = row\n")
99 file.write("field = data\n")
100 file.write("structure = scalar\n")
101 file.write("type = float\n")
102 file.write("dependency = positions\n")
103 file.write("positions = regular, regular, regular, 0, 1, 0, 1, 0, 1\n\n")
104 file.write("end\n")
105
106
107 file.close()
108
109
110 -def write_point(file_prefix=None, dir=None, inc=None, point=None, bounds=None, N=None):
111 """Creating a sphere at a given position within the map.
112
113 The formula used to calculate the coordinate position is::
114
115 V - L
116 coord = Inc * -----
117 U - L
118
119 where:
120 - V is the coordinate or parameter value.
121 - L is the lower bound value.
122 - U is the upper bound value.
123 - Inc is the number of increments.
124
125 Both a data file and .general file will be created.
126
127
128 @keyword file_prefix: The base part of the file name without extension.
129 @type file_prefix: str
130 @keyword dir: The directory to place the file in.
131 @type dir: str or None
132 @keyword inc: The number of increments in the map.
133 @type inc: int
134 @keyword point: The coordinates of the point.
135 @type point: numpy rank-1 float array
136 @keyword bounds: The bounds of the map.
137 @type bounds: numpy rank-2 float array
138 @keyword N: The dimension of the map.
139 @type N: int
140 """
141
142
143 print("\nCreating the OpenDX .general and data files for the point %s." % point)
144
145
146 point_file = open_write_file(file_name=file_prefix, dir=dir, force=True)
147 point_file_general = open_write_file(file_name=file_prefix+".general", dir=dir, force=True)
148
149
150 coords = inc * (point - bounds[:, 0]) / (bounds[:, 1] - bounds[:, 0])
151 for i in range(N):
152 point_file.write("%-15.5g" % coords[i])
153 point_file.write("1\n")
154
155
156 point_file_general.write("file = %s\n" % point_file)
157 point_file_general.write("points = 1\n")
158 point_file_general.write("format = ascii\n")
159 point_file_general.write("interleaving = field\n")
160 point_file_general.write("field = locations, field0\n")
161 point_file_general.write("structure = 3-vector, scalar\n")
162 point_file_general.write("type = float, float\n\n")
163 point_file_general.write("end\n")
164
165
166 point_file.close()
167 point_file_general.close()
168
169
170 -def write_program(file_prefix=None, point_file=None, dir=None, inc=None, N=None, num_points=None, labels=None, tick_locations=None, tick_values=None, date=None):
171 """Create the OpenDX .net program file.
172
173 @keyword file_prefix: The base part of the file name without extension.
174 @type file_prefix: str
175 @keyword point_file: The name of the point file to be displayed by the program.
176 @type point_file: str or None
177 @keyword dir: The directory to place the file in.
178 @type dir: str or None
179 @keyword inc: The number of increments in the map.
180 @type inc: int
181 @keyword N: The dimension of the map.
182 @type N: int
183 @keyword num_points: The number of points to be displayed by the program.
184 @type num_points: int
185 @keyword labels: The strings associated with the map axes, as an OpenDX string.
186 @type labels: str
187 @keyword tick_locations: The locations of the tick marks, as an OpenDX string.
188 @type tick_locations: str
189 @keyword tick_values: The values of the tick marks, as an OpenDX string.
190 @type tick_values: str
191 @keyword date: The date string to include in the configuration.
192 @type date: str
193 """
194
195
196 print("\nCreating the OpenDX .net program file.")
197
198
199 file = open_write_file(file_name=file_prefix+".net", dir=dir, force=True)
200
201
202 corners = "{[0"
203 for i in range(N - 1):
204 corners += " 0"
205 corners += "] [%s" % inc
206 for i in range(N - 1):
207 corners += " %s" % inc
208 corners += "]}"
209
210
211 sphere_size = repr(0.025 * (inc + 1.0))
212
213
214 image_array1 = "[%s %s %s]" % (0.6 * (inc + 1.0), 0.3 * (inc + 1.0), 0.6 * (inc + 1.0))
215 image_array2 = "[%s %s %s]" % (0.6 * (inc + 1.0), 0.3 * (inc + 1.0), 6.0 * (inc + 1.0))
216 image_val = repr(3.0 * (inc + 1.0))
217
218
219
220
221
222 file.write("//\n")
223 file.write("// time: %s\n" % date)
224 file.write("//\n")
225 file.write("// version: 3.2.0 (format), 4.3.2 (DX)\n")
226 file.write("//\n")
227 file.write("//\n")
228 file.write("// MODULE main\n")
229
230
231 if num_points == 1:
232 file.write("\n")
233 file.write("// page assignment: Colour Space order=3, windowed=0, showing=0\n")
234 file.write("// page assignment: ColourScene order=5, windowed=0, showing=0\n")
235 file.write("// page assignment: Glyph order=2, windowed=0, showing=0\n")
236 file.write("// page assignment: Grey Space order=4, windowed=0, showing=0\n")
237 file.write("// page assignment: GreyScene order=6, windowed=0, showing=0\n")
238 file.write("// page assignment: Image order=7, windowed=0, showing=0\n")
239 file.write("// page assignment: Isosurfaces order=1, windowed=0, showing=1\n")
240
241
242 else:
243 file.write("\n")
244 file.write("// page assignment: Colour Space order=4, windowed=0, showing=0\n")
245 file.write("// page assignment: ColourScene order=6, windowed=0, showing=0\n")
246 file.write("// page assignment: Grey Space order=5, windowed=0, showing=0\n")
247 file.write("// page assignment: GreyScene order=7, windowed=0, showing=0\n")
248 file.write("// page assignment: Image order=8, windowed=0, showing=0\n")
249 file.write("// page assignment: Isosurfaces order=2, windowed=0, showing=1\n")
250
251
252 file.write("\n")
253 file.write("// workspace: width = 474, height = 354\n")
254 file.write("// layout: snap = 0, width = 50, height = 50, align = NN\n")
255 file.write("//\n")
256 file.write("macro main(\n")
257 file.write(") -> (\n")
258 file.write(") {\n")
259 file.write(" // \n")
260
261
262 if num_points == 1:
263 file.write("\n")
264 file.write(" // node Import[4]: x = 177, y = 62, inputs = 6, label = %s\n" % point_file)
265 file.write(" // input[1]: defaulting = 0, visible = 1, type = 32, value = \"%s.general\"\n" % point_file)
266 file.write(" // input[3]: defaulting = 1, visible = 1, type = 32, value = \"general\"\n")
267 file.write(" // page group: Glyph\n")
268 file.write(" //\n")
269 file.write("main_Import_4_out_1 = \n")
270 file.write(" Import(\n")
271 file.write(" main_Import_4_in_1,\n")
272 file.write(" main_Import_4_in_2,\n")
273 file.write(" main_Import_4_in_3,\n")
274 file.write(" main_Import_4_in_4,\n")
275 file.write(" main_Import_4_in_5,\n")
276 file.write(" main_Import_4_in_6\n")
277 file.write(" ) [instance: 4, cache: 1];\n")
278 file.write(" // \n")
279 file.write(" // node Glyph[2]: x = 201, y = 182, inputs = 7, label = Glyph\n")
280 file.write(" // input[2]: defaulting = 0, visible = 1, type = 32, value = \"sphere\"\n")
281 file.write(" // input[3]: defaulting = 1, visible = 1, type = 5, value = 10.0\n")
282 file.write(" // input[4]: defaulting = 0, visible = 1, type = 5, value = %s\n" % sphere_size)
283 file.write(" // input[5]: defaulting = 0, visible = 1, type = 5, value = 0.0\n")
284 file.write(" // page group: Glyph\n")
285 file.write(" //\n")
286 file.write("main_Glyph_2_out_1 = \n")
287 file.write(" Glyph(\n")
288 file.write(" main_Import_4_out_1,\n")
289 file.write(" main_Glyph_2_in_2,\n")
290 file.write(" main_Glyph_2_in_3,\n")
291 file.write(" main_Glyph_2_in_4,\n")
292 file.write(" main_Glyph_2_in_5,\n")
293 file.write(" main_Glyph_2_in_6,\n")
294 file.write(" main_Glyph_2_in_7\n")
295 file.write(" ) [instance: 2, cache: 1];\n")
296 file.write(" // \n")
297 file.write(" // node Color[10]: x = 357, y = 278, inputs = 5, label = Color\n")
298 file.write(" // input[2]: defaulting = 0, visible = 1, type = 8, value = [0 0 0]\n")
299 file.write(" // input[3]: defaulting = 0, visible = 1, type = 5, value = 1.0\n")
300 file.write(" // page group: Glyph\n")
301 file.write(" //\n")
302 file.write("main_Color_10_out_1 = \n")
303 file.write(" Color(\n")
304 file.write(" main_Glyph_2_out_1,\n")
305 file.write(" main_Color_10_in_2,\n")
306 file.write(" main_Color_10_in_3,\n")
307 file.write(" main_Color_10_in_4,\n")
308 file.write(" main_Color_10_in_5\n")
309 file.write(" ) [instance: 10, cache: 1];\n")
310 file.write(" // \n")
311 file.write(" // node Transmitter[1]: x = 352, y = 386, inputs = 1, label = GreySphere\n")
312 file.write(" // page group: Glyph\n")
313 file.write(" //\n")
314 file.write("GreySphere = main_Color_10_out_1;\n")
315 file.write(" // \n")
316 file.write(" // node Receiver[2]: x = 190, y = 350, inputs = 1, label = GreySphere\n")
317 file.write(" // page group: Grey Space\n")
318 file.write(" //\n")
319 file.write("main_Receiver_2_out_1[cache: 0] = GreySphere;\n")
320
321
322 file.write("\n")
323 file.write(" // \n")
324 file.write(" // node Import[3]: x = 225, y = 84, inputs = 6, label = %s\n" % file_prefix)
325 file.write(" // input[1]: defaulting = 0, visible = 1, type = 32, value = \"%s.general\"\n" % file_prefix)
326 file.write(" // input[3]: defaulting = 1, visible = 1, type = 32, value = \"general\"\n")
327 file.write(" // page group: Isosurfaces\n")
328 file.write(" //\n")
329 file.write("main_Import_3_out_1 = \n")
330 file.write(" Import(\n")
331 file.write(" main_Import_3_in_1,\n")
332 file.write(" main_Import_3_in_2,\n")
333 file.write(" main_Import_3_in_3,\n")
334 file.write(" main_Import_3_in_4,\n")
335 file.write(" main_Import_3_in_5,\n")
336 file.write(" main_Import_3_in_6\n")
337 file.write(" ) [instance: 3, cache: 1];\n")
338 file.write(" // \n")
339 file.write(" // node Isosurface[5]: x = 102, y = 191, inputs = 6, label = Outer Isosurface\n")
340 file.write(" // input[2]: defaulting = 0, visible = 1, type = 5, value = 500.0\n")
341 file.write(" // page group: Isosurfaces\n")
342 file.write(" //\n")
343 file.write("main_Isosurface_5_out_1 = \n")
344 file.write(" Isosurface(\n")
345 file.write(" main_Import_3_out_1,\n")
346 file.write(" main_Isosurface_5_in_2,\n")
347 file.write(" main_Isosurface_5_in_3,\n")
348 file.write(" main_Isosurface_5_in_4,\n")
349 file.write(" main_Isosurface_5_in_5,\n")
350 file.write(" main_Isosurface_5_in_6\n")
351 file.write(" ) [instance: 5, cache: 1];\n")
352 file.write(" // \n")
353 file.write(" // node Transmitter[7]: x = 110, y = 292, inputs = 1, label = Surface4\n")
354 file.write(" // page group: Isosurfaces\n")
355 file.write(" //\n")
356 file.write("Surface4 = main_Isosurface_5_out_1;\n")
357 file.write(" // \n")
358 file.write(" // node Receiver[14]: x = 123, y = 51, inputs = 1, label = Surface4\n")
359 file.write(" // page group: Grey Space\n")
360 file.write(" //\n")
361 file.write("main_Receiver_14_out_1[cache: 0] = Surface4;\n")
362 file.write(" // \n")
363 file.write(" // node Color[6]: x = 142, y = 145, inputs = 5, label = Color\n")
364 file.write(" // input[2]: defaulting = 0, visible = 1, type = 8, value = [0 0 0]\n")
365 file.write(" // input[3]: defaulting = 0, visible = 1, type = 5, value = 0.2\n")
366 file.write(" // page group: Grey Space\n")
367 file.write(" //\n")
368 file.write("main_Color_6_out_1 = \n")
369 file.write(" Color(\n")
370 file.write(" main_Receiver_14_out_1,\n")
371 file.write(" main_Color_6_in_2,\n")
372 file.write(" main_Color_6_in_3,\n")
373 file.write(" main_Color_6_in_4,\n")
374 file.write(" main_Color_6_in_5\n")
375 file.write(" ) [instance: 6, cache: 1];\n")
376 file.write(" // \n")
377 file.write(" // node Isosurface[6]: x = 200, y = 191, inputs = 6, label = Middle Isosurface\n")
378 file.write(" // input[2]: defaulting = 0, visible = 1, type = 5, value = 100.0\n")
379 file.write(" // page group: Isosurfaces\n")
380 file.write(" //\n")
381 file.write("main_Isosurface_6_out_1 = \n")
382 file.write(" Isosurface(\n")
383 file.write(" main_Import_3_out_1,\n")
384 file.write(" main_Isosurface_6_in_2,\n")
385 file.write(" main_Isosurface_6_in_3,\n")
386 file.write(" main_Isosurface_6_in_4,\n")
387 file.write(" main_Isosurface_6_in_5,\n")
388 file.write(" main_Isosurface_6_in_6\n")
389 file.write(" ) [instance: 6, cache: 1];\n")
390 file.write(" // \n")
391 file.write(" // node Transmitter[8]: x = 208, y = 292, inputs = 1, label = Surface3\n")
392 file.write(" // page group: Isosurfaces\n")
393 file.write(" //\n")
394 file.write("Surface3 = main_Isosurface_6_out_1;\n")
395 file.write(" // \n")
396 file.write(" // node Receiver[13]: x = 227, y = 51, inputs = 1, label = Surface3\n")
397 file.write(" // page group: Grey Space\n")
398 file.write(" //\n")
399 file.write("main_Receiver_13_out_1[cache: 0] = Surface3;\n")
400 file.write(" // \n")
401 file.write(" // node Color[7]: x = 246, y = 145, inputs = 5, label = Color\n")
402 file.write(" // input[2]: defaulting = 0, visible = 1, type = 8, value = [0.2 0.2 0.2]\n")
403 file.write(" // input[3]: defaulting = 0, visible = 1, type = 5, value = 0.4\n")
404 file.write(" // page group: Grey Space\n")
405 file.write(" //\n")
406 file.write("main_Color_7_out_1 = \n")
407 file.write(" Color(\n")
408 file.write(" main_Receiver_13_out_1,\n")
409 file.write(" main_Color_7_in_2,\n")
410 file.write(" main_Color_7_in_3,\n")
411 file.write(" main_Color_7_in_4,\n")
412 file.write(" main_Color_7_in_5\n")
413 file.write(" ) [instance: 7, cache: 1];\n")
414 file.write(" // \n")
415 file.write(" // node Collect[5]: x = 203, y = 236, inputs = 2, label = Collect\n")
416 file.write(" // page group: Grey Space\n")
417 file.write(" //\n")
418 file.write("main_Collect_5_out_1 = \n")
419 file.write(" Collect(\n")
420 file.write(" main_Color_6_out_1,\n")
421 file.write(" main_Color_7_out_1\n")
422 file.write(" ) [instance: 5, cache: 1];\n")
423 file.write(" // \n")
424 file.write(" // node Isosurface[7]: x = 298, y = 191, inputs = 6, label = Inner Isosurface\n")
425 file.write(" // input[2]: defaulting = 0, visible = 1, type = 5, value = 20.0\n")
426 file.write(" // page group: Isosurfaces\n")
427 file.write(" //\n")
428 file.write("main_Isosurface_7_out_1 = \n")
429 file.write(" Isosurface(\n")
430 file.write(" main_Import_3_out_1,\n")
431 file.write(" main_Isosurface_7_in_2,\n")
432 file.write(" main_Isosurface_7_in_3,\n")
433 file.write(" main_Isosurface_7_in_4,\n")
434 file.write(" main_Isosurface_7_in_5,\n")
435 file.write(" main_Isosurface_7_in_6\n")
436 file.write(" ) [instance: 7, cache: 1];\n")
437 file.write(" // \n")
438 file.write(" // node Transmitter[9]: x = 306, y = 292, inputs = 1, label = Surface2\n")
439 file.write(" // page group: Isosurfaces\n")
440 file.write(" //\n")
441 file.write("Surface2 = main_Isosurface_7_out_1;\n")
442 file.write(" // \n")
443 file.write(" // node Receiver[12]: x = 331, y = 51, inputs = 1, label = Surface2\n")
444 file.write(" // page group: Grey Space\n")
445 file.write(" //\n")
446 file.write("main_Receiver_12_out_1[cache: 0] = Surface2;\n")
447 file.write(" // \n")
448 file.write(" // node Color[8]: x = 350, y = 145, inputs = 5, label = Color\n")
449 file.write(" // input[2]: defaulting = 0, visible = 1, type = 8, value = [0.5 0.5 0.5]\n")
450 file.write(" // input[3]: defaulting = 0, visible = 1, type = 5, value = 0.5\n")
451 file.write(" // page group: Grey Space\n")
452 file.write(" //\n")
453 file.write("main_Color_8_out_1 = \n")
454 file.write(" Color(\n")
455 file.write(" main_Receiver_12_out_1,\n")
456 file.write(" main_Color_8_in_2,\n")
457 file.write(" main_Color_8_in_3,\n")
458 file.write(" main_Color_8_in_4,\n")
459 file.write(" main_Color_8_in_5\n")
460 file.write(" ) [instance: 8, cache: 1];\n")
461 file.write(" // \n")
462 file.write(" // node Isosurface[8]: x = 396, y = 191, inputs = 6, label = Innermost Isosurface\n")
463 file.write(" // input[2]: defaulting = 0, visible = 1, type = 5, value = 7.0\n")
464 file.write(" // page group: Isosurfaces\n")
465 file.write(" //\n")
466 file.write("main_Isosurface_8_out_1 = \n")
467 file.write(" Isosurface(\n")
468 file.write(" main_Import_3_out_1,\n")
469 file.write(" main_Isosurface_8_in_2,\n")
470 file.write(" main_Isosurface_8_in_3,\n")
471 file.write(" main_Isosurface_8_in_4,\n")
472 file.write(" main_Isosurface_8_in_5,\n")
473 file.write(" main_Isosurface_8_in_6\n")
474 file.write(" ) [instance: 8, cache: 1];\n")
475 file.write(" // \n")
476 file.write(" // node Transmitter[10]: x = 404, y = 292, inputs = 1, label = Surface1\n")
477 file.write(" // page group: Isosurfaces\n")
478 file.write(" //\n")
479 file.write("Surface1 = main_Isosurface_8_out_1;\n")
480 file.write(" // \n")
481 file.write(" // node Receiver[11]: x = 434, y = 51, inputs = 1, label = Surface1\n")
482 file.write(" // page group: Grey Space\n")
483 file.write(" //\n")
484 file.write("main_Receiver_11_out_1[cache: 0] = Surface1;\n")
485 file.write(" // \n")
486 file.write(" // node Color[9]: x = 453, y = 145, inputs = 5, label = Color\n")
487 file.write(" // input[2]: defaulting = 0, visible = 1, type = 32, value = \"white\"\n")
488 file.write(" // input[3]: defaulting = 0, visible = 1, type = 5, value = 0.7\n")
489 file.write(" // page group: Grey Space\n")
490 file.write(" //\n")
491 file.write("main_Color_9_out_1 = \n")
492 file.write(" Color(\n")
493 file.write(" main_Receiver_11_out_1,\n")
494 file.write(" main_Color_9_in_2,\n")
495 file.write(" main_Color_9_in_3,\n")
496 file.write(" main_Color_9_in_4,\n")
497 file.write(" main_Color_9_in_5\n")
498 file.write(" ) [instance: 9, cache: 1];\n")
499 file.write(" // \n")
500 file.write(" // node Collect[6]: x = 409, y = 236, inputs = 2, label = Collect\n")
501 file.write(" // page group: Grey Space\n")
502 file.write(" //\n")
503 file.write("main_Collect_6_out_1 = \n")
504 file.write(" Collect(\n")
505 file.write(" main_Color_8_out_1,\n")
506 file.write(" main_Color_9_out_1\n")
507 file.write(" ) [instance: 6, cache: 1];\n")
508 file.write(" // \n")
509 file.write(" // node Collect[7]: x = 307, y = 327, inputs = 2, label = Collect\n")
510 file.write(" // page group: Grey Space\n")
511 file.write(" //\n")
512 file.write("main_Collect_7_out_1 = \n")
513 file.write(" Collect(\n")
514 file.write(" main_Collect_5_out_1,\n")
515 file.write(" main_Collect_6_out_1\n")
516 file.write(" ) [instance: 7, cache: 1];\n")
517 file.write(" // \n")
518
519
520 if num_points == 1:
521 file.write("\n")
522 file.write(" // node Collect[8]: x = 293, y = 431, inputs = 2, label = Collect\n")
523 file.write(" // page group: Grey Space\n")
524 file.write(" //\n")
525 file.write("main_Collect_8_out_1 = \n")
526 file.write(" Collect(\n")
527 file.write(" main_Receiver_2_out_1,\n")
528 file.write(" main_Collect_7_out_1\n")
529 file.write(" ) [instance: 8, cache: 1];\n")
530 file.write(" // \n")
531 file.write(" // node Transmitter[4]: x = 282, y = 517, inputs = 1, label = GreySpace\n")
532
533
534 else:
535 file.write("\n")
536 file.write(" // node Transmitter[4]: x = 296, y = 439, inputs = 1, label = GreySpace\n")
537
538
539 file.write("\n")
540 file.write(" // page group: Grey Space\n")
541 file.write(" // \n")
542
543
544 if num_points == 1:
545 file.write("\n")
546 file.write("GreySpace = main_Collect_8_out_1;\n")
547
548
549 else:
550 file.write("\n")
551 file.write("GreySpace = main_Collect_7_out_1;\n")
552
553
554 file.write("\n")
555 file.write(" // \n")
556 file.write(" // node Receiver[3]: x = 137, y = 57, inputs = 1, label = GreySpace\n")
557 file.write(" // page group: GreyScene\n")
558 file.write(" //\n")
559 file.write("main_Receiver_3_out_1[cache: 0] = GreySpace;\n")
560 file.write(" // \n")
561 file.write(" // node Scale[3]: x = 163, y = 159, inputs = 2, label = Scale\n")
562 file.write(" // input[2]: defaulting = 0, visible = 1, type = 8, value = [1 1 1]\n")
563 file.write(" // page group: GreyScene\n")
564 file.write(" //\n")
565 file.write("main_Scale_3_out_1 = \n")
566 file.write(" Scale(\n")
567 file.write(" main_Receiver_3_out_1,\n")
568 file.write(" main_Scale_3_in_2\n")
569 file.write(" ) [instance: 3, cache: 1];\n")
570 file.write(" // \n")
571 file.write(" // node AutoCamera[2]: x = 273, y = 264, inputs = 9, label = AutoCamera\n")
572 file.write(" // input[2]: defaulting = 0, visible = 1, type = 8, value = [1 -1 1]\n")
573 file.write(" // input[3]: defaulting = 1, visible = 1, type = 5, value = 500.0\n")
574 file.write(" // input[4]: defaulting = 0, visible = 0, type = 1, value = 640\n")
575 file.write(" // input[5]: defaulting = 0, visible = 0, type = 5, value = .75\n")
576 file.write(" // input[6]: defaulting = 0, visible = 0, type = 8, value = [-1 1 0 ]\n")
577 file.write(" // input[7]: defaulting = 0, visible = 0, type = 3, value = 0\n")
578 file.write(" // input[8]: defaulting = 0, visible = 0, type = 5, value = 30.0\n")
579 file.write(" // input[9]: defaulting = 0, visible = 1, type = 32, value = \"white\"\n")
580 file.write(" // page group: GreyScene\n")
581 file.write(" //\n")
582 file.write("main_AutoCamera_2_out_1 = \n")
583 file.write(" AutoCamera(\n")
584 file.write(" main_Scale_3_out_1,\n")
585 file.write(" main_AutoCamera_2_in_2,\n")
586 file.write(" main_AutoCamera_2_in_3,\n")
587 file.write(" main_AutoCamera_2_in_4,\n")
588 file.write(" main_AutoCamera_2_in_5,\n")
589 file.write(" main_AutoCamera_2_in_6,\n")
590 file.write(" main_AutoCamera_2_in_7,\n")
591 file.write(" main_AutoCamera_2_in_8,\n")
592 file.write(" main_AutoCamera_2_in_9\n")
593 file.write(" ) [instance: 2, cache: 1];\n")
594 file.write(" // \n")
595 file.write(" // node AutoAxes[2]: x = 175, y = 379, inputs = 19, label = AutoAxes\n")
596 file.write(" // input[3]: defaulting = 0, visible = 1, type = 16777248, value = %s\n" % labels)
597 file.write(" // input[4]: defaulting = 0, visible = 0, type = 1, value = 30\n")
598 file.write(" // input[5]: defaulting = 0, visible = 1, type = 16777224, value = %s\n" % corners)
599 file.write(" // input[6]: defaulting = 0, visible = 1, type = 3, value = 1\n")
600 file.write(" // input[7]: defaulting = 1, visible = 0, type = 3, value = 1\n")
601 file.write(" // input[9]: defaulting = 0, visible = 1, type = 3, value = 1\n")
602 file.write(" // input[10]: defaulting = 0, visible = 1, type = 16777224, value = {[1 1 1] [0.1 0.1 0.1] [0 0 0] [0 0 0]}\n")
603 file.write(" // input[11]: defaulting = 0, visible = 1, type = 16777248, value = {\"background\" \"grid\" \"labels\" \"ticks\"}\n")
604 file.write(" // input[12]: defaulting = 1, visible = 0, type = 5, value = 0.4\n")
605 file.write(" // input[13]: defaulting = 0, visible = 0, type = 32, value = \"area\"\n")
606 file.write(" // input[14]: defaulting = 0, visible = 1, type = 16777221, value = %s\n" % tick_locations[0])
607 file.write(" // input[15]: defaulting = 0, visible = 1, type = 16777221, value = %s\n" % tick_locations[1])
608 file.write(" // input[16]: defaulting = 0, visible = 1, type = 16777221, value = %s\n" % tick_locations[2])
609 file.write(" // input[17]: defaulting = 0, visible = 1, type = 16777248, value = %s\n" % tick_values[0])
610 file.write(" // input[18]: defaulting = 0, visible = 1, type = 16777248, value = %s\n" % tick_values[1])
611 file.write(" // input[19]: defaulting = 0, visible = 1, type = 16777248, value = %s\n" % tick_values[2])
612 file.write(" // page group: GreyScene\n")
613 file.write(" //\n")
614 file.write("main_AutoAxes_2_out_1 = \n")
615 file.write(" AutoAxes(\n")
616 file.write(" main_Scale_3_out_1,\n")
617 file.write(" main_AutoCamera_2_out_1,\n")
618 file.write(" main_AutoAxes_2_in_3,\n")
619 file.write(" main_AutoAxes_2_in_4,\n")
620 file.write(" main_AutoAxes_2_in_5,\n")
621 file.write(" main_AutoAxes_2_in_6,\n")
622 file.write(" main_AutoAxes_2_in_7,\n")
623 file.write(" main_AutoAxes_2_in_8,\n")
624 file.write(" main_AutoAxes_2_in_9,\n")
625 file.write(" main_AutoAxes_2_in_10,\n")
626 file.write(" main_AutoAxes_2_in_11,\n")
627 file.write(" main_AutoAxes_2_in_12,\n")
628 file.write(" main_AutoAxes_2_in_13,\n")
629 file.write(" main_AutoAxes_2_in_14,\n")
630 file.write(" main_AutoAxes_2_in_15,\n")
631 file.write(" main_AutoAxes_2_in_16,\n")
632 file.write(" main_AutoAxes_2_in_17,\n")
633 file.write(" main_AutoAxes_2_in_18,\n")
634 file.write(" main_AutoAxes_2_in_19\n")
635 file.write(" ) [instance: 2, cache: 1];\n")
636 file.write(" // \n")
637
638
639 if num_points == 1:
640 file.write("\n")
641 file.write(" // node Color[11]: x = 133, y = 278, inputs = 5, label = Color\n")
642 file.write(" // input[2]: defaulting = 0, visible = 1, type = 8, value = [1 0 0]\n")
643 file.write(" // input[3]: defaulting = 0, visible = 1, type = 5, value = 1.0\n")
644 file.write(" // page group: Glyph\n")
645 file.write(" //\n")
646 file.write("main_Color_11_out_1 = \n")
647 file.write(" Color(\n")
648 file.write(" main_Glyph_2_out_1,\n")
649 file.write(" main_Color_11_in_2,\n")
650 file.write(" main_Color_11_in_3,\n")
651 file.write(" main_Color_11_in_4,\n")
652 file.write(" main_Color_11_in_5\n")
653 file.write(" ) [instance: 11, cache: 1];\n")
654 file.write(" // \n")
655 file.write(" // node Transmitter[2]: x = 122, y = 386, inputs = 1, label = ColourSphere\n")
656 file.write(" // page group: Glyph\n")
657 file.write(" //\n")
658 file.write("ColourSphere = main_Color_11_out_1;\n")
659 file.write(" // \n")
660 file.write(" // node Receiver[1]: x = 179, y = 349, inputs = 1, label = ColourSphere\n")
661 file.write(" // page group: Colour Space\n")
662 file.write(" //\n")
663 file.write("main_Receiver_1_out_1[cache: 0] = ColourSphere;\n")
664
665
666 file.write("\n")
667 file.write(" // \n")
668 file.write(" // node Receiver[10]: x = 123, y = 51, inputs = 1, label = Surface4\n")
669 file.write(" // page group: Colour Space\n")
670 file.write(" //\n")
671 file.write("main_Receiver_10_out_1[cache: 0] = Surface4;\n")
672 file.write(" // \n")
673 file.write(" // node Color[12]: x = 142, y = 145, inputs = 5, label = Color\n")
674 file.write(" // input[2]: defaulting = 0, visible = 1, type = 8, value = [0 0 0.2]\n")
675 file.write(" // input[3]: defaulting = 0, visible = 1, type = 5, value = 0.3\n")
676 file.write(" // input[4]: defaulting = 1, visible = 0, type = 32, value = NULL\n")
677 file.write(" // input[5]: defaulting = 1, visible = 0, type = 3, value = NULL\n")
678 file.write(" // page group: Colour Space\n")
679 file.write(" //\n")
680 file.write("main_Color_12_out_1 = \n")
681 file.write(" Color(\n")
682 file.write(" main_Receiver_10_out_1,\n")
683 file.write(" main_Color_12_in_2,\n")
684 file.write(" main_Color_12_in_3,\n")
685 file.write(" main_Color_12_in_4,\n")
686 file.write(" main_Color_12_in_5\n")
687 file.write(" ) [instance: 12, cache: 1];\n")
688 file.write(" // \n")
689 file.write(" // node Receiver[9]: x = 227, y = 51, inputs = 1, label = Surface3\n")
690 file.write(" // page group: Colour Space\n")
691 file.write(" //\n")
692 file.write("main_Receiver_9_out_1[cache: 0] = Surface3;\n")
693 file.write(" // \n")
694 file.write(" // node Color[13]: x = 246, y = 145, inputs = 5, label = Color\n")
695 file.write(" // input[2]: defaulting = 0, visible = 1, type = 32, value = \"blue\"\n")
696 file.write(" // input[3]: defaulting = 0, visible = 1, type = 5, value = 0.3\n")
697 file.write(" // page group: Colour Space\n")
698 file.write(" //\n")
699 file.write("main_Color_13_out_1 = \n")
700 file.write(" Color(\n")
701 file.write(" main_Receiver_9_out_1,\n")
702 file.write(" main_Color_13_in_2,\n")
703 file.write(" main_Color_13_in_3,\n")
704 file.write(" main_Color_13_in_4,\n")
705 file.write(" main_Color_13_in_5\n")
706 file.write(" ) [instance: 13, cache: 1];\n")
707 file.write(" // \n")
708 file.write(" // node Collect[9]: x = 203, y = 236, inputs = 2, label = Collect\n")
709 file.write(" // page group: Colour Space\n")
710 file.write(" //\n")
711 file.write("main_Collect_9_out_1 = \n")
712 file.write(" Collect(\n")
713 file.write(" main_Color_12_out_1,\n")
714 file.write(" main_Color_13_out_1\n")
715 file.write(" ) [instance: 9, cache: 1];\n")
716 file.write(" // \n")
717 file.write(" // node Receiver[8]: x = 331, y = 51, inputs = 1, label = Surface2\n")
718 file.write(" // page group: Colour Space\n")
719 file.write(" //\n")
720 file.write("main_Receiver_8_out_1[cache: 0] = Surface2;\n")
721 file.write(" // \n")
722 file.write(" // node Color[14]: x = 350, y = 145, inputs = 5, label = Color\n")
723 file.write(" // input[2]: defaulting = 0, visible = 1, type = 8, value = [0.5 0.5 1]\n")
724 file.write(" // input[3]: defaulting = 0, visible = 1, type = 5, value = 0.2\n")
725 file.write(" // page group: Colour Space\n")
726 file.write(" //\n")
727 file.write("main_Color_14_out_1 = \n")
728 file.write(" Color(\n")
729 file.write(" main_Receiver_8_out_1,\n")
730 file.write(" main_Color_14_in_2,\n")
731 file.write(" main_Color_14_in_3,\n")
732 file.write(" main_Color_14_in_4,\n")
733 file.write(" main_Color_14_in_5\n")
734 file.write(" ) [instance: 14, cache: 1];\n")
735 file.write(" // \n")
736 file.write(" // node Receiver[7]: x = 434, y = 51, inputs = 1, label = Surface1\n")
737 file.write(" // page group: Colour Space\n")
738 file.write(" //\n")
739 file.write("main_Receiver_7_out_1[cache: 0] = Surface1;\n")
740 file.write(" // \n")
741 file.write(" // node Color[15]: x = 453, y = 145, inputs = 5, label = Color\n")
742 file.write(" // input[2]: defaulting = 0, visible = 1, type = 32, value = \"white\"\n")
743 file.write(" // input[3]: defaulting = 0, visible = 1, type = 5, value = 0.55\n")
744 file.write(" // input[4]: defaulting = 1, visible = 0, type = 32, value = \"positions\"\n")
745 file.write(" // page group: Colour Space\n")
746 file.write(" //\n")
747 file.write("main_Color_15_out_1 = \n")
748 file.write(" Color(\n")
749 file.write(" main_Receiver_7_out_1,\n")
750 file.write(" main_Color_15_in_2,\n")
751 file.write(" main_Color_15_in_3,\n")
752 file.write(" main_Color_15_in_4,\n")
753 file.write(" main_Color_15_in_5\n")
754 file.write(" ) [instance: 15, cache: 1];\n")
755 file.write(" // \n")
756 file.write(" // node Collect[10]: x = 409, y = 236, inputs = 2, label = Collect\n")
757 file.write(" // page group: Colour Space\n")
758 file.write(" //\n")
759 file.write("main_Collect_10_out_1 = \n")
760 file.write(" Collect(\n")
761 file.write(" main_Color_14_out_1,\n")
762 file.write(" main_Color_15_out_1\n")
763 file.write(" ) [instance: 10, cache: 1];\n")
764 file.write(" // \n")
765 file.write(" // node Collect[11]: x = 307, y = 327, inputs = 2, label = Collect\n")
766 file.write(" // page group: Colour Space\n")
767 file.write(" //\n")
768 file.write("main_Collect_11_out_1 = \n")
769 file.write(" Collect(\n")
770 file.write(" main_Collect_9_out_1,\n")
771 file.write(" main_Collect_10_out_1\n")
772 file.write(" ) [instance: 11, cache: 1];\n")
773 file.write(" // \n")
774
775
776 if num_points == 1:
777 file.write("\n")
778 file.write(" // node Collect[12]: x = 293, y = 431, inputs = 2, label = Collect\n")
779 file.write(" // page group: Colour Space\n")
780 file.write(" //\n")
781 file.write("main_Collect_12_out_1 = \n")
782 file.write(" Collect(\n")
783 file.write(" main_Receiver_1_out_1,\n")
784 file.write(" main_Collect_11_out_1\n")
785 file.write(" ) [instance: 12, cache: 1];\n")
786 file.write(" // \n")
787 file.write(" // node Transmitter[3]: x = 276, y = 517, inputs = 1, label = ColourSpace\n")
788
789
790 else:
791 file.write("\n")
792 file.write(" // node Transmitter[3]: x = 290, y = 440, inputs = 1, label = ColourSpace\n")
793
794
795 file.write("\n")
796 file.write(" // page group: Colour Space\n")
797 file.write(" // n")
798
799
800 if num_points == 1:
801 file.write("\n")
802 file.write("ColourSpace = main_Collect_12_out_1;\n")
803
804
805 else:
806 file.write("\n")
807 file.write("ColourSpace = main_Collect_11_out_1;\n")
808
809
810 file.write("\n")
811 file.write(" // \n")
812 file.write(" // node Receiver[4]: x = 131, y = 58, inputs = 1, label = ColourSpace\n")
813 file.write(" // page group: ColourScene\n")
814 file.write(" //\n")
815 file.write("main_Receiver_4_out_1[cache: 0] = ColourSpace;\n")
816 file.write(" // \n")
817 file.write(" // node Scale[5]: x = 163, y = 159, inputs = 2, label = Scale\n")
818 file.write(" // input[2]: defaulting = 0, visible = 1, type = 8, value = [1 1 1]\n")
819 file.write(" // page group: ColourScene\n")
820 file.write(" //\n")
821 file.write("main_Scale_5_out_1 = \n")
822 file.write(" Scale(\n")
823 file.write(" main_Receiver_4_out_1,\n")
824 file.write(" main_Scale_5_in_2\n")
825 file.write(" ) [instance: 5, cache: 1];\n")
826 file.write(" // \n")
827 file.write(" // node AutoCamera[4]: x = 273, y = 264, inputs = 9, label = AutoCamera\n")
828 file.write(" // input[2]: defaulting = 0, visible = 1, type = 8, value = [1 -1 1]\n")
829 file.write(" // input[3]: defaulting = 1, visible = 1, type = 5, value = 500.0\n")
830 file.write(" // input[5]: defaulting = 0, visible = 0, type = 5, value = .75\n")
831 file.write(" // input[6]: defaulting = 0, visible = 0, type = 8, value = [-1 1 0 ]\n")
832 file.write(" // input[7]: defaulting = 0, visible = 0, type = 3, value = 0\n")
833 file.write(" // input[8]: defaulting = 0, visible = 0, type = 5, value = 30.0\n")
834 file.write(" // input[9]: defaulting = 0, visible = 1, type = 32, value = \"black\"\n")
835 file.write(" // page group: ColourScene\n")
836 file.write(" //\n")
837 file.write("main_AutoCamera_4_out_1 = \n")
838 file.write(" AutoCamera(\n")
839 file.write(" main_Scale_5_out_1,\n")
840 file.write(" main_AutoCamera_4_in_2,\n")
841 file.write(" main_AutoCamera_4_in_3,\n")
842 file.write(" main_AutoCamera_4_in_4,\n")
843 file.write(" main_AutoCamera_4_in_5,\n")
844 file.write(" main_AutoCamera_4_in_6,\n")
845 file.write(" main_AutoCamera_4_in_7,\n")
846 file.write(" main_AutoCamera_4_in_8,\n")
847 file.write(" main_AutoCamera_4_in_9\n")
848 file.write(" ) [instance: 4, cache: 1];\n")
849 file.write(" // \n")
850 file.write(" // node AutoAxes[4]: x = 175, y = 379, inputs = 19, label = AutoAxes\n")
851 file.write(" // input[3]: defaulting = 0, visible = 1, type = 16777248, value = %s\n" % labels)
852 file.write(" // input[4]: defaulting = 0, visible = 0, type = 1, value = 30\n")
853 file.write(" // input[5]: defaulting = 0, visible = 1, type = 16777224, value = %s\n" % corners)
854 file.write(" // input[6]: defaulting = 0, visible = 1, type = 3, value = 1\n")
855 file.write(" // input[7]: defaulting = 1, visible = 0, type = 3, value = 1\n")
856 file.write(" // input[9]: defaulting = 0, visible = 1, type = 3, value = 1\n")
857 file.write(" // input[10]: defaulting = 0, visible = 1, type = 16777224, value = {[0.05 0.05 0.05] [0.3 0.3 0.3] [1 1 1] [1 1 0]}\n")
858 file.write(" // input[11]: defaulting = 0, visible = 1, type = 16777248, value = {\"background\" \"grid\" \"labels\" \"ticks\"}\n")
859 file.write(" // input[12]: defaulting = 1, visible = 0, type = 5, value = 0.4\n")
860 file.write(" // input[13]: defaulting = 0, visible = 0, type = 32, value = \"area\"\n")
861 file.write(" // input[14]: defaulting = 0, visible = 1, type = 16777221, value = %s\n" % tick_locations[0])
862 file.write(" // input[15]: defaulting = 0, visible = 1, type = 16777221, value = %s\n" % tick_locations[1])
863 file.write(" // input[16]: defaulting = 0, visible = 1, type = 16777221, value = %s\n" % tick_locations[2])
864 file.write(" // input[17]: defaulting = 0, visible = 1, type = 16777248, value = %s\n" % tick_values[0])
865 file.write(" // input[18]: defaulting = 0, visible = 1, type = 16777248, value = %s\n" % tick_values[1])
866 file.write(" // input[19]: defaulting = 0, visible = 1, type = 16777248, value = %s\n" % tick_values[2])
867 file.write(" // page group: ColourScene\n")
868 file.write(" //\n")
869 file.write("main_AutoAxes_4_out_1 = \n")
870 file.write(" AutoAxes(\n")
871 file.write(" main_Scale_5_out_1,\n")
872 file.write(" main_AutoCamera_4_out_1,\n")
873 file.write(" main_AutoAxes_4_in_3,\n")
874 file.write(" main_AutoAxes_4_in_4,\n")
875 file.write(" main_AutoAxes_4_in_5,\n")
876 file.write(" main_AutoAxes_4_in_6,\n")
877 file.write(" main_AutoAxes_4_in_7,\n")
878 file.write(" main_AutoAxes_4_in_8,\n")
879 file.write(" main_AutoAxes_4_in_9,\n")
880 file.write(" main_AutoAxes_4_in_10,\n")
881 file.write(" main_AutoAxes_4_in_11,\n")
882 file.write(" main_AutoAxes_4_in_12,\n")
883 file.write(" main_AutoAxes_4_in_13,\n")
884 file.write(" main_AutoAxes_4_in_14,\n")
885 file.write(" main_AutoAxes_4_in_15,\n")
886 file.write(" main_AutoAxes_4_in_16,\n")
887 file.write(" main_AutoAxes_4_in_17,\n")
888 file.write(" main_AutoAxes_4_in_18,\n")
889 file.write(" main_AutoAxes_4_in_19\n")
890 file.write(" ) [instance: 4, cache: 1];\n")
891 file.write(" // \n")
892 file.write(" // node Selector[1]: x = 245, y = 66, inputs = 7, label = Selector\n")
893 file.write(" // input[1]: defaulting = 0, visible = 0, type = 32, value = \"Selector_1\"\n")
894 file.write(" // input[2]: defaulting = 0, visible = 0, type = 32, value = \"Colour\" \n")
895 file.write(" // input[3]: defaulting = 0, visible = 0, type = 29, value = 1 \n")
896 file.write(" // input[4]: defaulting = 1, visible = 1, type = 16777248, value = { \"Colour\" \"Grey\" }\n")
897 file.write(" // input[5]: defaulting = 1, visible = 0, type = 16777245, value = { 1 2 }\n")
898 file.write(" // output[1]: visible = 1, type = 29, value = 1 \n")
899 file.write(" // output[2]: visible = 1, type = 32, value = \"Colour\" \n")
900 file.write(" // page group: Image\n")
901 file.write(" //\n")
902 file.write(" // \n")
903 file.write(" // node Transmitter[6]: x = 299, y = 487, inputs = 1, label = ColourImage\n")
904 file.write(" // page group: ColourScene\n")
905 file.write(" //\n")
906 file.write("ColourImage = main_AutoAxes_4_out_1;\n")
907 file.write(" // \n")
908 file.write(" // node Receiver[5]: x = 76, y = 190, inputs = 1, label = ColourImage\n")
909 file.write(" // page group: Image\n")
910 file.write(" //\n")
911 file.write("main_Receiver_5_out_1[cache: 0] = ColourImage;\n")
912 file.write(" // \n")
913 file.write(" // node Transmitter[5]: x = 305, y = 489, inputs = 1, label = GreyImage\n")
914 file.write(" // page group: GreyScene\n")
915 file.write(" //\n")
916 file.write("GreyImage = main_AutoAxes_2_out_1;\n")
917 file.write(" // \n")
918 file.write(" // node Receiver[6]: x = 199, y = 190, inputs = 1, label = GreyImage\n")
919 file.write(" // page group: Image\n")
920 file.write(" //\n")
921 file.write("main_Receiver_6_out_1[cache: 0] = GreyImage;\n")
922 file.write(" // \n")
923 file.write(" // node Switch[1]: x = 177, y = 293, inputs = 3, label = Switch\n")
924 file.write(" // page group: Image\n")
925 file.write(" //\n")
926 file.write("main_Switch_1_out_1 = \n")
927 file.write(" Switch(\n")
928 file.write(" main_Selector_1_out_1,\n")
929 file.write(" main_Receiver_5_out_1,\n")
930 file.write(" main_Receiver_6_out_1\n")
931 file.write(" ) [instance: 1, cache: 1];\n")
932 file.write(" // \n")
933 file.write(" // node Switch[14]: x = 325, y = 293, inputs = 3, label = Switch\n")
934 file.write(" // input[2]: defaulting = 0, visible = 1, type = 67108863, value = \"black\"\n")
935 file.write(" // input[3]: defaulting = 0, visible = 1, type = 67108863, value = \"white\"\n")
936 file.write(" // page group: Image\n")
937 file.write(" //\n")
938 file.write("main_Switch_14_out_1 = \n")
939 file.write(" Switch(\n")
940 file.write(" main_Selector_1_out_1,\n")
941 file.write(" main_Switch_14_in_2,\n")
942 file.write(" main_Switch_14_in_3\n")
943 file.write(" ) [instance: 14, cache: 1];\n")
944 file.write(" // \n")
945 file.write(" // node Image[3]: x = 252, y = 424, inputs = 49, label = Image\n")
946 file.write(" // input[1]: defaulting = 0, visible = 0, type = 67108863, value = \"Image_3\"\n")
947 file.write(" // input[4]: defaulting = 0, visible = 0, type = 1, value = 1\n")
948 file.write(" // input[5]: defaulting = 0, visible = 0, type = 8, value = %s\n" % image_array1)
949 file.write(" // input[6]: defaulting = 0, visible = 0, type = 8, value = %s\n" % image_array2)
950 file.write(" // input[7]: defaulting = 0, visible = 0, type = 5, value = %s\n" % image_val)
951 file.write(" // input[8]: defaulting = 0, visible = 0, type = 1, value = 1376\n")
952 file.write(" // input[9]: defaulting = 0, visible = 0, type = 5, value = 0.678\n")
953 file.write(" // input[10]: defaulting = 0, visible = 0, type = 8, value = [-0.109685 0.243133 0.963772]\n")
954 file.write(" // input[11]: defaulting = 1, visible = 0, type = 5, value = 30.9877\n")
955 file.write(" // input[12]: defaulting = 0, visible = 0, type = 1, value = 0\n")
956 file.write(" // input[14]: defaulting = 0, visible = 0, type = 1, value = 1\n")
957 file.write(" // input[15]: defaulting = 0, visible = 0, type = 32, value = \"none\"\n")
958 file.write(" // input[16]: defaulting = 0, visible = 0, type = 32, value = \"none\"\n")
959 file.write(" // input[17]: defaulting = 1, visible = 0, type = 1, value = 1\n")
960 file.write(" // input[18]: defaulting = 1, visible = 0, type = 1, value = 1\n")
961 file.write(" // input[19]: defaulting = 0, visible = 0, type = 1, value = 0\n")
962 file.write(" // input[22]: defaulting = 1, visible = 1, type = 32, value = \"black\"\n")
963 file.write(" // input[25]: defaulting = 0, visible = 0, type = 32, value = \"iso\"\n")
964 file.write(" // input[26]: defaulting = 0, visible = 0, type = 32, value = \"tiff\"\n")
965 file.write(" // input[29]: defaulting = 0, visible = 0, type = 3, value = 0\n")
966 file.write(" // input[30]: defaulting = 1, visible = 0, type = 16777248, value = %s\n" % labels)
967 file.write(" // input[32]: defaulting = 1, visible = 0, type = 16777224, value = %s\n" % corners)
968 file.write(" // input[33]: defaulting = 0, visible = 0, type = 3, value = 1\n")
969 file.write(" // input[34]: defaulting = 0, visible = 0, type = 3, value = 0\n")
970 file.write(" // input[36]: defaulting = 0, visible = 0, type = 3, value = 1\n")
971 file.write(" // input[41]: defaulting = 0, visible = 0, type = 32, value = \"rotate\"\n")
972 file.write(" // input[42]: defaulting = 0, visible = 0, type = 32, value = \"Surface\"\n")
973 file.write(" // page group: Image\n")
974 file.write(" // title: value = Surface\n")
975 file.write(" // depth: value = 24\n")
976 file.write(" // window: position = (0.0000,0.0400), size = 0.9929x0.9276\n")
977 file.write(" // internal caching: 1\n")
978 file.write(" //\n")
979 file.write("main_Image_3_out_1,\n")
980 file.write("main_Image_3_out_2,\n")
981 file.write("main_Image_3_out_3 = \n")
982 file.write(" Image(\n")
983 file.write(" main_Image_3_in_1,\n")
984 file.write(" main_Switch_1_out_1,\n")
985 file.write(" main_Image_3_in_3,\n")
986 file.write(" main_Image_3_in_4,\n")
987 file.write(" main_Image_3_in_5,\n")
988 file.write(" main_Image_3_in_6,\n")
989 file.write(" main_Image_3_in_7,\n")
990 file.write(" main_Image_3_in_8,\n")
991 file.write(" main_Image_3_in_9,\n")
992 file.write(" main_Image_3_in_10,\n")
993 file.write(" main_Image_3_in_11,\n")
994 file.write(" main_Image_3_in_12,\n")
995 file.write(" main_Image_3_in_13,\n")
996 file.write(" main_Image_3_in_14,\n")
997 file.write(" main_Image_3_in_15,\n")
998 file.write(" main_Image_3_in_16,\n")
999 file.write(" main_Image_3_in_17,\n")
1000 file.write(" main_Image_3_in_18,\n")
1001 file.write(" main_Image_3_in_19,\n")
1002 file.write(" main_Image_3_in_20,\n")
1003 file.write(" main_Image_3_in_21,\n")
1004 file.write(" main_Switch_14_out_1,\n")
1005 file.write(" main_Image_3_in_23,\n")
1006 file.write(" main_Image_3_in_24,\n")
1007 file.write(" main_Image_3_in_25,\n")
1008 file.write(" main_Image_3_in_26,\n")
1009 file.write(" main_Image_3_in_27,\n")
1010 file.write(" main_Image_3_in_28,\n")
1011 file.write(" main_Image_3_in_29,\n")
1012 file.write(" main_Image_3_in_30,\n")
1013 file.write(" main_Image_3_in_31,\n")
1014 file.write(" main_Image_3_in_32,\n")
1015 file.write(" main_Image_3_in_33,\n")
1016 file.write(" main_Image_3_in_34,\n")
1017 file.write(" main_Image_3_in_35,\n")
1018 file.write(" main_Image_3_in_36,\n")
1019 file.write(" main_Image_3_in_37,\n")
1020 file.write(" main_Image_3_in_38,\n")
1021 file.write(" main_Image_3_in_39,\n")
1022 file.write(" main_Image_3_in_40,\n")
1023 file.write(" main_Image_3_in_41,\n")
1024 file.write(" main_Image_3_in_42,\n")
1025 file.write(" main_Image_3_in_43,\n")
1026 file.write(" main_Image_3_in_44,\n")
1027 file.write(" main_Image_3_in_45,\n")
1028 file.write(" main_Image_3_in_46,\n")
1029 file.write(" main_Image_3_in_47,\n")
1030 file.write(" main_Image_3_in_48,\n")
1031 file.write(" main_Image_3_in_49\n")
1032 file.write(" ) [instance: 3, cache: 1];\n")
1033 file.write("// network: end of macro body\n")
1034 file.write("CacheScene(main_Image_3_in_1, main_Image_3_out_1, main_Image_3_out_2);\n")
1035 file.write("}\n")
1036
1037
1038 if num_points == 1:
1039 file.write("\n")
1040 file.write("main_Import_4_in_1 = \"%s.general\";\n" % point_file)
1041 file.write("main_Import_4_in_2 = NULL;\n")
1042 file.write("main_Import_4_in_3 = NULL;\n")
1043 file.write("main_Import_4_in_4 = NULL;\n")
1044 file.write("main_Import_4_in_5 = NULL;\n")
1045 file.write("main_Import_4_in_6 = NULL;\n")
1046 file.write("main_Import_4_out_1 = NULL;\n")
1047 file.write("main_Glyph_2_in_2 = \"sphere\";\n")
1048 file.write("main_Glyph_2_in_3 = NULL;\n")
1049 file.write("main_Glyph_2_in_4 = %s;\n" % sphere_size)
1050 file.write("main_Glyph_2_in_5 = 0.0;\n")
1051 file.write("main_Glyph_2_in_6 = NULL;\n")
1052 file.write("main_Glyph_2_in_7 = NULL;\n")
1053 file.write("main_Glyph_2_out_1 = NULL;\n")
1054 file.write("main_Color_10_in_2 = [0 0 0];\n")
1055 file.write("main_Color_10_in_3 = 1.0;\n")
1056 file.write("main_Color_10_in_4 = NULL;\n")
1057 file.write("main_Color_10_in_5 = NULL;\n")
1058 file.write("main_Color_10_out_1 = NULL;\n")
1059 file.write("main_Transmitter_1_out_1 = NULL;\n")
1060 file.write("main_Receiver_2_out_1 = NULL;\n")
1061
1062
1063 file.write("\n")
1064 file.write("main_Import_3_in_1 = \"%s.general\";\n" % file_prefix)
1065 file.write("main_Import_3_in_2 = NULL;\n")
1066 file.write("main_Import_3_in_3 = NULL;\n")
1067 file.write("main_Import_3_in_4 = NULL;\n")
1068 file.write("main_Import_3_in_5 = NULL;\n")
1069 file.write("main_Import_3_in_6 = NULL;\n")
1070 file.write("main_Import_3_out_1 = NULL;\n")
1071 file.write("main_Isosurface_5_in_2 = 500.0;\n")
1072 file.write("main_Isosurface_5_in_3 = NULL;\n")
1073 file.write("main_Isosurface_5_in_4 = NULL;\n")
1074 file.write("main_Isosurface_5_in_5 = NULL;\n")
1075 file.write("main_Isosurface_5_in_6 = NULL;\n")
1076 file.write("main_Isosurface_5_out_1 = NULL;\n")
1077 file.write("main_Transmitter_7_out_1 = NULL;\n")
1078 file.write("main_Receiver_14_out_1 = NULL;\n")
1079 file.write("main_Color_6_in_2 = [0 0 0];\n")
1080 file.write("main_Color_6_in_3 = 0.2;\n")
1081 file.write("main_Color_6_in_4 = NULL;\n")
1082 file.write("main_Color_6_in_5 = NULL;\n")
1083 file.write("main_Color_6_out_1 = NULL;\n")
1084 file.write("main_Isosurface_6_in_2 = 100.0;\n")
1085 file.write("main_Isosurface_6_in_3 = NULL;\n")
1086 file.write("main_Isosurface_6_in_4 = NULL;\n")
1087 file.write("main_Isosurface_6_in_5 = NULL;\n")
1088 file.write("main_Isosurface_6_in_6 = NULL;\n")
1089 file.write("main_Isosurface_6_out_1 = NULL;\n")
1090 file.write("main_Transmitter_8_out_1 = NULL;\n")
1091 file.write("main_Receiver_13_out_1 = NULL;\n")
1092 file.write("main_Color_7_in_2 = [0.2 0.2 0.2];\n")
1093 file.write("main_Color_7_in_3 = 0.4;\n")
1094 file.write("main_Color_7_in_4 = NULL;\n")
1095 file.write("main_Color_7_in_5 = NULL;\n")
1096 file.write("main_Color_7_out_1 = NULL;\n")
1097 file.write("main_Collect_5_out_1 = NULL;\n")
1098 file.write("main_Isosurface_7_in_2 = 20.0;\n")
1099 file.write("main_Isosurface_7_in_3 = NULL;\n")
1100 file.write("main_Isosurface_7_in_4 = NULL;\n")
1101 file.write("main_Isosurface_7_in_5 = NULL;\n")
1102 file.write("main_Isosurface_7_in_6 = NULL;\n")
1103 file.write("main_Isosurface_7_out_1 = NULL;\n")
1104 file.write("main_Transmitter_9_out_1 = NULL;\n")
1105 file.write("main_Receiver_12_out_1 = NULL;\n")
1106 file.write("main_Color_8_in_2 = [0.5 0.5 0.5];\n")
1107 file.write("main_Color_8_in_3 = 0.5;\n")
1108 file.write("main_Color_8_in_4 = NULL;\n")
1109 file.write("main_Color_8_in_5 = NULL;\n")
1110 file.write("main_Color_8_out_1 = NULL;\n")
1111 file.write("main_Isosurface_8_in_2 = 7.0;\n")
1112 file.write("main_Isosurface_8_in_3 = NULL;\n")
1113 file.write("main_Isosurface_8_in_4 = NULL;\n")
1114 file.write("main_Isosurface_8_in_5 = NULL;\n")
1115 file.write("main_Isosurface_8_in_6 = NULL;\n")
1116 file.write("main_Isosurface_8_out_1 = NULL;\n")
1117 file.write("main_Transmitter_10_out_1 = NULL;\n")
1118 file.write("main_Receiver_11_out_1 = NULL;\n")
1119 file.write("main_Color_9_in_2 = \"white\";\n")
1120 file.write("main_Color_9_in_3 = 0.7;\n")
1121 file.write("main_Color_9_in_4 = NULL;\n")
1122 file.write("main_Color_9_in_5 = NULL;\n")
1123 file.write("main_Color_9_out_1 = NULL;\n")
1124 file.write("main_Collect_6_out_1 = NULL;\n")
1125 file.write("main_Collect_7_out_1 = NULL;\n")
1126
1127
1128 if num_points == 1:
1129 file.write("\n")
1130 file.write("main_Collect_8_out_1 = NULL;\n")
1131
1132
1133 file.write("\n")
1134 file.write("main_Transmitter_4_out_1 = NULL;\n")
1135 file.write("main_Receiver_3_out_1 = NULL;\n")
1136 file.write("main_Scale_3_in_2 = [1 1 1];\n")
1137 file.write("main_Scale_3_out_1 = NULL;\n")
1138 file.write("main_AutoCamera_2_in_2 = [1 -1 1];\n")
1139 file.write("main_AutoCamera_2_in_3 = NULL;\n")
1140 file.write("main_AutoCamera_2_in_4 = 640;\n")
1141 file.write("main_AutoCamera_2_in_5 = .75;\n")
1142 file.write("main_AutoCamera_2_in_6 = [-1 1 0 ];\n")
1143 file.write("main_AutoCamera_2_in_7 = 0;\n")
1144 file.write("main_AutoCamera_2_in_8 = 30.0;\n")
1145 file.write("main_AutoCamera_2_in_9 = \"white\";\n")
1146 file.write("main_AutoCamera_2_out_1 = NULL;\n")
1147 file.write("main_AutoAxes_2_in_3 = %s;\n" % labels)
1148 file.write("main_AutoAxes_2_in_4 = 30;\n")
1149 file.write("main_AutoAxes_2_in_5 = %s;\n" % corners)
1150 file.write("main_AutoAxes_2_in_6 = 1;\n")
1151 file.write("main_AutoAxes_2_in_7 = NULL;\n")
1152 file.write("main_AutoAxes_2_in_8 = NULL;\n")
1153 file.write("main_AutoAxes_2_in_9 = 1;\n")
1154 file.write("main_AutoAxes_2_in_10 = {[1 1 1] [0.1 0.1 0.1] [0 0 0] [0 0 0]};\n")
1155 file.write("main_AutoAxes_2_in_11 = {\"background\" \"grid\" \"labels\" \"ticks\"};\n")
1156 file.write("main_AutoAxes_2_in_12 = NULL;\n")
1157 file.write("main_AutoAxes_2_in_13 = \"area\";\n")
1158 file.write("main_AutoAxes_2_in_14 = %s;\n" % tick_locations[0])
1159 file.write("main_AutoAxes_2_in_15 = %s;\n" % tick_locations[1])
1160 file.write("main_AutoAxes_2_in_16 = %s;\n" % tick_locations[2])
1161 file.write("main_AutoAxes_2_in_17 = %s;\n" % tick_values[0])
1162 file.write("main_AutoAxes_2_in_18 = %s;\n" % tick_values[1])
1163 file.write("main_AutoAxes_2_in_19 = %s;\n" % tick_values[2])
1164 file.write("main_AutoAxes_2_out_1 = NULL;\n")
1165
1166
1167 if num_points == 1:
1168 file.write("\n")
1169 file.write("main_Color_11_in_2 = [1 0 0];\n")
1170 file.write("main_Color_11_in_3 = 1.0;\n")
1171 file.write("main_Color_11_in_4 = NULL;\n")
1172 file.write("main_Color_11_in_5 = NULL;\n")
1173 file.write("main_Color_11_out_1 = NULL;\n")
1174 file.write("main_Transmitter_2_out_1 = NULL;\n")
1175 file.write("main_Receiver_1_out_1 = NULL;\n")
1176
1177
1178 file.write("\n")
1179 file.write("main_Receiver_10_out_1 = NULL;\n")
1180 file.write("main_Color_12_in_2 = [0 0 0.2];\n")
1181 file.write("main_Color_12_in_3 = 0.3;\n")
1182 file.write("main_Color_12_in_4 = NULL;\n")
1183 file.write("main_Color_12_in_5 = NULL;\n")
1184 file.write("main_Color_12_out_1 = NULL;\n")
1185 file.write("main_Receiver_9_out_1 = NULL;\n")
1186 file.write("main_Color_13_in_2 = \"blue\";\n")
1187 file.write("main_Color_13_in_3 = 0.3;\n")
1188 file.write("main_Color_13_in_4 = NULL;\n")
1189 file.write("main_Color_13_in_5 = NULL;\n")
1190 file.write("main_Color_13_out_1 = NULL;\n")
1191 file.write("main_Collect_9_out_1 = NULL;\n")
1192 file.write("main_Receiver_8_out_1 = NULL;\n")
1193 file.write("main_Color_14_in_2 = [0.5 0.5 1];\n")
1194 file.write("main_Color_14_in_3 = 0.2;\n")
1195 file.write("main_Color_14_in_4 = NULL;\n")
1196 file.write("main_Color_14_in_5 = NULL;\n")
1197 file.write("main_Color_14_out_1 = NULL;\n")
1198 file.write("main_Receiver_7_out_1 = NULL;\n")
1199 file.write("main_Color_15_in_2 = \"white\";\n")
1200 file.write("main_Color_15_in_3 = 0.55;\n")
1201 file.write("main_Color_15_in_4 = NULL;\n")
1202 file.write("main_Color_15_in_5 = NULL;\n")
1203 file.write("main_Color_15_out_1 = NULL;\n")
1204 file.write("main_Collect_10_out_1 = NULL;\n")
1205 file.write("main_Collect_11_out_1 = NULL;\n")
1206
1207
1208 if num_points == 1:
1209 file.write("\n")
1210 file.write("main_Collect_12_out_1 = NULL;\n")
1211
1212
1213 file.write("\n")
1214 file.write("main_Transmitter_3_out_1 = NULL;\n")
1215 file.write("main_Receiver_4_out_1 = NULL;\n")
1216 file.write("main_Scale_5_in_2 = [1 1 1];\n")
1217 file.write("main_Scale_5_out_1 = NULL;\n")
1218 file.write("main_AutoCamera_4_in_2 = [1 -1 1];\n")
1219 file.write("main_AutoCamera_4_in_3 = NULL;\n")
1220 file.write("main_AutoCamera_4_in_4 = NULL;\n")
1221 file.write("main_AutoCamera_4_in_5 = .75;\n")
1222 file.write("main_AutoCamera_4_in_6 = [-1 1 0 ];\n")
1223 file.write("main_AutoCamera_4_in_7 = 0;\n")
1224 file.write("main_AutoCamera_4_in_8 = 30.0;\n")
1225 file.write("main_AutoCamera_4_in_9 = \"black\";\n")
1226 file.write("main_AutoCamera_4_out_1 = NULL;\n")
1227 file.write("main_AutoAxes_4_in_3 = %s;\n" % labels)
1228 file.write("main_AutoAxes_4_in_4 = 30;\n")
1229 file.write("main_AutoAxes_4_in_5 = %s;\n" % corners)
1230 file.write("main_AutoAxes_4_in_6 = 1;\n")
1231 file.write("main_AutoAxes_4_in_7 = NULL;\n")
1232 file.write("main_AutoAxes_4_in_8 = NULL;\n")
1233 file.write("main_AutoAxes_4_in_9 = 1;\n")
1234 file.write("main_AutoAxes_4_in_10 = {[0.05 0.05 0.05] [0.3 0.3 0.3] [1 1 1] [1 1 0]};\n")
1235 file.write("main_AutoAxes_4_in_11 = {\"background\" \"grid\" \"labels\" \"ticks\"};\n")
1236 file.write("main_AutoAxes_4_in_12 = NULL;\n")
1237 file.write("main_AutoAxes_4_in_13 = \"area\";\n")
1238 file.write("main_AutoAxes_4_in_14 = %s;\n" % tick_locations[0])
1239 file.write("main_AutoAxes_4_in_15 = %s;\n" % tick_locations[1])
1240 file.write("main_AutoAxes_4_in_16 = %s;\n" % tick_locations[2])
1241 file.write("main_AutoAxes_4_in_17 = %s;\n" % tick_values[0])
1242 file.write("main_AutoAxes_4_in_18 = %s;\n" % tick_values[1])
1243 file.write("main_AutoAxes_4_in_19 = %s;\n" % tick_values[2])
1244 file.write("main_AutoAxes_4_out_1 = NULL;\n")
1245 file.write("main_Selector_1_in_1 = \"Selector_1\";\n")
1246 file.write("main_Selector_1_in_2 = \"Colour\" ;\n")
1247 file.write("main_Selector_1_in_3 = 1 ;\n")
1248 file.write("main_Selector_1_in_4 = NULL;\n")
1249 file.write("main_Selector_1_in_5 = NULL;\n")
1250 file.write("main_Selector_1_in_6 = NULL;\n")
1251 file.write("main_Selector_1_in_7 = NULL;\n")
1252 file.write("main_Selector_1_out_1 = 1 ;\n")
1253 file.write("main_Transmitter_6_out_1 = NULL;\n")
1254 file.write("main_Receiver_5_out_1 = NULL;\n")
1255 file.write("main_Transmitter_5_out_1 = NULL;\n")
1256 file.write("main_Receiver_6_out_1 = NULL;\n")
1257 file.write("main_Switch_1_out_1 = NULL;\n")
1258 file.write("main_Switch_14_in_2 = \"black\";\n")
1259 file.write("main_Switch_14_in_3 = \"white\";\n")
1260 file.write("main_Switch_14_out_1 = NULL;\n")
1261 file.write("macro Image(\n")
1262 file.write(" id,\n")
1263 file.write(" object,\n")
1264 file.write(" where,\n")
1265 file.write(" useVector,\n")
1266 file.write(" to,\n")
1267 file.write(" from,\n")
1268 file.write(" width,\n")
1269 file.write(" resolution,\n")
1270 file.write(" aspect,\n")
1271 file.write(" up,\n")
1272 file.write(" viewAngle,\n")
1273 file.write(" perspective,\n")
1274 file.write(" options,\n")
1275 file.write(" buttonState = 1,\n")
1276 file.write(" buttonUpApprox = \"none\",\n")
1277 file.write(" buttonDownApprox = \"none\",\n")
1278 file.write(" buttonUpDensity = 1,\n")
1279 file.write(" buttonDownDensity = 1,\n")
1280 file.write(" renderMode = 0,\n")
1281 file.write(" defaultCamera,\n")
1282 file.write(" reset,\n")
1283 file.write(" backgroundColor,\n")
1284 file.write(" throttle,\n")
1285 file.write(" RECenable = 0,\n")
1286 file.write(" RECfile,\n")
1287 file.write(" RECformat,\n")
1288 file.write(" RECresolution,\n")
1289 file.write(" RECaspect,\n")
1290 file.write(" AAenable = 0,\n")
1291 file.write(" AAlabels,\n")
1292 file.write(" AAticks,\n")
1293 file.write(" AAcorners,\n")
1294 file.write(" AAframe,\n")
1295 file.write(" AAadjust,\n")
1296 file.write(" AAcursor,\n")
1297 file.write(" AAgrid,\n")
1298 file.write(" AAcolors,\n")
1299 file.write(" AAannotation,\n")
1300 file.write(" AAlabelscale,\n")
1301 file.write(" AAfont,\n")
1302 file.write(" interactionMode,\n")
1303 file.write(" title,\n")
1304 file.write(" AAxTickLocs,\n")
1305 file.write(" AAyTickLocs,\n")
1306 file.write(" AAzTickLocs,\n")
1307 file.write(" AAxTickLabels,\n")
1308 file.write(" AAyTickLabels,\n")
1309 file.write(" AAzTickLabels,\n")
1310 file.write(" webOptions) -> (\n")
1311 file.write(" object,\n")
1312 file.write(" camera,\n")
1313 file.write(" where)\n")
1314 file.write("{\n")
1315 file.write(" ImageMessage(\n")
1316 file.write(" id,\n")
1317 file.write(" backgroundColor,\n")
1318 file.write(" throttle,\n")
1319 file.write(" RECenable,\n")
1320 file.write(" RECfile,\n")
1321 file.write(" RECformat,\n")
1322 file.write(" RECresolution,\n")
1323 file.write(" RECaspect,\n")
1324 file.write(" AAenable,\n")
1325 file.write(" AAlabels,\n")
1326 file.write(" AAticks,\n")
1327 file.write(" AAcorners,\n")
1328 file.write(" AAframe,\n")
1329 file.write(" AAadjust,\n")
1330 file.write(" AAcursor,\n")
1331 file.write(" AAgrid,\n")
1332 file.write(" AAcolors,\n")
1333 file.write(" AAannotation,\n")
1334 file.write(" AAlabelscale,\n")
1335 file.write(" AAfont,\n")
1336 file.write(" AAxTickLocs,\n")
1337 file.write(" AAyTickLocs,\n")
1338 file.write(" AAzTickLocs,\n")
1339 file.write(" AAxTickLabels,\n")
1340 file.write(" AAyTickLabels,\n")
1341 file.write(" AAzTickLabels,\n")
1342 file.write(" interactionMode,\n")
1343 file.write(" title,\n")
1344 file.write(" renderMode,\n")
1345 file.write(" buttonUpApprox,\n")
1346 file.write(" buttonDownApprox,\n")
1347 file.write(" buttonUpDensity,\n")
1348 file.write(" buttonDownDensity) [instance: 1, cache: 1];\n")
1349 file.write(" autoCamera =\n")
1350 file.write(" AutoCamera(\n")
1351 file.write(" object,\n")
1352 file.write(" \"front\",\n")
1353 file.write(" object,\n")
1354 file.write(" resolution,\n")
1355 file.write(" aspect,\n")
1356 file.write(" [0,1,0],\n")
1357 file.write(" perspective,\n")
1358 file.write(" viewAngle,\n")
1359 file.write(" backgroundColor) [instance: 1, cache: 1];\n")
1360 file.write(" realCamera =\n")
1361 file.write(" Camera(\n")
1362 file.write(" to,\n")
1363 file.write(" from,\n")
1364 file.write(" width,\n")
1365 file.write(" resolution,\n")
1366 file.write(" aspect,\n")
1367 file.write(" up,\n")
1368 file.write(" perspective,\n")
1369 file.write(" viewAngle,\n")
1370 file.write(" backgroundColor) [instance: 1, cache: 1];\n")
1371 file.write(" coloredDefaultCamera = \n")
1372 file.write(" UpdateCamera(defaultCamera,\n")
1373 file.write(" background=backgroundColor) [instance: 1, cache: 1];\n")
1374 file.write(" nullDefaultCamera =\n")
1375 file.write(" Inquire(defaultCamera,\n")
1376 file.write(" \"is null + 1\") [instance: 1, cache: 1];\n")
1377 file.write(" resetCamera =\n")
1378 file.write(" Switch(\n")
1379 file.write(" nullDefaultCamera,\n")
1380 file.write(" coloredDefaultCamera,\n")
1381 file.write(" autoCamera) [instance: 1, cache: 1];\n")
1382 file.write(" resetNull = \n")
1383 file.write(" Inquire(\n")
1384 file.write(" reset,\n")
1385 file.write(" \"is null + 1\") [instance: 2, cache: 1];\n")
1386 file.write(" reset =\n")
1387 file.write(" Switch(\n")
1388 file.write(" resetNull,\n")
1389 file.write(" reset,\n")
1390 file.write(" 0) [instance: 2, cache: 1];\n")
1391 file.write(" whichCamera =\n")
1392 file.write(" Compute(\n")
1393 file.write(" \"($0 != 0 || $1 == 0) ? 1 : 2\",\n")
1394 file.write(" reset,\n")
1395 file.write(" useVector) [instance: 1, cache: 1];\n")
1396 file.write(" camera = Switch(\n")
1397 file.write(" whichCamera,\n")
1398 file.write(" resetCamera,\n")
1399 file.write(" realCamera) [instance: 3, cache: 1];\n")
1400 file.write(" AAobject =\n")
1401 file.write(" AutoAxes(\n")
1402 file.write(" object,\n")
1403 file.write(" camera,\n")
1404 file.write(" AAlabels,\n")
1405 file.write(" AAticks,\n")
1406 file.write(" AAcorners,\n")
1407 file.write(" AAframe,\n")
1408 file.write(" AAadjust,\n")
1409 file.write(" AAcursor,\n")
1410 file.write(" AAgrid,\n")
1411 file.write(" AAcolors,\n")
1412 file.write(" AAannotation,\n")
1413 file.write(" AAlabelscale,\n")
1414 file.write(" AAfont,\n")
1415 file.write(" AAxTickLocs,\n")
1416 file.write(" AAyTickLocs,\n")
1417 file.write(" AAzTickLocs,\n")
1418 file.write(" AAxTickLabels,\n")
1419 file.write(" AAyTickLabels,\n")
1420 file.write(" AAzTickLabels) [instance: 1, cache: 1];\n")
1421 file.write(" switchAAenable = Compute(\"$0+1\",\n")
1422 file.write(" AAenable) [instance: 2, cache: 1];\n")
1423 file.write(" object = Switch(\n")
1424 file.write(" switchAAenable,\n")
1425 file.write(" object,\n")
1426 file.write(" AAobject) [instance:4, cache: 1];\n")
1427 file.write(" SWapproximation_options =\n")
1428 file.write(" Switch(\n")
1429 file.write(" buttonState,\n")
1430 file.write(" buttonUpApprox,\n")
1431 file.write(" buttonDownApprox) [instance: 5, cache: 1];\n")
1432 file.write(" SWdensity_options =\n")
1433 file.write(" Switch(\n")
1434 file.write(" buttonState,\n")
1435 file.write(" buttonUpDensity,\n")
1436 file.write(" buttonDownDensity) [instance: 6, cache: 1];\n")
1437 file.write(" HWapproximation_options =\n")
1438 file.write(" Format(\n")
1439 file.write(" \"%s,%s\",\n")
1440 file.write(" buttonDownApprox,\n")
1441 file.write(" buttonUpApprox) [instance: 1, cache: 1];\n")
1442 file.write(" HWdensity_options =\n")
1443 file.write(" Format(\n")
1444 file.write(" \"%d,%d\",\n")
1445 file.write(" buttonDownDensity,\n")
1446 file.write(" buttonUpDensity) [instance: 2, cache: 1];\n")
1447 file.write(" switchRenderMode = Compute(\n")
1448 file.write(" \"$0+1\",\n")
1449 file.write(" renderMode) [instance: 3, cache: 1];\n")
1450 file.write(" approximation_options = Switch(\n")
1451 file.write(" switchRenderMode,\n")
1452 file.write(" SWapproximation_options,\n")
1453 file.write(" HWapproximation_options) [instance: 7, cache: 1];\n")
1454 file.write(" density_options = Switch(\n")
1455 file.write(" switchRenderMode,\n")
1456 file.write(" SWdensity_options,\n")
1457 file.write(" HWdensity_options) [instance: 8, cache: 1];\n")
1458 file.write(" renderModeString = Switch(\n")
1459 file.write(" switchRenderMode,\n")
1460 file.write(" \"software\",\n")
1461 file.write(" \"hardware\")[instance: 9, cache: 1];\n")
1462 file.write(" object_tag = Inquire(\n")
1463 file.write(" object,\n")
1464 file.write(" \"object tag\")[instance: 3, cache: 1];\n")
1465 file.write(" annoted_object =\n")
1466 file.write(" Options(\n")
1467 file.write(" object,\n")
1468 file.write(" \"send boxes\",\n")
1469 file.write(" 0,\n")
1470 file.write(" \"cache\",\n")
1471 file.write(" 1,\n")
1472 file.write(" \"object tag\",\n")
1473 file.write(" object_tag,\n")
1474 file.write(" \"ddcamera\",\n")
1475 file.write(" whichCamera,\n")
1476 file.write(" \"rendering approximation\",\n")
1477 file.write(" approximation_options,\n")
1478 file.write(" \"render every\",\n")
1479 file.write(" density_options,\n")
1480 file.write(" \"button state\",\n")
1481 file.write(" buttonState,\n")
1482 file.write(" \"rendering mode\",\n")
1483 file.write(" renderModeString) [instance: 1, cache: 1];\n")
1484 file.write(" RECresNull =\n")
1485 file.write(" Inquire(\n")
1486 file.write(" RECresolution,\n")
1487 file.write(" \"is null + 1\") [instance: 4, cache: 1];\n")
1488 file.write(" ImageResolution =\n")
1489 file.write(" Inquire(\n")
1490 file.write(" camera,\n")
1491 file.write(" \"camera resolution\") [instance: 5, cache: 1];\n")
1492 file.write(" RECresolution =\n")
1493 file.write(" Switch(\n")
1494 file.write(" RECresNull,\n")
1495 file.write(" RECresolution,\n")
1496 file.write(" ImageResolution) [instance: 10, cache: 1];\n")
1497 file.write(" RECaspectNull =\n")
1498 file.write(" Inquire(\n")
1499 file.write(" RECaspect,\n")
1500 file.write(" \"is null + 1\") [instance: 6, cache: 1];\n")
1501 file.write(" ImageAspect =\n")
1502 file.write(" Inquire(\n")
1503 file.write(" camera,\n")
1504 file.write(" \"camera aspect\") [instance: 7, cache: 1];\n")
1505 file.write(" RECaspect =\n")
1506 file.write(" Switch(\n")
1507 file.write(" RECaspectNull,\n")
1508 file.write(" RECaspect,\n")
1509 file.write(" ImageAspect) [instance: 11, cache: 1];\n")
1510 file.write(" switchRECenable = Compute(\n")
1511 file.write(" \"$0 == 0 ? 1 : (($2 == $3) && ($4 == $5)) ? ($1 == 1 ? 2 : 3) : 4\",\n")
1512 file.write(" RECenable,\n")
1513 file.write(" switchRenderMode,\n")
1514 file.write(" RECresolution,\n")
1515 file.write(" ImageResolution,\n")
1516 file.write(" RECaspect,\n")
1517 file.write(" ImageAspect) [instance: 4, cache: 1];\n")
1518 file.write(" NoRECobject, RECNoRerenderObject, RECNoRerHW, RECRerenderObject = Route(switchRECenable, annoted_object);\n")
1519 file.write(" Display(\n")
1520 file.write(" NoRECobject,\n")
1521 file.write(" camera,\n")
1522 file.write(" where,\n")
1523 file.write(" throttle) [instance: 1, cache: 1];\n")
1524 file.write(" image =\n")
1525 file.write(" Render(\n")
1526 file.write(" RECNoRerenderObject,\n")
1527 file.write(" camera) [instance: 1, cache: 1];\n")
1528 file.write(" Display(\n")
1529 file.write(" image,\n")
1530 file.write(" NULL,\n")
1531 file.write(" where,\n")
1532 file.write(" throttle) [instance: 2, cache: 1];\n")
1533 file.write(" WriteImage(\n")
1534 file.write(" image,\n")
1535 file.write(" RECfile,\n")
1536 file.write(" RECformat) [instance: 1, cache: 1];\n")
1537 file.write(" rec_where = Display(\n")
1538 file.write(" RECNoRerHW,\n")
1539 file.write(" camera,\n")
1540 file.write(" where,\n")
1541 file.write(" throttle) [instance: 1, cache: 0];\n")
1542 file.write(" rec_image = ReadImageWindow(\n")
1543 file.write(" rec_where) [instance: 1, cache: 1];\n")
1544 file.write(" WriteImage(\n")
1545 file.write(" rec_image,\n")
1546 file.write(" RECfile,\n")
1547 file.write(" RECformat) [instance: 1, cache: 1];\n")
1548 file.write(" RECupdateCamera =\n")
1549 file.write(" UpdateCamera(\n")
1550 file.write(" camera,\n")
1551 file.write(" resolution=RECresolution,\n")
1552 file.write(" aspect=RECaspect) [instance: 2, cache: 1];\n")
1553 file.write(" Display(\n")
1554 file.write(" RECRerenderObject,\n")
1555 file.write(" camera,\n")
1556 file.write(" where,\n")
1557 file.write(" throttle) [instance: 1, cache: 1];\n")
1558 file.write(" RECRerenderObject =\n")
1559 file.write(" ScaleScreen(\n")
1560 file.write(" RECRerenderObject,\n")
1561 file.write(" NULL,\n")
1562 file.write(" RECresolution,\n")
1563 file.write(" camera) [instance: 1, cache: 1];\n")
1564 file.write(" image =\n")
1565 file.write(" Render(\n")
1566 file.write(" RECRerenderObject,\n")
1567 file.write(" RECupdateCamera) [instance: 2, cache: 1];\n")
1568 file.write(" WriteImage(\n")
1569 file.write(" image,\n")
1570 file.write(" RECfile,\n")
1571 file.write(" RECformat) [instance: 2, cache: 1];\n")
1572 file.write("}\n")
1573 file.write("main_Image_3_in_1 = \"Image_3\";\n")
1574 file.write("main_Image_3_in_3 = \"X24,,Surface\";\n")
1575 file.write("main_Image_3_in_4 = 1;\n")
1576 file.write("main_Image_3_in_5 = %s;\n" % image_array1)
1577 file.write("main_Image_3_in_6 = %s;\n" % image_array2)
1578 file.write("main_Image_3_in_7 = %s;\n" % image_val)
1579 file.write("main_Image_3_in_8 = 1376;\n")
1580 file.write("main_Image_3_in_9 = 0.678;\n")
1581 file.write("main_Image_3_in_10 = [-0.109685 0.243133 0.963772];\n")
1582 file.write("main_Image_3_in_11 = NULL;\n")
1583 file.write("main_Image_3_in_12 = 0;\n")
1584 file.write("main_Image_3_in_13 = NULL;\n")
1585 file.write("main_Image_3_in_14 = 1;\n")
1586 file.write("main_Image_3_in_15 = \"none\";\n")
1587 file.write("main_Image_3_in_16 = \"none\";\n")
1588 file.write("main_Image_3_in_17 = NULL;\n")
1589 file.write("main_Image_3_in_18 = NULL;\n")
1590 file.write("main_Image_3_in_19 = 0;\n")
1591 file.write("main_Image_3_in_20 = NULL;\n")
1592 file.write("main_Image_3_in_21 = NULL;\n")
1593 file.write("main_Image_3_in_23 = NULL;\n")
1594 file.write("main_Image_3_in_25 = \"iso\";\n")
1595 file.write("main_Image_3_in_26 = \"tiff\";\n")
1596 file.write("main_Image_3_in_27 = NULL;\n")
1597 file.write("main_Image_3_in_28 = NULL;\n")
1598 file.write("main_Image_3_in_29 = 0;\n")
1599 file.write("main_Image_3_in_30 = NULL;\n")
1600 file.write("main_Image_3_in_31 = NULL;\n")
1601 file.write("main_Image_3_in_32 = NULL;\n")
1602 file.write("main_Image_3_in_33 = 1;\n")
1603 file.write("main_Image_3_in_34 = 0;\n")
1604 file.write("main_Image_3_in_35 = NULL;\n")
1605 file.write("main_Image_3_in_36 = 1;\n")
1606 file.write("main_Image_3_in_37 = NULL;\n")
1607 file.write("main_Image_3_in_38 = NULL;\n")
1608 file.write("main_Image_3_in_39 = NULL;\n")
1609 file.write("main_Image_3_in_40 = NULL;\n")
1610 file.write("main_Image_3_in_41 = \"rotate\";\n")
1611 file.write("main_Image_3_in_42 = \"Surface\";\n")
1612 file.write("main_Image_3_in_43 = NULL;\n")
1613 file.write("main_Image_3_in_44 = NULL;\n")
1614 file.write("main_Image_3_in_45 = NULL;\n")
1615 file.write("main_Image_3_in_46 = NULL;\n")
1616 file.write("main_Image_3_in_47 = NULL;\n")
1617 file.write("main_Image_3_in_48 = NULL;\n")
1618 file.write("main_Image_3_in_49 = NULL;\n")
1619 file.write("Executive(\"product version 4 3 2\");\n")
1620 file.write("$sync\n")
1621 file.write("main();\n")
1622
1623
1624 file.close()
1625