80 bool mIsAnimated =
false;
81 double mFrameRate = 10;
119 double size()
const {
return mSize; }
170 Qt::PenJoinStyle
joinStyle()
const {
return mJoinStyle; }
211 bool mEnabled =
false;
215 Qt::PenJoinStyle mJoinStyle = Qt::RoundJoin;
216 std::unique_ptr< QgsFillSymbol > mFillSymbol;
230 switch ( sipCpp->type() )
233 sipType = sipType_QgsMarkerSymbol;
236 sipType = sipType_QgsLineSymbol;
239 sipType = sipType_QgsFillSymbol;
337 const int count = sipCpp->symbolLayerCount();
338 if ( a0 < 0 || a0 >= count )
340 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
345 sipRes = sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
367 sipRes = sipCpp->symbolLayerCount();
371 int __bool__()
const;
388 const int count = sipCpp->symbolLayerCount();
389 if ( a0 < -count || a0 >= count )
391 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
396 return sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
400 return sipConvertFromType( sipCpp->symbolLayer( count + a0 ), sipType_QgsSymbolLayer, NULL );
414 void __delitem__(
int index );
416 const int count = sipCpp->symbolLayerCount();
417 if ( a0 >= 0 && a0 < count )
418 sipCpp->deleteSymbolLayer( a0 );
419 else if ( a0 < 0 && a0 >= -count )
420 sipCpp->deleteSymbolLayer( count + a0 );
423 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
437 bool insertSymbolLayer(
int index, QgsSymbolLayer *layer
SIP_TRANSFER );
445 bool appendSymbolLayer( QgsSymbolLayer *layer
SIP_TRANSFER );
450 bool deleteSymbolLayer(
int index );
467 bool changeSymbolLayer(
int index, QgsSymbolLayer *layer
SIP_TRANSFER );
478 void startRender( QgsRenderContext &context,
const QgsFields &fields = QgsFields() );
486 void stopRender( QgsRenderContext &context );
498 void setColor(
const QColor &color )
const;
508 QColor color()
const;
526 void drawPreviewIcon(
529 QgsRenderContext *customContext =
nullptr,
530 bool selected =
false,
531 const QgsExpressionContext *expressionContext =
nullptr,
532 const QgsLegendPatchShape *patchShape =
nullptr,
533 const QgsScreenProperties &screen = QgsScreenProperties()
545 void exportImage(
const QString &path,
const QString &format, QSize size );
556 QImage asImage( QSize size, QgsRenderContext *customContext =
nullptr );
569 QImage bigSymbolPreviewImage(
570 QgsExpressionContext *expressionContext =
nullptr,
572 const QgsScreenProperties &screen = QgsScreenProperties()
578 Q_DECL_DEPRECATED QImage bigSymbolPreviewImage( QgsExpressionContext *expressionContext =
nullptr,
int flags = static_cast<
int >( Qgis::SymbolPreviewFlag::FlagIncludeCrosshairsForMarkerSymbols ) )
584 QString dump() const;
599 bool rendersIdenticallyTo( const QgsSymbol *other ) const;
613 Q_DECL_DEPRECATED
void toSld( QDomDocument &doc, QDomElement &element, QVariantMap props ) const
SIP_DEPRECATED;
824 void setDataDefinedProperty( Property key, const
QgsProperty &property );
852 bool hasDataDefinedProperties()
const;
863 bool canCauseArtifactsBetweenAdjacentTiles()
const;
886 bool selected = false,
887 bool drawVertexMarker = false,
888 Qgis::VertexMarkerType currentVertexMarkerType =
Qgis::VertexMarkerType::SemiTransparentCircle,
889 double currentVertexMarkerSize = 0.0
931 double extentBuffer() const;
942 void setExtentBuffer(
double extentBuffer );
978 double x = point.
x();
979 double y = point.
y();
982 pt = QPointF( x, y );
1002 static QPolygonF _getPolygonRing(
QgsRenderContext &context,
const QgsCurve &curve,
bool clipToExtent,
bool isExteriorRing =
false,
bool correctRingOrientation =
false );
1011 static void _getPolygon( QPolygonF &pts, QVector<QPolygonF> &holes,
QgsRenderContext &context,
const QgsPolygon &polygon,
bool clipToExtent =
true,
bool correctRingOrientation =
false );
1024 void copyCommonProperties( const
QgsSymbol *other );
1038 void renderUsingLayer(
1045 void renderVertexMarker( QPointF pt,
QgsRenderContext &context,
Qgis::VertexMarkerType currentVertexMarkerType,
double currentVertexMarkerSize );
1078 static void initPropertyDefinitions();
1087 bool mStarted =
false;
1090 std::unique_ptr< QgsSymbolRenderContext > mSymbolRenderContext;
1110 static QPolygonF _getPolygonRing2d(
QgsRenderContext &context,
const QgsCurve &curve,
bool clipToExtent,
bool isExteriorRing =
false,
bool correctRingOrientation =
false );
1118 static QPolygonF _getPolygonRing3d(
QgsRenderContext &context,
const QgsCurve &curve,
bool clipToExtent,
bool isExteriorRing =
false,
bool correctRingOrientation =
false );
Provides global constants and enumerations for use throughout the application.
QFlags< SymbolPreviewFlag > SymbolPreviewFlags
Symbol preview flags.
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
RenderUnit
Rendering size units.
@ Millimeters
Millimeters.
@ FlagIncludeCrosshairsForMarkerSymbols
Include a crosshairs reference image in the background of marker symbol previews.
QFlags< SymbolRenderHint > SymbolRenderHints
Symbol render hints.
QFlags< SymbolFlag > SymbolFlags
Symbol flags.
Custom exception class for Coordinate Reference System related exceptions.
Abstract base class for curved geometry type.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Represents a patch shape for use in map legends.
Abstract base class for line symbol layers.
void transformInPlace(double &x, double &y) const
Transforms map coordinates to device coordinates.
Struct for storing maximum and minimum scales for measurements in map units.
Point geometry type, with support for z-dimension and m-values.
QPointF toQPointF() const
Returns the point as a QPointF.
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
A store for object properties.
A container for the context for various read/write operations on objects.
Contains information about the context of a rendering operation.
const QgsMapToPixel & mapToPixel() const
Returns the context's map to pixel transform, which transforms between map coordinates and device coo...
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context.
Holds SLD export options and other information related to SLD export of a QGIS layer style.
Contains settings relating to symbol animation.
bool isAnimated() const
Returns true if the symbol is animated.
void setIsAnimated(bool animated)
Sets whether the symbol is animated.
void setFrameRate(double rate)
Sets the symbol animation frame rate (in frames per second).
double frameRate() const
Returns the symbol animation frame rate (in frames per second).
Contains settings relating to symbol buffers, which draw a "halo" effect around the symbol.
void setEnabled(bool enabled)
Sets whether the symbol buffer will be drawn.
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale object for the buffer size.
bool enabled() const
Returns whether the buffer is enabled.
~QgsSymbolBufferSettings()
QgsMapUnitScale sizeMapUnitScale() const
Returns the map unit scale object for the buffer size.
void setSize(double size)
Sets the size of the buffer.
QgsSymbolBufferSettings()
void setJoinStyle(Qt::PenJoinStyle style)
Sets the join style used for drawing the buffer.
void setSizeUnit(Qgis::RenderUnit unit)
Sets the unit used for the buffer size.
QgsSymbolBufferSettings & operator=(const QgsSymbolBufferSettings &)
Qt::PenJoinStyle joinStyle() const
Returns the buffer join style.
Qgis::RenderUnit sizeUnit() const
Returns the units for the buffer size.
double size() const
Returns the size of the buffer.
Abstract base class for symbol layers.
Encapsulates the context in which a symbol is being rendered.
Abstract base class for all rendered symbols.
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the symbol's property collection, used for data defined overrides.
Qgis::SymbolFlags mSymbolFlags
Symbol flags.
void setOutputUnit(Qgis::RenderUnit unit) const
Sets the units to use for sizes and widths within the symbol.
Property
Data definable properties.
void setRenderHints(Qgis::SymbolRenderHints hints)
Sets rendering hint flags for the symbol.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol's property collection, used for data defined overrides.
qreal mOpacity
Symbol opacity (in the range 0 - 1).
Q_DECL_DEPRECATED const QgsVectorLayer * mLayer
static QPointF _getPoint(QgsRenderContext &context, const QgsPoint &point)
Creates a point in screen coordinates from a QgsPoint in map coordinates.
bool mClipFeaturesToExtent
bool usesMapUnits() const
Returns true if the symbol has any components which use map unit based sizes.
friend class QgsFeatureRenderer
Qgis::SymbolFlags flags() const
Returns flags for the symbol.
Q_DECL_DEPRECATED void toSld(QDomDocument &doc, QDomElement &element, QVariantMap props) const
Converts the symbol to a SLD representation.
QgsMapUnitScale mapUnitScale() const
Returns the map unit scale for the symbol.
static QString symbolTypeToString(Qgis::SymbolType type)
Returns a translated string version of the specified symbol type.
qreal opacity() const
Returns the opacity for the symbol.
static Qgis::SymbolType symbolTypeForGeometryType(Qgis::GeometryType type)
Returns the default symbol type required for the specified geometry type.
void setMapUnitScale(const QgsMapUnitScale &scale) const
Sets the map unit scale for the symbol.
bool clipFeaturesToExtent() const
Returns whether features drawn by the symbol will be clipped to the render context's extent.
void setFlags(Qgis::SymbolFlags flags)
Sets flags for the symbol.
Qgis::RenderUnit mExtentBufferSizeUnit
void setExtentBufferSizeUnit(Qgis::RenderUnit unit)
Sets the unit used for the extent buffer.
std::unique_ptr< QgsSymbolBufferSettings > mBufferSettings
QgsSymbolLayerList symbolLayers() const
Returns the list of symbol layers contained in the symbol.
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
Qgis::RenderUnit extentBufferSizeUnit() const
Returns the units for the buffer size.
Qgis::SymbolRenderHints mRenderHints
virtual QgsSymbol * clone() const =0
Returns a deep copy of this symbol.
int symbolLayerCount() const
Returns the total number of symbol layers contained in the symbol.
QgsSymbolLayerList mLayers
QgsSymbolAnimationSettings mAnimationSettings
Qgis::RenderUnit outputUnit() const
Returns the units to use for sizes and widths within the symbol.
Qgis::SymbolType type() const
Returns the symbol's type.
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the symbol's property collection, used for data defined overrides.
QgsSymbol(Qgis::SymbolType type, const QgsSymbolLayerList &layers)
Constructor for a QgsSymbol of the specified type.
bool forceRHR() const
Returns true if polygon features drawn by the symbol will be reoriented to follow the standard right-...
void setClipFeaturesToExtent(bool clipFeaturesToExtent)
Sets whether features drawn by the symbol should be clipped to the render context's extent.
void setForceRHR(bool force)
Sets whether polygon features drawn by the symbol should be reoriented to follow the standard right-h...
Represents a vector layer which manages a vector based dataset.
#define SIP_TYPEHINT(type)
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
#define SIP_THROW(name,...)
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
QList< QgsSymbolLayer * > QgsSymbolLayerList