1 /* Copyright (C) 1992-1998 The Geometry Center
2  * Copyright (C) 1998-2000 Stuart Levy, Tamara Munzner, Mark Phillips
3  *
4  * This file is part of Geomview.
5  *
6  * Geomview is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License as published
8  * by the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * Geomview is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with Geomview; see the file COPYING.  If not, write
18  * to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
19  * USA, or visit http://www.gnu.org.
20  */
21 
22 
23 /* Authors: Charlie Gunn, Stuart Levy, Tamara Munzner, Mark Phillips */
24 
25 #ifndef QUADPDEFS
26 #define QUADPDEFS
27 
28 #include "geomclass.h"
29 #include "quad.h"
30 #include "bsptree.h"
31 
32 #define QUAD_N      VERT_N
33 #define QUAD_C      VERT_C
34 #define QUAD_BINARY GEOMFLAG(0x01)
35 
36 typedef HPoint3 QuadP[4];
37 typedef Point3 QuadN[4];
38 typedef ColorA QuadC[4];
39 
40 struct Quad {
41   GEOMFIELDS;
42   int     maxquad;
43   QuadP   *p;
44   QuadN   *n;
45   QuadC   *c;
46 };
47 
48 Quad *QuadPick(Quad *, Pick *, Appearance *,
49 	       Transform, TransformN *, int *axes);
50 Quad *QuadComputeNormals(Quad *q);
51 
QuadRef(Quad * q)52 static inline Ref *QuadRef(Quad *q)
53 {
54   union castit {
55     Ref  ref;
56     Quad quad;
57   };
58 
59   return &((union castit *)q)->ref;
60 }
61 
QuadGeom(Quad * q)62 static inline Geom *QuadGeom(Quad *q)
63 {
64   union castit {
65     Geom geom;
66     Quad quad;
67   };
68 
69   return &((union castit *)q)->geom;
70 }
71 
72 #endif /* ! QUADPDEFS */
73 
74 /*
75  * Local Variables: ***
76  * c-basic-offset: 2 ***
77  * End: ***
78  */
79