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

File Contents

# Content
1 # SCCSid "$SunId$ LBL"
2 #
3 # Create ZONE screen
4 #
5
6 proc zonechange {nm el op} { # record change in ZONE
7 global radvar zonevar
8 if {"$nm" == "radvar"} {
9 if {"$op" == "u"} {
10 set radvar(ZONE) {}
11 trace variable radvar(ZONE) wu zonechange
12 }
13 trace vdelete zonevar w zonechange
14 if {"$radvar(ZONE)" == {}} {
15 set zonevar(IE) Interior
16 set zonevar(xmin) {}
17 set zonevar(xmax) {}
18 set zonevar(ymin) {}
19 set zonevar(ymax) {}
20 set zonevar(zmin) {}
21 set zonevar(zmax) {}
22 } elseif {[llength $radvar(ZONE)] == 7} {
23 if [string match {[Ii]*} $radvar(ZONE)] {
24 set zonevar(IE) Interior
25 } else {
26 set zonevar(IE) Exterior
27 }
28 set zonevar(xmin) [lindex $radvar(ZONE) 1]
29 set zonevar(xmax) [lindex $radvar(ZONE) 2]
30 set zonevar(ymin) [lindex $radvar(ZONE) 3]
31 set zonevar(ymax) [lindex $radvar(ZONE) 4]
32 set zonevar(zmin) [lindex $radvar(ZONE) 5]
33 set zonevar(zmax) [lindex $radvar(ZONE) 6]
34 }
35 trace variable zonevar w zonechange
36 return
37 }
38 trace vdelete radvar(ZONE) wu zonechange
39 set radvar(ZONE) "$zonevar(IE) $zonevar(xmin) $zonevar(xmax) $zonevar(ymin) $zonevar(ymax) $zonevar(zmin) $zonevar(zmax)"
40 trace variable radvar(ZONE) wu zonechange
41 }
42
43 proc indscale v { # set indirect value
44 global radvar
45 set radvar(INDIRECT) $v
46 }
47
48 proc copyzone rf { # copy ZONE settings from another RIF
49 load_vars [file tail $rf] {ZONE DETAIL INDIRECT VARIABILITY EXPOSURE}
50 }
51
52 proc do_zone w { # set up ZONE screen
53 global radvar zonevar rifname rif_glob
54 if {"$w" == "done"} {
55 trace vdelete radvar(ZONE) wu zonechange
56 trace vdelete zonevar w zonechange
57 unset zonevar
58 return
59 }
60 frame $w
61 # Zone fields
62 label $w.zol -text ZONE
63 place $w.zol -relx .0714 -rely .0610
64 radiobutton $w.zi -text Interior -anchor w -relief flat \
65 -variable zonevar(IE) -value Interior
66 place $w.zi -relx .2857 -rely .0610
67 radiobutton $w.ze -text Exterior -anchor w -relief flat \
68 -variable zonevar(IE) -value Exterior
69 place $w.ze -relx .5714 -rely .0610
70 helplink "$w.zi $w.ze" trad zone type
71 label $w.maxl -text Maximum
72 place $w.maxl -relx .0714 -rely .1829
73 label $w.minl -text Minimum
74 place $w.minl -relx .0714 -rely .3049
75 label $w.xl -text X:
76 place $w.xl -relx .2500 -rely .2439
77 entry $w.xmax -textvariable zonevar(xmax) -relief sunken
78 place $w.xmax -relwidth .1786 -relheight .0610 -relx .2857 -rely .1829
79 entry $w.xmin -textvariable zonevar(xmin) -relief sunken
80 place $w.xmin -relwidth .1786 -relheight .0610 -relx .2857 -rely .3049
81 label $w.yl -text Y:
82 place $w.yl -relx .5000 -rely .2439
83 entry $w.ymax -textvariable zonevar(ymax) -relief sunken
84 place $w.ymax -relwidth .1786 -relheight .0610 -relx .5357 -rely .1829
85 entry $w.ymin -textvariable zonevar(ymin) -relief sunken
86 place $w.ymin -relwidth .1786 -relheight .0610 -relx .5357 -rely .3049
87 label $w.zl -text Z:
88 place $w.zl -relx .7500 -rely .2439
89 entry $w.zmax -textvariable zonevar(zmax) -relief sunken
90 place $w.zmax -relwidth .1786 -relheight .0610 -relx .7857 -rely .1829
91 entry $w.zmin -textvariable zonevar(zmin) -relief sunken
92 place $w.zmin -relwidth .1786 -relheight .0610 -relx .7857 -rely .3049
93 helplink "$w.xmin $w.xmax $w.ymin $w.ymax $w.zmin $w.zmax" \
94 trad zone zone
95 # Detail
96 label $w.detl -text Detail:
97 place $w.detl -relx .0714 -rely .4268
98 radiobutton $w.detH -text High -anchor w -relief flat \
99 -variable radvar(DETAIL) -value High
100 place $w.detH -relx .2857 -rely .4268
101 radiobutton $w.detM -text Medium -anchor w -relief flat \
102 -variable radvar(DETAIL) -value Medium
103 place $w.detM -relx .5357 -rely .4268
104 radiobutton $w.detL -text Low -anchor w -relief flat \
105 -variable radvar(DETAIL) -value Low
106 place $w.detL -relx .7857 -rely .4268
107 helplink "$w.detH $w.detM $w.detL" trad zone detail
108 # Indirect
109 label $w.indl -text Indirect:
110 place $w.indl -relx .0714 -rely .5488
111 scale $w.inds -showvalue yes -from 0 -to 5 \
112 -orient horizontal -command indscale \
113 -length 450 -width 25
114 $w.inds set $radvar(INDIRECT)
115 place $w.inds -relx .2857 -rely .5488
116 helplink $w.inds trad zone indirect
117 # Variability
118 label $w.varl -text Variability:
119 place $w.varl -relx .0714 -rely .7317
120 radiobutton $w.varH -text High -anchor w -relief flat \
121 -variable radvar(VARIABILITY) -value High
122 place $w.varH -relx .2857 -rely .7317
123 radiobutton $w.varM -text Medium -anchor w -relief flat \
124 -variable radvar(VARIABILITY) -value Medium
125 place $w.varM -relx .5357 -rely .7317
126 radiobutton $w.varL -text Low -anchor w -relief flat \
127 -variable radvar(VARIABILITY) -value Low
128 place $w.varL -relx .7857 -rely .7317
129 helplink "$w.varH $w.varM $w.varL" trad zone variability
130 # Exposure
131 label $w.expl -text Exposure:
132 place $w.expl -relx .0714 -rely .8537
133 entry $w.expe -textvariable radvar(EXPOSURE) -relief sunken
134 place $w.expe -relwidth .1786 -relheight .0610 -relx .2857 -rely .8537
135 helplink $w.expe trad zone exposure
136 # Revert and Copy buttons
137 button $w.revert -text Revert -relief raised \
138 -command "copyzone $rifname"
139 place $w.revert -relwidth .1071 -relheight .0610 -relx .98 -rely .98 \
140 -anchor se
141 helplink $w.revert trad zone revert
142 button $w.copy -text Copy -relief raised -command {getfile \
143 -send copyzone -view view_txt -glob $rif_glob}
144 place $w.copy -relwidth .1071 -relheight .0610 -relx .98 -rely .90 \
145 -anchor se
146 helplink $w.copy trad zone copy
147 # Focusing
148 focus $w.xmin
149 bind $w.xmin <Return> "focus $w.xmax"
150 bind $w.xmax <Return> "focus $w.ymin"
151 bind $w.ymin <Return> "focus $w.ymax"
152 bind $w.ymax <Return> "focus $w.zmin"
153 bind $w.zmin <Return> "focus $w.zmax"
154 bind $w.zmax <Return> "focus $w.expe"
155 bind $w.expe <Return> {}
156 # Track ZONE variable
157 if [info exists radvar(ZONE)] {
158 zonechange radvar ZONE w
159 trace variable radvar(ZONE) wu zonechange
160 } else {
161 zonechange radvar ZONE u
162 }
163 }