2424******************************************************************************/
2525#include < ShapeMatchingPlugin/initShapeMatchingPlugin.h>
2626#include < sofa/core/ObjectFactory.h>
27+ #include < sofa/helper/system/PluginManager.h>
2728
28- namespace sofa ::component
29+ namespace shapematchingplugin
2930{
3031
32+ extern void registerShapeMatchingForceField (sofa::core::ObjectFactory* factory);
33+ extern void registerShapeMatchingRotationFinder (sofa::core::ObjectFactory* factory);
34+
3135 extern " C" {
3236 SOFA_SHAPEMATCHINGPLUGIN_API void initExternalModule ();
3337 SOFA_SHAPEMATCHINGPLUGIN_API const char * getModuleName ();
3438 SOFA_SHAPEMATCHINGPLUGIN_API const char * getModuleVersion ();
3539 SOFA_SHAPEMATCHINGPLUGIN_API const char * getModuleLicense ();
3640 SOFA_SHAPEMATCHINGPLUGIN_API const char * getModuleDescription ();
37- SOFA_SHAPEMATCHINGPLUGIN_API const char * getModuleComponentList ( );
41+ SOFA_SHAPEMATCHINGPLUGIN_API void registerObjects (sofa::core::ObjectFactory* factory );
3842 }
3943
4044 void initShapeMatchingPlugin ()
@@ -44,6 +48,9 @@ namespace sofa::component
4448
4549 void initExternalModule ()
4650 {
51+ // make sure that this plugin is registered into the PluginManager
52+ sofa::helper::system::PluginManager::getInstance ().registerPlugin (MODULE_NAME);
53+
4754 static bool first = true ;
4855 if (first)
4956 {
@@ -53,12 +60,12 @@ namespace sofa::component
5360
5461 const char * getModuleName ()
5562 {
56- return shapematching:: MODULE_NAME;
63+ return MODULE_NAME;
5764 }
5865
5966 const char * getModuleVersion ()
6067 {
61- return shapematching:: MODULE_VERSION;
68+ return MODULE_VERSION;
6269 }
6370
6471 const char * getModuleLicense ()
@@ -71,11 +78,10 @@ namespace sofa::component
7178 return " Plugin with ShapeMatchingPlugin" ;
7279 }
7380
74- const char * getModuleComponentList ( )
81+ void registerObjects (sofa::core::ObjectFactory* factory )
7582 {
76- // / string containing the names of the classes provided by the plugin
77- static std::string classes = sofa::core::ObjectFactory::getInstance ()->listClassesFromTarget (sofa_tostring (SOFA_TARGET));
78- return classes.c_str ();
83+ registerShapeMatchingForceField (factory);
84+ registerShapeMatchingRotationFinder (factory);
7985 }
8086
81- } // namespace sofa::component
87+ } // namespace shapematchingplugin
0 commit comments