QGIS API Documentation
3.8.0-Zanzibar (11aff65)
|
#include <qgssymbol.h>
Public Member Functions | |
QgsSymbolRenderContext (QgsRenderContext &c, QgsUnitTypes::RenderUnit u, qreal opacity=1.0, bool selected=false, QgsSymbol::RenderHints renderHints=nullptr, const QgsFeature *f=nullptr, const QgsFields &fields=QgsFields(), const QgsMapUnitScale &mapUnitScale=QgsMapUnitScale()) | |
Constructor for QgsSymbolRenderContext. More... | |
QgsSymbolRenderContext (const QgsSymbolRenderContext &rh)=delete | |
QgsSymbolRenderContext cannot be copied. More... | |
QgsExpressionContextScope * | expressionContextScope () |
This scope is always available when a symbol of this type is being rendered. More... | |
const QgsFeature * | feature () const |
Returns the current feature being rendered. More... | |
QgsFields | fields () const |
Fields of the layer. More... | |
int | geometryPartCount () const |
Part count of current geometry. More... | |
int | geometryPartNum () const |
Part number of current geometry. More... | |
Q_DECL_DEPRECATED QgsMapUnitScale | mapUnitScale () const |
qreal | opacity () const |
Returns the opacity for the symbol. More... | |
QgsSymbolRenderContext & | operator= (const QgsSymbolRenderContext &) |
QgsWkbTypes::GeometryType | originalGeometryType () const |
Returns the geometry type for the original feature geometry being rendered. More... | |
Q_DECL_DEPRECATED double | outputLineWidth (double width) const |
Q_DECL_DEPRECATED double | outputPixelSize (double size) const |
Q_DECL_DEPRECATED QgsUnitTypes::RenderUnit | outputUnit () const |
Returns the output unit for the context. More... | |
QgsRenderContext & | renderContext () |
Returns a reference to the context's render context. More... | |
const QgsRenderContext & | renderContext () const |
Returns a reference to the context's render context. More... | |
QgsSymbol::RenderHints | renderHints () const |
Returns the rendering hint flags for the symbol. More... | |
bool | selected () const |
Returns true if symbols should be rendered using the selected symbol coloring and style. More... | |
void | setExpressionContextScope (QgsExpressionContextScope *contextScope) |
Set an expression scope for this symbol. More... | |
void | setFeature (const QgsFeature *f) |
void | setGeometryPartCount (int count) |
Sets the part count of current geometry. More... | |
void | setGeometryPartNum (int num) |
Sets the part number of current geometry. More... | |
Q_DECL_DEPRECATED void | setMapUnitScale (const QgsMapUnitScale &scale) |
void | setOpacity (qreal opacity) |
Sets the opacity for the symbol. More... | |
void | setOriginalGeometryType (QgsWkbTypes::GeometryType type) |
Sets the geometry type for the original feature geometry being rendered. More... | |
void | setOriginalValueVariable (const QVariant &value) |
Sets the original value variable value for data defined symbology. More... | |
Q_DECL_DEPRECATED void | setOutputUnit (QgsUnitTypes::RenderUnit u) |
Sets the output unit for the context. More... | |
void | setRenderHints (QgsSymbol::RenderHints hints) |
Sets rendering hint flags for the symbol. More... | |
void | setSelected (bool selected) |
Sets whether symbols should be rendered using the selected symbol coloring and style. More... | |
Definition at line 549 of file qgssymbol.h.
QgsSymbolRenderContext::QgsSymbolRenderContext | ( | QgsRenderContext & | c, |
QgsUnitTypes::RenderUnit | u, | ||
qreal | opacity = 1.0 , |
||
bool | selected = false , |
||
QgsSymbol::RenderHints | renderHints = nullptr , |
||
const QgsFeature * | f = nullptr , |
||
const QgsFields & | fields = QgsFields() , |
||
const QgsMapUnitScale & | mapUnitScale = QgsMapUnitScale() |
||
) |
Constructor for QgsSymbolRenderContext.
c | |
u | |
opacity | value between 0 (fully transparent) and 1 (fully opaque) |
selected | set to true if symbol should be drawn in a "selected" state |
renderHints | flags controlling rendering behavior |
f | |
fields | |
mapUnitScale |
Definition at line 1111 of file qgssymbol.cpp.
|
delete |
QgsSymbolRenderContext cannot be copied.
QgsExpressionContextScope * QgsSymbolRenderContext::expressionContextScope | ( | ) |
This scope is always available when a symbol of this type is being rendered.
Definition at line 1150 of file qgssymbol.cpp.
|
inline |
Returns the current feature being rendered.
This may be nullptr
.
Definition at line 655 of file qgssymbol.h.
|
inline |
Fields of the layer.
Currently only available in startRender() calls to allow symbols with data-defined properties prepare the expressions (other times fields() returns an empty QgsFields object).
Definition at line 680 of file qgssymbol.h.
|
inline |
|
inline |
|
inline |
Definition at line 605 of file qgssymbol.h.
|
inline |
Returns the opacity for the symbol.
Definition at line 617 of file qgssymbol.h.
QgsSymbolRenderContext & QgsSymbolRenderContext::operator= | ( | const QgsSymbolRenderContext & | ) |
Definition at line 1140 of file qgssymbol.cpp.
|
inline |
Returns the geometry type for the original feature geometry being rendered.
This can be useful if symbol layers alter their appearance based on geometry type - eg offsetting a simple line style will look different if the simple line is rendering a polygon feature (a closed buffer) vs a line feature (an unclosed offset line).
Definition at line 672 of file qgssymbol.h.
double QgsSymbolRenderContext::outputLineWidth | ( | double | width | ) | const |
Definition at line 1130 of file qgssymbol.cpp.
double QgsSymbolRenderContext::outputPixelSize | ( | double | size | ) | const |
Definition at line 1135 of file qgssymbol.cpp.
|
inline |
Returns the output unit for the context.
Definition at line 594 of file qgssymbol.h.
|
inline |
Returns a reference to the context's render context.
Definition at line 574 of file qgssymbol.h.
|
inline |
Returns a reference to the context's render context.
Definition at line 580 of file qgssymbol.h.
|
inline |
Returns the rendering hint flags for the symbol.
Definition at line 642 of file qgssymbol.h.
|
inline |
Returns true
if symbols should be rendered using the selected symbol coloring and style.
Definition at line 630 of file qgssymbol.h.
void QgsSymbolRenderContext::setExpressionContextScope | ( | QgsExpressionContextScope * | contextScope | ) |
Set an expression scope for this symbol.
Will take ownership.
contextScope | An expression scope for details about this symbol |
Definition at line 1155 of file qgssymbol.cpp.
|
inline |
Definition at line 650 of file qgssymbol.h.
|
inline |
|
inline |
Sets the part number of current geometry.
Definition at line 704 of file qgssymbol.h.
|
inline |
Definition at line 610 of file qgssymbol.h.
|
inline |
Sets the opacity for the symbol.
opacity | opacity value between 0 (fully transparent) and 1 (fully opaque) |
Definition at line 624 of file qgssymbol.h.
|
inline |
Sets the geometry type for the original feature geometry being rendered.
Definition at line 662 of file qgssymbol.h.
void QgsSymbolRenderContext::setOriginalValueVariable | ( | const QVariant & | value | ) |
Sets the original value variable value for data defined symbology.
value | value for original value variable. This usually represents the symbol property value before any data defined overrides have been applied. |
Definition at line 1125 of file qgssymbol.cpp.
|
inline |
Sets the output unit for the context.
Definition at line 600 of file qgssymbol.h.
|
inline |
Sets rendering hint flags for the symbol.
Definition at line 648 of file qgssymbol.h.
|
inline |
Sets whether symbols should be rendered using the selected symbol coloring and style.
Definition at line 636 of file qgssymbol.h.