Thank you very much... it worked!!

 either

%inline %{
osg::Geode *NodeToGeode2(osg::Node *b) {
   return dynamic_cast<osg::Geode*>(b);
}
%}

or

%extend osg::Node {
    virtual osg::Geode* asGeode() {return dynamic_cast<osg::Geode*>(self);}
};

The Cmake projects worked fine (just some mods to standard FindOSG), I 
spent some time to find out how to install correctly into site_packages
If I' m correct, the dll must be renamed .pyd and the generated py must 
be copied inside the site_packages
I noticed the compile time of the _osg project is quite slow (at least 
on my machine) do you think it would be possible to split the big osg 
wrapper into smaller pieces to
both speed up build time and separate original (yours) and added (mine)

Do you plan to insert your CMake files into the osgswig svn?
Having things in svn will really help a lot the development
I' m planning to experiment further and then try to  add site_packages 
installation to cmake if do not find a better way to work

thanks again
                     Luigi
René Molenaar wrote:

> 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] <mailto:[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
>     osg-users@lists.openscenegraph.org
>     <mailto: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
>  
>

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

Reply via email to