VectorProcessingOperationDialog.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 src/terralib/vp/qt/VectorProcessingOperationDialog.h
22  *
23  * \brief Implements a dialog used to execute a vector processing operation
24  */
25 
26 #ifndef __TERRALIB_VP_QT_INTERNAL_VECTORPROCESSINGOPERATIONDIALOG_H
27 #define __TERRALIB_VP_QT_INTERNAL_VECTORPROCESSINGOPERATIONDIALOG_H
28 
29 #include "../Config.h"
30 
31  // TerraLib Includes
32 #include "../../maptools/AbstractLayer.h"
33 #include "../OperationThreadManagerListener.h"
34 
35 // STL Includes
36 #include <memory>
37 
38  // Qt Includes
39 #include <QDialog>
40 #include <QPixmap>
41 
42 namespace Ui { class VectorProcessingOperationDialogForm; }
43 
44 class CurrentExecutionImpl;
45 
46 namespace te
47 {
48  namespace common
49  {
50  class TaskProgress;
51  }
52 
53  namespace da
54  {
55  class DataAccess;
56  class DataAccessPtr;
57  }
58 
59  namespace qt
60  {
61  namespace widgets
62  {
63  class ProgressViewerTaskWidget;
64  }
65  }
66 
67  namespace vp
68  {
69  class AbstractOperation;
70  class AbstractParameters;
71  class OperationThreadManager;
72  enum class ProgressState;
73  enum class OperationResult;
74 
75  namespace qt
76  {
77  class InputDataAccessWidget;
78  class OutputDataAccessWidget;
79  class SpecificParametersWidget;
80 
82  {
83  Q_OBJECT
84 
85  signals:
86 
88 
90 
91  public:
92 
93  void processingStateChanged(const te::vp::ProgressState& newState) override
94  {
95  emit processingStateChangedSignal(newState);
96  }
97 
98  void processingFinished(const te::vp::OperationResult& result) override
99  {
100  emit processingFinishedSignal(result);
101  }
102  };
103 
104 
105  /*!
106  \class VectorProcessingOperationDialog
107 
108  \brief Implements a dialog used to execute a vector processing operation
109  */
111  {
112  Q_OBJECT
113 
114  public:
115 
116  /*!
117  \brief Constructor.
118  */
119  VectorProcessingOperationDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
120 
121  /*!
122  \brief Destructor.
123  */
125 
126  public:
127 
128  /*!
129  \brief Returns the internal widget
130 
131  \return Pointer to Qt Widget InputDataAccessItemWidgetForm
132  */
133  Ui::VectorProcessingOperationDialogForm* getForm() const;
134 
135  /*!
136  \brief Inits the dialog by setting the the operation to be executed in interface and the list of available input layers
137 
138  \param operation Pointer to a TerraLib VP operation
139  \param layers The list of available input layers
140 
141  \note NOT take the ownership of this object
142  */
143  void init(const std::string& operationName, const std::list<te::map::AbstractLayerPtr>& layers);
144 
146 
147  std::list<te::map::AbstractLayerPtr> getOutputLayers();
148 
149  void keyPressEvent(QKeyEvent* event);
150 
151  protected:
152 
153  void setDialogOnExecution(bool onExecution);
154 
156 
157  protected slots:
158 
160 
162 
164 
165  void onClose();
166 
167  /*!
168  \brief Interface tool button to execute the vectorial process operation
169  */
171 
173 
174  private:
175 
176  std::unique_ptr<Ui::VectorProcessingOperationDialogForm> m_ui; //!< Pointer to Qt widget
177 
178  te::vp::qt::InputDataAccessWidget* m_inputDataWidget; //!< TerraLib Qt component used to get input data access
179 
180  te::vp::qt::OutputDataAccessWidget* m_outputDataWidget; //!< TerraLib Qt component used to get output data access
181 
182  te::vp::qt::SpecificParametersWidget* m_specificParamsWidget; //!< TerraLib Qt component with specific parameters for each operation
183 
184  std::string m_operationName; //!< The name of the operation to be created and executed
185 
186  te::qt::widgets::ProgressViewerTaskWidget* m_progressViewer; //!< TerraLib Qt component to represent a progress viewer
187 
188  QtOperationThreadManagerListener m_processListener; //!< A listener to the status of the execution
189 
190  std::unique_ptr< CurrentExecutionImpl > m_run; //!< The implementation of one execution
191 
192  std::vector<te::da::DataAccessPtr> m_vecOverallOutputDataAccess; //!< Stores all the outputs considering all the executions
193  };
194  } // end namespace qt
195  } // end namespace qt
196 } // end namespace qt
197 
198 
199 #endif // __TERRALIB_VP_QT_INTERNAL_VECTORPROCESSINGOPERATIONDIALOG_H
200 
A progress viewer for a unique task.
Abstract class used to define an operation.
Abstract class used to define the input/ ouptut parameters for TerraAmazon Operations.
Implements a widget used to return a set of Data Access object.
void processingFinishedSignal(const te::vp::OperationResult &result)
void processingStateChanged(const te::vp::ProgressState &newState) override
void processingFinished(const te::vp::OperationResult &result) override
void processingStateChangedSignal(const te::vp::ProgressState &newState)
Abstract class used do define a component to set specific parameters for each operation.
Implements a dialog used to execute a vector processing operation.
QtOperationThreadManagerListener m_processListener
A listener to the status of the execution.
te::vp::qt::SpecificParametersWidget * m_specificParamsWidget
TerraLib Qt component with specific parameters for each operation.
te::vp::qt::OutputDataAccessWidget * m_outputDataWidget
TerraLib Qt component used to get output data access.
std::unique_ptr< Ui::VectorProcessingOperationDialogForm > m_ui
Pointer to Qt widget.
std::unique_ptr< CurrentExecutionImpl > m_run
The implementation of one execution.
VectorProcessingOperationDialog(QWidget *parent=0, Qt::WindowFlags f=0)
Constructor.
void init(const std::string &operationName, const std::list< te::map::AbstractLayerPtr > &layers)
Inits the dialog by setting the the operation to be executed in interface and the list of available i...
te::vp::OperationResult getResult() const
void onProcessingFinished(const te::vp::OperationResult &result)
std::string m_operationName
The name of the operation to be created and executed.
te::vp::AbstractParameters * createParametersForOperation(te::vp::AbstractOperation *operation, QString &errorMessage)
te::qt::widgets::ProgressViewerTaskWidget * m_progressViewer
TerraLib Qt component to represent a progress viewer.
std::vector< te::da::DataAccessPtr > m_vecOverallOutputDataAccess
Stores all the outputs considering all the executions.
std::list< te::map::AbstractLayerPtr > getOutputLayers()
te::vp::qt::InputDataAccessWidget * m_inputDataWidget
TerraLib Qt component used to get input data access.
void onExecuteOperationToolButtonPressed()
Interface tool button to execute the vectorial process operation.
Ui::VectorProcessingOperationDialogForm * getForm() const
Returns the internal widget.
void onProcessingStateChanged(const te::vp::ProgressState &newState)
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