19 #include "qgis_core.h"
69 switch ( sipCpp->type() )
74 default: sipType = 0;
break;
109 Q_DECLARE_FLAGS( RenderHints, RenderHint )
179 const int count = sipCpp->symbolLayerCount();
180 if ( a0 < 0 || a0 >= count )
182 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
187 sipRes = sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
208 sipRes = sipCpp->symbolLayerCount();
212 int __bool__()
const;
227 const int count = sipCpp->symbolLayerCount();
228 if ( a0 < -count || a0 >= count )
230 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
235 return sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
239 return sipConvertFromType( sipCpp->symbolLayer( count + a0 ), sipType_QgsSymbolLayer, NULL );
251 void __delitem__(
int index );
253 const int count = sipCpp->symbolLayerCount();
254 if ( a0 >= 0 && a0 < count )
255 sipCpp->deleteSymbolLayer( a0 );
256 else if ( a0 < 0 && a0 >= -count )
257 sipCpp->deleteSymbolLayer( count + a0 );
260 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
286 bool deleteSymbolLayer(
int index );
334 void setColor(
const QColor &color );
344 QColor color()
const;
375 void exportImage(
const QString &path,
const QString &format, QSize size );
395 FlagIncludeCrosshairsForMarkerSymbols = 1 << 0,
397 Q_DECLARE_FLAGS( PreviewFlags, PreviewFlag )
414 QString
dump()
const;
426 void toSld( QDomDocument &doc, QDomElement &element, QVariantMap props )
const;
443 bool usesMapUnits()
const;
560 void setDataDefinedProperty( Property key,
const QgsProperty &property );
589 bool hasDataDefinedProperties()
const;
600 bool canCauseArtifactsBetweenAdjacentTiles()
const;
635 if ( context.coordinateTransform().isValid() )
637 double x = point.x();
638 double y = point.y();
640 context.coordinateTransform().transformInPlace( x, y, z );
641 pt = QPointF( x, y );
645 pt = point.toQPointF();
647 context.mapToPixel().transformInPlace( pt.rx(), pt.ry() );
662 static QPolygonF _getPolygonRing(
QgsRenderContext &context,
const QgsCurve &curve,
bool clipToExtent,
bool isExteriorRing =
false,
bool correctRingOrientation =
false );
671 static void _getPolygon( QPolygonF &pts, QVector<QPolygonF> &holes,
QgsRenderContext &context,
const QgsPolygon &polygon,
bool clipToExtent =
true,
bool correctRingOrientation =
false );
700 qreal mOpacity = 1.0;
702 RenderHints mRenderHints;
703 bool mClipFeaturesToExtent = true;
704 bool mForceRHR = false;
713 static void initPropertyDefinitions();
722 bool mStarted =
false;
725 std::unique_ptr< QgsSymbolRenderContext > mSymbolRenderContext;
808 void setOriginalValueVariable(
const QVariant &value );
862 QgsSymbol::RenderHints
renderHints()
const {
return mRenderHints; }
929 Q_DECL_DEPRECATED
double outputLineWidth(
double width )
const SIP_DEPRECATED;
934 Q_DECL_DEPRECATED
double outputPixelSize(
double size )
const SIP_DEPRECATED;
978 std::unique_ptr< QgsExpressionContextScope > mExpressionContextScope;
981 qreal mOpacity = 1.0;
983 QgsSymbol::RenderHints mRenderHints;
986 int mGeometryPartCount;
987 int mGeometryPartNum;
989 std::unique_ptr< QgsLegendPatchShape > mPatchShape;
1026 void setAngle(
double symbolAngle );
1035 double angle()
const;
1042 void setDataDefinedAngle(
const QgsProperty &property );
1060 void setLineAngle(
double lineAngle );
1070 void setSize(
double size );
1084 double size()
const;
1147 void setDataDefinedSize(
const QgsProperty &property );
1226 void setWidth(
double width );
1246 double width()
const;
1266 void setDataDefinedWidth(
const QgsProperty &property );
1289 void renderPolyline(
const QPolygonF &points,
const QgsFeature *f,
QgsRenderContext &context,
int layer = -1,
bool selected =
false );
1322 void setAngle(
double angle );
1339 void renderPolygon(
const QPolygonF &points,
const QVector<QPolygonF> *rings,
const QgsFeature *f,
QgsRenderContext &context,
int layer = -1,
bool selected =
false );
1347 QRectF polygonBounds(
const QPolygonF &points,
const QVector<QPolygonF> *rings )
const;
1349 QVector<QPolygonF> *translateRings(
const QVector<QPolygonF> *rings,
double dx,
double dy )
const;
Custom exception class for Coordinate Reference System related exceptions.
Abstract base class for curved geometry type.
Single scope for storing variables and functions for use within a QgsExpressionContext.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
static QPointF _getPoint(QgsRenderContext &context, const QgsPoint &point)
Creates a point in screen coordinates from a wkb string in map coordinates.
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
virtual void toSld(QDomDocument &doc, QDomElement &element, const QVariantMap &props=QVariantMap()) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
virtual QString dump() const
Returns debug information about this renderer.
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
void renderVertexMarker(QPointF pt, QgsRenderContext &context)
render editing vertex marker at specified point
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
virtual bool renderFeature(const QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false) SIP_THROW(QgsCsException)
Render a feature using this renderer in the given context.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Container of fields for a vector layer.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Represents a patch shape for use in map legends.
A line symbol type, for rendering LineString and MultiLineString geometries.
Struct for storing maximum and minimum scales for measurements in map units.
Abstract base class for marker symbol layers.
A marker symbol type, for rendering Point and MultiPoint geometries.
Base class for visual effects which can be applied to QPicture drawings.
Point geometry type, with support for z-dimension and m-values.
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
A store for object properties.
Contains information about the context of a rendering operation.
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
Q_DECL_DEPRECATED void setMapUnitScale(const QgsMapUnitScale &scale)
QgsFields fields() const
Fields of the layer.
~QgsSymbolRenderContext()
void setSelected(bool selected)
Sets whether symbols should be rendered using the selected symbol coloring and style.
Q_DECL_DEPRECATED QgsUnitTypes::RenderUnit outputUnit() const
Returns the output unit for the context.
int geometryPartNum() const
Part number of current geometry.
bool selected() const
Returns true if symbols should be rendered using the selected symbol coloring and style.
void setRenderHints(QgsSymbol::RenderHints hints)
Sets rendering hint flags for the symbol.
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const
int geometryPartCount() const
Part count of current geometry.
QgsWkbTypes::GeometryType originalGeometryType() const
Returns the geometry type for the original feature geometry being rendered.
const QgsFeature * feature() const
Returns the current feature being rendered.
const QgsRenderContext & renderContext() const
Returns a reference to the context's render context.
void setGeometryPartCount(int count)
Sets the part count of current geometry.
void setGeometryPartNum(int num)
Sets the part number of current geometry.
QgsSymbol::RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
void setOriginalGeometryType(QgsWkbTypes::GeometryType type)
Sets the geometry type for the original feature geometry being rendered.
QgsSymbolRenderContext(const QgsSymbolRenderContext &rh)=delete
QgsSymbolRenderContext cannot be copied.
void setFeature(const QgsFeature *f)
qreal opacity() const
Returns the opacity for the symbol.
Q_DECL_DEPRECATED void setOutputUnit(QgsUnitTypes::RenderUnit u)
Sets the output unit for the context.
Abstract base class for all rendered symbols.
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the symbol's property collection, used for data defined overrides.
void setRenderHints(RenderHints hints)
Sets rendering hint flags for the symbol.
Property
Data definable properties.
@ PropertyOpacity
Opacity.
@ ScaleArea
Calculate scale by the area.
SymbolType type() const
Returns the symbol's type.
RenderHint
Flags controlling behavior of symbols during rendering.
qreal opacity() const
Returns the opacity for the symbol.
bool clipFeaturesToExtent() const
Returns whether features drawn by the symbol will be clipped to the render context's extent.
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the symbol's property collection, used for data defined overrides.
RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol's property collection, used for data defined overrides.
QgsSymbolLayerList symbolLayers()
Returns the list of symbol layers contained in the symbol.
SymbolType
Type of the symbol.
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
int symbolLayerCount() const
Returns the total number of symbol layers contained in the symbol.
virtual QgsSymbol * clone() const =0
Returns a deep copy of this symbol.
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...
PreviewFlag
Flags for controlling how symbol preview images are generated.
@ FlagIncludeCrosshairsForMarkerSymbols
Include a crosshairs reference image in the background of marker symbol previews.
RenderUnit
Rendering size units.
Represents a vector layer which manages a vector based data sets.
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
#define SIP_TYPEHINT(type)
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
QList< QgsSymbolLayer * > QgsSymbolLayerList