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 // TerraLib
30 #ifndef Q_MOC_RUN
31 #include "../../../maptools/AbstractLayer.h"
32 #include "../../../qt/widgets/rp/RpToolsWidget.h"
33 #include "../../../rp/Filter.h"
34 #endif
35 #include "../../../se/ChannelSelection.h"
36 #include "../Config.h"
37 #include "InputLayerWidget.h"
38 #include "OutputRasterWidget.h"
39 
40 // STL
41 #include <memory>
42 
43 //Boost
44 #include <boost/numeric/ublas/matrix.hpp>
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 
71  class TEQTWIDGETSEXPORT FilterDialogForm : public QDialog
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  public slots:
103 
104  void onFilterTypeComboBoxActivated(int index);
105 
106  void onIterationsChanged(int iteration);
107 
108  void onMaskToolButtonClicked();
109 
110  void onLoadMaskToolButtonClicked();
111 
112  void onPreviewCheckBoxToggled(bool isChecked);
113 
114  void onOkPushButtonClicked();
115 
116  void apply();
117 
118  void layerChanged();
119 
120  void onEnvelopeAcquired(te::gm::Envelope env);
121 
122  void onMapDisplayExtentChanged();
123 
124  signals:
125 
126  void geomAquired(te::gm::Polygon* poly);
127 
128  void addLayer(te::map::AbstractLayerPtr layer);
129 
130  void closeTool();
131 
132  protected:
133 
134  bool execute();
135 
136  void listBands();
137 
138  void listFilterTypes();
139 
140  void getRasterFromROI();
141 
142  void applyPreview();
143 
144  void drawPreview(te::rst::Raster* raster);
145 
146  void drawGeom();
147 
148  te::se::ChannelSelection* getChannelSelection();
149 
150  void clearCanvas();
151 
152  void closeEvent(QCloseEvent* e);
153 
154  private:
155 
156  std::auto_ptr<Ui::FilterDialogForm> m_ui;
157  std::unique_ptr<te::qt::widgets::RpToolsWidget> m_navigator;
158 
167  std::auto_ptr<te::qt::widgets::DoubleListWidget> m_doubleListWidget;
168 
169  boost::numeric::ublas::matrix<double> m_window; //!< User defined convolution window.
170  };
171  } // end namespace widgets
172  } // end namespace qt
173 } // end namespace te
174 
175 #endif // __TERRALIB_QT_WIDGETS_RP_INTERNAL_FILTERDIALOGFORM_H
te::map::AbstractLayerPtr m_layer
te::qt::widgets::OutputRasterWidget * m_outputWidget
std::unique_ptr< te::qt::widgets::RpToolsWidget > m_navigator
A widget to control the display of a set of layers.
Definition: MapDisplay.h:69
boost::numeric::ublas::matrix< double > m_window
User defined convolution window.
This file has the OutputRasterWidget class.
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
This file has the InputLayerWidget class.
An abstract class for raster data strucutures.
Definition: Raster.h:71
URI C++ Library.
std::auto_ptr< te::qt::widgets::DoubleListWidget > m_doubleListWidget
te::qt::widgets::InputLayerWidget * m_inputWidget
This class is used to set output layer.
This class is used to set input layer.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:74
Filter input parameters.
Definition: Filter.h:55
te::map::AbstractLayerPtr m_outputLayer
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Definition: Polygon.h:50
std::auto_ptr< Ui::FilterDialogForm > m_ui
te::qt::widgets::MapDisplay * m_mapDisplay
#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
ChannelSelection specifies the false-color channel selection for a multi-spectral raster source (such...