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
ScriptEdit * boxPolarRadius
Definition: FunctionDialog.h:90
void showFunctionLog()
Definition: FunctionDialog.cpp:702
QComboBox * boxMathFunctions
Definition: FunctionDialog.h:113
ScriptEdit * d_active_editor
Definition: FunctionDialog.h:119
QLineEdit * boxPolarParameter
Definition: FunctionDialog.h:99
void setGraph(Graph *g)
Definition: FunctionDialog.h:59
QLabel * textFunction
Definition: FunctionDialog.h:93
void raiseWidget(int index)
Definition: FunctionDialog.cpp:344
void showPolarRadiusLog()
Definition: FunctionDialog.cpp:751
QSpinBox * boxPolarPoints
Definition: FunctionDialog.h:105
bool acceptParametric()
Definition: FunctionDialog.cpp:511
DoubleSpinBox * boxTo
Definition: FunctionDialog.h:95
QWidget * polarPage
Definition: FunctionDialog.h:109
A 2D-plotting widget.
Definition: Graph.h:123
QTableWidget * boxConstants
Definition: FunctionDialog.h:111
QStackedWidget * optionStack
Definition: FunctionDialog.h:106
DoubleSpinBox * boxPolarFrom
Definition: FunctionDialog.h:100
void accept()
Definition: FunctionDialog.cpp:678
QLineEdit * boxParameter
Definition: FunctionDialog.h:96
void setConstants(FunctionCurve *c, const QMap< QString, double > &constants)
Definition: FunctionDialog.cpp:877
QPushButton * buttonClear
Definition: FunctionDialog.h:102
QPushButton * buttonPolarRadiusLog
Definition: FunctionDialog.h:115
DoubleSpinBox * boxFrom
Definition: FunctionDialog.h:94
QWidget * functionPage
Definition: FunctionDialog.h:108
ApplicationWindow * d_app
Definition: FunctionDialog.h:118
void guessConstants()
Definition: FunctionDialog.cpp:814
void setCurveToModify(Graph *g, int curve)
Definition: FunctionDialog.cpp:359
QPushButton * buttonFunctionLog
Definition: FunctionDialog.h:115
ScriptEdit * boxFunction
Definition: FunctionDialog.h:107
A QDoubleSpinBox allowing to customize numbers display with respect to locale settings.
Definition: DoubleSpinBox.h:39
QPushButton * buttonXParLog
Definition: FunctionDialog.h:115
QTextEdit * boxFunctionExplain
Definition: FunctionDialog.h:114
ScriptEdit * boxYFunction
Definition: FunctionDialog.h:89
DoubleSpinBox * boxParFrom
Definition: FunctionDialog.h:97
QtiPlot's main window.
Definition: ApplicationWindow.h:133
Editor widget with support for evaluating expressions and executing code.
Definition: ScriptEdit.h:50
bool acceptPolar()
Definition: FunctionDialog.cpp:595
Function dialog.
Definition: FunctionDialog.h:50
void showYParLog()
Definition: FunctionDialog.cpp:735
Definition: FunctionCurve.h:37
DoubleSpinBox * boxPolarTo
Definition: FunctionDialog.h:101
bool d_stand_alone
Definition: FunctionDialog.h:120
Graph * graph
Definition: FunctionDialog.h:85
FunctionDialog(ApplicationWindow *parent, bool standAlone=true, Qt::WFlags fl=0)
Definition: FunctionDialog.cpp:57
QComboBox * boxType
Definition: FunctionDialog.h:92
ScriptEdit * boxPolarTheta
Definition: FunctionDialog.h:91
void buttonClicked(QAbstractButton *)
Definition: FunctionDialog.cpp:329
void setActiveEditor(ScriptEdit *edit)
Definition: FunctionDialog.h:77
QSpinBox * boxParPoints
Definition: FunctionDialog.h:104
QWidget * parametricPage
Definition: FunctionDialog.h:110
void clearList()
Definition: FunctionDialog.cpp:433
bool acceptFunction()
Definition: FunctionDialog.cpp:454
QSpinBox * boxPoints
Definition: FunctionDialog.h:103
int curveID
Definition: FunctionDialog.h:86
QPushButton * addFunctionBtn
Definition: FunctionDialog.h:112
bool apply()
Definition: FunctionDialog.cpp:684
ScriptEdit * boxXFunction
Definition: FunctionDialog.h:88
DoubleSpinBox * boxParTo
Definition: FunctionDialog.h:98
void updateFunctionExplain(int)
Definition: FunctionDialog.cpp:809
QDialogButtonBox * buttonBox
Definition: FunctionDialog.h:116
void showPolarThetaLog()
Definition: FunctionDialog.cpp:768
QPushButton * buttonPolarRThetaLog
Definition: FunctionDialog.h:115
QPushButton * buttonYParLog
Definition: FunctionDialog.h:115
void insertFunction()
Definition: FunctionDialog.cpp:784
void showXParLog()
Definition: FunctionDialog.cpp:718