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

Comparing ray/src/util/glare.csh (file contents):
Revision 1.1 by greg, Wed Apr 24 18:27:08 1991 UTC vs.
Revision 2.4 by greg, Sat Feb 22 02:07:30 2003 UTC

# Line 1 | Line 1
1   #!/bin/csh -f
2 < # SCCSid "$SunId$ LBL"
2 > # RCSid: $Id$
3   #
4   # Interactive program for calculating glare values
5   #
# Line 7 | Line 7 | set fgargs=(-v)
7   set nofile="none"
8   set octree=$nofile
9   set picture=$nofile
10 + set glarefile=$nofile
11   if ($#argv >= 1) then
12          set glarefile=$argv[1]
13 < else
14 <        set glarefile=$nofile
13 >        if ($#argv >= 2) then
14 >                set picture=$argv[2]
15 >                if ($#argv >= 3) then
16 >                        set octree=$argv[3]
17 >                endif
18 >        endif
19   endif
20   set rtargs=
21   set view=
# Line 53 | Line 58 | If the viewpoint is not the same as the picture, an er
58   If no view is specified, the view parameters are taken from the picture,
59   so the view specification is optional unless you are starting from an
60   octree.
61 +
62   _EOF_
63 <        readvar picture
64 <        readvar octree
63 >        if ( $picture == $nofile ) then
64 >                readvar picture
65 >        endif
66 >        if ( $octree == $nofile ) then
67 >                readvar octree
68 >        endif
69          readvar view
70          if ( $picture == $nofile && $octree == $nofile ) then
71                  echo "You must specify a picture or an octree"
72                  exit 1
73          endif
74 +        if ( $picture == $nofile && "$view" == "" ) then
75 +                echo "You must give a view if there is no picture"
76 +                exit 1
77 +        endif
78          if ( $picture != $nofile ) then
79                  if ( ! -r $picture ) then
80                          echo "Cannot read $picture"
81                          exit 1
82                  endif
83 <                set fgargs=($fgargs -p $picture -vf $picture)
83 >                set fgargs=($fgargs -p $picture)
84 >                if ( "$view" != "" ) then
85 >                        set view=(-vf $picture $view)
86 >                endif
87          endif
88          set fgargs=($fgargs $view)
89          if ( $octree != $nofile ) then
# Line 80 | Line 97 | With an octree, you should give the same options for -
97   so forth as are used to render the scene.  Please enter them below.
98  
99   _EOF_
100 +                if ($picture != $nofile) then
101 +                        echo "These are the parameters from the picture:"
102 +                        getinfo $picture
103 +                endif
104                  readvar rtargs
105                  set fgargs=($fgargs $rtargs $octree)
106          endif
# Line 90 | Line 111 | _EOF_
111                  if ("$<" =~ [yY]) then
112                          set fgargs=(-r 400 $fgargs)
113                  else
114 <                        set fgargs=(-r 200 $fgargs)
114 >                        set fgargs=(-r 250 $fgargs)
115                  endif
116 <                echo -n "Are these sources very bright? "
116 >                echo -n "Are these sources relatively bright? "
117                  if ("$<" =~ [nN]*) then
118                          set fgargs=(-c $fgargs)
119                  endif
# Line 126 | Line 147 | _EOF_
147          echo "Starting calculation..."
148          echo findglare $fgargs
149          findglare $fgargs > $glarefile
150 +        if ($status) then
151 +                echo "Uh-oh.  Something went wrong with findglare\!"
152 +                rm $glarefile
153 +                exit 1
154 +        endif
155   endif
156   if ($?DISPLAY && $picture != $nofile) then
157          echo ""
158          echo "Displaying glare sources in '$picture'..."
159          xglaresrc $picture $glarefile
134        if ($status) then
135                x11image =+0+0 -g 2.6 $picture &
136                sleep 40
137                xglaresrc $picture $glarefile
138        endif
160   endif
161 < set ndxnam=("Guth Visual Comfort Probability" "Guth Disability Glare Ratio")
162 < set ndxcom=(guth_vcp guth_dgr)
161 > set ndxnam=("Guth Visual Comfort Probability" "Guth Disability Glare Ratio" "CIE Glare Index" "BRS Glare Index" "Unified Glare Rating" "Daylight Glare Index")
162 > set ndxcom=("glarendx -t guth_vcp" "glarendx -t guth_dgr" "glarendx -t cie_cgi" "glarendx -t brs_gi" "glarendx -t ugr" "glarendx -t dgi")
163 > set bcdlvl=(50 124 18.5 18.5 18.5 21.7)
164   while ( 1 )
165          echo ""
166          echo "  0.  Quit"
# Line 172 | Line 194 | while ( 1 )
194                          else if ($octree != $nofile) then
195                                  set subtitle="$subtitle $octree"
196                          endif
197 +                        if ( "$subtitle" == "" ) then
198 +                                set subtitle="`getinfo < $glarefile | grep findglare`"
199 +                        endif
200                          cat <<_EOF_ > $plotfile
201 + include=line.plt
202   include=polar.plt
203   title="$ndxnam[$choice]"
204   subtitle="$subtitle"
205 + Bdata=
206 +        0       $bcdlvl[$choice]
207 +        360     $bcdlvl[$choice]
208 + ;
209 + Blabel="BCD level"
210   Adata=
211   _EOF_
212                          getinfo - < $gndxfile >> $plotfile

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines