sofa icon indicating copy to clipboard operation
sofa copied to clipboard

[All] Remove SOFA_ENABLE_LEGACY_HEADERS usage

Open fredroy opened this issue 1 year ago • 1 comments

A continuation of

  • #4812

but much bigger and less trivial.

This PR removes SOFA_ENABLE_LEGACY_HEADERS, implying:

  • no more collections/deprecated projects which was to ensure the continuity of Sofa.NG
  • some renaming in MultiThreading and SofaCUDA.

The deletion of the layer compat between old and new modules was acted for 23.06 so not a big deal by itself (only 1.5 year late🤷‍♂️ ). But some olden modules still have some code/components:

  • SofaGraphComponent: with a Gravity component
  • SofaMiscCollision: with DefaultCollisionGroupManager, SolverMerger components and RayTriangleVisitor visitor
  • SleepController: with a SleepControllercomponent
  • SofaValidation: with various measuring stuff components. There is also SofaExporter which had some forgotten(?) examples of components which were moved. So the examples have been just moved as well

So what should be done for these components? IMO (not done yet)

  • Gravity seems useless/not usable.
  • SleepController might maybe probably be interesting
  • DefaultCollisionGroupManager, SolverMerger were bogus and RayTriangleVisitor not used at all
  • SofaValidation may be totally transformed as a plugin (as in applications/plugins)

To be discussed.


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 avatar Jul 05 '24 06:07 fredroy

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

fredroy avatar Jul 05 '24 06:07 fredroy

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

fredroy avatar Jul 09 '24 01:07 fredroy

  • Gravity should be moved into MechanicalLoad
  • SleepController , @bakpaul will take a look
  • SofaMiscCollision should be fully removed
  • SofaValidation: archive
  • SofaExporter: to check

hugtalbot avatar Jul 17 '24 07:07 hugtalbot

So I took a look at the SleepController. It simply puts context to sleep where the mechanical object has a max velocity under a certain threshold. Then wake them up again only when a collision occurs with another object that is moving. Three remarks :

  • Being put to sleep disables any mechanical visitor to be applied on the node and deactivates its constraint corrections. So no more computing (no system build, no integration, only collision detection)
  • This works well only for scenes where external interaction only arise between two objects colliding, neither by the mean of a change of external forces (dynamic vector field for instance), or of constraint state changes not managed by the collision pipeline (for instance statically defined interaction constraints such as cable constraints).
  • The code seems overly complicated for what it performs but certainly does what it says it does. I didn't try it but it looks ok.

Sincerely, I cannot see myself advising anyone to use it in their scene given the fact that the use case doesn't apply for the majority of the scenes (especially for soft robotics). So I wouldn't mind never seeing it again...

bakpaul avatar Jul 18 '24 15:07 bakpaul

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

fredroy avatar Jul 22 '24 00:07 fredroy

Reviews seem to have been taken into account, right @fredroy ? CI says yes!

hugtalbot avatar Jul 29 '24 15:07 hugtalbot

Reviews seem to have been taken into account, right @fredroy ? CI says yes!

Yes

fredroy avatar Jul 29 '24 23:07 fredroy