OpenSceneGraph/include/osgDB
Robert Osfield 6a67be2e32 Introduced CMake option OSG_PROVIDE_READFILE option that defaults to ON, but when switched to OFF disables the building of the osgDB::read*File() methods,
forcing users to use osgDB::readRef*File() methods.  The later is preferable as it closes a potential threading bug when using paging databases in conjunction
with the osgDB::Registry Object Cache.  This threading bug occurs when one thread gets an object from the Cache via an osgDB::read*File() call where only
a pointer to the object is passed back, so taking a reference to the object is delayed till it gets reassigned to a ref_ptr<>, but at the same time another
thread calls a flush of the Object Cache deleting this object as it's referenceCount is now zero.  Using osgDB::readREf*File() makes sure the a ref_ptr<> is
passed back and the referenceCount never goes to zero.

To ensure the OSG builds when OSG_PROVIDE_READFILE is to OFF the many cases of osgDB::read*File() usage had to be replaced with a ref_ptr<> osgDB::readRef*File()
usage.  The avoid this change causing lots of other client code to be rewritten to handle the use of ref_ptr<> in place of C pointer I introduced a serious of
templte methods in various class to adapt ref_ptr<> to the underly C pointer to be passed to old OSG API's, example of this is found in include/osg/Group:

    bool addChild(Node* child); // old method which can only be used with a Node*

    tempalte<class T> bool addChild(const osg::ref_ptr<T>& child) { return addChild(child.get()); } // adapter template method

These changes together cover 149 modified files, so it's a large submission. This extent of changes are warrent to make use of the Object Cache
and multi-threaded loaded more robust.



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15165 16af8721-9629-0410-8352-f15c8da7e697
2015-10-22 14:14:53 +00:00
..
Archive Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
AuthenticationMap Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Callbacks From Jannik Heller, typo fixes 2015-04-13 10:43:56 +00:00
ClassInterface From Albert Luaces, typo fixes. 2015-06-01 13:40:20 +00:00
ConvertBase64 From Johannes Scholz, "Attached you find a patch for osgDB::OutputStream and osgDB::InputStream to include osg::Image::data() using Base64 encoding inside the ASCII OSGT, if WriteImageHint=IncludeData is set, only." 2015-03-02 12:11:43 +00:00
ConvertUTF Standardized on defined(__ANDROID__) 2014-11-28 10:54:40 +00:00
DatabasePager From Jannik Heller, typo fixes 2015-06-01 13:11:49 +00:00
DatabaseRevisions From David Callu, warning fixes and removal of spaces at end of lines. 2013-06-28 12:00:43 +00:00
DataTypes Added access methods to Serializer to help with using wrappers for other purposes such as script integration. 2013-09-11 15:44:08 +00:00
DotOsgWrapper Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
DynamicLibrary Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Export Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
ExternalFileWriter From Albert Luaces, typo fixes. 2015-06-01 13:40:20 +00:00
FileCache Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
FileNameUtils Added osgDB::getSortedDirectoryContents and osgDB::FileNameComparator to help with sorting directory contents into alphabetic and numerical order. 2012-09-12 16:02:02 +00:00
FileUtils Added osgDB::getSortedDirectoryContents and osgDB::FileNameComparator to help with sorting directory contents into alphabetic and numerical order. 2012-09-12 16:02:02 +00:00
fstream From Martin Naylor, replace osgDB::fstream with an osgDB::open() call. 2013-06-12 12:49:18 +00:00
ImageOptions Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
ImagePager From Laurens Voerman, "I found that using an ImageSequence with mode PAGE_AND_DISCARD_USED_IMAGES triggers the (3) imageThreads to run and never stop, even when no more work is to be done. This is due to a bug in the stop condition currently setting the thread to stop and wait for a signal only when no work needs to be done AND the databasepager is paused. 2015-09-04 15:05:06 +00:00
ImageProcessor Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Input Refactored osgDB::Input::readObjectOfType to use a template, and updated associated wrappers to avoid using local static's 2012-11-21 13:38:11 +00:00
InputStream Added handling of the reading of field properties to a dummy object for cached images to avoid threading issues associated with reusing and modifying an active object. 2014-11-05 16:08:42 +00:00
ObjectCache Refactored the handling of use of the osgDB::ObjectCache in the DatabasePager to use a local thread specific ObjectCache to handle new additions and 2014-11-13 09:40:11 +00:00
ObjectWrapper From Frashud Lashkari, "I was getting "Unsupported wrapper class..." error messages when attempting to load osgb models simultaneously from multiple threads. I believe the problem is caused by un-synchronized access to the global osgDB::ObjectWrapperManager class. I've attached a change that adds a mutex to the class and uses it when accessing the internal wrapper/compress maps. This appears to fix the issues I was having." 2015-06-01 12:07:04 +00:00
Options From Mike Connell, "Give ReadFileCallback access to parent location : These small changes to the database pager allow user code in the ReadFileCallback to safely determine where the file being loaded is destined to be inserted into the scenegraph. 2015-06-08 11:18:24 +00:00
Output Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
OutputStream From Pjotr Svetachov, "Today I found a bug in the IutputStream class when saving array 2014-04-29 13:41:35 +00:00
ParameterOutput Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
PluginQuery Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
ReaderWriter Introduced CMake option OSG_PROVIDE_READFILE option that defaults to ON, but when switched to OFF disables the building of the osgDB::read*File() methods, 2015-10-22 14:14:53 +00:00
ReadFile Introduced CMake option OSG_PROVIDE_READFILE option that defaults to ON, but when switched to OFF disables the building of the osgDB::read*File() methods, 2015-10-22 14:14:53 +00:00
Registry From Jannik Heller, typo fixes 2015-06-01 13:11:49 +00:00
Serializer Added supoort for osg::CullSettings/Camera::InheritanceMaskActionOnAttributeSetting and InheritanceMask properties. 2015-06-09 16:49:20 +00:00
SharedStateManager Fixed usage of META_NodeVisitor so it doesn't include "" 2013-01-24 18:48:34 +00:00
StreamOperator From Wang Rui, "The file attached includes two new features for the serialization IO functionality. First, custom serializer version control should work now, just by defining a new REGISTER_CUSTOM_OBJECT_WRAPPER macro. For example: 2013-06-24 08:48:55 +00:00
Version Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
WriteFile Added readScript/writeScript methods to ReaderWriter 2014-07-14 15:59:06 +00:00
XmlParser Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00