201 Commits

Author SHA1 Message Date
Nyall Dawson
8cac36433d [FEATURE] Add support for transparency in SVG color params
...and update all bundled SVGs to suit

Non-bundled SVGs must add:

fill-opacity="param(fill-opacity)"
and
stroke-opacity="param(outline-opacity)"

to enable transparency support
2015-12-08 22:45:51 +11:00
Nyall Dawson
9cc9d424ce Add extra check for deprecations to documentation test
This check tests that if a function has been declared deprecated
with either Q_DECL_DEPRECATED or has a @deprecated Doxygen note
then it MUST have both the Q_DECL_DEPRECATD and @deprecated note.

It's important that both are used, as Q_DECL_DEPRECATED allows
throwing a warning if that method is used in code, while the
@deprecated doxygen note gives an indication to devs/PyQGIS users
of why it's deprecated and what should be used instead.

Ideally we'd also test for SIP /Deprecated/ tags, but I can't
find any reliable way to do this.
2015-12-07 21:55:36 +11:00
Nyall Dawson
9eee121115 Apply filters to feature request for categorized renderer
Makes rendering much faster when only certain categories are checked,
as only the matching records for the displayed features are fetched
from the provider.
2015-12-04 07:29:06 +11:00
Nyall Dawson
4203a7c1f4 Add method to determine approximate rendered symbol bounds for markers
Sponsored by City of Uster
2015-11-20 19:55:02 +11:00
Nyall Dawson
dc0639c794 Add missing /Transfer/s to setSubSymbol 2015-11-18 06:46:30 +11:00
Nyall Dawson
936b6506ec Add method to QgsSvgCache to return SVG viewbox size 2015-11-15 14:45:42 +11:00
Nyall Dawson
cdf21b7c3e Return derived classes from clone() methods, avoids need to
dynamic_cast results
2015-11-12 20:29:06 +11:00
Matthias Kuhn
56ccb2b858 sipClass_Klass is deprecated for a long time: replace with sipType_Klass 2015-11-11 23:22:51 +01:00
Nyall Dawson
719ff408a5 Add some missing SIP bindings, comment some classes as not available
in Python
2015-11-10 17:08:27 +11:00
Juergen E. Fischer
b5794b2f2d sip coverage fixes:
* make sip coverage test aware that there are less classes where QSci sip
  headers are not available
* exclude properties from members
* fix QgsFeatureIds typedef (fixes missing signal
  QgsVectorLayer.featuresDeleted and others)
* add missing notes for PyNames
* include some missing new methods in bindings
2015-11-08 19:30:39 +00:00
Vincent Mora
700fc043a4 Merge pull request #2414 from vmora/varying_width_assistant
[FEATURE] assistant for varying line width
2015-11-05 16:48:43 +01:00
vmora
6d1d213973 [FEATURE] assistant for varying line width
The qgssizescalewidget as been modified to handle line symbols as well
as markers.
The scale expression has been enhanced to support general exponentials
(i.e. eponents different from Flanery .57 and Area .5a)
The assistant as been modified to disply the exponent when Exponential
scaling is required.
2015-11-05 14:14:36 +01:00
Nyall Dawson
9e84fcafd8 Followup 2ac5933 with more data defined fixes
2ac5933 fixed the regression in 2.12, but there were more underlying
issues from <2.8 causing sub symbols with data defined properties
to be ignored.

Add some tests.

(refs #13707)
2015-11-04 16:03:46 +11:00
Nyall Dawson
f1633a1796 Change all signals to use const refs for non trivial objects 2015-10-26 22:46:25 +11:00
Nyall Dawson
f9559003d4 Really fix #13545
I'm not sure what sip voodoo is preventing the bindings from
calling methods in the base class, so for QGIS <3.0 I've aliased
all the new signatures and will rename them back for 3.0
2015-10-12 21:56:30 +11:00
Nyall Dawson
a784d6bc3d If svg files with params do not have a default value set, then don't
reset the fill/border color and border width when changing svg
marker/svg fill SVG files

This change makes the behaviour consistent between the svg marker
symbol and the other marker symbols. Additionally, svg files
which have customisable colors and NO default values set will
be shaded in gray fill/black outline in the svg selector widget,
to follow the same behaviour as the other marker symbol selectors.

Note that this change has NO EFFECT unless the svg files are
modified to remove the default param value, so there will be no
change for users' custom symbols. A follow up commit will need
to remove the default param values from the preinstalled SVG
files though. If you want to test in the meantime, I've modified
just the first two symbols in the accomodation group to make
this change for testing.

(refs #10908)
2015-10-11 23:00:01 +11:00
Nyall Dawson
3520f038dd Fix missing sip bindings for renderers (fix #13545) 2015-10-08 23:47:51 +11:00
Nyall Dawson
dcbe0d370e Fix legends are empty if presets used with filtered legend (fix #13300) 2015-10-08 07:57:21 +11:00
Nyall Dawson
c6df096c38 Followup c49b5b7, more fixes 2015-10-07 18:32:24 +11:00
Nyall Dawson
c49b5b777f Change a lot of arguments to const references in core/gui
Rationale:
- there was a lot of large objects passed by value, so potentially
there's a speed bump from this
- even for implicitly shared classes like QString/QList there's still
a (small) cost for copying the objects when there's no reason to
- it's the right thing to do!
2015-10-07 12:02:04 +11:00
Nyall Dawson
0caf944747 Misc optimisations identified by clazy:
- call reserve on container classes where applicable
- make sure Q_FOREACH uses references
- remove dynamic casts to base classes
- fix some implicit bool conversions
2015-10-05 18:43:18 +11:00
Nyall Dawson
a8f8cfefe5 Finish implementation of @value context variable 2015-10-01 15:42:02 +10:00
Nyall Dawson
5cfdea569b More removal of const from QgsRenderContext in symbology 2015-10-01 15:42:02 +10:00
Nyall Dawson
57275cea9e Revert "Add methods for retrieving extra parameters from symbol render"
This reverts commit fe9461be05043daf34057a85e57424f99eeae43d.

The commit was originally added for a label based feature which needed
to be reworked after recent labeling changes. Reverting this commit
to avoid polluting the API.
2015-09-25 19:09:09 +10:00
Nyall Dawson
73d838fd81 [FEATURE] Add concentric ring placement mode for displacement renderer 2015-09-18 13:20:53 +10:00
Nyall Dawson
586d59a432 [FEATURE] Add option to map unit scaling for limiting size in mm
Previously only the option to limit the scale range of the scaling
was available. Now you can also choose to limit the corresponding
rendered size in mm.
2015-09-17 20:35:27 +10:00
Nyall Dawson
5a9d932d9c [FEATURE] Allow tolerance in mm/pixels for displacement renderer 2015-09-16 17:11:32 +10:00
Matthias Kuhn
93e9204b43 Add test for rulebased renderer else rule 2015-09-08 17:03:21 +02:00
Nyall Dawson
fe9461be05 Add methods for retrieving extra parameters from symbol render 2015-09-08 22:08:18 +10:00
Nyall Dawson
096d46464d Allow setting expression context for symbol widgets and dialogs
This means that symbol selectors can be aware of the correct variable
scope and values for both populating expression builder widgets and
for symbol previews.
2015-09-03 22:46:37 +10:00
Matthias Kuhn
ce1f657893 rule based renderer: skip else rule for disabled items 2015-09-02 07:57:47 +02:00
Nyall Dawson
d7ab102daf Fix some leaks in symbology widgets 2015-09-01 16:06:35 +10:00
Nyall Dawson
d6d6827b6e Port symbols to expression contexts 2015-08-22 19:01:40 +10:00
Nyall Dawson
57669e71c0 Make QgsRenderContext available to more renderer methods 2015-08-22 19:01:38 +10:00
Juergen E. Fischer
ac89dc0e73 * update QgsSymbolV2 sip bindings
* fix a crash when setRotationField (now deprecated) is used on a fresh
  QgsCategorizedSymbolRendererV2
2015-08-13 17:48:56 +02:00
Nyall Dawson
728ead8a53 Avoid use of deprecated rotation field methods 2015-08-07 09:06:31 +10:00
Matthias Kuhn
1e6483c6d1 Fix marker rotation
The rotation is no longer saved in the Qgs*SymbolRendererV2 but in the
QgsMarkerSymbolV2 in a QgsDataDefined. This commit fixes the legacy API and
redirects calls to the new API.
2015-08-07 08:47:52 +10:00
Nyall Dawson
56a48ed0d2 Add missing color ramp methods and conversions to sip 2015-08-05 14:46:46 +10:00
Martin Dobias
febadfe21b Fix crashes when rendering with SVG symbols that are missing
The crashes would happen after some time when browsing the map,
especially when size of SVGs is in map units. This was due to wrong
removal of deleted cache entries where cache entry key would be
different from SVG file's path, thus not removing the entry that
got deleted. Now explicitly keeping the lookup key in the entry
to make sure this does not happen.

Related issues: #9959, #8883
2015-07-31 20:35:15 +02:00
Matthias Kuhn
e984fb00fd Remove QgsRenderOptions, return filter in separate method 2015-07-29 12:09:44 +02:00
Matthias Kuhn
1d7a6a4909 Rule based renderer exposes filter where clause
This filter can then be sent to the server to reduce the amount of fetched
features
2015-07-29 12:08:55 +02:00
Matthias Kuhn
b47b9a54b7 Add return type QgsRenderOptions to QgsRendererV2::startRender
This allows to specify additional filter constraints for the feature request to
be specified.
2015-07-29 12:08:54 +02:00
Juergen E. Fischer
9752c468c1 indentation update 2015-07-29 11:52:14 +02:00
Nyall Dawson
cfee456c05 [FEATURE] Add option to force a vector layer to render as a raster
(under the layer properties, rendering tab)

So why would you want this? Well, extremely detailed layers (eg
polygon layers with a huge number of nodes) can cause composer
exports in PDF/SVG format to be huge as all nodes are included in
the exported file. This can also make the resultant file very slow
to work with/open in other programs (*cough* Inkscape *cough*).

Now, these you can force these layers to be rasterised so that the
exported files won't have to include all the nodes contained in these
layers. (Before you could also do this by forcing the composer to
export as a raster, but that was an all-or-nothing solution).

The ideal solution would be a simplification option for composer
exports which would simplify the layers by removing redundant points
at the export DPI, but this is an easy workaround for now.
2015-07-09 18:34:55 +10:00
Nathan Woodrow
659f0d661c Add exportImage API to QgsSymbol 2015-07-07 21:59:22 +10:00
Juergen E. Fischer
b28c4847c7 dxf export:
* add missing marker types (fixes #13062)
* add missing support for data-defined marker names (fixes #13063)
2015-07-02 21:50:22 +02:00
Juergen E. Fischer
b3c2bd7f21 dxf export:
* fix support for data-defined properties in SVG export
* remove drawRects and let it fallback to drawPath and drawPolygon
* close arcs
2015-06-20 01:12:13 +02:00
Nyall Dawson
604f7e5011 Add methods to test whether graduated ranges overlap or have gaps 2015-06-12 20:19:43 +10:00
Juergen E. Fischer
cec5bdeb0d fix some warnings 2015-05-24 18:48:22 +02:00
Nyall Dawson
ef0d413819 Data defined font marker character 2015-05-22 20:00:19 +10:00