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

kstars

planetviewer.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           planetviewer.h  -  Display overhead view of the solar system
00003                              -------------------
00004     begin                : Sun May 25 2003
00005     copyright            : (C) 2003 by Jason Harris
00006     email                : jharris@30doradus.org
00007  ***************************************************************************/
00008 /***************************************************************************
00009  *                                                                         *
00010  *   This program is free software; you can redistribute it and/or modify  *
00011  *   it under the terms of the GNU General Public License as published by  *
00012  *   the Free Software Foundation; either version 2 of the License, or     *
00013  *   (at your option) any later version.                                   *
00014  *                                                                         *
00015  ***************************************************************************/
00016 
00017 #ifndef PLANETVIEWER_H
00018 #define PLANETVIEWER_H
00019 
00020 #include <kdialogbase.h>
00021 #include <kpushbutton.h>
00022 #include <qtimer.h>
00023 
00024 #include "kstarsplotwidget.h"
00025 #include "planetviewerui.h"
00026 #include "kstarsdatetime.h"
00027 #include "planetcatalog.h"
00028 
00034 class PlanetViewer : public KDialogBase
00035 {
00036 Q_OBJECT
00037 public:
00038     PlanetViewer(QWidget *parent = 0, const char *name = 0);
00039     ~PlanetViewer();
00040 
00041     QString centerPlanet() const { return CenterPlanet; }
00042     void setCenterPlanet( const QString &cp ) { CenterPlanet = cp; }
00043     
00044     KPlotObject* planetObject(uint i) const { return planet[i]; }
00045     QString planetName(uint i) const { return pName[i]; }
00046 
00047 protected:
00048     virtual void keyPressEvent( QKeyEvent *e );
00049     virtual void paintEvent( QPaintEvent* );
00050 
00051 private slots:
00052     void initPlotObjects();
00053     void tick();
00054     void setTimeScale(float);
00055     void slotChangeDate( const ExtDate &d );
00056     void slotRunClock();
00057     void slotToday();
00058 
00059 private:
00060     void updatePlanets();
00061     
00062     PlanetViewerUI *pw;
00063     KStarsDateTime ut;
00064     PlanetCatalog PCat;
00065     double scale;
00066     bool isClockRunning;
00067     QTimer tmr;
00068     int UpdateInterval[9], LastUpdate[9];
00069     QString pName[9], pColor[9];
00070     QString CenterPlanet;
00071 
00072     KPlotObject *ksun;
00073     KPlotObject *planet[9];
00074     KPlotObject *planetLabel[9];
00075 };
00076 
00077 class PVPlotWidget : public KStarsPlotWidget
00078 {
00079 Q_OBJECT
00080 public:
00081     PVPlotWidget( double x1, double x2, double y1, double y2, 
00082             QWidget *parent=0, const char *name=0 );
00083     PVPlotWidget( QWidget *parent=0, const char *name=0 );
00084     ~PVPlotWidget();
00085 
00086 public slots:
00087     void slotZoomIn();
00088     void slotZoomOut();
00089 
00090 signals:
00091     void doubleClicked( double, double );
00092 
00093 protected:
00094     virtual void keyPressEvent( QKeyEvent *e );
00095     virtual void mousePressEvent( QMouseEvent *e );
00096     virtual void mouseMoveEvent( QMouseEvent *e );
00097     virtual void mouseReleaseEvent( QMouseEvent * );
00098     virtual void mouseDoubleClickEvent( QMouseEvent *e );
00099     virtual void wheelEvent( QWheelEvent *e );
00100 
00101 private:
00102     bool mouseButtonDown;
00103     int oldx, oldy;
00104     PlanetViewer *pv;
00105 };
00106 
00107 #endif

kstars

Skip menu "kstars"
  • Main Page
  • Modules
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • keduca
  • kstars
Generated for API Reference by doxygen 1.5.9
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