Sorry, I have send the message before completing it:

unsigned int osg::computeVisitorType(const std::string& type_id)
{
   return some_hash(type_id);
}

This would enable the possibility to check out which type of visitor is 
currently traversing the node. Also in future releases or in external 
applications with just different visitors there would be a possibility to 
detect visitor types in a simple way.

All osg visitors might be named with "osg_" prefix and hence make them more or 
less unique (of course in the limitation of the hash function used).

What about that idea?

art
> It seems that in the current version of osg, there is some
> unknown node visitor running over all of my nodes. The node
> type does return just NODE_VISITOR=0. Hence I do not see any
> way to find out, which type of visitor is traversing there.
> 
> Currently there exists so many different node visitors in
> the core osg, that it is somehow very strange to have the
> VisitorType enum only describing couple of them, which are
> even come from osgUtil and not from osg ;). I would propose
> to have here some other kind of identification of a visitor.
> 
> What about being the visitor type not an enumeration but an
> integer and create new visitor types by something like a
> hash function over a string or so. Maybe a global method in
> the core osg like:
> unsigned int osg::computeVisitorType(const std::string&
> type_id)
> {
> 
> }
> 
> 
> 
>       
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

Reply via email to