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

Comparing ray/src/gen/xform.c (file contents):
Revision 2.6 by greg, Mon Sep 21 12:15:44 1992 UTC vs.
Revision 2.10 by greg, Fri Dec 8 18:29:06 1995 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1992 Regents of the University of California */
1 > /* Copyright (c) 1995 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 173 | Line 173 | xform(name, fin)                       /* transform stream by tot.xfm */
173   char  *name;
174   register FILE  *fin;
175   {
176 +        int  nobjs = 0;
177          register int  c;
178  
179          while ((c = getc(fin)) != EOF) {
# Line 188 | Line 189 | register FILE  *fin;
189                  } else if (c == '!') {                  /* command */
190                          ungetc(c, fin);
191                          xfcomm(name, fin);
192 +                        nobjs++;
193                  } else {                                /* object */
194                          ungetc(c, fin);
195                          xfobject(name, fin);
196 +                        nobjs++;
197                  }
198          }
199 +        if (nobjs == 0)
200 +                fprintf(stderr, "%s: (%s): warning - empty file\n",
201 +                                progname, name);
202   }
203  
204  
# Line 398 | Line 404 | FILE  *fin;
404   }
405  
406  
407 + m_mist(fin)             /* transform arguments for mist */
408 + FILE  *fin;
409 + {
410 +        FUNARGS  fa;
411 +
412 +        if (readfargs(&fa, fin) != 1)
413 +                return(-1);
414 +        if (fa.nsargs != 0  || fa.nfargs != 4)
415 +                return(-1);
416 +        printf("0\n0\n4");
417 +        printf(" %18.12g %18.12g %18.12g", fa.farg[0]/tot.sca,
418 +                        fa.farg[1]/tot.sca, fa.farg[2]/tot.sca);
419 +        printf(" %18.12g\n", fa.farg[3]);
420 +        freefargs(&fa);
421 +        return(0);
422 + }
423 +
424 +
425   m_dielectric(fin)               /* transform arguments for dielectric */
426   FILE  *fin;
427   {
404        double  pow();
428          FUNARGS  fa;
429  
430          if (readfargs(&fa, fin) != 1)
# Line 422 | Line 445 | FILE  *fin;
445   m_interface(fin)                /* transform arguments for interface */
446   FILE  *fin;
447   {
425        double  pow();
448          FUNARGS  fa;
449  
450          if (readfargs(&fa, fin) != 1)
# Line 638 | Line 660 | FILE  *fin;
660  
661   initotypes()                    /* initialize ofun[] array */
662   {
641        extern int  o_source();
642        extern int  o_sphere();
643        extern int  o_face();
644        extern int  o_cone();
645        extern int  o_cylinder();
646        extern int  o_ring();
647        extern int  m_glow();
648        extern int  m_spot();
649        extern int  m_dielectric();
650        extern int  m_interface();
651        extern int  text();
652        extern int  alias();
653        extern int  passargs();
654        extern int  addxform();
663          register int  i;
664  
665          if (ofun[OBJ_SOURCE].funp == o_source)
# Line 678 | Line 686 | initotypes()                   /* initialize ofun[] array */
686          ofun[MAT_SPOT].funp = m_spot;
687          ofun[MAT_DIELECTRIC].funp = m_dielectric;
688          ofun[MAT_INTERFACE].funp = m_interface;
689 +        ofun[MAT_MIST].funp = m_mist;
690          ofun[PAT_CTEXT].funp =
691          ofun[PAT_BTEXT].funp =
692          ofun[MIX_TEXT].funp = text;
693          ofun[ALIAS].funp = alias;
694                                          /* surface inverses */
695 +        tinvers[OBJ_FACE] = OBJ_FACE;
696          tinvers[OBJ_SOURCE] = OBJ_SOURCE;
697          tinvers[OBJ_CONE] = OBJ_CUP;
698          tinvers[OBJ_CUP] = OBJ_CONE;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines