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.4 by greg, Tue Mar 14 10:16:46 1995 UTC vs.
Revision 2.8 by greg, Thu Sep 21 10:51:30 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 alldone
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 73 | Line 79 | proc list_views {} {           # List finished and unfinished p
79  
80   proc delpic {} {                # Delete selected pictures
81          global curmess
82 <        set selected_pics [get_selpics]
83 <        if {"$selected_pics" == {}} {
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?" \
88 >                        "Really delete file(s) $selected_pics?" \
89                          questhead 0 {Delete} {Cancel}] {
90                  return
91          }
# Line 89 | Line 95 | proc delpic {} {               # Delete selected pictures
95          list_views
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)] {
130 <                        set ev $radvar(EXPOSURE)
130 >                        set ev [expr {round($radvar(EXPOSURE))}]
131                  } else {
132 <                        set ev [expr {log($radvar(EXPOSURE))/log(2)}]
132 >                        set ev [expr {round(log($radvar(EXPOSURE))/log(2))}]
133                  }
119                if {$ev < 0} {
120                        set ev [expr {int($ev - .5)}]
121                } else {
122                        set ev [expr {int($ev + .5)}]
123                }
134          }
135          foreach p $selected_pics {
136 <                if [string match *.raw $p] {
136 >                if {[string match *.unf $p] ||
137 >                                $radvar(PICTURE) == $radvar(RAWFILE)} {
138                          set dc [format $dispcom $ev $p]
139                  } else {
140                          set dc [format $dispcom 0 $p]
# Line 163 | Line 174 | proc prtpic {} {               # Print selected pictures
174   }
175  
176   proc do_results w {             # Results screen
177 <        global radvar curmess fvwbox ufvwbox dispcom prntcom conv convdest
177 >        global radvar curmess fvwbox ufvwbox dispcom prntcom conv \
178 >                        rawfroot convdest
179          if {"$w" == "done"} {
180 <                unset fvwbox ufvwbox convdest
180 >                unset fvwbox ufvwbox convdest rawfroot
181                  return
182          }
183          frame $w
# Line 245 | Line 257 | proc do_results w {            # Results screen
257          place $w.prte -relwidth .5714 -relheight .0610 -relx .3571 -rely .8537
258          helplink $w.prte trad results printcommand
259          # Fill in views
260 +        if {$radvar(RAWFILE) != {}} {
261 +                set rawfroot $radvar(RAWFILE)
262 +                if {$radvar(RAWFILE) == $radvar(PICTURE)} {
263 +                        set curmess "Warning: finished views are unfiltered"
264 +                }
265 +        } else {
266 +                set rawfroot $radvar(PICTURE)
267 +        }
268          list_views
269   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines