rendering operations on a specific feature are performed
This allows symbol layer subclasses to know when a set of rendering
operations all relate to a single feature, e.g. when a number
of polygons are rendered which all belong to the same multi-polygon
geometry attached to a single feature.
Without these hooks, symbol layer subclasses have no stable method
of knowing that these parts all relate to a single feature, or
have no means of knowing when the final part of that feature has
been rendered.
This commit adds a new fill symbol layer type "Random marker fill". It
allows polygon features to be rendered using a marker symbol placed
at random locations within the polygon boundary.
Options include:
- number of marker symbols to render for the polygon
- whether markers rendered near the edges of polygons should be clipped
to the polygon boundary or not
- an optional random number seed, to give consistent placement
of markers whenever maps are refreshed (also allows random placement
to play nice with QGIS server and tile-based rendering)
Sponsored by the SLYR project
Whilst usually this is bad practice (reusing an existing expression context),
and instead you should make a new context for every batch of expression evaluations,
we can't do this in the style model and we end up potentially creating
thousands of new contexts. So instead, we use a single one, which is
safe because the actual expression context used here is a very
basic one...
or size properties
Previously only string values of the format 'x,y' would be permitted. But
I've seen MANY bug reports and questions about this, so also allow
arrays of doubles as a valid result. E.g. "array(3,5)". In any case, it's
just nicer.
Fixes#31444
* Add button to change billboard symbol.
* Add shaders for billboards.
* Add billboard material class.
* Add sample billboard image.
* Add dummy handler for billboard.
* Add billboard geometry class.
* First working version of 3D point as billboard.
* Make selected feature bigger.
* Use default symbol preview as billboard.
* Update billboard when changes the viewport size.
* Use QgsTerrainTextureImage for adding image to texture.
* Show better quality of billboard default symbol.
* Promote QgsSymbolButton not working.
* Add QgsSymbolButton properly.
* Add seTexture2DFromSymbol.
* Use default symbol
* [On Progress] Get symbol from the QgsSymbolButton.
* [On progress] failed to change the symbol
* Fix billboard fragment shader for macOS
* Better transparency handling.
* Use size from the symbol.
* Add set layer for 3d billboard symbol.
* Set billboard size from the symbol pixel size * 20
* Use size from the image.
* [Debug] set white symbol to success kid, it work when previous billboard is success kid.
* Use store and restore symbol from Nyall.
* Remove unrelated code.
* Apply random extent to fix the bug, from Martin.
* Remove add mesh entities for billboard.
* Hide material and transformation widget for billboard.
* Remove add scene entities for billboard.
* Add selected as parameter in drawPreviewIcon.
* Add QgsMarkerSymbol to store the symbol in billboard
* Put billboard symbol in point3dsymbol serialization.
* Add billboard height in the UI.
* Set height for billboard.
* Store billboard height separately. Perhaps better to use existing transform.
* Set height of billboard to TY.
* Flipped image for billboard symbol.
* Add helper function to set billboard function.
* Generate billboard transform from general transform.
* Use static dpi for context size.
* Remove debug message.
* Use Qgs3DRenderContext for selection color and dpi from QgsApplication.
* Remove unnecessary file and code.
* Remove commented iut code.
* Add documentation of new classes.
* Fix banned keywords.
* Add missing parameter's documentation.
* Address PR review.
* Use context from readXML.
* Remove one line function.
* Fix billboard size.
* Make some functions private, remove unused function.
* Use unique_ptr for the ownership.
* Use unique_ptr for default symbol to avoid memory leak.
* Add parent to texture2D.
* Fix documentation.
* Add copy constructor.
* Fix documentation.
* Remove documentation warning.
* Fix sip error.
* Add unit test for billboard rendering.
* Set ambient to not transparent for measurement line.
* Add dpi in the Qgs3DMapSetting
* Update billboard rendering unit test.
* Remove layer from 3d point widget since it's not supported yet.
* Addressing PR review from Martin.
* Attach dom directly for the billboard symbol.
* Remove unused constructor for point3dsymbol.
* Use stroke width ratio for solving big stroke width.
* Update unit test for rendering with some stroke color.
* Fix typo.
Adds:
- __len__ : returns number of symbol layers in symbol
- [ ] getter: returns a specific symbol layer, also allows negative indices to retrieve from end of symbol
- del [ ]: removes a specific symbol layer, also allows negative indices
- raise IndexError when an invalid symbol layer is requested
- allow iteration over symbol layers using
for layer in symbol:
print(layer.color())
Adds a new visitor pattern API for creation of visitors which visit
all the style entities (symbols, color ramps, text formats, and
label styles) associated with different objects. Can be used on a
renderer, map layer, or project wide level.
E.g. on a project wide level, allows collection of ALL the style
symbols/color ramps/text settings inside a project, including those
in layouts or annotations!
Just like the earlier change which allows for text formats to
be managed in style manager, this change allows for layer-wide
label settings to be stored and managed in styles.
So while a text format includes just the font settings and other
appearance related settings, Label Settings also includes layer-type
specific settings such as label placement, priority, rendering
settings.