1 /* $Id: tess.h,v 1.16 1999/12/06 09:39:34 gareth Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999 Brian Paul All Rights Reserved.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 /*****************************************************************************
29 * GLU 1.3 Polygon Tessellation by Gareth Hughes <garethh@bell-labs.com>
31 *****************************************************************************/
33 #ifndef __GLU_TESS_H__
34 #define __GLU_TESS_H__
41 #include "tess_typedefs.h"
42 #include "tess_macros.h"
43 #include "tess_hash.h"
44 #include "tess_heap.h"
46 #include "tess_grid.h"
53 /*****************************************************************************
54 * The GLUtesselator structure:
55 *****************************************************************************/
58 tess_callbacks_t callbacks
;
60 GLboolean boundary_only
;
65 tess_contour_t
*contours
, *last_contour
;
66 tess_contour_t
*current_contour
;
67 GLdouble mins
[2], maxs
[2];
69 tess_vertex_t
**sorted_vertices
;
71 tess_grid_t
*grid
; /* Not currently used... */
81 /*****************************************************************************
82 * Common tessellation functions:
83 *****************************************************************************/
84 extern void tess_error_callback( GLUtesselator
*, GLenum
);
86 extern GLdouble
twice_contour_area( tess_contour_t
*contour
);
87 extern void reverse_contour( tess_contour_t
*contour
);
88 extern void delete_contour( tess_contour_t
**contour
);
90 extern void contour_dump( tess_contour_t
*contour
);
93 /*****************************************************************************
95 *****************************************************************************/
97 extern int tess_dbg_level
;
99 #define DBG_LEVEL_BASE 1
100 #define DBG_LEVEL_VERBOSE 10
101 #define DBG_LEVEL_ENTEREXIT 20
104 #define DBG_STREAM stdout
106 #define DBG_STREAM stderr
110 #define MSG( level, format, args... ) \
111 if ( level <= tess_dbg_level ) { \
112 fprintf( DBG_STREAM, "%9.9s:%d:\t ", __FILE__, __LINE__ ); \
113 fprintf( DBG_STREAM, format, ## args ); \
114 fflush( DBG_STREAM ); \
118 #endif /* __GNUC__ */
124 extern INLINE
void tess_msg( GLint level
, char *format
, ... );
125 extern INLINE
void tess_info( char *file
, GLint line
);
131 #endif /* __GLU_TESS_H__ */