QGIS API Documentation
3.8.0-Zanzibar (11aff65)
|
Abstract base class for scale bar renderers. More...
#include <qgsscalebarrenderer.h>
Classes | |
struct | ScaleBarContext |
Contains parameters regarding scalebar calculations. More... | |
Public Member Functions | |
QgsScaleBarRenderer ()=default | |
Constructor for QgsScaleBarRenderer. More... | |
virtual | ~QgsScaleBarRenderer ()=default |
virtual 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 scaleContext. More... | |
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. More... | |
virtual QString | name () const =0 |
Returns the unique name for this style. More... | |
Protected Member Functions | |
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 context. More... | |
QString | firstLabelString (const QgsScaleBarSettings &settings) const |
Returns the text used for the first label in the scalebar. More... | |
Q_DECL_DEPRECATED double | firstLabelXOffset (const QgsScaleBarSettings &settings) const |
Returns the x-offset (in millimeters) used for the first label in the scalebar. More... | |
double | firstLabelXOffset (const QgsScaleBarSettings &settings, const QgsRenderContext &context) const |
Returns the x-offset (in render context painter units) used for the first label in the scalebar. More... | |
QList< double > | segmentPositions (const QgsScaleBarRenderer::ScaleBarContext &scaleContext, const QgsScaleBarSettings &settings) const |
Returns a list of positions for each segment within the scalebar. More... | |
QList< double > | segmentWidths (const QgsScaleBarRenderer::ScaleBarContext &scaleContext, const QgsScaleBarSettings &settings) const |
Returns a list of widths of each segment of the scalebar. More... | |
Abstract base class for scale bar renderers.
Scalebar renderer subclasses implement custom drawing logic, with the possibility to implement custom labeling.
Definition at line 38 of file qgsscalebarrenderer.h.
|
default |
Constructor for QgsScaleBarRenderer.
|
virtualdefault |
|
virtual |
Calculates the required box size (in millimeters) for a scalebar using the specified settings and scaleContext.
Reimplemented in QgsNumericScaleBarRenderer.
Definition at line 98 of file qgsscalebarrenderer.cpp.
|
pure virtual |
Draws the scalebar using the specified settings and scaleContext to a destination render context.
Implemented in QgsTicksScaleBarRenderer, QgsSingleBoxScaleBarRenderer, QgsDoubleBoxScaleBarRenderer, and QgsNumericScaleBarRenderer.
|
protected |
Draws default scalebar labels using the specified settings and scaleContext to a destination render context.
Definition at line 24 of file qgsscalebarrenderer.cpp.
|
protected |
Returns the text used for the first label in the scalebar.
Definition at line 121 of file qgsscalebarrenderer.cpp.
|
protected |
Returns the x-offset (in millimeters) used for the first label in the scalebar.
Definition at line 133 of file qgsscalebarrenderer.cpp.
|
protected |
Returns the x-offset (in render context painter units) used for the first label in the scalebar.
Definition at line 141 of file qgsscalebarrenderer.cpp.
|
pure virtual |
Returns the unique name for this style.
Implemented in QgsTicksScaleBarRenderer, QgsSingleBoxScaleBarRenderer, QgsDoubleBoxScaleBarRenderer, and QgsNumericScaleBarRenderer.
|
protected |
Returns a list of positions for each segment within the scalebar.
Definition at line 147 of file qgsscalebarrenderer.cpp.
|
protected |
Returns a list of widths of each segment of the scalebar.
Definition at line 171 of file qgsscalebarrenderer.cpp.