104 return static_cast< std::size_t
>(
mPal->globalCandidatesLimitPoint() > 0 ? std::min(
mPal->globalCandidatesLimitPoint(), 4 ) : 4 );
105 else if ( size > 500 )
106 return static_cast< std::size_t
>(
mPal->globalCandidatesLimitPoint() > 0 ? std::min(
mPal->globalCandidatesLimitPoint(), 6 ) : 6 );
107 else if ( size > 200 )
108 return static_cast< std::size_t
>(
mPal->globalCandidatesLimitPoint() > 0 ? std::min(
mPal->globalCandidatesLimitPoint(), 8 ) : 8 );
109 else if ( size > 100 )
110 return static_cast< std::size_t
>(
mPal->globalCandidatesLimitPoint() > 0 ? std::min(
mPal->globalCandidatesLimitPoint(), 12 ) : 12 );
112 return static_cast< std::size_t
>( std::max(
mPal->globalCandidatesLimitPoint(), 0 ) );
125 return static_cast< std::size_t
>(
mPal->globalCandidatesLimitLine() > 0 ? std::min(
mPal->globalCandidatesLimitLine(), 5 ) : 5 );
126 else if ( size > 500 )
127 return static_cast< std::size_t
>(
mPal->globalCandidatesLimitLine() > 0 ? std::min(
mPal->globalCandidatesLimitLine(), 10 ) : 10 );
128 else if ( size > 200 )
129 return static_cast< std::size_t
>(
mPal->globalCandidatesLimitLine() > 0 ? std::min(
mPal->globalCandidatesLimitLine(), 20 ) : 20 );
130 else if ( size > 100 )
131 return static_cast< std::size_t
>(
mPal->globalCandidatesLimitLine() > 0 ? std::min(
mPal->globalCandidatesLimitLine(), 40 ) : 40 );
133 return static_cast< std::size_t
>( std::max(
mPal->globalCandidatesLimitLine(), 0 ) );
146 return static_cast< std::size_t
>(
mPal->globalCandidatesLimitPolygon() > 0 ? std::min(
mPal->globalCandidatesLimitPolygon(), 5 ) : 5 );
147 else if ( size > 500 )
148 return static_cast< std::size_t
>(
mPal->globalCandidatesLimitPolygon() > 0 ? std::min(
mPal->globalCandidatesLimitPolygon(), 15 ) : 15 );
149 else if ( size > 200 )
150 return static_cast< std::size_t
>(
mPal->globalCandidatesLimitPolygon() > 0 ? std::min(
mPal->globalCandidatesLimitPolygon(), 20 ) : 20 );
151 else if ( size > 100 )
152 return static_cast< std::size_t
>(
mPal->globalCandidatesLimitPolygon() > 0 ? std::min(
mPal->globalCandidatesLimitPolygon(), 25 ) : 25 );
154 return static_cast< std::size_t
>( std::max(
mPal->globalCandidatesLimitPolygon(), 0 ) );
237 void setPriority(
double priority );
300 void joinConnectedFeatures();
310 void chopFeaturesAtRepeatDistance();
349 void addFeaturePart( std::unique_ptr< FeaturePart > fpart,
const QString &labelText = QString() );
LabelPlacement
Placement modes which determine how label candidates are generated for a feature.
@ Curved
Arranges candidates following the curvature of a line feature. Applies to line layers only.
@ PerimeterCurved
Arranges candidates following the curvature of a polygon's boundary. Applies to polygon layers only.
UpsideDownLabelHandling
Handling techniques for upside down labels.
@ FlipUpsideDownLabels
Upside-down labels (90 <= angle < 270) are shown upright.
An abstract interface class for label providers.
Describes a feature that should be used within the labeling engine.
ObstacleType
Valid obstacle types, which affect how features within the layer will act as obstacles for labels.
@ PolygonBoundary
Avoid placing labels over boundary of polygon (prefer placing outside or completely inside polygon).
void setUpsidedownLabels(Qgis::UpsideDownLabelHandling ud)
Sets how upside down labels will be handled within the layer.
QHash< QString, QVector< FeaturePart * > > mConnectedHashtable
friend class LabelPosition
std::deque< std::unique_ptr< FeaturePart > > mFeatureParts
List of feature parts.
QList< FeaturePart * > mObstacleParts
List of obstacle parts.
QString name() const
Returns the layer's name.
QgsAbstractLabelProvider * provider() const
Returns pointer to the associated provider.
std::size_t maximumPolygonLabelCandidates() const
Returns the maximum number of polygon label candidates to generate for features in this layer.
bool active() const
Returns whether the layer is currently active.
void setObstacleType(QgsLabelObstacleSettings::ObstacleType obstacleType)
Sets the obstacle type, which controls how features within the layer act as obstacles for labels.
QgsAbstractLabelProvider * mProvider
Qgis::LabelPlacement arrangement() const
Returns the layer's arrangement policy.
void addFeaturePart(std::unique_ptr< FeaturePart > fpart, const QString &labelText=QString())
Add newly created feature part into r tree and to the list.
std::size_t maximumPointLabelCandidates() const
Returns the maximum number of point label candidates to generate for features in this layer.
bool mergeConnectedLines() const
Returns whether connected lines will be merged before labeling.
void setMergeConnectedLines(bool merge)
Sets whether connected lines should be merged before labeling.
void setActive(bool active)
Sets whether the layer is currently active.
Qgis::UpsideDownLabelHandling mUpsidedownLabels
QHash< QgsFeatureId, int > mConnectedFeaturesIds
Layer(QgsAbstractLabelProvider *provider, const QString &name, Qgis::LabelPlacement arrangement, double defaultPriority, bool active, bool toLabel, Pal *pal)
Create a new layer.
Qgis::UpsideDownLabelHandling upsidedownLabels() const
Returns how upside down labels are handled within the layer.
void setArrangement(Qgis::LabelPlacement arrangement)
Sets the layer's arrangement policy.
QHash< QgsFeatureId, QgsLabelFeature * > mHashtable
Lookup table of label features (owned by the label feature provider that created them).
void setLabelLayer(bool toLabel)
Sets whether the layer will be labeled.
std::vector< geos::unique_ptr > mGeosObstacleGeometries
void addObstaclePart(FeaturePart *fpart)
Add newly created obstacle part into r tree and to the list.
Qgis::LabelPlacement mArrangement
Optional flags used for some placement methods.
bool labelLayer() const
Returns whether the layer will be labeled or not.
QgsLabelObstacleSettings::ObstacleType mObstacleType
bool centroidInside() const
Returns whether labels placed at the centroid of features within the layer are forced to be placed in...
bool isCurved() const
Returns true if the layer has curved labels.
void setCentroidInside(bool forceInside)
Sets whether labels placed at the centroid of features within the layer are forced to be placed insid...
int featureCount() const
Returns the number of features in layer.
QgsLabelObstacleSettings::ObstacleType obstacleType() const
Returns the obstacle type, which controls how features within the layer act as obstacles for labels.
double priority() const
Returns the layer's priority, between 0 and 1.
std::size_t maximumLineLabelCandidates() const
Returns the maximum number of line label candidates to generate for features in this layer.
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features