9 #include <QRadioButton>
11 #include <QStackedWidget>
12 #include <QToolButton>
28 p_bandBinViewport = NULL;
40 action->setIcon(QPixmap(
toolIconDir() +
"/rgb.png"));
41 action->setToolTip(
"Band Selection (B)");
42 action->setShortcut(Qt::Key_B);
44 "<b>Function:</b> Change the view of the cube from gray scale to RGB.\
45 <p><b>Shortcut:</b> B</p> ";
46 action->setWhatsThis(text);
64 QMenu *copyMenu =
new QMenu();
66 copyLinked->setText(
"to Linked Viewports");
70 copyAll->setText(
"to All Viewports");
73 copyMenu->addAction(copyLinked);
74 copyMenu->addAction(copyAll);
76 QToolButton *copyButton =
new QToolButton(hbox);
77 copyButton->setAutoRaise(
true);
78 copyButton->setIconSize(QSize(22, 22));
79 copyButton->setPopupMode(QToolButton::MenuButtonPopup);
80 copyButton->setMenu(copyMenu);
81 copyButton->setDefaultAction(copyAll);
82 copyButton->setIcon(QPixmap(
toolIconDir() +
"/copy_bands.png"));
83 copyButton->setToolTip(
"Copy");
86 copyButton->setWhatsThis(text);
90 colorIcon.addPixmap(
toolIconDir() +
"/rgb.png", QIcon::Normal, QIcon::On);
91 grayIcon.addPixmap(
toolIconDir() +
"/gray.png", QIcon::Normal, QIcon::Off);
102 "<b>Function:</b> Toggle the active viewport between color or \
103 grayscale display of the cube. Color display is only possible if \
104 the cube has two or more bands";
110 p_comboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
112 p_comboBox->setToolTip(
"Select BandBin keyword");
114 "<b>Function:</b> The default option \"Wavelength\" \
115 simply shows the current band displayed in the viewport. However, \
116 the labels of many cubes contain the BandBin group. \
117 Keywords in this group describe the bands in a meaningful way, \
118 such as WaveLength, Filter, Temperature, iTime, etc. \
119 Selecting an alternative BandBin keyword will cause those values \
120 to show in the spin boxes to the right.";
123 p_stack =
new QStackedWidget(hbox);
132 p_redSpin->setToolTip(
"Change red band");
134 p_grnSpin->setToolTip(
"Change green band");
136 p_bluSpin->setToolTip(
"Change blue band");
139 p_stack2 =
new QStackedWidget(hbox);
142 p_grayDisplay->setFrameStyle(QFrame::Panel | QFrame::Sunken);
149 p_redDisplay->setFrameStyle(QFrame::Panel | QFrame::Sunken);
151 p_blueDisplay->setFrameStyle(QFrame::Panel | QFrame::Sunken);
155 QHBoxLayout *displayLayout =
new QHBoxLayout(grayWidget);
157 displayLayout->addStretch(1);
158 grayWidget->setLayout(displayLayout);
160 displayLayout =
new QHBoxLayout(colorWidget);
164 colorWidget->setLayout(displayLayout);
166 QHBoxLayout *layout =
new QHBoxLayout(stuff1);
167 layout->setMargin(0);
169 layout->addStretch(1);
170 stuff1->setLayout(layout);
172 layout =
new QHBoxLayout(stuff2);
173 layout->setMargin(0);
178 stuff2->setLayout(layout);
186 vertLine->setFrameShape(QFrame::VLine);
187 vertLine->setFrameShadow(QFrame::Sunken);
189 layout =
new QHBoxLayout(hbox);
190 layout->setMargin(0);
193 layout->addWidget(copyButton);
195 layout->addWidget(vertLine);
198 layout->addStretch(1);
199 hbox->setLayout(layout);
218 .findGroup(
"BandBin");
225 for(
int i = 0; i < bandBin.
keywords(); i++) {
226 if(bandBin[i].name() ==
p_comboBox->currentText()) {
228 for(
int j = 0; j < bandBin[i].size(); j++) {
235 for(
int i = 1; i <=
p_bands; i++) {
282 .findGroup(
"BandBin");
283 for(
int i = 0; i < bandBin.
keywords(); i++) {
285 if(bandBin[i].size() ==
p_bands) {
286 QString bandBinName = bandBin[i].
name();
316 if(v == NULL)
return;
474 if(p_bandBinViewport != cvp) {
518 p_bandBinViewport = cvp;
Cube display widget for certain Isis MDI applications.
bool isGray() const
Is the viewport shown in gray / b&w.
bool isColor() const
Is the viewport shown in 3-band color.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
int keywords() const
Returns the number of keywords contained in the PvlContainer.
int greenBand() const
Return the green band currently viewed.
int redBand() const
Return the red band currently viewed.
void setComboCount(int count)
Sets the band bin combo box count.
void setComboIndex(int index)
Sets the band bin combo box index.
int comboCount() const
Return the BandBin combo box count.
Cube * cube() const
Return the cube associated with viewport.
int grayBand() const
Return the gray band currently viewed.
int comboIndex() const
Return the BandBin combo box index.
Contains multiple PvlContainers.
int bandCount() const
Returns the number of virtual bands for the cube.
bool isLinked() const
Is the viewport linked with other viewports.
int cubeBands() const
Return the number of bands in the cube.
int blueBand() const
Return the blue band currently viewed.
QString name() const
Returns the container name.
IO Handler for Isis Cubes.