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" 36 #include "ui_MosaicWizardPageForm.h" 39 #include <QApplication> 40 #include <QGridLayout> 41 #include <QMessageBox> 48 te::qt::widgets::MosaicWizardPage::MosaicWizardPage(
QWidget* parent)
50 m_ui(new
Ui::MosaicWizardPageForm)
58 this->setTitle(tr(
"Mosaic"));
59 this->setSubTitle(tr(
"Select the type of mosaic and set their specific parameters."));
61 m_ui->m_noDataValueLineEdit->setValidator(
new QDoubleValidator(
this));
63 m_ui->m_tpmAcquireToolButton->setIcon(QIcon::fromTheme(
"wand"));
66 QGridLayout* layout =
new QGridLayout(m_ui->m_tplpWidget);
68 m_tiePointParameters->setMosaicLayout();
69 layout->setContentsMargins(0, 0, 0, 0);
70 layout->addWidget(m_tiePointParameters);
73 connect(m_ui->m_tpmAcquireToolButton, SIGNAL(clicked()),
this, SLOT(onTiePointsAcquiredToolButtonClicked()));
88 int idx =
m_ui->m_mosaicTypeComboBox->currentIndex();
90 int type =
m_ui->m_mosaicTypeComboBox->itemData(idx).toInt();
97 int idx =
m_ui->m_mosaicTypeComboBox->currentIndex();
99 int type =
m_ui->m_mosaicTypeComboBox->itemData(idx).toInt();
106 int idx =
m_ui->m_mosaicTypeComboBox->currentIndex();
108 int type =
m_ui->m_mosaicTypeComboBox->itemData(idx).toInt();
118 m_ui->m_tpmLayerAComboBox->clear();
119 m_ui->m_tpmLayerBComboBox->clear();
121 std::list<te::map::AbstractLayerPtr>::iterator it =
m_layerList.begin();
122 std::vector<std::size_t>
bands;
128 std::unique_ptr<te::da::DataSet>
ds = l->getData();
130 std::unique_ptr<te::rst::Raster>
rst = ds->getRaster(rpos);
133 bands.push_back(rst->getNumberOfBands());
135 m_ui->m_tpmLayerAComboBox->addItem(l->getTitle().c_str(), QVariant::fromValue(l));
136 m_ui->m_tpmLayerBComboBox->addItem(l->getTitle().c_str(), QVariant::fromValue(l));
142 std::vector<std::size_t>::iterator itBand = std::min_element(bands.begin(), bands.end());
144 for(std::size_t t = 0; t < *itBand; ++t)
146 m_ui->m_smRefBandComboBox->addItem(QString::number(t));
152 int interpolationIdx =
m_ui->m_interpolatorTypeComboBox->currentIndex();
155 int blenderIdx =
m_ui->m_blenderTypeComboBox->currentIndex();
162 algoInputParams.
m_noDataValue =
m_ui->m_noDataValueLineEdit->text().isEmpty() ? 0 :
m_ui->m_noDataValueLineEdit->text().toDouble();
167 return algoInputParams;
174 return algoOutputParams;
181 int interpolationIdx =
m_ui->m_interpolatorTypeComboBox->currentIndex();
184 int blenderIdx =
m_ui->m_blenderTypeComboBox->currentIndex();
187 int linkerIdx =
m_ui->m_tpmLinkTypeComboBox->currentIndex();
192 algoInputParams.
m_noDataValue =
m_ui->m_noDataValueLineEdit->text().isEmpty() ? 0 :
m_ui->m_noDataValueLineEdit->text().toDouble();
197 algoInputParams.
m_geomTransfName =
m_ui->m_smGeomTransformComboBox->currentText().toUtf8().data();
202 return algoInputParams;
209 return algoOutputParams;
216 int interpolationIdx =
m_ui->m_interpolatorTypeComboBox->currentIndex();
219 int blenderIdx =
m_ui->m_blenderTypeComboBox->currentIndex();
224 algoInputParams.
m_noDataValue =
m_ui->m_noDataValueLineEdit->text().isEmpty() ? 0 :
m_ui->m_noDataValueLineEdit->text().toDouble();
229 algoInputParams.
m_geomTransfName =
m_ui->m_smGeomTransformComboBox->currentText().toUtf8().data();
238 return algoInputParams;
245 return algoOutputParams;
250 int aIdx =
m_ui->m_tpmLayerAComboBox->currentIndex();
251 QVariant aVarLayer =
m_ui->m_tpmLayerAComboBox->itemData(aIdx, Qt::UserRole);
259 int bIdx =
m_ui->m_tpmLayerBComboBox->currentIndex();
260 QVariant bVarLayer =
m_ui->m_tpmLayerBComboBox->itemData(bIdx, Qt::UserRole);
268 int aIdx =
m_ui->m_tpmLayerAComboBox->currentIndex();
269 QVariant aVarLayer =
m_ui->m_tpmLayerAComboBox->itemData(aIdx, Qt::UserRole);
272 int bIdx =
m_ui->m_tpmLayerBComboBox->currentIndex();
273 QVariant bVarLayer =
m_ui->m_tpmLayerBComboBox->itemData(bIdx, Qt::UserRole);
278 dlg.setReferenceLayer(aLayer);
279 dlg.setAdjustLayer(bLayer);
283 std::vector<te::gm::GTParameters::TiePoint> tiePoints;
285 dlg.getWidget()->getTiePointsIdxCoords(tiePoints);
295 m_ui->m_mosaicTypeComboBox->clear();
297 m_ui->m_mosaicTypeComboBox->addItem(tr(
"Geo Mosaic"),
MOSAIC_GEO);
302 m_ui->m_interpolatorTypeComboBox->clear();
309 m_ui->m_blenderTypeComboBox->clear();
317 m_ui->m_tpmLinkTypeComboBox->clear();
323 m_ui->m_tpmLinkTypeComboBox->setEnabled(
false);
326 m_ui->m_tpmGeomTransformComboBox->clear();
327 m_ui->m_smGeomTransformComboBox->clear();
332 while( gtItB != gtItE )
334 m_ui->m_tpmGeomTransformComboBox->addItem(QString(gtItB->first.c_str()));
335 m_ui->m_smGeomTransformComboBox->addItem(QString(gtItB->first.c_str()));
void onTiePointsAcquiredToolButtonClicked()
Near neighborhood interpolation method.
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.
static te::dt::Date ds(2010, 01, 01)
InterpolationMethod
Allowed interpolation methods.
InterpolationMethod Method
Allowed interpolation methods.
std::list< te::map::AbstractLayerPtr > m_layerList
Q_DECLARE_METATYPE(te::map::AbstractLayerPtr) te
std::map< TFACTORYKEY, TFACTORY *, TKEYCOMPARE >::const_iterator const_iterator
te::qt::widgets::TiePointLocatorParametersWidget * m_tiePointParameters
Tie Point parameters widget.
Pixels will be summed inside the raster overlapped area.
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.
Bicubic interpolation method.
void setList(std::list< te::map::AbstractLayerPtr > &layerList)
te::map::AbstractLayerPtr getTiePointMosaicLayerB()
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.
Euclidean distance method.
Bilinear interpolation method.
te::rp::TiePointsMosaic::OutputParameters getOutputTPParams()
te::rp::SequenceMosaic::InputParameters getInputSeqParams()
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
std::unique_ptr< Ui::MosaicWizardPageForm > m_ui
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
std::vector< std::vector< te::gm::GTParameters::TiePoint > > m_tiePoints
Tie-points between each adjacent raster pair (te::gm::GTParameters::TiePoint::first are raster (with ...