A multi thread Qt4 widget to control the display of a set of layers. More...
#include <MultiThreadMapDisplay.h>
Public Types | |
enum | ResizePolicy { Fixed , Cut , Center } |
Defines the resize policy for map display. More... | |
Public Member Functions | |
virtual const te::gm::Envelope & | getExtent () const |
It returns the world extent showned by the MapDisplay. More... | |
virtual te::map::AlignType | getHAlign () const |
It returns the MapDisplay current horizontal align. More... | |
virtual std::list< AbstractLayerPtr > | getLayerList () const |
virtual int | getSRID () const |
It return the Spatial Reference System used by the Map Display. More... | |
virtual te::map::AlignType | getVAlign () const |
It returns the MapDisplay current vertical align. More... | |
virtual void | setAlign (te::map::AlignType h, te::map::AlignType v) |
It will set the align rendering of objects into the map display. Just successive drawings will be affected by this modification. More... | |
virtual void | setLayerList (const std::list< te::map::AbstractLayerPtr > &layers) |
It sets the layer list to be showed in the Map Display. More... | |
Initializer Methods | |
Methods related to instantiation and destruction. | |
MultiThreadMapDisplay (const QSize &size, const bool &showFeedback=true, QWidget *parent=0, Qt::WindowFlags f=0) | |
It constructs an empty multi thread map display with the given dimensions which is a child of parent, with widget flags set to f. More... | |
MultiThreadMapDisplay (QWidget *parent=0, const bool &showFeedback=true, Qt::WindowFlags f=0) | |
~MultiThreadMapDisplay () | |
Destructor. More... | |
Protected Attributes | |
te::gm::Envelope | m_extent |
The display extent. More... | |
te::map::AlignType | m_hAlign |
The display horizontal align. More... | |
std::list< te::map::AbstractLayerPtr > | m_layerList |
The layer list to be displayed. More... | |
int | m_srid |
The display SRS. More... | |
te::map::AlignType | m_vAlign |
The display vertical align. More... | |
Map Display Virtual Methods | |
Methods to configure the MapDisplay. | |
bool | m_cancel |
Copy Constructor and Assignment Operator | |
Copy constructor and assignment operator not allowed. | |
std::list< te::map::AbstractLayerPtr > | m_visibleLayers |
The set of visible layers. More... | |
std::vector< QRunnable * > | m_threads |
The set of threads used to draw the layer list. More... | |
std::map< std::string, QImage * > | m_images |
The set of images built by each thread. It will be used to compose the final result, keeping the layer list order. More... | |
bool | m_showFeedback |
A flag that indicates if the map display will show drawing feedback. More... | |
QMatrix | m_matrix |
Used to convert screen coordinates to world coordinates. More... | |
bool | m_synchronous |
A flag that indicates if the map display is synchronous or asynchronous. More... | |
ThreadManager * | m_tmger |
QCursor | m_oldCursor |
MultiThreadMapDisplay (const MultiThreadMapDisplay &rhs) | |
Copy constructor not allowed. More... | |
MultiThreadMapDisplay & | operator= (const MultiThreadMapDisplay &rhs) |
Assignment operator not allowed. More... | |
AbstractMapDisplay Methods | |
QPixmap * | m_displayPixmap |
This pixmap will be the result of all canvas pixmap drawing, i. e., the result of drawing all visible layers. More... | |
QPixmap * | m_draftPixmap |
The draft pixmap can be used to draw some feedback on map display. More... | |
std::vector< QPixmap * > | m_ownPixmapVec |
A vector of users own draft pixmap. More... | |
QColor | m_backgroundColor |
Background color. More... | |
ResizePolicy | m_resizePolicy |
Resize policy for this map display. More... | |
QSize | m_oldSize |
Stores the last size of map display on start resize event. More... | |
QTimer * | m_timer |
Timer to execute redraw on resize action. More... | |
int | m_interval |
Timeout interval in milliseconds to redraw. More... | |
bool | m_isDrawing |
A flag that indicates if the map display is drawing. More... | |
double | m_scale |
Current calculated scale. More... | |
int | m_overridedDpiX |
Overrided value of the DPI in the X-axis, so the scale can be correctly computed. More... | |
int | m_overridedDpiY |
Overrided value of the DPI in the X-axis, so the scale can be correctly computed. More... | |
double | m_minScale |
The minimun scale. More... | |
double | m_maxScale |
The maximum scale. More... | |
double | m_digitalization |
Factor used in digitalization. More... | |
te::qt::widgets::AbstractTool * | m_tool |
Pointer to the current tool being used. More... | |
ScaleWidget * | m_graphicScale |
Graphic scale pointer. More... | |
Grid * | m_grid |
Planar grid pointer. More... | |
std::size_t | m_blockPopUpCounter |
Flag used to block pop up in this component. More... | |
virtual void | changeData (te::map::AbstractLayerPtr, int nsrid=TE_UNKNOWN_SRS) |
unsigned int | getWidth () const |
It returns the MapDisplay current width in pixels. More... | |
unsigned int | getHeight () const |
It returns the MapDisplay current height in pixels. More... | |
double | getWidthMM () const |
It returns the MapDisplay current width in millimeters. More... | |
double | getHeightMM () const |
It returns the MapDisplay current height in millimeters. More... | |
virtual void | setSRID (const int &srid, bool doRefresh=true) |
It sets a new Spatial Reference System to be used by the Map Display. More... | |
virtual QPixmap * | getDisplayPixmap () const |
It returns the map display pixmap. More... | |
virtual QPixmap * | getDraftPixmap () const |
It returns the map display draft pixmap. More... | |
std::size_t | createMyOwnDraftPixmap () |
It creates a new user own display draft pixmap. More... | |
QPixmap * | getMyOwnDraftPixmap (std::size_t index) |
It returns the user own display draft pixmap. More... | |
void | removeMyOwnDraftPixmap (std::size_t index) |
It removes the user own display draft pixmap. More... | |
virtual void | setResizePolicy (const ResizePolicy &policy) |
Sets the resize policy to this map display. More... | |
virtual void | setResizeInterval (int msec) |
Sets the timeout interval in milliseconds to redraw on resize event. More... | |
virtual QColor | getBackgroundColor () |
Gets the map display background color. More... | |
virtual void | setBackgroundColor (const QColor &color) |
Sets the map display background color. More... | |
bool | isDrawing () const |
Returns if the map display is drawing. More... | |
virtual double | getScale () const |
Calculates and return the current scale. More... | |
virtual bool | setScale (const double &scale) |
Defines the scale and calculates envelope based on the requested scale. More... | |
virtual void | getDPI (int &dpiX, int &dpiY) const |
Returns the current values of the DPI in X-axis and in Y-axis. More... | |
virtual void | setOverrideDPI (int dpiX, int dpiY) |
Overrides the values of the DPI that had been acquired from the device. This is done in order to make the scale be correctly computed and allows the correct computation of sizes in millimeters. More... | |
virtual void | restoreDPI () |
Returns the default value of the DPI. In this case, the values from the device will be acquired. More... | |
virtual void | setCurrentTool (te::qt::widgets::AbstractTool *tool, const bool &delPrevious=true) |
Updates the current tool being used on te::qt::widgets::MapDisplay. More... | |
te::qt::widgets::AbstractTool * | getCurrentTool () |
Returns the current tool being used. More... | |
virtual void | setLimitScale (double minScale, double maxScale) |
Defines the min scale and max scale. More... | |
virtual double | getDigitalization () const |
Gets the digitalization factor. More... | |
virtual void | setDigitalization (double digitalization) |
Sets the digitalization factor. More... | |
ScaleWidget * | getGraphicScale () const |
Returns the pointer for the graphic scale object;. More... | |
Grid * | getGrid () const |
void | blockPopUp () |
void | unBlockPopUp () |
bool | isBlockedPopUp () |
virtual void | onResizeTimeout () |
void | extentChanged () |
void | displayPaintEvent (QPainter *) |
void | displaySridChanged () |
void | showGraphicScale (bool visible) |
Shows / hides the graphic scale. More... | |
void | showGrid (bool visible) |
virtual void | draw (te::map::AbstractLayer *layer, QPainter &painter) |
It displays the given layer. More... | |
virtual te::qt::widgets::Canvas * | getCanvas (te::map::AbstractLayer *layer, int type=QInternal::Pixmap) |
It retrieves an associated canvas to the given layer. More... | |
virtual void | resizeAllCanvas () |
It resizes all canvas of map display. More... | |
virtual void | adjustExtent (const QSize &oldSize, const QSize &size) |
It adjusts the map display extent based on resize policy. More... | |
virtual void | paintEvent (QPaintEvent *e) |
It assembles the final image and draws the widget. More... | |
AbstractMapDisplay Methods | |
void | setLayerList (const std::list< te::map::AbstractLayerPtr > &layers) |
void | setExtent (te::gm::Envelope &e, bool doRefresh=true) |
It sets the world visible area and refreshes the contents in the map display. More... | |
void | refresh (bool redraw=false) |
It updates the contents in the map display. More... | |
virtual QPointF | transform (const QPointF &p) |
Transforms the given point, in screen coordinates, to a point in world coordinates. More... | |
void | setSynchronous (bool on) |
void | updateLayer (te::map::AbstractLayerPtr layer, bool redraw=true) |
void | updateLayer (std::vector< te::map::AbstractLayerPtr > layers, bool redraw=true) |
void | resizeEvent (QResizeEvent *e) |
This event handler receives widget resize events wich are passed in the event parameter. More... | |
void | updateTransform () |
void | showFeedback (const QImage &) |
void | showFeedback () |
void | onDrawLayerFinished (const int &index, const QImage &image) |
void | onRenderingFinished () |
void | onDrawCanceled () |
void | drawLayersFinished (const QMap< QString, QString > &errors) |
This signal is emitted when the draw process ends. i.e. when all layers have been drawn. More... | |
A multi thread Qt4 widget to control the display of a set of layers.
Definition at line 62 of file MultiThreadMapDisplay.h.
|
inherited |
Defines the resize policy for map display.
Enumerator | |
---|---|
Fixed | Document-me! |
Cut | Document-me! |
Center | Document-me! |
Definition at line 82 of file MapDisplay.h.
te::qt::widgets::MultiThreadMapDisplay::MultiThreadMapDisplay | ( | const QSize & | size, |
const bool & | showFeedback = true , |
||
QWidget * | parent = 0 , |
||
Qt::WindowFlags | f = 0 |
||
) |
It constructs an empty multi thread map display with the given dimensions which is a child of parent, with widget flags set to f.
size | The map display size. |
showFeedback | A flag that indicates if the map display will show drawing feedback. |
parent | The widget's parent. |
f | Widget window flags. |
te::qt::widgets::MultiThreadMapDisplay::MultiThreadMapDisplay | ( | QWidget * | parent = 0 , |
const bool & | showFeedback = true , |
||
Qt::WindowFlags | f = 0 |
||
) |
te::qt::widgets::MultiThreadMapDisplay::~MultiThreadMapDisplay | ( | ) |
Destructor.
|
private |
Copy constructor not allowed.
rhs | The right-hand-side copy that would be used to copy from. |
|
protectedvirtualinherited |
It adjusts the map display extent based on resize policy.
oldSize | The size before the resize. |
size | The size after the resize. |
|
inherited |
|
virtualinherited |
|
inherited |
It creates a new user own display draft pixmap.
|
signalinherited |
this signal is issued to others draw on this display.
|
signalinherited |
This signal is sent to others know that the projection was changed.
|
protectedvirtualinherited |
It displays the given layer.
layer | The layer that will be drawn. |
painter | The painter that will composed the draw result. |
|
signal |
This signal is emitted when the draw process ends. i.e. when all layers have been drawn.
errors | A map that indicates the errors that could be occurred during the draw process. i.e layer id -> error message |
|
signalinherited |
This signal is emitted when the map display extent changed.
|
virtualinherited |
Gets the map display background color.
|
protectedvirtualinherited |
It retrieves an associated canvas to the given layer.
layer | The layer for wich we want to get an associated canvas. |
|
inherited |
Returns the current tool being used.
|
virtualinherited |
Gets the digitalization factor.
|
virtualinherited |
It returns the map display pixmap.
|
virtualinherited |
Returns the current values of the DPI in X-axis and in Y-axis.
|
virtualinherited |
It returns the map display draft pixmap.
|
virtualinherited |
It returns the world extent showned by the MapDisplay.
Implements te::map::AbstractMapDisplay.
|
inherited |
Returns the pointer for the graphic scale object;.
|
inherited |
|
virtualinherited |
It returns the MapDisplay current horizontal align.
Implements te::map::AbstractMapDisplay.
|
virtualinherited |
It returns the MapDisplay current height in pixels.
Implements te::map::AbstractMapDisplay.
|
virtualinherited |
It returns the MapDisplay current height in millimeters.
Implements te::map::AbstractMapDisplay.
|
virtualinherited |
|
inherited |
It returns the user own display draft pixmap.
index | The draft pixmap index |
|
virtualinherited |
Calculates and return the current scale.
|
virtualinherited |
It return the Spatial Reference System used by the Map Display.
Implements te::map::AbstractMapDisplay.
|
virtualinherited |
It returns the MapDisplay current vertical align.
Implements te::map::AbstractMapDisplay.
|
virtualinherited |
It returns the MapDisplay current width in pixels.
Implements te::map::AbstractMapDisplay.
|
virtualinherited |
It returns the MapDisplay current width in millimeters.
Implements te::map::AbstractMapDisplay.
|
inherited |
|
inherited |
Returns if the map display is drawing.
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
protectedvirtualslotinherited |
|
private |
Assignment operator not allowed.
rhs | The right-hand-side copy that would be used to copy from. |
|
protectedvirtualinherited |
It assembles the final image and draws the widget.
e | The event received by this widget. |
|
virtual |
It updates the contents in the map display.
Reimplemented from te::qt::widgets::MapDisplay.
|
inherited |
It removes the user own display draft pixmap.
index | The draft pixmap index |
|
protectedvirtualinherited |
It resizes all canvas of map display.
|
virtual |
This event handler receives widget resize events wich are passed in the event parameter.
e | The resize event. |
Reimplemented from te::qt::widgets::MapDisplay.
|
virtualinherited |
Returns the default value of the DPI. In this case, the values from the device will be acquired.
|
virtualinherited |
It will set the align rendering of objects into the map display. Just successive drawings will be affected by this modification.
h | The new horizontal align. |
v | The new vertical align. |
Implements te::map::AbstractMapDisplay.
|
virtualinherited |
Sets the map display background color.
color | The color. |
|
virtualinherited |
Updates the current tool being used on te::qt::widgets::MapDisplay.
tool | The new te::qt::widgets::AbstractTool. |
delPrevious | True for delete the old tool. |
|
virtualinherited |
Sets the digitalization factor.
|
virtual |
It sets the world visible area and refreshes the contents in the map display.
If the given area is not proportional to the device width and height, the MapDisplay will change it in order to preserve the aspect ratio.
e | The world visible area. |
doRefresh | If true the display will refresh its contents. |
Reimplemented from te::qt::widgets::MapDisplay.
|
virtualinherited |
It sets the layer list to be showed in the Map Display.
layers | The layer list. |
Implements te::map::AbstractMapDisplay.
void te::qt::widgets::MultiThreadMapDisplay::setLayerList | ( | const std::list< te::map::AbstractLayerPtr > & | layers | ) |
|
virtualinherited |
Defines the min scale and max scale.
|
virtualinherited |
Overrides the values of the DPI that had been acquired from the device. This is done in order to make the scale be correctly computed and allows the correct computation of sizes in millimeters.
|
virtualinherited |
Sets the timeout interval in milliseconds to redraw on resize event.
msec | The timeout interval in milliseconds. |
|
virtualinherited |
Sets the resize policy to this map display.
policy | The resize policy. |
|
virtualinherited |
Defines the scale and calculates envelope based on the requested scale.
|
virtualinherited |
It sets a new Spatial Reference System to be used by the Map Display.
It will also convert the current envelope coordinates to the new SRS. This may cause changes to the world visible area. In this case, the extent will be updated and new internal transformation function will be calculated.
srid | The new Spatial Reference System to be used by the Map Display. |
doRefresh | If true the display will refresh its contents. |
Reimplemented from te::map::MapDisplay.
void te::qt::widgets::MultiThreadMapDisplay::setSynchronous | ( | bool | on | ) |
|
protectedslot |
|
inlineprotectedslot |
Definition at line 127 of file MultiThreadMapDisplay.h.
|
slotinherited |
Shows / hides the graphic scale.
visible | True shows the graphic scale, false hides it. |
|
slotinherited |
|
virtual |
Transforms the given point, in screen coordinates, to a point in world coordinates.
p | A point in screen coordinates. |
Reimplemented from te::qt::widgets::MapDisplay.
|
inherited |
void te::qt::widgets::MultiThreadMapDisplay::updateLayer | ( | std::vector< te::map::AbstractLayerPtr > | layers, |
bool | redraw = true |
||
) |
|
virtual |
Reimplemented from te::qt::widgets::MapDisplay.
|
private |
|
protectedinherited |
Background color.
Definition at line 411 of file MapDisplay.h.
|
protectedinherited |
Flag used to block pop up in this component.
Definition at line 430 of file MapDisplay.h.
|
protectedinherited |
Definition at line 172 of file AbstractMapDisplay.h.
|
protectedinherited |
Factor used in digitalization.
Definition at line 423 of file MapDisplay.h.
|
protectedinherited |
This pixmap will be the result of all canvas pixmap drawing, i. e., the result of drawing all visible layers.
Definition at line 406 of file MapDisplay.h.
|
protectedinherited |
The draft pixmap can be used to draw some feedback on map display.
Definition at line 407 of file MapDisplay.h.
|
protectedinherited |
The display extent.
Definition at line 75 of file MapDisplay.h.
|
protectedinherited |
Graphic scale pointer.
Definition at line 427 of file MapDisplay.h.
|
protectedinherited |
Planar grid pointer.
Definition at line 428 of file MapDisplay.h.
|
protectedinherited |
The display horizontal align.
Definition at line 78 of file MapDisplay.h.
|
protected |
The set of images built by each thread. It will be used to compose the final result, keeping the layer list order.
Definition at line 179 of file MultiThreadMapDisplay.h.
|
protectedinherited |
Timeout interval in milliseconds to redraw.
Definition at line 415 of file MapDisplay.h.
|
protectedinherited |
A flag that indicates if the map display is drawing.
Definition at line 416 of file MapDisplay.h.
|
protectedinherited |
The layer list to be displayed.
Definition at line 76 of file MapDisplay.h.
|
protected |
Used to convert screen coordinates to world coordinates.
Definition at line 181 of file MultiThreadMapDisplay.h.
|
protectedinherited |
The maximum scale.
Definition at line 422 of file MapDisplay.h.
|
protectedinherited |
The minimun scale.
Definition at line 421 of file MapDisplay.h.
|
protected |
Definition at line 185 of file MultiThreadMapDisplay.h.
|
protectedinherited |
Stores the last size of map display on start resize event.
Definition at line 413 of file MapDisplay.h.
|
protectedinherited |
Overrided value of the DPI in the X-axis, so the scale can be correctly computed.
Definition at line 419 of file MapDisplay.h.
|
protectedinherited |
Overrided value of the DPI in the X-axis, so the scale can be correctly computed.
Definition at line 420 of file MapDisplay.h.
|
protectedinherited |
A vector of users own draft pixmap.
Definition at line 409 of file MapDisplay.h.
|
protectedinherited |
Resize policy for this map display.
Definition at line 412 of file MapDisplay.h.
|
mutableprotectedinherited |
Current calculated scale.
Definition at line 418 of file MapDisplay.h.
|
protected |
A flag that indicates if the map display will show drawing feedback.
Definition at line 180 of file MultiThreadMapDisplay.h.
|
protectedinherited |
The display SRS.
Definition at line 77 of file MapDisplay.h.
|
protected |
A flag that indicates if the map display is synchronous or asynchronous.
Definition at line 182 of file MultiThreadMapDisplay.h.
|
protected |
The set of threads used to draw the layer list.
Definition at line 178 of file MultiThreadMapDisplay.h.
|
protectedinherited |
Timer to execute redraw on resize action.
Definition at line 414 of file MapDisplay.h.
|
protected |
Definition at line 184 of file MultiThreadMapDisplay.h.
|
protectedinherited |
Pointer to the current tool being used.
Definition at line 425 of file MapDisplay.h.
|
protectedinherited |
The display vertical align.
Definition at line 79 of file MapDisplay.h.
|
protected |
The set of visible layers.
Definition at line 177 of file MultiThreadMapDisplay.h.