Loading...
Searching...
No Matches
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
50namespace Ui { class DissolveDialogForm; }
51
52// Forward declarations
53class QListWidgetItem;
54class QModelIndex;
55class QTreeWidgetItem;
56
57namespace 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 */
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
150
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
It models a property definition.
Definition: Property.h:60
void onAdvanced(bool visible)
DissolveDialog(QWidget *parent=0, Qt::WindowFlags f=0)
void setLayers(std::list< te::map::AbstractLayerPtr > layers)
Set the layer that can be used.
bool m_toFile
The output file is in a file.
std::vector< std::string > getSelectedPropertyNames()
Get the selected properties based on selected QListWidgetItem.
std::map< te::dt::Property *, std::vector< te::stat::StatisticalSummary > > getStatisticalSummary()
Get the Grouping Functions Type based on selected QListWidgetItem.
void onFilterLineEditTextChanged(const QString &text)
te::vp::AlgorithmParams * m_params
Algorithm parameters.
std::list< te::map::AbstractLayerPtr > m_layers
List of layers.
void onRejectAllComboBoxChanged(int index)
std::map< te::stat::StatisticalSummary, std::string > StaticalSummaryMap
void setStatisticalSummary()
Set Statistical Summary Type for combobox 'm_selectAllComboBox' and 'm_rejectAllComboBox' based on a ...
bool isCollection()
Verify if the output result is a collection or single geometry.
te::map::AbstractLayerPtr m_inputLayer
Layer used for dissolve.
void onOutputListWidgetClicked(QListWidgetItem *item)
void onLayerComboBoxChanged(int index)
te::dt::Property * getSelectedPropertyByName(std::string propertyName)
Get the selected property based on selected QListWidgetItem using the name of property.
StaticalSummaryMap m_StatisticalSummaryMap
Maping of Statistical Summary enum.
void setFunctionsByLayer(std::vector< te::dt::Property * > properties)
Set Grouping Functions Type for 'm_outputListWidget' based on Selected Layer.
void onSelectAllComboBoxChanged(int index)
std::vector< te::vp::InputParams > m_inputParams
A vector of input parameters.
te::map::AbstractLayerPtr getLayer()
Get the generated layer.
std::vector< std::string > m_warnings
Warnings during the operation.
void onTargetDatasourceToolButtonPressed()
void onTargetFileToolButtonPressed()
std::unique_ptr< Ui::DissolveDialogForm > m_ui
DialogForm.
void onMultiGeometryChecked(bool checked)
std::vector< te::dt::Property * > m_properties
Properties related to the selected Layer.
void setStatisticalSummaryMap()
Map Statistical Summary Type enum for an intuitive name.
te::da::DataSourceInfoPtr m_outputDatasource
DataSource information.
std::vector< std::string > getWarnings()
Get warning messages.
te::map::AbstractLayerPtr m_layer
Generated Layer.
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
TerraLib.
#define slots
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61