QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
22 , mGeometry( std::move( geometry ) )
29 if ( mPermissibleZoneGeosPrepared )
31 mPermissibleZoneGeosPrepared.reset();
32 mPermissibleZoneGeos.reset();
40 if ( mPermissibleZoneGeosPrepared )
42 mPermissibleZoneGeosPrepared.reset();
43 mPermissibleZoneGeos.reset();
44 mPermissibleZoneGeosPrepared =
nullptr;
51 if ( !mPermissibleZoneGeos )
73 return mAnchorPosition;
105 if ( mLineAnchorPercent < 0.25 )
107 else if ( mLineAnchorPercent > 0.75 )
114 return mAnchorTextPoint;
120 return mObstacleSettings;
125 mObstacleSettings = settings;
130 return mOriginalFeatureCrs;
@ StartOfText
Anchor using start of text.
double mOverrunSmoothDistance
Distance to smooth angle of line start and end when calculating overruns.
QgsLabelLineSettings::AnchorTextPoint lineAnchorTextPoint() const
Returns the line anchor text point, which dictates which part of the label text should be placed at t...
Contains settings related to how the label engine treats features as obstacles.
double mOverrunDistance
Distance to allow label to overrun linear features.
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
QgsGeometry mPermissibleZone
Optional geometry to use for label's permissible zone.
const QgsLabelObstacleSettings & obstacleSettings() const
Returns the label's obstacle settings.
static geos::unique_ptr asGeos(const QgsGeometry &geometry, double precision=0)
Returns a geos geometry - caller takes ownership of the object (should be deleted with GEOSGeom_destr...
QSizeF mSize
Width and height of the label.
@ EndOfText
Anchor using end of text.
double overrunDistance() const
Returns the permissible distance (in map units) which labels are allowed to overrun the start or end ...
void setOverrunDistance(double distance)
Sets the permissible distance (in map units) which labels are allowed to overrun the start or end of ...
void setObstacleSettings(const QgsLabelObstacleSettings &settings)
Sets the label's obstacle settings.
@ CenterOfText
Anchor using center of text.
void setOverrunSmoothDistance(double distance)
Sets the distance (in map units) with which the ends of linear features are averaged over when calcul...
void setAnchorPosition(const QgsPointXY &anchorPosition)
In case of quadrand or aligned positioning, this is set to the anchor point.
QgsFeature feature() const
Returns the original feature associated with this label.
AnchorTextPoint
Anchor point of label text.
This class represents a coordinate reference system (CRS).
static GEOSContextHandle_t getGEOSHandler()
QgsLabelFeature(QgsFeatureId id, geos::unique_ptr geometry, QSizeF size)
Create label feature, takes ownership of the geometry instance.
void setPermissibleZone(const QgsGeometry &geometry)
Sets the label's permissible zone geometry.
A class to represent a 2D point.
QSizeF size(double angle=0.0) const
Size of the label (in map units)
GEOSGeometry * geometry() const
Gets access to the associated geometry.
A geometry is the spatial representation of a feature.
QgsCoordinateReferenceSystem originalFeatureCrs() const
Returns the original layer CRS of the feature associated with the label.
double overrunSmoothDistance() const
Returns the distance (in map units) with which the ends of linear features are averaged over when cal...
QgsPointXY anchorPosition() const
In case of quadrand or aligned positioning, this is set to the anchor point.
virtual ~QgsLabelFeature()
Clean up geometry and curved label info (if present)
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
void setOriginalFeatureCrs(const QgsCoordinateReferenceSystem &crs)
Sets the original layer crs of the feature associated with the label.
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
QSizeF mRotatedSize
Width and height of the label when rotated between 45 to 135 and 235 to 315 degrees;.
void setFeature(const QgsFeature &feature)
Sets the original feature associated with this label.
@ FollowPlacement
Automatically set the anchor point based on the lineAnchorPercent() value. Values <25% will use the s...
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features