During this refactoring, I've stumbled upon two issues :
The first refactoring has some errors, where the new type was compatible with the old one, but not the exact one. So I fixed it. Also Sometimes the old data type was changed but only on the old symbol, which is strange and certainly made the compat layer break is used because often the two types where completely unrelated but setParent isn't templated so....
This compat layer only works for Data<T> every types that inherits from it, will only see the original Data<T> methods taken into account in the compact layer. This was the case here for DataFileName and all TopologicalData.
I've decided to adopt two different strategy :
For DataFileName I didn't put my component and still usef the 'setParent' strategy. This is because, a priori, we won't chage a filename data during execution, this is often a given parameter, but we often use methods specific to DataFileName.
For the topological one, usually topological mechanisms are used in very specific classes to handle topological changes. But in a user perspective, it is often used as a classical Data<vector<Index>>. So What I did is use RenamedData on those, allowing the compat on the Data<T> level, but not for the topological methods which are not working anymore on the old symbol (and will create a compilation error if used)...
To make it cleaner we might need to create new RenamedData class for all classes inheriting from Data<T>. Which is not the purpose of this PR.
This does the issue https://github.com/sofa-framework/sofa/issues/4845.
During this refactoring, I've stumbled upon two issues :
setParent
isn't templated so....Data<T>
every types that inherits from it, will only see the originalData<T>
methods taken into account in the compact layer. This was the case here forDataFileName
and allTopologicalData
.I've decided to adopt two different strategy :
DataFileName
I didn't put my component and still usef the 'setParent' strategy. This is because, a priori, we won't chage a filename data during execution, this is often a given parameter, but we often use methods specific toDataFileName
.Data<vector<Index>>
. So What I did is useRenamedData
on those, allowing the compat on theData<T>
level, but not for the topological methods which are not working anymore on the old symbol (and will create a compilation error if used)...To make it cleaner we might need to create new
RenamedData
class for all classes inheriting fromData<T>
. Which is not the purpose of this PR.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