17#ifndef QGSSCALEBARRENDERER_H
18#define QGSSCALEBARRENDERER_H
48 FlagUsesLineSymbol = 1 << 0,
49 FlagUsesFillSymbol = 1 << 1,
50 FlagUsesAlternateFillSymbol = 1 << 2,
51 FlagRespectsUnits = 1 << 3,
52 FlagRespectsMapUnitsPerScaleBarUnit = 1 << 4,
53 FlagUsesUnitLabel = 1 << 5,
54 FlagUsesSegments = 1 << 6,
55 FlagUsesLabelBarSpace = 1 << 7,
56 FlagUsesLabelVerticalPlacement = 1 << 8,
57 FlagUsesLabelHorizontalPlacement = 1 << 8,
58 FlagUsesAlignment = 1 << 9,
59 FlagUsesSubdivisions = 1 << 10,
60 FlagUsesDivisionSymbol = 1 << 11,
61 FlagUsesSubdivisionSymbol = 1 << 12,
62 FlagUsesSubdivisionsHeight = 1 << 13,
114 virtual QString
id()
const = 0;
Contains information about the context of a rendering operation.
virtual void draw(QgsRenderContext &context, const QgsScaleBarSettings &settings, const QgsScaleBarRenderer::ScaleBarContext &scaleContext) const =0
Draws the scalebar using the specified settings and scaleContext to a destination render context.
virtual Flags flags() const
Returns the scalebar rendering flags, which dictates the renderer's behavior.
Q_DECL_DEPRECATED QString name() const
Returns the unique name for this style.
virtual ~QgsScaleBarRenderer()=default
virtual bool applyDefaultSettings(QgsScaleBarSettings &settings) const
Applies any default settings relating to the scalebar to the passed settings object.
virtual int sortKey() const
Returns a sorting key value, where renderers with a lower sort key will be shown earlier in lists.
virtual QString visibleName() const =0
Returns the user friendly, translated name for the renderer.
void drawDefaultLabels(QgsRenderContext &context, const QgsScaleBarSettings &settings, const QgsScaleBarRenderer::ScaleBarContext &scaleContext) const
Draws default scalebar labels using the specified settings and scaleContext to a destination render c...
virtual Q_DECL_DEPRECATED QSizeF calculateBoxSize(const QgsScaleBarSettings &settings, const QgsScaleBarRenderer::ScaleBarContext &scaleContext) const
Calculates the required box size (in millimeters) for a scalebar using the specified settings and sca...
QString firstLabelString(const QgsScaleBarSettings &settings) const
Returns the text used for the first label in the scalebar.
QgsScaleBarRenderer()=default
QList< double > segmentWidths(const QgsScaleBarRenderer::ScaleBarContext &scaleContext, const QgsScaleBarSettings &settings) const
Returns a list of widths of each segment of the scalebar.
Q_DECL_DEPRECATED QList< double > segmentPositions(const QgsScaleBarRenderer::ScaleBarContext &scaleContext, const QgsScaleBarSettings &settings) const
Returns a list of positions for each segment within the scalebar.
virtual QgsScaleBarRenderer * clone() const =0
Returns a clone of the renderer.
Q_DECL_DEPRECATED double firstLabelXOffset(const QgsScaleBarSettings &settings) const
Returns the x-offset (in millimeters) used for the first label in the scalebar.
Flag
Flags which control scalebar renderer behavior.
virtual QString id() const =0
Returns the unique ID for this renderer.
Stores the appearance and layout settings for scalebar drawing with QgsScaleBarRenderer.
#define SIP_ENUM_BASETYPE(type)
Contains parameters regarding scalebar calculations.
QSizeF size
Destination size for scalebar.
double scale
Scale denominator.
bool isValid() const
Returns true if the context has valid settings.
QgsScaleBarRenderer::Flags flags
Scalebar renderer flags.
double segmentWidth
The width, in millimeters, of each individual segment drawn.