QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
|
#include <qgssymbollayerutils.h>
Static Public Member Functions | |
static void | appendPolyline (QPolygonF &target, const QPolygonF &line) |
Appends a polyline line to an existing target polyline. More... | |
static void | applyScaleDependency (QDomDocument &doc, QDomElement &ruleElem, QVariantMap &props) |
Checks if the properties contain scaleMinDenom and scaleMaxDenom, if available, they are added into the SE Rule element. More... | |
static void | blurImageInPlace (QImage &image, QRect rect, int radius, bool alphaOnly) |
Blurs an image in place, e.g. creating Qt-independent drop shadows. More... | |
static void | clearSymbolMap (QgsSymbolMap &symbols) |
static QColor | colorFromMimeData (const QMimeData *data, bool &hasAlpha) |
Attempts to parse mime data as a color. More... | |
static QgsNamedColorList | colorListFromMimeData (const QMimeData *data) |
Attempts to parse mime data as a list of named colors. More... | |
static QMimeData * | colorListToMimeData (const QgsNamedColorList &colorList, bool allFormats=true) |
Creates mime data from a list of named colors. More... | |
static QIcon | colorRampPreviewIcon (QgsColorRamp *ramp, QSize size, int padding=0) |
Returns an icon preview for a color ramp. More... | |
static QPixmap | colorRampPreviewPixmap (QgsColorRamp *ramp, QSize size, int padding=0, Qt::Orientation direction=Qt::Horizontal, bool flipDirection=false, bool drawTransparentBackground=true) |
Returns a pixmap preview for a color ramp. More... | |
static QVariant | colorRampToVariant (const QString &name, QgsColorRamp *ramp) |
Saves a color ramp to a QVariantMap, wrapped in a QVariant. More... | |
static QMimeData * | colorToMimeData (const QColor &color) |
Creates mime data from a color. More... | |
static QString | colorToName (const QColor &color) |
Returns a friendly display name for a color. More... | |
static bool | condenseFillAndOutline (QgsFillSymbolLayer *fill, QgsLineSymbolLayer *outline) |
Attempts to condense a fill and outline layer, by moving the outline layer to the fill symbol's stroke. More... | |
static bool | convertPolygonSymbolizerToPointMarker (QDomElement &element, QList< QgsSymbolLayer * > &layerList) |
Converts a polygon symbolizer element to a list of marker symbol layers. More... | |
static void | createAnchorPointElement (QDomDocument &doc, QDomElement &element, QPointF anchor) |
Creates a SE 1.1 anchor point element as a child of the specified element. More... | |
static void | createDisplacementElement (QDomDocument &doc, QDomElement &element, QPointF offset) |
static bool | createExpressionElement (QDomDocument &doc, QDomElement &element, const QString &function) |
Creates a OGC Expression element based on the provided function expression. More... | |
static QgsSymbolLayer * | createFillLayerFromSld (QDomElement &element) |
static bool | createFunctionElement (QDomDocument &doc, QDomElement &element, const QString &function) |
static void | createGeometryElement (QDomDocument &doc, QDomElement &element, const QString &geomFunc) |
static QgsSymbolLayer * | createLineLayerFromSld (QDomElement &element) |
static QgsSymbolLayer * | createMarkerLayerFromSld (QDomElement &element) |
static void | createOnlineResourceElement (QDomDocument &doc, QDomElement &element, const QString &path, const QString &format) |
static void | createOpacityElement (QDomDocument &doc, QDomElement &element, const QString &alphaFunc) |
static void | createRotationElement (QDomDocument &doc, QDomElement &element, const QString &rotationFunc) |
static QDomElement | createSvgParameterElement (QDomDocument &doc, const QString &name, const QString &value) |
static bool | createSymbolLayerListFromSld (QDomElement &element, QgsWkbTypes::GeometryType geomType, QList< QgsSymbolLayer * > &layers) |
Creates a symbol layer list from a DOM element. More... | |
static QDomElement | createVendorOptionElement (QDomDocument &doc, const QString &name, const QString &value) |
static QgsArrowSymbolLayer::HeadType | decodeArrowHeadType (const QVariant &value, bool *ok=nullptr) |
Decodes a value representing an arrow head type. More... | |
static QgsArrowSymbolLayer::ArrowType | decodeArrowType (const QVariant &value, bool *ok=nullptr) |
Decodes a value representing an arrow type. More... | |
static QPainter::CompositionMode | decodeBlendMode (const QString &s) |
static Qt::BrushStyle | decodeBrushStyle (const QString &str) |
static QColor | decodeColor (const QString &str) |
static Qgis::SymbolCoordinateReference | decodeCoordinateReference (const QString &string, bool *ok=nullptr) |
Decodes a string representing a symbol coordinate reference mode. More... | |
static Qgis::LineClipMode | decodeLineClipMode (const QString &string, bool *ok=nullptr) |
Decodes a string representing a line clip mode. More... | |
static QgsMapUnitScale | decodeMapUnitScale (const QString &str) |
static Qgis::MarkerClipMode | decodeMarkerClipMode (const QString &string, bool *ok=nullptr) |
Decodes a string representing a marker clip mode. More... | |
static Qt::PenCapStyle | decodePenCapStyle (const QString &str) |
static Qt::PenJoinStyle | decodePenJoinStyle (const QString &str) |
static Qt::PenStyle | decodePenStyle (const QString &str) |
static QPointF | decodePoint (const QString &string) |
Decodes a QSizeF from a string. More... | |
static QVector< qreal > | decodeRealVector (const QString &s) |
static Qgis::ScaleMethod | decodeScaleMethod (const QString &str) |
Decodes a symbol scale method from a string. More... | |
static QSizeF | decodeSize (const QString &string) |
Decodes a QSizeF from a string. More... | |
static int | decodeSldAlpha (const QString &str) |
static Qt::BrushStyle | decodeSldBrushStyle (const QString &str) |
static QFont::Style | decodeSldFontStyle (const QString &str) |
static int | decodeSldFontWeight (const QString &str) |
static Qt::PenCapStyle | decodeSldLineCapStyle (const QString &str) |
static Qt::PenJoinStyle | decodeSldLineJoinStyle (const QString &str) |
static QVector< qreal > | decodeSldRealVector (const QString &s) |
static QgsUnitTypes::RenderUnit | decodeSldUom (const QString &str, double *scaleFactor=nullptr) |
Decodes a SLD unit of measure string to a render unit. More... | |
static bool | displacementFromSldElement (QDomElement &element, QPointF &offset) |
static void | drawStippledBackground (QPainter *painter, QRect rect) |
static void | drawVertexMarker (double x, double y, QPainter &p, Qgis::VertexMarkerType type, int markerSize) |
Draws a vertex symbol at (painter) coordinates x, y. More... | |
static QString | encodeBrushStyle (Qt::BrushStyle style) |
static QString | encodeColor (const QColor &color) |
static QString | encodeCoordinateReference (Qgis::SymbolCoordinateReference coordinateReference) |
Encodes a symbol coordinate reference mode to a string. More... | |
static QString | encodeLineClipMode (Qgis::LineClipMode mode) |
Encodes a line clip mode to a string. More... | |
static QString | encodeMapUnitScale (const QgsMapUnitScale &mapUnitScale) |
static QString | encodeMarkerClipMode (Qgis::MarkerClipMode mode) |
Encodes a marker clip mode to a string. More... | |
static QString | encodePenCapStyle (Qt::PenCapStyle style) |
static QString | encodePenJoinStyle (Qt::PenJoinStyle style) |
static QString | encodePenStyle (Qt::PenStyle style) |
static QString | encodePoint (QPointF point) |
Encodes a QPointF to a string. More... | |
static QString | encodeRealVector (const QVector< qreal > &v) |
static QString | encodeScaleMethod (Qgis::ScaleMethod scaleMethod) |
Encodes a symbol scale method to a string. More... | |
static QString | encodeSize (QSizeF size) |
Encodes a QSizeF to a string. More... | |
static QString | encodeSldAlpha (int alpha) |
static QString | encodeSldBrushStyle (Qt::BrushStyle style) |
static QString | encodeSldFontStyle (QFont::Style style) |
static QString | encodeSldFontWeight (int weight) |
static QString | encodeSldLineCapStyle (Qt::PenCapStyle style) |
static QString | encodeSldLineJoinStyle (Qt::PenJoinStyle style) |
static QString | encodeSldRealVector (const QVector< qreal > &v) |
static QString | encodeSldUom (QgsUnitTypes::RenderUnit unit, double *scaleFactor) |
Encodes a render unit into an SLD unit of measure string. More... | |
static double | estimateMaxSymbolBleed (QgsSymbol *symbol, const QgsRenderContext &context) |
Returns the maximum estimated bleed for the symbol. More... | |
static QgsStringMap | evaluatePropertiesMap (const QMap< QString, QgsProperty > &propertiesMap, const QgsExpressionContext &context) |
Evaluates a map of properties using the given context and returns a variant map with evaluated expressions from the properties. More... | |
static bool | externalGraphicFromSld (QDomElement &element, QString &path, QString &mime, QColor &color, double &size) |
static void | externalGraphicToSld (QDomDocument &doc, QDomElement &element, const QString &path, const QString &mime, const QColor &color, double size=-1) |
static bool | externalMarkerFromSld (QDomElement &element, QString &path, QString &format, int &markIndex, QColor &color, double &size) |
static void | externalMarkerToSld (QDomDocument &doc, QDomElement &element, const QString &path, const QString &format, int *markIndex=nullptr, const QColor &color=QColor(), double size=-1) |
static QString | fieldOrExpressionFromExpression (QgsExpression *expression) |
Returns a field name if the whole expression is just a name of the field . More... | |
static QgsExpression * | fieldOrExpressionToExpression (const QString &fieldOrExpression) |
Returns a new valid expression instance for given field or expression string. More... | |
static bool | fillFromSld (QDomElement &element, Qt::BrushStyle &brushStyle, QColor &color) |
static void | fillToSld (QDomDocument &doc, QDomElement &element, Qt::BrushStyle brushStyle, const QColor &color=QColor()) |
static bool | functionFromSldElement (QDomElement &element, QString &function) |
static bool | geometryFromSldElement (QDomElement &element, QString &geomFunc) |
static QgsStringMap | getSvgParameterList (QDomElement &element) |
static QString | getSvgParametricPath (const QString &basePath, const QColor &fillColor, const QColor &strokeColor, double strokeWidth) |
Encodes a reference to a parametric SVG into a path with parameters according to the SVG Parameters spec. More... | |
static QgsStringMap | getVendorOptionList (QDomElement &element) |
static bool | hasExternalGraphic (QDomElement &element) |
static bool | hasWellKnownMark (QDomElement &element) |
static QgsNamedColorList | importColorsFromGpl (QFile &file, bool &ok, QString &name) |
Imports colors from a gpl GIMP palette file. More... | |
static bool | isSharpCorner (QPointF p1, QPointF p2, QPointF p3) |
Returns true if the angle formed by the line p1 - p2 - p3 forms a "sharp" corner. More... | |
static void | labelTextToSld (QDomDocument &doc, QDomElement &element, const QString &label, const QFont &font, const QColor &color=QColor(), double size=-1) |
static bool | lineFromSld (QDomElement &element, Qt::PenStyle &penStyle, QColor &color, double &width, Qt::PenJoinStyle *penJoinStyle=nullptr, Qt::PenCapStyle *penCapStyle=nullptr, QVector< qreal > *customDashPattern=nullptr, double *dashOffset=nullptr) |
static void | lineToSld (QDomDocument &doc, QDomElement &element, Qt::PenStyle penStyle, const QColor &color, double width=-1, const Qt::PenJoinStyle *penJoinStyle=nullptr, const Qt::PenCapStyle *penCapStyle=nullptr, const QVector< qreal > *customDashPattern=nullptr, double dashOffset=0.0) |
static QStringList | listSvgFiles () |
Returns a list of all available svg files. More... | |
static QStringList | listSvgFilesAt (const QString &directory) |
Returns a list of svg files at the specified directory. More... | |
static QgsColorRamp * | loadColorRamp (const QVariant &value) |
Load a color ramp from a QVariantMap, wrapped in a QVariant. More... | |
static QgsColorRamp * | loadColorRamp (QDomElement &element) |
Creates a color ramp from the settings encoded in an XML element. More... | |
static QgsSymbol * | loadSymbol (const QDomElement &element, const QgsReadWriteContext &context) |
Attempts to load a symbol from a DOM element. More... | |
template<class SymbolType > | |
static SymbolType * | loadSymbol (const QDomElement &element, const QgsReadWriteContext &context) |
Attempts to load a symbol from a DOM element and cast it to a particular symbol type. More... | |
static QgsSymbolLayer * | loadSymbolLayer (QDomElement &element, const QgsReadWriteContext &context) |
Reads and returns symbol layer from XML. Caller is responsible for deleting the returned object. More... | |
static QgsSymbolMap | loadSymbols (QDomElement &element, const QgsReadWriteContext &context) |
Reads a collection of symbols from XML and returns them in a map. Caller is responsible for deleting returned symbols. More... | |
static void | mergeScaleDependencies (double mScaleMinDenom, double mScaleMaxDenom, QVariantMap &props) |
Merges the local scale limits, if any, with the ones already in the map, if any. More... | |
static void | multiplyImageOpacity (QImage *image, qreal opacity) |
Multiplies opacity of image pixel values with a (global) transparency value. More... | |
static bool | needEllipseMarker (QDomElement &element) |
static bool | needFontMarker (QDomElement &element) |
static bool | needLinePatternFill (QDomElement &element) |
static bool | needMarkerLine (QDomElement &element) |
static bool | needPointPatternFill (QDomElement &element) |
static bool | needSvgFill (QDomElement &element) |
static bool | needSvgMarker (QDomElement &element) |
static QString | ogrFeatureStyleBrush (const QColor &fillColr) |
Create ogr feature style string for brush. More... | |
static QString | ogrFeatureStylePen (double width, double mmScaleFactor, double mapUnitsScaleFactor, const QColor &c, Qt::PenJoinStyle joinStyle=Qt::MiterJoin, Qt::PenCapStyle capStyle=Qt::FlatCap, double offset=0.0, const QVector< qreal > *dashPattern=nullptr) |
Create ogr feature style string for pen. More... | |
static bool | onlineResourceFromSldElement (QDomElement &element, QString &path, QString &format) |
static bool | opacityFromSldElement (QDomElement &element, QString &alphaFunc) |
static void | parametricSvgToSld (QDomDocument &doc, QDomElement &graphicElem, const QString &path, const QColor &fillColor, double size, const QColor &strokeColor, double strokeWidth) |
Encodes a reference to a parametric SVG into SLD, as a succession of parametric SVG using URL parameters, a fallback SVG without parameters, and a final fallback as a mark with the right colors and stroke for systems that cannot do SVG at all. More... | |
static QColor | parseColor (const QString &colorStr, bool strictEval=false) |
Attempts to parse a string as a color using a variety of common formats, including hex codes, rgb and rgba strings. More... | |
static QList< QColor > | parseColorList (const QString &colorStr) |
Attempts to parse a string as a list of colors using a variety of common formats, including hex codes, rgb and rgba strings. More... | |
static QColor | parseColorWithAlpha (const QString &colorStr, bool &containsAlpha, bool strictEval=false) |
Attempts to parse a string as a color using a variety of common formats, including hex codes, rgb and rgba, hsl and hsla strings. More... | |
static QVariantMap | parseProperties (const QDomElement &element) |
Parses the properties from XML and returns a map. More... | |
static bool | pointInPolygon (const QPolygonF &points, QPointF point) |
Calculate whether a point is within of a QPolygonF. More... | |
static QPointF | pointOnLineWithDistance (QPointF startPoint, QPointF directionPoint, double distance) |
Returns a point on the line from startPoint to directionPoint that is a certain distance away from the starting point. More... | |
static QPointF | polygonCentroid (const QPolygonF &points) |
Calculate the centroid point of a QPolygonF. More... | |
static QPointF | polygonPointOnSurface (const QPolygonF &points, const QVector< QPolygonF > *rings=nullptr) |
Calculate a point on the surface of a QPolygonF. More... | |
static double | polylineLength (const QPolygonF &polyline) |
Returns the total length of a polyline. More... | |
static QPolygonF | polylineSubstring (const QPolygonF &polyline, double startOffset, double endOffset) |
Returns the substring of a polyline which starts at startOffset from the beginning of the line and ends at endOffset from the start of the line. More... | |
static void | premultiplyColor (QColor &rgb, int alpha) |
Converts a QColor into a premultiplied ARGB QColor value using a specified alpha value. More... | |
static QList< double > | prettyBreaks (double minimum, double maximum, int classes) |
Computes a sequence of about 'classes' equally spaced round values which cover the range of values from 'minimum' to 'maximum'. More... | |
static double | rendererFrameRate (const QgsFeatureRenderer *renderer) |
Calculates the frame rate (in frames per second) at which the given renderer must be redrawn. More... | |
static QVector< qreal > | rescaleUom (const QVector< qreal > &array, QgsUnitTypes::RenderUnit unit, const QVariantMap &props) |
Rescales the given array based on the uomScale found in the props, if any is found, otherwise returns a copy of the original point. More... | |
static double | rescaleUom (double size, QgsUnitTypes::RenderUnit unit, const QVariantMap &props) |
Rescales the given size based on the uomScale found in the props, if any is found, otherwise returns the value un-modified. More... | |
static QPointF | rescaleUom (QPointF point, QgsUnitTypes::RenderUnit unit, const QVariantMap &props) |
Rescales the given point based on the uomScale found in the props, if any is found, otherwise returns a copy of the original point. More... | |
static QgsSymbol * | restrictedSizeSymbol (const QgsSymbol *s, double minSize, double maxSize, QgsRenderContext *context, double &width, double &height, bool *ok=nullptr) |
Creates a new symbol with size restricted to min/max size if original size is out of min/max range. More... | |
static bool | rotationFromSldElement (QDomElement &element, QString &rotationFunc) |
static QDomElement | saveColorRamp (const QString &name, QgsColorRamp *ramp, QDomDocument &doc) |
Encodes a color ramp's settings to an XML element. More... | |
static bool | saveColorsToGpl (QFile &file, const QString &paletteName, const QgsNamedColorList &colors) |
Exports colors to a gpl GIMP palette file. More... | |
static void | saveProperties (QVariantMap props, QDomDocument &doc, QDomElement &element) |
Saves the map of properties to XML. More... | |
static QDomElement | saveSymbol (const QString &symbolName, const QgsSymbol *symbol, QDomDocument &doc, const QgsReadWriteContext &context) |
Writes a symbol definition to XML. More... | |
static QDomElement | saveSymbols (QgsSymbolMap &symbols, const QString &tagName, QDomDocument &doc, const QgsReadWriteContext &context) |
Writes a collection of symbols to XML with specified tagName for the top-level element. More... | |
static double | sizeInPixelsFromSldUom (const QString &uom, double size) |
Returns the size scaled in pixels according to the uom attribute. More... | |
static void | sortVariantList (QList< QVariant > &list, Qt::SortOrder order) |
Sorts the passed list in requested order. More... | |
static QString | svgSymbolNameToPath (const QString &name, const QgsPathResolver &pathResolver) |
Determines an SVG symbol's path from its name. More... | |
static QString | svgSymbolPathToName (const QString &path, const QgsPathResolver &pathResolver) |
Determines an SVG symbol's name from its path. More... | |
static QgsSymbol * | symbolFromMimeData (const QMimeData *data) |
Attempts to parse mime data as a symbol. More... | |
static QIcon | symbolLayerPreviewIcon (const QgsSymbolLayer *layer, QgsUnitTypes::RenderUnit u, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale(), Qgis::SymbolType parentSymbolType=Qgis::SymbolType::Hybrid, QgsMapLayer *mapLayer=nullptr) |
Draws a symbol layer preview to an icon. More... | |
static QPicture | symbolLayerPreviewPicture (const QgsSymbolLayer *layer, QgsUnitTypes::RenderUnit units, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale(), Qgis::SymbolType parentSymbolType=Qgis::SymbolType::Hybrid) |
Draws a symbol layer preview to a QPicture. More... | |
static QIcon | symbolPreviewIcon (const QgsSymbol *symbol, QSize size, int padding=0, QgsLegendPatchShape *shape=nullptr) |
Returns an icon preview for a color ramp. More... | |
static QPixmap | symbolPreviewPixmap (const QgsSymbol *symbol, QSize size, int padding=0, QgsRenderContext *customContext=nullptr, bool selected=false, const QgsExpressionContext *expressionContext=nullptr, const QgsLegendPatchShape *shape=nullptr) |
Returns a pixmap preview for a color ramp. More... | |
static QString | symbolProperties (QgsSymbol *symbol) |
Returns a string representing the symbol. More... | |
static QMimeData * | symbolToMimeData (const QgsSymbol *symbol) |
Creates new mime data from a symbol. More... | |
static QPointF | toPoint (const QVariant &value, bool *ok=nullptr) |
Converts a value to a point. More... | |
static QSizeF | toSize (const QVariant &value, bool *ok=nullptr) |
Converts a value to a size. More... | |
static QSet< const QgsSymbolLayer * > | toSymbolLayerPointers (QgsFeatureRenderer *renderer, const QSet< QgsSymbolLayerId > &symbolLayerIds) |
Converts a set of symbol layer id to a set of pointers to actual symbol layers carried by the feature renderer. More... | |
static bool | wellKnownMarkerFromSld (QDomElement &element, QString &name, QColor &color, QColor &strokeColor, Qt::PenStyle &strokeStyle, double &strokeWidth, double &size) |
static void | wellKnownMarkerToSld (QDomDocument &doc, QDomElement &element, const QString &name, const QColor &color, const QColor &strokeColor, Qt::PenStyle strokeStyle, double strokeWidth=-1, double size=-1) |
Definition at line 57 of file qgssymbollayerutils.h.
|
static |
Appends a polyline line to an existing target polyline.
Any duplicate points at the start line which match the end point from target will be skipped.
Definition at line 4507 of file qgssymbollayerutils.cpp.
|
static |
Checks if the properties contain scaleMinDenom and scaleMaxDenom, if available, they are added into the SE Rule element.
Definition at line 4802 of file qgssymbollayerutils.cpp.
|
static |
Blurs an image in place, e.g. creating Qt-independent drop shadows.
Definition at line 3983 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 3267 of file qgssymbollayerutils.cpp.
|
static |
Attempts to parse mime data as a color.
data | mime data to parse |
hasAlpha | will be set to true if mime data was interpreted as a color containing an explicit alpha value |
Definition at line 3493 of file qgssymbollayerutils.cpp.
|
static |
Attempts to parse mime data as a list of named colors.
data | mime data to parse |
Definition at line 3521 of file qgssymbollayerutils.cpp.
|
static |
Creates mime data from a list of named colors.
colorList | list of named colors |
allFormats | set to true to include additional mime formats, include text/plain and application/x-color |
Definition at line 3634 of file qgssymbollayerutils.cpp.
|
static |
Returns an icon preview for a color ramp.
ramp | color ramp |
size | target icon size |
padding | space between icon edge and color ramp |
Definition at line 1020 of file qgssymbollayerutils.cpp.
|
static |
Returns a pixmap preview for a color ramp.
ramp | color ramp |
size | target pixmap size |
padding | space between icon edge and color ramp |
direction | direction to render pixmap (since QGIS 3.18) |
flipDirection | set to true to flip the direction of the ramp. For horizontal directions, ramps will be rendered left to right by default. For vertical directions, ramps will be rendered top to bottom by default. Setting this flag to true will reverse these default directions. |
drawTransparentBackground | set to false to disable the checkerboard effect drawn below transparent colors in the ramp |
Definition at line 1025 of file qgssymbollayerutils.cpp.
|
static |
Saves a color ramp to a QVariantMap, wrapped in a QVariant.
You can use QgsXmlUtils::writeVariant to save it to an XML document.
Definition at line 3351 of file qgssymbollayerutils.cpp.
|
static |
Creates mime data from a color.
Sets both the mime data's color data, and the mime data's text with the color's hex code.
color | color to encode as mime data |
Definition at line 3483 of file qgssymbollayerutils.cpp.
|
static |
Returns a friendly display name for a color.
color | source color |
Definition at line 3402 of file qgssymbollayerutils.cpp.
|
static |
Attempts to condense a fill and outline layer, by moving the outline layer to the fill symbol's stroke.
This will only be done if the outline can be transformed into a stroke on the fill layer losslessly. If so, fill will be updated in place with the new stroke. Any existing stroke settings in fill will be replaced.
Returns true
if the fill and outline were successfully condensed.
Definition at line 4080 of file qgssymbollayerutils.cpp.
|
static |
Converts a polygon symbolizer element to a list of marker symbol layers.
Definition at line 1865 of file qgssymbollayerutils.cpp.
|
static |
Creates a SE 1.1 anchor point element as a child of the specified element.
doc | The document |
element | The parent element |
anchor | An anchor specification, with values between 0 and 1 |
Definition at line 2765 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2747 of file qgssymbollayerutils.cpp.
|
static |
Creates a OGC Expression element based on the provided function expression.
doc | The document owning the element |
element | The element parent |
function | The expression to be encoded |
Definition at line 2965 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 1613 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2981 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2922 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 1636 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 1655 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 3033 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2727 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2706 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 3067 of file qgssymbollayerutils.cpp.
|
static |
Creates a symbol layer list from a DOM element.
Definition at line 1463 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 3114 of file qgssymbollayerutils.cpp.
|
static |
Decodes a value representing an arrow head type.
Definition at line 419 of file qgssymbollayerutils.cpp.
|
static |
Decodes a value representing an arrow type.
Definition at line 444 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 853 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 319 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 68 of file qgssymbollayerutils.cpp.
|
static |
Decodes a string representing a symbol coordinate reference mode.
string | string to decode |
ok | will be set to true if string was successfully decoded |
Definition at line 391 of file qgssymbollayerutils.cpp.
|
static |
Decodes a string representing a line clip mode.
string | string to decode |
ok | will be set to true if string was successfully decoded |
Definition at line 505 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 675 of file qgssymbollayerutils.cpp.
|
static |
Decodes a string representing a marker clip mode.
string | string to decode |
ok | will be set to true if string was successfully decoded |
Definition at line 469 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 249 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 199 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 173 of file qgssymbollayerutils.cpp.
|
static |
Decodes a QSizeF from a string.
Definition at line 542 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 778 of file qgssymbollayerutils.cpp.
|
static |
Decodes a symbol scale method from a string.
Definition at line 837 of file qgssymbollayerutils.cpp.
|
static |
Decodes a QSizeF from a string.
Definition at line 606 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 92 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 376 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 118 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 138 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 272 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 226 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 807 of file qgssymbollayerutils.cpp.
|
static |
Decodes a SLD unit of measure string to a render unit.
str | string to decode |
scaleFactor | if specified, will be set to scale factor for unit of measure |
Definition at line 739 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2782 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 1070 of file qgssymbollayerutils.cpp.
|
static |
Draws a vertex symbol at (painter) coordinates x, y.
(Useful to assist vertex editing.)
Definition at line 1089 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 280 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 63 of file qgssymbollayerutils.cpp.
|
static |
Encodes a symbol coordinate reference mode to a string.
coordinateReference | coordinate reference mode |
Definition at line 407 of file qgssymbollayerutils.cpp.
|
static |
Encodes a line clip mode to a string.
Definition at line 523 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 665 of file qgssymbollayerutils.cpp.
|
static |
Encodes a marker clip mode to a string.
Definition at line 489 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 234 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 184 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 152 of file qgssymbollayerutils.cpp.
|
static |
Encodes a QPointF to a string.
Definition at line 537 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 763 of file qgssymbollayerutils.cpp.
|
static |
Encodes a symbol scale method to a string.
Definition at line 821 of file qgssymbollayerutils.cpp.
|
static |
Encodes a QSizeF to a string.
Definition at line 601 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 87 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 339 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 103 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 126 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 257 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 211 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 792 of file qgssymbollayerutils.cpp.
|
static |
Encodes a render unit into an SLD unit of measure string.
unit | unit to encode |
scaleFactor | if specified, will be set to scale factor for unit of measure |
Definition at line 713 of file qgssymbollayerutils.cpp.
|
static |
Returns the maximum estimated bleed for the symbol.
Definition at line 933 of file qgssymbollayerutils.cpp.
|
static |
Evaluates a map of properties using the given context and returns a variant map with evaluated expressions from the properties.
Definition at line 5064 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2524 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2441 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2579 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2549 of file qgssymbollayerutils.cpp.
|
static |
Returns a field name if the whole expression is just a name of the field .
Returns full expression string if the expression is more complex than just one field. Using just expression->expression() method may return quoted field name, but that is not wanted for saving (due to backward compatibility) or display in GUI.
Definition at line 4535 of file qgssymbollayerutils.cpp.
|
static |
Returns a new valid expression instance for given field or expression string.
If the input is not a valid expression, it is assumed that it is a field name and gets properly quoted. If the string is empty, returns nullptr
. This is useful when accepting input which could be either a non-quoted field name or expression.
Definition at line 4519 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2172 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2121 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2996 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2956 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 3075 of file qgssymbollayerutils.cpp.
|
static |
Encodes a reference to a parametric SVG into a path with parameters according to the SVG Parameters spec.
Definition at line 2489 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 3122 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 1678 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 1719 of file qgssymbollayerutils.cpp.
|
static |
Imports colors from a gpl GIMP palette file.
file | source gpl file |
ok | will be true if file was successfully read |
name | will be set to palette name from gpl file, if present |
Definition at line 3710 of file qgssymbollayerutils.cpp.
|
static |
Returns true
if the angle formed by the line p1 - p2 - p3 forms a "sharp" corner.
Sharp corners form an angle which exceeds a 45 degree threshold.
Definition at line 4498 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2811 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2310 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2226 of file qgssymbollayerutils.cpp.
|
static |
Returns a list of all available svg files.
Definition at line 4149 of file qgssymbollayerutils.cpp.
|
static |
Returns a list of svg files at the specified directory.
Definition at line 4175 of file qgssymbollayerutils.cpp.
|
static |
Load a color ramp from a QVariantMap, wrapped in a QVariant.
You can use QgsXmlUtils::readVariant to load it from an XML document.
Definition at line 3370 of file qgssymbollayerutils.cpp.
|
static |
Creates a color ramp from the settings encoded in an XML element.
element | DOM element |
Definition at line 3316 of file qgssymbollayerutils.cpp.
|
static |
Attempts to load a symbol from a DOM element.
element | DOM element representing symbol |
context | object to transform relative to absolute paths |
Definition at line 1213 of file qgssymbollayerutils.cpp.
|
inlinestatic |
Attempts to load a symbol from a DOM element and cast it to a particular symbol type.
element | DOM element representing symbol |
context | object to transform relative to absolute paths |
Definition at line 383 of file qgssymbollayerutils.h.
|
static |
Reads and returns symbol layer from XML. Caller is responsible for deleting the returned object.
Definition at line 1323 of file qgssymbollayerutils.cpp.
|
static |
Reads a collection of symbols from XML and returns them in a map. Caller is responsible for deleting returned symbols.
Definition at line 3175 of file qgssymbollayerutils.cpp.
|
static |
Merges the local scale limits, if any, with the ones already in the map, if any.
Definition at line 4819 of file qgssymbollayerutils.cpp.
|
static |
Multiplies opacity of image pixel values with a (global) transparency value.
Definition at line 3953 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 1779 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 1734 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 1810 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 1797 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 1845 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 1851 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 1774 of file qgssymbollayerutils.cpp.
|
static |
Create ogr feature style string for brush.
fillColr | fill color |
Definition at line 2912 of file qgssymbollayerutils.cpp.
|
static |
Create ogr feature style string for pen.
Definition at line 2838 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 3048 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2737 of file qgssymbollayerutils.cpp.
|
static |
Encodes a reference to a parametric SVG into SLD, as a succession of parametric SVG using URL parameters, a fallback SVG without parameters, and a final fallback as a mark with the right colors and stroke for systems that cannot do SVG at all.
Definition at line 2461 of file qgssymbollayerutils.cpp.
|
static |
Attempts to parse a string as a color using a variety of common formats, including hex codes, rgb and rgba strings.
colorStr | string representing the color |
strictEval | set to true for stricter color parsing rules |
Definition at line 3793 of file qgssymbollayerutils.cpp.
|
static |
Attempts to parse a string as a list of colors using a variety of common formats, including hex codes, rgb and rgba strings.
colorStr | string representing the color list |
Definition at line 3414 of file qgssymbollayerutils.cpp.
|
static |
Attempts to parse a string as a color using a variety of common formats, including hex codes, rgb and rgba, hsl and hsla strings.
colorStr | string representing the color |
containsAlpha | if colorStr contains an explicit alpha value then containsAlpha will be set to true |
strictEval | set to true for stricter color parsing rules |
Definition at line 3799 of file qgssymbollayerutils.cpp.
|
static |
Parses the properties from XML and returns a map.
Definition at line 3142 of file qgssymbollayerutils.cpp.
|
static |
Calculate whether a point is within of a QPolygonF.
Definition at line 4371 of file qgssymbollayerutils.cpp.
|
static |
Returns a point on the line from startPoint to directionPoint that is a certain distance away from the starting point.
Definition at line 4139 of file qgssymbollayerutils.cpp.
|
static |
Calculate the centroid point of a QPolygonF.
Definition at line 4303 of file qgssymbollayerutils.cpp.
|
static |
Calculate a point on the surface of a QPolygonF.
Definition at line 4335 of file qgssymbollayerutils.cpp.
|
static |
Returns the total length of a polyline.
Definition at line 4397 of file qgssymbollayerutils.cpp.
|
static |
Returns the substring of a polyline which starts at startOffset from the beginning of the line and ends at endOffset from the start of the line.
If startOffset is less than 0, then the start point will be calculated by subtracting that distance from the end of the line. Similarly, if endOffset is less than zero then the end point will be subtracted from the end of the line.
May return an empty linestring if the substring is zero length.
Definition at line 4415 of file qgssymbollayerutils.cpp.
|
static |
Converts a QColor into a premultiplied ARGB QColor value using a specified alpha value.
Definition at line 4059 of file qgssymbollayerutils.cpp.
|
static |
Computes a sequence of about 'classes' equally spaced round values which cover the range of values from 'minimum' to 'maximum'.
The values are chosen so that they are 1, 2 or 5 times a power of 10.
Definition at line 4545 of file qgssymbollayerutils.cpp.
|
static |
Calculates the frame rate (in frames per second) at which the given renderer must be redrawn.
Returns -1 if the renderer is not animated.
Definition at line 4922 of file qgssymbollayerutils.cpp.
|
static |
Rescales the given array based on the uomScale found in the props, if any is found, otherwise returns a copy of the original point.
Definition at line 4791 of file qgssymbollayerutils.cpp.
|
static |
Rescales the given size based on the uomScale found in the props, if any is found, otherwise returns the value un-modified.
Definition at line 4707 of file qgssymbollayerutils.cpp.
|
static |
Rescales the given point based on the uomScale found in the props, if any is found, otherwise returns a copy of the original point.
Definition at line 4784 of file qgssymbollayerutils.cpp.
|
static |
Creates a new symbol with size restricted to min/max size if original size is out of min/max range.
s | the original symbol |
minSize | the minimum size in mm |
maxSize | the maximum size in mm |
context | the render context |
width | expected width, can be changed by the function |
height | expected height, can be changed by the function |
ok | if not nullptr, ok is set to false if it's not possible to compute a restricted symbol (if geometry generators are involved for instance) |
Definition at line 4985 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2716 of file qgssymbollayerutils.cpp.
|
static |
Encodes a color ramp's settings to an XML element.
name | name of ramp |
ramp | color ramp to save |
doc | XML document |
Definition at line 3341 of file qgssymbollayerutils.cpp.
|
static |
Exports colors to a gpl GIMP palette file.
file | destination file |
paletteName | name of palette, which is stored in gpl file |
colors | colors to export |
true
if export was successful Definition at line 3675 of file qgssymbollayerutils.cpp.
|
static |
Saves the map of properties to XML.
Definition at line 3170 of file qgssymbollayerutils.cpp.
|
static |
Writes a symbol definition to XML.
Definition at line 1396 of file qgssymbollayerutils.cpp.
|
static |
Writes a collection of symbols to XML with specified tagName for the top-level element.
Definition at line 3253 of file qgssymbollayerutils.cpp.
|
static |
Returns the size scaled in pixels according to the uom attribute.
uom | The uom attribute from SLD 1.1 version |
size | The original size |
Definition at line 4842 of file qgssymbollayerutils.cpp.
|
static |
Sorts the passed list in requested order.
Definition at line 4125 of file qgssymbollayerutils.cpp.
|
static |
Determines an SVG symbol's path from its name.
If name is not an absolute path the file is scanned for in the SVG paths specified in settings svg/searchPathsForSVG.
Definition at line 4202 of file qgssymbollayerutils.cpp.
|
static |
Determines an SVG symbol's name from its path.
Definition at line 4268 of file qgssymbollayerutils.cpp.
|
static |
Attempts to parse mime data as a symbol.
A new symbol instance will be returned if the data was successfully converted to a symbol.
Definition at line 3291 of file qgssymbollayerutils.cpp.
|
static |
Draws a symbol layer preview to an icon.
layer | symbol layer to draw |
u | size units |
size | target size of preview icon |
scale | map unit scale for preview |
parentSymbolType | since QGIS 3.22, can be used to specify the parent symbol type so that geometry generator preview icons are correctly calculated |
mapLayer | since QGIS 3.28, can be used to specify the associated map layer so that layer related expressions are correctly calculated |
Definition at line 982 of file qgssymbollayerutils.cpp.
|
static |
Draws a symbol layer preview to a QPicture.
layer | symbol layer to draw |
units | size units |
size | target size of preview picture |
scale | map unit scale for preview |
parentSymbolType | since QGIS 3.22, can be used to specify the parent symbol type so that geometry generator preview icons are correctly calculated |
Definition at line 946 of file qgssymbollayerutils.cpp.
|
static |
Returns an icon preview for a color ramp.
symbol | symbol |
size | target pixmap size |
padding | space between icon edge and symbol |
shape | optional legend patch shape to use for rendering the preview icon |
Definition at line 870 of file qgssymbollayerutils.cpp.
|
static |
Returns a pixmap preview for a color ramp.
symbol | symbol |
size | target pixmap size |
padding | space between icon edge and symbol |
customContext | render context to use when rendering symbol |
selected | set to true to render the symbol in a selected state |
expressionContext | optional custom expression context |
shape | optional legend patch shape to use for rendering the preview icon |
Definition at line 875 of file qgssymbollayerutils.cpp.
|
static |
Returns a string representing the symbol.
Can be used to test for equality between symbols.
Definition at line 1453 of file qgssymbollayerutils.cpp.
|
static |
Creates new mime data from a symbol.
This also sets the mime color data to match the symbol's color, so that copied symbols can be paste in places where a color is expected.
Definition at line 3273 of file qgssymbollayerutils.cpp.
|
static |
Converts a value to a point.
value | value to convert |
ok | if specified, will be set to true if value was successfully converted |
Definition at line 550 of file qgssymbollayerutils.cpp.
|
static |
Converts a value to a size.
value | value to convert |
ok | if specified, will be set to true if value was successfully converted |
Definition at line 614 of file qgssymbollayerutils.cpp.
|
static |
Converts a set of symbol layer id to a set of pointers to actual symbol layers carried by the feature renderer.
Definition at line 4862 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2659 of file qgssymbollayerutils.cpp.
|
static |
Definition at line 2623 of file qgssymbollayerutils.cpp.