19 #include "qgis_core.h" 66 switch ( sipCpp->type() )
71 default: sipType = 0;
break;
163 bool deleteSymbolLayer(
int index );
174 bool changeSymbolLayer(
int index,
QgsSymbolLayer *layer SIP_TRANSFER );
195 void setColor(
const QColor &color );
196 QColor color()
const;
203 void drawPreviewIcon( QPainter *painter, QSize size,
QgsRenderContext *customContext =
nullptr );
206 void exportImage(
const QString &path,
const QString &format, QSize size );
218 QString
dump()
const;
311 bool hasDataDefinedProperties()
const;
321 void renderFeature(
const QgsFeature &feature,
QgsRenderContext &context,
int layer = -1,
bool selected =
false,
bool drawVertexMarker =
false,
int currentVertexMarkerType = 0,
int currentVertexMarkerSize = 0 );
341 double x = point.
x();
342 double y = point.
y();
345 pt = QPointF( x, y );
368 static void _getPolygon( QPolygonF &pts, QList<QPolygonF> &holes,
QgsRenderContext &context,
const QgsPolygon &polygon,
bool clipToExtent =
true );
397 qreal mOpacity = 1.0;
399 RenderHints mRenderHints =
nullptr;
400 bool mClipFeaturesToExtent =
true;
413 bool mStarted =
false;
416 std::unique_ptr< QgsSymbolRenderContext > mSymbolRenderContext;
422 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSymbol::RenderHints )
448 QgsSymbolRenderContext(
const QgsSymbolRenderContext &rh ) =
delete;
467 void setOriginalValueVariable(
const QVariant &value );
499 QgsSymbol::RenderHints
renderHints()
const {
return mRenderHints; }
560 double outputLineWidth(
double width )
const;
561 double outputPixelSize(
double size )
const;
564 QgsSymbolRenderContext &operator=(
const QgsSymbolRenderContext & );
585 QgsSymbolRenderContext(
const QgsSymbolRenderContext &rh )
SIP_FORCE;
589 std::unique_ptr< QgsExpressionContextScope > mExpressionContextScope;
592 qreal mOpacity = 1.0;
594 QgsSymbol::RenderHints mRenderHints;
597 int mGeometryPartCount;
598 int mGeometryPartNum;
629 void setAngle(
double symbolAngle );
638 double angle()
const;
645 void setDataDefinedAngle(
const QgsProperty &property );
663 void setLineAngle(
double lineAngle );
673 void setSize(
double size );
730 void setDataDefinedSize(
const QgsProperty &property );
784 void setWidth(
double width );
785 double width()
const;
792 void setDataDefinedWidth(
const QgsProperty &property );
803 void renderPolyline(
const QPolygonF &points,
const QgsFeature *
f,
QgsRenderContext &context,
int layer = -1,
bool selected =
false );
829 void setAngle(
double angle );
830 void renderPolygon(
const QPolygonF &points, QList<QPolygonF> *rings,
const QgsFeature *
f,
QgsRenderContext &context,
int layer = -1,
bool selected =
false );
838 QRectF polygonBounds(
const QPolygonF &points,
const QList<QPolygonF> *rings )
const;
840 QList<QPolygonF> *translateRings(
const QList<QPolygonF> *rings,
double dx,
double dy )
const;
QgsFields fields() const
Fields of the layer.
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.
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 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 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)
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
Return 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.
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...
QgsMapUnitScale mapUnitScale() const
QList< QgsSymbolLayer * > QgsSymbolLayerList
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context, or an invalid transform is no coordinate tr...
void setSelected(bool selected)
Abstract base class for curved geometry type.
Single scope for storing variables and functions for use within a QgsExpressionContext.
A store for object properties.
const QgsVectorLayer * layer() const
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.
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
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
Get a deep copy of this symbol.
void setLayer(const QgsVectorLayer *layer)
RenderHints renderHints() const
Returns the rendering hint flags for the 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 list of symbol layers contained in the symbol.
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 setMapUnitScale(const QgsMapUnitScale &scale)
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.
virtual bool renderFeature(QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false)
Render a feature using this renderer in the given context.
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.
QgsUnitTypes::RenderUnit outputUnit() const
Returns the output unit for the context.