27 #include "../../../common/progress/ProgressManager.h" 28 #include "../../../dataaccess/dataset/DataSet.h" 29 #include "../../../dataaccess/utils/Utils.h" 30 #include "../../../raster/Grid.h" 31 #include "../../../raster/Raster.h" 32 #include "../../../rp/Register.h" 33 #include "../../../rp/Module.h" 34 #include "../../../maptools/Utils.h" 35 #include "../help/HelpPushButton.h" 36 #include "../layer/search/LayerSearchWidget.h" 37 #include "../layer/search/LayerSearchWizardPage.h" 38 #include "../progress/ProgressViewerDialog.h" 39 #include "../raster/RasterInfoWidget.h" 52 #include <QApplication> 53 #include <QMessageBox> 60 this->setWizardStyle(QWizard::ModernStyle);
61 this->setWindowTitle(tr(
"Register"));
64 this->setOption(QWizard::HaveHelpButton,
true);
65 this->setOption(QWizard::HelpButtonOnRight,
false);
69 this->setButton(QWizard::HelpButton, helpButton);
73 connect(
this, SIGNAL(currentIdChanged(
int)), SLOT(
onPageChanged(
int)));
84 std::list<te::map::AbstractLayerPtr> list =
m_layerAdjPage->getSearchWidget()->getSelecteds();
86 if(list.empty() ==
false)
97 std::list<te::map::AbstractLayerPtr> list =
m_layerRefPage->getSearchWidget()->getSelecteds();
99 if(list.empty() ==
false)
112 std::vector< te::gm::GTParameters::TiePoint > tiePoints;
116 if(tiePoints.empty())
118 QMessageBox::warning(
this, tr(
"Register"), tr(
"Tie Points not aquired."));
154 m_layerAdjPage->setSubTitle(tr(
"Allows selection of layers using filters for selection. Select the layer to be used as ADJUST."));
156 m_layerRefPage->setSubTitle(tr(
"Allows selection of layers using filters for selection. Select the layer to be used as REFERENCE."));
165 QMessageBox::warning(
this, tr(
"Register"), tr(
"File already exists."));
170 std::unique_ptr<te::da::DataSet>
ds(
m_adjLayer->getData());
172 std::unique_ptr<te::rst::Raster> inputRst =
ds->getRaster(rpos);
174 std::vector<unsigned int> vec;
175 for(
size_t t = 0; t < inputRst->getNumberOfBands(); ++t)
177 vec.push_back((
unsigned int)t);
180 std::vector< te::gm::GTParameters::TiePoint > tiePoints;
210 QApplication::setOverrideCursor(Qt::WaitCursor);
216 if(!algorithmInstance.
initialize(algoInputParams))
218 QApplication::restoreOverrideCursor();
219 QMessageBox::warning(
this, tr(
"Register"), tr(
"Algorithm initialization error.") +
225 if(!algorithmInstance.
execute(algoOutputParams))
227 QApplication::restoreOverrideCursor();
228 QMessageBox::warning(
this, tr(
"Register"), tr(
"Register Error.") +
235 QApplication::restoreOverrideCursor();
236 QMessageBox::warning(
this, tr(
"Register"), tr(
"Register Done!"));
238 algoOutputParams.
reset();
245 catch(
const std::exception& e)
247 QApplication::restoreOverrideCursor();
248 QMessageBox::warning(
this, tr(
"Register"), e.what());
254 QApplication::restoreOverrideCursor();
255 QMessageBox::warning(
this, tr(
"Register"), tr(
"An exception has occurred!"));
bool execute(AlgorithmOutputParameters &outputParams)
Executes the algorithm using the supplied parameters.
This file defines the RegisterWizard class.
static te::dt::Date ds(2010, 01, 01)
static const std::string getLastLogStr()
Returns the last log string generated by this module.
This file defines a class for a Raster Info Wizard page.
bool initialize(const AlgorithmInputParameters &inputParams)
Initialize the algorithm instance making it ready for execution.
This class is GUI used to define the raster info parameters for raster factory.
std::map< std::string, std::string > m_rInfo
The necessary information to create the output rasters (as described in te::raster::RasterFactory).
Utility functions for the data access module.
TEMAPEXPORT te::rst::Raster * GetRaster(AbstractLayer *layer)
It gets the raster referenced by the given data set layer.
Performs raster data registering into a SRS using a set of tie points.
Register output parameters.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state...