Skip to content

Commit 00410fe

Browse files
committed
Apply new factory registration mechanism
1 parent d77c0d3 commit 00410fe

12 files changed

+107
-49
lines changed

src/ModelOrderReduction/component/contact/MORUnilateralInteractionConstraint.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ namespace sofa::component::constraint::lagrangian::model
3131
using namespace sofa::defaulttype;
3232
using namespace sofa::helper;
3333

34-
int MORUnilateralInteractionConstraintClass = core::RegisterObject("Unilateral constraint in a reduced model")
35-
.add< MORUnilateralInteractionConstraint<Vec3Types> >()
36-
;
34+
void registerMORUnilateralInteractionConstraint(sofa::core::ObjectFactory* factory)
35+
{
36+
factory->registerObjects(sofa::core::ObjectRegistrationData("Unilateral constraint in a reduced model")
37+
.add< MORUnilateralInteractionConstraint<Vec3Types> >());
38+
}
3739

3840
template class SOFA_MODELORDERREDUCTION_API MORUnilateralInteractionConstraint<Vec3Types>;
3941
} // namespace sofa::component::constraint::lagrangian::model

src/ModelOrderReduction/component/contact/MORpointModel.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ using namespace sofa::defaulttype;
3232
using namespace sofa::core::collision;
3333
using namespace helper;
3434

35-
int MORPointCollisionModelClass = core::RegisterObject("Collision model which represents a set of points")
36-
.add< MORPointCollisionModel<defaulttype::Vec3Types> >()
37-
38-
.addAlias("MORPoint")
39-
;
35+
void registerMORPointCollisionModel(sofa::core::ObjectFactory* factory)
36+
{
37+
factory->registerObjects(sofa::core::ObjectRegistrationData("Collision model which represents a set of points")
38+
.add< MORPointCollisionModel<defaulttype::Vec3Types> >()
39+
.addAlias("MORPoint")
40+
);
41+
}
4042

4143
template class SOFA_MODELORDERREDUCTION_API MORPointCollisionModel<defaulttype::Vec3Types>;
4244
} // namespace sofa::component::collision::geometry

src/ModelOrderReduction/component/forcefield/HyperReducedHexahedronFEMForceField.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ using namespace sofa::defaulttype;
2929
//SOFA_DECL_CLASS(HyperReducedHexahedronFEMForceField)
3030

3131
// Register in the Factory
32-
int HyperReducedHexahedronFEMForceFieldClass = core::RegisterObject("Hexahedral finite elements")
33-
.add< HyperReducedHexahedronFEMForceField<Vec3Types> >()
34-
;
32+
void registerHyperReducedHexahedronFEMForceField(sofa::core::ObjectFactory* factory)
33+
{
34+
factory->registerObjects(sofa::core::ObjectRegistrationData("Hexahedral finite elements")
35+
.add< HyperReducedHexahedronFEMForceField<Vec3Types> >());
36+
}
3537

3638
template class SOFA_MODELORDERREDUCTION_API HyperReducedHexahedronFEMForceField<Vec3Types>;
3739

src/ModelOrderReduction/component/forcefield/HyperReducedRestShapeSpringsForceField.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ using namespace sofa::defaulttype;
2929

3030
SOFA_DECL_CLASS(HyperReducedRestShapeSpringsForceField)
3131

32-
33-
int HyperReducedRestShapeSpringsForceFieldClass = core::RegisterObject("Simple elastic springs applied to given degrees of freedom between their current and rest shape position")
34-
.add< HyperReducedRestShapeSpringsForceField<Vec3Types> >()
35-
;
32+
void registerHyperReducedRestShapeSpringsForceField(sofa::core::ObjectFactory* factory)
33+
{
34+
factory->registerObjects(sofa::core::ObjectRegistrationData("Simple elastic springs applied to given degrees of freedom between their current and rest shape position")
35+
.add< HyperReducedRestShapeSpringsForceField<Vec3Types> >());
36+
}
3637

3738
template class SOFA_MODELORDERREDUCTION_API HyperReducedRestShapeSpringsForceField<Vec3Types>;
3839
} // namespace sofa::component::solidmechanics::spring

src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedralCorotationalFEMForceField.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ using namespace sofa::defaulttype;
3131
SOFA_DECL_CLASS(HyperReducedTetrahedralCorotationalFEMForceField)
3232

3333
// Register in the Factory
34-
int HyperReducedTetrahedralCorotationalFEMForceFieldClass = core::RegisterObject("Corotational FEM Tetrahedral finite elements")
35-
.add< HyperReducedTetrahedralCorotationalFEMForceField<Vec3Types> >()
36-
;
34+
void registerHyperReducedTetrahedralCorotationalFEMForceField(sofa::core::ObjectFactory* factory)
35+
{
36+
factory->registerObjects(sofa::core::ObjectRegistrationData("Corotational FEM Tetrahedral finite elements")
37+
.add< HyperReducedTetrahedralCorotationalFEMForceField<Vec3Types> >());
38+
}
3739

3840
template class SOFA_MODELORDERREDUCTION_API HyperReducedTetrahedralCorotationalFEMForceField<Vec3Types>;
3941
} // namespace sofa::component::solidmechanics::fem::elastic

src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronFEMForceField.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ using namespace sofa::defaulttype;
3030
SOFA_DECL_CLASS(HyperReducedTetrahedronFEMForceField)
3131

3232
// Register in the Factory
33-
int HyperReducedTetrahedronFEMForceFieldClass = core::RegisterObject("Tetrahedral finite elements")
34-
.add< HyperReducedTetrahedronFEMForceField<Vec3Types> >()
35-
;
33+
void registerHyperReducedTetrahedronFEMForceField(sofa::core::ObjectFactory* factory)
34+
{
35+
factory->registerObjects(sofa::core::ObjectRegistrationData("Tetrahedral finite elements")
36+
.add< HyperReducedTetrahedronFEMForceField<Vec3Types> >());
37+
}
3638

3739
template class SOFA_MODELORDERREDUCTION_API HyperReducedTetrahedronFEMForceField<Vec3Types>;
3840
} // namespace sofa::component::forcefield

src/ModelOrderReduction/component/forcefield/HyperReducedTetrahedronHyperelasticityFEMForceField.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ using namespace sofa::defaulttype;
3131
SOFA_DECL_CLASS(HyperReducedTetrahedronHyperelasticityFEMForceField)
3232

3333
// Register in the Factory
34-
int HyperReducedTetrahedronHyperelasticityFEMForceFieldClass = core::RegisterObject("Generic Tetrahedral finite elements")
35-
.add< HyperReducedTetrahedronHyperelasticityFEMForceField<Vec3Types> >()
36-
;
34+
void registerHyperReducedTetrahedronHyperelasticityFEMForceField(sofa::core::ObjectFactory* factory)
35+
{
36+
factory->registerObjects(sofa::core::ObjectRegistrationData("Generic Tetrahedral finite elements")
37+
.add< HyperReducedTetrahedronHyperelasticityFEMForceField<Vec3Types> >());
38+
}
3739

3840
template class SOFA_MODELORDERREDUCTION_API HyperReducedTetrahedronHyperelasticityFEMForceField<Vec3Types>;
3941
} // namespace sofa::component::forcefield

src/ModelOrderReduction/component/forcefield/HyperReducedTriangleFEMForceField.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ SOFA_DECL_CLASS(HyperReducedTriangleFEMForceField)
3030
using namespace sofa::defaulttype;
3131

3232
// Register in the Factory
33-
int HyperReducedTriangleFEMForceFieldClass = core::RegisterObject("Triangular finite elements")
34-
.add< HyperReducedTriangleFEMForceField<Vec3Types> >()
35-
;
33+
void registerHyperReducedTriangleFEMForceField(sofa::core::ObjectFactory* factory)
34+
{
35+
factory->registerObjects(sofa::core::ObjectRegistrationData("Triangular finite elements")
36+
.add< HyperReducedTriangleFEMForceField<Vec3Types> >());
37+
}
3638

3739
template class SOFA_MODELORDERREDUCTION_API HyperReducedTriangleFEMForceField<Vec3Types>;
3840
} // namespace sofa::component::solidmechanics::fem::elastic

src/ModelOrderReduction/component/mapping/MORContactMapping.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,20 @@ using namespace core::behavior;
4040

4141

4242
// Register in the Factory
43-
int MORContactMappingClass = core::RegisterObject("Special case of mapping where the child points are the same as the parent points")
44-
.add< MORContactMapping< Vec3dTypes, Vec3dTypes > >()
45-
.add< MORContactMapping< Vec2Types, Vec2Types > >()
46-
.add< MORContactMapping< Vec1Types, Vec1Types > >()
47-
48-
;
49-
43+
void registerMORContactMapping(sofa::core::ObjectFactory* factory)
44+
{
45+
factory->registerObjects(sofa::core::ObjectRegistrationData("Special case of mapping where the child points are the same as the parent points")
46+
.add< MORContactMapping< Vec3dTypes, Vec3dTypes > >()
47+
.add< MORContactMapping< Vec2Types, Vec2Types > >()
48+
.add< MORContactMapping< Vec1Types, Vec1Types > >());
49+
}
5050

5151
template class MORContactMapping< Vec3dTypes, Vec3dTypes >;
5252
template class MORContactMapping< Vec2Types, Vec2Types >;
5353
template class MORContactMapping< Vec1Types, Vec1Types >;
5454

5555

5656

57-
58-
5957
} // namespace mapping
6058

6159
} // namespace component

src/ModelOrderReduction/component/mapping/ModelOrderReductionMapping.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ using namespace core::behavior;
3636
SOFA_DECL_CLASS(ModelOrderReductionMapping)
3737

3838
// Register in the Factory
39-
static int ModelOrderReductionMappingClass = core::RegisterObject("Reduced model")
40-
.add< ModelOrderReductionMapping< Vec1Types, Vec3Types > >(true)
41-
;
39+
void registerModelOrderReductionMapping(sofa::core::ObjectFactory* factory)
40+
{
41+
factory->registerObjects(sofa::core::ObjectRegistrationData("Reduced model")
42+
.add< ModelOrderReductionMapping< Vec1Types, Vec3Types > >(true));
43+
}
4244

4345
template class SOFA_MODELORDERREDUCTION_API ModelOrderReductionMapping< Vec1Types, Vec3Types >;
4446

0 commit comments

Comments
 (0)