15 #ifndef QGSLABELFEATURE_H 16 #define QGSLABELFEATURE_H 20 #include "qgis_core.h" 67 GEOSGeometry *
geometry()
const {
return mGeometry.get(); }
96 void setPermissibleZone(
const QgsGeometry &geometry );
117 QSizeF
size()
const {
return mSize; }
177 double zIndex()
const {
return mZIndex; }
288 void setPredefinedPositionOrder(
const QVector< QgsPalLayerSettings::PredefinedPointPosition > &order ) { mPredefinedPositionOrder = order; }
429 pal::LineArrangementFlags mArrangementFlags =
nullptr;
441 #endif // QGSLABELFEATURE_H QgsPointXY positionOffset() const
Applies only to "offset from point" placement strategy.
pal::Layer * layer() const
Gets PAL layer of the label feature. Should be only used internally in PAL.
void setSymbolSize(QSizeF size)
Sets the size of the rendered symbol associated with this feature.
QgsPointXY mFixedPosition
fixed position for the label (instead of automatic placement)
double repeatDistance() const
Applies only to linestring features - after what distance (in map units) the labels should be repeate...
void setVisualMargin(const QgsMargins &margin)
Sets the visual margin for the label feature.
bool alwaysShow() const
Whether label should be always shown (sets very high label priority)
std::unique_ptr< const GEOSPreparedGeometry, GeosDeleter > prepared_unique_ptr
Scoped GEOS prepared geometry pointer.
A set of features which influence the labeling process.
A class to represent a 2D point.
QString mLabelText
text of the label
const GEOSPreparedGeometry * permissibleZonePrepared() const
Returns a GEOS prepared geometry representing the label's permissibleZone().
QgsMargins mVisualMargin
Visual margin of label contents.
bool mIsObstacle
whether the feature geometry acts as an obstacle for labels
void setObstacleFactor(double factor)
Sets the obstacle factor for the feature.
QPointF quadOffset() const
Applies to "offset from point" placement strategy and "around point" (in case hasFixedQuadrant() retu...
A geometry is the spatial representation of a feature.
void setCurvedLabelInfo(pal::LabelInfo *info)
takes ownership of the instance
bool mHasFixedQuadrant
whether mQuadOffset should be respected (only for "around point" placement)
double priority() const
Returns the feature's labeling priority.
double mRepeatDistance
distance after which label should be repeated (only for linestrings)
double mObstacleFactor
how strong is the geometry acting as obstacle
QgsFeatureId mId
Associated ID unique within the parent label provider.
void setAlwaysShow(bool enabled)
Sets whether label should be always shown (sets very high label priority)
void setLabelText(const QString &text)
Sets text of the label.
bool mHasFixedPosition
whether mFixedPosition should be respected
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)
bool isObstacle() const
Returns whether the feature will act as an obstacle for labels.
QgsPalLayerSettings::OffsetType offsetType() const
Returns the offset type, which determines how offsets and distance to label behaves.
void setHasFixedPosition(bool enabled)
Sets whether the label should use a fixed position instead of being automatically placed...
GEOSGeometry * geometry() const
Gets access to the associated geometry.
pal::LabelInfo * curvedLabelInfo() const
Gets additional infor required for curved label placement. Returns null if not set.
QSizeF size() const
Size of the label (in map units)
void setPositionOffset(const QgsPointXY &offset)
Applies only to "offset from point" placement strategy.
QSizeF mSize
Width and height of the label.
bool hasFixedPosition() const
Whether the label should use a fixed position instead of being automatically placed.
geos::unique_ptr mObstacleGeometry
Optional geometry to use for label obstacles, if different to mGeometry.
double mFixedAngle
fixed rotation for the label (instead of automatic choice)
QgsGeometry permissibleZone() const
Returns the label's permissible zone geometry.
void setIsObstacle(bool enabled)
Sets whether the feature will act as an obstacle for labels.
void setZIndex(double zIndex)
Sets the label's z-index.
const QSizeF & symbolSize() const
Returns the size of the rendered symbol associated with this feature, if applicable.
QSizeF mSymbolSize
Size of associated rendered symbol, if applicable.
GEOSGeometry * obstacleGeometry() const
Returns the label's obstacle geometry, if different to the feature geometry.
QVector< QgsPalLayerSettings::PredefinedPointPosition > mPredefinedPositionOrder
Ordered list of predefined positions for label (only for OrderedPositionsAroundPoint placement) ...
void setLayer(pal::Layer *layer)
Assign PAL layer to the label feature. Should be only used internally in PAL.
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
bool hasFixedQuadrant() const
Returns whether the quadrant for the label is fixed.
Optional additional info about label (for curved labels)
void setFixedAngle(double angle)
Sets angle in degrees of the fixed angle (relevant only if hasFixedAngle() returns true) ...
OffsetType
Behavior modifier for label offset and distance, only applies in some label placement modes...
void setPredefinedPositionOrder(const QVector< QgsPalLayerSettings::PredefinedPointPosition > &order)
Sets the priority ordered list of predefined positions for label candidates.
void setOffsetType(QgsPalLayerSettings::OffsetType type)
Sets the offset type, which determines how offsets and distance to label behaves. ...
void setDistLabel(double dist)
Applies to "around point" placement strategy or linestring features.
bool mAlwaysShow
whether to always show label - even in case of collisions
The QgsAbstractLabelProvider class is an interface class.
QgsPointXY mPositionOffset
offset of label from the feature (only for "offset from point" placement)
const QgsMargins & visualMargin() const
Returns the visual margin for the label feature.
void setFixedPosition(const QgsPointXY &point)
Sets coordinates of the fixed position (relevant only if hasFixedPosition() returns true) ...
bool mHasFixedAngle
whether mFixedAngle should be respected
QgsPointXY fixedPosition() const
Coordinates of the fixed position (relevant only if hasFixedPosition() returns true) ...
double zIndex() const
Returns the label's z-index.
Contains information about the context of a rendering operation.
double obstacleFactor() const
Returns the obstacle factor for the feature.
geos::unique_ptr mGeometry
Geometry of the feature to be labelled.
The QgsLabelFeature class describes a feature that should be used within the labeling engine...
double mPriority
Priority of the label.
QVector< QgsPalLayerSettings::PredefinedPointPosition > predefinedPositionOrder() const
Returns the priority ordered list of predefined positions for label candidates.
void setHasFixedAngle(bool enabled)
Sets whether the label should use a fixed angle instead of using angle from automatic placement...
void setRepeatDistance(double dist)
Applies only to linestring features - set after what distance (in map units) the labels should be rep...
double distLabel() const
Applies to "around point" placement strategy or linestring features.
void setHasFixedQuadrant(bool enabled)
Sets whether the quadrant for the label must be respected.
bool hasFixedAngle() const
Whether the label should use a fixed angle instead of using angle from automatic placement.
QgsGeometry mPermissibleZone
Optional geometry to use for label's permissible zone.
double mDistLabel
distance of label from the feature (only for "around point" placement or linestrings) ...
double mZIndex
Z-index of label (higher z-index labels are rendered on top of lower z-index labels) ...
void setArrangementFlags(pal::LineArrangementFlags flags)
Sets the feature's arrangement flags.
QString labelText() const
Text of the label.
double fixedAngle() const
Angle in degrees of the fixed angle (relevant only if hasFixedAngle() returns true) ...
QgsPalLayerSettings::OffsetType mOffsetType
Offset type for certain placement modes.
The QgsMargins class defines the four margins of a rectangle.
void setQuadOffset(QPointF quadOffset)
Set which side of the point to use.
void setPriority(double priority)
Sets the priority for labeling the feature.
QgsFeatureId id() const
Identifier of the label (unique within the parent label provider)
pal::LineArrangementFlags arrangementFlags() const
Returns the feature's arrangement flags.
QPointF mQuadOffset
whether the side of the label is fixed (only for "around point" placement)