From b773df8ac77b9a5a285ecff6b934e4df5febe57b Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Tue, 16 Jun 2026 15:32:04 +0200 Subject: [PATCH] Replace deprecated PYBIND11_OVERLOAD* by PYBIND11_OVERRIDE* --- .../Sofa/src/SofaPython3/Sofa/Core/Binding_Component.cpp | 6 +++--- .../Sofa/src/SofaPython3/Sofa/Core/Binding_Controller.cpp | 6 +++--- .../Sofa/src/SofaPython3/Sofa/Core/Binding_DataEngine.cpp | 2 +- .../Sofa/src/SofaPython3/Sofa/Core/Binding_ForceField.cpp | 8 ++++---- .../Sofa/src/SofaPython3/Sofa/Core/Binding_Mapping.cpp | 8 ++++---- .../Sofa/src/SofaPython3/Sofa/Core/Binding_Prefab.cpp | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Component.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Component.cpp index 39d1bab69..a9b9defbe 100644 --- a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Component.cpp +++ b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Component.cpp @@ -42,7 +42,7 @@ Component_Trampoline::Component_Trampoline() void Component_Trampoline::draw(const sofa::core::visual::VisualParams* params) { PythonEnvironment::executePython(this, [this, params](){ - PYBIND11_OVERLOAD(void, Component, draw, params); + PYBIND11_OVERRIDE(void, Component, draw, params); }); } @@ -50,14 +50,14 @@ void Component_Trampoline::init() { PythonEnvironment::executePython(this, [this](){ initializePythonCache(); - PYBIND11_OVERLOAD(void, Component, init, ); + PYBIND11_OVERRIDE(void, Component, init, ); }); } void Component_Trampoline::reinit() { PythonEnvironment::executePython(this, [this](){ - PYBIND11_OVERLOAD(void, Component, reinit, ); + PYBIND11_OVERRIDE(void, Component, reinit, ); }); } diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Controller.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Controller.cpp index 06f87a98d..bf9a4240f 100644 --- a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Controller.cpp +++ b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Controller.cpp @@ -50,7 +50,7 @@ Controller_Trampoline::Controller_Trampoline() void Controller_Trampoline::draw(const sofa::core::visual::VisualParams* params) { PythonEnvironment::executePython(this, [this, params](){ - PYBIND11_OVERLOAD(void, Controller, draw, params); + PYBIND11_OVERRIDE(void, Controller, draw, params); }); } @@ -58,14 +58,14 @@ void Controller_Trampoline::init() { PythonEnvironment::executePython(this, [this](){ initializePythonCache(); - PYBIND11_OVERLOAD(void, Controller, init, ); + PYBIND11_OVERRIDE(void, Controller, init, ); }); } void Controller_Trampoline::reinit() { PythonEnvironment::executePython(this, [this](){ - PYBIND11_OVERLOAD(void, Controller, reinit, ); + PYBIND11_OVERRIDE(void, Controller, reinit, ); }); } diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_DataEngine.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_DataEngine.cpp index 2a2af6991..30fb21044 100644 --- a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_DataEngine.cpp +++ b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_DataEngine.cpp @@ -51,7 +51,7 @@ std::string DataEngine_Trampoline::getClassName() const void DataEngine_Trampoline::init() { PythonEnvironment::executePython(this, [this](){ - PYBIND11_OVERLOAD(void, DataEngine, init, ); + PYBIND11_OVERRIDE(void, DataEngine, init, ); }); } diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_ForceField.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_ForceField.cpp index de486854d..58ae5ab86 100644 --- a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_ForceField.cpp +++ b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_ForceField.cpp @@ -84,7 +84,7 @@ namespace sofapython3 if(!mstate.get()) throw py::type_error("Missing mechanical state."); - PYBIND11_OVERLOAD(void, ForceField, init,); + PYBIND11_OVERRIDE(void, ForceField, init,); } template @@ -99,7 +99,7 @@ namespace sofapython3 "kFactor"_a=mparams->kFactor(), "isImplicit"_a=mparams->implicit(), "energy"_a=mparams->energy()); - PYBIND11_OVERLOAD_PURE(void, ForceField, addForce, mp, PythonFactory::toPython(&f), PythonFactory::toPython(&x), PythonFactory::toPython(&v)); + PYBIND11_OVERRIDE_PURE(void, ForceField, addForce, mp, PythonFactory::toPython(&f), PythonFactory::toPython(&x), PythonFactory::toPython(&v)); } template @@ -114,7 +114,7 @@ namespace sofapython3 "kFactor"_a=mparams->kFactor(), "isImplicit"_a=mparams->implicit() ); - PYBIND11_OVERLOAD_PURE(void, ForceField, addDForce, mp, PythonFactory::toPython(&df), PythonFactory::toPython(&dx)); + PYBIND11_OVERRIDE_PURE(void, ForceField, addDForce, mp, PythonFactory::toPython(&df), PythonFactory::toPython(&dx)); } @@ -129,7 +129,7 @@ namespace sofapython3 "isImplicit"_a=mparams->implicit() ); - PYBIND11_OVERLOAD_PURE(py::object, ForceField, addKToMatrix, mp, nIndices, nDofs); + PYBIND11_OVERRIDE_PURE(py::object, ForceField, addKToMatrix, mp, nIndices, nDofs); } template diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Mapping.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Mapping.cpp index 91f180391..c295f644a 100644 --- a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Mapping.cpp +++ b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Mapping.cpp @@ -92,7 +92,7 @@ namespace sofapython3 "isImplicit"_a=mparams->implicit(), "energy"_a=mparams->energy()); - PYBIND11_OVERLOAD_PURE(void, Inherit1, apply, mp, + PYBIND11_OVERRIDE_PURE(void, Inherit1, apply, mp, PythonFactory::toPython(&out), PythonFactory::toPython(&in)); } @@ -108,7 +108,7 @@ namespace sofapython3 "isImplicit"_a=mparams->implicit(), "energy"_a=mparams->energy()); - PYBIND11_OVERLOAD_PURE(void, Inherit1, applyJ, mp, + PYBIND11_OVERRIDE_PURE(void, Inherit1, applyJ, mp, PythonFactory::toPython(&out), PythonFactory::toPython(&in)); } @@ -123,7 +123,7 @@ namespace sofapython3 "isImplicit"_a=mparams->implicit(), "energy"_a=mparams->energy()); - PYBIND11_OVERLOAD_PURE(void, Inherit1, applyJT, mp, + PYBIND11_OVERRIDE_PURE(void, Inherit1, applyJT, mp, PythonFactory::toPython(&out), PythonFactory::toPython(&in)); } @@ -135,7 +135,7 @@ namespace sofapython3 py::dict mp = py::dict("time"_a=getContext()->getTime()); - PYBIND11_OVERLOAD_PURE(void, Inherit1, applyConstraintsJT, mp, + PYBIND11_OVERRIDE_PURE(void, Inherit1, applyConstraintsJT, mp, PythonFactory::toPython(&out), PythonFactory::toPython(&in)); } diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Prefab.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Prefab.cpp index dfdd2cc31..36e941282 100644 --- a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Prefab.cpp +++ b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Prefab.cpp @@ -61,7 +61,7 @@ void Prefab_Trampoline::doReInit() } try{ this->d_componentState.setValue(sofa::core::objectmodel::ComponentState::Valid); - PYBIND11_OVERLOAD(void, Prefab, doReInit, ); + PYBIND11_OVERRIDE(void, Prefab, doReInit, ); } catch (std::exception& e) { this->d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid);