27 #include "../../../common/progress/ProgressManager.h" 28 #include "../../../dataaccess/dataset/DataSet.h" 29 #include "../../../dataaccess/utils/Utils.h" 30 #include "../../../raster/Raster.h" 31 #include "../../../rp/Segmenter.h" 32 #include "../../../rp/SegmenterRegionGrowingBaatzStrategy.h" 33 #include "../../../rp/SegmenterRegionGrowingMeanStrategy.h" 34 #include "../../../rp/Module.h" 35 #include "../../../maptools/Utils.h" 36 #include "../help/HelpPushButton.h" 37 #include "../layer/search/LayerSearchWidget.h" 38 #include "../layer/search/LayerSearchWizardPage.h" 39 #include "../progress/ProgressViewerDialog.h" 43 #include "../raster/RasterInfoWidget.h" 45 #include "ui_SegmenterAdvancedOptionsWizardPageForm.h" 52 #include <QMessageBox> 57 #include <boost/timer.hpp> 58 #include <boost/format.hpp> 65 this->setWizardStyle(QWizard::ModernStyle);
66 this->setWindowTitle(tr(
"Segmenter"));
69 this->setOption(QWizard::HaveHelpButton,
true);
70 this->setOption(QWizard::HelpButtonOnRight,
false);
74 this->setButton(QWizard::HelpButton, helpButton);
78 connect(
this, SIGNAL(currentIdChanged(
int)), SLOT(
onPageChanged(
int)));
89 std::list<te::map::AbstractLayerPtr> list =
m_layerSearchPage->getSearchWidget()->getSelecteds();
91 if(list.empty() ==
false)
105 QMessageBox::warning(
this, tr(
"Warning"), tr(
"Select at least one band."));
113 QMessageBox::warning(
this, tr(
"Warning"), tr(
"Invalid file name"));
119 QMessageBox::warning(
this, tr(
"Warning"), tr(
"The output raster file already exists"));
167 QMessageBox::warning(
this, tr(
"Segmenter"), tr(
"File already exists."));
173 std::unique_ptr<te::da::DataSet>
ds(l->getData());
194 QApplication::setOverrideCursor(Qt::WaitCursor);
198 if(algorithmInstance.initialize(algoInputParams))
202 if(algorithmInstance.execute(algoOutputParams))
204 algoOutputParams.
reset();
209 std::string elapsedTimeStr = boost::str( boost::format(
"%.2f" ) % timer.elapsed() );
210 QApplication::restoreOverrideCursor();
211 QMessageBox::information(
this, tr(
"Segmenter"), tr(
"Segmenter ended sucessfully") + (
" (" + elapsedTimeStr +
" " ).c_str() + tr(
"seconds") +
")" );
223 QFileInfo info(
file);
233 catch(
const std::exception& e)
235 QApplication::restoreOverrideCursor();
236 QMessageBox::warning(
this, tr(
"Segmenter"), tr(e.what()));
242 QApplication::restoreOverrideCursor();
243 QMessageBox::critical(
this, tr(
"Segmenter"), tr(
"Segmenter initialization error") +
244 (
" " + algorithmInstance.getErrorMessage() ).c_str());
251 QApplication::restoreOverrideCursor();
252 QMessageBox::critical(
this, tr(
"Segmenter"), tr(
"Segmenter initialization error") +
253 (
" " + algorithmInstance.getErrorMessage() ).c_str());
259 catch(
const std::exception& e)
261 QApplication::restoreOverrideCursor();
262 QMessageBox::warning(
this, tr(
"Segmenter"), e.what());
268 QApplication::restoreOverrideCursor();
269 QMessageBox::warning(
this, tr(
"Segmenter"), tr(
"An exception has occurred!"));
274 QApplication::restoreOverrideCursor();
Segmenter Output Parameters.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
static te::dt::Date ds(2010, 01, 01)
This file defines a class for a Segmenter Advanced Options Wizard page.
This file defines a class for a Raster Info Wizard page.
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state...
This class is GUI used to define the segmenter advanced options parameters for the RP constast operat...
This class is GUI used to define the segmenter parameters for the RP constast operation.
This class is GUI used to define the raster info parameters for raster factory.
Utility functions for the data access module.
A Qt dialog that allows users to run a segmenter operation defined by RP module.
TEMAPEXPORT te::rst::Raster * GetRaster(AbstractLayer *layer)
It gets the raster referenced by the given data set layer.
std::map< std::string, std::string > m_rInfo
The necessary information to create the raster (as described in te::raster::RasterFactory).
This file defines a class for a Segmenter Wizard page.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
file(WRITE ${CMAKE_BINARY_DIR}/config_qhelp.cmake"configure_file (${TERRALIB_ABSOLUTE_ROOT_DIR}/doc/qhelp/help.qhcp.in ${CMAKE_BINARY_DIR}/share/terraview/help/help.qhcp @ONLY)") add_custom_command(OUTPUT del_dir COMMAND $