Class: QgsCurvedLineCallout¶
- class qgis.core.QgsCurvedLineCallout¶
Bases:
QgsSimpleLineCallout
Draws curved lines as callouts.
New in version 3.20:
Methods
Returns the anchor point geometry for a label with the given bounding box and
anchor
point mode.Calculates the direct line from a label geometry to an anchor geometry part, respecting the various callout settings which influence how the callout end should be placed in the anchor geometry.
- rtype:
QgsCurvedLineCallout
Creates a new
QgsCurvedLineCallout
, using the settings serialized in theproperties
map (corresponding to the output fromQgsCurvedLineCallout.properties()
).- param start:
Returns the callout line's curvature.
Returns the anchor point geometry for a label with the given bounding box and
anchor
point mode.Returns the callout line's curve orientation.
- param context:
Sets the callout line's
curvature
.Sets the callout line's curve
orientation
.- rtype:
str
Attributes
- Automatic = 0¶
- Clockwise = 1¶
- CounterClockwise = 2¶
- class Orientation¶
Bases:
int
- calloutLabelPoint(self, bodyBoundingBox: QRectF, angle: float, anchor: QgsCallout.LabelAnchorPoint, context: QgsRenderContext, calloutContext: QgsCallout.QgsCalloutContext) Tuple[QgsGeometry, bool] ¶
Returns the anchor point geometry for a label with the given bounding box and
anchor
point mode.The
pinned
argument will be set toTrue
if the callout label point is pinned (manually placed).New in version 3.20.
- calloutLineToPart(self, labelGeometry: QgsGeometry, partGeometry: QgsAbstractGeometry, context: QgsRenderContext, calloutContext: QgsCallout.QgsCalloutContext) Tuple[QgsGeometry, bool] ¶
Calculates the direct line from a label geometry to an anchor geometry part, respecting the various callout settings which influence how the callout end should be placed in the anchor geometry.
Returns a null geometry if the callout line cannot be calculated.
The
pinned
argument will be set toTrue
if the callout anchor point is pinned (manually placed).New in version 3.20.
- clone(self) QgsCurvedLineCallout ¶
- Return type:
- create(properties: Dict[str, Any] = {}, context: QgsReadWriteContext = QgsReadWriteContext()) QgsCallout ¶
Creates a new
QgsCurvedLineCallout
, using the settings serialized in theproperties
map (corresponding to the output fromQgsCurvedLineCallout.properties()
).- Parameters:
properties (Dict[str) –
context (
QgsReadWriteContext
= QgsReadWriteContext()) –
- Return type:
- createCalloutLine(self, start: QgsPoint, end: QgsPoint, context: QgsRenderContext, bodyBoundingBox: QRectF, angle: float, anchor: QgsGeometry, calloutContext: QgsCallout.QgsCalloutContext) QgsCurve ¶
- Parameters:
start (QgsPoint) –
end (QgsPoint) –
context (QgsRenderContext) –
bodyBoundingBox (QRectF) –
angle (float) –
anchor (QgsGeometry) –
calloutContext (QgsCallout.QgsCalloutContext) –
- Return type:
- curvature(self) float ¶
Returns the callout line’s curvature.
The curvature is a percentage value (with typical ranges between 0.0 and 1.0), representing the overall curvature of the line.
See also
- Return type:
float
- draw(self, context: QgsRenderContext, bodyBoundingBox: QRectF, angle: float, anchor: QgsGeometry, calloutContext: QgsCallout.QgsCalloutContext)¶
- labelAnchorGeometry(self, bodyBoundingBox: QRectF, angle: float, anchor: QgsCallout.LabelAnchorPoint) QgsGeometry ¶
Returns the anchor point geometry for a label with the given bounding box and
anchor
point mode.Deprecated since version QGIS: 3.20 use
calloutLabelPoint()
instead
- orientation(self) QgsCurvedLineCallout.Orientation ¶
Returns the callout line’s curve orientation.
See also
- Return type:
- properties(self, context: QgsReadWriteContext) Dict[str, Any] ¶
- Parameters:
context (QgsReadWriteContext) –
- Return type:
Dict[str, Any]
- setCurvature(self, curvature: float)¶
Sets the callout line’s
curvature
.The
curvature
is a percentage value (with typical ranges between 0.0 and 1.0), representing the overall curvature of the line.See also
- Parameters:
curvature (float) –
- setOrientation(self, orientation: QgsCurvedLineCallout.Orientation)¶
Sets the callout line’s curve
orientation
.See also
- Parameters:
orientation (QgsCurvedLineCallout.Orientation) –
- type(self) str ¶
- Return type:
str