All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::qt::widgets::DrawLayerThread Class Reference

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>

Inheritance diagram for te::qt::widgets::DrawLayerThread:

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::AbstractLayergetLayer () 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::AbstractLayerm_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...
 

Detailed Description

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.

Constructor & Destructor Documentation

te::qt::widgets::DrawLayerThread::DrawLayerThread ( QObject *  parent = 0)

It constructs a new thread responsible to draw a given layer.

Parameters
parentThe 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.

Member Function Documentation

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.

Parameters
layerThe layer that will be draw.
boxThe interest area to draw the layer.
sridThe SRS to be used to draw the layer objects.
sizeThe result size, in pixels; e.g. (800 x 600).
indexAn optional index that can be provided by the caller to keep the draw order.

Definition at line 48 of file DrawLayerThread.cpp.

void te::qt::widgets::DrawLayerThread::drawLayerFinished ( const int &  index,
const QImage &  image 
)
signal

This signal is emitted when the draw process ends.

Parameters
indexThe thread index.
imageThe final result of draw process.
void te::qt::widgets::DrawLayerThread::feedback ( const QImage &  image)
signal

This signal is emitted during the draw process.

Parameters
imageThe 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().

void te::qt::widgets::DrawLayerThread::onFinished ( )
protectedslot

Definition at line 139 of file DrawLayerThread.cpp.

Referenced by DrawLayerThread().

void te::qt::widgets::DrawLayerThread::onStarted ( )
protectedslot

Definition at line 129 of file DrawLayerThread.cpp.

Referenced by DrawLayerThread().

void te::qt::widgets::DrawLayerThread::run ( )
protected
void te::qt::widgets::DrawLayerThread::sendFeedback ( )
protectedslot

Definition at line 134 of file DrawLayerThread.cpp.

Referenced by DrawLayerThread().

Member Data Documentation

te::gm::Envelope te::qt::widgets::DrawLayerThread::m_env
protected

The interest area to draw the layer.

Definition at line 134 of file DrawLayerThread.h.

QString te::qt::widgets::DrawLayerThread::m_errorMessage
protected

A string that contains an error message.

Definition at line 142 of file DrawLayerThread.h.

QTimer te::qt::widgets::DrawLayerThread::m_feedback
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().

bool te::qt::widgets::DrawLayerThread::m_finishedWithSuccess
protected

A flag that indicates if the layer could be drawn.

Definition at line 141 of file DrawLayerThread.h.

QImage te::qt::widgets::DrawLayerThread::m_image
protected

The image that will be generated during the draw process.

Definition at line 137 of file DrawLayerThread.h.

int te::qt::widgets::DrawLayerThread::m_index
protected

An optional index that can be provided by the caller to keep the draw order.

Definition at line 136 of file DrawLayerThread.h.

int te::qt::widgets::DrawLayerThread::m_interval
protected

Interval used to send feedbacks.

Definition at line 140 of file DrawLayerThread.h.

te::map::AbstractLayer* te::qt::widgets::DrawLayerThread::m_layer
protected

The layer that will be drawn.

Definition at line 133 of file DrawLayerThread.h.

QMutex te::qt::widgets::DrawLayerThread::m_mutex
protected

Controls the serialization between threads.

Definition at line 138 of file DrawLayerThread.h.

int te::qt::widgets::DrawLayerThread::m_srid
protected

The SRS to be used to draw the layer objects.

Definition at line 135 of file DrawLayerThread.h.


The documentation for this class was generated from the following files: