From Neil Groves, "Frequently I would like code that has a signature like: void foo(osg::ref_ptr<osg::Node> node) to work for osg::ref_ptr<osg::Group>, osg::ref_ptr<osg::Geode> etc. The behaviour of osg::ref_ptr does not mimic the behaviour of a raw pointer in this regard.
From Neil Groves, "Frequently I would like code that has a signature like: void foo(osg::ref_ptr<osg::Node> node) to work for osg::ref_ptr<osg::Group>, osg::ref_ptr<osg::Geode> etc. The behaviour of osg::ref_ptr does not mimic the behaviour of a raw pointer in this regard.

To facilitate this possibility I have added a template copy constructor and a template assignment operator. These work for safe conversions like those in my previous example, but fail as desired for non-safe conversions since the template instantiation fails during the raw pointer copy/assignment.

The lack of this facility has appreciably handicapped development of generic algorithms applied to the scene graph, and I believe that this alteration will be welcomed by most of the community. If there are issues with antiquated compilers not supporting template member functions then perhaps a small piece of conditional compilation is in order.

I have made the change using the latest release version (2.6) as the base. The full file is attached.

I have not tested building the osg wrappers and the script binding code. I have tested the legal and illegal conversions of both copying and assignment to ensure that behave as expected on MSVC7.1, MSVC8, MSVC9, GCC 4.3."


ghub/osg,artoolkit/osg,ghub/osg,XiaoCC/osg,XiaoCC/osg,omega-hub/osg,koshman86/osg,XiaoCC/osg,stmh/osg,koshman86/osg,koshman86/osg,XiaoCC/osg,XiaoCC/osg,ghub/osg,omega-hub/osg,ntoand/osg,stmh/osg,ghub/osg,ntoand/osg,ntoand/osg,artoolkit/osg,artoolkit/osg,ntoand/osg,stmh/osg,omega-hub/osg,stmh/osg,koshman86/osg,omega-hub/osg,stmh/osg,artoolkit/osg