19 #include "qgis_core.h" 66 switch ( sipCpp->type() )
71 default: sipType = 0;
break;
153 const int count = sipCpp->symbolLayerCount();
154 if ( a0 < 0 || a0 >= count )
156 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
161 sipRes = sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
182 sipRes = sipCpp->symbolLayerCount();
186 int __bool__()
const;
201 const int count = sipCpp->symbolLayerCount();
202 if ( a0 < -count || a0 >= count )
204 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
209 return sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
213 return sipConvertFromType( sipCpp->symbolLayer( count + a0 ), sipType_QgsSymbolLayer, NULL );
225 void __delitem__(
int index );
227 const int count = sipCpp->symbolLayerCount();
228 if ( a0 >= 0 && a0 < count )
229 sipCpp->deleteSymbolLayer( a0 );
230 else if ( a0 < 0 && a0 >= -count )
231 sipCpp->deleteSymbolLayer( count + a0 );
234 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
260 bool deleteSymbolLayer(
int index );
277 bool changeSymbolLayer(
int index,
QgsSymbolLayer *layer SIP_TRANSFER );
308 void setColor(
const QColor &color );
318 QColor color()
const;
336 void drawPreviewIcon( QPainter *painter, QSize size,
QgsRenderContext *customContext =
nullptr,
bool selected =
false,
const QgsExpressionContext *expressionContext =
nullptr );
347 void exportImage(
const QString &path,
const QString &format, QSize size );
373 QString
dump()
const;
509 bool hasDataDefinedProperties()
const;
546 double x = point.
x();
547 double y = point.
y();
550 pt = QPointF( x, y );
571 static QPolygonF _getPolygonRing(
QgsRenderContext &context,
const QgsCurve &curve,
bool clipToExtent,
bool isExteriorRing =
false,
bool correctRingOrientation =
false );
580 static void _getPolygon( QPolygonF &pts, QList<QPolygonF> &holes,
QgsRenderContext &context,
const QgsPolygon &polygon,
bool clipToExtent =
true,
bool correctRingOrientation =
false );
609 qreal mOpacity = 1.0;
611 RenderHints mRenderHints =
nullptr;
612 bool mClipFeaturesToExtent =
true;
613 bool mForceRHR =
false;
626 bool mStarted =
false;
629 std::unique_ptr< QgsSymbolRenderContext > mSymbolRenderContext;
635 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSymbol::RenderHints )
663 QgsSymbolRenderContext(
const QgsSymbolRenderContext &rh ) =
delete;
682 void setOriginalValueVariable(
const QVariant &value );
736 QgsSymbol::RenderHints
renderHints()
const {
return mRenderHints; }
803 Q_DECL_DEPRECATED
double outputLineWidth(
double width )
const SIP_DEPRECATED;
808 Q_DECL_DEPRECATED
double outputPixelSize(
double size )
const SIP_DEPRECATED;
811 QgsSymbolRenderContext &operator=(
const QgsSymbolRenderContext & );
832 QgsSymbolRenderContext(
const QgsSymbolRenderContext &rh )
SIP_FORCE;
836 std::unique_ptr< QgsExpressionContextScope > mExpressionContextScope;
839 qreal mOpacity = 1.0;
841 QgsSymbol::RenderHints mRenderHints;
844 int mGeometryPartCount;
845 int mGeometryPartNum;
883 void setAngle(
double symbolAngle );
892 double angle()
const;
899 void setDataDefinedAngle(
const QgsProperty &property );
917 void setLineAngle(
double lineAngle );
927 void setSize(
double size );
1004 void setDataDefinedSize(
const QgsProperty &property );
1083 void setWidth(
double width );
1095 double width()
const;
1115 void setDataDefinedWidth(
const QgsProperty &property );
1138 void renderPolyline(
const QPolygonF &points,
const QgsFeature *f,
QgsRenderContext &context,
int layer = -1,
bool selected =
false );
1171 void setAngle(
double angle );
1188 void renderPolygon(
const QPolygonF &points, QList<QPolygonF> *rings,
const QgsFeature *f,
QgsRenderContext &context,
int layer = -1,
bool selected =
false );
1196 QRectF polygonBounds(
const QPolygonF &points,
const QList<QPolygonF> *rings )
const;
1198 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.