182 Commits

Author SHA1 Message Date
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
Nyall Dawson
c5b04efadb Fix attributes from some symbols were not available for data defined
symbology (line marker, line pattern)
2015-05-19 17:01:40 +10:00
Mathieu Pellerin
f314522b73 [symbology] improve marker rotation along line to fix data-defined
angle support
2015-05-19 16:29:24 +10:00
Nyall Dawson
eb716fc310 [symbology] Fall back to symbol style if data defined evaluation
fails or is null.
2015-05-09 19:56:27 +10:00
Nyall Dawson
aab3b15991 Replace use of expressions for symbology data defined properties
with QgsDataDefined. Allows for direct use of fields and for
deactivating data defined properties without loss of expression/
specified field.
2015-05-06 18:35:59 +10:00
Juergen E. Fischer
edeafa95ac indentation and minor sip updates 2015-05-03 17:10:32 +02:00
Nyall Dawson
bb0e583f4b Move methods for returning lists of values from a vector layer field
or expression to QgsVectorLayer. Add unit tests.
2015-05-02 20:32:16 +10:00
Nyall Dawson
7314047698 Fix missing doc strings due to invalid doxygen tags 2015-04-30 17:26:58 +10:00
vmora
cf3a712711 Move prettyBreaks calculation to QgsSymbolLayerV2Utils 2015-04-27 18:22:48 +10:00
Nyall Dawson
28b5217bb8 Merge pull request #1974 from vmora/graduated_by_size
[feature] graduated with varying size
2015-04-11 11:15:50 +10:00
vmora
84af60ad56 [feature] graduated with varying size
The graduated symbol renderer now allows to use varying size instead of
varying color.

The classification remains the same an tabbed size/color in the gui
allows the use to choose one type or the other.
2015-04-10 09:14:14 +02:00
Juergen E. Fischer
12d7cfca03 indentation update 2015-04-07 14:27:39 +02:00
Nyall Dawson
8b37ea2b05 [FEATURE] Add option to symbology to prevent clipping of features
This option (located under the symbol advanced menu) disables the
automatic clipping of lines/polygons to the canvas extent. In
some cases this clipping results in unfavourable symbology (eg
centroid fills where the centroid must always be the actual
feature's centroid). (fix #9757)
2015-03-28 21:16:45 +11:00
Nyall Dawson
742f3233ee [FEATURE] Paint effects for layers and symbol layers
This commit adds a new framework for implementing paint effects, which
modify the results of QPainter operations to apply visual effects
such as drop shadows and blurs.

The initial implementation allows for effects to be applied to entire
layers and individual symbol layers.

Included are a drop shadow, inner shadow, blur, inner glow, outer glow,
colorise and transform effect. A "stack" effect is also implemented
which allows other paint effects to be combined in various ways.

Sponsored by hundreds of generous kickstarter contributors!
2015-03-28 20:04:50 +11:00
Nyall Dawson
3c71498c3e Add some missing /TransferThis/ to sip bindings for QObject parents 2015-02-18 17:35:47 +11:00
Nyall Dawson
4def416bbc Merge pull request #1858 from vmora/symbol_list_refacto
line symbol layer refacto to avoid code duplication
2015-02-07 20:51:40 +11:00
Nyall Dawson
93a86835d6 Fix common memory leak after using QgsSymbolLayerV2Utils::loadSymbol 2015-02-03 21:22:46 +11:00
Juergen E. Fischer
abd4a04399 sip update 2015-02-03 02:21:52 +01:00
vmora
261271518c line symbol layer refacto to avoid code duplication
The line symbol layer as been refactored to avoid code duplication and
expose the offset and offset units in the base class. Note that
the added functions in the base class where already defined in all
child classes.
2015-01-23 09:12:06 +01:00
Juergen E. Fischer
221e9ef7c7 dxf export: support line offsets 2015-01-23 00:14:39 +01:00