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 #include "../../../dataaccess/datasource/DataSourceInfo.h"
26 #include "../../../maptools/AbstractLayer.h"
27 #include "../Config.h"
28 
29 //Qt
30 // QT
31 #include <QTableWidgetItem>
32 #include <QWizardPage>
33 
34 //STL
35 #include <memory>
36 
37 //Forward declarations
38 namespace Ui
39 {
40  class GroupingWidgetForm;
41  class RasterizationWizardPageForm;
42 }
43 
44 namespace te
45 {
46  namespace color { class ColorBar; }
47 
48  namespace map
49  {
50  class Grouping;
51  class GroupingItem;
52  }
53 
54  namespace rst { class Raster; }
55 
56  namespace qt
57  {
58  namespace widgets
59  {
60 
61  // Forward declarations
62  class ColorCatalogWidget;
63 
64  class TEQTWIDGETSEXPORT RasterizationWizardPage : public QWizardPage
65  {
66  Q_OBJECT
67 
68  public:
69 
70  RasterizationWizardPage(QWidget* parent=0);
71 
73 
74  void setLayer(te::map::AbstractLayerPtr layer);
75 
76  double getResX();
77 
78  double getResY();
79 
80  te::gm::Envelope getEnvelope();
81 
82  int getSrid();
83 
84  bool outputDataSourceToFile();
85 
86  te::da::DataSourceInfoPtr getDataSourceInfo();
87 
88  std::string getRepositoryName();
89 
90  std::string getAttributeName();
91 
92  std::map<std::string, std::vector<int> > getInformations();
93 
94  void validate();
95 
96  std::vector<te::map::GroupingItem*> getGroupingItems();
97 
98  QTableWidget* getTableWidget();
99 
100  void saveLegend(const std::string& path);
101 
102  private:
103 
104  /*! \brief Updates the widget form based on internal fill element. */
105  void updateUi(bool loadColorBar = false);
106 
107  std::vector<std::string> getDistinctClasses(const std::string& attrName);
108 
109  void getDataAsString(std::vector<std::string>& vec, const std::string& attrName, int& nullValues);
110 
111  void getLinkedDataAsString(std::vector<std::string>& vec, const std::string& attrName, int& nullValues);
112 
113  void buildSymbolizer(std::string meanTitle = "");
114 
115  void createStringNullGroupingItem(int count);
116 
117  int getGeometryType();
118 
119  void listAttributes();
120 
121  protected slots:
122 
123  void onApplyPushButtonClicked();
124 
125  void onSelectAllPushButtonClicked();
126 
127  void onUnselectAllPushButtonClicked();
128 
129  void onAttrComboBoxActivated(int idx);
130 
131  void onColorBarChanged();
132 
133  void onTableWidgetItemChanged(QTableWidgetItem* item);
134 
135  void onTableWidgetItemDoubleClicked(QTableWidgetItem* item);
136 
137  void onLoadPushButtonClicked();
138 
139  void onSavePushButtonClicked();
140 
141  void onResXLineEditEditingFinished();
142 
143  void onResYLineEditEditingFinished();
144 
145  void onTargetFileToolButtonPressed();
146 
147  signals:
148 
149  void applyPushButtonClicked();
150 
151  private:
152 
153  std::auto_ptr<Ui::RasterizationWizardPageForm> m_ui;
154 
155  te::map::AbstractLayerPtr m_layer; //!< TerraLib layer auto ptr
156 
157  te::color::ColorBar* m_cb; //!< Terralib color bar objetc
158  te::qt::widgets::ColorCatalogWidget* m_colorBar; //!< Widget used to pick a color.
159 
160  std::vector<te::map::GroupingItem*> m_legend; //!< Grouping items
161 
162  te::da::DataSourceInfoPtr m_outputDatasource; //!< DataSource information.
163 
164  bool m_toFile;
165 
166  bool m_manual;
167  };
168 
169  } // namespace widgets
170  } // namespace qt
171 } // namespace te
172 
173 #endif // TE_QT_WIDGETS_RASTERIZATIONWIZARDPAGE_H
std::auto_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.
URI C++ Library.
te::map::AbstractLayerPtr m_layer
TerraLib layer auto ptr.
std::vector< te::map::GroupingItem * > m_legend
Grouping items.
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
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr