• 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
curve_imp.h
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 #ifndef KIG_OBJECTS_CURVE_IMP_H
19 #define KIG_OBJECTS_CURVE_IMP_H
20 
21 #include "object_imp.h"
22 
27 class CurveImp
28  : public ObjectImp
29 {
30 private:
31  double revert (int n) const;
32 protected:
33  // following two functions are used by generic getParam()
34  double getParamofmin( double a, double b,
35  const Coordinate& p,
36  const KigDocument& doc ) const;
37  double getDist(double param, const Coordinate& p, const KigDocument& doc) const;
38 public:
39  typedef ObjectImp Parent;
40 
44  static const ObjectImpType* stype();
45 
46  Coordinate attachPoint() const;
47 
48  // param is between 0 and 1. Note that 0 and 1 should be the
49  // end-points. E.g. for a Line, getPoint(0) returns a more or less
50  // infinite point. getPoint(0.5) should return the point in the
51  // middle.
52  virtual double getParam( const Coordinate& point, const KigDocument& ) const;
53  // this should be the inverse function of getPoint().
54  // Note that it should also do something reasonable when p is not on
55  // the curve. You can return an invalid Coordinate(
56  // Coordinate::invalidCoord() ) if you need to in some cases.
57  virtual const Coordinate getPoint( double param, const KigDocument& ) const = 0;
58 
59  virtual CurveImp* copy() const = 0;
60 
67  virtual bool containsPoint( const Coordinate& p, const KigDocument& ) const = 0;
68  QString cartesianEquationString( const KigDocument& w ) const;
69 };
70 
71 #endif
object_imp.h
ObjectImpType
Instances of this class represent a certain ObjectImp type.
Definition: object_imp.h:95
CurveImp::Parent
ObjectImp Parent
Definition: curve_imp.h:39
CurveImp::attachPoint
Coordinate attachPoint() const
Returns a reference point where to attach labels; when this returns an invalidCoord then the attachme...
Definition: curve_imp.cc:44
CurveImp::cartesianEquationString
QString cartesianEquationString(const KigDocument &w) const
Definition: curve_imp.cc:276
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
CurveImp::getPoint
virtual const Coordinate getPoint(double param, const KigDocument &) const =0
CurveImp::getParamofmin
double getParamofmin(double a, double b, const Coordinate &p, const KigDocument &doc) const
This function calculates the parameter of the point that realizes the minimum in [a,b] of the distance between the points of the locus and the point of coordinate p, using the golden ration method.
Definition: curve_imp.cc:58
CurveImp::copy
virtual CurveImp * copy() const =0
Returns a copy of this ObjectImp.
CurveImp::containsPoint
virtual bool containsPoint(const Coordinate &p, const KigDocument &) const =0
Return whether this Curve contains the given point.
CurveImp::stype
static const ObjectImpType * stype()
Returns the ObjectImpType representing the CurveImp type.
Definition: curve_imp.cc:27
KigDocument
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
ObjectImp
The ObjectImp class represents the behaviour of an object after it is calculated. ...
Definition: object_imp.h:226
CurveImp::getDist
double getDist(double param, const Coordinate &p, const KigDocument &doc) const
This function returns the distance between the point with parameter param and point p...
Definition: curve_imp.cc:137
CurveImp::getParam
virtual double getParam(const Coordinate &point, const KigDocument &) const
Definition: curve_imp.cc:149
CurveImp
This class represents a curve: something which is composed of points, like a line, a circle, a locus.
Definition: curve_imp.h:27
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