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

Comparing ray/src/cv/mgflib/mgf2inv.c (file contents):
Revision 1.6 by greg, Tue Mar 18 11:05:43 1997 UTC vs.
Revision 1.10 by greg, Tue Aug 5 20:40:16 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1995 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Convert MGF to Inventor file.
6   *
# Line 12 | Line 9 | static char SCCSid[] = "$SunId$ LBL";
9  
10   #include <stdio.h>
11  
12 + #include <stdlib.h>
13 +
14   #include <math.h>
15  
16   #include <ctype.h>
# Line 24 | Line 23 | static char SCCSid[] = "$SunId$ LBL";
23  
24   #define O_INV1          1       /* Inventor 1.0 output */
25   #define O_INV2          2       /* Inventor 2.0 output */
26 < #define O_VRML          3       /* VRML output */
26 > #define O_VRML1         3       /* VRML 1.0 output */
27  
28   #define MAXID           48      /* maximum identifier length */
29  
# Line 99 | Line 98 | char   *argv[];
98                                  /* get options and print format line */
99          for (i = 1; i < argc && argv[i][0] == '-'; i++)
100                  if (!strcmp(argv[i], "-vrml"))
101 <                        outtype = O_VRML;
101 >                        outtype = O_VRML1;
102                  else if (!strcmp(argv[i], "-1"))
103                          outtype = O_INV1;
104                  else if (!strcmp(argv[i], "-2"))
# Line 113 | Line 112 | char   *argv[];
112          case O_INV2:
113                  printf("#Inventor V2.0 ascii\n");
114                  break;
115 <        case O_VRML:
116 <                printf("#VRML 1.0 ascii\n");
115 >        case O_VRML1:
116 >                printf("#VRML V1.0 ascii\n");
117                  break;
118          }
119          printf("## Translated from MGF Version %d.%d\n", MG_VMAJOR, MG_VMINOR);
# Line 353 | Line 352 | put_material()                 /* put out current material */
352          indent(0);
353          printf("%s}\n", tabs);
354          if (outtype != O_INV1)
355 <                printf("%sShapeHints { shapeType %s }\n", tabs,
355 >                printf("%sShapeHints { shapeType %s faceType UNKNOWN_FACE_TYPE }\n",
356 >                        tabs,
357                          c_cmaterial->sided ? "SOLID" : "UNKNOWN_SHAPE_TYPE");
358          indent(0);
359          printf("%s}\n", tabs);
# Line 460 | Line 460 | char   **av;
460          if (put_material() < 0)
461                  return(MG_EBADMAT);
462                                  /* get endpoints */
463 <        if ((v1 = c_getvert(av[1])) == NULL | (v2 = c_getvert(av[3])) == NULL)
463 >        if (((v1 = c_getvert(av[1])) == NULL) | ((v2 = c_getvert(av[3])) == NULL))
464                  return(MG_EUNDEF);
465                                  /* get radius */
466          if (!isflt(av[2]))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines