13 #include <QHBoxLayout>
17 #include <QRadioButton>
19 #include <QStackedWidget>
20 #include <QToolButton>
23 #include "MdiCubeViewport.h"
36 p_bandBinViewport = NULL;
48 action->setIcon(QPixmap(
toolIconDir() +
"/rgb.png"));
49 action->setToolTip(
"Band Selection (B)");
50 action->setShortcut(Qt::Key_B);
52 "<b>Function:</b> Change the view of the cube from gray scale to RGB.\
53 <p><b>Shortcut:</b> B</p> ";
54 action->setWhatsThis(text);
74 copyLinked->setText(
"to Linked Viewports");
78 copyAll->setText(
"to All Viewports");
81 copyMenu->addAction(copyLinked);
82 copyMenu->addAction(copyAll);
84 QToolButton *copyButton =
new QToolButton(hbox);
85 copyButton->setAutoRaise(
true);
86 copyButton->setIconSize(QSize(22, 22));
87 copyButton->setPopupMode(QToolButton::MenuButtonPopup);
88 copyButton->setMenu(copyMenu);
89 copyButton->setDefaultAction(copyAll);
90 copyButton->setIcon(QPixmap(
toolIconDir() +
"/copy_bands.png"));
91 copyButton->setToolTip(
"Copy");
94 copyButton->setWhatsThis(text);
98 colorIcon.addPixmap(
toolIconDir() +
"/rgb.png", QIcon::Normal, QIcon::On);
99 grayIcon.addPixmap(
toolIconDir() +
"/gray.png", QIcon::Normal, QIcon::Off);
110 "<b>Function:</b> Toggle the active viewport between color or \
111 grayscale display of the cube. Color display is only possible if \
112 the cube has two or more bands";
118 p_comboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
120 p_comboBox->setToolTip(
"Select BandBin keyword");
122 "<b>Function:</b> The default option \"Wavelength\" \
123 simply shows the current band displayed in the viewport. However, \
124 the labels of many cubes contain the BandBin group. \
125 Keywords in this group describe the bands in a meaningful way, \
126 such as WaveLength, Filter, Temperature, iTime, etc. \
127 Selecting an alternative BandBin keyword will cause those values \
128 to show in the spin boxes to the right.";
131 p_stack =
new QStackedWidget(hbox);
140 p_redSpin->setToolTip(
"Change red band");
142 p_grnSpin->setToolTip(
"Change green band");
144 p_bluSpin->setToolTip(
"Change blue band");
147 p_stack2 =
new QStackedWidget(hbox);
150 p_grayDisplay->setFrameStyle(QFrame::Panel | QFrame::Sunken);
157 p_redDisplay->setFrameStyle(QFrame::Panel | QFrame::Sunken);
159 p_blueDisplay->setFrameStyle(QFrame::Panel | QFrame::Sunken);
163 QHBoxLayout *displayLayout =
new QHBoxLayout(grayWidget);
165 displayLayout->addStretch(1);
166 grayWidget->setLayout(displayLayout);
168 displayLayout =
new QHBoxLayout(colorWidget);
172 colorWidget->setLayout(displayLayout);
174 QHBoxLayout *layout =
new QHBoxLayout(stuff1);
175 layout->setMargin(0);
177 layout->addStretch(1);
178 stuff1->setLayout(layout);
180 layout =
new QHBoxLayout(stuff2);
181 layout->setMargin(0);
186 stuff2->setLayout(layout);
194 vertLine->setFrameShape(QFrame::VLine);
195 vertLine->setFrameShadow(QFrame::Sunken);
197 layout =
new QHBoxLayout(hbox);
198 layout->setMargin(0);
201 layout->addWidget(copyButton);
203 layout->addWidget(vertLine);
206 layout->addStretch(1);
207 hbox->setLayout(layout);
226 .findGroup(
"BandBin");
233 for(
int i = 0; i < bandBin.
keywords(); i++) {
234 if(bandBin[i].name() ==
p_comboBox->currentText()) {
236 for(
int j = 0; j < bandBin[i].size(); j++) {
243 for(
int i = 1; i <=
p_bands; i++) {
290 .findGroup(
"BandBin");
291 for(
int i = 0; i < bandBin.
keywords(); i++) {
293 if(bandBin[i].size() ==
p_bands) {
294 QString bandBinName = bandBin[i].
name();
324 if(v == NULL)
return;
482 if(p_bandBinViewport != cvp) {
526 p_bandBinViewport = cvp;