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

kig

conic_imp.h

Go to the documentation of this file.
00001 // Copyright (C)  2003  Dominique Devriese <devriese@kde.org>
00002 
00003 // This program is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU General Public License
00005 // as published by the Free Software Foundation; either version 2
00006 // of the License, or (at your option) any later version.
00007 
00008 // This program is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 // GNU General Public License for more details.
00012 
00013 // You should have received a copy of the GNU General Public License
00014 // along with this program; if not, write to the Free Software
00015 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00016 // 02110-1301, USA.
00017 
00018 #ifndef KIG_OBJECTS_CONIC_IMP_H
00019 #define KIG_OBJECTS_CONIC_IMP_H
00020 
00021 #include "curve_imp.h"
00022 
00023 #include "../misc/conic-common.h"
00024 #include "../misc/equation.h"
00025 
00039 class ConicImp
00040   : public CurveImp
00041 {
00042 protected:
00043   ConicImp();
00044   ~ConicImp();
00045 public:
00046   typedef CurveImp Parent;
00050   static const ObjectImpType* stype();
00051 
00052   ObjectImp* transform( const Transformation& ) const;
00053 
00054   void draw( KigPainter& p ) const;
00055   bool contains( const Coordinate& p, int width, const KigWidget& ) const;
00056   bool inRect( const Rect& r, int width, const KigWidget& ) const;
00057   bool valid() const;
00058   Rect surroundingRect() const;
00059 
00060   int numberOfProperties() const;
00061   const ObjectImpType* impRequirementForProperty( int which ) const;
00062   bool isPropertyDefinedOnOrThroughThisImp( int which ) const;
00063   const QByteArrayList properties() const;
00064   const QByteArrayList propertiesInternalNames() const;
00065   const char* iconForProperty( int which ) const;
00066   ObjectImp* property( int which, const KigDocument& w ) const;
00067 
00068   double getParam( const Coordinate& point, const KigDocument& ) const;
00069   const Coordinate getPoint( double param, const KigDocument& ) const;
00070 
00071   // getPoint and getParam do not really need the KigDocument arg...
00072 
00073   double getParam( const Coordinate& point ) const;
00074   const Coordinate getPoint( double param ) const;
00075 
00076   // information about ourselves.  These are all virtual, because a
00077   // trivial subclass like CircleImp can override these with trivial
00078   // versions.
00079 
00087   virtual int conicType() const;
00091   virtual QString conicTypeString() const;
00096   virtual QString cartesianEquationString( const KigDocument& w ) const;
00102   virtual QString polarEquationString( const KigDocument& w ) const;
00106   virtual const ConicCartesianData cartesianData() const;
00110   virtual const ConicPolarData polarData() const = 0;
00114   virtual Coordinate coniccenter() const;
00118   virtual Coordinate focus1() const;
00122   virtual Coordinate focus2() const;
00123 
00124   const ObjectImpType* type() const;
00125   void visit( ObjectImpVisitor* vtor ) const;
00126 
00127   bool equals( const ObjectImp& rhs ) const;
00128 
00129   bool containsPoint( const Coordinate& p, const KigDocument& doc ) const;
00130   bool internalContainsPoint( const Coordinate& p, double threshold ) const;
00131   bool isVerticalParabola( ConicCartesianData& data ) const;
00132 };
00133 
00138 class ConicImpCart
00139   : public ConicImp
00140 {
00141 protected:
00142   ConicCartesianData mcartdata;
00143   ConicPolarData mpolardata;
00144 public:
00145   ConicImpCart( const ConicCartesianData& data );
00146   ~ConicImpCart();
00147   ConicImpCart* copy() const;
00148 
00149   const ConicCartesianData cartesianData() const;
00150   const ConicPolarData polarData() const;
00151 };
00152 
00157 class ConicImpPolar
00158   : public ConicImp
00159 {
00160   ConicPolarData mdata;
00161 public:
00162   ConicImpPolar( const ConicPolarData& data );
00163   ~ConicImpPolar();
00164   ConicImpPolar* copy() const;
00165 
00166   const ConicPolarData polarData() const;
00167 };
00168 
00172 class ConicArcImp
00173   : public ConicImpCart
00174 {
00175   double msa;
00176   double ma;
00177 public:
00178   typedef CurveImp Parent;
00182   static const ObjectImpType* stype();
00187   ConicArcImp( const ConicCartesianData& data,
00188                const double startangle, const double angle );
00189   ~ConicArcImp();
00190 
00191   ConicArcImp* copy() const;
00192 
00193   ObjectImp* transform( const Transformation& t ) const;
00194   bool contains( const Coordinate& p, int width, const KigWidget& ) const;
00195   bool containsPoint( const Coordinate& p, const KigDocument& doc ) const;
00196   bool internalContainsPoint( const Coordinate& p, double threshold,
00197      const KigDocument& doc ) const;
00198 
00199   int numberOfProperties() const;
00200   const QByteArrayList properties() const;
00201   const QByteArrayList propertiesInternalNames() const;
00202   ObjectImp* property( int which, const KigDocument& w ) const;
00203   const char* iconForProperty( int which ) const;
00204   bool isPropertyDefinedOnOrThroughThisImp( int which ) const;
00205 
00206   double getParam( const Coordinate& point, const KigDocument& ) const;
00207   const Coordinate getPoint( double param, const KigDocument& ) const;
00208 
00209   double getParam( const Coordinate& point ) const;
00210   const Coordinate getPoint( double param ) const;
00211 
00215   void setStartAngle( double sa ) { msa = sa; }
00219   void setAngle( double a ) { ma = a; }
00223   Coordinate firstEndPoint() const;
00227   Coordinate secondEndPoint() const;
00228 
00229   const ObjectImpType* type() const;
00230 };
00231 
00232 #endif

kig

Skip menu "kig"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal