SciDAVis  1.D4
Plot3DDialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : Plot3DDialog.h
3  Project : SciDAVis
4  --------------------------------------------------------------------
5  Copyright : (C) 2006 by Ion Vasilief, Tilman Benkert
6  Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net
7  Description : Surface plot options 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 PLOT3DDIALOG_H
30 #define PLOT3DDIALOG_H
31 
32 #include "Graph3D.h"
33 #include <QCheckBox>
34 
35 class QComboBox;
36 class QLabel;
37 class QLineEdit;
38 class QListWidget;
39 class QPushButton;
40 class QRadioButton;
41 class QSpinBox;
42 class QDoubleSpinBox;
43 class QTabWidget;
44 class QWidget;
45 class QStringList;
46 class QStackedWidget;
47 
48 using namespace Qwt3D;
49 
51 class Plot3DDialog : public QDialog
52 {
53  Q_OBJECT
54 
55 public:
56  Plot3DDialog( QWidget* parent = 0, Qt::WFlags fl = 0 );
57  ~Plot3DDialog();
58 
59 public slots:
60  void accept();
61  bool updatePlot();
62 
63  QColor pickFromColor();
64  QColor pickToColor();
65  QColor pickMeshColor();
66  QColor pickAxesColor();
67  QColor pickTitleColor();
68  QColor pickNumberColor();
69  QColor pickBgColor();
70  QColor pickLabelColor();
71  QColor pickGridColor();
72 
73  void setColors(const QColor& title, const QColor& mesh,const QColor& axes,const QColor& num,
74  const QColor& label,const QColor& bg,const QColor& grid);
75  void setDataColors(const QColor& minColor, const QColor& maxColor);
76  void setTransparency(double t);
77  void pickTitleFont();
78  void setTitle(const QString& title);
79  void setTitleFont(const QFont& font);
80 
81  void setResolution(int r);
82  void showLegend(bool show);
83  void setOrthogonal(bool on){boxOrthogonal->setChecked(on);};
84 
85  void setAxesLabels(const QStringList& list);
86  void viewAxisOptions(int axis);
87 
88  void setAxesFonts(const QFont& xf, const QFont& yf, const QFont& zf);
89  QFont axisFont(int axis);
90  void pickAxisLabelFont();
91 
92  void pickNumbersFont();
93  void setNumbersFonts(const QFont& f){numbersFont=f;};
94 
95  QStringList scaleOptions(int axis, double start, double end,
96  const QString& majors, const QString& minors);
97  void setScales(const QStringList& list);
98  void viewScaleLimits(int axis);
99 
100  void setAxesTickLengths(const QStringList& list);
101  void setMeshLineWidth(double lw);
102  void setLabelsDistance(int dist);
103 
104  void disableAxesOptions();
105  void disableMeshOptions();
106  void disableLegend();
107  void disableGridOptions();
108  void showBarsTab(double rad);
109  void showPointsTab(double rad, bool smooth);
110  void showConesTab(double rad, int quality);
111  void showCrossHairTab(double rad, double linewidth, bool smooth, bool boxed);
112 
113  void customWorksheetBtn(const QString& text);
114  void worksheet();
115  void setZoom(double zoom);
116  void setScaling(double xVal, double yVal, double zVal);
117  void showTitleTab();
118  void showAxisTab();
119 
120  void initPointsOptionsStack();
121  void changeZoom(double);
122  void changeTransparency(int val);
123 
124  void showLowerGreek();
125  void showUpperGreek();
126  void addSymbol(const QString& letter);
127  void showGeneralTab();
128 
129  void pickDataColorMap();
130  void setPlot(Graph3D *plot){d_plot = plot;};
131 
132 signals:
133  void showWorksheet();
134  void updatePoints(double, bool);
135  void updateBars(double);
136  void updateTransparency(double);
137  void updateDataColors(const QColor&,const QColor&);
138  void updateColors(const QColor&,const QColor&,const QColor&,const QColor&,const QColor&,const QColor&);
139  void updateTitle(const QString&,const QColor&,const QFont&);
140  void updateResolution(int);
141  void showColorLegend(bool);
142  void setOrtho(bool);
143  void updateLabel(int,const QString&, const QFont&);
144  void updateScale(int,const QStringList&);
145  void updateTickLength(int,double, double);
146  void adjustLabels (int);
147  void setNumbersFont(const QFont&);
148  void updateMeshLineWidth(int);
149  void updateZoom(double);
150  void updateScaling(double, double, double);
151  void updateCones(double, int);
152  void updateCross(double, double, bool, bool);
153  void setDataColorMap(const QString&);
154 
155 private:
156  void initScalesPage();
157  void initAxesPage();
158  void initTitlePage();
159  void initColorsPage();
160  void initGeneralPage();
161 
163  QFont titleFont, xAxisFont,yAxisFont,zAxisFont, numbersFont;
164  QStringList labels, scales, tickLengths;
165  QColor titleColor,meshColor,bgColor, axesColor, numColor,labelColor, gridColor;
166  QColor fromColor, toColor; //custom data colors
167 
168  QSpinBox *boxMeshLineWidth;
169  QPushButton* buttonApply;
170  QPushButton* buttonOk;
171  QPushButton* buttonCancel, *buttonLowerGreek, *buttonUpperGreek;
172  QPushButton* btnTitleColor, *btnTitleFont, *btnLabelFont, *btnGrid;
173  QPushButton *btnBackground, *btnMesh, *btnAxes, *btnTitle, *btnLabels, *btnNumbers;
174  QPushButton *btnNumbersFont, *btnFromColor, *btnToColor, *btnTable, *btnColorMap;
175  QPushButton *buttonAxisLowerGreek, *buttonAxisUpperGreek;
176  QTabWidget* generalDialog;
177  QWidget *scale, *colors, *general, *axes, *title, *bars, *points;
178  QLineEdit *boxTitle, *boxFrom, *boxTo, *boxLabel;
179  QSpinBox *boxMajors, *boxMinors;
180  QGroupBox *TicksGroupBox, *AxesColorGroupBox;
181  QSpinBox *boxResolution, *boxDistance, *boxTransparency;
182  QCheckBox *boxLegend, *boxSmooth, *boxBoxed, *boxCrossSmooth, *boxOrthogonal;
183  QListWidget *axesList, *axesList2;
184  QComboBox *boxType, *boxPointStyle;
185  QLineEdit *boxMajorLength, *boxMinorLength, *boxConesRad;
186  QDoubleSpinBox *boxZoom, *boxXScale, *boxYScale, *boxZScale;
187  QSpinBox *boxQuality;
188  QLineEdit *boxSize, *boxBarsRad, *boxCrossRad, *boxCrossLinewidth;
189  QStackedWidget *optionStack;
190  QWidget *dotsPage, *conesPage, *crossPage;
191 };
192 
193 #endif