Here is a question of one of our students.

Hello,

I am a student, now by my project I meet a problem, I want to convert an object of type osg::GeometryPtr to type void * pointer, but
I cannot do that direct with static_cast<> .

The reason why I want to do this is that I want to pass a GeometryPtr to a callback as kind of a user data pointer, i.e., that pointer could point to all other kinds of objects, and my library should not have to worry what type of pointer it really is.


What I can do is
------------------------------------------------------------------------
osg::Geometry geo;
void * p = reinterpret_cast<void*>(geo);
------------------------------------------------------------------------

However, the problems are

1. is the operator "reinterpret_cast<>" safe here?
2. how to convert osg::GeometryPtr to osg::Geometry * ?
3. Is there any other good method to convert osg::GeometryPtr to void* ?


Any ideas, suggestions, pointers, etc., will be highly appreciated.

Thanks

Weiyu Yi
Clausthal U, Germany










Attachment: smime.p7s
Description: S/MIME cryptographic signature

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to