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

kig

  • sources
  • kde-4.12
  • kdeedu
  • kig
  • objects
object_imp_factory.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 "object_imp_factory.h"
19 
20 #include "object_imp.h"
21 #include "bogus_imp.h"
22 #include "circle_imp.h"
23 #include "conic_imp.h"
24 #include "cubic_imp.h"
25 #include "line_imp.h"
26 #include "locus_imp.h"
27 #include "other_imp.h"
28 #include "point_imp.h"
29 #include "text_imp.h"
30 
31 #include "../misc/coordinate.h"
32 
33 #include <qdom.h>
34 
35 #include <klocale.h>
36 
37 const ObjectImpFactory* ObjectImpFactory::instance()
38 {
39  static const ObjectImpFactory t;
40  return &t;
41 }
42 
43 ObjectImpFactory::ObjectImpFactory()
44 {
45 }
46 
47 ObjectImpFactory::~ObjectImpFactory()
48 {
49 }
50 
51 static void addXYElements( const Coordinate& c, QDomElement& parent, QDomDocument& doc )
52 {
53  QDomElement xe = doc.createElement( "x" );
54  xe.appendChild(
55  doc.createTextNode(
56  QString::number( c.x ) ) );
57  parent.appendChild( xe );
58  QDomElement ye = doc.createElement( "y" );
59  ye.appendChild(
60  doc.createTextNode(
61  QString::number( c.y ) ) );
62  parent.appendChild( ye );
63 }
64 
65 static void addDoubleElement( const char* name, double d, QDomElement& parent, QDomDocument& doc )
66 {
67  QDomElement e = doc.createElement( name );
68  e.appendChild( doc.createTextNode( QString::number( d ) ) );
69  parent.appendChild( e );
70 }
71 
72 static void addCoordinateElement( const char* name, const Coordinate& d, QDomElement& p, QDomDocument& doc )
73 {
74  QDomElement e = doc.createElement( name );
75  addXYElements( d, e, doc );
76  p.appendChild( e );
77 }
78 
79 QString ObjectImpFactory::serialize( const ObjectImp& d, QDomElement& parent,
80  QDomDocument& doc ) const
81 {
82  if( d.inherits( IntImp::stype() ) )
83  {
84  parent.appendChild(
85  doc.createTextNode(
86  QString::number( static_cast<const IntImp&>( d ).data() ) ) );
87  return QString::fromLatin1( "int" );
88  }
89  else if ( d.inherits( DoubleImp::stype() ) )
90  {
91  parent.appendChild(
92  doc.createTextNode(
93  QString::number( static_cast<const DoubleImp&>( d ).data() ) ) );
94  return QString::fromLatin1( "double" );
95  }
96  else if( d.inherits( StringImp::stype() ) )
97  {
98  parent.appendChild(
99  doc.createTextNode(
100  static_cast<const StringImp&>( d ).data() ) );
101  return QString::fromLatin1( "string" );
102  }
103  else if ( d.inherits( TestResultImp::stype() ) )
104  {
105  assert( false );
106  parent.appendChild(
107  doc.createTextNode(
108  static_cast<const TestResultImp&>( d ).data() ) );
109  return QString::fromLatin1( "testresult" );
110  }
111  else if( d.inherits( HierarchyImp::stype() ) )
112  {
113  static_cast<const HierarchyImp&>( d ).data().serialize( parent, doc );
114  return QString::fromLatin1( "hierarchy" );
115  }
116  else if ( d.inherits( TransformationImp::stype() ) )
117  {
118  const Transformation& trans = static_cast<const TransformationImp&>( d ).data();
119 
120  QDomElement matrixe = doc.createElement( "matrix" );
121  for ( int i = 0; i < 3; ++i )
122  {
123  for ( int j = 0; j < 3; ++j )
124  {
125  QDomElement elel = doc.createElement( "element" );
126  elel.setAttribute( "row", QString::number( i ) );
127  elel.setAttribute( "column", QString::number( j ) );
128  elel.appendChild( doc.createTextNode( QString::number( trans.data( i, j ) ) ) );
129  matrixe.appendChild( elel );
130  };
131  }
132  parent.appendChild( matrixe );
133 
134  QDomElement homothetye = doc.createElement( "homothetic" );
135  const char* ishomothety = trans.isHomothetic() ? "true" : "false";
136  homothetye.appendChild( doc.createTextNode( ishomothety ) );
137  parent.appendChild( homothetye );
138 
139  return QString::fromLatin1( "transformation" );
140  }
141  else if( d.inherits( AbstractLineImp::stype() ) )
142  {
143  LineData l = static_cast<const AbstractLineImp&>( d ).data();
144  addCoordinateElement( "a", l.a, parent, doc );
145  addCoordinateElement( "b", l.b, parent, doc );
146  if( d.inherits( SegmentImp::stype() ) )
147  return QString::fromLatin1( "segment" );
148  else if( d.inherits( RayImp::stype() ) )
149  return QString::fromLatin1( "ray" );
150  else return QString::fromLatin1( "line" );
151  }
152  else if( d.inherits( PointImp::stype() ) )
153  {
154  addXYElements( static_cast<const PointImp&>( d ).coordinate(),
155  parent, doc );
156  return QString::fromLatin1( "point" );
157  }
158  else if( d.inherits( TextImp::stype() ) )
159  {
160  QString text = static_cast<const TextImp&>( d ).text();
161  parent.appendChild(
162  doc.createTextNode( text ) );
163  return QString::fromLatin1( "text" );
164  }
165  else if( d.inherits( AngleImp::stype() ) )
166  {
167  addDoubleElement( "size", static_cast<const AngleImp&>( d ).size(), parent, doc );
168  return QString::fromLatin1( "angle" );
169  }
170  else if ( d.inherits( ArcImp::stype() ) )
171  {
172  const ArcImp& a = static_cast<const ArcImp&>( d );
173  addCoordinateElement( "center", a.center(), parent, doc );
174  addDoubleElement( "radius", a.radius(), parent, doc );
175  addDoubleElement( "startangle", a.startAngle(), parent, doc );
176  addDoubleElement( "angle", a.angle(), parent, doc );
177  return QString::fromLatin1( "arc" );
178  }
179  else if( d.inherits( VectorImp::stype() ) )
180  {
181  Coordinate dir = static_cast<const VectorImp&>( d ).dir();
182  addXYElements( dir, parent, doc );
183  return QString::fromLatin1( "vector" );
184  }
185  else if( d.inherits( LocusImp::stype() ) )
186  {
187  const LocusImp& locus = static_cast<const LocusImp&>( d );
188 
189  // serialize the curve..
190  QDomElement curve = doc.createElement( "curve" );
191  const CurveImp& curveimp = *locus.curve();
192  QString type = serialize( curveimp, curve, doc );
193  curve.setAttribute( "type", type );
194  parent.appendChild( curve );
195 
196  // serialize the hierarchy..
197  QDomElement hier = doc.createElement( "calculation" );
198  locus.hierarchy().serialize( hier, doc );
199  parent.appendChild( hier );
200 
201  return QString::fromLatin1( "locus" );
202  }
203  else if( d.inherits( CircleImp::stype() ) )
204  {
205  const CircleImp& c = static_cast<const CircleImp&>( d );
206  addCoordinateElement( "center", c.center(), parent, doc );
207  addDoubleElement( "radius", c.radius(), parent, doc );
208  return QString::fromLatin1( "circle" );
209  }
210  else if( d.inherits( ConicImp::stype() ) )
211  {
212  const ConicPolarData data = static_cast<const ConicImp&>( d ).polarData();
213  addCoordinateElement( "focus1", data.focus1, parent, doc );
214  addDoubleElement( "pdimen", data.pdimen, parent, doc );
215  addDoubleElement( "ecostheta0", data.ecostheta0, parent, doc );
216  addDoubleElement( "esintheta0", data.esintheta0, parent, doc );
217  return QString::fromLatin1( "conic" );
218  }
219  else if( d.inherits( CubicImp::stype() ) )
220  {
221  const CubicCartesianData data = static_cast<const CubicImp&>( d ).data();
222  QDomElement coeffs = doc.createElement( "coefficients" );
223  addDoubleElement( "a000", data.coeffs[0], coeffs, doc );
224  addDoubleElement( "a001", data.coeffs[1], coeffs, doc );
225  addDoubleElement( "a002", data.coeffs[2], coeffs, doc );
226  addDoubleElement( "a011", data.coeffs[3], coeffs, doc );
227  addDoubleElement( "a012", data.coeffs[4], coeffs, doc );
228  addDoubleElement( "a022", data.coeffs[5], coeffs, doc );
229  addDoubleElement( "a111", data.coeffs[6], coeffs, doc );
230  addDoubleElement( "a112", data.coeffs[7], coeffs, doc );
231  addDoubleElement( "a122", data.coeffs[8], coeffs, doc );
232  addDoubleElement( "a222", data.coeffs[9], coeffs, doc );
233  parent.appendChild( coeffs );
234  return QString::fromLatin1( "cubic" );
235  }
236  assert( false );
237  return QString();
238 }
239 
240 static Coordinate readXYElements( const QDomElement& e, bool& ok )
241 {
242  double x, y;
243  ok = true;
244  QDomElement xe = e.firstChild().toElement();
245  if ( xe.isNull() || xe.tagName() != "x" )
246  {
247  ok = false;
248  return Coordinate();
249  }
250  else x = xe.text().toDouble( &ok );
251 
252  QDomElement ye = xe.nextSibling().toElement();
253  if ( ye.isNull() || ye.tagName() != "y" )
254  {
255  ok = false;
256  return Coordinate();
257  }
258  else y = ye.text().toDouble( &ok );
259 
260  return Coordinate( x, y );
261 }
262 
263 static Coordinate readCoordinateElement( const QDomNode& n, bool& ok,
264  const char* tagname )
265 {
266  QDomElement e = n.toElement();
267  if ( e.isNull() || e.tagName() != tagname )
268  {
269  ok = false;
270  Coordinate ret;
271  return ret;
272  }
273  return readXYElements( e, ok );
274 }
275 
276 static double readDoubleElement( const QDomNode& n, bool& ok,
277  const char* tagname )
278 {
279  QDomElement e = n.toElement();
280  if ( e.isNull() || e.tagName() != tagname )
281  {
282  ok = false;
283  return 0.;
284  };
285  return e.text().toDouble( &ok );
286 }
287 
288 ObjectImp* ObjectImpFactory::deserialize( const QString& type,
289  const QDomElement& parent,
290  QString& error ) const
291 {
292 #define KIG_GENERIC_PARSE_ERROR \
293  { \
294  error = i18n( "An error was encountered at line %1 in file %2.", \
295  __LINE__, __FILE__ ); \
296  return 0; \
297  }
298 
299  bool ok = true;
300  if ( type == "int" )
301  {
302  int ret = parent.text().toInt( &ok );
303  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
304  return new IntImp( ret );
305  }
306  else if ( type == "double" )
307  {
308  double ret = parent.text().toDouble( &ok );
309  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
310  return new DoubleImp( ret );
311  }
312  else if ( type == "string" )
313  {
314  return new StringImp( parent.text() );
315  }
316  else if ( type == "testresult" )
317  {
318 // should never get here, at least for new save files!
319  return new TestResultImp( true, parent.text() );
320  }
321  else if ( type == "hierarchy" )
322  {
323  ObjectHierarchy* hier = ObjectHierarchy::buildSafeObjectHierarchy( parent, error );
324  if ( ! hier ) return 0;
325  HierarchyImp* imp = new HierarchyImp( *hier );
326  delete hier;
327  return imp;
328  }
329  else if ( type == "transformation" )
330  {
331  double data[3][3];
332  bool homothetic = false;
333  for ( QDomElement childe = parent.firstChild().toElement();
334  ! childe.isNull(); childe = childe.nextSibling().toElement() )
335  {
336  if ( childe.tagName() == "matrix" )
337  {
338  for ( QDomElement elel = childe.firstChild().toElement();
339  ! elel.isNull(); elel = elel.nextSibling().toElement() )
340  {
341  if ( elel.tagName() != "element" ) KIG_GENERIC_PARSE_ERROR;
342  bool ok = true;
343  int row = elel.attribute( "row" ).toInt( &ok );
344  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
345  int column = elel.attribute( "column" ).toInt( &ok );
346  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
347  data[row][column] = elel.text().toDouble( &ok );
348  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
349  };
350  }
351  else if ( childe.tagName() == "homothetic" )
352  {
353  homothetic = childe.text() == "true";
354  }
355  else continue;
356  };
357  Transformation trans( data, homothetic );
358  return new TransformationImp( trans );
359  }
360  else if ( type == "point" )
361  {
362  Coordinate ret = readXYElements( parent, ok );
363  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
364  return new PointImp( ret );
365  }
366  else if ( type == "line" || type == "segment" || type == "ray" )
367  {
368  QDomNode n = parent.firstChild();
369  Coordinate a = readCoordinateElement( n, ok, "a" );
370  if ( !ok ) KIG_GENERIC_PARSE_ERROR;
371  n = n.nextSibling();
372  Coordinate b = readCoordinateElement( n, ok, "b" );
373  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
374  if ( type == "line" ) return new LineImp( a, b );
375  else if ( type == "segment" ) return new SegmentImp( a, b );
376  else return new RayImp( a, b );
377  }
378  else if( type == "angle" )
379  {
380  double size = readDoubleElement( parent.firstChild(), ok, "size" );
381  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
382 
383  //TODO figure out how to know if this should be marked as a right angle
384  return new AngleImp( Coordinate(), 0, size, false );
385  }
386  else if ( type == "arc" )
387  {
388  QDomNode n = parent.firstChild();
389  Coordinate center = readCoordinateElement( n, ok, "center" );
390  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
391  n = n.nextSibling();
392  double radius = readDoubleElement( n, ok, "radius" );
393  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
394  n = n.nextSibling();
395  double startangle = readDoubleElement( n, ok, "startangle" );
396  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
397  n = n.nextSibling();
398  double angle = readDoubleElement( n, ok, "angle" );
399  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
400  return new ArcImp( center, radius, startangle, angle );
401  }
402  else if( type == "vector" )
403  {
404  Coordinate dir = readXYElements( parent, ok );
405  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
406  return new VectorImp( Coordinate(), dir );
407  }
408  else if( type == "locus" )
409  {
410  QDomElement curvee = parent.firstChild().toElement();
411  if ( curvee.isNull() || curvee.tagName() != "curve" ) KIG_GENERIC_PARSE_ERROR;
412  QString type = curvee.attribute( "type" );
413  ObjectImp* oi = deserialize( type, curvee, error );
414  if ( ! oi || ! oi->inherits( CurveImp::stype() ) ) KIG_GENERIC_PARSE_ERROR;
415  //CurveImp* curvei = static_cast<CurveImp*>( oi );
416 
417  QDomElement hiere = curvee.nextSibling().toElement();
418  if ( hiere.isNull() || hiere.tagName() != "calculation" ) KIG_GENERIC_PARSE_ERROR;
419  assert( false ); // TODO
420 // return new LocusImp( curvei, hier );
421  }
422  else if( type == "circle" )
423  {
424  QDomNode n = parent.firstChild();
425  Coordinate center = readCoordinateElement( n, ok, "center" );
426  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
427 
428  n = n.nextSibling();
429  double radius = readDoubleElement( n, ok, "radius" );
430  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
431 
432  return new CircleImp( center, radius );
433  }
434  else if( type == "conic" )
435  {
436  QDomNode n = parent.firstChild();
437  Coordinate focus1 = readCoordinateElement( n, ok, "focus1" );
438  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
439 
440  n = n.nextSibling();
441  double pdimen = readDoubleElement( n, ok, "pdimen" );
442  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
443 
444  n = n.nextSibling();
445  double ecostheta0 = readDoubleElement( n, ok, "ecostheta0" );
446  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
447 
448  n = n.nextSibling();
449  double esintheta0 = readDoubleElement( n, ok, "esintheta0" );
450  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
451 
452  return new ConicImpPolar(
453  ConicPolarData( focus1, pdimen, ecostheta0, esintheta0 ) );
454  }
455  else if( type == "cubic" )
456  {
457  QDomElement coeffse = parent.firstChild().toElement();
458  if ( coeffse.isNull() || coeffse.tagName() != "coefficients" )
459  KIG_GENERIC_PARSE_ERROR;
460 
461  QDomNode n = coeffse.firstChild();
462  double a000 = readDoubleElement( n, ok, "a000" );
463  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
464 
465  n = n.nextSibling();
466  double a001 = readDoubleElement( n, ok, "a001" );
467  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
468 
469  n = n.nextSibling();
470  double a002 = readDoubleElement( n, ok, "a002" );
471  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
472 
473  n = n.nextSibling();
474  double a011 = readDoubleElement( n, ok, "a011" );
475  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
476 
477  n = n.nextSibling();
478  double a012 = readDoubleElement( n, ok, "a012" );
479  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
480 
481  n = n.nextSibling();
482  double a022 = readDoubleElement( n, ok, "a022" );
483  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
484 
485  n = n.nextSibling();
486  double a111 = readDoubleElement( n, ok, "a111" );
487  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
488 
489  n = n.nextSibling();
490  double a112 = readDoubleElement( n, ok, "a112" );
491  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
492 
493  n = n.nextSibling();
494  double a122 = readDoubleElement( n, ok, "a112" );
495  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
496 
497  n = n.nextSibling();
498  double a222 = readDoubleElement( n, ok, "a222" );
499  if ( ! ok ) KIG_GENERIC_PARSE_ERROR;
500 
501  return new CubicImp( CubicCartesianData( a000, a001, a002,
502  a011, a012, a022,
503  a111, a112, a122,
504  a222 ) );
505  }
506 
507  error = i18n( "This Kig file uses an object of type \"%1\", "
508  "which this Kig version does not support."
509  "Perhaps you have compiled Kig without support "
510  "for this object type,"
511  "or perhaps you are using an older Kig version.", type );
512  return 0;
513 }
514 
object_imp.h
ObjectImpFactory::instance
static const ObjectImpFactory * instance()
Definition: object_imp_factory.cc:37
ObjectImpFactory
Definition: object_imp_factory.h:23
HierarchyImp::stype
static const ObjectImpType * stype()
Definition: bogus_imp.cc:227
locus_imp.h
CubicImp
An ObjectImp representing a cubic.
Definition: cubic_imp.h:29
LocusImp
LocusImp is an imp that consists of a copy of the curveimp that the moving point moves over...
Definition: locus_imp.h:57
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
ObjectHierarchy
Definition: object_hierarchy.h:30
ConicPolarData::esintheta0
double esintheta0
The esintheta0 value from the polar equation.
Definition: conic-common.h:118
CubicCartesianData::coeffs
double coeffs[10]
Definition: cubic-common.h:34
point_imp.h
ObjectHierarchy::buildSafeObjectHierarchy
static ObjectHierarchy * buildSafeObjectHierarchy(const QDomElement &parent, QString &error)
Deserialize the ObjectHierarchy data from the xml element parent .
Definition: object_hierarchy.cc:482
StringImp
This ObjectImp is a BogusImp containing only a string value.
Definition: bogus_imp.h:167
readDoubleElement
static double readDoubleElement(const QDomNode &n, bool &ok, const char *tagname)
Definition: object_imp_factory.cc:276
LocusImp::curve
const CurveImp * curve() const
Definition: locus_imp.cc:147
AbstractLineImp
An ObjectImp class that is the base of the line-like ObjectImp's: SegmentImp, LineImp and RayImp...
Definition: line_imp.h:31
LineData
Simple class representing a line.
Definition: misc/common.h:49
LineData::b
Coordinate b
Another point on the line.
Definition: misc/common.h:68
text_imp.h
CircleImp
An ObjectImp representing a circle.
Definition: circle_imp.h:27
TextImp
Definition: text_imp.h:26
RayImp
An ObjectImp representing a ray.
Definition: line_imp.h:136
DoubleImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the DoubleImp type.
Definition: bogus_imp.cc:270
addDoubleElement
static void addDoubleElement(const char *name, double d, QDomElement &parent, QDomDocument &doc)
Definition: object_imp_factory.cc:65
CircleImp::center
const Coordinate center() const
Return the center of this circle.
Definition: circle_imp.cc:210
object_imp_factory.h
TransformationImp::stype
static const ObjectImpType * stype()
Definition: bogus_imp.cc:233
ObjectHierarchy::serialize
void serialize(QDomElement &parent, QDomDocument &doc) const
saves the ObjectHierarchy data in children xml tags of parent .
Definition: object_hierarchy.cc:414
RayImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the RayImp type.
Definition: line_imp.cc:562
VectorImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the VectorImp type.
Definition: other_imp.cc:613
circle_imp.h
IntImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the IntImp type.
Definition: bogus_imp.cc:278
readXYElements
static Coordinate readXYElements(const QDomElement &e, bool &ok)
Definition: object_imp_factory.cc:240
IntImp
This ObjectImp is a BogusImp containing only an int value.
Definition: bogus_imp.h:128
ArcImp::radius
double radius() const
Return the radius of this arc.
Definition: other_imp.cc:537
KIG_GENERIC_PARSE_ERROR
#define KIG_GENERIC_PARSE_ERROR
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
ConicImpPolar
An implementation of ConicImp to be used when only the polar equation of the conic is known...
Definition: conic_imp.h:157
readCoordinateElement
static Coordinate readCoordinateElement(const QDomNode &n, bool &ok, const char *tagname)
Definition: object_imp_factory.cc:263
Transformation::isHomothetic
bool isHomothetic() const
Returns whether this is a homothetic (affine) transformation.
Definition: kigtransform.cpp:681
VectorImp
An ObjectImp representing a vector.
Definition: other_imp.h:99
LocusImp::stype
static const ObjectImpType * stype()
Definition: locus_imp.cc:200
ArcImp::angle
double angle() const
Return the dimension in radians of this arc.
Definition: other_imp.cc:547
bogus_imp.h
ObjectImpFactory::deserialize
ObjectImp * deserialize(const QString &type, const QDomElement &parent, QString &error) const
loads data from parent , and returns a new ObjectImp from the type string type .
Definition: object_imp_factory.cc:288
TestResultImp::stype
static const ObjectImpType * stype()
Definition: bogus_imp.cc:294
PointImp
An ObjectImp representing a point.
Definition: point_imp.h:27
Transformation
Class representing a transformation.
Definition: kigtransform.h:37
ConicPolarData::focus1
Coordinate focus1
The first focus of this conic.
Definition: conic-common.h:106
LineData::a
Coordinate a
One point on the line.
Definition: misc/common.h:64
ConicPolarData::pdimen
double pdimen
The pdimen value from the polar equation.
Definition: conic-common.h:110
TransformationImp
Definition: bogus_imp.h:232
HierarchyImp
Definition: bogus_imp.h:203
SegmentImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the SegmentImp type.
Definition: line_imp.cc:545
CubicCartesianData
This class represents an equation of a cubic in the form (in homogeneous coordinates, ), .
Definition: cubic-common.h:31
ConicPolarData::ecostheta0
double ecostheta0
The ecostheta0 value from the polar equation.
Definition: conic-common.h:114
ArcImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the ArcImp type.
Definition: other_imp.cc:629
ConicImp
An ObjectImp representing a conic.
Definition: conic_imp.h:39
ArcImp::center
const Coordinate center() const
Return the center of this arc.
Definition: other_imp.cc:532
CircleImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the CircleImp type.
Definition: circle_imp.cc:342
ArcImp::startAngle
double startAngle() const
Return the start angle in radians of this arc.
Definition: other_imp.cc:542
ObjectImpFactory::serialize
QString serialize(const ObjectImp &d, QDomElement &parent, QDomDocument &doc) const
adds data to parent , and returns a type string.
Definition: object_imp_factory.cc:79
CircleImp::radius
double radius() const
Return the radius of this circle.
Definition: circle_imp.cc:215
PointImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing PointImp's.
Definition: point_imp.cc:159
line_imp.h
CurveImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the CurveImp type.
Definition: curve_imp.cc:27
ConicImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the ConicImp type.
Definition: conic_imp.cc:380
AngleImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the AngleImp type.
Definition: other_imp.cc:597
DoubleImp
This ObjectImp is a BogusImp containing only a double value.
Definition: bogus_imp.h:89
cubic_imp.h
AbstractLineImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the AbstractLineImp type.
Definition: line_imp.cc:520
StringImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the StringImp type.
Definition: bogus_imp.cc:220
LocusImp::hierarchy
const ObjectHierarchy & hierarchy() const
Definition: locus_imp.cc:152
LineImp
An ObjectImp representing a line.
Definition: line_imp.h:184
Transformation::data
double data(int r, int c) const
Definition: kigtransform.cpp:732
addCoordinateElement
static void addCoordinateElement(const char *name, const Coordinate &d, QDomElement &p, QDomDocument &doc)
Definition: object_imp_factory.cc:72
ArcImp
An ObjectImp representing an arc.
Definition: other_imp.h:169
Coordinate::x
double x
X Component.
Definition: coordinate.h:126
addXYElements
static void addXYElements(const Coordinate &c, QDomElement &parent, QDomDocument &doc)
Definition: object_imp_factory.cc:51
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
TextImp::stype
static const ObjectImpType * stype()
Definition: text_imp.cc:143
CubicImp::stype
static const ObjectImpType * stype()
Definition: cubic_imp.cc:352
conic_imp.h
TestResultImp
Definition: bogus_imp.h:253
other_imp.h
AngleImp
An ObjectImp representing an angle.
Definition: other_imp.h:28
CurveImp
This class represents a curve: something which is composed of points, like a line, a circle, a locus.
Definition: curve_imp.h:27
ConicPolarData
This class represents an equation of a conic in the form .
Definition: conic-common.h:85
SegmentImp
An ObjectImp representing a segment.
Definition: line_imp.h:81
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:39 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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