19 #include "qgis_core.h" 67 switch ( sipCpp->type() )
72 default: sipType = 0;
break;
162 const int count = sipCpp->symbolLayerCount();
163 if ( a0 < 0 || a0 >= count )
165 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
170 sipRes = sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
191 sipRes = sipCpp->symbolLayerCount();
195 int __bool__()
const;
210 const int count = sipCpp->symbolLayerCount();
211 if ( a0 < -count || a0 >= count )
213 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
218 return sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
222 return sipConvertFromType( sipCpp->symbolLayer( count + a0 ), sipType_QgsSymbolLayer, NULL );
234 void __delitem__(
int index );
236 const int count = sipCpp->symbolLayerCount();
237 if ( a0 >= 0 && a0 < count )
238 sipCpp->deleteSymbolLayer( a0 );
239 else if ( a0 < 0 && a0 >= -count )
240 sipCpp->deleteSymbolLayer( count + a0 );
243 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
269 bool deleteSymbolLayer(
int index );
286 bool changeSymbolLayer(
int index,
QgsSymbolLayer *layer SIP_TRANSFER );
317 void setColor(
const QColor &color );
327 QColor color()
const;
345 void drawPreviewIcon( QPainter *painter, QSize size,
QgsRenderContext *customContext =
nullptr,
bool selected =
false,
const QgsExpressionContext *expressionContext =
nullptr );
356 void exportImage(
const QString &path,
const QString &format, QSize size );
382 QString
dump()
const;
518 bool hasDataDefinedProperties()
const;
555 double x = point.
x();
556 double y = point.
y();
559 pt = QPointF( x, y );
580 static QPolygonF _getPolygonRing(
QgsRenderContext &context,
const QgsCurve &curve,
bool clipToExtent,
bool isExteriorRing =
false,
bool correctRingOrientation =
false );
589 static void _getPolygon( QPolygonF &pts, QList<QPolygonF> &holes,
QgsRenderContext &context,
const QgsPolygon &polygon,
bool clipToExtent =
true,
bool correctRingOrientation =
false );
618 qreal mOpacity = 1.0;
620 RenderHints mRenderHints =
nullptr;
621 bool mClipFeaturesToExtent =
true;
622 bool mForceRHR =
false;
635 bool mStarted =
false;
638 std::unique_ptr< QgsSymbolRenderContext > mSymbolRenderContext;
670 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSymbol::RenderHints )
698 QgsSymbolRenderContext(
const QgsSymbolRenderContext &rh ) =
delete;
717 void setOriginalValueVariable(
const QVariant &value );
771 QgsSymbol::RenderHints
renderHints()
const {
return mRenderHints; }
838 Q_DECL_DEPRECATED
double outputLineWidth(
double width )
const SIP_DEPRECATED;
843 Q_DECL_DEPRECATED
double outputPixelSize(
double size )
const SIP_DEPRECATED;
846 QgsSymbolRenderContext &operator=(
const QgsSymbolRenderContext & );
867 QgsSymbolRenderContext(
const QgsSymbolRenderContext &rh )
SIP_FORCE;
871 std::unique_ptr< QgsExpressionContextScope > mExpressionContextScope;
874 qreal mOpacity = 1.0;
876 QgsSymbol::RenderHints mRenderHints;
879 int mGeometryPartCount;
880 int mGeometryPartNum;
918 void setAngle(
double symbolAngle );
927 double angle()
const;
934 void setDataDefinedAngle(
const QgsProperty &property );
952 void setLineAngle(
double lineAngle );
962 void setSize(
double size );
1039 void setDataDefinedSize(
const QgsProperty &property );
1118 void setWidth(
double width );
1130 double width()
const;
1150 void setDataDefinedWidth(
const QgsProperty &property );
1173 void renderPolyline(
const QPolygonF &points,
const QgsFeature *f,
QgsRenderContext &context,
int layer = -1,
bool selected =
false );
1206 void setAngle(
double angle );
1223 void renderPolygon(
const QPolygonF &points, QList<QPolygonF> *rings,
const QgsFeature *f,
QgsRenderContext &context,
int layer = -1,
bool selected =
false );
1231 QRectF polygonBounds(
const QPolygonF &points,
const QList<QPolygonF> *rings )
const;
1233 QList<QPolygonF> *translateRings(
const QList<QPolygonF> *rings,
double dx,
double dy )
const;
Q_DECL_DEPRECATED void setMapUnitScale(const QgsMapUnitScale &scale)
QgsFields fields() const
Fields of the layer.
Abstract base class for all rendered symbols.
QPointF toQPointF() const
Returns the point as a QPointF.
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props=QgsStringMap()) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
const QgsRenderContext & renderContext() const
Returns a reference to the context's render context.
Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const
static QPointF _getPoint(QgsRenderContext &context, const QgsPoint &point)
Creates a point in screen coordinates from a QgsPoint in map coordinates.
Base class for visual effects which can be applied to QPicture drawings.
bool clipFeaturesToExtent() const
Returns whether features drawn by the symbol will be clipped to the render context's extent...
Container of fields for a vector layer.
void setGeometryPartCount(int count)
Sets the part count of current geometry.
int symbolLayerCount() const
Returns the total number of symbol layers contained in the symbol.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
#define SIP_TYPEHINT(type)
QMap< QString, QString > QgsStringMap
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)
A marker symbol type, for rendering Point and MultiPoint geometries.
A line symbol type, for rendering LineString and MultiLineString geometries.
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
void transformInPlace(double &x, double &y) const
Transform device coordinates to map coordinates.
SymbolType
Type of the symbol.
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
QgsSymbolLayerList mLayers
void setOriginalGeometryType(QgsWkbTypes::GeometryType type)
Sets the geometry type for the original feature geometry being rendered.
bool forceRHR() const
Returns true if polygon features drawn by the symbol will be reoriented to follow the standard right-...
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
void setGeometryPartNum(int num)
Sets the part number of current geometry.
Calculate scale by the area.
qreal opacity() const
Returns the opacity for the symbol.
void setRenderHints(RenderHints hints)
Sets rendering hint flags for the symbol.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QList< QgsSymbolLayer * > QgsSymbolLayerList
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context.
void setSelected(bool selected)
Sets whether symbols should be rendered using the selected symbol coloring and style.
Abstract base class for curved geometry type.
Single scope for storing variables and functions for use within a QgsExpressionContext.
A store for object properties.
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
Point geometry type, with support for z-dimension and m-values.
void setRenderHints(QgsSymbol::RenderHints hints)
Sets rendering hint flags for the symbol.
bool selected() const
Returns true if symbols should be rendered using the selected symbol coloring and style...
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.
QgsWkbTypes::GeometryType originalGeometryType() const
Returns the geometry type for the original feature geometry being rendered.
void setFeature(const QgsFeature *f)
int geometryPartNum() const
Part number of current geometry.
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
RenderHint
Flags controlling behavior of symbols during rendering.
Contains information about the context of a rendering operation.
Abstract base class for marker symbol layers.
const QgsMapToPixel & mapToPixel() const
Returns the context's map to pixel transform, which transforms between map coordinates and device coo...
SymbolType type() const
Returns the symbol's type.
Struct for storing maximum and minimum scales for measurements in map units.
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
virtual QgsSymbol * clone() const =0
Returns a deep copy of this symbol.
Q_DECL_DEPRECATED QgsUnitTypes::RenderUnit outputUnit() const
Returns the output unit for the context.
RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
const QgsFeature * feature() const
Returns the current feature being rendered.
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
QgsSymbolLayerList symbolLayers()
Returns the list of symbol layers contained in the symbol.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Custom exception class for Coordinate Reference System related exceptions.
Q_DECL_DEPRECATED void setOutputUnit(QgsUnitTypes::RenderUnit u)
Sets the output unit for the context.
void setClipFeaturesToExtent(bool clipFeaturesToExtent)
Sets whether features drawn by the symbol should be clipped to the render context's extent...
qreal opacity() const
Returns the opacity for the symbol.
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 data sets.
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
int geometryPartCount() const
Part count of current geometry.
RenderUnit
Rendering size units.
QgsSymbol::RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
void renderVertexMarker(QPointF pt, QgsRenderContext &context)
render editing vertex marker at specified point
virtual QString dump() const
Returns debug information about this renderer.