GeometricOpDialog.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/GeometricOpDialog.h
22 
23  \brief A Qt dialog that allows users to run the basic geometric operations
24  defined by VP module.
25 */
26 
27 #ifndef __TERRALIB_VP_INTERNAL_GEOMETRICOPDIALOG_H
28 #define __TERRALIB_VP_INTERNAL_GEOMETRICOPDIALOG_H
29 
30 // TerraLib
31 #ifndef Q_MOC_RUN
32 #include "../../dataaccess/datasource/DataSourceInfo.h"
33 #include "../../maptools/AbstractLayer.h"
34 #endif
35 #include "../Config.h"
36 #include "../Enums.h"
37 
38 // STL
39 #include <list>
40 #include <memory>
41 
42 // Qt
43 #include <QDialog>
44 
45 namespace Ui { class GeometricOpDialogForm; }
46 
47 namespace te
48 {
49  namespace vp
50  {
51  /*!
52  \class GeometricOpDialog
53 
54  \brief This class is GUI used to define the wizard for the VP geometric
55  operation.
56  */
57  class TEVPEXPORT GeometricOpDialog : public QDialog
58  {
59  Q_OBJECT
60 
61  public:
62 
63  GeometricOpDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
64 
66 
67  void setLayers(std::list<te::map::AbstractLayerPtr> layers);
68 
69  te::map::AbstractLayerPtr getInLayer();
70 
71  std::vector<te::map::AbstractLayerPtr> getOutLayer();
72 
73  bool hasConvexHull();
74 
75  bool hasCentroid();
76 
77  bool hasMBR();
78 
79  bool hasArea();
80 
81  bool hasLine();
82 
83  bool hasPerimeter();
84 
85  void enableOperations(te::gm::GeomType type);
86 
87  te::vp::GeometricOpObjStrategy getObjectStrategy();
88 
89  protected slots:
90 
91  void onLayerComboBoxChanged(int index);
92 
93  void onAttributeComboBoxChanged(int index);
94 
95  void onAllObjectsToggled();
96 
97  void onAllLayerOperationToggled();
98 
99  void onAttributeOperationToggled();
100 
101  void onTargetDatasourceToolButtonPressed();
102 
103  void onTargetFileToolButtonPressed();
104 
105  void onOkPushButtonClicked();
106 
107  void onCancelPushButtonClicked();
108 
109  void onSrsToolButtonClicked();
110 
111  private:
112 
113  std::unique_ptr<Ui::GeometricOpDialogForm> m_ui; //!< Qt Dialog Form
114 
115  std::list<te::map::AbstractLayerPtr> m_layers; //!< List of layers.
116  te::map::AbstractLayerPtr m_selectedLayer; //!< Selected layer to operation
117  te::da::DataSourceInfoPtr m_outputDatasource; //!< DataSource information.
118  std::vector<te::map::AbstractLayerPtr> m_outputLayer; //!< Generated Layer.
119  std::vector<te::vp::GeometricOperation> m_ops; //!< Operations selected to be executed.
120  std::string m_attribute; //!< Properties related to the selected Layer to do the dissolve before operation.
121  bool m_toFile; //!< Flag to indicate if the output will be stored in a file.
122  int m_newSRID; //!< newSRID to compure tabular operations (Area, Perimeter, Line).
123  };
124  } // end namespace vp
125 } // end namespace te
126 
127 #endif // __TERRALIB_VP_INTERNAL_GEOMETRICOPDIALOG_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
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Definition: Enums.h:41
std::unique_ptr< Ui::GeometricOpDialogForm > m_ui
Qt Dialog Form.
std::string m_attribute
Properties related to the selected Layer to do the dissolve before operation.
te::da::DataSourceInfoPtr m_outputDatasource
DataSource information.
GeometricOpObjStrategy
Defines the strategy used for the processing of the input geometries.
Definition: Enums.h:115
te::map::AbstractLayerPtr m_selectedLayer
Selected layer to operation.
URI C++ Library.
bool m_toFile
Flag to indicate if the output will be stored in a file.
std::list< te::map::AbstractLayerPtr > m_layers
List of layers.
std::vector< te::map::AbstractLayerPtr > m_outputLayer
Generated Layer.
std::vector< te::vp::GeometricOperation > m_ops
Operations selected to be executed.
This class is GUI used to define the wizard for the VP geometric operation.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
int m_newSRID
newSRID to compure tabular operations (Area, Perimeter, Line).
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr