Skip to content
Permalink
Browse files
Address review
  • Loading branch information
nirvn committed Dec 29, 2021
1 parent 4131714 commit d4fceb27976cdfa61cdcd21a28307ad879f3ba44
@@ -113,7 +113,7 @@ QVariantMap QgsVectorizeAlgorithmBase::processAlgorithm( const QVariantMap &para
for ( int column = 0; column < iterCols; column++ )
{
const double value = rasterBlock->valueAndNoData( row, column, isNoData );
if ( !isNoData && !qgsDoubleNear( value, 0.0 ) )
if ( !isNoData )
{
const QgsGeometry pixelRectGeometry = createGeometryForPixel( currentX, currentY, mRasterUnitsPerPixelX, mRasterUnitsPerPixelY );

@@ -354,16 +354,16 @@ class CORE_EXPORT QgsMapRendererJob : public QObject SIP_ABSTRACT

/**
* Returns the label sink associated to this rendering job.
* \note not available in Python bindings
* \note Not available in Python bindings.
* \since QGIS 3.24
*/
QgsLabelSink *labelSink() const { return mLabelSink; } SIP_SKIP

/**
* Assigns the label sink which will take over responsability for handling labels
* Assigns the label sink which will take over responsibility for handling labels
* during the rendering job.
* \note the ownership is not transferred
* \note not available in Python bindings
* \note Ownership is not transferred and the sink must exist for the lifetime of the map rendering job.
* \note Not available in Python bindings.
* \since QGIS 3.24
*/
void setLabelSink( QgsLabelSink *sink ) { mLabelSink = sink; } SIP_SKIP
@@ -56,6 +56,7 @@ QgsRenderContext::QgsRenderContext( const QgsRenderContext &rh )
, mRendererScale( rh.mRendererScale )
, mSymbologyReferenceScale( rh.mSymbologyReferenceScale )
, mLabelingEngine( rh.mLabelingEngine )
, mLabelSink( rh.mLabelSink )
, mSelectionColor( rh.mSelectionColor )
, mVectorSimplifyMethod( rh.mVectorSimplifyMethod )
, mExpressionContext( rh.mExpressionContext )
@@ -99,6 +100,7 @@ QgsRenderContext &QgsRenderContext::operator=( const QgsRenderContext &rh )
mRendererScale = rh.mRendererScale;
mSymbologyReferenceScale = rh.mSymbologyReferenceScale;
mLabelingEngine = rh.mLabelingEngine;
mLabelSink = rh.mLabelSink;
mSelectionColor = rh.mSelectionColor;
mVectorSimplifyMethod = rh.mVectorSimplifyMethod;
mExpressionContext = rh.mExpressionContext;
@@ -361,13 +361,14 @@ class CORE_EXPORT QgsRenderContext : public QgsTemporalRangeObject
double symbologyReferenceScale() const { return mSymbologyReferenceScale; }

/**
* Gets access to new labeling engine (may be NULLPTR)
* \note not available in Python bindings
* Gets access to new labeling engine (may be NULLPTR).
* \note Not available in Python bindings.
*/
QgsLabelingEngine *labelingEngine() const { return mLabelingEngine; } SIP_SKIP

/**
* Returns the associated label sink, or NULLPTR if not set.
* \note Not available in Python bindings.
* \since QGIS 3.24
*/
QgsLabelSink *labelSink() const { return mLabelSink; } SIP_SKIP
@@ -539,13 +540,14 @@ class CORE_EXPORT QgsRenderContext : public QgsTemporalRangeObject

/**
* Assigns the labeling engine
* \note not available in Python bindings
* \note Not available in Python bindings.
*/
void setLabelingEngine( QgsLabelingEngine *engine ) { mLabelingEngine = engine; } SIP_SKIP

/**
* Assigns the label sink which will take over responsability for handling labels.
* \note the ownership is not transferred
* Assigns the label sink which will take over responsibility for handling labels.
* \note Ownership is not transferred and the sink must exist for the lifetime of the map rendering job.
* \note Not available in Python bindings.
* \since QGIS 3.24
*/
void setLabelSink( QgsLabelSink *sink ) { mLabelSink = sink; } SIP_SKIP
@@ -736,24 +736,18 @@ void QgsVectorLayerRenderer::prepareLabeling( QgsVectorLayer *layer, QSet<QStrin
QgsPalLayerSettings settings = layer->labeling()->settings();
mLabelProvider = new QgsLabelSinkProvider( layer, QString(), context.labelSink(), &settings );
}
engine2->addProvider( mLabelProvider );
if ( !mLabelProvider->prepare( context, attributeNames ) )
{
engine2->removeProvider( mLabelProvider );
mLabelProvider = nullptr;
}
}
else
{
mLabelProvider = layer->labeling()->provider( layer );
if ( mLabelProvider )
}
if ( mLabelProvider )
{
engine2->addProvider( mLabelProvider );
if ( !mLabelProvider->prepare( context, attributeNames ) )
{
engine2->addProvider( mLabelProvider );
if ( !mLabelProvider->prepare( context, attributeNames ) )
{
engine2->removeProvider( mLabelProvider );
mLabelProvider = nullptr; // deleted by engine
}
engine2->removeProvider( mLabelProvider );
mLabelProvider = nullptr; // deleted by engine
}
}
}

0 comments on commit d4fceb2

Please sign in to comment.