19 #include "qgis_core.h" 66 switch ( sipCpp->type() )
71 default: sipType = 0;
break;
172 bool deleteSymbolLayer(
int index );
189 bool changeSymbolLayer(
int index,
QgsSymbolLayer *layer SIP_TRANSFER );
220 void setColor(
const QColor &color );
230 QColor color()
const;
242 void drawPreviewIcon( QPainter *painter, QSize size,
QgsRenderContext *customContext =
nullptr );
253 void exportImage(
const QString &path,
const QString &format, QSize size );
279 QString
dump()
const;
415 bool hasDataDefinedProperties()
const;
452 double x = point.
x();
453 double y = point.
y();
456 pt = QPointF( x, y );
477 static QPolygonF _getPolygonRing(
QgsRenderContext &context,
const QgsCurve &curve,
bool clipToExtent,
bool isExteriorRing =
false,
bool correctRingOrientation =
false );
486 static void _getPolygon( QPolygonF &pts, QList<QPolygonF> &holes,
QgsRenderContext &context,
const QgsPolygon &polygon,
bool clipToExtent =
true,
bool correctRingOrientation =
false );
515 qreal mOpacity = 1.0;
517 RenderHints mRenderHints =
nullptr;
518 bool mClipFeaturesToExtent =
true;
519 bool mForceRHR =
false;
532 bool mStarted =
false;
535 std::unique_ptr< QgsSymbolRenderContext > mSymbolRenderContext;
541 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSymbol::RenderHints )
569 QgsSymbolRenderContext(
const QgsSymbolRenderContext &rh ) =
delete;
588 void setOriginalValueVariable(
const QVariant &value );
642 QgsSymbol::RenderHints
renderHints()
const {
return mRenderHints; }
709 Q_DECL_DEPRECATED
double outputLineWidth(
double width )
const SIP_DEPRECATED;
714 Q_DECL_DEPRECATED
double outputPixelSize(
double size )
const SIP_DEPRECATED;
717 QgsSymbolRenderContext &operator=(
const QgsSymbolRenderContext & );
738 QgsSymbolRenderContext(
const QgsSymbolRenderContext &rh )
SIP_FORCE;
742 std::unique_ptr< QgsExpressionContextScope > mExpressionContextScope;
745 qreal mOpacity = 1.0;
747 QgsSymbol::RenderHints mRenderHints;
750 int mGeometryPartCount;
751 int mGeometryPartNum;
789 void setAngle(
double symbolAngle );
798 double angle()
const;
805 void setDataDefinedAngle(
const QgsProperty &property );
823 void setLineAngle(
double lineAngle );
833 void setSize(
double size );
910 void setDataDefinedSize(
const QgsProperty &property );
989 void setWidth(
double width );
1001 double width()
const;
1021 void setDataDefinedWidth(
const QgsProperty &property );
1044 void renderPolyline(
const QPolygonF &points,
const QgsFeature *f,
QgsRenderContext &context,
int layer = -1,
bool selected =
false );
1077 void setAngle(
double angle );
1094 void renderPolygon(
const QPolygonF &points, QList<QPolygonF> *rings,
const QgsFeature *f,
QgsRenderContext &context,
int layer = -1,
bool selected =
false );
1102 QRectF polygonBounds(
const QPolygonF &points,
const QList<QPolygonF> *rings )
const;
1104 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...
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.