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