Hi, Rafa,

        I've tried doing something like what you've said before: every time
before I checked for selections with verifySelection(), I searched for a
NULL member and erased it, like it's done below. Can you tell me why it
still isn't working? Is there a logical flaw in my code?

       Thanks,
           Renan M Z Mendes

        case(osgGA::GUIEventAdapter::KEYDOWN):
            {
                if(!ponto.empty())
                {
                    for(ponto_limp = ponto.begin(); ponto_limp != ponto.end();
ponto_limp++)
                    {
                        if(*ponto_limp == NULL)
                        {
                            ponto.erase(ponto_limp);
                        }
                    }

                    for(ponto_itr = ponto.begin(); ponto_itr != ponto.end();
ponto_itr++)
                    {
                        if((*ponto_itr)->verifySelection())
                        {
                            switch(ea.getKey())
                            {
                            case(ea.KEY_Delete):
                                {
                                    osg::Group* root =
(*ponto_itr)->getParent(0);

root->removeChild(root->getChildIndex((*ponto_itr)), 1);
                                }
                            }
                        }
                    }
                }
           }
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to