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

kig

coordinate_system.h

Go to the documentation of this file.
00001 /*
00002  This file is part of Kig, a KDE program for Interactive Geometry...
00003  Copyright (C) 2002  Dominique Devriese <devriese@kde.org>
00004 
00005  This program is free software; you can redistribute it and/or modify
00006  it under the terms of the GNU General Public License as published by
00007  the Free Software Foundation; either version 2 of the License, or
00008  (at your option) any later version.
00009 
00010  This program is distributed in the hope that it will be useful,
00011  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  GNU General Public License for more details.
00014 
00015  You should have received a copy of the GNU General Public License
00016  along with this program; if not, write to the Free Software
00017  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
00018  USA
00019 */
00020 
00021 #ifndef KIG_MISC_COORDINATE_SYSTEM_H
00022 #define KIG_MISC_COORDINATE_SYSTEM_H
00023 
00024 #include <qnamespace.h>
00025 
00026 class KigPainter;
00027 class KigDocument;
00028 class KigWidget;
00029 class CoordinateSystem;
00030 class QValidator;
00031 class Coordinate;
00032 class QString;
00033 class QStringList;
00034 
00039 class CoordinateSystemFactory
00040 {
00041 public:
00042   enum { Euclidean = 0, Polar = 1 };
00043 
00044   static QStringList names();
00045   static QString setCoordinateSystemStatement( int id );
00046   static CoordinateSystem* build( int which );
00047   static CoordinateSystem* build( const char* type );
00048 };
00049 
00060 class CoordinateSystem
00061 //  : public Qt
00062 {
00063 public:
00064   CoordinateSystem();
00065   virtual ~CoordinateSystem();
00066 
00067   virtual QString fromScreen ( const Coordinate& pt, const KigDocument& w ) const = 0;
00074   virtual QString coordinateFormatNotice() const = 0;
00079   virtual QString coordinateFormatNoticeMarkup() const = 0;
00080   virtual Coordinate toScreen (const QString& pt, bool& ok) const = 0;
00081   virtual void drawGrid ( KigPainter& p, bool showgrid = true,
00082                           bool showaxes = true ) const = 0;
00083   virtual QValidator* coordinateValidator() const = 0;
00084   virtual Coordinate snapToGrid( const Coordinate& c,
00085                                  const KigWidget& w ) const = 0;
00086 
00087   virtual const char* type() const = 0;
00088   virtual int id() const = 0;
00089 };
00090 
00091 class EuclideanCoords
00092   : public CoordinateSystem
00093 {
00094 public:
00095   EuclideanCoords();
00096   ~EuclideanCoords();
00097   QString fromScreen( const Coordinate& pt, const KigDocument& w ) const;
00098   QString coordinateFormatNotice() const;
00099   QString coordinateFormatNoticeMarkup() const;
00100   Coordinate toScreen (const QString& pt, bool& ok) const;
00101   void drawGrid ( KigPainter& p, bool showgrid = true,
00102                   bool showaxes = true ) const;
00103   QValidator* coordinateValidator() const;
00104   Coordinate snapToGrid( const Coordinate& c,
00105                          const KigWidget& w ) const;
00106 
00107   const char* type() const;
00108   int id() const;
00109 };
00110 
00111 class PolarCoords
00112   : public CoordinateSystem
00113 {
00114   void drawGridLine( KigPainter& p, const Coordinate& center,
00115                      double radius ) const;
00116 public:
00117   PolarCoords();
00118   ~PolarCoords();
00119   QString fromScreen( const Coordinate& pt, const KigDocument& w ) const;
00120   QString coordinateFormatNotice() const;
00121   QString coordinateFormatNoticeMarkup() const;
00122   Coordinate toScreen (const QString& pt, bool& ok) const;
00123   void drawGrid ( KigPainter& p, bool showgrid = true,
00124                   bool showaxes = true ) const;
00125   QValidator* coordinateValidator() const;
00126   Coordinate snapToGrid( const Coordinate& c,
00127                          const KigWidget& w ) const;
00128 
00129   const char* type() const;
00130   int id() const;
00131 };
00132 
00133 #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