Changeset View
Changeset View
Standalone View
Standalone View
misc/builtin_stuff.cc
Context not available. | |||||
294 | actions->add( new ConstructibleAction( &m, "objects_new_midpoint", Qt::Key_M ) ); | 294 | actions->add( new ConstructibleAction( &m, "objects_new_midpoint", Qt::Key_M ) ); | ||
---|---|---|---|---|---|
295 | }; | 295 | }; | ||
296 | 296 | | |||
297 | { | ||||
298 | // now for the Golden Point action. It does both the golden ratio point of | ||||
299 | // a segment, and the golden ratio point of two points. The golden ratio point of | ||||
300 | // two segments just shows the golden ratio point property, and therefore | ||||
301 | // doesn't need to be added to the ctors, because there are | ||||
302 | // already facilities to construct an object's properties.. | ||||
303 | // therefore, we add only an mpotp to the ctors, and add the | ||||
304 | // merged constructor only to the actions.. | ||||
305 | ctors->add( new GoldenPointOfTwoPointsConstructor() ); | ||||
306 | | ||||
307 | ObjectConstructor* mpotp = new GoldenPointOfTwoPointsConstructor(); | ||||
308 | ObjectConstructor* mpos = new PropertyObjectConstructor( | ||||
309 | SegmentImp::stype(), I18N_NOOP( "Construct the golden ratio point of this segment" ), | ||||
310 | "", "", "", "", "golden-point" ); | ||||
311 | | ||||
312 | // make this a static object, so it gets deleted at the end of | ||||
313 | // the program. | ||||
314 | static MergeObjectConstructor m( | ||||
315 | I18N_NOOP( "Golden Point" ), | ||||
316 | I18N_NOOP( "The golden ratio point of a segment or two other points" ), | ||||
317 | "segment_golden_point" ); | ||||
318 | m.merge( mpotp ); | ||||
319 | m.merge( mpos ); | ||||
320 | actions->add( new ConstructibleAction( &m, "objects_new_golden_point", 0 ) ); | ||||
321 | }; | ||||
322 | | ||||
297 | c = new SimpleObjectTypeConstructor( | 323 | c = new SimpleObjectTypeConstructor( | ||
298 | VectorType::instance(), | 324 | VectorType::instance(), | ||
299 | I18N_NOOP( "Vector" ), | 325 | I18N_NOOP( "Vector" ), | ||
Context not available. |