sofa icon indicating copy to clipboard operation
sofa copied to clipboard

[Core] Make src an explicit link and support late update

Open alxbilger opened this issue 2 years ago • 7 comments

if the attribute "src" is found, a link is dynamically added to the object. If the link is resolved right away, it links the Data. If the link is not resolved, it will try later in the updateLinks function.

It allows to write:

<OglModel  name="OglModel" src="@SOFA_pod" />
<MeshOBJLoader name="SOFA_pod" filename="mesh/SOFA_pod.obj" handleSeams="1" />

Before this PR, the src object must be declared before the src attribute. It was not possible to declare it after, such as in the previous example.


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 Jul 21 '22 07:07 alxbilger

Hi @alxbilger,

Thanks for the PR, especially because I have interest in having src (and few other) attribute handled as data or link (see: https://github.com/sofa-framework/sofa/pull/116 and https://github.com/sofa-framework/sofa/issues/41).

What rise my attention is that in the past it was discussed that out of order references may not be a feature to preserve so I wonder if you have specific use case for such a thing ?

damienmarchal avatar Jul 21 '22 12:07 damienmarchal

We are not sure to understand your point "out of order references may not be a feature" @damienmarchal let's chat about this at next sofa-dev

hugtalbot avatar Jul 27 '22 09:07 hugtalbot

I mean having the ability to links to objects that are not yet created.

damienmarchal avatar Jul 27 '22 09:07 damienmarchal

The late initialization has been removed. Now, this PR only creates the src link.

alxbilger avatar Aug 25 '22 14:08 alxbilger

Test are still failing @alxbilger and many warnings seem to be added :drop_of_blood:

hugtalbot avatar Aug 26 '22 07:08 hugtalbot

Not sure why these tests do not pass @alxbilger https://github.com/sofa-framework/sofa/blob/dccb9849ed4b08a305086e02131ce7c25c79eff0/Sofa/Component/Topology/Utility/tests/TopologyChecker_test.cpp#L1346-L1369

hugtalbot avatar Aug 31 '22 09:08 hugtalbot

https://github.com/sofa-framework/sofa/blob/dccb9849ed4b08a305086e02131ce7c25c79eff0/Sofa/Component/Topology/Utility/tests/TopologyChecker_test.cpp#L1202-L1205

hugtalbot avatar Aug 31 '22 09:08 hugtalbot