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] mesh frame editing part 3 - Advanced editing #44169

Merged
merged 8 commits into from
Jul 19, 2021

Conversation

vcloarec
Copy link
Member

@vcloarec vcloarec commented Jul 15, 2021

This PR is in the scope of qgis/QGIS-Enhancement-Proposals#228

API:
Here, advanced editing is introduced by a new interface abstract class QgsMeshAdvancedEditing.
Derived classes of this class can be implemented to make some advanced editing on a mesh: generation of faces to add to the mesh, particular operation on many faces or vertices.
The advanced editing is made by passing a QgsMeshAdvancedEditing instance to a QgsmeshEditor instance, and the editing is applied as other editing operations.

In this PR, two advanced editings are implemented:

  • Delaunay triangulation, implemented in the ANALYSIS part because it uses existing classes related to Delaunay Triangulation and Mesh
  • faces refinement, implemented directly in the CORE part

User interface in QGIS:
Delaunay triangulation and face refinement are accessible from the context menu in the map when vertices or/and faces are selected. Later, when other tools will be implemented, maybe these actions could be called from buttons in the mesh toolbar.

mapTool_delaunay_triangulation

mapTool_refine

@github-actions github-actions bot added this to the 3.22.0 milestone Jul 15, 2021
Copy link
Contributor

@PeterPetrik PeterPetrik left a comment

Choose a reason for hiding this comment

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

Nice!

I have a question for "advanced" editing tools? I am wondering if there are any other advanced editing tools coming ?

python/core/auto_generated/qgis.sip.in Outdated Show resolved Hide resolved
QgsMeshTriangulation triangulation;

QVector<int> triangulationVertexToMeshVertex( vertexIndextoTriangulate.count() );
const QgsMesh destinationMesh = *meshEditor->topologicalMesh()->mesh();
Copy link
Contributor

Choose a reason for hiding this comment

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

if it is const, cannot we just use pointer here and do not dereference it?

src/analysis/mesh/qgsmeshtriangulation.cpp Show resolved Hide resolved
src/analysis/mesh/qgsmeshtriangulation.h Show resolved Hide resolved
src/app/mesh/qgsmaptooleditmeshframe.cpp Outdated Show resolved Hide resolved
src/core/mesh/qgsmeshadvancedediting.h Show resolved Hide resolved
src/core/mesh/qgsmesheditor.cpp Outdated Show resolved Hide resolved
src/core/mesh/qgsmesheditor.h Outdated Show resolved Hide resolved
src/core/mesh/qgsmesheditor.cpp Outdated Show resolved Hide resolved
tests/src/core/testqgsmesheditor.cpp Show resolved Hide resolved
@vcloarec
Copy link
Member Author

I have a question for "advanced" editing tools? I am wondering if there are any other advanced editing tools coming ?

Yes, there are surely some other that coming, but later, not in this PR. A least, I think about the force mesh by a polyline, and maybe modify by expression.

@vcloarec vcloarec added Feature Mesh Related to general mesh layer handling (not specific data formats) labels Jul 15, 2021
@PeterPetrik
Copy link
Contributor

It would be good to not use force-push git commit (only when rebasing from master) since it makes reviews harder...

@vcloarec vcloarec closed this Jul 17, 2021
@vcloarec vcloarec reopened this Jul 17, 2021
@PeterPetrik PeterPetrik self-requested a review July 19, 2021 06:20
@PeterPetrik PeterPetrik merged commit 8cd8bec into qgis:master Jul 19, 2021
tomkralidis pushed a commit to tomkralidis/QGIS that referenced this pull request Aug 22, 2021
[mesh] [feature] Delaunay triangulation and face refinement for advanced mesh editing tools
@zacharlie zacharlie added the Changelog Items that are queued to appear in the visual changelog - remove after harvesting label Sep 19, 2021
@zacharlie zacharlie added ChangelogHarvested This PR description has been harvested in the Changelog already. and removed Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ChangelogHarvested This PR description has been harvested in the Changelog already. Feature Mesh Related to general mesh layer handling (not specific data formats)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants