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 
72  void setLayer(te::map::AbstractLayerPtr layer);
73 
74  double getResX();
75 
76  double getResY();
77 
78  te::gm::Envelope getEnvelope();
79 
80  int getSrid();
81 
82  bool outputDataSourceToFile();
83 
84  te::da::DataSourceInfoPtr getDataSourceInfo();
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 
109  void createStringNullGroupingItem(int count);
110 
111  int getGeometryType();
112 
113  void listAttributes();
114 
115  protected slots:
116 
117  void onApplyPushButtonClicked();
118 
119  void onSelectAllPushButtonClicked();
120 
121  void onUnselectAllPushButtonClicked();
122 
123  void onAttrComboBoxActivated(int idx);
124 
125  void onColorBarChanged();
126 
127  void onTableWidgetItemChanged(QTableWidgetItem* item);
128 
129  void onTableWidgetItemDoubleClicked(QTableWidgetItem* item);
130 
131  void onLoadPushButtonClicked();
132 
133  void onSavePushButtonClicked();
134 
135  void onResXLineEditEditingFinished();
136 
137  void onResYLineEditEditingFinished();
138 
139  void onTargetFileToolButtonPressed();
140 
141  signals:
142 
143  void applyPushButtonClicked();
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
#define slots
std::unique_ptr< Ui::RasterizationWizardPageForm > m_ui
te::color::ColorBar * m_cb
Terralib color bar objetc.
te::da::DataSourceInfoPtr m_outputDatasource
DataSource information.
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
te::qt::widgets::ColorCatalogWidget * m_colorBar
Widget used to pick a color.
TerraLib.
te::map::AbstractLayerPtr m_layer
TerraLib layer auto ptr.
It models the concept of color bar.
Definition: ColorBar.h:49
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
std::vector< te::se::Rule * > m_legend
Rule items.
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr