11 |
|
* |
12 |
|
*/ |
13 |
|
|
14 |
< |
#include <stdio.h> |
14 |
> |
#include "rtio.h" |
15 |
|
#include <stdlib.h> |
16 |
|
#include <math.h> |
17 |
– |
#include <strings.h> |
17 |
|
#include <ctype.h> |
18 |
|
#include "ezxml.h" |
19 |
|
#include "bsdf.h" |
360 |
|
return (df->maxHemi <= 1.01); |
361 |
|
} |
362 |
|
|
364 |
– |
/* skip integer in string */ |
365 |
– |
static char * |
366 |
– |
i_skip(char *s) |
367 |
– |
{ |
368 |
– |
while (isspace(*s)) |
369 |
– |
s++; |
370 |
– |
if (*s == '-' || *s == '+') |
371 |
– |
s++; |
372 |
– |
if (!isdigit(*s)) |
373 |
– |
return(NULL); |
374 |
– |
do |
375 |
– |
s++; |
376 |
– |
while (isdigit(*s)); |
377 |
– |
return(s); |
378 |
– |
} |
379 |
– |
|
380 |
– |
/* skip float in string */ |
381 |
– |
static char * |
382 |
– |
f_skip(char *s) |
383 |
– |
{ |
384 |
– |
register char *cp; |
385 |
– |
|
386 |
– |
while (isspace(*s)) |
387 |
– |
s++; |
388 |
– |
if (*s == '-' || *s == '+') |
389 |
– |
s++; |
390 |
– |
cp = s; |
391 |
– |
while (isdigit(*cp)) |
392 |
– |
cp++; |
393 |
– |
if (*cp == '.') { |
394 |
– |
cp++; s++; |
395 |
– |
while (isdigit(*cp)) |
396 |
– |
cp++; |
397 |
– |
} |
398 |
– |
if (cp == s) |
399 |
– |
return(NULL); |
400 |
– |
if (*cp == 'e' || *cp == 'E') |
401 |
– |
return(i_skip(cp+1)); |
402 |
– |
return(cp); |
403 |
– |
} |
404 |
– |
|
363 |
|
/* load BSDF distribution for this wavelength */ |
364 |
|
static int |
365 |
|
load_bsdf_data(SDData *sd, ezxml_t wdb, int rowinc) |
462 |
|
return RC_FORMERR; |
463 |
|
} |
464 |
|
for (i = 0; i < dp->ninc*dp->nout; i++) { |
465 |
< |
char *sdnext = f_skip(sdata); |
465 |
> |
char *sdnext = fskip(sdata); |
466 |
|
if (sdnext == NULL) { |
467 |
|
sprintf(SDerrorDetail, |
468 |
|
"Bad/missing BSDF ScatteringData in '%s'", |