home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / mesa-1.2.8 / src-glu / tess.h < prev    next >
C/C++ Source or Header  |  1996-05-27  |  3KB  |  118 lines

  1. /* tess.c */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  1.2
  6.  * Copyright (C) 1995  Brian Paul  (brianp@ssec.wisc.edu)
  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. /*
  25. $Id: tess.h,v 1.6 1995/07/28 21:36:26 brianp Exp $
  26.  
  27. $Log: tess.h,v $
  28.  * Revision 1.6  1995/07/28  21:36:26  brianp
  29.  * changed all GLUenum to GLenum
  30.  *
  31.  * Revision 1.5  1995/05/26  19:06:52  brianp
  32.  * replaced GLenum with GLUenum in tesselator error callback function
  33.  *
  34.  * Revision 1.4  1995/05/22  16:56:20  brianp
  35.  * Release 1.2
  36.  *
  37.  * Revision 1.3  1995/05/16  19:17:21  brianp
  38.  * minor changes to allow compilation with real OpenGL headers
  39.  *
  40.  * Revision 1.2  1995/04/28  20:07:08  brianp
  41.  * renamed struct GLUtriangulatorObj to struct glu_triangulator_obj
  42.  *
  43.  * Revision 1.1  1995/04/28  16:19:34  brianp
  44.  * Initial revision
  45.  *
  46.  */
  47.  
  48.  
  49. /*
  50.  * This file is part of the polygon tesselation code contributed by
  51.  * Bogdan Sikorski
  52.  */
  53.  
  54.  
  55. #include "gluP.h"
  56.  
  57. #define EPSILON 1e-06 /* epsilon for double precision compares */
  58.  
  59. typedef enum
  60. {
  61.     OXY,
  62.     OYZ,
  63.     OXZ
  64. } projection_type;
  65.  
  66. typedef struct callbacks_str
  67. {
  68.     void (*begin)( GLenum mode );
  69.     void (*edgeFlag)( GLboolean flag );
  70.     void (*vertex)( GLvoid *v );
  71.     void (*end)( void );
  72.     void (*error)( GLenum err );
  73. } tess_callbacks;
  74.  
  75. typedef struct vertex_str
  76. {
  77.     void                *data;
  78.     GLdouble            location[3];
  79.     GLdouble            x,y;
  80.     GLboolean            edge_flag;
  81.     struct vertex_str    *shadow_vertex;
  82.     struct vertex_str    *next,*previous;
  83. } tess_vertex;
  84.  
  85. typedef struct contour_str
  86. {
  87.     GLenum                type;
  88.     GLuint                vertex_cnt;
  89.     GLdouble            area;
  90.     GLenum                orientation;
  91.     struct vertex_str    *vertices,*last_vertex;
  92.     struct contour_str    *next,*previous;
  93. } tess_contour;
  94.  
  95. typedef struct polygon_str
  96. {
  97.     GLuint                vertex_cnt;
  98.     GLdouble            A,B,C,D;
  99.     GLdouble            area;
  100.     GLenum                orientation;
  101.     struct vertex_str    *vertices,*last_vertex;
  102. } tess_polygon;
  103.  
  104. struct GLUtriangulatorObj
  105. {
  106.     tess_contour        *contours,*last_contour;
  107.     GLuint                contour_cnt;
  108.     tess_callbacks        callbacks;
  109.     tess_polygon        *current_polygon;
  110.     GLenum                error;
  111.     GLdouble            A,B,C,D;
  112.     projection_type        projection;
  113. };
  114.  
  115.  
  116. extern void tess_call_user_error(GLUtriangulatorObj *,GLenum);
  117.  
  118.