QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
36 #include "qgis_core.h"
42 #include <QLinkedList>
101 const int size = mHashtable.size();
103 return static_cast< std::size_t
>( mPal->globalCandidatesLimitPoint() > 0 ? std::min( mPal->globalCandidatesLimitPoint(), 4 ) : 4 );
104 else if ( size > 500 )
105 return static_cast< std::size_t
>( mPal->globalCandidatesLimitPoint() > 0 ? std::min( mPal->globalCandidatesLimitPoint(), 6 ) : 6 );
106 else if ( size > 200 )
107 return static_cast< std::size_t
>( mPal->globalCandidatesLimitPoint() > 0 ? std::min( mPal->globalCandidatesLimitPoint(), 8 ) : 8 );
108 else if ( size > 100 )
109 return static_cast< std::size_t
>( mPal->globalCandidatesLimitPoint() > 0 ? std::min( mPal->globalCandidatesLimitPoint(), 12 ) : 12 );
111 return static_cast< std::size_t
>( std::max( mPal->globalCandidatesLimitPoint(), 0 ) );
122 const int size = mHashtable.size();
124 return static_cast< std::size_t
>( mPal->globalCandidatesLimitLine() > 0 ? std::min( mPal->globalCandidatesLimitLine(), 5 ) : 5 );
125 else if ( size > 500 )
126 return static_cast< std::size_t
>( mPal->globalCandidatesLimitLine() > 0 ? std::min( mPal->globalCandidatesLimitLine(), 10 ) : 10 );
127 else if ( size > 200 )
128 return static_cast< std::size_t
>( mPal->globalCandidatesLimitLine() > 0 ? std::min( mPal->globalCandidatesLimitLine(), 20 ) : 20 );
129 else if ( size > 100 )
130 return static_cast< std::size_t
>( mPal->globalCandidatesLimitLine() > 0 ? std::min( mPal->globalCandidatesLimitLine(), 40 ) : 40 );
132 return static_cast< std::size_t
>( std::max( mPal->globalCandidatesLimitLine(), 0 ) );
143 const int size = mHashtable.size();
145 return static_cast< std::size_t
>( mPal->globalCandidatesLimitPolygon() > 0 ? std::min( mPal->globalCandidatesLimitPolygon(), 5 ) : 5 );
146 else if ( size > 500 )
147 return static_cast< std::size_t
>( mPal->globalCandidatesLimitPolygon() > 0 ? std::min( mPal->globalCandidatesLimitPolygon(), 15 ) : 15 );
148 else if ( size > 200 )
149 return static_cast< std::size_t
>( mPal->globalCandidatesLimitPolygon() > 0 ? std::min( mPal->globalCandidatesLimitPolygon(), 20 ) : 20 );
150 else if ( size > 100 )
151 return static_cast< std::size_t
>( mPal->globalCandidatesLimitPolygon() > 0 ? std::min( mPal->globalCandidatesLimitPolygon(), 25 ) : 25 );
153 return static_cast< std::size_t
>( std::max( mPal->globalCandidatesLimitPolygon(), 0 ) );
162 QString
name()
const {
return mName; }
236 void setPriority(
double priority );
243 double priority()
const {
return mDefaultPriority; }
299 void joinConnectedFeatures();
309 void chopFeaturesAtRepeatDistance();
330 bool mCentroidInside =
false;
335 bool mMergeLines =
false;
348 void addFeaturePart( std::unique_ptr< FeaturePart > fpart,
const QString &labelText = QString() );
std::size_t maximumPointLabelCandidates() const
Returns the maximum number of point label candidates to generate for features in this layer.
QList< FeaturePart * > mObstacleParts
List of obstacle parts.
bool isCurved() const
Returns true if the layer has curved labels.
void setArrangement(Qgis::LabelPlacement arrangement)
Sets the layer's arrangement policy.
void setCentroidInside(bool forceInside)
Sets whether labels placed at the centroid of features within the layer are forced to be placed insid...
UpsideDownLabelHandling
Handling techniques for upside down labels.
bool centroidInside() const
Returns whether labels placed at the centroid of features within the layer are forced to be placed in...
LabelPosition is a candidate feature label position.
QgsAbstractLabelProvider * provider() const
Returns pointer to the associated provider.
std::vector< geos::unique_ptr > mGeosObstacleGeometries
QHash< QgsFeatureId, QgsLabelFeature * > mHashtable
Lookup table of label features (owned by the label feature provider that created them)
bool mergeConnectedLines() const
Returns whether connected lines will be merged before labeling.
bool active() const
Returns whether the layer is currently active.
Representation of a labeling problem.
int featureCount()
Returns the number of features in layer.
QgsAbstractLabelProvider * mProvider
QString name() const
Returns the layer's name.
The QgsAbstractLabelProvider class is an interface class. Implementations return list of labels and t...
Qgis::LabelPlacement mArrangement
Optional flags used for some placement methods.
double priority() const
Returns the layer's priority, between 0 and 1.
QHash< QString, QVector< FeaturePart * > > mConnectedHashtable
QHash< QgsFeatureId, int > mConnectedFeaturesIds
void setMergeConnectedLines(bool merge)
Sets whether connected lines should be merged before labeling.
Qgis::UpsideDownLabelHandling upsidedownLabels() const
Returns how upside down labels are handled within the layer.
void setUpsidedownLabels(Qgis::UpsideDownLabelHandling ud)
Sets how upside down labels will be handled within the layer.
Qgis::LabelPlacement arrangement() const
Returns the layer's arrangement policy.
Main class to handle feature.
std::size_t maximumLineLabelCandidates() const
Returns the maximum number of line label candidates to generate for features in this layer.
std::deque< std::unique_ptr< FeaturePart > > mFeatureParts
List of feature parts.
void setObstacleType(QgsLabelObstacleSettings::ObstacleType obstacleType)
Sets the obstacle type, which controls how features within the layer act as obstacles for labels.
bool labelLayer() const
Returns whether the layer will be labeled or not.
A set of features which influence the labeling process.
@ PerimeterCurved
Arranges candidates following the curvature of a polygon's boundary. Applies to polygon layers only.
ObstacleType
Valid obstacle types, which affect how features within the layer will act as obstacles for labels.
The QgsLabelFeature class describes a feature that should be used within the labeling engine....
void setActive(bool active)
Sets whether the layer is currently active.
std::size_t maximumPolygonLabelCandidates() const
Returns the maximum number of polygon label candidates to generate for features in this layer.
QgsLabelObstacleSettings::ObstacleType obstacleType() const
Returns the obstacle type, which controls how features within the layer act as obstacles for labels.
void setLabelLayer(bool toLabel)
Sets whether the layer will be labeled.
LabelPlacement
Placement modes which determine how label candidates are generated for a feature.
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features
@ Curved
Arranges candidates following the curvature of a line feature. Applies to line layers only.