Skip to content

Commit

Permalink
send reindex action in the mesh menu
Browse files Browse the repository at this point in the history
  • Loading branch information
vcloarec committed Sep 15, 2021
1 parent 2d99806 commit fa87494
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/app/mesh/qgsmaptooleditmeshframe.cpp
Expand Up @@ -413,6 +413,11 @@ QWidgetAction *QgsMapToolEditMeshFrame::forceByLineWidgetActionSettings() const
return mWidgetActionForceByLine;
}

QAction *QgsMapToolEditMeshFrame::reindexAction() const
{
return mActionReindexMesh;
}

void QgsMapToolEditMeshFrame::initialize()
{
if ( !mFaceRubberBand )
Expand Down Expand Up @@ -1652,11 +1657,11 @@ void QgsMapToolEditMeshFrame::forceBySelectedLayerPolyline()

void QgsMapToolEditMeshFrame::reindexMesh()
{
onEditingStarted();

if ( !mCurrentLayer || !mCurrentLayer->isEditable() )
return;

onEditingStarted();

if ( QMessageBox::question( canvas(), tr( "Reindex the Mesh" ),
tr( "Do you want to reindex the faces and vertices of the mesh layer %1?" ).arg( mCurrentLayer->name() ),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No )
Expand Down
1 change: 1 addition & 0 deletions src/app/mesh/qgsmaptooleditmeshframe.h
Expand Up @@ -128,6 +128,7 @@ class APP_EXPORT QgsMapToolEditMeshFrame : public QgsMapToolAdvancedDigitizing
QList<QAction *> forceByLinesActions() const;
QAction *defaultForceAction() const;
QWidgetAction *forceByLineWidgetActionSettings() const;
QAction *reindexAction() const;

void setActionsEnable( bool enable );

Expand Down
2 changes: 2 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -3869,6 +3869,8 @@ void QgisApp::createToolBars()
mDigitizeModeToolButton->setMenu( digitizeMenu );
for ( QAction *mapToolAction : editMeshMapTool->mapToolActions() )
mMapToolGroup->addAction( mapToolAction );

mMeshMenu->addAction( editMeshMapTool->reindexAction() );
}

QToolButton *annotationLayerToolButton = new QToolButton();
Expand Down

0 comments on commit fa87494

Please sign in to comment.