1
/***************************************************************************
4
--------------------------------------------------------------------
5
Copyright : (C) 2006 by Ion Vasilief, Tilman Benkert
6
Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net
7
Description : Custom curves dialog
9
***************************************************************************/
11
/***************************************************************************
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. *
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. *
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 *
28
***************************************************************************/
33
#include <QTreeWidgetItem>
34
#include "MultiLayer.h"
61
//! Custom plot/curves dialog
62
class PlotDialog : public QDialog
67
PlotDialog(bool showExtended, QWidget* parent = 0, Qt::WFlags fl = 0 );
68
void initFonts(const QFont& titlefont, const QFont& axesfont, const QFont& numbersfont, const QFont& legendfont);
69
void insertColumnsList(const QStringList& names){columnNames = names;};
70
void setMultiLayer(MultiLayer *ml);
73
void showAll(bool all);
74
void selectCurve(int index);
77
void showStatistics();
78
void customVectorsPage(bool angleMag);
79
void updateEndPointColumns(const QString& text);
81
void fillBoxSymbols();
87
int setPlotType(CurveTreeItem *item);
88
void changePlotType(int plotType);
89
void setActiveCurve(CurveTreeItem *item);
91
void insertTabs(int plot_type);
92
void updateTabWindow(QTreeWidgetItem *currentItem, QTreeWidgetItem *previousItem);
93
void showAreaColor(bool show);
95
void removeSelectedCurve();
97
/******* error bars options **************/
98
void pickErrorBarsColor();
99
void changeErrorBarsType();
100
void changeErrorBarsPlus();
101
void changeErrorBarsMinus();
102
void changeErrorBarsThrough();
104
void setAutomaticBinning();
106
void showPlotAssociations(QTreeWidgetItem *item, int);
108
void setPenStyle(Qt::PenStyle style);
109
void setPiePenStyle(const Qt::PenStyle& style);
112
void setBoxType(int index);
113
void setBoxRangeType(int index);
114
void setWhiskersRange(int index);
117
void pickContourLinesColor();
118
void showDefaultContourLinesBox(bool show);
119
void showColorMapEditor(bool show);
122
void setActiveLayer(LayerItem *item);
123
void updateTreeWidgetItem(QTreeWidgetItem *item);
124
void updateBackgroundTransparency(int alpha);
125
void updateCanvasTransparency(int alpha);
126
void updateAntialiasing(bool on);
127
void updateBorder(int width);
128
void pickBackgroundColor();
129
void pickCanvasColor();
130
void pickBorderColor();
131
void changeMargin(int);
132
void setTitlesFont();
133
void setAxesLabelsFont();
134
void setAxesNumbersFont();
135
void setLegendsFont();
139
void closeEvent(QCloseEvent* e);
141
void clearTabWidget();
144
void initSymbolsPage();
145
void initHistogramPage();
146
void initErrorsPage();
147
void initSpacingPage();
150
void initPercentilePage();
151
void initSpectrogramPage();
152
void initLayerPage();
153
void initFontsPage();
155
void initPrintPage();
156
void contextMenuEvent(QContextMenuEvent *e);
158
QFont titleFont, legendFont, axesFont, numbersFont;
161
QStringList columnNames;
163
QPushButton *btnTitle, *btnAxesLabels, *btnAxesNumbers, *btnLegend;
164
ColorMapEditor *colorMapEditor;
165
QWidget *curvePlotTypeBox, *layerPage, *piePage, *fontsPage, *printPage;
166
QTreeWidget* listBox;
167
QCheckBox *boxAntialiasing, *boxAll, *boxScaleLayers, *boxPrintCrops;
168
ColorButton *boxBorderColor, *boxBackgroundColor, *boxCanvasColor;
169
QSpinBox *boxBackgroundTransparency, *boxCanvasTransparency, *boxBorderWidth, *boxMargin;
170
QSpinBox *boxRadius, *boxPieLineWidth;
171
ColorBox *boxFirstColor, *boxPieLineColor;
172
PatternBox *boxPiePattern;
173
QComboBox* boxPieLineStyle;
175
QPushButton* buttonApply, *btnWorksheet;
176
QPushButton* buttonOk, *btnMore;
177
QPushButton* buttonCancel;
178
QComboBox* boxPlotType;
180
QComboBox* boxConnect;
181
QComboBox* boxLineStyle;
182
QSpinBox* boxLineWidth, *boxPenWidth;
183
ColorBox* boxLineColor, *boxAreaColor;
185
QSpinBox* boxSymbolSize;
186
ColorBox* boxSymbolColor,*boxFillColor;
187
SymbolBox* boxSymbolStyle;
188
PatternBox *boxPattern;
189
QTabWidget* privateTabWidget;
190
QWidget *errorsPage, *spectrogramPage;
191
QGroupBox* fillGroupBox;
195
ColorButton *colorBox, *levelsColorBox;
196
ColorBox* vectColorBox;
199
QCheckBox* throughBox;
200
QLabel *labelPosition, *labelXEnd, *labelYEnd;
201
QGroupBox* GroupBoxH;
202
QWidget *histogramPage, *spacingPage;
203
QLineEdit *binSizeBox, *histogramBeginBox, *histogramEndBox;
204
QCheckBox *automaticBox;
205
QPushButton* buttonStatistics, *btnEditCurve;
206
QSpinBox* gapBox, *offsetBox, *boxWidth;
207
QWidget *vectPage, *boxPage, *percentilePage, *axesPage;
208
QComboBox *xEndBox, *yEndBox, *boxType, *boxWhiskersType, *boxWhiskersRange, *boxRange;
209
QSpinBox* headAngleBox, *headLengthBox, *vectWidthBox, *boxPercSize, *boxEdgeWidth;
210
QCheckBox *filledHeadBox;
211
QSpinBox *boxCoef, *boxWhiskersCoef;
212
QCheckBox *boxFillSymbols, *boxFillSymbol;
213
ColorBox *boxPercFillColor, *boxEdgeColor;
214
QLabel *whiskerCoeffLabel, *whiskerRangeLabel, *boxCoeffLabel;
215
QLabel *boxRangeLabel, *whiskerCntLabel, *boxCntLabel;
216
QGroupBox *GroupBoxVectEnd;
217
QComboBox *vectPosBox, *boxXAxis, *boxYAxis, *colorScaleBox, *boxContourStyle;
218
QSpinBox *levelsBox, *contourWidthBox, *colorScaleWidthBox;
219
QGroupBox *levelsGroupBox, *axisScaleBox, *imageGroupBox;
220
QGroupBox *defaultPenBox;
221
QRadioButton *defaultScaleBox, *grayScaleBox, *customScaleBox, *defaultContourBox, *autoContourBox;
223
SymbolBox *boxMaxStyle, *boxMinStyle, *boxMeanStyle, *box99Style, *box1Style;
224
QDoubleSpinBox *whiskerCnt, *boxCnt;
227
/*****************************************************************************
231
*****************************************************************************/
232
//! LayerItem tree widget item class
233
class LayerItem : public QTreeWidgetItem
236
enum {LayerTreeItem = 1001};
237
LayerItem(Graph *g, QTreeWidgetItem *parent, const QString& s);
239
Graph *graph() { return d_graph; };
240
void setActive(bool select);
243
void insertCurvesList();
247
/*****************************************************************************
249
* Class CurveTreeItem
251
*****************************************************************************/
252
//! CurveTreeItem tree widget item class
253
class CurveTreeItem : public QTreeWidgetItem
256
enum {PlotCurveTreeItem = 1002};
257
CurveTreeItem(const QwtPlotItem *curve, LayerItem *parent, const QString& s);
259
Graph* graph(){return ((LayerItem *)parent())->graph();};
260
void setActive(bool on);
262
const QwtPlotItem *plotItem() { return d_curve; };
267
const QwtPlotItem *d_curve;