From c6b32412bd17857db99d8969ff22909cef78f05b Mon Sep 17 00:00:00 2001 From: Themis Skamagkis Date: Mon, 7 Sep 2026 13:19:26 +0200 Subject: [PATCH 1/2] [cmake] Add this module to sofa target --- src/SofaHaplyRobotics/config.h.in | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SofaHaplyRobotics/config.h.in b/src/SofaHaplyRobotics/config.h.in index 4ba6bdc..eebf207 100644 --- a/src/SofaHaplyRobotics/config.h.in +++ b/src/SofaHaplyRobotics/config.h.in @@ -23,6 +23,7 @@ #include #ifdef SOFA_BUILD_SOFAHAPLYROBOTICS +# define SOFA_TARGET SofaHaplyRobotics # define SOFA_HAPLYROBOTICS_API SOFA_EXPORT_DYNAMIC_LIBRARY #else # define SOFA_HAPLYROBOTICS_API SOFA_IMPORT_DYNAMIC_LIBRARY From 9b9694fda4023385c1e7c5c504a40573943a1f35 Mon Sep 17 00:00:00 2001 From: Themis Skamagkis Date: Mon, 7 Sep 2026 13:19:50 +0200 Subject: [PATCH 2/2] [src] Register object with more recent method --- src/SofaHaplyRobotics/Haply_Inverse3Controller.cpp | 8 +++++--- .../initSofaHaplyRoboticsPlugin.cpp | 13 +++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/SofaHaplyRobotics/Haply_Inverse3Controller.cpp b/src/SofaHaplyRobotics/Haply_Inverse3Controller.cpp index 40fdbc0..19eabde 100644 --- a/src/SofaHaplyRobotics/Haply_Inverse3Controller.cpp +++ b/src/SofaHaplyRobotics/Haply_Inverse3Controller.cpp @@ -48,9 +48,11 @@ const std::string Haply_Inverse3Controller::wirelessGripIdKey_ = "wireless_verse using namespace sofa::helper::system::thread; -const int Haply_Inverse3ControllerClass = core::RegisterObject("Driver allowing interfacing with Haptic Haply Robotics Inverse3 device.") - .add< Haply_Inverse3Controller >() - ; +void registerHaply_Inverse3Controller(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Driver allowing interfacing with Haptic Haply Robotics Inverse3 device.") + .add< Haply_Inverse3Controller >()); +} //constructeur diff --git a/src/SofaHaplyRobotics/initSofaHaplyRoboticsPlugin.cpp b/src/SofaHaplyRobotics/initSofaHaplyRoboticsPlugin.cpp index e2e03c7..678f020 100644 --- a/src/SofaHaplyRobotics/initSofaHaplyRoboticsPlugin.cpp +++ b/src/SofaHaplyRobotics/initSofaHaplyRoboticsPlugin.cpp @@ -19,6 +19,13 @@ ****************************************************************************/ #include +#include + +namespace sofa::HaplyRobotics +{ + void registerHaply_Inverse3Controller(sofa::core::ObjectFactory* factory); +} + namespace sofa::component { @@ -31,6 +38,7 @@ extern "C" { SOFA_HAPLYROBOTICS_API const char* getModuleLicense(); SOFA_HAPLYROBOTICS_API const char* getModuleDescription(); SOFA_HAPLYROBOTICS_API const char* getModuleComponentList(); + SOFA_HAPLYROBOTICS_API void registerObjects(sofa::core::ObjectFactory* factory); } void initExternalModule() @@ -68,4 +76,9 @@ const char* getModuleComponentList() return "Haply_Inverse3Controller"; } +void registerObjects(sofa::core::ObjectFactory* factory) +{ + sofa::HaplyRobotics::registerHaply_Inverse3Controller(factory); +} + } // namespace sofa::component