Skip to content
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

Apply new registration mechanism #141

Merged

Conversation

bakpaul
Copy link
Collaborator

@bakpaul bakpaul commented Nov 29, 2024

This applies the new factory registration mechanism as introduced by [All] ObjectFactory: Explicit components registration #4429

In the process I've encountered a problem of consistency of namespace. I needed all of the registering methods to be in the Cosserat namespace. But a lot of SOFA namespace are used. This is bad practice, only the Cosserat namespace should be used in this plugin.

@bakpaul
Copy link
Collaborator Author

bakpaul commented Dec 2, 2024

Please test it on your side before merging: while testing it on my side using the examples, I've had a lots of warning because of multiple registration in the factory. This might be due to multiple loading of the library. Problem is that the example are using some custom headers and so on, I preferred to have your feedback before taking a closer look.

Copy link
Collaborator

@adagolodjo adagolodjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it stands, I think the code is good. But, you're right, I'll try to compile it on my machine and test scenes before a possible merge.

Copy link
Member

@alxbilger alxbilger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, @adagolodjo could you take the opportunity to review all the Component descriptions? I see a lot of copy/paste.

src/Cosserat/constraint/QPSlidingConstraint.cpp Outdated Show resolved Hide resolved
src/Cosserat/engine/ProjectionEngine.cpp Show resolved Hide resolved
src/Cosserat/forcefield/BeamHookeLawForceField.cpp Outdated Show resolved Hide resolved
src/Cosserat/initCosserat.cpp Show resolved Hide resolved
@adagolodjo
Copy link
Collaborator

Overall, @adagolodjo could you take the opportunity to review all the Component descriptions? I see a lot of copy/paste.

@alxbilger, This has been done in some pending PRs, and some of them are deprecated. So I'm trying to reactivate them as I go. Let's push this one before it becomes deprecated as well.

@alxbilger
Copy link
Member

@adagolodjo ok but remove the comments looking like:

////////////////////////////////////////////    FACTORY    //////////////////////////////////////////////
// Registering the component
// see: http://wiki.sofa-framework.org/wiki/ObjectFactory
// 1-RegisterObject("description") + .add<> : Register the component
// 2-.add<>(true) : Set default template

It's very related to this PR.

@adagolodjo
Copy link
Collaborator

@adagolodjo ok but remove the comments looking like:

////////////////////////////////////////////    FACTORY    //////////////////////////////////////////////
// Registering the component
// see: http://wiki.sofa-framework.org/wiki/ObjectFactory
// 1-RegisterObject("description") + .add<> : Register the component
// 2-.add<>(true) : Set default template

It's very related to this PR.

Done, here bakpaul#1.

@alxbilger alxbilger force-pushed the 24_11_apply_new_factory_registration branch from 373aa69 to 89c9053 Compare January 9, 2025 08:04
@alxbilger alxbilger force-pushed the 24_11_apply_new_factory_registration branch from 89c9053 to 84806f9 Compare January 9, 2025 08:06
@alxbilger
Copy link
Member

@bakpaul @adagolodjo I took the liberty to:

  • Remove all inconsistent comments
  • Restore the previous formatting on some files. They were changed by mistake I think.
  • Uniformize template specialization
  • Make minor cleaning

I recommend a last review from you.

@adagolodjo I realized seconds ago that you did some of the changes in a dedicated PR. Sorry

@bakpaul
Copy link
Collaborator Author

bakpaul commented Jan 9, 2025

I'll take a look. In the mean(time, do I still need to merge bakpaul#1 ?

@alxbilger
Copy link
Member

@bakpaul no it can be closed. I did not see this PR unfortunately.

@alxbilger alxbilger merged commit 0daabee into SofaDefrost:master Jan 9, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants