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

[MechanicalLoad] Replace doUpdateInternal by callback: ConstantFF #3924

Merged

Conversation

hugtalbot
Copy link
Contributor

@hugtalbot hugtalbot commented Jun 7, 2023

In the spirit of #3900 this PR applies the change on the ConstantForceField.

To be noted:

  • return have been added
  • the componentState must be added to trigger the callback
  • use function isComponentStateValid()
  • Create separate addUpdateCallback and created dedicated separate functions
  • Remove call to trackData for doUpdateInternal
  • Use Accessors (remove beginEdit)

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).

@hugtalbot hugtalbot added pr: status to review To notify reviewers to review this pull-request pr: clean Cleaning the code pr: dev meeting topic PR to be discussed in sofa-dev meeting labels Jun 7, 2023
@hugtalbot
Copy link
Contributor Author

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

@hugtalbot
Copy link
Contributor Author

just for your 👁️ @damienmarchal

@alxbilger
Copy link
Contributor

Is there a reason why not defining 4 callbacks instead of one with if conditions?

@hugtalbot
Copy link
Contributor Author

trackInternalData to remove

@hugtalbot
Copy link
Contributor Author

both comments:

  • Is there a reason why not defining 4 callbacks instead of one with if conditions? @alxbilger
  • trackInternalData to remove

are implemented in #3936

Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>
@hugtalbot hugtalbot requested a review from alxbilger June 13, 2023 19:19
@hugtalbot hugtalbot removed the pr: dev meeting topic PR to be discussed in sofa-dev meeting label Jun 19, 2023
@hugtalbot hugtalbot added pr: status wip Development in the pull-request is still in progress and removed pr: status to review To notify reviewers to review this pull-request labels Jun 28, 2023
@hugtalbot hugtalbot added pr: status to review To notify reviewers to review this pull-request pr: status wip Development in the pull-request is still in progress and removed pr: status wip Development in the pull-request is still in progress pr: status to review To notify reviewers to review this pull-request labels Jul 6, 2023
@hugtalbot hugtalbot added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels Jul 7, 2023
@hugtalbot
Copy link
Contributor Author

PR passes now and includes:

  • use function isComponentStateValid()
  • Create separate addUpdateCallback and created dedicated separate functions
  • remove call to trackData for doUpdateInternal
  • use Accessors (remove beginEdit)

Co-authored-by: Frederick Roy <fredroy@users.noreply.github.com>
@hugtalbot hugtalbot requested a review from fredroy July 12, 2023 07:33
@hugtalbot
Copy link
Contributor Author

waiting for your GO @alxbilger @damienmarchal
it would be to be merged along with #4019

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.

I still don't like that you keep empty functions with a comment explaining that the code changed. Git is made for that. I would remove reinit and doUpdateInternal. Otherwise, the PR looks ok even though I did not test it.

@hugtalbot
Copy link
Contributor Author

This PR has to be considered along with #4019

@fredroy fredroy 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 Jul 26, 2023
@bakpaul bakpaul merged commit 79d8c60 into sofa-framework:master Jul 26, 2023
7 of 8 checks passed
hugtalbot added a commit to hugtalbot/sofa that referenced this pull request Aug 2, 2023
@hugtalbot hugtalbot added this to the v23.12 milestone Aug 3, 2023
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: status ready Approved a pull-request, ready to be squashed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants