FilterDialogForm.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/FilterDialogForm.h
22 
23  \brief This file has the FilterDialogForm class.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_RP_INTERNAL_FILTERDIALOGFORM_H
27 #define __TERRALIB_QT_WIDGETS_RP_INTERNAL_FILTERDIALOGFORM_H
28 
29 #ifndef Q_MOC_RUN
30 // TerraLib
31 #include "../../../maptools/AbstractLayer.h"
32 #include "../../../qt/widgets/rp/RpToolsWidget.h"
33 #include "../../../rp/Filter.h"
34 #include "../../../se/ChannelSelection.h"
35 #include "../Config.h"
36 #include "InputLayerWidget.h"
37 #include "OutputRasterWidget.h"
38 
39 // STL
40 #include <memory>
41 
42 //Boost
43 #include <boost/numeric/ublas/matrix.hpp>
44 #endif
45 
46 // Qt
47 #include <QDialog>
48 #include <QActionGroup>
49 
50 namespace Ui { class FilterDialogForm; }
51 
52 namespace te
53 {
54  namespace qt
55  {
56  namespace af
57  {
58  namespace evt
59  {
60  struct Event;
61  }
62  }
63 
64  namespace widgets
65  {
66  //forward declaration
67  class Canvas;
68  class MapDisplay;
69  class DoubleListWidget;
70 
72  {
73  Q_OBJECT
74 
75  public:
76 
77  FilterDialogForm(QWidget* parent = 0);
78 
80 
81  bool isComplete() const;
82 
83  public:
84 
85  /*!
86  \brief This method is used to set the selected layer for filter operation
87 
88  \param layer The layer ptr
89 
90  \note This layer MUST HAVE a valid raster object.
91  */
92  void setParams();
93 
94  void setList(std::list<te::map::AbstractLayerPtr>& layerList, te::map::AbstractLayerPtr selectedlayer);
95 
96  void setMapDisplay(te::qt::widgets::MapDisplay* mapDisplay);
97 
98  void setActionGroup(QActionGroup* actionGroup);
99 
100  te::rp::Filter::InputParameters getInputParams();
101 
102  void onMapDisplayExtentChanged();
103 
104  public slots:
105 
106  void onFilterTypeComboBoxActivated(int index);
107 
108  void onIterationsChanged(int iteration);
109 
110  void onMaskToolButtonClicked();
111 
112  void onLoadMaskToolButtonClicked();
113 
114  void onPreviewCheckBoxToggled(bool isChecked);
115 
116  void onOkPushButtonClicked();
117 
118  void layerChanged();
119 
120  void onEnvelopeAcquired(te::gm::Envelope env);
121 
122  signals:
123 
124  void addLayer(te::map::AbstractLayerPtr layer);
125 
126  void closeTool();
127 
128  protected:
129 
130  bool execute();
131 
132  void listBands();
133 
134  void listFilterTypes();
135 
136  void getRasterFromROI();
137 
138  void applyPreview();
139 
140  void drawPreview(te::rst::Raster* raster);
141 
142  void drawGeom();
143 
144  te::se::ChannelSelection* getChannelSelection();
145 
146  void clearCanvas();
147 
148  void closeEvent(QCloseEvent* e);
149 
150  private:
151 
152  std::unique_ptr<Ui::FilterDialogForm> m_ui;
153  std::unique_ptr<te::qt::widgets::RpToolsWidget> m_navigator;
154 
163  std::unique_ptr<te::qt::widgets::DoubleListWidget> m_doubleListWidget;
164 
165  boost::numeric::ublas::matrix<double> m_window; //!< User defined convolution window.
166  };
167  } // end namespace widgets
168  } // end namespace qt
169 } // end namespace te
170 
171 #endif // __TERRALIB_QT_WIDGETS_RP_INTERNAL_FILTERDIALOGFORM_H
#define slots
te::map::AbstractLayerPtr m_layer
te::qt::widgets::OutputRasterWidget * m_outputWidget
void MapDisplay()
It retrieves data from a data source, create a set of layer and show map display. ...
std::unique_ptr< te::qt::widgets::RpToolsWidget > m_navigator
std::unique_ptr< te::qt::widgets::DoubleListWidget > m_doubleListWidget
A widget to control the display of a set of layers.
boost::numeric::ublas::matrix< double > m_window
User defined convolution window.
This file has the OutputRasterWidget class.
An Envelope defines a 2D rectangular region.
This file has the InputLayerWidget class.
An abstract class for raster data strucutures.
URI C++ Library.
Definition: Attributes.h:37
te::qt::widgets::InputLayerWidget * m_inputWidget
std::unique_ptr< Ui::FilterDialogForm > m_ui
This class is used to set output layer.
This class is used to set input layer.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Filter input parameters.
Definition: rp/Filter.h:55
te::map::AbstractLayerPtr m_outputLayer
te::qt::widgets::MapDisplay * m_mapDisplay
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
ChannelSelection specifies the false-color channel selection for a multi-spectral raster source (such...