Create a template object in C++ based on the template of another object #2967
-
In a base class like ODESolver.h, I want to create a GravityForceField in the |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Have a look on the |
Beta Was this translation helpful? Give feedback.
-
If recommand using simpleapi for that. BaseObject::SPtr addBoxROI(BaseObject::SPtr target)
{
Node::SPtr node = dynamic_cast<Node*>(target->getContext());
return createObject(node, "BoxROI", {{"template", target->getTemplateName()}} );
} |
Beta Was this translation helpful? Give feedback.
-
thanks a lot guys @alxbilger @damienmarchal |
Beta Was this translation helpful? Give feedback.
-
Thanks to your feedback I successfully did it in my PR #2988 here: https://github.com/sofa-framework/sofa/pull/2988/files#diff-b7033b5ee81b1b83fb5e9521290781ebd5be95a58da07519661287e3d79bac06R205-R207 I therefore close this thread |
Beta Was this translation helpful? Give feedback.
If recommand using simpleapi for that.