ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/do_results3.6.tcl
(Generate patch)

Comparing ray/src/util/do_results3.6.tcl (file contents):
Revision 2.1 by greg, Thu Oct 27 15:56:08 1994 UTC vs.
Revision 2.7 by greg, Thu Sep 21 10:19:54 1995 UTC

# Line 52 | Line 52 | set conv(types) {GIF-bw GIF-8 PICT PS PPM-asc PPM-bin
52                  tga-bw tga-8 tga-16 tga-24 TIFF-bw TIFF-24}
53   set conv(typ) tga-24
54  
55 + proc testappend {flst tf} {     # test if tf exists and append to flst if so
56 +        upvar $flst mylist
57 +        if [file exists $tf] {
58 +                lappend mylist $tf
59 +        }
60 + }
61 +
62   proc list_views {} {            # List finished and unfinished pictures
63 <        global radvar fvwbox ufvwbox
63 >        global radvar fvwbox ufvwbox alldone rawfroot
64          set fpics {}
65          set ufpics {}
66          foreach vw $radvar(view) {
67 <                set fnr $radvar(PICTURE)_[lindex $vw 0]
61 <                if [file exists $fnr.raw] {
67 >                if [file exists ${rawfroot}_[lindex $vw 0].unf] {
68                          lappend ufpics [lindex $vw 0]
69 <                } elseif {[file exists $fnr.pic]} {
69 >                } elseif {[file exists $radvar(PICTURE)_[lindex $vw 0].pic]} {
70                          lappend fpics [lindex $vw 0]
71                  }
72          }
# Line 68 | Line 74 | proc list_views {} {           # List finished and unfinished p
74          eval $fvwbox insert end $fpics
75          $ufvwbox delete 0 end
76          eval $ufvwbox insert end $ufpics
77 +        set alldone [expr [llength $fpics] == [llength $radvar(view)]]
78   }
79  
80   proc delpic {} {                # Delete selected pictures
81 <        global curmess alldone
82 <        set selected_pics [get_selpics]
83 <        if {"$selected_pics" == {}} {
81 >        global curmess
82 >        set selected_pics [get_selpics 1]
83 >        if {$selected_pics == {}} {
84                  set curmess "No pictures selected."
85                  return
86          }
87          if [tk_dialog .dlg {Verification} \
88 <                        "Really delete picture file(s) $selected_pics?" \
89 <                        questhead 1 {Delete} {Cancel}] {
88 >                        "Really delete file(s) $selected_pics?" \
89 >                        questhead 0 {Delete} {Cancel}] {
90                  return
91          }
92          if {! [catch {eval exec rm $selected_pics < /dev/null} curmess]} {
93                  set curmess "Deleted [llength $selected_pics] file(s)."
94          }
95          list_views
89        set alldone 0
96   }
97  
98 < proc get_selpics {} {           # return selected pictures
99 <        global fvwbox ufvwbox radvar
98 > proc get_selpics {{getall 0}} {         # return selected pictures
99 >        global fvwbox ufvwbox radvar rawfroot
100          set sl {}
101          foreach i [$fvwbox curselection] {
102 <                lappend sl $radvar(PICTURE)_[$fvwbox get $i].pic
102 >                testappend sl $radvar(PICTURE)_[$fvwbox get $i].pic
103 >                if {$getall && $rawfroot != $radvar(PICTURE)} {
104 >                        testappend sl ${rawfroot}_[$fvwbox get $i].pic
105 >                }
106 >                if {$getall && $radvar(ZFILE) != {}} {
107 >                        testappend sl $radvar(ZFILE)_[$fvwbox get $i].zbf
108 >                }
109          }
110          foreach i [$ufvwbox curselection] {
111 <                lappend sl $radvar(PICTURE)_[$ufvwbox get $i].raw
111 >                testappend sl ${rawfroot}_[$ufvwbox get $i].unf
112 >                if {$getall && $radvar(ZFILE) != {}} {
113 >                        testappend sl $radvar(ZFILE)_[$ufvwbox get $i].zbf
114 >                }
115          }
116          return $sl
117   }
# Line 104 | Line 119 | proc get_selpics {} {          # return selected pictures
119   proc dsppic {} {                # Display selected pictures
120          global curmess dispcom radvar
121          set selected_pics [get_selpics]
122 <        if {"$selected_pics" == {}} {
122 >        if {$selected_pics == {}} {
123                  set curmess "No pictures selected."
124                  return
125          }
126 <        if {"$radvar(EXPOSURE)" == {}} {
126 >        if {$radvar(EXPOSURE) == {}} {
127                  set ev 0
128          } else {
129                  if [regexp {^[+-]} $radvar(EXPOSURE)] {
# Line 123 | Line 138 | proc dsppic {} {               # Display selected pictures
138                  }
139          }
140          foreach p $selected_pics {
141 <                if [string match *.raw $p] {
141 >                if {[string match *.unf $p] ||
142 >                                $radvar(PICTURE) == "$radvar(RAWFILE)"} {
143                          set dc [format $dispcom $ev $p]
144                  } else {
145                          set dc [format $dispcom 0 $p]
# Line 140 | Line 156 | proc cnvpic {} {               # Convert selected pictures
156                  set p $radvar(PICTURE)_$vw.pic
157                  set df [format $convdest $vw]
158                  set curmess "Converting $p to $df..."
159 <                update idletasks
159 >                update
160                  set cc [format $conv($conv(typ),com) $p $df]
161                  if {! [catch {eval exec $cc} curmess]} {
162                          set curmess "Done."
# Line 154 | Line 170 | proc prtpic {} {               # Print selected pictures
170          foreach i [$fvwbox curselection] {
171                  set p $radvar(PICTURE)_[$fvwbox get $i].pic
172                  set curmess "Printing $p..."
173 <                update idletasks
173 >                update
174                  set pc [format $prntcom $p]
175                  if {! [catch {eval exec $pc} curmess]} {
176                          set curmess "Done."
# Line 163 | Line 179 | proc prtpic {} {               # Print selected pictures
179   }
180  
181   proc do_results w {             # Results screen
182 <        global radvar curmess fvwbox ufvwbox dispcom prntcom conv convdest
182 >        global radvar curmess fvwbox ufvwbox dispcom prntcom conv \
183 >                        rawfroot convdest
184          if {"$w" == "done"} {
185 <                unset fvwbox ufvwbox convdest
185 >                unset fvwbox ufvwbox convdest rawfroot
186                  return
187          }
188          frame $w
# Line 245 | Line 262 | proc do_results w {            # Results screen
262          place $w.prte -relwidth .5714 -relheight .0610 -relx .3571 -rely .8537
263          helplink $w.prte trad results printcommand
264          # Fill in views
265 +        if {$radvar(RAWFILE) != {}} {
266 +                set rawfroot $radvar(RAWFILE)
267 +        } else {
268 +                set rawfroot $radvar(PICTURE)
269 +        }
270          list_views
271   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines