DissolveDialog.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/DissolveDialog.h
22 
23  \brief A dialog dissolve operation
24 */
25 
26 #ifndef __TERRALIB_VP_INTERNAL_DISSOLVEDIALOG_H
27 #define __TERRALIB_VP_INTERNAL_DISSOLVEDIALOG_H
28 
29 // TerraLib
30 #ifndef Q_MOC_RUN
31 #include "../../dataaccess/datasource/DataSourceInfo.h"
32 #include "../../datatype/Property.h"
33 #include "../../maptools/AbstractLayer.h"
34 #include "../AlgorithmParams.h"
35 #endif
36 
37 #include "../../statistics/core/Enums.h"
38 
39 #include "../Config.h"
40 #include "../Enums.h"
41 
42 // STL
43 #include <list>
44 #include <map>
45 #include <memory>
46 
47 // Qt
48 #include <QDialog>
49 
50 namespace Ui { class DissolveDialogForm; }
51 
52 // Forward declarations
53 class QListWidgetItem;
54 class QModelIndex;
55 class QTreeWidgetItem;
56 
57 namespace te
58 {
59  namespace vp
60  {
61 // Forward declarations
62  class LayerTreeModel;
63 
64  class TEVPEXPORT DissolveDialog : public QDialog
65  {
66  Q_OBJECT
67 
68  public:
69 
70  DissolveDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
71 
73 
74  /*!
75  \brief Set the layer that can be used
76 
77  \param layers List of AbstractLayerPtr
78  \param selectedLayer Selected AbstractLayerPtr
79  */
80  void setLayers(std::list<te::map::AbstractLayerPtr> layers);
81 
82  /*!
83  \brief Get the Grouping Functions Type based on selected QListWidgetItem.
84 
85  \return Map with Properties and Grouping Functions Type.
86  */
87  std::map<te::dt::Property*, std::vector<te::stat::StatisticalSummary> > getStatisticalSummary();
88 
89  /*!
90  \brief Get the selected property based on selected QListWidgetItem using the name of property.
91 
92  \return a property.
93  */
94  te::dt::Property* getSelectedPropertyByName(std::string propertyName);
95 
96  /*!
97  \brief Get the selected properties based on selected QListWidgetItem.
98 
99  \return a Vector with selected properties.
100  */
101  std::vector<std::string> getSelectedPropertyNames();
102 
103  /*!
104  \brief Verify if the output result is a collection or single geometry.
105 
106  \return bool isCollection.
107  */
108  bool isCollection();
109 
110  /*!
111  \brief Get the generated layer.
112 
113  \return the generated layer.
114  */
116 
117  /*!
118  \brief Get warning messages.
119 
120  \return a vector of warnings.
121  */
122  std::vector<std::string> getWarnings();
123 
124  /*!
125  \brief Set Statistical Summary Type for combobox 'm_selectAllComboBox' and 'm_rejectAllComboBox' based on a enum.
126  */
128 
129  /*!
130  \brief Map Statistical Summary Type enum for an intuitive name.
131  */
133 
134  /*!
135  \brief Set Grouping Functions Type for 'm_outputListWidget' based on Selected Layer.
136  */
137  void setFunctionsByLayer(std::vector<te::dt::Property*> properties);
138 
139  protected slots:
140 
141  void onLayerComboBoxChanged(int index);
142 
143  void onFilterLineEditTextChanged(const QString& text);
144 
145  void onAdvanced(bool visible);
146 
147  void onMultiGeometryChecked(bool checked);
148 
149  void onSelectAllComboBoxChanged(int index);
150 
151  void onRejectAllComboBoxChanged(int index);
152 
153  void onOutputListWidgetClicked(QListWidgetItem * item);
154 
156 
158 
160 
162 
163  private:
164 
165  typedef std::map<te::stat::StatisticalSummary, std::string> StaticalSummaryMap;
166 
167  std::unique_ptr<Ui::DissolveDialogForm> m_ui; //!< DialogForm
168  std::list<te::map::AbstractLayerPtr> m_layers; //!< List of layers.
169  te::map::AbstractLayerPtr m_inputLayer; //!< Layer used for dissolve
170 
171  std::vector<te::vp::InputParams> m_inputParams; //!< A vector of input parameters.
172  te::vp::AlgorithmParams* m_params; //!< Algorithm parameters.
173 
174  std::vector<te::dt::Property*> m_properties; //!< Properties related to the selected Layer
175  StaticalSummaryMap m_StatisticalSummaryMap; //!< Maping of Statistical Summary enum
176 
177  te::da::DataSourceInfoPtr m_outputDatasource; //!< DataSource information.
178  te::map::AbstractLayerPtr m_layer; //!< Generated Layer.
179 
180  bool m_toFile; //!< The output file is in a file.
181  std::vector<std::string> m_warnings; //!< Warnings during the operation.
182  };
183  } // end namespace vp
184 } // end namespace te
185 
186 #endif // __TERRALIB_VP_INTERNAL_DISSOLVEDIALOG_H
te::vp::DissolveDialog::setStatisticalSummaryMap
void setStatisticalSummaryMap()
Map Statistical Summary Type enum for an intuitive name.
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::vp::DissolveDialog::m_inputLayer
te::map::AbstractLayerPtr m_inputLayer
Layer used for dissolve.
Definition: DissolveDialog.h:169
te::vp::DissolveDialog::onMultiGeometryChecked
void onMultiGeometryChecked(bool checked)
te::map::AbstractLayerPtr
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
Definition: AbstractLayer.h:626
te::da::DataSourceInfoPtr
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
Definition: DataSourceInfo.h:107
te::vp::DissolveDialog::m_warnings
std::vector< std::string > m_warnings
Warnings during the operation.
Definition: DissolveDialog.h:181
te::vp::DissolveDialog::setLayers
void setLayers(std::list< te::map::AbstractLayerPtr > layers)
Set the layer that can be used.
te::vp::DissolveDialog::DissolveDialog
DissolveDialog(QWidget *parent=0, Qt::WindowFlags f=0)
te::vp::DissolveDialog::~DissolveDialog
~DissolveDialog()
te::vp::AlgorithmParams
Definition: AlgorithmParams.h:52
te::vp::DissolveDialog::onRejectAllComboBoxChanged
void onRejectAllComboBoxChanged(int index)
te::vp::DissolveDialog::getStatisticalSummary
std::map< te::dt::Property *, std::vector< te::stat::StatisticalSummary > > getStatisticalSummary()
Get the Grouping Functions Type based on selected QListWidgetItem.
te::vp::DissolveDialog::getWarnings
std::vector< std::string > getWarnings()
Get warning messages.
te::vp::DissolveDialog::onTargetDatasourceToolButtonPressed
void onTargetDatasourceToolButtonPressed()
te::vp::DissolveDialog::StaticalSummaryMap
std::map< te::stat::StatisticalSummary, std::string > StaticalSummaryMap
Definition: DissolveDialog.h:165
te::vp::DissolveDialog::onCancelPushButtonClicked
void onCancelPushButtonClicked()
te::vp::DissolveDialog::onAdvanced
void onAdvanced(bool visible)
te::vp::DissolveDialog::onOutputListWidgetClicked
void onOutputListWidgetClicked(QListWidgetItem *item)
Ui
Definition: ConfigInputAddressDialog.h:44
TEVPEXPORT
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
te::vp::DissolveDialog::getSelectedPropertyNames
std::vector< std::string > getSelectedPropertyNames()
Get the selected properties based on selected QListWidgetItem.
te::vp::DissolveDialog::m_layer
te::map::AbstractLayerPtr m_layer
Generated Layer.
Definition: DissolveDialog.h:178
slots
#define slots
Definition: VirtualMachine.h:48
te::vp::DissolveDialog::m_layers
std::list< te::map::AbstractLayerPtr > m_layers
List of layers.
Definition: DissolveDialog.h:168
te::vp::DissolveDialog::onLayerComboBoxChanged
void onLayerComboBoxChanged(int index)
te::vp::DissolveDialog::m_StatisticalSummaryMap
StaticalSummaryMap m_StatisticalSummaryMap
Maping of Statistical Summary enum.
Definition: DissolveDialog.h:175
te::vp::DissolveDialog::isCollection
bool isCollection()
Verify if the output result is a collection or single geometry.
te::vp::DissolveDialog::getSelectedPropertyByName
te::dt::Property * getSelectedPropertyByName(std::string propertyName)
Get the selected property based on selected QListWidgetItem using the name of property.
te::vp::DissolveDialog::m_ui
std::unique_ptr< Ui::DissolveDialogForm > m_ui
DialogForm.
Definition: DissolveDialog.h:167
te::vp::DissolveDialog::m_properties
std::vector< te::dt::Property * > m_properties
Properties related to the selected Layer.
Definition: DissolveDialog.h:174
te::vp::DissolveDialog::setStatisticalSummary
void setStatisticalSummary()
Set Statistical Summary Type for combobox 'm_selectAllComboBox' and 'm_rejectAllComboBox' based on a ...
te::vp::DissolveDialog::onOkPushButtonClicked
void onOkPushButtonClicked()
te::dt::Property
It models a property definition.
Definition: Property.h:60
te::vp::DissolveDialog::getLayer
te::map::AbstractLayerPtr getLayer()
Get the generated layer.
te::vp::DissolveDialog::m_toFile
bool m_toFile
The output file is in a file.
Definition: DissolveDialog.h:180
te::vp::DissolveDialog::m_outputDatasource
te::da::DataSourceInfoPtr m_outputDatasource
DataSource information.
Definition: DissolveDialog.h:177
te::vp::DissolveDialog
Definition: DissolveDialog.h:65
te::vp::DissolveDialog::setFunctionsByLayer
void setFunctionsByLayer(std::vector< te::dt::Property * > properties)
Set Grouping Functions Type for 'm_outputListWidget' based on Selected Layer.
te::vp::DissolveDialog::onTargetFileToolButtonPressed
void onTargetFileToolButtonPressed()
te::vp::DissolveDialog::m_inputParams
std::vector< te::vp::InputParams > m_inputParams
A vector of input parameters.
Definition: DissolveDialog.h:171
te::vp::DissolveDialog::m_params
te::vp::AlgorithmParams * m_params
Algorithm parameters.
Definition: DissolveDialog.h:172
te::vp::DissolveDialog::onSelectAllComboBoxChanged
void onSelectAllComboBoxChanged(int index)
te::vp::DissolveDialog::onFilterLineEditTextChanged
void onFilterLineEditTextChanged(const QString &text)