|
QGIS API Documentation
2.14.11-Essen
|
#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 Q_DECL_DEPRECATED int | addDiagramLayer (QgsVectorLayer *layer, const QgsDiagramLayerSettings *s) override |
| adds a diagram layer to the labeling engine More... | |
| Q_DECL_DEPRECATED 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 QgsPalLabeling * | clone () override |
| called when passing engine among map renderers More... | |
| virtual void | drawLabeling (QgsRenderContext &context) override |
| called when the map is drawn and labels should be placed More... | |
| bool | drawLabelRectOnly () const |
| Returns whether the engine will only draw the outline rectangles of labels, not the label contents themselves. 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... | |
| Q_DECL_DEPRECATED QgsPalLayerSettings & | layer (const QString &layerName) override |
| void | loadEngineSettings () |
| load/save engine settings to project file More... | |
| void | numCandidatePositions (int &candPoint, int &candLine, int &candPolygon) |
| virtual int | prepareDiagramLayer (QgsVectorLayer *layer, QStringList &attrNames, QgsRenderContext &ctx) override |
| adds a diagram layer to the labeling engine More... | |
| 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, QgsRenderContext &context) override |
| called for every diagram feature More... | |
| virtual void | registerFeature (const QString &layerID, QgsFeature &feat, QgsRenderContext &context) override |
| Register a feature for labelling. More... | |
| void | saveEngineSettings () |
| Search | searchMethod () const |
| void | setDrawingOutlineLabels (bool outline) |
| void | setDrawLabelRectOnly (bool drawRect) |
| Sets whether the engine should only draw the outline rectangles of labels, not the label contents themselves. More... | |
| 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 | drawLabelCandidateRect (pal::LabelPosition *lp, QPainter *painter, const QgsMapToPixel *xform, QList< QgsLabelCandidate > *candidates=nullptr) |
| static void | drawLabelShadow (QgsRenderContext &context, const QgsLabelComponent &component, const QgsPalLayerSettings &tmpLyr) |
| static bool | geometryRequiresPreparation (const QgsGeometry *geometry, QgsRenderContext &context, const QgsCoordinateTransform *ct, QgsGeometry *clipGeometry=nullptr) |
| Checks whether a geometry requires preparation before registration with PAL. More... | |
| static QgsGeometry * | prepareGeometry (const QgsGeometry *geometry, QgsRenderContext &context, const QgsCoordinateTransform *ct, QgsGeometry *clipGeometry=nullptr) |
| 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 | 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... | |
| static void | dataDefinedDropShadow (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &ddValues) |
| static void | dataDefinedShapeBackground (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &ddValues) |
| static void | dataDefinedTextBuffer (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &ddValues) |
| static void | dataDefinedTextFormatting (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &ddValues) |
| static void | dataDefinedTextStyle (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &ddValues) |
Protected Attributes | |
| QList< QgsLabelCandidate > | mCandidates |
| QHash< QString, QgsVectorLayerDiagramProvider * > | mDiagramProviders |
| hashtable of diagram providers (key = layer ID) More... | |
| QgsLabelingEngineV2 * | mEngine |
| New labeling engine to interface with PAL. More... | |
| QgsPalLayerSettings | mInvalidLayerSettings |
| QHash< QString, QgsVectorLayerLabelProvider * > | mLabelProviders |
| hashtable of label providers, being filled during labeling (key = layer ID) More... | |
Friends | |
| class | QgsDxfExport |
| class | QgsPalLayerSettings |
| class | QgsVectorLayerLabelProvider |
Definition at line 860 of file qgspallabeling.h.
| Enumerator | |
|---|---|
| LabelText | |
| LabelBuffer | |
| LabelShape | |
| LabelSVG | |
| LabelShadow | |
Definition at line 863 of file qgspallabeling.h.
| Enumerator | |
|---|---|
| Chain | |
| Popmusic_Tabu | |
| Popmusic_Chain | |
| Popmusic_Tabu_Chain | |
| Falp | |
Definition at line 881 of file qgspallabeling.h.
| QgsPalLabeling::QgsPalLabeling | ( | ) |
Definition at line 3860 of file qgspallabeling.cpp.
| QgsPalLabeling::~QgsPalLabeling | ( | ) |
Definition at line 3865 of file qgspallabeling.cpp.
|
overridevirtual |
adds a diagram layer to the labeling engine
Reimplemented from QgsLabelingEngineInterface.
Definition at line 3952 of file qgspallabeling.cpp.
|
inline |
Definition at line 889 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 4108 of file qgspallabeling.cpp.
|
overridevirtual |
clears data defined objects from PAL layer settings for a registered layer
Implements QgsLabelingEngineInterface.
Definition at line 3902 of file qgspallabeling.cpp.
|
overridevirtual |
clears all PAL layer settings for registered layers
Implements QgsLabelingEngineInterface.
Definition at line 3898 of file qgspallabeling.cpp.
| void QgsPalLabeling::clearEngineSettings | ( | ) |
Definition at line 5165 of file qgspallabeling.cpp.
|
overridevirtual |
called when passing engine among map renderers
Implements QgsLabelingEngineInterface.
Definition at line 5178 of file qgspallabeling.cpp.
|
staticprotected |
Definition at line 4422 of file qgspallabeling.cpp.
|
staticprotected |
Definition at line 4311 of file qgspallabeling.cpp.
|
staticprotected |
Definition at line 4254 of file qgspallabeling.cpp.
|
staticprotected |
Definition at line 4201 of file qgspallabeling.cpp.
|
staticprotected |
Definition at line 4176 of file qgspallabeling.cpp.
|
protected |
Definition at line 4495 of file qgspallabeling.cpp.
|
static |
Definition at line 4710 of file qgspallabeling.cpp.
|
static |
Definition at line 4654 of file qgspallabeling.cpp.
|
static |
Definition at line 4594 of file qgspallabeling.cpp.
|
overridevirtual |
called when the map is drawn and labels should be placed
Implements QgsLabelingEngineInterface.
Definition at line 4490 of file qgspallabeling.cpp.
| bool QgsPalLabeling::drawLabelRectOnly | ( | ) | const |
Returns whether the engine will only draw the outline rectangles of labels, not the label contents themselves.
Used for debugging and testing purposes.
Definition at line 4584 of file qgspallabeling.cpp.
|
static |
Definition at line 5007 of file qgspallabeling.cpp.
|
overridevirtual |
called when we're done with rendering
Implements QgsLabelingEngineInterface.
Definition at line 4164 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 3966 of file qgspallabeling.cpp.
|
overridevirtual |
called when we're going to start with rendering
Implements QgsLabelingEngineInterface.
Definition at line 4153 of file qgspallabeling.cpp.
|
overridevirtual |
called when we're going to start with rendering
Implements QgsLabelingEngineInterface.
Definition at line 4159 of file qgspallabeling.cpp.
| bool QgsPalLabeling::isDrawingOutlineLabels | ( | ) | const |
Definition at line 4574 of file qgspallabeling.cpp.
| bool QgsPalLabeling::isShowingAllLabels | ( | ) | const |
Definition at line 4554 of file qgspallabeling.cpp.
| bool QgsPalLabeling::isShowingCandidates | ( | ) | const |
Definition at line 4534 of file qgspallabeling.cpp.
| bool QgsPalLabeling::isShowingPartialsLabels | ( | ) | const |
Definition at line 4564 of file qgspallabeling.cpp.
| bool QgsPalLabeling::isShowingShadowRectangles | ( | ) | const |
Definition at line 4544 of file qgspallabeling.cpp.
|
inline |
Definition at line 995 of file qgspallabeling.h.
|
overridevirtual |
return infos about labels at a given (map) position
Implements QgsLabelingEngineInterface.
Definition at line 4499 of file qgspallabeling.cpp.
|
overridevirtual |
return infos about labels within a given (map) rectangle
Implements QgsLabelingEngineInterface.
Definition at line 4504 of file qgspallabeling.cpp.
|
overridevirtual |
Implements QgsLabelingEngineInterface.
Definition at line 4170 of file qgspallabeling.cpp.
| void QgsPalLabeling::loadEngineSettings | ( | ) |
load/save engine settings to project file
Definition at line 5155 of file qgspallabeling.cpp.
| void QgsPalLabeling::numCandidatePositions | ( | int & | candPoint, |
| int & | candLine, | ||
| int & | candPolygon | ||
| ) |
Definition at line 4514 of file qgspallabeling.cpp.
|
overridevirtual |
adds a diagram layer to the labeling engine
Reimplemented from QgsLabelingEngineInterface.
Definition at line 3936 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 4026 of file qgspallabeling.cpp.
|
overridevirtual |
hook called when drawing layer before issuing select()
Implements QgsLabelingEngineInterface.
Definition at line 3908 of file qgspallabeling.cpp.
|
overridevirtual |
called for every diagram feature
Reimplemented from QgsLabelingEngineInterface.
Definition at line 4146 of file qgspallabeling.cpp.
|
overridevirtual |
Register a feature for labelling.
| layerID | string identifying layer associated with label |
| feat | feature to label |
| context | render context. The QgsExpressionContext contained within the render context must have already had the feature and fields sets prior to calling this method. |
Implements QgsLabelingEngineInterface.
Definition at line 3960 of file qgspallabeling.cpp.
| void QgsPalLabeling::saveEngineSettings | ( | ) |
Definition at line 5160 of file qgspallabeling.cpp.
| QgsPalLabeling::Search QgsPalLabeling::searchMethod | ( | ) | const |
Definition at line 4529 of file qgspallabeling.cpp.
| void QgsPalLabeling::setDrawingOutlineLabels | ( | bool | outline | ) |
Definition at line 4579 of file qgspallabeling.cpp.
| void QgsPalLabeling::setDrawLabelRectOnly | ( | bool | drawRect | ) |
Sets whether the engine should only draw the outline rectangles of labels, not the label contents themselves.
Used for debugging and testing purposes.
| drawRect | set to true to enable rect drawing only |
Definition at line 4589 of file qgspallabeling.cpp.
| void QgsPalLabeling::setNumCandidatePositions | ( | int | candPoint, |
| int | candLine, | ||
| int | candPolygon | ||
| ) |
Definition at line 4519 of file qgspallabeling.cpp.
| void QgsPalLabeling::setSearchMethod | ( | QgsPalLabeling::Search | s | ) |
Definition at line 4524 of file qgspallabeling.cpp.
| void QgsPalLabeling::setShowingAllLabels | ( | bool | showing | ) |
Definition at line 4559 of file qgspallabeling.cpp.
| void QgsPalLabeling::setShowingCandidates | ( | bool | showing | ) |
Definition at line 4539 of file qgspallabeling.cpp.
| void QgsPalLabeling::setShowingPartialsLabels | ( | bool | showing | ) |
Definition at line 4569 of file qgspallabeling.cpp.
| void QgsPalLabeling::setShowingShadowRectangles | ( | bool | showing | ) |
Definition at line 4549 of file qgspallabeling.cpp.
|
inline |
Definition at line 997 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 4012 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 3993 of file qgspallabeling.cpp.
|
static |
called to find out whether the layer is used for labeling
Definition at line 3885 of file qgspallabeling.cpp.
|
static |
Definition at line 3876 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 4509 of file qgspallabeling.cpp.
|
overridevirtual |
called to find out whether the layer is used for labeling
Implements QgsLabelingEngineInterface.
Definition at line 3871 of file qgspallabeling.cpp.
|
friend |
Definition at line 1059 of file qgspallabeling.h.
|
friend |
Definition at line 1084 of file qgspallabeling.h.
|
friend |
Definition at line 1058 of file qgspallabeling.h.
|
protected |
Definition at line 1082 of file qgspallabeling.h.
|
protected |
hashtable of diagram providers (key = layer ID)
Definition at line 1075 of file qgspallabeling.h.
|
protected |
New labeling engine to interface with PAL.
Definition at line 1079 of file qgspallabeling.h.
|
protected |
Definition at line 1076 of file qgspallabeling.h.
|
protected |
hashtable of label providers, being filled during labeling (key = layer ID)
Definition at line 1073 of file qgspallabeling.h.
1.8.13