sofa
sofa copied to clipboard
[Core] Make src an explicit link and support late update
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).
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 ?
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
I mean having the ability to links to objects that are not yet created.
The late initialization has been removed. Now, this PR only creates the src
link.
Test are still failing @alxbilger and many warnings seem to be added :drop_of_blood:
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
https://github.com/sofa-framework/sofa/blob/dccb9849ed4b08a305086e02131ce7c25c79eff0/Sofa/Component/Topology/Utility/tests/TopologyChecker_test.cpp#L1202-L1205