qt/rastervisual/MainWindow.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 MainWindow.h
22 
23  \brief A simple main window to show example of TerraLib Qt Tools.
24 */
25 
26 #ifndef __TERRALIB_EXAMPLES_QT_TOOLS_INTERNAL_TOOLS_H
27 #define __TERRALIB_EXAMPLES_QT_TOOLS_INTERNAL_TOOLS_H
28 
29 // TerarLib
32 
33 // Qt
34 #include <QMainWindow>
35 
36 // STL
37 #include <list>
38 #include <vector>
39 
40 // Forward declarations
41 namespace te
42 {
43  namespace da
44  {
45  class DataSource;
46  }
47 
48  namespace map
49  {
50  class AbstractLayer;
51  }
52 
53  namespace se
54  {
55  class Style;
56  class RasterSymbolizer;
57  }
58 
59  namespace qt
60  {
61  namespace widgets
62  {
63  class AbstractTool;
64  class MapDisplay;
65  class RasterSymbolizerWidget;
66  }
67  }
68 }
69 
70 // Forward declarations
71 class QAction;
72 class QContextMenuEvent;
73 class QPointF;
74 class QMenu;
75 class QToolBar;
76 
77 /*!
78  \class MainWindow
79 
80  \brief A simple main window to show example of TerraLib Qt Tools.
81 */
82 class MainWindow : public QMainWindow
83 {
84  Q_OBJECT
85 
86  public:
87 
88  /** @name Initializer Methods
89  * Methods related to instantiation and destruction.
90  */
91  //@{
92 
93  /*! \brief Constructor */
94  MainWindow(QWidget* parent = 0, Qt::WindowFlags f = 0);
95 
96  /*! \brief Destructor. */
97  ~MainWindow();
98 
99  //@}
100 
101 
102  void addRasterLayer(const QString& path);
103 
104  private:
105 
106  void setupActions();
107  void setupDockWindow();
108  void contextMenuEvent(QContextMenuEvent* e);
109  void updateDisplay();
110  void startTools();
111  void checkToolsStatus();
112 
113  private slots:
114 
115  void onPanTriggered();
116  void onZoomInTriggered();
117  void onZoomOutTriggered();
118  void onZoomAreaTriggered();
119  void onCoordTracked(QPointF& coordinate);
120  void onReadPixelTriggered();
121  void onRasterStyleTriggered();
122  void onFileSelected(QString s);
123  void onSymbolizerUpdated();
124 
125 
126  private:
127 
130 
131  std::vector<te::da::DataSource*> m_ds;
132  std::list<te::map::AbstractLayer*> m_layers;
133 
134  QList<QAction*> m_actions;
135  QToolBar* m_toolBar;
136  QMenu* m_menu;
137 
138  static std::size_t ms_id;
139 
141 
143 
146 
147 };
148 
149 #endif // __TERRALIB_EXAMPLES_QT_TOOLS_INTERNAL_TOOLS_H
Enumerations related to Geometry module.
#define slots
te::qt::widgets::ProgressViewerDialog * m_dlgViewer
This is the base class for layers.
Definition: AbstractLayer.h:77
A widget used to configure a Raster Symbolizer SE element.
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
te::qt::widgets::RasterSymbolizerWidget * m_rvW
std::list< te::map::AbstractLayer * > m_layers
te::qt::widgets::AbstractTool * m_tool
URI C++ Library.
Definition: Attributes.h:37
This class controls how a set of layers are displayed.
te::qt::widgets::MapDisplay * m_display
A progress dialog.
std::vector< te::da::DataSource * > m_ds
void DataSource()
static std::size_t ms_id
A simple main window to show example of TerraLib Qt Tools.
QList< QAction * > m_actions