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

kstars

kstarsplotwidget.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           kstarsplotwidget.h - A widget for dat plotting in KStars
00003                              -------------------
00004     begin                : Sun 18 May 2003
00005     copyright            : (C) 2003 by Jason Harris
00006     email                : kstars@30doradus.org
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef _KSTARSPLOTWIDGET_H_
00019 #define _KSTARSPLOTWIDGET_H_
00020 
00021 #include <qwidget.h>
00022 #include <libkdeedu/kdeeduplot/kplotwidget.h>
00023 
00024 #define BIGTICKSIZE 10
00025 #define SMALLTICKSIZE 4
00026 #define XPADDING 20
00027 #define YPADDING 20
00028 
00029 class QColor;
00030 class QPixmap;
00031 
00039 class KStarsPlotWidget : public KPlotWidget {
00040     Q_OBJECT
00041 public:
00044     KStarsPlotWidget( double x1=0.0, double x2=1.0, double y1=0.0, double y2=1.0, QWidget *parent=0, const char* name=0 );
00045 
00048     ~KStarsPlotWidget() {}
00049 
00053     enum AXIS_TYPE { DOUBLE=0, TIME=1, ANGLE=2, UNKNOWN_TYPE };
00054 
00057     void updateTickmarks();
00058     void setLimits( double xb1, double xb2, double yb1, double yb2 );
00059     void setSecondaryLimits( double xb1, double xb2, double yb1, double yb2 );
00060     void checkLimits();
00061 
00062     double xb() const { return DataRect2.x(); }
00063     double xb2() const { return DataRect2.x2(); }
00064     double yb() const { return DataRect2.y(); }
00065     double yb2() const { return DataRect2.y2(); }
00066     double dataWidth2() const { return DataRect2.width(); }
00067     double dataHeight2() const { return DataRect2.height(); }
00068 
00069     double xScale() const { return XScaleFactor; }
00070     void setXScale( double s ) { XScaleFactor = s; }
00071     double yScale() const { return YScaleFactor; }
00072     void setYScale( double s ) { YScaleFactor = s; }
00073 
00076     AXIS_TYPE xAxisType() const { return XAxisType; }
00077     AXIS_TYPE xAxisType0() const { return XAxisType_0; }
00080     AXIS_TYPE yAxisType() const { return YAxisType; }
00081     AXIS_TYPE yAxisType0() const { return YAxisType_0; }
00082 
00086     void setXAxisType( AXIS_TYPE xtype ) { XAxisType = xtype; }
00087     void setXAxisType0( AXIS_TYPE xtype ) { XAxisType_0 = xtype; }
00091     void setYAxisType( AXIS_TYPE ytype ) { YAxisType = ytype; }
00092     void setYAxisType0( AXIS_TYPE ytype ) { YAxisType_0 = ytype; }
00093 
00098     virtual void setXAxisLabel2( QString xlabel ) { XAxisLabel2 = xlabel; }
00103     virtual void setYAxisLabel2( QString ylabel ) { YAxisLabel2 = ylabel; }
00104 
00109     int rightPadding()  const;
00114     int topPadding()    const;
00115 
00116 protected:
00117     void drawBox( QPainter *p );
00118 
00119     double dXtick2, dYtick2;
00120     int nmajX2, nminX2, nmajY2, nminY2;
00121     AXIS_TYPE XAxisType, YAxisType, XAxisType_0, YAxisType_0;
00122     double XScaleFactor, YScaleFactor;
00123     DRect DataRect2;
00124 
00125     QString XAxisLabel2, YAxisLabel2;
00126 };
00127 
00128 #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