IdentityDialog.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/vp/qt/IdentityDialog.h
22 
23  \brief Identity operation dialog.
24 */
25 
26 #ifndef __TERRALIB_VP_QT_INTERNAL_IDENTITYDIALOG_H
27 #define __TERRALIB_VP_QT_INTERNAL_IDENTITYDIALOG_H
28 
29 // TerraLib
30 #include "../../dataaccess/datasource/DataSourceInfo.h"
31 #include "../../maptools/AbstractLayer.h"
32 #include "../AlgorithmParams.h"
33 #include "../Config.h"
34 
35 // STL
36 #include <map>
37 #include <memory>
38 
39 // Qt
40 #include <QDialog>
41 
42 namespace Ui { class IdentityDialogForm; }
43 
44 namespace te
45 {
46  namespace qt
47  {
48  namespace widgets
49  {
50  class DoubleInputListWidget;
51  }
52  }
53 
54  namespace vp
55  {
56  /*!
57  \class IdentityDialog
58 
59  \brief A dialog used to execute vector identity.
60  */
61  class TEVPEXPORT IdentityDialog : public QDialog
62  {
63  Q_OBJECT
64 
65  public:
66 
67  IdentityDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
68 
69  ~IdentityDialog();
70 
71  struct DataStruct
72  {
74  {
75  m_dataSetType = 0;
76  m_dataSet = 0;
77  }
78 
81  };
82 
83  /*!
84  \brief Set the layer that can be used
85 
86  \param layers List of AbstractLayerPtr
87  */
88  void setLayers(std::list<te::map::AbstractLayerPtr> layers);
89 
90  te::map::AbstractLayerPtr getLayer();
91 
92  std::vector<std::string> getWarnings();
93 
94  protected:
95 
96  std::map<int, std::vector<std::string> > getSelectedProperties();
97 
98  void updateInputLayerComboBox();
99 
100  void updateIntersectionLayerComboBox();
101 
102  void updateDoubleListWidget();
103 
104  protected slots:
105 
106  void onInputLayerComboBoxChanged(int index);
107 
108  void onIntersectionLayerComboBoxChanged(int index);
109 
110  void onTargetDatasourceToolButtonPressed();
111 
112  void onTargetFileToolButtonPressed();
113 
114  void onOkPushButtonClicked();
115 
116  void onCancelPushButtonClicked();
117 
118  private:
119 
120  std::auto_ptr<Ui::IdentityDialogForm> m_ui;
121  std::list<te::map::AbstractLayerPtr> m_layers; //!< The vector layers in Layer Explorer.
124 
125  std::vector<te::vp::InputParams> m_inputParams; //!< A vector of input parameters.
126  te::vp::AlgorithmParams* m_params; //!< Algorithm parameters.
127 
128  te::da::DataSourceInfoPtr m_outputDatasource; //!< DataSource information.
130 
131  bool m_toFile; //!< The result is in a file?
132  std::vector<std::string> m_warnings; //!< Warnings during the operation.
133 
134  std::unique_ptr<te::qt::widgets::DoubleInputListWidget>
136  };
137  } // end namespace vp
138 } // end namespace te
139 
140 #endif // __TERRALIB_VP_QT_INTERNAL_IDENTITYDIALOG_H
te::da::DataSetType * m_dataSetType
A dialog used to execute vector identity.
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
bool m_toFile
The result is in a file?
te::da::DataSourceInfoPtr m_outputDatasource
DataSource information.
A class that models the description of a dataset.
Definition: DataSetType.h:72
std::list< te::map::AbstractLayerPtr > m_layers
The vector layers in Layer Explorer.
std::auto_ptr< Ui::IdentityDialogForm > m_ui
URI C++ Library.
te::map::AbstractLayerPtr m_inputSelectedLayer
Input layer selected.
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:112
te::map::AbstractLayerPtr m_intersectionSelectedLayer
Identity layer selected.
te::vp::AlgorithmParams * m_params
Algorithm parameters.
std::vector< te::vp::InputParams > m_inputParams
A vector of input parameters.
te::map::AbstractLayerPtr m_layerResult
Generated Layer.
std::vector< std::string > m_warnings
Warnings during the operation.
std::unique_ptr< te::qt::widgets::DoubleInputListWidget > m_inputDoubleInputListWidget
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr