diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/BarycentricMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/BarycentricMapping.cpp index ec2322e87c0..8617f33bc88 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/BarycentricMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/BarycentricMapping.cpp @@ -30,12 +30,11 @@ namespace sofa::component::mapping::linear using namespace sofa::defaulttype; -// Register in the Factory -int BarycentricMappingClass = core::RegisterObject("Mapping using barycentric coordinates of the child with respect to cells of its parent") - .add< BarycentricMapping< Vec3Types, Vec3Types > >(true) - - - ; +void registerBarycentricMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Mapping using barycentric coordinates of the child with respect to cells of its parent.") + .add< BarycentricMapping< Vec3Types, Vec3Types > >(true)); +} template class SOFA_COMPONENT_MAPPING_LINEAR_API BarycentricMapping< Vec3Types, Vec3Types >; diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/BarycentricMappingRigid.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/BarycentricMappingRigid.cpp index 6204d94946c..8d71d8a7052 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/BarycentricMappingRigid.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/BarycentricMappingRigid.cpp @@ -44,13 +44,11 @@ namespace sofa::component::mapping::linear using namespace sofa::defaulttype; -// Register in the Factory -int BarycentricMappingRigidClass = core::RegisterObject("") - .add< BarycentricMapping< Vec3Types, Rigid3Types > >() - - - ; - +void registerBarycentricMappingRigid(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Mapping using barycentric coordinates of the child with respect to cells of its parent.") + .add< BarycentricMapping< Vec3Types, Rigid3Types > >()); +} template <> void BarycentricMapperHexahedronSetTopology::handleTopologyChange(core::topology::Topology* t) diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/BeamLinearMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/BeamLinearMapping.cpp index d5a196c1a73..c1a057315de 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/BeamLinearMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/BeamLinearMapping.cpp @@ -30,16 +30,12 @@ namespace sofa::component::mapping::linear using namespace defaulttype; -// Register in the Factory -int BeamLinearMappingClass = core::RegisterObject("Set the positions and velocities of points attached to a beam using linear interpolation between DOFs") - - .add< BeamLinearMapping< Rigid3Types, Vec3Types > >() - - - - ; +void registerBeamLinearMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Set the positions and velocities of points attached to a beam using linear interpolation between DOFs.") + .add< BeamLinearMapping< Rigid3Types, Vec3Types > >()); +} template class SOFA_COMPONENT_MAPPING_LINEAR_API BeamLinearMapping< Rigid3Types, Vec3Types >; - } // namespace sofa::component::mapping::linear diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/CenterOfMassMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/CenterOfMassMapping.cpp index dd35f79ef85..0d78e38ff8c 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/CenterOfMassMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/CenterOfMassMapping.cpp @@ -31,14 +31,14 @@ namespace sofa::component::mapping::linear using namespace sofa::defaulttype; -// Register in the Factory -int CenterOfMassMappingClass = core::RegisterObject("Set the point to the center of mass of the DOFs it is attached to") +void registerCenterOfMassMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Set the point to the center of mass of the DOFs it is attached to") .add< CenterOfMassMapping< Rigid3Types, Vec3Types > >() - .add< CenterOfMassMapping< Rigid2Types, Vec2Types > >() -; + .add< CenterOfMassMapping< Rigid2Types, Vec2Types > >()); +} template class SOFA_COMPONENT_MAPPING_LINEAR_API CenterOfMassMapping< Rigid3Types, Vec3Types >; template class SOFA_COMPONENT_MAPPING_LINEAR_API CenterOfMassMapping< Rigid2Types, Vec2Types >; - } // namespace sofa::component::mapping::linear diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/CenterOfMassMulti2Mapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/CenterOfMassMulti2Mapping.cpp index f972c698497..7d79f3ca410 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/CenterOfMassMulti2Mapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/CenterOfMassMulti2Mapping.cpp @@ -30,13 +30,12 @@ namespace sofa::component::mapping::linear using namespace sofa::defaulttype; -// Register in the Factory -int CenterOfMassMulti2MappingClass = core::RegisterObject("Set the point to the center of mass of the DOFs it is attached to") - .add< CenterOfMassMulti2Mapping< Vec3Types, Rigid3Types, Vec3Types > >() - - ; +void registerCenterOfMassMulti2Mapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Set the point to the center of mass of the DOFs it is attached to.") + .add< CenterOfMassMulti2Mapping< Vec3Types, Rigid3Types, Vec3Types > >()); +} template class SOFA_COMPONENT_MAPPING_LINEAR_API CenterOfMassMulti2Mapping< Vec3Types, Rigid3Types, Vec3Types >; - } // namespace sofa::component::mapping::linear diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/CenterOfMassMultiMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/CenterOfMassMultiMapping.cpp index e9fb3c4988f..6cc1fc1a376 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/CenterOfMassMultiMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/CenterOfMassMultiMapping.cpp @@ -30,18 +30,16 @@ namespace sofa::component::mapping::linear using namespace sofa::defaulttype; - -// Register in the Factory -int CenterOfMassMultiMappingClass = core::RegisterObject("Set the point to the center of mass of the DOFs it is attached to") +void registerCenterOfMassMultiMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Set the point to the center of mass of the DOFs it is attached to.") .add< CenterOfMassMultiMapping< Vec3Types, Vec3Types > >() .add< CenterOfMassMultiMapping< Rigid3Types, Rigid3Types > >() - .add< CenterOfMassMultiMapping< Rigid3Types, Vec3Types > >() - - ; + .add< CenterOfMassMultiMapping< Rigid3Types, Vec3Types > >()); +} template class SOFA_COMPONENT_MAPPING_LINEAR_API CenterOfMassMultiMapping< Vec3Types, Vec3Types >; template class SOFA_COMPONENT_MAPPING_LINEAR_API CenterOfMassMultiMapping< Rigid3Types, Rigid3Types >; template class SOFA_COMPONENT_MAPPING_LINEAR_API CenterOfMassMultiMapping< Rigid3Types, Vec3Types >; - } // namespace sofa::component::mapping::linear diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/DeformableOnRigidFrameMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/DeformableOnRigidFrameMapping.cpp index 62e01e95d4c..dcad00973ff 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/DeformableOnRigidFrameMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/DeformableOnRigidFrameMapping.cpp @@ -28,13 +28,12 @@ namespace sofa::component::mapping::linear using namespace defaulttype; -// Register in the Factory -int DeformableOnRigidFrameMappingClass = core::RegisterObject("Set the positions and velocities of points attached to a rigid parent") - .add< DeformableOnRigidFrameMapping< Vec3Types, Rigid3Types, Vec3Types > >() - - ; +void registerDeformableOnRigidFrameMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Set the positions and velocities of points attached to a rigid parent.") + .add< DeformableOnRigidFrameMapping< Vec3Types, Rigid3Types, Vec3Types > >()); +} template class SOFA_COMPONENT_MAPPING_LINEAR_API DeformableOnRigidFrameMapping< Vec3Types, Rigid3Types, Vec3Types >; - } // namespace sofa::component::mapping::linear diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/IdentityMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/IdentityMapping.cpp index c1fd0c460ee..5666b206ae3 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/IdentityMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/IdentityMapping.cpp @@ -30,12 +30,10 @@ namespace sofa::component::mapping::linear { using namespace sofa::defaulttype; -using namespace core; -using namespace core::behavior; - -// Register in the Factory -int IdentityMappingClass = core::RegisterObject("Special case of mapping where the child points are the same as the parent points") +void registerIdentityMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Special case of mapping where the child points are the same as the parent points") .add< IdentityMapping< Vec3Types, Vec3Types > >() .add< IdentityMapping< Vec2Types, Vec2Types > >() .add< IdentityMapping< Vec1Types, Vec1Types > >() @@ -43,12 +41,9 @@ int IdentityMappingClass = core::RegisterObject("Special case of mapping where t .add< IdentityMapping< Vec6Types, Vec6Types > >() .add< IdentityMapping< Rigid3Types, Rigid3Types > >() .add< IdentityMapping< Rigid2Types, Rigid2Types > >() - -// Rigid -> Vec .add< IdentityMapping< Rigid3Types, Vec3Types > >() - .add< IdentityMapping< Rigid2Types, Vec2Types > >() - - ; + .add< IdentityMapping< Rigid2Types, Vec2Types > >()); +} template class SOFA_COMPONENT_MAPPING_LINEAR_API IdentityMapping< Vec3Types, Vec3Types >; template class SOFA_COMPONENT_MAPPING_LINEAR_API IdentityMapping< Vec2Types, Vec2Types >; diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/IdentityMultiMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/IdentityMultiMapping.cpp index cd6474aa518..9935427d27f 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/IdentityMultiMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/IdentityMultiMapping.cpp @@ -31,15 +31,14 @@ using namespace sofa::defaulttype; namespace sofa::component::mapping::linear { -// Register in the Factory -int IdentityMultiMappingClass = core::RegisterObject("Concatenate several States together") - .add< IdentityMultiMapping< Vec3Types, Vec3Types > >() - .add< IdentityMultiMapping< Rigid3Types, Rigid3Types > >() - - ; +void registerIdentityMultiMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Concatenate several States together.") + .add< IdentityMultiMapping< Vec3Types, Vec3Types > >() + .add< IdentityMultiMapping< Rigid3Types, Rigid3Types > >()); +} template class SOFA_COMPONENT_MAPPING_LINEAR_API IdentityMultiMapping< Vec3Types, Vec3Types >; template class SOFA_COMPONENT_MAPPING_LINEAR_API IdentityMultiMapping< Rigid3Types, Rigid3Types >; - } // namespace sofa::component::mapping::linear diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/LineSetSkinningMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/LineSetSkinningMapping.cpp index aee63b90506..0de0806a6a2 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/LineSetSkinningMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/LineSetSkinningMapping.cpp @@ -29,17 +29,12 @@ namespace sofa::component::mapping::linear using namespace sofa::defaulttype; -// Register in the Factory -int HandMappingClass = core::RegisterObject("skin a model from a set of rigid lines") - .add< LineSetSkinningMapping< Rigid3Types, Vec3Types > >() - - - ; - +void registerLineSetSkinningMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Skin a model from a set of rigid lines.") + .add< LineSetSkinningMapping< Rigid3Types, Vec3Types > >()); +} template class SOFA_COMPONENT_MAPPING_LINEAR_API LineSetSkinningMapping< Rigid3Types, Vec3Types >; - - - } //namespace sofa::component::mapping::linear diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/Mesh2PointMechanicalMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/Mesh2PointMechanicalMapping.cpp index 1655148689e..2abf6a62a88 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/Mesh2PointMechanicalMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/Mesh2PointMechanicalMapping.cpp @@ -30,15 +30,12 @@ namespace sofa::component::mapping::linear using namespace sofa::defaulttype; - -int Mesh2PointMechanicalMappingClass = core::RegisterObject("Mechanical mapping between a set of mesh primitives (point, edge, triangle...) and a set of points generated by Mesh2PointTopologicalMapping") - .add< Mesh2PointMechanicalMapping< Vec3Types, Vec3Types > >() - ; - +void registerMesh2PointMechanicalMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Mechanical mapping between a set of mesh primitives (point, edge, triangle...) and a set of points generated by Mesh2PointTopologicalMapping.") + .add< Mesh2PointMechanicalMapping< Vec3Types, Vec3Types > >()); +} template class SOFA_COMPONENT_MAPPING_LINEAR_API Mesh2PointMechanicalMapping< Vec3Types, Vec3Types >; - - - } //namespace sofa::component::mapping::linear diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/Mesh2PointTopologicalMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/Mesh2PointTopologicalMapping.cpp index fb78374342d..e00befd5e29 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/Mesh2PointTopologicalMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/Mesh2PointTopologicalMapping.cpp @@ -40,10 +40,11 @@ using namespace sofa::component::topology::container::dynamic; using namespace sofa::core::topology; using type::vector; -// Register in the Factory -int Mesh2PointTopologicalMappingClass = core::RegisterObject ( "This class maps any mesh primitive (point, edge, triangle...) into a point using a relative position from the primitive" ) - .add< Mesh2PointTopologicalMapping >() - ; +void registerMesh2PointTopologicalMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("This class maps any mesh primitive (point, edge, triangle...) into a point using a relative position from the primitive.") + .add< Mesh2PointTopologicalMapping >()); +} // Implementation Mesh2PointTopologicalMapping::Mesh2PointTopologicalMapping () diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SimpleTesselatedHexaTopologicalMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SimpleTesselatedHexaTopologicalMapping.cpp index 991450fbc2d..3ddc81d49d5 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SimpleTesselatedHexaTopologicalMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SimpleTesselatedHexaTopologicalMapping.cpp @@ -40,10 +40,11 @@ using namespace sofa::defaulttype; using namespace sofa::component::mapping::linear; using namespace sofa::core::topology; -// Register in the Factory -int SimpleTesselatedHexaTopologicalMappingClass = core::RegisterObject ( "Special case of mapping where HexahedronSetTopology is converted into a finer HexahedronSetTopology" ) - .add< SimpleTesselatedHexaTopologicalMapping >() - ; +void registerSimpleTesselatedHexaTopologicalMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Special case of mapping where HexahedronSetTopology is converted into a finer HexahedronSetTopology.") + .add< SimpleTesselatedHexaTopologicalMapping >()); +} // Implementation SimpleTesselatedHexaTopologicalMapping::SimpleTesselatedHexaTopologicalMapping() diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SimpleTesselatedTetraMechanicalMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SimpleTesselatedTetraMechanicalMapping.cpp index 3ffa3aa5df7..4c00e99bca5 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SimpleTesselatedTetraMechanicalMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SimpleTesselatedTetraMechanicalMapping.cpp @@ -32,23 +32,12 @@ using namespace sofa::defaulttype; using namespace core; using namespace core::behavior; -int SimpleTesselatedTetraMechanicalMappingClass = core::RegisterObject("Mechanical mapping between two TetrahedronSetTopologies generated by SimpleTesselatedTetraTopologicalMapping") - .add< SimpleTesselatedTetraMechanicalMapping< Vec3Types ,Vec3Types > >() - - - - ; - +void registerSimpleTesselatedTetraMechanicalMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Mechanical mapping between two TetrahedronSetTopologies generated by SimpleTesselatedTetraTopologicalMapping.") + .add< SimpleTesselatedTetraMechanicalMapping< Vec3Types, Vec3Types > >()); +} template class SimpleTesselatedTetraMechanicalMapping< Vec3Types, Vec3Types >; - - - -// Mech -> Mech - -// Mech -> Mapped - -// Mech -> ExtMapped - } //namespace sofa::component::mapping::linear diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SimpleTesselatedTetraTopologicalMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SimpleTesselatedTetraTopologicalMapping.cpp index 78700c24450..def42a686ca 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SimpleTesselatedTetraTopologicalMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SimpleTesselatedTetraTopologicalMapping.cpp @@ -42,10 +42,11 @@ using namespace sofa::component::topology::container::dynamic; using namespace sofa::core::topology; using sofa::type::fixed_array; -// Register in the Factory -int SimpleTesselatedTetraTopologicalMappingClass = core::RegisterObject ( "Special case of mapping where TetrahedronSetTopology is converted into a finer TetrahedronSetTopology" ) - .add< SimpleTesselatedTetraTopologicalMapping >() - ; +void registerSimpleTesselatedTetraTopologicalMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Special case of mapping where TetrahedronSetTopology is converted into a finer TetrahedronSetTopology.") + .add< SimpleTesselatedTetraTopologicalMapping >()); +} // Implementation SimpleTesselatedTetraTopologicalMapping::SimpleTesselatedTetraTopologicalMapping () diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SkinningMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SkinningMapping.cpp index 0ebe7063711..e747a47764d 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SkinningMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SkinningMapping.cpp @@ -28,22 +28,13 @@ namespace sofa::component::mapping::linear { using namespace defaulttype; -using namespace core; - -// Register in the Factory -int SkinningMappingClass = core::RegisterObject("skin a model from a set of rigid dofs") - -// Rigid Types - .add< SkinningMapping< Rigid3Types, Vec3Types > >() - - - - ; +void registerSkinningMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Skin a model from a set of rigid dofs.") + .add< SkinningMapping< Rigid3Types, Vec3Types > >()); +} template class SOFA_COMPONENT_MAPPING_LINEAR_API SkinningMapping< Rigid3Types, Vec3Types >; - - - } //namespace sofa::component::mapping::linear diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SubsetMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SubsetMapping.cpp index 6641621d57e..eaf5e6a7e4d 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SubsetMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SubsetMapping.cpp @@ -31,13 +31,14 @@ namespace sofa::component::mapping::linear { using namespace sofa::defaulttype; - -int SubsetMappingClass = core::RegisterObject("TODO-SubsetMappingClass") + ; +void registerSubsetMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Compute a subset of input points.") .add< SubsetMapping< Vec3Types, Vec3Types > >() .add< SubsetMapping< Vec1Types, Vec1Types > >() - .add< SubsetMapping< Rigid3Types, Rigid3Types > >() - .addAlias("SurfaceIdentityMapping") - ; + .add< SubsetMapping< Rigid3Types, Rigid3Types > >()); +} template class SOFA_COMPONENT_MAPPING_LINEAR_API SubsetMapping< Vec3Types, Vec3Types >; template class SOFA_COMPONENT_MAPPING_LINEAR_API SubsetMapping< Vec1Types, Vec1Types >; diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SubsetMultiMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SubsetMultiMapping.cpp index 3e2bcb0539e..2248c7e5cd7 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SubsetMultiMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/SubsetMultiMapping.cpp @@ -31,15 +31,15 @@ using namespace sofa::defaulttype; namespace sofa::component::mapping::linear { -// Register in the Factory -int SubsetMultiMappingClass = core::RegisterObject("Compute a subset of the input MechanicalObjects according to a dof index list") - .add< SubsetMultiMapping< Vec3Types, Vec3Types > >() - .add< SubsetMultiMapping< Vec2Types, Vec2Types > >() - .add< SubsetMultiMapping< Vec1Types, Vec1Types > >() - .add< SubsetMultiMapping< Rigid3Types, Rigid3Types > >() - .add< SubsetMultiMapping< Rigid3Types, Vec3Types > >() - - ; +void registerSubsetMultiMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Compute a subset of the input MechanicalObjects according to a dof index list.") + .add< SubsetMultiMapping< Vec3Types, Vec3Types > >() + .add< SubsetMultiMapping< Vec2Types, Vec2Types > >() + .add< SubsetMultiMapping< Vec1Types, Vec1Types > >() + .add< SubsetMultiMapping< Rigid3Types, Rigid3Types > >() + .add< SubsetMultiMapping< Rigid3Types, Vec3Types > >()); +} template class SOFA_COMPONENT_MAPPING_LINEAR_API SubsetMultiMapping< Vec3Types, Vec3Types >; template class SOFA_COMPONENT_MAPPING_LINEAR_API SubsetMultiMapping< Vec2Types, Vec2Types >; diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/TubularMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/TubularMapping.cpp index 6bd9a6fcff1..bab5a317896 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/TubularMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/TubularMapping.cpp @@ -29,15 +29,12 @@ namespace sofa::component::mapping::linear { using namespace sofa::defaulttype; -using namespace core; -using namespace core::behavior; -// Register in the Factory -int TubularMappingClass = core::RegisterObject("Create a Tube around rigid points") - .add< TubularMapping< Rigid3Types, Vec3Types > > () - - - ; +void registerTubularMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Create a Tube around rigid points.") + .add< TubularMapping< Rigid3Types, Vec3Types > >()); +} template class SOFA_COMPONENT_MAPPING_LINEAR_API TubularMapping< Rigid3Types, Vec3Types >; diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/VoidMapping.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/VoidMapping.cpp index b0aa2728df6..dfe2992bd56 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/VoidMapping.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/VoidMapping.cpp @@ -26,14 +26,10 @@ namespace sofa::component::mapping::linear { -using namespace sofa::defaulttype; -using namespace core; -using namespace core::behavior; - - -// Register in the Factory -int VoidMappingClass = core::RegisterObject("Special mapping that 'map' points for void ( no input DOF ). This is useful to be able to create animated objects mixed with real DOFs.") - .add< VoidMapping >() - ; +void registerVoidMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Special mapping that 'map' points for void ( no input DOF ). This is useful to be able to create animated objects mixed with real DOFs.") + .add< VoidMapping >()); +} } // namespace sofa::component::mapping::linear diff --git a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/init.cpp b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/init.cpp index 41646305224..d01af97a4e5 100644 --- a/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/init.cpp +++ b/Sofa/Component/Mapping/Linear/src/sofa/component/mapping/linear/init.cpp @@ -21,13 +21,37 @@ ******************************************************************************/ #include #include +#include + namespace sofa::component::mapping::linear { +extern void registerBarycentricMapping(sofa::core::ObjectFactory* factory); +extern void registerBarycentricMappingRigid(sofa::core::ObjectFactory* factory); +extern void registerBeamLinearMapping(sofa::core::ObjectFactory* factory); +extern void registerCenterOfMassMapping(sofa::core::ObjectFactory* factory); +extern void registerCenterOfMassMulti2Mapping(sofa::core::ObjectFactory* factory); +extern void registerCenterOfMassMultiMapping(sofa::core::ObjectFactory* factory); +extern void registerDeformableOnRigidFrameMapping(sofa::core::ObjectFactory* factory); +extern void registerIdentityMapping(sofa::core::ObjectFactory* factory); +extern void registerIdentityMultiMapping(sofa::core::ObjectFactory* factory); +extern void registerLineSetSkinningMapping(sofa::core::ObjectFactory* factory); +extern void registerMesh2PointMechanicalMapping(sofa::core::ObjectFactory* factory); +extern void registerMesh2PointTopologicalMapping(sofa::core::ObjectFactory* factory); +extern void registerSimpleTesselatedHexaTopologicalMapping(sofa::core::ObjectFactory* factory); +extern void registerSimpleTesselatedTetraMechanicalMapping(sofa::core::ObjectFactory* factory); +extern void registerSimpleTesselatedTetraTopologicalMapping(sofa::core::ObjectFactory* factory); +extern void registerSkinningMapping(sofa::core::ObjectFactory* factory); +extern void registerSubsetMapping(sofa::core::ObjectFactory* factory); +extern void registerSubsetMultiMapping(sofa::core::ObjectFactory* factory); +extern void registerTubularMapping(sofa::core::ObjectFactory* factory); +extern void registerVoidMapping(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 +69,38 @@ const char* getModuleVersion() return MODULE_VERSION; } +void registerObjects(sofa::core::ObjectFactory* factory) +{ + registerBarycentricMapping(factory); + registerBarycentricMappingRigid(factory); + registerBeamLinearMapping(factory); + registerCenterOfMassMapping(factory); + registerCenterOfMassMulti2Mapping(factory); + registerCenterOfMassMultiMapping(factory); + registerDeformableOnRigidFrameMapping(factory); + registerIdentityMapping(factory); + registerIdentityMultiMapping(factory); + registerLineSetSkinningMapping(factory); + registerMesh2PointMechanicalMapping(factory); + registerMesh2PointTopologicalMapping(factory); + registerSimpleTesselatedHexaTopologicalMapping(factory); + registerSimpleTesselatedTetraMechanicalMapping(factory); + registerSimpleTesselatedTetraTopologicalMapping(factory); + registerSkinningMapping(factory); + registerSubsetMapping(factory); + registerSubsetMultiMapping(factory); + registerTubularMapping(factory); + registerVoidMapping(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/Mapping/MappedMatrix/src/sofa/component/mapping/mappedmatrix/init.cpp b/Sofa/Component/Mapping/MappedMatrix/src/sofa/component/mapping/mappedmatrix/init.cpp index 17364692f93..8edb5a91e63 100644 --- a/Sofa/Component/Mapping/MappedMatrix/src/sofa/component/mapping/mappedmatrix/init.cpp +++ b/Sofa/Component/Mapping/MappedMatrix/src/sofa/component/mapping/mappedmatrix/init.cpp @@ -21,6 +21,8 @@ ******************************************************************************/ #include #include +#include + namespace sofa::component::mapping::mappedmatrix { @@ -28,6 +30,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() @@ -45,11 +48,19 @@ const char* getModuleVersion() return MODULE_VERSION; } +void registerObjects(sofa::core::ObjectFactory* factory) +{ + // this plugin does not register any component. +} + 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/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/AreaMapping.cpp b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/AreaMapping.cpp index 2922c3de451..54aa7178a27 100644 --- a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/AreaMapping.cpp +++ b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/AreaMapping.cpp @@ -28,12 +28,12 @@ namespace sofa::component::mapping::nonlinear using namespace defaulttype; -// Register in the Factory -int AreaMappingClass = core::RegisterObject("Mapping each triangle in a topology to a scalar value representing its area") - .add< AreaMapping< Vec3Types, Vec1Types > >() - ; +void registerAreaMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Mapping each triangle in a topology to a scalar value representing its area.") + .add< AreaMapping< Vec3Types, Vec1Types > >()); +} template class SOFA_COMPONENT_MAPPING_NONLINEAR_API AreaMapping< Vec3Types, Vec1Types >; - } diff --git a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/DistanceFromTargetMapping.cpp b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/DistanceFromTargetMapping.cpp index de3bf949283..bfca0babaf8 100644 --- a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/DistanceFromTargetMapping.cpp +++ b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/DistanceFromTargetMapping.cpp @@ -29,13 +29,13 @@ namespace sofa::component::mapping::nonlinear using namespace defaulttype; -// Register in the Factory -int DistanceFromTargetMappingClass = core::RegisterObject("Compute edge extensions") +void registerDistanceFromTargetMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Maps point positions to distances from target points.") .add< DistanceFromTargetMapping< Vec3Types, Vec1Types > >() .add< DistanceFromTargetMapping< Vec1Types, Vec1Types > >() - .add< DistanceFromTargetMapping< Rigid3Types, Vec1Types > >() - - ; + .add< DistanceFromTargetMapping< Rigid3Types, Vec1Types > >()); +} template class SOFA_COMPONENT_MAPPING_NONLINEAR_API DistanceFromTargetMapping< Vec3Types, Vec1Types >; template class SOFA_COMPONENT_MAPPING_NONLINEAR_API DistanceFromTargetMapping< Vec1Types, Vec1Types >; diff --git a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/DistanceMapping.cpp b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/DistanceMapping.cpp index 0af858584ba..1a9f75dbe6b 100644 --- a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/DistanceMapping.cpp +++ b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/DistanceMapping.cpp @@ -29,12 +29,12 @@ namespace sofa::component::mapping::nonlinear using namespace defaulttype; - -// Register in the Factory -int DistanceMappingClass = core::RegisterObject("Mapping each connected pair of Degrees of Freedom (DoFs) in a topology to a scalar value representing the distance between them.") +void registerDistanceMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Mapping each connected pair of Degrees of Freedom(DoFs) in a topology to a scalar value representing the distance between them.") .add< DistanceMapping< Vec3Types, Vec1Types > >() - .add< DistanceMapping< Rigid3Types, Vec1Types > >() - ; + .add< DistanceMapping< Rigid3Types, Vec1Types > >()); +} template class SOFA_COMPONENT_MAPPING_NONLINEAR_API DistanceMapping< Vec3Types, Vec1Types >; template class SOFA_COMPONENT_MAPPING_NONLINEAR_API DistanceMapping< Rigid3Types, Vec1Types >; diff --git a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/DistanceMultiMapping.cpp b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/DistanceMultiMapping.cpp index 7d0f723159b..045729b5a18 100644 --- a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/DistanceMultiMapping.cpp +++ b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/DistanceMultiMapping.cpp @@ -24,7 +24,6 @@ #include #include - namespace sofa::component::mapping::nonlinear { @@ -32,11 +31,14 @@ using defaulttype::Vec3Types; using defaulttype::Vec1Types; using defaulttype::Rigid3Types; -int DistanceMultiMappingClass = core::RegisterObject("Compute edge extensions") +void registerDistanceMultiMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Maps point positions from serveral mstates to distances (in distance unit).") .add< DistanceMultiMapping< Vec3Types, Vec1Types > >() - .add< DistanceMultiMapping< Rigid3Types, Vec1Types > >() - ; + .add< DistanceMultiMapping< Rigid3Types, Vec1Types > >()); +} template class SOFA_COMPONENT_MAPPING_NONLINEAR_API DistanceMultiMapping< Vec3Types, Vec1Types >; template class SOFA_COMPONENT_MAPPING_NONLINEAR_API DistanceMultiMapping< Rigid3Types, Vec1Types >; + } diff --git a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/RigidMapping.cpp b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/RigidMapping.cpp index 6aa5fa0f4cb..b06218c9c0e 100644 --- a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/RigidMapping.cpp +++ b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/RigidMapping.cpp @@ -41,13 +41,13 @@ void RigidMapping::updateOmega(typename InDeriv::Rot& omega += getVOrientation(out) + (typename InDeriv::Rot)cross(Out::getCPos(rotatedpoint), Out::getDPos(out)); } - -// Register in the Factory -int RigidMappingClass = core::RegisterObject("Set the positions and velocities of points attached to a rigid parent") +void registerRigidMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Set the positions and velocities of points attached to a rigid parent.") .add< RigidMapping< Rigid3Types, Vec3Types > >(true) .add< RigidMapping< Rigid3Types, Rigid3Types > >() - .add< RigidMapping< Rigid2Types, Vec2Types > >() - ; + .add< RigidMapping< Rigid2Types, Vec2Types > >()); +} template class SOFA_COMPONENT_MAPPING_NONLINEAR_API RigidMapping< Rigid3Types, Vec3Types >; template class SOFA_COMPONENT_MAPPING_NONLINEAR_API RigidMapping< Rigid3Types, Rigid3Types >; diff --git a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/SquareDistanceMapping.cpp b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/SquareDistanceMapping.cpp index 0c2ffb7f080..09fd2238176 100644 --- a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/SquareDistanceMapping.cpp +++ b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/SquareDistanceMapping.cpp @@ -29,16 +29,14 @@ namespace sofa::component::mapping::nonlinear using namespace defaulttype; - -// Register in the Factory -int SquareDistanceMappingClass = core::RegisterObject("Compute square edge extensions") +void registerSquareDistanceMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Maps point positions to square distances.") .add< SquareDistanceMapping< Vec3Types, Vec1Types > >() - .add< SquareDistanceMapping< Rigid3Types, Vec1Types > >() - - ; + .add< SquareDistanceMapping< Rigid3Types, Vec1Types > >()); +} template class SOFA_COMPONENT_MAPPING_NONLINEAR_API SquareDistanceMapping< Vec3Types, Vec1Types >; template class SOFA_COMPONENT_MAPPING_NONLINEAR_API SquareDistanceMapping< Rigid3Types, Vec1Types >; - } // namespace sofa::component::mapping::nonlinear diff --git a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/SquareMapping.cpp b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/SquareMapping.cpp index 064da10c1c6..38aff6f6ae4 100644 --- a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/SquareMapping.cpp +++ b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/SquareMapping.cpp @@ -29,13 +29,12 @@ namespace sofa::component::mapping::nonlinear using namespace defaulttype; - -// Register in the Factory -int SquareMappingClass = core::RegisterObject("Compute the square") - .add< SquareMapping< Vec1Types, Vec1Types > >() - ; +void registerSquareMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Compute the square value from the inputs.") + .add< SquareMapping< Vec1Types, Vec1Types > >()); +} template class SOFA_COMPONENT_MAPPING_NONLINEAR_API SquareMapping< Vec1Types, Vec1Types >; - } // namespace sofa::component::mapping::nonlinear diff --git a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/VolumeMapping.cpp b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/VolumeMapping.cpp index f028f0f98f4..d436abec53d 100644 --- a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/VolumeMapping.cpp +++ b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/VolumeMapping.cpp @@ -28,12 +28,12 @@ namespace sofa::component::mapping::nonlinear using namespace defaulttype; -// Register in the Factory -int VolumeMappingClass = core::RegisterObject("Mapping each tetrahedron in a topology to a scalar value representing its volume") - .add< VolumeMapping< Vec3Types, Vec1Types > >() - ; +void registerVolumeMapping(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Mapping each tetrahedron in a topology to a scalar value representing its volume.") + .add< VolumeMapping< Vec3Types, Vec1Types > >()); +} template class SOFA_COMPONENT_MAPPING_NONLINEAR_API VolumeMapping< Vec3Types, Vec1Types >; - } diff --git a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/init.cpp b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/init.cpp index 88bc991628a..edb75dd92b1 100644 --- a/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/init.cpp +++ b/Sofa/Component/Mapping/NonLinear/src/sofa/component/mapping/nonlinear/init.cpp @@ -21,13 +21,25 @@ ******************************************************************************/ #include #include +#include + namespace sofa::component::mapping::nonlinear { +extern void registerAreaMapping(sofa::core::ObjectFactory* factory); +extern void registerDistanceFromTargetMapping(sofa::core::ObjectFactory* factory); +extern void registerDistanceMapping(sofa::core::ObjectFactory* factory); +extern void registerDistanceMultiMapping(sofa::core::ObjectFactory* factory); +extern void registerRigidMapping(sofa::core::ObjectFactory* factory); +extern void registerSquareDistanceMapping(sofa::core::ObjectFactory* factory); +extern void registerSquareMapping(sofa::core::ObjectFactory* factory); +extern void registerVolumeMapping(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 +57,26 @@ const char* getModuleVersion() return MODULE_VERSION; } +void registerObjects(sofa::core::ObjectFactory* factory) +{ + registerAreaMapping(factory); + registerDistanceFromTargetMapping(factory); + registerDistanceMapping(factory); + registerDistanceMultiMapping(factory); + registerRigidMapping(factory); + registerSquareDistanceMapping(factory); + registerSquareMapping(factory); + registerVolumeMapping(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/Mapping/src/sofa/component/mapping/init.cpp b/Sofa/Component/Mapping/src/sofa/component/mapping/init.cpp index 5a2f0686290..32fc2adb7aa 100644 --- a/Sofa/Component/Mapping/src/sofa/component/mapping/init.cpp +++ b/Sofa/Component/Mapping/src/sofa/component/mapping/init.cpp @@ -22,8 +22,11 @@ #include #include -#include #include +#include + +#include +#include namespace sofa::component::mapping { @@ -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,14 +53,24 @@ const char* getModuleVersion() return MODULE_VERSION; } +void registerObjects(sofa::core::ObjectFactory* factory) +{ + factory->registerObjectsFromPlugin("Sofa.Component.Mapping.Linear"); + factory->registerObjectsFromPlugin("Sofa.Component.Mapping.MappedMatrix"); + factory->registerObjectsFromPlugin("Sofa.Component.Mapping.NonLinear"); +} + void init() { static bool first = true; if (first) { sofa::component::mapping::linear::init(); - sofa::component::mapping::nonlinear::init(); sofa::component::mapping::mappedmatrix::init(); + sofa::component::mapping::nonlinear::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 c9626de10c1..8c968b42f28 100644 --- a/Sofa/Component/src/sofa/component/init.cpp +++ b/Sofa/Component/src/sofa/component/init.cpp @@ -89,6 +89,7 @@ void registerObjects(sofa::core::ObjectFactory* factory) factory->registerObjectsFromPlugin("Sofa.Component.Topology"); factory->registerObjectsFromPlugin("Sofa.Component.LinearSolver"); factory->registerObjectsFromPlugin("Sofa.Component.Engine"); + factory->registerObjectsFromPlugin("Sofa.Component.Mapping"); } void init() diff --git a/Sofa/framework/Helper/src/sofa/helper/ComponentChange.cpp b/Sofa/framework/Helper/src/sofa/helper/ComponentChange.cpp index b2d0cd8f36d..9dda8de950b 100644 --- a/Sofa/framework/Helper/src/sofa/helper/ComponentChange.cpp +++ b/Sofa/framework/Helper/src/sofa/helper/ComponentChange.cpp @@ -805,7 +805,7 @@ const std::map< std::string, Dealiased, std::less<> > dealiasedComponents = { {"SSORLinearSolver", Dealiased("v24.12","SSORPreconditioner")}, {"SSORSolver", Dealiased("v24.12","SSORPreconditioner")}, {"RigidEngine", Dealiased("v24.12","RigidToQuatEngine")}, - + {"SurfaceIdentityMapping", Dealiased("v24.12","SubsetMapping")}, }; } // namespace sofa::helper::lifecycle