-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SofaKernel] implement activer's code at CollisionModel. #1259
Conversation
…ting from this class can compute sphere(s) de/activation during execution
Hi remi, Thanks for the PR. |
Actually this feature is already available for PointModel and LineModel. That's why I just added it in the same way for SphereModel. |
Hi, can you explain me in which case you need a contoller to inherite from this class to active or not the sphereModel compare to having a controller that search for the sphereModel and change the Data activate |
Indeed epernod, for each sphere/line/point the LocalMinDistance component checks if it is activated or not, not the whole collisionModel component. |
protected: | ||
core::behavior::MechanicalState<DataTypes>* mstate; | ||
Data<std::string> SphereActiverPath; ///< path of a component SphereActiver that activate or deactivate collision sphere during execution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of Datastd::string, use Link for component path and stuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I applied the same pattern as it was coded for Point/Line activers.
You probably mean I should correct Sphere Line and Point activers then ? Would not it break some plugin controller code ? Do we care about it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right about breaking things, but it is for the sake of cleaning 🤽♂ (just add breaking flag)
Personally I would bring at least this part (Link) to the other line/point activers ; especially if we suppose that the task #1262 wont be completed before a while...
Just my cent though 🦆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, if a feature is duplicated in more than two component...is a strong indication that it is time to re-factor it. I may be wrong but do #1262 task so complex ?
[ci-build][with-all-tests] |
👍 |
I just gave it a look and it seems easy to move up the whole code at CollisionModel level... so please do so, code will be cleaner, shorter and will offer a more consistent interface to users. In addition I see no problem in breaking code that does not follows Sofa guidelines. So renaming activated() into isActive() and other stuff like that would be welcome to :) |
add SphereActiver class in SphereModel so that some controller inheriting from this class can compute sphere(s) de/activation during execution
This PR:
Reviewers will merge only if all these checks are true.