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

kig

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