moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kig / filters / kseg-defs.h
blob448546967a79b6bada36c8f7c39861ab9012b0b7
1 // Copyright (C) 2003 Dominique Devriese <devriese@kde.org>
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place - Suite 330, Boston,
16 // MA 02111-1307, USA.
18 // this is a collection of definitions we need from KSeg. It includes
19 // code from defs.H and G_drawstyle.H. Thanks to Ilya Baran for
20 // making KSeg GPL, so there are no license probs or whatever..
23 * KSeg
24 * Copyright (C) 1999-2003 Ilya Baran
26 * This program is free software; you can redistribute it and/or modify
27 * it under the terms of the GNU General Public License as published by
28 * the Free Software Foundation; either version 2 of the License, or
29 * (at your option) any later version.
31 * This program is distributed in the hope that it will be useful,
32 * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 * GNU General Public License for more details.
36 * You should have received a copy of the GNU General Public License
37 * along with this program; if not, write to the Free Software
38 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
40 * Send comments and/or bug reports to:
41 * ibaran@mit.edu
45 #ifndef DEFS_H
46 #define DEFS_H
48 #include <stdio.h>
49 #include <stdlib.h>
50 #include <qglobal.h>
52 using namespace std;
54 #define DRAW_MAX 5000 // maximum coordinate. assumes you have a screen resolution less than this.
56 #define BIG (1e+37)
57 #define SMALL (1e-10)
59 inline int ROUND(double x) { return ((int)(x + 0.5)); }
60 inline int SIGN(double x) { return (x < 0) ? -1 : 1; }
61 inline int INTRAND(int a, int b) { return QMIN(a, b) + rand() % abs(a - b); }
62 #define SQR(x) ((x) * (x))
63 #define CUBE(x) ((x) * (x) * (x))
64 #define QUAD(x) (((x) * (x)) * ((x) * (x)))
66 enum G_Type
68 G_POINT = 1,
69 G_SEGMENT = 2,
70 G_RAY = 4,
71 G_LINE = 8,
72 G_CIRCLE = 16,
73 G_ARC = 32,
74 G_POLYGON = 64,
75 G_CIRCLEINTERIOR = 128,
76 G_ARCSECTOR = 256,
77 G_ARCSEGMENT = 512,
78 //non-primitive geometric types now:
79 G_LOCUS = 1024,
80 G_MEASURE = 2048,
81 G_CALCULATE = 4096,
82 G_ANNOTATION = 8192,
83 //fake type for scripting:
84 G_LOOP = 16384,
85 //compound types now:
86 G_STRAIGHT = G_SEGMENT | G_LINE | G_RAY,
87 G_CURVE = G_STRAIGHT | G_ARC | G_CIRCLE,
88 G_FILLED = G_POLYGON | G_CIRCLEINTERIOR | G_ARCSECTOR | G_ARCSEGMENT,
89 G_GEOMETRIC = G_POINT | G_CURVE | G_FILLED | G_LOCUS,
90 G_VALUE = G_MEASURE | G_CALCULATE,
91 G_TEXT = G_VALUE | G_ANNOTATION,
92 G_ANY = G_GEOMETRIC | G_TEXT | G_LOOP
95 enum G_AnyType
97 G_TRANSLATED,
98 G_ROTATED,
99 G_SCALED,
100 G_REFLECTED
103 #define IS_TRANSFORM(x) ((x) == G_TRANSLATED || (x) == G_ROTATED || (x) == G_SCALED || (x) == G_REFLECTED)
105 enum G_PointType
107 G_FREE_POINT = G_REFLECTED + 1,
108 G_CONSTRAINED_POINT,
109 G_INTERSECTION_POINT,
110 G_INTERSECTION2_POINT,
111 G_MID_POINT
114 enum G_SegmentType
116 G_ENDPOINTS_SEGMENT = G_REFLECTED + 1
119 enum G_RayType
121 G_TWOPOINTS_RAY = G_REFLECTED + 1,
122 G_BISECTOR_RAY
125 enum G_LineType
127 G_TWOPOINTS_LINE = G_REFLECTED + 1,
128 G_PARALLEL_LINE,
129 G_PERPENDICULAR_LINE
132 enum G_CircleType
134 G_CENTERPOINT_CIRCLE = G_REFLECTED + 1,
135 G_CENTERRADIUS_CIRCLE
138 enum G_ArcType
140 G_THREEPOINTS_ARC = G_REFLECTED + 1
143 enum G_FilledType
145 G_DEFAULT_FILLED = G_REFLECTED + 1
148 enum G_LocusType
150 G_OBJECT_LOCUS = G_REFLECTED + 1
153 enum G_MeasureType
155 G_DISTANCE_MEASURE,
156 G_LENGTH_MEASURE,
157 G_RADIUS_MEASURE,
158 G_ANGLE_MEASURE,
159 G_RATIO_MEASURE,
160 G_SLOPE_MEASURE,
161 G_AREA_MEASURE
164 enum G_CalculateType
166 G_REGULAR_CALCULATE
170 enum MenuIDs
172 ID_NEW_SEGMENT = 1,
173 ID_NEW_MIDPOINT,
174 ID_NEW_LINE,
175 ID_NEW_PERPENDICULAR,
176 ID_NEW_RAY,
177 ID_NEW_BISECTOR,
178 ID_NEW_CIRCLE,
179 ID_NEW_INTERSECTION,
180 ID_NEW_ARC,
181 ID_NEW_LOCUS,
182 ID_NEW_ARCSECTOR,
183 ID_NEW_ARCSEGMENT,
184 ID_NEW_CIRCLEINTERIOR,
185 ID_NEW_POLYGON,
187 ID_EDIT_UNDO,
188 ID_EDIT_REDO,
189 ID_EDIT_DELETE,
190 ID_EDIT_TOGGLELABELS,
191 ID_EDIT_SHOWLABELS,
192 ID_EDIT_HIDELABELS,
193 ID_EDIT_CHANGELABEL,
194 ID_EDIT_HIDE,
195 ID_EDIT_SHOWHIDDEN,
196 ID_EDIT_COLOR,
197 ID_EDIT_POINTSTYLE,
198 ID_EDIT_LINESTYLE,
199 ID_EDIT_FONT,
200 ID_EDIT_CHANGE_NUMBER_OF_SAMPLES,
201 ID_EDIT_PREFERENCES,
203 ID_EDIT_COLOR_BLACK,
204 ID_EDIT_COLOR_GRAY,
205 ID_EDIT_COLOR_RED,
206 ID_EDIT_COLOR_GREEN,
207 ID_EDIT_COLOR_BLUE,
208 ID_EDIT_COLOR_YELLOW,
209 ID_EDIT_COLOR_PURPLE,
210 ID_EDIT_COLOR_CYAN,
211 ID_EDIT_COLOR_OTHER,
213 ID_EDIT_POINTSTYLE_LARGECIRCLE,
214 ID_EDIT_POINTSTYLE_MEDIUMCIRCLE,
215 ID_EDIT_POINTSTYLE_SMALLCIRCLE,
217 ID_EDIT_LINESTYLE_SOLID,
218 ID_EDIT_LINESTYLE_DASHED,
219 ID_EDIT_LINESTYLE_DOTTED,
220 ID_EDIT_LINESTYLE_THIN,
221 ID_EDIT_LINESTYLE_NORMAL,
222 ID_EDIT_LINESTYLE_THICK,
224 ID_EDIT_FONT_10,
225 ID_EDIT_FONT_12,
226 ID_EDIT_FONT_14,
227 ID_EDIT_FONT_20,
228 ID_EDIT_FONT_30,
229 ID_EDIT_FONT_FONT,
231 ID_MEASURE_DISTANCE,
232 ID_MEASURE_LENGTH,
233 ID_MEASURE_RADIUS,
234 ID_MEASURE_ANGLE,
235 ID_MEASURE_RATIO,
236 ID_MEASURE_SLOPE,
237 ID_MEASURE_AREA,
238 ID_MEASURE_CALCULATE,
240 ID_TRANSFORM_CHOOSE_VECTOR,
241 ID_TRANSFORM_CHOOSE_MIRROR,
242 ID_TRANSFORM_CHOOSE_CENTER,
243 ID_TRANSFORM_CHOOSE_RATIO,
244 ID_TRANSFORM_CHOOSE_ANGLE,
245 ID_TRANSFORM_CLEAR_CHOSEN,
246 ID_TRANSFORM_TRANSLATE,
247 ID_TRANSFORM_ROTATE,
248 ID_TRANSFORM_REFLECT,
249 ID_TRANSFORM_SCALE,
251 ID_CONSTRUCTION_MAKE_NORMAL,
252 ID_CONSTRUCTION_MAKE_GIVEN,
253 ID_CONSTRUCTION_MAKE_FINAL,
254 ID_CONSTRUCTION_MAKE_INITIAL,
255 ID_CONSTRUCTION_RECURSE,
257 ID_PLAY_QUICKPLAY,
259 ID_QUICKPLAY_SET_DIRECTORY,
261 ID_FILE_RECENTLIST_START //should be the last entry
264 #endif //DEFS_H
268 * KSeg
269 * Copyright (C) 1999-2003 Ilya Baran
271 * This program is free software; you can redistribute it and/or modify
272 * it under the terms of the GNU General Public License as published by
273 * the Free Software Foundation; either version 2 of the License, or
274 * (at your option) any later version.
276 * This program is distributed in the hope that it will be useful,
277 * but WITHOUT ANY WARRANTY; without even the implied warranty of
278 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
279 * GNU General Public License for more details.
281 * You should have received a copy of the GNU General Public License
282 * along with this program; if not, write to the Free Software
283 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
285 * Send comments and/or bug reports to:
286 * ibaran@mit.edu
290 #ifndef G_DRAWSTYLE_H
291 #define G_DRAWSTYLE_H
293 enum PointStyle
295 ANY = 0,
296 SMALL_CIRCLE,
297 MEDIUM_CIRCLE,
298 LARGE_CIRCLE
301 #endif //G_DRAWSTYLE_H