iexciting-0.9.224
[exciting.git] / examples / diamond-rho3D / rho3d.net
blob64b41aeb549d421a892d021d889aefb5220c72b8
1 //
2 // time: Fri Sep 26 23:37:42 2008
3 //
4 // version: 3.2.0 (format), 4.4.0 (DX)
5 //
6 //
7 // MODULE main
8 // workspace: width = 298, height = 472
9 // layout: snap = 0, width = 50, height = 50, align = NN
11 macro main(
12 ) -> (
13 ) {
14     // 
15     // node Import[1]: x = 56, y = 47, inputs = 6, label = Import
16     // input[1]: defaulting = 0, visible = 1, type = 32, value = "rho3d.general"
17     //
18 main_Import_1_out_1 = 
19     Import(
20     main_Import_1_in_1,
21     main_Import_1_in_2,
22     main_Import_1_in_3,
23     main_Import_1_in_4,
24     main_Import_1_in_5,
25     main_Import_1_in_6
26     ) [instance: 1, cache: 1];
27     // 
28     // node Isosurface[2]: x = 220, y = 121, inputs = 6, label = Isosurface
29     // input[2]: defaulting = 0, visible = 1, type = 5, value = 0.04
30     //
31 main_Isosurface_2_out_1 = 
32     Isosurface(
33     main_Import_1_out_1,
34     main_Isosurface_2_in_2,
35     main_Isosurface_2_in_3,
36     main_Isosurface_2_in_4,
37     main_Isosurface_2_in_5,
38     main_Isosurface_2_in_6
39     ) [instance: 2, cache: 1];
40     // 
41     // node Color[1]: x = 72, y = 232, inputs = 5, label = Color
42     // input[2]: defaulting = 0, visible = 1, type = 32, value = "white"
43     // input[4]: defaulting = 0, visible = 0, type = 32, value = "front colors"
44     //
45 main_Color_1_out_1 = 
46     Color(
47     main_Isosurface_2_out_1,
48     main_Color_1_in_2,
49     main_Color_1_in_3,
50     main_Color_1_in_4,
51     main_Color_1_in_5
52     ) [instance: 1, cache: 1];
53     // 
54     // node Color[2]: x = 69, y = 316, inputs = 5, label = Color
55     // input[2]: defaulting = 0, visible = 1, type = 32, value = "orange"
56     // input[4]: defaulting = 0, visible = 0, type = 32, value = "back colors"
57     //
58 main_Color_2_out_1 = 
59     Color(
60     main_Color_1_out_1,
61     main_Color_2_in_2,
62     main_Color_2_in_3,
63     main_Color_2_in_4,
64     main_Color_2_in_5
65     ) [instance: 2, cache: 1];
66     // 
67     // node Image[4]: x = 223, y = 410, inputs = 49, label = Image
68     // input[1]: defaulting = 0, visible = 0, type = 32, value = "Image_4"
69     // input[4]: defaulting = 0, visible = 0, type = 1, value = 1
70     // input[5]: defaulting = 0, visible = 0, type = 8, value = [7.29024 7.29024 7.29024]
71     // input[6]: defaulting = 0, visible = 0, type = 8, value = [-4.66221 51.8696 -4.66221]
72     // input[7]: defaulting = 0, visible = 0, type = 5, value = 21.0859
73     // input[8]: defaulting = 0, visible = 0, type = 1, value = 640
74     // input[9]: defaulting = 0, visible = 0, type = 5, value = 0.75
75     // input[10]: defaulting = 0, visible = 0, type = 8, value = [0 0 -1]
76     // input[11]: defaulting = 1, visible = 0, type = 5, value = 24.9389
77     // input[12]: defaulting = 0, visible = 0, type = 1, value = 0
78     // input[14]: defaulting = 0, visible = 0, type = 1, value = 1
79     // input[15]: defaulting = 1, visible = 0, type = 32, value = "none"
80     // input[16]: defaulting = 1, visible = 0, type = 32, value = "none"
81     // input[17]: defaulting = 1, visible = 0, type = 1, value = 1
82     // input[18]: defaulting = 1, visible = 0, type = 1, value = 1
83     // input[19]: defaulting = 0, visible = 0, type = 1, value = 0
84     // input[29]: defaulting = 1, visible = 0, type = 3, value = 0
85     // input[41]: defaulting = 0, visible = 0, type = 32, value = "zoom"
86     // depth: value = 24
87     // window: position = (0.0104,0.0600), size = 0.4542x0.5800, screen = 0
88     // internal caching: 1
89     //
90 main_Image_4_out_1,
91 main_Image_4_out_2,
92 main_Image_4_out_3 = 
93     Image(
94     main_Image_4_in_1,
95     main_Color_2_out_1,
96     main_Image_4_in_3,
97     main_Image_4_in_4,
98     main_Image_4_in_5,
99     main_Image_4_in_6,
100     main_Image_4_in_7,
101     main_Image_4_in_8,
102     main_Image_4_in_9,
103     main_Image_4_in_10,
104     main_Image_4_in_11,
105     main_Image_4_in_12,
106     main_Image_4_in_13,
107     main_Image_4_in_14,
108     main_Image_4_in_15,
109     main_Image_4_in_16,
110     main_Image_4_in_17,
111     main_Image_4_in_18,
112     main_Image_4_in_19,
113     main_Image_4_in_20,
114     main_Image_4_in_21,
115     main_Image_4_in_22,
116     main_Image_4_in_23,
117     main_Image_4_in_24,
118     main_Image_4_in_25,
119     main_Image_4_in_26,
120     main_Image_4_in_27,
121     main_Image_4_in_28,
122     main_Image_4_in_29,
123     main_Image_4_in_30,
124     main_Image_4_in_31,
125     main_Image_4_in_32,
126     main_Image_4_in_33,
127     main_Image_4_in_34,
128     main_Image_4_in_35,
129     main_Image_4_in_36,
130     main_Image_4_in_37,
131     main_Image_4_in_38,
132     main_Image_4_in_39,
133     main_Image_4_in_40,
134     main_Image_4_in_41,
135     main_Image_4_in_42,
136     main_Image_4_in_43,
137     main_Image_4_in_44,
138     main_Image_4_in_45,
139     main_Image_4_in_46,
140     main_Image_4_in_47,
141     main_Image_4_in_48,
142     main_Image_4_in_49
143     ) [instance: 4, cache: 1];
144 // network: end of macro body
145 CacheScene(main_Image_4_in_1, main_Image_4_out_1, main_Image_4_out_2);
147 main_Import_1_in_1 = "rho3d.general";
148 main_Import_1_in_2 = NULL;
149 main_Import_1_in_3 = NULL;
150 main_Import_1_in_4 = NULL;
151 main_Import_1_in_5 = NULL;
152 main_Import_1_in_6 = NULL;
153 main_Import_1_out_1 = NULL;
154 main_Isosurface_2_in_2 = 0.04;
155 main_Isosurface_2_in_3 = NULL;
156 main_Isosurface_2_in_4 = NULL;
157 main_Isosurface_2_in_5 = NULL;
158 main_Isosurface_2_in_6 = NULL;
159 main_Isosurface_2_out_1 = NULL;
160 main_Color_1_in_2 = "white";
161 main_Color_1_in_3 = NULL;
162 main_Color_1_in_4 = "front colors";
163 main_Color_1_in_5 = NULL;
164 main_Color_1_out_1 = NULL;
165 main_Color_2_in_2 = "orange";
166 main_Color_2_in_3 = NULL;
167 main_Color_2_in_4 = "back colors";
168 main_Color_2_in_5 = NULL;
169 main_Color_2_out_1 = NULL;
170 macro Image(
171         id,
172         object,
173         where,
174         useVector,
175         to,
176         from,
177         width,
178         resolution,
179         aspect,
180         up,
181         viewAngle,
182         perspective,
183         options,
184         buttonState = 1,
185         buttonUpApprox = "none",
186         buttonDownApprox = "none",
187         buttonUpDensity = 1,
188         buttonDownDensity = 1,
189         renderMode = 0,
190         defaultCamera,
191         reset,
192         backgroundColor,
193         throttle,
194         RECenable = 0,
195         RECfile,
196         RECformat,
197         RECresolution,
198         RECaspect,
199         AAenable = 0,
200         AAlabels,
201         AAticks,
202         AAcorners,
203         AAframe,
204         AAadjust,
205         AAcursor,
206         AAgrid,
207         AAcolors,
208         AAannotation,
209         AAlabelscale,
210         AAfont,
211         interactionMode,
212         title,
213         AAxTickLocs,
214         AAyTickLocs,
215         AAzTickLocs,
216         AAxTickLabels,
217         AAyTickLabels,
218         AAzTickLabels,
219         webOptions) -> (
220         object,
221         camera,
222         where)
224     ImageMessage(
225         id,
226         backgroundColor,
227         throttle,
228         RECenable,
229         RECfile,
230         RECformat,
231         RECresolution,
232         RECaspect,
233         AAenable,
234         AAlabels,
235         AAticks,
236         AAcorners,
237         AAframe,
238         AAadjust,
239         AAcursor,
240         AAgrid,
241         AAcolors,
242         AAannotation,
243         AAlabelscale,
244         AAfont,
245         AAxTickLocs,
246         AAyTickLocs,
247         AAzTickLocs,
248         AAxTickLabels,
249         AAyTickLabels,
250         AAzTickLabels,
251         interactionMode,
252         title,
253         renderMode,
254         buttonUpApprox,
255         buttonDownApprox,
256         buttonUpDensity,
257         buttonDownDensity) [instance: 1, cache: 1];
258     autoCamera =
259         AutoCamera(
260             object,
261             "front",
262             object,
263             resolution,
264             aspect,
265             [0,1,0],
266             perspective,
267             viewAngle,
268             backgroundColor) [instance: 1, cache: 1];
269     realCamera =
270         Camera(
271             to,
272             from,
273             width,
274             resolution,
275             aspect,
276             up,
277             perspective,
278             viewAngle,
279             backgroundColor) [instance: 1, cache: 1];
280     coloredDefaultCamera = 
281          UpdateCamera(defaultCamera,
282             background=backgroundColor) [instance: 1, cache: 1];
283     nullDefaultCamera =
284         Inquire(defaultCamera,
285             "is null + 1") [instance: 1, cache: 1];
286     resetCamera =
287         Switch(
288             nullDefaultCamera,
289             coloredDefaultCamera,
290             autoCamera) [instance: 1, cache: 1];
291     resetNull = 
292         Inquire(
293             reset,
294             "is null + 1") [instance: 2, cache: 1];
295     reset =
296         Switch(
297             resetNull,
298             reset,
299             0) [instance: 2, cache: 1];
300     whichCamera =
301         Compute(
302             "($0 != 0 || $1 == 0) ? 1 : 2",
303             reset,
304             useVector) [instance: 1, cache: 1];
305     camera = Switch(
306             whichCamera,
307             resetCamera,
308             realCamera) [instance: 3, cache: 1];
309     AAobject =
310         AutoAxes(
311             object,
312             camera,
313             AAlabels,
314             AAticks,
315             AAcorners,
316             AAframe,
317             AAadjust,
318             AAcursor,
319             AAgrid,
320             AAcolors,
321             AAannotation,
322             AAlabelscale,
323             AAfont,
324             AAxTickLocs,
325             AAyTickLocs,
326             AAzTickLocs,
327             AAxTickLabels,
328             AAyTickLabels,
329             AAzTickLabels) [instance: 1, cache: 1];
330     switchAAenable = Compute("$0+1",
331              AAenable) [instance: 2, cache: 1];
332     object = Switch(
333              switchAAenable,
334              object,
335              AAobject) [instance:4, cache: 1];
336     SWapproximation_options =
337         Switch(
338             buttonState,
339             buttonUpApprox,
340             buttonDownApprox) [instance: 5, cache: 1];
341     SWdensity_options =
342         Switch(
343             buttonState,
344             buttonUpDensity,
345             buttonDownDensity) [instance: 6, cache: 1];
346     HWapproximation_options =
347         Format(
348             "%s,%s",
349             buttonDownApprox,
350             buttonUpApprox) [instance: 1, cache: 1];
351     HWdensity_options =
352         Format(
353             "%d,%d",
354             buttonDownDensity,
355             buttonUpDensity) [instance: 2, cache: 1];
356     switchRenderMode = Compute(
357              "$0+1",
358              renderMode) [instance: 3, cache: 1];
359     approximation_options = Switch(
360              switchRenderMode,
361             SWapproximation_options,
362              HWapproximation_options) [instance: 7, cache: 1];
363     density_options = Switch(
364              switchRenderMode,
365             SWdensity_options,
366             HWdensity_options) [instance: 8, cache: 1];
367     renderModeString = Switch(
368             switchRenderMode,
369             "software",
370             "hardware")[instance: 9, cache: 1];
371     object_tag = Inquire(
372             object,
373             "object tag")[instance: 3, cache: 1];
374     annoted_object =
375         Options(
376             object,
377             "send boxes",
378             0,
379             "cache",
380             1,
381             "object tag",
382             object_tag,
383             "ddcamera",
384             whichCamera,
385             "rendering approximation",
386             approximation_options,
387             "render every",
388             density_options,
389             "button state",
390             buttonState,
391             "rendering mode",
392             renderModeString) [instance: 1, cache: 1];
393     RECresNull =
394         Inquire(
395             RECresolution,
396             "is null + 1") [instance: 4, cache: 1];
397     ImageResolution =
398         Inquire(
399             camera,
400             "camera resolution") [instance: 5, cache: 1];
401     RECresolution =
402         Switch(
403             RECresNull,
404             RECresolution,
405             ImageResolution) [instance: 10, cache: 1];
406     RECaspectNull =
407         Inquire(
408             RECaspect,
409             "is null + 1") [instance: 6, cache: 1];
410     ImageAspect =
411         Inquire(
412             camera,
413             "camera aspect") [instance: 7, cache: 1];
414     RECaspect =
415         Switch(
416             RECaspectNull,
417             RECaspect,
418             ImageAspect) [instance: 11, cache: 1];
419     switchRECenable = Compute(
420           "$0 == 0 ? 1 : (($2 == $3) && ($4 == $5)) ? ($1 == 1 ? 2 : 3) : 4",
421             RECenable,
422             switchRenderMode,
423             RECresolution,
424             ImageResolution,
425             RECaspect,
426              ImageAspect) [instance: 4, cache: 1];
427     NoRECobject, RECNoRerenderObject, RECNoRerHW, RECRerenderObject = Route(switchRECenable, annoted_object);
428     Display(
429         NoRECobject,
430         camera,
431         where,
432         throttle) [instance: 1, cache: 1];
433     image =
434         Render(
435             RECNoRerenderObject,
436             camera) [instance: 1, cache: 1];
437     Display(
438         image,
439         NULL,
440         where,
441         throttle) [instance: 2, cache: 1];
442     WriteImage(
443         image,
444         RECfile,
445         RECformat) [instance: 1, cache: 1];
446     rec_where = Display(
447         RECNoRerHW,
448         camera,
449         where,
450         throttle) [instance: 1, cache: 0];
451     rec_image = ReadImageWindow(
452         rec_where) [instance: 1, cache: 1];
453     WriteImage(
454         rec_image,
455         RECfile,
456         RECformat) [instance: 1, cache: 1];
457     RECupdateCamera =
458         UpdateCamera(
459             camera,
460             resolution=RECresolution,
461             aspect=RECaspect) [instance: 2, cache: 1];
462     Display(
463         RECRerenderObject,
464         camera,
465         where,
466         throttle) [instance: 1, cache: 1];
467     RECRerenderObject =
468         ScaleScreen(
469             RECRerenderObject,
470             NULL,
471             RECresolution,
472             camera) [instance: 1, cache: 1];
473     image =
474         Render(
475             RECRerenderObject,
476             RECupdateCamera) [instance: 2, cache: 1];
477     WriteImage(
478         image,
479         RECfile,
480         RECformat) [instance: 2, cache: 1];
482 main_Image_4_in_1 = "Image_4";
483 main_Image_4_in_3 = "X24,,";
484 main_Image_4_in_4 = 1;
485 main_Image_4_in_5 = [7.29024 7.29024 7.29024];
486 main_Image_4_in_6 = [-4.66221 51.8696 -4.66221];
487 main_Image_4_in_7 = 21.0859;
488 main_Image_4_in_8 = 640;
489 main_Image_4_in_9 = 0.75;
490 main_Image_4_in_10 = [0 0 -1];
491 main_Image_4_in_11 = NULL;
492 main_Image_4_in_12 = 0;
493 main_Image_4_in_13 = NULL;
494 main_Image_4_in_14 = 1;
495 main_Image_4_in_15 = NULL;
496 main_Image_4_in_16 = NULL;
497 main_Image_4_in_17 = NULL;
498 main_Image_4_in_18 = NULL;
499 main_Image_4_in_19 = 0;
500 main_Image_4_in_20 = NULL;
501 main_Image_4_in_21 = NULL;
502 main_Image_4_in_22 = NULL;
503 main_Image_4_in_23 = NULL;
504 main_Image_4_in_25 = NULL;
505 main_Image_4_in_26 = NULL;
506 main_Image_4_in_27 = NULL;
507 main_Image_4_in_28 = NULL;
508 main_Image_4_in_29 = NULL;
509 main_Image_4_in_30 = NULL;
510 main_Image_4_in_31 = NULL;
511 main_Image_4_in_32 = NULL;
512 main_Image_4_in_33 = NULL;
513 main_Image_4_in_34 = NULL;
514 main_Image_4_in_35 = NULL;
515 main_Image_4_in_36 = NULL;
516 main_Image_4_in_37 = NULL;
517 main_Image_4_in_38 = NULL;
518 main_Image_4_in_39 = NULL;
519 main_Image_4_in_40 = NULL;
520 main_Image_4_in_41 = "zoom";
521 main_Image_4_in_42 = NULL;
522 main_Image_4_in_43 = NULL;
523 main_Image_4_in_44 = NULL;
524 main_Image_4_in_45 = NULL;
525 main_Image_4_in_46 = NULL;
526 main_Image_4_in_47 = NULL;
527 main_Image_4_in_48 = NULL;
528 main_Image_4_in_49 = NULL;
529 Executive("product version 4 4 0");
530 $sync
531 main();