22 , mGeometry( std::move( geometry ) )
29 if ( mPermissibleZoneGeosPrepared )
31 mPermissibleZoneGeosPrepared.reset();
32 mPermissibleZoneGeos.reset();
42 if ( mPermissibleZoneGeosPrepared )
44 mPermissibleZoneGeosPrepared.reset();
45 mPermissibleZoneGeos.reset();
46 mPermissibleZoneGeosPrepared =
nullptr;
53 if ( !mPermissibleZoneGeos )
70 return ( angle >= 0.785398 && angle <= 2.35619 ) || ( angle >= 3.92699 && angle <= 5.49779 ) ?
mRotatedSize :
mSize;
75 return mAnchorPosition;
105 return mObstacleSettings;
110 mObstacleSettings = settings;
double mOverrunSmoothDistance
Distance to smooth angle of line start and end when calculating overruns.
void setOverrunDistance(double distance)
Sets the permissible distance (in map units) which labels are allowed to overrun the start or end of ...
double mOverrunDistance
Distance to allow label to overrun linear features.
virtual ~QgsLabelFeature()
Clean up geometry and curved label info (if present)
A class to represent a 2D point.
pal::LabelInfo * mInfo
extra information for curved labels (may be nullptr)
GEOSGeometry * geometry() const
Gets access to the associated geometry.
A geometry is the spatial representation of a feature.
QgsFeature feature() const
Returns the original feature associated with this label.
QgsPointXY anchorPosition() const
In case of quadrand or aligned positioning, this is set to the anchor point.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
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)
Contains settings related to how the label engine treats features as obstacles.
static GEOSContextHandle_t getGEOSHandler()
QSizeF mSize
Width and height of the label.
void setPermissibleZone(const QgsGeometry &geometry)
Sets the label's permissible zone geometry.
QSizeF mRotatedSize
Width and height of the label when rotated between 45 to 135 and 235 to 315 degrees;.
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
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.
QgsLabelFeature(QgsFeatureId id, geos::unique_ptr geometry, QSizeF size)
Create label feature, takes ownership of the geometry instance.
const QgsLabelObstacleSettings & obstacleSettings() const
Returns the label's obstacle settings.
void setFeature(const QgsFeature &feature)
Sets the original feature associated with this label.
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...
void setObstacleSettings(const QgsLabelObstacleSettings &settings)
Sets the label's obstacle settings.
QSizeF size(double angle=0.0) const
Size of the label (in map units)
double overrunSmoothDistance() const
Returns the distance (in map units) with which the ends of linear features are averaged over when cal...
QgsGeometry mPermissibleZone
Optional geometry to use for label's permissible zone.
double overrunDistance() const
Returns the permissible distance (in map units) which labels are allowed to overrun the start or end ...