2 #include "ScatterPlotConfigDialog.h"
4 #include <qwt_interval.h>
12 #include <QPushButton>
16 #include "MdiCubeViewport.h"
17 #include "SpecialPixel.h"
18 #include "Workspace.h"
32 setWindowTitle(
"Configure Scatter Plot");
37 QGridLayout *mainLayout =
new QGridLayout;
68 QLabel *titleLabel =
new QLabel(
"<h2>Create Scatter Plot</h2>");
69 mainLayout->addWidget(titleLabel, curRow, 0, 1, 3);
72 QLabel *headerLabel =
new QLabel(
"Choose where to gather the scatter plot "
73 "data from. The X and Y axes are a single band of a cube and must have "
74 "the same dimensions");
75 headerLabel->setWordWrap(
true);
76 mainLayout->addWidget(headerLabel, curRow, 0, 1, 3);
79 int spacerRow = curRow;
82 QLabel *configXLabel =
new QLabel(
"Choose X Input Data");
83 mainLayout->addWidget(configXLabel, curRow, 0, 1, 3);
86 QLabel *xAxisCubeLabel =
new QLabel(
"Cube");
87 mainLayout->addWidget(xAxisCubeLabel, curRow, 1, 1, 1);
96 QLabel *xAxisCubeBandLabel =
new QLabel(
"Cube Band");
97 mainLayout->addWidget(xAxisCubeBandLabel, curRow, 1, 1, 1);
105 QLabel *xAxisBinCountLabel =
new QLabel(
"Bin Count (resolution)");
106 mainLayout->addWidget(xAxisBinCountLabel, curRow, 1, 1, 1);
117 QLabel *useViewportRangesLabel =
new QLabel(
"Use Viewport Visible Range");
118 mainLayout->addWidget(useViewportRangesLabel, curRow, 1, 1, 1);
126 QLabel *configYLabel =
new QLabel(
"Choose Y Input Data");
127 mainLayout->addWidget(configYLabel, curRow, 0, 1, 3);
130 QLabel *yAxisCubeLabel =
new QLabel(
"Cube");
131 mainLayout->addWidget(yAxisCubeLabel, curRow, 1, 1, 1);
140 QLabel *yAxisCubeBandLabel =
new QLabel(
"Cube Band");
141 mainLayout->addWidget(yAxisCubeBandLabel, curRow, 1, 1, 1);
149 QLabel *yAxisBinCountLabel =
new QLabel(
"Bin Count (resolution)");
150 mainLayout->addWidget(yAxisBinCountLabel, curRow, 1, 1, 1);
161 QHBoxLayout *buttonsLayout =
new QHBoxLayout;
162 buttonsLayout->addStretch();
167 this, SLOT(accept()));
170 QPushButton *cancelButton =
new QPushButton(
"Cancel");
171 cancelButton->setIcon(QIcon::fromTheme(
"window-close"));
172 connect(cancelButton, SIGNAL(clicked()),
173 this, SLOT(reject()));
174 buttonsLayout->addWidget(cancelButton);
177 buttonsWrapper->setLayout(buttonsLayout);
178 mainLayout->addWidget(buttonsWrapper, curRow, 0, 1, 3);
180 mainLayout->setColumnMinimumWidth(0, 20);
181 mainLayout->setRowMinimumHeight(spacerRow, 20);
182 setLayout(mainLayout);
194 if (activeViewport) {
211 return QSize(qRound(QDialog::sizeHint().width() * 1.3),
212 QDialog::sizeHint().height());
316 container = viewport;
333 container = viewport;
353 allXCubes.append(viewport->
cube());
358 foreach (
Cube *cubeToRemove, extraXCubes) {
365 foreach (
Cube *cubeToAdd, missingXCubes) {
367 QString cubeName = QFileInfo(cubeToAdd->
fileName()).baseName();
393 allYCubes.append(cube);
399 foreach (
Cube *cubeToRemove, extraYCubes) {
406 foreach (
Cube *cubeToAdd, missingYCubes) {
408 QString cubeName = QFileInfo(cubeToAdd->
fileName()).baseName();
444 bool allowCreation =
true;
447 allowCreation =
false;
452 allowCreation =
false;
472 foreach (
Cube *toRemove, itemsToRemove) {
473 list.removeAll(toRemove);
503 double startSample =
Null;
504 double startLine =
Null;
505 double endSample =
Null;
506 double endLine =
Null;
510 container->viewport()->height() - 1,
512 sampleRange.setInterval(qRound(startSample), qRound(endSample));
513 lineRange.setInterval(qRound(startLine), qRound(endLine));