Skip to content
Permalink
Browse files

[MESH] fix streamlines and traces renderer when vector is null (#36633)

[MESH] fix streamlines and traces renderer when vector is null
  • Loading branch information
vcloarec committed May 23, 2020
1 parent 204694e commit 42ba3d78febd5ae9833edc55eac060148c1e0522
Showing with 9 additions and 3 deletions.
  1. +3 −0 src/core/mesh/qgsmeshlayerrenderer.cpp
  2. +6 −3 src/core/mesh/qgsmeshtracerenderer.cpp
@@ -550,6 +550,9 @@ void QgsMeshLayerRenderer::renderVectorDataset()
if ( std::isnan( mVectorDatasetMagMinimum ) || std::isnan( mVectorDatasetMagMaximum ) )
return; // only NODATA values

if ( !( mVectorDatasetMagMaximum > 0 ) )
return; //all vector are null vector

std::unique_ptr<QgsMeshVectorRenderer> renderer( QgsMeshVectorRenderer::makeVectorRenderer(
mTriangularMesh,
mVectorDatasetValues,
@@ -371,8 +371,9 @@ void QgsMeshStreamField::addTrace( QgsPointXY startPoint )

void QgsMeshStreamField::addRandomTraces()
{
while ( mPixelFillingCount < mMaxPixelFillingCount && !mRenderContext.renderingStopped() )
addRandomTrace();
if ( mMaximumMagnitude > 0 )
while ( mPixelFillingCount < mMaxPixelFillingCount && !mRenderContext.renderingStopped() )
addRandomTrace();
}

void QgsMeshStreamField::addRandomTrace()
@@ -429,6 +430,9 @@ void QgsMeshStreamField::addTrace( QPoint startPixel )
if ( !mVectorValueInterpolator )
return;

if ( !( mMaximumMagnitude > 0 ) )
return;

mPainter->setPen( mPen );

//position in the pixelField
@@ -910,7 +914,6 @@ QgsMeshVectorStreamlineRenderer::QgsMeshVectorStreamlineRenderer(
mStreamlineField->setColor( settings.color() );
mStreamlineField->setFilter( settings.filterMin(), settings.filterMax() );


switch ( settings.streamLinesSettings().seedingMethod() )
{
case QgsMeshRendererVectorStreamlineSettings::MeshGridded:

0 comments on commit 42ba3d7

Please sign in to comment.
You can’t perform that action at this time.