Skip to content

Commit

Permalink
[Cleanup] Remove redundant factory registration comments in Cosserat …
Browse files Browse the repository at this point in the history
…module

Eliminated verbose comments detailing factory registration steps across
multiple files in the Cosserat module.
Simplified namespace declarations and cleaned up extraneous formatting.
Improved code readability by removing outdated or redundant commentary.
This commit does not affect the functionality of the module but enhances
maintainability by reducing clutter.
  • Loading branch information
adagolodjo committed Jan 6, 2025
1 parent b582fe0 commit 4926964
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 73 deletions.
19 changes: 2 additions & 17 deletions src/Cosserat/constraint/CosseratActuatorConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,20 @@
#include <Cosserat/config.h>
#include <sofa/core/ObjectFactory.h>

namespace Cosserat

namespace Cosserat
{

//////////////////////////////////////CosseratActuatorConstraintConstraintResolution1Dof/////////////////////////////////////////////
using namespace sofa::defaulttype;
using namespace sofa::helper;
using namespace sofa::core;

//////////////////////////////////////////// FACTORY //////////////////////////////////////////////
// Registering the component
// see: http://wiki.sofa-framework.org/wiki/ObjectFactory
// 1-RegisterObject("description") + .add<> : Register the component
// 2-.add<>(true) : Set default template

void registerCosseratActuatorConstraint(sofa::core::ObjectFactory* factory)
{
factory->registerObjects(sofa::core::ObjectRegistrationData("Simulate cable actuation.")
.add< sofa::component::constraintset::CosseratActuatorConstraint<Vec3Types> >(true));
}

;
////////////////////////////////////////////////////////////////////////////////////////////////////////

// Force template specialization for the most common sofa type.
// This goes with the extern template declaration in the .h. Declaring extern template
// avoid the code generation of the template for each compilation unit.
// see: http://www.stroustrup.com/C++11FAQ.html#extern-templates
//template class CosseratActuatorConstraint<Vec3Types>;
};

} // namespace sofa

9 changes: 1 addition & 8 deletions src/Cosserat/constraint/CosseratNeedleSlidingConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,17 @@
#include "CosseratNeedleSlidingConstraint.inl"



namespace Cosserat {

using sofa::defaulttype::Rigid3Types;
using namespace sofa::helper;
using namespace sofa::core;

//////////////////////////////////////////// FACTORY //////////////////////////////////////////////
// Registering the component
// see: http://wiki.sofa-framework.org/wiki/ObjectFactory
// 1-RegisterObject("description") + .add<> : Register the component
// 2-.add<>(true) : Set default template

void registerCosseratNeedleSlidingConstraint(
sofa::core::ObjectFactory *factory) {
factory->registerObjects(sofa::core::ObjectRegistrationData("Simulate sliding contraints for needle insertion.")
.add<sofa::component::constraintset::CosseratNeedleSlidingConstraint<sofa::defaulttype::Vec3Types>>(true));

}

} // namespace sofa
} // namespace Cosserat
17 changes: 0 additions & 17 deletions src/Cosserat/constraint/QPSlidingConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,28 +76,11 @@ void SlidingForceConstraintResolution::resolution(int line, double **w,
namespace Cosserat
{

//////////////////////////////////////////// FACTORY //////////////////////////////////////////////
// Registering the component
// see: http://wiki.sofa-framework.org/wiki/ObjectFactory
// 1-RegisterObject("description") + .add<> : Register the component
// 2-.add<>(true) : Set default template

void registerQPSlidingConstraint(sofa::core::ObjectFactory* factory)
{
factory->registerObjects(sofa::core::ObjectRegistrationData("Simulate cable actuation.")
.add< sofa::component::constraintset::QPSlidingConstraint<sofa::defaulttype::Vec3Types> >(true));
}


////////////////////////////////////////////////////////////////////////////////////////////////////////

// Force template specialization for the most common sofa type.
// This goes with the extern template declaration in the .h. Declaring extern template
// avoid the code generation of the template for each compilation unit.
// see: http://www.stroustrup.com/C++11FAQ.html#extern-templates
//template class QPSlidingConstraint<sofa::defaulttype::Vec3Types>;


} // namespace Cosserat


17 changes: 1 addition & 16 deletions src/Cosserat/forcefield/BeamHookeLawForceField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,6 @@ template class BeamHookeLawForceField<Vec6Types>;

namespace Cosserat
{
//////////////////////////////////////////// FACTORY //////////////////////////////////////////////
// Registering the component
// see: http://wiki.sofa-framework.org/wiki/ObjectFactory
// 1-RegisterObject("description") + .add<> : Register the component
// 2-.add<>(true) : Set default template




void registerBeamHookeLawForceField(sofa::core::ObjectFactory* factory)
{
factory->registerObjects(
Expand All @@ -191,12 +182,6 @@ void registerBeamHookeLawForceField(sofa::core::ObjectFactory* factory)
.add<sofa::component::forcefield::BeamHookeLawForceField<sofa::defaulttype::Vec3Types>>(true)
.add<sofa::component::forcefield::BeamHookeLawForceField<sofa::defaulttype::Vec6Types>>());
}
//////////////////////////////////////////////////////////////////////////////////////////////////////

// Force template specialization for the most common sofa floating point related type.
// This goes with the extern template declaration in the .h. Declaring extern template
// avoid the code generation of the template for each compilation unit.
// see: http://www.stroustrup.com/C++11FAQ.html#extern-templates


} // forcefield
} // Cosserat
9 changes: 0 additions & 9 deletions src/Cosserat/forcefield/BeamHookeLawForceFieldRigid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ using namespace sofa::defaulttype;
namespace Cosserat
{

//////////////////////////////////////////// FACTORY //////////////////////////////////////////////
// Registering the component
// see: http://wiki.sofa-framework.org/wiki/ObjectFactory
// 1-RegisterObject("description") + .add<> : Register the component
// 2-.add<>(true) : Set default template

void registerBeamHookeLawForceFieldRigid(sofa::core::ObjectFactory *factory) {
factory->registerObjects(
sofa::core::ObjectRegistrationData(
Expand All @@ -51,9 +45,6 @@ void registerBeamHookeLawForceFieldRigid(sofa::core::ObjectFactory *factory) {
.add<sofa::component::forcefield::BeamHookeLawForceFieldRigid<
Vec6Types>>());
}
//////////////////////////////////////////////////////////////////////////////////////////////////////

// Force template specialization for the most common sofa floating point related type. This goes with the extern template declaration in the .h. Declaring extern template avoid the code generation of the template for each compilation unit. see: http://www.stroustrup.com/C++11FAQ.html#extern-templates
}

namespace sofa::component::forcefield
Expand Down
6 changes: 0 additions & 6 deletions src/Cosserat/forcefield/CosseratInternalActuation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@

namespace Cosserat
{
//////////////////////////////////////////// FACTORY //////////////////////////////////////////////
// Registering the component
// see: http://wiki.sofa-framework.org/wiki/ObjectFactory
// 1-RegisterObject("description") + .add<> : Register the component
// 2-.add<>(true) : Set default template
using namespace sofa::defaulttype;

void registerCosseratInternalActuation(sofa::core::ObjectFactory *factory) {
Expand All @@ -46,7 +41,6 @@ void registerCosseratInternalActuation(sofa::core::ObjectFactory *factory) {
"This component is used to compute internal stress for torsion (along x) and bending (y and z)")
.add<sofa::component::forcefield::CosseratInternalActuation<Vec3Types>>(true));
}
//////////////////////////////////////////////////////////////////////////////////////////////////////

}

Expand Down

0 comments on commit 4926964

Please sign in to comment.