QGIS API Documentation
2.10.1-Pisa
|
#include <qgspallabeling.h>
Public Types | |
enum | DrawLabelType { LabelText = 0, LabelBuffer, LabelShape, LabelSVG, LabelShadow } |
enum | Search { Chain, Popmusic_Tabu, Popmusic_Chain, Popmusic_Tabu_Chain, Falp } |
Public Member Functions | |
QgsPalLabeling () | |
~QgsPalLabeling () | |
virtual int | addDiagramLayer (QgsVectorLayer *layer, const QgsDiagramLayerSettings *s) override |
adds a diagram layer to the labeling engine More... | |
const QList< QgsLabelCandidate > & | candidates () |
virtual void | clearActiveLayer (const QString &layerID) override |
clears data defined objects from PAL layer settings for a registered layer More... | |
virtual void | clearActiveLayers () override |
clears all PAL layer settings for registered layers More... | |
void | clearEngineSettings () |
virtual QgsLabelingEngineInterface * | clone () override |
called when passing engine among map renderers More... | |
virtual void | drawLabel (pal::LabelPosition *label, QgsRenderContext &context, QgsPalLayerSettings &tmpLyr, DrawLabelType drawType, double dpiRatio=1.0) |
drawLabel More... | |
void | drawLabelCandidateRect (pal::LabelPosition *lp, QPainter *painter, const QgsMapToPixel *xform) |
virtual void | drawLabeling (QgsRenderContext &context) override |
called when the map is drawn and labels should be placed More... | |
virtual void | exit () override |
called when we're done with rendering More... | |
virtual Q_DECL_DEPRECATED void | init (QgsMapRenderer *mr) override |
called when we're going to start with rendering More... | |
virtual void | init (const QgsMapSettings &mapSettings) override |
called when we're going to start with rendering More... | |
bool | isDrawingOutlineLabels () const |
bool | isShowingAllLabels () const |
bool | isShowingCandidates () const |
bool | isShowingPartialsLabels () const |
bool | isShowingShadowRectangles () const |
Q_DECL_DEPRECATED bool | isStoredWithProject () const |
virtual Q_DECL_DEPRECATED QList< QgsLabelPosition > | labelsAtPosition (const QgsPoint &p) override |
return infos about labels at a given (map) position More... | |
virtual Q_DECL_DEPRECATED QList< QgsLabelPosition > | labelsWithinRect (const QgsRectangle &r) override |
return infos about labels within a given (map) rectangle More... | |
QgsPalLayerSettings & | layer (const QString &layerName) override |
returns PAL layer settings for a registered layer More... | |
void | loadEngineSettings () |
load/save engine settings to project file More... | |
void | numCandidatePositions (int &candPoint, int &candLine, int &candPolygon) |
virtual int | prepareLayer (QgsVectorLayer *layer, QStringList &attrNames, QgsRenderContext &ctx) override |
hook called when drawing layer before issuing select() More... | |
virtual void | registerDiagramFeature (const QString &layerID, QgsFeature &feat, const QgsRenderContext &context=QgsRenderContext()) override |
called for every diagram feature More... | |
virtual void | registerFeature (const QString &layerID, QgsFeature &feat, const QgsRenderContext &context=QgsRenderContext(), QString dxfLayer=QString::null) override |
hook called when drawing for every feature in a layer More... | |
void | saveEngineSettings () |
Search | searchMethod () const |
void | setDrawingOutlineLabels (bool outline) |
void | setNumCandidatePositions (int candPoint, int candLine, int candPolygon) |
void | setSearchMethod (Search s) |
void | setShowingAllLabels (bool showing) |
void | setShowingCandidates (bool showing) |
void | setShowingPartialsLabels (bool showing) |
void | setShowingShadowRectangles (bool showing) |
Q_DECL_DEPRECATED void | setStoredWithProject (bool store) |
QgsLabelingResults * | takeResults () |
Return pointer to recently computed results (in drawLabeling()) and pass the ownership of results to the caller. More... | |
virtual bool | willUseLayer (QgsVectorLayer *layer) override |
called to find out whether the layer is used for labeling More... | |
Public Member Functions inherited from QgsLabelingEngineInterface | |
virtual | ~QgsLabelingEngineInterface () |
Static Public Member Functions | |
static void | drawLabelBackground (QgsRenderContext &context, QgsLabelComponent component, const QgsPalLayerSettings &tmpLyr) |
static void | drawLabelBuffer (QgsRenderContext &context, const QgsLabelComponent &component, const QgsPalLayerSettings &tmpLyr) |
static void | drawLabelShadow (QgsRenderContext &context, const QgsLabelComponent &component, const QgsPalLayerSettings &tmpLyr) |
static bool | geometryRequiresPreparation (const QgsGeometry *geometry, const QgsRenderContext &context, const QgsCoordinateTransform *ct, QgsGeometry *clipGeometry=0) |
Checks whether a geometry requires preparation before registration with PAL. More... | |
static QgsGeometry * | prepareGeometry (const QgsGeometry *geometry, const QgsRenderContext &context, const QgsCoordinateTransform *ct, QgsGeometry *clipGeometry=0) |
Prepares a geometry for registration with PAL. More... | |
static QStringList | splitToGraphemes (const QString &text) |
Splits a text string to a list of graphemes, which are the smallest allowable character divisions in the string. More... | |
static QStringList | splitToLines (const QString &text, const QString &wrapCharacter) |
Splits a text string to a list of separate lines, using a specified wrap character. More... | |
static bool | staticWillUseLayer (QgsVectorLayer *layer) |
called to find out whether the layer is used for labeling More... | |
static bool | staticWillUseLayer (const QString &layerID) |
Protected Member Functions | |
void | dataDefinedDropShadow (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &ddValues) |
void | dataDefinedShapeBackground (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &ddValues) |
void | dataDefinedTextBuffer (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &ddValues) |
void | dataDefinedTextFormatting (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &ddValues) |
void | dataDefinedTextStyle (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &ddValues) |
void | deleteTemporaryData () |
Static Protected Member Functions | |
static bool | checkMinimumSizeMM (const QgsRenderContext &context, const QgsGeometry *geom, double minSize) |
Checks whether a geometry exceeds the minimum required size for a geometry to be labeled. More... | |
Protected Attributes | |
QHash< QString, QgsDiagramLayerSettings > | mActiveDiagramLayers |
QHash< QString, QgsPalLayerSettings > | mActiveLayers |
QList< QgsLabelCandidate > | mCandidates |
int | mCandLine |
int | mCandPoint |
int | mCandPolygon |
bool | mDrawOutlineLabels |
QgsPalLayerSettings | mInvalidLayerSettings |
const QgsMapSettings * | mMapSettings |
pal::Pal * | mPal |
QgsLabelingResults * | mResults |
Search | mSearch |
bool | mShowingAllLabels |
bool | mShowingCandidates |
bool | mShowingPartialsLabels |
bool | mShowingShadowRects |
Friends | |
class | QgsPalLayerSettings |
Definition at line 702 of file qgspallabeling.h.
Enumerator | |
---|---|
LabelText | |
LabelBuffer | |
LabelShape | |
LabelSVG | |
LabelShadow |
Definition at line 705 of file qgspallabeling.h.
Enumerator | |
---|---|
Chain | |
Popmusic_Tabu | |
Popmusic_Chain | |
Popmusic_Tabu_Chain | |
Falp |
Definition at line 722 of file qgspallabeling.h.
QgsPalLabeling::QgsPalLabeling | ( | ) |
Definition at line 3016 of file qgspallabeling.cpp.
QgsPalLabeling::~QgsPalLabeling | ( | ) |
Definition at line 3043 of file qgspallabeling.cpp.
|
overridevirtual |
adds a diagram layer to the labeling engine
Reimplemented from QgsLabelingEngineInterface.
Definition at line 3310 of file qgspallabeling.cpp.
|
inline |
Definition at line 729 of file qgspallabeling.h.
|
staticprotected |
Checks whether a geometry exceeds the minimum required size for a geometry to be labeled.
context | render context |
geom | geometry |
minSize | minimum size for geometry |
Definition at line 3482 of file qgspallabeling.cpp.
|
overridevirtual |
clears data defined objects from PAL layer settings for a registered layer
Implements QgsLabelingEngineInterface.
Definition at line 3089 of file qgspallabeling.cpp.
|
overridevirtual |
clears all PAL layer settings for registered layers
Implements QgsLabelingEngineInterface.
Definition at line 3079 of file qgspallabeling.cpp.
void QgsPalLabeling::clearEngineSettings | ( | ) |
Definition at line 5195 of file qgspallabeling.cpp.
|
overridevirtual |
called when passing engine among map renderers
Implements QgsLabelingEngineInterface.
Definition at line 5208 of file qgspallabeling.cpp.
|
protected |
Definition at line 3954 of file qgspallabeling.cpp.
|
protected |
Definition at line 3843 of file qgspallabeling.cpp.
|
protected |
Definition at line 3786 of file qgspallabeling.cpp.
|
protected |
Definition at line 3733 of file qgspallabeling.cpp.
|
protected |
Definition at line 3708 of file qgspallabeling.cpp.
|
protected |
Definition at line 4279 of file qgspallabeling.cpp.
|
virtual |
drawLabel
Reimplemented in QgsDxfPalLabeling.
Definition at line 4407 of file qgspallabeling.cpp.
|
static |
Definition at line 4712 of file qgspallabeling.cpp.
|
static |
Definition at line 4657 of file qgspallabeling.cpp.
void QgsPalLabeling::drawLabelCandidateRect | ( | pal::LabelPosition * | lp, |
QPainter * | painter, | ||
const QgsMapToPixel * | xform | ||
) |
Definition at line 4357 of file qgspallabeling.cpp.
|
overridevirtual |
called when the map is drawn and labels should be placed
Implements QgsLabelingEngineInterface.
Definition at line 4027 of file qgspallabeling.cpp.
|
static |
Definition at line 5009 of file qgspallabeling.cpp.
|
overridevirtual |
called when we're done with rendering
Implements QgsLabelingEngineInterface.
Definition at line 3688 of file qgspallabeling.cpp.
|
static |
Checks whether a geometry requires preparation before registration with PAL.
geometry | geometry to prepare |
context | render context |
ct | coordinate transform |
clipGeometry | geometry to clip features to, if applicable |
Definition at line 3340 of file qgspallabeling.cpp.
|
overridevirtual |
called when we're going to start with rendering
Implements QgsLabelingEngineInterface.
Definition at line 3650 of file qgspallabeling.cpp.
|
overridevirtual |
called when we're going to start with rendering
Implements QgsLabelingEngineInterface.
Definition at line 3655 of file qgspallabeling.cpp.
|
inline |
Definition at line 741 of file qgspallabeling.h.
|
inline |
Definition at line 734 of file qgspallabeling.h.
|
inline |
Definition at line 727 of file qgspallabeling.h.
|
inline |
Definition at line 737 of file qgspallabeling.h.
|
inline |
Definition at line 731 of file qgspallabeling.h.
|
inline |
Definition at line 812 of file qgspallabeling.h.
|
overridevirtual |
return infos about labels at a given (map) position
Implements QgsLabelingEngineInterface.
Definition at line 4311 of file qgspallabeling.cpp.
|
overridevirtual |
return infos about labels within a given (map) rectangle
Implements QgsLabelingEngineInterface.
Definition at line 4316 of file qgspallabeling.cpp.
|
overridevirtual |
returns PAL layer settings for a registered layer
Implements QgsLabelingEngineInterface.
Definition at line 3695 of file qgspallabeling.cpp.
void QgsPalLabeling::loadEngineSettings | ( | ) |
load/save engine settings to project file
Definition at line 5157 of file qgspallabeling.cpp.
void QgsPalLabeling::numCandidatePositions | ( | int & | candPoint, |
int & | candLine, | ||
int & | candPolygon | ||
) |
Definition at line 4333 of file qgspallabeling.cpp.
|
static |
Prepares a geometry for registration with PAL.
Handles reprojection, rotation, clipping, etc.
geometry | geometry to prepare |
context | render context |
ct | coordinate transform |
clipGeometry | geometry to clip features to, if applicable |
Definition at line 3400 of file qgspallabeling.cpp.
|
overridevirtual |
hook called when drawing layer before issuing select()
Implements QgsLabelingEngineInterface.
Definition at line 3103 of file qgspallabeling.cpp.
|
overridevirtual |
called for every diagram feature
Reimplemented from QgsLabelingEngineInterface.
Definition at line 3520 of file qgspallabeling.cpp.
|
overridevirtual |
hook called when drawing for every feature in a layer
Implements QgsLabelingEngineInterface.
Definition at line 3334 of file qgspallabeling.cpp.
void QgsPalLabeling::saveEngineSettings | ( | ) |
Definition at line 5182 of file qgspallabeling.cpp.
QgsPalLabeling::Search QgsPalLabeling::searchMethod | ( | ) | const |
Definition at line 4352 of file qgspallabeling.cpp.
|
inline |
Definition at line 742 of file qgspallabeling.h.
void QgsPalLabeling::setNumCandidatePositions | ( | int | candPoint, |
int | candLine, | ||
int | candPolygon | ||
) |
Definition at line 4340 of file qgspallabeling.cpp.
void QgsPalLabeling::setSearchMethod | ( | QgsPalLabeling::Search | s | ) |
Definition at line 4347 of file qgspallabeling.cpp.
|
inline |
Definition at line 735 of file qgspallabeling.h.
|
inline |
Definition at line 728 of file qgspallabeling.h.
|
inline |
Definition at line 738 of file qgspallabeling.h.
|
inline |
Definition at line 732 of file qgspallabeling.h.
|
inline |
Definition at line 814 of file qgspallabeling.h.
|
static |
Splits a text string to a list of graphemes, which are the smallest allowable character divisions in the string.
This accounts for scripts were individual characters are not allowed to be split apart (eg Arabic and Indic based scripts)
text | string to split |
Definition at line 3386 of file qgspallabeling.cpp.
|
static |
Splits a text string to a list of separate lines, using a specified wrap character.
The text string will be split on either newline characters or the wrap character.
text | text string to split |
wrapCharacter | additional character to wrap on |
Definition at line 3367 of file qgspallabeling.cpp.
|
static |
called to find out whether the layer is used for labeling
Definition at line 3068 of file qgspallabeling.cpp.
|
static |
Definition at line 3059 of file qgspallabeling.cpp.
QgsLabelingResults * QgsPalLabeling::takeResults | ( | ) |
Return pointer to recently computed results (in drawLabeling()) and pass the ownership of results to the caller.
Definition at line 4321 of file qgspallabeling.cpp.
|
overridevirtual |
called to find out whether the layer is used for labeling
Implements QgsLabelingEngineInterface.
Definition at line 3054 of file qgspallabeling.cpp.
|
friend |
Definition at line 908 of file qgspallabeling.h.
|
protected |
Definition at line 889 of file qgspallabeling.h.
|
protected |
Definition at line 887 of file qgspallabeling.h.
|
protected |
Definition at line 899 of file qgspallabeling.h.
|
protected |
Definition at line 893 of file qgspallabeling.h.
|
protected |
Definition at line 893 of file qgspallabeling.h.
|
protected |
Definition at line 893 of file qgspallabeling.h.
|
protected |
Definition at line 904 of file qgspallabeling.h.
|
protected |
Definition at line 890 of file qgspallabeling.h.
|
protected |
Definition at line 892 of file qgspallabeling.h.
|
protected |
Definition at line 896 of file qgspallabeling.h.
|
protected |
Definition at line 906 of file qgspallabeling.h.
|
protected |
Definition at line 894 of file qgspallabeling.h.
|
protected |
Definition at line 901 of file qgspallabeling.h.
|
protected |
Definition at line 900 of file qgspallabeling.h.
|
protected |
Definition at line 903 of file qgspallabeling.h.
|
protected |
Definition at line 902 of file qgspallabeling.h.