kalzium
elementdataviewer.h
Go to the documentation of this file.00001 #ifndef ELEMENTDATAVIEWER_H 00002 #define ELEMENTDATAVIEWER_H 00003 /*************************************************************************** 00004 copyright : (C) 2004, 2005, 2006 by Carsten Niehaus 00005 email : cniehaus@kde.org 00006 ***************************************************************************/ 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 #include <kdialog.h> 00018 #include "ui_plotsetupwidget.h" 00019 #include "kalziumdataobject.h" 00020 #include "kalziumutils.h" 00021 00022 00023 class QTimer; 00024 class KActionCollection; 00025 00026 typedef QList<double> DoubleList; 00027 00032 class AxisData 00033 { 00034 public: 00038 enum PAXISDATA { 00039 NUMBER = 0, 00040 MASS, 00041 EN, 00042 MELTINGPOINT, 00043 BOILINGPOINT, 00044 ATOMICRADIUS, 00045 COVALENTRADIUS 00046 }; 00047 00048 enum AXISTYPE { 00049 X = 0, 00050 Y 00051 }; 00052 00053 AxisData( AxisData::AXISTYPE ); 00054 00058 double value( int element ) const; 00059 00065 DoubleList dataList; 00066 00067 int currentDataType; 00068 00069 ChemicalDataObject::BlueObelisk kind; 00070 00071 AXISTYPE type() const{ 00072 return m_type; 00073 } 00074 00075 private: 00076 AXISTYPE m_type; 00077 }; 00078 00079 00085 class ElementDataViewer : public KDialog 00086 { 00087 Q_OBJECT 00088 00089 public: 00090 ElementDataViewer( QWidget *parent = 0 ); 00091 00092 ~ElementDataViewer(); 00093 00097 AxisData *m_yData; 00098 00102 AxisData *m_xData; 00103 00104 00105 protected: 00106 virtual void keyPressEvent(QKeyEvent *e); 00107 00108 private: 00109 Ui::PlotSetupWidget ui; 00110 00111 void getMinMax(double& min, double& max, AxisData * data); 00112 00113 QStringList names; 00114 QStringList symbols; 00115 00116 QTimer *m_timer; 00117 00118 KActionCollection* m_actionCollection; 00119 00120 void initData(); 00121 void setupAxisData( AxisData * data ); 00122 00123 void setLimits(); 00124 00125 protected slots: 00129 virtual void slotHelp(); 00130 00131 private slots: 00132 void rangeChanged(); 00133 00134 public slots: 00135 void slotZoomIn(); 00136 void slotZoomOut(); 00137 00141 void drawPlot(); 00142 }; 00143 00144 #endif // ELEMENTDATAVIEWER_H 00145
KDE 4.2 API Reference