Skip to content

SurfaceManipulationWidget: fix update of unchangeableVerts_ #4751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions source/MRViewer/MRSurfaceManipulationWidget.cpp
Original file line number Diff line number Diff line change
@@ -406,17 +406,17 @@ bool SurfaceManipulationWidget::onMouseUp_( Viewer::MouseButton button, int /*mo
.maxEdgeLen = 2 * (float)avgLen,
.edgeWeights = settings_.edgeWeights
};
if ( unchangeableVerts_.any() )
settings.onEdgeSplit = [&] ( EdgeId e1, EdgeId e )
{
settings.onEdgeSplit = [&] ( EdgeId e1, EdgeId e )
{
if ( newFaceSelection.test( newMesh->topology.left( e ) ) )
newFaceSelection.autoResizeSet( newMesh->topology.left( e1 ) );
if ( newFaceSelection.test( newMesh->topology.right( e ) ) )
newFaceSelection.autoResizeSet( newMesh->topology.right( e1 ) );
if ( newFaceSelection.test( newMesh->topology.left( e ) ) )
newFaceSelection.autoResizeSet( newMesh->topology.left( e1 ) );
if ( newFaceSelection.test( newMesh->topology.right( e ) ) )
newFaceSelection.autoResizeSet( newMesh->topology.right( e1 ) );
// if we split an edge with both unchangeable end vertices, then mark new vertex as unchangeable as well
if ( unchangeableVerts_.test( newMesh->topology.org( e1 ) ) &&
unchangeableVerts_.test( newMesh->topology.dest( e ) ) )
unchangeableVerts_.autoResizeSet( newMesh->topology.org( e ) );
};
}
};
for ( auto e : bd )
if ( !newMesh->topology.left( e ) )
fillHoleNicely( *newMesh, e, settings );
@@ -739,9 +739,7 @@ void SurfaceManipulationWidget::updateRegion_( const Vector2f& mousePos )
}
for ( auto v : singleEditingRegion_ )
singleEditingRegion_.set( v, editingDistanceMap_[v] <= settings_.radius );
if ( singleEditingRegion_.any() && unchangeableVerts_.any() )
singleEditingRegion_ -= unchangeableVerts_;

singleEditingRegion_ -= unchangeableVerts_;
}

void SurfaceManipulationWidget::abortEdit_()