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

kig

builtin_stuff.cc

Go to the documentation of this file.
00001 // Copyright (C)  2003  Dominique Devriese <devriese@kde.org>
00002 
00003 // This program is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU General Public License
00005 // as published by the Free Software Foundation; either version 2
00006 // of the License, or (at your option) any later version.
00007 
00008 // This program is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 // GNU General Public License for more details.
00012 
00013 // You should have received a copy of the GNU General Public License
00014 // along with this program; if not, write to the Free Software
00015 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00016 // 02110-1301, USA.
00017 
00018 #include "builtin_stuff.h"
00019 
00020 #include <config-kig.h>
00021 
00022 #include "object_constructor.h"
00023 #include "lists.h"
00024 #include "special_constructors.h"
00025 #include "guiaction.h"
00026 
00027 #include "../objects/angle_type.h"
00028 #include "../objects/arc_type.h"
00029 #include "../objects/circle_type.h"
00030 #include "../objects/conic_types.h"
00031 #include "../objects/cubic_type.h"
00032 #include "../objects/intersection_types.h"
00033 #include "../objects/inversion_type.h"
00034 #include "../objects/line_imp.h"
00035 #include "../objects/line_type.h"
00036 #include "../objects/object_imp.h"
00037 #include "../objects/other_imp.h"
00038 #include "../objects/other_type.h"
00039 #include "../objects/point_type.h"
00040 #include "../objects/tests_type.h"
00041 #include "../objects/transform_types.h"
00042 #include "../objects/vector_type.h"
00043 #include "../objects/polygon_type.h"
00044 
00045 #include <klocale.h>
00046 
00047 void setupBuiltinStuff()
00048 {
00049   static bool done = false;
00050   if ( ! done )
00051   {
00052     ObjectConstructorList* ctors = ObjectConstructorList::instance();
00053     GUIActionList* actions = GUIActionList::instance();
00054     ObjectConstructor* c = 0;
00055 
00056     // point by coords...
00057     c = new SimpleObjectTypeConstructor(
00058       PointByCoordsType::instance(),
00059       I18N_NOOP( "Point by Numeric Labels" ),
00060       I18N_NOOP( "A point whose coordinates are given by two numeric labels" ),
00061       "pointxy" );
00062     ctors->add( c );
00063     actions->add( new ConstructibleAction( c, "objects_new_point_by_coords" ) );
00064 
00065     // segment...
00066     c = new SimpleObjectTypeConstructor(
00067       SegmentABType::instance(), I18N_NOOP( "Segment" ),
00068       I18N_NOOP( "A segment constructed from its start and end point" ),
00069       "segment" );
00070     ctors->add( c );
00071     actions->add( new ConstructibleAction( c, "objects_new_segment", Qt::Key_S ) );
00072 
00073     // line by two points..
00074     c = new SimpleObjectTypeConstructor(
00075       LineABType::instance(), I18N_NOOP( "Line by Two Points" ),
00076       I18N_NOOP( "A line constructed through two points"), "line" );
00077     ctors->add( c );
00078     actions->add( new ConstructibleAction( c, "objects_new_linettp", Qt::Key_L ) );
00079 
00080     // ray by two points..
00081     c = new SimpleObjectTypeConstructor(
00082       RayABType::instance(), I18N_NOOP( "Half-Line" ),
00083       I18N_NOOP( "A half-line by its start point, and another point somewhere on it." ),
00084       "ray" );
00085     ctors->add( c );
00086     actions->add( new ConstructibleAction( c, "objects_new_ray", Qt::Key_R ) );
00087 
00088     // perpendicular line
00089     c = new SimpleObjectTypeConstructor(
00090       LinePerpendLPType::instance(), I18N_NOOP( "Perpendicular" ),
00091       I18N_NOOP( "A line constructed through a point, perpendicular to another line or segment." ),
00092       "perpendicular" );
00093     ctors->add( c );
00094     actions->add( new ConstructibleAction( c, "objects_new_lineperpend" ) );
00095 
00096     // parallel line
00097     c = new SimpleObjectTypeConstructor(
00098       LineParallelLPType::instance(), I18N_NOOP( "Parallel" ),
00099       I18N_NOOP( "A line constructed through a point, and parallel to another line or segment" ),
00100       "parallel" );
00101     ctors->add( c );
00102     actions->add( new ConstructibleAction( c, "objects_new_lineparallel" ) );
00103 
00104     // circle
00105     c = new SimpleObjectTypeConstructor(
00106       CircleBCPType::instance(), I18N_NOOP( "Circle by Center && Point" ),
00107       I18N_NOOP( "A circle constructed by its center and a point that pertains to it" ),
00108       "circlebcp" );
00109     ctors->add( c );
00110     actions->add( new ConstructibleAction( c, "objects_new_circlebcp", Qt::Key_C ) );
00111 
00112     c = new SimpleObjectTypeConstructor(
00113       CircleBTPType::instance(), I18N_NOOP( "Circle by Three Points" ),
00114       I18N_NOOP( "A circle constructed through three points" ),
00115       "circlebtp" );
00116     ctors->add( c );
00117     actions->add( new ConstructibleAction( c, "objects_new_circlebtp" ) );
00118 
00119     c = new SimpleObjectTypeConstructor(
00120       CircleBPRType::instance(), I18N_NOOP( "Circle by Point && Radius" ),
00121       I18N_NOOP( "A circle defined by its center and the length of the radius" ),
00122       "circlebps" );
00123     ctors->add( c );
00124     actions->add( new ConstructibleAction( c, "objects_new_circlebpr" ) );
00125 
00126     // declare this object static to this function, so it gets deleted
00127     // at the end of the program, without us having to wonder about
00128     // deleting it..  We don't want to register this
00129     // object-constructor, because that way, "construct the bisector"
00130     // would appear twice in the angle popup menu: once as the generic
00131     // construct a property stuff, and once because of this ctor..
00132     // we only register the guiaction, cause it makes sense to have a
00133     // toolbar icon for this..
00134     static PropertyObjectConstructor anglebisectionctor(
00135       AngleImp::stype(),
00136       I18N_NOOP( "Construct Bisector of This Angle" ),
00137       I18N_NOOP( "Select the angle you want to construct the bisector of..." ),
00138       I18N_NOOP( "Angle Bisector" ),
00139       I18N_NOOP( "The bisector of an angle" ),
00140       "angle_bisector",
00141       "angle-bisector" );
00142     actions->add( new ConstructibleAction( &anglebisectionctor, "objects_new_angle_bisector" ) );
00143 
00144     // conic stuff
00145     c = new SimpleObjectTypeConstructor(
00146       ConicB5PType::instance(), I18N_NOOP( "Conic by Five Points" ),
00147       I18N_NOOP( "A conic constructed through five points" ),
00148       "conicb5p" );
00149     ctors->add( c );
00150     actions->add( new ConstructibleAction( c, "objects_new_conicb5p" ) );
00151 
00152     c = new SimpleObjectTypeConstructor(
00153       ConicBAAPType::instance(),
00154       I18N_NOOP( "Hyperbola by Asymptotes && Point" ),
00155       I18N_NOOP( "A hyperbola with given asymptotes through a point" ),
00156       "conicbaap" );
00157     ctors->add( c );
00158     actions->add( new ConstructibleAction( c, "objects_new_conicbaap" ) );
00159 
00160     c = new SimpleObjectTypeConstructor(
00161       EllipseBFFPType::instance(),
00162       I18N_NOOP( "Ellipse by Focuses && Point" ), // focuses is used in preference to foci
00163       I18N_NOOP( "An ellipse constructed by its focuses and a point that pertains to it" ),
00164       "ellipsebffp" );
00165     ctors->add( c );
00166     actions->add( new ConstructibleAction( c, "objects_new_ellipsebffp" ) );
00167 
00168     c = new SimpleObjectTypeConstructor(
00169       HyperbolaBFFPType::instance(),
00170       I18N_NOOP( "Hyperbola by Focuses && Point" ), // focuses is used in preference to foci
00171       I18N_NOOP( "A hyperbola constructed by its focuses and a point that pertains to it" ),
00172       "hyperbolabffp" );
00173     ctors->add( c );
00174     actions->add( new ConstructibleAction( c, "objects_new_hyperbolabffp" ) );
00175 
00176     c = new SimpleObjectTypeConstructor(
00177       ConicBDFPType::instance(),
00178       I18N_NOOP( "Conic by Directrix, Focus && Point" ),
00179       I18N_NOOP( "A conic with given directrix and focus, through a point" ),
00180       "conicbdfp" );
00181     ctors->add( c );
00182     actions->add( new ConstructibleAction( c, "objects_new_conicbdfp" ) );
00183 
00184     c = new SimpleObjectTypeConstructor(
00185       ParabolaBTPType::instance(),
00186       I18N_NOOP( "Vertical Parabola by Three Points" ),
00187       I18N_NOOP( "A vertical parabola constructed through three points" ),
00188       "parabolabtp" );
00189     ctors->add( c );
00190     actions->add( new ConstructibleAction( c, "objects_new_parabolabtp" ) );
00191 
00192     c = new SimpleObjectTypeConstructor(
00193       CubicB9PType::instance(),
00194       I18N_NOOP( "Cubic Curve by Nine Points" ),
00195       I18N_NOOP( "A cubic curve constructed through nine points" ),
00196       "cubicb9p" );
00197     ctors->add( c );
00198     actions->add( new ConstructibleAction( c, "objects_new_cubicb9p" ) );
00199 
00200     c = new SimpleObjectTypeConstructor(
00201       ConicPolarPointType::instance(),
00202       I18N_NOOP( "Polar Point of a Line" ),
00203       I18N_NOOP( "The polar point of a line with respect to a conic." ),
00204       "polarpoint" );
00205     ctors->add( c );
00206     actions->add( new ConstructibleAction( c, "objects_new_pointpolar" ) );
00207 
00208     c = new SimpleObjectTypeConstructor(
00209       ConicPolarLineType::instance(),
00210       I18N_NOOP( "Polar Line of a Point" ),
00211       I18N_NOOP( "The polar line of a point with respect to a conic." ),
00212       "polarline" );
00213     ctors->add( c );
00214     actions->add( new ConstructibleAction( c, "objects_new_linepolar" ) );
00215 
00216     c = new SimpleObjectTypeConstructor(
00217       CubicNodeB6PType::instance(),
00218       I18N_NOOP( "Cubic Curve with Node by Six Points" ),
00219       I18N_NOOP( "A cubic curve with a nodal point at the origin through six points" ),
00220       "cubicnodeb6p" );
00221     ctors->add( c );
00222     actions->add( new ConstructibleAction( c, "objects_new_cubicnodeb6p" ) );
00223 
00224     c = new SimpleObjectTypeConstructor(
00225       CubicCuspB4PType::instance(),
00226       I18N_NOOP( "Cubic Curve with Cusp by Four Points" ),
00227       I18N_NOOP( "A cubic curve with a horizontal cusp at the origin through four points" ),
00228       "cubiccuspb4p" );
00229     ctors->add( c );
00230     actions->add( new ConstructibleAction( c, "objects_new_cubiccuspb4p" ) );
00231 
00232     c = new SimpleObjectTypeConstructor(
00233       VerticalCubicB4PType::instance(),
00234       I18N_NOOP( "Cubic Function by Four Points" ),
00235       I18N_NOOP( "A cubic function through four points" ),
00236       "verticalcubicb4p" );
00237     ctors->add( c );
00238     actions->add( new ConstructibleAction( c, "objects_new_verticalcubicb4p" ) );
00239 
00240     c = new SimpleObjectTypeConstructor(
00241       ConicDirectrixType::instance(),
00242       I18N_NOOP( "Directrix of a Conic" ),
00243       I18N_NOOP( "The directrix line of a conic." ),
00244       "directrix" );
00245     ctors->add( c );
00246     actions->add( new ConstructibleAction( c, "objects_new_linedirectrix" ) );
00247 
00248     c = new SimpleObjectTypeConstructor(
00249       AngleType::instance(),
00250       I18N_NOOP( "Angle by Three Points" ),
00251       I18N_NOOP( "An angle defined by three points" ),
00252       "angle" );
00253     ctors->add( c );
00254     actions->add( new ConstructibleAction( c, "objects_new_angle", Qt::Key_A ) );
00255 
00256     c = new SimpleObjectTypeConstructor(
00257       EquilateralHyperbolaB4PType::instance(),
00258       I18N_NOOP( "Equilateral Hyperbola by Four Points" ),
00259       I18N_NOOP( "An equilateral hyperbola constructed through four points" ),
00260       "equilateralhyperbolab4p" );
00261     ctors->add( c );
00262     actions->add( new ConstructibleAction( c, "objects_new_equilateralhyperbolab4p" ) );
00263 
00264     {
00265       // now for the Mid Point action.  It does both the mid point of
00266       // a segment, and the mid point of two points.  The midpoint of
00267       // two segments just shows the mid point property, and therefore
00268       // doesn't need to be added to the ctors, because there are
00269       // already facilities to construct an object's properties..
00270       // therefore, we add only an mpotp to the ctors, and add the
00271       // merged constructor only to the actions..
00272       ctors->add( new MidPointOfTwoPointsConstructor() );
00273 
00274       ObjectConstructor* mpotp = new MidPointOfTwoPointsConstructor();
00275       ObjectConstructor* mpos = new PropertyObjectConstructor(
00276         SegmentImp::stype(), I18N_NOOP( "Construct the midpoint of this segment" ),
00277         "", "", "", "", "mid-point" );
00278 
00279       // make this a static object, so it gets deleted at the end of
00280       // the program.
00281       static MergeObjectConstructor m(
00282         I18N_NOOP( "Mid Point" ),
00283         I18N_NOOP( "The midpoint of a segment or two other points" ),
00284         "bisection" );
00285       m.merge( mpotp );
00286       m.merge( mpos );
00287       actions->add( new ConstructibleAction( &m, "objects_new_midpoint", Qt::Key_M ) );
00288     };
00289 
00290     c = new SimpleObjectTypeConstructor(
00291       VectorType::instance(),
00292       I18N_NOOP( "Vector" ),
00293       I18N_NOOP( "Construct a vector from two given points." ),
00294       "vector" );
00295     ctors->add( c );
00296     actions->add( new ConstructibleAction( c, "objects_new_vector", Qt::Key_V ) );
00297 
00298     c = new SimpleObjectTypeConstructor(
00299       VectorSumType::instance(),
00300       I18N_NOOP( "Vector Sum" ),
00301       I18N_NOOP( "Construct the vector sum of two vectors." ),
00302       "vectorsum" );
00303     ctors->add( c );
00304     actions->add( new ConstructibleAction( c, "objects_new_vectorsum", 0 ) );
00305 
00306     c = new SimpleObjectTypeConstructor(
00307       LineByVectorType::instance(),
00308       I18N_NOOP( "Line by Vector" ),
00309       I18N_NOOP( "Construct the line by a given vector though a given point." ),
00310       "linebyvector" );
00311     ctors->add( c );
00312     actions->add( new ConstructibleAction( c, "objects_new_linebyvector", 0 ) );
00313 
00314     c = new SimpleObjectTypeConstructor(
00315       HalflineByVectorType::instance(),
00316       I18N_NOOP( "Half-Line by Vector" ),
00317       I18N_NOOP( "Construct the half-line by a given vector starting at given point." ),
00318       "halflinebyvector" );
00319     ctors->add( c );
00320     actions->add( new ConstructibleAction( c, "objects_new_halflinebyvector", 0 ) );
00321 
00322     c = new SimpleObjectTypeConstructor(
00323       ArcBTPType::instance(),
00324       I18N_NOOP( "Arc by Three Points" ),
00325       I18N_NOOP( "Construct an arc through three points." ),
00326       "arc" );
00327     ctors->add( c );
00328     actions->add( new ConstructibleAction( c, "objects_new_arcbtp" ) );
00329 
00330     c = new SimpleObjectTypeConstructor(
00331       ConicArcBCTPType::instance(),
00332       I18N_NOOP( "Conic Arc by Center and Three Points" ),
00333       I18N_NOOP( "Construct a conic arc with given center through three points." ),
00334       "conicarc" );
00335     ctors->add( c );
00336     actions->add( new ConstructibleAction( c, "objects_new_conicarcbctp" ) );
00337 
00338     c = new SimpleObjectTypeConstructor(
00339       ConicArcB5PType::instance(),
00340       I18N_NOOP( "Conic Arc by Five Points" ),
00341       I18N_NOOP( "Construct a conic arc through five points." ),
00342       "conicarc" );
00343     ctors->add( c );
00344     actions->add( new ConstructibleAction( c, "objects_new_conicarcb5p" ) );
00345 
00346     c = new SimpleObjectTypeConstructor(
00347       ArcBCPAType::instance(),
00348       I18N_NOOP( "Arc by Center, Angle && Point" ),
00349       I18N_NOOP( "Construct an arc by its center and a given angle, "
00350                  "starting at a given point" ),
00351       "arcbcpa" );
00352     ctors->add( c );
00353     actions->add( new ConstructibleAction( c, "objects_new_arcbcpa" ) );
00354 
00355     c = new SimpleObjectTypeConstructor(
00356       ParabolaBDPType::instance(),
00357       I18N_NOOP( "Parabola by Directrix && Focus" ),
00358       I18N_NOOP( "A parabola defined by its directrix and focus" ),
00359       "parabolabdp" );
00360     ctors->add( c );
00361     actions->add( new ConstructibleAction( c, "objects_new_parabolabdp" ) );
00362 
00363     // Transformation stuff..
00364 //    c = new SimpleObjectTypeConstructor(
00365 //      CircularInversionType::instance(),
00366 //      I18N_NOOP( "Invert" ),
00367 //      I18N_NOOP( "The inversion of an object with respect to a circle" ),
00368 //      "inversion" );
00369 //    ctors->add( c );
00370 //    actions->add( new ConstructibleAction( c, "objects_new_inversion" ) );
00371 
00372     c = new InversionConstructor();
00373     ctors->add( c );
00374     actions->add( new ConstructibleAction( c, "objects_new_inversion" ) );
00375 
00376     c = new SimpleObjectTypeConstructor(
00377       TranslatedType::instance(),
00378       I18N_NOOP( "Translate" ),
00379       I18N_NOOP( "The translation of an object by a vector" ),
00380       "translation" );
00381     ctors->add( c );
00382     actions->add( new ConstructibleAction( c, "objects_new_translation" ) );
00383 
00384     c = new SimpleObjectTypeConstructor(
00385       PointReflectionType::instance(),
00386       I18N_NOOP( "Reflect in Point" ),
00387       I18N_NOOP( "An object reflected in a point" ),
00388       "centralsymmetry" );
00389     ctors->add( c );
00390     actions->add( new ConstructibleAction( c, "objects_new_pointreflection" ) );
00391 
00392     c = new SimpleObjectTypeConstructor(
00393       LineReflectionType::instance(),
00394       I18N_NOOP( "Reflect in Line" ),
00395       I18N_NOOP( "An object reflected in a line" ),
00396       "mirrorpoint" );
00397     ctors->add( c );
00398     actions->add( new ConstructibleAction( c, "objects_new_linereflection" ) );
00399 
00400     c = new SimpleObjectTypeConstructor(
00401       RotationType::instance(),
00402       I18N_NOOP( "Rotate" ),
00403       I18N_NOOP( "An object rotated by an angle around a point" ),
00404       "rotation" );
00405     ctors->add( c );
00406     actions->add( new ConstructibleAction( c, "objects_new_rotation" ) );
00407 
00408     c = new SimpleObjectTypeConstructor(
00409       ScalingOverCenterType::instance(),
00410       I18N_NOOP( "Scale" ),
00411       I18N_NOOP( "Scale an object over a point, by the ratio given by the length of a segment" ),
00412       "scale" );
00413     ctors->add( c );
00414     actions->add( new ConstructibleAction( c, "objects_new_scalingovercenter" ) );
00415 
00416     c = new SimpleObjectTypeConstructor(
00417       ScalingOverLineType::instance(),
00418       I18N_NOOP( "Scale over Line" ),
00419       I18N_NOOP( "An object scaled over a line, by the ratio given by the length of a segment" ),
00420       "stretch" );
00421     ctors->add( c );
00422     actions->add( new ConstructibleAction( c, "objects_new_scalingoverline" ) );
00423 
00424     c = new SimpleObjectTypeConstructor(
00425       ScalingOverCenter2Type::instance(),
00426       I18N_NOOP( "Scale (ratio given by two segments)" ),
00427       I18N_NOOP( "Scale an object over a point, by the ratio given by the length of two segments" ),
00428       "scale" );
00429     ctors->add( c );
00430     actions->add( new ConstructibleAction( c, "objects_new_scalingovercenter2" ) );
00431 
00432     c = new SimpleObjectTypeConstructor(
00433       ScalingOverLine2Type::instance(),
00434       I18N_NOOP( "Scale over Line (ratio given by two segments)" ),
00435       I18N_NOOP( "An object scaled over a line, by the ratio given by the length of two segments" ),
00436       "stretch" );
00437     ctors->add( c );
00438     actions->add( new ConstructibleAction( c, "objects_new_scalingoverline2" ) );
00439 
00440     c = new SimpleObjectTypeConstructor(
00441       SimilitudeType::instance(),
00442       I18N_NOOP( "Apply Similitude" ),
00443       I18N_NOOP( "Apply a similitude to an object (the sequence of a scaling and rotation around a center)" ),
00444       "similitude" );
00445     ctors->add( c );
00446     actions->add( new ConstructibleAction( c, "objects_new_similitude" ) );
00447 
00448     c = new SimpleObjectTypeConstructor(
00449       HarmonicHomologyType::instance(),
00450       I18N_NOOP( "Harmonic Homology" ),
00451       I18N_NOOP( "The harmonic homology with a given center and a given axis (this is a projective transformation)" ),
00452       "harmonichomology" );
00453     ctors->add( c );
00454     actions->add( new ConstructibleAction( c, "objects_new_harmonichomology" ) );
00455 
00456     c = new GenericAffinityConstructor();
00457     ctors->add( c );
00458     actions->add( new ConstructibleAction( c, "objects_new_genericaffinity" ) );
00459 
00460     c = new GenericProjectivityConstructor();
00461     ctors->add( c );
00462     actions->add( new ConstructibleAction( c, "objects_new_genericprojectivity" ) );
00463 
00464     c = new SimpleObjectTypeConstructor(
00465       CastShadowType::instance(),
00466       I18N_NOOP( "Draw Projective Shadow" ),
00467       I18N_NOOP( "The shadow of an object with a given light source and projection plane (indicated by a line)" ),
00468       "castshadow" );
00469     ctors->add( c );
00470     actions->add( new ConstructibleAction( c, "objects_new_castshadow" ) );
00471 
00472 //     c = new SimpleObjectTypeConstructor(
00473 //       ProjectiveRotationType::instance(),
00474 //       I18N_NOOP( "Rotate Projectively" ),
00475 //       I18N_NOOP( "An object projectively rotated by an angle and a half-line" ),
00476 //       "projectiverotation" );
00477 //     ctors->add( c );
00478 //     actions->add( new ConstructibleAction( c, "objects_new_projectiverotation" ) );
00479 
00480     c = new MultiObjectTypeConstructor(
00481       ConicAsymptoteType::instance(),
00482       I18N_NOOP( "Asymptotes of a Hyperbola" ),
00483       I18N_NOOP( "The two asymptotes of a hyperbola." ),
00484       "conicasymptotes", -1, 1 );
00485     ctors->add( c );
00486     actions->add( new ConstructibleAction( c, "objects_new_lineconicasymptotes" ) );
00487 
00488     c = new ConicRadicalConstructor();
00489     ctors->add( c );
00490     actions->add( new ConstructibleAction( c, "objects_new_lineconicradical") );
00491 
00492     /* ----------- start polygons --------- */
00493 
00494     c = new SimpleObjectTypeConstructor(
00495       TriangleB3PType::instance(),
00496       I18N_NOOP( "Triangle by Its Vertices" ),
00497       I18N_NOOP( "Construct a triangle given its three vertices." ),
00498       "triangle" );
00499     ctors->add( c );
00500     actions->add( new ConstructibleAction( c, "objects_new_trianglebtp" ) );
00501 
00502     c = new PolygonBNPTypeConstructor();
00503     ctors->add( c );
00504     actions->add( new ConstructibleAction( c, "objects_new_polygonbnp" ));
00505 
00506     c = new PolygonBCVConstructor();
00507     ctors->add( c );
00508     actions->add( new ConstructibleAction( c, "objects_new_polygonbcv" ) );
00509 
00510     c = new PolygonVertexTypeConstructor();
00511     ctors->add( c );
00512     actions->add( new ConstructibleAction( c, "objects_new_polygonvertices" ));
00513 
00514     c = new PolygonSideTypeConstructor();
00515     ctors->add( c );
00516     actions->add( new ConstructibleAction( c, "objects_new_polygonsides" ));
00517 
00518     c = new SimpleObjectTypeConstructor(
00519       ConvexHullType::instance(), I18N_NOOP( "Convex Hull" ),
00520       I18N_NOOP( "A polygon that corresponds to the convex hull of another polygon" ),
00521       "convexhull" );
00522     ctors->add( c );
00523     actions->add( new ConstructibleAction( c, "objects_new_convexhull" ) );
00524 
00525     /* ----------- end polygons --------- */
00526 
00527     c = new LocusConstructor();
00528     ctors->add( c );
00529     actions->add( new ConstructibleAction( c, "objects_new_locus" ) );
00530 
00531     // tests
00532     c = new TestConstructor(
00533       AreParallelType::instance(),
00534       I18N_NOOP( "Parallel Test" ),
00535       I18N_NOOP( "Test whether two given lines are parallel" ),
00536       "testparallel" );
00537     ctors->add( c );
00538     actions->add( new ConstructibleAction( c, "objects_new_areparallel" ) );
00539 
00540     c = new TestConstructor(
00541       AreOrthogonalType::instance(),
00542       I18N_NOOP( "Orthogonal Test" ),
00543       I18N_NOOP( "Test whether two given lines are orthogonal" ),
00544       "testorthogonal" );
00545     ctors->add( c );
00546     actions->add( new ConstructibleAction( c, "objects_new_areorthogonal" ) );
00547 
00548     c = new TestConstructor(
00549       AreCollinearType::instance(),
00550       I18N_NOOP( "Collinear Test" ),
00551       I18N_NOOP( "Test whether three given points are collinear" ),
00552       "testcollinear" );
00553     ctors->add( c );
00554     actions->add( new ConstructibleAction( c, "objects_new_arecollinear" ) );
00555 
00556     c = new TestConstructor(
00557       ContainsTestType::instance(),
00558       I18N_NOOP( "Contains Test" ),
00559       I18N_NOOP( "Test whether a given curve contains a given point" ),
00560       "testcontains" );
00561     ctors->add( c );
00562     actions->add( new ConstructibleAction( c, "objects_new_containstest" ) );
00563 
00564     c = new TestConstructor(
00565       InPolygonTestType::instance(),
00566       I18N_NOOP( "In Polygon Test" ),
00567       I18N_NOOP( "Test whether a given polygon contains a given point" ),
00568       "test" );
00569     ctors->add( c );
00570     actions->add( new ConstructibleAction( c, "objects_new_inpolygontest" ) );
00571 
00572     c = new TestConstructor(
00573       ConvexPolygonTestType::instance(),
00574       I18N_NOOP( "Convex Polygon Test" ),
00575       I18N_NOOP( "Test whether a given polygon is convex" ),
00576       "test" );
00577     ctors->add( c );
00578     actions->add( new ConstructibleAction( c, "objects_new_convexpolygontest" ) );
00579 
00580     c = new TestConstructor(
00581       ExistenceTestType::instance(),
00582       I18N_NOOP( "Existence Test" ),
00583       I18N_NOOP( "Test whether a given object is constructible" ),
00584       "test" );
00585     ctors->add( c );
00586     actions->add( new ConstructibleAction( c, "objects_new_existencetest" ) );
00587 
00588     c = new TestConstructor(
00589       SameDistanceType::instance(),
00590       I18N_NOOP( "Distance Test" ),
00591       I18N_NOOP( "Test whether a given point have the same distance from a given point "
00592                  "and from another given point" ),
00593       "testdistance" );
00594     ctors->add( c );
00595     actions->add( new ConstructibleAction( c, "objects_new_distancetest" ) );
00596 
00597     c = new TestConstructor(
00598       VectorEqualityTestType::instance(),
00599       I18N_NOOP( "Vector Equality Test" ),
00600       I18N_NOOP( "Test whether two vectors are equal" ),
00601       "test" );
00602 //      "testequal" );
00603     ctors->add( c );
00604     actions->add( new ConstructibleAction( c, "objects_new_vectorequalitytest" ) );
00605 
00606     c = new MeasureTransportConstructor();
00607     ctors->add( c );
00608     actions->add( new ConstructibleAction( c, "objects_new_measuretransport" ));
00609 
00610 //    c = new SimpleObjectTypeConstructor(
00611 //      MeasureTransportType::instance(),
00612 //      I18N_NOOP( "Measure Transport" ),
00613 //      I18N_NOOP( "Transport the measure of a segment or arc over a line or circle." ),
00614 //      "measuretransport" );
00615 //    ctors->add( c );
00616 //    actions->add( new ConstructibleAction( c, "objects_new_measuretransport" ) );
00617 
00618     // the generic intersection constructor..
00619     c = new GenericIntersectionConstructor();
00620     ctors->add( c );
00621     actions->add( new ConstructibleAction( c, "objects_new_intersection", Qt::Key_I ) );
00622 
00623     // the generic tangent constructor
00624     c = new TangentConstructor();
00625     ctors->add( c );
00626     actions->add( new ConstructibleAction( c, "objects_new_tangent", Qt::Key_T ) );
00627 
00628     // the generic center of curvature constructor
00629     c = new CocConstructor();
00630     ctors->add( c );
00631     actions->add( new ConstructibleAction( c, "objects_new_centerofcurvature" ) );
00632 
00633     actions->add( new ConstructPointAction( "objects_new_normalpoint" ) );
00634     actions->add( new ConstructTextLabelAction( "objects_new_textlabel" ) );
00635     actions->add( new AddFixedPointAction( "objects_new_point_xy" ) );
00636     actions->add( new ConstructNumericLabelAction( "objects_new_numericlabel" ) );
00637 
00638 #ifdef KIG_ENABLE_PYTHON_SCRIPTING
00639 #include "../scripting/script-common.h"
00640     actions->add( new NewScriptAction(
00641                         I18N_NOOP( "Python Script" ),
00642                         I18N_NOOP( "Construct a new Python script." ),
00643                         "objects_new_script_python",
00644                         ScriptType::Python ) );
00645 #endif
00646 
00647 #if 0
00648     actions->add( new TestAction( "test_stuff" ) );
00649 #endif
00650   };
00651 
00652   done = true;
00653 }

kig

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

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
  •   stepcore
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal