DisplayWindow.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 DisplayWindow.h
22 
23  \brief A simple main window to show example of TerraLib Graph.
24 */
25 
26 #ifndef __TERRALIB_EXAMPLES_QT_TOOLS_INTERNAL_GRAPHDISPLAYWINDOW_H
27 #define __TERRALIB_EXAMPLES_QT_TOOLS_INTERNAL_GRAPHDISPLAYWINDOW_H
28 
29 // TerarLib
30 #ifndef Q_MOC_RUN
33 #endif
34 
35 // Qt
36 #include <QMainWindow>
37 
38 // STL
39 #include <list>
40 #include <vector>
41 
42 // Forward declarations
43 namespace te
44 {
45  namespace da
46  {
47  class DataSource;
48  }
49 
50  namespace graph
51  {
52  class AbstractGraph;
53  }
54 
55  namespace se
56  {
57  class Style;
58  }
59 
60  namespace qt
61  {
62  namespace widgets
63  {
64  class AbstractTool;
65  class MapDisplay;
66  }
67  }
68 }
69 
70 // Forward declarations
71 class QAction;
72 class QPointF;
73 class QToolBar;
74 
75 /*!
76  \class DisplayWindow
77 
78  \brief A simple main window to show example of TerraLib Qt Tools.
79 */
80 class DisplayWindow : public QMainWindow
81 {
82  Q_OBJECT
83 
84  public:
85 
86  /** @name Initializer Methods
87  * Methods related to instantiation and destruction.
88  */
89  //@{
90 
91  /*! \brief Constructor */
92  DisplayWindow(QWidget* parent = 0, Qt::WindowFlags f = 0);
93 
94  /*! \brief Destructor. */
95  ~DisplayWindow();
96 
97  //@}
98 
99  void addGraph(te::graph::AbstractGraph* graph, te::gm::Envelope extent, te::se::Style* s = 0);
100  void addRasterLayer(std::string path, std::string name);
101  void addVectorialLayer(std::string path, int srid);
102 
103  void setPNGPrefix(std::string prefix);
104 
105  private:
106 
107  void setupActions();
108 
109  private slots:
110 
111  void onPanTriggered();
112  void onZoomAreaTriggered();
113  void onPNGTriggered();
114  void onCoordTracked(QPointF& coordinate);
115 
116  private:
117 
120 
121  std::list<te::map::AbstractLayerPtr> m_layers;
122 
123  QToolBar* m_toolBar;
124  QAction* m_setPan;
125  QAction* m_setZoomArea;
126  QAction* m_png;
127 
128  static std::size_t ms_id;
129 
130  int m_count;
131  std::string m_pngPrefix;
132 };
133 
134 #endif // __TERRALIB_EXAMPLES_QT_TOOLS_INTERNAL_GRAPHDISPLAYWINDOW_H
Enumerations related to Geometry module.
std::list< te::map::AbstractLayerPtr > m_layers
#define slots
QAction * m_setPan
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
Definition: Style.h:65
void MapDisplay()
It retrieves data from a data source, create a set of layer and show map display. ...
This is the base class for Layers.
A widget to control the display of a set of layers.
This class defines an interface for objects that can receive application events and respond to them...
Definition: AbstractTool.h:63
An Envelope defines a 2D rectangular region.
A simple main window to show example of TerraLib Qt Tools.
Definition: DisplayWindow.h:80
Abstract class used to define the main functions of graph struct. All graph implementations must used...
Definition: AbstractGraph.h:55
URI C++ Library.
Definition: Attributes.h:37
te::qt::widgets::AbstractTool * m_tool
QAction * m_setZoomArea
QToolBar * m_toolBar
static std::size_t ms_id
void DataSource()
QAction * m_png
te::qt::widgets::MapDisplay * m_display
std::string m_pngPrefix