[Collision.Geometry] Use StateAccessor and Topology accessor#5908
[Collision.Geometry] Use StateAccessor and Topology accessor#5908alxbilger wants to merge 7 commits intosofa-framework:masterfrom
Conversation
|
[ci-build][with-all-tests] |
| d_componentState.setValue(sofa::core::objectmodel::ComponentState::Valid); | ||
| if (!this->isComponentStateInvalid()) | ||
| { | ||
| this->validateMState(); |
There was a problem hiding this comment.
validateMState() doesn't set the component state to be valid when the mstate exists. We either must change tje validateMSatet method or add a component state modification here
There was a problem hiding this comment.
Why does it have to be valid? The only useful information is knowing if the state is invalid or not, but the validity is not important. Specially because this class in designed to be a base class. In this case, we don't have any rule to set the state to valid. The most illustrative example is BaseObject::init.
There was a problem hiding this comment.
Because it was the case before. Your PR is changing this component and fully rely on derived class to set the valid state.
IMO, we shouldn't expect only the derived class to set valid when it is finally the case, it is too difficult to maintain, we never know if a class is a 'real' leaf or not. With this design we can endup having object that are totally fine, all check passed, but because the last class didn't actually validate it, the object is in an invalid state. What I would advocate for is that all class set to valid as long as its test passes. And let the following class invalidate the state if necessary. This way no matter what is the class place in the inheritance tree, we know that the component state will always be defined.
But maybe this is more a meta question ?
|
|
This is to factorize the behavior, have the same common variables and expose the links.
[with-all-tests]
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