ArithmeticOpDialogForm.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/qt/widgets/rp/ArithmeticOpDialogForm.h
22 
23  \brief This file defines a class for a ArithmeticOp Dialog.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_RP_INTERNAL_ARITHMETICOPDIALOGFORM_H
27 #define __TERRALIB_QT_WIDGETS_RP_INTERNAL_ARITHMETICOPDIALOGFORM_H
28 
29 // TerraLib
30 #ifndef Q_MOC_RUN
31 #include "../../../maptools/AbstractLayer.h"
32 #endif
33 #include "../Config.h"
34 
35 #include "../../../rp/ArithmeticOperations.h"
36 #include "OutputRasterWidget.h"
37 
38 // STL
39 #include <memory>
40 
41 // Qt
42 #include <QComboBox>
43 #include <QDialog>
44 
45 
46 // Forward declaration
47 namespace Ui { class ArithmeticOpDialogForm; }
48 
49 namespace te
50 {
51  namespace qt
52  {
53  namespace widgets
54  {
55  /*!
56  \class ArithmeticOpDialogForm
57 
58  \brief This class is GUI used to define the arithmeticOp parameters for the RP arithmeticOp operation.
59  */
61  {
62  Q_OBJECT
63 
64  public:
65 
66  ArithmeticOpDialogForm(QWidget* parent = 0);
67 
69 
70  bool isComplete() const;
71 
72  public:
73 
74  void setList(std::list<te::map::AbstractLayerPtr>& layerList);
75 
76  std::string getUserDefinedExpression();
77 
78  std::string getExpression();
79 
80  te::map::AbstractLayerPtr getOutputLayer();
81 
82  std::map<std::string, te::map::AbstractLayer*> getMapLayer();
83 
84  std::vector<std::string> getBandsVec();
85 
86  te::rp::ArithmeticOperations::InputParameters paramsFromOpUserdDef();
87 
88  void closeEvent(QCloseEvent* e);
89 
90  public slots:
91 
92  void onAddLayerPushButtonClicked();
93  void onSearchLayerToolButtonPressed();
94 
95  void onSqrtPushButtonClicked();
96  void onParRightPushButtonClicked();
97  void onParLeftPushButtonClicked();
98  void onSinPushButtonClicked();
99  void onASinPushButtonClicked();
100  void onExpPushButtonClicked();
101  void onCosPushButtonClicked();
102  void onACosPushButtonClicked();
103  void onLogPushButtonClicked();
104  void onTanPushButtonClicked();
105  void onATanPushButtonClicked();
106  void onLnPushButtonClicked();
107 
108  void onN0PushButtonClicked();
109  void onN1PushButtonClicked();
110  void onN2PushButtonClicked();
111  void onN3PushButtonClicked();
112  void onN4PushButtonClicked();
113  void onN5PushButtonClicked();
114  void onN6PushButtonClicked();
115  void onN7PushButtonClicked();
116  void onN8PushButtonClicked();
117  void onN9PushButtonClicked();
118  void onDotPushButtonClicked();
119  void onSignalPushButtonClicked();
120 
121  void onDivPushButtonClicked();
122  void onMultPushButtonClicked();
123  void onSubPushButtonClicked();
124  void onAddPushButtonClicked();
125  void onCePushButtonClicked();
126  void onCPushButtonClicked();
127  void onLoadPushButtonClicked();
128  void onSavePushButtonClicked();
129 
130  void onOkPushButtonClicked();
131 
132  signals:
133 
134  void addLayer(te::map::AbstractLayerPtr layer);
135 
136  void closeTool();
137 
138  protected:
139 
140  void getRasterBands(QComboBox* layer, int index, QComboBox* band);
141 
142  void updateExpressionHistory();
143 
144  bool execute();
145 
146  private:
147 
149 
150  std::vector<std::string> m_expressionHistory;
151 
153 
154  std::auto_ptr<Ui::ArithmeticOpDialogForm> m_ui;
155 
156  std::list<te::map::AbstractLayerPtr> m_layerList;
157 
159 
161 
162  std::map<std::string, te::map::AbstractLayer*> m_mapLayer;
163 
164  std::vector<std::string> m_bandsVec;
165 
166  std::string m_operation;
167 
168  int m_nLayer;
169  };
170 
171  } // end namespace widgets
172  } // end namespace qt
173 } // end namespace te
174 
175 #endif // __TERRALIB_QT_WIDGETS_RP_INTERNAL_ARITHMETICOPDIALOGFORM_H
This is the base class for layers.
Definition: AbstractLayer.h:76
std::auto_ptr< Ui::ArithmeticOpDialogForm > m_ui
std::list< te::map::AbstractLayerPtr > m_layerList
std::map< std::string, te::map::AbstractLayer * > m_mapLayer
This file has the OutputRasterWidget class.
URI C++ Library.
This class is used to set output layer.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
ArithmeticOperations input parameters.
This class is GUI used to define the arithmeticOp parameters for the RP arithmeticOp operation...
te::qt::widgets::OutputRasterWidget * m_outputWidget