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

[Topology.Mapping] Edge2QuadTopologicalMapping: use Links for required QuadSet components #4361

Merged
merged 4 commits into from
Dec 27, 2023

Conversation

fredroy
Copy link
Contributor

@fredroy fredroy commented Dec 15, 2023

Edge2QuadTopologicalMapping needs QuadSet container and modifier, and was merely just searching into its node for them, with no check whatsoever. So if one of the two was not present, a crash happened without any warning/error...

So in this PR, links are added (so no need to search the context every time), warn the user if not set and let the component to Invalid

+ some cleanups for good measure


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@fredroy fredroy added pr: fix Fix a bug pr: status to review To notify reviewers to review this pull-request pr: clean Cleaning the code labels Dec 15, 2023
@fredroy
Copy link
Contributor Author

fredroy commented Dec 15, 2023

[ci-build][with-all-tests]

Copy link
Contributor

@alxbilger alxbilger left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -31,6 +31,13 @@
#include <sofa/core/BaseMapping.h>
#include <sofa/core/behavior/MechanicalState.h>


namespace sofa::component::topology::container::dynamic
Copy link
Contributor

Choose a reason for hiding this comment

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

I am surprised that forward declaration works with Links

Copy link
Contributor Author

@fredroy fredroy Dec 15, 2023

Choose a reason for hiding this comment

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

I wanted to try for the lolz but it works on MSVC. Curious to see if it will be the same for gcc/clang (if the CI does want to do its job) 😅
EDIT: it works too 👍

@fredroy
Copy link
Contributor Author

fredroy commented Dec 16, 2023

[ci-build][with-all-tests]

@hugtalbot hugtalbot added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Dec 20, 2023
@epernod epernod merged commit a624001 into sofa-framework:master Dec 27, 2023
3 checks passed
@fredroy fredroy deleted the edge2quad_uselinks branch January 7, 2024 23:40
@hugtalbot hugtalbot added pr: backport todo This PR will be backported into the release preceeding its milestone. and removed pr: backport todo This PR will be backported into the release preceeding its milestone. labels Jan 10, 2024
@hugtalbot hugtalbot added this to the v24.06 milestone Jan 10, 2024
hugtalbot pushed a commit to hugtalbot/sofa that referenced this pull request Jan 16, 2024
…d QuadSet components (sofa-framework#4361)

* use links for quad container/modifier

* cleaning

---------

Co-authored-by: Paul Baksic <[email protected]>
Co-authored-by: erik pernod <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: clean Cleaning the code pr: fix Fix a bug pr: status ready Approved a pull-request, ready to be squashed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants