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>
49 : QWizardPage(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);
69 layout->setContentsMargins(0, 0, 0, 0);
88 int idx = m_ui->m_mosaicTypeComboBox->currentIndex();
90 int type = m_ui->m_mosaicTypeComboBox->itemData(idx).toInt();
92 return (type == MOSAIC_GEO);
97 int idx = m_ui->m_mosaicTypeComboBox->currentIndex();
99 int type = m_ui->m_mosaicTypeComboBox->itemData(idx).toInt();
101 return (type == MOSAIC_TIEPOINT);
106 int idx = m_ui->m_mosaicTypeComboBox->currentIndex();
108 int type = m_ui->m_mosaicTypeComboBox->itemData(idx).toInt();
110 return (type == MOSAIC_SEQUENCE);
115 m_layerList = layerList;
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;
124 while(it != m_layerList.end())
128 std::auto_ptr<te::da::DataSet> ds = l->getData();
130 std::auto_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();
164 algoInputParams.
m_autoEqualize = m_ui->m_autoEqualizeCheckBox->isChecked();
165 algoInputParams.
m_useRasterCache = m_ui->m_rasterCacheCheckBox->isChecked();
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();
194 algoInputParams.
m_autoEqualize = m_ui->m_autoEqualizeCheckBox->isChecked();
195 algoInputParams.
m_useRasterCache = m_ui->m_rasterCacheCheckBox->isChecked();
197 algoInputParams.
m_geomTransfName = m_ui->m_smGeomTransformComboBox->currentText().toStdString();
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();
226 algoInputParams.
m_autoEqualize = m_ui->m_autoEqualizeCheckBox->isChecked();
227 algoInputParams.
m_useRasterCache = m_ui->m_rasterCacheCheckBox->isChecked();
229 algoInputParams.
m_geomTransfName = m_ui->m_smGeomTransformComboBox->currentText().toStdString();
236 algoInputParams.
m_locatorParams = m_tiePointParameters->getTiePointInputParameters();
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);
288 m_tiePoints.push_back(tiePoints);
295 m_ui->m_mosaicTypeComboBox->clear();
297 m_ui->m_mosaicTypeComboBox->addItem(tr(
"Geo Mosaic"), MOSAIC_GEO);
298 m_ui->m_mosaicTypeComboBox->addItem(tr(
"Tie Points Mosaic"), MOSAIC_TIEPOINT);
299 m_ui->m_mosaicTypeComboBox->addItem(tr(
"Sequence Mosaic"), MOSAIC_SEQUENCE);
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.
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.
InterpolationMethod
Allowed interpolation methods.
InterpolationMethod Method
Allowed interpolation methods.
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.
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)
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
Q_DECLARE_METATYPE(te::map::AbstractLayerPtr)