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"; |
173 |
|
char *name; |
174 |
|
register FILE *fin; |
175 |
|
{ |
176 |
+ |
int nobjs = 0; |
177 |
|
register int c; |
178 |
|
|
179 |
|
while ((c = getc(fin)) != EOF) { |
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 |
|
|
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 |
|
{ |
660 |
|
|
661 |
|
initotypes() /* initialize ofun[] array */ |
662 |
|
{ |
639 |
– |
extern int o_source(); |
640 |
– |
extern int o_sphere(); |
641 |
– |
extern int o_face(); |
642 |
– |
extern int o_cone(); |
643 |
– |
extern int o_cylinder(); |
644 |
– |
extern int o_ring(); |
645 |
– |
extern int m_glow(); |
646 |
– |
extern int m_spot(); |
647 |
– |
extern int m_dielectric(); |
648 |
– |
extern int m_interface(); |
649 |
– |
extern int text(); |
650 |
– |
extern int alias(); |
651 |
– |
extern int passargs(); |
652 |
– |
extern int addxform(); |
663 |
|
register int i; |
664 |
|
|
665 |
|
if (ofun[OBJ_SOURCE].funp == o_source) |
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; |