From 3be744dc87000b205b85fe35de930848d7b4256b Mon Sep 17 00:00:00 2001 From: Damien Marchal Date: Wed, 26 Aug 2026 14:49:42 +0200 Subject: [PATCH] Integrate removale of DAGSimulation --- Plugin/CMakeLists.txt | 4 ++-- Plugin/src/SofaPython3/SceneLoaderPY3.cpp | 2 +- Plugin/src/SofaPython3/initModule.cpp | 2 -- bindings/Sofa/src/SofaPython3/Sofa/Simulation/CMakeLists.txt | 4 ++-- .../src/SofaPython3/Sofa/Simulation/Submodule_Simulation.cpp | 3 --- bindings/SofaRuntime/CMakeLists.txt | 4 ++-- .../src/SofaPython3/SofaRuntime/Module_SofaRuntime.cpp | 1 - 7 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Plugin/CMakeLists.txt b/Plugin/CMakeLists.txt index 577acbb08..c7bf8f634 100644 --- a/Plugin/CMakeLists.txt +++ b/Plugin/CMakeLists.txt @@ -27,14 +27,14 @@ set(SOURCE_FILES ) find_package(pybind11 CONFIG REQUIRED) -sofa_find_package(Sofa.Simulation.Graph REQUIRED) +sofa_find_package(Sofa.Simulation.Common REQUIRED) add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) add_library(SofaPython3::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) target_compile_definitions(${PROJECT_NAME} PRIVATE "-DSOFA_BUILD_SOFAPYTHON3") -target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Graph) +target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Common) target_link_libraries(${PROJECT_NAME} PUBLIC pybind11::module pybind11::embed) set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME SofaPython3) diff --git a/Plugin/src/SofaPython3/SceneLoaderPY3.cpp b/Plugin/src/SofaPython3/SceneLoaderPY3.cpp index 9185e1593..e7902eb1c 100644 --- a/Plugin/src/SofaPython3/SceneLoaderPY3.cpp +++ b/Plugin/src/SofaPython3/SceneLoaderPY3.cpp @@ -86,7 +86,7 @@ bool SceneLoaderPY3::syntaxForAddingRequiredPlugin(const std::string& pluginName sofa::simulation::Node::SPtr SceneLoaderPY3::doLoad(const std::string& filename, const std::vector& sceneArgs) { - if (sofa::simulation::Simulation* simulation = sofa::simulation::getSimulation()) + if (sofa::simulation::Simulation* simulation = sofa::simulation::MainSimulation::getSimulation()) { sofa::simulation::Node::SPtr root = simulation->createNewNode("root"); loadSceneWithArguments(filename.c_str(), sceneArgs, root); diff --git a/Plugin/src/SofaPython3/initModule.cpp b/Plugin/src/SofaPython3/initModule.cpp index 0f8fcd798..f3654a7cc 100644 --- a/Plugin/src/SofaPython3/initModule.cpp +++ b/Plugin/src/SofaPython3/initModule.cpp @@ -29,7 +29,6 @@ using sofapython3::PythonEnvironment; #include #include #include -#include extern "C" { @@ -50,7 +49,6 @@ void initExternalModule() sofa::defaulttype::init(); sofa::core::init(); sofa::simulation::core::init(); - sofa::simulation::graph::init(); PythonEnvironment::Init(); first = false; diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Simulation/CMakeLists.txt b/bindings/Sofa/src/SofaPython3/Sofa/Simulation/CMakeLists.txt index 4d0456d0c..931e9e3bc 100644 --- a/bindings/Sofa/src/SofaPython3/Sofa/Simulation/CMakeLists.txt +++ b/bindings/Sofa/src/SofaPython3/Sofa/Simulation/CMakeLists.txt @@ -18,7 +18,7 @@ if (NOT TARGET SofaPython3::Plugin) sofa_find_package(SofaPython3 REQUIRED COMPONENTS Plugin) endif() -sofa_find_package(Sofa.Simulation.Graph REQUIRED) +sofa_find_package(Sofa.Simulation.Common REQUIRED) SP3_add_python_module( TARGET ${PROJECT_NAME} @@ -27,5 +27,5 @@ SP3_add_python_module( DESTINATION Sofa SOURCES ${SOURCE_FILES} HEADERS ${HEADER_FILES} - DEPENDS Sofa.Simulation.Graph SofaPython3::Plugin + DEPENDS Sofa.Simulation.Common SofaPython3::Plugin ) diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Simulation/Submodule_Simulation.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Simulation/Submodule_Simulation.cpp index 6f875dfc9..dc0931a38 100644 --- a/bindings/Sofa/src/SofaPython3/Sofa/Simulation/Submodule_Simulation.cpp +++ b/bindings/Sofa/src/SofaPython3/Sofa/Simulation/Submodule_Simulation.cpp @@ -42,7 +42,6 @@ using sofa::simulation::Simulation; #include #include #include -#include #include #include #include @@ -82,7 +81,6 @@ PYBIND11_MODULE(Simulation, simulation) // These are needed to force the dynamic loading of module dependencies (found in CMakeLists.txt) sofa::core::init(); sofa::simulation::core::init(); - sofa::simulation::graph::init(); simulation.doc() =sofapython3::doc::simulation::Class; @@ -135,7 +133,6 @@ PYBIND11_MODULE(Simulation, simulation) sofa::simulation::core::cleanup(); sofa::simulation::common::cleanup(); - sofa::simulation::graph::cleanup(); msg_info("SofaPython3.Simulation") << "Sofa.Simulation unload()"; })); diff --git a/bindings/SofaRuntime/CMakeLists.txt b/bindings/SofaRuntime/CMakeLists.txt index 52c4d80e8..cd18aef1b 100644 --- a/bindings/SofaRuntime/CMakeLists.txt +++ b/bindings/SofaRuntime/CMakeLists.txt @@ -12,7 +12,7 @@ set(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/SofaPython3/SofaRuntime/Timer/Submodule_Timer_doc.h ) -sofa_find_package(Sofa.Simulation.Graph REQUIRED) +sofa_find_package(Sofa.Simulation.Common REQUIRED) SP3_add_python_package( SOURCE_DIRECTORY @@ -27,7 +27,7 @@ SP3_add_python_module( DESTINATION SofaRuntime SOURCES ${SOURCE_FILES} HEADERS ${HEADER_FILES} - DEPENDS Sofa.Simulation.Graph SofaPython3::Plugin SofaPython3::Bindings.Sofa.Core + DEPENDS Sofa.Simulation.Common SofaPython3::Plugin SofaPython3::Bindings.Sofa.Core ) sofa_create_component_in_package_with_targets( diff --git a/bindings/SofaRuntime/src/SofaPython3/SofaRuntime/Module_SofaRuntime.cpp b/bindings/SofaRuntime/src/SofaPython3/SofaRuntime/Module_SofaRuntime.cpp index 2c6636070..299b8081b 100644 --- a/bindings/SofaRuntime/src/SofaPython3/SofaRuntime/Module_SofaRuntime.cpp +++ b/bindings/SofaRuntime/src/SofaPython3/SofaRuntime/Module_SofaRuntime.cpp @@ -53,7 +53,6 @@ using sofapython3::SceneLoaderPY3; #include #include -#include #include "Timer/Submodule_Timer.h"