• 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
cubic_imp.cc
Go to the documentation of this file.
1 // Copyright (C) 2003 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 "cubic_imp.h"
19 
20 #include "bogus_imp.h"
21 
22 #include "../misc/kigpainter.h"
23 #include "../misc/screeninfo.h"
24 #include "../misc/kignumerics.h"
25 #include "../misc/equation.h"
26 #include "../misc/common.h"
27 #include "../kig/kig_view.h"
28 
29 #include <math.h>
30 #include <klocale.h>
31 #include <qstring.h>
32 
33 CubicImp::CubicImp( const CubicCartesianData& data )
34  : CurveImp(), mdata( data )
35 {
36 }
37 
38 CubicImp::~CubicImp()
39 {
40 }
41 
42 ObjectImp* CubicImp::transform( const Transformation& t ) const
43 {
44  bool valid = true;
45  CubicCartesianData d = calcCubicTransformation( data(), t, valid );
46  d.normalize();
47  if ( valid ) return new CubicImp( d );
48  else return new InvalidImp;
49 }
50 
51 void CubicImp::draw( KigPainter& p ) const
52 {
53  p.drawCurve( this );
54 }
55 
56 bool CubicImp::contains( const Coordinate& o, int width, const KigWidget& w ) const
57 {
58  return internalContainsPoint( o, w.screenInfo().normalMiss( width ) );
59 }
60 
61 bool CubicImp::inRect( const Rect&, int, const KigWidget& ) const
62 {
63  // TODO ?
64  return false;
65 }
66 
67 CubicImp* CubicImp::copy() const
68 {
69  return new CubicImp( mdata );
70 }
71 
72 double CubicImp::getParam( const Coordinate& p, const KigDocument& ) const
73 {
74  double x = p.x;
75  double y = p.y;
76  double t;
77 
78  double a000 = mdata.coeffs[0];
79  double a001 = mdata.coeffs[1];
80  double a002 = mdata.coeffs[2];
81  double a011 = mdata.coeffs[3];
82  double a012 = mdata.coeffs[4];
83  double a022 = mdata.coeffs[5];
84  double a111 = mdata.coeffs[6];
85  double a112 = mdata.coeffs[7];
86  double a122 = mdata.coeffs[8];
87  double a222 = mdata.coeffs[9];
88 
89  /*
90  * first project p onto the cubic. This is done by computing the
91  * line through p in the direction of the gradient
92  */
93 
94  double f = a000 + a001*x + a002*y + a011*x*x + a012*x*y + a022*y*y +
95  a111*x*x*x + a112*x*x*y + a122*x*y*y + a222*y*y*y;
96  if ( f != 0 )
97  {
98  double fx = a001 + 2*a011*x + a012*y + 3*a111*x*x + 2*a112*x*y + a122*y*y;
99  double fy = a002 + 2*a022*y + a012*x + 3*a222*y*y + 2*a122*x*y + a112*x*x;
100  Coordinate v = Coordinate (fx, fy);
101  if ( f < 0 ) v = -v; // the line points away from the intersection
102  double a, b, c, d;
103  calcCubicLineRestriction ( mdata, p, v, a, b, c, d );
104  if ( a < 0 )
105  {
106  a *= -1;
107  b *= -1;
108  c *= -1;
109  d *= -1;
110  }
111 
112  // computing the coefficients of the Sturm sequence
113  double p1a = 2*b*b - 6*a*c;
114  double p1b = b*c - 9*a*d;
115  double p0a = c*p1a*p1a + p1b*(3*a*p1b - 2*b*p1a);
116  // compute the number of roots for negative lambda
117  int variations = calcCubicVariations ( 0, a, b, c, d, p1a, p1b, p0a );
118  bool valid;
119  int numroots;
120  double lambda = calcCubicRoot ( -1e10, 1e10, a, b, c, d, variations, valid,
121  numroots );
122  if ( valid )
123  {
124  Coordinate pnew = p + lambda*v;
125  x = pnew.x;
126  y = pnew.y;
127  }
128  }
129 
130  if (x > 0) t = x/(1+x);
131  else t = x/(1-x);
132  t = 0.5*(t + 1);
133  t /= 3;
134 
135  Coordinate p1 = getPoint ( t );
136  Coordinate p2 = getPoint ( t + 1.0/3.0 );
137  Coordinate p3 = getPoint ( t + 2.0/3.0 );
138 
139  double mint = t;
140  double mindist = p1.valid() ? fabs ( y - p1.y ) : double_inf;
141  if ( p2.valid() && fabs ( y - p2.y ) < mindist )
142  {
143  mint = t + 1.0/3.0;
144  mindist = fabs ( y - p2.y );
145  }
146  if ( p3.valid() && fabs ( y - p3.y ) < mindist )
147  {
148  mint = t + 2.0/3.0;
149  }
150 
151  return mint;
152 }
153 
154 const Coordinate CubicImp::getPoint( double p, const KigDocument& ) const
155 {
156  return getPoint( p );
157 }
158 
159 const Coordinate CubicImp::getPoint( double p ) const
160 {
161  /*
162  * this isn't really elegant...
163  * the magnitude of p tells which one of the maximum 3 intersections
164  * of the vertical line with the cubic to take.
165  */
166 
167  p *= 3;
168  int root = (int) p;
169  assert ( root >= 0 );
170  assert ( root <= 3 );
171  if ( root == 3 ) root = 2;
172 
173  p -= root;
174 
175  assert ( 0 <= p && p <= 1 );
176  if ( p <= 0. ) p = 1e-6;
177  if ( p >= 1. ) p = 1 - 1e-6;
178  root++;
179  p = 2*p - 1;
180  double x;
181  if (p > 0) x = p/(1 - p);
182  else x = p/(1 + p);
183 
184  // calc the third degree polynomial:
185  // compute the third degree polinomial:
186 // double a000 = mdata.coeffs[0];
187 // double a001 = mdata.coeffs[1];
188 // double a002 = mdata.coeffs[2];
189 // double a011 = mdata.coeffs[3];
190 // double a012 = mdata.coeffs[4];
191 // double a022 = mdata.coeffs[5];
192 // double a111 = mdata.coeffs[6];
193 // double a112 = mdata.coeffs[7];
194 // double a122 = mdata.coeffs[8];
195 // double a222 = mdata.coeffs[9];
196 //
197 // // first the y^3 coefficient, it coming only from a222:
198 // double a = a222;
199 // // next the y^2 coefficient (from a122 and a022):
200 // double b = a122*x + a022;
201 // // next the y coefficient (from a112, a012 and a002):
202 // double c = a112*x*x + a012*x + a002;
203 // // finally the constant coefficient (from a111, a011, a001 and a000):
204 // double d = a111*x*x*x + a011*x*x + a001*x + a000;
205 
206 // commented out, since the bound is already computed when passing a huge
207 // interval; the normalization is not needed also
208 
209  // renormalize: positive a
210 // if ( a < 0 )
211 // {
212 // a *= -1;
213 // b *= -1;
214 // c *= -1;
215 // d *= -1;
216 // }
217 //
218 // const double small = 1e-7;
219 // int degree = 3;
220 // if ( fabs(a) < small*fabs(b) ||
221 // fabs(a) < small*fabs(c) ||
222 // fabs(a) < small*fabs(d) )
223 // {
224 // degree = 2;
225 // if ( fabs(b) < small*fabs(c) ||
226 // fabs(b) < small*fabs(d) )
227 // {
228 // degree = 1;
229 // }
230 // }
231 
232 // and a bound for all the real roots:
233 
234 // double bound;
235 // switch (degree)
236 // {
237 // case 3:
238 // bound = fabs(d/a);
239 // if ( fabs(c/a) + 1 > bound ) bound = fabs(c/a) + 1;
240 // if ( fabs(b/a) + 1 > bound ) bound = fabs(b/a) + 1;
241 // break;
242 //
243 // case 2:
244 // bound = fabs(d/b);
245 // if ( fabs(c/b) + 1 > bound ) bound = fabs(c/b) + 1;
246 // break;
247 //
248 // case 1:
249 // default:
250 // bound = fabs(d/c) + 1;
251 // break;
252 // }
253 
254  int numroots;
255  bool valid = true;
256  double y = calcCubicYvalue ( x, -double_inf, double_inf, root, mdata, valid,
257  numroots );
258  if ( ! valid ) return Coordinate::invalidCoord();
259  else return Coordinate(x,y);
260 // if ( valid ) return Coordinate(x,y);
261 // root--; if ( root <= 0) root += 3;
262 // y = calcCubicYvalue ( x, -bound, bound, root, mdata, valid,
263 // numroots );
264 // if ( valid ) return Coordinate(x,y);
265 // root--; if ( root <= 0) root += 3;
266 // y = calcCubicYvalue ( x, -bound, bound, root, mdata, valid,
267 // numroots );
268 // assert ( valid );
269 // return Coordinate(x,y);
270 }
271 
272 int CubicImp::numberOfProperties() const
273 {
274  return Parent::numberOfProperties() + 1;
275 }
276 
277 const QByteArrayList CubicImp::propertiesInternalNames() const
278 {
279  QByteArrayList l = Parent::propertiesInternalNames();
280  l << "cartesian-equation";
281  assert( l.size() == CubicImp::numberOfProperties() );
282  return l;
283 
284 }
285 
286 /*
287  * cartesian equation property contributed by Carlo Sardi
288  */
289 
290 const QByteArrayList CubicImp::properties() const
291 {
292  QByteArrayList l = Parent::properties();
293  l << I18N_NOOP( "Cartesian Equation" );
294  assert( l.size() == CubicImp::numberOfProperties() );
295  return l;
296 
297 }
298 
299 const ObjectImpType* CubicImp::impRequirementForProperty( int which ) const
300 {
301  if ( which < Parent::numberOfProperties() )
302  return Parent::impRequirementForProperty( which );
303  else return CubicImp::stype();
304 }
305 
306 const char* CubicImp::iconForProperty( int which ) const
307 {
308  int pnum = 0;
309  if ( which < Parent::numberOfProperties() )
310  return Parent::iconForProperty( which );
311  if ( which == Parent::numberOfProperties() + pnum++ )
312  return "kig_text"; // cartesian equation string
313  else
314  assert( false );
315  return "";
316 }
317 
318 ObjectImp* CubicImp::property( int which, const KigDocument& w ) const
319 {
320  int pnum = 0;
321 
322  if ( which < Parent::numberOfProperties() )
323  return Parent::property( which, w );
324  if ( which == Parent::numberOfProperties() + pnum++ )
325  return new StringImp( cartesianEquationString( w ) );
326  else
327  assert( false );
328  return new InvalidImp;
329 }
330 
331 const CubicCartesianData CubicImp::data() const
332 {
333  return mdata;
334 }
335 
336 void CubicImp::visit( ObjectImpVisitor* vtor ) const
337 {
338  vtor->visit( this );
339 }
340 
341 bool CubicImp::equals( const ObjectImp& rhs ) const
342 {
343  return rhs.inherits( CubicImp::stype() ) &&
344  static_cast<const CubicImp&>( rhs ).data() == data();
345 }
346 
347 const ObjectImpType* CubicImp::type() const
348 {
349  return CubicImp::stype();
350 }
351 
352 const ObjectImpType* CubicImp::stype()
353 {
354  static const ObjectImpType t(
355  Parent::stype(), "cubic",
356  I18N_NOOP( "cubic curve" ),
357  I18N_NOOP( "Select this cubic curve" ),
358  I18N_NOOP( "Select cubic curve %1" ),
359  I18N_NOOP( "Remove a Cubic Curve" ),
360  I18N_NOOP( "Add a Cubic Curve" ),
361  I18N_NOOP( "Move a Cubic Curve" ),
362  I18N_NOOP( "Attach to this cubic curve" ),
363  I18N_NOOP( "Show a Cubic Curve" ),
364  I18N_NOOP( "Hide a Cubic Curve" )
365  );
366  return &t;
367 }
368 
369 bool CubicImp::containsPoint( const Coordinate& p, const KigDocument& ) const
370 {
371  return internalContainsPoint( p, test_threshold );
372 }
373 
374 bool CubicImp::internalContainsPoint( const Coordinate& p, double threshold ) const
375 {
376  double a000 = mdata.coeffs[0];
377  double a001 = mdata.coeffs[1];
378  double a002 = mdata.coeffs[2];
379  double a011 = mdata.coeffs[3];
380  double a012 = mdata.coeffs[4];
381  double a022 = mdata.coeffs[5];
382  double a111 = mdata.coeffs[6];
383  double a112 = mdata.coeffs[7];
384  double a122 = mdata.coeffs[8];
385  double a222 = mdata.coeffs[9];
386 
387  double x = p.x;
388  double y = p.y;
389 
390  double f = a000 + a001*x + a002*y + a011*x*x + a012*x*y + a022*y*y +
391  a111*x*x*x + a112*x*x*y + a122*x*y*y + a222*y*y*y;
392  double fx = a001 + 2*a011*x + a012*y + 3*a111*x*x + 2*a112*x*y + a122*y*y;
393  double fy = a002 + a012*x + 2*a022*y + a112*x*x + 2*a122*x*y + 3*a222*y*y;
394 
395  double dist = fabs(f)/(fabs(fx) + fabs(fy));
396 
397  return dist <= threshold;
398 }
399 
400 bool CubicImp::isPropertyDefinedOnOrThroughThisImp( int which ) const
401 {
402  return Parent::isPropertyDefinedOnOrThroughThisImp( which );
403 }
404 
405 bool CubicImp::isVerticalCubic( ) const
406 {
407  return (
408  fabs( mdata.coeffs[9] ) < 1e-12 && // y^3
409  fabs( mdata.coeffs[7] ) < 1e-12 && // x^2y
410  fabs( mdata.coeffs[8] ) < 1e-12 && // xy^2
411  fabs( mdata.coeffs[5] ) < 1e-12 && // y^2
412  fabs( mdata.coeffs[4] ) < 1e-12 && // xy
413  fabs( mdata.coeffs[2] ) > 1e-5 ); // y
414 }
415 
416 Rect CubicImp::surroundingRect() const
417 {
418  // it's probably possible to calculate this if it exists, but for
419  // now we don't.
420  return Rect::invalidRect();
421 }
422 
423 QString CubicImp::cartesianEquationString( const KigDocument& ) const
424 {
425  EquationString ret = EquationString( "" );
426  bool needsign = false;
427  if ( isVerticalCubic() )
428  {
429  double f = - 1.0/mdata.coeffs[2];
430  ret.addTerm( - f*mdata.coeffs[2], ret.y(), needsign );
431  ret.append( " = " );
432  needsign = false;
433  ret.addTerm( f*mdata.coeffs[6], ret.x3(), needsign );
434  ret.addTerm( f*mdata.coeffs[9], ret.y3(), needsign );
435  ret.addTerm( f*mdata.coeffs[7], ret.x2y(), needsign );
436  ret.addTerm( f*mdata.coeffs[8], ret.xy2(), needsign );
437  ret.addTerm( f*mdata.coeffs[5], ret.y2(), needsign );
438  ret.addTerm( f*mdata.coeffs[3], ret.x2(), needsign );
439  ret.addTerm( f*mdata.coeffs[4], ret.xy(), needsign );
440  ret.addTerm( f*mdata.coeffs[1], ret.x(), needsign );
441  ret.addTerm( f*mdata.coeffs[0], "", needsign );
442  return ret;
443  }
444  ret.addTerm( mdata.coeffs[6], ret.x3(), needsign );
445  ret.addTerm( mdata.coeffs[9], ret.y3(), needsign );
446  ret.addTerm( mdata.coeffs[7], ret.x2y(), needsign );
447  ret.addTerm( mdata.coeffs[8], ret.xy2(), needsign );
448  ret.addTerm( mdata.coeffs[5], ret.y2(), needsign );
449  ret.addTerm( mdata.coeffs[3], ret.x2(), needsign );
450  ret.addTerm( mdata.coeffs[4], ret.xy(), needsign );
451  ret.addTerm( mdata.coeffs[1], ret.x(), needsign );
452  ret.addTerm( mdata.coeffs[2], ret.y(), needsign );
453  ret.addTerm( mdata.coeffs[0], "", needsign );
454  ret.append( " = 0" );
455 // ret.prettify();
456  return ret;
457 
458 // /*
459 // * unfortunately QStrings.arg method is limited to %1, %9, so we cannot
460 // * treat all 10 arguments! Let's split the equation in two parts...
461 // * Now this ends up also in the translation machinery, is this really
462 // * necessary? Otherwise we could do a little bit of tidy up on the
463 // * the equation (removal of zeros, avoid " ... + -1234 x ", etc.)
464 // */
465 //
466 // QString ret = i18n( "%6 x³ + %9 y³ + %7 x²y + %8 xy² + %5 y² + %3 x² + %4 xy + %1 x + %2 y" );
467 // ret = ret.arg( ret.chop( mdata.coeffs[1] ), 0, 'g', 3 );
468 // ret = ret.arg( ret.chop( mdata.coeffs[2] ), 0, 'g', 3 );
469 // ret = ret.arg( ret.chop( mdata.coeffs[3] ), 0, 'g', 3 );
470 // ret = ret.arg( ret.chop( mdata.coeffs[4] ), 0, 'g', 3 );
471 // ret = ret.arg( ret.chop( mdata.coeffs[5] ), 0, 'g', 3 );
472 // ret = ret.arg( ret.chop( mdata.coeffs[6] ), 0, 'g', 3 );
473 // ret = ret.arg( ret.chop( mdata.coeffs[7] ), 0, 'g', 3 );
474 // ret = ret.arg( ret.chop( mdata.coeffs[8] ), 0, 'g', 3 );
475 // ret = ret.arg( ret.chop( mdata.coeffs[9] ), 0, 'g', 3 );
476 
477 // ret.append( " + %1 = 0" );
478 // ret = ret.arg( ret.chop( mdata.coeffs[0] ), 0, 'g', 3 );
479 
480 // ret.replace( "+ -", "- " );
481 // ret.replace( "+-", "-" );
482 // return ret;
483 }
calcCubicLineRestriction
void calcCubicLineRestriction(CubicCartesianData data, Coordinate p, Coordinate v, double &a, double &b, double &c, double &d)
Definition: cubic-common.cc:395
CubicImp::getParam
double getParam(const Coordinate &point, const KigDocument &) const
Definition: cubic_imp.cc:72
CubicImp
An ObjectImp representing a cubic.
Definition: cubic_imp.h:29
EquationString::y
const QString y() const
Definition: equation.cc:110
ObjectImpType
Instances of this class represent a certain ObjectImp type.
Definition: object_imp.h:95
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
EquationString::xy2
const QString xy2() const
Definition: equation.cc:85
CubicCartesianData::coeffs
double coeffs[10]
Definition: cubic-common.h:34
calcCubicRoot
double calcCubicRoot(double xmin, double xmax, double a, double b, double c, double d, int root, bool &valid, int &numroots)
This file is part of Kig, a KDE program for Interactive Geometry...
Definition: kignumerics.cpp:32
EquationString::x3
const QString x3() const
Definition: equation.cc:70
StringImp
This ObjectImp is a BogusImp containing only a string value.
Definition: bogus_imp.h:167
ScreenInfo::normalMiss
double normalMiss(int width) const
Definition: screeninfo.cc:88
KigPainter::drawCurve
void drawCurve(const CurveImp *curve)
draw a generic curve...
Definition: kigpainter.cpp:757
ObjectImpVisitor::visit
void visit(const ObjectImp *imp)
Definition: object_imp.cc:81
ObjectImp::impRequirementForProperty
virtual const ObjectImpType * impRequirementForProperty(int which) const
Definition: object_imp.cc:76
ObjectImp::property
virtual ObjectImp * property(int which, const KigDocument &d) const
Definition: object_imp.cc:70
CubicImp::type
const ObjectImpType * type() const
Returns the lowermost ObjectImpType that this object is an instantiation of.
Definition: cubic_imp.cc:347
Rect
This file is part of Kig, a KDE program for Interactive Geometry...
Definition: rect.h:34
CubicImp::property
ObjectImp * property(int which, const KigDocument &w) const
Definition: cubic_imp.cc:318
EquationString
Simple class that represents an equation.
Definition: equation.h:49
CubicImp::impRequirementForProperty
const ObjectImpType * impRequirementForProperty(int which) const
Definition: cubic_imp.cc:299
EquationString::xy
const QString xy() const
Definition: equation.cc:100
CubicImp::inRect
bool inRect(const Rect &r, int width, const KigWidget &) const
Definition: cubic_imp.cc:61
CubicImp::properties
const QByteArrayList properties() const
Definition: cubic_imp.cc:290
CubicImp::equals
bool equals(const ObjectImp &rhs) const
Returns true if this ObjectImp is equal to rhs.
Definition: cubic_imp.cc:341
CubicImp::copy
CubicImp * copy() const
Returns a copy of this ObjectImp.
Definition: cubic_imp.cc:67
ObjectImp::propertiesInternalNames
virtual const QByteArrayList propertiesInternalNames() const
Definition: object_imp.cc:63
EquationString::x
const QString x() const
Definition: equation.cc:105
Rect::invalidRect
static Rect invalidRect()
Definition: rect.cc:305
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
CubicImp::propertiesInternalNames
const QByteArrayList propertiesInternalNames() const
Definition: cubic_imp.cc:277
EquationString::addTerm
void addTerm(double coeff, const QString &unknowns, bool &needsign)
Definition: equation.cc:41
KigWidget::screenInfo
const ScreenInfo & screenInfo() const
the part of the document we're currently showing i.e.
Definition: kig_view.cpp:272
CubicImp::isVerticalCubic
bool isVerticalCubic() const
Definition: cubic_imp.cc:405
CubicImp::~CubicImp
~CubicImp()
Definition: cubic_imp.cc:38
CubicImp::getPoint
const Coordinate getPoint(double param, const KigDocument &) const
Definition: cubic_imp.cc:154
test_threshold
const double test_threshold
Definition: common.cpp:510
ObjectImp::iconForProperty
virtual const char * iconForProperty(int which) const
Definition: object_imp.cc:187
KigPainter
KigPainter is an extended QPainter.
Definition: kigpainter.h:51
bogus_imp.h
EquationString::y2
const QString y2() const
Definition: equation.cc:95
calcCubicYvalue
double calcCubicYvalue(double x, double ymin, double ymax, int root, CubicCartesianData data, bool &valid, int &numroots)
Definition: cubic-common.cc:345
CubicImp::CubicImp
CubicImp(const CubicCartesianData &data)
Definition: cubic_imp.cc:33
EquationString::x2
const QString x2() const
Definition: equation.cc:90
Transformation
Class representing a transformation.
Definition: kigtransform.h:37
CubicImp::cartesianEquationString
QString cartesianEquationString(const KigDocument &) const
Definition: cubic_imp.cc:423
KigWidget
This class is the real widget showing the document.
Definition: kig_view.h:50
CubicImp::transform
ObjectImp * transform(const Transformation &) const
Return this ObjectImp, transformed by the transformation t.
Definition: cubic_imp.cc:42
CubicCartesianData
This class represents an equation of a cubic in the form (in homogeneous coordinates, ), .
Definition: cubic-common.h:31
ObjectImp::isPropertyDefinedOnOrThroughThisImp
virtual bool isPropertyDefinedOnOrThroughThisImp(int which) const
Definition: object_imp.cc:326
EquationString::x2y
const QString x2y() const
Definition: equation.cc:80
EquationString::y3
const QString y3() const
Definition: equation.cc:75
CubicImp::visit
void visit(ObjectImpVisitor *vtor) const
Definition: cubic_imp.cc:336
Coordinate::invalidCoord
static Coordinate invalidCoord()
Create an invalid Coordinate.
Definition: coordinate.cpp:171
double_inf
const double double_inf
Definition: common.cpp:509
CubicImp::data
const CubicCartesianData data() const
Return the cartesian representation of this cubic.
Definition: cubic_imp.cc:331
CubicImp::internalContainsPoint
bool internalContainsPoint(const Coordinate &p, double threshold) const
Definition: cubic_imp.cc:374
CubicImp::isPropertyDefinedOnOrThroughThisImp
bool isPropertyDefinedOnOrThroughThisImp(int which) const
Definition: cubic_imp.cc:400
CurveImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the CurveImp type.
Definition: curve_imp.cc:27
cubic_imp.h
KigDocument
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
CubicImp::numberOfProperties
int numberOfProperties() const
Definition: cubic_imp.cc:272
Coordinate::x
double x
X Component.
Definition: coordinate.h:126
CubicImp::containsPoint
bool containsPoint(const Coordinate &p, const KigDocument &doc) const
Return whether this Curve contains the given point.
Definition: cubic_imp.cc:369
CubicImp::draw
void draw(KigPainter &p) const
Definition: cubic_imp.cc:51
QByteArrayList
QList< QByteArray > QByteArrayList
Definition: objects/common.h:50
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
ObjectImp::valid
bool valid() const
Returns true if this is a valid ObjectImp.
Definition: object_imp.cc:41
CubicImp::contains
bool contains(const Coordinate &p, int width, const KigWidget &) const
Definition: cubic_imp.cc:56
CubicImp::stype
static const ObjectImpType * stype()
Definition: cubic_imp.cc:352
calcCubicVariations
int calcCubicVariations(double x, double a, double b, double c, double d, double p1a, double p1b, double p0a)
Definition: kignumerics.cpp:164
ObjectImp::numberOfProperties
virtual int numberOfProperties() const
Definition: object_imp.cc:58
Coordinate::valid
bool valid() const
Return whether this is a valid Coordinate.
Definition: coordinate.cpp:176
CubicImp::iconForProperty
const char * iconForProperty(int which) const
Definition: cubic_imp.cc:306
ObjectImpVisitor
Definition: object_imp.h:56
ObjectImp::properties
virtual const QByteArrayList properties() const
Definition: object_imp.cc:51
InvalidImp
This ObjectImp represents an invalid object.
Definition: bogus_imp.h:61
CubicImp::surroundingRect
Rect surroundingRect() const
Definition: cubic_imp.cc:416
CubicCartesianData::normalize
void normalize()
Definition: cubic-common.cc:44
CurveImp
This class represents a curve: something which is composed of points, like a line, a circle, a locus.
Definition: curve_imp.h:27
calcCubicTransformation
const CubicCartesianData calcCubicTransformation(const CubicCartesianData &data, const Transformation &t, bool &valid)
Definition: cubic-common.cc:438
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