Skip to content

[SofaBaseTopology] Add method to register callbacks directly using the topologyData#2375

Merged
fredroy merged 3 commits intosofa-framework:masterfrom
epernod:info_topo_handlers3
Oct 8, 2021
Merged

[SofaBaseTopology] Add method to register callbacks directly using the topologyData#2375
fredroy merged 3 commits intosofa-framework:masterfrom
epernod:info_topo_handlers3

Conversation

@epernod
Copy link
Copy Markdown
Contributor

@epernod epernod commented Oct 1, 2021

  • Add method addTopologyEventCallBack in TopologyData to be able to register callback to the TopologyHandler without having to manually create and manipulate this handler class.
    addTopologyEventCallBack redirect the registration to TopologyHandler->addCallBack
  • Various minor cleaning in code comments

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

@epernod epernod added pr: status to review To notify reviewers to review this pull-request pr: new feature Implement a new feature labels Oct 1, 2021
@epernod epernod added this to the v21.12 milestone Oct 1, 2021
@epernod epernod self-assigned this Oct 1, 2021
@epernod
Copy link
Copy Markdown
Contributor Author

epernod commented Oct 4, 2021

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

Copy link
Copy Markdown
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.

Only a minor typo

Comment thread SofaKernel/modules/SofaBaseTopology/src/SofaBaseTopology/TopologyData.inl Outdated

protected:
sofa::component::topology::TopologyDataHandler< TopologyElementType, VecT>* m_topologyHandler;
TopologyDataElementHandler* m_topologyHandler;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

unique ptr ?

…ogyData.inl

Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>
@fredroy
Copy link
Copy Markdown
Contributor

fredroy commented Oct 8, 2021

unique ptr ?

lifetime of m_topologyHandler is planned to handled in a future PR, therefore ... ready

@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 Oct 8, 2021
@fredroy fredroy merged commit d68a75a into sofa-framework:master Oct 8, 2021
@epernod epernod deleted the info_topo_handlers3 branch October 8, 2021 13:48
guparan pushed a commit that referenced this pull request Oct 28, 2021
…2377)

This PR depends on #2374 #2375 and #2376 and should be rebased before review.

- Remove old method `handleTopologyChange`
- Turn d_indices into TopologySubsetIndices, this automatically fix the topological changes update. 
- Fix the use of subset indices combined with topology changes.
- Add callback on endingEvent to update the totalMass/vertexMass
- Fix the center of gravity display when using subset of indices

______________________________________________________

Co-authored-by: Hugo <hugo.talbot@sofa-framework.org>
Co-authored-by: Frederick Roy <fredroy@users.noreply.github.com>
fredroy added a commit to fredroy/sofa that referenced this pull request Nov 8, 2021
…ofa-framework#2377)

This PR depends on sofa-framework#2374 sofa-framework#2375 and sofa-framework#2376 and should be rebased before review.

- Remove old method `handleTopologyChange`
- Turn d_indices into TopologySubsetIndices, this automatically fix the topological changes update. 
- Fix the use of subset indices combined with topology changes.
- Add callback on endingEvent to update the totalMass/vertexMass
- Fix the center of gravity display when using subset of indices

______________________________________________________

Co-authored-by: Hugo <hugo.talbot@sofa-framework.org>
Co-authored-by: Frederick Roy <fredroy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: new feature Implement a new feature pr: status ready Approved a pull-request, ready to be squashed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants