Changeset View
Changeset View
Standalone View
Standalone View
objects/point_type.cc
Context not available. | |||||
288 | return new PointImp( ( a + b ) / 2 ); | 288 | return new PointImp( ( a + b ) / 2 ); | ||
---|---|---|---|---|---|
289 | } | 289 | } | ||
290 | 290 | | |||
291 | static const ArgsParser::spec argsspecGoldenPoint[] = | ||||
292 | { | ||||
293 | { PointImp::stype(), I18N_NOOP( "Construct the golden ratio point of this point and another point" ), | ||||
294 | I18N_NOOP( "Select the first of the two points of which you want to construct the golden ratio point..." ), false }, | ||||
295 | { PointImp::stype(), I18N_NOOP( "Construct the golden ratio point of this point and another point" ), | ||||
296 | I18N_NOOP( "Select the other of the two points of which you want to construct the golden ratio point..." ), false } | ||||
297 | }; | ||||
298 | | ||||
299 | KIG_INSTANTIATE_OBJECT_TYPE_INSTANCE( GoldenPointType ) | ||||
300 | | ||||
301 | GoldenPointType::GoldenPointType() | ||||
302 | : ObjectABType( "GoldenPoint", argsspecGoldenPoint, 2 ) | ||||
303 | { | ||||
304 | } | ||||
305 | | ||||
306 | GoldenPointType::~GoldenPointType() | ||||
307 | { | ||||
308 | } | ||||
309 | | ||||
310 | const GoldenPointType* GoldenPointType::instance() | ||||
311 | { | ||||
312 | static const GoldenPointType t; | ||||
313 | return &t; | ||||
314 | } | ||||
315 | | ||||
316 | ObjectImp* GoldenPointType::calcx( const Coordinate& a, const Coordinate& b ) const | ||||
317 | { | ||||
318 | return new PointImp( a + (3 - sqrt(5)) * (b - a) / 2 ); | ||||
319 | } | ||||
320 | | ||||
291 | bool ConstrainedPointType::inherits( int type ) const | 321 | bool ConstrainedPointType::inherits( int type ) const | ||
292 | { | 322 | { | ||
293 | return type == ID_ConstrainedPointType; | 323 | return type == ID_ConstrainedPointType; | ||
Context not available. | |||||
362 | return PointImp::stype(); | 392 | return PointImp::stype(); | ||
363 | } | 393 | } | ||
364 | 394 | | |||
395 | const ObjectImpType* GoldenPointType::resultId() const | ||||
396 | { | ||||
397 | return PointImp::stype(); | ||||
398 | } | ||||
399 | | ||||
365 | QStringList FixedPointType::specialActions() const | 400 | QStringList FixedPointType::specialActions() const | ||
366 | { | 401 | { | ||
367 | QStringList ret; | 402 | QStringList ret; | ||
Context not available. |