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