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 #include "../../../../qt/widgets/canvas/Canvas.h"
35 #include "../client/DataTypes.h"
36 
37 // Qt
38 #include <QFrame>
39 
40 // STL
41 #include <memory>
42 
43 namespace te
44 {
45  namespace ws
46  {
47  namespace ogc
48  {
49  namespace wms
50  {
51  namespace qt
52  {
53 
54  /*!
55  \class WMSLayerDisplay
56 
57  \brief A map display for a WMSGetMapResponse.
58  */
59  class TEOGCWMSQTEXPORT WMSLayerDisplay : public QFrame
60  {
61  Q_OBJECT
62 
63  public:
64 
65  WMSLayerDisplay(QWidget* parent = 0, Qt::WindowFlags f = 0);
66 
67  ~WMSLayerDisplay();
68 
69  /*!
70  * \brief Draws a WMSGetMapResponse in the preview Canvas.
71  * \param response WMSGetMapResponse to draw.
72  */
73  void draw(const te::ws::ogc::wms::WMSGetMapResponse& response);
74 
75  void clear();
76 
77  protected:
78 
79  void paintEvent(QPaintEvent* e);
80 
81  void resizeEvent(QResizeEvent* e);
82 
83  private:
84 
85  std::unique_ptr<te::qt::widgets::Canvas> m_canvas;
86  };
87 
88  }
89  }
90  }
91  }
92 }
93 
94 #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