Commit Graph

26 Commits

Author SHA1 Message Date
Robert Osfield
e3d1c4ba04 From Piotr Rak, "added bool conversion for ref_ptr, when no implicit conversion to T* is used." 2008-11-25 16:24:50 +00:00
Robert Osfield
eb01f3365f Added include <osg/Config> to take advantage of OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION 2008-10-03 16:57:01 +00:00
Robert Osfield
e7bfc59f5a From Neil Groves, addition on a T* implicit output conversion method and removal of comparison methods that are replaced by the single conversion method.
From Robert Osfield, optional compilation of above.
2008-10-03 15:13:11 +00:00
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
Robert Osfield
7a42716036 Removed template methods that were break VS6.0 build. 2006-07-03 15:21:08 +00:00
Robert Osfield
3e177ca727 From Tyge Løvset, ref_ptr<> template constructor, operators and associated functions.
From Robert Osfield, tweaks and fixes to the above, also removed the deprecated take() method.
2006-06-26 20:41:33 +00:00
Robert Osfield
35fcaf7bde Convert tabs to spaces. 2005-11-17 17:44:48 +00:00
Robert Osfield
678b22ce83 Updated Copyright notices to 1998-2005. 2005-04-14 21:41:28 +00:00
Robert Osfield
21691f2d56 From Geoff Michel, typo and spelling fixes 2004-09-02 19:10:33 +00:00
Robert Osfield
953ac782ac From Gideon May, added
typedef T element_type;

To ref_ptr<> to make it compatible with the boost ref_ptr<> implemenations.
2003-07-15 08:17:54 +00:00
Robert Osfield
152e60c61b Reverted the changes to ref_ptr<> for implicit cast to pointer. 2003-03-06 19:41:59 +00:00
Robert Osfield
fab6f24f4e Changed the osgText::Font implementation so it used a facade us abstract away
the actual implemention. This has been done so that when a freetype font is
created the implementation can unloaded when the freetype plugin is unloaded
without breaking the main font.

Also add image margin around founds to prevent any image boundaries appearing.
2003-03-06 17:11:24 +00:00
Robert Osfield
0d9aaa5ca6 Reverted the ref_ptr<> implementation to prior implicit cast operator via
commenting out// #define AUTOMATIC_CAST_TO_POINTER.
2003-03-06 13:45:20 +00:00
Robert Osfield
b70c80ba39 Add #ifndef's around the comparison operator's against const T* now that the
implicit cast operator has been added.
2003-03-06 10:38:31 +00:00
Robert Osfield
f9d8f3fa9d Added implicit cast to T* to ref_ptr<>. 2003-03-05 21:04:11 +00:00
Robert Osfield
1c34c0981e Further improvements to osgText and the freetype plugin, handling different
font sizes better and plugin removal safely.
2003-03-04 12:34:42 +00:00
Robert Osfield
48bda9cc79 Added new Copyright/License notice to header and source files. 2003-01-21 16:45:36 +00:00
Robert Osfield
f36bc69c58 Made the more of the OSG's referenced object desctructors protected to ensure
that they arn't created on the stack inappropriately.

Split the implemention of Matrix up so that it is a simple no referenced counted
class and can be safefly created on the stack.  To support referenced counting a
seperate subclass now exists, this is RefMatrix which inherits from both Matrix and
Object.
2003-01-10 09:25:42 +00:00
Robert Osfield
12226e4371 Converted the instances of const built in types being returned from methods
and passed as paramters into straight forward non const built in types,
i.e. const bool foogbar(const int) becomes bool foobar(int).
2002-09-02 12:31:35 +00:00
Robert Osfield
3a964a6b93 Updated docs and added osgGA 2002-07-16 20:07:32 +00:00
Robert Osfield
f2e215bf44 Added conversion to osg::GeoSet::converToGeometry() utility to help the
migration to and testing of the new osg::Geometry class.
2002-06-23 21:43:46 +00:00
Robert Osfield
c1283c23e8 Removed the trailing ; after namespace {...} declariations in headers
which was being picked as a warning under Codewarrior.
2002-02-03 12:33:41 +00:00
Robert Osfield
1aaa46dbe7 Fixes for Windows build. 2002-01-30 16:24:24 +00:00
Robert Osfield
5ceefdcc12 Fixed compilation error in src/osgDB/FileUtils.cpp.
Added support for nested NodeCallbacks, allowing them to be chained together
so that multiple operations can be applied.
2001-11-11 22:32:59 +00:00
Robert Osfield
9917b6500d Added a copyright notice to all core headers, which all begin with
//C++ header to help scripts and editors pick up the fact that the
file is a header file.
2001-10-04 15:12:57 +00:00
Don BURNS
7e81f6cfa6 More clean up for synch with 0.8.42 2001-09-19 21:19:47 +00:00