From 34f6993bb887fc5c718c0343a69e39cdeff37c8c Mon Sep 17 00:00:00 2001 From: Frederick Roy Date: Mon, 23 Sep 2024 15:50:35 +0900 Subject: [PATCH 1/5] apply new register mechanism to topology --- .../container/constant/CubeTopology.cpp | 8 ++- .../container/constant/MeshTopology.cpp | 10 ++-- .../container/constant/SphereQuadTopology.cpp | 9 +-- .../topology/container/constant/init.cpp | 19 ++++++- .../DynamicSparseGridGeometryAlgorithms.cpp | 11 ++-- .../DynamicSparseGridTopologyContainer.cpp | 11 ++-- .../DynamicSparseGridTopologyModifier.cpp | 8 ++- .../dynamic/EdgeSetGeometryAlgorithms.cpp | 12 ++-- .../dynamic/EdgeSetTopologyContainer.cpp | 10 ++-- .../dynamic/EdgeSetTopologyModifier.cpp | 11 ++-- .../HexahedronSetGeometryAlgorithms.cpp | 12 ++-- .../HexahedronSetTopologyContainer.cpp | 10 ++-- .../dynamic/HexahedronSetTopologyModifier.cpp | 10 ++-- ...ltilevelHexahedronSetTopologyContainer.cpp | 10 ++-- .../dynamic/PointSetGeometryAlgorithms.cpp | 11 ++-- .../dynamic/PointSetTopologyContainer.cpp | 10 ++-- .../dynamic/PointSetTopologyModifier.cpp | 11 ++-- .../dynamic/QuadSetGeometryAlgorithms.cpp | 12 ++-- .../dynamic/QuadSetTopologyContainer.cpp | 11 ++-- .../dynamic/QuadSetTopologyModifier.cpp | 10 ++-- .../TetrahedronSetGeometryAlgorithms.cpp | 12 ++-- .../TetrahedronSetTopologyContainer.cpp | 10 ++-- .../TetrahedronSetTopologyModifier.cpp | 10 ++-- .../dynamic/TriangleSetGeometryAlgorithms.cpp | 14 ++--- .../dynamic/TriangleSetTopologyContainer.cpp | 11 ++-- .../dynamic/TriangleSetTopologyModifier.cpp | 11 ++-- .../topology/container/dynamic/init.cpp | 57 ++++++++++++++++++- .../container/grid/CylinderGridTopology.cpp | 11 ++-- .../topology/container/grid/GridTopology.cpp | 10 ++-- .../container/grid/RegularGridTopology.cpp | 11 ++-- .../grid/SparseGridMultipleTopology.cpp | 25 ++++---- .../grid/SparseGridRamificationTopology.cpp | 9 +-- .../container/grid/SparseGridTopology.cpp | 10 ++-- .../container/grid/SphereGridTopology.cpp | 11 ++-- .../topology/container/grid/init.cpp | 27 ++++++++- .../component/topology/container/init.cpp | 14 +++++ .../mapping/CenterPointTopologicalMapping.cpp | 11 ++-- .../mapping/Edge2QuadTopologicalMapping.cpp | 10 ++-- .../mapping/Hexa2QuadTopologicalMapping.cpp | 14 ++--- .../mapping/Hexa2TetraTopologicalMapping.cpp | 14 ++--- .../mapping/IdentityTopologicalMapping.cpp | 12 ++-- .../Quad2TriangleTopologicalMapping.cpp | 12 ++-- .../mapping/SubsetTopologicalMapping.cpp | 12 ++-- .../Tetra2TriangleTopologicalMapping.cpp | 14 ++--- .../Triangle2EdgeTopologicalMapping.cpp | 10 ++-- .../sofa/component/topology/mapping/init.cpp | 31 +++++++++- .../utility/TopologicalChangeProcessor.cpp | 10 ++-- .../utility/TopologyBoundingTrasher.cpp | 8 ++- .../topology/utility/TopologyChecker.cpp | 10 ++-- .../sofa/component/topology/utility/init.cpp | 19 ++++++- .../src/sofa/component/topology/init.cpp | 14 +++++ Sofa/Component/src/sofa/component/init.cpp | 1 + .../src/sofa/helper/ComponentChange.cpp | 9 +++ 53 files changed, 433 insertions(+), 247 deletions(-) diff --git a/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/CubeTopology.cpp b/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/CubeTopology.cpp index e666b76e0b1..a9e09ed3bc8 100644 --- a/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/CubeTopology.cpp +++ b/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/CubeTopology.cpp @@ -57,9 +57,11 @@ void CubeTopology::parse(core::objectmodel::BaseObjectDescription* arg) this->setPos(d_min.getValue()[0], d_max.getValue()[0], d_min.getValue()[1], d_max.getValue()[1], d_min.getValue()[2], d_max.getValue()[2]); } -int CubeTopologyClass = core::RegisterObject("Surface of a cube in 3D") - .add< CubeTopology >() - ; +void registerCubeTopology(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Surface of a cube in 3D.") + .add< CubeTopology >()); +} CubeTopology::CubeTopology(int _nx, int _ny, int _nz) : d_nx(initData(&d_nx, _nx, "nx", "x grid resolution")) diff --git a/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/MeshTopology.cpp b/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/MeshTopology.cpp index 47f8a909fbf..74d4fb6d8a6 100644 --- a/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/MeshTopology.cpp +++ b/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/MeshTopology.cpp @@ -478,11 +478,11 @@ void MeshTopology::QuadUpdate::doUpdate() using namespace sofa::defaulttype; using core::topology::BaseMeshTopology; - -int MeshTopologyClass = core::RegisterObject("Generic mesh topology") - .addAlias("Mesh") - .add< MeshTopology >() - ; +void registerMeshTopology(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Generic mesh topology.") + .add< MeshTopology >()); +} MeshTopology::MeshTopology() : d_seqPoints(initData(&d_seqPoints, "position", "List of point positions")) diff --git a/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/SphereQuadTopology.cpp b/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/SphereQuadTopology.cpp index d99065cf2b9..73e7bfaf9de 100644 --- a/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/SphereQuadTopology.cpp +++ b/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/SphereQuadTopology.cpp @@ -29,10 +29,11 @@ namespace sofa::component::topology::container::constant using namespace sofa::type; using namespace sofa::defaulttype; -int SphereQuadTopologyClass = core::RegisterObject("Sphere topology constructed with deformed quads") - .addAlias("SphereQuad") - .add< SphereQuadTopology >() - ; +void registerSphereQuadTopology(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Sphere topology constructed with deformed quads.") + .add< SphereQuadTopology >()); +} SphereQuadTopology::SphereQuadTopology(int nx, int ny, int nz) : CubeTopology(nx, ny, nz), diff --git a/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/init.cpp b/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/init.cpp index 8e3c0970fbc..52c2b119c28 100644 --- a/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/init.cpp +++ b/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/init.cpp @@ -21,13 +21,20 @@ ******************************************************************************/ #include #include +#include + namespace sofa::component::topology::container::constant { - + +extern void registerCubeTopology(sofa::core::ObjectFactory* factory); +extern void registerMeshTopology(sofa::core::ObjectFactory* factory); +extern void registerSphereQuadTopology(sofa::core::ObjectFactory* factory); + extern "C" { SOFA_EXPORT_DYNAMIC_LIBRARY void initExternalModule(); SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleName(); SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleVersion(); + SOFA_EXPORT_DYNAMIC_LIBRARY void registerObjects(sofa::core::ObjectFactory* factory); } void initExternalModule() @@ -45,11 +52,21 @@ const char* getModuleVersion() return MODULE_VERSION; } +void registerObjects(sofa::core::ObjectFactory* factory) +{ + registerCubeTopology(factory); + registerMeshTopology(factory); + registerSphereQuadTopology(factory); +} + void init() { static bool first = true; if (first) { + // make sure that this plugin is registered into the PluginManager + sofa::helper::system::PluginManager::getInstance().registerPlugin(MODULE_NAME); + first = false; } } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridGeometryAlgorithms.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridGeometryAlgorithms.cpp index 372842adb2f..4cba0c5c79d 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridGeometryAlgorithms.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridGeometryAlgorithms.cpp @@ -28,11 +28,13 @@ namespace sofa::component::topology::container::dynamic { using namespace sofa::defaulttype; -int DynamicSparseGridGeometryAlgorithmsClass = core::RegisterObject ( "Hexahedron set geometry algorithms" ) - .add< DynamicSparseGridGeometryAlgorithms > ( true ) // default template - .add< DynamicSparseGridGeometryAlgorithms >() - ; +void registerDynamicSparseGridGeometryAlgorithms(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Dynamic Sparse grid geometry algorithms.") + .add< DynamicSparseGridGeometryAlgorithms >(true) // default template + .add< DynamicSparseGridGeometryAlgorithms >()); +} template <> int DynamicSparseGridGeometryAlgorithms::findNearestElementInRestPos(const Coord& pos, sofa::type::Vec3& baryC, Real& distance) const @@ -43,5 +45,4 @@ int DynamicSparseGridGeometryAlgorithms::findNearestElementInRestPos( template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API DynamicSparseGridGeometryAlgorithms; template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API DynamicSparseGridGeometryAlgorithms; - } // namespace sofa::component::topology::container::dynamic diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridTopologyContainer.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridTopologyContainer.cpp index 6858eaab746..5d39ff4ec15 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridTopologyContainer.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridTopologyContainer.cpp @@ -30,13 +30,14 @@ namespace sofa::component::topology::container::dynamic { -using namespace std; using namespace sofa::type; using namespace sofa::defaulttype; -int DynamicSparseGridTopologyContainerClass = core::RegisterObject ( "Hexahedron set topology container" ) - .add< DynamicSparseGridTopologyContainer >() - ; +void registerDynamicSparseGridTopologyContainer(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Dynamic Sparse grid geometry container.") + .add< DynamicSparseGridTopologyContainer >()); +} DynamicSparseGridTopologyContainer::DynamicSparseGridTopologyContainer() : d_resolution (initData (&d_resolution, type::Vec3i (0, 0, 0 ), "resolution", "voxel grid resolution" ) ) @@ -78,7 +79,7 @@ void DynamicSparseGridTopologyContainer::init() for( unsigned int i = 0; i < iirg.size(); i++) { - idrg2tpo.insert( make_pair( iirg[i], i )); + idrg2tpo.insert( std::make_pair( iirg[i], i )); } // Init values diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridTopologyModifier.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridTopologyModifier.cpp index 2a7687a7d95..621e327ecda 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridTopologyModifier.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridTopologyModifier.cpp @@ -30,9 +30,11 @@ namespace sofa::component::topology::container::dynamic { -int DynamicSparseGridTopologyModifierClass = core::RegisterObject ( "Hexahedron set topology modifier" ) - .add< DynamicSparseGridTopologyModifier >(); - +void registerDynamicSparseGridTopologyModifier(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Dynamic Sparse grid geometry modifier.") + .add< DynamicSparseGridTopologyModifier >()); +} void DynamicSparseGridTopologyModifier::init() { diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetGeometryAlgorithms.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetGeometryAlgorithms.cpp index f315be2f8d8..3185d0fc840 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetGeometryAlgorithms.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetGeometryAlgorithms.cpp @@ -28,15 +28,18 @@ namespace sofa::component::topology::container::dynamic { + using namespace sofa::defaulttype; -int EdgeSetGeometryAlgorithmsClass = core::RegisterObject("Edge set geometry algorithms") + +void registerEdgeSetGeometryAlgorithms(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Edge set geometry algorithms.") .add< EdgeSetGeometryAlgorithms >(true) // default template .add< EdgeSetGeometryAlgorithms >() .add< EdgeSetGeometryAlgorithms >() .add< EdgeSetGeometryAlgorithms >() - .add< EdgeSetGeometryAlgorithms >() - - ; + .add< EdgeSetGeometryAlgorithms >()); +} template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API EdgeSetGeometryAlgorithms; template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API EdgeSetGeometryAlgorithms; @@ -44,5 +47,4 @@ template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API EdgeSetGeometryAlgo template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API EdgeSetGeometryAlgorithms; template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API EdgeSetGeometryAlgorithms; - } //namespace sofa::component::topology::container::dynamic diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetTopologyContainer.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetTopologyContainer.cpp index b2c62930c8f..9273c9eb6c1 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetTopologyContainer.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetTopologyContainer.cpp @@ -36,11 +36,13 @@ namespace sofa::component::topology::container::dynamic { -using namespace std; using namespace sofa::defaulttype; -int EdgeSetTopologyContainerClass = core::RegisterObject("Edge set topology container") - .add< EdgeSetTopologyContainer >() - ; + +void registerEdgeSetTopologyContainer(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Edge set topology container.") + .add< EdgeSetTopologyContainer >()); +} EdgeSetTopologyContainer::EdgeSetTopologyContainer() : PointSetTopologyContainer( ) diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetTopologyModifier.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetTopologyModifier.cpp index cf7b145525b..56925587c58 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetTopologyModifier.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetTopologyModifier.cpp @@ -40,12 +40,13 @@ namespace sofa::component::topology::container::dynamic { -using namespace sofa::defaulttype; -int EdgeSetTopologyModifierClass = core::RegisterObject("Edge set topology modifier") - .add< EdgeSetTopologyModifier >(); -using namespace std; -using namespace sofa::defaulttype; +void registerEdgeSetTopologyModifier(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Edge set topology modifier.") + .add< EdgeSetTopologyModifier >()); +} + using namespace sofa::core::topology; void EdgeSetTopologyModifier::init() diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetGeometryAlgorithms.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetGeometryAlgorithms.cpp index 2a5341d54c2..ef4df87c975 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetGeometryAlgorithms.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetGeometryAlgorithms.cpp @@ -27,15 +27,17 @@ namespace sofa::component::topology::container::dynamic { + using namespace sofa::defaulttype; -int HexahedronSetGeometryAlgorithmsClass = core::RegisterObject("Hexahedron set geometry algorithms") - .add< HexahedronSetGeometryAlgorithms >(true) // default template - .add< HexahedronSetGeometryAlgorithms >() - ; +void registerHexahedronSetGeometryAlgorithms(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Hexahedron set geometry algorithms.") + .add< HexahedronSetGeometryAlgorithms >(true) // default template + .add< HexahedronSetGeometryAlgorithms >()); +} template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API HexahedronSetGeometryAlgorithms; template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API HexahedronSetGeometryAlgorithms; - } //namespace sofa::component::topology::container::dynamic diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetTopologyContainer.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetTopologyContainer.cpp index cf6cfe185ca..33bb916d67e 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetTopologyContainer.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetTopologyContainer.cpp @@ -28,15 +28,15 @@ namespace sofa::component::topology::container::dynamic { -using namespace std; -using namespace sofa::defaulttype; using sofa::core::topology::edgesInHexahedronArray; using sofa::core::topology::quadsOrientationInHexahedronArray; using sofa::core::topology::verticesInHexahedronArray; -int HexahedronSetTopologyContainerClass = core::RegisterObject("Hexahedron set topology container") - .add< HexahedronSetTopologyContainer >() - ; +void registerHexahedronSetTopologyContainer(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Hexahedron set topology container.") + .add< HexahedronSetTopologyContainer >()); +} HexahedronSetTopologyContainer::HexahedronSetTopologyContainer() : QuadSetTopologyContainer() diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetTopologyModifier.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetTopologyModifier.cpp index 82a295788d7..c406876ac08 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetTopologyModifier.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetTopologyModifier.cpp @@ -30,11 +30,13 @@ namespace sofa::component::topology::container::dynamic { -int HexahedronSetTopologyModifierClass = core::RegisterObject("Hexahedron set topology modifier") - .add< HexahedronSetTopologyModifier >(); -using namespace std; -using namespace sofa::defaulttype; +void registerHexahedronSetTopologyModifier(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Hexahedron set topology modifier.") + .add< HexahedronSetTopologyModifier >()); +} + using namespace sofa::core::topology; void HexahedronSetTopologyModifier::init() diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/MultilevelHexahedronSetTopologyContainer.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/MultilevelHexahedronSetTopologyContainer.cpp index 8d57a6b00e9..050ef68e952 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/MultilevelHexahedronSetTopologyContainer.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/MultilevelHexahedronSetTopologyContainer.cpp @@ -33,13 +33,13 @@ namespace sofa::component::topology::container::dynamic { -using namespace std; using namespace sofa::type; -using namespace sofa::defaulttype; -int MultilevelHexahedronSetTopologyContainerClass = core::RegisterObject("Hexahedron set topology container") - .add< MultilevelHexahedronSetTopologyContainer >() - ; +void registerMultilevelHexahedronSetTopologyContainer(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Multilevel Hexahedron set topology container.") + .add< MultilevelHexahedronSetTopologyContainer >()); +} MultilevelHexahedronSetTopologyContainer::MultilevelHexahedronSetTopologyContainer() : HexahedronSetTopologyContainer(), diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetGeometryAlgorithms.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetGeometryAlgorithms.cpp index 8022a9d2364..6eb55ee2a4d 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetGeometryAlgorithms.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetGeometryAlgorithms.cpp @@ -29,12 +29,14 @@ namespace sofa::component::topology::container::dynamic { using namespace sofa::defaulttype; -int PointSetGeometryAlgorithmsClass = core::RegisterObject("Point set geometry algorithms") + +void registerPointSetGeometryAlgorithms(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Point set geometry algorithms.") .add< PointSetGeometryAlgorithms >(true) // default template .add< PointSetGeometryAlgorithms >() - .add< PointSetGeometryAlgorithms >() - - ; + .add< PointSetGeometryAlgorithms >()); +} template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API PointSetGeometryAlgorithms; template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API PointSetGeometryAlgorithms; @@ -42,5 +44,4 @@ template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API PointSetGeometryAlg template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API PointSetGeometryAlgorithms; template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API PointSetGeometryAlgorithms; - } //namespace sofa::component::topology::container::dynamic diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetTopologyContainer.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetTopologyContainer.cpp index b644cdf4511..c165e65b577 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetTopologyContainer.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetTopologyContainer.cpp @@ -49,11 +49,11 @@ struct GeneratePointID } -using namespace sofa::defaulttype; - -int PointSetTopologyContainerClass = core::RegisterObject("Point set topology container") - .add< PointSetTopologyContainer >() - ; +void registerPointSetTopologyContainer(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Point set topology container.") + .add< PointSetTopologyContainer >()); +} PointSetTopologyContainer::PointSetTopologyContainer(Size npoints) : d_initPoints (initData(&d_initPoints, "position", "Initial position of points",true,true)) diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetTopologyModifier.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetTopologyModifier.cpp index 6573eb11f4b..011db7b972a 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetTopologyModifier.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetTopologyModifier.cpp @@ -33,12 +33,13 @@ namespace sofa::component::topology::container::dynamic { -int PointSetTopologyModifierClass = core::RegisterObject("Point set topology modifier") - .add< PointSetTopologyModifier >(); -using namespace std; -using namespace sofa::defaulttype; -using namespace sofa::core::behavior; +void registerPointSetTopologyModifier(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Point set topology modifier.") + .add< PointSetTopologyModifier >()); +} + using namespace sofa::core::topology; void PointSetTopologyModifier::init() diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetGeometryAlgorithms.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetGeometryAlgorithms.cpp index 9711e21b402..1072deaaefe 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetGeometryAlgorithms.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetGeometryAlgorithms.cpp @@ -28,15 +28,17 @@ namespace sofa::component::topology::container::dynamic { + using namespace sofa::defaulttype; -int QuadSetGeometryAlgorithmsClass = core::RegisterObject("Quad set geometry algorithms") - .add< QuadSetGeometryAlgorithms >(true) // default template - .add< QuadSetGeometryAlgorithms >() - ; +void registerQuadSetGeometryAlgorithms(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Quad set geometry algorithms.") + .add< QuadSetGeometryAlgorithms >(true) // default template + .add< QuadSetGeometryAlgorithms >()); +} template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API QuadSetGeometryAlgorithms; template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API QuadSetGeometryAlgorithms; - } //namespace sofa::component::topology::container::dynamic diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetTopologyContainer.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetTopologyContainer.cpp index ba4b361d837..108ba5b41b0 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetTopologyContainer.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetTopologyContainer.cpp @@ -28,12 +28,11 @@ namespace sofa::component::topology::container::dynamic { -using namespace std; -using namespace sofa::defaulttype; - -int QuadSetTopologyContainerClass = core::RegisterObject("Quad set topology container") - .add< QuadSetTopologyContainer >() - ; +void registerQuadSetTopologyContainer(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Quad set topology container.") + .add< QuadSetTopologyContainer >()); +} QuadSetTopologyContainer::QuadSetTopologyContainer() : EdgeSetTopologyContainer() diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetTopologyModifier.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetTopologyModifier.cpp index fc6efdd5d74..8b65baf6746 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetTopologyModifier.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetTopologyModifier.cpp @@ -30,15 +30,15 @@ namespace sofa::component::topology::container::dynamic { -int QuadSetTopologyModifierClass = core::RegisterObject("Quad set topology modifier") - .add< QuadSetTopologyModifier >(); +void registerQuadSetTopologyModifier(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Quad set topology modifier.") + .add< QuadSetTopologyModifier >()); +} -using namespace std; -using namespace sofa::defaulttype; using namespace sofa::core::topology; - void QuadSetTopologyModifier::init() { EdgeSetTopologyModifier::init(); diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetGeometryAlgorithms.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetGeometryAlgorithms.cpp index 33b6549d15b..44ba8cd335d 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetGeometryAlgorithms.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetGeometryAlgorithms.cpp @@ -27,15 +27,17 @@ namespace sofa::component::topology::container::dynamic { + using namespace sofa::defaulttype; -int TetrahedronSetGeometryAlgorithmsClass = core::RegisterObject("Tetrahedron set geometry algorithms") - .add< TetrahedronSetGeometryAlgorithms >(true) // default template - .add< TetrahedronSetGeometryAlgorithms >() - ; +void registerTetrahedronSetGeometryAlgorithms(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Tetrahedron set geometry algorithms.") + .add< TetrahedronSetGeometryAlgorithms >(true) // default template + .add< TetrahedronSetGeometryAlgorithms >()); +} template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API TetrahedronSetGeometryAlgorithms; template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API TetrahedronSetGeometryAlgorithms; - } //namespace sofa::component::topology::container::dynamic diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetTopologyContainer.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetTopologyContainer.cpp index c4eede995d3..6b9aec63546 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetTopologyContainer.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetTopologyContainer.cpp @@ -27,13 +27,13 @@ namespace sofa::component::topology::container::dynamic { -using namespace std; -using namespace sofa::defaulttype; using sofa::core::topology::edgesInTetrahedronArray; -int TetrahedronSetTopologyContainerClass = core::RegisterObject("Tetrahedron set topology container") - .add< TetrahedronSetTopologyContainer >() - ; +void registerTetrahedronSetTopologyContainer(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Tetrahedron set topology container.") + .add< TetrahedronSetTopologyContainer >()); +} ///convention triangles in tetra (orientation interior) diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetTopologyModifier.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetTopologyModifier.cpp index 43d7a420445..5affc213eed 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetTopologyModifier.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetTopologyModifier.cpp @@ -33,11 +33,13 @@ namespace sofa::component::topology::container::dynamic { -int TetrahedronSetTopologyModifierClass = core::RegisterObject("Tetrahedron set topology modifier") - .add< TetrahedronSetTopologyModifier >(); -using namespace std; -using namespace sofa::defaulttype; +void registerTetrahedronSetTopologyModifier(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Tetrahedron set topology modifier.") + .add< TetrahedronSetTopologyModifier >()); +} + using namespace sofa::core::topology; //const unsigned int edgesInTetrahedronArray[6][2] = {{0,1}, {0,2}, {0,3}, {1,2}, {1,3}, {2,3}}; diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetGeometryAlgorithms.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetGeometryAlgorithms.cpp index 180a0443b4f..3356543d77e 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetGeometryAlgorithms.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetGeometryAlgorithms.cpp @@ -27,14 +27,15 @@ namespace sofa::component::topology::container::dynamic { + using namespace sofa::defaulttype; -int TriangleSetGeometryAlgorithmsClass = core::RegisterObject("Triangle set geometry algorithms") +void registerTriangleSetGeometryAlgorithms(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Triangle set geometry algorithms.") .add< TriangleSetGeometryAlgorithms >(true) // default template - .add< TriangleSetGeometryAlgorithms >() - ; - - + .add< TriangleSetGeometryAlgorithms >()); +} // methods specilizations declaration template<> SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API @@ -50,12 +51,9 @@ int TriangleSetGeometryAlgorithms::SplitAlongPath(PointI sofa::type::vector< sofa::type::Vec3 >& coords_list, sofa::type::vector& new_edges, SReal epsilonSnapPath, SReal epsilonSnapBorder); - - template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API TriangleSetGeometryAlgorithms; template class SOFA_COMPONENT_TOPOLOGY_CONTAINER_DYNAMIC_API TriangleSetGeometryAlgorithms; - template<> int TriangleSetGeometryAlgorithms::SplitAlongPath(PointID, Coord&, PointID, Coord&, sofa::type::vector< sofa::geometry::ElementType>&, diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyContainer.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyContainer.cpp index 48ab563d783..b43f1c3ad64 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyContainer.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyContainer.cpp @@ -26,13 +26,12 @@ namespace sofa::component::topology::container::dynamic { -using namespace std; -using namespace sofa::defaulttype; - -int TriangleSetTopologyContainerClass = core::RegisterObject("Triangle set topology container") - .add< TriangleSetTopologyContainer >() - ; +void registerTriangleSetTopologyContainer(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Triangle set topology container.") + .add< TriangleSetTopologyContainer >()); +} TriangleSetTopologyContainer::TriangleSetTopologyContainer() : EdgeSetTopologyContainer() diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyModifier.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyModifier.cpp index f076b2cafcd..52cc34ef3c1 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyModifier.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyModifier.cpp @@ -33,12 +33,13 @@ namespace sofa::component::topology::container::dynamic { -int TriangleSetTopologyModifierClass = core::RegisterObject("Triangle set topology modifier") - .add< TriangleSetTopologyModifier >() - ; -using namespace std; -using namespace sofa::defaulttype; +void registerTriangleSetTopologyModifier(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Triangle set topology modifier.") + .add< TriangleSetTopologyModifier >()); +} + using namespace sofa::core::topology; void TriangleSetTopologyModifier::init() diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/init.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/init.cpp index 88ac7674543..1caad7ab75e 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/init.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/init.cpp @@ -21,13 +21,39 @@ ******************************************************************************/ #include #include +#include + namespace sofa::component::topology::container::dynamic { - + +extern void registerDynamicSparseGridGeometryAlgorithms(sofa::core::ObjectFactory* factory); +extern void registerDynamicSparseGridTopologyContainer(sofa::core::ObjectFactory* factory); +extern void registerDynamicSparseGridTopologyModifier(sofa::core::ObjectFactory* factory); +extern void registerEdgeSetGeometryAlgorithms(sofa::core::ObjectFactory* factory); +extern void registerEdgeSetTopologyContainer(sofa::core::ObjectFactory* factory); +extern void registerEdgeSetTopologyModifier(sofa::core::ObjectFactory* factory); +extern void registerHexahedronSetGeometryAlgorithms(sofa::core::ObjectFactory* factory); +extern void registerHexahedronSetTopologyContainer(sofa::core::ObjectFactory* factory); +extern void registerHexahedronSetTopologyModifier(sofa::core::ObjectFactory* factory); +extern void registerMultilevelHexahedronSetTopologyContainer(sofa::core::ObjectFactory* factory); +extern void registerPointSetGeometryAlgorithms(sofa::core::ObjectFactory* factory); +extern void registerPointSetTopologyContainer(sofa::core::ObjectFactory* factory); +extern void registerPointSetTopologyModifier(sofa::core::ObjectFactory* factory); +extern void registerQuadSetGeometryAlgorithms(sofa::core::ObjectFactory* factory); +extern void registerQuadSetTopologyContainer(sofa::core::ObjectFactory* factory); +extern void registerQuadSetTopologyModifier(sofa::core::ObjectFactory* factory); +extern void registerTetrahedronSetGeometryAlgorithms(sofa::core::ObjectFactory* factory); +extern void registerTetrahedronSetTopologyContainer(sofa::core::ObjectFactory* factory); +extern void registerTetrahedronSetTopologyModifier(sofa::core::ObjectFactory* factory); +extern void registerTriangleSetGeometryAlgorithms(sofa::core::ObjectFactory* factory); +extern void registerTriangleSetTopologyContainer(sofa::core::ObjectFactory* factory); +extern void registerTriangleSetTopologyModifier(sofa::core::ObjectFactory* factory); + extern "C" { SOFA_EXPORT_DYNAMIC_LIBRARY void initExternalModule(); SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleName(); SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleVersion(); + SOFA_EXPORT_DYNAMIC_LIBRARY void registerObjects(sofa::core::ObjectFactory* factory); } void initExternalModule() @@ -45,11 +71,40 @@ const char* getModuleVersion() return MODULE_VERSION; } +void registerObjects(sofa::core::ObjectFactory* factory) +{ + registerDynamicSparseGridGeometryAlgorithms(factory); + registerDynamicSparseGridTopologyContainer(factory); + registerDynamicSparseGridTopologyModifier(factory); + registerEdgeSetGeometryAlgorithms(factory); + registerEdgeSetTopologyContainer(factory); + registerEdgeSetTopologyModifier(factory); + registerHexahedronSetGeometryAlgorithms(factory); + registerHexahedronSetTopologyContainer(factory); + registerHexahedronSetTopologyModifier(factory); + registerMultilevelHexahedronSetTopologyContainer(factory); + registerPointSetGeometryAlgorithms(factory); + registerPointSetTopologyContainer(factory); + registerPointSetTopologyModifier(factory); + registerQuadSetGeometryAlgorithms(factory); + registerQuadSetTopologyContainer(factory); + registerQuadSetTopologyModifier(factory); + registerTetrahedronSetGeometryAlgorithms(factory); + registerTetrahedronSetTopologyContainer(factory); + registerTetrahedronSetTopologyModifier(factory); + registerTriangleSetGeometryAlgorithms(factory); + registerTriangleSetTopologyContainer(factory); + registerTriangleSetTopologyModifier(factory); +} + void init() { static bool first = true; if (first) { + // make sure that this plugin is registered into the PluginManager + sofa::helper::system::PluginManager::getInstance().registerPlugin(MODULE_NAME); + first = false; } } diff --git a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/CylinderGridTopology.cpp b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/CylinderGridTopology.cpp index 66d02134b14..d2fadfe0bf8 100644 --- a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/CylinderGridTopology.cpp +++ b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/CylinderGridTopology.cpp @@ -29,12 +29,11 @@ namespace sofa::component::topology::container::grid using namespace sofa::type; using namespace sofa::defaulttype; - - -int CylinderGridTopologyClass = core::RegisterObject("Cylinder grid in 3D") - .addAlias("CylinderGrid") - .add< CylinderGridTopology >() - ; +void registerCylinderGridTopology(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Cylinder grid in 3D.") + .add< CylinderGridTopology >()); +} CylinderGridTopology::CylinderGridTopology(int nx, int ny, int nz) : GridTopology(nx, ny, nz) diff --git a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/GridTopology.cpp b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/GridTopology.cpp index 166d08df145..ae70dd43d2a 100644 --- a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/GridTopology.cpp +++ b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/GridTopology.cpp @@ -27,11 +27,11 @@ namespace sofa::component::topology::container::grid { -int GridTopologyClass = core::RegisterObject("Base class fo a regular grid in 3D") - .addAlias("Grid") - .add< GridTopology >() - ; - +void registerGridTopology(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Base class fo a regular grid in 3D.") + .add< GridTopology >()); +} GridTopology::GridUpdate::GridUpdate(GridTopology *t): m_topology(t) diff --git a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/RegularGridTopology.cpp b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/RegularGridTopology.cpp index da3187e7395..1f28f85aa55 100644 --- a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/RegularGridTopology.cpp +++ b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/RegularGridTopology.cpp @@ -411,11 +411,10 @@ void RegularGridTopology::createTexCoords() } } - -int RegularGridTopologyClass = core::RegisterObject("Regular grid in 3D") - .addAlias("RegularGrid") - .add< RegularGridTopology >() - ; - +void registerRegularGridTopology(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Regular grid in 3D.") + .add< RegularGridTopology >()); +} } //namespace sofa::component::topology::container::grid diff --git a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/SparseGridMultipleTopology.cpp b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/SparseGridMultipleTopology.cpp index f13bd44174c..b485ae44b92 100644 --- a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/SparseGridMultipleTopology.cpp +++ b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/SparseGridMultipleTopology.cpp @@ -27,18 +27,19 @@ namespace sofa::component::topology::container::grid { -int SparseGridMultipleTopologyClass = core::RegisterObject("Sparse grid in 3D") - .addAlias("SparseGridMultiple") - .add< SparseGridMultipleTopology >() - ; - - -SparseGridMultipleTopology::SparseGridMultipleTopology( bool _isVirtual ) : SparseGridRamificationTopology(_isVirtual), - d_fileTopologies(initData(&d_fileTopologies, type::vector< std::string >() , "fileTopologies", "All topology filenames")), - d_dataStiffnessCoefs(initData(&d_dataStiffnessCoefs, type::vector< float >() , "stiffnessCoefs", "A stiffness coefficient for each topology filename")), - d_dataMassCoefs(initData(&d_dataMassCoefs, type::vector< float >() , "massCoefs", "A mass coefficient for each topology filename")), - d_computeRamifications(initData(&d_computeRamifications, true , "computeRamifications", "Are ramifications wanted?")), - d_erasePreviousCoef(initData(&d_erasePreviousCoef, false , "erasePreviousCoef", "Does a new stiffness/mass coefficient replace the previous or blend half/half with it?")) +void registerSparseGridMultipleTopology(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Sparse grid in 3D.") + .add< SparseGridMultipleTopology >()); +} + +SparseGridMultipleTopology::SparseGridMultipleTopology( bool _isVirtual ) + : SparseGridRamificationTopology(_isVirtual) + , d_fileTopologies(initData(&d_fileTopologies, type::vector< std::string >() , "fileTopologies", "All topology filenames")) + , d_dataStiffnessCoefs(initData(&d_dataStiffnessCoefs, type::vector< float >() , "stiffnessCoefs", "A stiffness coefficient for each topology filename")) + , d_dataMassCoefs(initData(&d_dataMassCoefs, type::vector< float >() , "massCoefs", "A mass coefficient for each topology filename")) + , d_computeRamifications(initData(&d_computeRamifications, true , "computeRamifications", "Are ramifications wanted?")) + , d_erasePreviousCoef(initData(&d_erasePreviousCoef, false , "erasePreviousCoef", "Does a new stiffness/mass coefficient replace the previous or blend half/half with it?")) { _fileTopologies.setOriginalData(&d_fileTopologies); _dataStiffnessCoefs.setOriginalData(&d_dataStiffnessCoefs); diff --git a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/SparseGridRamificationTopology.cpp b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/SparseGridRamificationTopology.cpp index 62f036d2445..ea4c192920c 100644 --- a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/SparseGridRamificationTopology.cpp +++ b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/SparseGridRamificationTopology.cpp @@ -27,10 +27,11 @@ namespace sofa::component::topology::container::grid { -int SparseGridRamificationTopologyClass = core::RegisterObject("Sparse grid in 3D (modified)") - .addAlias("SparseGridRamification") - .add< SparseGridRamificationTopology >() - ; +void registerSparseGridRamificationTopology(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Sparse grid in 3D (modified).") + .add< SparseGridRamificationTopology >()); +} SparseGridRamificationTopology::SparseGridRamificationTopology(bool isVirtual) : SparseGridTopology(isVirtual) diff --git a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/SparseGridTopology.cpp b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/SparseGridTopology.cpp index 10a1f45173d..43b5e136953 100644 --- a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/SparseGridTopology.cpp +++ b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/SparseGridTopology.cpp @@ -42,11 +42,11 @@ using namespace sofa::helper; namespace sofa::component::topology::container::grid { -int SparseGridTopologyClass = core::RegisterObject("Sparse grid in 3D") - .addAlias("SparseGrid") - .add< SparseGridTopology >() - ; - +void registerSparseGridTopology(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Sparse grid in 3D.") + .add< SparseGridTopology >()); +} const float SparseGridTopology::WEIGHT27[8][27] = { diff --git a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/SphereGridTopology.cpp b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/SphereGridTopology.cpp index 2e2e93c1653..39ea54ec88e 100644 --- a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/SphereGridTopology.cpp +++ b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/SphereGridTopology.cpp @@ -29,12 +29,11 @@ namespace sofa::component::topology::container::grid using namespace sofa::type; using namespace sofa::defaulttype; - - -int SphereGridTopologyClass = core::RegisterObject("Sphere grid in 3D") - .addAlias("SphereGrid") - .add< SphereGridTopology >() - ; +void registerSphereGridTopology(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Sphere grid in 3D.") + .add< SphereGridTopology >()); +} SphereGridTopology::SphereGridTopology(int nx, int ny, int nz) : GridTopology(nx, ny, nz) diff --git a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/init.cpp b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/init.cpp index a134bb36d20..59702ee2338 100644 --- a/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/init.cpp +++ b/Sofa/Component/Topology/Container/Grid/src/sofa/component/topology/container/grid/init.cpp @@ -21,13 +21,24 @@ ******************************************************************************/ #include #include +#include + namespace sofa::component::topology::container::grid { - + +extern void registerCylinderGridTopology(sofa::core::ObjectFactory* factory); +extern void registerGridTopology(sofa::core::ObjectFactory* factory); +extern void registerRegularGridTopology(sofa::core::ObjectFactory* factory); +extern void registerSparseGridMultipleTopology(sofa::core::ObjectFactory* factory); +extern void registerSparseGridRamificationTopology(sofa::core::ObjectFactory* factory); +extern void registerSparseGridTopology(sofa::core::ObjectFactory* factory); +extern void registerSphereGridTopology(sofa::core::ObjectFactory* factory); + extern "C" { SOFA_EXPORT_DYNAMIC_LIBRARY void initExternalModule(); SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleName(); SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleVersion(); + SOFA_EXPORT_DYNAMIC_LIBRARY void registerObjects(sofa::core::ObjectFactory* factory); } void initExternalModule() @@ -45,11 +56,25 @@ const char* getModuleVersion() return MODULE_VERSION; } +void registerObjects(sofa::core::ObjectFactory* factory) +{ + registerCylinderGridTopology(factory); + registerGridTopology(factory); + registerRegularGridTopology(factory); + registerSparseGridMultipleTopology(factory); + registerSparseGridRamificationTopology(factory); + registerSparseGridTopology(factory); + registerSphereGridTopology(factory); +} + void init() { static bool first = true; if (first) { + // make sure that this plugin is registered into the PluginManager + sofa::helper::system::PluginManager::getInstance().registerPlugin(MODULE_NAME); + first = false; } } diff --git a/Sofa/Component/Topology/Container/src/sofa/component/topology/container/init.cpp b/Sofa/Component/Topology/Container/src/sofa/component/topology/container/init.cpp index ff104b239f8..99b3ffeac8d 100644 --- a/Sofa/Component/Topology/Container/src/sofa/component/topology/container/init.cpp +++ b/Sofa/Component/Topology/Container/src/sofa/component/topology/container/init.cpp @@ -25,6 +25,9 @@ #include #include +#include +#include + namespace sofa::component::topology::container { @@ -32,6 +35,7 @@ extern "C" { SOFA_EXPORT_DYNAMIC_LIBRARY void initExternalModule(); SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleName(); SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleVersion(); + SOFA_EXPORT_DYNAMIC_LIBRARY void registerObjects(sofa::core::ObjectFactory* factory); } void initExternalModule() @@ -49,6 +53,13 @@ const char* getModuleVersion() return MODULE_VERSION; } +void registerObjects(sofa::core::ObjectFactory* factory) +{ + factory->registerObjectsFromPlugin("Sofa.Component.Topology.Container.Constant"); + factory->registerObjectsFromPlugin("Sofa.Component.Topology.Container.Dynamic"); + factory->registerObjectsFromPlugin("Sofa.Component.Topology.Container.Grid"); +} + void init() { static bool first = true; @@ -59,6 +70,9 @@ void init() sofa::component::topology::container::dynamic::init(); sofa::component::topology::container::grid::init(); + // make sure that this plugin is registered into the PluginManager + sofa::helper::system::PluginManager::getInstance().registerPlugin(MODULE_NAME); + first = false; } } diff --git a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/CenterPointTopologicalMapping.cpp b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/CenterPointTopologicalMapping.cpp index 4e9ad9e2c77..e3434f7637e 100644 --- a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/CenterPointTopologicalMapping.cpp +++ b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/CenterPointTopologicalMapping.cpp @@ -31,14 +31,15 @@ namespace sofa::component::topology::mapping { -using namespace sofa::defaulttype; + using namespace sofa::component::topology::mapping; using namespace sofa::core::topology; -// Register in the Factory -int CenterPointTopologicalMappingClass = core::RegisterObject ( "" ) - .add< CenterPointTopologicalMapping >() - ; +void registerCenterPointTopologicalMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Each primitive in the input Topology will be mapped to a point in the output topology.") + .add< CenterPointTopologicalMapping >()); +} // Implementation CenterPointTopologicalMapping::CenterPointTopologicalMapping () diff --git a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Edge2QuadTopologicalMapping.cpp b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Edge2QuadTopologicalMapping.cpp index 2f5bcfe4a2a..4b46f4c3194 100644 --- a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Edge2QuadTopologicalMapping.cpp +++ b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Edge2QuadTopologicalMapping.cpp @@ -39,11 +39,11 @@ using namespace sofa::defaulttype; using namespace sofa::component::topology::mapping; using namespace sofa::core::topology; -// Register in the Factory -int Edge2QuadTopologicalMappingClass = core::RegisterObject("Special case of mapping where EdgeSetTopology is converted to QuadSetTopology.") - .add< Edge2QuadTopologicalMapping >() - - ; +void registerEdge2QuadTopologicalMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Topological mapping where EdgeSetTopology is converted to QuadSetTopology.") + .add< Edge2QuadTopologicalMapping >()); +} // Implementation Edge2QuadTopologicalMapping::Edge2QuadTopologicalMapping() diff --git a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Hexa2QuadTopologicalMapping.cpp b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Hexa2QuadTopologicalMapping.cpp index c7a9f35ef73..c749876cfe9 100644 --- a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Hexa2QuadTopologicalMapping.cpp +++ b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Hexa2QuadTopologicalMapping.cpp @@ -42,18 +42,14 @@ namespace sofa::component::topology::mapping { -using namespace sofa::defaulttype; - using namespace sofa::component::topology; using namespace sofa::core::topology; -// Register in the Factory -int Hexa2QuadTopologicalMappingClass = core::RegisterObject("Special case of mapping where HexahedronSetTopology is converted to QuadSetTopology") - .add< Hexa2QuadTopologicalMapping >() - - ; - -// Implementation +void registerHexa2QuadTopologicalMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Topological mapping where HexahedronSetTopology is converted to QuadSetTopology") + .add< Hexa2QuadTopologicalMapping >()); +} Hexa2QuadTopologicalMapping::Hexa2QuadTopologicalMapping() : sofa::core::topology::TopologicalMapping() diff --git a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Hexa2TetraTopologicalMapping.cpp b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Hexa2TetraTopologicalMapping.cpp index 818c9de3f78..3a0ff141ab2 100644 --- a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Hexa2TetraTopologicalMapping.cpp +++ b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Hexa2TetraTopologicalMapping.cpp @@ -41,18 +41,14 @@ namespace sofa::component::topology::mapping { -using namespace sofa::defaulttype; - using namespace sofa::component::topology::mapping; using namespace sofa::core::topology; -// Register in the Factory -int Hexa2TetraTopologicalMappingClass = core::RegisterObject("Special case of mapping where HexahedronSetTopology is converted to TetrahedronSetTopology") - .add< Hexa2TetraTopologicalMapping >() - - ; - -// Implementation +void registerHexa2TetraTopologicalMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Topological mapping where HexahedronSetTopology is converted to TetrahedronSetTopology") + .add< Hexa2TetraTopologicalMapping >()); +} Hexa2TetraTopologicalMapping::Hexa2TetraTopologicalMapping() : sofa::core::topology::TopologicalMapping() diff --git a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/IdentityTopologicalMapping.cpp b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/IdentityTopologicalMapping.cpp index 04f1d379292..12334c60a8a 100644 --- a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/IdentityTopologicalMapping.cpp +++ b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/IdentityTopologicalMapping.cpp @@ -48,16 +48,14 @@ namespace sofa::component::topology::mapping { -using namespace sofa::defaulttype; - using namespace sofa::component::topology::mapping; using namespace sofa::core::topology; -// Register in the Factory -int IdentityTopologicalMappingClass = core::RegisterObject("This class is a specific implementation of TopologicalMapping where the destination topology should be kept identical to the source topology. The implementation currently assumes that both topology have been initialized identically.") - .add< IdentityTopologicalMapping >() - - ; +void registerIdentityTopologicalMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("TopologicalMapping where the destination topology should be kept identical to the source topology. The implementation currently assumes that both topology have been initialized identically.") + .add< IdentityTopologicalMapping >()); +} IdentityTopologicalMapping::IdentityTopologicalMapping() { diff --git a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Quad2TriangleTopologicalMapping.cpp b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Quad2TriangleTopologicalMapping.cpp index 1d949df3185..9158923af67 100644 --- a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Quad2TriangleTopologicalMapping.cpp +++ b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Quad2TriangleTopologicalMapping.cpp @@ -53,13 +53,11 @@ typedef BaseMeshTopology In; /// Output Topology typedef BaseMeshTopology Out; -// Register in the Factory -int Quad2TriangleTopologicalMappingClass = core::RegisterObject("Special case of mapping where QuadSetTopology is converted to TriangleSetTopology") - .add< Quad2TriangleTopologicalMapping >() - - ; - -// Implementation +void registerQuad2TriangleTopologicalMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Topological mapping where QuadSetTopology is converted to TriangleSetTopology") + .add< Quad2TriangleTopologicalMapping >()); +} Quad2TriangleTopologicalMapping::Quad2TriangleTopologicalMapping() : sofa::core::topology::TopologicalMapping() diff --git a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/SubsetTopologicalMapping.cpp b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/SubsetTopologicalMapping.cpp index efbda7a7405..3330149e011 100644 --- a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/SubsetTopologicalMapping.cpp +++ b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/SubsetTopologicalMapping.cpp @@ -47,16 +47,14 @@ namespace sofa::component::topology::mapping { -using namespace sofa::defaulttype; - using namespace sofa::component::topology::mapping; using namespace sofa::core::topology; -// Register in the Factory -int SubsetTopologicalMappingClass = core::RegisterObject("This class is a specific implementation of TopologicalMapping where the destination topology is a subset of the source topology. The implementation currently assumes that both topologies have been initialized correctly.") - .add< SubsetTopologicalMapping >() - - ; +void registerSubsetTopologicalMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("TopologicalMapping where the destination topology is a subset of the source topology. The implementation currently assumes that both topologies have been initialized correctly.") + .add< SubsetTopologicalMapping >()); +} SubsetTopologicalMapping::SubsetTopologicalMapping() : d_samePoints(initData(&d_samePoints, false, "samePoints", "True if the same set of points is used in both topologies")) diff --git a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Tetra2TriangleTopologicalMapping.cpp b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Tetra2TriangleTopologicalMapping.cpp index 5158b94a940..315dab425f9 100644 --- a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Tetra2TriangleTopologicalMapping.cpp +++ b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Tetra2TriangleTopologicalMapping.cpp @@ -42,18 +42,14 @@ namespace sofa::component::topology::mapping { -using namespace sofa::defaulttype; - using namespace sofa::component::topology::mapping; using namespace sofa::core::topology; -// Register in the Factory -int Tetra2TriangleTopologicalMappingClass = core::RegisterObject("Special case of mapping where TetrahedronSetTopology is converted to TriangleSetTopology") - .add< Tetra2TriangleTopologicalMapping >() - - ; - -// Implementation +void registerTetra2TriangleTopologicalMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Topological mapping where TetrahedronSetTopology is converted to TriangleSetTopology") + .add< Tetra2TriangleTopologicalMapping >()); +} Tetra2TriangleTopologicalMapping::Tetra2TriangleTopologicalMapping() : sofa::core::topology::TopologicalMapping() diff --git a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Triangle2EdgeTopologicalMapping.cpp b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Triangle2EdgeTopologicalMapping.cpp index a43dbf4e255..a8c83f5b0a1 100644 --- a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Triangle2EdgeTopologicalMapping.cpp +++ b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/Triangle2EdgeTopologicalMapping.cpp @@ -41,14 +41,14 @@ namespace sofa::component::topology::mapping { -using namespace sofa::defaulttype; - using namespace sofa::component::topology::mapping; using namespace sofa::core::topology; -// Register in the Factory -int Triangle2EdgeTopologicalMappingClass = core::RegisterObject("Special case of mapping where TriangleSetTopology is converted to EdgeSetTopology") - .add< Triangle2EdgeTopologicalMapping >(); +void registerTriangle2EdgeTopologicalMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Topological mapping where TriangleSetTopology is converted to EdgeSetTopology") + .add< Triangle2EdgeTopologicalMapping >()); +} Triangle2EdgeTopologicalMapping::Triangle2EdgeTopologicalMapping() : sofa::core::topology::TopologicalMapping() diff --git a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/init.cpp b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/init.cpp index c84007bf931..7a520cdffd2 100644 --- a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/init.cpp +++ b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/init.cpp @@ -21,13 +21,26 @@ ******************************************************************************/ #include #include +#include + namespace sofa::component::topology::mapping { - + +extern void registerCenterPointTopologicalMapping(sofa::core::ObjectFactory* factory); +extern void registerEdge2QuadTopologicalMapping(sofa::core::ObjectFactory* factory); +extern void registerHexa2QuadTopologicalMapping(sofa::core::ObjectFactory* factory); +extern void registerHexa2TetraTopologicalMapping(sofa::core::ObjectFactory* factory); +extern void registerIdentityTopologicalMapping(sofa::core::ObjectFactory* factory); +extern void registerQuad2TriangleTopologicalMapping(sofa::core::ObjectFactory* factory); +extern void registerSubsetTopologicalMapping(sofa::core::ObjectFactory* factory); +extern void registerTetra2TriangleTopologicalMapping(sofa::core::ObjectFactory* factory); +extern void registerTriangle2EdgeTopologicalMapping(sofa::core::ObjectFactory* factory); + extern "C" { SOFA_EXPORT_DYNAMIC_LIBRARY void initExternalModule(); SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleName(); SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleVersion(); + SOFA_EXPORT_DYNAMIC_LIBRARY void registerObjects(sofa::core::ObjectFactory* factory); } void initExternalModule() @@ -45,11 +58,27 @@ const char* getModuleVersion() return MODULE_VERSION; } +void registerObjects(sofa::core::ObjectFactory* factory) +{ + registerCenterPointTopologicalMapping(factory); + registerEdge2QuadTopologicalMapping(factory); + registerHexa2QuadTopologicalMapping(factory); + registerHexa2TetraTopologicalMapping(factory); + registerIdentityTopologicalMapping(factory); + registerQuad2TriangleTopologicalMapping(factory); + registerSubsetTopologicalMapping(factory); + registerTetra2TriangleTopologicalMapping(factory); + registerTriangle2EdgeTopologicalMapping(factory); +} + void init() { static bool first = true; if (first) { + // make sure that this plugin is registered into the PluginManager + sofa::helper::system::PluginManager::getInstance().registerPlugin(MODULE_NAME); + first = false; } } diff --git a/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologicalChangeProcessor.cpp b/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologicalChangeProcessor.cpp index 9532d64031d..dfb078c7d4e 100644 --- a/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologicalChangeProcessor.cpp +++ b/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologicalChangeProcessor.cpp @@ -50,11 +50,11 @@ namespace sofa::component::topology::utility using namespace sofa::type; using namespace defaulttype; - - -int TopologicalChangeProcessorClass = core::RegisterObject("Read topological Changes and process them.") - .add< TopologicalChangeProcessor >(); - +void registerTopologicalChangeProcessor(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Read topological Changes and process them.") + .add< TopologicalChangeProcessor >()); +} TopologicalChangeProcessor::TopologicalChangeProcessor() : d_filename(initData(&d_filename, "filename", "input file name for topological changes.")) diff --git a/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologyBoundingTrasher.cpp b/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologyBoundingTrasher.cpp index 4f2eda6e674..be5b2142def 100644 --- a/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologyBoundingTrasher.cpp +++ b/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologyBoundingTrasher.cpp @@ -28,11 +28,13 @@ namespace sofa::component::topology::utility { -using namespace sofa::type; using namespace sofa::defaulttype; -int TopologyBoundingTrasherClass = core::RegisterObject("A class to remove all elements going outside from the given Bounding Box.") - .add< TopologyBoundingTrasher >(true); +void registerTopologyBoundingTrasher(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("A class to remove all elements going outside from the given Bounding Box.") + .add< TopologyBoundingTrasher >()); +} template class SOFA_COMPONENT_TOPOLOGY_UTILITY_API TopologyBoundingTrasher; diff --git a/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologyChecker.cpp b/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologyChecker.cpp index a2b86bf7270..cc5994e227a 100644 --- a/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologyChecker.cpp +++ b/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologyChecker.cpp @@ -33,13 +33,13 @@ namespace sofa::component::topology::utility { -using namespace defaulttype; using namespace sofa::core::topology; - -int TopologyCheckerClass = core::RegisterObject("Read topological Changes and process them.") - .add< TopologyChecker >(); - +void registerTopologyChecker(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Read topological Changes and process them.") + .add< TopologyChecker >()); +} TopologyChecker::TopologyChecker() : d_eachStep(initData(&d_eachStep, false, "eachStep", "Check topology at each step")) diff --git a/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/init.cpp b/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/init.cpp index c4cbe818890..fc671fdd1e1 100644 --- a/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/init.cpp +++ b/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/init.cpp @@ -21,13 +21,20 @@ ******************************************************************************/ #include #include +#include + namespace sofa::component::topology::utility { - + +extern void registerTopologicalChangeProcessor(sofa::core::ObjectFactory* factory); +extern void registerTopologyBoundingTrasher(sofa::core::ObjectFactory* factory); +extern void registerTopologyChecker(sofa::core::ObjectFactory* factory); + extern "C" { SOFA_EXPORT_DYNAMIC_LIBRARY void initExternalModule(); SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleName(); SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleVersion(); + SOFA_EXPORT_DYNAMIC_LIBRARY void registerObjects(sofa::core::ObjectFactory* factory); } void initExternalModule() @@ -45,11 +52,21 @@ const char* getModuleVersion() return MODULE_VERSION; } +void registerObjects(sofa::core::ObjectFactory* factory) +{ + registerTopologicalChangeProcessor(factory); + registerTopologyBoundingTrasher(factory); + registerTopologyChecker(factory); +} + void init() { static bool first = true; if (first) { + // make sure that this plugin is registered into the PluginManager + sofa::helper::system::PluginManager::getInstance().registerPlugin(MODULE_NAME); + first = false; } } diff --git a/Sofa/Component/Topology/src/sofa/component/topology/init.cpp b/Sofa/Component/Topology/src/sofa/component/topology/init.cpp index 90c1fb75ffc..145ed36c9ec 100644 --- a/Sofa/Component/Topology/src/sofa/component/topology/init.cpp +++ b/Sofa/Component/Topology/src/sofa/component/topology/init.cpp @@ -25,6 +25,9 @@ #include #include +#include +#include + namespace sofa::component::topology { @@ -32,6 +35,7 @@ extern "C" { SOFA_EXPORT_DYNAMIC_LIBRARY void initExternalModule(); SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleName(); SOFA_EXPORT_DYNAMIC_LIBRARY const char* getModuleVersion(); + SOFA_EXPORT_DYNAMIC_LIBRARY void registerObjects(sofa::core::ObjectFactory* factory); } void initExternalModule() @@ -49,6 +53,13 @@ const char* getModuleVersion() return MODULE_VERSION; } +void registerObjects(sofa::core::ObjectFactory* factory) +{ + factory->registerObjectsFromPlugin("Sofa.Component.Topology.Container"); + factory->registerObjectsFromPlugin("Sofa.Component.Topology.Mapping"); + factory->registerObjectsFromPlugin("Sofa.Component.Topology.Utility"); +} + void init() { static bool first = true; @@ -59,6 +70,9 @@ void init() sofa::component::topology::mapping::init(); sofa::component::topology::utility::init(); + // make sure that this plugin is registered into the PluginManager + sofa::helper::system::PluginManager::getInstance().registerPlugin(MODULE_NAME); + first = false; } } diff --git a/Sofa/Component/src/sofa/component/init.cpp b/Sofa/Component/src/sofa/component/init.cpp index 783ca1c1aeb..d878de1f175 100644 --- a/Sofa/Component/src/sofa/component/init.cpp +++ b/Sofa/Component/src/sofa/component/init.cpp @@ -86,6 +86,7 @@ void registerObjects(sofa::core::ObjectFactory* factory) factory->registerObjectsFromPlugin("Sofa.Component.Haptics"); factory->registerObjectsFromPlugin("Sofa.Component.Diffusion"); factory->registerObjectsFromPlugin("Sofa.Component.ODESolver"); + factory->registerObjectsFromPlugin("Sofa.Component.Topology"); } void init() diff --git a/Sofa/framework/Helper/src/sofa/helper/ComponentChange.cpp b/Sofa/framework/Helper/src/sofa/helper/ComponentChange.cpp index a0ef1c3c0a9..b364d50817a 100644 --- a/Sofa/framework/Helper/src/sofa/helper/ComponentChange.cpp +++ b/Sofa/framework/Helper/src/sofa/helper/ComponentChange.cpp @@ -784,6 +784,15 @@ const std::map< std::string, Dealiased, std::less<> > dealiasedComponents = { {"ImplicitEulerSolver", Dealiased("v24.12","EulerImplicitSolver")}, {"ImplicitEuler", Dealiased("v24.12","EulerImplicitSolver")}, {"VariationalSolver", Dealiased("v24.12","VariationalSymplecticSolver")}, + {"Mesh", Dealiased("v24.12","MeshTopology")}, + {"SphereQuad", Dealiased("v24.12","SphereQuadTopology")}, + {"CylinderGrid", Dealiased("v24.12","CylinderGridTopology")}, + {"Grid", Dealiased("v24.12","GridTopology")}, + {"RegularGrid", Dealiased("v24.12","RegularGridTopology")}, + {"SparseGridMultiple", Dealiased("v24.12","SparseGridMultipleTopology")}, + {"SparseGridRamification", Dealiased("v24.12","SparseGridRamificationTopology")}, + {"SparseGrid", Dealiased("v24.12","SparseGridTopology")}, + {"SphereGrid", Dealiased("v24.12","SphereGridTopology")}, }; From 475f91b6574b266586255b61e67252168ec11924 Mon Sep 17 00:00:00 2001 From: Frederick Roy Date: Tue, 24 Sep 2024 09:33:20 +0900 Subject: [PATCH 2/5] remove aliases in scene --- .../Constraint/Lagrangian/FixedLagrangianConstaint_Vec3.scn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Component/Constraint/Lagrangian/FixedLagrangianConstaint_Vec3.scn b/examples/Component/Constraint/Lagrangian/FixedLagrangianConstaint_Vec3.scn index ef74dbb59a4..47d32cedd42 100644 --- a/examples/Component/Constraint/Lagrangian/FixedLagrangianConstaint_Vec3.scn +++ b/examples/Component/Constraint/Lagrangian/FixedLagrangianConstaint_Vec3.scn @@ -29,7 +29,7 @@ - + From f7b9489286acb4041675d12e84c4106b7a938ee5 Mon Sep 17 00:00:00 2001 From: Frederick Roy Date: Tue, 24 Sep 2024 09:40:54 +0900 Subject: [PATCH 3/5] change test with VisualModel --- .../projects/SceneChecking/tests/SceneChecker_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/projects/SceneChecking/tests/SceneChecker_test.cpp b/applications/projects/SceneChecking/tests/SceneChecker_test.cpp index b5511140d91..9de8d0bbcf4 100644 --- a/applications/projects/SceneChecking/tests/SceneChecker_test.cpp +++ b/applications/projects/SceneChecking/tests/SceneChecker_test.cpp @@ -209,15 +209,15 @@ struct SceneChecker_test : public BaseSimulationTest void checkUsingAlias(bool sceneWithAlias) { - const std::string withAlias = "Mesh"; - const std::string withoutAlias = "MeshTopology"; + const std::string withAlias = "VisualModel"; + const std::string withoutAlias = "VisualModelImpl"; const std::string componentName = sceneWithAlias ? withAlias : withoutAlias; std::stringstream scene; scene << " \n" << " \n" << " \n" - << " \n" + << " \n" << " \n" << " <" << componentName << "/> \n" << " \n"; From 040823ea369413a085e88d989580d9c55cfb5dce Mon Sep 17 00:00:00 2001 From: Frederick Roy Date: Tue, 24 Sep 2024 09:41:18 +0900 Subject: [PATCH 4/5] remove aliases from unittest --- Sofa/Component/Engine/Select/tests/MeshROI_test.cpp | 6 +++--- Sofa/Component/Mass/tests/DiagonalMass_test.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Sofa/Component/Engine/Select/tests/MeshROI_test.cpp b/Sofa/Component/Engine/Select/tests/MeshROI_test.cpp index 2f5dd0ad8ef..aa3e96d8ab6 100644 --- a/Sofa/Component/Engine/Select/tests/MeshROI_test.cpp +++ b/Sofa/Component/Engine/Select/tests/MeshROI_test.cpp @@ -73,7 +73,7 @@ struct MeshROI_test : public BaseSimulationTest, " " " " " " - " " + " " " " " " " " ; @@ -136,7 +136,7 @@ struct MeshROI_test : public BaseSimulationTest, " " " " " " - " " + " " " " " " " " ; @@ -157,7 +157,7 @@ struct MeshROI_test : public BaseSimulationTest, - + diff --git a/Sofa/Component/Mass/tests/DiagonalMass_test.cpp b/Sofa/Component/Mass/tests/DiagonalMass_test.cpp index 882614ea793..1c4d0c378db 100644 --- a/Sofa/Component/Mass/tests/DiagonalMass_test.cpp +++ b/Sofa/Component/Mass/tests/DiagonalMass_test.cpp @@ -155,7 +155,7 @@ class DiagonalMass_test : public BaseTest "" " " " " - " " + " " " " " " " " ; @@ -188,7 +188,7 @@ class DiagonalMass_test : public BaseTest " " " " " " - " " + " " " " " " " " ; @@ -219,7 +219,7 @@ class DiagonalMass_test : public BaseTest " " " " " " - " " + " " " " " " " " ; @@ -249,7 +249,7 @@ class DiagonalMass_test : public BaseTest " " " " " " - " " + " " " " " " " " ; From cbf8bdf25abb79c8e4e1cd38e93946eebeabbd9d Mon Sep 17 00:00:00 2001 From: Frederick Roy Date: Fri, 27 Sep 2024 09:48:23 +0900 Subject: [PATCH 5/5] Apply suggestions from code review (updates on component description) Co-authored-by: Hugo --- .../sofa/component/topology/container/constant/CubeTopology.cpp | 2 +- .../sofa/component/topology/container/constant/MeshTopology.cpp | 2 +- .../container/dynamic/DynamicSparseGridGeometryAlgorithms.cpp | 2 +- .../container/dynamic/DynamicSparseGridTopologyContainer.cpp | 2 +- .../container/dynamic/DynamicSparseGridTopologyModifier.cpp | 2 +- .../topology/container/dynamic/EdgeSetGeometryAlgorithms.cpp | 2 +- .../topology/container/dynamic/EdgeSetTopologyContainer.cpp | 2 +- .../topology/container/dynamic/EdgeSetTopologyModifier.cpp | 2 +- .../container/dynamic/HexahedronSetGeometryAlgorithms.cpp | 2 +- .../container/dynamic/HexahedronSetTopologyContainer.cpp | 2 +- .../container/dynamic/HexahedronSetTopologyModifier.cpp | 2 +- .../topology/container/dynamic/PointSetGeometryAlgorithms.cpp | 2 +- .../topology/container/dynamic/PointSetTopologyContainer.cpp | 2 +- .../topology/container/dynamic/PointSetTopologyModifier.cpp | 2 +- .../topology/container/dynamic/QuadSetGeometryAlgorithms.cpp | 2 +- .../topology/container/dynamic/QuadSetTopologyContainer.cpp | 2 +- .../topology/container/dynamic/QuadSetTopologyModifier.cpp | 2 +- .../container/dynamic/TetrahedronSetGeometryAlgorithms.cpp | 2 +- .../container/dynamic/TetrahedronSetTopologyContainer.cpp | 2 +- .../container/dynamic/TetrahedronSetTopologyModifier.cpp | 2 +- .../container/dynamic/TriangleSetGeometryAlgorithms.cpp | 2 +- .../topology/container/dynamic/TriangleSetTopologyContainer.cpp | 2 +- .../topology/container/dynamic/TriangleSetTopologyModifier.cpp | 2 +- .../topology/mapping/CenterPointTopologicalMapping.cpp | 2 +- .../component/topology/utility/TopologicalChangeProcessor.cpp | 2 +- .../sofa/component/topology/utility/TopologyBoundingTrasher.cpp | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/CubeTopology.cpp b/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/CubeTopology.cpp index a9e09ed3bc8..d2eaa4d0ec2 100644 --- a/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/CubeTopology.cpp +++ b/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/CubeTopology.cpp @@ -59,7 +59,7 @@ void CubeTopology::parse(core::objectmodel::BaseObjectDescription* arg) void registerCubeTopology(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Surface of a cube in 3D.") + factory->registerObjects(core::ObjectRegistrationData("Surface topology of a cube in 3D (points, edges and quads).") .add< CubeTopology >()); } diff --git a/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/MeshTopology.cpp b/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/MeshTopology.cpp index 74d4fb6d8a6..f8384eca4a1 100644 --- a/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/MeshTopology.cpp +++ b/Sofa/Component/Topology/Container/Constant/src/sofa/component/topology/container/constant/MeshTopology.cpp @@ -480,7 +480,7 @@ using core::topology::BaseMeshTopology; void registerMeshTopology(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Generic mesh topology.") + factory->registerObjects(core::ObjectRegistrationData("Generic constant topology loaded from a mesh file.") .add< MeshTopology >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridGeometryAlgorithms.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridGeometryAlgorithms.cpp index 4cba0c5c79d..a134550bdeb 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridGeometryAlgorithms.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridGeometryAlgorithms.cpp @@ -31,7 +31,7 @@ using namespace sofa::defaulttype; void registerDynamicSparseGridGeometryAlgorithms(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Dynamic Sparse grid geometry algorithms.") + factory->registerObjects(core::ObjectRegistrationData("Dynamic sparse grid geometry algorithms.") .add< DynamicSparseGridGeometryAlgorithms >(true) // default template .add< DynamicSparseGridGeometryAlgorithms >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridTopologyContainer.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridTopologyContainer.cpp index 5d39ff4ec15..8f7c5684a5f 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridTopologyContainer.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridTopologyContainer.cpp @@ -35,7 +35,7 @@ using namespace sofa::defaulttype; void registerDynamicSparseGridTopologyContainer(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Dynamic Sparse grid geometry container.") + factory->registerObjects(core::ObjectRegistrationData("Dynamic sparse grid geometry container.") .add< DynamicSparseGridTopologyContainer >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridTopologyModifier.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridTopologyModifier.cpp index 621e327ecda..3f88626577c 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridTopologyModifier.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/DynamicSparseGridTopologyModifier.cpp @@ -32,7 +32,7 @@ namespace sofa::component::topology::container::dynamic void registerDynamicSparseGridTopologyModifier(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Dynamic Sparse grid geometry modifier.") + factory->registerObjects(core::ObjectRegistrationData("Dynamic sparse grid geometry modifier.") .add< DynamicSparseGridTopologyModifier >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetGeometryAlgorithms.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetGeometryAlgorithms.cpp index 3185d0fc840..98ddf0cc07d 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetGeometryAlgorithms.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetGeometryAlgorithms.cpp @@ -33,7 +33,7 @@ using namespace sofa::defaulttype; void registerEdgeSetGeometryAlgorithms(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Edge set geometry algorithms.") + factory->registerObjects(core::ObjectRegistrationData("Geometry algorithms dedicated to an edge topology.") .add< EdgeSetGeometryAlgorithms >(true) // default template .add< EdgeSetGeometryAlgorithms >() .add< EdgeSetGeometryAlgorithms >() diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetTopologyContainer.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetTopologyContainer.cpp index 9273c9eb6c1..6d3de29e77f 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetTopologyContainer.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetTopologyContainer.cpp @@ -40,7 +40,7 @@ using namespace sofa::defaulttype; void registerEdgeSetTopologyContainer(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Edge set topology container.") + factory->registerObjects(core::ObjectRegistrationData("Topology container for an edge topology.") .add< EdgeSetTopologyContainer >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetTopologyModifier.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetTopologyModifier.cpp index 56925587c58..0edd32a39a0 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetTopologyModifier.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/EdgeSetTopologyModifier.cpp @@ -43,7 +43,7 @@ namespace sofa::component::topology::container::dynamic void registerEdgeSetTopologyModifier(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Edge set topology modifier.") + factory->registerObjects(core::ObjectRegistrationData("Topology modifier dedicated to an edge topology.") .add< EdgeSetTopologyModifier >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetGeometryAlgorithms.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetGeometryAlgorithms.cpp index ef4df87c975..db5d1b4e6eb 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetGeometryAlgorithms.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetGeometryAlgorithms.cpp @@ -32,7 +32,7 @@ using namespace sofa::defaulttype; void registerHexahedronSetGeometryAlgorithms(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Hexahedron set geometry algorithms.") + factory->registerObjects(core::ObjectRegistrationData("Geometry algorithms dedicated to an hexahedral topology.") .add< HexahedronSetGeometryAlgorithms >(true) // default template .add< HexahedronSetGeometryAlgorithms >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetTopologyContainer.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetTopologyContainer.cpp index 33bb916d67e..f9fa154edba 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetTopologyContainer.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetTopologyContainer.cpp @@ -34,7 +34,7 @@ using sofa::core::topology::verticesInHexahedronArray; void registerHexahedronSetTopologyContainer(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Hexahedron set topology container.") + factory->registerObjects(core::ObjectRegistrationData("Topology container dedicated to an hexahedral topology.") .add< HexahedronSetTopologyContainer >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetTopologyModifier.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetTopologyModifier.cpp index c406876ac08..93f8c310868 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetTopologyModifier.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/HexahedronSetTopologyModifier.cpp @@ -33,7 +33,7 @@ namespace sofa::component::topology::container::dynamic void registerHexahedronSetTopologyModifier(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Hexahedron set topology modifier.") + factory->registerObjects(core::ObjectRegistrationData("Topology modifier dedicated to an hexahedral topology.") .add< HexahedronSetTopologyModifier >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetGeometryAlgorithms.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetGeometryAlgorithms.cpp index 6eb55ee2a4d..2f7f39b68a7 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetGeometryAlgorithms.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetGeometryAlgorithms.cpp @@ -32,7 +32,7 @@ using namespace sofa::defaulttype; void registerPointSetGeometryAlgorithms(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Point set geometry algorithms.") + factory->registerObjects(core::ObjectRegistrationData("Geometry algorithms dedicated to a point topology.") .add< PointSetGeometryAlgorithms >(true) // default template .add< PointSetGeometryAlgorithms >() .add< PointSetGeometryAlgorithms >()); diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetTopologyContainer.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetTopologyContainer.cpp index c165e65b577..ef8b6d401e1 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetTopologyContainer.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetTopologyContainer.cpp @@ -51,7 +51,7 @@ struct GeneratePointID void registerPointSetTopologyContainer(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Point set topology container.") + factory->registerObjects(core::ObjectRegistrationData("Topology container dedicated to a point topology.") .add< PointSetTopologyContainer >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetTopologyModifier.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetTopologyModifier.cpp index 011db7b972a..cc35bf05f07 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetTopologyModifier.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/PointSetTopologyModifier.cpp @@ -36,7 +36,7 @@ namespace sofa::component::topology::container::dynamic void registerPointSetTopologyModifier(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Point set topology modifier.") + factory->registerObjects(core::ObjectRegistrationData("Topology modifier dedicated to a point topology.") .add< PointSetTopologyModifier >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetGeometryAlgorithms.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetGeometryAlgorithms.cpp index 1072deaaefe..cf6a9461cbf 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetGeometryAlgorithms.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetGeometryAlgorithms.cpp @@ -33,7 +33,7 @@ using namespace sofa::defaulttype; void registerQuadSetGeometryAlgorithms(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Quad set geometry algorithms.") + factory->registerObjects(core::ObjectRegistrationData("Geometry algorithms dedicated to a quad topology.") .add< QuadSetGeometryAlgorithms >(true) // default template .add< QuadSetGeometryAlgorithms >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetTopologyContainer.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetTopologyContainer.cpp index 108ba5b41b0..05d4641150b 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetTopologyContainer.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetTopologyContainer.cpp @@ -30,7 +30,7 @@ namespace sofa::component::topology::container::dynamic void registerQuadSetTopologyContainer(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Quad set topology container.") + factory->registerObjects(core::ObjectRegistrationData("Topology container dedicated to a quad topology.") .add< QuadSetTopologyContainer >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetTopologyModifier.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetTopologyModifier.cpp index 8b65baf6746..bee7780caa3 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetTopologyModifier.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/QuadSetTopologyModifier.cpp @@ -33,7 +33,7 @@ namespace sofa::component::topology::container::dynamic void registerQuadSetTopologyModifier(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Quad set topology modifier.") + factory->registerObjects(core::ObjectRegistrationData("Topology modifier dedicated to a quad topology.") .add< QuadSetTopologyModifier >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetGeometryAlgorithms.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetGeometryAlgorithms.cpp index 44ba8cd335d..7bf78f2b1a5 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetGeometryAlgorithms.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetGeometryAlgorithms.cpp @@ -32,7 +32,7 @@ using namespace sofa::defaulttype; void registerTetrahedronSetGeometryAlgorithms(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Tetrahedron set geometry algorithms.") + factory->registerObjects(core::ObjectRegistrationData("Geometry algorithms dedicated to a tetrahedral topology.") .add< TetrahedronSetGeometryAlgorithms >(true) // default template .add< TetrahedronSetGeometryAlgorithms >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetTopologyContainer.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetTopologyContainer.cpp index 6b9aec63546..5f9fedd0175 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetTopologyContainer.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetTopologyContainer.cpp @@ -31,7 +31,7 @@ using sofa::core::topology::edgesInTetrahedronArray; void registerTetrahedronSetTopologyContainer(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Tetrahedron set topology container.") + factory->registerObjects(core::ObjectRegistrationData("Topology container dedicated to a tetrahedral topology.") .add< TetrahedronSetTopologyContainer >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetTopologyModifier.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetTopologyModifier.cpp index 5affc213eed..faee40cbb0f 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetTopologyModifier.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TetrahedronSetTopologyModifier.cpp @@ -36,7 +36,7 @@ namespace sofa::component::topology::container::dynamic void registerTetrahedronSetTopologyModifier(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Tetrahedron set topology modifier.") + factory->registerObjects(core::ObjectRegistrationData("Topology modifier dedicated to a tetrahedral topology.") .add< TetrahedronSetTopologyModifier >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetGeometryAlgorithms.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetGeometryAlgorithms.cpp index 3356543d77e..9953a160abc 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetGeometryAlgorithms.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetGeometryAlgorithms.cpp @@ -32,7 +32,7 @@ using namespace sofa::defaulttype; void registerTriangleSetGeometryAlgorithms(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Triangle set geometry algorithms.") + factory->registerObjects(core::ObjectRegistrationData("Geometry algorithms dedicated to a triangular topology.") .add< TriangleSetGeometryAlgorithms >(true) // default template .add< TriangleSetGeometryAlgorithms >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyContainer.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyContainer.cpp index b43f1c3ad64..871f7896046 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyContainer.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyContainer.cpp @@ -29,7 +29,7 @@ namespace sofa::component::topology::container::dynamic void registerTriangleSetTopologyContainer(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Triangle set topology container.") + factory->registerObjects(core::ObjectRegistrationData("Topology container dedicated to a triangular topology.") .add< TriangleSetTopologyContainer >()); } diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyModifier.cpp b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyModifier.cpp index 52cc34ef3c1..f03f972b45c 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyModifier.cpp +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyModifier.cpp @@ -36,7 +36,7 @@ namespace sofa::component::topology::container::dynamic void registerTriangleSetTopologyModifier(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Triangle set topology modifier.") + factory->registerObjects(core::ObjectRegistrationData("Topology modifier dedicated to a triangular topology.") .add< TriangleSetTopologyModifier >()); } diff --git a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/CenterPointTopologicalMapping.cpp b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/CenterPointTopologicalMapping.cpp index e3434f7637e..c53d1e9b848 100644 --- a/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/CenterPointTopologicalMapping.cpp +++ b/Sofa/Component/Topology/Mapping/src/sofa/component/topology/mapping/CenterPointTopologicalMapping.cpp @@ -37,7 +37,7 @@ using namespace sofa::core::topology; void registerCenterPointTopologicalMapping(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Each primitive in the input Topology will be mapped to a point in the output topology.") + factory->registerObjects(core::ObjectRegistrationData("Topological mapping where each primitive in the input topology will be mapped to a point in the output topology.") .add< CenterPointTopologicalMapping >()); } diff --git a/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologicalChangeProcessor.cpp b/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologicalChangeProcessor.cpp index dfb078c7d4e..f9cacb1af93 100644 --- a/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologicalChangeProcessor.cpp +++ b/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologicalChangeProcessor.cpp @@ -52,7 +52,7 @@ using namespace defaulttype; void registerTopologicalChangeProcessor(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Read topological Changes and process them.") + factory->registerObjects(core::ObjectRegistrationData("Read topological changes and process them.") .add< TopologicalChangeProcessor >()); } diff --git a/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologyBoundingTrasher.cpp b/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologyBoundingTrasher.cpp index be5b2142def..853dd829362 100644 --- a/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologyBoundingTrasher.cpp +++ b/Sofa/Component/Topology/Utility/src/sofa/component/topology/utility/TopologyBoundingTrasher.cpp @@ -32,7 +32,7 @@ using namespace sofa::defaulttype; void registerTopologyBoundingTrasher(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("A class to remove all elements going outside from the given Bounding Box.") + factory->registerObjects(core::ObjectRegistrationData("Component removing all elements going outside from the given bounding box.") .add< TopologyBoundingTrasher >()); }