MultiImager.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 MultiImager.h
22 
23  \brief
24 */
25 
27 
28 // Qt
29 #include <QtCore/QEventLoop>
30 #include <QtCore/QObject>
31 
32 // STL
33 #include <memory>
34 #include <iostream>
35 
36 class MultiImager : public QObject
37 {
38  Q_OBJECT
39 
40  public:
41 
42  MultiImager(QObject* parent=0);
43 
44  ~MultiImager();
45 
47 
48  void refresh();
49 
50  protected:
51 
52  std::auto_ptr<te::qt::widgets::MultiThreadMapDisplay> m_display;
53 };
54 
56 QObject(parent)
57 {
58 }
59 
61 {
62 }
63 
65 {
66  m_display.reset(display);
67 }
68 
69 inline void MultiImager::refresh()
70 {
71  m_display->refresh();
72 
73  QEventLoop q;
74 
75  connect(m_display.get(), SIGNAL(drawLayersFinished(const QMap<QString, QString>&)), &q, SLOT(quit()));
76 
77  q.exec();
78  }
std::auto_ptr< te::qt::widgets::MultiThreadMapDisplay > m_display
Definition: MultiImager.h:52
void setMapDisplay(te::qt::widgets::MultiThreadMapDisplay *display)
Definition: MultiImager.h:64
A multi thread Qt4 widget to control the display of a set of layers.
void refresh()
Definition: MultiImager.h:69
MultiImager(QObject *parent=0)
Definition: MultiImager.h:55
A multi thread Qt4 widget to control the display of a set of layers.