Cannot hide child FeatureNode with Cull Callback.

classic Classic list List threaded Threaded
5 messages Options
dmitriano dmitriano
Reply | Threaded
Open this post in threaded view
|

Cannot hide child FeatureNode with Cull Callback.

I have a node derived from osg::Group with a child node of type FeatureNode (that is added with addChild(...)). If I simply return from the Cull Callback without traversing the children:

void MyNode::traverse(osg::NodeVisitor& nv)
{
    if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR)
    {
        return;
    }
    else
    {
        osg::Group::traverse(nv);
    }
}

the child FeatureNode remains visible, but other child nodes of type LabelNode successfully disappear. Doing the same with the root node or map node makes all the nodes invisible (the scene becomes completely blue).

For example, setting FeatureNode mask to 0 makes it invisible:

    FeatureNode* node = new FeatureNode(mapNode_, featList, style);
    node->init();
    addChild(node);
    node->setNodeMask(0);

but why Cull Callback does not?
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Cannot hide child FeatureNode with Cull Callback.

Dmitri,
If you can provide a standalone .cpp file that demonstrates the issue, we will test it and see what the problem is. Thanks.
Glenn Waldron / Pelican Mapping
dmitriano dmitriano
Reply | Threaded
Open this post in threaded view
|

Re: Cannot hide child FeatureNode with Cull Callback.

This post was updated on .
Hello Glenn!

I added my node to osgearth_qt_windows.cpp sample and published it here: <REMOVED LINK>. The node draws a red Graticule.

I believe, there is nothing special to QT, all the code related to my node is between ***Graticule START*** and ***Graticule END***.

search for 'GraticuleNode still visible.' in the code to find where I add the Cull Callback and override traverse().

I use OSG 3.4.1 with OSG Earth 2.7
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Cannot hide child FeatureNode with Cull Callback.

Dmitiri,
I have opened an issue for this:
https://github.com/gwaldron/osgearth/issues/989

The cause is known but it will be a while before we can get around to coding up a fix. Thanks for your patience.
Glenn Waldron / Pelican Mapping
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Cannot hide child FeatureNode with Cull Callback.

Dmitri,
Please re-test with the master branch and see if the problem if resolved. Thanks.
Glenn Waldron / Pelican Mapping