sofa icon indicating copy to clipboard operation
sofa copied to clipboard

[Core] Warn when input/output of mapping is deduced automatically

Open alxbilger opened this issue 10 months ago • 1 comments

The search for "input" and "output" can be moved into the init method. It is called anyway by the object factory. If we do that, the function create is identical to BaseObject::create. It is then useless to define it again.

In case a mapping is defined without "input" or "output", the warning looks like:

[WARNING] [RigidMapping()] The attribute 'input' of this component has not been defined. It is automatically set to '@/Torus3/MechanicalObject1'. It is recommended to define it to avoid any error.
[WARNING] [RigidMapping()] The attribute 'output' of this component has not been defined. It is automatically set to '@/Torus3/Surf2/MechanicalObject1'. It is recommended to define it to avoid any error.

To better understand the implicit mechanism, the full link is set. It is much more readable than "@../" and "@./"


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

alxbilger avatar Jan 22 '25 14:01 alxbilger

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

fredroy avatar Jan 28 '25 10:01 fredroy