Files
OpenSceneGraph/include/osg
Robert Osfield 99fd6ed93a 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."
2008-10-03 09:55:20 +00:00
..
2008-06-19 20:38:38 +00:00
2006-07-18 15:21:48 +00:00
2008-08-18 11:00:40 +00:00
2006-07-18 15:21:48 +00:00
2006-07-18 15:21:48 +00:00
2006-07-18 15:21:48 +00:00
2006-07-18 15:21:48 +00:00
2007-08-10 17:44:54 +00:00
2007-05-14 16:16:22 +00:00
2006-07-18 15:21:48 +00:00
2008-05-12 10:16:40 +00:00
2008-03-12 20:15:45 +00:00
2006-07-18 15:21:48 +00:00
2007-07-11 16:06:04 +00:00
2006-07-18 15:21:48 +00:00
2006-07-18 15:21:48 +00:00
2008-03-12 20:15:45 +00:00
2008-07-23 15:42:02 +00:00
2008-03-12 20:15:45 +00:00
2008-06-19 20:38:38 +00:00
2006-07-18 15:21:48 +00:00
2006-07-18 15:21:48 +00:00
2008-08-18 10:47:43 +00:00
2007-02-15 10:25:11 +00:00
2006-07-18 15:21:48 +00:00
2006-07-18 15:21:48 +00:00
2008-09-01 09:57:35 +00:00
2008-09-25 15:19:42 +00:00
2006-07-18 15:21:48 +00:00
2006-07-18 15:21:48 +00:00
2006-07-18 15:21:48 +00:00
2006-07-18 15:21:48 +00:00