Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rendered callout details to QgsLabelingResults for retrieval afte…
…r a map render completes
- Loading branch information
1 parent
4f39cf6
commit d84da56
Showing
17 changed files
with
586 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
python/core/auto_generated/labeling/qgscalloutposition.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/labeling/qgscalloutposition.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
class QgsCalloutPosition | ||
{ | ||
%Docstring | ||
Represents the calculated placement of a map label callout line. | ||
|
||
.. versionadded:: 3.20 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgscalloutposition.h" | ||
%End | ||
public: | ||
|
||
QgsCalloutPosition( QgsFeatureId id, const QString &layer, const QString &providerId = QString() ); | ||
%Docstring | ||
Constructor for QgsCalloutPosition. | ||
|
||
:param id: associated feature ID | ||
:param layer: ID of associated map layer | ||
:param providerId: ID of associated label provider | ||
%End | ||
|
||
QgsCalloutPosition(); | ||
%Docstring | ||
Constructor for QgsCalloutPosition | ||
%End | ||
|
||
QgsFeatureId featureId; | ||
|
||
QString layerID; | ||
|
||
QString providerID; | ||
|
||
QPointF origin() const; | ||
%Docstring | ||
Returns the origin of the callout line, in map coordinates. | ||
|
||
The origin of the callout line is the line point associated with the label text. | ||
|
||
.. seealso:: :py:func:`setOrigin` | ||
|
||
.. seealso:: :py:func:`destination` | ||
%End | ||
|
||
void setOrigin( const QPointF &origin ); | ||
%Docstring | ||
Sets the ``origin`` of the callout line, in map coordinates. | ||
|
||
The origin of the callout line is the line point associated with the label text. | ||
|
||
.. seealso:: :py:func:`origin` | ||
|
||
.. seealso:: :py:func:`setDestination` | ||
%End | ||
|
||
QPointF destination() const; | ||
%Docstring | ||
Returns the destination of the callout line, in map coordinates. | ||
|
||
The destination of the callout line is the line point associated with the feature's geometry. | ||
|
||
.. seealso:: :py:func:`setDestination` | ||
|
||
.. seealso:: :py:func:`origin` | ||
%End | ||
|
||
void setDestination( const QPointF &destination ); | ||
%Docstring | ||
Sets the ``destination`` of the callout line, in map coordinates. | ||
|
||
The destination of the callout line is the line point associated with the feature's geometry. | ||
|
||
.. seealso:: :py:func:`destination` | ||
|
||
.. seealso:: :py:func:`setOrigin` | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/labeling/qgscalloutposition.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/*************************************************************************** | ||
qgscalloutposition.h | ||
------------------- | ||
begin : February 2021 | ||
copyright : (C) Nyall Dawson | ||
email : nyall dot dawson at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#ifndef QGSCALLOUTPOSITION_H | ||
#define QGSCALLOUTPOSITION_H | ||
|
||
#include "qgis_core.h" | ||
#include "qgis_sip.h" | ||
|
||
#include "qgsfeatureid.h" | ||
|
||
#include <QPointF> | ||
|
||
/** | ||
* \ingroup core | ||
* \class QgsCalloutPosition | ||
* \brief Represents the calculated placement of a map label callout line. | ||
* \since QGIS 3.20 | ||
*/ | ||
class CORE_EXPORT QgsCalloutPosition | ||
{ | ||
public: | ||
|
||
/** | ||
* Constructor for QgsCalloutPosition. | ||
* \param id associated feature ID | ||
* \param layer ID of associated map layer | ||
* \param providerId ID of associated label provider | ||
*/ | ||
QgsCalloutPosition( QgsFeatureId id, const QString &layer, const QString &providerId = QString() ) | ||
: featureId( id ) | ||
, layerID( layer ) | ||
, providerID( providerId ) | ||
{} | ||
|
||
//! Constructor for QgsCalloutPosition | ||
QgsCalloutPosition() = default; | ||
|
||
/** | ||
* ID of feature associated with this callout. | ||
*/ | ||
QgsFeatureId featureId = FID_NULL; | ||
|
||
/** | ||
* ID of associated map layer. | ||
*/ | ||
QString layerID; | ||
|
||
/** | ||
* ID of the associated label provider. | ||
*/ | ||
QString providerID; | ||
|
||
/** | ||
* Returns the origin of the callout line, in map coordinates. | ||
* | ||
* The origin of the callout line is the line point associated with the label text. | ||
* | ||
* \see setOrigin() | ||
* \see destination() | ||
*/ | ||
QPointF origin() const { return mOrigin; } | ||
|
||
/** | ||
* Sets the \a origin of the callout line, in map coordinates. | ||
* | ||
* The origin of the callout line is the line point associated with the label text. | ||
* | ||
* \see origin() | ||
* \see setDestination() | ||
*/ | ||
void setOrigin( const QPointF &origin ) { mOrigin = origin; } | ||
|
||
/** | ||
* Returns the destination of the callout line, in map coordinates. | ||
* | ||
* The destination of the callout line is the line point associated with the feature's geometry. | ||
* | ||
* \see setDestination() | ||
* \see origin() | ||
*/ | ||
QPointF destination() const { return mDestination; } | ||
|
||
/** | ||
* Sets the \a destination of the callout line, in map coordinates. | ||
* | ||
* The destination of the callout line is the line point associated with the feature's geometry. | ||
* | ||
* \see destination() | ||
* \see setOrigin() | ||
*/ | ||
void setDestination( const QPointF &destination ) { mDestination = destination; } | ||
|
||
private: | ||
|
||
QPointF mOrigin; | ||
|
||
QPointF mDestination; | ||
}; | ||
|
||
#endif // QGSCALLOUTPOSITION_H |
Oops, something went wrong.