15#ifndef QGSLINEARREFERENCINGSYMBOLLAYER_H
16#define QGSLINEARREFERENCINGSYMBOLLAYER_H
51 Qgis::SymbolLayerFlags
flags() const override;
201 bool showMarker()
const;
210 void setShowMarker(
bool show );
305 void renderPolylineInterval(
const QgsLineString *line,
QgsSymbolRenderContext &context,
double skipMultiples,
const QPointF &labelOffsetPainterUnits,
double averageAngleLengthPainterUnits,
bool showMarker );
306 void renderPolylineVertex(
const QgsLineString *line,
QgsSymbolRenderContext &context,
double skipMultiples,
const QPointF &labelOffsetPainterUnits,
double averageAngleLengthPainterUnits,
bool showMarker );
307 void renderGeometryPart(
QgsSymbolRenderContext &context,
const QgsAbstractGeometry *geometry,
double labelOffsetPainterUnitsX,
double labelOffsetPainterUnitsY,
double skipMultiples,
double averageAngleDistancePainterUnits,
bool showMarker );
308 void renderLineString(
QgsSymbolRenderContext &context,
const QgsLineString *line,
double labelOffsetPainterUnitsX,
double labelOffsetPainterUnitsY,
double skipMultiples,
double averageAngleDistancePainterUnits,
bool showMarker );
315 double mInterval = 1000;
316 double mSkipMultiplesOf = 0;
317 bool mRotateLabels =
true;
319 QPointF mLabelOffset{ 1, 0 };
321 QgsMapUnitScale mLabelOffsetMapUnitScale;
323 QgsTextFormat mTextFormat;
324 std::unique_ptr<QgsNumericFormat> mNumericFormat;
326 bool mShowMarker =
false;
327 std::unique_ptr<QgsMarkerSymbol> mMarkerSymbol;
329 double mAverageAngleLength = 4;
331 QgsMapUnitScale mAverageAngleLengthMapUnitScale;
333 QString mLabelProviderId;
Provides global constants and enumerations for use throughout the application.
LinearReferencingPlacement
Defines how/where the labels should be placed in a linear referencing symbol layer.
@ IntervalCartesian2D
Place labels at regular intervals, using Cartesian distance calculations on a 2D plane.
LinearReferencingLabelSource
Defines what quantity to use for the labels shown in a linear referencing symbol layer.
@ CartesianDistance2D
Distance along line, calculated using Cartesian calculations on a 2D plane.
RenderUnit
Rendering size units.
@ Millimeters
Millimeters.
Abstract base class for all geometries.
Line string geometry type, with support for z-dimension and m-values.
QgsLineSymbolLayer(const QgsLineSymbolLayer &other)=delete
double offset() const
Returns the line's offset.
Qgis::SymbolLayerFlags flags() const override
Returns flags which control the symbol layer's behavior.
double averageAngleLength() const
Returns the length of line over which the line's direction is averaged when calculating individual la...
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
void setAverageAngleUnit(Qgis::RenderUnit unit)
Sets the unit for the length over which the line's direction is averaged when calculating individual ...
void setAverageAngleMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the length over which the line's direction is averaged when calculating i...
void setSkipMultiplesOf(double multiple)
Sets the multiple distance to skip labels for.
QVariantMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
Qgis::RenderUnit labelOffsetUnit() const
Returns the unit used for the offset between the line and linear referencing labels.
QgsSymbol * subSymbol() override
Returns the symbol's sub symbol, if present.
void setLabelOffset(const QPointF &offset)
Sets the offset between the line and linear referencing labels.
QgsTextFormat textFormat() const
Returns the text format used to render the layer.
QString layerType() const override
Returns a string that represents this layer type.
bool rotateLabels() const
Returns true if the labels and symbols are to be rotated to match their line segment orientation.
void setNumericFormat(QgsNumericFormat *format)
Sets the numeric format used to format the labels for the layer.
QgsNumericFormat * numericFormat() const
Returns the numeric format used to format the labels for the layer.
QPointF labelOffset() const
Returns the offset between the line and linear referencing labels.
const QgsMapUnitScale & labelOffsetMapUnitScale() const
Returns the map unit scale used for calculating the offset between the line and linear referencing la...
void setInterval(double interval)
Sets the interval between labels.
~QgsLinearReferencingSymbolLayer() override
Qgis::RenderUnit averageAngleUnit() const
Returns the unit for the length over which the line's direction is averaged when calculating individu...
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
void renderPolyline(const QPolygonF &points, QgsSymbolRenderContext &context) override
Renders the line symbol layer along the line joining points, using the given render context.
void setRotateLabels(bool rotate)
Sets whether the labels and symbols should be rotated to match their line segment orientation.
bool setSubSymbol(QgsSymbol *symbol) override
Sets layer's subsymbol. takes ownership of the passed symbol.
void setTextFormat(const QgsTextFormat &format)
Sets the text format used to render the layer.
const QgsMapUnitScale & averageAngleMapUnitScale() const
Returns the map unit scale for the length over which the line's direction is averaged when calculatin...
QgsLinearReferencingSymbolLayer()
void setLabelOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for calculating the offset between the line and linear referencing label...
void setLabelOffsetUnit(Qgis::RenderUnit unit)
Sets the unit used for the offset between the line and linear referencing labels.
double skipMultiplesOf() const
Returns the multiple distance to skip labels for.
QgsLinearReferencingSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
static QgsSymbolLayer * create(const QVariantMap &properties=QVariantMap())
Creates a new QgsLinearReferencingSymbolLayer, using the specified properties.
double interval() const
Returns the interval between labels.
void setAverageAngleLength(double length)
Sets the length of line over which the line's direction is averaged when calculating individual label...
Struct for storing maximum and minimum scales for measurements in map units.
QgsSymbolLayer(const QgsSymbolLayer &other)
Encapsulates the context in which a symbol is being rendered.
Abstract base class for all rendered symbols.
Container for all settings relating to text rendering.