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