head 1.10; access; symbols KDE_1_1_1_RELEASE:1.7 KDE_1_1_BRANCH:1.7.0.4 KDE_1_1_RELEASE:1.7 KDE_1_1_pre2:1.7 kde_1_1_alpha_1:1.7 beta1-0_2:1.7; locks; strict; comment @ * @; 1.10 date 99.06.22.06.58.26; author garbanzo; state Exp; branches; next 1.9; 1.9 date 99.06.21.14.42.46; author tibirna; state Exp; branches; next 1.8; 1.8 date 99.03.01.23.26.34; author kulow; state Exp; branches; next 1.7; 1.7 date 98.10.19.16.54.37; author budnik; state Exp; branches 1.7.2.1; next 1.6; 1.6 date 98.09.29.17.05.30; author budnik; state Exp; branches; next 1.5; 1.5 date 98.09.28.18.07.25; author budnik; state Exp; branches; next 1.4; 1.4 date 98.09.25.16.52.58; author budnik; state Exp; branches; next 1.3; 1.3 date 98.09.23.06.08.16; author budnik; state Exp; branches; next 1.2; 1.2 date 98.09.16.02.54.13; author budnik; state Exp; branches; next 1.1; 1.1 date 98.09.06.12.30.31; author denis; state Exp; branches; next ; 1.7.2.1 date 99.02.23.10.03.25; author kulow; state Exp; branches; next ; desc @@ 1.10 log @Make this a bit neater, and make it compile. @ text @/* - written 1998 by Alexander Budnik This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef K_CONF_OBJS #define K_CONF_OBJS "$Id$" #include #include "kobjconf.h" /** These objects can handle a group of objects with keys matching regular expressions. It uses QStrList as data - list of strings for matched keys. For example if you want to read keys keyAB=... keyBC=.. ... keyAZ=.. use this object: registerObject(new KConfigMatchKeysObject(QRegExp("key[A-Z][A-Z]", list, ','); */ class KConfigMatchKeysObject: public KConfigObject { protected: QRegExp regexp; /** KConfigObject reimplemented read data method */ virtual void readObject(KObjectConfig*); /** KConfigObject reimplemented write data method */ virtual void writeObject(KObjectConfig*); public: /** Create new object to read all keys matched regular expression. @@param match The Regular Expression @@param list QStrList variable to read/write data. Each matched key readed as QString item of list. */ KConfigMatchKeysObject(const QRegExp& match, QStrList& list); QStrList separate(int index, char sep=','); }; /** This objects can handle a group of objects with keys numbered without holes glEnd(); angle += delta_angle; } } else if (qobj->DrawStyle==GLU_SILHOUETTE) { GLint slice; GLdouble angle, delta_angle; delta_angle = DEG_TO_RAD(sweepAngle / slices); /* draw outer ring */ glBegin( GL_LINE_STRIP ); angle = DEG_TO_RAD(startAngle); for (slice=0; slice<=slices; slice++) { glVertex2d( outerRadius * sin(angle), outerRadius * cos(angle) ); angle += delta_angle; } glEnd(); /* draw inner ring */ if (innerRadius>0.0) { glBegin( GL_LINE_STRIP ); angle = DEG_TO_RAD(startAngle); for (slice=0; sliceDrawStyle==GLU_FILL) { GLint loop, slice; GLdouble radius, delta_radius; GLdouble angle, delta_angle; delta_radius = (outerRadius - innerRadius) / loops; delta_angle = DEG_TO_RAD(sweepAngle / slices); radius = innerRadius; for (loop=0; loopOrientation==GLU_OUTSIDE) { glVertex2d( (radius+delta_radius)*sin(angle), (radius+delta_radius)*cos(angle) ); glVertex2d( radius * sin(angle), radius * cos(angle) ); } else { glVertex2d( radius * sin(angle), radius * cos(angle) ); glVertex2d( (radius+delta_radius)*sin(angle), (radius+delta_radius)*cos(angle) ); } angle += delta_angle; } glEnd(); radius += delta_radius; } } } /* $Id: tess.c,v 1.11 1999/02/27 13:55:31 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.1 * Copyright (C) 1995-1999 Brian Paul * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * $Log: tess.c,v $ * Revision 1.11 1999/02/27 13:55:31 brianp * fixed BeOS-related GLU typedef problems * * Revision 1.10 1999/01/03 03:23:15 brianp * now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump) * * Revision 1.9 1998/06/01 01:10:29 brianp * small update for Next/OpenStep from Alexander Mai * * Revision 1.8 1998/02/04 00:27:58 brianp * cygnus changes from Stephane Rehel * * Revision 1.7 1998/01/16 03:35:26 brianp * fixed Windows compilation warnings (Theodore Jump) * * Revision 1.6 1997/09/17 01:51:48 brianp * changed glu*Callback() functions to match prototype in glu.h * * Revision 1.5 1997/07/24 01:28:44 brianp * changed precompiled header symbol from PCH to PC_HEADER * * Revision 1.4 1997/05/28 02:29:38 brianp * added support for precompiled headers (PCH), inserted APIENTRY keyword * * Revision 1.3 1996/11/12 01:23:02 brianp * added test to prevent free(vertex) when vertex==NULL in delete_contours() * * Revision 1.2 1996/10/22 22:57:19 brianp * better error handling in gluBegin/EndPolygon() from Erich Eder * * Revision 1.1 1996/09/27 01:19:39 brianp * Initial revision * */ /* * This file is part of the polygon tesselation code contributed by * Bogdan Sikorski */ #ifdef PC_HEADER #include "all.h" #else #include #include #include "tess.h" #endif /* * This is ugly, but seems the easiest way to do things to make the * code work under YellowBox for Windows */ #if defined(OPENSTEP) && defined(GLCALLBACK) #undef GLCALLBACK #define GLCALLBACK #endif extern void tess_test_polygon(GLUtriangulatorObj *); extern void tess_find_contour_hierarchies(GLUtriangulatorObj *); extern void tess_handle_holes(GLUtriangulatorObj *); extern void tess_tesselate(GLUtriangulatorObj *); extern void tess_tesselate_with_edge_flag(GLUtriangulatorObj *); static void delete_contours(GLUtriangulatorObj *); #ifdef __CYGWIN32__ #define _CALLBACK #else #define _CALLBACK GLCALLBACK #endif void init_callbacks(tess_callbacks *callbacks) { callbacks->begin = ( void (_CALLBACK*)(GLenum) ) 0; callbacks->edgeFlag = ( void (_CALLBACK*)(GLboolean) ) 0; callbacks->vertex = ( void (_CALLBACK*)(void*) ) 0; callbacks->end = ( void (_CALLBACK*)(void) ) 0; callbacks->error = ( void (_CALLBACK*)(GLenum) ) 0; } void tess_call_user_error(GLUtriangulatorObj *tobj, GLenum gluerr) { if(tobj->error==GLU_NO_ERROR) tobj->error=gluerr; if(tobj->callbacks.error!=NULL) (tobj->callbacks.error)(gluerr); } GLUtriangulatorObj* GLAPIENTRY gluNewTess( void ) { GLUtriangulatorObj *tobj; tobj = (GLUtriangulatorObj *) malloc(sizeof(struct GLUtesselator)); if (!tobj) return NULL; tobj->contours=tobj->last_contour=NULL; init_callbacks(&tobj->callbacks); tobj->error=GLU_NO_ERROR; tobj->current_polygon=NULL; tobj->contour_cnt=0; return tobj; } void GLAPIENTRY gluTessCallback( GLUtriangulatorObj *tobj, GLenum which, void (GLCALLBACK *fn)() ) { switch(which) { case GLU_BEGIN: tobj->callbacks.begin = (void (_CALLBACK*)(GLenum)) fn; break; case GLU_EDGE_FLAG: tobj->callbacks.edgeFlag = (void (_CALLBACK*)(GLboolean)) fn; break; case GLU_VERTEX: tobj->callbacks.vertex = (void (_CALLBACK*)(void *)) fn; break; case GLU_END: tobj->callbacks.end = (void (_CALLBACK*)(void)) fn; break; case GLU_ERROR: tobj->callbacks.error = (void (_CALLBACK*)(GLenum)) fn; break; default: tobj->error=GLU_INVALID_ENUM; break; } } void GLAPIENTRY gluDeleteTess( GLUtriangulatorObj *tobj ) { if(tobj->error==GLU_NO_ERROR && tobj->contour_cnt) /* was gluEndPolygon called? */ tess_call_user_error(tobj,GLU_TESS_ERROR1); /* delete all internal structures */ delete_contours(tobj); free(tobj); } void GLAPIENTRY gluBeginPolygon( GLUtriangulatorObj *tobj ) { /* if(tobj->error!=GLU_NO_ERROR) return; */ tobj->error = GLU_NO_ERROR; if(tobj->current_polygon!=NULL) { /* gluEndPolygon was not called */ tess_call_user_error(tobj,GLU_TESS_ERROR1); /* delete all internal structures */ delete_contours(tobj); } else { if((tobj->current_polygon= (tess_polygon *)malloc(sizeof(tess_polygon)))==NULLl" errors. Better map substitution in "Add map" dialog. Change in message reporting (MsgBox) @ text @d109 1 a109 1 virtual QWidget* createWidget(QWidget* parent=0L, const char* label=0L); @ 1.7.2.1 log @extreme QStringing @ text @d109 1 a109 1 virtual QWidget* createWidget(QWidget* parent=0L, const char* label=0); @ 1.6 log @- fix foreground color configuration - new things in kobjectconfig - new model of configuration @ text @d177 1 a179 1 const char **list, **labels; d203 4 d218 5 d233 1 a233 1 void setIndex(int i) {if(pstring) *pstring = list[i]; else *pindex = i;} d235 1 a235 1 return QString(pindex?list[*pindex]:(const char*)*pstring); @ 1.5 log @A lot of things. - fix bug in reading keycodes - codding "defaults" in kcmikbd - untested lt.kimap added - big changes in kobjectconfig @ text @d92 2 a93 3 /** * Boolean Config Object */ d97 1 a97 2 /** KConfigObject reimplemented read data method d99 2 a100 3 void readObject(KObjectConfig*); /** KConfigObject reimplemented write data method d102 2 a103 1 void writeObject(KObjectConfig*); d110 2 d176 1 a176 1 protected: d182 1 a182 2 /** KConfigObject reimplemented write data method d184 2 a185 3 void readObject(KObjectConfig*); /** KConfigObject reimplemented write data method d187 2 a188 1 void writeObject(KObjectConfig*); d190 1 a190 1 public: d223 2 a224 2 int getIndex() const {return pindex?*pindex:getIndex(*pstring);} void setIndex(int i) {if(pstring) *pstring = list[i]; else *pindex = i;} d228 2 a229 1 friend class KConfigComboWidget; d232 1 a232 5 /** OColor Object d237 1 a237 2 /** KConfigObject reimplemented write data method d239 2 a240 3 void readObject(KObjectConfig*); /** KConfigObject reimplemented write data method d242 2 a243 1 void writeObject(KObjectConfig*); d245 1 a245 2 /** Construct new Color object. d249 2 a250 3 /** Create colored button connected to KColorDialog. Parameter label ignored. d254 1 a254 1 void changed(const QColor&)n 1.4 1997/05/28 02:29:38 brianp * added support for precompiled headers (PCH), inserted APIENTRY keyword * * Revision 1.3 1997/02/17 17:24:58 brianp * more tesselation changes (Randy Frank) * * Revision 1.2 1997/02/13 18:31:57 brianp * fixed some numerical precision problems (Randy Frank) * * Revision 1.1 1996/09/27 01:19:39 brianp * Initial revision * */ /* * This file is part of the polygon tesselation code contributed by * Bogdan Sikorski */ #ifdef PC_HEADER #include "all.h" #else #include #include #include "tess.h" #endif static GLboolean edge_flag; static void emit_triangle(GLUtriangulatorObj *, tess_vertex *, tess_vertex *,tess_vertex *); static void emit_triangle_with_edge_flag(GLUtriangulatorObj *, tess_vertex *,GLboolean,tess_vertex *,GLboolean, tess_vertex *,GLboolean); static GLdouble twice_the_triangle_area( tess_vertex *va, tess_vertex *vb, tess_vertex *vc) { return (vb->x - va->x)*(vc->y - va->y) - (vb->y - va->y)*(vc->x - va->x); } static GLboolean left( GLdouble A, GLdouble B, GLdouble C, GLdouble x, GLdouble y) { if(A*x+B*y+C > -EPSILON) return GL_TRUE; else return GL_FALSE; } static GLboolean right( GLdouble A, GLdouble B, GLdouble C, GLdouble x, GLdouble y) { if(A*x+B*y+C < EPSILON) return GL_TRUE; else return GL_FALSE; } static GLint convex_ccw( tess_vertex *va, tess_vertex *vb, tess_vertex *vc, GLUtriangulatorObj *tobj) { GLdouble d; d = twice_the_triangle_area(va,vb,vc); if (d > EPSILON ) { return 1; } else if (d < -EPSILON ) { return 0; } else { return -1; } } static GLint convex_cw( tess_vertex *va, tess_vertex *vb, tess_vertex *vc, GLUtriangulatorObj *tobj) { GLdouble d; d = twice_the_triangle_area(va,vb,vc); if (d < -EPSILON ) { return 1; } else if (d > EPSILON ) { return 0; } else { return -1; } } static GLboolean diagonal_ccw( tess_vertex *va, tess_vertex *vb, GLUtriangulatorObj *tobj, tess_contour *contour) { tess_vertex *vc=va->next , *vertex , *shadow_vontour->vertices,contour->vertices->next, contour->vertices->next->next); } } void tess_tesselate_with_edge_flag(GLUtriangulatorObj *tobj) { tess_contour *contour; edge_flag=GL_TRUE; /* first callback with edgeFlag set to GL_TRUE */ (tobj->callbacks.edgeFlag)(GL_TRUE); for(contour=tobj->contours;contour!=NULL;contour=contour->next) { if(contour->orientation==GLU_CCW) triangulate_ccw_with_edge_flag(tobj,contour); else triangulate_cw_with_edge_flag(tobj,contour); if(tobj->error!=GLU_NO_ERROR) return; /* emit the last triangle */ emit_triangle_with_edge_flag(tobj,contour->vertices, contour->vertices->edge_flag,contour->vertices->next, contour->vertices->next->edge_flag,contour->vertices->next->next, contour->vertices->next->next->edge_flag); } } static void emit_triangle( GLUtriangulatorObj *tobj, tess_vertex *v1, tess_vertex *v2, tess_vertex *v3) { (tobj->callbacks.begin)(GL_TRIANGLES); (tobj->callbacks.vertex)(v1->data); (tobj->callbacks.vertex)(v2->data); (to createWidget(QWidget* parent=0L); @ 1.2 log @New in kobjconfig @ text @d1 20 @ 1.1 log @KIKbd added. Looks like it compiles ok. Please check it out on platforms other than Linux. @ text @d46 5 d75 5 d101 5 d124 5 d147 5 d171 5 d223 4 d254 4 @