82 bool mIsAnimated =
false;
83 double mFrameRate = 10;
123 double size()
const {
return mSize; }
174 Qt::PenJoinStyle
joinStyle()
const {
return mJoinStyle; }
215 bool mEnabled =
false;
219 Qt::PenJoinStyle mJoinStyle = Qt::RoundJoin;
220 std::unique_ptr< QgsFillSymbol > mFillSymbol;
235 switch ( sipCpp->type() )
240 default: sipType = 0;
break;
334 const int count = sipCpp->symbolLayerCount();
335 if ( a0 < 0 || a0 >= count )
337 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
342 sipRes = sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
362 sipRes = sipCpp->symbolLayerCount();
366 int __bool__()
const;
383 const int count = sipCpp->symbolLayerCount();
384 if ( a0 < -count || a0 >= count )
386 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
391 return sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
395 return sipConvertFromType( sipCpp->symbolLayer( count + a0 ), sipType_QgsSymbolLayer, NULL );
409 void __delitem__(
int index );
411 const int count = sipCpp->symbolLayerCount();
412 if ( a0 >= 0 && a0 < count )
413 sipCpp->deleteSymbolLayer( a0 );
414 else if ( a0 < 0 && a0 >= -count )
415 sipCpp->deleteSymbolLayer( count + a0 );
418 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
431 bool insertSymbolLayer(
int index, QgsSymbolLayer *layer
SIP_TRANSFER );
439 bool appendSymbolLayer( QgsSymbolLayer *layer
SIP_TRANSFER );
444 bool deleteSymbolLayer(
int index );
461 bool changeSymbolLayer(
int index, QgsSymbolLayer *layer
SIP_TRANSFER );
472 void startRender( QgsRenderContext &context,
const QgsFields &fields = QgsFields() );
480 void stopRender( QgsRenderContext &context );
492 void setColor(
const QColor &color )
const;
502 QColor color()
const;
520 void drawPreviewIcon( QPainter *painter, QSize size, QgsRenderContext *customContext =
nullptr,
bool selected =
false,
const QgsExpressionContext *expressionContext =
nullptr,
521 const QgsLegendPatchShape *patchShape =
nullptr,
const QgsScreenProperties &screen = QgsScreenProperties() );
532 void exportImage(
const QString &path,
const QString &format, QSize size );
543 QImage asImage( QSize size, QgsRenderContext *customContext =
nullptr );
561 Q_DECL_DEPRECATED QImage bigSymbolPreviewImage( QgsExpressionContext *expressionContext =
nullptr,
int flags = static_cast<
int >( Qgis::SymbolPreviewFlag::FlagIncludeCrosshairsForMarkerSymbols ) )
SIP_DEPRECATED;
566 QString dump() const;
581 bool rendersIdenticallyTo( const QgsSymbol *other ) const;
595 Q_DECL_DEPRECATED
void toSld( QDomDocument &doc, QDomElement &element, QVariantMap props ) const
SIP_DEPRECATED;
806 void setDataDefinedProperty( Property key, const
QgsProperty &property );
834 bool hasDataDefinedProperties()
const;
845 bool canCauseArtifactsBetweenAdjacentTiles()
const;
864 void renderFeature( const
QgsFeature &feature,
QgsRenderContext &context,
int layer = -1,
bool selected = false,
bool drawVertexMarker = false,
Qgis::VertexMarkerType currentVertexMarkerType =
Qgis::VertexMarkerType::SemiTransparentCircle,
double currentVertexMarkerSize = 0.0 )
SIP_THROW(
QgsCsException );
905 double extentBuffer() const;
916 void setExtentBuffer(
double extentBuffer );
953 double x = point.
x();
954 double y = point.
y();
957 pt = QPointF( x, y );
978 static QPolygonF _getPolygonRing(
QgsRenderContext &context,
const QgsCurve &curve,
bool clipToExtent,
bool isExteriorRing =
false,
bool correctRingOrientation =
false );
987 static void _getPolygon( QPolygonF &pts, QVector<QPolygonF> &holes,
QgsRenderContext &context,
const QgsPolygon &polygon,
bool clipToExtent =
true,
bool correctRingOrientation =
false );
1000 void copyCommonProperties( const
QgsSymbol *other );
1014 void renderUsingLayer(
QgsSymbolLayer *layer,
QgsSymbolRenderContext &context,
Qgis::GeometryType geometryType =
Qgis::GeometryType::Unknown, const QPolygonF *points =
nullptr, const QVector<QPolygonF> *rings =
nullptr );
1019 void renderVertexMarker( QPointF pt,
QgsRenderContext &context,
Qgis::VertexMarkerType currentVertexMarkerType,
double currentVertexMarkerSize );
1052 static void initPropertyDefinitions();
1061 bool mStarted =
false;
1064 std::unique_ptr< QgsSymbolRenderContext > mSymbolRenderContext;
1084 static QPolygonF _getPolygonRing2d(
QgsRenderContext &context,
const QgsCurve &curve,
bool clipToExtent,
bool isExteriorRing =
false,
bool correctRingOrientation =
false );
1092 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