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

Comparing ray/src/util/wrapBSDF.c (file contents):
Revision 2.14 by greg, Thu Apr 2 16:40:32 2015 UTC vs.
Revision 2.17 by greg, Tue Feb 2 18:02:32 2016 UTC

# Line 9 | Line 9 | static const char RCSid[] = "$Id$";
9  
10   #include <ctype.h>
11   #include "rtio.h"
12 < #include "rtprocess.h"
12 > #include "paths.h"
13   #include "ezxml.h"
14   #include "bsdf.h"
15   #include "bsdf_m.h"
# Line 25 | Line 25 | const char     *attr_unit = "meter";
25   const char      legal_units[] = "meter|foot|inch|centimeter|millimeter";
26                                          /* system materials & geometry */
27   const char      *mgf_geometry = NULL;
28 <
28 >                                        /* comment list */
29 > #define MAXCOMM         30
30 > const char      *commlist[MAXCOMM];
31 > int             ncomm = 0;
32                                          /* angle bases */
33   enum { ABdefault=-1, ABklemsFull=0, ABklemsHalf, ABklemsQuarter,
34                  ABtensorTree3, ABtensorTree4, ABend };
# Line 585 | Line 588 | writeBSDF(const char *caller, ezxml_t fl)
588                  free(xml);
589                  return 0;
590          }
591 +        puts("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
592 +        for (i = 0; i < ncomm; i++)
593 +                printf("<!-- %s -->\n", commlist[i]);
594          fflush(stdout);                         /* write previous XML info. */
595          if (write(fileno(stdout), xml, ei) != ei) {
596                  free(xml);
# Line 717 | Line 723 | UsageExit(const char *pname)
723          fputs("Usage: ", stderr);
724          fputs(pname, stderr);
725          fputs(" [-W][-c][-a {kf|kh|kq|t3|t4}][-u unit][-g geom][-f 'x=string;y=string']", stderr);
726 <        fputs(" [-s spectr][-tb inp][-tf inp][-rb inp][-rf inp]", stderr);
726 >        fputs(" [-s spectr][-tb inp][-tf inp][-rb inp][-rf inp][-C comm]", stderr);
727          fputs(" [input.xml]\n", stderr);
728          exit(1);
729   }
# Line 785 | Line 791 | main(int argc, char *argv[])
791                          continue;
792                  case 'c':               /* correct solid angle */
793                          correct_solid_angle = 1;
794 +                        continue;
795 +                case 'C':               /* comment */
796 +                        if (ncomm >= MAXCOMM) {
797 +                                fprintf(stderr, "%s: too many comments\n",
798 +                                                argv[0]);
799 +                                return 1;
800 +                        }
801 +                        if (strchr(argv[++i], '>') != NULL) {
802 +                                fprintf(stderr, "%s: illegal character in comment\n",
803 +                                                argv[0]);
804 +                                return 1;
805 +                        }
806 +                        commlist[ncomm++] = argv[i];
807                          continue;
808                  case 't':               /* transmission */
809                          if (i >= argc-1)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines