20805 Commits

Author SHA1 Message Date
Martin Dobias
d3b5fb01cd User-configurable update interval 2013-12-11 21:12:24 +07:00
Martin Dobias
90b10f79cf Fix unit tests
- QgsFeature owns QgsFields (otherwise the assigned QgsFields may get deleted)
- updated QgsRenderChecker to use map settings + map renderer job
- fixed DPI issue in map renderer to map settings conversion
- fixed vector layer cache (failing file operations)

There are still few tests that keep failing compared to master branch,
but the reason for failure are tiny pixel diffs and we should probably just
update the expected images.
2013-12-11 16:21:35 +07:00
Martin Dobias
151bad59cd Update to qgis_bench: use renderer job, allow parallel mode, print other time 2013-12-10 17:31:17 +07:00
Martin Dobias
e814e8df92 Invalidate cached image when layer's data or appearance is modified 2013-12-10 15:35:13 +07:00
Martin Dobias
9164ae9412 Options: remove legacy rendering options, add parallel rendering 2013-12-09 22:40:29 +07:00
Martin Dobias
e4a1651c49 Bring back render caching 2013-12-09 22:18:39 +07:00
Martin Dobias
0d2fbbe2cb Sync works now between QgsMapRenderer and QgsMapCanvas 2013-12-06 19:08:43 +07:00
Martin Dobias
bf7dd52299 Various fixes to make it compile on Windows 2013-12-06 09:22:26 +07:00
Martin Dobias
e1ea342ffc Enable Python in background threads. Fixed drawing of plugin layers. 2013-12-05 18:59:44 +07:00
Martin Dobias
2bece090f5 Update Python bindings to match changes in core/gui libraries. 2013-12-05 18:27:45 +07:00
Martin Dobias
412eaf4a07 Added sync between QgsMapCanvas settings and (legacy) QgsMapRenderer (untested) 2013-12-05 10:06:45 +07:00
Martin Dobias
7194567a90 Restored reading/writing of canvas map settings 2013-12-04 12:19:18 +07:00
Martin Dobias
4493f513fd Draw labeling also in parallel map renderer job 2013-12-04 00:13:33 +07:00
Martin Dobias
b99e93caea Updated memory provider to support feature source (untested yet) 2013-12-03 18:11:19 +07:00
Martin Dobias
5386324e15 Made QgsSpatialIndex implicitly shared class.
As a bonus, spatial index is a bit faster (10%) as we do not use random eviction buffer
anymore (which makes sense only when using disk storage manager).

Added basic tests for spatial index
2013-12-03 17:33:52 +07:00
Martin Dobias
9d001853c0 Introduction of concept of feature sources for vector data.
Feature sources of providers/layers should act as immutable
snapshots of the state of provider or layer, not being affected
by any concurrent changes to provider or layer while the source is in use.

Currently working just with OGR, Postgres, SpatiaLite providers.
2013-12-03 12:26:47 +07:00
Martin Dobias
5590ab4a09 Do not block functionality when canvas is drawing, respect frozen/render on flag.
Because the rendering is asynchronous, it is not necessary to block user input anymore
2013-11-27 14:45:27 +07:00
Martin Dobias
6ee8a7e6f8 Remove processEvents() calls that are not necessary anymore 2013-11-27 10:22:22 +07:00
Martin Dobias
2b5c903b58 Fixed handling of map updates
Previously there was a problem that if user panned too quickly,
the map item could get completely out of the view of the graphics
view and no new paint events would be created for some time.
2013-11-26 20:05:23 +07:00
Martin Dobias
879f051601 Reporting of rendering errors, safer isActive() for custom painter job 2013-11-26 19:10:16 +07:00
Martin Dobias
9a4f326ae3 Implementation of parallel rendering job (work in progress)
More changes:
- few improvements to map renderer job API
- added basic unit test for map renderer job
- map canvas uses P key to switch parallel/sequential rendering
2013-11-25 20:45:37 +07:00
Martin Dobias
4a554dbc4f Initial support for rendering of rasters 2013-11-22 11:50:04 +07:00
Martin Dobias
5b6393f22f Revived labeling and diagrams for vector layers 2013-11-20 18:48:24 +07:00
Martin Dobias
fe0596f1ec Do not keep pointer to vector layer in vector layer feature iterator.
This will make the iterator safe to changes in vector layer while
the iterator is still active.
2013-11-20 16:33:27 +07:00
Martin Dobias
2fcf556c3c Do the rendering of map layers within special classes
This is an important change: new class (QgsMapLayerRenderer) is introduced
and it keeps all information from layer which is necessary for rendering.
Thanks to that, any changes to map layer will have no impact on rendering that
may be currently underway: if the user changes renderer, rendering will
not crash because it is using a different instance.

Work in progress: only vector layers, no labeling, no diagrams, iterator
still uses some bits from QgsVectorLayer.

Another change: QgsFeatureRendererV2, QgsSymbolV2 do not get access
to QgsVectorLayer - only to fields they need. Point displacement renderer
did more extensive use of QgsVectorLayer - currently it is not functional.
2013-11-20 16:01:12 +07:00
Martin Dobias
036b25ebc9 Stop using QgsMapLayer's setCacheImage()
That caching mechanism is too coarse - it is expected that there is only one map renderer.
Instead, caching would need to be done on higher level, e.g. in QgsMapCanvas
2013-11-18 17:58:58 +07:00
Martin Dobias
68e29511c3 Allow cancellation of PAL labeling computation 2013-11-18 14:28:55 +07:00
Martin Dobias
1110aafa43 Do map rendering inside of QgsMapCanvas
QgsMapCanvasMap is now just a simple map canvas item storing an image,
all rendering logic has been moved to QgsMapCanvas.
Restored functionality of map decorations and cancellation of rendering.
When map is going to be refreshed, the old rendered map stays visible
for a small amount of time (scaled) and then it is replaced by the new map.
2013-11-15 18:47:25 +07:00
Martin Dobias
d49f7ac2ee Refactoring of QgsPalLabeling
The idea was not to expose the labeling engine instance used for rendering
to other parts of the application and keep it as an implementation
detail within renderer jobs.

Resulting placement is kept in a newly created class QgsLabelingResults
which is passed from the renderer job's labeling engine to map canvas
where it is available for map tools.

Global labeling settings are now kept only in QgsProject (there is
no instance of QgsPalLabeling which would stay alive all the time).
2013-11-14 22:43:48 +07:00
Martin Dobias
cfc2a48539 Restore advanced layer effects, labeling in composer.
Also fixes DpiY setting in composer + workaround for QPicture DPI issues
2013-11-14 15:15:11 +07:00
Martin Dobias
cf3d86c33c Removed use of QgsMapRenderer::rendererContext()
Deprecated QImage/QPixmap switch in QgsMapCanvas
2013-11-13 16:13:50 +07:00
Martin Dobias
d1985a16a3 Introduce flags for boolean settings in map settings.
Also revived drawEditingInformation setting in render context
2013-11-13 14:59:09 +07:00
Martin Dobias
735fab1a1e Simplified map rendering configuration.
- scene and painter DPI are always the same
- raster scale factor is always 1
- scale factor always means pixels per milimeter
- no need to force of custom-computed scale
- no "output units" - map settings always use pixels as units

The logic used previously was getting too complex:
- scene DPI vs painter DPI
- enforcing custom scale in composer
- unclear logic behind scale factor and raster scale factor settings

This is resolved by doing composer-specific tweaks inside composer:
- set map cache image's DPI (to get correct scale)
- scale printer's painter to switch from mm to pixels (dots)
2013-11-13 11:51:14 +07:00
Martin Dobias
630272d280 Conversion of composer to use map renderer job 2013-11-13 10:08:27 +07:00
Martin Dobias
35894f1ecc Made labeling working without QgsMapRenderer (using QgsMapSettings) 2013-11-11 19:48:48 +07:00
Martin Dobias
2d12aca357 More changes to use QgsMapSettings instead of QgsMapRenderer 2013-11-11 18:03:35 +07:00
Martin Dobias
1b7fcc2664 Update QgsTolerance to use QgsMapSettings instead of QgsMapRenderer 2013-11-11 15:31:21 +07:00
Martin Dobias
61c48be3a6 Deprecated several map canvas signals related to rendering 2013-11-11 14:14:27 +07:00
Martin Dobias
106b2cce12 Removed stop rendering button, deprecated QgsMapTool::renderComplete 2013-11-11 12:36:46 +07:00
Martin Dobias
abc15ab0ad Handling of selection color in QgsMapSettings 2013-11-11 11:03:37 +07:00
Martin Dobias
016f39e218 Map canvas uses renderer to QImage, fix for jumping image after pan 2013-11-06 22:55:29 +07:00
Martin Dobias
3c05976a70 Updated overview to use rendering jobs, fixed cancellation 2013-11-06 17:07:05 +07:00
Martin Dobias
bc45b98075 Implementation of sequential rendering to QImage 2013-11-06 11:16:32 +07:00
Martin Dobias
fd10fae1f2 Remove mDrawing from canvas - it is now transparent to the user 2013-11-01 18:01:53 +07:00
Martin Dobias
9fb6a1cae1 Moving canvas away from QgsMapRenderer, now with OTF projections working 2013-11-01 17:35:39 +07:00
Martin Dobias
d9b95bcd42 Marked few drawing progress reporting signals as deprecated 2013-11-01 10:35:34 +07:00
Martin Dobias
ccd40bf0bf Map canvas has its QgsMapSettings, moving away from QgsMapRenderer 2013-11-01 09:42:40 +07:00
Martin Dobias
f2004962bc Added utility functions to QgsMapSettings 2013-10-31 16:34:30 +07:00
Martin Dobias
159f135d93 Removed QgsMapRendererV2 again in favour of using jobs directly 2013-10-31 15:55:13 +07:00
Martin Dobias
ef3c267278 More work in progress 2013-10-31 11:25:33 +07:00