8319 Commits

Author SHA1 Message Date
Nyall Dawson
0aa085d41f Add quick hasCacheImage method to QgsMapRendererCache 2017-02-01 14:42:31 +10:00
Nyall Dawson
d0e6e17816 QgsMapRendererCache can have multiple dependent layers for a cache image
In some cases the render result for a layer may depend on more than
one layer.

This changes QgsMapRendererCache to use "cache keys" instead of layer ids
to identify images within the cache. When setting an image inside the
cache, a new list parameter is used to specify all layers on which
that image depends.
2017-02-01 14:42:31 +10:00
Nyall Dawson
d74fbff0aa Make QgsMapRendererCache protected members private
This class isn't designed to be subclassed
2017-02-01 14:42:31 +10:00
Nyall Dawson
75506867aa Make protected members in QgsMapRendererJob not part of public API
QgsMapRendererJob and subclasses are not designed to be subclassed
outside of core QGIS code. Marking them private API allows us to
change them after API is frozen again.
2017-02-01 14:19:36 +10:00
Alessandro Pasotti
248c5831ca Resource Sharing Plugin Tests Added 2017-01-31 15:23:42 +01:00
Alessandro Pasotti
b3de34a6b6 Fixed spell check 2017-01-31 12:56:27 +01:00
Alessandro Pasotti
e50bc7c2e8 Added QGIS Resource Sharing Plugin and deps 2017-01-31 12:05:27 +01:00
Nyall Dawson
aaa8c4e492 [FEATURE] Expose GEOS Voronoi and delaunay triangulation to QgsGeometry 2017-01-31 19:35:32 +10:00
Denis Rouzaud
f85ac23cde fix version in added note 2017-01-31 10:03:33 +01:00
Nyall Dawson
1fce65707c Add missing annotation api break docs, fix sip binding 2017-01-31 12:58:51 +10:00
Martin Dobias
7683cfacd3 Rework vector joins so they do not use QgsProject::instance()
The basic idea is to split reading of XML definition and resolution of layer IDs into layers.

Also includes some cleanups in QgsProject and improvements in QgsVectorLayerJoinInfo.
2017-01-31 09:33:02 +08:00
Nyall Dawson
87f2fe55b2 Add unit test for processing polygonize algorithm 2017-01-31 10:47:00 +10:00
Nyall Dawson
14bd79f844 Remove dependance on shapely library
Port processing polygonize alg to use native QgsGeometry methods
2017-01-31 10:47:00 +10:00
Nyall Dawson
4cebb46445 [FEATURE] Expose GEOS polygonize operation via QgsGeometry 2017-01-31 10:47:00 +10:00
Nyall Dawson
8709e1f9d5 Merge pull request #4078 from nyalldawson/geom_api
API changes to QgsGeometry::isEmpty()/isNull()
2017-01-31 09:13:15 +10:00
Nyall Dawson
afcb75af51 Remove QgsGeometry::isGeosEmpty
Use the faster native QgsGeometry::isEmpty instead
2017-01-31 07:19:56 +10:00
Nyall Dawson
79bf17ae1f Replace deprecated assertRegexpMatches call 2017-01-31 07:18:11 +10:00
Nyall Dawson
af0d68b882 Implement QgsGeometry::isEmpty()
Faster than QgsGeometry::isGeosEmpty() because it avoids the
conversion to GEOS geometries and just uses the QgsAbstractGeometry
subclasses directly.

Also implements faster isEmpty() overrides for specific
QgsAbstractGeometry subclasses.
2017-01-31 07:15:51 +10:00
LOMENEDE Jean-Daniel
c4165e4eeb [processing]Execute Sql : fix Input2.. InputN parameters 2017-01-30 16:38:58 +01:00
Nyall Dawson
49aae6e908 Rename QgsGeometry::isEmpty to isNull
Differentiates missing geometries from empty geometries (eg
empty geometry collections)
2017-01-30 21:58:23 +10:00
Nyall Dawson
61d3147261 Merge pull request #4073 from nyalldawson/annotations
Refactor annotations, add new annotation features + some other exciting stuff
2017-01-30 21:21:01 +10:00
Nyall Dawson
10c40dcaab Fix rendering offset lines as part of fill symbol (outside of
vector layers) results in broken offset outline
2017-01-30 19:58:08 +10:00
Nyall Dawson
41fe33551c Add missing python bindings 2017-01-30 17:40:41 +10:00
Blottiere Paul
44da573002 replace class by namespace 2017-01-30 08:21:06 +01:00
Blottiere Paul
5594418113 fix typo 2017-01-30 08:21:06 +01:00
Blottiere Paul
5c8360dba2 [server] WIP clean project parsing by using QgsProject 2017-01-30 08:21:05 +01:00
Nyall Dawson
ad184cdeed [composer] Remove last link between composer maps and canvas
you WILL respect the separation between core and gui!!\!
2017-01-30 15:09:27 +10:00
Nyall Dawson
4058f4734b Annotations are now handled at a project level
This commit implements a new QgsAnnotationManager class, which
handles storage, writing and retrieval of annotations.

QgsProject has an annotationManager() attached to it. Map canvases
sync their visible QgsMapCanvasAnnotationItems to the annotations
contained within the project's annotation manager.

This moves all management, storage and retrieval of annotations
up to core and out of app/canvas.
2017-01-30 14:57:16 +10:00
Nyall Dawson
dd51843e54 QgsSymbol estimateMaxBleed methods now use a QgsRenderContext
argument to correctly calculate bleed for mapunits/pixels/etc
2017-01-30 12:36:04 +10:00
Nyall Dawson
fac7887a9c [FEATURE] Annotations can be styled using fill symbol styles (fix #10552)
This changes the rendering of annotation frames to use QGIS' symbology
engine, which means that all the existing fill styles can now be
used to style annotation frames.

Also paint effects & data defined symbol parameters. Whee!
2017-01-30 12:17:44 +10:00
Nyall Dawson
a94ca701ac [FEATURE] Control over annotation contents margins (refs #10555)
Allows setting left/top/right/bottom margins for the contents
within an annotation.
2017-01-30 11:31:52 +10:00
Nyall Dawson
a7be9968b8 New class QgsMargins for storing margins (left/right/top/bottom)
Basically a direct port of QMarginF, but forced to always use
double values, and with added toString()/fromString() methods.
2017-01-30 10:50:48 +10:00
Nyall Dawson
c22f5de690 Port annotation feature handling to QgsAnnotation
Not an ideal implementation (too much logic resides in the
gui QgsMapCanvasAnnotationItem class), but any approach
using current api will be dependant on some hacks.

Ideally we need a QgsVectorDataProvider method for finding
the closest feature(s) to a point(/line/polygon) within a
certain tolerance, with provider specific implementations
which offload this to the data store's spatial indices.
Then this handling could be bumped up to reside in
QgsAnnotation.
2017-01-30 08:39:47 +10:00
Nyall Dawson
aa14926ca8 Move map layer association for annotations to QgsAnnotation
Previously only some annotations had (incomplete) support for
attaching to a particular vector layer and synchronising their
visibility with the layer's visibility.

This handling has all been moved up to QgsAnnotation, so that
all annotation types can be attached to layers.

This will allow selective annotation visibility based on the
visible layers of a particular canvas, eg in multi-canvas
environments.

Additionally:
- show the attached layer in the annotation properties
dialog, and allow it to be cleared to always show the
annotation
- allow attaching annotations to non-vector layers
- add unit tests for visibility
2017-01-30 08:36:20 +10:00
Nyall Dawson
c853f4fe89 Refactor annotations
Splits the rendering component of annotations out from map
canvas item component.

A new core abstract base class QgsAnnotation handles the
management of the common properties associated with an
annotation, and handles rendering the annotation onto a
QgsRenderContext destination.

Existing annotation classes have been ported to this, and
with the exception of the form annotation moved into core.
Form annotations are dependant on editor widgets and must
remain in GUI.

A new QgsMapCanvasAnnotationItem item class implements
a QgsMapCanvasItem which draws an annotation inside the
canvas, and handles synchronising the position and size
of the canvas item with the QgsAnnotation position/size.

This allows annotations to be safely used in a multi-canvas
environment, with a single QgsAnnotation being displayed
in multiple canvases (even if the canvases have different
extent/crs/etc).

Additionally it allows annotations to be directly rendered
to a map (eg in composer) without going through the
gui based Qt graphics scene framework.

Also removes lots of duplicate code, and adds some basic
unit tests for annotations.
2017-01-30 08:36:19 +10:00
Martin Dobias
8ba609e516 Tidy up layer definitions code + removal of QgsProject::instance()
Moved code related to layer definitions away from QgsMapLayer
2017-01-29 23:22:37 +08:00
lbartoletti
548461ac3c [FEATURE] QgsPointV2 add project with 3D support
Allows projection of a point with inclination to return a 3d point.

Expression "project" function has been extended to support a new inclination parameter.
2017-01-29 08:29:25 +10:00
Alexandre Neto
290758a4bc More PNG to SVG replacements (#4065) 2017-01-28 11:17:43 +07:00
matteo
f7644b4708 [processing] add test for merge gdal 2017-01-27 10:13:04 +01:00
Nyall Dawson
f4a9797b3d Merge pull request #4067 from nyalldawson/raster_ctor
Remove duplicate QgsRasterLayer constructor
2017-01-27 19:05:14 +10:00
Martin Dobias
0341478864 Remove code for reading of legacy (QGIS < 1.0) renderers
Also removes a bunch of unused old QMLs and upgrades one still in use
2017-01-27 16:02:48 +08:00
Alexander Bruy
66e10e4937 Merge pull request #4066 from PedroVenancio/master
[processing] add GRASS 7.x v.out.ascii algorithm
2017-01-27 08:31:32 +02:00
Nyall Dawson
6c7e2f1b87 Make QgsVectorLayer ctor default to ogr provider 2017-01-27 15:53:35 +10:00
Martin Dobias
c72734285b Fix spelling and API doc 2017-01-27 09:43:29 +08:00
Martin Dobias
b245ccc105 [FEATURE] API call to make geometries valid (port of ST_MakeValid)
This introduces QgsGeometry::makeValid() which will try to make a valid
geometry out of invalid one. This is more complicated method than just
doing a buffer with zero width, but it should not loose any vertices.

Finally we should have a reliable way in QGIS to fix bad geometries!

Ported the C code from lwgeom library to QGIS.
2017-01-27 09:43:29 +08:00
Martin Dobias
137eb3a0f9 Make layer tree implementation independent from QgsProject::instance()
Another bit in the project refactoring work to get rid of dependencies
on QgsProject singleton.

Reading of layer trees from XML is now split into two phases:
1. read XML and keep layer IDs
2. resolve layer IDs to QgsMapLayer instances (using QgsProject)

There are convenience methods to do both phases in one go.
2017-01-27 09:29:04 +08:00
Nyall Dawson
45fc6dc2fe Remove duplicate QgsRasterLayer constructor
Avoids confusing overload behavior when constructing QgsRasterLayers
from c++ code. This extra constructor was causing character literals
to be converted to a boolean loadDefaultStyle flag instead
of being used as the provider key. Removing the extra constructor
avoids this, and removes some duplicate code.
2017-01-27 11:13:52 +10:00
PedroVenancio
bf2d9995f0 Add GRASS 7.x v.out.ascii algorithm 2017-01-26 22:04:06 +00:00
rldhont
c861682ded [BUGFIX][Processing] Script: get output file extension 2017-01-26 16:53:44 +01:00
Martin Dobias
3a92b17418 Reading/saving labeling engine uses a particular QgsProject
... rather than using QgsProject::instance() internally

These are small cleanups to dig out some instance() uses and move them one level up...

At some point we should maybe make labeling engine configuration a part of QgsMapSettings
and have default project labeling engine config accessible from QgsProject
in a way similar to e.g. snapping configuration.
2017-01-26 10:56:50 +08:00