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 #ifndef Q_MOC_RUN
31 #include "../../dataaccess/datasource/DataSourceInfo.h"
32 #include "../../maptools/AbstractLayer.h"
33 #include "../AlgorithmParams.h"
34 #endif
35 #include "../Config.h"
36 
37 // STL
38 #include <map>
39 #include <memory>
40 
41 // Qt
42 #include <QDialog>
43 
44 namespace Ui { class IdentityDialogForm; }
45 
46 namespace te
47 {
48  namespace qt
49  {
50  namespace widgets
51  {
52  class DoubleInputListWidget;
53  }
54  }
55 
56  namespace vp
57  {
58  /*!
59  \class IdentityDialog
60 
61  \brief A dialog used to execute vector identity.
62  */
63  class TEVPEXPORT IdentityDialog : public QDialog
64  {
65  Q_OBJECT
66 
67  public:
68 
69  IdentityDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
70 
71  ~IdentityDialog();
72 
73  struct DataStruct
74  {
76  {
77  m_dataSetType = 0;
78  m_dataSet = 0;
79  }
80 
83  };
84 
85  /*!
86  \brief Set the layer that can be used
87 
88  \param layers List of AbstractLayerPtr
89  */
90  void setLayers(std::list<te::map::AbstractLayerPtr> layers);
91 
92  te::map::AbstractLayerPtr getLayer();
93 
94  std::vector<std::string> getWarnings();
95 
96  protected:
97 
98  std::map<int, std::vector<std::string> > getSelectedProperties();
99 
100  void updateInputLayerComboBox();
101 
102  void updateIntersectionLayerComboBox();
103 
104  void updateDoubleListWidget();
105 
106  protected slots:
107 
108  void onInputLayerComboBoxChanged(int index);
109 
110  void onIntersectionLayerComboBoxChanged(int index);
111 
112  void onTargetDatasourceToolButtonPressed();
113 
114  void onTargetFileToolButtonPressed();
115 
116  void onOkPushButtonClicked();
117 
118  void onCancelPushButtonClicked();
119 
120  private:
121 
122  std::auto_ptr<Ui::IdentityDialogForm> m_ui;
123  std::list<te::map::AbstractLayerPtr> m_layers; //!< The vector layers in Layer Explorer.
126 
127  std::vector<te::vp::InputParams> m_inputParams; //!< A vector of input parameters.
128  te::vp::AlgorithmParams* m_params; //!< Algorithm parameters.
129 
130  te::da::DataSourceInfoPtr m_outputDatasource; //!< DataSource information.
132 
133  bool m_toFile; //!< The result is in a file?
134  std::vector<std::string> m_warnings; //!< Warnings during the operation.
135 
136  std::unique_ptr<te::qt::widgets::DoubleInputListWidget>
138  };
139  } // end namespace vp
140 } // end namespace te
141 
142 #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