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 699cff0 commit db7a050d7d8fcaf1761a7522a44915eb394d713b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
@@ -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 );
}

@@ -248,7 +248,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 db7a050

Please sign in to comment.