kalzium
elementdataviewer.h
Go to the documentation of this file.00001 #ifndef ELEMENTDATAVIEWER_H
00002 #define ELEMENTDATAVIEWER_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
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 MEANWEIGHT,
00042 DENSITY,
00043 EN,
00044 MELTINGPOINT,
00045 BOILINGPOINT,
00046 ATOMICRADIUS,
00047 COVALENTRADIUS
00048 };
00049
00050 enum AXISTYPE {
00051 X = 0,
00052 Y
00053 };
00054
00055 AxisData( AxisData::AXISTYPE );
00056
00060 double value( int element ) const;
00061
00067 DoubleList dataList;
00068
00069 int currentDataType;
00070
00071 ChemicalDataObject::BlueObelisk kind;
00072
00073 AXISTYPE type() const{
00074 return m_type;
00075 }
00076
00077 private:
00078 AXISTYPE m_type;
00079 };
00080
00081
00087 class ElementDataViewer : public KDialog
00088 {
00089 Q_OBJECT
00090
00091 public:
00092 ElementDataViewer( QWidget *parent = 0 );
00093
00094 ~ElementDataViewer();
00095
00099 AxisData *m_yData;
00100
00104 AxisData *m_xData;
00105
00106
00107 protected:
00108 virtual void keyPressEvent(QKeyEvent *e);
00109
00110 private:
00111 Ui::PlotSetupWidget ui;
00112
00113 void getMinMax(double& min, double& max, AxisData * data);
00114
00115 QStringList names;
00116 QStringList symbols;
00117
00118 QTimer *m_timer;
00119
00120 KActionCollection* m_actionCollection;
00121
00122 void initData();
00123 void setupAxisData( AxisData * data );
00124
00125 void setLimits();
00126
00127 protected slots:
00131 virtual void slotHelp();
00132
00133 private slots:
00134 void rangeChanged();
00135
00136 public slots:
00137 void slotZoomIn();
00138 void slotZoomOut();
00139
00143 void drawPlot();
00144 };
00145
00146 #endif // ELEMENTDATAVIEWER_H
00147