Quantum GIS API Documentation
1.7.4
|
Abstraction of composer scale bar style. More...
#include <qgsscalebarstyle.h>
Public Member Functions | |
QgsScaleBarStyle (const QgsComposerScaleBar *bar) | |
virtual | ~QgsScaleBarStyle () |
virtual void | draw (QPainter *p, double xOffset=0) const =0 |
Draws the style. | |
virtual void | drawLabels (QPainter *p) const |
virtual QRectF | calculateBoxSize () const |
virtual QString | name () const =0 |
Protected Attributes | |
const QgsComposerScaleBar * | mScaleBar |
Private Member Functions | |
QgsScaleBarStyle () |
Abstraction of composer scale bar style.
Subclasses draw themselves, have the possibility to implement custom labeling and calculate corresponding box size.
Definition at line 30 of file qgsscalebarstyle.h.
QgsScaleBarStyle::QgsScaleBarStyle | ( | const QgsComposerScaleBar * | bar | ) |
Definition at line 22 of file qgsscalebarstyle.cpp.
QgsScaleBarStyle::~QgsScaleBarStyle | ( | ) | [virtual] |
Definition at line 32 of file qgsscalebarstyle.cpp.
QgsScaleBarStyle::QgsScaleBarStyle | ( | ) | [private] |
Definition at line 27 of file qgsscalebarstyle.cpp.
QRectF QgsScaleBarStyle::calculateBoxSize | ( | ) | const [virtual] |
Reimplemented in QgsNumericScaleBarStyle.
Definition at line 103 of file qgsscalebarstyle.cpp.
References QgsComposerScaleBar::boxContentSpace(), QgsComposerScaleBar::firstLabelString(), QgsComposerScaleBar::font(), QgsComposerItem::fontAscentMillimeters(), QgsComposerScaleBar::height(), QgsComposerScaleBar::labelBarSpace(), mScaleBar, QgsComposerScaleBar::numMapUnitsPerScaleBarUnit(), QgsComposerScaleBar::numSegments(), QgsComposerScaleBar::numUnitsPerSegment(), QgsComposerScaleBar::pen(), QgsComposerScaleBar::segmentPositions(), QgsComposerItem::textWidthMillimeters(), and QgsComposerScaleBar::unitLabeling().
Referenced by QgsComposerScaleBar::adjustBoxSize().
virtual void QgsScaleBarStyle::draw | ( | QPainter * | p, |
double | xOffset = 0 |
||
) | const [pure virtual] |
Draws the style.
p | painter object |
xOffset | offset to account for centered labeling |
Implemented in QgsTicksScaleBarStyle, QgsSingleBoxScaleBarStyle, QgsDoubleBoxScaleBarStyle, and QgsNumericScaleBarStyle.
Referenced by QgsComposerScaleBar::paint().
void QgsScaleBarStyle::drawLabels | ( | QPainter * | p | ) | const [virtual] |
Definition at line 37 of file qgsscalebarstyle.cpp.
References QgsComposerScaleBar::boxContentSpace(), QgsComposerItem::drawText(), QgsComposerScaleBar::firstLabelString(), QgsComposerScaleBar::font(), QgsComposerItem::fontAscentMillimeters(), mScaleBar, QgsComposerScaleBar::numMapUnitsPerScaleBarUnit(), QgsComposerScaleBar::numSegmentsLeft(), QgsComposerScaleBar::numUnitsPerSegment(), QgsComposerScaleBar::segmentMillimeters(), QgsComposerScaleBar::segmentPositions(), QgsComposerItem::textWidthMillimeters(), and QgsComposerScaleBar::unitLabeling().
Referenced by QgsDoubleBoxScaleBarStyle::draw(), QgsSingleBoxScaleBarStyle::draw(), and QgsTicksScaleBarStyle::draw().
virtual QString QgsScaleBarStyle::name | ( | ) | const [pure virtual] |
Implemented in QgsTicksScaleBarStyle, QgsSingleBoxScaleBarStyle, QgsDoubleBoxScaleBarStyle, and QgsNumericScaleBarStyle.
Referenced by QgsComposerScaleBar::style(), and QgsComposerScaleBar::writeXML().
const QgsComposerScaleBar* QgsScaleBarStyle::mScaleBar [protected] |
Definition at line 49 of file qgsscalebarstyle.h.
Referenced by QgsNumericScaleBarStyle::calculateBoxSize(), calculateBoxSize(), QgsNumericScaleBarStyle::draw(), QgsDoubleBoxScaleBarStyle::draw(), QgsSingleBoxScaleBarStyle::draw(), QgsTicksScaleBarStyle::draw(), drawLabels(), and QgsNumericScaleBarStyle::scaleText().