I read this in the swig manual:

If you need to cast a pointer or change its value, consider writing some
helper functions instead.
see: http://www.swig.org/Doc1.3/Python.html

%inline %{

/* C++-style cast */
Foo *BarToFoo(Bar *b) {
   return dynamic_cast<Foo*>(b);
}

%}


You can also create the member function node.asGeode() in a similar way with
swig. This is a safe and handy method. There might be other options... this
way you would need to use swig, and can't use the binary version.

René



2008/2/13, Luigi Calori <[EMAIL PROTECTED]>:
>
> René Molenaar wrote:
>
> > Swig wrappers for OpenSceneGraph Python and Perl
> >
> > These files are part of: The VRmeer Library - Delft University of
> > Technology
> >
> > The files are based on osgswig (http://code.google.com/p/osgswig/)
> > with some additions and CMake files.
> >
> Thanks for the post, I' ll try them as soon as possible, I' m currently
> try to learn python and osgswig using the binary version under windows XP
> I stumbled upon a problem:
>
> I would like to parse the one scene, so willing to use  something like:
>
>
> node = osgDB.readNodeFile('cow.osg')
>
> while node.className() == 'Group':
>     print node.className()
>     node = node.asGroup().getChild(0)
> print node.className()
>
> The problem arise when getChild() returns a Geode.
> There is no  --- node.asGeode() ---- method so I have no idea of how to
> get the handle of a Geode in the scene.
>
> Sorry for my dumbness, any help really appreciated,
>
> Luigi
> _______________________________________________
> 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

Reply via email to