QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
18 #ifndef QGSVECTORFIELDSYMBOLLAYER_H
19 #define QGSVECTORFIELDSYMBOLLAYER_H
21 #include "qgis_core.h"
43 ClockwiseFromNorth = 0,
44 CounterclockwiseFromEast
57 static QgsSymbolLayer *create(
const QVariantMap &properties = QVariantMap() );
60 QString
layerType()
const override {
return QStringLiteral(
"VectorField" ); }
65 void setColor(
const QColor &color )
override;
66 QColor
color()
const override;
73 QVariantMap properties() const override;
74 bool usesMapUnits() const override;
76 void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const override;
80 QSet<QString> usedAttributes( const
QgsRenderContext &context ) const override;
81 bool hasDataDefinedProperties() const override;
84 void setXAttribute( const QString &attribute ) { mXAttribute = attribute; }
86 void setYAttribute(
const QString &attribute ) { mYAttribute = attribute; }
89 double scale()
const {
return mScale; }
132 VectorFieldType mVectorFieldType = Cartesian;
133 AngleOrientation mAngleOrientation = ClockwiseFromNorth;
134 AngleUnits mAngleUnits = Degrees;
136 std::unique_ptr< QgsLineSymbol > mLineSymbol;
143 void convertPolarToCartesian(
double length,
double angle,
double &x,
double &y )
const;
146 #endif // QGSVECTORFIELDSYMBOLLAYER_H
void setVectorFieldType(VectorFieldType type)
void setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the distance.
virtual void setColor(const QColor &color)
Sets the "representative" color for the symbol layer.
RenderUnit
Rendering size units.
A symbol layer class for displaying displacement arrows based on point layer attributes.
QgsMapUnitScale mapUnitScale() const override
VectorFieldType vectorFieldType() const
QString yAttribute() const
virtual QgsSymbol * subSymbol()
Returns the symbol's sub symbol, if present.
const QgsMapUnitScale & distanceMapUnitScale() const
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
QRectF bounds(QPointF, QgsSymbolRenderContext &) override
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
Contains information about the context of a rendering operation.
@ RenderMillimeters
Millimeters.
Abstract base class for marker symbol layers.
Abstract base class for all rendered symbols.
void setMapUnitScale(const QgsMapUnitScale &scale) override
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
virtual QgsSymbolLayer * clone() const =0
Shall be reimplemented by subclasses to create a deep copy of the instance.
virtual bool setSubSymbol(QgsSymbol *symbol)
Sets layer's subsymbol. takes ownership of the passed symbol.
QgsUnitTypes::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
A line symbol type, for rendering LineString and MultiLineString geometries.
Struct for storing maximum and minimum scales for measurements in map units.
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
AngleOrientation angleOrientation() const
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the units for the distance.
Qgis::SymbolType type() const
AngleUnits angleUnits() const
void setAngleOrientation(AngleOrientation orientation)
virtual void renderPoint(QPointF point, QgsSymbolRenderContext &context)=0
Renders a marker at the specified point.
virtual QColor color() const
Returns the "representative" color of the symbol layer.
QString xAttribute() const
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 setYAttribute(const QString &attribute)
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
QString layerType() const override
Returns a string that represents this layer type.
void setAngleUnits(AngleUnits units)