Skip to content
Permalink
Browse files
Mesh editing fixes (#44881)
[mesh]
* fix Delaunay triangulation
* fix free vertices updating
  • Loading branch information
vcloarec committed Sep 1, 2021
1 parent 5cf1b7a commit f19f554f8d10c90f557e26f3a8f9a8c302f1377b
Showing with 9 additions and 8 deletions.
  1. +2 −1 src/analysis/mesh/qgsmeshtriangulation.cpp
  2. +7 −7 src/app/mesh/qgsmaptooleditmeshframe.cpp
@@ -430,7 +430,8 @@ QgsTopologicalMesh::Changes QgsMeshEditingDelaunayTriangulation::apply( QgsMeshE

Q_ASSERT( meshEditor->topologicalMesh().checkConsistency() == QgsMeshEditingError() );

mMessage = QObject::tr( "%1 vertices have not been included in the triangulation" ).arg( removedVerticesFromTriangulation.count() );
if ( !removedVerticesFromTriangulation.isEmpty() )
mMessage = QObject::tr( "%1 vertices have not been included in the triangulation" ).arg( removedVerticesFromTriangulation.count() );

if ( triangulationReady && !giveUp )
return meshEditor->topologicalMesh().addFaces( topologicFaces );
@@ -123,7 +123,7 @@ QgsMapToolEditMeshFrame::QgsMapToolEditMeshFrame( QgsMapCanvas *canvas )

connect( mActionDelaunayTriangulation, &QAction::triggered, this, [this]
{
if ( mCurrentEditor && mSelectedVertices.count() > 3 )
if ( mCurrentEditor && mSelectedVertices.count() >= 3 )
{
QgsMeshEditingDelaunayTriangulation triangulation;
triangulation.setInputVertices( mSelectedVertices.keys() );
@@ -363,6 +363,7 @@ void QgsMapToolEditMeshFrame::activate()
QgsMapToolAdvancedDigitizing::activate();
if ( mZValueWidget )
mZValueWidget->show();
updateFreeVertices();
}

bool QgsMapToolEditMeshFrame::populateContextMenuWithEvent( QMenu *menu, QgsMapMouseEvent *event )
@@ -1091,16 +1092,15 @@ void QgsMapToolEditMeshFrame::setCurrentLayer( QgsMapLayer *layer )
}
}

if ( mCurrentEditor && !mZValueWidget )
if ( mCurrentEditor )
{
createZValueWidget();
if ( !mZValueWidget )
createZValueWidget();
updateFreeVertices();
}

if ( !mCurrentEditor )
{
else
deactivate();
}

}

void QgsMapToolEditMeshFrame::onEdit()

0 comments on commit f19f554

Please sign in to comment.