27 #include "../../../dataaccess/dataset/DataSet.h"
28 #include "../../../dataaccess/utils/Utils.h"
29 #include "../../../raster/Raster.h"
30 #include "../../../rp/Contrast.h"
31 #include "../../../rp/Module.h"
32 #include "../../widgets/help/HelpPushButton.h"
45 #include <QtGui/QApplication>
46 #include <QtGui/QMessageBox>
53 this->setWizardStyle(QWizard::ModernStyle);
54 this->setWindowTitle(tr(
"Contrast"));
57 this->setOption(QWizard::HaveHelpButton,
true);
58 this->setOption(QWizard::HelpButtonOnRight,
false);
62 this->setButton(QWizard::HelpButton, helpButton);
76 if(currentPage() == m_layerSearchPage.get())
78 std::list<te::map::AbstractLayerPtr> list = m_layerSearchPage->getSearchWidget()->getSelecteds();
80 if(list.empty() ==
false)
84 m_contrastPage->set(l);
87 return m_layerSearchPage->isComplete();
89 else if(currentPage() == m_contrastPage.get())
91 bool res = m_contrastPage->isComplete();
94 QMessageBox::warning(
this, tr(
"Warning"), tr(
"Select at least one band."));
98 else if(currentPage() == m_rasterInfoPage.get())
108 m_layerSearchPage->getSearchWidget()->setList(layerList);
109 m_layerSearchPage->getSearchWidget()->filterOnlyByRaster();
114 removePage(m_layerSearchId);
116 m_contrastPage->set(layer);
121 return m_outputLayer;
130 m_layerSearchId = addPage(m_layerSearchPage.get());
131 addPage(m_contrastPage.get());
132 addPage(m_rasterInfoPage.get());
135 m_layerSearchPage->getSearchWidget()->enableMultiSelection(
false);
140 if(m_rasterInfoPage->getWidget()->fileExists())
142 QMessageBox::warning(
this, tr(
"Contrast"), tr(
"File already exists."));
148 std::auto_ptr<te::da::DataSet> ds = l->getData();
152 std::auto_ptr<te::rst::Raster> inputRst = ds->getRaster(rpos);
166 QApplication::setOverrideCursor(Qt::WaitCursor);
168 if(algorithmInstance.
initialize(algoInputParams))
170 if(algorithmInstance.
execute(algoOutputParams))
172 algoOutputParams.
reset();
176 m_rasterInfoPage->getWidget()->getInfo());
178 QMessageBox::information(
this, tr(
"Contrast"), tr(
"Contrast enhencement ended sucessfully"));
182 QMessageBox::critical(
this, tr(
"Contrast"), tr(
"Contrast enhencement execution error.") +
185 QApplication::restoreOverrideCursor();
192 QMessageBox::critical(
this, tr(
"Contrast"), tr(
"Contrast enhencement initialization error.") +
195 QApplication::restoreOverrideCursor();
200 QApplication::restoreOverrideCursor();
std::vector< unsigned int > m_outRasterBands
Bands to be processed from the output raster.
This class is GUI used to define the contrast parameters for the RP constast operation.
bool execute(AlgorithmOutputParameters &outputParams)
Executes the algorithm using the supplied parameters.
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.
This file has the RasterInfoWidget class.
Contrast output parameters.
std::vector< unsigned int > m_inRasterBands
Bands to be processed from the input raster.
std::map< std::string, std::string > m_createdOutRasterInfo
The necessary information to create the raster (as described in te::raster::RasterFactory), leave empty if the result must be written to the raster pointed m_outRasterPtr.
Push button that uses te::qt::widgets::HelpManager on its mouse pressed implementation.
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state...
std::string m_createdOutRasterDSType
Output raster data source type (as described in te::raster::RasterFactory ), leave empty if the resul...
te::rst::Raster const * m_inRasterPtr
Input raster.
This file defines the LayerSearchWizardPage class.
This file defines the LayerSearchWidget class.
A Qt dialog that allows users to run a contrast operation defined by RP module.
Utility functions for the data access module.
TEQTWIDGETSEXPORT te::map::AbstractLayerPtr createLayer(const std::string &driverName, const std::map< std::string, std::string > &connInfo)
void setPageReference(const QString &ref)
Sets the documentation page reference.
bool m_enableProgress
Enable/Disable the progress interface (default:false).
Contrast input parameters.
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
This class is GUI used to define the raster info parameters for raster factory.
ContrastWizard(QWidget *parent)
virtual bool validateCurrentPage()
te::map::AbstractLayerPtr getOutputLayer()
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
void setLayer(te::map::AbstractLayerPtr layer)
This file defines a class for a Contrast Wizard page.
void setList(std::list< te::map::AbstractLayerPtr > &layerList)
bool initialize(const AlgorithmInputParameters &inputParams)
Initialize the algorithm instance making it ready for execution.