Hi, everyone. When testing my application, an error message appeared saying: 'Debug Assertion Failure' and 'vector subscription out of range'. This error occured when:
1) I wrote the following code: case(osgGA::GUIEventAdapter::KEYDOWN): { if(!ponto.empty()) // ponto is defined as: std::vector<Ponto*> ponto; in which Ponto is a class created by me. { for(ponto_itr = ponto.begin(); ponto_itr != ponto.end(); ponto_itr++) { if((*ponto_itr)->verifySelection()) // verifies if the shape associated with an instance of the class Ponto was picked { switch(ea.getKey()) { case(ea.KEY_Delete): { osg::Group* root = (*ponto_itr)->getParent(0); root->removeChild(root->getChildIndex((*ponto_itr)), 1); } } } } } 2) AND when I do the following: 1 - select one point; 2 - delete it; 3 - press delete again, having or NOT selected another 'ponto' (instance of class Ponto) on the screen. NOTE: when a drawable from 'ponto' is selected (picked), the 'ponto' is allocated in the vector. Thanks, Renan M Z Mendes
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org