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

Comparing ray/src/util/bsdfview.pl (file contents):
Revision 2.2 by greg, Sat Aug 12 01:31:29 2017 UTC vs.
Revision 2.3 by greg, Thu Aug 17 21:32:29 2017 UTC

# Line 13 | Line 13 | my $octree = "$td/bv$$.oct";
13   my $ambf = "$td/af$$.amb";
14   my $raddev = "x11";     # default output device. Overwrite with -o
15   my $qual = "Low";
16 < my $vw = "def";
16 > my $usetrad = 0;
17  
18   my $opts = "";  # Options common to rad
19   my $rendopts = "-w-";   # For render= line in rif file
# Line 24 | Line 24 | while (@ARGV) {
24                  $opts .= " $_";
25          } elsif (m/^-v\b/) {    # standard view
26                  # Let rad do any error handling...
27 <                $vw = $ARGV[1];
27 >                $opts .= qq( -v "$ARGV[1]");
28                  shift @ARGV;
29          } elsif (m/^-[nN]\b/) { # No. of parallel processes
30                  $opts .= ' -N ' . $ARGV[1];
# Line 38 | Line 38 | while (@ARGV) {
38          } elsif ((m/^-V\b/) or (m/^-e\b/)) {   # print view, explicate variables
39                  # Think of those two as '-verbose'.
40                  $opts .= " $_";
41 +        } elsif (m/^-t\b/) {    # start trad instead of rad
42 +                $usetrad = 1;
43          } elsif (m/^-\w/) {
44                  die("bsdfview: Bad option: $_\n");
45          } else {
# Line 48 | Line 50 | while (@ARGV) {
50  
51   # We need at least one XML or SIR file
52   if ($#ARGV < 0) {
53 <        die("Missing input XML or SIR file(s)\n");
53 >        die("bsdfview: missing input XML or SIR file(s)\n");
54   }
55  
56 + if (length($opts) and $usetrad) {
57 +        die("bsdfview: rad options not supported when calling trad (-t)\n");
58 + }
59 +
60   my @objects = @ARGV;
61  
62   # Make this work under Windoze
# Line 72 | Line 78 | my $rif = "$name.rif";
78  
79   if (-e $rif) {                  # RIF already exists?
80          print "Attempting to run with existing rad input file '$rif'\n";
81 <        system "rad -o $raddev -w -v $vw $opts $rif QUA=$qual";
81 >        if ($usetrad) {
82 >                system "trad $rif";
83 >        } else {
84 >                system "rad -o $raddev -w $opts $rif QUA=$qual";
85 >        }
86          die("\nTry removing '$rif' and starting again\n\n") if $?;
87          exit;
88   }
# Line 107 | Line 117 | view= pt -vtl -vp 0 0 -10 -vd 0 0 1 -vu 0 1 0 -vv 35 -
117   EndOfRif
118   close(FH);
119  
120 < system "rad -o $raddev -v $vw $opts $rif";
121 <
120 > if ($usetrad) {
121 >        system "trad $rif";
122 > } else {
123 >        system "rad -o $raddev $opts $rif";
124 > }
125   #EOF

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines