Commit Graph

67 Commits

Author SHA1 Message Date
Robert Osfield
502acc19c9 Build fix 2017-05-25 09:54:11 +01:00
Robert Osfield
dd996a3289 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/trunk@15164 16af8721-9629-0410-8352-f15c8da7e697
2015-10-22 13:42:19 +00:00
Robert Osfield
d14a602a59 From Jannik Heller, typo fixes
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14882 16af8721-9629-0410-8352-f15c8da7e697
2015-06-01 13:11:49 +00:00
Robert Osfield
28a676e105 Replaced use of while(isRunning()) { YieldCurrentThread(); } style loops with use of join() to avoid false positives being reported by valgrind when using the helgrind tool for thread debugging.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14460 16af8721-9629-0410-8352-f15c8da7e697
2014-11-04 10:46:59 +00:00
Robert Osfield
d18250da59 Replaced .osg with .osgt file usage 2011-06-14 16:54:20 +00:00
Robert Osfield
90bc608020 Fixed warning 2010-03-11 10:17:50 +00:00
Robert Osfield
1f01d30f72 Added tests of various FileNameUtils functions, tests invoked by osgunittests filenames 2010-03-10 12:13:31 +00:00
Robert Osfield
1479902b07 Added basic Matrix::decompose() test, based on a test progrem wrttien by Paul Obermeier 2009-06-08 12:50:26 +00:00
Robert Osfield
734463fcc7 Warning fixes 2009-02-03 15:28:53 +00:00
Robert Osfield
418dc34776 Fixed warnings 2009-01-07 11:24:47 +00:00
Robert Osfield
9b1445d5b9 Fixed warnings 2008-12-18 13:56:30 +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
5a9e957412 Added docs for read-threads <numthreads> command line options 2008-09-26 13:51:49 +00:00
Robert Osfield
4cb79dcddf From Jean-Sebastian Guay, fixed windows build 2008-09-24 16:03:47 +00:00
Robert Osfield
edc966c4c2 Added "serialize" and plugin "preload" options in the "read-threads" code path. 2008-09-23 15:41:49 +00:00
Robert Osfield
1b02cf99dc Added read-threads <numThreads> command line and read thread test back end 2008-09-23 13:58:49 +00:00
Robert Osfield
22eae68e48 From Mathias Froehlich, "This is a generic optimization that does not depend on any cpu or instruction
set.

The optimization is based on the observation that matrix matrix multiplication
with a dense matrix 4x4 is 4^3 Operations whereas multiplication with a
transform, or scale matrix is only 4^2 operations. Which is a gain of a
*FACTOR*4* for these special cases.
The change implements these special cases, provides a unit test for these
implementation and converts uses of the expensiver dense matrix matrix
routine with the specialized versions.

Depending on the transform nodes in the scenegraph this change gives a
noticable improovement.
For example the osgforest code using the MatrixTransform is about 20% slower
than the same codepath using the PositionAttitudeTransform instead of the
MatrixTransform with this patch applied.

If I remember right, the sse type optimizations did *not* provide a factor 4
improovement. Also these changes are totally independent of any cpu or
instruction set architecture. So I would prefer to have this current kind of
change instead of some hand coded and cpu dependent assembly stuff. If we
need that hand tuned stuff, these can go on top of this changes which must
provide than hand optimized additional variants for the specialized versions
to give a even better result in the end.

An other change included here is a change to rotation matrix from quaterion
code. There is a sqrt call which couold be optimized away. Since we divide in
effect by sqrt(length)*sqrt(length) which is just length ...
"
2008-09-17 16:14:28 +00:00
Robert Osfield
5711964481 Added unit test to smoke out a thread issue with using ofstream("/dev/null") inside
osg::notify()
2008-06-03 11:28:16 +00:00
Robert Osfield
daef0f64f2 From Jose Delport, "attached is a version of osgunittests that does not give false alarms
for the case where q1 = -q2. The output of 'osgunittests quat' is now
much cleaner.
"
2008-03-13 16:38:05 +00:00
Robert Osfield
f4afa427a7 From Roland Smeenk, "Attached you will find a large set of small typo fixes (mainly in the comments)." 2007-12-10 17:30:18 +00:00
Robert Osfield
5b305e37b0 From Mathias Froehlich, "Attached is a changed version of osgunittests.cpp. The __FUNCTION__
macro/string value is not portable. Instead the functions name is just put
into the string."
2007-12-06 17:01:22 +00:00
Robert Osfield
3d7fbeca28 Added testPolytope entry 2007-12-04 14:43:14 +00:00
Robert Osfield
d8cbd49471 Added thread unit test to test the create, start and destruction of threads 2007-09-25 10:18:50 +00:00
Robert Osfield
5817d4c83e From David Spilling, tweaked quat tests to reproduce getRotate errors. 2007-08-27 09:51:24 +00:00
Robert Osfield
cc0f1cb0fe From Martin Lavery and Robert Osfield, Updated examples to use a variation of the MIT License 2007-06-12 14:20:16 +00:00
Robert Osfield
0f132ab21e Added support for using quat_scaled sx sy sz for testing getting quats from scaled
matrices.  Removed broken Matrixd/quat test
2007-06-07 11:05:59 +00:00
Robert Osfield
9a0b39c34b From J.P Delport, "attached find an updated osgunittests.cpp that allows for the testing of
the matrix.getRotate() function when a matrix contains a scale as well
as a rotation.

The scale can optionally be switched off, see the top of
testQuatFromMatrix().

As expected, all the current methods for mat to quat conversion fail
these new tests. When the scale is omitted, mk2 of getRotate with sign
instead of signOrZero passes, as well as mk1.
"
2007-06-01 21:38:53 +00:00
Robert Osfield
11df762e08 From Olar Flebbe, "Visual Studio 2005 triggered a small glitch in UnittestFramework.cpp
Do not derefence it2 if it is at end()."
2007-05-29 09:57:18 +00:00
Robert Osfield
6c74589014 Added signOrZero template method, and to Matrix_implementation.cpp usage of this
method in the get(Quat&) code.
2007-05-09 09:26:33 +00:00
Robert Osfield
ef84805d5a Added SETUP_COMMANDLINE_APPLICATION and SETUP_COMMANDLINE_EXAMPLE macros 2007-04-12 09:59:34 +00:00
Robert Osfield
2187b061fc From Eric Wing,
"Attached is a patch allows access access to the CMake MACOSX_BUNDLE
option. Now SETUP_APPLICATION and SETUP_EXAMPLE take an additional
optional parameter that specifies if the program is a command line
application or a GUI application (think: IS_COMMANDLINE_APP). Passing
1 means true (is_commandline_app). Passing 0 or omitting the parameter
means false.

I changed the scripts for osgversion and osgunittests to support this
option because I believe they are command line apps. Are there any
others?"
2007-04-12 09:33:24 +00:00
Robert Osfield
5be86601bb Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
Robert Osfield
2e6ee4bb39 Removed old gmake and VisualStudio build files 2007-04-10 13:10:25 +00:00
Robert Osfield
6d7b5e7ebd From Eric Wing, pedantic warning fixes 2007-04-06 15:36:13 +00:00
Robert Osfield
d9a94f7890 Moved the TARGET_NAME setting into the SETUP_APPLICATION/EXAMPLE macro 2007-03-19 17:18:59 +00:00
Robert Osfield
da64127539 Ran dos2unix on CMakeLists.txt files. 2007-03-19 13:26:34 +00:00
Robert Osfield
be3f61c49f From Luigi Calori, move to using local CMakeLists.txt files and explicit file lists.
From Robert Osfield, small ammendments of the above to seperate example and application installs, and fix the osgPlugins install directory.
2007-03-19 12:30:26 +00:00
Robert Osfield
eb4ad4229f Moved osgProducer and osgproducerviewer out into their own repository.
Clean up the source for remaining references to osgProducer/Producer.
2007-02-27 13:16:18 +00:00
Robert Osfield
b121c9686f Ported following examples to osgViewer:
osgteapot
osgtessellate
osgtext
osgtexture1D
osgtexture2D
osgtexture3D
osgtexturerectangle
osgvertexprogram
osgvolume
osgwindows
osgsimple
osgkeyboardmouse
2007-01-11 15:19:59 +00:00
Robert Osfield
47d1404c2b Removed now redundent OSG_EXPORT to solve build problems under Windows 2006-12-22 16:48:17 +00:00
Robert Osfield
c9c2950759 Moved UnitTestFramework from core osg lib into osgunittests example 2006-12-19 17:06:59 +00:00
Robert Osfield
d1b14abb91 Added sizeof(short int) 2006-08-23 13:18:22 +00:00
Robert Osfield
564ee34f76 Added Matrix*::getRotate()/setRotate(Quat), deprecating Matrix*::get(Quat&), Matrix*::set(Quat&) 2006-07-31 17:31:21 +00:00
Robert Osfield
f977d7c606 Updated osgunittests with a matrix invert unit test, and added a conditional
calling of invert_4x4 or invert_4x3 depending on the the right hand column of the matrix.

Updated wrappers
2006-07-28 13:48:08 +00:00
Robert Osfield
032bba78fa From J.P. Delport, added units tests to pick up on erroneous Matrix::get(Quat&) computation. 2006-07-27 11:13:56 +00:00
Robert Osfield
b6b9e4bc7e fixed warning and add a few extra tests 2006-07-04 09:46:41 +00:00
Robert Osfield
c986f6ea41 Added a performace test section to osgunitests, currently just does basic C/C++ tests. 2006-07-03 13:53:39 +00:00
Robert Osfield
69cd27e37f Added sizeof(std::string) test to osgunittests 2005-06-08 10:39:43 +00:00
Robert Osfield
3953190dfe Fixed typo in testLookAt debug info. 2005-04-17 19:14:32 +00:00
Robert Osfield
21ea5a55a8 Added #include <osg/io_utils> 2005-04-08 09:51:56 +00:00