Skip to content

Commit

Permalink
[Core] Remove some static functions create (#5239)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxbilger authored Jan 29, 2025
1 parent 989a885 commit 3659403
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 63 deletions.
17 changes: 0 additions & 17 deletions Sofa/framework/Core/src/sofa/core/Multi2Mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<class T>
static typename T::SPtr create(T*, core::objectmodel::BaseContext* context, core::objectmodel::BaseObjectDescription* arg)
{
typename T::SPtr obj = sofa::core::objectmodel::New<T>();

if (context)
context->addObject(obj);

if (arg)
obj->parse(arg);

return obj;
}

protected:
void getVecIn1Coord (const MultiVecCoordId id, type::vector< DataVecCoord_t<In1>*> &v) const
Expand Down
20 changes: 0 additions & 20 deletions Sofa/framework/Core/src/sofa/core/MultiMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<class T>
static typename T::SPtr create(T*, core::objectmodel::BaseContext* context, core::objectmodel::BaseObjectDescription* arg)
{
typename T::SPtr obj = sofa::core::objectmodel::New<T>();

if (context)
context->addObject(obj);

if (arg)
{
obj->parse(arg);
}

return obj;
}

protected:

void getVecInCoord (const MultiVecCoordId id, type::vector< InDataVecCoord* > &v) const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<class T>
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<class T>
static typename T::SPtr create(T*, sofa::core::objectmodel::BaseContext* context, sofa::core::objectmodel::BaseObjectDescription* arg)
{
sofa::simulation::Node* gnode = dynamic_cast<sofa::simulation::Node*>(context);
typename T::SPtr obj = sofa::core::objectmodel::New<T>(gnode);
if (context) context->addObject(obj);
if (arg) obj->parse(arg);
return obj;
}

private :

sofa::simulation::Node* gnode;
Expand Down

0 comments on commit 3659403

Please sign in to comment.