VectorToVectorDialog.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  \file terralib/attributefill/qt/VectorToVectorDialog.h
22 
23  \brief Raster to vector attributefill dialog.
24 */
25 
26 #ifndef __TERRALIB_ATTRIBUTEFILL_INTERNAL_VECTORTOVECTORDIALOG_H
27 #define __TERRALIB_ATTRIBUTEFILL_INTERNAL_VECTORTOVECTORDIALOG_H
28 
29 // TerraLib
30 #ifndef Q_MOC_RUN
31 #include "../../dataaccess/datasource/DataSourceInfo.h"
32 #include "../../datatype/Property.h"
33 #include "../../maptools/AbstractLayer.h"
34 #include "../../statistics/core/Utils.h"
35 #endif
36 #include "../Config.h"
37 #include "../Enums.h"
38 
39 // STL
40 #include <list>
41 #include <map>
42 #include <memory>
43 #include <vector>
44 
45 // Qt
46 #include <QDialog>
47 
48 namespace Ui { class VectorToVectorDialogForm; }
49 
50 // Forward declarations
51 class QListWidgetItem;
52 class QModelIndex;
53 class QTreeWidgetItem;
54 
55 namespace te
56 {
57  namespace attributefill
58  {
60  {
61  Q_OBJECT
62 
63  public:
64 
65  VectorToVectorDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
66 
68 
69 
70  /*!
71  \brief Set the layer that can be used
72 
73  \param layers List of AbstractLayerPtr
74  */
75  void setLayers(std::list<te::map::AbstractLayerPtr> layers);
76 
77  /*!
78  \brief Get the generated layer.
79 
80  \return the generated layer.
81  */
82  te::map::AbstractLayerPtr getLayer();
83 
84  void setLogPath(const std::string& path);
85 
86  private:
87 
88  void setFunctionsByLayer(te::map::AbstractLayerPtr layer);
89 
90  void setStatisticalSummary();
91 
92  te::map::AbstractLayerPtr getCurrentFromLayer();
93 
94  te::map::AbstractLayerPtr getCurrentToLayer();
95 
96  std::map<std::string, std::vector<te::attributefill::OperationType> > getSelections();
97 
98  bool isPolygon(te::gm::GeomType type);
99 
100  bool isPoint(te::gm::GeomType type);
101 
102  bool isValidPropertyType(const int type);
103 
104  bool isClassType(const int type);
105 
106  te::gm::GeomType getCurrentToLayerGeomType();
107 
108  bool isNumProperty(const int type);
109 
110  protected slots:
111 
112  void onTargetDatasourceToolButtonPressed();
113 
114  void onTargetFileToolButtonPressed();
115 
116  void onFromLayerComboBoxCurrentIndexChanged(int index);
117 
118  void onToLayerComboBoxCurrentIndexChanged(int index);
119 
120  void onOkPushButtonClicked();
121 
122  void onCancelPushButtonClicked();
123 
124  void onSelectAttrToolButtonPressed();
125 
126  void onSelectAllComboBoxChanged(int index);
127 
128  void onRejectAllComboBoxChanged(int index);
129 
130  void onStatisticsListWidgetItemPressed(QListWidgetItem * item);
131 
132  private:
133 
134  typedef std::map<te::stat::StatisticalSummary, std::string> StaticalSummaryMap;
135 
136  std::auto_ptr<Ui::VectorToVectorDialogForm> m_ui; //!< User interface.
137  te::da::DataSourceInfoPtr m_outputDatasource; //!< DataSource information.
138  std::list<te::map::AbstractLayerPtr> m_layers; //!< List of layers.
139  std::vector<std::string> m_outputAttributes;
141  std::string m_path; //!< Output layer path;
142  std::string m_logPath;
143  bool m_toFile;
144  };
145  } // end namespace attributefill
146 } // end namespace te
147 
148 #endif // __TERRALIB_ATTRIBUTEFILL_INTERNAL_VECTORTOVECTORDIALOG_H
std::string m_path
Output layer path;.
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Definition: Enums.h:41
std::list< te::map::AbstractLayerPtr > m_layers
List of layers.
#define TEATTRIBUTEFILLEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
URI C++ Library.
std::vector< std::string > m_outputAttributes
std::auto_ptr< Ui::VectorToVectorDialogForm > m_ui
User interface.
te::da::DataSourceInfoPtr m_outputDatasource
DataSource information.
std::map< te::stat::StatisticalSummary, std::string > StaticalSummaryMap
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr