Hi Daniel, osg::Array's all map to OpenGL so have to be contiguous, std::vector fits the bill, std::list wouldn't. Regardless of this OpenGL mapping doing a std::list<> of tens of thousands of small objects would be really inefficient memory and computation wise - it's only random inserts/deletes that you'd gain anything and this isn't a common usage model for OSG users.
In your case you need to work out what operations you need to do and how to best map them to manipulation of a std::vector<>. Creating a new Array might even be the most efficient thing to do. Robert. On Tue, May 6, 2008 at 10:11 AM, Daniel Moos <[EMAIL PROTECTED]> wrote: > Hello > > I have a little question about the osg::Array in OpenSceneGraph. In our > project we must delete some triangles and normales from an geometry. For > that we use iterators and the erase() function. Now we have a big > performance problem. > > To delete 12'000 triangles with its normales, we have 70'000ms. > If i first copy the hole triangles to a std::list, delete the triangles and > then copy them back to the osg::DrawElementsUInt structure we only have > 100ms. > > The std::vector work with linear time and the std::list with constant time, > which is much faster. > > Now my question. Why use the osg::Array a std::vector and not a std::list? > I'm shure there is a good reason... But I haven't got a clue. > > Thanks & Have a nice day > Daniel Moos > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

