Commit Graph

29 Commits

Author SHA1 Message Date
Robert Osfield
65127f5b34 Moved the declaration of osgDB::Field, FieldReader and FieldReaderIterator into include/osg/Input to centralise all the deprecated .osg parsing code into one place. 2010-01-25 15:24:47 +00:00
Robert Osfield
f45ae6a4d8 From David Fries, "I was trying to create a lot of threads under 32 bit Linux, but could
only create 376, then the program would hang.
376 * 8MB stack per thread = 3008 MB
The stack size allocated per thread blew the process address stack.
To get more threads you have to specify a smaller per thread stack,
but while the Thread::start says it will limit the stack size to the
smallest allowable stack size, it won't let it be smaller than the
default.  I included the limits.h header to use PTHREAD_STACK_MIN as
the minimum stack size.

As for the deadlock, if the pthread_create failed, the new thread
doesn't exist and doesn't call threadStartedBlock.release(), so the
existing thread deadlocks on threadStartedBlock.block().  Only block
if the thread was started."
2009-11-20 10:27:43 +00:00
Robert Osfield
3171be0ff7 From Gustav Haapalahti and Robert Osfield,
First Submission email from Gustav:
"This submission adds a --cache option to osgconv and osgviewer that enables setObjectCacheHint(osgDB::Options::CACHE_ALL); It greatly reduces memory usage when a .osg file has lots of external references with ProxyNode:s that points to the same file.

Options are also added to the osg plugin. The code was already mostly implemented but there was no way to change the options.
includeExternalReferences
writeExternalReferenceFiles
A counter is added to keep track if an external file has already been written down to avoid writing the same file over and over again. If it has already been written once then it is not written again.
The counter is added to the Output class in osgDB.
"

Second Submission email from Gustav:
"This is a continuation to my previous submission.
I noticed that the same problem that I fixed in ProxyNode.cpp for the osg plugin (external files being written over and over again) also existed in the ive plugin. I attached a submission where the ive plugin remembers which external files that have already been written and do not write them again."


Changes to the above done by Robert Osfield,

    changed command line parameter to --enable-object-cache
    changed set/get methods in osgDB::Output and ive/DataOutputStream.cpp to be s/getExternalFileWritten(const std::string&)
    cleaned up set up of osgDB::Options.
2009-06-08 16:50:50 +00:00
Robert Osfield
b7b065abe3 Refactored the Registry::ReadFileCallback, WriteFileCallback and ReaderWriter::Options to they are now defined in their own header and in the osgDB namespace.
Introduced a new FindFileCallback to Registry to compliement the existing ReadFileCallback and WriteFileCallback.

Added support for assign Find, Read and WriteFileCallbacks to osdDB::Options to enable plugins/applications to override the callbacks just for that
read/write call and any nested file operations
2009-05-09 08:49:27 +00:00
Robert Osfield
720551d549 From Michael Platings, Converted std::fstream/ifstream/ofstream to osgDB::fstream/ifstream/ofstream and
fopen to osgDB::fopen to facilitate support for wide character filenames using UT8 encoding.
2008-11-07 15:08:08 +00:00
Robert Osfield
1e5783ece7 Added a wrapString(const char*) which automatically handles null strings. 2008-06-18 16:45:21 +00:00
Robert Osfield
c4d07194a2 From Art Trevs, add support for saving external shader files.
From Robert Osfield, adding missing member variable initializes and Output::getShaderFileNameForOutput() implementation
2008-03-04 14:04:48 +00:00
Robert Osfield
4c787abfd7 Added option for controlling whether output code should write out default values 2007-09-16 17:45:53 +00:00
Robert Osfield
5d23bf7739 From Mike Weiblen, with mods of using references by Robert Osfield for efficiency. Submission notes from Mike:
"By repurpose, I'm creating a new plugin that uses much of the .osg fileformat,
but with some changes.  Specifically, I'm creating a ".osgfs" plugin, which
represents the scenegraph hierarchy as a filesystem of nested subdirectories and
individual files for each node, rather than nested braces with everything in a
single monolithic file.  I intend to incorporate file alteration monitor events
to watch the filesystem for modifications and automatically reload.

The problem I'm running into is osgDB is too tightly coupled to the .osg format.
osgDB::Output::writeObject() contains literal .osg format-specific strings like
"{" to represent the Object hierarchy at too low a semantic level.  I propose
using virtual methods; my plugin can then derive from osgDB::Output and
represent Object hiearchy differently.
"
2007-05-09 10:01:15 +00:00
Robert Osfield
f1c2694c17 Updated copyright years. 2006-07-18 15:21:48 +00:00
Robert Osfield
35fcaf7bde Convert tabs to spaces. 2005-11-17 17:44:48 +00:00
Robert Osfield
9bbba5a052 From Don Tidrow, bug fix to setOutputTextureFiles(bool). 2005-10-26 20:30:15 +00:00
Robert Osfield
d1108ea862 Added support for "-O OutputTextureFiles" options string in .osg plugin to
allow texture files to be written out when writing out a .osg file.
2005-09-19 14:07:44 +00:00
Robert Osfield
678b22ce83 Updated Copyright notices to 1998-2005. 2005-04-14 21:41:28 +00:00
Robert Osfield
39311cdee3 From Loic Dachary, added getFileName method 2004-11-14 21:08:10 +00:00
Robert Osfield
5b75d7f525 From Michael Gronger, addition of ReaderWriter* Registry::getReaderWriterForExtension(const std::string& ext).
Also removed copy constructor and = operator from Ouput as it was produce
spurious warnings under gcc 3.3.
2003-07-10 13:35:19 +00:00
Robert Osfield
6b64cd88b8 Removed superfluous const 2003-05-17 08:36:25 +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
ba34880464 Added support for reading and writing Sphere, Box, Cone, Cylinder and Grid shapes. 2003-01-08 14:32:13 +00:00
Robert Osfield
32c6a7809a Updated the handling of string in the .osg reading and writing so that it
handles the use of " quotes inside the string.
2002-10-28 12:55:19 +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
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
604110b245 Updates to help compilation under gcc 3.03. 2002-01-20 16:24:54 +00:00
Robert Osfield
478274ae7d Fixes to Windows build in liu of the move to using just std::streams. 2001-12-14 23:18:28 +00:00
Robert Osfield
b1f478e5d2 Updated OSG so that the old OSG_USE_IO_DOT_H has be removed from all headers
that used it, all references to the Standard C++ stream classes use the
std::ostream etc convention, all references to "using namespace std" and
"using namespace std::ostream etc" have been removed.
2001-12-14 21:49:04 +00:00
Robert Osfield
a4e4d4fa7c Removed all references to using namespace std to help solve compilation problems
under Windows and IRIX.

Also integrated small change to lib3ds from Drew for IRIX compilation.
2001-12-14 10:02:27 +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
e8f256a59d Added a bunch of files synched with 0.8.42 2001-09-19 21:08:56 +00:00