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..
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:
54 #define DRAW_MAX 5000 // maximum coordinate. assumes you have a screen resolution less than this.
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)))
75 G_CIRCLEINTERIOR
= 128,
78 //non-primitive geometric types now:
83 //fake type for scripting:
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
103 #define IS_TRANSFORM(x) ((x) == G_TRANSLATED || (x) == G_ROTATED || (x) == G_SCALED || (x) == G_REFLECTED)
107 G_FREE_POINT
= G_REFLECTED
+ 1,
109 G_INTERSECTION_POINT
,
110 G_INTERSECTION2_POINT
,
116 G_ENDPOINTS_SEGMENT
= G_REFLECTED
+ 1
121 G_TWOPOINTS_RAY
= G_REFLECTED
+ 1,
127 G_TWOPOINTS_LINE
= G_REFLECTED
+ 1,
134 G_CENTERPOINT_CIRCLE
= G_REFLECTED
+ 1,
135 G_CENTERRADIUS_CIRCLE
140 G_THREEPOINTS_ARC
= G_REFLECTED
+ 1
145 G_DEFAULT_FILLED
= G_REFLECTED
+ 1
150 G_OBJECT_LOCUS
= G_REFLECTED
+ 1
175 ID_NEW_PERPENDICULAR
,
184 ID_NEW_CIRCLEINTERIOR
,
190 ID_EDIT_TOGGLELABELS
,
200 ID_EDIT_CHANGE_NUMBER_OF_SAMPLES
,
208 ID_EDIT_COLOR_YELLOW
,
209 ID_EDIT_COLOR_PURPLE
,
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
,
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
,
248 ID_TRANSFORM_REFLECT
,
251 ID_CONSTRUCTION_MAKE_NORMAL
,
252 ID_CONSTRUCTION_MAKE_GIVEN
,
253 ID_CONSTRUCTION_MAKE_FINAL
,
254 ID_CONSTRUCTION_MAKE_INITIAL
,
255 ID_CONSTRUCTION_RECURSE
,
259 ID_QUICKPLAY_SET_DIRECTORY
,
261 ID_FILE_RECENTLIST_START
//should be the last entry
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:
290 #ifndef G_DRAWSTYLE_H
291 #define G_DRAWSTYLE_H
301 #endif //G_DRAWSTYLE_H