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 double &scale, 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...
 
QImage getImage () const
 This method returns the image result of the drawn layer. 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...
 
double m_scale
 Scale value used to draw the layer. 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.
te::qt::widgets::DrawLayerThread::~DrawLayerThread ( )

Destructor.

Member Function Documentation

void te::qt::widgets::DrawLayerThread::draw ( te::map::AbstractLayer layer,
const te::gm::Envelope box,
int  srid,
const double &  scale,
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. param scale The current scale of display.
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.
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.

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.

QImage te::qt::widgets::DrawLayerThread::getImage ( ) const

This method returns the image result of the drawn layer.

te::map::AbstractLayer* te::qt::widgets::DrawLayerThread::getLayer ( ) const

This method returns the layer handled by this thread.

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

Member Data Documentation

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

The interest area to draw the layer.

Definition at line 138 of file DrawLayerThread.h.

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

A string that contains an error message.

Definition at line 147 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 144 of file DrawLayerThread.h.

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

A flag that indicates if the layer could be drawn.

Definition at line 146 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 142 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 140 of file DrawLayerThread.h.

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

Interval used to send feedbacks.

Definition at line 145 of file DrawLayerThread.h.

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

The layer that will be drawn.

Definition at line 137 of file DrawLayerThread.h.

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

Controls the serialization between threads.

Definition at line 143 of file DrawLayerThread.h.

double te::qt::widgets::DrawLayerThread::m_scale
protected

Scale value used to draw the layer.

Definition at line 141 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 139 of file DrawLayerThread.h.


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