Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RasterLayer: Properly handle GUI updates when multiple canvas are displayed #59444

Merged
merged 6 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 134 additions & 0 deletions python/PyQt6/core/auto_generated/qgsrenderedlayerstatistics.sip.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsrenderedlayerstatistics.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/






class QgsRenderedLayerStatistics: QgsRenderedItemDetails
{
%Docstring(signature="appended")
Contains computed statistics for a layer render.

.. versionadded:: 3.42
%End

%TypeHeaderCode
#include "qgsrenderedlayerstatistics.h"
%End
public:

QgsRenderedLayerStatistics( const QString &layerId, const QList<double> &minimum, const QList<double> &maximum );
%Docstring
Constructor for QgsRenderedLayerStatistics from a list of ``minimum`` and ``maximum``.

This is used to store the minimum and maximum values of a layer. Many values may be stored.
For example, a raster layer may have multiple bands. In that case, ``minimum`` will contain the minimum
value of each band and ``maximum`` will contain the maximum value of each band.
%End

QgsRenderedLayerStatistics( const QString &layerId, SIP_PYOBJECT minimum /TypeHint="Optional[float]"/ = Py_None, SIP_PYOBJECT maximum /TypeHint="Optional[float]"/ = Py_None ) [( const QString & layerId, double minimum = 0.0, double maximum = 0.0 )];
%Docstring
Constructor for QgsRenderedLayerStatistics with only one value for ``minimum`` and ``maximum``.
%End
%MethodCode
double minP = a1 == Py_None ? std::numeric_limits<double>::quiet_NaN() : PyFloat_AsDouble( a1 );
double maxP = a2 == Py_None ? std::numeric_limits<double>::quiet_NaN() : PyFloat_AsDouble( a2 );
QList<double> minL = {minP};
QList<double> maxL = {maxP};
sipCpp = new sipQgsRenderedLayerStatistics( *a0, minL, maxL );
%End

SIP_PYOBJECT __repr__();
%MethodCode
QStringList minimums;
minimums.reserve( sipCpp->minimum().size() );
for ( double min : sipCpp->minimum() )
{
minimums.append( QString::number( min ) );
}
QStringList maximums;
maximums.reserve( sipCpp->maximum().size() );
for ( double max : sipCpp->maximum() )
{
maximums.append( QString::number( max ) );
}
QString str = QStringLiteral( "<QgsRenderedLayerStatistics: %1 (min: %2 - max: %3)>" ).arg( sipCpp->layerId(), minimums.join( ',' ), maximums.join( ',' ) );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

QList<double> minimum() const;
%Docstring
Returns the minimum values of the computed statistics.

.. seealso:: :py:func:`setMinimum`
%End

double minimum( int index ) const;
%Docstring
Returns the minimum value of the computed statistics at ``index``.

.. seealso:: :py:func:`setMinimum`
%End

QList<double> maximum() const;
%Docstring
Returns the maximum values of the computed statistics.

.. seealso:: :py:func:`setMaximum`
%End

double maximum( int index ) const;
%Docstring
Returns the maximum values of the computed statistics at ``index``.

.. seealso:: :py:func:`setMaximum`
%End

void setMinimum( QList<double> &minimum );
%Docstring
Sets the minimum values of the computed statistics.

.. seealso:: :py:func:`minimum`
%End

bool setMinimum( int index, double minimum );
%Docstring
Sets the minimum value of the computed statistics at ``index``.

:return: ``True`` if value has been set.

.. seealso:: :py:func:`minimum`
%End

void setMaximum( QList<double> &maximum );
%Docstring
Sets the maximum values of the computed statistics.

.. seealso:: :py:func:`maximum`
%End

bool setMaximum( int index, double maximum );
%Docstring
Sets the maximum value of the computed statistics at ``index``.

:return: ``True`` if value has been set.

.. seealso:: :py:func:`maximum`
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsrenderedlayerstatistics.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Ownership of the enhancement is transferred.
virtual void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props = QVariantMap() ) const;



private:
QgsMultiBandColorRenderer( const QgsMultiBandColorRenderer & );
const QgsMultiBandColorRenderer &operator=( const QgsMultiBandColorRenderer & );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ Set contrast enhancement algorithm
%End



virtual QString subsetString() const;
%Docstring
Returns the string (typically sql) used to define a subset of the layer.
Expand Down Expand Up @@ -430,6 +429,7 @@ to be drawn outside the data extent.
virtual QgsMapLayerElevationProperties *elevationProperties();



public slots:
void showStatusMessage( const QString &message );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ should be canceled.
.. versionadded:: 3.10
%End



protected:

void _writeXml( QDomDocument &doc, QDomElement &rasterRendererElem ) const;
Expand All @@ -242,6 +244,7 @@ during an actual rendering operation.
.. versionadded:: 3.10
%End


private:
QgsRasterRenderer( const QgsRasterRenderer & );
const QgsRasterRenderer &operator=( const QgsRasterRenderer & );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Ownership of ``settings`` is transferred.
.. versionadded:: 3.18
%End


private:
QgsSingleBandGrayRenderer( const QgsSingleBandGrayRenderer & );
const QgsSingleBandGrayRenderer &operator=( const QgsSingleBandGrayRenderer & );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Sets the band used by the renderer.
void setClassificationMin( double min );
void setClassificationMax( double max );


private:
QgsSingleBandPseudoColorRenderer( const QgsSingleBandPseudoColorRenderer & );
const QgsSingleBandPseudoColorRenderer &operator=( const QgsSingleBandPseudoColorRenderer & );
Expand Down
1 change: 1 addition & 0 deletions python/PyQt6/core/core_auto.sip
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
%Include auto_generated/qgsrenderchecker.sip
%Include auto_generated/qgsrendercontext.sip
%Include auto_generated/qgsrenderedfeaturehandlerinterface.sip
%Include auto_generated/qgsrenderedlayerstatistics.sip
%Include auto_generated/qgsrendereditemdetails.sip
%Include auto_generated/qgsrunprocess.sip
%Include auto_generated/qgsruntimeprofiler.sip
Expand Down
134 changes: 134 additions & 0 deletions python/core/auto_generated/qgsrenderedlayerstatistics.sip.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsrenderedlayerstatistics.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/






class QgsRenderedLayerStatistics: QgsRenderedItemDetails
{
%Docstring(signature="appended")
Contains computed statistics for a layer render.

.. versionadded:: 3.42
%End

%TypeHeaderCode
#include "qgsrenderedlayerstatistics.h"
%End
public:

QgsRenderedLayerStatistics( const QString &layerId, const QList<double> &minimum, const QList<double> &maximum );
%Docstring
Constructor for QgsRenderedLayerStatistics from a list of ``minimum`` and ``maximum``.

This is used to store the minimum and maximum values of a layer. Many values may be stored.
For example, a raster layer may have multiple bands. In that case, ``minimum`` will contain the minimum
value of each band and ``maximum`` will contain the maximum value of each band.
%End

QgsRenderedLayerStatistics( const QString &layerId, SIP_PYOBJECT minimum /TypeHint="Optional[float]"/ = Py_None, SIP_PYOBJECT maximum /TypeHint="Optional[float]"/ = Py_None ) [( const QString & layerId, double minimum = 0.0, double maximum = 0.0 )];
%Docstring
Constructor for QgsRenderedLayerStatistics with only one value for ``minimum`` and ``maximum``.
%End
%MethodCode
double minP = a1 == Py_None ? std::numeric_limits<double>::quiet_NaN() : PyFloat_AsDouble( a1 );
double maxP = a2 == Py_None ? std::numeric_limits<double>::quiet_NaN() : PyFloat_AsDouble( a2 );
QList<double> minL = {minP};
QList<double> maxL = {maxP};
sipCpp = new sipQgsRenderedLayerStatistics( *a0, minL, maxL );
%End

SIP_PYOBJECT __repr__();
%MethodCode
QStringList minimums;
minimums.reserve( sipCpp->minimum().size() );
for ( double min : sipCpp->minimum() )
{
minimums.append( QString::number( min ) );
}
QStringList maximums;
maximums.reserve( sipCpp->maximum().size() );
for ( double max : sipCpp->maximum() )
{
maximums.append( QString::number( max ) );
}
QString str = QStringLiteral( "<QgsRenderedLayerStatistics: %1 (min: %2 - max: %3)>" ).arg( sipCpp->layerId(), minimums.join( ',' ), maximums.join( ',' ) );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

QList<double> minimum() const;
%Docstring
Returns the minimum values of the computed statistics.

.. seealso:: :py:func:`setMinimum`
%End

double minimum( int index ) const;
%Docstring
Returns the minimum value of the computed statistics at ``index``.

.. seealso:: :py:func:`setMinimum`
%End

QList<double> maximum() const;
%Docstring
Returns the maximum values of the computed statistics.

.. seealso:: :py:func:`setMaximum`
%End

double maximum( int index ) const;
%Docstring
Returns the maximum values of the computed statistics at ``index``.

.. seealso:: :py:func:`setMaximum`
%End

void setMinimum( QList<double> &minimum );
%Docstring
Sets the minimum values of the computed statistics.

.. seealso:: :py:func:`minimum`
%End

bool setMinimum( int index, double minimum );
%Docstring
Sets the minimum value of the computed statistics at ``index``.

:return: ``True`` if value has been set.

.. seealso:: :py:func:`minimum`
%End

void setMaximum( QList<double> &maximum );
%Docstring
Sets the maximum values of the computed statistics.

.. seealso:: :py:func:`maximum`
%End

bool setMaximum( int index, double maximum );
%Docstring
Sets the maximum value of the computed statistics at ``index``.

:return: ``True`` if value has been set.

.. seealso:: :py:func:`maximum`
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsrenderedlayerstatistics.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Ownership of the enhancement is transferred.
virtual void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props = QVariantMap() ) const;



private:
QgsMultiBandColorRenderer( const QgsMultiBandColorRenderer & );
const QgsMultiBandColorRenderer &operator=( const QgsMultiBandColorRenderer & );
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/raster/qgsrasterlayer.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ Set contrast enhancement algorithm
%End



virtual QString subsetString() const;
%Docstring
Returns the string (typically sql) used to define a subset of the layer.
Expand Down Expand Up @@ -430,6 +429,7 @@ to be drawn outside the data extent.
virtual QgsMapLayerElevationProperties *elevationProperties();



public slots:
void showStatusMessage( const QString &message );

Expand Down
3 changes: 3 additions & 0 deletions python/core/auto_generated/raster/qgsrasterrenderer.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ should be canceled.
.. versionadded:: 3.10
%End



protected:

void _writeXml( QDomDocument &doc, QDomElement &rasterRendererElem ) const;
Expand All @@ -242,6 +244,7 @@ during an actual rendering operation.
.. versionadded:: 3.10
%End


private:
QgsRasterRenderer( const QgsRasterRenderer & );
const QgsRasterRenderer &operator=( const QgsRasterRenderer & );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Ownership of ``settings`` is transferred.
.. versionadded:: 3.18
%End


private:
QgsSingleBandGrayRenderer( const QgsSingleBandGrayRenderer & );
const QgsSingleBandGrayRenderer &operator=( const QgsSingleBandGrayRenderer & );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Sets the band used by the renderer.
void setClassificationMin( double min );
void setClassificationMax( double max );


private:
QgsSingleBandPseudoColorRenderer( const QgsSingleBandPseudoColorRenderer & );
const QgsSingleBandPseudoColorRenderer &operator=( const QgsSingleBandPseudoColorRenderer & );
Expand Down
1 change: 1 addition & 0 deletions python/core/core_auto.sip
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
%Include auto_generated/qgsrenderchecker.sip
%Include auto_generated/qgsrendercontext.sip
%Include auto_generated/qgsrenderedfeaturehandlerinterface.sip
%Include auto_generated/qgsrenderedlayerstatistics.sip
%Include auto_generated/qgsrendereditemdetails.sip
%Include auto_generated/qgsrunprocess.sip
%Include auto_generated/qgsruntimeprofiler.sip
Expand Down
Loading
Loading