27 #include "../../../common/STLUtils.h"
28 #include "../../../dataaccess/dataset/DataSet.h"
29 #include "../../../dataaccess/utils/Utils.h"
30 #include "../../../geometry/Coord2D.h"
31 #include "../../../geometry/GTFactory.h"
32 #include "../../../maptools/MarkRendererManager.h"
33 #include "../../../geometry/Point.h"
34 #include "../../../raster/Grid.h"
35 #include "../../../raster/Raster.h"
36 #include "../../../se/Fill.h"
37 #include "../../../se/Mark.h"
38 #include "../../../se/Stroke.h"
39 #include "../../../se/Utils.h"
40 #include "../../../srs/Converter.h"
41 #include "../../widgets/canvas/Canvas.h"
42 #include "../../widgets/canvas/MapDisplay.h"
43 #include "../../widgets/srs/SRSManagerDialog.h"
44 #include "../../widgets/Utils.h"
47 #include "ui_RasterNavigatorWidgetForm.h"
48 #include "ui_TiePointLocatorWidgetForm.h"
51 #include <QGridLayout>
52 #include <QMessageBox>
58 #define PATTERN_SIZE 18
63 m_acqType(InvalidAcquisitionT),
91 m_ui(new Ui::TiePointLocatorWidgetForm),
92 m_tiePointHasFirstCoord(false),
93 m_tiePointIdCounter(0)
97 m_ui->m_x1LineEdit->setValidator(
new QDoubleValidator(
this));
98 m_ui->m_y1LineEdit->setValidator(
new QDoubleValidator(
this));
99 m_ui->m_x2LineEdit->setValidator(
new QDoubleValidator(
this));
100 m_ui->m_y2LineEdit->setValidator(
new QDoubleValidator(
this));
102 m_ui->m_resXLineEdit->setValidator(
new QDoubleValidator(
this));
103 m_ui->m_resYLineEdit->setValidator(
new QDoubleValidator(
this));
105 m_ui->m_selectAllToolButton->setIcon(QIcon::fromTheme(
"table-select"));
106 m_ui->m_unselectAllToolButton->setIcon(QIcon::fromTheme(
"table-unselect"));
107 m_ui->m_deleteSelectedToolButton->setIcon(QIcon::fromTheme(
"table-delete-select"));
108 m_ui->m_autoAcquireTiePointsToolButton->setIcon(QIcon::fromTheme(
"wand"));
109 m_ui->m_addToolButton->setIcon(QIcon::fromTheme(
"list-add"));
110 m_ui->m_refreshToolButton->setIcon(QIcon::fromTheme(
"view-refresh"));
111 m_ui->m_doneToolButton->setIcon(QIcon::fromTheme(
"check"));
166 delete m_markSelected;
169 delete m_markUnselected;
184 std::auto_ptr<te::da::DataSet> ds(m_refLayer->getData());
186 std::auto_ptr<te::rst::Raster> inputRst = ds->getRaster(rpos);
188 te::qt::widgets::TiePointData::TPContainerT::const_iterator itB = m_tiePoints.begin();
190 const te::qt::widgets::TiePointData::TPContainerT::const_iterator itE = m_tiePoints.end();
192 tiePoints.reserve( m_tiePoints.size() );
196 converter->setSourceSRID(m_refLayer->getSRID());
197 converter->setTargetSRID(m_ui->m_sridLineEdit->text().toInt());
203 tp.first = itB->second.m_tiePoint.second;
205 te::gm::Coord2D c = inputRst->getGrid()->gridToGeo(itB->second.m_tiePoint.first.x, itB->second.m_tiePoint.first.y);
207 converter->convert(c.
x, c.
y, c.
x, c.
y);
211 tiePoints.push_back(tp);
223 if(m_tiePointHasFirstCoord)
224 coordRef = m_currentTiePoint.first;
226 return m_tiePointHasFirstCoord;
233 m_refNavigator->set(layer);
236 std::auto_ptr<te::da::DataSet> ds = m_refLayer->getData();
241 std::auto_ptr<te::rst::Raster> inputRst = ds->getRaster(rpos);
245 m_ui->m_referenceBand1ComboBox->clear();
247 for(
unsigned band1Idx = 0; band1Idx < inputRst->getNumberOfBands(); ++band1Idx)
248 m_ui->m_referenceBand1ComboBox->addItem(QString::number(band1Idx));
252 strSRID.setNum(m_refLayer->getSRID());
253 m_ui->m_inputSRIDLineEdit->setText(strSRID);
256 strResX.setNum(inputRst->getGrid()->getResolutionX());
257 m_ui->m_inputResXLineEdit->setText(strResX);
260 strResY.setNum(inputRst->getGrid()->getResolutionY());
261 m_ui->m_inputResYLineEdit->setText(strResY);
270 m_adjNavigator->set(layer);
273 std::auto_ptr<te::da::DataSet> ds = m_adjLayer->getData();
278 std::auto_ptr<te::rst::Raster> inputRst = ds->getRaster(rpos);
282 m_ui->m_referenceBand2ComboBox->clear();
284 for(
unsigned band2Idx = 0; band2Idx < inputRst->getNumberOfBands(); ++band2Idx)
285 m_ui->m_referenceBand2ComboBox->addItem(QString::number(band2Idx));
288 strSRID.setNum(m_adjLayer->getSRID());
289 m_ui->m_sridLineEdit->setText(strSRID);
292 strResX.setNum(inputRst->getGrid()->getResolutionX());
293 m_ui->m_resXLineEdit->setText(strResX);
296 strResY.setNum(inputRst->getGrid()->getResolutionY());
297 m_ui->m_resYLineEdit->setText(strResY);
304 srid = m_ui->m_sridLineEdit->text().toInt();
309 resX = m_ui->m_resXLineEdit->text().toDouble();
310 resY = m_ui->m_resYLineEdit->text().toDouble();
315 assert(m_refLayer.get());
318 std::auto_ptr<te::da::DataSet> ds = m_refLayer->getData();
323 std::auto_ptr<te::rst::Raster> inputRst = ds->getRaster(rpos);
327 m_currentTiePoint.first = inputRst->getGrid()->geoToGrid(x, y);
329 m_tiePointHasFirstCoord =
true;
336 assert(m_adjLayer.get());
339 std::auto_ptr<te::da::DataSet> ds = m_adjLayer->getData();
344 std::auto_ptr<te::rst::Raster> inputRst = ds->getRaster(rpos);
348 if(m_tiePointHasFirstCoord)
350 m_currentTiePoint.second = inputRst->getGrid()->geoToGrid(x, y);
352 m_tiePointHasFirstCoord =
false;
359 ++m_tiePointIdCounter;
360 m_tiePoints[ m_tiePointIdCounter ] = tpD;
362 tiePointsTableUpdate();
370 m_ui->m_tiePointLabel->setPixmap(p);
375 m_ui->m_selectedTiePointLabel->setPixmap(p);
380 m_ui->m_refTiePointLabel->setPixmap(p);
385 m_ui->m_tiePointsTableWidget->clearSelection();
387 for(
int i = 0; i < m_ui->m_tiePointsTableWidget->rowCount(); ++i)
389 QTableWidgetItem* item = m_ui->m_tiePointsTableWidget->item(i, 0);
391 int curId = item->text().toInt();
394 if(curId >= initialId)
395 m_ui->m_tiePointsTableWidget->selectRow(i);
402 std::auto_ptr<te::da::DataSet> dsRef(m_refLayer->getData());
404 std::auto_ptr<te::rst::Raster> inputRstRef = dsRef->getRaster(rpos);
406 std::auto_ptr<te::da::DataSet> dsAdj(m_adjLayer->getData());
408 std::auto_ptr<te::rst::Raster> inputRstAdj = dsAdj->getRaster(rpos);
440 inputParams.
m_inRaster1Bands.push_back(m_ui->m_referenceBand1ComboBox->currentText().toUInt());
441 inputParams.
m_inRaster2Bands.push_back(m_ui->m_referenceBand2ComboBox->currentText().toUInt());
443 inputParams.
m_pixelSizeXRelation = inputRstRef->getGrid()->getResolutionX() / m_ui->m_resXLineEdit->text().toDouble();
444 inputParams.
m_pixelSizeYRelation = inputRstRef->getGrid()->getResolutionY() / m_ui->m_resYLineEdit->text().toDouble();
449 unsigned int manualTPNumber = 0;
450 te::qt::widgets::TiePointData::TPContainerT::const_iterator itB = m_tiePoints.begin();
451 const te::qt::widgets::TiePointData::TPContainerT::const_iterator itE = m_tiePoints.end();
452 double coordDiffX = 0;
453 double coordDiffY = 0;
459 coordDiffX = itB->second.m_tiePoint.first.x - itB->second.m_tiePoint.second.x;
460 coordDiffY = itB->second.m_tiePoint.first.y - itB->second.m_tiePoint.second.y;
477 QApplication::setOverrideCursor(Qt::WaitCursor);
485 if(algorithmInstance.
execute(outputParams))
487 const unsigned int tpsNmb = (
unsigned int)outputParams.
m_tiePoints.size();
494 int initialId = m_tiePointIdCounter + 1;
496 for(
unsigned int tpIdx = 0; tpIdx < tpsNmb; ++tpIdx)
498 ++m_tiePointIdCounter;
500 m_tiePoints[ m_tiePointIdCounter ] = auxTpData;
503 tiePointsTableUpdate();
505 createSelection(initialId);
509 QMessageBox::warning(
this, tr(
"Warning"), tr(
"None tie points was located."));
516 QApplication::restoreOverrideCursor();
518 QMessageBox::warning(
this, tr(
"Warning"), tr(
"Error locating tie points."));
521 QApplication::restoreOverrideCursor();
526 m_ui->m_tiePointsTableWidget->selectAll();
531 m_ui->m_tiePointsTableWidget->clearSelection();
536 const int rowCount = m_ui->m_tiePointsTableWidget->rowCount();
538 for(
int row = 0 ; row < rowCount ; ++row )
540 QTableWidgetItem* itemPtr = m_ui->m_tiePointsTableWidget->item(row, 0);
542 if(itemPtr->isSelected())
544 unsigned int tpID = itemPtr->text().toUInt();
546 te::qt::widgets::TiePointData::TPContainerT::iterator deletionIt = m_tiePoints.find(tpID);
548 assert(deletionIt != m_tiePoints.end());
550 m_tiePoints.erase(deletionIt);
554 if(m_tiePoints.empty())
556 m_tiePointIdCounter = 0;
559 m_tiePointsSelected.clear();
561 tiePointsTableUpdate();
566 if((!m_ui->m_x1LineEdit->text().isEmpty()) && (!m_ui->m_y1LineEdit->text().isEmpty()) &&
567 (!m_ui->m_x2LineEdit->text().isEmpty()) && (!m_ui->m_y2LineEdit->text().isEmpty()))
571 tpD.
m_tiePoint.first.x = m_ui->m_x1LineEdit->text().toDouble();
572 tpD.
m_tiePoint.first.y = m_ui->m_y1LineEdit->text().toDouble();
573 tpD.
m_tiePoint.second.x = m_ui->m_x2LineEdit->text().toDouble();
574 tpD.
m_tiePoint.second.y = m_ui->m_y2LineEdit->text().toDouble();
576 ++m_tiePointIdCounter;
577 m_tiePoints[m_tiePointIdCounter] = tpD;
579 tiePointsTableUpdate();
585 transformationInfoUpdate();
590 updateAdvancedOptions();
592 tiePointsTableUpdate();
597 emit doneAcquiredTiePoints();
612 refCoordPicked(x, y);
619 adjCoordPicked(x, y);
632 srsDialog.setWindowTitle(tr(
"Choose the SRS"));
634 if(srsDialog.exec() == QDialog::Accepted)
639 strSRID.setNum(srid.first);
640 m_ui->m_sridLineEdit->setText(strSRID);
649 te::qt::widgets::TiePointData::TPContainerT::const_iterator tPIt = m_tiePoints.begin();
650 const te::qt::widgets::TiePointData::TPContainerT::const_iterator tPItEnd = m_tiePoints.end();
652 while( tPIt != tPItEnd )
654 transParams.
m_tiePoints.push_back(tPIt->second.m_tiePoint);
658 std::string geoTransfName = m_ui->m_geomTransfNameComboBox->currentText().toStdString();
664 if(!transfPtr->initialize(transParams))
669 m_ui->m_tiePointsTableWidget->blockSignals(
true );
670 m_ui->m_tiePointsTableWidget->setSortingEnabled(
false );
672 m_ui->m_tiePointsTableWidget->setRowCount(0);
674 double currTPError = 0;
676 tPIt = m_tiePoints.begin();
678 while( tPIt != tPItEnd )
680 int newrow = m_ui->m_tiePointsTableWidget->rowCount();
681 m_ui->m_tiePointsTableWidget->insertRow(newrow);
684 currTPError = transfPtr.get() ? transfPtr->getDirectMappingError(currTP) : 0.0;
687 QTableWidgetItem* itemId =
new QTableWidgetItem(QString::number(tPIt->first));
688 itemId->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
689 m_ui->m_tiePointsTableWidget->setItem(newrow, 0, itemId);
692 QTableWidgetItem* itemError =
new QTableWidgetItem(QString::number(currTPError));
693 itemError->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
694 m_ui->m_tiePointsTableWidget->setItem(newrow, 1, itemError);
704 type = tr(
"Automatic");
707 QTableWidgetItem* itemType =
new QTableWidgetItem(type);
708 itemType->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
709 m_ui->m_tiePointsTableWidget->setItem(newrow, 2, itemType);
712 QTableWidgetItem* itemRefX =
new QTableWidgetItem(QString::number(currTP.first.x));
713 itemRefX->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
714 m_ui->m_tiePointsTableWidget->setItem(newrow, 3, itemRefX);
717 QTableWidgetItem* itemRefY =
new QTableWidgetItem(QString::number(currTP.first.y));
718 itemRefY->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
719 m_ui->m_tiePointsTableWidget->setItem(newrow, 4, itemRefY);
722 QTableWidgetItem* itemAdjX =
new QTableWidgetItem(QString::number(currTP.second.x));
723 itemAdjX->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
724 m_ui->m_tiePointsTableWidget->setItem(newrow, 5, itemAdjX);
727 QTableWidgetItem* itemAdjY =
new QTableWidgetItem(QString::number(currTP.second.y));
728 itemAdjY->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
729 m_ui->m_tiePointsTableWidget->setItem(newrow, 6, itemAdjY);
732 std::set<int>::iterator it = m_tiePointsSelected.find(tPIt->first);
734 if(it != m_tiePointsSelected.end())
736 m_ui->m_tiePointsTableWidget->selectRow(newrow);
742 m_ui->m_tiePointsTableWidget->setSortingEnabled(
true);
743 m_ui->m_tiePointsTableWidget->blockSignals(
false );
744 m_ui->m_tiePointsTableWidget->resizeColumnsToContents();
746 transformationInfoUpdate();
756 m_tiePointsSelected.clear();
758 const int rowCount = m_ui->m_tiePointsTableWidget->rowCount();
760 for(
int row = 0; row < rowCount; ++row)
762 QTableWidgetItem* itemPtr = m_ui->m_tiePointsTableWidget->item(row, 0);
764 int id = itemPtr->text().toUInt();
766 te::qt::widgets::TiePointData::TPContainerT::iterator it = m_tiePoints.find(
id);
768 assert(it != m_tiePoints.end());
772 if( itemPtr->isSelected() )
774 it->second.m_selected =
true;
776 transParamsSelectedTP.
m_tiePoints.push_back(tiePoint);
778 m_tiePointsSelected.insert(
id);
782 it->second.m_selected =
false;
784 transParamsUnselectedTP.
m_tiePoints.push_back(tiePoint);
791 std::string geoTransfName = m_ui->m_geomTransfNameComboBox->currentText().toStdString();
794 if(transfAllTPPtr.get())
795 if(!transfAllTPPtr->initialize(transParamsAllTP))
796 transfAllTPPtr.reset();
799 if(transfSelectedTPPtr.get())
800 if(!transfSelectedTPPtr->initialize(transParamsSelectedTP))
801 transfSelectedTPPtr.reset();
804 if(transfUnselectedTPPtr.get())
805 if(!transfUnselectedTPPtr->initialize(transParamsUnselectedTP))
806 transfUnselectedTPPtr.reset();
809 m_ui->m_tiePointsNumberLineEdit->setText(QString::number(m_tiePoints.size()));
811 if(transfAllTPPtr.get())
812 m_ui->m_transformationRMSEAllLineEdit->setText(QString::number(transfAllTPPtr->getDirectMapRMSE()));
814 m_ui->m_transformationRMSEAllLineEdit->setText(
"N/A");
816 if(transfSelectedTPPtr.get())
817 m_ui->m_transformationRMSESelectedLineEdit->setText(QString::number(transfSelectedTPPtr->getDirectMapRMSE()));
819 m_ui->m_transformationRMSESelectedLineEdit->setText(
"N/A");
821 if(transfUnselectedTPPtr.get())
822 m_ui->m_transformationRMSEunselectedLineEdit->setText(QString::number(transfUnselectedTPPtr->getDirectMapRMSE()));
824 m_ui->m_transformationRMSEunselectedLineEdit->setText(
"N/A");
827 emit tiePointsUpdated();
832 m_ui->m_enableGeometryFilterCheckBox->setChecked(m_inputParameters.m_enableGeometryFilter);
833 m_ui->m_enableMultiThreadCheckBox->setChecked(m_inputParameters.m_enableMultiThread);
835 switch( m_inputParameters.m_interesPointsLocationStrategy )
839 int idx = m_ui->m_interesPointsLocationStrategyComboBox->findText(
"Surf");
840 m_ui->m_interesPointsLocationStrategyComboBox->setCurrentIndex(idx);
845 int idx = m_ui->m_interesPointsLocationStrategyComboBox->findText(
"Moravec");
846 m_ui->m_interesPointsLocationStrategyComboBox->setCurrentIndex(idx);
853 while( gtItB != gtItE )
855 m_ui->m_geomTransfNameComboBox->addItem(QString(gtItB->first.c_str()));
859 int idx = m_ui->m_geomTransfNameComboBox->findText(m_inputParameters.m_geomTransfName.c_str());
860 m_ui->m_geomTransfNameComboBox->setCurrentIndex(idx);
862 m_ui->m_geometryFilterAssuranceLineEdit->setText(QString::number(m_inputParameters.m_geometryFilterAssurance));
864 m_ui->m_geomTransfMaxErrorLineEdit->setText(QString::number(m_inputParameters.m_geomTransfMaxError));
866 switch(m_inputParameters.m_interpMethod)
870 int idx = m_ui->m_interpMethodComboBox->findText(
"Bilinear");
871 m_ui->m_interpMethodComboBox->setCurrentIndex(idx);
876 int idx = m_ui->m_interpMethodComboBox->findText(
"Bicubic");
877 m_ui->m_interpMethodComboBox->setCurrentIndex(idx);
882 int idx = m_ui->m_interpMethodComboBox->findText(
"NearestNeighbor");
883 m_ui->m_interpMethodComboBox->setCurrentIndex(idx);
887 m_ui->m_maxTiePointsLineEdit->setText(QString::number(m_inputParameters.m_maxTiePoints));
889 m_ui->m_correlationWindowWidthLineEdit->setText(QString::number(m_inputParameters.m_moravecCorrelationWindowWidth));
891 m_ui->m_gaussianFilterIterationsLineEdit->setText(QString::number(m_inputParameters.m_moravecGaussianFilterIterations));
893 m_ui->m_minAbsCorrelationLineEdit->setText(QString::number(m_inputParameters.m_moravecMinAbsCorrelation));
895 m_ui->m_moravecWindowWidthLineEdit->setText(QString::number(m_inputParameters.m_moravecWindowWidth));
897 m_ui->m_maxNormEuclideanDistLineEdit->setText(QString::number(m_inputParameters.m_surfMaxNormEuclideanDist));
899 m_ui->m_octavesNumberLineEdit->setText(QString::number(m_inputParameters.m_surfOctavesNumber));
901 m_ui->m_scalesNumberLineEdit->setText(QString::number(m_inputParameters.m_surfScalesNumber));
906 m_inputParameters.m_enableGeometryFilter = m_ui->m_enableGeometryFilterCheckBox->isChecked();
908 m_inputParameters.m_enableMultiThread = m_ui->m_enableMultiThreadCheckBox->isChecked();
910 if(m_ui->m_interesPointsLocationStrategyComboBox->currentText() ==
"Surf")
915 m_inputParameters.m_geomTransfName = m_ui->m_geomTransfNameComboBox->currentText().toStdString();
917 m_inputParameters.m_geometryFilterAssurance = m_ui->m_geometryFilterAssuranceLineEdit->text().toDouble();
919 m_inputParameters.m_geomTransfMaxError = m_ui->m_geomTransfMaxErrorLineEdit->text().toDouble();
921 if(m_ui->m_interpMethodComboBox->currentText() ==
"Bilinear")
923 else if(m_ui->m_interpMethodComboBox->currentText() ==
"Bicubic")
928 m_inputParameters.m_maxTiePoints = m_ui->m_maxTiePointsLineEdit->text().toUInt();
930 m_inputParameters.m_moravecCorrelationWindowWidth = m_ui->m_correlationWindowWidthLineEdit->text().toUInt();
932 m_inputParameters.m_moravecGaussianFilterIterations = m_ui->m_gaussianFilterIterationsLineEdit->text().toUInt();
934 m_inputParameters.m_moravecMinAbsCorrelation = m_ui->m_minAbsCorrelationLineEdit->text().toDouble();
936 m_inputParameters.m_moravecWindowWidth = m_ui->m_moravecWindowWidthLineEdit->text().toUInt();
938 m_inputParameters.m_surfMaxNormEuclideanDist = m_ui->m_maxNormEuclideanDistLineEdit->text().toDouble();
940 m_inputParameters.m_surfOctavesNumber = m_ui->m_octavesNumberLineEdit->text().toUInt();
942 m_inputParameters.m_surfScalesNumber = m_ui->m_scalesNumberLineEdit->text().toUInt();
948 QGridLayout* layoutRef =
new QGridLayout(m_ui->m_refWidget);
951 m_refNavigator->setWindowTitle(tr(
"Reference"));
952 m_refNavigator->setMinimumSize(550, 400);
953 m_refNavigator->hideGeomTool(
true);
954 m_refNavigator->hideInfoTool(
true);
956 layoutRef->addWidget(m_refNavigator);
957 layoutRef->setContentsMargins(0,0,0,0);
959 connect(m_refNavigator, SIGNAL(mapDisplayExtentChanged()),
this, SLOT(onRefMapDisplayExtentChanged()));
964 QGridLayout* layoutAdj =
new QGridLayout(m_ui->m_adjWidget);
967 m_adjNavigator->setWindowTitle(tr(
"Adjust"));
968 m_adjNavigator->setMinimumSize(550, 400);
969 m_adjNavigator->hideGeomTool(
true);
970 m_adjNavigator->hideInfoTool(
true);
972 layoutAdj->addWidget(m_adjNavigator);
973 layoutAdj->setContentsMargins(0,0,0,0);
975 connect(m_adjNavigator, SIGNAL(mapDisplayExtentChanged()),
this, SLOT(onAdjMapDisplayExtentChanged()));
996 if(!m_refLayer.get())
998 std::auto_ptr<te::da::DataSet> dsRef = m_refLayer->getData();
1002 std::auto_ptr<te::rst::Raster> rstRef = dsRef->getRaster(rpos);
1006 if(!m_adjLayer.get())
1008 std::auto_ptr<te::da::DataSet> dsAdj = m_adjLayer->getData();
1012 std::auto_ptr<te::rst::Raster> rstAdj = dsAdj->getRaster(rpos);
1019 te::qt::widgets::TiePointData::TPContainerT::const_iterator it = tpc.begin();
1021 while(it != tpc.end())
1045 rstRef->getGrid()->gridToGeo(refCoord.
x, refCoord.
y, refGeoCoord.
x, refGeoCoord.
y );
1048 refCanvasInstance.draw(&refPoint);
1051 QMatrix matrix = refCanvasInstance.getMatrix();
1052 QPointF pointCanvas = matrix.map(QPointF(refGeoCoord.
x, refGeoCoord.
y));
1053 pointCanvas.setX(pointCanvas.x() + 8);
1054 QPointF pointGeo = matrix.inverted().map(pointCanvas);
1055 refPoint.
setX(pointGeo.x());
1056 refPoint.
setY(pointGeo.y());
1057 refCanvasInstance.drawText(&refPoint, QString::number(
id).toStdString());
1062 rstAdj->getGrid()->gridToGeo(adjCoord.
x, adjCoord.
y, adjGeoCoord.
x, adjGeoCoord.
y );
1065 adjCanvasInstance.draw(&adjPoint);
1068 matrix = adjCanvasInstance.getMatrix();
1069 pointCanvas = matrix.map(QPointF(adjGeoCoord.
x, adjGeoCoord.
y));
1070 pointCanvas.setX(pointCanvas.x() + 8);
1071 pointGeo = matrix.inverted().map(pointCanvas);
1072 adjPoint.
setX(pointGeo.x());
1073 adjPoint.
setY(pointGeo.y());
1074 adjCanvasInstance.drawText(&adjPoint, QString::number(
id).toStdString());
1081 if(getReferenceTiePointCoord(refCoord))
1087 rstRef->getGrid()->gridToGeo(refCoord.
x, refCoord.
y, refGeoCoord.
x, refGeoCoord.
y );
1090 refCanvasInstance.draw(&refPoint);
1093 refDisplay->repaint();
1094 adjDisplay->repaint();
1101 QPixmap p = QPixmap::fromImage(*img);
void getOutputResolution(double &resX, double &resY)
std::map< unsigned int, TiePointData > TPContainerT
Tie-pints container type definition.
void onRefPointPicked(double x, double y, te::qt::widgets::MapDisplay *map)
TESEEXPORT Fill * CreateFill(const std::string &color, const std::string &opacity)
Creates a fill.
te::color::RGBAColor ** m_rgbaMarkRef
Represents the pattern of reference tie point.
void setX(const double &x)
It sets the Point x-coordinate value.
void onAutoAcquireTiePointsToolButtonClicked()
bool m_enableProgress
Enable/Disable the progress interface (default:false).
void transformationInfoUpdate()
Uptate the current transformation information widgets.
std::vector< te::gm::GTParameters::TiePoint > m_tiePoints
The generated tie-pionts (te::gm::GTParameters::TiePoint::first are raster 1 line/column indexes...
A Fill specifies the pattern for filling an area geometry.
void onDeleteSelectedToolButtonClicked()
This file has the RasterNavigatorWidget class.
void setReferenceLayer(te::map::AbstractLayerPtr layer)
This method is used to set the selected layer used to be the reference layer.
void startAdvancedOptions()
Fill interface widget with initial values.
void onAdjMapDisplayExtentChanged()
unsigned int getNumberOfRows() const
Returns the raster number of rows.
void onDoneToolButtonClicked()
unsigned int m_raster2TargetAreaWidth
The raster 2 target area width (default:0 - The entire raster will be considered).
void setY(const double &y)
It sets the Point y-coordinate value.
QPixmap getPixmap(te::color::RGBAColor **rgba)
Grid * getGrid()
It returns the raster grid.
std::vector< unsigned int > m_inRaster1Bands
Bands to be used from the input raster 1.
void setAdjustLayer(te::map::AbstractLayerPtr layer)
This method is used to set the selected layer used to be the adjust layer.
void refCoordPicked(double x, double y)
A Stroke specifies the appearance of a linear geometry.
unsigned int m_raster2TargetAreaColStart
The first column of the raster 2 target area to process (default:0 - The entire raster will be consid...
const te::qt::widgets::TiePointData::TPContainerT & getTiePointContainer()
Get tie point data container.
void tiePointsTableUpdate()
Uptate the tie-points table widget.
te::se::Mark * m_markRef
Represents the mark of a reference tie point.
te::se::Mark * m_markUnselected
Represents the mark of a unselected tie point.
void onUnselectAllToolButtonClicked()
void updateAdvancedOptions()
Update tie point values with advanced options changed values.
TiePointAcquisitionType m_acqType
Acquisition type.
TESEEXPORT Mark * CreateMark(const std::string &wellKnownName, Stroke *stroke, Fill *fill)
Creates a mark.
This file has the TiePointLocatorWidget class.
te::se::Mark * m_markSelected
Represents the mark of a selected tie point.
This class is used to navigate over a DataSetLayer (having a raster representation) and given a set o...
void getOutputSRID(int &srid)
static GeometricTransformation * make(const std::string &factoryKey)
It creates an object with the appropriated factory.
bool getReferenceTiePointCoord(te::gm::Coord2D &coordRef)
Get tie point reference coord that does not have an adjust coordenate.
An utility struct for representing 2D coordinates.
bool execute(AlgorithmOutputParameters &outputParams)
Executes the algorithm using the supplied parameters.
#define TE_TRANSPARENT
For an RGBA color this is the value of the alpha-channel for totally transparent. ...
te::color::RGBAColor ** m_rgbaMarkUnselected
Represents the pattern of a unselected tie point.
void onRefMapDisplayExtentChanged()
bool m_selected
Tie point selection status;.
TiePointLocatorWidget(QWidget *parent=0, Qt::WindowFlags f=0)
double m_pixelSizeXRelation
The pixel resolution relation m_pixelSizeXRelation = raster1_pixel_res_x / raster2_pixel_res_x (defau...
A dialog used to build a SRSManagerDialog element.
std::vector< TiePoint > m_tiePoints
Tie points.
void getTiePoints(std::vector< te::gm::GTParameters::TiePoint > &tiePoints) const
Get the current acquired tie-points.
void setTiePointMarkLegend(QPixmap p)
TiePointsLocator input parameters.
TESEEXPORT Stroke * CreateStroke(const std::string &color, const std::string &width)
Creates a stroke.
double m_lly
Lower left corner y-coordinate.
void adjCoordPicked(double x, double y)
virtual QPixmap * getDraftPixmap() const
It returns the map display draft pixmap.
void onAdjPointPicked(double x, double y, te::qt::widgets::MapDisplay *map)
void onSRIDPushButtonClicked()
double m_ury
Upper right corner y-coordinate.
unsigned int m_maxR1ToR2Offset
The maximum offset (pixels units) between a raster 1 point end the respective raster 2 point (default...
void onAddToolButtonClicked()
Ui::TiePointLocatorWidgetForm * getForm() const
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
A canvas built on top of Qt.
unsigned int m_raster2TargetAreaLineStart
The first line of the raster 2 target area to process (default:0 - The entire raster will be consider...
A point with x and y coordinate values.
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
unsigned int m_raster1TargetAreaLineStart
The first line of the raster 1 target area to process (default:0 - The entire raster will be consider...
void onSelectAllToolButtonClicked()
Bilinear interpolation method.
const std::pair< int, std::string > & getSelectedSRS() const
Returns the selected SRS in the window.
double m_urx
Upper right corner x-coordinate.
unsigned int m_raster2TargetAreaHeight
The raster 2 target area height (default:0 - The entire raster will be considered).
static dictionary_type & getDictionary()
It returns a reference to the internal dictionary of concrete factories.
A widget to control the display of a set of layers.
unsigned int getNumberOfColumns() const
Returns the raster number of columns.
Bicubic interpolation method.
std::vector< unsigned int > m_inRaster2Bands
Bands to be used from the input raster 2.
void Free(std::vector< T * > *v)
This function can be applied to a pointer to a vector of pointers.
Automatic acquisition type.
A Converter is responsible for the conversion of coordinates between different Coordinate Systems (CS...
bool initialize(const AlgorithmInputParameters &inputParams)
Initialize the algorithm instance making it ready for execution.
double m_pixelSizeYRelation
The pixel resolution relation m_pixelSizeYRelation = raster1_pixel_res_y / raster2_pixel_res_y (defau...
const TiePointData & operator=(const TiePointData &other)
te::color::RGBAColor ** m_rgbaMarkSelected
Represents the pattern of a selected tie point.
void onTiePointsTableWidgetItemSelectionChanged()
double m_llx
Lower left corner x-coordinate.
unsigned int m_raster1TargetAreaColStart
The first column of the raster 2 target area to process (default:0 - The entire raster will be consid...
void setReferenceTiePointMarkLegend(QPixmap p)
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
std::auto_ptr< Ui::TiePointLocatorWidgetForm > m_ui
std::map< TFACTORYKEY, TFACTORY *, TKEYCOMPARE >::const_iterator const_iterator
unsigned int m_raster1TargetAreaWidth
The raster 1 target area width (default:0 - The entire raster will be considered).
2D Geometric transformation parameters.
static MarkRendererManager & getInstance()
It returns a reference to the singleton instance.
std::pair< Coord2D, Coord2D > TiePoint
Tie point type definition.
te::gm::GTParameters::TiePoint m_tiePoint
Tie point coordinates.
te::rst::Raster const * m_inRaster1Ptr
Input raster 1.
virtual const te::gm::Envelope & getExtent() const
It returns the world extent showned by the MapDisplay.
An Envelope defines a 2D rectangular region.
void onTiePointsUpdated()
void setWindow(const double &llx, const double &lly, const double &urx, const double &ury)
It sets the world (or window) coordinates area (supposing a cartesian reference system).
Near neighborhood interpolation method.
std::map< TFACTORYKEY, TFACTORY *, TKEYCOMPARE >::const_iterator end() const
It returns an iterator to the end of the container.
void geoToGrid(const double &x, const double &y, double &col, double &row) const
Get the grid point associated to a spatial location.
unsigned int m_raster1TargetAreaHeight
The raster 1 target area height (default:0 - The entire raster will be considered).
void createSelection(int initialId)
te::rst::Raster const * m_inRaster2Ptr
Input raster 2.
void onRefreshToolButtonClicked()
void setSelectedTiePointMarkLegend(QPixmap p)
std::map< TFACTORYKEY, TFACTORY *, TKEYCOMPARE >::const_iterator begin() const
It returns an iterator to the first stored factory.
TiePointsLocator output parameters.
TEQTWIDGETSEXPORT QImage * GetImage(te::color::RGBAColor **img, int width, int height)
It creates a QImage from an RGBA color array.