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 )
567 QgsSymbolRenderContext(
const QgsSymbolRenderContext &rh ) =
delete;
586 void setOriginalValueVariable(
const QVariant &value );
618 QgsSymbol::RenderHints
renderHints()
const {
return mRenderHints; }
679 double outputLineWidth(
double width )
const;
680 double outputPixelSize(
double size )
const;
683 QgsSymbolRenderContext &operator=(
const QgsSymbolRenderContext & );
704 QgsSymbolRenderContext(
const QgsSymbolRenderContext &rh )
SIP_FORCE;
708 std::unique_ptr< QgsExpressionContextScope > mExpressionContextScope;
711 qreal mOpacity = 1.0;
713 QgsSymbol::RenderHints mRenderHints;
716 int mGeometryPartCount;
717 int mGeometryPartNum;
755 void setAngle(
double symbolAngle );
764 double angle()
const;
771 void setDataDefinedAngle(
const QgsProperty &property );
789 void setLineAngle(
double lineAngle );
799 void setSize(
double size );
876 void setDataDefinedSize(
const QgsProperty &property );
943 void setWidth(
double width );
955 double width()
const;
975 void setDataDefinedWidth(
const QgsProperty &property );
986 void renderPolyline(
const QPolygonF &points,
const QgsFeature *f,
QgsRenderContext &context,
int layer = -1,
bool selected =
false );
1019 void setAngle(
double angle );
1020 void renderPolygon(
const QPolygonF &points, QList<QPolygonF> *rings,
const QgsFeature *f,
QgsRenderContext &context,
int layer = -1,
bool selected =
false );
1028 QRectF polygonBounds(
const QPolygonF &points,
const QList<QPolygonF> *rings )
const;
1030 QList<QPolygonF> *translateRings(
const QList<QPolygonF> *rings,
double dx,
double dy )
const;
QgsSymbol::RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
Abstract base class for all rendered symbols.
bool clipFeaturesToExtent() const
Returns whether features drawn by the symbol will be clipped to the render context's extent...
QgsWkbTypes::GeometryType originalGeometryType() const
Returns the geometry type for the original feature geometry being rendered.
int symbolLayerCount() const
Returns the total number of symbol layers contained in the symbol.
Handles storage of information regarding WKB types and their properties.
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.
void setOutputUnit(QgsUnitTypes::RenderUnit u)
Sets the output unit for the context.
bool forceRHR() const
Returns true if polygon features drawn by the symbol will be reoriented to follow the standard right-...
Container of fields for a vector layer.
void setGeometryPartCount(int count)
Sets the part count of current geometry.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QMap< QString, QString > QgsStringMap
qreal opacity() const
Returns the opacity for the symbol.
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
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 transformInPlace(double &x, double &y) const
Transform device coordinates to map coordinates.
QgsMapUnitScale mapUnitScale() const
void setOriginalGeometryType(QgsWkbTypes::GeometryType type)
Sets the geometry type for the original feature geometry being rendered.
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.
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...
QgsUnitTypes::RenderUnit outputUnit() const
Returns the output unit for the context.
QList< QgsSymbolLayer * > QgsSymbolLayerList
void setSelected(bool selected)
Abstract base class for curved geometry type.
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
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.
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.
QgsFields fields() const
Fields of the layer.
qreal opacity() const
Returns the opacity for the symbol.
void setFeature(const QgsFeature *f)
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.
Struct for storing maximum and minimum scales for measurements in map units.
const QgsRenderContext & renderContext() const
Returns a reference to the context's render context.
virtual QString dump() const
Returns debug information about this renderer.
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
virtual QgsSymbol * clone() const =0
Returns a deep copy of this symbol.
const QgsFeature * feature() const
Current feature being rendered - may be null.
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.
const QgsMapToPixel & mapToPixel() const
Returns the context's map to pixel transform, which transforms between map coordinates and device coo...
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Custom exception class for Coordinate Reference System related exceptions.
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context.
void setClipFeaturesToExtent(bool clipFeaturesToExtent)
Sets whether features drawn by the symbol should be clipped to the render context's extent...
void setMapUnitScale(const QgsMapUnitScale &scale)
void setForceRHR(bool force)
Sets whether polygon features drawn by the symbol should be reoriented to follow the standard right-h...
int geometryPartCount() const
Part count of current geometry.
int geometryPartNum() const
Part number of current geometry.
Represents a vector layer which manages a vector based data sets.
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
RenderUnit
Rendering size units.
void renderVertexMarker(QPointF pt, QgsRenderContext &context)
render editing vertex marker at specified point
QPointF toQPointF() const
Returns the point as a QPointF.