QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
|
The QgsAbstractLabelProvider class is an interface class. More...
#include <qgslabelingenginev2.h>
Public Types | |
enum | Flag { DrawLabels = 1 << 1, DrawAllLabels = 1 << 2, MergeConnectedLines = 1 << 3, CentroidMustBeInside = 1 << 4, LabelPerFeaturePart = 1 << 6 } |
Public Member Functions | |
QgsAbstractLabelProvider (const QString &layerId=QString(), const QString &providerId=QString()) | |
Construct the provider with default values. More... | |
virtual | ~QgsAbstractLabelProvider () |
Vritual destructor. More... | |
virtual void | drawLabel (QgsRenderContext &context, pal::LabelPosition *label) const =0 |
draw this label at the position determined by the labeling engine More... | |
Flags | flags () const |
Flags associated with the provider. More... | |
virtual QList< QgsLabelFeature * > | labelFeatures (QgsRenderContext &context)=0 |
Return list of label features (they are owned by the provider and thus deleted on its destruction) More... | |
QString | layerId () const |
Returns ID of associated layer, or empty string if no layer is associated with the provider. More... | |
unsigned int | linePlacementFlags () const |
For layers with linestring geometries - extra placement flags (or-ed combination of QgsPalLayerSettings::LinePlacementFlags) More... | |
QString | name () const |
Name of the layer (for statistics, debugging etc.) - does not need to be unique. More... | |
QgsPalLayerSettings::ObstacleType | obstacleType () const |
How the feature geometries will work as obstacles. More... | |
QgsPalLayerSettings::Placement | placement () const |
What placement strategy to use for the labels. More... | |
double | priority () const |
Default priority of labels (may be overridden by individual labels) More... | |
QString | providerId () const |
Returns provider ID - useful in case there is more than one label provider within a layer (e.g. More... | |
void | setEngine (const QgsLabelingEngineV2 *engine) |
Associate provider with a labeling engine (should be only called internally from QgsLabelingEngineV2) More... | |
virtual QList< QgsAbstractLabelProvider * > | subProviders () |
Return list of child providers - useful if the provider needs to put labels into more layers with different configuration. More... | |
QgsPalLayerSettings::UpsideDownLabels | upsidedownLabels () const |
How to handle labels that would be upside down. More... | |
Protected Attributes | |
const QgsLabelingEngineV2 * | mEngine |
Associated labeling engine. More... | |
Flags | mFlags |
Flags altering drawing and registration of features. More... | |
QString | mLayerId |
Associated layer's ID, if applicable. More... | |
unsigned int | mLinePlacementFlags |
Extra placement flags for linestring geometries. More... | |
QString | mName |
Name of the layer. More... | |
QgsPalLayerSettings::ObstacleType | mObstacleType |
Type of the obstacle of feature geometries. More... | |
QgsPalLayerSettings::Placement | mPlacement |
Placement strategy. More... | |
double | mPriority |
Default priority of labels. More... | |
QString | mProviderId |
Associated provider ID (one layer may have multiple providers, e.g. in rule-based labeling) More... | |
QgsPalLayerSettings::UpsideDownLabels | mUpsidedownLabels |
How to handle labels that would be upside down. More... | |
The QgsAbstractLabelProvider class is an interface class.
Implementations return list of labels and their associated geometries - these are used by QgsLabelingEngineV2 to compute the final layout of labels.
Implementations also take care of drawing the returned final label positions.
Definition at line 42 of file qgslabelingenginev2.h.
Definition at line 54 of file qgslabelingenginev2.h.
QgsAbstractLabelProvider::QgsAbstractLabelProvider | ( | const QString & | layerId = QString() , |
const QString & | providerId = QString() |
||
) |
Construct the provider with default values.
Definition at line 384 of file qgslabelingenginev2.cpp.
|
inlinevirtual |
Vritual destructor.
Definition at line 49 of file qgslabelingenginev2.h.
|
pure virtual |
draw this label at the position determined by the labeling engine
Implemented in QgsDxfRuleBasedLabelProvider, QgsVectorLayerDiagramProvider, QgsVectorLayerLabelProvider, and QgsDxfLabelProvider.
|
inline |
Flags associated with the provider.
Definition at line 85 of file qgslabelingenginev2.h.
|
pure virtual |
Return list of label features (they are owned by the provider and thus deleted on its destruction)
Implemented in QgsVectorLayerDiagramProvider, and QgsVectorLayerLabelProvider.
|
inline |
Returns ID of associated layer, or empty string if no layer is associated with the provider.
Definition at line 77 of file qgslabelingenginev2.h.
|
inline |
For layers with linestring geometries - extra placement flags (or-ed combination of QgsPalLayerSettings::LinePlacementFlags)
Definition at line 91 of file qgslabelingenginev2.h.
|
inline |
Name of the layer (for statistics, debugging etc.) - does not need to be unique.
Definition at line 74 of file qgslabelingenginev2.h.
|
inline |
How the feature geometries will work as obstacles.
Definition at line 97 of file qgslabelingenginev2.h.
|
inline |
What placement strategy to use for the labels.
Definition at line 88 of file qgslabelingenginev2.h.
|
inline |
Default priority of labels (may be overridden by individual labels)
Definition at line 94 of file qgslabelingenginev2.h.
|
inline |
Returns provider ID - useful in case there is more than one label provider within a layer (e.g.
in case of rule-based labeling - provider ID = rule's key). May be empty string if layer ID is sufficient for identification of provider's configuration.
Definition at line 82 of file qgslabelingenginev2.h.
|
inline |
Associate provider with a labeling engine (should be only called internally from QgsLabelingEngineV2)
Definition at line 52 of file qgslabelingenginev2.h.
|
inlinevirtual |
Return list of child providers - useful if the provider needs to put labels into more layers with different configuration.
Reimplemented in QgsRuleBasedLabelProvider.
Definition at line 71 of file qgslabelingenginev2.h.
|
inline |
How to handle labels that would be upside down.
Definition at line 100 of file qgslabelingenginev2.h.
|
protected |
Associated labeling engine.
Definition at line 104 of file qgslabelingenginev2.h.
|
protected |
Flags altering drawing and registration of features.
Definition at line 113 of file qgslabelingenginev2.h.
|
protected |
Associated layer's ID, if applicable.
Definition at line 109 of file qgslabelingenginev2.h.
|
protected |
Extra placement flags for linestring geometries.
Definition at line 117 of file qgslabelingenginev2.h.
|
protected |
Name of the layer.
Definition at line 107 of file qgslabelingenginev2.h.
|
protected |
Type of the obstacle of feature geometries.
Definition at line 121 of file qgslabelingenginev2.h.
|
protected |
Placement strategy.
Definition at line 115 of file qgslabelingenginev2.h.
|
protected |
Default priority of labels.
Definition at line 119 of file qgslabelingenginev2.h.
|
protected |
Associated provider ID (one layer may have multiple providers, e.g. in rule-based labeling)
Definition at line 111 of file qgslabelingenginev2.h.
|
protected |
How to handle labels that would be upside down.
Definition at line 123 of file qgslabelingenginev2.h.