sofa-framework / sofa

Real-time multi-physics simulation with an emphasis on medical simulation.
https://www.sofa-framework.org
GNU Lesser General Public License v2.1
874 stars 297 forks source link

Updating a Tearing Example from Sofa v21.06 to v23.06: Seeking Assistance and Resources #4461

Open JaggerYu928 opened 3 months ago

JaggerYu928 commented 3 months ago

Hello developers of the Sofa framework, I found a tearing example that I need on this forum, but it is based on Sofa v21.06. Could you advise me on how to rewrite it for Sofa v23.06? Is there an API comparison chart or something similar that could assist me? Thank you so much for assisting me.

https://github.com/alireza-montazeri/SofaTearing

hugtalbot commented 3 months ago

Hey @JaggerYu928

For the RequiredPlugin, please see : https://www.sofa-framework.org/community/doc/using-sofa/sofa-ng-migration/ For the other errors, please make sure to carefully read the deprecation / warning messages

If you do not successfully solve them, please list the error output down here Cheers

JaggerYu928 commented 3 months ago

Hi @hugtalbot,

Thank you for your response. I've reviewed the CMakeLists.txt file in the SofaTearing plugin and noticed that the first two lines are:

find_package(SofaFramework REQUIRED) find_package(SofaGui REQUIRED)

However, I couldn't find SofaFramework and SofaGui mentioned in the SOFA-NG transition list you provided. It's possible that I've misunderstood the process for integrating a v21.06 plugin with SOFA v23.06. Could you please clarify this for me or offer further guidance?

Thank you.

hugtalbot commented 2 months ago

Hi @JaggerYu928

It should be Sofa.Framework and Sofa.GUI Let me know if this does it

JaggerYu928 commented 2 months ago

Hi @hugtalbot,

Apologies for the delayed response. I've recently updated my CMakeLists in the ext_plugin_repo, switching from sofa_add_plugin to sofa_add_subdirectory, which has successfully enabled the build of this plugin. Below is the revised CMakeLists for your reference:

cmake_minimum_required(VERSION 3.12)

find_package(SofaFramework REQUIRED)

# Changed from sofa_add_plugin to sofa_add_subdirectory
#sofa_add_plugin(SofaTearing/ SofaTearing)
sofa_add_subdirectory(plugin SofaTearing/ SofaTearing)