QtiPlot  0.9.8.2
FunctionDialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : FunctionDialog.h
3  Project : QtiPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2006 - 2009 by Ion Vasilief
6  Email (use @ for *) : ion_vasilief*yahoo.fr
7  Description : Function dialog
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 #ifndef FUNCTIONDIALOG_H
30 #define FUNCTIONDIALOG_H
31 
32 #include <Graph.h>
33 
34 class QAbstractButton;
35 class QDialogButtonBox;
36 class QTableWidget;
37 class QStackedWidget;
38 class QWidget;
39 class QLineEdit;
40 class QComboBox;
41 class QPushButton;
42 class QSpinBox;
43 class QLabel;
44 class QTextEdit;
45 class DoubleSpinBox;
46 class ScriptEdit;
47 class ApplicationWindow;
48 
50 class FunctionDialog : public QDialog
51 {
52  Q_OBJECT
53 
54 public:
55  FunctionDialog(ApplicationWindow* parent, bool standAlone = true, Qt::WFlags fl = 0 );
56 
57  void setCurveToModify(Graph *g, int curve);
59  void setGraph(Graph *g){graph = g;};
60 
61 public slots:
62  bool apply();
63 
64 private slots:
65  void raiseWidget(int index);
66  void insertFunction();
67  void updateFunctionExplain(int);
68  void accept();
69  bool acceptFunction();
70  bool acceptParametric();
71  bool acceptPolar();
72  void showFunctionLog();
73  void showXParLog();
74  void showYParLog();
75  void showPolarRadiusLog();
76  void showPolarThetaLog();
78  void guessConstants();
79  void buttonClicked(QAbstractButton *);
80  void clearList();
81 
82 private:
83  void setConstants(FunctionCurve *c, const QMap<QString, double>& constants);
84 
86  int curveID;
87 
92  QComboBox* boxType;
93  QLabel* textFunction;
96  QLineEdit* boxParameter;
99  QLineEdit* boxPolarParameter;
102  QPushButton* buttonClear;
103  QSpinBox* boxPoints;
104  QSpinBox* boxParPoints;
105  QSpinBox* boxPolarPoints;
106  QStackedWidget* optionStack;
108  QWidget* functionPage;
109  QWidget* polarPage;
110  QWidget* parametricPage;
111  QTableWidget *boxConstants;
112  QPushButton *addFunctionBtn;
113  QComboBox* boxMathFunctions;
114  QTextEdit* boxFunctionExplain;
116  QDialogButtonBox *buttonBox;
117 
121 };
122 
123 #endif // FUNCTIONDIALOG_H