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

kig

  • sources
  • kde-4.14
  • kdeedu
  • kig
  • objects
point_type.cc
Go to the documentation of this file.
1 // Copyright (C) 2002 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 "point_type.h"
19 
20 #include <math.h>
21 
22 #include "special_imptypes.h"
23 #include "point_imp.h"
24 #include "curve_imp.h"
25 #include "line_imp.h"
26 #include "other_imp.h"
27 #include "bogus_imp.h"
28 
29 #include "../modes/moving.h"
30 #include "../misc/coordinate_system.h"
31 #include "../misc/common.h"
32 #include "../misc/calcpaths.h"
33 #include "../misc/kiginputdialog.h"
34 #include "../kig/kig_part.h"
35 #include "../kig/kig_document.h"
36 #include "../kig/kig_view.h"
37 #include "../kig/kig_commands.h"
38 
39 #include <klocale.h>
40 
41 static const ArgsParser::spec argsspecFixedPoint[] =
42 {
43  { DoubleImp::stype(), "x", "SHOULD NOT BE SEEN", false },
44  { DoubleImp::stype(), "y", "SHOULD NOT BE SEEN", false }
45 };
46 
47 KIG_INSTANTIATE_OBJECT_TYPE_INSTANCE( FixedPointType )
48 
49 FixedPointType::FixedPointType()
50  : ArgsParserObjectType( "FixedPoint", argsspecFixedPoint, 2 )
51 {
52 }
53 
54 FixedPointType::~FixedPointType()
55 {
56 }
57 
58 ObjectImp* FixedPointType::calc( const Args& parents, const KigDocument& ) const
59 {
60  if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp;
61 
62  double a = static_cast<const DoubleImp*>( parents[0] )->data();
63  double b = static_cast<const DoubleImp*>( parents[1] )->data();
64 
65  return new PointImp( Coordinate( a, b ) );
66 }
67 
68 static const ArgsParser::spec argsspecRelativePoint[] =
69 {
70  { DoubleImp::stype(), "relative-x", "SHOULD NOT BE SEEN", false },
71  { DoubleImp::stype(), "relative-y", "SHOULD NOT BE SEEN", false },
72  { ObjectImp::stype(), "object", "SHOULD NOT BE SEEN", false }
73 };
74 
75 KIG_INSTANTIATE_OBJECT_TYPE_INSTANCE( RelativePointType )
76 
77 RelativePointType::RelativePointType()
78  : ArgsParserObjectType( "RelativePoint", argsspecRelativePoint, 3 )
79 {
80 }
81 
82 RelativePointType::~RelativePointType()
83 {
84 }
85 
86 ObjectImp* RelativePointType::calc( const Args& parents, const KigDocument& ) const
87 {
88  if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp;
89  if ( ! parents[2]->attachPoint().valid() ) return new InvalidImp;
90 
91  Coordinate reference = static_cast<const ObjectImp*>( parents[2] )->attachPoint();
92  double a = static_cast<const DoubleImp*>( parents[0] )->data();
93  double b = static_cast<const DoubleImp*>( parents[1] )->data();
94 
95  return new PointImp( reference + Coordinate( a, b ) );
96 }
97 
98 KIG_INSTANTIATE_OBJECT_TYPE_INSTANCE( CursorPointType )
99 
100 CursorPointType::CursorPointType()
101  : ObjectType( "CursorPoint" )
102 {
103 }
104 
105 CursorPointType::~CursorPointType()
106 {
107 }
108 
109 const CursorPointType* CursorPointType::instance()
110 {
111  static const CursorPointType t;
112  return &t;
113 }
114 
115 ObjectImp* CursorPointType::calc( const Args& parents, const KigDocument& ) const
116 {
117  assert ( parents[0]->inherits( DoubleImp::stype() ) );
118  assert ( parents[1]->inherits( DoubleImp::stype() ) );
119  double a = static_cast<const DoubleImp*>( parents[0] )->data();
120  double b = static_cast<const DoubleImp*>( parents[1] )->data();
121 
122  return new BogusPointImp( Coordinate( a, b ) );
123 }
124 
125 const ObjectImpType* CursorPointType::resultId() const
126 {
127  return BogusPointImp::stype();
128 }
129 
130 ObjectImp* ConstrainedPointType::calc( const Args& parents, const KigDocument& doc ) const
131 {
132  if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp;
133 
134  double param = static_cast<const DoubleImp*>( parents[0] )->data();
135  const Coordinate nc = static_cast<const CurveImp*>( parents[1] )->getPoint( param, doc );
136  doc.mcachedparam = param;
137  if ( nc.valid() ) return new PointImp( nc );
138  else return new InvalidImp;
139 }
140 
141 const ArgsParser::spec argsspecConstrainedPoint[] =
142 {
143  { DoubleImp::stype(), "parameter", "SHOULD NOT BE SEEN", false },
144  { CurveImp::stype(), "Constrain the point to this curve", "SHOULD NOT BE SEEN", true }
145 };
146 
147 KIG_INSTANTIATE_OBJECT_TYPE_INSTANCE( ConstrainedPointType )
148 
149 ConstrainedPointType::ConstrainedPointType()
150  : ArgsParserObjectType( "ConstrainedPoint", argsspecConstrainedPoint, 2 )
151 {
152 }
153 
154 ConstrainedPointType::~ConstrainedPointType()
155 {
156 }
157 
158 void FixedPointType::move( ObjectTypeCalcer& ourobj, const Coordinate& to,
159  const KigDocument& ) const
160 {
161  // fetch the old coord..;
162  std::vector<ObjectCalcer*> pa = ourobj.parents();
163  assert( margsparser.checkArgs( pa ) );
164  assert( dynamic_cast<ObjectConstCalcer*>( pa.front() ) );
165  assert( dynamic_cast<ObjectConstCalcer*>( pa.back() ) );
166 
167  ObjectConstCalcer* ox = static_cast<ObjectConstCalcer*>( pa.front() );
168  ObjectConstCalcer* oy = static_cast<ObjectConstCalcer*>( pa.back() );
169 
170  ox->setImp( new DoubleImp( to.x ) );
171  oy->setImp( new DoubleImp( to.y ) );
172 }
173 
174 void RelativePointType::move( ObjectTypeCalcer& ourobj, const Coordinate& to,
175  const KigDocument& ) const
176 {
177  // fetch the attach point..;
178  // this routine is tightly paired with what moveReferencePoint returns!
179  // right now moveReferencePoint always returns the origin
180  std::vector<ObjectCalcer*> pa = ourobj.parents();
181  assert( margsparser.checkArgs( pa ) );
182  assert( dynamic_cast<ObjectConstCalcer*>( pa[0] ) );
183  assert( dynamic_cast<ObjectConstCalcer*>( pa[1] ) );
184 
185  ObjectConstCalcer* ox = static_cast<ObjectConstCalcer*>( pa[0] );
186  ObjectConstCalcer* oy = static_cast<ObjectConstCalcer*>( pa[1] );
187  ObjectCalcer* ob = static_cast<ObjectCalcer*>( pa[2] );
188 
189  Coordinate attach = ob->imp()->attachPoint();
190  ox->setImp( new DoubleImp( to.x - attach.x ) );
191  oy->setImp( new DoubleImp( to.y - attach.y ) );
192 }
193 
194 void CursorPointType::move( ObjectTypeCalcer& ourobj, const Coordinate& to,
195  const KigDocument& ) const
196 {
197  // fetch the old coord..;
198 
199  std::vector<ObjectCalcer*> pa = ourobj.parents();
200  assert( pa.size() == 2 );
201  assert( dynamic_cast<ObjectConstCalcer*>( pa.front() ) );
202  assert( dynamic_cast<ObjectConstCalcer*>( pa.back() ) );
203 
204  ObjectConstCalcer* ox = static_cast<ObjectConstCalcer*>( pa.front() );
205  ObjectConstCalcer* oy = static_cast<ObjectConstCalcer*>( pa.back() );
206 
207  ox->setImp( new DoubleImp( to.x ) );
208  oy->setImp( new DoubleImp( to.y ) );
209 }
210 
211 void ConstrainedPointType::move( ObjectTypeCalcer& ourobj, const Coordinate& to,
212  const KigDocument& d ) const
213 {
214  // fetch the CurveImp..
215  std::vector<ObjectCalcer*> parents = ourobj.parents();
216  assert( margsparser.checkArgs( parents ) );
217 
218  assert( dynamic_cast<ObjectConstCalcer*>( parents[0] ) );
219  ObjectConstCalcer* paramo = static_cast<ObjectConstCalcer*>( parents[0] );
220  const CurveImp* ci = static_cast<const CurveImp*>( parents[1]->imp() );
221 
222  // fetch the new param..
223  const double np = ci->getParam( to, d );
224 
225  paramo->setImp( new DoubleImp( np ) );
226 }
227 
228 bool ConstrainedPointType::canMove( const ObjectTypeCalcer& ) const
229 {
230  return true;
231 }
232 
233 bool ConstrainedPointType::isFreelyTranslatable( const ObjectTypeCalcer& ) const
234 {
235  return false;
236 }
237 
238 bool FixedPointType::canMove( const ObjectTypeCalcer& ) const
239 {
240  return true;
241 }
242 
243 bool FixedPointType::isFreelyTranslatable( const ObjectTypeCalcer& ) const
244 {
245  return true;
246 }
247 
248 bool RelativePointType::canMove( const ObjectTypeCalcer& ) const
249 {
250  return true;
251 }
252 
253 bool RelativePointType::isFreelyTranslatable( const ObjectTypeCalcer& ) const
254 {
255  return true;
256 }
257 
258 bool CursorPointType::canMove( const ObjectTypeCalcer& ) const
259 {
260  return true;
261 }
262 
263 static const ArgsParser::spec argsspecMidPoint[] =
264 {
265  { PointImp::stype(), I18N_NOOP( "Construct the midpoint of this point and another point" ),
266  I18N_NOOP( "Select the first of the two points of which you want to construct the midpoint..." ), false },
267  { PointImp::stype(), I18N_NOOP( "Construct the midpoint of this point and another point" ),
268  I18N_NOOP( "Select the other of the two points of which you want to construct the midpoint..." ), false }
269 };
270 
271 KIG_INSTANTIATE_OBJECT_TYPE_INSTANCE( MidPointType )
272 
273 MidPointType::MidPointType()
274  : ObjectABType( "MidPoint", argsspecMidPoint, 2 )
275 {
276 }
277 
278 MidPointType::~MidPointType()
279 {
280 }
281 
282 const MidPointType* MidPointType::instance()
283 {
284  static const MidPointType t;
285  return &t;
286 }
287 
288 ObjectImp* MidPointType::calcx( const Coordinate& a, const Coordinate& b ) const
289 {
290  return new PointImp( ( a + b ) / 2 );
291 }
292 
293 bool ConstrainedPointType::inherits( int type ) const
294 {
295  return type == ID_ConstrainedPointType;
296 }
297 
298 const ConstrainedPointType* ConstrainedPointType::instance()
299 {
300  static const ConstrainedPointType t;
301  return &t;
302 }
303 
304 bool FixedPointType::inherits( int type ) const
305 {
306  return type == ID_FixedPointType;
307 }
308 
309 const FixedPointType* FixedPointType::instance()
310 {
311  static const FixedPointType t;
312  return &t;
313 }
314 
315 const ObjectImpType* FixedPointType::resultId() const
316 {
317  return PointImp::stype();
318 }
319 
320 const RelativePointType* RelativePointType::instance()
321 {
322  static const RelativePointType t;
323  return &t;
324 }
325 
326 const ObjectImpType* RelativePointType::resultId() const
327 {
328  return PointImp::stype();
329 }
330 
331 const ObjectImpType* ConstrainedPointType::resultId() const
332 {
333  return PointImp::stype();
334 }
335 
336 const ObjectImpType* CursorPointType::impRequirement( const ObjectImp* o, const Args& ) const
337 {
338  if ( o->inherits( DoubleImp::stype() ) )
339  return DoubleImp::stype();
340 
341  if ( o->inherits( PointImp::stype() ) )
342  return PointImp::stype();
343 
344  return 0;
345 }
346 
347 bool CursorPointType::isDefinedOnOrThrough( const ObjectImp*, const Args& ) const
348 {
349  return false;
350 }
351 
352 std::vector<ObjectCalcer*> CursorPointType::sortArgs( const std::vector<ObjectCalcer*>& args ) const
353 {
354  return args;
355 }
356 
357 Args CursorPointType::sortArgs( const Args& args ) const
358 {
359  return args;
360 }
361 
362 const ObjectImpType* MidPointType::resultId() const
363 {
364  return PointImp::stype();
365 }
366 
367 QStringList FixedPointType::specialActions() const
368 {
369  QStringList ret;
370  ret << i18n( "Set &Coordinate..." );
371  ret << i18n( "Redefine" );
372  return ret;
373 }
374 
375 QStringList ConstrainedPointType::specialActions() const
376 {
377  QStringList ret;
378  ret << i18n( "Set &Parameter..." );
379  ret << i18n( "Redefine" );
380  return ret;
381 }
382 
383 static void redefinePoint( ObjectHolder* o, KigPart& d, KigWidget& w )
384 {
385  PointRedefineMode pm( o, d, w );
386  d.runMode( &pm );
387 }
388 
389 void FixedPointType::executeAction(
390  int i, ObjectHolder& oh, ObjectTypeCalcer& o,
391  KigPart& d, KigWidget& w, NormalMode& ) const
392 {
393  switch( i )
394  {
395  case 0:
396  {
397  bool ok = true;
398  assert ( o.imp()->inherits( PointImp::stype() ) );
399  Coordinate oldc = static_cast<const PointImp*>( o.imp() )->coordinate();
400  KigInputDialog::getCoordinate(
401  i18n( "Set Coordinate" ),
402  i18n( "Enter the new coordinate." ) + QString::fromLatin1( "<br>" ) +
403  d.document().coordinateSystem().coordinateFormatNoticeMarkup(),
404  &w, &ok, d.document(), &oldc );
405  if ( ! ok ) break;
406 
407  MonitorDataObjects mon( getAllParents( &o ) );
408  o.move( oldc, d.document() );
409  KigCommand* kc = new KigCommand( d, PointImp::stype()->moveAStatement() );
410  mon.finish( kc );
411 
412  d.history()->push( kc );
413  break;
414  };
415  case 1:
416  redefinePoint( &oh, d, w );
417  break;
418  default:
419  assert( false );
420  };
421 }
422 
423 void ConstrainedPointType::executeAction(
424  int i, ObjectHolder& oh, ObjectTypeCalcer& o, KigPart& d, KigWidget& w,
425  NormalMode& ) const
426 {
427  switch( i )
428  {
429  case 1:
430  redefinePoint( &oh, d, w );
431  break;
432  case 0:
433  {
434  std::vector<ObjectCalcer*> parents = o.parents();
435  assert( dynamic_cast<ObjectConstCalcer*>( parents[0] ) &&
436  parents[0]->imp()->inherits( DoubleImp::stype() ) );
437 
438  ObjectConstCalcer* po = static_cast<ObjectConstCalcer*>( parents[0] );
439  double oldp = static_cast<const DoubleImp*>( po->imp() )->data();
440 
441  bool ok = true;
442  double newp = getDoubleFromUser(
443  i18n( "Set Point Parameter" ), i18n( "Choose the new parameter: " ),
444  oldp, &w, &ok, 0, 1, 4 );
445  if ( ! ok ) return;
446 
447  MonitorDataObjects mon( parents );
448  po->setImp( new DoubleImp( newp ) );
449  KigCommand* kc = new KigCommand( d, i18n( "Change Parameter of Constrained Point" ) );
450  mon.finish( kc );
451  d.history()->push( kc );
452  break;
453  };
454  default:
455  assert( false );
456  };
457 }
458 
459 const Coordinate FixedPointType::moveReferencePoint( const ObjectTypeCalcer& ourobj ) const
460 {
461  assert( ourobj.imp()->inherits( PointImp::stype() ) );
462  return static_cast<const PointImp*>( ourobj.imp() )->coordinate();
463 }
464 
465 const Coordinate RelativePointType::moveReferencePoint( const ObjectTypeCalcer& ourobj ) const
466 {
467  assert( ourobj.imp()->inherits( PointImp::stype() ) );
468 // return static_cast<const PointImp*>( ourobj.imp() )->coordinate();
469  return Coordinate( 0., 0. );
470 }
471 
472 const Coordinate ConstrainedPointType::moveReferencePoint( const ObjectTypeCalcer& ourobj ) const
473 {
474  assert( ourobj.imp()->inherits( PointImp::stype() ) );
475  return static_cast<const PointImp*>( ourobj.imp() )->coordinate();
476 }
477 
478 std::vector<ObjectCalcer*> FixedPointType::movableParents( const ObjectTypeCalcer& ourobj ) const
479 {
480  return ourobj.parents();
481 }
482 
483 std::vector<ObjectCalcer*> RelativePointType::movableParents( const ObjectTypeCalcer& ourobj ) const
484 {
485  std::vector<ObjectCalcer*> ret;
486  ret.push_back( ourobj.parents()[0] );
487  ret.push_back( ourobj.parents()[1] );
488  return ret;
489 }
490 
491 std::vector<ObjectCalcer*> ConstrainedPointType::movableParents( const ObjectTypeCalcer& ourobj ) const
492 {
493  std::vector<ObjectCalcer*> ret;
494  ret.push_back( ourobj.parents()[0] );
495  return ret;
496 }
497 
498 static const ArgsParser::spec argsspecConstrainedRelativePoint[] =
499 {
500  { DoubleImp::stype(), "relative-x", "SHOULD NOT BE SEEN", false },
501  { DoubleImp::stype(), "relative-y", "SHOULD NOT BE SEEN", false },
502  { DoubleImp::stype(), "parameter", "SHOULD NOT BE SEEN", false },
503  { CurveImp::stype(), "curve", "SHOULD NOT BE SEEN", false }
504 };
505 
506 KIG_INSTANTIATE_OBJECT_TYPE_INSTANCE( ConstrainedRelativePointType )
507 
508 ConstrainedRelativePointType::ConstrainedRelativePointType()
509  : ArgsParserObjectType( "ConstrainedRelativePoint",
510  argsspecConstrainedRelativePoint, 4 )
511 {
512 }
513 
514 ConstrainedRelativePointType::~ConstrainedRelativePointType()
515 {
516 }
517 
518 ObjectImp* ConstrainedRelativePointType::calc( const Args& parents,
519  const KigDocument& doc ) const
520 {
521  if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp;
522 
523  double a = static_cast<const DoubleImp*>( parents[0] )->data();
524  double b = static_cast<const DoubleImp*>( parents[1] )->data();
525  double p = static_cast<const DoubleImp*>( parents[2] )->data();
526  Coordinate reference = static_cast<const CurveImp*>( parents[3] )->getPoint( p, doc );
527 
528  return new PointImp( reference + Coordinate( a, b ) );
529 }
530 
531 void ConstrainedRelativePointType::move( ObjectTypeCalcer& ourobj,
532  const Coordinate& to, const KigDocument& doc ) const
533 {
534  // this routine is tightly paired with what moveReferencePoint returns!
535  // right now moveReferencePoint always returns the origin
536  std::vector<ObjectCalcer*> pa = ourobj.parents();
537  assert( margsparser.checkArgs( pa ) );
538  assert( dynamic_cast<ObjectConstCalcer*>( pa[0] ) );
539  assert( dynamic_cast<ObjectConstCalcer*>( pa[1] ) );
540  assert( dynamic_cast<ObjectConstCalcer*>( pa[2] ) );
541 
542  ObjectConstCalcer* ox = static_cast<ObjectConstCalcer*>( pa[0] );
543  ObjectConstCalcer* oy = static_cast<ObjectConstCalcer*>( pa[1] );
544  ObjectConstCalcer* op = static_cast<ObjectConstCalcer*>( pa[2] );
545  ObjectCalcer* ob = static_cast<ObjectCalcer*>( pa[3] );
546 
547  const CurveImp* curve = static_cast<const CurveImp*>( ob->imp() );
548  double newp = curve->getParam( to, doc );
549  Coordinate attach = curve->getPoint( newp, doc );
550 
551  ox->setImp( new DoubleImp( to.x - attach.x ) );
552  oy->setImp( new DoubleImp( to.y - attach.y ) );
553  op->setImp( new DoubleImp( newp ) );
554 }
555 
556 bool ConstrainedRelativePointType::canMove( const ObjectTypeCalcer& ) const
557 {
558  return true;
559 }
560 
561 bool ConstrainedRelativePointType::isFreelyTranslatable( const ObjectTypeCalcer& ) const
562 {
563  return true;
564 }
565 
566 const ConstrainedRelativePointType* ConstrainedRelativePointType::instance()
567 {
568  static const ConstrainedRelativePointType t;
569  return &t;
570 }
571 
572 const ObjectImpType* ConstrainedRelativePointType::resultId() const
573 {
574  return PointImp::stype();
575 }
576 
577 const Coordinate ConstrainedRelativePointType::moveReferencePoint(
578  const ObjectTypeCalcer& ourobj ) const
579 {
580  assert( ourobj.imp()->inherits( PointImp::stype() ) );
581  return Coordinate( 0., 0. );
582 }
583 
584 std::vector<ObjectCalcer*> ConstrainedRelativePointType::movableParents(
585  const ObjectTypeCalcer& ourobj ) const
586 {
587  std::vector<ObjectCalcer*> ret;
588  ret.push_back( ourobj.parents()[0] );
589  ret.push_back( ourobj.parents()[1] );
590  ret.push_back( ourobj.parents()[2] );
591  return ret;
592 }
593 
594 /* ----------------- Transport of measure ------------------------------ */
595 
596 ObjectImp* MeasureTransportType::calc( const Args& parents, const KigDocument& doc ) const
597 {
598  double measure;
599 
600  if ( parents.size() != 3 ) return new InvalidImp;
601 
602  bool valid;
603  measure = getDoubleFromImp( parents[0], valid );
604  if ( ! valid ) return new InvalidImp;
605 
606  const Coordinate& p = static_cast<const PointImp*>( parents[2] )->coordinate();
607  if ( parents[1]->inherits (LineImp::stype()) )
608  {
609  const LineImp* c = static_cast<const LineImp*>( parents[1] );
610 
611  if ( !c->containsPoint( p, doc ) )
612  return new InvalidImp;
613 
614  const LineData line = c->data();
615  const Coordinate dir = line.dir()/line.length();
616  const Coordinate nc = p + measure*dir;
617 
618  if ( nc.valid() ) return new PointImp( nc );
619  else return new InvalidImp;
620  } else if ( parents[1]->inherits (CircleImp::stype()) )
621  {
622  const CircleImp* c = static_cast<const CircleImp*>( parents[1] );
623  if ( !c->containsPoint( p, doc ) )
624  return new InvalidImp;
625 
626  double param = c->getParam( p, doc );
627  measure /= 2*c->radius()*M_PI;
628  param += measure;
629  while (param > 1) param -= 1;
630 
631  const Coordinate nc = c->getPoint( param, doc );
632  if ( nc.valid() ) return new PointImp( nc );
633  else return new InvalidImp;
634  }
635 
636  return new InvalidImp;
637 }
638 
639 // I18N_NOOP( "Select the segment/arc to transport on the circle/line..." ), false },
640 // I18N_NOOP( "Select the circle/line on which to transport a measure..." ), true },
641 // I18N_NOOP( "Select a point on the circle/line..." ), false }
642 
643 KIG_INSTANTIATE_OBJECT_TYPE_INSTANCE( MeasureTransportType )
644 
645 MeasureTransportType::MeasureTransportType()
646  : ObjectType( "TransportOfMeasure" )
647 {
648 }
649 
650 MeasureTransportType::~MeasureTransportType()
651 {
652 }
653 
654 const MeasureTransportType* MeasureTransportType::instance()
655 {
656  static const MeasureTransportType t;
657  return &t;
658 }
659 
660 const ObjectImpType* MeasureTransportType::resultId() const
661 {
662  return PointImp::stype();
663 }
664 
665 const ObjectImpType* MeasureTransportType::impRequirement( const ObjectImp* obj, const Args& ) const
666 {
667  if ( obj->inherits( PointImp::stype () ) )
668  return PointImp::stype ();
669 
670  if ( obj->inherits( LineImp::stype () ) )
671  return LineImp::stype ();
672 
673  if ( obj->inherits( CircleImp::stype () ) )
674  return CircleImp::stype ();
675 
676  if ( obj->inherits( SegmentImp::stype () ) )
677  return SegmentImp::stype ();
678 
679  if ( obj->inherits( ArcImp::stype () ) )
680  return ArcImp::stype ();
681 
682  return 0;
683 }
684 
685 bool MeasureTransportType::isDefinedOnOrThrough( const ObjectImp* o, const Args& ) const
686 {
687  if ( o->inherits( LineImp::stype() ) ) return true;
688  if ( o->inherits( CircleImp::stype() ) ) return true;
689  return false;
690 }
691 
692 std::vector<ObjectCalcer*> MeasureTransportType::sortArgs( const std::vector<ObjectCalcer*>& args ) const
693 {
694  return args; /* should already be in correct order */
695 }
696 
697 Args MeasureTransportType::sortArgs( const Args& args ) const
698 {
699  return args;
700 }
701 
702 /* - transport of measure (old, for compatibility with prev. kig files) - */
703 /* it should be safe now to remove this completely, since the loading of "MeasureTransport"
704  * is treated in "load07" building a node that uses the new version
705  */
706 
707 ObjectImp* MeasureTransportTypeOld::calc( const Args& parents, const KigDocument& doc ) const
708 {
709  if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp;
710 
711  const CircleImp* c = static_cast<const CircleImp*>( parents[0] );
712  const Coordinate& p = static_cast<const PointImp*>( parents[1] )->coordinate();
713 
714  if ( !c->containsPoint( p, doc ) )
715  return new InvalidImp;
716 
717  const SegmentImp* s = static_cast<const SegmentImp*>( parents[2] );
718  double param = c->getParam( p, doc );
719  double measure = s->length();
720  measure /= 2*c->radius()*M_PI;
721  param += measure;
722  while (param > 1) param -= 1;
723 
724  const Coordinate nc = c->getPoint( param, doc );
725  if ( nc.valid() ) return new PointImp( nc );
726  else return new InvalidImp;
727 }
728 
729 static const ArgsParser::spec argsspecMeasureTransportOld[] =
730 {
731  { CircleImp::stype(), "Transport a measure on this circle",
732  I18N_NOOP( "Select the circle on which to transport a measure..." ), true },
733  { PointImp::stype(), "Start transport from this point of the circle",
734  I18N_NOOP( "Select a point on the circle..." ), false },
735  { SegmentImp::stype(), "Segment to transport",
736  I18N_NOOP( "Select the segment to transport on the circle..." ), false }
737 };
738 
739 KIG_INSTANTIATE_OBJECT_TYPE_INSTANCE( MeasureTransportTypeOld )
740 
741 MeasureTransportTypeOld::MeasureTransportTypeOld()
742  : ArgsParserObjectType( "MeasureTransportObsoleted", argsspecMeasureTransportOld, 3 )
743 {
744 }
745 
746 MeasureTransportTypeOld::~MeasureTransportTypeOld()
747 {
748 }
749 
750 const MeasureTransportTypeOld* MeasureTransportTypeOld::instance()
751 {
752  static const MeasureTransportTypeOld t;
753  return &t;
754 }
755 
756 const ObjectImpType* MeasureTransportTypeOld::resultId() const
757 {
758  return PointImp::stype();
759 }
760 
761 /* ----------------- end transport of measure ------------------------- */
762 
763 /* Construct a point whose coordinates are indicated by numeric labels */
764 
765 ObjectImp* PointByCoordsType::calc( const Args& parents, const KigDocument& ) const
766 {
767  if ( ! margsparser.checkArgs( parents ) ) return new InvalidImp;
768 
769  bool valid;
770  double x = getDoubleFromImp( parents[0], valid);
771  if ( ! valid ) return new InvalidImp;
772  double y = getDoubleFromImp( parents[1], valid);
773  if ( ! valid ) return new InvalidImp;
774 
775  const Coordinate nc = Coordinate( x, y );
776  if ( nc.valid() ) return new PointImp( nc );
777  else return new InvalidImp;
778 }
779 
780 static const ArgsParser::spec argsspecPointByCoords[] =
781 {
782  { &lengthimptypeinstance, "X coordinate given by this number/length",
783  I18N_NOOP( "Select a number/length as x coordinate of the point..." ), false },
784  { &lengthimptypeinstance, "Y coordinate given by this number/length",
785  I18N_NOOP( "Select a number/length as y coordinate of the point..." ), false }
786 };
787 
788 KIG_INSTANTIATE_OBJECT_TYPE_INSTANCE( PointByCoordsType )
789 
790 PointByCoordsType::PointByCoordsType()
791  : ArgsParserObjectType( "PointByCoordinates", argsspecPointByCoords, 2 )
792 {
793 }
794 
795 PointByCoordsType::~PointByCoordsType()
796 {
797 }
798 
799 const PointByCoordsType* PointByCoordsType::instance()
800 {
801  static const PointByCoordsType t;
802  return &t;
803 }
804 
805 const ObjectImpType* PointByCoordsType::resultId() const
806 {
807  return PointImp::stype();
808 }
809 
810 static const ArgsParser::spec argsspecProjectedPoint[] =
811 {
812  { PointImp::stype(), "Point to project",
813  I18N_NOOP( "Select a point to project onto a line..." ), false },
814  { AbstractLineImp::stype(), "Line where to project",
815  I18N_NOOP( "Line where the projected point will lie..." ), true }
816 };
817 
818 KIG_INSTANTIATE_OBJECT_TYPE_INSTANCE( ProjectedPointType )
819 
820 ProjectedPointType::ProjectedPointType()
821  : ArgsParserObjectType( "ProjectedPoint", argsspecProjectedPoint, 2 )
822 {
823 }
824 
825 ProjectedPointType::~ProjectedPointType()
826 {
827 }
828 
829 const ProjectedPointType* ProjectedPointType::instance()
830 {
831  static const ProjectedPointType t;
832  return &t;
833 }
834 
835 ObjectImp* ProjectedPointType::calc(const Args& parents, const KigDocument& ) const
836 {
837  if( parents.size() == 2 )
838  {
839  const PointImp* point = static_cast<const PointImp*>( parents[0] );
840  const LineImp* line = static_cast<const LineImp*>( parents[1] );
841 
842  return new PointImp( calcPointProjection( point->coordinate(), line->data() ) );
843  }
844 
845  return new InvalidImp();
846 }
847 
848 const ObjectImpType* ProjectedPointType::resultId() const
849 {
850  return PointImp::stype();
851 }
MeasureTransportType::impRequirement
const ObjectImpType * impRequirement(const ObjectImp *o, const Args &parents) const
Supposing that parents would be given as parents to this type's calc function, this function returns ...
Definition: point_type.cc:665
redefinePoint
static void redefinePoint(ObjectHolder *o, KigPart &d, KigWidget &w)
Definition: point_type.cc:383
ProjectedPointType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:848
MidPointType::calcx
ObjectImp * calcx(const Coordinate &a, const Coordinate &b) const
Definition: point_type.cc:288
ObjectTypeCalcer::move
void move(const Coordinate &to, const KigDocument &doc)
This is the method that does the real moving work.
Definition: object_calcer.cc:296
MeasureTransportType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:660
AbstractLineImp::data
LineData data() const
Get the LineData for this AbstractLineImp.
Definition: line_imp.cc:359
ObjectImpType
Instances of this class represent a certain ObjectImp type.
Definition: object_imp.h:95
RelativePointType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:483
ObjectImp::inherits
bool inherits(const ObjectImpType *t) const
Returns true if this ObjectImp inherits the ObjectImp type represented by t.
Definition: object_imp.cc:279
ObjectConstCalcer::imp
const ObjectImp * imp() const
Returns the ObjectImp of this ObjectCalcer.
Definition: object_calcer.cc:65
ObjectConstCalcer::setImp
void setImp(ObjectImp *newimp)
Set the ObjectImp of this ObjectConstCalcer to the given newimp.
Definition: object_calcer.cc:241
RelativePointType::canMove
bool canMove(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:248
ConstrainedRelativePointType::move
void move(ObjectTypeCalcer &ourobj, const Coordinate &to, const KigDocument &) const
Definition: point_type.cc:531
SegmentImp::length
double length() const
Get the length of this segment.
Definition: line_imp.cc:494
KIG_INSTANTIATE_OBJECT_TYPE_INSTANCE
KIG_INSTANTIATE_OBJECT_TYPE_INSTANCE(SegmentAxisType)
MeasureTransportType::sortArgs
std::vector< ObjectCalcer * > sortArgs(const std::vector< ObjectCalcer * > &args) const
Definition: point_type.cc:692
ObjectABType
Definition: base_type.h:27
point_imp.h
ArgsParserObjectType
This is a convenience subclass of ObjectType that a type should inherit from if its parents can be sp...
Definition: object_type.h:113
FixedPointType::executeAction
void executeAction(int i, ObjectHolder &o, ObjectTypeCalcer &t, KigPart &d, KigWidget &w, NormalMode &m) const
execute the i 'th action from the specialActions above.
Definition: point_type.cc:389
argsspecFixedPoint
static const ArgsParser::spec argsspecFixedPoint[]
Definition: point_type.cc:41
KigCommand
a KigCommand represents almost every action performed in Kig.
Definition: kig_commands.h:44
RelativePointType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:326
ObjectType::inherits
virtual bool inherits(int type) const
Definition: object_type.cc:64
LineData
Simple class representing a line.
Definition: misc/common.h:49
ObjectConstCalcer
This is an ObjectCalcer that keeps an ObjectImp, and never calculates a new one.
Definition: object_calcer.h:232
LineData::dir
const Coordinate dir() const
The direction of the line.
Definition: misc/common.h:72
BogusPointImp::stype
static const ObjectImpType * stype()
Definition: point_imp.cc:203
LineImp::containsPoint
bool containsPoint(const Coordinate &p, const KigDocument &doc) const
Return whether this Curve contains the given point.
Definition: line_imp.cc:614
CircleImp
An ObjectImp representing a circle.
Definition: circle_imp.h:27
CircleImp::getPoint
const Coordinate getPoint(double param, const KigDocument &) const
Definition: circle_imp.cc:325
KigPart::document
const KigDocument & document() const
Definition: kig_part.cpp:986
argsspecProjectedPoint
static const ArgsParser::spec argsspecProjectedPoint[]
Definition: point_type.cc:810
DoubleImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the DoubleImp type.
Definition: bogus_imp.cc:270
CursorPointType::canMove
bool canMove(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:258
ConstrainedRelativePointType::canMove
bool canMove(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:556
KigPart::history
QUndoStack * history()
Definition: kig_part.cpp:630
special_imptypes.h
ConstrainedPointType::move
void move(ObjectTypeCalcer &ourobj, const Coordinate &to, const KigDocument &) const
Definition: point_type.cc:211
ConstrainedPointType::executeAction
void executeAction(int i, ObjectHolder &, ObjectTypeCalcer &o, KigPart &d, KigWidget &w, NormalMode &m) const
execute the i 'th action from the specialActions above.
Definition: point_type.cc:423
PointImp::coordinate
const Coordinate & coordinate() const
Get the coordinate of this PointImp.
Definition: point_imp.h:50
ObjectImp::stype
static const ObjectImpType * stype()
The ObjectImpType representing the base ObjectImp class.
Definition: object_imp.cc:284
ObjectTypeCalcer
This is an ObjectCalcer that uses one of the various ObjectType's to calculate its ObjectImp...
Definition: object_calcer.h:183
LineImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the LineImp type.
Definition: line_imp.cc:528
lengthimptypeinstance
LengthImpType lengthimptypeinstance
ConstrainedRelativePointType
Definition: point_type.h:75
FixedPointType::instance
static const FixedPointType * instance()
Definition: point_type.cc:309
FixedPointType
Definition: point_type.h:25
RelativePointType::instance
static const RelativePointType * instance()
Definition: point_type.cc:320
point_type.h
ConstrainedRelativePointType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:518
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
ConicImp::containsPoint
bool containsPoint(const Coordinate &p, const KigDocument &doc) const
Return whether this Curve contains the given point.
Definition: conic_imp.cc:402
ConstrainedRelativePointType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:561
ConstrainedPointType::canMove
bool canMove(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:228
FixedPointType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:58
CurveImp::getPoint
virtual const Coordinate getPoint(double param, const KigDocument &) const =0
ArgsParserObjectType::margsparser
const ArgsParser margsparser
Definition: object_type.h:117
KigInputDialog::getCoordinate
static void getCoordinate(const QString &caption, const QString &label, QWidget *parent, bool *ok, const KigDocument &doc, Coordinate *cvalue)
Static convenience function to get a Coordinate from the user.
Definition: kiginputdialog.cc:259
CircleImp::getParam
double getParam(const Coordinate &point, const KigDocument &) const
Definition: circle_imp.cc:317
argsspecMeasureTransportOld
static const ArgsParser::spec argsspecMeasureTransportOld[]
Definition: point_type.cc:729
argsspecPointByCoords
static const ArgsParser::spec argsspecPointByCoords[]
Definition: point_type.cc:780
getAllParents
std::vector< ObjectCalcer * > getAllParents(const std::vector< ObjectCalcer * > &objs)
This function returns all objects above the given in the dependency graph.
Definition: calcpaths.cc:229
ConstrainedRelativePointType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:577
argsspecMidPoint
static const ArgsParser::spec argsspecMidPoint[]
Definition: point_type.cc:263
ConstrainedRelativePointType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:584
getDoubleFromUser
double getDoubleFromUser(const QString &caption, const QString &label, double value, QWidget *parent, bool *ok, double min, double max, int decimals)
Here, we define some algorithms which we need in various places...
Definition: common.cpp:349
ObjectHolder
An ObjectHolder represents an object as it is known to the document.
Definition: object_holder.h:40
ObjectTypeCalcer::imp
const ObjectImp * imp() const
Returns the ObjectImp of this ObjectCalcer.
Definition: object_calcer.cc:100
bogus_imp.h
ConstrainedRelativePointType::instance
static const ConstrainedRelativePointType * instance()
Definition: point_type.cc:566
PointImp
An ObjectImp representing a point.
Definition: point_imp.h:27
ObjectCalcer
An ObjectCalcer is an object that represents an algorithm for calculating an ObjectImp from other Obj...
Definition: object_calcer.h:66
Args
std::vector< const ObjectImp * > Args
Definition: objects/common.h:47
CursorPointType::isDefinedOnOrThrough
bool isDefinedOnOrThrough(const ObjectImp *o, const Args &parents) const
Supposing that parents would be given as parents to this type's calc function, this function returns ...
Definition: point_type.cc:347
ConstrainedPointType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:491
MonitorDataObjects
this class monitors a set of DataObjects for changes and returns an appropriate ChangeObjectImpsComma...
Definition: kig_commands.h:153
KigPart::runMode
void runMode(KigMode *)
Definition: kig_part.cpp:732
argsspecConstrainedPoint
const ArgsParser::spec argsspecConstrainedPoint[]
Definition: point_type.cc:141
MeasureTransportType::isDefinedOnOrThrough
bool isDefinedOnOrThrough(const ObjectImp *o, const Args &parents) const
Supposing that parents would be given as parents to this type's calc function, this function returns ...
Definition: point_type.cc:685
ConstrainedPointType
Definition: point_type.h:115
KigWidget
This class is the real widget showing the document.
Definition: kig_view.h:50
ArgsParser::checkArgs
bool checkArgs(const std::vector< ObjectCalcer * > &os) const
Definition: argsparser.cpp:222
SegmentImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the SegmentImp type.
Definition: line_imp.cc:545
FixedPointType::move
void move(ObjectTypeCalcer &ourobj, const Coordinate &to, const KigDocument &) const
Definition: point_type.cc:158
QStringList
FixedPointType::canMove
bool canMove(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:238
ArgsParser::spec
Definition: argsparser.h:113
MidPointType
Definition: point_type.h:140
ArcImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the ArcImp type.
Definition: other_imp.cc:629
ObjectImp::attachPoint
virtual Coordinate attachPoint() const =0
Returns a reference point where to attach labels; when this returns an invalidCoord then the attachme...
MonitorDataObjects::finish
void finish(KigCommand *comm)
add the generated KigCommandTasks to the command comm .
Definition: kig_commands.cpp:227
MeasureTransportTypeOld::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:756
CircleImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the CircleImp type.
Definition: circle_imp.cc:342
CursorPointType::move
void move(ObjectTypeCalcer &ourobj, const Coordinate &to, const KigDocument &) const
Definition: point_type.cc:194
RelativePointType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:253
ObjectType
The ObjectType class is a thing that represents the "behaviour" for a certain type.
Definition: object_type.h:32
PointByCoordsType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:805
CoordinateSystem::coordinateFormatNoticeMarkup
virtual QString coordinateFormatNoticeMarkup() const =0
Like coordinateFormatNotice(), but with HTML tags useful to have a rich text...
CursorPointType::sortArgs
std::vector< ObjectCalcer * > sortArgs(const std::vector< ObjectCalcer * > &args) const
Definition: point_type.cc:352
ConstrainedPointType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:233
CursorPointType
Definition: point_type.h:95
MidPointType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:362
BogusPointImp
Definition: point_imp.h:81
argsspecRelativePoint
static const ArgsParser::spec argsspecRelativePoint[]
Definition: point_type.cc:68
ObjectType::ID_ConstrainedPointType
Definition: object_type.h:41
FixedPointType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:478
CircleImp::radius
double radius() const
Return the radius of this circle.
Definition: circle_imp.cc:215
ConstrainedPointType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:331
PointImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing PointImp's.
Definition: point_imp.cc:159
PointRedefineMode
Definition: moving.h:86
line_imp.h
ConstrainedPointType::specialActions
QStringList specialActions() const
return i18n'd names for the special actions.
Definition: point_type.cc:375
MeasureTransportTypeOld
Definition: point_type.h:168
ConstrainedPointType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:130
RelativePointType::move
void move(ObjectTypeCalcer &ourobj, const Coordinate &to, const KigDocument &) const
Definition: point_type.cc:174
CurveImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the CurveImp type.
Definition: curve_imp.cc:27
PointByCoordsType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:765
DoubleImp
This ObjectImp is a BogusImp containing only a double value.
Definition: bogus_imp.h:89
RelativePointType
Definition: point_type.h:51
FixedPointType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:243
KigDocument
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
CursorPointType::impRequirement
const ObjectImpType * impRequirement(const ObjectImp *o, const Args &parents) const
Supposing that parents would be given as parents to this type's calc function, this function returns ...
Definition: point_type.cc:336
MeasureTransportTypeOld::instance
static const MeasureTransportTypeOld * instance()
Definition: point_type.cc:750
AbstractLineImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the AbstractLineImp type.
Definition: line_imp.cc:520
ConstrainedPointType::inherits
bool inherits(int type) const
Definition: point_type.cc:293
KigDocument::mcachedparam
double mcachedparam
Definition: kig_document.h:71
LineImp
An ObjectImp representing a line.
Definition: line_imp.h:184
ObjectCalcer::imp
virtual const ObjectImp * imp() const =0
Returns the ObjectImp of this ObjectCalcer.
argsspecConstrainedRelativePoint
static const ArgsParser::spec argsspecConstrainedRelativePoint[]
Definition: point_type.cc:498
MidPointType::instance
static const MidPointType * instance()
Definition: point_type.cc:282
ObjectTypeCalcer::parents
std::vector< ObjectCalcer * > parents() const
Returns the parent ObjectCalcer's of this ObjectCalcer.
Definition: object_calcer.cc:105
FixedPointType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:315
MeasureTransportType::instance
static const MeasureTransportType * instance()
Definition: point_type.cc:654
Coordinate::x
double x
X Component.
Definition: coordinate.h:126
QString::fromLatin1
QString fromLatin1(const char *str, int size)
getDoubleFromImp
double getDoubleFromImp(const ObjectImp *obj, bool &valid)
Definition: special_imptypes.cc:27
Coordinate::y
double y
Y Component.
Definition: coordinate.h:129
ObjectImp
The ObjectImp class represents the behaviour of an object after it is calculated. ...
Definition: object_imp.h:226
KigPart
This is a "Part".
Definition: kig_part.h:68
ProjectedPointType
Definition: point_type.h:192
ProjectedPointType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:835
CursorPointType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:125
MeasureTransportType
Definition: point_type.h:152
PointByCoordsType
Definition: point_type.h:180
FixedPointType::specialActions
QStringList specialActions() const
return i18n'd names for the special actions.
Definition: point_type.cc:367
ConstrainedPointType::instance
static const ConstrainedPointType * instance()
Definition: point_type.cc:298
curve_imp.h
KigDocument::coordinateSystem
const CoordinateSystem & coordinateSystem() const
Definition: kig_document.cc:40
RelativePointType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:86
ConstrainedPointType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:472
PointByCoordsType::instance
static const PointByCoordsType * instance()
Definition: point_type.cc:799
ConstrainedRelativePointType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: point_type.cc:572
RelativePointType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:465
CurveImp::getParam
virtual double getParam(const Coordinate &point, const KigDocument &) const
Definition: curve_imp.cc:149
NormalMode
Definition: normal.h:26
MeasureTransportTypeOld::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:707
calcPointProjection
const Coordinate calcPointProjection(const Coordinate &p, const LineData &l)
this calculates the perpendicular projection of point p on line ab...
Definition: common.cpp:295
Coordinate::valid
bool valid() const
Return whether this is a valid Coordinate.
Definition: coordinate.cpp:176
ProjectedPointType::instance
static const ProjectedPointType * instance()
Definition: point_type.cc:829
FixedPointType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &ourobj) const
Definition: point_type.cc:459
CursorPointType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:115
CursorPointType::instance
static const CursorPointType * instance()
Definition: point_type.cc:109
QUndoStack::push
void push(QUndoCommand *cmd)
MeasureTransportType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: point_type.cc:596
InvalidImp
This ObjectImp represents an invalid object.
Definition: bogus_imp.h:61
ObjectType::ID_FixedPointType
Definition: object_type.h:43
other_imp.h
CurveImp
This class represents a curve: something which is composed of points, like a line, a circle, a locus.
Definition: curve_imp.h:27
FixedPointType::inherits
bool inherits(int type) const
Definition: point_type.cc:304
LineData::length
double length() const
The length from a to b.
Definition: misc/common.h:76
SegmentImp
An ObjectImp representing a segment.
Definition: line_imp.h:81
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:05 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
  • 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