UnionDialog.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/UnionDialog.h
22 
23  \brief Union operation dialog.
24 */
25 
26 #ifndef __TERRALIB_VP_QT_INTERNAL_UNIONDIALOG_H
27 #define __TERRALIB_VP_QT_INTERNAL_UNIONDIALOG_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 <memory>
39 
40 // Qt
41 #include <QDialog>
42 
43 namespace Ui { class UnionDialogForm; }
44 
45 namespace te
46 {
47  namespace qt
48  {
49  namespace widgets
50  {
51  class DoubleListWidget;
52  }
53  }
54 
55  namespace vp
56  {
57  /*!
58  \class UnionDialog
59 
60  \brief A dialog used to execute vector union.
61  */
62  class TEVPEXPORT UnionDialog : public QDialog
63  {
64  Q_OBJECT
65 
66  public:
67 
68  UnionDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
69 
70  ~UnionDialog();
71 
72  struct DataStruct
73  {
75  {
76  m_dataSetType = 0;
77  m_dataSet = 0;
78  }
79 
82  };
83 
84  /*!
85  \brief Set the layer that can be used
86 
87  \param layers List of AbstractLayerPtr
88  */
89  void setLayers(std::list<te::map::AbstractLayerPtr> layers);
90 
91  te::map::AbstractLayerPtr getLayer();
92 
93  protected:
94 
95  std::vector<std::pair<std::string, std::string> >
96  getSelectedProperties();
97 
98  void updateFirstLayerComboBox();
99 
100  void updateSecondLayerComboBox();
101 
102  void updateDoubleListWidget();
103 
104  protected slots:
105 
106  void onFirstLayerComboBoxChanged(int index);
107 
108  void onSecondLayerComboBoxChanged(int index);
109 
110  void onTargetDatasourceToolButtonPressed();
111 
112  void onTargetFileToolButtonPressed();
113 
114  void onOkPushButtonClicked();
115 
116  void onCancelPushButtonClicked();
117 
118  private:
119 
120  std::unique_ptr<Ui::UnionDialogForm> 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 
133  std::unique_ptr<te::qt::widgets::DoubleListWidget> m_doubleListWidget;
134  };
135  } // end namespace vp
136 } // end namespace te
137 
138 #endif // __TERRALIB_VP_QT_INTERNAL_UNIONDIALOG_H
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
#define slots
te::map::AbstractLayerPtr m_firstSelectedLayer
Input layer selected.
Definition: UnionDialog.h:122
te::map::AbstractLayerPtr m_outputLayer
Generated Layer.
Definition: UnionDialog.h:129
bool m_toFile
The result is in a file?
Definition: UnionDialog.h:131
A class that models the description of a dataset.
Definition: DataSetType.h:72
te::da::DataSet * m_dataSet
Definition: UnionDialog.h:81
te::da::DataSourceInfoPtr m_outputDatasource
DataSource information.
Definition: UnionDialog.h:128
std::vector< te::vp::InputParams > m_inputParams
A vector of input parameters.
Definition: UnionDialog.h:125
std::unique_ptr< te::qt::widgets::DoubleListWidget > m_doubleListWidget
Definition: UnionDialog.h:133
te::da::DataSetType * m_dataSetType
Definition: UnionDialog.h:80
URI C++ Library.
std::unique_ptr< Ui::UnionDialogForm > m_ui
Definition: UnionDialog.h:120
A dialog used to execute vector union.
Definition: UnionDialog.h:62
te::map::AbstractLayerPtr m_secondSelectedLayer
Union layer selected.
Definition: UnionDialog.h:123
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:112
std::list< te::map::AbstractLayerPtr > m_layers
The vector layers in Layer Explorer.
Definition: UnionDialog.h:121
te::vp::AlgorithmParams * m_params
Algorithm parameters.
Definition: UnionDialog.h:126
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr