1 | /***************************************
2 | $Header$
3 |
4 | This file defines the isurface and idisplay structures which map to the
5 | ISurface and IDisplay data types in illuminator.h. It also contains the
6 | zbuffer data type for multiz.c.
7 | ***************************************/
8 |
9 |
10 | #ifndef SURFACE_H
11 | #define SURFACE_H /*+ To stop multiple inclusions. +*/
12 |
13 | #include <illuminator.h> /* For various types */
14 |
15 | struct isurface {
16 | /*+ Number of triangles in this node. Its value is initialized to zero, and
17 | incremented as each triangle is added, then reset to zero when the
18 | triangulation is displayed. +*/
19 | int num_triangles;
20 |
21 | /*+ Number of triangles allocated in the vertices array. +*/
22 | int vertisize;
23 |
24 | /*+ Array of vertex corners of triangles. The number of triangles is given
25 | by num_triangles, and size of the array by vertisize. For each triangle,
26 | this array has the coordinates of the three nodes, and its R, G, B and A
27 | color values, hence 13 PetscScalars for each triangle. +*/
28 | PetscScalar *vertices;
29 | };
30 |
31 | /*+ The zbuffer type, used to store an entry for a pixel. +*/
32 | typedef struct {
33 | guchar r,g,b,a;
34 | float z;
35 | } zbuffer;
36 |
37 | struct idisplay {
38 | /*+ Geomview output pipe +*/
39 | FILE *to_geomview;
40 |
41 | guchar *rgb;
42 | int rgb_width, rgb_height, rgb_rowskip, rgb_bpp;
43 |
44 | zbuffer *zbuf;
45 | int zbuf_width, zbuf_height, zbuf_rowskip, zbuf_depth;
46 | };
47 |
48 | #endif /* SURFACE_H */