Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Remove some static functions create #5239

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading