RasterizationWizardPage.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 
21 #ifndef TE_QT_WIDGETS_RASTERIZATIONWIZARDPAGE_H
22 #define TE_QT_WIDGETS_RASTERIZATIONWIZARDPAGE_H
23 
24 //Terralib
25 #ifndef Q_MOC_RUN
26 #include "../../../dataaccess/datasource/DataSourceInfo.h"
27 #include "../../../maptools/AbstractLayer.h"
28 #endif
29 #include "../Config.h"
30 
31 //Qt
32 // QT
33 #include <QTableWidgetItem>
34 #include <QWizardPage>
35 
36 //STL
37 #include <memory>
38 
39 //Forward declarations
40 namespace Ui
41 {
42  class GroupingWidgetForm;
43  class RasterizationWizardPageForm;
44 }
45 
46 namespace te
47 {
48  namespace color { class ColorBar; }
49 
50  namespace rst { class Raster; }
51 
52  namespace se { class Rule; }
53 
54  namespace qt
55  {
56  namespace widgets
57  {
58 
59  // Forward declarations
60  class ColorCatalogWidget;
61 
62  class TEQTWIDGETSEXPORT RasterizationWizardPage : public QWizardPage
63  {
64  Q_OBJECT
65 
66  public:
67 
68  RasterizationWizardPage(QWidget* parent=0);
69 
71 
73 
74  double getResX();
75 
76  double getResY();
77 
79 
80  int getSrid();
81 
83 
85 
86  std::string getRepositoryName();
87 
88  std::string getAttributeName();
89 
90  std::map<std::string, std::vector<int> > getInformations();
91 
92  void validate();
93 
94  QTableWidget* getTableWidget();
95 
96  void saveLegend(const std::string& path);
97 
98  private:
99 
100  /*! \brief Updates the widget form based on internal fill element. */
101  void updateUi(bool loadColorBar = false);
102 
103  std::vector<std::string> getDistinctClasses(const std::string& attrName);
104 
105  void getDataAsString(std::vector<std::string>& vec, const std::string& attrName, int& nullValues);
106 
107  void buildSymbolizer(std::string meanTitle = "");
108 
110 
112 
114 
115  protected slots:
116 
118 
120 
122 
123  void onAttrComboBoxActivated(int idx);
124 
126 
127  void onTableWidgetItemChanged(QTableWidgetItem* item);
128 
129  void onTableWidgetItemDoubleClicked(QTableWidgetItem* item);
130 
132 
134 
136 
138 
140 
141  signals:
142 
144 
145  private:
146 
147  std::unique_ptr<Ui::RasterizationWizardPageForm> m_ui;
148 
149  te::map::AbstractLayerPtr m_layer; //!< TerraLib layer auto ptr
150 
151  te::color::ColorBar* m_cb; //!< Terralib color bar objetc
152  te::qt::widgets::ColorCatalogWidget* m_colorBar; //!< Widget used to pick a color.
153 
154  std::vector<te::se::Rule*> m_legend; //!< Rule items
155 
156  te::da::DataSourceInfoPtr m_outputDatasource; //!< DataSource information.
157 
158  bool m_toFile;
159 
160  bool m_manual;
161  };
162 
163  } // namespace widgets
164  } // namespace qt
165 } // namespace te
166 
167 #endif // TE_QT_WIDGETS_RASTERIZATIONWIZARDPAGE_H
te::qt::widgets::RasterizationWizardPage::onLoadPushButtonClicked
void onLoadPushButtonClicked()
te::qt::widgets::RasterizationWizardPage::outputDataSourceToFile
bool outputDataSourceToFile()
te::gm::Envelope
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
te::qt::widgets::RasterizationWizardPage::m_colorBar
te::qt::widgets::ColorCatalogWidget * m_colorBar
Widget used to pick a color.
Definition: RasterizationWizardPage.h:152
te::qt::widgets::RasterizationWizardPage::onTargetFileToolButtonPressed
void onTargetFileToolButtonPressed()
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::qt::widgets::RasterizationWizardPage::createStringNullGroupingItem
void createStringNullGroupingItem(int count)
te::qt::widgets::RasterizationWizardPage::onSavePushButtonClicked
void onSavePushButtonClicked()
te::map::AbstractLayerPtr
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
Definition: AbstractLayer.h:626
te::da::DataSourceInfoPtr
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
Definition: DataSourceInfo.h:107
te::qt::widgets::RasterizationWizardPage::validate
void validate()
te::qt::widgets::RasterizationWizardPage::setLayer
void setLayer(te::map::AbstractLayerPtr layer)
te::qt::widgets::RasterizationWizardPage
Definition: RasterizationWizardPage.h:63
te::color::loadColorBar
TECOLOREXPORT te::color::ColorSchemeCatalog * loadColorBar(const std::string &jsonfile, const std::string &catalogName)
This file contains utility functions for color bar.
te::qt::widgets::RasterizationWizardPage::getTableWidget
QTableWidget * getTableWidget()
te::qt::widgets::RasterizationWizardPage::RasterizationWizardPage
RasterizationWizardPage(QWidget *parent=0)
te::qt::widgets::RasterizationWizardPage::getAttributeName
std::string getAttributeName()
te::qt::widgets::RasterizationWizardPage::m_cb
te::color::ColorBar * m_cb
Terralib color bar objetc.
Definition: RasterizationWizardPage.h:151
te::qt::widgets::RasterizationWizardPage::m_legend
std::vector< te::se::Rule * > m_legend
Rule items.
Definition: RasterizationWizardPage.h:154
te::qt::widgets::RasterizationWizardPage::getDataAsString
void getDataAsString(std::vector< std::string > &vec, const std::string &attrName, int &nullValues)
te::qt::widgets::RasterizationWizardPage::onUnselectAllPushButtonClicked
void onUnselectAllPushButtonClicked()
TEQTWIDGETSEXPORT
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
te::qt::widgets::RasterizationWizardPage::onTableWidgetItemDoubleClicked
void onTableWidgetItemDoubleClicked(QTableWidgetItem *item)
te::qt::widgets::RasterizationWizardPage::onColorBarChanged
void onColorBarChanged()
te::qt::widgets::RasterizationWizardPage::getDataSourceInfo
te::da::DataSourceInfoPtr getDataSourceInfo()
te::qt::widgets::ColorCatalogWidget
...
Definition: ColorCatalogWidget.h:59
Ui
Definition: ConfigInputAddressDialog.h:44
te::qt::widgets::RasterizationWizardPage::m_ui
std::unique_ptr< Ui::RasterizationWizardPageForm > m_ui
Definition: RasterizationWizardPage.h:147
te::qt::widgets::RasterizationWizardPage::m_manual
bool m_manual
Definition: RasterizationWizardPage.h:160
te::qt::widgets::RasterizationWizardPage::onResYLineEditEditingFinished
void onResYLineEditEditingFinished()
te::qt::widgets::RasterizationWizardPage::onSelectAllPushButtonClicked
void onSelectAllPushButtonClicked()
slots
#define slots
Definition: VirtualMachine.h:48
te::qt::widgets::RasterizationWizardPage::buildSymbolizer
void buildSymbolizer(std::string meanTitle="")
te::qt::widgets::RasterizationWizardPage::onAttrComboBoxActivated
void onAttrComboBoxActivated(int idx)
te::qt::widgets::RasterizationWizardPage::listAttributes
void listAttributes()
te::qt::widgets::RasterizationWizardPage::~RasterizationWizardPage
~RasterizationWizardPage()
te::qt::widgets::RasterizationWizardPage::saveLegend
void saveLegend(const std::string &path)
te::qt::widgets::RasterizationWizardPage::getResY
double getResY()
te::qt::widgets::RasterizationWizardPage::applyPushButtonClicked
void applyPushButtonClicked()
te::qt::widgets::RasterizationWizardPage::getResX
double getResX()
te::color::ColorBar
It models the concept of color bar.
Definition: ColorBar.h:50
te::qt::widgets::RasterizationWizardPage::getRepositoryName
std::string getRepositoryName()
te::qt::widgets::RasterizationWizardPage::onTableWidgetItemChanged
void onTableWidgetItemChanged(QTableWidgetItem *item)
te::qt::widgets::RasterizationWizardPage::getEnvelope
te::gm::Envelope getEnvelope()
te::qt::widgets::RasterizationWizardPage::updateUi
void updateUi(bool loadColorBar=false)
Updates the widget form based on internal fill element.
te::qt::widgets::RasterizationWizardPage::onResXLineEditEditingFinished
void onResXLineEditEditingFinished()
te::qt::widgets::RasterizationWizardPage::onApplyPushButtonClicked
void onApplyPushButtonClicked()
te::qt::widgets::RasterizationWizardPage::m_layer
te::map::AbstractLayerPtr m_layer
TerraLib layer auto ptr.
Definition: RasterizationWizardPage.h:149
te::qt::widgets::RasterizationWizardPage::getInformations
std::map< std::string, std::vector< int > > getInformations()
te::qt::widgets::RasterizationWizardPage::m_outputDatasource
te::da::DataSourceInfoPtr m_outputDatasource
DataSource information.
Definition: RasterizationWizardPage.h:156
te::qt::widgets::RasterizationWizardPage::getSrid
int getSrid()
te::qt::widgets::RasterizationWizardPage::m_toFile
bool m_toFile
Definition: RasterizationWizardPage.h:158
te::qt::widgets::RasterizationWizardPage::getDistinctClasses
std::vector< std::string > getDistinctClasses(const std::string &attrName)
te::qt::widgets::RasterizationWizardPage::getGeometryType
int getGeometryType()