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