Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[api] Add framework for collecting rendered item details during map
renderer operations This follow a similar pattern as how labeling results could be collected after a map render job, but generalises the API so that it can be used for storing details of rendered items of any type. It's currently used for storing details of rendered annotation items, so that map tools can retrieve details of annotation items visible in the canvas in an optimised way.
- Loading branch information
1 parent
b09994a
commit 660433d
Showing
25 changed files
with
912 additions
and
16 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
python/core/auto_generated/annotations/qgsrenderedannotationitemdetails.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,57 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/annotations/qgsrenderedannotationitemdetails.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
class QgsRenderedAnnotationItemDetails : QgsRenderedItemDetails | ||
{ | ||
%Docstring(signature="appended") | ||
Contains information about a rendered annotation item. | ||
|
||
.. versionadded:: 3.22 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsrenderedannotationitemdetails.h" | ||
%End | ||
public: | ||
|
||
QgsRenderedAnnotationItemDetails( const QString &layerId, const QString &itemId ); | ||
%Docstring | ||
Constructor for QgsRenderedAnnotationItemDetails. | ||
%End | ||
|
||
SIP_PYOBJECT __repr__(); | ||
%MethodCode | ||
QString str = QStringLiteral( "<QgsRenderedAnnotationItemDetails: %1 - %2>" ).arg( sipCpp->layerId(), sipCpp->itemId() ); | ||
sipRes = PyUnicode_FromString( str.toUtf8().constData() ); | ||
%End | ||
|
||
virtual QgsRenderedAnnotationItemDetails *clone() const /Factory/; | ||
|
||
|
||
QString layerId() const; | ||
%Docstring | ||
Returns the layer ID of the associated map layer. | ||
%End | ||
|
||
QString itemId() const; | ||
%Docstring | ||
Returns the item ID of the associated annotation item. | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/annotations/qgsrenderedannotationitemdetails.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
53 changes: 53 additions & 0 deletions
53
python/core/auto_generated/maprenderer/qgsrendereditemresults.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,53 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/maprenderer/qgsrendereditemresults.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
|
||
class QgsRenderedItemResults | ||
{ | ||
%Docstring(signature="appended") | ||
Stores collated details of rendered items during a map rendering operation. | ||
|
||
.. versionadded:: 3.22 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsrendereditemresults.h" | ||
%End | ||
public: | ||
QgsRenderedItemResults(); | ||
~QgsRenderedItemResults(); | ||
|
||
|
||
QList< QgsRenderedItemDetails * > renderedItems() const; | ||
%Docstring | ||
Returns a list of all rendered items. | ||
%End | ||
|
||
QList<const QgsRenderedAnnotationItemDetails *> renderedAnnotationItemsInBounds( const QgsRectangle &bounds ) const; | ||
%Docstring | ||
Returns a list with details of the rendered annotation items within the specified ``bounds``. | ||
|
||
.. versionadded:: 3.22 | ||
%End | ||
|
||
|
||
private: | ||
QgsRenderedItemResults( const QgsRenderedItemResults & ); | ||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/maprenderer/qgsrendereditemresults.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/qgsrendereditemdetails.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
class QgsRenderedItemDetails | ||
{ | ||
%Docstring(signature="appended") | ||
Base class for detailed information about a rendered item. | ||
|
||
.. versionadded:: 3.22 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsrendereditemdetails.h" | ||
%End | ||
public: | ||
|
||
%ConvertToSubClassCode | ||
if ( dynamic_cast<QgsRenderedAnnotationItemDetails *>( sipCpp ) ) | ||
sipType = sipType_QgsRenderedAnnotationItemDetails; | ||
else | ||
sipType = 0; | ||
%End | ||
|
||
virtual ~QgsRenderedItemDetails(); | ||
|
||
virtual QgsRenderedItemDetails *clone() const = 0 /Factory/; | ||
%Docstring | ||
Clones the details. | ||
%End | ||
|
||
QgsRectangle boundingBox() const; | ||
%Docstring | ||
Returns the bounding box of the item (in map units). | ||
|
||
.. seealso:: :py:func:`setBoundingBox` | ||
%End | ||
|
||
void setBoundingBox( const QgsRectangle &bounds ); | ||
%Docstring | ||
Sets the bounding box of the item (in map units). | ||
|
||
.. seealso:: :py:func:`boundingBox` | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/qgsrendereditemdetails.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
Oops, something went wrong.