QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
19 #include "qgis_core.h"
68 switch ( sipCpp->type() )
73 default: sipType = 0;
break;
108 Q_DECLARE_FLAGS( RenderHints, RenderHint )
163 const int count = sipCpp->symbolLayerCount();
164 if ( a0 < 0 || a0 >= count )
166 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
171 sipRes = sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
192 sipRes = sipCpp->symbolLayerCount();
196 int __bool__()
const;
211 const int count = sipCpp->symbolLayerCount();
212 if ( a0 < -count || a0 >= count )
214 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
219 return sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
223 return sipConvertFromType( sipCpp->symbolLayer( count + a0 ), sipType_QgsSymbolLayer, NULL );
235 void __delitem__(
int index );
237 const int count = sipCpp->symbolLayerCount();
238 if ( a0 >= 0 && a0 < count )
239 sipCpp->deleteSymbolLayer( a0 );
240 else if ( a0 < 0 && a0 >= -count )
241 sipCpp->deleteSymbolLayer( count + a0 );
244 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
270 bool deleteSymbolLayer(
int index );
318 void setColor(
const QColor &color );
328 QColor color()
const;
359 void exportImage(
const QString &path,
const QString &format, QSize size );
385 QString
dump()
const;
521 bool hasDataDefinedProperties()
const;
556 if ( context.coordinateTransform().isValid() )
558 double x = point.x();
559 double y = point.y();
561 context.coordinateTransform().transformInPlace( x, y, z );
562 pt = QPointF( x, y );
566 pt = point.toQPointF();
568 context.mapToPixel().transformInPlace( pt.rx(), pt.ry() );
583 static QPolygonF _getPolygonRing(
QgsRenderContext &context,
const QgsCurve &curve,
bool clipToExtent,
bool isExteriorRing =
false,
bool correctRingOrientation =
false );
592 static void _getPolygon( QPolygonF &pts, QVector<QPolygonF> &holes,
QgsRenderContext &context,
const QgsPolygon &polygon,
bool clipToExtent =
true,
bool correctRingOrientation =
false );
621 qreal mOpacity = 1.0;
623 RenderHints mRenderHints;
624 bool mClipFeaturesToExtent = true;
625 bool mForceRHR = false;
638 bool mStarted =
false;
641 std::unique_ptr< QgsSymbolRenderContext > mSymbolRenderContext;
673 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSymbol::RenderHints )
722 void setOriginalValueVariable(
const QVariant &value );
776 QgsSymbol::RenderHints
renderHints()
const {
return mRenderHints; }
843 Q_DECL_DEPRECATED
double outputLineWidth(
double width )
const SIP_DEPRECATED;
848 Q_DECL_DEPRECATED
double outputPixelSize(
double size )
const SIP_DEPRECATED;
892 std::unique_ptr< QgsExpressionContextScope > mExpressionContextScope;
895 qreal mOpacity = 1.0;
897 QgsSymbol::RenderHints mRenderHints;
900 int mGeometryPartCount;
901 int mGeometryPartNum;
903 std::unique_ptr< QgsLegendPatchShape > mPatchShape;
940 void setAngle(
double symbolAngle );
949 double angle()
const;
956 void setDataDefinedAngle(
const QgsProperty &property );
974 void setLineAngle(
double lineAngle );
984 void setSize(
double size );
1061 void setDataDefinedSize(
const QgsProperty &property );
1140 void setWidth(
double width );
1152 double width()
const;
1172 void setDataDefinedWidth(
const QgsProperty &property );
1195 void renderPolyline(
const QPolygonF &points,
const QgsFeature *f,
QgsRenderContext &context,
int layer = -1,
bool selected =
false );
1228 void setAngle(
double angle );
1245 void renderPolygon(
const QPolygonF &points,
const QVector<QPolygonF> *rings,
const QgsFeature *f,
QgsRenderContext &context,
int layer = -1,
bool selected =
false );
1253 QRectF polygonBounds(
const QPolygonF &points,
const QVector<QPolygonF> *rings )
const;
1255 QVector<QPolygonF> *translateRings(
const QVector<QPolygonF> *rings,
double dx,
double dy )
const;
Abstract base class for curved geometry type.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
A store for object properties.
RenderUnit
Rendering size units.
Point geometry type, with support for z-dimension and m-values.
Q_DECL_DEPRECATED QgsUnitTypes::RenderUnit outputUnit() const
Returns the output unit for the context.
const QgsFeature * feature() const
Returns the current feature being rendered.
void setSelected(bool selected)
Sets whether symbols should be rendered using the selected symbol coloring and style.
RenderHint
Flags controlling behavior of symbols during rendering.
void setGeometryPartNum(int num)
Sets the part number of current geometry.
qreal opacity() const
Returns the opacity for the symbol.
int geometryPartCount() const
Part count of current geometry.
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
Q_DECL_DEPRECATED void setOutputUnit(QgsUnitTypes::RenderUnit u)
Sets the output unit for the context.
Abstract base class for marker symbol layers.
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
void setFeature(const QgsFeature *f)
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
#define SIP_TYPEHINT(type)
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.
QgsWkbTypes::GeometryType originalGeometryType() const
Returns the geometry type for the original feature geometry being rendered.
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
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.
const QgsRenderContext & renderContext() const
Returns a reference to the context's render context.
QgsFields fields() const
Fields of the layer.
static QPointF _getPoint(QgsRenderContext &context, const QgsPoint &point)
Creates a point in screen coordinates from a wkb string in map coordinates.
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
void setGeometryPartCount(int count)
Sets the part count of current geometry.
Struct for storing maximum and minimum scales for measurements in map units.
void setForceRHR(bool force)
Sets whether polygon features drawn by the symbol should be reoriented to follow the standard right-h...
Single scope for storing variables and functions for use within a QgsExpressionContext....
QgsSymbol::RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
void setOriginalGeometryType(QgsWkbTypes::GeometryType type)
Sets the geometry type for the original feature geometry being rendered.
virtual QgsSymbol * clone() const =0
Returns a deep copy of this symbol.
RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
QMap< QString, QString > QgsStringMap
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
bool clipFeaturesToExtent() const
Returns whether features drawn by the symbol will be clipped to the render context's extent.
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
QList< QgsSymbolLayer * > QgsSymbolLayerList
void setRenderHints(RenderHints hints)
Sets rendering hint flags for the symbol.
Q_DECL_DEPRECATED void setMapUnitScale(const QgsMapUnitScale &scale)
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.
Base class for visual effects which can be applied to QPicture drawings.
void renderVertexMarker(QPointF pt, QgsRenderContext &context)
render editing vertex marker at specified point
SymbolType type() const
Returns the symbol's type.
virtual QString dump() const
Returns debug information about this renderer.
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
SymbolType
Type of the symbol.
QgsSymbolLayerList symbolLayers()
Returns the list of symbol layers contained in the symbol.
@ ScaleArea
Calculate scale by the area.
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
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)
int geometryPartNum() const
Part number of current geometry.
bool forceRHR() const
Returns true if polygon features drawn by the symbol will be reoriented to follow the standard right-...
Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const
int symbolLayerCount() const
Returns the total number of symbol layers contained in the symbol.