24
24
******************************************************************************/
25
25
#include < ShapeMatchingPlugin/initShapeMatchingPlugin.h>
26
26
#include < sofa/core/ObjectFactory.h>
27
+ #include < sofa/helper/system/PluginManager.h>
27
28
28
- namespace sofa ::component
29
+ namespace shapematchingplugin
29
30
{
30
31
32
+ extern void registerShapeMatchingForceField (sofa::core::ObjectFactory* factory);
33
+ extern void registerShapeMatchingRotationFinder (sofa::core::ObjectFactory* factory);
34
+
31
35
extern " C" {
32
36
SOFA_SHAPEMATCHINGPLUGIN_API void initExternalModule ();
33
37
SOFA_SHAPEMATCHINGPLUGIN_API const char * getModuleName ();
34
38
SOFA_SHAPEMATCHINGPLUGIN_API const char * getModuleVersion ();
35
39
SOFA_SHAPEMATCHINGPLUGIN_API const char * getModuleLicense ();
36
40
SOFA_SHAPEMATCHINGPLUGIN_API const char * getModuleDescription ();
37
- SOFA_SHAPEMATCHINGPLUGIN_API const char * getModuleComponentList ( );
41
+ SOFA_SHAPEMATCHINGPLUGIN_API void registerObjects (sofa::core::ObjectFactory* factory );
38
42
}
39
43
40
44
void initShapeMatchingPlugin ()
@@ -44,6 +48,9 @@ namespace sofa::component
44
48
45
49
void initExternalModule ()
46
50
{
51
+ // make sure that this plugin is registered into the PluginManager
52
+ sofa::helper::system::PluginManager::getInstance ().registerPlugin (MODULE_NAME);
53
+
47
54
static bool first = true ;
48
55
if (first)
49
56
{
@@ -53,12 +60,12 @@ namespace sofa::component
53
60
54
61
const char * getModuleName ()
55
62
{
56
- return shapematching:: MODULE_NAME;
63
+ return MODULE_NAME;
57
64
}
58
65
59
66
const char * getModuleVersion ()
60
67
{
61
- return shapematching:: MODULE_VERSION;
68
+ return MODULE_VERSION;
62
69
}
63
70
64
71
const char * getModuleLicense ()
@@ -71,11 +78,10 @@ namespace sofa::component
71
78
return " Plugin with ShapeMatchingPlugin" ;
72
79
}
73
80
74
- const char * getModuleComponentList ( )
81
+ void registerObjects (sofa::core::ObjectFactory* factory )
75
82
{
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);
79
85
}
80
86
81
- } // namespace sofa::component
87
+ } // namespace shapematchingplugin
0 commit comments