HyperspaceExplorer 0.7.1
|
00001 /* 00002 Hyperspace Explorer - visualizing higher-dimensional geometry 00003 Copyright (C) 2010 Lene Preuss <lene.preuss@gmail.com> 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 along 00016 with this program; if not, write to the Free Software Foundation, Inc., 00017 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 00019 */ 00020 00021 #ifndef VALUES_DIALOG_IMPL_H 00022 #define VALUES_DIALOG_IMPL_H 00023 00024 #include <cstdlib> 00025 #include <iostream> 00026 00027 #include <QSlider> 00028 #include <QLineEdit> 00029 #include <QComboBox> 00030 00031 #include "ValuesDialog.h" 00032 00033 #include "Log.h" 00034 #include "ParameterMap.h" 00035 00036 class Displayable; 00037 00038 namespace UI { 00039 namespace Dialogs { 00041 00050 class ValuesDialogImpl: public QDialog, public UI::Dialogs::ValuesDialog { 00051 Q_OBJECT 00052 00053 public: 00054 ValuesDialogImpl(QWidget *parent = 0, Qt::WFlags f = 0); 00055 virtual ~ValuesDialogImpl() {} 00056 00057 void setFunction(const std::shared_ptr<Displayable> &); 00058 00059 std::string print (); 00060 00062 double tmin () { return atof (Min[0]->text ().toStdString().c_str()); } 00064 double tmax () { return atof (Max[0]->text ().toStdString().c_str()); } 00066 unsigned tsteps () { return Slider[0]->value (); } 00068 double dt () { return (tmax ()-tmin ())/double (tsteps ()); } 00069 00071 double umin () { return atof (Min[1]->text ().toStdString().c_str()); } 00073 double umax () { return atof (Max[1]->text ().toStdString().c_str()); } 00075 unsigned usteps () { return Slider[1]->value (); } 00077 double du () { return (umax ()-umin ())/double (usteps ()); } 00078 00080 double vmin () { return atof (Min[2]->text ().toStdString().c_str()); } 00082 double vmax () { return atof (Max[2]->text ().toStdString().c_str()); } 00084 unsigned vsteps () { return Slider[2]->value (); } 00086 double dv () { return (vmax ()-vmin ())/double (vsteps ()); } 00087 00088 public slots: 00089 virtual void accept (); 00090 00091 signals: 00093 void ApplyChanges (const ParameterMap &); 00094 00095 private: 00096 void setParameters(const ParameterMap &); 00097 ParameterMap parameters; 00098 }; 00099 } 00100 } 00101 #endif 00102