Re: [osg-users] can't remove all PrimitiveSet

2008-05-28 Thread Paul Melis

Hi Alberto,

Alberto Luaces wrote:


El Martes 27 Mayo 2008ES 16:58:21 Paul Melis escribió:
 


  dirtyDisplayList();
  dirtyBound();

When using direct access to the list you will have to call these
yourself...

 



Well, I think osg users are used to call these functions themselves pretty 
often when dealing with dynamic geometries, but it's just a matter of 
style :)
 

No offense, but I consider using the underlying data structure like in 
this particular case bad style, it's asking for trouble.
The problem is that directly adding to/removing from the underlying 
vector doesn't include all the semantics of adding/removing of the 
higher level API. So whenever the higher level add/remove is altered to 
say, include more operations, you might not become aware of this until 
you code that directly accesses the vector starts misbehaving. Removing 
the public access to the primitive set list would help to avoid this, 
but it seems other OSG classes need access to it, e.g. osgUtil::Optimizer.


Regards,
Paul
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] can't remove all PrimitiveSet

2008-05-27 Thread IceSharK
Paul , thank you.

Yes, the right way is : *geometry-removePrimitiveSet( 0 ,
geometry-getNumPrimitiveSets() );*

The problem is caused by my another code.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] can't remove all PrimitiveSet

2008-05-21 Thread IceSharK
Hi all ~


I implement the code ,

//

struct MyUpdateCallback : osg::Drawable::UpdateCallback
{
 virtual void update( osg::NodeVisitor* , osg::Drawable* drawable )
 {
  osg::Geometry* geometry = drawable-asGeometry();

  geometry-removePrimitiveSet( 0 ,
geometry-gegetPrimitiveSetList().size() );
 }
}

//

It can't remove all PrimitiveSet , the last PrimitiveSet is still alive.

//

why not Geometry has removeAllPrimitiveSet() or clear()

//

thanks.

---IceSharK
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org