This class represents a thread responsible to draw a given layer. Basically, this class receives draw layer requests and generates a QImage as result. More...
#include <DrawLayerThread.h>
Signals | |
| void | drawLayerFinished (const int &index, const QImage &image) |
| This signal is emitted when the draw process ends. More... | |
| void | feedback (const QImage &image) |
| This signal is emitted during the draw process. More... | |
Public Member Functions | |
| void | draw (te::map::AbstractLayer *layer, const te::gm::Envelope &box, int srid, const QSize &size, const int &index) |
| This method is used to request the draw of the given layer. More... | |
| bool | finishedWithSuccess () const |
| This method tells if the thread finished with success. More... | |
| QString | getErrorMessage () const |
| This method returns an error message if the thread has not finished with success. Otherwise, the error message is empty. More... | |
| te::map::AbstractLayer * | getLayer () const |
| This method returns the layer handled by this thread. More... | |
Initializer Methods | |
Methods related to instantiation and destruction. | |
| DrawLayerThread (QObject *parent=0) | |
| It constructs a new thread responsible to draw a given layer. More... | |
| ~DrawLayerThread () | |
| Destructor. More... | |
Protected Slots | |
| void | onFinished () |
| void | onStarted () |
| void | sendFeedback () |
Protected Member Functions | |
| void | run () |
Protected Attributes | |
| te::gm::Envelope | m_env |
| The interest area to draw the layer. More... | |
| QString | m_errorMessage |
| A string that contains an error message. More... | |
| QTimer | m_feedback |
| Timer used to send feedback. The feedback will be sent right after timeout() QTimer's signal. More... | |
| bool | m_finishedWithSuccess |
| A flag that indicates if the layer could be drawn. More... | |
| QImage | m_image |
| The image that will be generated during the draw process. More... | |
| int | m_index |
| An optional index that can be provided by the caller to keep the draw order. More... | |
| int | m_interval |
| Interval used to send feedbacks. More... | |
| te::map::AbstractLayer * | m_layer |
| The layer that will be drawn. More... | |
| QMutex | m_mutex |
| Controls the serialization between threads. More... | |
| int | m_srid |
| The SRS to be used to draw the layer objects. More... | |
This class represents a thread responsible to draw a given layer. Basically, this class receives draw layer requests and generates a QImage as result.
Definition at line 55 of file DrawLayerThread.h.
| te::qt::widgets::DrawLayerThread::DrawLayerThread | ( | QObject * | parent = 0 | ) |
It constructs a new thread responsible to draw a given layer.
| parent | The thread's parent. |
Definition at line 33 of file DrawLayerThread.cpp.
References m_feedback, onFinished(), onStarted(), and sendFeedback().
| te::qt::widgets::DrawLayerThread::~DrawLayerThread | ( | ) |
Destructor.
Definition at line 43 of file DrawLayerThread.cpp.
| void te::qt::widgets::DrawLayerThread::draw | ( | te::map::AbstractLayer * | layer, |
| const te::gm::Envelope & | box, | ||
| int | srid, | ||
| const QSize & | size, | ||
| const int & | index | ||
| ) |
This method is used to request the draw of the given layer.
| layer | The layer that will be draw. |
| box | The interest area to draw the layer. |
| srid | The SRS to be used to draw the layer objects. |
| size | The result size, in pixels; e.g. (800 x 600). |
| index | An optional index that can be provided by the caller to keep the draw order. |
Definition at line 48 of file DrawLayerThread.cpp.
|
signal |
This signal is emitted when the draw process ends.
| index | The thread index. |
| image | The final result of draw process. |
|
signal |
This signal is emitted during the draw process.
| image | The partial result of draw process. |
| bool te::qt::widgets::DrawLayerThread::finishedWithSuccess | ( | ) | const |
This method tells if the thread finished with success.
Definition at line 74 of file DrawLayerThread.cpp.
Referenced by te::qt::widgets::MultiThreadMapDisplay::onDrawLayerFinished().
| QString te::qt::widgets::DrawLayerThread::getErrorMessage | ( | ) | const |
This method returns an error message if the thread has not finished with success. Otherwise, the error message is empty.
Definition at line 79 of file DrawLayerThread.cpp.
Referenced by te::qt::widgets::MultiThreadMapDisplay::onDrawLayerFinished().
| te::map::AbstractLayer * te::qt::widgets::DrawLayerThread::getLayer | ( | ) | const |
This method returns the layer handled by this thread.
Definition at line 84 of file DrawLayerThread.cpp.
Referenced by te::qt::widgets::MultiThreadMapDisplay::onDrawLayerFinished().
|
protectedslot |
Definition at line 135 of file DrawLayerThread.cpp.
Referenced by DrawLayerThread().
|
protectedslot |
Definition at line 125 of file DrawLayerThread.cpp.
Referenced by DrawLayerThread().
|
protected |
Definition at line 89 of file DrawLayerThread.cpp.
References te::qt::widgets::Canvas::calcAspectRatio(), te::qt::widgets::Canvas::clear(), te::common::NO_CONNECTION_AVAILABLE, and te::qt::widgets::Canvas::setWindow().
|
protectedslot |
Definition at line 130 of file DrawLayerThread.cpp.
Referenced by DrawLayerThread().
|
protected |
The interest area to draw the layer.
Definition at line 134 of file DrawLayerThread.h.
|
protected |
A string that contains an error message.
Definition at line 142 of file DrawLayerThread.h.
|
protected |
Timer used to send feedback. The feedback will be sent right after timeout() QTimer's signal.
Definition at line 139 of file DrawLayerThread.h.
Referenced by DrawLayerThread().
|
protected |
A flag that indicates if the layer could be drawn.
Definition at line 141 of file DrawLayerThread.h.
|
protected |
The image that will be generated during the draw process.
Definition at line 137 of file DrawLayerThread.h.
|
protected |
An optional index that can be provided by the caller to keep the draw order.
Definition at line 136 of file DrawLayerThread.h.
|
protected |
Interval used to send feedbacks.
Definition at line 140 of file DrawLayerThread.h.
|
protected |
The layer that will be drawn.
Definition at line 133 of file DrawLayerThread.h.
|
protected |
Controls the serialization between threads.
Definition at line 138 of file DrawLayerThread.h.
|
protected |
The SRS to be used to draw the layer objects.
Definition at line 135 of file DrawLayerThread.h.