All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AggregationDialog.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/AggregationDialog.h
22 
23  \brief A dialog aggregation operation
24 */
25 
26 #ifndef __TERRALIB_VP_INTERNAL_AGGREGATIONDIALOG_H
27 #define __TERRALIB_VP_INTERNAL_AGGREGATIONDIALOG_H
28 
29 // TerraLib
30 #include "../../dataaccess/datasource/DataSourceInfo.h"
31 #include "../../datatype/Property.h"
32 #include "../../maptools/AbstractLayer.h"
33 #include "../../statistics/core/Enums.h"
34 #include "../Config.h"
35 #include "../Enums.h"
36 
37 // STL
38 #include <list>
39 #include <map>
40 #include <memory>
41 
42 // Qt
43 #include <QDialog>
44 
45 namespace Ui { class AggregationDialogForm; }
46 
47 // Forward declarations
48 class QListWidgetItem;
49 class QModelIndex;
50 class QTreeWidgetItem;
51 
52 namespace te
53 {
54  namespace vp
55  {
56 // Forward declarations
57  class LayerTreeModel;
58 
59  class TEVPEXPORT AggregationDialog : public QDialog
60  {
61  Q_OBJECT
62 
63  public:
64 
65  AggregationDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
66 
68 
69  /*!
70  \brief Set the layer that can be used
71 
72  \param layers List of AbstractLayerPtr
73  */
74  void setLayers(std::list<te::map::AbstractLayerPtr> layers);
75 
76  /*!
77  \brief Get the Grouping Functions Type based on selected QListWidgetItem.
78 
79  \return Map with Properties and Grouping Functions Type.
80  */
81  std::map<te::dt::Property*, std::vector<te::stat::StatisticalSummary> > getStatisticalSummary();
82 
83  /*!
84  \brief Get the selected property based on selected QListWidgetItem using the name of property.
85 
86  \return a property.
87  */
88  te::dt::Property* getSelectedPropertyByName(std::string propertyName);
89 
90  /*!
91  \brief Get the selected properties based on selected QListWidgetItem.
92 
93  \return a Vector with selected properties.
94  */
95  std::vector<te::dt::Property*> getSelectedProperties();
96 
97  /*!
98  \brief Get the generated layer.
99 
100  \return the generated layer.
101  */
102  te::map::AbstractLayerPtr getLayer();
103 
104  /*!
105  \brief Set Statistical Summary Type for combobox 'm_selectAllComboBox' and 'm_rejectAllComboBox' based on a enum.
106  */
107  void setStatisticalSummary();
108 
109  /*!
110  \brief Map Statistical Summary Type enum for an intuitive name.
111  */
112  void setStatisticalSummaryMap();
113 
114  /*!
115  \brief Set Grouping Functions Type for 'm_outputListWidget' based on Selected Layer.
116  */
117  void setFunctionsByLayer(std::vector<te::dt::Property*> properties);
118 
119  protected slots:
120 
121  void onLayerComboBoxChanged(int index);
122 
123  void onFilterLineEditTextChanged(const QString& text);
124 
125  void onCalculateStatistics(bool visible);
126 
127  void onSelectAllComboBoxChanged(int index);
128 
129  void onRejectAllComboBoxChanged(int index);
130 
131  void onOutputListWidgetClicked(QListWidgetItem * item);
132 
133  void onTargetDatasourceToolButtonPressed();
134 
135  void onTargetFileToolButtonPressed();
136 
137  void onHelpPushButtonClicked();
138 
139  void onOkPushButtonClicked();
140 
141  void onCancelPushButtonClicked();
142 
143  private:
144 
145  typedef std::map<te::stat::StatisticalSummary, std::string> StaticalSummaryMap;
146 
147  std::auto_ptr<Ui::AggregationDialogForm> m_ui;
148  te::da::DataSourceInfoPtr m_outputDatasource; //!< DataSource information.
149  std::list<te::map::AbstractLayerPtr> m_layers; //!< List of layers.
150  te::map::AbstractLayerPtr m_selectedLayer; //!< Layer used for aggregation
151  std::vector<te::dt::Property*> m_properties; //!< Properties related to the selected Layer
152  StaticalSummaryMap m_StatisticalSummaryMap; //!< Maping of Statistical Summary enum
153  te::map::AbstractLayerPtr m_layer; //!< Generated Layer.
154  bool m_toFile;
155  };
156  } // end namespace vp
157 } // end namespace te
158 
159 #endif // __TERRALIB_VP_INTERNAL_AGGREGATIONDIALOG_H
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:64
te::da::DataSourceInfoPtr m_outputDatasource
DataSource information.
std::vector< te::dt::Property * > m_properties
Properties related to the selected Layer.
te::map::AbstractLayerPtr m_selectedLayer
Layer used for aggregation.
It models a property definition.
Definition: Property.h:59
std::auto_ptr< Ui::AggregationDialogForm > m_ui
std::list< te::map::AbstractLayerPtr > m_layers
List of layers.
te::map::AbstractLayerPtr m_layer
Generated Layer.
StaticalSummaryMap m_StatisticalSummaryMap
Maping of Statistical Summary enum.
std::map< te::stat::StatisticalSummary, std::string > StaticalSummaryMap
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr