WMSLayerDisplay.h
Go to the documentation of this file.
1 /* Copyright (C) 2001-2016 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/ws/ogc/wms/qt/WMSLayerDisplay.h
22 
23  \brief A display QFrame to draw previews for WMS data.
24 
25  \author Emerson Moraes
26 */
27 
28 #ifndef __TERRALIB_WS_OGC_WMS_QT_WMSLAYERDISPLAY_H
29 #define __TERRALIB_WS_OGC_WMS_QT_WMSLAYERDISPLAY_H
30 
31 #include "Config.h"
32 
33 //TerraLib
34 #ifndef Q_MOC_RUN
35 #include "../../../../qt/widgets/canvas/Canvas.h"
36 #include "../client/DataTypes.h"
37 #endif
38 
39 // Qt
40 #include <QFrame>
41 
42 // STL
43 #include <memory>
44 
45 namespace te
46 {
47  namespace ws
48  {
49  namespace ogc
50  {
51  namespace wms
52  {
53  namespace qt
54  {
55 
56  /*!
57  \class WMSLayerDisplay
58 
59  \brief A map display for a WMSGetMapResponse.
60  */
61  class TEOGCWMSQTEXPORT WMSLayerDisplay : public QFrame
62  {
63  Q_OBJECT
64 
65  public:
66 
67  WMSLayerDisplay(QWidget* parent = 0, Qt::WindowFlags f = 0);
68 
69  ~WMSLayerDisplay();
70 
71  /*!
72  * \brief Draws a WMSGetMapResponse in the preview Canvas.
73  * \param response WMSGetMapResponse to draw.
74  */
75  void draw(const te::ws::ogc::wms::WMSGetMapResponse& response);
76 
77  void clear();
78 
79  protected:
80 
81  void paintEvent(QPaintEvent* e);
82 
83  void resizeEvent(QResizeEvent* e);
84 
85  private:
86 
87  std::unique_ptr<te::qt::widgets::Canvas> m_canvas;
88  };
89 
90  }
91  }
92  }
93  }
94 }
95 
96 #endif // __TERRALIB_WS_OGC_WMS_QT_WMSLAYERDISPLAY_H
std::unique_ptr< te::qt::widgets::Canvas > m_canvas
URI C++ Library.
A map display for a WMSGetMapResponse.
The WMSGetMapResponse WMS 1.3.0 struct.
Definition: DataTypes.h:316
#define TEOGCWMSQTEXPORT
Definition: Config.h:66