27 #include "../../../common/STLUtils.h"
30 #include "ui_ChannelSelectionWidgetForm.h"
31 #include "../../../raster.h"
32 #include "../../../se.h"
42 m_ui(new Ui::ChannelSelectionWidgetForm),
43 m_scRed(new te::se::SelectedChannel),
44 m_scGreen(new te::se::SelectedChannel),
45 m_scBlue(new te::se::SelectedChannel),
46 m_scMono(new te::se::SelectedChannel),
47 m_cs(new te::se::ChannelSelection)
55 QGridLayout* layout =
new QGridLayout(
m_ui->m_frame);
56 layout->setContentsMargins(0,0,0,0);
103 m_cs->setRedChannel(m_scRed);
104 m_cs->setGreenChannel(m_scGreen);
105 m_cs->setBlueChannel(m_scBlue);
106 m_cs->setGrayChannel(m_scMono);
111 QStringList bandNames;
113 for(
size_t i = 0; i < m_bands.size(); ++i)
117 if(m_bands[i]->m_description.empty())
120 bandInfo.setNum(m_bands[i]->m_idx);
122 bandNames.push_back(bandInfo);
126 bandNames.push_back(m_bands[i]->m_description.c_str());
132 m_sCWidget->setChannelNames(bandNames);
138 m_ui->m_redRadioButton->setEnabled(
true);
139 m_ui->m_greenRadioButton->setEnabled(
true);
140 m_ui->m_blueRadioButton->setEnabled(
true);
141 m_ui->m_monoRadioButton->setEnabled(
false);
143 m_ui->m_redRadioButton->setChecked(
true);
144 onRedChannelSelected();
149 m_ui->m_redRadioButton->setEnabled(
false);
150 m_ui->m_greenRadioButton->setEnabled(
false);
151 m_ui->m_blueRadioButton->setEnabled(
false);
152 m_ui->m_monoRadioButton->setEnabled(
true);
154 m_ui->m_monoRadioButton->setChecked(
true);
157 m_sCWidget->setSelectedChannel(m_scMono);
162 if(m_ui->m_redRadioButton->isChecked())
164 m_sCWidget->setSelectedChannel(m_scRed);
170 if(m_ui->m_greenRadioButton->isChecked())
172 m_sCWidget->setSelectedChannel(m_scGreen);
178 if(m_ui->m_blueRadioButton->isChecked())
180 m_sCWidget->setSelectedChannel(m_scBlue);
185 if(m_ui->m_monoRadioButton->isChecked())
187 m_sCWidget->setSelectedChannel(m_scMono);
193 if(m_ui->m_redRadioButton->isChecked())
195 m_scRed = m_sCWidget->getSelectedChannel();
197 else if(m_ui->m_greenRadioButton->isChecked())
199 m_scGreen = m_sCWidget->getSelectedChannel();
201 else if(m_ui->m_blueRadioButton->isChecked())
203 m_scBlue = m_sCWidget->getSelectedChannel();
205 else if(m_ui->m_monoRadioButton->isChecked())
207 m_scMono = m_sCWidget->getSelectedChannel();
void onMonoChannelSelected()
ChannelSelection specifies the false-color channel selection for a multi-spectral raster source (such...
void onGrayScalelSelected()
A dialog used to build a SelectedChannelWidget element.
void onSelectedChannelChanged()
ChannelSelectionWidget(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a ChannelSelectionWidget dialog which is a child of parent, with widget flags set to f...
void onGreenChannelSelected()
void updateUi()
Updates the widget form based on internal mark element.
te::qt::widgets::SelectedChannelWidget * m_sCWidget
Selected Channel Widget.
te::se::ChannelSelection * getChannelSelection() const
std::auto_ptr< Ui::ChannelSelectionWidgetForm > m_ui
Dialog form.
void setProperty(std::vector< te::rst::BandProperty * > &p)
Sets the band information.
void initialize()
Internal method to initialize the widget (e.g.: color, combos, icons, etc.)
void onBlueChannelSelected()
void onRGBColorSelected()
ChannelSelection * clone() const
It creates a new copy of this object.
~ChannelSelectionWidget()
Destructor.
void onRedChannelSelected()
A widget used to build SelectedChannel element.
void setChannelSelection(const te::se::ChannelSelection *cs)