QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
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 );
379 FlagIncludeCrosshairsForMarkerSymbols = 1 << 0,
381 Q_DECLARE_FLAGS( PreviewFlags, PreviewFlag )
398 QString
dump()
const;
534 bool hasDataDefinedProperties()
const;
569 if ( context.coordinateTransform().isValid() )
571 double x = point.x();
572 double y = point.y();
574 context.coordinateTransform().transformInPlace( x, y, z );
575 pt = QPointF( x, y );
579 pt = point.toQPointF();
581 context.mapToPixel().transformInPlace( pt.rx(), pt.ry() );
596 static QPolygonF _getPolygonRing(
QgsRenderContext &context,
const QgsCurve &curve,
bool clipToExtent,
bool isExteriorRing =
false,
bool correctRingOrientation =
false );
605 static void _getPolygon( QPolygonF &pts, QVector<QPolygonF> &holes,
QgsRenderContext &context,
const QgsPolygon &polygon,
bool clipToExtent =
true,
bool correctRingOrientation =
false );
634 qreal mOpacity = 1.0;
636 RenderHints mRenderHints;
637 bool mClipFeaturesToExtent = true;
638 bool mForceRHR = false;
651 bool mStarted =
false;
654 std::unique_ptr< QgsSymbolRenderContext > mSymbolRenderContext;
735 void setOriginalValueVariable(
const QVariant &value );
789 QgsSymbol::RenderHints
renderHints()
const {
return mRenderHints; }
856 Q_DECL_DEPRECATED
double outputLineWidth(
double width )
const SIP_DEPRECATED;
861 Q_DECL_DEPRECATED
double outputPixelSize(
double size )
const SIP_DEPRECATED;
905 std::unique_ptr< QgsExpressionContextScope > mExpressionContextScope;
908 qreal mOpacity = 1.0;
910 QgsSymbol::RenderHints mRenderHints;
913 int mGeometryPartCount;
914 int mGeometryPartNum;
916 std::unique_ptr< QgsLegendPatchShape > mPatchShape;
953 void setAngle(
double symbolAngle );
962 double angle()
const;
969 void setDataDefinedAngle(
const QgsProperty &property );
987 void setLineAngle(
double lineAngle );
997 void setSize(
double size );
1011 double size()
const;
1074 void setDataDefinedSize(
const QgsProperty &property );
1153 void setWidth(
double width );
1173 double width()
const;
1193 void setDataDefinedWidth(
const QgsProperty &property );
1216 void renderPolyline(
const QPolygonF &points,
const QgsFeature *f,
QgsRenderContext &context,
int layer = -1,
bool selected =
false );
1249 void setAngle(
double angle );
1266 void renderPolygon(
const QPolygonF &points,
const QVector<QPolygonF> *rings,
const QgsFeature *f,
QgsRenderContext &context,
int layer = -1,
bool selected =
false );
1274 QRectF polygonBounds(
const QPolygonF &points,
const QVector<QPolygonF> *rings )
const;
1276 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.
Container of fields for a vector layer.
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.
Contains information about the context of a rendering operation.
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.
QgsSymbolRenderContext(const QgsSymbolRenderContext &rh)=delete
QgsSymbolRenderContext cannot be copied.
~QgsSymbolRenderContext()
Abstract base class for all rendered symbols.
PreviewFlag
Flags for controlling how symbol preview images are generated.
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)
Represents a patch shape for use in map legends.
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.
Custom exception class for Coordinate Reference System related exceptions.
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.
A marker symbol type, for rendering Point and MultiPoint geometries.
void setGeometryPartCount(int count)
Sets the part count of current geometry.
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
A line symbol type, for rendering LineString and MultiLineString geometries.
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
Represents a vector layer which manages a vector based data sets.
QList< QgsSymbolLayer * > QgsSymbolLayerList
void setRenderHints(RenderHints hints)
Sets rendering hint flags for the symbol.
@ FlagIncludeCrosshairsForMarkerSymbols
Include a crosshairs reference image in the background of marker symbol previews.
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.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
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.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
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.