QtiPlot
0.9.8.2
Main Page
Related Pages
Classes
Files
File List
File Members
qtiplot
src
plot2D
dialogs
PlotDialog.h
Go to the documentation of this file.
1
/***************************************************************************
2
File : PlotDialog.h
3
Project : QtiPlot
4
--------------------------------------------------------------------
5
Copyright : (C) 2006 - 2011 by Ion Vasilief
6
Email (use @ for *) : ion_vasilief*yahoo.fr
7
Description : Custom curves 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 PLOTDIALOG_H
30
#define PLOTDIALOG_H
31
32
#include <QDialog>
33
#include <QTreeWidgetItem>
34
#include <
MultiLayer.h
>
35
36
class
QCheckBox;
37
class
QComboBox;
38
class
QCompleter;
39
class
QLabel;
40
class
QLineEdit;
41
class
QListWidget;
42
class
QPushButton;
43
class
QSpinBox;
44
class
QTabWidget;
45
class
QWidget;
46
class
QStringList;
47
class
QGroupBox;
48
class
QDoubleSpinBox;
49
class
QRadioButton;
50
class
QTreeWidget;
51
class
QSlider;
52
53
class
LayerItem
;
54
class
CurveTreeItem
;
55
class
ColorBox
;
56
class
PatternBox
;
57
class
ColorButton
;
58
class
MultiLayer
;
59
class
SymbolBox
;
60
class
ColorMapEditor
;
61
class
QwtPlotItem;
62
class
DoubleSpinBox
;
63
class
PenStyleBox
;
64
class
Spectrogram
;
65
class
ErrorBarsCurve
;
66
class
BoxCurve
;
67
class
DataCurve
;
68
class
ContourLinesEditor
;
69
class
FunctionDialog
;
70
class
EnrichmentDialog
;
71
73
class
PlotDialog
:
public
QDialog
74
{
75
Q_OBJECT
76
77
public
:
78
PlotDialog
(
bool
showExtended, QWidget* parent = 0, Qt::WFlags fl = 0 );
79
void
initFonts
(
const
QFont& titlefont,
const
QFont& axesfont,
const
QFont& numbersfont,
const
QFont& legendfont);
80
void
insertColumnsList
(
const
QStringList& names){
columnNames
= names;};
81
void
setMultiLayer
(
MultiLayer
*ml);
82
void
selectMultiLayerItem
();
83
84
public
slots:
85
void
showAll
(
bool
all);
86
void
selectCurve
(
int
index);
87
88
private
slots:
89
void
showBoxStatistics
();
90
void
showStatistics
();
91
void
customVectorsPage
(
bool
angleMag);
92
void
updateEndPointColumns
(
const
QString& text);
93
94
void
fillBoxSymbols
();
95
void
fillSymbols
();
96
bool
acceptParams
();
97
void
showWorksheet
();
98
void
quit
();
99
100
int
setPlotType
(
CurveTreeItem
*item);
101
void
changePlotType
(
int
plotType);
102
void
setActiveCurve
(
CurveTreeItem
*item);
103
104
void
raiseCurve
();
105
void
shiftCurveBy
(
int
offset = 1);
106
107
void
insertTabs
(
int
plot_type);
108
void
updateTabWindow
(QTreeWidgetItem *currentItem, QTreeWidgetItem *previousItem);
109
void
showAreaColor
(
bool
show);
110
111
void
removeSelectedObject
();
112
113
void
chooseBackgroundImageFile
(
const
QString& fn = QString());
114
void
resizeCanvasToFitImage
();
115
116
void
chooseSymbolImageFile
();
117
118
void
pickErrorBarsColor
();
119
void
enableBoxApplyColor
(
int
);
120
121
void
setAutomaticBinning
(
bool
on =
true
);
122
123
//box plots
124
void
setBoxType
(
int
index);
125
void
setBoxRangeType
(
int
index);
126
void
setWhiskersRange
(
int
index);
127
void
enableLabelsPage
();
128
129
//spectrograms
130
void
showDefaultContourLinesBox
(
bool
show);
131
void
showColorMapEditor
(
bool
show);
132
133
//layer geometry
134
void
adjustLayerHeight
(
double
width);
135
void
adjustLayerWidth
(
double
height);
136
void
displayCoordinates
(
int
unit,
Graph
*g = 0);
137
//plot window geometry
138
void
displayPlotCoordinates
(
int
unit);
139
void
adjustPlotWidth
(
double
height);
140
void
adjustPlotHeight
(
double
width);
141
142
void
setCanvasDefaultValues
();
143
144
void
setActiveLayer
(
LayerItem
*item);
145
void
updateTreeWidgetItem
(QTreeWidgetItem *item);
146
void
updateVisibility
();
147
void
updateVisibility
(QTreeWidgetItem *item,
int
column);
148
void
updateBackgroundTransparency
(
int
alpha);
149
void
updateCanvasTransparency
(
int
alpha);
150
void
setTitlesFont
();
151
void
setAxesLabelsFont
();
152
void
setAxesNumbersFont
();
153
void
setLegendsFont
();
154
void
editCurve
();
155
void
editCurveRange
();
156
void
chooseLabelsFont
();
157
void
applyLayerFormat
();
158
void
applyCanvasFormat
();
159
void
setLayerDefaultValues
();
160
void
setEquidistantLevels
();
161
void
showCustomPenColumn
(
bool
on);
162
163
private
:
164
void
resizeLayerToFitImage
(
Graph
*g);
165
void
applyCanvasFormatToLayer
(
Graph
*g);
166
void
applyCanvasSize
();
167
168
void
applyFormatToLayer
(
Graph
*g);
169
void
applySymbolsFormatToCurve
(QwtPlotCurve *c,
bool
fillColor =
true
,
bool
penColor =
true
);
170
void
applySymbolsFormatToLayer
(
Graph
*g);
171
void
applySymbolsFormat
(QwtPlotCurve *c);
172
173
void
applyLineFormatToLayer
(
Graph
*g);
174
void
applyLineFormat
(QwtPlotCurve *c);
175
176
void
applyErrorBarFormatToCurve
(
ErrorBarsCurve
*err,
bool
color =
true
);
177
void
applyErrorBarFormatToLayer
(
Graph
*g);
178
void
applyErrorBarFormat
(
ErrorBarsCurve
*c);
179
180
void
applyBoxWhiskersFormatToCurve
(
BoxCurve
*b);
181
void
applyBoxWhiskersFormatToLayer
(
Graph
*g);
182
void
applyBoxWhiskersFormat
(
BoxCurve
*c);
183
184
void
applyPercentileFormatToCurve
(
BoxCurve
*b);
185
void
applyPercentileFormatToLayer
(
Graph
*g);
186
void
applyPercentileFormat
(
BoxCurve
*c);
187
188
void
applyLabelsFormatToItem
(QwtPlotItem *);
189
void
applyLabelsFormatToLayer
(
Graph
*);
190
void
applyLabelsFormat
(QwtPlotItem *);
191
192
void
applyGapToLayer
(
Graph
*g);
193
void
applyGap
(
Graph
*g);
194
195
void
setLabelsFont
(
const
QFont& font,
Graph
*,
const
QwtPlotItem *);
196
void
setLabelsFontToPlotItem
(
const
QFont& font,
const
QwtPlotItem *);
197
void
setLabelsFontToLayer
(
const
QFont& font,
Graph
*);
198
199
int
labelsAlignment
();
200
void
closeEvent
(QCloseEvent* e);
201
202
void
clearTabWidget
();
203
void
initAxesPage
();
204
void
initLinePage
();
205
void
initSymbolsPage
();
206
void
initHistogramPage
();
207
void
initErrorsPage
();
208
void
initSpacingPage
();
209
void
initVectPage
();
210
void
initBoxPage
();
211
void
initPercentilePage
();
212
void
initSpectrogramPage
();
213
void
initSpectrogramValuesPage
();
214
void
initContourLinesPage
();
215
void
initLayerPage
();
216
void
initCanvasPage
();
217
void
initLayerGeometryPage
();
218
void
initPlotGeometryPage
();
219
void
initLayerDisplayPage
();
220
void
initLayerSpeedPage
();
221
void
initFontsPage
();
222
void
initMiscPage
();
223
void
initPiePage
();
224
void
initPieGeometryPage
();
225
void
initPieLabelsPage
();
226
void
initPrintPage
();
227
void
initLabelsPage
();
228
void
initFunctionPage
();
229
void
contextMenuEvent
(QContextMenuEvent *e);
230
void
showAllLabelControls
(
bool
show =
true
,
int
curveType = 0);
231
void
updateContourLevelsDisplay
(
Spectrogram
*sp);
232
QRect
layerCanvasRect
(QWidget *widget,
double
x,
double
y,
double
w,
double
h,
FrameWidget::Unit
unit);
233
234
double
aspect_ratio
,
plot_aspect_ratio
;
235
236
QFont
titleFont
,
legendFont
,
axesFont
,
numbersFont
;
237
238
MultiLayer
*
d_ml
;
239
QStringList
columnNames
;
240
241
DoubleSpinBox
*
boxX
, *
boxY
, *
boxLayerWidth
, *
boxLayerHeight
;
242
QCheckBox *
keepRatioBox
;
243
244
QPushButton *
btnTitle
, *
btnAxesLabels
, *
btnAxesNumbers
, *
btnLegend
;
245
ColorMapEditor
*
colorMapEditor
;
246
QWidget *
curvePlotTypeBox
, *
layerPage
, *
layerGeometryPage
, *
piePage
, *
fontsPage
, *
printPage
;
247
QWidget *
layerDisplayPage
, *
speedPage
, *
functionPage
, *
canvasPage
;
248
QTreeWidget*
listBox
;
249
QCheckBox *
boxAntialiasing
, *
boxScaleLayers
, *
boxPrintCrops
, *
boxAutoscaling
, *
boxGridPosition
, *
boxMissingData
;
250
ColorButton
*
boxBorderColor
, *
boxBackgroundColor
, *
boxCanvasColor
;
251
QSpinBox *
boxBackgroundTransparency
, *
boxCanvasTransparency
, *
boxBorderWidth
, *
boxMargin
;
252
QSpinBox *
boxRadius
;
253
DoubleSpinBox
*
boxPieLineWidth
;
254
ColorBox
*
boxFirstColor
;
255
ColorButton
*
boxPieLineColor
;
256
PatternBox
*
boxPiePattern
;
257
PenStyleBox
*
boxPieLineStyle
;
258
QLineEdit *
imagePathBox
;
259
QComboBox *
imageApplyToBox
;
260
QRadioButton *
colorBtn
, *
imageBtn
;
261
QGroupBox *
canvasColorBox
, *
canvasImageBox
;
262
263
QPushButton*
buttonApply
, *
btnWorksheet
;
264
QPushButton*
buttonOk
, *
btnMore
;
265
QPushButton*
buttonCancel
;
266
QComboBox*
boxPlotType
;
267
QWidget*
linePage
;
268
QComboBox*
boxConnect
;
269
PenStyleBox
*
boxLineStyle
;
270
DoubleSpinBox
*
boxLineWidth
, *
boxPenWidth
;
271
ColorButton
*
boxLineColor
, *
boxAreaColor
;
272
QWidget*
symbolPage
;
273
QSpinBox*
boxSymbolSize
;
274
ColorButton
*
boxSymbolColor
, *
boxFillColor
;
275
SymbolBox
*
boxSymbolStyle
;
276
PatternBox
*
boxPattern
;
277
QTabWidget*
privateTabWidget
;
278
QWidget *
errorsPage
, *
spectrogramPage
, *
contourLinesPage
;
279
QGroupBox*
fillGroupBox
;
280
QCheckBox*
plusBox
;
281
QCheckBox*
minusBox
;
282
QCheckBox*
xBox
;
283
ColorButton
*
colorBox
, *
levelsColorBox
, *
vectColorBox
;
284
DoubleSpinBox
*
widthBox
;
285
QComboBox*
capBox
;
286
QCheckBox*
throughBox
;
287
QLabel *
labelPosition
, *
labelXEnd
, *
labelYEnd
;
288
QGroupBox*
GroupBoxH
;
289
QWidget *
histogramPage
, *
spacingPage
;
290
DoubleSpinBox
*
binSizeBox
, *
histogramBeginBox
, *
histogramEndBox
;
291
QCheckBox *
automaticBox
;
292
QPushButton*
buttonStatistics
, *
btnEditCurve
, *
buttonBoxStatistics
, *
btnEditCurveRange
;
293
QSpinBox*
gapBox
, *
offsetBox
, *
boxWidth
;
294
QWidget *
vectPage
, *
boxPage
, *
percentilePage
, *
axesPage
;
295
QComboBox *
xEndBox
, *
yEndBox
, *
boxType
, *
boxWhiskersType
, *
boxWhiskersRange
, *
boxRange
;
296
QSpinBox*
headAngleBox
, *
headLengthBox
, *
boxPercSize
;
297
DoubleSpinBox
*
vectWidthBox
, *
boxEdgeWidth
;
298
QCheckBox *
filledHeadBox
;
299
QSpinBox *
boxCoef
, *
boxWhiskersCoef
;
300
QCheckBox *
boxFillSymbols
, *
boxFillSymbol
;
301
ColorButton
*
boxPercFillColor
, *
boxEdgeColor
;
302
QLabel *
whiskerCoeffLabel
, *
whiskerRangeLabel
, *
boxCoeffLabel
;
303
QLabel *
boxRangeLabel
, *
whiskerCntLabel
, *
boxCntLabel
;
304
QGroupBox *
GroupBoxVectEnd
;
305
QComboBox *
vectPosBox
, *
boxXAxis
, *
boxYAxis
, *
colorScaleBox
;
306
PenStyleBox
*
boxContourStyle
;
307
QSpinBox *
levelsBox
, *
colorScaleWidthBox
;
308
DoubleSpinBox
*
contourWidthBox
;
309
QGroupBox *
levelsGroupBox
, *
axisScaleBox
, *
imageGroupBox
;
310
QGroupBox *
defaultPenBox
;
311
QRadioButton *
defaultScaleBox
, *
grayScaleBox
, *
customScaleBox
, *
defaultContourBox
, *
autoContourBox
;
312
313
QCheckBox *
boxWhiskerLabels
, *
boxBoxLabels
;
314
QComboBox *
boxWhiskersFormatApplyToBox
, *
boxLabelsFormatApplyToBox
, *
percentileFormatApplyToBox
;
315
SymbolBox
*
boxMaxStyle
, *
boxMinStyle
, *
boxMeanStyle
, *
box99Style
, *
box1Style
;
316
QDoubleSpinBox *
whiskerCnt
, *
boxCnt
;
318
QGroupBox *
labelsGroupBox
;
319
DoubleSpinBox
*
boxLabelsAngle
;
320
QSpinBox *
boxLabelsXOffset
, *
boxLabelsYOffset
;
321
QCheckBox *
boxLabelsWhiteOut
;
322
QPushButton *
btnLabelsFont
;
323
QComboBox *
boxLabelsAlign
, *
boxLabelsColumn
;
324
ColorButton
*
boxLabelsColor
;
325
QWidget *
labelsPage
;
326
327
QGroupBox *
pieAutoLabelsBox
, *
boxPieWedge
;
328
DoubleSpinBox
*
boxPieStartAzimuth
, *
boxPieEdgeDist
, *
boxPieViewAngle
, *
boxPieThickness
;
329
QCheckBox *
boxPieConterClockwise
, *
boxPieValues
, *
boxPiePercentages
, *
boxPieCategories
;
330
QWidget *
pieLabelsPage
;
331
QSpinBox *
boxPieOffset
;
332
QWidget *
pieGeometryPage
;
333
334
QComboBox *
unitBox
;
335
QComboBox *
backgroundApplyToBox
;
336
QPushButton *
layerDefaultBtn
;
337
338
DoubleSpinBox
*
firstContourLineBox
, *
contourLinesDistanceBox
;
339
QLabel *
justifyLabelsLbl
, *
labelsColumnLbl
;
340
341
QWidget *
spectroValuesPage
;
342
QComboBox *
boxSpectroMatrix
;
343
QCheckBox *
boxUseMatrixFormula
;
344
ContourLinesEditor
*
contourLinesEditor
;
345
QPushButton *
btnSetEquidistantLevels
;
346
QRadioButton *
customPenBtn
;
347
348
QSpinBox *
boxSkipSymbols
, *
boxSkipErrorBars
;
349
QComboBox *
symbolsFormatApplyToBox
, *
lineFormatApplyToBox
, *
errorBarsFormatApplyToBox
, *
sizeApplyToBox
;
350
QSpinBox *
boxMaxPoints
;
351
DoubleSpinBox
*
boxDouglasPeukerTolerance
;
352
QGroupBox *
speedModeBox
;
353
QCheckBox *
boxApplyColorTo
;
354
355
QWidget *
miscPage
, *
plotGeometryPage
;
356
QCheckBox *
boxLinkXAxes
;
357
QComboBox *
boxLinkAllXAxes
;
358
359
FunctionDialog
*
functionEdit
;
360
QSpinBox *
boxCurveOpacity
, *
boxSymbolTransparency
, *
boxLineTransparency
, *
boxPercentileTransparency
;
361
QSlider *
curveOpacitySlider
, *
symbTransparencySlider
, *
lineTransparencySlider
, *
percentileTransparencySlider
;
362
363
DoubleSpinBox
*
boxPlotX
, *
boxPlotY
, *
boxPlotWidth
, *
boxPlotHeight
;
364
QComboBox *
plotUnitBox
, *
gapApplyToBox
;
365
QCheckBox *
boxResizeLayers
, *
keepPlotRatioBox
, *
layerScaleFonts
;
366
EnrichmentDialog
*
enrichmentDialog
;
367
QPushButton *
btnUp
, *
btnDown
;
368
QLabel *
barsOffsetLabel
;
369
370
QRadioButton *
standardSymbolBtn
, *
imageSymbolBtn
;
371
QGroupBox *
standardSymbolFormatBox
, *
imageSymBolFormatBox
;
372
QLineEdit *
imageSymbolPathBox
;
373
QLabel *
symbolImageLabel
;
374
375
QGroupBox *
boxFramed
;
376
ColorButton
*
boxFrameColor
;
377
QSpinBox *
boxFrameWidth
;
378
QPushButton *
canvasDefaultBtn
;
379
QSlider *
canvasOpacitySlider
, *
bkgOpacitySlider
;
380
381
QCheckBox *
boxLeftAxis
, *
boxRightAxis
, *
boxBottomAxis
, *
boxTopAxis
;
382
QCompleter *
completer
;
383
};
384
385
/*****************************************************************************
386
*
387
* Class LayerItem
388
*
389
*****************************************************************************/
391
class
LayerItem
:
public
QTreeWidgetItem
392
{
393
public
:
394
enum
{
LayerTreeItem
= 1001};
395
LayerItem
(
Graph
*g, QTreeWidgetItem *parent,
const
QString& s);
396
397
Graph
*
graph
() {
return
d_graph
; };
398
void
setActive
(
bool
select);
399
400
protected
:
401
void
insertCurvesList
();
402
void
insertEnrichmentsList
();
403
Graph
*
d_graph
;
404
};
405
406
/*****************************************************************************
407
*
408
* Class CurveTreeItem
409
*
410
*****************************************************************************/
412
class
CurveTreeItem
:
public
QTreeWidgetItem
413
{
414
public
:
415
enum
{
PlotCurveTreeItem
= 1002};
416
CurveTreeItem
(QwtPlotItem *curve,
LayerItem
*parent,
const
QString& s);
417
418
Graph
*
graph
(){
return
((
LayerItem
*)parent())->graph();};
419
void
setActive
(
bool
on);
420
421
const
QwtPlotItem *
plotItem
() {
return
d_curve
; };
422
int
plotItemType
();
423
int
plotItemStyle
();
424
int
plotItemIndex
();
425
426
protected
:
427
QwtPlotItem *
d_curve
;
428
};
429
430
/*****************************************************************************
431
*
432
* Class FrameWidgetTreeItem
433
*
434
*****************************************************************************/
436
class
FrameWidgetTreeItem
:
public
QTreeWidgetItem
437
{
438
public
:
439
enum
{
FrameWidgetItem
= 1003};
440
FrameWidgetTreeItem
(
FrameWidget
*w,
LayerItem
*parent,
const
QString& s);
441
442
Graph
*
graph
(){
return
((
LayerItem
*)parent())->graph();};
443
FrameWidget
*
frameWidget
(){
return
d_widget
;};
444
445
void
setActive
(
bool
on);
446
447
protected
:
448
QPixmap
frameWidgetPixmap
();
449
450
FrameWidget
*
d_widget
;
451
};
452
#endif
Generated on Fri Mar 14 2014 22:59:34 for QtiPlot by
1.8.1.2