ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/do_options.tcl
Revision: 2.1
Committed: Thu Oct 27 15:56:07 1994 UTC (29 years, 11 months ago) by greg
Content type: application/x-tcl
Branch: MAIN
Log Message:
Initial revision

File Contents

# Content
1 # SCCSid "$SunId$ LBL"
2 #
3 # Options screen for trad
4 #
5
6 proc amb_delete {} { # delete ambient file
7 global radvar curmess
8 if {"$radvar(AMBFILE)" == {} || ! [file exists $radvar(AMBFILE)]} {
9 set curmess {No ambient file.}
10 return
11 }
12 set hl [string length [exec getinfo < $radvar(AMBFILE)]]
13 set fl [file size $radvar(AMBFILE)]
14 set nv [expr ($fl - $hl - 3) / 75]
15 if {$nv && [tk_dialog .dlg {Verification} \
16 "Really delete ambient file $radvar(AMBFILE)\
17 with $nv indirect irradiances values?" \
18 questhead 1 {Delete} {Cancel}]} {
19 return 0
20 }
21 if [catch {exec rm $radvar(AMBFILE) < /dev/null} curmess] {return 0}
22 set curmess {Ambient file deleted.}
23 return 1
24 }
25
26 proc copyopts rf { # copy option settings from another RIF
27 load_vars [file tail $rf] {QUALITY PENUMBRAS AMBFILE OPTFILE REPORT \
28 oconv mkillum render pfilt}
29 }
30
31 proc do_options w { # Set up options screen
32 global radvar rifname
33 if {"$w" == "done"} {
34 return
35 }
36 frame $w
37 # Quality
38 label $w.qual -text Quality:
39 place $w.qual -relx .0714 -rely .0610
40 radiobutton $w.quaH -text High -anchor w -relief flat \
41 -variable radvar(QUALITY) -value High
42 place $w.quaH -relx .2857 -rely .0610
43 radiobutton $w.quaM -text Medium -anchor w -relief flat \
44 -variable radvar(QUALITY) -value Medium
45 place $w.quaM -relx .5357 -rely .0610
46 radiobutton $w.quaL -text Low -anchor w -relief flat \
47 -variable radvar(QUALITY) -value Low
48 place $w.quaL -relx .7857 -rely .0610
49 helplink "$w.quaH $w.quaM $w.quaL" trad options quality
50 # Penumbras
51 label $w.penl -text Penumbras:
52 place $w.penl -relx .0714 -rely .1585
53 radiobutton $w.penT -text On -anchor w -relief flat \
54 -variable radvar(PENUMBRAS) -value True
55 place $w.penT -relx .2857 -rely .1585
56 radiobutton $w.penF -text Off -anchor w -relief flat \
57 -variable radvar(PENUMBRAS) -value False
58 place $w.penF -relx .5357 -rely .1585
59 helplink "$w.penT $w.penF" trad options penumbras
60 # Ambfile
61 label $w.ambl -text Ambfile:
62 place $w.ambl -relx .0714 -rely .2805
63 entry $w.ambe -textvariable radvar(AMBFILE) -relief sunken
64 place $w.ambe -relwidth .5714 -relheight .0610 -relx .2857 -rely .2805
65 helplink $w.ambe trad options ambfile
66 button $w.ambd -text Delete -relief raised -command amb_delete
67 place $w.ambd -relwidth .1071 -relheight .0610 -relx .98 -rely .2805 \
68 -anchor ne
69 helplink $w.ambd trad options ambdelete
70 # Optfile
71 label $w.optl -text Optfile:
72 place $w.optl -relx .0714 -rely .4024
73 entry $w.opte -textvariable radvar(OPTFILE) -relief sunken
74 place $w.opte -relwidth .5714 -relheight .0610 -relx .2857 -rely .4024
75 helplink $w.opte trad options optfile
76 # Report
77 label $w.repl -text Report:
78 place $w.repl -relx .0714 -rely .5244
79 entry $w.repe -textvariable radvar(REPORT) -relief sunken
80 place $w.repe -relwidth .5714 -relheight .0610 -relx .2857 -rely .5244
81 helplink $w.repe trad options report
82 # Oconv options
83 label $w.ocol -text "oconv opts:"
84 place $w.ocol -relx .0714 -rely .6463
85 entry $w.ocoe -textvariable radvar(oconv) -relief sunken
86 place $w.ocoe -relwidth .5714 -relheight .0600 -relx .2857 -rely .6463
87 helplink $w.ocoe trad options oconv
88 # Mkillum options
89 label $w.mkil -text "mkillum opts:"
90 place $w.mkil -relx .0714 -rely .7073
91 entry $w.mkie -textvariable radvar(mkillum) -relief sunken
92 place $w.mkie -relwidth .5714 -relheight .0600 -relx .2857 -rely .7073
93 helplink $w.mkie trad options mkillum
94 # Render options
95 label $w.renl -text "render opts:"
96 place $w.renl -relx .0714 -rely .7683
97 entry $w.rene -textvariable radvar(render) -relief sunken
98 place $w.rene -relwidth .5714 -relheight .0600 -relx .2857 -rely .7683
99 helplink $w.rene trad options render
100 # Pfilt options
101 label $w.pfil -text "pfilt opts:"
102 place $w.pfil -relx .0714 -rely .8293
103 entry $w.pfie -textvariable radvar(pfilt) -relief sunken
104 place $w.pfie -relwidth .5714 -relheight .0600 -relx .2857 -rely .8293
105 helplink $w.pfie trad options pfilt
106 # Revert and Copy buttons
107 button $w.revert -text Revert -relief raised \
108 -command "copyopts $rifname"
109 place $w.revert -relwidth .1071 -relheight .0610 -relx .98 -rely .98 \
110 -anchor se
111 helplink $w.revert trad options revert
112 button $w.copy -text Copy -relief raised -command {getfile \
113 -send copyopts -view view_txt -glob $rif_glob}
114 place $w.copy -relwidth .1071 -relheight .0610 -relx .98 -rely .90 \
115 -anchor se
116 helplink $w.copy trad options copy
117 # Set focus
118 focus $w.ambe
119 bind $w.ambe <Return> "focus $w.opte"
120 bind $w.opte <Return> "focus $w.repe"
121 bind $w.repe <Return> "focus $w.ocoe"
122 bind $w.ocoe <Return> "focus $w.mkie"
123 bind $w.mkie <Return> "focus $w.rene"
124 bind $w.rene <Return> "focus $w.pfie"
125 bind $w.pfie <Return> {}
126 }