• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kig

  • sources
  • kde-4.14
  • kdeedu
  • kig
  • misc
builtin_stuff.cc
Go to the documentation of this file.
1 // Copyright (C) 2003 Dominique Devriese <devriese@kde.org>
2 
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.
7 
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.
12 
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., 51 Franklin Street, Fifth Floor, Boston, MA
16 // 02110-1301, USA.
17 
18 #include "builtin_stuff.h"
19 
20 #include <config-kig.h>
21 
22 #include "object_constructor.h"
23 #include "lists.h"
24 #include "special_constructors.h"
25 #include "guiaction.h"
26 
27 #include "../objects/angle_type.h"
28 #include "../objects/arc_type.h"
29 #include "../objects/circle_type.h"
30 #include "../objects/conic_types.h"
31 #include "../objects/cubic_type.h"
32 #include "../objects/intersection_types.h"
33 #include "../objects/inversion_type.h"
34 #include "../objects/line_imp.h"
35 #include "../objects/line_type.h"
36 #include "../objects/object_imp.h"
37 #include "../objects/other_imp.h"
38 #include "../objects/other_type.h"
39 #include "../objects/point_type.h"
40 #include "../objects/tests_type.h"
41 #include "../objects/transform_types.h"
42 #include "../objects/vector_type.h"
43 #include "../objects/polygon_type.h"
44 #include "../objects/bezier_type.h"
45 
46 #include <klocale.h>
47 
48 void setupBuiltinStuff()
49 {
50  static bool done = false;
51  if ( ! done )
52  {
53  ObjectConstructorList* ctors = ObjectConstructorList::instance();
54  GUIActionList* actions = GUIActionList::instance();
55  ObjectConstructor* c = 0;
56 
57  // point by coords...
58  c = new SimpleObjectTypeConstructor(
59  PointByCoordsType::instance(),
60  I18N_NOOP( "Point by Numeric Labels" ),
61  I18N_NOOP( "A point whose coordinates are given by two numeric labels" ),
62  "pointxy" );
63  ctors->add( c );
64  actions->add( new ConstructibleAction( c, "objects_new_point_by_coords" ) );
65 
66  // segment...
67  c = new SimpleObjectTypeConstructor(
68  SegmentABType::instance(), I18N_NOOP( "Segment" ),
69  I18N_NOOP( "A segment constructed from its start and end point" ),
70  "segment" );
71  ctors->add( c );
72  actions->add( new ConstructibleAction( c, "objects_new_segment", Qt::Key_S ) );
73 
74  // segment axis...
75  c = new SimpleObjectTypeConstructor(
76  SegmentAxisType::instance(), I18N_NOOP( "Segment Axis" ),
77  I18N_NOOP( "The perpendicular line through a given segment's mid point." ),
78  "segmentaxis" );
79  ctors->add( c );
80  actions->add( new ConstructibleAction( c, "objects_new_segment_axis" ) );
81 
82  // line by two points..
83  c = new SimpleObjectTypeConstructor(
84  LineABType::instance(), I18N_NOOP( "Line by Two Points" ),
85  I18N_NOOP( "A line constructed through two points"), "line" );
86  ctors->add( c );
87  actions->add( new ConstructibleAction( c, "objects_new_linettp", Qt::Key_L ) );
88 
89  // ray by two points..
90  c = new SimpleObjectTypeConstructor(
91  RayABType::instance(), I18N_NOOP( "Half-Line" ),
92  I18N_NOOP( "A half-line by its start point, and another point somewhere on it." ),
93  "ray" );
94  ctors->add( c );
95  actions->add( new ConstructibleAction( c, "objects_new_ray", Qt::Key_R ) );
96 
97  // perpendicular line
98  c = new SimpleObjectTypeConstructor(
99  LinePerpendLPType::instance(), I18N_NOOP( "Perpendicular" ),
100  I18N_NOOP( "A line constructed through a point, perpendicular to another line or segment." ),
101  "perpendicular" );
102  ctors->add( c );
103  actions->add( new ConstructibleAction( c, "objects_new_lineperpend" ) );
104 
105  // parallel line
106  c = new SimpleObjectTypeConstructor(
107  LineParallelLPType::instance(), I18N_NOOP( "Parallel" ),
108  I18N_NOOP( "A line constructed through a point, and parallel to another line or segment" ),
109  "parallel" );
110  ctors->add( c );
111  actions->add( new ConstructibleAction( c, "objects_new_lineparallel" ) );
112 
113  // circle
114  c = new SimpleObjectTypeConstructor(
115  CircleBCPType::instance(), I18N_NOOP( "Circle by Center && Point" ),
116  I18N_NOOP( "A circle constructed by its center and a point that pertains to it" ),
117  "circlebcp" );
118  ctors->add( c );
119  actions->add( new ConstructibleAction( c, "objects_new_circlebcp", Qt::Key_C ) );
120 
121  c = new SimpleObjectTypeConstructor(
122  CircleBTPType::instance(), I18N_NOOP( "Circle by Three Points" ),
123  I18N_NOOP( "A circle constructed through three points" ),
124  "circlebtp" );
125  ctors->add( c );
126  actions->add( new ConstructibleAction( c, "objects_new_circlebtp" ) );
127 
128  c = new SimpleObjectTypeConstructor(
129  CircleBPRType::instance(), I18N_NOOP( "Circle by Point && Radius" ),
130  I18N_NOOP( "A circle defined by its center and the length of the radius" ),
131  "circlebps" );
132  ctors->add( c );
133  actions->add( new ConstructibleAction( c, "objects_new_circlebpr" ) );
134 
135  // declare this object static to this function, so it gets deleted
136  // at the end of the program, without us having to wonder about
137  // deleting it.. We don't want to register this
138  // object-constructor, because that way, "construct the bisector"
139  // would appear twice in the angle popup menu: once as the generic
140  // construct a property stuff, and once because of this ctor..
141  // we only register the guiaction, cause it makes sense to have a
142  // toolbar icon for this..
143  static PropertyObjectConstructor anglebisectionctor(
144  AngleImp::stype(),
145  I18N_NOOP( "Construct Bisector of This Angle" ),
146  I18N_NOOP( "Select the angle you want to construct the bisector of..." ),
147  I18N_NOOP( "Angle Bisector" ),
148  I18N_NOOP( "The bisector of an angle" ),
149  "angle_bisector",
150  "angle-bisector" );
151  actions->add( new ConstructibleAction( &anglebisectionctor, "objects_new_angle_bisector" ) );
152 
153  // conic stuff
154  c = new SimpleObjectTypeConstructor(
155  ConicB5PType::instance(), I18N_NOOP( "Conic by Five Points" ),
156  I18N_NOOP( "A conic constructed through five points" ),
157  "conicb5p" );
158  ctors->add( c );
159  actions->add( new ConstructibleAction( c, "objects_new_conicb5p" ) );
160 
161  c = new SimpleObjectTypeConstructor(
162  ConicBAAPType::instance(),
163  I18N_NOOP( "Hyperbola by Asymptotes && Point" ),
164  I18N_NOOP( "A hyperbola with given asymptotes through a point" ),
165  "conicbaap" );
166  ctors->add( c );
167  actions->add( new ConstructibleAction( c, "objects_new_conicbaap" ) );
168 
169  c = new SimpleObjectTypeConstructor(
170  EllipseBFFPType::instance(),
171  I18N_NOOP( "Ellipse by Focuses && Point" ), // focuses is used in preference to foci
172  I18N_NOOP( "An ellipse constructed by its focuses and a point that pertains to it" ),
173  "ellipsebffp" );
174  ctors->add( c );
175  actions->add( new ConstructibleAction( c, "objects_new_ellipsebffp" ) );
176 
177  c = new SimpleObjectTypeConstructor(
178  HyperbolaBFFPType::instance(),
179  I18N_NOOP( "Hyperbola by Focuses && Point" ), // focuses is used in preference to foci
180  I18N_NOOP( "A hyperbola constructed by its focuses and a point that pertains to it" ),
181  "hyperbolabffp" );
182  ctors->add( c );
183  actions->add( new ConstructibleAction( c, "objects_new_hyperbolabffp" ) );
184 
185  c = new SimpleObjectTypeConstructor(
186  ConicBDFPType::instance(),
187  I18N_NOOP( "Conic by Directrix, Focus && Point" ),
188  I18N_NOOP( "A conic with given directrix and focus, through a point" ),
189  "conicbdfp" );
190  ctors->add( c );
191  actions->add( new ConstructibleAction( c, "objects_new_conicbdfp" ) );
192 
193  c = new SimpleObjectTypeConstructor(
194  ParabolaBTPType::instance(),
195  I18N_NOOP( "Vertical Parabola by Three Points" ),
196  I18N_NOOP( "A vertical parabola constructed through three points" ),
197  "parabolabtp" );
198  ctors->add( c );
199  actions->add( new ConstructibleAction( c, "objects_new_parabolabtp" ) );
200 
201  c = new SimpleObjectTypeConstructor(
202  CubicB9PType::instance(),
203  I18N_NOOP( "Cubic Curve by Nine Points" ),
204  I18N_NOOP( "A cubic curve constructed through nine points" ),
205  "cubicb9p" );
206  ctors->add( c );
207  actions->add( new ConstructibleAction( c, "objects_new_cubicb9p" ) );
208 
209  c = new SimpleObjectTypeConstructor(
210  ConicPolarPointType::instance(),
211  I18N_NOOP( "Polar Point of a Line" ),
212  I18N_NOOP( "The polar point of a line with respect to a conic." ),
213  "polarpoint" );
214  ctors->add( c );
215  actions->add( new ConstructibleAction( c, "objects_new_pointpolar" ) );
216 
217  c = new SimpleObjectTypeConstructor(
218  ConicPolarLineType::instance(),
219  I18N_NOOP( "Polar Line of a Point" ),
220  I18N_NOOP( "The polar line of a point with respect to a conic." ),
221  "polarline" );
222  ctors->add( c );
223  actions->add( new ConstructibleAction( c, "objects_new_linepolar" ) );
224 
225  c = new SimpleObjectTypeConstructor(
226  CubicNodeB6PType::instance(),
227  I18N_NOOP( "Cubic Curve with Node by Six Points" ),
228  I18N_NOOP( "A cubic curve with a nodal point at the origin through six points" ),
229  "cubicnodeb6p" );
230  ctors->add( c );
231  actions->add( new ConstructibleAction( c, "objects_new_cubicnodeb6p" ) );
232 
233  c = new SimpleObjectTypeConstructor(
234  CubicCuspB4PType::instance(),
235  I18N_NOOP( "Cubic Curve with Cusp by Four Points" ),
236  I18N_NOOP( "A cubic curve with a horizontal cusp at the origin through four points" ),
237  "cubiccuspb4p" );
238  ctors->add( c );
239  actions->add( new ConstructibleAction( c, "objects_new_cubiccuspb4p" ) );
240 
241  c = new SimpleObjectTypeConstructor(
242  VerticalCubicB4PType::instance(),
243  I18N_NOOP( "Cubic Function by Four Points" ),
244  I18N_NOOP( "A cubic function through four points" ),
245  "verticalcubicb4p" );
246  ctors->add( c );
247  actions->add( new ConstructibleAction( c, "objects_new_verticalcubicb4p" ) );
248 
249  c = new SimpleObjectTypeConstructor(
250  ConicDirectrixType::instance(),
251  I18N_NOOP( "Directrix of a Conic" ),
252  I18N_NOOP( "The directrix line of a conic." ),
253  "directrix" );
254  ctors->add( c );
255  actions->add( new ConstructibleAction( c, "objects_new_linedirectrix" ) );
256 
257  c = new SimpleObjectTypeConstructor(
258  AngleType::instance(),
259  I18N_NOOP( "Angle by Three Points" ),
260  I18N_NOOP( "An angle defined by three points" ),
261  "angle" );
262  ctors->add( c );
263  actions->add( new ConstructibleAction( c, "objects_new_angle", Qt::Key_A ) );
264 
265  c = new SimpleObjectTypeConstructor(
266  EquilateralHyperbolaB4PType::instance(),
267  I18N_NOOP( "Equilateral Hyperbola by Four Points" ),
268  I18N_NOOP( "An equilateral hyperbola constructed through four points" ),
269  "equilateralhyperbolab4p" );
270  ctors->add( c );
271  actions->add( new ConstructibleAction( c, "objects_new_equilateralhyperbolab4p" ) );
272 
273  {
274  // now for the Mid Point action. It does both the mid point of
275  // a segment, and the mid point of two points. The midpoint of
276  // two segments just shows the mid point property, and therefore
277  // doesn't need to be added to the ctors, because there are
278  // already facilities to construct an object's properties..
279  // therefore, we add only an mpotp to the ctors, and add the
280  // merged constructor only to the actions..
281  ctors->add( new MidPointOfTwoPointsConstructor() );
282 
283  ObjectConstructor* mpotp = new MidPointOfTwoPointsConstructor();
284  ObjectConstructor* mpos = new PropertyObjectConstructor(
285  SegmentImp::stype(), I18N_NOOP( "Construct the midpoint of this segment" ),
286  "", "", "", "", "mid-point" );
287 
288  // make this a static object, so it gets deleted at the end of
289  // the program.
290  static MergeObjectConstructor m(
291  I18N_NOOP( "Mid Point" ),
292  I18N_NOOP( "The midpoint of a segment or two other points" ),
293  "bisection" );
294  m.merge( mpotp );
295  m.merge( mpos );
296  actions->add( new ConstructibleAction( &m, "objects_new_midpoint", Qt::Key_M ) );
297  };
298 
299  c = new SimpleObjectTypeConstructor(
300  VectorType::instance(),
301  I18N_NOOP( "Vector" ),
302  I18N_NOOP( "Construct a vector from two given points." ),
303  "vector" );
304  ctors->add( c );
305  actions->add( new ConstructibleAction( c, "objects_new_vector", Qt::Key_V ) );
306 
307  c = new SimpleObjectTypeConstructor(
308  VectorSumType::instance(),
309  I18N_NOOP( "Vector Sum" ),
310  I18N_NOOP( "Construct the vector sum of two vectors." ),
311  "vectorsum" );
312  ctors->add( c );
313  actions->add( new ConstructibleAction( c, "objects_new_vectorsum", 0 ) );
314 
315  c = new SimpleObjectTypeConstructor(
316  LineByVectorType::instance(),
317  I18N_NOOP( "Line by Vector" ),
318  I18N_NOOP( "Construct the line by a given vector though a given point." ),
319  "linebyvector" );
320  ctors->add( c );
321  actions->add( new ConstructibleAction( c, "objects_new_linebyvector", 0 ) );
322 
323  c = new SimpleObjectTypeConstructor(
324  HalflineByVectorType::instance(),
325  I18N_NOOP( "Half-Line by Vector" ),
326  I18N_NOOP( "Construct the half-line by a given vector starting at given point." ),
327  "halflinebyvector" );
328  ctors->add( c );
329  actions->add( new ConstructibleAction( c, "objects_new_halflinebyvector", 0 ) );
330 
331  c = new SimpleObjectTypeConstructor(
332  ArcBTPType::instance(),
333  I18N_NOOP( "Arc by Three Points" ),
334  I18N_NOOP( "Construct an arc through three points." ),
335  "arc" );
336  ctors->add( c );
337  actions->add( new ConstructibleAction( c, "objects_new_arcbtp" ) );
338 
339  c = new SimpleObjectTypeConstructor(
340  ConicArcBCTPType::instance(),
341  I18N_NOOP( "Conic Arc by Center and Three Points" ),
342  I18N_NOOP( "Construct a conic arc with given center through three points." ),
343  "conicarc" );
344  ctors->add( c );
345  actions->add( new ConstructibleAction( c, "objects_new_conicarcbctp" ) );
346 
347  c = new SimpleObjectTypeConstructor(
348  ConicArcB5PType::instance(),
349  I18N_NOOP( "Conic Arc by Five Points" ),
350  I18N_NOOP( "Construct a conic arc through five points." ),
351  "conicarc" );
352  ctors->add( c );
353  actions->add( new ConstructibleAction( c, "objects_new_conicarcb5p" ) );
354 
355  c = new SimpleObjectTypeConstructor(
356  ArcBCPAType::instance(),
357  I18N_NOOP( "Arc by Center, Angle && Point" ),
358  I18N_NOOP( "Construct an arc by its center and a given angle, "
359  "starting at a given point" ),
360  "arcbcpa" );
361  ctors->add( c );
362  actions->add( new ConstructibleAction( c, "objects_new_arcbcpa" ) );
363 
364  c = new SimpleObjectTypeConstructor(
365  ParabolaBDPType::instance(),
366  I18N_NOOP( "Parabola by Directrix && Focus" ),
367  I18N_NOOP( "A parabola defined by its directrix and focus" ),
368  "parabolabdp" );
369  ctors->add( c );
370  actions->add( new ConstructibleAction( c, "objects_new_parabolabdp" ) );
371 
372  // Transformation stuff..
373 // c = new SimpleObjectTypeConstructor(
374 // CircularInversionType::instance(),
375 // I18N_NOOP( "Invert" ),
376 // I18N_NOOP( "The inversion of an object with respect to a circle" ),
377 // "inversion" );
378 // ctors->add( c );
379 // actions->add( new ConstructibleAction( c, "objects_new_inversion" ) );
380 
381  c = new InversionConstructor();
382  ctors->add( c );
383  actions->add( new ConstructibleAction( c, "objects_new_inversion" ) );
384 
385  c = new SimpleObjectTypeConstructor(
386  TranslatedType::instance(),
387  I18N_NOOP( "Translate" ),
388  I18N_NOOP( "The translation of an object by a vector" ),
389  "translation" );
390  ctors->add( c );
391  actions->add( new ConstructibleAction( c, "objects_new_translation" ) );
392 
393  c = new SimpleObjectTypeConstructor(
394  PointReflectionType::instance(),
395  I18N_NOOP( "Reflect in Point" ),
396  I18N_NOOP( "An object reflected in a point" ),
397  "centralsymmetry" );
398  ctors->add( c );
399  actions->add( new ConstructibleAction( c, "objects_new_pointreflection" ) );
400 
401  c = new SimpleObjectTypeConstructor(
402  LineReflectionType::instance(),
403  I18N_NOOP( "Reflect in Line" ),
404  I18N_NOOP( "An object reflected in a line" ),
405  "mirrorpoint" );
406  ctors->add( c );
407  actions->add( new ConstructibleAction( c, "objects_new_linereflection" ) );
408 
409  c = new SimpleObjectTypeConstructor(
410  RotationType::instance(),
411  I18N_NOOP( "Rotate" ),
412  I18N_NOOP( "An object rotated by an angle around a point" ),
413  "rotation" );
414  ctors->add( c );
415  actions->add( new ConstructibleAction( c, "objects_new_rotation" ) );
416 
417  c = new SimpleObjectTypeConstructor(
418  ScalingOverCenterType::instance(),
419  I18N_NOOP( "Scale" ),
420  I18N_NOOP( "Scale an object over a point, by the ratio given by the length of a segment" ),
421  "scale" );
422  ctors->add( c );
423  actions->add( new ConstructibleAction( c, "objects_new_scalingovercenter" ) );
424 
425  c = new SimpleObjectTypeConstructor(
426  ScalingOverLineType::instance(),
427  I18N_NOOP( "Scale over Line" ),
428  I18N_NOOP( "An object scaled over a line, by the ratio given by the length of a segment" ),
429  "stretch" );
430  ctors->add( c );
431  actions->add( new ConstructibleAction( c, "objects_new_scalingoverline" ) );
432 
433  c = new SimpleObjectTypeConstructor(
434  ScalingOverCenter2Type::instance(),
435  I18N_NOOP( "Scale (ratio given by two segments)" ),
436  I18N_NOOP( "Scale an object over a point, by the ratio given by the length of two segments" ),
437  "scale" );
438  ctors->add( c );
439  actions->add( new ConstructibleAction( c, "objects_new_scalingovercenter2" ) );
440 
441  c = new SimpleObjectTypeConstructor(
442  ScalingOverLine2Type::instance(),
443  I18N_NOOP( "Scale over Line (ratio given by two segments)" ),
444  I18N_NOOP( "An object scaled over a line, by the ratio given by the length of two segments" ),
445  "stretch" );
446  ctors->add( c );
447  actions->add( new ConstructibleAction( c, "objects_new_scalingoverline2" ) );
448 
449  c = new SimpleObjectTypeConstructor(
450  SimilitudeType::instance(),
451  I18N_NOOP( "Apply Similitude" ),
452  I18N_NOOP( "Apply a similitude to an object (the sequence of a scaling and rotation around a center)" ),
453  "similitude" );
454  ctors->add( c );
455  actions->add( new ConstructibleAction( c, "objects_new_similitude" ) );
456 
457  c = new SimpleObjectTypeConstructor(
458  HarmonicHomologyType::instance(),
459  I18N_NOOP( "Harmonic Homology" ),
460  I18N_NOOP( "The harmonic homology with a given center and a given axis (this is a projective transformation)" ),
461  "harmonichomology" );
462  ctors->add( c );
463  actions->add( new ConstructibleAction( c, "objects_new_harmonichomology" ) );
464 
465  c = new GenericAffinityConstructor();
466  ctors->add( c );
467  actions->add( new ConstructibleAction( c, "objects_new_genericaffinity" ) );
468 
469  c = new GenericProjectivityConstructor();
470  ctors->add( c );
471  actions->add( new ConstructibleAction( c, "objects_new_genericprojectivity" ) );
472 
473  c = new SimpleObjectTypeConstructor(
474  CastShadowType::instance(),
475  I18N_NOOP( "Draw Projective Shadow" ),
476  I18N_NOOP( "The shadow of an object with a given light source and projection plane (indicated by a line)" ),
477  "castshadow" );
478  ctors->add( c );
479  actions->add( new ConstructibleAction( c, "objects_new_castshadow" ) );
480 
481 // c = new SimpleObjectTypeConstructor(
482 // ProjectiveRotationType::instance(),
483 // I18N_NOOP( "Rotate Projectively" ),
484 // I18N_NOOP( "An object projectively rotated by an angle and a half-line" ),
485 // "projectiverotation" );
486 // ctors->add( c );
487 // actions->add( new ConstructibleAction( c, "objects_new_projectiverotation" ) );
488 
489  c = new MultiObjectTypeConstructor(
490  ConicAsymptoteType::instance(),
491  I18N_NOOP( "Asymptotes of a Hyperbola" ),
492  I18N_NOOP( "The two asymptotes of a hyperbola." ),
493  "conicasymptotes", -1, 1 );
494  ctors->add( c );
495  actions->add( new ConstructibleAction( c, "objects_new_lineconicasymptotes" ) );
496 
497  c = new ConicRadicalConstructor();
498  ctors->add( c );
499  actions->add( new ConstructibleAction( c, "objects_new_lineconicradical") );
500 
501  /* ----------- start polygons --------- */
502 
503  c = new SimpleObjectTypeConstructor(
504  TriangleB3PType::instance(),
505  I18N_NOOP( "Triangle by Its Vertices" ),
506  I18N_NOOP( "Construct a triangle given its three vertices." ),
507  "triangle" );
508  ctors->add( c );
509  actions->add( new ConstructibleAction( c, "objects_new_trianglebtp" ) );
510 
511  c = new PolygonBNPTypeConstructor();
512  ctors->add( c );
513  actions->add( new ConstructibleAction( c, "objects_new_polygonbnp" ));
514 
515  c = new OpenPolygonTypeConstructor();
516  ctors->add( c );
517  actions->add( new ConstructibleAction( c, "objects_new_openpolygon" ));
518 
519  c = new PolygonBCVConstructor();
520  ctors->add( c );
521  actions->add( new ConstructibleAction( c, "objects_new_polygonbcv" ) );
522 
523  c = new PolygonVertexTypeConstructor();
524  ctors->add( c );
525  actions->add( new ConstructibleAction( c, "objects_new_polygonvertices" ));
526 
527  c = new PolygonSideTypeConstructor();
528  ctors->add( c );
529  actions->add( new ConstructibleAction( c, "objects_new_polygonsides" ));
530 
531  c = new SimpleObjectTypeConstructor(
532  ConvexHullType::instance(), I18N_NOOP( "Convex Hull" ),
533  I18N_NOOP( "A polygon that corresponds to the convex hull of another polygon" ),
534  "convexhull" );
535  ctors->add( c );
536  actions->add( new ConstructibleAction( c, "objects_new_convexhull" ) );
537 
538  /* ----------- end polygons --------- */
539 
540  /* ----------- start bezier --------- */
541 
542  c = new SimpleObjectTypeConstructor(
543  BezierQuadricType::instance(),
544  I18N_NOOP( "Bézier Quadratic by its Control Points" ),
545  I18N_NOOP( "Construct a Bézier quadratic given its three control points." ),
546  "bezier3" );
547  ctors->add( c );
548  actions->add( new ConstructibleAction( c, "objects_new_bezierquadratic" ) );
549 
550  c = new SimpleObjectTypeConstructor(
551  BezierCubicType::instance(),
552  I18N_NOOP( "Bézier Cubic by its Control Points" ),
553  I18N_NOOP( "Construct a Bézier cubic given its four control points." ),
554  "bezier4" );
555  ctors->add( c );
556  actions->add( new ConstructibleAction( c, "objects_new_beziercubic" ) );
557 
558  c = new BezierCurveTypeConstructor();
559  ctors->add( c );
560  actions->add( new ConstructibleAction( c, "objects_new_beziercurve" ));
561 
562  c = new SimpleObjectTypeConstructor(
563  RationalBezierQuadricType::instance(),
564  I18N_NOOP( "Rational Bézier Quadratic by its Control Points" ),
565  I18N_NOOP( "Construct a Rational Bézier quadratic given its three control points." ),
566  "rbezier3" );
567  ctors->add( c );
568  actions->add( new ConstructibleAction( c, "objects_new_rationalbezierquadratic" ) );
569 
570  c = new SimpleObjectTypeConstructor(
571  RationalBezierCubicType::instance(),
572  I18N_NOOP( "Rational Bézier Cubic by its Control Points" ),
573  I18N_NOOP( "Construct a Rational Bézier cubic given its four control points." ),
574  "rbezier4" );
575  ctors->add( c );
576  actions->add( new ConstructibleAction( c, "objects_new_rationalbeziercubic" ) );
577 
578  c = new RationalBezierCurveTypeConstructor();
579  ctors->add( c );
580  actions->add( new ConstructibleAction( c, "objects_new_rationalbeziercurve" ));
581 
582 
583  /* ----------- end bezier ----------- */
584 
585  c = new LocusConstructor();
586  ctors->add( c );
587  actions->add( new ConstructibleAction( c, "objects_new_locus" ) );
588 
589  // tests
590  c = new TestConstructor(
591  AreParallelType::instance(),
592  I18N_NOOP( "Parallel Test" ),
593  I18N_NOOP( "Test whether two given lines are parallel" ),
594  "testparallel" );
595  ctors->add( c );
596  actions->add( new ConstructibleAction( c, "objects_new_areparallel" ) );
597 
598  c = new TestConstructor(
599  AreOrthogonalType::instance(),
600  I18N_NOOP( "Orthogonal Test" ),
601  I18N_NOOP( "Test whether two given lines are orthogonal" ),
602  "testorthogonal" );
603  ctors->add( c );
604  actions->add( new ConstructibleAction( c, "objects_new_areorthogonal" ) );
605 
606  c = new TestConstructor(
607  AreCollinearType::instance(),
608  I18N_NOOP( "Collinear Test" ),
609  I18N_NOOP( "Test whether three given points are collinear" ),
610  "testcollinear" );
611  ctors->add( c );
612  actions->add( new ConstructibleAction( c, "objects_new_arecollinear" ) );
613 
614  c = new TestConstructor(
615  ContainsTestType::instance(),
616  I18N_NOOP( "Contains Test" ),
617  I18N_NOOP( "Test whether a given curve contains a given point" ),
618  "testcontains" );
619  ctors->add( c );
620  actions->add( new ConstructibleAction( c, "objects_new_containstest" ) );
621 
622  c = new TestConstructor(
623  InPolygonTestType::instance(),
624  I18N_NOOP( "In Polygon Test" ),
625  I18N_NOOP( "Test whether a given polygon contains a given point" ),
626  "test" );
627  ctors->add( c );
628  actions->add( new ConstructibleAction( c, "objects_new_inpolygontest" ) );
629 
630  c = new TestConstructor(
631  ConvexPolygonTestType::instance(),
632  I18N_NOOP( "Convex Polygon Test" ),
633  I18N_NOOP( "Test whether a given polygon is convex" ),
634  "test" );
635  ctors->add( c );
636  actions->add( new ConstructibleAction( c, "objects_new_convexpolygontest" ) );
637 
638  c = new TestConstructor(
639  ExistenceTestType::instance(),
640  I18N_NOOP( "Existence Test" ),
641  I18N_NOOP( "Test whether a given object is constructible" ),
642  "test" );
643  ctors->add( c );
644  actions->add( new ConstructibleAction( c, "objects_new_existencetest" ) );
645 
646  c = new TestConstructor(
647  SameDistanceType::instance(),
648  I18N_NOOP( "Distance Test" ),
649  I18N_NOOP( "Test whether a given point have the same distance from a given point "
650  "and from another given point" ),
651  "testdistance" );
652  ctors->add( c );
653  actions->add( new ConstructibleAction( c, "objects_new_distancetest" ) );
654 
655  c = new TestConstructor(
656  VectorEqualityTestType::instance(),
657  I18N_NOOP( "Vector Equality Test" ),
658  I18N_NOOP( "Test whether two vectors are equal" ),
659  "test" );
660 // "testequal" );
661  ctors->add( c );
662  actions->add( new ConstructibleAction( c, "objects_new_vectorequalitytest" ) );
663 
664  c = new MeasureTransportConstructor();
665  ctors->add( c );
666  actions->add( new ConstructibleAction( c, "objects_new_measuretransport" ));
667 
668 // c = new SimpleObjectTypeConstructor(
669 // MeasureTransportType::instance(),
670 // I18N_NOOP( "Measure Transport" ),
671 // I18N_NOOP( "Transport the measure of a segment or arc over a line or circle." ),
672 // "measuretransport" );
673 // ctors->add( c );
674 // actions->add( new ConstructibleAction( c, "objects_new_measuretransport" ) );
675 
676  c = new SimpleObjectTypeConstructor(
677  ProjectedPointType::instance(),
678  I18N_NOOP( "Point Projection" ),
679  I18N_NOOP( "Project a point on a line" ),
680  "projection" );
681  ctors->add( c );
682  actions->add( new ConstructibleAction( c, "objects_new_projection" ) );
683 
684  // the generic intersection constructor..
685  c = new GenericIntersectionConstructor();
686  ctors->add( c );
687  actions->add( new ConstructibleAction( c, "objects_new_intersection", Qt::Key_I ) );
688 
689  // the generic tangent constructor
690  c = new TangentConstructor();
691  ctors->add( c );
692  actions->add( new ConstructibleAction( c, "objects_new_tangent", Qt::Key_T ) );
693 
694  // the generic center of curvature constructor
695  c = new CocConstructor();
696  ctors->add( c );
697  actions->add( new ConstructibleAction( c, "objects_new_centerofcurvature" ) );
698 
699  actions->add( new ConstructPointAction( "objects_new_normalpoint" ) );
700  actions->add( new ConstructTextLabelAction( "objects_new_textlabel" ) );
701  actions->add( new AddFixedPointAction( "objects_new_point_xy" ) );
702  actions->add( new ConstructNumericLabelAction( "objects_new_numericlabel" ) );
703 
704 #ifdef KIG_ENABLE_PYTHON_SCRIPTING
705 #include "../scripting/script-common.h"
706  actions->add( new NewScriptAction(
707  I18N_NOOP( "Python Script" ),
708  I18N_NOOP( "Construct a new Python script." ),
709  "objects_new_script_python",
710  ScriptType::Python ) );
711 #endif
712 
713 #if 0
714  actions->add( new TestAction( "test_stuff" ) );
715 #endif
716  };
717 
718  done = true;
719 }
MergeObjectConstructor
This class is a collection of some other ObjectConstructors, that makes them appear to the user as a ...
Definition: object_constructor.h:285
InPolygonTestType::instance
static const InPolygonTestType * instance()
Definition: tests_type.cc:229
GUIActionList
List of GUIActions for the parts to show.
Definition: lists.h:38
ConstructNumericLabelAction
Definition: guiaction.h:133
CastShadowType::instance
static const CastShadowType * instance()
Definition: transform_types.cc:651
ArcBTPType::instance
static const ArcBTPType * instance()
Definition: arc_type.cc:70
ScalingOverLineType::instance
static const ScalingOverLineType * instance()
Definition: transform_types.cc:290
InversionConstructor
Definition: special_constructors.h:375
ConicArcB5PType::instance
static const ConicArcB5PType * instance()
Definition: arc_type.cc:364
ExistenceTestType::instance
static const ExistenceTestType * instance()
Definition: tests_type.cc:403
CubicCuspB4PType::instance
static const CubicCuspB4PType * instance()
Definition: cubic_type.cc:135
PointReflectionType::instance
static const PointReflectionType * instance()
Definition: transform_types.cc:87
ConicDirectrixType::instance
static const ConicDirectrixType * instance()
Definition: conic_types.cc:395
lists.h
SimpleObjectTypeConstructor
A standard implementation of StandardConstructorBase for simple types.
Definition: object_constructor.h:188
AreCollinearType::instance
static const AreCollinearType * instance()
Definition: tests_type.cc:140
RotationType::instance
static const RotationType * instance()
Definition: transform_types.cc:161
TranslatedType::instance
static const TranslatedType * instance()
Definition: transform_types.cc:52
ScalingOverCenter2Type::instance
static const ScalingOverCenter2Type * instance()
Definition: transform_types.cc:248
LinePerpendLPType::instance
static LinePerpendLPType * instance()
Definition: line_type.cc:171
AreOrthogonalType::instance
static const AreOrthogonalType * instance()
Definition: tests_type.cc:94
ParabolaBDPType::instance
static const ParabolaBDPType * instance()
Definition: conic_types.cc:482
BezierQuadricType::instance
static const BezierQuadricType * instance()
Definition: bezier_type.cc:62
AngleType::instance
static const AngleType * instance()
Definition: angle_type.cc:63
ConvexPolygonTestType::instance
static const ConvexPolygonTestType * instance()
Definition: tests_type.cc:273
CubicB9PType::instance
static const CubicB9PType * instance()
Definition: cubic_type.cc:53
GenericAffinityConstructor
Definition: special_constructors.h:357
ObjectConstructorList
The list of object constructors for use in various places, e.g.
Definition: lists.h:69
CircleBPRType::instance
static const CircleBPRType * instance()
Definition: circle_type.cc:210
ConicBAAPType::instance
static const ConicBAAPType * instance()
Definition: conic_types.cc:102
RayABType::instance
static const RayABType * instance()
Definition: line_type.cc:119
ContainsTestType::instance
static const ContainsTestType * instance()
Definition: tests_type.cc:183
SimilitudeType::instance
static const SimilitudeType * instance()
Definition: transform_types.cc:866
VerticalCubicB4PType::instance
static const VerticalCubicB4PType * instance()
Definition: cubic_type.cc:173
RationalBezierCurveTypeConstructor
Definition: special_constructors.h:234
ObjectConstructorList::add
void add(ObjectConstructor *a)
Definition: lists.cc:155
LocusConstructor
Definition: special_constructors.h:331
ConstructPointAction
Definition: guiaction.h:87
VectorEqualityTestType::instance
static const VectorEqualityTestType * instance()
Definition: tests_type.cc:363
ConicArcBCTPType::instance
static const ConicArcBCTPType * instance()
Definition: arc_type.cc:255
PolygonBNPTypeConstructor
Definition: special_constructors.h:136
ScriptType::Python
Definition: script-common.h:36
ObjectConstructor
This class represents a way to construct a set of objects from a set of other objects.
Definition: object_constructor.h:44
ConvexHullType::instance
static const ConvexHullType * instance()
Definition: polygon_type.cc:1081
TestConstructor
Definition: special_constructors.h:414
EllipseBFFPType::instance
static const EllipseBFFPType * instance()
Definition: conic_types.cc:168
MidPointOfTwoPointsConstructor
Definition: special_constructors.h:399
AddFixedPointAction
Definition: guiaction.h:118
TriangleB3PType::instance
static const TriangleB3PType * instance()
Definition: polygon_type.cc:59
LineParallelLPType::instance
static LineParallelLPType * instance()
Definition: line_type.cc:204
setupBuiltinStuff
void setupBuiltinStuff()
Definition: builtin_stuff.cc:48
VectorType::instance
static const VectorType * instance()
Definition: vector_type.cc:43
ConicAsymptoteType::instance
static const ConicAsymptoteType * instance()
Definition: conic_types.cc:521
SegmentAxisType::instance
static const SegmentAxisType * instance()
Definition: line_type.cc:147
BezierCubicType::instance
static const BezierCubicType * instance()
Definition: bezier_type.cc:162
ConicPolarLineType::instance
static const ConicPolarLineType * instance()
Definition: conic_types.cc:360
ConicBDFPType::instance
static const ConicBDFPType * instance()
Definition: conic_types.cc:209
PolygonBCVConstructor
Definition: special_constructors.h:175
SegmentImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the SegmentImp type.
Definition: line_imp.cc:545
CocConstructor
Definition: special_constructors.h:449
ObjectConstructorList::instance
static ObjectConstructorList * instance()
Definition: lists.cc:129
CircleBCPType::instance
static const CircleBCPType * instance()
Definition: circle_type.cc:55
GenericIntersectionConstructor
Definition: special_constructors.h:383
ConicPolarPointType::instance
static const ConicPolarPointType * instance()
Definition: conic_types.cc:324
CircleBTPType::instance
static const CircleBTPType * instance()
Definition: circle_type.cc:66
SameDistanceType::instance
static const SameDistanceType * instance()
Definition: tests_type.cc:320
ParabolaBTPType::instance
static const ParabolaBTPType * instance()
Definition: conic_types.cc:283
ScalingOverCenterType::instance
static const ScalingOverCenterType * instance()
Definition: transform_types.cc:203
ConstructibleAction
Definition: guiaction.h:68
GenericProjectivityConstructor
Definition: special_constructors.h:366
MeasureTransportConstructor
Definition: special_constructors.h:275
ArcBCPAType::instance
static const ArcBCPAType * instance()
Definition: arc_type.cc:184
TangentConstructor
Definition: special_constructors.h:435
VectorSumType::instance
static const VectorSumType * instance()
Definition: vector_type.cc:80
LineByVectorType::instance
static const LineByVectorType * instance()
Definition: line_type.cc:316
HalflineByVectorType::instance
static const HalflineByVectorType * instance()
Definition: line_type.cc:356
CubicNodeB6PType::instance
static const CubicNodeB6PType * instance()
Definition: cubic_type.cc:95
ConicB5PType::instance
static const ConicB5PType * instance()
Definition: conic_types.cc:75
RationalBezierCubicType::instance
static const RationalBezierCubicType * instance()
Definition: bezier_type.cc:497
ScalingOverLine2Type::instance
static const ScalingOverLine2Type * instance()
Definition: transform_types.cc:331
MultiObjectTypeConstructor
This class is the equivalent of SimpleObjectTypeConstructor for object types that are constructed in ...
Definition: object_constructor.h:251
AngleImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the AngleImp type.
Definition: other_imp.cc:597
builtin_stuff.h
OpenPolygonTypeConstructor
Definition: special_constructors.h:156
GUIActionList::instance
static GUIActionList * instance()
Definition: lists.cc:42
BezierCurveTypeConstructor
Definition: special_constructors.h:215
guiaction.h
EquilateralHyperbolaB4PType::instance
static const EquilateralHyperbolaB4PType * instance()
Definition: conic_types.cc:442
GUIActionList::add
void add(GUIAction *a)
Definition: lists.cc:80
SegmentABType::instance
static const SegmentABType * instance()
Definition: line_type.cc:55
ConstructTextLabelAction
Definition: guiaction.h:103
PolygonVertexTypeConstructor
Definition: special_constructors.h:64
LineReflectionType::instance
static const LineReflectionType * instance()
Definition: transform_types.cc:122
RationalBezierQuadricType::instance
static const RationalBezierQuadricType * instance()
Definition: bezier_type.cc:384
PointByCoordsType::instance
static const PointByCoordsType * instance()
Definition: point_type.cc:799
HarmonicHomologyType::instance
static const HarmonicHomologyType * instance()
Definition: transform_types.cc:411
special_constructors.h
ConicRadicalConstructor
Definition: special_constructors.h:314
AreParallelType::instance
static const AreParallelType * instance()
Definition: tests_type.cc:50
ProjectedPointType::instance
static const ProjectedPointType * instance()
Definition: point_type.cc:829
PolygonSideTypeConstructor
Definition: special_constructors.h:79
PropertyObjectConstructor
A standard implementation of StandardConstructorBase for property objects...
Definition: object_constructor.h:215
MergeObjectConstructor::merge
void merge(ObjectConstructor *e)
Definition: object_constructor.cc:235
LineABType::instance
static const LineABType * instance()
Definition: line_type.cc:87
HyperbolaBFFPType::instance
static const HyperbolaBFFPType * instance()
Definition: conic_types.cc:198
object_constructor.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kig

Skip menu "kig"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal