DrawThread.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 terralib/qt/widgets/canvas/DrawThread.h
22 
23 \brief Thread to draw a Layer in a PaintDevice.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_DRAWTHREAD_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_DRAWTHREAD_H
28 
29 //TerraLib
30 #include "../../../maptools/Enums.h"
31 #include "../Config.h"
32 
33 // Qt
34 #include <QColor>
35 #include <QObject>
36 #include <QRunnable>
37 
38 class QPaintDevice;
39 class QSize;
40 
41 namespace te
42 {
43  namespace gm
44  {
45  class Envelope;
46  }
47 
48  namespace map
49  {
50  class AbstractLayer;
51  }
52 
53  namespace qt
54  {
55  namespace widgets
56  {
57  class TEQTWIDGETSEXPORT DrawThread : public QObject, public QRunnable
58  {
59  Q_OBJECT
60 
61  public:
62 
63  DrawThread(QPaintDevice* dev, te::map::AbstractLayer* layer, te::gm::Envelope* env, const QColor& bckGround, int srid, double scale,
64  te::map::AlignType hAlign, te::map::AlignType vAlign);
65 
66  ~DrawThread();
67 
68  void run();
69 
70  bool hasFinished() const;
71 
72  QString errorMessage() const;
73 
74  QString layerId() const;
75 
76  Q_SIGNALS:
77 
78  void finished();
79 
80  protected:
81 
82  QPaintDevice* m_device;
83 
85 
87 
88  QColor m_bckGround;
89 
90  int m_srid;
91 
92  double m_scale;
93 
94  te::map::AlignType m_hAlign; //!< The display horizontal align.
95 
96  te::map::AlignType m_vAlign; //!< The display vertical align.
97 
98  public:
99 
100  bool m_cancel;
101 
102  protected:
103 
105 
106  QString m_errorMessage;
107  };
108  }
109  }
110 }
111 
112 #endif //__TERRALIB_QT_WIDGETS_INTERNAL_DRAWTHREAD_H
This is the base class for layers.
Definition: AbstractLayer.h:77
te::gm::Envelope * m_envelope
Definition: DrawThread.h:86
AlignType
This enum contains values to control the alignment of components (like Canvas and MapDisplay)...
Definition: Enums.h:125
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
URI C++ Library.
te::map::AbstractLayer * m_layer
Definition: DrawThread.h:84
QPaintDevice * m_device
Definition: DrawThread.h:82
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
te::map::AlignType m_hAlign
The display horizontal align.
Definition: DrawThread.h:94
te::map::AlignType m_vAlign
The display vertical align.
Definition: DrawThread.h:96