1+ #include < CollisionAlgorithm/initCollisionAlgorithm.h>
2+
13#include < sofa/core/ObjectFactory.h>
24#include < sofa/helper/system/FileRepository.h>
35#include < sofa/helper/system/PluginManager.h>
@@ -34,28 +36,25 @@ extern void registerPointGeometry(sofa::core::ObjectFactory* factory);
3436extern void registerEdgeGeometry (sofa::core::ObjectFactory* factory);
3537extern void registerTriangleGeometry (sofa::core::ObjectFactory* factory);
3638extern void registerTetrahedronGeometry (sofa::core::ObjectFactory* factory);
37- } // namespace sofa::collisionalgorithm
38-
39- namespace sofa ::component
40- {
41-
42- // Here are just several convenient functions to help user to know what contains the plugin
4339
4440extern " C"
4541{
46- void initExternalModule ();
47- const char * getModuleName ();
48- const char * getModuleVersion ();
49- const char * getModuleLicense ();
50- const char * getModuleDescription ();
51- void registerObjects (sofa::core::ObjectFactory* factory);
42+ SOFA_COLLISIONALGORITHM_API void initExternalModule ();
43+ SOFA_COLLISIONALGORITHM_API const char * getModuleName ();
44+ SOFA_COLLISIONALGORITHM_API const char * getModuleVersion ();
45+ SOFA_COLLISIONALGORITHM_API const char * getModuleLicense ();
46+ SOFA_COLLISIONALGORITHM_API const char * getModuleDescription ();
47+ SOFA_COLLISIONALGORITHM_API void registerObjects (sofa::core::ObjectFactory* factory);
5248}
5349
5450void initCollisionAlgorithm ()
5551{
5652 static bool first = true ;
5753 if (first)
5854 {
55+ // make sure that this plugin is registered into the PluginManager
56+ sofa::helper::system::PluginManager::getInstance ().registerPlugin (MODULE_NAME);
57+
5958 first = false ;
6059#ifdef PLUGIN_DATA_DIR
6160 sofa::helper::system::DataRepository.addLastPath (std::string (QUOTE (PLUGIN_DATA_DIR)));
@@ -70,7 +69,7 @@ void initExternalModule()
7069 initCollisionAlgorithm ();
7170}
7271
73- const char * getModuleName () { return " CollisionAlgorithm " ; }
72+ const char * getModuleName () { return MODULE_NAME ; }
7473
7574const char * getModuleVersion ()
7675{
@@ -87,7 +86,6 @@ const char* getModuleDescription() { return "Plugin for collision detection"; }
8786
8887void registerObjects (sofa::core::ObjectFactory* factory)
8988{
90- using namespace sofa ::collisionalgorithm;
9189 // Register CollisionPipeline
9290 registerCollisionLoop (factory);
9391 // Register Algorithms
@@ -107,4 +105,4 @@ void registerObjects(sofa::core::ObjectFactory* factory)
107105 registerTetrahedronGeometry (factory);
108106}
109107
110- } // namespace sofa::component
108+ } // namespace collisionalgorithm
0 commit comments