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/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 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