QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
18 #ifndef QGSVECTORFIELDSYMBOLLAYER_H
19 #define QGSVECTORFIELDSYMBOLLAYER_H
21 #include "qgis_core.h"
41 ClockwiseFromNorth = 0,
42 CounterclockwiseFromEast
56 QString
layerType()
const override {
return QStringLiteral(
"VectorField" ); }
61 void setColor(
const QColor &color )
override;
62 QColor
color()
const override;
71 void toSld( QDomDocument &doc, QDomElement &element, const
QgsStringMap &props ) const override;
75 QSet<QString> usedAttributes( const
QgsRenderContext &context ) const override;
76 bool hasDataDefinedProperties() const override;
79 void setXAttribute( const QString &attribute ) { mXAttribute = attribute; }
81 void setYAttribute(
const QString &attribute ) { mYAttribute = attribute; }
84 double scale()
const {
return mScale; }
127 VectorFieldType mVectorFieldType = Cartesian;
128 AngleOrientation mAngleOrientation = ClockwiseFromNorth;
129 AngleUnits mAngleUnits = Degrees;
131 std::unique_ptr< QgsLineSymbol > mLineSymbol;
138 void convertPolarToCartesian(
double length,
double angle,
double &x,
double &y )
const;
141 #endif // QGSVECTORFIELDSYMBOLLAYER_H
virtual bool setSubSymbol(QgsSymbol *symbol)
Sets layer's subsymbol. takes ownership of the passed symbol.
void setVectorFieldType(VectorFieldType type)
void setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the distance.
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 void setColor(const QColor &color)
The fill color.
virtual QColor color() const
The fill color.
QgsSymbol * subSymbol() override
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.
QgsUnitTypes::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
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.
QMap< QString, QString > QgsStringMap
AngleUnits angleUnits() const
void setAngleOrientation(AngleOrientation orientation)
virtual void renderPoint(QPointF point, QgsSymbolRenderContext &context)=0
Renders a marker at the specified point.
QgsSymbol::SymbolType type() const
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)