ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/bsdf.c
(Generate patch)

Comparing ray/src/common/bsdf.c (file contents):
Revision 2.27 by greg, Wed Apr 27 23:05:51 2011 UTC vs.
Revision 2.33 by greg, Tue Jun 28 21:11:04 2011 UTC

# Line 10 | Line 10 | static const char RCSid[] = "$Id$";
10   *
11   */
12  
13 + #define _USE_MATH_DEFINES
14   #include <stdio.h>
15   #include <stdlib.h>
16 + #include <string.h>
17   #include <math.h>
18 + #include <ctype.h>
19   #include "ezxml.h"
20   #include "hilbert.h"
21   #include "bsdf.h"
# Line 106 | Line 109 | SDloadGeometry(SDData *sd, ezxml_t wdb)
109          if ((geom = ezxml_child(wdb, "Geometry")) == NULL ||
110                          (mgfstr = ezxml_txt(geom)) == NULL)
111                  return SDEnone;
112 +        while (isspace(*mgfstr))
113 +                ++mgfstr;
114 +        if (!*mgfstr)
115 +                return SDEnone;
116          if ((fmt = ezxml_attr(geom, "format")) != NULL &&
117                          strcasecmp(fmt, "MGF")) {
118                  sprintf(SDerrorDetail,
# Line 168 | Line 175 | SDloadFile(SDData *sd, const char *fname)
175                  return lastErr;
176                                  /* try loading variable resolution data */
177          lastErr = SDloadTre(sd, wtl);
171 #if 0
178                                  /* check our result */
179 <        switch (lastErr) {
174 <        case SDEformat:
175 <        case SDEdata:
176 <        case SDEsupport:        /* possibly we just tried the wrong format */
179 >        if (lastErr == SDEsupport)      /* try matrix BSDF if not tree data */
180                  lastErr = SDloadMtx(sd, wtl);
181 <                break;
179 <        default:                /* variable res. OK else serious error */
180 <                break;
181 <        }
182 < #endif
181 >                
182                                  /* done with XML file */
183          ezxml_free(fl);
184          
# Line 815 | Line 814 | SDmapDir(FVECT resVec, RREAL vMtx[3][3], const FVECT i
814  
815   #include "standard.h"
816   #include "paths.h"
818 #include <ctype.h>
817  
818   #define MAXLATS         46              /* maximum number of latitudes */
819  
# Line 935 | Line 933 | ab_getndx(             /* get index corresponding to the given ve
933   {
934          ANGLE_BASIS  *ab = (ANGLE_BASIS *)p;
935          int     li, ndx;
936 <        double  pol, azi, d;
936 >        double  pol, azi;
937  
938          if ((v[2] < -1.0) | (v[2] > 1.0))
939                  return(-1);
# Line 1175 | Line 1173 | check_bsdf_data(       /* check that BSDF data is sane */
1173   )
1174   {
1175          double          *omega_iarr, *omega_oarr;
1176 <        double          dom, contrib, hemi_total, full_total;
1176 >        double          dom, hemi_total, full_total;
1177          int             nneg;
1178          FVECT           v;
1179          int             i, o;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines