Skip to content
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

Mesh selection actions #58888

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

JanCaha
Copy link
Contributor

@JanCaha JanCaha commented Sep 27, 2024

Description

Adds two new actions for selecting vertices on Mesh:

  • select isolated vertices which are not part of any face
  • select all vertices from mesh layer

@github-actions github-actions bot added this to the 3.40.0 milestone Sep 27, 2024
Copy link

github-actions bot commented Sep 27, 2024

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit 2965486)

@uclaros uclaros added Frozen Feature freeze - Do not merge! Mesh Related to general mesh layer handling (not specific data formats) labels Sep 27, 2024
Comment on lines 287 to 292
QList<int> verticesIndexes;
verticesIndexes.reserve( mCurrentLayer->meshVertexCount() );
for ( int i = 0; i < mCurrentLayer->meshVertexCount(); i++ )
{
verticesIndexes.append( i );
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meshVertexCount() says:

\note during mesh editing, some vertices can be void and are not included in this returned value

does that affect us?
Would it be better to maybe use mCurrentLayer->selectVerticesByExpression( true ) to get the indexes instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good point.

We could avoid evaluating the expression by using mCurrentLayer->nativeMesh()->vertexCount(). That would skip need to use QgsExpression and its evaluation. It is what the mCurrentLayer->selectVerticesByExpression() does internally anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frozen Feature freeze - Do not merge! Mesh Related to general mesh layer handling (not specific data formats)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants