QGIS API Documentation
3.2.0-Bonn (bc43194)
|
A set of features which influence the labeling process. More...
#include <layer.h>
Public Types | |
enum | LabelMode { LabelPerFeature, LabelPerFeaturePart } |
enum | UpsideDownLabels { Upright, ShowDefined, ShowAll } |
Public Member Functions | |
virtual | ~Layer () |
bool | active () const |
Returns whether the layer is currently active. More... | |
QgsPalLayerSettings::Placement | arrangement () const |
Returns the layer's arrangement policy. More... | |
LineArrangementFlags | arrangementFlags () const |
Returns the layer's arrangement flags. More... | |
bool | centroidInside () const |
Returns whether labels placed at the centroid of features within the layer are forced to be placed inside the feature's geometry. More... | |
void | chopFeaturesAtRepeatDistance () |
Chop layer features at the repeat distance *. More... | |
int | connectedFeatureId (QgsFeatureId featureId) const |
Returns the connected feature ID for a label feature ID, which is unique for all features which have been joined as a result of joinConnectedFeatures() More... | |
bool | displayAll () const |
int | featureCount () |
Returns the number of features in layer. More... | |
bool | isCurved () const |
Returns true if the layer has curved labels. More... | |
void | joinConnectedFeatures () |
Join connected features with the same label text. More... | |
bool | labelLayer () const |
Returns whether the layer will be labeled or not. More... | |
LabelMode | labelMode () const |
Returns the layer's labeling mode. More... | |
bool | mergeConnectedLines () const |
Returns whether connected lines will be merged before labeling. More... | |
QString | name () const |
Returns the layer's name. More... | |
QgsPalLayerSettings::ObstacleType | obstacleType () const |
Returns the obstacle type, which controls how features within the layer act as obstacles for labels. More... | |
double | priority () const |
Returns the layer's priority, between 0 and 1. More... | |
QgsAbstractLabelProvider * | provider () const |
Returns pointer to the associated provider. More... | |
bool | registerFeature (QgsLabelFeature *label) |
Register a feature in the layer. More... | |
void | setActive (bool active) |
Sets whether the layer is currently active. More... | |
void | setArrangement (QgsPalLayerSettings::Placement arrangement) |
Sets the layer's arrangement policy. More... | |
void | setArrangementFlags (LineArrangementFlags flags) |
Sets the layer's arrangement flags. More... | |
void | setCentroidInside (bool forceInside) |
Sets whether labels placed at the centroid of features within the layer are forced to be placed inside the feature's geometry. More... | |
void | setLabelLayer (bool toLabel) |
Sets whether the layer will be labeled. More... | |
void | setLabelMode (LabelMode mode) |
Sets the layer's labeling mode. More... | |
void | setMergeConnectedLines (bool merge) |
Sets whether connected lines should be merged before labeling. More... | |
void | setObstacleType (QgsPalLayerSettings::ObstacleType obstacleType) |
Sets the obstacle type, which controls how features within the layer act as obstacles for labels. More... | |
void | setPriority (double priority) |
Sets the layer's priority. More... | |
void | setUpsidedownLabels (UpsideDownLabels ud) |
Sets how upside down labels will be handled within the layer. More... | |
UpsideDownLabels | upsidedownLabels () const |
Returns how upside down labels are handled within the layer. More... | |
Protected Member Functions | |
Layer (QgsAbstractLabelProvider *provider, const QString &name, QgsPalLayerSettings::Placement arrangement, double defaultPriority, bool active, bool toLabel, Pal *pal, bool displayAll=false) | |
Create a new layer. More... | |
void | addFeaturePart (FeaturePart *fpart, const QString &labelText=QString()) |
Add newly created feature part into r tree and to the list. More... | |
void | addObstaclePart (FeaturePart *fpart) |
Add newly created obstacle part into r tree and to the list. More... | |
Friends | |
class | FeaturePart |
class | LabelPosition |
class | Pal |
class | Problem |
A set of features which influence the labeling process.
|
protected |
Create a new layer.
provider | Associated provider |
name | Name of the layer (for stats, debugging - does not need to be unique) |
arrangement | Arrangement mode : how to place candidates |
defaultPriority | layer's prioriry (0 is the best, 1 the worst) |
active | is the layer is active (currently displayed) |
toLabel | the layer will be labeled whether toLablel is true |
pal | pointer to the pal object |
displayAll | if true, all features will be labelled even though overlaps occur |
|
inline |
|
protected |
|
protected |
|
inline |
Returns the layer's arrangement policy.
|
inline |
Returns the layer's arrangement flags.
|
inline |
Returns whether labels placed at the centroid of features within the layer are forced to be placed inside the feature's geometry.
void Layer::chopFeaturesAtRepeatDistance | ( | ) |
int Layer::connectedFeatureId | ( | QgsFeatureId | featureId | ) | const |
Returns the connected feature ID for a label feature ID, which is unique for all features which have been joined as a result of joinConnectedFeatures()
|
inline |
|
inline |
void Layer::joinConnectedFeatures | ( | ) |
|
inline |
Returns whether the layer will be labeled or not.
|
inline |
|
inline |
Returns whether connected lines will be merged before labeling.
|
inline |
|
inline |
Returns the obstacle type, which controls how features within the layer act as obstacles for labels.
|
inline |
Returns the layer's priority, between 0 and 1.
0 corresponds to highest priority, 1 to lowest priority.
|
inline |
bool Layer::registerFeature | ( | QgsLabelFeature * | label | ) |
Register a feature in the layer.
Does not take ownership of the label feature (it is owned by its provider).
PalException::FeatureExists |
|
inline |
Sets whether the layer is currently active.
Active means "is currently displayed or used as obstacles". When a layer is deactivated then feature of this layer will not be used for either labeling or as obstacles.
active | set to true to make the layer active, or false to deactivate the layer |
|
inline |
|
inline |
|
inline |
Sets whether labels placed at the centroid of features within the layer are forced to be placed inside the feature's geometry.
forceInside | set to true to force centroid labels to be within the feature. If set to false then the centroid may fall outside the feature. |
|
inline |
Sets whether the layer will be labeled.
toLabel | set to false disable labeling this layer |
|
inline |
|
inline |
Sets whether connected lines should be merged before labeling.
merge | set to true to merge connected lines |
|
inline |
Sets the obstacle type, which controls how features within the layer act as obstacles for labels.
obstacleType | new obstacle type |
void Layer::setPriority | ( | double | priority | ) |
|
inline |
Sets how upside down labels will be handled within the layer.
ud | upside down label handling mode |
|
inline |
Returns how upside down labels are handled within the layer.
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |