27 #include "../../../dataaccess/dataset/DataSet.h"
28 #include "../../../dataaccess/utils/Utils.h"
29 #include "../../../geometry/GTFactory.h"
30 #include "../../../raster/Interpolator.h"
31 #include "../../../rp/Blender.h"
35 #include "ui_MosaicWizardPageForm.h"
38 #include <QApplication>
39 #include <QGridLayout>
40 #include <QMessageBox>
48 : QWizardPage(parent),
49 m_ui(new Ui::MosaicWizardPageForm)
57 this->setTitle(tr(
"Mosaic"));
58 this->setSubTitle(tr(
"Select the type of mosaic and set their specific parameters."));
60 m_ui->m_noDataValueLineEdit->setValidator(
new QDoubleValidator(
this));
62 m_ui->m_tpmAcquireToolButton->setIcon(QIcon::fromTheme(
"wand"));
80 int idx = m_ui->m_mosaicTypeComboBox->currentIndex();
82 int type = m_ui->m_mosaicTypeComboBox->itemData(idx).toInt();
84 return (type == MOSAIC_GEO);
89 int idx = m_ui->m_mosaicTypeComboBox->currentIndex();
91 int type = m_ui->m_mosaicTypeComboBox->itemData(idx).toInt();
93 return (type == MOSAIC_TIEPOINT);
98 int idx = m_ui->m_mosaicTypeComboBox->currentIndex();
100 int type = m_ui->m_mosaicTypeComboBox->itemData(idx).toInt();
102 return (type == MOSAIC_SEQUENCE);
107 m_layerList = layerList;
110 m_ui->m_tpmLayerAComboBox->clear();
111 m_ui->m_tpmLayerBComboBox->clear();
113 std::list<te::map::AbstractLayerPtr>::iterator it = m_layerList.begin();
114 std::vector<std::size_t> bands;
116 while(it != m_layerList.end())
120 std::auto_ptr<te::da::DataSet> ds = l->getData();
122 std::auto_ptr<te::rst::Raster> rst = ds->getRaster(rpos);
125 bands.push_back(rst->getNumberOfBands());
127 m_ui->m_tpmLayerAComboBox->addItem(l->getTitle().c_str(), QVariant::fromValue(l));
128 m_ui->m_tpmLayerBComboBox->addItem(l->getTitle().c_str(), QVariant::fromValue(l));
134 std::vector<std::size_t>::iterator itBand = std::min_element(bands.begin(), bands.end());
136 for(std::size_t t = 0; t < *itBand; ++t)
138 m_ui->m_smRefBandComboBox->addItem(QString::number(t));
144 int interpolationIdx = m_ui->m_interpolatorTypeComboBox->currentIndex();
147 int blenderIdx = m_ui->m_blenderTypeComboBox->currentIndex();
154 algoInputParams.
m_noDataValue = m_ui->m_noDataValueLineEdit->text().isEmpty() ? 0 : m_ui->m_noDataValueLineEdit->text().toDouble();
156 algoInputParams.
m_autoEqualize = m_ui->m_autoEqualizeCheckBox->isChecked();
157 algoInputParams.
m_useRasterCache = m_ui->m_rasterCacheCheckBox->isChecked();
159 return algoInputParams;
166 return algoOutputParams;
173 int interpolationIdx = m_ui->m_interpolatorTypeComboBox->currentIndex();
176 int blenderIdx = m_ui->m_blenderTypeComboBox->currentIndex();
179 int linkerIdx = m_ui->m_tpmLinkTypeComboBox->currentIndex();
184 algoInputParams.
m_noDataValue = m_ui->m_noDataValueLineEdit->text().isEmpty() ? 0 : m_ui->m_noDataValueLineEdit->text().toDouble();
186 algoInputParams.
m_autoEqualize = m_ui->m_autoEqualizeCheckBox->isChecked();
187 algoInputParams.
m_useRasterCache = m_ui->m_rasterCacheCheckBox->isChecked();
189 algoInputParams.
m_geomTransfName = m_ui->m_smGeomTransformComboBox->currentText().toStdString();
194 return algoInputParams;
201 return algoOutputParams;
208 int interpolationIdx = m_ui->m_interpolatorTypeComboBox->currentIndex();
211 int blenderIdx = m_ui->m_blenderTypeComboBox->currentIndex();
216 algoInputParams.
m_noDataValue = m_ui->m_noDataValueLineEdit->text().isEmpty() ? 0 : m_ui->m_noDataValueLineEdit->text().toDouble();
218 algoInputParams.
m_autoEqualize = m_ui->m_autoEqualizeCheckBox->isChecked();
219 algoInputParams.
m_useRasterCache = m_ui->m_rasterCacheCheckBox->isChecked();
221 algoInputParams.
m_geomTransfName = m_ui->m_smGeomTransformComboBox->currentText().toStdString();
230 return algoInputParams;
237 return algoOutputParams;
242 int aIdx = m_ui->m_tpmLayerAComboBox->currentIndex();
243 QVariant aVarLayer = m_ui->m_tpmLayerAComboBox->itemData(aIdx, Qt::UserRole);
251 int bIdx = m_ui->m_tpmLayerBComboBox->currentIndex();
252 QVariant bVarLayer = m_ui->m_tpmLayerBComboBox->itemData(bIdx, Qt::UserRole);
260 int aIdx = m_ui->m_tpmLayerAComboBox->currentIndex();
261 QVariant aVarLayer = m_ui->m_tpmLayerAComboBox->itemData(aIdx, Qt::UserRole);
264 int bIdx = m_ui->m_tpmLayerBComboBox->currentIndex();
265 QVariant bVarLayer = m_ui->m_tpmLayerBComboBox->itemData(bIdx, Qt::UserRole);
270 dlg.setReferenceLayer(aLayer);
271 dlg.setAdjustLayer(bLayer);
275 std::vector<te::gm::GTParameters::TiePoint> tiePoints;
277 dlg.getWidget()->getTiePointsIdxCoords(tiePoints);
280 m_tiePoints.push_back(tiePoints);
287 m_ui->m_mosaicTypeComboBox->clear();
289 m_ui->m_mosaicTypeComboBox->addItem(tr(
"Geo Mosaic"), MOSAIC_GEO);
290 m_ui->m_mosaicTypeComboBox->addItem(tr(
"Tie Points Mosaic"), MOSAIC_TIEPOINT);
291 m_ui->m_mosaicTypeComboBox->addItem(tr(
"Sequence Mosaic"), MOSAIC_SEQUENCE);
294 m_ui->m_interpolatorTypeComboBox->clear();
301 m_ui->m_blenderTypeComboBox->clear();
308 m_ui->m_tpmLinkTypeComboBox->clear();
314 m_ui->m_tpmLinkTypeComboBox->setEnabled(
false);
317 m_ui->m_tpmGeomTransformComboBox->clear();
318 m_ui->m_smGeomTransformComboBox->clear();
323 while( gtItB != gtItE )
325 m_ui->m_tpmGeomTransformComboBox->addItem(QString(gtItB->first.c_str()));
326 m_ui->m_smGeomTransformComboBox->addItem(QString(gtItB->first.c_str()));
void onTiePointsAcquiredToolButtonClicked()
std::auto_ptr< Ui::MosaicWizardPageForm > m_ui
Mosaic output parameters.
te::rp::TiePointsMosaic::InputParameters getInputTPParams()
te::map::AbstractLayerPtr getTiePointMosaicLayerA()
static dictionary_type & getDictionary()
It returns a reference to the internal dictionary of concrete factories.
Bicubic interpolation method.
std::map< TFACTORYKEY, TFACTORY *, TKEYCOMPARE >::const_iterator const_iterator
te::rp::GeoMosaic::OutputParameters getOutputGeoParams()
te::rp::SequenceMosaic::OutputParameters getOutputSeqParams()
std::map< TFACTORYKEY, TFACTORY *, TKEYCOMPARE >::const_iterator end() const
It returns an iterator to the end of the container.
This file defines a class for a Mosaic Wizard page.
void setList(std::list< te::map::AbstractLayerPtr > &layerList)
te::map::AbstractLayerPtr getTiePointMosaicLayerB()
Method
Allowed interpolation methods.
te::rp::GeoMosaic::InputParameters getInputGeoParams()
std::map< TFACTORYKEY, TFACTORY *, TKEYCOMPARE >::const_iterator begin() const
It returns an iterator to the first stored factory.
GeoMosaic output parameters.
Mosaic output parameters.
Bilinear interpolation method.
Euclidean distance method.
MosaicWizardPage(QWidget *parent=0)
te::rp::TiePointsMosaic::OutputParameters getOutputTPParams()
te::rp::SequenceMosaic::InputParameters getInputSeqParams()
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
Near neighborhood interpolation method.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
Q_DECLARE_METATYPE(te::map::AbstractLayerPtr)