From 09a105503755858a5c9e9d78cf3c0349f8eea052 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Tue, 5 Nov 2002 09:51:08 +0000 Subject: Suppression dans la structure ZnPoly de holes et migration de cw dans la structure ZnContour. Ajout de controls � la structure ZnContour pour faire de paths. Ajout de l'enum ZnContourCmd pour les op�rations sur les contours. Migration de fan de la structure ZnTristrip � la structure ZnStrip pour g�n�raliser (Tesselateur GLU). Ajout de ZnCombineData pour assurer le support du tesselateur GLU. --- generic/Types.h | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/generic/Types.h b/generic/Types.h index fec26b0..f46a4a0 100644 --- a/generic/Types.h +++ b/generic/Types.h @@ -47,8 +47,8 @@ extern "C" { typedef void *ZnItemClassId; typedef void *ZnItemId; -typedef double ZnReal; /* Keep it a double for GPC & libart. */ -typedef int ZnBool; /* Keep it an int to keep Tk & GPC happy */ +typedef double ZnReal; /* Keep it a double for GL. */ +typedef int ZnBool; /* Keep it an int to keep Tk happy */ typedef ZnReal ZnPos; typedef ZnReal ZnDim; typedef XColor *ZnColor; @@ -67,44 +67,49 @@ typedef struct { typedef struct { int num_points; ZnPoint *points; + char *controls; + ZnBool cw; } ZnContour; /* - * contour1/hole1 can be used to store a single contour - * without having to alloc the holes & contours arrays. - * The first three fields must be in sync with the gpc_polygon - * struct when using gpc. + * contour1 can be used to store a single contour + * without having to alloc the contours array. */ typedef struct { int num_contours; - ZnBool *holes; ZnContour *contours; - ZnBool *cw; - ZnBool hole1; ZnContour contour1; - ZnBool cw1; } ZnPoly; +/* + * Keep this enum in sync with op_strings in Contour() + * in tkZinc.c. + */ +typedef enum { + ZN_CONTOUR_ADD, ZN_CONTOUR_ADD_HOLE, ZN_CONTOUR_REMOVE +} ZnContourCmd; + typedef struct { int num_points; ZnPoint *points; + ZnBool fan; /* When using a fan, all contour vertices must be + * included to describe the contour as a polygon + * (clipping code use that to speed up region + * rendering) and the center must be the first + * vertex. */ } ZnStrip; -/* - * The first two fields must be kept in sync with gpc_tristrip - * when using gpc. - */ typedef struct { int num_strips; ZnStrip *strips; ZnStrip strip1; - ZnBool fan; /* When using a fan, all contour vertices must be - * included to describe the contour as a polygon - * (clipping code use that to speed up region - * rendering). */ - ZnPoint center; } ZnTriStrip; - + +typedef struct _ZnCombineData { + ZnReal v[2]; + struct _ZnCombineData *next; +} ZnCombineData; + /* * ZnBBox: orig is into the area while corner is not. * Thus the test: ((bbox.orig.x == bbox.corner.x) || -- cgit v1.1