From ab37cabda99e378c9605cb665edccc1b247b461c Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Wed, 22 Jan 2025 16:00:51 +0100 Subject: [PATCH] [Core] Remove some static functions create --- .../Core/src/sofa/core/Multi2Mapping.h | 17 ---------------- .../Core/src/sofa/core/MultiMapping.h | 20 ------------------- .../behavior/MixedInteractionConstraint.h | 15 -------------- .../AnimationLoopParallelScheduler.h | 11 ---------- 4 files changed, 63 deletions(-) diff --git a/Sofa/framework/Core/src/sofa/core/Multi2Mapping.h b/Sofa/framework/Core/src/sofa/core/Multi2Mapping.h index 6616b222fa2..c0ead569710 100644 --- a/Sofa/framework/Core/src/sofa/core/Multi2Mapping.h +++ b/Sofa/framework/Core/src/sofa/core/Multi2Mapping.h @@ -229,23 +229,6 @@ class Multi2Mapping : public BaseMapping return !error && BaseMapping::canCreate(obj, context, arg); } - /// Construction method called by ObjectFactory. - /// - /// This implementation read the input and output attributes to - /// find the input and output models of this mapping. - template - static typename T::SPtr create(T*, core::objectmodel::BaseContext* context, core::objectmodel::BaseObjectDescription* arg) - { - typename T::SPtr obj = sofa::core::objectmodel::New(); - - if (context) - context->addObject(obj); - - if (arg) - obj->parse(arg); - - return obj; - } protected: void getVecIn1Coord (const MultiVecCoordId id, type::vector< DataVecCoord_t*> &v) const diff --git a/Sofa/framework/Core/src/sofa/core/MultiMapping.h b/Sofa/framework/Core/src/sofa/core/MultiMapping.h index c6ecfe48c78..bc65f24d32f 100644 --- a/Sofa/framework/Core/src/sofa/core/MultiMapping.h +++ b/Sofa/framework/Core/src/sofa/core/MultiMapping.h @@ -231,26 +231,6 @@ class MultiMapping : public BaseMapping return BaseMapping::canCreate(obj, context, arg); } - /// Construction method called by ObjectFactory. - /// - /// This implementation read the input and output attributes to - /// find the input and output models of this mapping. - template - static typename T::SPtr create(T*, core::objectmodel::BaseContext* context, core::objectmodel::BaseObjectDescription* arg) - { - typename T::SPtr obj = sofa::core::objectmodel::New(); - - if (context) - context->addObject(obj); - - if (arg) - { - obj->parse(arg); - } - - return obj; - } - protected: void getVecInCoord (const MultiVecCoordId id, type::vector< InDataVecCoord* > &v) const diff --git a/Sofa/framework/Core/src/sofa/core/behavior/MixedInteractionConstraint.h b/Sofa/framework/Core/src/sofa/core/behavior/MixedInteractionConstraint.h index d2c82954415..51b2322c62e 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/MixedInteractionConstraint.h +++ b/Sofa/framework/Core/src/sofa/core/behavior/MixedInteractionConstraint.h @@ -113,21 +113,6 @@ class MixedInteractionConstraint : public BaseInteractionConstraint, public Pair /// This is the method that should be implemented by the component virtual void buildConstraintMatrix(const ConstraintParams* cParams, DataMatrixDeriv1 &c1, DataMatrixDeriv2 &c2, unsigned int &cIndex , const DataVecCoord1 &x1, const DataVecCoord2 &x2) = 0; - - - /// Construction method called by ObjectFactory. - template - static typename T::SPtr create(T* p0, core::objectmodel::BaseContext* context, core::objectmodel::BaseObjectDescription* arg) - { - typename T::SPtr obj = core::behavior::BaseInteractionConstraint::create(p0, context, arg); - - if (arg) - { - obj->parse(arg); - } - - return obj; - } }; #if !defined(SOFA_CORE_BEHAVIOR_MIXEDINTERACTIONCONSTRAINT_CPP) diff --git a/applications/plugins/MultiThreading/src/MultiThreading/component/animationloop/AnimationLoopParallelScheduler.h b/applications/plugins/MultiThreading/src/MultiThreading/component/animationloop/AnimationLoopParallelScheduler.h index 18b2d8e9eb8..ecffebb8269 100644 --- a/applications/plugins/MultiThreading/src/MultiThreading/component/animationloop/AnimationLoopParallelScheduler.h +++ b/applications/plugins/MultiThreading/src/MultiThreading/component/animationloop/AnimationLoopParallelScheduler.h @@ -76,17 +76,6 @@ class SOFA_MULTITHREADING_PLUGIN_API AnimationLoopParallelScheduler : void step(const sofa::core::ExecParams* params, SReal dt) override; - /// Construction method called by ObjectFactory. - template - static typename T::SPtr create(T*, sofa::core::objectmodel::BaseContext* context, sofa::core::objectmodel::BaseObjectDescription* arg) - { - sofa::simulation::Node* gnode = dynamic_cast(context); - typename T::SPtr obj = sofa::core::objectmodel::New(gnode); - if (context) context->addObject(obj); - if (arg) obj->parse(arg); - return obj; - } - private : sofa::simulation::Node* gnode;