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;
A line symbol type, for rendering LineString and MultiLineString geometries.
Struct for storing maximum and minimum scales for measurements in map units.
Abstract base class for marker symbol layers.
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
virtual void renderPoint(QPointF point, QgsSymbolRenderContext &context)=0
Renders a marker at the specified point.
QgsMapUnitScale mapUnitScale() const override
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
QgsUnitTypes::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
void setMapUnitScale(const QgsMapUnitScale &scale) override
Contains information about the context of a rendering operation.
virtual bool setSubSymbol(QgsSymbol *symbol)
Sets layer's subsymbol. takes ownership of the passed symbol.
Qgis::SymbolType type() const
virtual QgsSymbolLayer * clone() const =0
Shall be reimplemented by subclasses to create a deep copy of the instance.
virtual void setColor(const QColor &color)
Sets the "representative" color for the symbol layer.
virtual QgsSymbol * subSymbol()
Returns the symbol's sub symbol, if present.
virtual QColor color() const
Returns the "representative" color of the symbol layer.
Abstract base class for all rendered symbols.
RenderUnit
Rendering size units.
@ RenderMillimeters
Millimeters.
A symbol layer class for displaying displacement arrows based on point layer attributes.
void setYAttribute(const QString &attribute)
void setAngleUnits(AngleUnits units)
void setVectorFieldType(VectorFieldType type)
const QgsMapUnitScale & distanceMapUnitScale() const
QString yAttribute() const
AngleUnits angleUnits() const
void setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the distance.
~QgsVectorFieldSymbolLayer() override
void setAngleOrientation(AngleOrientation orientation)
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the units for the distance.
AngleOrientation angleOrientation() const
QRectF bounds(QPointF, QgsSymbolRenderContext &) override
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
QString xAttribute() const
VectorFieldType vectorFieldType() const
QString layerType() const override
Returns a string that represents this layer type.
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)