Skip to content
Permalink
Browse files

fix #21931 Mesh calculator crash when used with face dataset

  • Loading branch information
PeterPetrik committed Apr 26, 2019
1 parent cc37e70 commit 4aaa523977c9ec74ddb2e92f704eaa30d16d5121
Showing with 8 additions and 6 deletions.
  1. +7 −5 src/analysis/mesh/qgsmeshcalcutils.cpp
  2. +1 −1 src/app/mesh/qgsmeshcalculatordialog.cpp
@@ -61,11 +61,13 @@ std::shared_ptr<QgsMeshMemoryDatasetGroup> QgsMeshCalcUtils::create( const QStri
for ( int value_i = 0; value_i < count; ++value_i )
ds->values[value_i] = block.value( value_i );

const QgsMeshDataBlock active = dp->areFacesActive( index, 0, dp->faceCount() );
Q_ASSERT( active.count() == dp->faceCount() );
for ( int value_i = 0; value_i < dp->faceCount(); ++value_i )
ds->active[value_i] = active.active( value_i );

if ( grp->type == QgsMeshDatasetGroupMetadata::DataOnVertices )
{
const QgsMeshDataBlock active = dp->areFacesActive( index, 0, dp->faceCount() );
Q_ASSERT( active.count() == dp->faceCount() );
for ( int value_i = 0; value_i < dp->faceCount(); ++value_i )
ds->active[value_i] = active.active( value_i );
}
grp->addDataset( ds );
}

@@ -247,7 +247,7 @@ void QgsMeshCalculatorDialog::mExpressionTextEdit_textChanged()
}
else
{
mExpressionValidLabel->setText( tr( "Expression invalid" ) );
mExpressionValidLabel->setText( tr( "Expression invalid or datasets type not supported" ) );
}
mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
}

0 comments on commit 4aaa523

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