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

Comparing ray/src/cv/mgflib/parser.c (file contents):
Revision 1.23 by greg, Wed Jun 19 22:34:59 1996 UTC vs.
Revision 1.24 by greg, Tue Mar 18 11:17:24 1997 UTC

# Line 67 | Line 67 | static int     e_any_toss(),           /* discard unneeded entity *
67                  e_cmix(),               /* color mixtures */
68                  e_cspec();              /* color spectra */
69  
70 int             e_include(),            /* include file */
71                e_sph(),                /* sphere */
72                e_cyl(),                /* cylinder */
73                e_cone(),               /* cone */
74                e_prism(),              /* prism */
75                e_ring(),               /* ring */
76                e_torus();              /* torus */
77
70                                  /* alternate handler support functions */
71  
72   static int      (*e_supp[MG_NENTITIES])();
# Line 124 | Line 116 | mg_init()                      /* initialize alternate entity handlers */
116                  ineed |= 1L<<MG_E_POINT|1L<<MG_E_NORMAL|1L<<MG_E_VERTEX;
117          } else
118                  uneed |= 1L<<MG_E_POINT|1L<<MG_E_NORMAL|1L<<MG_E_VERTEX|1L<<MG_E_XF;
119 +        if (mg_ehand[MG_E_FACE] == NULL)
120 +                mg_ehand[MG_E_FACE] = mg_ehand[MG_E_FACEH];
121 +        else if (mg_ehand[MG_E_FACEH] == NULL)
122 +                mg_ehand[MG_E_FACEH] = e_faceh;
123          if (mg_ehand[MG_E_COLOR] != NULL) {
124                  if (mg_ehand[MG_E_CMIX] == NULL) {
125                          mg_ehand[MG_E_CMIX] = e_cmix;
# Line 461 | Line 457 | char   **av;
457          } while (xf_context != xf_orig);
458          mg_close();
459          return(MG_OK);
460 + }
461 +
462 +
463 + int
464 + e_faceh(ac, av)                 /* replace face+holes with single contour */
465 + int     ac;
466 + char    **av;
467 + {
468 +        char    *newav[MG_MAXARGC];
469 +        int     lastp = 0;
470 +        register int    i, j;
471 +
472 +        newav[0] = mg_ename[MG_E_FACE];
473 +        for (i = 1; i < ac; i++)
474 +                if (av[i][0] == '-') {
475 +                        if (i < 4)
476 +                                return(MG_EARGC);
477 +                        if (i >= ac-1)
478 +                                break;
479 +                        if (!lastp)
480 +                                lastp = i-1;
481 +                        for (j = i+1; j < ac-1 && av[j+1][0] != '-'; j++)
482 +                                ;
483 +                        if (j - i < 3)
484 +                                return(MG_EARGC);
485 +                        newav[i] = av[j];       /* connect hole loop */
486 +                } else
487 +                        newav[i] = av[i];       /* hole or perimeter vertex */
488 +        if (lastp)
489 +                newav[i++] = av[lastp];         /* finish seam to outside */
490 +        newav[i] = NULL;
491 +        return(mg_handle(MG_E_FACE, i, newav));
492   }
493  
494  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines