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

Map tool idenfify: Add support for index in mesh data #60896

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

Conversation

ptitjano
Copy link
Collaborator

@ptitjano ptitjano commented Mar 7, 2025

Description

This extends the identify tool to also display the index of a vertex/face/edge of a mesh.
See, the screenshot below:

image

@ptitjano ptitjano self-assigned this Mar 7, 2025
@github-actions github-actions bot added this to the 3.44.0 milestone Mar 7, 2025
@ptitjano ptitjano force-pushed the mesh-closest-element branch 3 times, most recently from d595836 to d522b8a Compare March 7, 2025 16:42
ptitjano added 2 commits March 7, 2025 17:46
This is a generalization of `snapOnElement`, since it allows to also
get the element (face, vertex or edge) index.
This is achieved by using `QgsMeshLayer::closestElement()` instead of
`QgsMeshLayer::snapOnElement()`.
@ptitjano ptitjano force-pushed the mesh-closest-element branch from d522b8a to 3259f79 Compare March 7, 2025 16:46
Copy link

github-actions bot commented Mar 7, 2025

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 3259f79)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 3259f79)

*
* \since QGIS 3.44
*/
int closestElement( QgsMesh::ElementType elementType, const QgsPointXY &point, double searchRadius, QgsPointXY &projectedPoint ) const;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
int closestElement( QgsMesh::ElementType elementType, const QgsPointXY &point, double searchRadius, QgsPointXY &projectedPoint ) const;
int closestElement( QgsMesh::ElementType elementType, const QgsPointXY &point, double searchRadius, QgsPointXY &projectedPoint SIP_OUT ) const;

@@ -925,38 +926,16 @@ int QgsMeshLayer::closestEdge( const QgsPointXY &point, double searchRadius, Qgs
return selectedIndex;
}

QgsMeshDatasetIndex QgsMeshLayer::staticVectorDatasetIndex( int group ) const
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why move this code? It clutters the diff here, and will make git blame a bit more frustrating...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants