| 1 |
/* $Id: tess.h,v 1.2 2000/11/02 00:28:54 mholst Exp $ */ |
| 2 |
|
| 3 |
/* |
| 4 |
* Mesa 3-D graphics library |
| 5 |
* Version: 2.0 |
| 6 |
* Copyright (C) 1995-1996 Brian Paul |
| 7 |
* |
| 8 |
* This library is free software; you can redistribute it and/or |
| 9 |
* modify it under the terms of the GNU Library General Public |
| 10 |
* License as published by the Free Software Foundation; either |
| 11 |
* version 2 of the License, or (at your option) any later version. |
| 12 |
* |
| 13 |
* This library is distributed in the hope that it will be useful, |
| 14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 |
* Library General Public License for more details. |
| 17 |
* |
| 18 |
* You should have received a copy of the GNU Library General Public |
| 19 |
* License along with this library; if not, write to the Free |
| 20 |
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 21 |
*/ |
| 22 |
|
| 23 |
/* |
| 24 |
* This file is part of the polygon tesselation code contributed by |
| 25 |
* Bogdan Sikorski |
| 26 |
*/ |
| 27 |
|
| 28 |
|
| 29 |
#include "gluP.h" |
| 30 |
|
| 31 |
#define EPSILON 1e-06 /* epsilon for double precision compares */ |
| 32 |
|
| 33 |
typedef enum |
| 34 |
{ |
| 35 |
OXY, |
| 36 |
OYZ, |
| 37 |
OXZ |
| 38 |
} projection_type; |
| 39 |
|
| 40 |
typedef struct callbacks_str |
| 41 |
{ |
| 42 |
void (*begin)( GLenum mode ); |
| 43 |
void (*edgeFlag)( GLboolean flag ); |
| 44 |
void (*vertex)( GLvoid *v ); |
| 45 |
void (*end)( void ); |
| 46 |
void (*error)( GLenum err ); |
| 47 |
} tess_callbacks; |
| 48 |
|
| 49 |
typedef struct vertex_str |
| 50 |
{ |
| 51 |
void *data; |
| 52 |
GLdouble location[3]; |
| 53 |
GLdouble x,y; |
| 54 |
GLboolean edge_flag; |
| 55 |
struct vertex_str *shadow_vertex; |
| 56 |
struct vertex_str *next,*previous; |
| 57 |
} tess_vertex; |
| 58 |
|
| 59 |
typedef struct contour_str |
| 60 |
{ |
| 61 |
GLenum type; |
| 62 |
GLuint vertex_cnt; |
| 63 |
GLdouble area; |
| 64 |
GLenum orientation; |
| 65 |
struct vertex_str *vertices,*last_vertex; |
| 66 |
struct contour_str *next,*previous; |
| 67 |
} tess_contour; |
| 68 |
|
| 69 |
typedef struct polygon_str |
| 70 |
{ |
| 71 |
GLuint vertex_cnt; |
| 72 |
GLdouble A,B,C,D; |
| 73 |
GLdouble area; |
| 74 |
GLenum orientation; |
| 75 |
struct vertex_str *vertices,*last_vertex; |
| 76 |
} tess_polygon; |
| 77 |
|
| 78 |
struct GLUtriangulatorObj |
| 79 |
{ |
| 80 |
tess_contour *contours,*last_contour; |
| 81 |
GLuint contour_cnt; |
| 82 |
tess_callbacks callbacks; |
| 83 |
tess_polygon *current_polygon; |
| 84 |
GLenum error; |
| 85 |
GLdouble A,B,C,D; |
| 86 |
projection_type projection; |
| 87 |
}; |
| 88 |
|
| 89 |
|
| 90 |
extern void tess_call_user_error(GLUtriangulatorObj *,GLenum); |
| 91 |
|