Ticket #153 (closed patch: fixed)

Opened 2 years ago

Last modified 2 years ago

makeCoredNode patch (additional signature)

Reported by: marcusl Assigned to: unassigned
Priority: major Milestone:
Component: System Version: 1.8
Keywords: Cc:
Completion:

Description

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!

Change History

01/19/07 08:01:05 changed by marcusl

  • type changed from defect to patch.

01/31/07 15:57:06 changed by dirk

  • status changed from new to closed.
  • resolution set to fixed.

Committed! Thanks for the patch!