QGIS API Documentation
3.0.2-Girona (307d082)
|
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... | |
double | firstLabelXOffset (const QgsScaleBarSettings &settings) const |
Returns the x-offset (in millimeters) 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 37 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 92 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 23 of file qgsscalebarrenderer.cpp.
|
protected |
Returns the text used for the first label in the scalebar.
Definition at line 113 of file qgsscalebarrenderer.cpp.
|
protected |
Returns the x-offset (in millimeters) used for the first label in the scalebar.
Definition at line 125 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 131 of file qgsscalebarrenderer.cpp.
|
protected |
Returns a list of widths of each segment of the scalebar.
Definition at line 154 of file qgsscalebarrenderer.cpp.