The following addition in makeCoredNode allows one to create a node while avoiding to specify the core type if one passes a ptr to it:
template <class Core, class CoreParentPtr> inline
NodePtr makeCoredNode(FCPtr<CoreParentPtr, Core> *coreP)
{
NodePtr n = osg::Node::create();
Core::Ptr c = Core::create();
osg::beginEditCP(n, osg::Node::CoreFieldMask);
n->setCore(c);
osg::endEditCP(n, osg::Node::CoreFieldMask);
if(coreP != NULL)
*coreP = c;
return n;
}
I.e, you can do
TransformPtr tf;
NodePtr node = makeCoredNode(tf); // no need to specify transform here, yay!