Compare commits

..

1413 Commits

Author SHA1 Message Date
Paul MARTZ
4d1a844fb1 Making 2.8.2b release. 2009-10-21 22:39:49 +00:00
Paul MARTZ
5c7990156d ChangeLog: Update ChangeLog. 2009-10-21 22:37:29 +00:00
Paul MARTZ
7269f71c47 Add CMake-controllable option to avoid doing a glBlitFramebuffer into depth to resolve multisampling. This works arouns a hang on OS X with NVIDIA GeForce 8800 and v1.5.49 drivers. 2009-10-21 21:45:55 +00:00
Paul MARTZ
32fb841e58 From Paul Martz: Branch of the 2.8.2 release to add workaround for issue on OS X NVIDIA driver 1.5.49. glBlitFramebuffer on both color and depth locks the OS X desktop. Fix is a CMake-controlled switch, when enabled, the glBlitFramebuffer does not blit depth. This produces acceptable results because apps doing RTT generally don't need to resolve MSFBO to depth. 2009-10-21 20:13:37 +00:00
Robert Osfield
ace1188557 Release OpenSceneGraph-2.8.2 2009-07-28 06:13:31 +00:00
Robert Osfield
817780e67c Updated ChangeLog 2009-07-28 06:13:20 +00:00
Robert Osfield
7ed9ef7db0 Updated dates for 2.8.2 stable release 2009-07-28 06:02:27 +00:00
Robert Osfield
12d20ee257 From Jean-Sebastien Guay, updated CTestConfig to point to new cdash.openscenegraph.org site 2009-07-24 12:12:33 +00:00
Robert Osfield
2bed6a2dca From J.P. Delport, "attached a modified jpeg plugin that allows writing of grayscale images." 2009-07-17 07:50:06 +00:00
Robert Osfield
315e749cce Update ChangeLog and NEWS for 2.8.2-rc4 2009-07-16 13:30:00 +00:00
Robert Osfield
0b5d743411 Updated release candidate number to 4 2009-07-16 13:18:12 +00:00
Robert Osfield
0029d8fc46 From Fabien Lavignotte, "When exporting some models to OpenFlight, i found a crash if the texture
unit does not contain a TexEnv object.
Here's the small fix, just a test on the pointer."

Merged from svn trunk using:

svn merge -r 10490:10491 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgPlugins/OpenFlight
2009-07-16 12:11:18 +00:00
Robert Osfield
a5d6c1a6a3 From Stephane Lamoliatte, "The vertical anchor is inverted in the osgWidget::Window::update function.
Here is a small patch to fix that."
2009-07-16 12:06:42 +00:00
Robert Osfield
65f85fee6d From Cedric Pinson, crash fix for osganimationtimeline that was caused by not checking if nathan.osg test file had be loaded or not. 2009-07-16 11:52:18 +00:00
Robert Osfield
df14b9980a From Jason Daly, "These are some fixes to the mdl and bsp plugins to handle transparency and lighting better, plus a few other tweaks." 2009-07-16 11:42:08 +00:00
Robert Osfield
7ba85b16db From Colin MacDonald, "The Optimizer Merge Geometry visitor is always merging geometries,
even if they have had DataVariance DYNAMIC explicitly specified.  Then
when an application attempts to dynamically update the geometry in the
frame loop the primitive sets and data arrays are no longer as
expected, leading to display and/or memory corruption.

Attached is a simple fix."

Note from Robert Osfield, tweaked Colin's changes so that it uses != DYNAMIC rather == STATIC in the additional test.

Merged from svn/trunk using:

   svn merge -r 10479:10480 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgUtil/Optimizer.cpp
2009-07-16 11:09:16 +00:00
Robert Osfield
bda1350be4 Tweaked news 2009-07-14 16:02:55 +00:00
Robert Osfield
31f2e7902f Updated contributors, authors file, news and changelog for 2.8.2-rc3 2009-07-14 15:49:40 +00:00
Robert Osfield
e89336a306 From Cory Riddell based on suggestion from Robert Osfield, "I've been running with your suggested changes for a few days now and it
has been working perfectly. I'm still not entirely clear why adding a
slave/subgraph causes the problem."
2009-07-13 16:45:06 +00:00
Robert Osfield
9a8abe7fee From David Fries, "Here is a fix for a deadlock seen under Windows using OpenThreads
Barrier operations.  The error is with atomic operations in the
win32 condition implementation.  The attached sample program will
reliably trigger with as few as three threads and a dual core system,
though sometimes it will take 65,000 iterations.

2.8.1 was the base for these changes

Win32ConditionPrivateData.h
Win32ConditionPrivateData::wait does two operations to decrement
waiters_ then read, when InterlockedDecrement decrements and returns
the value in one operation.  The two operations allows another thread
to also decrement with both getting 0 for an answer.

Win32ConditionPrivateData::broadcast is using waiters_ directly
instead of using the w value read earlier, if it was safe to use
waiters_ directly there would be no need for InterlockedGet or w.

overview of deadlock in barrier with three threads
one thread in broadcast, 2 threads in wait,
release semaphore 2, waits on waiters_done_
both threads wake, decrement waiters_, get 0 for w,
       <logic error here>
one calls set waiters_done_,
broadcast thread comes out of waiters_done_,
other thread calls waiters_done_, (which leaves waiters_done_ in the
signaled state)
       <sets the trap>
broadcast thread returns releases mutex, other threads get
mutex and also return,
next barrier, first two threads enter wait, one goes to broadcast, release
semaphore 2, skips waiters_done_ as it had been released last time
returns, processes, enters the barrier for the next barrier operation
and waits,
three threads are now in wait, two have the previous barrier phase,
one the current phase, there's one count left in the semaphore which a
thread gets, returns, enters the barrier as a waiter, sleeps, and the
deadlock is completed"

Merged from svn/trunk using:

svn merge -r 10456:10457 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/OpenThreads/win32
2009-07-13 16:07:47 +00:00
Robert Osfield
01b27a9fb2 From Paul Fotheringham, fixed linux build error when compiling dicom plugin against ITK by adding define VCL_CAN_STATIC_CONST_INIT_FLOAT to be zero.
From Robert Osfield, general clean up of CMakeLists.txt under ITK side
2009-07-03 19:08:55 +00:00
Robert Osfield
21f735d653 From Bryan Thrall, "The OpenFlight plugin doesn't handle unrecognized options or extra
whitespace in all cases, causing it to crash."
2009-07-01 15:39:48 +00:00
Robert Osfield
4dfa7485c1 Updated NEWS for and READE for 2.9.2-rc2. 2009-06-29 09:50:45 +00:00
Robert Osfield
7bbc1c419b Updated release candidate to 2 2009-06-29 09:47:46 +00:00
Robert Osfield
ab029febbd Made --pssm and --sv options use SingleThreaded viewer to workaround threading issues with ParallelSplitShadowMap and ShadowVolume techniques. 2009-06-29 09:46:40 +00:00
Robert Osfield
d5d19ac1a4 Updated to NEWS to map to wiki NEWS item 2009-06-25 16:08:25 +00:00
Robert Osfield
44da3958c3 From Mathias Froehlich, changes from atof to use osg::asciiToFloat() to avoid locale issues with atof 2009-06-25 14:06:29 +00:00
Robert Osfield
26e3f00882 From Mathias Froehlich, "Fix possible problem with aliasing rules... and fix a gcc warning :)
Use a union to determine if we are on a little endian or big endian machine."

Merged from svn/trunk using :

svn merge -r 10409:10410 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/include/osg/
2009-06-25 13:27:37 +00:00
Robert Osfield
fb6e1d4d9f Fixed swap size error.
Merged from svn/trunk using:

  svn merge -r 10386:10387 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgPlugins/txp/
2009-06-22 16:04:46 +00:00
Robert Osfield
e4fa4f9119 Updated NEWS, AUTHORS and ChangeLog for 2.8.2-rc1 release 2009-06-22 09:32:42 +00:00
Robert Osfield
a9c1dd1a4a Merged from svn/trunk fix to initGLNames() which addressed thread safety issue 2009-06-22 07:42:57 +00:00
Robert Osfield
102e5c2439 From Farshid Lashkari, "I found a bug in the osgText library in version 1.2 that I believe still exists in the latest version.
I found that changing the alignment of a text object does not work properly if the text contains newline characters. I've attached a simple test case that shows the problem. If I set the text AFTER setting the alignment, everything works fine. But if I set the text BEFORE setting the alignment then the text is displayed incorrectly.

The fix is very simple. Instead of calling computePositions() in TextBase::setAlignment(), it calls computeGlyphRepresentation(). I've attached the modified TextBase.cpp."

Merged from svn/trunk using:

  svn merge -r 10375:10376 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgText/TextBase.cpp
2009-06-20 11:38:22 +00:00
Robert Osfield
264746a5c2 Added clears of input vectors in various get*() methods 2009-06-19 11:02:15 +00:00
Robert Osfield
dfa3c9a2c9 Updated ChangeLog 2009-06-19 10:44:47 +00:00
Robert Osfield
b795e65a39 From Rene Molenaar, "The bug is as described above:
"The dragger's corner tabs are no longer in the corners."

this fix places the cornertabs back in the corners.
(the manipulator does not make sense otherwise)."
2009-06-18 08:19:37 +00:00
Robert Osfield
b1dbb9e96b Added CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS 2009-06-17 15:10:04 +00:00
Robert Osfield
4f6add4c14 Fixed error in DisplaySetting::setNumOfHttpDatabaseThreadsHint() 2009-06-17 08:55:53 +00:00
Robert Osfield
edb1eede40 From Konstantin Sinitsyn, "I've fixed bug with loading of compressed texture to texture array!"
Merged from svn/trunk using:

svn merge -r 10336:10337 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osg
2009-06-12 09:53:42 +00:00
Robert Osfield
9cccbcd7b7 From Mathias Froehlich, "Without this change packed depth stencil attachments are only supported if the
GL_EXT_framebuffer_blit extension is available. This is due to the early
return from the constructor if this is missing.
As far as I read the standard extension documents, this blit call is not
required to have packed depth stencil fbos.
The change fixes this and allows packed stencil attachments on machines
without the multisample blit command."

Merged from svn/trunk using:

svn merge -r 10326:10327 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk
2009-06-08 13:53:05 +00:00
Robert Osfield
1bf529b391 From Lionel Largade, "this correction makes the intensity interpolated in the correct direction when the angle is between _cosFadeAngle and _cosAngle."
Merged from svn/trunk using:

   svn merge -r 10320:10321 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgSim
2009-06-08 11:14:37 +00:00
Robert Osfield
83b84eb2f4 Introduced depend_on template and usage in RenderBin.cpp's singleton to solve crash on exit in static builds. 2009-06-06 10:08:43 +00:00
Paul MELIS
90325a5895 Fixed incorrect ENDIF() in applications/osgversion/CMakeLists.txt
(CMake 2.4 complained about this, while 2.6 seems to ignore it)
2009-06-04 19:22:06 +00:00
Robert Osfield
c2bc684eb2 Update ChangeLog and NEWS 2009-06-02 14:48:36 +00:00
Robert Osfield
5b439806ce Merged from svn/trunk : "Moved assigned of texture object to
_textureObjectBuffer to earlier in Texture2D::apply() to prevent
problems with non power of two texture mipmap generation."
2009-06-02 14:44:33 +00:00
Robert Osfield
5574c50607 Updated ChangeLog and NEWS.txt in prep for 2.8.2 2009-06-02 14:42:07 +00:00
Robert Osfield
31cb807db3 Updated version numbers for 2.8.2 release 2009-06-02 09:23:47 +00:00
Robert Osfield
3326c26a60 Merged from svn/trunk : "Fixed handling of case where the
master and the slave camera are placed on the same
          GraphisContext, or when the master camera and slave camera are
          assigned to different Camers. Note normally one doesn't mix
          master with GraphicsContexts and slave cameras so neither case is
          common."
2009-06-02 09:20:20 +00:00
Robert Osfield
8d70cc0b0f Merged from svn/trunk: "Added initializer of ParticleSystemUpdater::_frameNumber" 2009-06-02 09:17:48 +00:00
Robert Osfield
3558d1d010 Merged from svn/trunk two submissions:
"Refactored the adaption of X11 key symbols into OSG key events to fix problems with handling wide range of locales."

From Mathias Froehlich, "This frees some memory that is allocated by the X11 functions."
2009-06-02 09:16:11 +00:00
Robert Osfield
be47c9f44a Merged from svn/trunk. 2009-06-02 09:15:03 +00:00
Robert Osfield
6dab8c3380 From Emmanuel Roche, "I've also updated
the computeBound() method from the osg::Transform class : this
          method was using float based temporary variables and thus the
          double precision is lost here. I've changed that to use the
          generic types osg::BoundingSphere::vec_type and
          osg::BoundingSphere::value_type instead."

Merged from svn/trunk.
2009-06-02 09:14:04 +00:00
Robert Osfield
bbc8e7b58c Fixed glStencilMask setting. 2009-05-27 12:11:58 +00:00
Robert Osfield
9d8c98395e Refactored the GraphicsWindowX11::adaptKey() implementation so that it always uses the reampX11Key(ks) method, and for the mapping to handle case correctly. Merged from svn/trunk revision. 2009-05-25 16:36:11 +00:00
Robert Osfield
abbf13d7bf Updated AUTHORS file to 2.8.1 release 2009-05-19 16:21:24 +00:00
Robert Osfield
431c34024c Updated ChangeLog for 2.8.1 release 2009-05-19 16:08:18 +00:00
Robert Osfield
ba50def217 Updated dates and reset release candidate back to 0 for final 2.8.1 release 2009-05-19 16:05:19 +00:00
Robert Osfield
7592acf224 Updated ChangeLog, NEWS, README and AUTHORS files for rc5. 2009-05-18 16:02:10 +00:00
Robert Osfield
62f5a4d3bc Merged changed from svn/trunk, improving the reliability of the clear of the stencil and depth buffer. 2009-05-18 15:49:19 +00:00
Robert Osfield
0c345e76d4 From Paul Obermeier, "Please find enclosed some changed OSG header files.
The changes are more or less just beautifications
(when looked at them from the C++ view), but make
wrapping OSG with SWIG easier.
I have tested the changes with both 2.8.1-rc4 and the
current head and would appreciate to incorporate the
changes in both branches.

Here is a description of the changes:

osg/BoundingSphere:
   Use the following typedef (like used in BoundingBox)
       typedef typename VT::value_type value_type;
   instead of
       typedef typename vec_type::value_type value_type;

   SWIG reports errors on the latter construct.
   Also makes it consistent with BoundingBox.


osg/Vec4ub:
   Consistent use of "value_type" throughout the file.


osg/Vec?b:
   Consistent use of "value_type" throughout the files.

   Also changed
       typedef char value_type;
   to
       typedef signed char value_type;

   In the case of a simple "char", SWIG assumes a string.
   Using "signed char" instead of "char" does not change
   the behaviour of the class."
2009-05-18 14:53:11 +00:00
Robert Osfield
d4ec341573 From Ross Anderson, "Symptom: The computation of TerrainTiles containing only image layers (no elevation layer) is incorrect. The resulting bounding sphere will always have a radius of zero.
The fix is to remove the call to bs.expandBy(v) and compute the radius directly. I believe this call was intended to be bs.expandRadiusBy(v), but it is superfluous when the radius is computed directly.
"

Merged from svn/trunk using:

   svn merge -r 10229:10230 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgTerrain
2009-05-18 12:56:29 +00:00
Robert Osfield
371778e0e7 Merged from svn/trunk libcurl version checks to enable build against older versions of libcurl.
svn merge -r 10221:10222 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgPlugins/curl/
2009-05-15 15:13:17 +00:00
Robert Osfield
ca58e0db21 Removed redundent errno and version string declaration 2009-05-15 12:37:31 +00:00
Robert Osfield
a6e017dc3c Updated ChangeLog and dates for 2.8.0-rc4 2009-05-15 09:25:31 +00:00
Robert Osfield
e843836292 Updated dates 2009-05-14 17:26:30 +00:00
Robert Osfield
e7447a46be Updated ChangeLog and AUTHOR file 2009-05-14 17:25:00 +00:00
Robert Osfield
ec23bf1b1c Moved the Contributors generation code out into a separate source file that is only compiled when OSG_MAINTAINER is enable via ccamke. This has been done to prevent build issues on some machines with compilers that chose a different local to the one that the contributors names are encoded. 2009-05-14 17:18:47 +00:00
Robert Osfield
285240fd2d From Thibault Genessay, "On Windows, when a process tries to spawn one too many thread,
_beginthreadex() fails but OpenThreads still waits on the startup
Block before returning to the caller of OpenThreads::Thread::start().
This causes a deadlock. The return value of _beginthreadex() is
actually checked, but after the call to OpenThreads::Block::block() so
it is basically useless.

Attached is a fix to move the check for the return value of
_beginthreadex() before the call to block(), so that start() can
return to the caller with a non-zero error code. This solves the
problem for me."

Merged from svn trunk using:

  svn merge -r 10190:10191 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/OpenThreads/win32
2009-05-13 08:35:45 +00:00
Robert Osfield
bf5cad7a0c Updated ChangeLog and NEWS/READER for release candidate 2009-05-12 11:15:19 +00:00
Robert Osfield
c81ba225c9 Updated wrappers 2009-05-12 11:12:11 +00:00
Robert Osfield
79967399fe From Fajran Iman Rusadi, fixed to handling of widget indices in insert and remove methods. Merged from svn/trunk using:
svn merge -r 10181:10182 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgWidget
2009-05-12 10:49:16 +00:00
Robert Osfield
adced1b3dc Added initializer for _mouseCursor 2009-05-08 12:38:26 +00:00
Robert Osfield
0e64a4773a From Neil Groves, fixed unitialized variable 2009-05-08 07:49:54 +00:00
Robert Osfield
f86dbaed74 Updated release candidate to 4. 2009-05-07 15:59:26 +00:00
Robert Osfield
6612b98ddb From Frederic Bouvier, workaround of setCursor problems under Windows. 2009-05-07 15:14:59 +00:00
Robert Osfield
67ef3fd2c5 Fixed ABSOLUTE_RF slave camera resize policy, merged from svn trunk using:
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/
2009-05-07 14:58:22 +00:00
Robert Osfield
4ae4b9fdf5 From Stephan Huber, "while debugging a problem in finding plugins on OS X I discovered, that
the conditional directives for setting the prepend-string in
createLibraryNameForExtension were not in effect, because of the mixture
of different #ifdef styles.

I removed the conditional part for __APPLE__ completely to be more
standard-conform with other platforms (plugins should be located in
osgPlugins-X.X.X/). Because of the wrong syntax of the conditional
compile the old code was not used anyway -- so no functional change.
"

Merged from svn/trunk using:

svn merge -r 10149:10150 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgDB
2009-05-07 13:24:49 +00:00
Robert Osfield
e1c5969b0e From Chris Denham, fix for swapBuffers warning when window is minimized under Windows.
svn merge -r 10146:10147 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgViewer/
2009-05-07 13:18:35 +00:00
Robert Osfield
029c114c4c Fixed name of POPPLER_LIBRARY_DIRS, merged from svn trunk using svn merge -r 10143:10144 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgPlugins/pdf 2009-05-07 09:47:20 +00:00
Robert Osfield
bc7f1cf5ac Merged from svn/trunk support for searching for imagery in path relative to the .osg file being loaded. Merged using:
svn merge -r 10100:10137 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgPlugins/osgVolume
2009-05-05 12:56:30 +00:00
Robert Osfield
34c458f075 Merged improvements to osgVolume from svn/trunk using :
svn merge -r 10100:10137 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgVolume
2009-05-05 12:54:16 +00:00
Robert Osfield
7e84617d24 Changed doxygen docs to indicate deprecated status with suggestion of IntersectionVisitor instead. 2009-04-24 17:52:05 +00:00
Robert Osfield
aab533c046 From Jason Daly, "Currently, the .mdl plugin loads vertices in the native DirectX order, which is the reverse of OpenGL order. This means that the back faces are currently rendered as front faces, and vice versa.
This fix reverses the vertex order and sets up proper OpenGL facing.  I didn't notice this problem until I started using the plug-in in my own code (osgviewer seems to not enable backface culling)."

merged from svn/trunk using:

svn merge -r 10092:10093 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgPlugins/mdl/
2009-04-24 10:56:45 +00:00
Robert Osfield
b2e40572e5 Fixed typo 2009-04-23 15:11:05 +00:00
Robert Osfield
f175cad6d8 Update ChnageLog, dates and authors for 2.8.1-rc3 2009-04-23 13:46:49 +00:00
Robert Osfield
2d2b13361b Updated release candidate number 2009-04-23 13:27:56 +00:00
Robert Osfield
aa7b0becf7 Fix to handling of subsurface layers so that more appropriate PolygonOffset values are chosen. Merged from svn/trunk using:
svn merge -r 10083:10084 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/
2009-04-23 11:08:36 +00:00
Robert Osfield
4f3e2c2e82 Merged from svn trunk using:
svn merge -r 10082:10083 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osg/PolygonOffset.cpp
2009-04-23 11:07:14 +00:00
Robert Osfield
ebee4b6721 Fixed typo. 2009-04-22 13:54:45 +00:00
Robert Osfield
e383ef95bc From Bob Kuehne, "fix for failing collada builds on osx due to not being able to stringstreamify osg::Vec3 without io_utils included." 2009-04-22 13:09:45 +00:00
Robert Osfield
2741c38c0d From Paul Martz, "Looks like the people who created these two examples were a bit careless with cut and paste."
Merged from svn/trunk using:

svn merge -r 10063:10064 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/examples/
2009-04-22 10:56:05 +00:00
Robert Osfield
a15b93432a From Eric Sokolowsky, "src/osg/Image.cpp is missing the GL_RGBA8 image type when calculating the number of components in an image. It is added here."
Merged from svn trunk using:

svn merge -r 10061:10062 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osg/Image.cpp
2009-04-22 10:49:56 +00:00
Robert Osfield
3d4ff7ae02 Fix for handling case of no graphics contexts being registered.
Merged from svn/trunk using:
    svn merge -r 10053:10054 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgDB/DatabasePager.cpp
2009-04-21 10:20:56 +00:00
Robert Osfield
cc3f8eba8b Updated dates for 2.8.1-rc2 2009-04-12 18:58:09 +00:00
Robert Osfield
5802844f52 Updated CMakeLists.txt ChangeLog generator so that it tracks the current branch or svn/trunk to prevent branches generating logs for svn/trunk.
Updated osgversion's authors mapping.

Updated ChangeLog.
2009-04-12 18:53:22 +00:00
Robert Osfield
98c3d362e5 Added release from svn/trunk to enable osgCompute. 2009-04-12 10:29:10 +00:00
Robert Osfield
9c6f1ac45a Updated NEWS for 2.8.1-rc1 2009-04-10 21:25:59 +00:00
Robert Osfield
3e340bb23d UPdated date 2009-04-10 14:35:42 +00:00
Robert Osfield
1bbcc0ea44 Update ChangeLog and AUTHORS.txt file for 2.8.1-rc1 2009-04-10 12:56:30 +00:00
Robert Osfield
b3f1204c64 Merged changes from svn/trunk 2009-04-10 12:54:48 +00:00
Robert Osfield
df731d8244 Updater version numbers to 2.8.1-rc1 2009-04-10 10:58:42 +00:00
Robert Osfield
29857b3b19 From J.P. Delport, spelling and grammer fixes 2009-04-10 09:43:20 +00:00
Robert Osfield
b608c191c1 From Mattias Helsing, "
* Use the CPack ZIP generator on windows (WIN32)
* Reformatted according to Philip Lowman's recent submissions"
2009-04-09 15:56:22 +00:00
Robert Osfield
d3d0c28f61 From Glen Waldron, "Attached is a patch for osgUtil::Optimizer. If you run the SpatializeGroupsVisitor on a scene graph containing Geodes, StateSets attached to Geodes can be lost.
The problem is in SpatializeGroupsVisitor::divide(osg::Geode*, unsigned int) where the code creates a new Group and divides up the input Geode into one Geode per Drawable.

I fixed the problem by assigning the Geode's stateset to the new parent group.

To replicate the bug, see attached osg/dds files:

osgviewer b.osg -- model renders correctly
set OSG_OPTIMIZER="SPATIALIZE_GROUPS"
osgviewer b.osg -- textures are missing."

Merged from svn/trunk using:

svn merge -r 9986:9987 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgUtil/Optimizer.cpp
2009-04-08 10:50:30 +00:00
Robert Osfield
c78d065d51 Added disabling of mipmapping for non power of two textures 2009-04-06 12:29:17 +00:00
Robert Osfield
171bc9da21 Merged from svn/trunk disabling of use of display lists and a extra check against NULL to prevent a crash when NULL colour layers are assigned 2009-04-06 11:27:28 +00:00
Robert Osfield
2bb480759f Merged fix in svn/trunk that avoids the building of display lists when VBO's are compiled. 2009-04-03 11:29:49 +00:00
Robert Osfield
4ff8df73bc Merged fixes to the texture compression settings from svn/trunk that don't change the
requested compression type when the pixel type is not a direct match.
2009-03-26 10:25:50 +00:00
Robert Osfield
8631eaaf40 From Michael Platings, fixed memory leak 2009-03-23 16:26:27 +00:00
Robert Osfield
ed2aa7c90f From Frank Midgley, "I tried running osgconv --formats yesterday on OS X and got no results. Turns out the changes discussed in the "osgDB::listAllAvailablePlugins win32 fix" thread back in Sep '08 broke this. The OSG_PLUGIN_EXTENSION macro is being defined in src/osgDB/CMakeLists.txt from CMAKE_SHARED_LIBRARY_SUFFIX which is "dylib" on OS X. The problem is that all of the plug-ins are setup in OsgMacroUtils.cmake with:
ADD_LIBRARY(${TARGET_TARGETNAME} MODULE ${TARGET_SRC} ${TARGET_H})

which gives them .so extensions.  Since ".so" != ".dylib" osgDB::listAllAvailablePlugins finds no plug-ins.  I believe the correct solution is to use CMAKE_SHARED_MODULE_SUFFIX instead.  This builds and runs correctly on OS X but I have not tested on other platforms.

Attached is an updated src/osgDB/CMakeLists.txt based on rev 9915.  The change is at line 108.  To validate: build and then run bin/osgconv --formats.  You should get many screenfuls of plug-in features, extensions and options."

Merged from svn/trunk using:

   svn merge -r 9921:9922 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgDB/CMakeLists.txt
2009-03-12 17:57:52 +00:00
Robert Osfield
8cd7d36982 From Konstantin Sinitsyn, "At this moment, I just introducing to OSG. When I reviewing optimizer code, I find a mistake in Optimizer::RemoveLoadedProxyNodesVisitor, as it seems. This optimizer removes proxy nodes that fully loaded and in some cases attach their childs to parrents directly (without creating of group). I dont understand how this works, because if proxy node doesn't have any attributes such as name, description, node mask and any callbacks, then new group does not created to hold proxy node childs. And code below trying to attach their children to all parents but seems like only first child beeing attached to all parents correctly."
Merged from svn/trunk using:
   svn merge -r 9919:9920 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgUtil/Optimizer.cpp
2009-03-12 17:51:52 +00:00
Robert Osfield
d843de261e From Neil Hughes, changed the handling of opacity maps so that when they are used blending in enabled. Merged from svn/trunk using:
svn merge -r 9905:9906 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgPlugins/3ds/ReaderWriter3DS.cpp
2009-03-11 13:31:17 +00:00
Robert Osfield
c60cff5eb6 From Lionel Lagarde, "the attachment contains a correction of the Optimizer::MergeGeometryVisitor.
When 2 geometries are merged, the primitive sets of the second geometry
are copied to the first geometry.

The primitive sets were copied with a std::insert into the first geometry
primitive set vector. It doesn't work when the geometry is using VBOs (because
the element buffer object of the primitive set is not updated).

The correction replaces

lhs.getPrimitiveSetList().insert( lhs.getPrimitiveSetList().end(),
                                rhs.getPrimitiveSetList().begin(),
                                rhs.getPrimitiveSetList().end() );

by
 for( primItr=rhs.getPrimitiveSetList().begin();
   primItr!=rhs.getPrimitiveSetList().end();
   ++primItr )
{
  lhs.addPrimitiveSet(primItr->get());
}
"
2009-03-11 12:42:44 +00:00
Robert Osfield
18726b72ea Fix to crash due to indices being present witout any associated arrays. Merged from svn/trunk using:
svn merge -r 9899:9900 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osg/Geometry.cpp
2009-03-11 12:02:04 +00:00
Robert Osfield
04e10363bb From Lionel Lagarde, "The copy constructor of the nodes and the drawables do :
Node::Node(Node &node, copyop) :
  _stateSet(copyop(node.getStateSet()),

It doesn't call the setStateSet method of osg::Node (or osg::Drawable). So the parent
list of the state set is not updated with the new node (drawable)."

Merged from svn/trunk using:

svn merge -r 9896:9897 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osg/Drawable.cpp
svn merge -r 9896:9897 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osg/Node.cpp
2009-03-11 11:03:44 +00:00
Robert Osfield
ee4d49c398 From Martin Spott, fixes for IBM AIX build. Merged from svn/trunk using:
svn merge -r 9881:9882 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/include/osg/
2009-03-10 11:56:43 +00:00
Robert Osfield
a6774396bd From Mathias Froehlich, "An other one:
The TLS Varialbe is accessed before it is initialized.
Attached is a change to rev 9791."

Merged from svn/trunk using:

   svn merge -r 9831:9832 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/OpenThreads/win32
2009-03-02 10:51:41 +00:00
Robert Osfield
c37b478ed6 From Petr Salinger, build fix for GNU/kFreeBSD.
Merged from svn/trunk using:

  svn merge -r 9827:9828 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/examples/osgcluster/broadcaster.cpp
2009-03-02 09:59:27 +00:00
Robert Osfield
339026a0f2 From Roland Smeenk, "Attached is a small bug fix for the redundant messages that are created in OSG applications on windows. GraphicsWindowWin32::setCursor is called every frame from the WM_NCHITTEST message. This will result in a call to ::SetCursor(_currentCursor) every frame, which again causes a WM_MOUSEMOVE to occur. The fix exits GraphicsWindowWin32::setCursor if the requested cursor already is the current cursor.
"

Merged from svn/trunk using:

svn merge -r 9823:9824 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgViewer/GraphicsWindowWin32.cpp
2009-02-27 11:14:04 +00:00
Robert Osfield
e68110f303 From Atr Tevs, fixes to FBO blitting. Merged from svn/trunk using:
svn merge -r 9821:9822 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgUtil/RenderStage.cpp
2009-02-27 10:50:12 +00:00
Robert Osfield
1490271272 From Mattias Helsing, "
In file "/home/robert/OpenSceneGraph/CMakeModules//Find3rdPartyDependencies.cmake":
------------------------------
64:             SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
"
2009-02-26 22:10:53 +00:00
Robert Osfield
8faa9d3f63 From Mathieu Marache, "I was trying to use the archive output of osgdem without success when
I eventually found out that it was now disabled (the mailing list
archive tells me it is because of multithreaded write issues with
vpn). I then decided to use osgarchive to make it myself from the
generated output. However if one of the insert parameters is a
directory, it won't be able to find them. The attached versions
corrects this"
2009-02-20 17:28:14 +00:00
Robert Osfield
8297d8f0cb From Humar Carmona, "When reading a DXF file, the reader breaks at a debug assertion at vector (it breaks on release version). Inspecting the code show that the cause could be in dxfEntity.cpp.
It seems that the problem is an offending "short" used in a for loop, where it should be "int" or "long". It causes an index out of range error. "

Merged from svn trunk using:
svn merge -r 9803:9804 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgPlugins/dxf/dxfEntity.cpp
2009-02-20 11:41:30 +00:00
Robert Osfield
439c3a866b Fixed bug in checking of return values. Fix merged in from svn/trunk using:
svn merge -r 9800:9801  http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgPlugins/hdr/hdrloader.cpp
2009-02-19 17:40:55 +00:00
Robert Osfield
8954964c32 From Tanguy Fautre, This fixes the OSG crashes reported by http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2009-February/023499.html
It's a one line change against OSG 2.8.0 (see line 196). I've already tested the change, and confirmed it\u2019s fixing the crashes described above."

merged from svn trunk using:

svn merge -r 9797:9798  http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osg/State.cpp
2009-02-19 16:36:56 +00:00
Robert Osfield
7e75fa6a66 From Ruben Smelik, "I've found a (copy-paste?) error in PrimitiveSet.cpp regarding instanced drawing. For DrawElementsUInt and DrawElementsUShort the type argument of glDrawElementsInstanced was set as GL_BYTE instead of GL_UNSIGNED_INT and GL_UNSIGNED_SHORT. I've attached the fixed source file (based on the current SVN head version)."
Merged from svn/trunk using:

svn merge -r 9795:9796 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osg/
2009-02-19 16:00:52 +00:00
Robert Osfield
ced46026e5 merged from svn/trunk using:
svn merge -r 9793:9794 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk
2009-02-19 15:38:09 +00:00
Robert Osfield
36ba62e69a Fixed number of contributors 2009-02-19 13:44:14 +00:00
Robert Osfield
721505f7c9 Updated ChangeLog for 2.8.0 2009-02-12 14:46:11 +00:00
Robert Osfield
e4eb3896dd Compiled fix 2009-02-12 14:35:55 +00:00
Robert Osfield
98df276818 Changed iso surface lighting to ignore intensity of the texture 2009-02-12 14:01:53 +00:00
Robert Osfield
c3bad2bd04 Fixed handling of xSize, ySize and zSize 2009-02-12 13:57:18 +00:00
Robert Osfield
e4ad3d311d Updated ChangeLog 2009-02-12 13:31:04 +00:00
Robert Osfield
fc05e7d8b1 Warning fixes for Windows 2009-02-12 12:51:04 +00:00
Robert Osfield
d58a21ca5f Updated dates and release candidate number of 2.8.0 release 2009-02-12 10:17:41 +00:00
Robert Osfield
03e08d7918 Update ChangeLog, Authors for rc6 2009-02-11 20:25:34 +00:00
Robert Osfield
6ce7cc9d6a Updated wrappers 2009-02-11 20:19:48 +00:00
Robert Osfield
2646423be7 Updated wrapper configurations from svn/trunk revision 9774 2009-02-11 20:17:12 +00:00
Robert Osfield
625ea05d3f Changed the default for aggressive warnings so that they are off under Apple. 2009-02-11 17:43:25 +00:00
Robert Osfield
f963397726 From Riccardo Corsi, "in attach you'll find a patch to cleanup a little bit the (de)initialization code of QuickTime? environment from the quickTime pluging.
It basically removes the static init() and exit() functions,and move them inside the observer class (the one that cleans everything up when the last media is unloaded).

It also add an extra check to clean up on exit if the QuickTime? env is initialized, but no media is succesfully loaded / written (it might happens with streaming resources).

I tested it under WinXP with zero, one and multiple videos. "

Merged from svn/trunk using:

svn merge -r 9768:9769 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk
2009-02-11 17:42:17 +00:00
Robert Osfield
7c97bab944 Added brackets around (unsigned int) to avoid IRIX compile error. Merged from svn/trunk using:
svn merge -r 9762:9763 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/
2009-02-11 17:08:04 +00:00
Robert Osfield
89052bec27 Fixes to doyxgen warnings, merged from svn/trunk using:
svn merge -r 9761:9762 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/
2009-02-11 16:59:08 +00:00
Robert Osfield
99120af181 From Sukender, changes doxygen vebosity to QUIET, merged from svn/trunk using:
svn merge -r 9763:9764 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/
2009-02-11 16:57:43 +00:00
Robert Osfield
166f949592 Updated changelog 2009-02-11 16:50:51 +00:00
Robert Osfield
145d93073c Updated ChangeLog 2009-02-11 09:18:02 +00:00
Robert Osfield
db00cb1613 From Roland Smeenk, "Attached are two small fixes:
-I changed the SET of COLLADA_BOOST_INCLUDE_DIR to use findpath, so users may override this setting if they choose not to build against to precompiled boost libraries delivered with the Collada DOM.

-Changed daeRMaterials.cpp to prevent a compiler warning about a potentially uninitialized variable."
2009-02-11 09:16:58 +00:00
Robert Osfield
1420393b00 Warning fix 2009-02-10 20:28:29 +00:00
Robert Osfield
440445aa8b Updated release number and dates for 2.8.0-rc5 2009-02-10 20:25:38 +00:00
Robert Osfield
07bccafd05 Merged from svn/trunk changes for better Collada build support from Roland Smeenk, Roger James and Robert Osfield, merge commands.
svn merge -r 9740:9741 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk
svn merge -r 9750:9751 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk
2009-02-10 20:15:54 +00:00
Robert Osfield
6df979f8c8 Changed the message about not finding plugin so that it's notify level is INFO 2009-02-10 20:07:00 +00:00
Robert Osfield
aef27c4387 From Pierre Haritchabalet, "In IO_FluidProgram.cpp, FluidProgram_readLocalData() function is wrong. When density parameter is read, the function "setFluidViscosity()" is called instead of "setFluidDensity()".
This patch fixes osg plug'in FluidProgram_readLocalData."

merged from svn/trunk using:

  svn diff -r 9748:9749 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk
2009-02-10 18:59:22 +00:00
Robert Osfield
d3061ac0f7 Fixed the handle of ImageSequence in osgVolume. 2009-02-10 18:48:17 +00:00
Robert Osfield
4adc16bcdd From Jason Beverage, "I've added a small change to the CURL plugin that allows support for HTTP redirects."
Merged from svn/trunk:

   svn merge -r 9743:9744 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk
2009-02-10 13:58:07 +00:00
Robert Osfield
6a051be85a From Miguel Escriva, fixed finding of zlib under Windows, merged in from svn/trunk using:
svn merge -r 9741:9742 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk
2009-02-10 13:31:15 +00:00
Robert Osfield
cbb9881003 Update ChangeLog and AUTHORS for 2.8.0-rc2 2009-02-09 23:23:31 +00:00
Robert Osfield
be40ac8aad From Fabien Lavignotte,"Some other litte changes just to clean up the API.
TimeLine : remove virtual inheritance that is not needed
RigGeometry : put some methods/members in private section (everything was public), use META_Object macro
osganimationskinning.cpp : remove two lines that are not needed"

Merged from svn/trunk:

svn merge -r 9736:9737 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk
2009-02-09 22:59:13 +00:00
Robert Osfield
919a1e5286 Fixed for loop bug in DatabasePager::getRequestsInProgress(). 2009-02-09 22:28:49 +00:00
Robert Osfield
85acee5dcc Update release candidate to 4. 2009-02-09 22:13:09 +00:00
Robert Osfield
77326d2c17 Add suppression of the ScopedLock<Mutex> template 2009-02-09 22:09:41 +00:00
Robert Osfield
ea3b08526d From Bryan Thrall, "The .osg plugin doesn't seem to support an option to write shader files
separately, so it always inlines them in the .osg file (as far as I can
tell). This change adds that ability. "

Merged from svn/trunk.
2009-02-09 21:53:18 +00:00
Robert Osfield
437377b5d5 From Ralf Habacker, "on win32 there is a memory leak in recent svn code in GraphicsWindowWin32.cpp.
in bool GraphicsWindowWin32::setWindow( HWND handle )

there is the following if/else statement

  if (_traits.valid() && _traits->setInheritedWindowPixelFormat)
  ....
  else
     setPixelFormat()
    _hglrc = ::wglCreateContext(...) [1]

setPixelFormat() calls wglCreateContext() and saves the result into _hglrc which is overwritten by a second call to wglCreateContext() call at [1]

The same behavior occurs in bool Win32WindowingSystem::getSampleOpenGLContext( OpenGLContext& context, HDC windowHDC, int windowOriginX, int windowOriginY ).

The solution for this issue is to move the wglCreateContext() out of setPixelFormat() and to place it into the caller which is done to the appended file
"
2009-02-09 21:17:36 +00:00
Robert Osfield
c7f2e570ed To address a thread related crash reported in osgParticle changed the ParticleSystem
to have an optional compile path for either using a OpenThreads::ReadWriteMutex or an 
OpenThreads::Mutex as it's base implementation, with the Mutex now being used by default.
2009-02-09 18:20:36 +00:00
Robert Osfield
b9540fc9f1 Fixed indentation 2009-02-09 14:51:42 +00:00
Robert Osfield
fa8de3058f Synced OSG-2.8 version with the svn/trunk version. 2009-02-09 14:48:26 +00:00
Robert Osfield
1194f8941c From Stephan Huber, did an merge from svn/trunk:
svn merge -r 9722:9721 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk
2009-02-09 14:38:46 +00:00
Robert Osfield
1a922f0f28 Reset the release candidate number in prep for official 2.8.0 release 2009-02-09 13:12:36 +00:00
Robert Osfield
ce1d7c0c90 Updated date of 2.8.0 release 2009-02-09 12:59:05 +00:00
Robert Osfield
3c50ac6f04 From Paul Melis, syncing improvements made to wiki version of NEWS for 2.8 2009-02-09 11:15:13 +00:00
Robert Osfield
b783a7468e Removed inapproriatly placed #pragma 2009-02-09 10:58:34 +00:00
Robert Osfield
4e2c17ee02 Updated wrappers 2009-02-09 09:48:50 +00:00
Robert Osfield
578a910ad0 From Cedric Pinson, removed virtual inheritance from osgAnimation::Animation 2009-02-09 09:41:48 +00:00
Robert Osfield
e0f4fb0952 Updated NEWS and README dates for 2.8.0-rc3 2009-02-08 19:40:44 +00:00
Robert Osfield
6ad6bf8b5a Fixed handling of making svn tags when on a branch 2009-02-08 19:39:24 +00:00
Robert Osfield
0b702d27de Changed the svn source from trunk to branches 2009-02-08 19:35:34 +00:00
Robert Osfield
d3f2c6e505 Fixed handling of a series of \n in the text string so that the correct line spacing is maintained. 2009-02-08 19:27:52 +00:00
Robert Osfield
12d62940bc Form Paul Melis, "While trying out the osgbrowser example (where I had forgotten to update
LD_LIBRARY_PATH so the XUL libs would be found) I noticed that although
the gecko plugin was found it could not be loaded. But this did not
trigger any visible warning/error message (at least not without INFO
notify level). Would you mind if we change the notify level for a
dlerror() to WARNING? This will also make it more explicit for the case
when a plugin isn't actually found, which seems to come up a lot for
novice users (e.g. no freetype on win32, so no freetype plugin, etc).
Also, the current error message is misleading ("Warning: Could not FIND
plugin to ...") because the it's not always a case of not finding the
plugin. I slightly enhanced the situation of not finding a plugin versus
finding it but not being able to load it.

Here's also a few fixes to some of the examples:
- osgfont: make usage help line more in line with the actual behaviour
- osgcompositeviewer: complain when no model file was provided
- osgmovie: don't include quicktime-dependent feature on Linux
- osgocclussionquery: comment addition (as I was surprised that lines
were being drawn in a function called createRandomTriangles())"
2009-02-08 15:56:10 +00:00
Robert Osfield
ffcece130a Added merge.setting of StateSet during replacement of Transforms in FlattenStaticTransfrom and CombineAdjacentTransfroms 2009-02-07 11:28:55 +00:00
Robert Osfield
e2d7743a80 Updated Authors 2009-02-06 16:07:36 +00:00
Robert Osfield
6298312cf0 Updated ChangeLog for 2.8.0-rc2 2009-02-06 16:03:38 +00:00
Robert Osfield
1a3a801857 From Gary Quinn, spelling fixes 2009-02-06 15:27:41 +00:00
Robert Osfield
5ee4a99de0 Updated date of release 2009-02-06 15:13:19 +00:00
Robert Osfield
9097925163 Added version checks and an extra header check to make sure everything that is required by the gecko plugin is available. 2009-02-06 14:23:58 +00:00
Robert Osfield
f29ddb0e05 Fixed data copy bug 2009-02-06 12:12:40 +00:00
Robert Osfield
96cd49d43a From Gary Quin, update to paths 2009-02-06 11:14:12 +00:00
Robert Osfield
cd666f61e8 Added #include <osg/Config> to export to enable the pragama to work 2009-02-06 10:54:57 +00:00
Robert Osfield
1224e0883a From Paul Melis, added use of pkg-config to find FindXUL and DCMTK env var for finding DCMTK 2009-02-06 10:48:38 +00:00
Robert Osfield
fde95d5ccf From Alberto Luaces, "here are some minor fixes to notify warnings were the std::hex modifier was
used but never restored to the decimal notation. That made OSG print messages
like the following after some notifications:

Warning: detected OpenGL error 'invalid value' after RenderBin::draw(,)
RenderStage::drawInner(,) FBO status= 0x8cd5
[...]
Scaling image 'brick_side.JPG' from (1b4,24f) to (200,200) <--- Values in hex
because of previous error.
[...]"
2009-02-06 10:35:18 +00:00
Robert Osfield
d0e12bd379 Added pragma disables for VS C4702 and C4511 as VS7.1 was spitting out lots warnings for valid code. 2009-02-06 10:12:40 +00:00
Robert Osfield
9acbe3e44f Removed -Wunitialized flag as it was caused warnings from some versions of gcc 2009-02-06 10:06:02 +00:00
Robert Osfield
eb9b99b5ec Added the disabling of VS warning C4267. 2009-02-05 16:09:56 +00:00
Robert Osfield
42f06bf81a Updated release candidate number to 2 2009-02-05 15:24:59 +00:00
Robert Osfield
76dd3698ce From Fabien Lavignotte, "Here is some various small fixes i have done while playing with
osgAnimation.
 - Animation : removed the _name attribute that is never used.
 - BasicAnimationManager : fix a crash on Windows with the example
osganimationviewer. The _lastUpdate attribute was not initialized when
using copy constructor.
 - CMakeLists.txt : add RigGeometry to the headers list"
2009-02-05 15:23:08 +00:00
Robert Osfield
a571574a1c Added suppression of strict-alaising warning emitted by gecko headers 2009-02-05 14:34:15 +00:00
Robert Osfield
223c603a8c Disabled deprecated warning 2009-02-05 14:16:04 +00:00
Robert Osfield
91716f6e06 Fixed tabs 2009-02-05 12:45:02 +00:00
Robert Osfield
b8345534c5 Added initializer to fix warning 2009-02-05 12:43:22 +00:00
Robert Osfield
33cba8392a Added exports to TileID classes, and moved their constructors to .cpp's. 2009-02-05 12:36:53 +00:00
Robert Osfield
2ab6a762c8 From Morne Pistorius, "Attached is a modified version of the QOSGWidget example that shows
the workaround we discussed for adding/removing views in a composite
viewer at runtime.  A dummy view is added to the viewer to always keep
it live.

Also, I added a #define to the Qt event relay methods to not override
them on a Windows system.  This fixes the bug where duplicate events
are being sent and making it impossible to throw the trackball."
2009-02-05 12:21:25 +00:00
Robert Osfield
cc68950e7a Warning fixes 2009-02-05 12:03:09 +00:00
Robert Osfield
59c1483fb9 Added suppression of C4512 as it's just causing lots of warnings on some VS compiler versions, fixes the warnings via code is just too much of risk at this late stage of the 2.8 release 2009-02-05 11:06:23 +00:00
Robert Osfield
cb37bf2446 Removed the --format=2 entry as it was reported problems with buggy standard library headers 2009-02-05 10:40:43 +00:00
Robert Osfield
3a34e2869b From Jean-Sebastien Guay, warning fixes. 2009-02-04 19:22:25 +00:00
Robert Osfield
849333d43e Updated ChangeLog 2009-02-04 14:15:11 +00:00
Robert Osfield
a15813c4a7 From Paul Melis, spelling fixes 2009-02-04 13:53:32 +00:00
Robert Osfield
a606fd688c Branch OpenSceneGraph-2.8 2009-02-04 13:01:44 +00:00
Robert Osfield
af8696ca57 Set the release candidate to 1. 2009-02-04 12:59:44 +00:00
Robert Osfield
fc6fa1e268 Updated news to keep in sync with online news entry 2009-02-04 12:54:18 +00:00
Robert Osfield
a40c476aa4 Updated AUTHORS file for 2.8 branch. 2009-02-04 12:50:26 +00:00
Robert Osfield
fadc4661e7 Updated NEWS and README for 2.8 branch 2009-02-04 12:31:33 +00:00
Robert Osfield
3c6b26c970 Fixed the constness of osg::Image* pointer 2009-02-04 11:35:24 +00:00
Robert Osfield
316a7a4dbd Removed cast, to quieten VS warnings. Confirm change with original author Mathias Froehlich. 2009-02-04 09:03:13 +00:00
Robert Osfield
ff66ca022e Clean up warning disable code 2009-02-03 20:26:26 +00:00
Robert Osfield
2540c7dd57 Disabled warning 2009-02-03 20:17:24 +00:00
Robert Osfield
d4afe154f0 Fixed warning 2009-02-03 17:14:34 +00:00
Robert Osfield
7eafde35e2 Fixed warning 2009-02-03 17:11:54 +00:00
Robert Osfield
734463fcc7 Warning fixes 2009-02-03 15:28:53 +00:00
Robert Osfield
abb63e3199 Added setDataVariance(DYNAMIC) to text label as it's being updated dynamically 2009-02-03 12:47:41 +00:00
Robert Osfield
c5733fef14 Added local disabling the the VS C4121 "alignment of a member was sensitive to packing" warning 2009-02-03 11:54:46 +00:00
Robert Osfield
b51adc6f24 Fixed warning 2009-02-03 11:07:13 +00:00
Robert Osfield
1f3551820b Added disabling of "warning: format not a string literal, argument types not checked" under FreeBSD as these errors are being generated from std library ostream implementation. 2009-02-03 11:05:35 +00:00
Robert Osfield
17241da4e5 Added explict initialization of osg::Object contstructor to fix warning 2009-02-03 11:04:37 +00:00
Robert Osfield
5aeca01828 Updated wrappers 2009-02-02 20:42:33 +00:00
Robert Osfield
1153ea5feb Warnings fixes for VS. 2009-02-02 20:35:19 +00:00
Robert Osfield
965b7ddc72 Attempt to appease both FreeBSD CMAke 2.6.2 + Linux CMake 2.4.8 builds 2009-02-02 20:34:58 +00:00
Robert Osfield
bd3c5ac0fa From Cedric Pinson, warning fix. 2009-02-02 18:55:08 +00:00
Robert Osfield
10d16c92fe Added initializer for local Quat definition 2009-02-02 17:46:16 +00:00
Robert Osfield
81b336756b Added explict intializiers of base classes 2009-02-02 17:32:34 +00:00
Robert Osfield
c37d72957a Added /lib64 to search paths. 2009-02-02 17:16:02 +00:00
Robert Osfield
e1bdee5338 Improved handling of stats projection size 2009-02-02 17:15:40 +00:00
Robert Osfield
630f5087dc From Stephan Huber, build fix for OSX XCode build 2009-02-02 16:56:46 +00:00
Robert Osfield
b1a5228972 Fixed version 2009-02-02 15:04:53 +00:00
Robert Osfield
33d158e290 Updated OpenThreads and OpenSceneGraph version ready for OSG-2.8 branch. 2009-02-02 14:55:51 +00:00
Robert Osfield
fa727038a4 From Cedric Pinson, "Here an update of the osgAnimation ReaderWriter, it add other NodeCallback that could be attached to a node with Bone." 2009-02-02 14:51:51 +00:00
Robert Osfield
3d1c38f5e8 From Pierre Haritchablaet, "The wind vector of osgParticle::FluidFrictionOperator has not been written and read in IO_FluidFrictionOperator. This patch fixes osg plug'in FluidFrictionOperator_readLocalData and FluidFrictionOperator_writeLocalData." 2009-02-02 14:50:19 +00:00
Robert Osfield
2d55740b3e Refactored osg::TransferFunction1D to use an std::map internally which is kept in sync with the actual osg::Image that is passed to the GPU.
Added .osg support for osg::TransferFunction1D.

Updated wrappers
2009-02-02 14:43:27 +00:00
Robert Osfield
6130f292a7 From Sukender, add check against NULL parameter value 2009-02-02 09:23:28 +00:00
Robert Osfield
d6b0cd64f1 Ground work for full .osg support for osg::TransferFunction* 2009-02-01 12:38:55 +00:00
Robert Osfield
a13c6405d8 Updated NEWS 2009-01-31 21:46:27 +00:00
Robert Osfield
b514b435f4 Added initial placeholder for .osg support for osgVolume::TransferFunctionProperty 2009-01-31 21:46:16 +00:00
Robert Osfield
281800539e Fixed handling of TransferFunctionProperty. 2009-01-31 21:45:47 +00:00
Robert Osfield
6fda032aa2 Rejigged the Xrandr include 2009-01-31 10:21:36 +00:00
Robert Osfield
aed3339e43 Improved shaders to better handle region of constant values when doing normal generation 2009-01-30 18:56:30 +00:00
Robert Osfield
a358bd7370 Updated iso surface shaders 2009-01-30 17:10:27 +00:00
Robert Osfield
cbaf9d639c Added support for discard fragment that don't generate an iso surface intersect 2009-01-30 16:45:54 +00:00
Robert Osfield
5c7a6a25a0 From Paul Melis, "I think TransferFunction needs to call _image->dirty() in two places in response to an assign() of new transfer map values.
Here's an updated file, which seems to work here.
"
2009-01-30 15:04:07 +00:00
Robert Osfield
eae23b01c3 From Lionel Lagarde, "this correct how the ParticleEffect are serialized :
- the texture file name is taken from the TextFileName field
- the texture file name is written using writeString
"
2009-01-30 14:54:22 +00:00
Robert Osfield
f394179baf Update AUTHORS for release 2009-01-30 13:05:07 +00:00
Robert Osfield
a019c74de1 Updated ChangeLog for 2.7.9 release 2009-01-30 12:17:59 +00:00
Robert Osfield
7a7c64211c Fixed size of background of frame stats so that it's the correct width of the window 2009-01-30 12:09:06 +00:00
Robert Osfield
1dd7f10e19 Updated wrappers 2009-01-30 11:40:19 +00:00
Robert Osfield
411431f3be Fixed warnings, updated NEWS 2009-01-30 10:55:28 +00:00
Robert Osfield
6710fbc78a Added support for osgVolume::ProperyAdjustmentCallback 2009-01-29 20:40:56 +00:00
Robert Osfield
51403143bd Added support for osgVolume::Property classes 2009-01-29 20:34:22 +00:00
Robert Osfield
4c75313ced Fixed handling of files with event callbacks on them. 2009-01-29 17:19:47 +00:00
Robert Osfield
04631ff9ae From Jean-Sebastien Guay, added missing windows socket library 2009-01-29 16:38:46 +00:00
Robert Osfield
d277a85537 Updated FindOSG.cmake from the version used by Present3D as this is more up to date. 2009-01-29 15:37:52 +00:00
Robert Osfield
3e8249591b Update ChangeLog 2009-01-29 15:32:43 +00:00
Robert Osfield
16e1ea70a6 Updated news 2009-01-29 15:07:57 +00:00
Robert Osfield
66d77e3ebd Fixed the sumation of the the unique number of primtivesets and vertices in the scene Stats collect 2009-01-29 14:41:18 +00:00
Robert Osfield
4291a8e193 Added CMakeLists.txt for osgcluster 2009-01-29 14:35:15 +00:00
Robert Osfield
7db0ba0bea First cut of NEWS for 2.8 release 2009-01-29 14:00:59 +00:00
Robert Osfield
8e3b5e41c7 Restructed the reporting of the libpath message so that it only appears the first time it's required 2009-01-29 13:29:08 +00:00
Robert Osfield
9b64144a2f Added osgcluster example into build system 2009-01-29 13:17:48 +00:00
Robert Osfield
d62c34efe8 From Jason Daly, "Somehow, one of the shaders in the bsp plugin started behaving incorrectly between the original submission and now. I suspect it has to do with a typo in the setup of the shader that was fixed at some point, or it happened during the recent warnings purge. In any case, I had to invert the usage of a parameter in the shader to make it behave properly again.
The vtf plugin wasn't working in Windows due to OS differences in the byte-packing of the header structure (on Windows, the big block read was causing a buffer overrun).  I fixed this by reading the structure from the file field by field.  It's now happy on both Linux and Windows."
2009-01-29 11:18:03 +00:00
Robert Osfield
2bf68cab53 Fixed warning 2009-01-29 11:03:38 +00:00
Robert Osfield
d44b4d21b9 Revised the message about install path. 2009-01-29 10:43:11 +00:00
Robert Osfield
2014d6162c Added missing entry in build for AnimationManager.cpp 2009-01-29 10:22:52 +00:00
Robert Osfield
be179b481d Improved the handling of toggling of GL_LIGHTi modes when SceneView::setLightingMode() is toggled on/off. 2009-01-29 09:28:08 +00:00
Robert Osfield
5ac339d7b2 Replaced -1 with ~0u to fix warning due to being written to a UInt field. Note, OpenFlight spec says -1, which is clearly an error in the spec, so we've had to guess at ~0u being an appropriate value. 2009-01-29 09:27:23 +00:00
Robert Osfield
e5680b2b4f Removed now redundent shader files.
Fixed the adding of  transfer function property.
2009-01-29 09:24:45 +00:00
Robert Osfield
8c134750e6 Removed old shader files 2009-01-28 16:48:10 +00:00
Robert Osfield
f9855c35ec Removed comments. 2009-01-28 16:44:46 +00:00
Robert Osfield
4004b37ee8 Updated wrappers 2009-01-28 15:23:18 +00:00
Robert Osfield
ac264a4a0c Moved push/popCulling set it public scope. 2009-01-28 15:15:19 +00:00
Robert Osfield
ef9987559e From Paul Melis, "1) Changes the order of the camera stats slightly, to be more in line with
the view stats
2) Uses a slightly smaller block for view statistics"
2009-01-28 13:45:04 +00:00
Robert Osfield
89d9da4fbe From Mathias Froehlich, fixed typo. 2009-01-28 12:55:38 +00:00
Robert Osfield
ca1f1e5abe Fixed warnings 2009-01-28 12:51:47 +00:00
Robert Osfield
d85759c61c Fixed of warnings 2009-01-28 12:45:05 +00:00
Robert Osfield
065b1d4978 Fixed warnings 2009-01-28 12:28:04 +00:00
Robert Osfield
b328758058 Temporarily disabled VS warning C4100 to enable use to home in on the useful warnings that could do with resolving. 2009-01-28 12:02:35 +00:00
Robert Osfield
f0a044ee77 From Mathias Froehlich, "I have today built svn trunk on HP-UX and Solaris8.
I had to do two small changes to src/osgWidget/Input.cpp and
src/osgAnimation/Animation.cpp mainly because of name lookup problems.
"
2009-01-28 11:59:06 +00:00
Robert Osfield
84f300fdaf From Lionel Lagarde, removed accounting of local to world transform on the force vector as the particle velocity should already been in world coords. Fixing this addresses a bug where particles accelerated out of the scene rather than slowing down. 2009-01-28 11:16:29 +00:00
Robert Osfield
789c35381d Added check against existing of a valid Stats object in ViewerBase::renderinTraverls() to prevent crash.
Added default View Stats into src/osgViewer/View.cpp to enable stats to be collected for views
2009-01-28 10:06:15 +00:00
Robert Osfield
75cd471254 From Mattias Helsing, "this is a semi-submission based on what you and others have been
talking about in the LIB_POSTFIX thread. It is a bit verbose perhaps
and the message I emit during the make install step flashes by and
gets burried under all "installing..." and/or "up-to-date..."
messages. I have posted on the cmake mail list on ways to do this
better.

The submission adds:
* message to user during configuration that s/he's eventually going o
install to ${CMAKE_INSTALL_PREFIX}lib${LIB_POSTFIX}
* if system has /etc/ld.so.conf.d and it is a dir generates
packaging/ld.so.conf.d/openscenegraph.conf and creates a custom target
for installing it (target must be run explicitly of course). User is
notified of this during configuration (may not be necessary)
* emit a message during installation that libraries are put in
<same-as-above>. This message unfortunately gets emitted to soon for
the user to see it

* I added "COMPONENT libopenscenegraph-dev" to the pkgconfig.pc's
install command
* Moved the section with OSG_CONFIG_HAS_BEEN_RUN_BEFORE as close to
the end of CMakeLists.txt as I dared. This is the intent of this
construct I think."
2009-01-28 09:42:21 +00:00
Robert Osfield
2b45fd1510 From Paul Melis, "Here is an updated osgViewer::StatsHandler. It has the following changes:
- The text and dark background rectangles are now correctly placed, and
slightly resized here and there.
- All counters (vertices, etc) now use a fixed formatting with 0 digits
precision, to prevent the text from being shown in scientific notation
when the number get large (e.g. 6.34344e+6). I tested with a scene
containing roughly 4 million vertices, to make sure its stats would
display correctly.

I also made slight changes to osgcompositeviewer (attached) to aid in
testing the stats display, specifically displaying of camera and view
names."
2009-01-28 09:31:43 +00:00
Robert Osfield
baa25411fd From Paul Melis, remove redundent spaces 2009-01-28 09:26:44 +00:00
Robert Osfield
49fbc56587 From Paul Melis, removed redundent spacing. 2009-01-28 09:24:06 +00:00
Robert Osfield
d2d89498ad Fixed the handling of setLightingMode and inheritCullSettings so that it properly manages the GL_LIGHTING mode 2009-01-28 09:23:26 +00:00
Robert Osfield
a51e95222d From Patrick Hartling, "I encountered a bug related to RTTI for subclasses of osg::Shape. The
circumstances under which this bug occur are rather specific, but the
basic problem occurs when one translation unit other than libosg.so
constructs an object that is a subclass of osg::Shape and another
translation unit other than libosg.so tries to perform a dynamic_cast or
other RTTI-based operation on that object. Under these circumstances,
the RTTI operation will fail. In my case, the translation units involved
were an application and osgdb_ive.so. The application constructed a
scene graph that included instantiations of subclasses of osg::Shape.
Depending on how the user ran the application, it would write the scene
graph to an IVE file using osgDB::writeNodeFile(). The dynamic_cast
operations in DataOutputStream::writeShape() would fail on the first
subclass of osg::Shape that was encountered. This is because there were
two different RTTI data objects for all osg::Shape subclasses being
compared: one in the application and one in osgdb_ive.so.

The fix for this is simple. We must ensure that at least one member
function of each of the subclasses of the polymorphic type osg::Shape is
compiled into libosg.so so that there is exactly one RTTI object for
that type in libosg.so. Then, all code linking against libosg.so will
use that single RTTI object. The following message from a list archive
sort of explains the issue and the solution:

  http://aspn.activestate.com/ASPN/Mail/Message/1688156

While the posting has to do with Boost.Python, the problem applies to
C++ libraries in general."
2009-01-28 09:21:46 +00:00
Robert Osfield
998582e945 Added back in intializers for RenderSurface. 2009-01-28 09:06:46 +00:00
Robert Osfield
e02ef22062 Removed .pc files as they are now automatically generated with the correct values by Cmake from the openthreads.pc.in and openscenegraph.pc.in files. 2009-01-27 15:35:51 +00:00
Robert Osfield
c898bc0ce7 From Alberto Luaces, "I have modified CMakeLists.txt in order to make CMake fill the existent
openscenegraph.pc and openthreads.pc files with OSG's installation values.
Then I install those files into the expected path for pkg-config (this can
also be modified through PKG_CONFIG_PATH environment variable). Therefore
those of us who are using pkg-config for linking can easily select which
version of OSG we want to use."
2009-01-27 15:34:57 +00:00
Robert Osfield
0308a2005e From Alberto Luaces, "I have modified CMakeLists.txt in order to make CMake fill the existent
openscenegraph.pc and openthreads.pc files with OSG's installation values.
Then I install those files into the expected path for pkg-config (this can
also be modified through PKG_CONFIG_PATH environment variable). Therefore
those of us who are using pkg-config for linking can easily select which
version of OSG we want to use."
2009-01-27 15:34:28 +00:00
Robert Osfield
a7b057feee From Jason Beverage, "Here is a small fix that enables writing 16 bit short images in the tiff plugin.
"
2009-01-27 15:14:47 +00:00
Robert Osfield
c7744b15a3 Converted viewer camera references to use observer_ptr<> rather than ref_ptr<> or C pointers to avoid issues with circular references/dangling pointers. 2009-01-27 14:11:37 +00:00
Robert Osfield
29157f24d9 Refactored the view stats. 2009-01-27 13:23:20 +00:00
Robert Osfield
1787efc9a3 Commented out debug message 2009-01-27 09:09:48 +00:00
Robert Osfield
48f683ec3f Ported onscreen camera stats across to using thread safe stats collection 2009-01-26 21:23:09 +00:00
Robert Osfield
eb17751edd Added passing of command line args to cmake 2009-01-26 19:22:27 +00:00
Robert Osfield
c7bf776bcb Converted across to using ref_ptr<> to avoid memory leak/dangling pointer issues. 2009-01-26 16:55:53 +00:00
Robert Osfield
69f9377093 Fixed effective leak in Program::PerContextProgram caused by previously osg::State keeping a set of std::ref_ptr<Program::PerContextProgram> without ever pruning this list.
The fix was to convert the osg::State to use C pointers for the set of applied PerContexProgram objects, and use the osg::Oberver mechanism to avoid dangling pointers for being maintained in osg::State.
2009-01-26 15:16:24 +00:00
Robert Osfield
55a0381687 Moved the XRANDR include into LIB_PRIVATE_HEADERS to avoid FreeBSD build problem 2009-01-26 13:48:50 +00:00
Robert Osfield
f623f6e83f Updated wrappers 2009-01-26 10:52:16 +00:00
Robert Osfield
6b48e4b1ea From Rick Appleton, "In DatabasePager.cpp I believe there's a copy-paste ommission. A little bit further down the file where the Drawables are compiled the code is similar to how I have fixed the code here for the StateSets. If the DatabasePager thread is supposed to pre-compile things, it will call the compileGLObjects such that compileAll will be true. However, when compiling StateSets compileAll isn't currently checked." 2009-01-26 10:35:16 +00:00
Robert Osfield
2d9097bb26 Changed META_NodeVisitor usage to META_Object as it's more appropriate. 2009-01-24 10:02:32 +00:00
Robert Osfield
e4b2562f7b From Stephan Huber, "OS X failed to compile AnimationManager because of
the useage of META_Node-macro, but AnimationManager is inherited from
NodeVisitor, so I changed the Macro to META_NodeVisitor"
2009-01-24 10:00:23 +00:00
Stephan Maximilian HUBER
85d993cdef From Stephan Huber: updated XCode project 2009-01-23 23:04:18 +00:00
Robert Osfield
88ce4a3786 From Roland Smeenk, "attached is a small crash fix for the case that a texture is used for transparency without the availability of a diffuse texture." 2009-01-23 15:52:10 +00:00
Robert Osfield
e0c279bf3d Added forward declaration of callbacks to headers to avoid scoping issues of classes with same names. 2009-01-23 15:50:05 +00:00
Robert Osfield
7b598c5701 Warning fixes for VS, and removal of associated warning disables 2009-01-23 15:12:26 +00:00
Robert Osfield
aa8402ce81 Added workaround for silly posix read deprecation warning under VS. 2009-01-23 15:02:04 +00:00
Robert Osfield
4161762cff Removed unneccesary warning disables 2009-01-23 14:00:49 +00:00
Robert Osfield
1fe0f0c0d6 Added range of visual rendering properties to readNode's creation of VolumeTile/ImageLayer. 2009-01-23 11:52:18 +00:00
Robert Osfield
b36f7e1fe7 From Mattias Froehlich, "To pass the Microsoft application verifier we have tried to get osgviewer
working with that thing.
This is what was missing so far:

Make win32 threads behave like the posix implementation when setting thread
cpu affinity. That includes avoid setting thread affininty on a non running
thread. Set that once it is running."
2009-01-23 10:29:09 +00:00
Robert Osfield
c17d85c241 From Lionel Lagarde, "here is a correction on
osgVolume/Property
  added OSGVOLUME_EXPORT to PropertyAdjustmentCallback

osgVolume/VolumeTile.cpp
  in copy constructor, removed ';' on if (volumeTile.getVolumeTechnique())"
2009-01-23 09:24:34 +00:00
Robert Osfield
33db349781 Upped notification level of timing stats 2009-01-23 09:22:31 +00:00
Robert Osfield
2e7ef9ed62 Updated wrappers 2009-01-21 19:28:46 +00:00
Robert Osfield
55e89e4466 From Cedric Pinson, "updated osgAnimation with the trunk here the update:
examples/osganimationviewer/AnimtkViewer.cpp:
- add option to display bone (--drawbone)
- dont crash if the file does not contains a AnimationManagerBase, display the content only

examples/osganimationviewer/AnimtkViewerGUI.cpp:
- adjust the path of image for the gui

include/osgAnimation/Interpolator:
- add warn message instead of old assert

include/osgAnimation/Bone:
src/osgAnimation/Skeleton.cpp:
- change a method name to fit better with what it does. setMatrixInSkeletonSpace instead of setBoneInSkeletonSpace

include/osgAnimation/Skinning:
src/osgAnimation/RigGeometry.cpp:
- add patch from Fabien Lavignotte to compute normal correctly

include/osgAnimation/Sampler:
- adjust behviour without assert, return 0 instead of crashing
"
2009-01-21 19:02:54 +00:00
Robert Osfield
d542961ca3 Fixed compile errors for when ref_ptr<> auto conversion is disabled 2009-01-21 19:01:26 +00:00
Robert Osfield
99313d225b From Roger James, The changes are as follows:-
1. Support for ambient occlusion maps.
2. A fix for the incorrect handling of normals on all geometries. The optimizer usually fixed this bug so it probably was not noticed very often.
3. A new option flag on the reader. "StrictTransparency"
          // Process transparent and transparency settings according to a strict interpretation of the spec
          // See https://collada.org/public_forum/viewtopic.php?f=12&t=1210
otherwise
          // Jump through various hoops to accomodate the multiplicity of different ways
          // that various people have interpreted the specification
4. Handling of texures in the transparent channel. This is allowed provided that they are the same texture that is specified in the diffuse channel. Accomodating a different texture would require use of programmable pipeline functionality which I have tried to avoid.
5. Handling of <bind_vertex_input> elements.
""
2009-01-21 18:47:55 +00:00
Robert Osfield
a3b91f9294 From Mattias Helsing, "got some feedback from J-S on the packaging so I have changed the
name of the top folder in each package to OpenSceneGraph-x.y.z

Noone else has had an opinion on whether compiler and it's version
should be part of the package filename on their platform/setup so I'll
leave it as is. That is - No action is taken for compilers other than
msvc but one can easily add this information to the cmake cache
regardless of platform.
"
2009-01-21 18:34:10 +00:00
Robert Osfield
908432c732 Replaced readImageFile() usage with readRefImageFile() to prevent threading issues with caching of imagery in the osgDB::Registry cache. 2009-01-21 18:23:55 +00:00
Robert Osfield
e17535813f From Jason Beverage, "I realized today that there is an issue with the Registry changes I submitted to allow plugins to have the first go at URLs.
The code works fine as is if the format plugin is not already loaded in memory.

If a plugin is already in memory, say the PNG plugin for example, then a call to readImageFile("http://server.com/image.png") will return FILE_NOT_FOUND because osgDB::findDataFile will not be able to locate the file.  So the Registry::read method is returning before the CURL plugin is given a chance to download the file.

I've made a few changes to the Registry to not return FILE_NOT_FOUND if the filename contains a URL that fix the issue."
2009-01-21 17:10:51 +00:00
Robert Osfield
39fc490a64 From Sherman Wilcox, "Minor change to the glPushAttrib(...) call in
renderWithStencilBuffer(...)  - added GL_STENCIL_BUFFER_BIT"
2009-01-21 14:37:36 +00:00
Robert Osfield
a6284b0e03 Renamed ShaderTechnique to RayTracedTechnique 2009-01-21 14:27:58 +00:00
Robert Osfield
0897368fa6 Cleaned up osgvolume 2009-01-21 12:06:13 +00:00
Robert Osfield
1c88753551 Introduced the ability to switch between different visual properties in osgVolume 2009-01-21 11:46:03 +00:00
Robert Osfield
f23f2c351f Updated wrappers 2009-01-20 17:53:06 +00:00
Robert Osfield
a40aa3a734 Moved PropertyAdjustmentCallback from osgvolume.cpp into osgVolume.
Updated lighting shaders.
2009-01-20 17:41:45 +00:00
Robert Osfield
0739b09519 Removed redundent shader files 2009-01-20 15:30:30 +00:00
Robert Osfield
bda89b113e Added lighting based shaders 2009-01-20 15:29:32 +00:00
Robert Osfield
fe667cdd2b Added event key variables 2009-01-20 15:06:44 +00:00
Robert Osfield
d46e0fcc79 Added support for SampleDensityProperty and TransparencyProperty 2009-01-20 13:50:57 +00:00
Robert Osfield
87cd4530f5 Added AlphaFunc support into osgVolume::AlphaFuncProperty. 2009-01-20 12:39:26 +00:00
Robert Osfield
8a971d96d2 Fixed compile error when using ITK 2009-01-20 11:34:15 +00:00
Robert Osfield
894b161878 Updated event callback to be able to update iso surface value. 2009-01-17 17:23:47 +00:00
Robert Osfield
71ee1a7047 Updated Uniform name for controlling IsoSurfaceValue 2009-01-17 17:23:17 +00:00
Robert Osfield
069d86ae8b Updated wrappers 2009-01-17 16:00:39 +00:00
Robert Osfield
b176c3a223 Removed old volume rendering scene graph code from osgvolume example.
Moved createNormalMapTexture and applyTransferFunction functions from osgvolume example into include/osgVolume/Layer.
2009-01-16 17:59:38 +00:00
Robert Osfield
9d4b44f956 Completed firt pass implementation FixedFunction and ShaderTechnique. 2009-01-16 16:21:54 +00:00
Robert Osfield
29ac92df0e Moved basics of fixed function pipeline implementation from osgvolume example into osgVolume 2009-01-16 11:27:20 +00:00
Robert Osfield
5e629d1236 Added default use of osgVolume::ShaderTechnique 2009-01-16 10:34:58 +00:00
Robert Osfield
78c2f98b7a Introduced ImageLayer computeMinMax + rescaling methods, and use of rescaleToZeroToOneRange by default. 2009-01-16 10:23:17 +00:00
Robert Osfield
ba94ea8c7d Introduce osgVolume::PropertVisitor, and IsoSurface, MaximumImageProjection, Ligting and AlphaFunc Properties 2009-01-15 15:57:04 +00:00
Robert Osfield
3be239bdb2 Removal of rendundant characters from Camera and Camera.cpp.
Updated wrappers
2009-01-15 10:44:52 +00:00
Robert Osfield
2f7fb53ff7 From Rudolf Wiedemann, "attached is the osg::Camera class (based on revision 9493), where
methods
 getProjectionMatrixAsOrtho()
 getProjectionMatrixAsFrustum()
 getProjectionMatrixAsPerspective()
 getViewMatrixAsLookAt() (2x)
are now const, as they only call const methods of osg::Matrixf/d.
"
2009-01-15 10:36:04 +00:00
Robert Osfield
c28221b06f Changed setVolumeTechnique to setVolumeTechniquePrototype() 2009-01-14 20:43:21 +00:00
Robert Osfield
778f4e321d Added VolumeTechnique to Volume 2009-01-14 20:38:12 +00:00
Robert Osfield
1a00a2ce3c Added osgVolume .osg plugin 2009-01-14 20:32:06 +00:00
Robert Osfield
d87ec7cb18 Introduced osgVolume::Property, CompositePropery and TransferFunctionPropety classes 2009-01-14 15:16:29 +00:00
Robert Osfield
c21eef7afb From Lionel Lagarde, "The last field of the LightPointAppearancePalette is only valid for > 15.8 version of
the format."
2009-01-14 10:32:20 +00:00
Robert Osfield
2efce3965a Integrated state setup code from osgvolume.cpp example into ShaderTechnique path. 2009-01-13 17:51:45 +00:00
Robert Osfield
f260737cd8 Introduced class interfaces for FixedFunctionTechnique and ShaderTechnique volume rendering techniques. 2009-01-13 17:20:32 +00:00
Robert Osfield
7bcdaa74bf Added ZLIB_FOUND to dicom qualification 2009-01-13 10:15:04 +00:00
Robert Osfield
6a19b04d22 Added a / in front of the ${DCMTK_ROOT_INCLUDE_DIR} to workaround a CMake bug that ignores /usr/local/include directories.
Added ZLIB to include line.
2009-01-13 10:12:13 +00:00
Robert Osfield
53d99109bd Added test message 2009-01-12 17:41:25 +00:00
Robert Osfield
12a484593c Further tweak to include paths 2009-01-12 16:37:38 +00:00
Robert Osfield
ded06dc421 Restructured the include paths 2009-01-12 16:10:40 +00:00
Robert Osfield
c2e7eacc06 Changed to use ref_ptr<> for scene model to avoid crash 2009-01-12 13:12:04 +00:00
Robert Osfield
ef1d205a2e From Mattias Helsing, "'ve finally finished the rework of the packaging support. It is
streamlined for tgz and has most of the features that Robert, J-S and
Sukender requested in december. I have an idea of how to discover the
vc80 sp1 or not but haven't had time to implement. The script is
completely reworked and now doesn't include cmakes' bundled
CPack.cmake script at all. In summary:

* filenames are
<package>-<osgversion>-<platform>-<arch>[-compiler]-<configuration>.tar.gz,
ex. libopenscenegraph-2.7.9-Linux-i386-Release.tar.gz,
libopenthreads-dev-2.7.9-win32-x86-vc80sp1-Debug.tar.gz

* targets (projects in msvs) are generated for each specified
component, a target that packages everything that is installed
(openscenegraph-all) and there's a target for running all other
packaging targets (Package ALL on msvs, package_ALL in unix
makefiles).

* It is possible to set the compiler in ccmake (cmake-gui, whatever you use)

* the top folder in packages is the same for all packages (OpenSceneGraph-x.y)

* the packaging support is limited with cmake-2.6.0 and not as
dynamic. With cmake-2.6.1 and later building the gdal plugin (for
example) will create a package_libopenscenegraph-gdal target. With
cmake-2.6.0 only the ones that are always built (libopenscenegraph,
libopenscenegraph-dev, openscenegraph, libopenthreads,
libopenthreads-dev

* i found a better way to decide whether cpack is available to guard
the BUiLD_OSG_PACKAGES option"
2009-01-12 11:34:03 +00:00
Robert Osfield
6904a5eda6 From Mattias Helsing, "Following reports by Alberto and Simon this submission reenables usage
of cmake-2.6.0. As a side note I just installed cmake from the ubuntu
repositories and got cmake-2.6.0-4ubuntu2 and this one produced the
currect CMAKE_CXX_FLAGS_RELEASE (-O3 -DNDEBUG).  This CMakeLists is
tested on linux with cmake versions 2.4.8, 2.6.0, 2.6.2 and
2.6.0-4ubuntu2

* Added quotes around CMAKE_CXX_FLAGS var to help cmake-2.6.0 pick up
that it really is a string value

* Removed quotes around values that we set in
OSG_AGGRESIVE_WARNING_FLAGS. This makes OSG_AGGRESIVE_WARING_FLAGS be
of LIST type so the foreach constructs can behave as I planned."
2009-01-09 19:53:28 +00:00
Robert Osfield
e37d22ad27 Fixed warning 2009-01-09 15:57:14 +00:00
Robert Osfield
b5a2dc4cfb Fixed warnings 2009-01-09 15:55:25 +00:00
Robert Osfield
2287f1190b Updated version number for next dev release 2009-01-09 15:25:34 +00:00
Robert Osfield
458993fa88 Moved osgVolume::ImageUtils to osg::ImageUtils, updated wrappers, and started moving osgvolume example across to create osgVolume subgraphs 2009-01-09 15:19:25 +00:00
Robert Osfield
9b4c6e25ea Fix of warning reported on CDash 2009-01-09 15:11:15 +00:00
Robert Osfield
1def3b3512 Fixed warnings reported on CDash 2009-01-09 15:09:39 +00:00
Robert Osfield
1289528770 From Roland Smeenk, "Attached is a fix for the Collada plugin. A PositionAttitudeTransform wrote its place elements in the wrong order." 2009-01-09 12:21:36 +00:00
Robert Osfield
fa499dc55f From Andy Skinner, fixes for Solaris build 2009-01-09 12:17:40 +00:00
Robert Osfield
c380ac5a1f From Cedric Pinson, "Here the updated osganimationskinning.cpp that works as before" 2009-01-08 14:52:11 +00:00
Robert Osfield
803d0dc60c Added missing *. 2009-01-08 12:47:20 +00:00
Robert Osfield
a5ebf338ac Commented out the warning disabling block 2009-01-08 11:35:57 +00:00
Robert Osfield
edd11bac2d From Mattias Helsing, added back in missing wd entries. 2009-01-08 11:28:04 +00:00
Robert Osfield
df8dbd9c81 From Mattias Helsing, "With msvc90 on vista and cmake-2.6.2 i had to rearrange the blocks
that set aggressive warnings in CMAKE_CXX_FLAGS and the on that
processes the source tree(s) or the newly set flags wouldn't take
effect until second consecutive configure.

I also replaced the internally cached variables that managed the
aggresive warnings with explicit adding and removing of flags in
CXX_FLAGS

For apple we first required min cmake version 2.6.0 and then had code
warning about using 2.4.x"
2009-01-08 11:26:16 +00:00
Robert Osfield
3b192f5119 Added checked from the ARG version of glDraw*Instanced(). 2009-01-08 11:19:21 +00:00
Robert Osfield
8418e3cb40 Removed inappropriate file 2009-01-08 11:18:54 +00:00
Robert Osfield
95ebf1fe71 From Andy Skinner, "I added a const_cast for a call to atomic_cas_ptr, which takes a void* and has been given a const void* const." 2009-01-08 11:16:56 +00:00
Robert Osfield
5275c11d06 From Blasius Czink, "It seems there is no atomic_xor_uint_nv(). I
attached a changed version of the Atomic header where a mutex fallback
is used for "xor" on solaris."
2009-01-08 11:15:14 +00:00
Robert Osfield
46eeac4514 Moved supression of VS warning C4706 from the include/osg/Export header into the CMake options list. Added suppression of C4127 as well. 2009-01-08 10:34:05 +00:00
Robert Osfield
fb75c50714 Fixed assingment operator 2009-01-07 15:35:28 +00:00
Robert Osfield
4add5f6fd1 Added supression VS warning "C4706: assignment within conditional expression" thanks gets spat out even for perfectly valid if ((variable=expression)) {} usage. 2009-01-07 15:33:24 +00:00
Robert Osfield
b1559ce696 Added handling of when a View isn't yet assigned to a Viewer to avoid associated crash 2009-01-07 14:49:04 +00:00
Robert Osfield
536384457a Updated wrappers 2009-01-07 13:16:38 +00:00
Robert Osfield
6bf59ffae9 Fixed warnings 2009-01-07 12:27:45 +00:00
Robert Osfield
418dc34776 Fixed warnings 2009-01-07 11:24:47 +00:00
Robert Osfield
98bd058317 Fixed warnings 2009-01-07 10:32:59 +00:00
Robert Osfield
85c510ba27 Added a protected = operator 2009-01-07 09:49:49 +00:00
Robert Osfield
8745ec7d69 Removed the usage of assert to prevent associated compile warnings and to clean up code 2009-01-06 19:09:50 +00:00
Robert Osfield
5bf69c9cbb Updated path to reflect where the new button images are located. 2009-01-06 19:08:34 +00:00
Robert Osfield
1d599c0572 From Don Leich, "Here are a couple of fixes for the file examples/osgviewerQT/QOSGWidget.cpp to
address some OS X issues.  Most of these fixes were previously submitted by Julian Scheid.  However, this patch however should not break the example for non-OS X builds and has been tested on 64-bit Linux as well as Mac OS X 10.5.

o  The value returned by QWidget::winId() is not usable as input for
WindowData under OS X the way it is for both Windows and Unix.  Julian's fix
for this uses the Carbon API.  Since the fix for X11 in unknown, it is now
assumed that OSG has been built with OSG_WINDOWING_SYSTEM='Carbon' for this
example to work at all when running under OS X.

o  The CompositeViewer version would hang on exit with the original timer start
argument.  Changing the argument value to match the non-composite version
seemed to cure the hanging.

o  Julian's patch altered the setGeometry position to 30/30 in order to see any
window decorations.  I did not have this problem, but left his changes intact.

o  The non-composite viewer needed it's camera initialization defered until
after the ViewerQOSG's Qt base class had been initialized.  Otherwise, the view
did not cover the entire window.
"
2009-01-06 16:45:35 +00:00
Robert Osfield
dee703a6f3 From Ewe Woesnner, "the Inventor loader crashes when a texture could not be loaded.
Please find attached a small fix which solves this issue."
2009-01-06 16:35:38 +00:00
Robert Osfield
ec457e34c3 From Sergey Leontyev, "Some minor(but important) bug fixes for osgWidget:
1. In WindowManager.cpp childRemoved method the second parameter "end" is misleading and

should be named "numChildren" instead. It represents how many children to remove.  As a result, the method was implemented incorrectly and failed to remove UI objects. So I fixed it.

 

replaced this:

 

void WindowManager::childRemoved(unsigned int start, unsigned int end) {
    while(start < end) {
        Window* window = getByIndex(start);

        if(!window) continue;

        if(_remove(window)) {
            window->_index = -1;

            window->unmanaged(this);
        }

        start++;
    }
}

 

with this:

void WindowManager::childRemoved(unsigned int start, unsigned int numChildren) {
 for (unsigned int i = start; i < start+numChildren; i++)
 {
  Window* window = getByIndex(i);

  if(!window) continue;

  if(_remove(window)) {
   window->_index = -1;

   window->unmanaged(this);
  }
 }
}

 

2. in Input.cpp

 

The cursor in Input did not get positioned correctly, probably as a left over from the TOP LEFT origin system which is now BOTTOM LEFT.

in method positioned()

replaced this:

    _cursor->setOrigin(x + xoffset + 1.0f, y - _cursor->getHeight() + 1.0f);

 

with this:

    _cursor->setOrigin(x + xoffset + 1.0f, y + 1.0f);

 

Now it is placed correctly.

 "
2009-01-06 16:16:03 +00:00
Robert Osfield
5a6a3f1edd Updated wrappers 2009-01-06 15:41:29 +00:00
Robert Osfield
af7bb82175 From Paul Martz, example demonstating new draw instanced primitive funcitonality. 2009-01-06 15:11:54 +00:00
Robert Osfield
4f3b1baee4 Added support for primitive instancing 2009-01-06 14:55:49 +00:00
Robert Osfield
9bd7fa7e6e From Jean-Sebastien Guay, changed VS aggressive warnings setting to just /W4. 2009-01-05 18:07:31 +00:00
Robert Osfield
3ddafa1078 From Don Leich, build fix for OSX. 2009-01-05 17:52:41 +00:00
Robert Osfield
20cb9625ea From Jason Beverage, "I thought about the issue I was having with the CURL plugin automatically trying to download all filenames with URL's rather than passing the full URL to the plugin. It turns out the solution was pretty simple.
I've made a small change to Registry.cpp that puts the CURL logic AFTER the URL has been passed to the plugin rather than assuming all URL's need to be downloaded by the CURL plugin.  This way, plugins can have first crack at the URL's, and if they don't handle it the previous CURL behavior kicks in."
2009-01-05 17:35:26 +00:00
Robert Osfield
910927145e From Paul Martz, added --points option for forcing points rendering of polygonal models 2009-01-05 17:06:09 +00:00
Robert Osfield
85fffc2e76 From Roland Smeenk, "Attached you will find an improved Collada plugin to properly support camera's.
A Collada camera will be added to the scenegraph as osg::CameraView. This allows the user to create a set of predefined camera viewpoints. I also added a new MatrixManipulator to osgGA called CameraViewSwitchManipulator and added usage of this to the osgviewer example. This manipulator allows switching between the predefined camera viewpoints. The current design limition I ran into is that a MatrixManipulator only manipulates the ViewMatrix, but for this particular  manipulator I also want to update the projectionMatrix of the camera when switching to a new viewpoint. This is not implemented because I don't know what would be the best way to design it. Any ideas?
 
Furthermore Collada also supports orthographic camera's, where an osg::CameraView only supports a perspective camera. Would it be useful to create a CameraView with customizable optics for this?"
2009-01-05 16:53:29 +00:00
Robert Osfield
1a600c1178 Updated wrappers 2009-01-05 12:21:58 +00:00
Robert Osfield
375253ae8a From Paul Martz, Correction to Timer method comment. 2009-01-05 11:58:08 +00:00
Robert Osfield
c8752d6c18 From Cedric Pinson, added non const getText() method 2009-01-05 11:31:38 +00:00
Robert Osfield
cedffd3adb Introduced osgVolume::Layer and Locator classes mirrroring similar classes in osgTerrain. 2009-01-05 11:26:26 +00:00
Robert Osfield
788bead9fe Change the aggressive warning level under VS to /W3 2009-01-05 10:13:04 +00:00
Robert Osfield
4f91d9769e Fixed warning 2008-12-24 11:05:22 +00:00
Robert Osfield
1697eb526d Fixed warnings 2008-12-24 10:30:21 +00:00
Robert Osfield
a9602c6906 Made aggressive warnings the default. 2008-12-22 21:17:03 +00:00
Robert Osfield
c0b696ba52 Fixed warnings 2008-12-22 21:16:40 +00:00
Robert Osfield
21b633e73b Build fix 2008-12-22 18:30:52 +00:00
Robert Osfield
0d5194bfd4 From Paul Martz, "Typing "osgconv" alone displays the --help family of options, as it should, but it also displays info about --formats and --plugins, which seems out of place because no other options are mentioned here.
The code changes osgconv so that "osgconv --help" displays help info about --formats and --plugins, plus it also displays documentation for --format and --plugin, which were previously missing."
2008-12-22 08:26:16 +00:00
Robert Osfield
f4c26f9cc8 Changed VolumeTile::setImage(Image*) to setImage(uint i, Image*) to allow multiple images to be attached to single tile 2008-12-21 20:42:29 +00:00
Robert Osfield
adced97dcd From Mattias Helsing, "Replace the IF(POLICY CMP0008) with an absolute version check for
cmake > 2.6.0.
The POLICY keyword is only valid starting with cmake-2.4.7 so using it
broke cmake 2.4.5/6 support."
2008-12-21 20:24:56 +00:00
Robert Osfield
adb7a49c10 Renamed osgVolume::Brick to osgVolume::VolumeTile 2008-12-20 20:55:21 +00:00
Robert Osfield
f0270f934e Changed the scale from 0.03 to 0.0254 as the Q3 bsp files are in inches. 2008-12-20 20:30:08 +00:00
Robert Osfield
28ca8277f8 From Jason Daly, "'ve been busy working on the Source engine plugins. There are several contributions in this submission:
osgDB/FileUtils.cpp:
Needed this extra code to allow a true case-insensitive search.  This is because the HL2 map and model files are often sloppy with case.  For example, the file might look for materials/models/alyx/alyx_sheet.vtf, but the file is actually in materials/Models/Alyx/alyx_sheet.vtf.  In case-insensitive mode, the new code recursively disassembles the path and checks each path element without regard to case.  In case-sensitive mode, the code behaves exactly as it used to.  The new code is also mostly skipped on Windows because of the case-insensitive file system.  Previously, I did all of this with custom search code in the .bsp plugin, but this allows the user to tailor the search using OSGFILEPATH.  There are some instructions in the plugins' README files about this.

osgPlugins/mdl:
This is a new plug-in for Half-Life 2 models (as opposed to maps).  This allows you to load Source models individually, as well as allowing the .bsp plugin to load models (props) that are embedded into maps.  Mdl files can contain simple object (crates, barrels, bottles), as well as fully articulated characters with skeletal animations.  Currently, it can load the simple objects.  It can also load the characters, but it can't load the skeletons or animations.

osgPlugins/bsp:
This contains all of the changes needed to load props along with the basic map geometry.  There are also
several bugs fixed.

osgPlugins/vtf:
This is the loader for Valve's texture format.  Previously, we had agreed to put this in with the bsp plugin, but I didn't think of the .mdl plugin at that time.  It's conceivable that a user might want to load models individually (not as part of a map), so the vtf reader does have to be separate.  I also fixed a rather significant bug.

I tested all of this code on RHEL 5.2 (32-bit), and Fedora 9 (64-bit).  I'll be testing on Windows soon.

I also attached a simple .mdl file, along with it's associated files and textures.  Just extract the tarball into it's own directory, set your OSGFILEPATH to point at that directory, and load the model like this:

 osgviewer models/props_junk/gascan001a.mdl"
2008-12-20 13:35:49 +00:00
Robert Osfield
05cb054140 Added OPTIONAL into INCLUDE(FindPkgConfig) 2008-12-20 12:52:16 +00:00
Robert Osfield
03285f5fe1 Updated ChangeLog for 2.7.8 dev release 2008-12-19 19:04:45 +00:00
Robert Osfield
ddc221ecc7 Added osgversion into dynamic build path 2008-12-19 18:37:23 +00:00
Robert Osfield
ad01f19db8 Removed debug message 2008-12-19 18:02:18 +00:00
Robert Osfield
2cc53e2256 Moved main setSceneData methods in osgViewer::View::setSceneData() 2008-12-19 17:50:58 +00:00
Robert Osfield
de53ed75f4 Updated wrappers 2008-12-19 17:15:56 +00:00
Robert Osfield
502eced994 From Jean-Sebastein Guay, I recently had to reimplement screen capture functionality into our framework (which was broken since the switch from OSG 1.2 to 2.2 over a year and a half ago). I used the ScreenCaptureHandler which I had contributed right before OSG 2.6 shipped, bit I had to trigger the screen capture programatically instead of by a key press in some cases, so I added a convenience method to do that.
It's a minimal change, it just calls an already existing protected method. It was trivial to subclass the handler to do it in our code, but pushing the change into OSG makes sense as it's generally useful to have it in the handler itself.

I also noticed that the handle() method was overridden from osgGA::GUIEventHandler but wasn't marked virtual. It wasn't intended that subclasses not be able to override it in turn, so I've added the keyword.""
2008-12-19 17:15:10 +00:00
Robert Osfield
767096631a Fixed warning 2008-12-19 16:59:10 +00:00
Robert Osfield
df0f01c828 Fixed compile error during debug build 2008-12-19 16:35:45 +00:00
Robert Osfield
02beb8c74a Added support for user defined clipping of the precipitation effect, to test use:
osgpreciptation lz.osg --clip 20
2008-12-19 16:13:19 +00:00
Robert Osfield
aabf60c8e5 Added setting of the gl_ClipVertex to enable clip planes to affect preciptation 2008-12-19 16:12:40 +00:00
Robert Osfield
0ea6cdeb96 Added ClipNode::set/getReferenceFrame(); 2008-12-19 15:29:59 +00:00
Robert Osfield
f4fe462b28 Removed MATH_LIBRARY and FREETYPE library reference. 2008-12-19 14:30:03 +00:00
Robert Osfield
8951acabb7 Fixed warning & error 2008-12-19 12:58:50 +00:00
Robert Osfield
4324e9a915 Reverted previous check-in to osgviewer.cpp as this was an accididental check-in with the code only in testing state, not appropriate to be checked-in. 2008-12-19 12:50:33 +00:00
Robert Osfield
c862344929 Fixed warning 2008-12-19 12:46:21 +00:00
Robert Osfield
840b926ca7 Fixed warning 2008-12-19 12:29:18 +00:00
Robert Osfield
74d090845f Added StandardShadowMap to list to test cases 2008-12-19 12:28:53 +00:00
Robert Osfield
75bd8e9a1e Updated wrappers 2008-12-19 11:36:26 +00:00
Robert Osfield
ef47733ea1 From Mattias Helsing, "
* Removed processing of include/OpenThreads in the OpenSceneGraph refman
* Clears the mark_as_advanced property of the BUILD_DOCUMENTATION
cmake variable (so it gets visible in simple view).
"
2008-12-19 11:04:35 +00:00
Robert Osfield
4c6511fd50 Updated wrappers 2008-12-19 10:20:23 +00:00
Robert Osfield
a4174763f8 Fixed typo 2008-12-18 17:40:13 +00:00
Robert Osfield
3327b6a621 From Bob Kuehne, "minor tweak to the cmake root file to handle debug correctly on os x." 2008-12-18 17:09:12 +00:00
Robert Osfield
b43c467d30 Refactored the handling of particle rotation 2008-12-18 17:01:21 +00:00
Robert Osfield
1b942fed64 Fixed warnings 2008-12-18 16:10:12 +00:00
Robert Osfield
6055dee411 Fixed warnings 2008-12-18 15:49:44 +00:00
Robert Osfield
4de4375fce Added MATH_LIBRARY to link list 2008-12-18 14:18:22 +00:00
Robert Osfield
9b1445d5b9 Fixed warnings 2008-12-18 13:56:30 +00:00
Robert Osfield
9d2b1b539c Fixed warnings 2008-12-18 13:23:48 +00:00
Robert Osfield
1d4a0e767c Fixed warning 2008-12-18 12:29:17 +00:00
Robert Osfield
bc6a7b03ab Quitened down debug messages 2008-12-18 12:27:34 +00:00
Robert Osfield
215cd5f29b Fixed warnings 2008-12-18 12:26:14 +00:00
Robert Osfield
de17dad958 Quitened down debug message 2008-12-18 12:25:51 +00:00
Robert Osfield
666a55c0a0 Fixed warnings 2008-12-18 11:54:34 +00:00
Robert Osfield
4ad20a413a Fixed warnings 2008-12-18 11:06:57 +00:00
Robert Osfield
1cd6541bfd Improved the effectiveness of the new max target number PageLOD's 2008-12-17 22:52:36 +00:00
Robert Osfield
f8151127e3 From J.P Delport, "I changed the default HDR mode to the ARB format and put in comments for some other possible modes.
Some other comment cleanups too."
2008-12-17 17:23:17 +00:00
Robert Osfield
288e1853b9 Fixed warnings 2008-12-17 17:11:13 +00:00
Robert Osfield
c01ed02147 Fixed inactive PagedLOD removal code 2008-12-17 16:58:23 +00:00
Robert Osfield
2225339208 Fixed warnings 2008-12-17 16:13:23 +00:00
Robert Osfield
4f561d84b3 Fixed warnings 2008-12-17 16:02:42 +00:00
Robert Osfield
34eab50197 Fixed warnings 2008-12-17 15:36:59 +00:00
Robert Osfield
c85437e967 Fixed warnings 2008-12-17 15:32:35 +00:00
Robert Osfield
33545ab332 Fixed warnings 2008-12-17 14:56:40 +00:00
Robert Osfield
26c57f125d Warning fixes 2008-12-17 13:14:17 +00:00
Robert Osfield
8a6e04b84d Introduce NodeVisitor::className and libraryName() 2008-12-17 12:13:15 +00:00
Robert Osfield
a5c32da4ff Warning fixes 2008-12-17 11:00:16 +00:00
Robert Osfield
e754fc5aab From Sekender, fixed warnins 2008-12-17 10:34:09 +00:00
Robert Osfield
ca3e855b9c Fixed warnings 2008-12-17 10:33:39 +00:00
Robert Osfield
d01fc6ab1b From Jean-Sebastien Guay, added missing export 2008-12-17 10:01:52 +00:00
Robert Osfield
e7d8a2cfe6 Updated wrappers 2008-12-16 21:16:06 +00:00
Robert Osfield
ffe77a785a Build fixes for when the implict ref_ptr<> cast is not enabled 2008-12-16 20:49:12 +00:00
Robert Osfield
60fc821764 From Cedric Pinson and Jeremey Moles, Changes to OpenSceneGraph-osgWidget-dev branch.
Notes from Robert Osfield, Merged changes to OpenSceneGraph-osgWidget-dev r9367 (prior to my botched attempt at merged svn/trunk into the branch).
2008-12-16 20:29:00 +00:00
Robert Osfield
3313327ab4 From Bob Kuehne, build fixes. 2008-12-16 19:49:09 +00:00
Robert Osfield
bd4b6e9b8c Updated version numbers for 2.8.8 dev release 2008-12-16 16:36:33 +00:00
Robert Osfield
6458db7765 Updated wrappers 2008-12-16 15:58:42 +00:00
Robert Osfield
f8ada4953d From Mathias Froehilch, "
On OpenThreads win32 implementation we unconditionally unlock a mutex in the
destructor. That happens even if the mutex was not locked before.
When running a osg application within microsofts application verifier, that
software checks tells me that we should not unlock an unlocked mutex.

When I look at the posix threads mutex implementation, which does no unlock in
the destructor and where it is illegal to destroy a locked mutex, I conclude
that it is not needed for an OpenThreads::Mutex to do that unlock in the
win32 Mutex destructor.

Thus this patch based on rev 9358 removes that additional unlock in the win32
mutex implementations destructor."
2008-12-16 15:21:17 +00:00
Robert Osfield
4511281f04 From Sukender and Robert Osfield, introduced GraphicsContext::ScreenSettings & WindowingSystemInterface::enumerateScreenSettings. 2008-12-16 15:08:04 +00:00
Robert Osfield
aad0a2a2ba From Peter Hrenka, "Fix counting number of new arrays and avoid
building free-list when not needed (saves
a handfull of mallocs/frees).
"
2008-12-16 12:38:10 +00:00
Robert Osfield
f63d33c003 Fixed warnings 2008-12-16 12:23:30 +00:00
Robert Osfield
de1031b264 Fixed warnings 2008-12-16 12:20:19 +00:00
Robert Osfield
c7b6dd9a18 From Mattias Helsing,"Added doc/Doxyfiles/openthreads.doxyfile.cmake
Updated all doxyfiles under doc/Doxyfiles. They are now all processed
by cmake but make targets are only generated for
OpenSceneGraphReferenceDocs and OpenThreadsReferenceDocs. The others
can be run with doxygen directly in <builddir>/doc.
Fixed a copy-paste in openthreads sproc and pthreads CMakeLists
Added the osg logo to the html footers
Added possibility to get generation of chm files.

CMakeLists (toplevel):
Added install of osg and ot reference docs. This also generates
packaging targets of openscenegraph-doc and openthreads-doc if you
have packaging enabled
Removed the unused USING_OP_OT_TRIPLE_SET since there was no way of
enabling it anyway
Removed BUILD_REF_DOCS. IMO it was redundant - BUILD_DOCUMENTATION
does the same thing and we get that anyway from including
Documentation.cmake.
OsgCPack.cmake:
Removed generation of PACKAGE_SRC for msvc
Added special handling for -doc packaging targets - they don't require
system, architecture or compiler"
2008-12-16 11:43:28 +00:00
Robert Osfield
3ce53b56c7 Added support for a Terrain::s/getTerrainTechniquePrototype() 2008-12-15 22:18:40 +00:00
Robert Osfield
8e49efd496 From Tatsuhiro Nishioka, "I found a bug in GraphicsWindowCarbon.
GraphicsWindowCarbon::requestWarpPointer() places the mouse pointer in a (global?) display coordination, but it must be in a local window coordination. This problem is critical because the mouse cursor can go off a window especially when you place the window on the secondary screen.

Attached is the file to fix this problem.

I tested this modified file with the following situations (on FlightGear) and all works fine.
- two windows on two screens (each has one window).
- two windows on two screens (secondary screen has all windows).
- two windows on two screens (primary screen has all windows).

In all scenarios, warp requests (by right-click the mouse) successfully moves the mouse pointer to the center of the main window,
and it is what it's supposed to be in the flightgear."
2008-12-15 20:38:40 +00:00
Robert Osfield
9027e7a9af Limited the static build to just osversion and osgstaticviewer 2008-12-15 20:32:15 +00:00
Robert Osfield
528fdbb75c Aded osg::isGLExtensionOrVersionSupported(uint contextID, char* extensionName, float minVersionRequired) method that
returns true if (the extension string is supported or GL version is greater than or equal to a specified version) and 
non extension disable is used.   This makes it possible to disable extensions that are now
available as parts of the core OpenGL spec.

Updated Texture.cpp is use this method.
2008-12-15 19:37:14 +00:00
Robert Osfield
f4836d7aa1 From Paul Martz, "I'm not sure why this message was added, but it doesn't appear to merit INFO verbosity. Changing this from INFO to DEBUG_FP." 2008-12-15 16:46:13 +00:00
Robert Osfield
cf73a329b3 From Peter Hrenka, "I implemented a free list reallocation scheme in
VertexBufferObject::compileBuffer().

The offsets of newly added Arrays were not properly
calculated. This submission tries to find a
matching empty slot when the total size of
the VBO has not changed (e.g. when an array
is replaced by another array of the same size).


This fixes the overwriting issue that I showed in my posting
"Bug in VertexBufferObject::compileBuffer" on OSG-Users.
"
2008-12-15 16:42:22 +00:00
Robert Osfield
ca3fe5d352 Reduced the default number _targetMaximumNumberOfPageLOD to 300 to keep the memory consumption on large databases a bit lower. 2008-12-15 16:41:34 +00:00
Robert Osfield
993ec64657 Added deprecated messages to get/set methods of outgoing expiry schemes. 2008-12-15 16:10:26 +00:00
Robert Osfield
4c32c577d5 From Mathias Helsing, "Cpack support submission with:
Better package naming. example
openscenegraph-core-2.7.7-Linux-i386.tar.gz on my ubuntu laptop and
openscenegraph-core.2.7.7-win32-x86-vc80.tar.gz on winxp.

CMakers will not get options for selecting compression format. TGZ
goes for all platforms (on win32 I use 7zip)

The wrappers is now given the COMPONENT name
libopenscenegraph-wrappers. Feel free to change the name.

On windows with visual studio the OsgCPack script make some efforts to
discover the compiler used but support is a bit poor so I've given
CMake acces to OSG_CPACK_COMPILER to provide some mean to name the
compiler.

stop

The platform part is taken from CMAKE_SYSTEM_NAME and for windows I
change this to win32 or win64 based on CMAKE_CL_64. This might not be
necessary if the arch part has that information. This information is
taken from CMAKE_SYSTEM_PROCESSOR. I only have 32bit here so if some
of you could uncomment line 15,16 in OsgCPack.cmake and report what
cmake report it would be nice. I'm especially interested anything but
win32 and linux32"
2008-12-15 14:07:29 +00:00
Robert Osfield
25f4baf990 Made the folowing changes to make the DatabasePager more restrained in its memory consumption, and to improve the speed of merging of tiles (at the potential cost of extra frame drops).
Set Made DatabasePager TargetMaximumNumberOfPageLOD technique the be the default with a default target number of PagedLOD of 500.

Set DatabasePager DoPreCompile to OFF by default.
2008-12-15 13:56:38 +00:00
Robert Osfield
7d719d998e Removed buildMipmaps method that had no implementation. 2008-12-15 12:16:31 +00:00
Stephan Maximilian HUBER
71cb98dce4 From Stephan Huber: updated XCode project 2008-12-12 22:28:22 +00:00
Robert Osfield
73d7d31d60 Updated AUTHORS and READER for 2.7.7 dev release 2008-12-12 19:19:01 +00:00
Robert Osfield
a8889d7922 Updated change log 2008-12-12 19:12:38 +00:00
Robert Osfield
315aeeb557 Where possible moved redundent C header includes from headers to source files 2008-12-12 18:47:30 +00:00
Robert Osfield
97cd954c01 Changed the libopenscenegraph-core to be part of libopenscenegraph, and
changed libopenscenegraph-examples to be part of openscenegraph-examples
2008-12-12 14:54:22 +00:00
Robert Osfield
6b5a1ac2da Updated wrappers 2008-12-12 14:16:11 +00:00
Robert Osfield
946175385f From Ulrich Hertlein, Typo fixes + "optional parameter to RecordCameraPathHandler to control the frame rate for record/playback. Default is 25.0, the environment variable takes preference if set." 2008-12-12 13:41:39 +00:00
Robert Osfield
55fe4967ad From Mattias Helsing, "I have developed the earlier cpack example a bit. Perhaps you could
consider these initial cpack support scripts. It is hidden behind a
BUILD_PACKAGES option so won't affect the normal user. The submission
1) set the COMPONENT attribute on all cmake install commands.
COMPONENT names are according to
http://www.openscenegraph.org/projects/osg/wiki/Community/Packaging

2) provide cmake script and a template for creating CPack
configuration files. It will generate target for creating packages
with everything that gets "installed" (make package on unx, project
PACKAGE in MSVC) plus targets for generating one package per COMPONENT
(i.e. libopenscenegraph-core etc.).

I have temporariliy uploaded some examples to
http://www.openscenegraph.org/projects/osg/wiki/Community/People/MattiasHelsing

If this submission makes it into svn we can develop it to generate
rpms, installers for windows and mac (I know at least J-S don't like
these but there may be others who do ;) and even DEBs (not sure if we
can make them "ubuntu-ready" but they eventually may - at least we
could put a deb on the website)"
2008-12-12 11:01:09 +00:00
Robert Osfield
388531e834 Updated wrappers 2008-12-12 10:20:05 +00:00
Robert Osfield
b038baf676 Updated version number for 2.7.7 release 2008-12-12 10:19:19 +00:00
Robert Osfield
4896fe6e05 From Mattias Helsing, "When building osg static on Windows the _declspec's wasn't escaped for
applications, examples or wrappers. Attached are the CMakeLists I had
to change to make these compile.
"
2008-12-11 17:00:40 +00:00
Robert Osfield
3a623717a9 Cleaned up layout 2008-12-10 17:08:21 +00:00
Robert Osfield
c3611c5875 Added mechanism for registering proxy objects in the .osg plugin in a way that is compatible with static linking. 2008-12-10 16:26:02 +00:00
Robert Osfield
1b55a56731 Removed #if 0'd out reference to osgDB 2008-12-10 15:01:49 +00:00
Robert Osfield
bceaef6f06 Fixed link line 2008-12-10 12:50:40 +00:00
Robert Osfield
5363736caa Refactored computeIntersections() float x,float y, const osg::NodePath& nodePath. 2008-12-10 11:12:37 +00:00
Robert Osfield
69f5e5c5e5 From Andreas Goebel, (submitted by Paul Martz) "A fix for the FLT exporter. This change adds support for normals with OVERALL binding (and improves support for normals with PER_PRIMITIVE binding -- still not correct, but at least it doesn't index off the end of the array anymore)." 2008-12-10 10:13:58 +00:00
Robert Osfield
33782a5177 From Marcin Prus, "some time ago there was an optimization fix including change in DirectionalSector::computeMatrix().
Rotation matrices were replaced with quaternions but incorrect contructor was used. There was a call to Quat(angle, xAxis, yAxis, zAxis ) but there is no such constructor in Quat class to create quaternion for rotation. As a result we got this values being written into quaternion directly.

I've replaced Quat contructor calls with the ones creating rotation quaternions Quat( angle, Vec3( axis ) )."
2008-12-10 10:10:45 +00:00
Robert Osfield
3297702173 Added return 2008-12-10 09:34:45 +00:00
Robert Osfield
905f3673d5 From Sukender, added missing inline keywords 2008-12-09 16:43:38 +00:00
Robert Osfield
9a554f7eec Fixed cull callback usage to ensure that the lazy updating of the browser image functions automatically. 2008-12-09 14:07:59 +00:00
Robert Osfield
c8190d9c54 Cleaned up osgWidget::VncClient and osgWidget::Browser so that their implementations are all more consitent with the osgWidget::PdfReader. 2008-12-09 11:05:04 +00:00
Robert Osfield
d8c17e4c4c Added support for setting background colour of Pdf document. 2008-12-09 09:26:51 +00:00
Robert Osfield
c0ac01c576 Added setImageToColour function 2008-12-09 09:25:12 +00:00
Robert Osfield
6b3704ce09 Added asSwitch and asGeode convinience methods to Node 2008-12-09 09:24:47 +00:00
Robert Osfield
45160a2129 Added ability to customize keyboard events for controlling osgWidget::PdfImage/PdfReader 2008-12-07 17:37:26 +00:00
Robert Osfield
6f356aeb97 Intoduce new osgWidget::PdfReader and osgWidget::VncClient front ends to osgWidget,
with new pdf plugin and updated vnc plugin that now support these front ends.

Updated osgpdf and osgvnc examples to new these new interfaces.
2008-12-07 17:02:30 +00:00
Robert Osfield
0114ac4734 Fixed build problem 2008-12-06 11:03:32 +00:00
Robert Osfield
bad3a92fc3 Added GL_ABGR_EXT to fix windows build 2008-12-05 16:41:12 +00:00
Robert Osfield
25eff6e27c From Jason Daly, added support for reading Valve's texture format files 2008-12-04 10:27:29 +00:00
Robert Osfield
fe439b3707 From Sukender, (Benoit Neil) "adding a few convinience methods to osg::Node (ouch!). Just tell me if you find them useful:
/** Convinience method that sets the update callback of the node if it doesn't exist, or nest it into the existing one. */
void addUpdateCallback(NodeCallback* nc);

/** Convinience method that removes a given callback from a node, even if that callback is nested. There is no error return in case the given callback is not found. */
void removeUpdateCallback(NodeCallback* nc);

... and the same for Event and Cull callbacks methods."
2008-12-03 14:13:59 +00:00
Robert Osfield
4957d7bb55 From Ferdi Smit, "Image.cpp didn't handle the integer data types correctly in the function:
unsigned int Image::computeNumComponents(GLenum pixelFormat)

so I added these types to the switch statement:

      case(GL_RED_INTEGER_EXT): return 1;
      case(GL_GREEN_INTEGER_EXT): return 1;
      case(GL_BLUE_INTEGER_EXT): return 1;
      case(GL_ALPHA_INTEGER_EXT): return 1;
      case(GL_RGB_INTEGER_EXT): return 3;
      case(GL_RGBA_INTEGER_EXT): return 4;
      case(GL_BGR_INTEGER_EXT): return 3;
      case(GL_BGRA_INTEGER_EXT): return 4;
      case(GL_LUMINANCE_INTEGER_EXT): return 1;
      case(GL_LUMINANCE_ALPHA_INTEGER_EXT): return 2;

That's all... now it computes the number of components and, thus, the image size
correctly."
2008-12-03 12:09:21 +00:00
Robert Osfield
9d92a26693 Revised the DYNAMIC vs STATIC library setup of COLLADA. 2008-12-02 10:42:58 +00:00
Robert Osfield
b58efff175 From Jean-Sebastien Guay, build fix 2008-12-02 09:00:53 +00:00
Robert Osfield
1ff5d3c53d Fixed wrappers 2008-12-01 15:46:50 +00:00
Robert Osfield
91f8dbb583 From Wang Rui, "Attachment is a plugin reading Biovision hierarchical files (.BVH) to generate character motion animations. BVH format is widely used by Character Studio of 3dsmax, MotionBuilder and other softwares, also supported by most motion capture devices. The plugin is based on the latest osgAnimation library of OSG 2.7.6 and will return a osgAnimation::AnimationManager pointer if using readNodeFile() to load it.
Source and CMake files are:
 
CMakeLists.txt
ReaderWriterBVH.cpp
 
Also there are 3 example BVH files. The first two are captured from motions of human beings - maybe a kung-fu master here. PLEASE use command below to see the results:
 
# osgviewer example1.bvh -O solids
 
This will demonstrate the animating of a skeleton and render bones as solid boxes. Note that the motion assumes XOZ is the ground and has an offset from the center, so we should adjust our view to get best effects.
 
You may also use "-O contours" to render bones as lines. The viewer shows nothing if without any options because osgAnimation::Bone does not render itself. User may add customized models to each named bones as osganimationskinning does to make uses of this plugin in their own applications.

I was wondering to support a BvhNode in my osgModeling peoject before, but soon found it better be a plugin for animation. A problem is, how to bind real geometry models to the skeleton. Maybe we could have a bindingToNode() visitor in future to find geodes matching names of bones and add them as bones' children."
2008-12-01 14:07:20 +00:00
Robert Osfield
d6845c4c7d Updated wrappers 2008-12-01 13:47:48 +00:00
Robert Osfield
f2c1a3ea8a From Art Tevs, "here is a submission of an additional class of PixelBufferObejct, which implements more general way of handling with PBOs. Current osg implementation of PBO does use an attached osg::Image to copy data from. This is somehow only one way of using it and doesn't provide full functionality of PBOs.
--------------------------------------------
Descripton:

The patch does provide a new class PixelDataBufferObject which is capable of allocating memory on the GPU side (PBO memory) of arbitrary size. The memory can then further be used to be enabled into read mode (GL_PIXEL_UNPACK_BUFFER_ARB) or in write mode (GL_PIXEL_PACK_BUFFER_ARB). Enabling the buffer into write mode will force the driver to write data from bounded textures into that buffer (i.e. glGetTexImage). Using buffer in read mode give you the possibility to read data from the buffer into a texture with e.g. glTexSubImage or other instuctions. Hence no data is copied over the CPU (host memory), all the operations are done in the GPU memory.


--------------------------------------------
Compatibility:

The new class require the unbindBuffer method from the base class BufferObject to be virtual, which shouldn't break any functionality of already existing classes. Except of this the new class is fully orthogonal to existing one, hence can be safely added into already existing osg system.

--------------------------------------------
Testing:

The new class was tested in the current svn version of osgPPU. I am using the new class to copy data from textures into the PBO and hence provide them to CUDA kernels. Also reading the results back from CUDA is implemented using the provided patch. The given patch gives a possibility of easy interoperability between CUDA and osg (osgPPU ;) )


--------------------------------------------
I think in general it is a better way to derive the PixelBufferObject class from PixelDataBufferObject, since the second one is a generalization of the first one. However this could break the current functionality, hence I haven't implemented it in such a way. However I would push that on a stack of wished osg 3.x features, since this will reflect the OpenGL PBO functionality through the classes better.
"
2008-12-01 13:28:13 +00:00
Robert Osfield
5178a0ec66 Added OpenThreads to link lists 2008-12-01 11:19:11 +00:00
Robert Osfield
78a808e444 Changed OPENEXR_LIBRARY to OPENEXR_LIBRARIES to pick up on Ulrich's changes to the FindOpenEXR.cmake 2008-11-30 16:33:55 +00:00
Robert Osfield
eba1072dfa From Ulrich Hertlien, "'m was getting a build failure from the OpenEXR reader on Mac OS X. It was complaining about undefined references to half::convert(int). I believe this is because the EXR plugin doesn't explicitly link against the Half library.
Attached is a modified FindOpenEXR.cmake module that locates IlmIlf and Half, as well as a modified exr/CMakeLists.txt that picks up this change.

Also attached are some typo fixes for CMakeModules.

Cheers,"
2008-11-30 16:33:11 +00:00
Robert Osfield
47f518d1c7 From Art Tevs, "here are a small extension to the osg::Image class, which do computes data type from the given format, i.e. (GL_RGB32F_ARB -> GL_FLOAT). The method is very usefull to find out which data type a texture or an image have based on the internal/pixel format." 2008-11-30 15:56:47 +00:00
Robert Osfield
fd90f1a6ef Updated ChangeLog, and AUTHORS lists for 2.7.6 dev release 2008-11-29 12:16:04 +00:00
Robert Osfield
3c611dcf30 Build fix for when implicit conversion in ref_ptr<> is switched off. 2008-11-29 11:35:03 +00:00
Robert Osfield
a14b6b9e24 Fixed build for when ref_ptr<> impicit cast is not built 2008-11-29 11:10:56 +00:00
Robert Osfield
b021f0c518 Removed cmath include as it was causing build problems under Cgwin 2008-11-28 17:18:08 +00:00
Robert Osfield
cd4b4b8bfe Added new examples 2008-11-28 14:37:58 +00:00
Robert Osfield
070b9c2cd9 From Cedric Pinson, updates to osganimation examples.
Merged by Robert Osfield, from OpenSceneGraph-osgWidget-dev
2008-11-28 14:37:16 +00:00
Robert Osfield
9b1841d009 From Jeremy Moles, updates to osgwidget examples.
Merged by Robert Osfield from OpenSceneGraph-osgWidget-dev
2008-11-28 14:36:39 +00:00
Robert Osfield
16bae8830e Updated wrappers 2008-11-28 14:35:47 +00:00
Robert Osfield
9748fdd605 From Jeremy Moles, updates to osgWidget
Merged my Robert Osfield from OpenSceneGraph-osgWidget-dev.
2008-11-28 14:35:33 +00:00
Robert Osfield
d3b2d9b074 From Cedric Pinson, updates toosgAnimation.
Merged by Robert Osfield, from OpenSceneGraph-osgWidget-dev.
2008-11-28 14:34:38 +00:00
Robert Osfield
37682c6668 From Cedric Pinson, "updated the CMakelist.txt of curl plugin to compile with the static library of curl.
I added the external dependency wldap32"
2008-11-27 17:31:49 +00:00
Robert Osfield
e9a18a7466 Updated SO version number for 2.5.6 release 2008-11-27 17:30:14 +00:00
Robert Osfield
57a543b683 Updated ChangeLog 2008-11-27 17:29:12 +00:00
Stephan Maximilian HUBER
799801c201 From Stephan Huber:
updated XCode project, added osgAnimation framework + one example using it (osganimationviewer). 
Added _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC to local OpenThreads/Config when compiling for the 10.5 SDK.
Some minor fixes on some of the configurations/targets
2008-11-27 16:58:43 +00:00
Robert Osfield
cf440dfec3 Changed unsigned long to unsigned int to avoid 64bit portability issue. 2008-11-27 14:05:30 +00:00
Robert Osfield
12bfb6d79a From Jean-Sebastien Guay, "osgautocapture uses M_PI to convert degrees to radians, which didn't compile on Win32. Switched to using osg::DegreesToRadians. Also removed the "convert to radians" comment on each line, as the code clearly conveys this without needing a comment now." 2008-11-27 09:45:41 +00:00
Robert Osfield
25ec33d863 Enabled the build of exr plugin 2008-11-27 09:36:35 +00:00
Robert Osfield
db572a9142 Build fixes 2008-11-27 09:36:18 +00:00
Robert Osfield
c0e7e733ec Removed the use of = operator. 2008-11-27 09:33:06 +00:00
Robert Osfield
c470752182 Updated wrappers 2008-11-26 16:40:01 +00:00
Robert Osfield
d952172559 From Tim Moore, "Double precision versions of BoundingBox and BoundingSphere are useful for doing computations in world coordinates, especially when working with a geocentric scene. By default, these classes are built using floats, so templated versions fill a need. I've used the double precision templates to fix some problems with ViewDependentShadow, which will follow shortly.
"
2008-11-26 16:39:52 +00:00
Robert Osfield
98c197edad added workaround of compile issues with templated version of BoundingBox 2008-11-26 16:00:27 +00:00
Robert Osfield
b813d1b31b Updated wrappers 2008-11-26 13:18:54 +00:00
Robert Osfield
d7c2d6863d From Andy Preece,
"To reproduce the bug:

   1. Create a template osg::Sequence node (and underlying geometry) but do not attach the node to the current active scenegraph.
   2. At some point during the rendering loop (perhaps on a keystroke) clone the sequence node (I use the call:

       dynamic_cast<osg::Node*>(templateNode -> clone( osg::CopyOp( (osg::CopyOp::CopyFlags)osg::CopyOp::DEEP_COPY_NODES ) ) )

   3. Set the cloned sequence node duration to a value that makes the animation run slower (i.e. 2.0).
   4. Start the cloned sequence (using setMode()).
   5. Repeat steps 2 \u2013 4 and observe that the cloned sequences do not run slow but run as fast, appearing to ignore the duration that has been set on them.

 

Looking at the \u2018good documentation\u2019 (2.4 source code), I see that _start is being set to _now (osg::Sequence::setMode(), line 192). Should this not _start not be set to -1.0?"
2008-11-26 12:50:12 +00:00
Robert Osfield
89ea6d596c Added searching for OpenEXR 2008-11-26 12:35:49 +00:00
Robert Osfield
51fee6f75c From Ragnar Hammarqvist, "I wrote an EXR image plug-in to osg, I would like to contribute this plug-in to the osg project if you find it useful.
The plug-in is a wrapper around open-exr (http://www.openexr.com) that consists of two projects, ilmbase-1.0.1 and openexr-1.6.1.

I have only tested it on windows XP 32 machine. So there might be some work making it work on other platforms.

The plug-in supports writing and reading EXR files. When writing it can use the data type GL_HALF_FLOAT_ARB(se ilmbase-1.0.1) and GL_FLOAT. When reading the data type always becomes GL_HALF_FLOAT_ARB. It supports textures with three and four channels.

When reading an exr file it automatically removes Alfa channel if it didn't store any information."

--

From Robert Osfield, started work on ported it to other platforms, but could fix some problems relating to error: 

        ?Imf::OStream::OStream(const Imf::OStream&)? is private

I'm checking in now so that others can have a bash at completing the port.
2008-11-26 12:35:25 +00:00
Robert Osfield
e02ae68aa9 From Gino van den Bergen, "The FindGDAL.cmake seems to be broken in OSG 2.6.1 for locating gdal.h through enviroment variable GDAL_DIR.
Also, I've modified the FindCOLLADA.cmake to locate the current 2.1 versions of the COLLADA DOM in the build directories under VC8. I've also added a COLLADA_LIBRARY_DEBUG spec. Other flavors may be added depending on compiler version and DOM version."
2008-11-26 12:07:03 +00:00
Robert Osfield
b147a22af1 From BjornHein, "attached a proposal for an extension for the the stl-File ReaderWriter. It allows saving of an osg node tree as stl file in ASCII-Format.
Standard is to generate one stl file.

With an additional option it is possible to write one file per Geode. This option is not very "useful" for typical application, I use it for separating and conversion of geometric data. So it could be removed if considered to special."
2008-11-26 11:45:33 +00:00
Robert Osfield
270fd48536 From John Vidar Larring, osgautocapture example that captures an image from a paged database by frame loop to the paging is complete, then takes a snapshot. 2008-11-26 11:23:06 +00:00
Robert Osfield
b2762c4788 Added DatabasePager::getRequestsInProgress() that return true if there are still tiles to load.
Added DatabasePager::setTargetMaximumNumberOfPageLOD(..) that sets the target number of PagedLOD to try and maintain
2008-11-26 11:12:19 +00:00
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
a7a7115581 Fix for build with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION off 2008-11-25 15:57:27 +00:00
Robert Osfield
1228897b72 Fixed build for when OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION is off 2008-11-25 15:38:11 +00:00
Robert Osfield
8ea639f564 Updated wrappers 2008-11-25 14:40:02 +00:00
Robert Osfield
017b4315bc From Joakim Simmonsson, fix for handling of billboards in FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS 2008-11-25 14:31:19 +00:00
Robert Osfield
b6fe330b85 Added support for unsigned int uniforms 2008-11-25 14:15:55 +00:00
Robert Osfield
0d8ae3bd66 From Ferdi Smit, added support for unsigned int typed uniforms 2008-11-25 14:15:35 +00:00
Robert Osfield
a751eb0326 From Urlich Hertlein, "Attached is a patched version that replaces calls to atof() with osg::asciiToFloat()." 2008-11-25 13:45:27 +00:00
Robert Osfield
b7882c57f8 Fixed warning and some unitialized variables. 2008-11-25 12:22:33 +00:00
Robert Osfield
a1f59b6241 Fixed warning 2008-11-25 11:09:40 +00:00
Robert Osfield
d08d778608 From Jaromir Vitek, "In attachment are another fixes for using packed depth+stencil (PDS).
* When used PDS RenderStage::runCameraSetUp sets flag that FBO has already stencil,depth buffer attached. Prevents adding next depth buffer.
* Sets correct traits for p-buffer if used PDS and something goes wrong with FBO setup or p-buffer is used directly.
* Adds warning to camera if user add depth/stencil already attached through PDS.
* Sets blitMask when use blit to resolve buffer.

There is also new example with using multisampled FBO."
2008-11-25 10:57:14 +00:00
Robert Osfield
410b90334a From Wojciech Lewandowski, "I have restored MSVC disabled warnings in osg/Export. Difference is they are now disabled only when OSG_DISABLE_MSVC_WARNINGS macro is defined. This macro is set through CMake options and autogenerated in osg/Config. Simon suggested that it would be cool if we had more control over selected warnings. I tried to learn how to make selection of individual warning numbers possible, but had to gave up as my cmake skills were not sufficient. The only way I saw this possible would be adding one define for each MSVC warning number. But many definitions seemed too be to much clutter for osg/Config file so I rejected thar idea. For this it would be cool if autogenerated Config entries could more powerful than simple #define/#undef flags. Maybe Cmake gurus know how to do it.
I have not reverted added Compiler options. I assume that one may want to have warnings enabled for the application but may not want to see them while OSG libraries and examples compile.

Modified files:

osg/Export   - now explicitly includes osg/Config to make sure OSG_DISABLE_MSVC_WARNINGS is read
osg/Config.in  - declares OSG_DISABLE_MSVC_WARNINGS flag to be added to autogenerated osg/Config
CMakeLists.txt - declares OSG_DISABLE_MSVC_WARNINGS as option with default ON setting
"
2008-11-24 16:32:52 +00:00
Robert Osfield
f92baedf2b From Marco Jez, "The DDS plugin currently prints too many NOTICE messages that, given their nature and frequency, should really be demoted to INFO or DEBUG severity. Fix is attached." 2008-11-24 16:26:15 +00:00
Robert Osfield
8527492638 From Alberto Luaces, removed #include <cmath> as it was cause a build problem under Cygwin. 2008-11-24 16:09:43 +00:00
Robert Osfield
2517c1e77e Improved the set of the master + slave cameras 2008-11-24 16:02:20 +00:00
Robert Osfield
9addcc050d From Rolad Smeenk, "Forgot a call to uniqify when generating an Id based on osg::Node name." 2008-11-24 15:27:19 +00:00
Robert Osfield
6ae07ce0e2 From Roland Smeenk, "This application can be used for testing plugins that can both read and write a certain file format. It will display the original file next to the written and reread file.
Example:
osgsidebyside -o cow.dae cow.osg
 
This example will read cow.osg, write cow.dae, read cow.dae and display cow.osg on the left side and cow.dae on the right side of the view.
 
Possible interactions:
KEY_UP   Speedup DOF animation
KEY_DOWN SlowDown DOF animation
KEY_RIGHT Toggle all MultiSwitches"
2008-11-24 14:37:15 +00:00
Robert Osfield
6bdd83413d From Roland Smeenk, "Overview of the Collada/dae plugin changes
New features
+Read and write of osg::LOD, osg::Switch, osgSim::Sequence, osgim::MultiSwitch and osgSim::DOFTransform data in <extra>
+Read and write of osg::Node description data in <extra>
+Plugin option "NoExtras" to prevent writing of <extra> data and only traverse the active children when saving
 
Changes/additions
+instanced_geometry and instanced_controller are now loaded in a single Geode with multiple Geometries instead of multiple geodes with a single Geometry
+Changed all calls to the deprecated createAndPlace() to the new add() methods
+All transformation elements <scale>, <rotate>, <translate>, <lookat>, <matrix>, <skew> are now concatenated properly in to a single MatrixTransform.
 Previously this was not done in order as required by Collada and and not all elements were included.
+Complete skew matrix creation
+Automatically add GL_RESCALE_NORMAL if scale is non-identity
+Blinn shininess remapping to [0,128] when in range [0,1]
+Changes to CMake file to make it compile on Windows
+Coding style and code documentation
 
Bug fixes
+Transparent texture writing fixed
+Fixed bug in using osg node name as collada node ID
+Fixed usage of double sided faces in GOOGLEEARTH extra
+Not adding blendfunc and blendcolor when opaque
 
TODO/Wishlist
-solve differences in drawables, DAE reader should place multiple collation elements into multiple primitivesets in a single geometry where possible (only when same material)
-solve differences in matrices
-multitexture support
-skinned mesh and generic animations using osgAnimation
-profile_GLSL based on COLLADA OpenGL Effects Viewer http://ati.amd.com/developer/rendermonkey/downloads.html
-handling more <extra> to more closely mimic the intended lighting"
2008-11-24 14:26:04 +00:00
Robert Osfield
d25de5e92e Replaced usage atof to asciiToFloat. 2008-11-24 13:50:28 +00:00
Robert Osfield
fccd05b290 Converted OpenGL version number code to using osg::asciiToFloat to avoid issues with conversion using locale senstive atof function 2008-11-24 13:19:01 +00:00
Robert Osfield
bf8c3cc07e From Jason Daly, "This is a plugin (two, actually) that will allow OSG to load .bsp map files from Valve's Source Engine games (Half-Life 2, etc.). One plugin (called "vbsp" to distinguish it from the Quake 3 bsp loader) reads the .bsp file itself, and the other ("vtf") reads the texture files.
The set up for this to work is a bit more complex than most files, since the engine expects all files to be in a certain place, and it tends to mix case a lot.  I tried to explain everything in the VBSP_README.txt file."

This plugin has been integrated with the pre-exisiting bsp plugin.
2008-11-24 11:39:02 +00:00
Robert Osfield
38f7fabb10 Renamig of files in prep of merge of valve bsp support 2008-11-24 10:28:19 +00:00
Robert Osfield
ed918cf6be From Tim Moore, "the GraphicsWindowX11 code was not correctly calling GraphicsContext::resized when the window was not mapped with the requested geometry." 2008-11-24 10:16:03 +00:00
Robert Osfield
d7ba995370 Updated wrappers 2008-11-24 10:13:27 +00:00
Robert Osfield
f1b5b75128 Added mechnism for tracking when a VncImage is inactive or not. 2008-11-23 17:28:13 +00:00
Robert Osfield
5b15436935 Added mechanism for tracking when interactive images are being rendered to
enable their backends to only rendered them when they are actively being rendered
in the OpenGL window.
2008-11-23 15:51:43 +00:00
Robert Osfield
8264b31fa1 Introduce osg::asciiToDouble/asciiToFloat function. 2008-11-23 11:35:43 +00:00
Robert Osfield
d946a6536e From Ulrich Hertlein, "I noticed some regression in the BMP loader - some 8-bit (paletted) files wouldn't load anymore but simply crash.
After taking a look at the current state of the BMP loader I decided it might be worth a shot at reimplementing that part.  For example: the current loader doesn't properly handle 1- and 4-bit files, incorrectly loads 16-bit files as intensity-alpha (they are RGB555), is full of dead code, and generally not in very good shape.

Attached is my re-implementation for review.

I've checked it against the test images from http://wvnvaxa.wvnet.edu/vmswww/bmp.html and models that use BMP files.
"
2008-11-23 10:20:50 +00:00
Robert Osfield
d0994c4ad3 From Paul Martz, added missing export 2008-11-23 09:57:41 +00:00
Robert Osfield
9f55408ca3 Removed the optional build for osgWidget and plugins as these are options that are appropriate for building all the time 2008-11-22 14:30:21 +00:00
Robert Osfield
56a2cc65d0 From Cedric Pinson, Pulled in osgAnimation from OpenSceneGraph-osgWidget-dev into svn/trunk. 2008-11-22 12:14:19 +00:00
Robert Osfield
fdaa75400b From Danny Valente, submitted bu Jean-Sebastien Guay, "Some context: In the past I submitted a fix to osgViewer::CompositeViewer where events would get wrong input ranges. Later, you made a change to set the eventState's current graphics context to the current graphics context. However, there's a problem in the sequence of events. Here's the recap (doing a graphical diff with the attached file will show this clearly):
Before:

1. if the camera is not a slave camera
  1.1 set the eventState's graphics context to the current context.
2. if the current master view is not the view which has the focus
  2.1 set the current master view to be the view which has the focus
  2.2 use the new master view's eventState instead of the old one

Now as you can see from this sequence, the graphics context is set on the eventState before switching to the view which has focus (and thus using another eventState). So the new eventState, in the case we need to switch views, will contain an old graphics context, not the correct one.

Just inversing these steps fixes the problem:

1. if the current master view is not the view which has the focus
  1.1 set the current master view to be the view which has the focus
  1.2 use the new master view's eventState instead of the old one
2. if the camera is not a slave camera
  2.1 set the eventState's graphics context to the current context.

Now, the eventState will refer to the correct graphics context in both cases.

Attached is a fixed CompositeViewer.cpp (based on today's SVN) which does this. Note that some other things are done in the 1. and 2. cases, but they have no influence on each other so they can just be swapped without problems.
"
2008-11-21 18:16:43 +00:00
Robert Osfield
6524788516 Added handling of View::LightingMode 2008-11-21 17:44:16 +00:00
Robert Osfield
d423aff288 Build fix 2008-11-21 17:10:41 +00:00
Robert Osfield
59df690e3e Added exports 2008-11-21 16:09:28 +00:00
Robert Osfield
e158c78ffa From David Spilling, better support for multitexture in obj loader. 2008-11-21 13:23:55 +00:00
Robert Osfield
d903423ded From Jaromir Vitek, osgpackeddepthstencil example as a test case. 2008-11-21 12:38:22 +00:00
Robert Osfield
2c4bb15bb6 Updated wrappers 2008-11-21 12:31:28 +00:00
Robert Osfield
344908faad Made the ParticleSystemUpdate::addParticleSystem, removeParticleSystem, replaceParticleSystem and setParticleSystem methods all virtual to allow them to be overriden. 2008-11-21 12:30:12 +00:00
Robert Osfield
a90bdd1833 From Mario Valle, "Attached two small correction to remove the following warnings from MINGW build." 2008-11-21 12:15:16 +00:00
Robert Osfield
05cd6878a5 From Jason Beverage, "The _pluginData member variable is not properly copied when using the copy constructor for ReaderWriter::Options." 2008-11-21 12:10:27 +00:00
Robert Osfield
6962b9e49f From Joakim Simonsson, fixed warning. 2008-11-21 12:05:03 +00:00
Robert Osfield
8eb351d722 From Gordon Tomlinson, "Find enclosed fix for a leak in the Tessellator::reset(), were the new verts were not being deleted, only the container was
We have confirmed the leak while running things through Purify,"

Small code tweaks by Robert Osfield to streamline the code.
2008-11-21 11:52:48 +00:00
Robert Osfield
f1faa4aa90 Updated wrappers 2008-11-21 11:27:11 +00:00
Robert Osfield
341abcb315 From Serge Lages, "Here you can find some modifications to osgManipulator to work with double values instead of floats. Indeed I faced problems with the osgManipulator library when working with Earth based scenes, it was impossible to drag objects in a precise way if they were too far from the center of the scene." 2008-11-21 11:23:21 +00:00
Robert Osfield
672a5d14fe Replaced tabs 2008-11-21 11:09:11 +00:00
Robert Osfield
54835570a0 Added handling of case when there is so scene graph attached to a view. 2008-11-21 10:27:31 +00:00
Robert Osfield
1fa288a399 From Jim Vaughan, "I found a bug in the code I sent you last month. It was working for SoVRMLTransform nodes, but
SOTransform nodes are not in the IV scenegraph the way I thought they were.  The attached file
contains a fix for this."
2008-11-20 17:27:21 +00:00
Robert Osfield
9da7bbf802 Added readNodeFile support the gecko plugin. 2008-11-20 13:07:21 +00:00
Robert Osfield
98df67c918 Added DisplaySettings::s/getApplication() to help with gecko plugin initialization when it requires the application name 2008-11-20 12:03:21 +00:00
Robert Osfield
d4c1634571 Updated wrappers 2008-11-20 11:47:38 +00:00
Robert Osfield
beae8ab67f Clean up osgbrowser after moving browser implementation into gecko plugin 2008-11-20 11:28:20 +00:00
Robert Osfield
7bf815332e Moved browser code from osgbrowser example into gecko plugin to make the browser functionality accessible to other OSG applications 2008-11-20 11:27:36 +00:00
Robert Osfield
eaba09027e Reverted Kyle Centers mistaken patch that removed a _currentContext->valid() that was actually required. 2008-11-19 20:34:53 +00:00
Robert Osfield
5288263528 Moved Browser.h and Browser.cpp from osgbrowser into osgWidget. 2008-11-19 17:16:29 +00:00
Robert Osfield
aa28f1a3fd Added XUL_DIR searching 2008-11-19 17:04:02 +00:00
Robert Osfield
35330867c5 Fixed component directory path handling. 2008-11-19 17:02:45 +00:00
Robert Osfield
094733def5 Refactored browser classes so that there is now a base class and reader writer. 2008-11-19 16:58:32 +00:00
Robert Osfield
297dd32011 Changed osgbrowser example to use a local CMakeModules/FindXUL.cmake script,
and specialization of GTK dependencies to only non Windows/OSX platforms.
2008-11-18 23:38:18 +00:00
Robert Osfield
a36ff70df4 Removed debug output 2008-11-18 17:20:45 +00:00
Robert Osfield
cac16cb590 Added optional bool keep to BarrierOperation to make it more resuable 2008-11-18 15:18:34 +00:00
Robert Osfield
96188d0240 Moved update functionality into from UBrowserImage into update. 2008-11-18 14:46:02 +00:00
Robert Osfield
3b3d932d30 Added support for running all ubrowser operataions in a background thread. 2008-11-18 13:36:47 +00:00
Robert Osfield
8abd7c3a76 Fixed key mapping 2008-11-17 19:15:12 +00:00
Robert Osfield
37bd44042a Refactored the UBrowser functionality so a UBrowserThread singlton class takes
over more responsibility of integratation with llmozlib.
2008-11-17 17:58:59 +00:00
Robert Osfield
ca5c93a983 Removed dependency on GLUT. 2008-11-17 15:53:04 +00:00
Robert Osfield
5eaf95ed0f Ported example to using OSG objects for rendering rather than GLUT 2008-11-17 15:49:24 +00:00
Robert Osfield
39646d2dff Introduced xulrunner extensions from llmozlib2, and got things working under linux 2008-11-17 10:36:55 +00:00
Robert Osfield
fa65527fee From Philip Lowman, "If you change CMAKE_INSTALL_PREFIX in the cache editor after building the OSG, it causes the entire project to rebuild (at least with the CMake makefile generator due to changing preprocessor definitions applied across all targets).
I suggest moving the definition of OSG_DEFAULT_LIBRARY_PATH (which is responsible for this global rebuild) into osgDB/CMakeLists.txt which is the only library in the code where this definition is (and is likely ever to be) used.  This way if the user changes it, only osgDB will rebuild."
2008-11-14 20:50:40 +00:00
Robert Osfield
f6ad4628f4 Added definition of std::wstring as a work around to a lack of wstring under Cygwin. 2008-11-14 20:31:28 +00:00
Robert Osfield
453bbc8608 From Simon Hammett, moved VS #prgama warning disabling from include/osg/Export to CMakeList.txt. 2008-11-14 18:22:01 +00:00
Robert Osfield
5d975da41a Removed reduncent #includes 2008-11-14 18:15:12 +00:00
Robert Osfield
10b5f0d041 From Wojciech Lewandowski, "Attached are modifications to GraphicsWindowWin32. By default workaround is
set to off. But could be activated/decativated via CMake as well as system
environment variable. I also modified src\osgViewer\CMakeLists.txt to turn
off this workaround by default as suggested."
2008-11-14 17:03:59 +00:00
Robert Osfield
2a1f7f0f7a Added GTK and GLUT guards to osgbrowser include 2008-11-14 16:54:07 +00:00
Robert Osfield
b62cb79c7e Further work on experiment llmozlib/geko based embedded web browser 2008-11-14 16:48:07 +00:00
Robert Osfield
d75cc7f84d An "attempt" at using LLMozLib sources as a base for a gecko based embedded browser. 2008-11-13 15:35:08 +00:00
Robert Osfield
11388f3519 Updated version number in prep for 2.5.6 dev release 2008-11-13 10:49:33 +00:00
Robert Osfield
ab9c0898c3 Moved Poppler-glib check into root CMakeList.txt 2008-11-12 22:54:12 +00:00
Robert Osfield
69effce44e Improved filepath handling, and increased the image resolution for better rendering quality 2008-11-12 14:57:30 +00:00
Robert Osfield
771dc7d645 Introduced new osgpdf example that use Cario + Poppler libraries to provide a means of rendering a pdf document to an osg::Image. 2008-11-12 14:21:05 +00:00
Robert Osfield
453e595636 Updated wrappers 2008-11-12 14:20:15 +00:00
Robert Osfield
89829f8153 Added osgViewerGetVersion() into context creation code as a means of forcing windows to link in osgViewer properly. 2008-11-12 10:30:17 +00:00
Robert Osfield
c1568bb735 Improved naming 2008-11-11 17:59:35 +00:00
Robert Osfield
f1bb6592bb Tweaked comment 2008-11-11 17:30:11 +00:00
Robert Osfield
014246bef6 Added default fallback of a window context is none is otherwise specified. 2008-11-11 17:29:48 +00:00
Robert Osfield
7468904dd6 Added command line argument docs and support for -h/--help command line options 2008-11-11 16:59:58 +00:00
Robert Osfield
98c9d0e88f Removed the redundent prepending of application name. 2008-11-11 16:59:12 +00:00
Robert Osfield
ee172b840c Added timing stats 2008-11-11 16:21:04 +00:00
Robert Osfield
3754dc4230 Added --geometry, --geometry-vbo and --geometry-va command line options and associated geometry test codes 2008-11-11 16:13:37 +00:00
Robert Osfield
4dd8ad2f16 Added --delay <microseconds> option that is run between each OpenGL object apply, defaults to 0 2008-11-11 15:00:29 +00:00
Robert Osfield
0de253ad2c Added support for fbo testing. 2008-11-11 12:50:51 +00:00
Robert Osfield
915a645761 First cut of osgmemorytest example that is written to allocate many windows/pbuffer/GL objects as test of how many objects can be allocated on a machine. 2008-11-10 20:06:27 +00:00
Robert Osfield
7255a23b03 Added commented out flt entry for compiling the old deprecated flight plugin (useful for testing purposes). 2008-11-10 13:56:59 +00:00
Robert Osfield
f5e1d17c13 Fix to traversal of children of an LOD - based on a suggestion from Katharina Plugge. 2008-11-10 13:48:36 +00:00
Robert Osfield
5bb6fe2ee7 Added support for Camera::PACKED_DEPTH_STENCIL_BUFFER to .osg and .ive formats 2008-11-09 11:56:02 +00:00
Robert Osfield
2090fb1450 From Jaromir Vitek, "patch contains extension to fbo and camera. Camera can attach new render buffer for depth and stencil logical buffer in packed form." 2008-11-09 11:55:11 +00:00
Robert Osfield
d75cd032b9 From Jean-Sebastien Guay, replaced M_PI with osg::PI. 2008-11-08 17:53:51 +00:00
Robert Osfield
52c14132b4 Updated ChangeLog for 2.7.5 release 2008-11-07 18:02:05 +00:00
Robert Osfield
ee0832c182 From Csaba Halasz, fix for hang when running in CullThreadPerCameraDrawThreadPerContext threading model. 2008-11-07 17:40:25 +00:00
Robert Osfield
60af3fd6fc Fixed typo 2008-11-07 17:23:55 +00:00
Robert Osfield
18dbdc2e86 Fixed build under gcc 4.3.2 2008-11-07 17:07:43 +00:00
Robert Osfield
b2cd130cc2 Updated ChangeLog and version number for 2.7.5 release 2008-11-07 16:26:46 +00:00
Robert Osfield
fd4dc1b9c6 Removed fstream for wrapper due to problems with wrapping. 2008-11-07 16:14:49 +00:00
Robert Osfield
b18840d438 Removed due to problems with build 2008-11-07 16:03:37 +00:00
Robert Osfield
0790bf18ec Updated wrappers 2008-11-07 15:38:40 +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
0ccf7d8383 Converted tabs to four spaces 2008-11-07 15:01:15 +00:00
Robert Osfield
3455431129 From Tim Moore, removed redundent forward declartion of BoundingBox and BoundingSphere 2008-11-07 13:18:40 +00:00
Robert Osfield
4f5379389d From Martins Innus, "Here is a fix to add requestWarpPointer for OS X. It seems to work for me, I just took what osgProducer had. These are updated files to 2.7.3" 2008-11-07 10:23:57 +00:00
Robert Osfield
20eba3fb74 Changed to using stdio.h. 2008-11-06 16:48:55 +00:00
Robert Osfield
566b4cd999 Updated wrappers 2008-11-06 14:56:31 +00:00
Robert Osfield
7b9474e33e Fixed constness of getTexture/getRenderBuffer() const and added non cost version. 2008-11-06 14:46:11 +00:00
Robert Osfield
b5aa966d12 From Michael Platings, "I've added functions to get the
texture, renderbuffer and other properties from a FrameBufferAttachment."
2008-11-06 14:29:35 +00:00
Robert Osfield
3f9e5dbfaa From Kyle Centers, removed redundent check to _currentContext.valid(). 2008-11-06 14:17:12 +00:00
Robert Osfield
ad2cb03a68 From Csaba Halasz, adding missing export directives 2008-11-06 14:04:26 +00:00
Robert Osfield
bfec6546ce From Thomas Wedner, "use osgViewer::CompositeViewer with several views. All views share
parts of their scene graphs. Within these common part some nodes have
event handlers which use the action adapter argument to the event
handler to determinate which view received the event.
Here is the problem, osgViewer::CompositeViewer::eventTraversal sets
the action adapter field in the EventVisitor always to the last view
which received an event, instead of using the view which actually
received the event, so determination of the correct view does not work.
I looked at the code a bit, and moved the code for setting the action
adapter to a IMO better place"
2008-11-06 13:57:14 +00:00
Robert Osfield
c7c1913561 From Ulrich Hertleinm "cmake 2.6 is having trouble on Mac OS X because example/CMakeLists.txt addes subdirectory osgviewerGLUT twice. I took the liberty to remove the second occurrence.
"
2008-11-06 13:40:35 +00:00
Robert Osfield
45c7ca720c Fixed IntersectionVisitor::accept(Camera) handling of relative Cameras. 2008-11-06 13:38:11 +00:00
Robert Osfield
c80c7dd5b9 From Chris Denham, added transform to cube to test picking fixes 2008-11-06 13:36:25 +00:00
Robert Osfield
239c18eddb Removed redundent static ImageStream pointer 2008-11-05 16:06:25 +00:00
Robert Osfield
a063d1dfb0 Added --no-rescale, --rescale (default) and --shift-min-to-zero command line options for controlling how the pixel data is managed. 2008-11-05 15:59:48 +00:00
Robert Osfield
de4e08e868 Added --replace-rgb-with-luminance option 2008-11-05 15:04:38 +00:00
Robert Osfield
2d10404a2f Added support for different pixel formats and datatypes in copyImage() method 2008-11-05 15:04:11 +00:00
Robert Osfield
766dcf4aeb Fixed return value of ArgumentParser::find() for when the search string is not found, the correct value is now -1. 2008-11-05 11:56:44 +00:00
Robert Osfield
822b1c9566 Added extra data types info to debug message 2008-11-05 10:29:45 +00:00
Robert Osfield
484ead14b5 Added Thread::Init() to CurrentThread 2008-11-05 10:27:49 +00:00
Robert Osfield
80a6e5eb2a Compiled fix for gcc 4.3.2 2008-11-04 16:31:47 +00:00
Robert Osfield
bc2e8034fe Fixed --images commandline parsing 2008-11-04 12:57:30 +00:00
Robert Osfield
2f541fc076 Added GPL copyright notice 2008-11-03 16:55:06 +00:00
Robert Osfield
c73f33d27c Added handling of texture matrices and texture rectangles in InteractiveImageHandler 2008-11-03 16:31:44 +00:00
Robert Osfield
9bba7bbee0 Refactored osgvnc example to utilise the new vnc plugin 2008-11-03 15:58:02 +00:00
Robert Osfield
5e56fb6eb6 Added vnc plugin. 2008-11-03 15:57:21 +00:00
Robert Osfield
70e1c60819 Added sendPointerEvent and sendKeyEvent virtual methods to osg::Image to
facilitate the subclassing of Image providing interactive behaviours so as
used in the vnc interactive VncImage class.

osgViewer::InteractiveImageHandler provides an event handler that convertes osgGA 
mouse and keyboard events into the coordinate frame of an image based on ray intersection with geometry in
the associated subgraph.

Changed the ordering of events processing in Viewer and CompositeViewer to allow
scene graph event handlers to take precidence over viewer event handlers and camera manipulators
2008-11-03 15:08:04 +00:00
Robert Osfield
545a5d02c7 Changed version number to 2.7.5 in prep for dev release 2008-11-03 15:03:49 +00:00
Robert Osfield
4741893563 Changed Tiff plugin to link to TIFF_LIBRARIES to handle case where JPEG and ZLIB are dependencies. 2008-11-03 10:17:26 +00:00
Robert Osfield
521a951b58 Wrapped up the various client streaming methods + thread into VncImage classes. 2008-10-31 16:48:19 +00:00
Robert Osfield
f1cc01c6b8 Implemented keyboard and mouse dispatch from vnc client to vnc server. 2008-10-31 13:59:32 +00:00
Robert Osfield
bad9854d71 Added very basic osgvnc example that uses the LibVNCServer client libries for implementing a vnc client
as an osg::Image with the vnc data stream going to it.
2008-10-31 12:03:44 +00:00
Robert Osfield
ae61033a32 Removed renduent osgDB::Registry DatabasePager methods 2008-10-30 13:05:08 +00:00
Robert Osfield
5141397d6f Updated ChangeLog, AUTHORS.txt and README.txt for 2.4.7 release 2008-10-29 12:04:11 +00:00
Robert Osfield
848b047708 From Blasius Czink, "changed the CHECK_CXX_SOURCE_RUNS macro slightly to avoid the compile problems due to bugged "intrin.h". In such a case the mutex fallback will be used (see attached file)." 2008-10-29 11:51:47 +00:00
Robert Osfield
3d07ab5664 Warning fixes 2008-10-29 11:15:33 +00:00
Robert Osfield
d7bc94d7cd Added missing implementations 2008-10-29 11:09:08 +00:00
Robert Osfield
edb4c4e554 Updated ChangeLog and AUTHORS.txt for 2.7.4 release 2008-10-29 10:56:40 +00:00
Robert Osfield
73e4e55328 Updated wrappers 2008-10-29 10:38:55 +00:00
Robert Osfield
4b28e22d34 From Lukas Diduch, added a multithread compsite viewer path, accessible using:
osgviewerQT --MTCompositeViewer --QOSGWidget cow.osg
2008-10-29 10:25:24 +00:00
Robert Osfield
649bc16753 From James Moliere, fixed display of axis 2008-10-29 10:12:02 +00:00
Robert Osfield
5034e223ec From Lionel Lagrade, "I've replaced readsome by read+gcount."
From Robert Osfeld, added throw on uncompress error.
2008-10-28 17:28:14 +00:00
Robert Osfield
0b451491b0 From Chris Denham, changed nested Camera intersection test so that it requires the command line --relative-camera-scene to enable it 2008-10-27 19:59:05 +00:00
Robert Osfield
5471bb9932 Added --help-env docs for OSG_MAX_PAGEDLOD 2008-10-27 17:42:04 +00:00
Robert Osfield
10834cdea4 Merged in comment split code from the old flt plugin so that FLT comments string with returns
in them are put into separate description entries.
2008-10-27 17:11:01 +00:00
Robert Osfield
9568a062f1 From Wojciech Lewandowski, "I am sending a really minor fix for StatsHandler::reset method. We dynamically add and remove slave cameras in our application. StatsHandler does not automatically adapt to this situation, and we call StatsHandler::reset to force it to update number of cameras and their graphs. Unfortunately, if stats were already drawn, reset would not remove former graph drawables and they would remain frozen below new stats. This update fixes it.
"
2008-10-27 17:09:36 +00:00
Robert Osfield
ff74744556 From Chris Denham, default scene that tests the use of in scene graph Camera which has a RELATIVE_RF ReferenceFrame. 2008-10-27 16:16:28 +00:00
Robert Osfield
10b6309f79 From Chris Denham, fixed support of in scene graph osg::Camera's with ReferenceFrame of RELATIVE_RF. 2008-10-27 16:06:24 +00:00
Robert Osfield
72200de866 From Katharina Plugge, "I found a bug in the OpenFlight-Plugin. When exporting to OpenFlight it could happen that palettes of an external reference like the texture palette are set wrong, because they are overwritten by parent settings (userData), which actually do not refer to palette entries respectively ParentPools (happens for example if a Transform is parent of a ProxyNode). The static cast from userData to ParentPools should therefore be a dynamic cast.
---------------------------

function FltExportVisitor::writeExternalReference( const osg::ProxyNode& proxy ):

Line 423 in file expPrimaryRecords.cpp has to be changed from

const ParentPools* pp = static_cast<const ParentPools*>(proxy.getUserData() );

to

const ParentPools* pp = dynamic_cast<const ParentPools*>(proxy.getUserData() );
"
2008-10-27 15:26:53 +00:00
Robert Osfield
b28612bce2 Various warning fixes 2008-10-27 13:09:43 +00:00
Robert Osfield
e062524cb4 Updated wrappers 2008-10-27 11:49:31 +00:00
Robert Osfield
756b9c389a From Mathias Froehlich, "This change is a result of a recent thread on osg-users.
The semantic change that went into the ac loader with the past patch was
incorrect wrt the document describing the behaviour of ac files and
inconsistent with what ac3d itself displays for that files.
This attached change reverts the behaviour to the original one. The
infrastructure to change this is left in place.
The change is based on rev 9045."
2008-10-27 11:08:54 +00:00
Robert Osfield
d703c58936 From Blasius Czink, "Among other things I added support for atomic operations on BSD-like systems and additional methods (for "and", "or", "xor").
"

and a later post the same osg-submissions thread:

"it's been a while since I have made the changes but I think it was due to problems with static builds of OpenThreads on windows. I was using
OpenThreads in a communication/synchronisation library (without
OpenSceneGraph). It seems I forgot to post a small change in the CMakeLists file of OpenThreads. If a user turns DYNAMIC_OPENTHREADS to OFF (static build) OT_LIBRARY_STATIC will be defined in the Config.
Without these changes a windows user will always end up with a "__declspec(dllexport)" or "__declspec(dllimport)" which is a problem for static builds."

And another post from Blasius on this topic:

"I tested with VS2005 and VS2008. For 32 bit everything works as expected. For x64 and VS2008 I could successfully do the cmake-configure and then the compilation but I had occasional crashes of cmTryCompileExec.exe (during the cmake-configure phase) which seems to be a cmake bug. With VS2005 and 64bit cmake does not set _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED although the interlocked functionality should be there. If I place the source snippet from the CHECK_CXX_SOURCE_RUNS macro to a separate sourcefile I can compile and run the resulting executable successfully. Forcing OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED (on VS2005/x64) reveals a bug in "intrin.h" which seems to be fixed in VS2008 but not in VS2005.

In case anyone is interested the lines:
__MACHINEI(unsigned char _interlockedbittestandset(long *a, long b))
__MACHINEI(unsigned char _interlockedbittestandreset(long *a, long b))
__MACHINEX64(unsigned char _interlockedbittestandset64(__int64 *a, __int64 b))
__MACHINEX64(unsigned char _interlockedbittestandreset64(__int64 *a, __int64 b))

should be changed to:
__MACHINEI(unsigned char _interlockedbittestandset(long volatile *a, long b))
__MACHINEI(unsigned char _interlockedbittestandreset(long volatile *a, long b))
__MACHINEX64(unsigned char _interlockedbittestandset64(__int64 volatile *a, __int64 b))
__MACHINEX64(unsigned char _interlockedbittestandreset64(__int64 volatile *a, __int64 b))

The worst thing that can happen is that interlocked funtionality is not detected during cmake-configure and the mutex fallback is used.
Which reminds me another small glitch in the Atomic header so I attached a corrected version.



    Why is the OT_LIBRARY_STATIC added to the config file? It is not needed anywhere.

OT_LIBRARY_STATIC is needed if you are doing static-builds on Windows. See my previous post on that.
"
2008-10-27 10:42:58 +00:00
Robert Osfield
b1c858d8f8 Fixed positioning of wings 2008-10-27 10:40:13 +00:00
Robert Osfield
71814fe266 From Mathieu Marache, "I came across a bug when building OpenSceneGraph with
MSVC_VERSIONED_DLL, NMake makefiles and CMake 2.6.2.
The compilation fails because it tries to copy ot11-OpenThreads.lib to
OpenThreads.lib which is valid for the 2.4.x era of CMake but not
anymore in 2.6.x era.
The provided file from the CMakeModules directory adds a tests on the
CMake version and corrects this. Works for me now."
2008-10-27 09:48:34 +00:00
Robert Osfield
32907d679f From Alberto Lucas, fixed typo 2008-10-27 09:44:49 +00:00
Robert Osfield
0ff3f48693 Improved the support for no pre compile, and configuring the number of threads in the DatabasePager. 2008-10-26 22:22:38 +00:00
Robert Osfield
1cb2fc259e Improved the error reporting 2008-10-26 22:21:09 +00:00
Robert Osfield
20da8e55a8 From Jim Vaughan,
- Matrix transform nodes were stripped out, and the
vertices and normals of each node were
transposed by the modelling matrix.  My change preserves
the matrix transform nodes, so that
models can still be articulated by changing the matrices.

- Lights were copied from the COIN scenegraph to the OSG
scenegraph, but they were not associated
with a LightSource node.  My change for this creates a
Group and adds a LightSource for each Light.

- If VRML textures have names, the name is now copied to

--

Form Robert Osfild, changed SbString to std::string usage


M    Inventor/ConvertFromInventor.h
M    Inventor/ConvertFromInventor.cpp
2008-10-25 13:17:22 +00:00
Robert Osfield
48c31e5885 From Alberto Luaces, "it seems a copy-paste error is present on the OBJ loader when parsing the
options given by the user. "noTesselateLargePolygons" is being activated
instead of "noTriStripPolygons". I'm attaching the fixed file."
2008-10-24 11:38:40 +00:00
Robert Osfield
37cd3b419c Fixed typo 2008-10-24 10:02:13 +00:00
Robert Osfield
284d7c911d Add osgParticle:: qualifiers in front of Program entries to avoid issues when combining osg::Program and osgParticle::Program in a single app 2008-10-24 09:59:12 +00:00
Robert Osfield
b2ffdacd80 Changed timing stats to osg::INFO level 2008-10-24 09:49:55 +00:00
Robert Osfield
19a51b5aff Removed debugging test. 2008-10-24 08:09:36 +00:00
Robert Osfield
c1fd14fb2c Introduced new method of management the number of PagedLOD active, by using
a capping the number of PagedLOD to a sepcified maximum, with pruning of inactive
PagedLOD when the total number of inactive and active PagedLOD goes above the maximum.

To enable the mode set the env var OSG_MAX_PAGEDLOD to a value something like 1000.
2008-10-23 16:33:14 +00:00
Robert Osfield
f4f6aa288d From Panagiotis Koutsourakis, "We are using Open Scene Graph for an application and we need COLLADA
support. While testing the pluggin we found a small bug and we are
submitting a patch.

The first attachment is a small program that creates a scene with two
pyramids, transformed by two instances of
osg::PositionAttitudeTransform. One of them is rotated 90 degrees in
the X axis, and the scene is exported both in the native OSG (.osg)
and COLLADA (.dae)  formats. In the first case the rotated pyramid is
displayed correctly whereas in the second the pyramid seems not to be
rotated.

In the COLLADA 1.4.1 specification (found at
http://www.khronos.org/collada/) it is specified that
"The <rotate> element contains a list of four floating-point values
[...] followed by an angle in degrees" but the plugin seems to write
the value in radians.

The problem seems to be in the method daeWriter::apply() that seems to
be writing the angle value in radians to the COLLADA file. The patch
can be found in the second attachment and is simply a call to
RadiansToDegrees wrapped around the angle.
"
2008-10-21 16:39:24 +00:00
Robert Osfield
fd5f9741d3 From Wojciech Lewandowski, "I made a minor tweak in StandardShadowMap.cpp. As agreed with J-S I have added AlphaFunc/AlphaTest to shadow camera stateset to make sure transparent objects will not cast blocky solid shadows." 2008-10-21 16:32:55 +00:00
Robert Osfield
3b5f9f1e5d From Chris Denham, "However, just spotted another inconsistency between UFOManipulator::getMatrix() and UFOManipulator::getInverseMatrix()
It assumes that inverse(_inverseMatrix * _offset) = _offset * _matrix
This is only true when _offset=identity, so I think it should be inverse(_offset) * _matrix
This inconsistency can cause problems when switching from UFO to other manipulators, because the UFO:Manipulator::getMatrix function is not necessarily returning a correct inverse of the currently set ModelViewTransform.
It was tempting to change the name of the _offset member to _inverseOffset, or to maintain both variables, but in the end went for the minimal change."
2008-10-21 16:31:01 +00:00
Robert Osfield
144e44a749 From Per Fahlberg, "I ran into a problem when using another library that implemented the same functions as the osg jpeg plugin, i guess they both originated from the same example code :) As a solution I added a namespace in ReaderWriterJPEG.cpp around the functions.
"
2008-10-21 16:27:22 +00:00
Robert Osfield
01593240ed #if'd out an premature StateSet optimization that was causing problems with datasets that mixed multi-texture coord geometry with single texture coord geometries in a single scene graph. 2008-10-21 15:51:56 +00:00
Robert Osfield
f058fc299e Updated wrappers 2008-10-21 09:50:07 +00:00
Robert Osfield
24eb2f6c43 Introduce osgDB::FileCache, and updated osgfilecache and DatabasePager to use it. 2008-10-20 16:24:57 +00:00
Robert Osfield
10186190f6 Introduced support for controlling mipmapping of osgTerrain::ImageLayer and compression of osgTerrain::HeightFieldLayer. 2008-10-20 08:43:25 +00:00
Robert Osfield
351ac1614c From Paul Melis, fixed typo 2008-10-17 09:16:02 +00:00
Robert Osfield
61bd2b825f From Chris Denham, "I noticed that UFOManipulator _matrix and _inverseMatrix may be inconsistently set due to typo in
UFOManipulator::home().
I assume the intention is that _matrix and _inverseMatrix are kept consistent, so corrected file attached.

///////////// OSG 2.6 //////////////////
  _inverseMatrix.makeLookAt( _homeEye, _homeCenter, _homeUp );
  _matrix.invert( _matrix );
///////////// after typo correction /////////////////
 _inverseMatrix.makeLookAt( _homeEye, _homeCenter, _homeUp );
  _matrix.invert( _inverseMatrix );
///////////////////////////////////////"
2008-10-15 10:07:21 +00:00
Robert Osfield
f66a285b01 Changed erroneous ZLIB_INCLUDE_DIRS to ZLIB_INCLUDE_DIR 2008-10-14 17:20:58 +00:00
Robert Osfield
1bbab1fcc7 From Jason Beverage, "Here is a small change to the CURL plugin to distinguish between a 400 level error and a 500 level error.
If a 400 level error occurs, a FILE_NOT_FOUND ReadResult is appropriate.

If a 500 level error occurs (such a 503, Service unavailable), the application might want to try to load the file again in a few seconds/minutes.  This submission returns ERROR_IN_READING_FILE if a 500 level error occurs so that clients can easily distinguish between the errors.

The actual error code is also added to the "message" of the ReadResult so if a client needs more information, they can just parse the message to retrieve the error code."
2008-10-14 16:57:37 +00:00
Robert Osfield
36a93d9cf3 Converted M_PI* usage across to osg::PI 2008-10-14 16:44:14 +00:00
Robert Osfield
ec797b3a81 From Ricard Schmidt, dot writer plugin. 2008-10-14 16:35:03 +00:00
Robert Osfield
8c6f65caca From James Moliere,
"   The code below is to show how a heirarchy of objects can be made within a scenegraph.
    In other words, how there can be a parent/child relationship between objects such
    that when a parent is rotated or translated, the children move is respect to it's
    parent movement.  A robotic arm is used in this example because this is what I'm
    using OSG for."
2008-10-14 15:24:39 +00:00
Robert Osfield
e4057b65ee Removed geomoflife_frag.cpp experiement from CMakeList.txt file 2008-10-14 15:10:10 +00:00
Robert Osfield
3aebed206e From J.P Delport, game of life example that demonstrates ping pong render to texture rendering 2008-10-14 14:58:10 +00:00
Robert Osfield
78d731a316 Added zlib support to curl and ive plugins 2008-10-14 14:37:11 +00:00
Robert Osfield
ad78c21e07 Added debug timing code 2008-10-14 14:36:24 +00:00
Robert Osfield
ac975bf79a Added a Refrenced::getGlobalReferencedMutex, and OpenThreads::ScopedPointerLock() and use of this in add/removeParent() codes
to avoid threading problems when using atomic ref counting.
2008-10-14 14:27:41 +00:00
Robert Osfield
af13e84093 UPdated version numbers 2008-10-14 14:25:54 +00:00
Robert Osfield
d8525815fd Moved compress/uncompress code across to using gzip compatible methods 2008-10-10 12:01:54 +00:00
Robert Osfield
46172c931e Added initial cut of gz compress/uncompress plugin 2008-10-09 18:46:49 +00:00
Robert Osfield
ab3ecd129d Initial cut of zlib based compress/uncompress plugin 2008-10-09 17:02:16 +00:00
Stephan Maximilian HUBER
df0fcbdf9b From Stephan Huber: updated XCode-project, added osgVolume-lib 2008-10-09 13:16:49 +00:00
Robert Osfield
c3af8b1c8e Fixed the frame rate reporting so that it handles the case when animation is slowed or speeded up 2008-10-09 08:52:14 +00:00
Robert Osfield
e41ee9f951 Updated date 2008-10-08 13:19:16 +00:00
Robert Osfield
f75e43e93a Updated ChangeLog and AUTHORS.txt for 2.7.3 dev release 2008-10-08 13:18:14 +00:00
Robert Osfield
9cd739d45c Updated wrappers 2008-10-08 12:54:45 +00:00
Robert Osfield
c47d63ba1c Added friend struct ViewData to try and avoid compile issues under HP-UX 2008-10-08 12:29:43 +00:00
Robert Osfield
5e95d6e3b5 Added Texture1D(Image*) and Texture3D(Image*) constructors 2008-10-08 11:30:18 +00:00
Robert Osfield
a4aa8fbcd2 Replaced std::vector::insert with std::copy + back_inserter to avoid member template problems with sunos. 2008-10-08 10:55:20 +00:00
Robert Osfield
29c0e913d7 From Mathias Froehlich, fixes for HP-UX, SGI and Solaris build 2008-10-08 10:10:34 +00:00
Robert Osfield
91d20fb3ec Moved OSG_FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL into src/osg/CMakeLists.txt 2008-10-07 15:59:10 +00:00
Robert Osfield
9b83cad247 Made line graph solid (alpha = 1.0) 2008-10-07 15:58:07 +00:00
Robert Osfield
4f684d16f2 From Jean-Sebastien Guay and Robert Osfield, added setDataVariance(osg::DYNAMIC) to avoid problems to optimization. 2008-10-07 15:41:47 +00:00
Robert Osfield
8ea9fad93a Added osgText to link line 2008-10-07 15:21:12 +00:00
Robert Osfield
c569b8a1f3 Restoring Roger's original 2.0 factor as on review the later orthographic projection code
doesn't require the position to be far out from the center to simulate an infinite light.
2008-10-07 15:19:48 +00:00
Robert Osfield
ad72dc66ce From Roger James, "The light position is incorrectly calculated for shadow casting scenes whose bounding box centre is not the origin. This is a one line fix.
"
2008-10-07 15:16:37 +00:00
Robert Osfield
09e6261e9a From Wojciech Lewandowski and Robert Osfield, add CMake build option for controlling the Windows/NVidia multi-monitor workaround. 2008-10-07 14:36:46 +00:00
Robert Osfield
0daf1f007a Updated wrappers 2008-10-07 14:25:09 +00:00
Robert Osfield
b7fa3f6f3c Replaced IntersectVisitor usage with IntersectionVisitor 2008-10-07 14:19:28 +00:00
Robert Osfield
907a51b198 Replaced usage of depreacted IntersectVisitor with IntersectionVisitor 2008-10-07 14:01:14 +00:00
Robert Osfield
ed2bbbf23b From Jean-Sebastirn Guay, "Inspired by the latest additions to the StatsHandler, here is my own addition. It's a graph that helps show the variation of the various stats over time. It's clearer than just having bars for the last 10 frames or so, IMHO, since 10 frames go by pretty fast...
The graph is displayed "under" (behind) the normal bar chart you get when you press 's' twice. It doesn't hide the normal stats, you can still read them without any trouble, and that way, it doesn't take any more screen space. It starts from the left, and will scroll left when there is enough data to fill the screen width. The graph lines have the same colors we're used to (except I made the event color a bit bluer, so it's not exactly the same as the update color). A screen shot is attached.

The lines get a bit confused when they're all overlapping at the bottom of the graph, but I think that's the least of our concerns (if they're all at the bottom of the graph - except FPS of course - then great!).

The only thing I'm not very keen about is that to make things simple, I clamp the values to a given maximum. Right now, the maximums I have set are:

* Frame rate: 100 fps (people have 60, 75, 85Hz refresh rates, so there's no one right value, but I think 100 is OK)
* Stats: 0.016 seconds (what you need to get 60Hz minimum)

This could be changed so that the scale of the graph changes according to the maximum value in the last screenful of the graph instead of clamping values. We would then need to display the scale for each value on the side of the graph, because if the scale changes, you need to know what it is at this moment.

I tried to make things easy to change, so for example if you don't like that the graph is in the same space as the normal stats bars, it's easy to move it anywhere else, and make it have other dimensions. The maximums and colors are also easy to change.

The impact on performance should be minimal, since it's one vertex per graph line that's added per frame, and vertices are removed when they scroll off the screen, so you'll never have more than say 1280 * (3 + ncameras) vertices on the screen at one time. No polygons, I used line strips. The scrolling is done with a MatrixTransform."
2008-10-07 13:37:04 +00:00
Robert Osfield
af30f0769a From Colin McDonald, "Attached is an update to the dxf plugin which adds rudimentary support for
text entities.
"
2008-10-07 13:06:53 +00:00
Robert Osfield
ff8c6aa32b From Mathias Froehlich, build fixes 2008-10-07 12:31:42 +00:00
Robert Osfield
8c98220878 Added the ability to release OpenGL objects in PagedLOD subgrphs that are no longer being rendered. 2008-10-07 11:35:41 +00:00
Robert Osfield
6ec4c64914 Updated wrappers 2008-10-06 17:15:16 +00:00
Robert Osfield
1f4e712fd8 Improved the ImageSequence::setLength() settting. 2008-10-06 17:03:32 +00:00
Robert Osfield
400e6eb09a Updated to reflect changes in NodeVistor::ImageRequestHandler. 2008-10-06 17:02:56 +00:00
Robert Osfield
8147bd4df8 Refactored ImageSequence to provided a cleaner and more robust implementation 2008-10-06 17:02:20 +00:00
Robert Osfield
7e43decf4c From Wojciech Lewandowski, build fixes for handling Matrix::value_type == float 2008-10-06 14:18:27 +00:00
Robert Osfield
df12c7bc68 Ran dos2unix 2008-10-06 14:15:27 +00:00
Robert Osfield
9cce90e920 From Glenn Waldron, "osgTerrain::Locator::setTransformAsExtents() does not update the _inverse member. Fix attached.
"
2008-10-06 09:39:43 +00:00
Robert Osfield
45085f3eea Converted tabs to four spaces 2008-10-06 08:58:50 +00:00
Robert Osfield
236832f669 Ran dos2unix on headers 2008-10-06 08:53:54 +00:00
Robert Osfield
87e8f06522 Ran dos2unix on new shadow implemenations 2008-10-06 08:53:25 +00:00
Robert Osfield
5fe30854dd From Jason Beverage, "Attached is a fix for getTile in the Terrain class. It should be checking for itr == _terrainTileMap.end() instead of itr != _terrainTileMap.end()." 2008-10-06 08:48:44 +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
7c6dbe0ed8 Moved the OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION definition into the Config.in rather use of -D define 2008-10-03 15:36:34 +00:00
Robert Osfield
3c52c2578f Updated wrappers 2008-10-03 15:15:33 +00:00
Robert Osfield
13d0292f29 Added optional compile of the new ref_ptr<>:T* operator() output conversion operator, controlled via a CMake option OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION. 2008-10-03 15:15:04 +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
56bc3ae194 Compile fix required when using ref_ptr<> implicit output conversion 2008-10-03 13:38:55 +00:00
Robert Osfield
eb5a656f4e From Neil Groves, added intrusive_ptr_add_ref and intrusive_ptr_release methods to enable
usage of boost::intrusive_ptr<> with osg::Referenced objects.
2008-10-03 13:34:32 +00:00
Robert Osfield
281f55a55c From Bryan Thrall, fixed typos in exception strings. 2008-10-03 11:04:23 +00:00
Robert Osfield
7a6ec46535 From Paul Martz, "I had to make Yet Another tweak to the workaround for the occlusion query issue on NVIDIA cards. Testing indicates that this produces stable results. I checked this in to the 2.6 branch as revision 8965. Please include this on the trunk" 2008-10-03 11:02:13 +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
830bb21a32 From Tatsuhiro Nishioka, submissions posted by Stephan Huber, "attached you'll find a modified ReaderWriterQT.cpp-file where I removed the support for rgb(a)-files.
Quicktime supports only files with 3/4-channels rgba-files and not 1/2-channels rgb-files.

This submission is from Tatsuhiro Nishioka, here's his original quote:

    When FlightGear crashes, the error message
    "GraphicsImportGetNaturalBounds failed" shows up. By adding printf
    debug, I found the error was -8969: codecBadDataErr when loading a
    gray-scaled (2 channels) rgba files even though the file can be loaded
    with Gimp and osgViewer properly.

    So I made an investigation on this problem and found an interesting
    thing. This error occurs only when non-rgb files are loaded before rgb
    files. The reason is that rgba files can be handled by both
    osgdb_rgb.so and osgdb_qt.so, but the error happens only when
    osgdb_qt.so try to load a gray-scaled rgba file.

    When a program is about to load an rgba file, osgdb_rgb.so is loaded
    and it handles the rgba file properly. In contrast, when a gray-scaled
    rgb file is being loaded after a non-rgb file (say png) is already
    loaded by osgdb_qt.so, osgdb_qt.so tries to load the file instead of
    osgdb_rgb, which causes the error above.

    Anyway, the bad thing is that QuickTime cannot handle gray-scaled rgb
    files properly. The solution for this is not to let osgdb_qt handle
    rgb files since osgdb_rgb can handle these properly.

"
2008-10-03 09:22:40 +00:00
Robert Osfield
4bde492d8c From Stephan Huber, removed now redundent setEventQueue method 2008-10-03 09:19:53 +00:00
Robert Osfield
fb9181ff17 From Roland Smeenk, A year ago Stephan Maximilian Huber sent in a submission with enhanced statistics. Because I was interested in the scene statistics of his submission I tried to merge his changes with the current CVS head. I made a few changes to the way the statistics are displayed. Attached you will find the new StatsHandler and a screenshot of the statistics in the compositeviewer example.
This code will add two extra statistics options:
-Camera scene statistics, stats for the scene after culling (updated at 10 Hz)
-View scene statistics, stats for the complete scene (updated at 5 Hz)
 
Each camera and each view will expand the statistics to the right.
 
I also added the requests and objects to compile of the databasepager to the databasepager statistics.""
2008-10-03 09:02:23 +00:00
Robert Osfield
03cec07df8 From Mathias Froehlich, Wr.t AC3D Texture clamping "I had a quick look at the problem.
Attached is a change that is able to provide shared textures for the clamp and
the repeat case.
So this appears to be the best fix I guess ...

Also it additionaly shares the TexEnv StateAttribute in a whole ac3d model."
2008-10-03 08:35:59 +00:00
Robert Osfield
82318cfd04 Added missing dirtyBound() calls 2008-10-03 08:33:17 +00:00
Robert Osfield
3b4184295e Various improvements to the dicom loader to be able to handle a broader range of dicom files 2008-10-02 15:45:08 +00:00
Robert Osfield
66c857b645 Updated shaders 2008-09-29 18:30:17 +00:00
Robert Osfield
c03b64731b Improved the dicom plugins handling of different slice positions 2008-09-29 17:00:38 +00:00
Robert Osfield
723ebd3334 Turned off the yaw mode on the FlightManipilator to make it easier to navigate in volumes 2008-09-29 13:22:12 +00:00
Robert Osfield
8346e82cf5 From Mathieu Marache, support for CDash 2008-09-29 11:00:42 +00:00
Robert Osfield
34044c5989 From Erik den Dekker, "I received a compiler warning in osgDB::registry::readObjectOfType while compiling SVN trunk with MSVC 2008.
..\..\..\..\src\osgDB\Registry.cpp(910) : warning C4806: '==' : unsafe operation: no value of type 'bool' promoted to type 'osgDB::Registry::LoadStatus' can equal the given constant

A quick review of the code revealed a piece of code that was clearly wrong, possibly due to a copy-and-paste error.

 "
2008-09-29 10:59:54 +00:00
Robert Osfield
d4c6af753f Added support for using ImageSequence to animate volumes 2008-09-29 10:56:42 +00:00
Robert Osfield
38171cc1b9 Improved the isosurface shaders, and mde GLSL usage the default 2008-09-28 15:16:13 +00:00
Robert Osfield
d8cfc9b1f5 Improved GLSL isosurface support when using a transfer function 2008-09-26 15:47:31 +00:00
Robert Osfield
21865d3ec1 Added setting of various filters and setResizeNonPowerOfTwoHint(false) on normals maps etc. 2008-09-26 14:50:41 +00:00
Robert Osfield
5a9e957412 Added docs for read-threads <numthreads> command line options 2008-09-26 13:51:49 +00:00
Robert Osfield
0fdb54d8bb Changed loadLibrary so that it retusn a LoadStatus variable to enable calling
codes to differentiate between whether a library is already loaded, or is newly loaded
2008-09-26 13:51:18 +00:00
Robert Osfield
026314bf83 Added --isosurface and --mip paths into osgvolume example, and added associted shaders 2008-09-26 11:29:00 +00:00
Robert Osfield
90ccb05fb1 From Mathias Froehlich, "for the rand functions stdlib.h is required ..." 2008-09-26 11:19:59 +00:00
Robert Osfield
195ad58494 From Lionel Lagarde, "Here is a correction on DatabasePager::FindCompileableGLObjectsVisitor
The apply(osg::Drawable *) method doesn't update the _drawableSet and
the isCompiled test was inversed."
2008-09-26 10:59:28 +00:00
Robert Osfield
bce664dcab From Fabio Mierlo, "n the lines 428 and 430 of obj.cpp file from release 2.6.0, the parser
use only the first 7 characters to compare the string "map_opacity "
and to copy the followed parameter, but the string have 12 characters."
2008-09-26 10:43:18 +00:00
Robert Osfield
794a3ff257 From Mathieu Marache, added support for CDash 2008-09-25 15:20:20 +00:00
Robert Osfield
3bbd4bbfd6 Removed unused methods 2008-09-25 15:19:42 +00:00
Robert Osfield
57150bb86a Updated wrappers 2008-09-25 15:04:05 +00:00
Robert Osfield
a3d25add27 Added osg2cpp example into build 2008-09-25 14:41:27 +00:00
Robert Osfield
a3314e35a7 Added convinience methods for parse shader source files 2008-09-25 14:41:06 +00:00
Robert Osfield
8c276a0b5e Created new osg2cpp utility that creates .cpp files from source shaders that can be included directly in application code, see osgvolume for an example. 2008-09-25 14:39:57 +00:00
Robert Osfield
134a2e69a0 Moved shaders into .cpp, with the shaders created by the new osg2cpp utility 2008-09-25 14:39:08 +00:00
Robert Osfield
36409f8597 Added .vert and .frag to list of accepted extension in the GLSL plugin 2008-09-25 10:21:44 +00:00
Robert Osfield
4cb79dcddf From Jean-Sebastian Guay, fixed windows build 2008-09-24 16:03:47 +00:00
Robert Osfield
306a9dd6db From Riccardo Corsi, Added 3gp file extension to supported list in quicktime plugin 2008-09-24 16:00:45 +00:00
Robert Osfield
5a87473444 Added 3gp extension alias for quicktime 2008-09-24 15:59:55 +00:00
Robert Osfield
62331769ac Added shader based transfer function, enabled via --gpu-tf 2008-09-24 10:45:15 +00:00
Robert Osfield
169d9f550e Fixed transfer function parsing 2008-09-24 10:20:23 +00:00
Robert Osfield
5c264c7c74 Added mutex usage to protect access to plugin and readerwriter containers 2008-09-23 17:29:28 +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
b1c93f05f6 From Wojciech Lweandowski, added support for noew LispSM shadow technique (use --lispsm on CmdLine) and added IslandScene database (use -4 on CmdLine). 2008-09-23 09:59:23 +00:00
Robert Osfield
55d4756d31 Added support for reading raw data and transfer function from a volume header 2008-09-22 17:24:26 +00:00
Robert Osfield
65cb2e625f Added --page-and-discard, --page-and-retain, --preload and --length command line options 2008-09-22 16:18:02 +00:00
Robert Osfield
71af4851c7 Fixed typo 2008-09-22 16:17:28 +00:00
Robert Osfield
260334e4fe Added stats handler 2008-09-22 15:56:22 +00:00
Robert Osfield
976df65bcc From Ulrich Hertlein, fixes for OSX build 2008-09-22 15:01:25 +00:00
Robert Osfield
e9e3a533ea Changed OSG_DEBUG_POSTFIX to use ADDQUOTES in the .cpp rather than trying to add quotes via CMakeLists.txt 2008-09-22 14:58:35 +00:00
Robert Osfield
8f4335825b From Ralf Habacker and Robert Osfield, added search for plugins with OS specific file plugin extensions 2008-09-22 14:55:19 +00:00
Robert Osfield
48fe06fec3 Added getExtensionIncludingDot to provide more efficient handling of extensions 2008-09-22 14:46:54 +00:00
Robert Osfield
922b85b386 Changed the macro usage so that the quotes are now added inside the .cpp 2008-09-22 13:16:29 +00:00
Robert Osfield
fa77f50260 Added readNode implementation that creates an osgVolume::Volume for the specified dicom file. 2008-09-22 11:13:50 +00:00
Robert Osfield
3ec2c22ad4 Added Volume wrappers, and updated terrain wrappers 2008-09-21 11:12:31 +00:00
Robert Osfield
00f6622ac8 Create initial class placeholders for main volume rendering classes 2008-09-21 11:05:03 +00:00
Robert Osfield
ae08a5b261 Change TileID::layer to TileID::level 2008-09-20 15:43:38 +00:00
Robert Osfield
c35159fdde From Chris Denham, changed gluGetErrorString to using osg::State::checkGLErrors() to avoid null pointer dereference 2008-09-20 10:34:47 +00:00
Robert Osfield
4aaf24b5d8 From Mathias Froehlich, added catch for GL_COLOR_MATERIAL mode being set. 2008-09-20 10:09:56 +00:00
Robert Osfield
8552faf774 From John Vida Larring, "If an application initializes osgViewer::GraphicsWindowEmbedded() but never gets around to do any rendering before the application is closed, the result with be a crash (SIGABRT/std::logic_error) in osg::getGLVersionNumber().
The fix was to check whether glGetString( GL_VERSION ) returned a null pointer (Ref. svn diff below). The altered src/osg/GLExtensions.cpp is zipped and attached to this email."
2008-09-20 10:05:31 +00:00
Robert Osfield
0b5852948d Added wrapper support for new osgShadow classes 2008-09-19 19:51:57 +00:00
Robert Osfield
bf15614df6 From Wojciech Lewandowski, a range of new ShadowMap implementations include View Dependent Shadow Maps - LispSM
From Robert Osfield, refactored Wojciech's submission to integrated with osgShadow and use coding sytle more consistent with rest of OSG.
2008-09-19 19:51:27 +00:00
Robert Osfield
f388d6a938 From Mathias Froehlich, added support for search in the installed directories for plugins 2008-09-19 12:49:22 +00:00
Robert Osfield
a961b880bb From Richard Schmidt, fixed the handling of user data so that it uses ref_ptr<> to avoid data getting deleted. 2008-09-19 08:16:41 +00:00
Robert Osfield
9f1672ca4c Updated ChangeLog 2008-09-18 16:48:21 +00:00
Robert Osfield
44113cfa14 Added Serializer wrappers 2008-09-18 16:03:34 +00:00
Robert Osfield
90d5c9d0c6 Moved Serializer header from VPB into osgDB. 2008-09-18 15:50:22 +00:00
Robert Osfield
7615c7073c Updated wrappers 2008-09-18 15:44:21 +00:00
Robert Osfield
91f7895735 refactored the getWindows(..) and getContexts(..) methods so that they produce
consistent ordering based on the order Camera/slave camera ordering.
2008-09-18 15:18:59 +00:00
Robert Osfield
8bdb22c22e From Mathias Froehlich, "Attached one namespace/scope lookup problem which shows up on irix." 2008-09-18 15:16:57 +00:00
Robert Osfield
1d328ba0d4 From Christopher Blaesius,
"Soft shadow mapping is basically the same as hard shadow mapping beside that
it uses a different fragment shader.
So for me it makes sense that osgShadow::SoftShadowMap is derived from
osgShadow::ShadowMap, this makes it easier to maintain the two classes.
Additional SoftShadowMap also provides the same Debug methods as ShadowMap."
2008-09-18 14:48:28 +00:00
Robert Osfield
47e07244b9 Updated wrappers 2008-09-18 13:54:22 +00:00
Robert Osfield
9510df9c2e From Alan Dickinson, change methods to virtual. 2008-09-18 13:54:13 +00:00
Robert Osfield
95a822b70d From John Argentieri, added missing _stripTextureFilePath( false ) initializer. 2008-09-18 13:18:12 +00:00
Robert Osfield
9cca510d6c From Chris Denham, added missing ccopy of polyOffset in copy constructor 2008-09-18 13:09:21 +00:00
Robert Osfield
40723ca8ac From Chris Denham, "
I think I may have discovered a bug in osgShadow/ShadowMap.cpp that results in incomplete shadows being generated.
The problem seems to caused by an incorrect interpretation of the spot light cutoff angle. The valid ranges for spot cutoff are 0-90 and 180, i.e half the 'field of view' for the spotlight. Whereas the shadow map code seems to assume the the spot cutoff is equal to the field of view. This results in the shadows generated by the spotlight getting clipped at half the spot cutoff angle.

I have fixed this in my copy of ShadowMap.cpp:
===============================
//Original code from OSG 2.6:
      if(selectLight->getSpotCutoff() < 180.0f)   // spotlight, then we don't need the bounding box
      {
          osg::Vec3 position(lightpos.x(), lightpos.y(), lightpos.z());
          float spotAngle = selectLight->getSpotCutoff();
          _camera->setProjectionMatrixAsPerspective(spotAngle, 1.0, 0.1, 1000.0);

_camera->setViewMatrixAsLookAt(position,position+lightDir,osg::Vec3(0.0f,1.0f,0.0f));
      }
===============================
// My modifications:
      float fov = selectLight->getSpotCutoff() * 2;
      if(fov < 180.0f)   // spotlight, then we don't need the bounding box
      {
          osg::Vec3 position(lightpos.x(), lightpos.y(), lightpos.z());
          _camera->setProjectionMatrixAsPerspective(fov, 1.0, 0.1, 1000.0);

_camera->setViewMatrixAsLookAt(position,position+lightDir,osg::Vec3(0.0f,1.0f,0.0f));
      }

This change seems correct for spot cutoff in the range 0, 90, but since OpenGL doesn't claim to support cutoffs >90 && <180, I'm not sure how shadow map should deal with those cases, but ignoring spot cut off greater than 90 here seems reasonable to me.
"
2008-09-18 13:05:24 +00:00
Robert Osfield
4923c88bd0 From Ralf Habacker, "the appended patch fixes the problem reported on http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2008-January/006110.html. "
> Using QOSGWidget - QWidget + osgViewer creating the graphics context.
>
> Windows Error #2000: [Screen #0] GraphicsWindowWin32::setWindow() - Unable
> to create OpenGL rendering context. Reason: The pixel format is invalid.
>
>
>
> And then the following fate error pops up:
>
>
>
> The instruction at "0x014c7ef1" referenced memory at "0x000000a4", The
> memory could not be "read".
>
> Click on Ok to terminate the program
>
> Click on CANCEL to debug the program
>
>
2008-09-18 12:57:15 +00:00
Robert Osfield
8dd9c54229 From Robert Osfield and Christophe Loustaunau, fixes for support for 16bit and 32bit tiff images 2008-09-18 12:50:20 +00:00
Robert Osfield
21686c27af From Mathias Froehlich, "I did some performance test runs with the development gcc-4.4 version.
To make it compiel with future gcc's we sppear to need the attached missing
includes ..."
2008-09-18 10:52:35 +00:00
Robert Osfield
9e47480bc7 From Mathieu Marache, "This is an addition for osgSim reader/writer for the osg ascii file format adding osgSim::OverlayNode support. " 2008-09-18 10:49:18 +00:00
Robert Osfield
0d74d508df From Tim Moore, "his submission fixes a bug when the ModularEmitter and ParticleSystem are in different frames of reference. Specifically, it supports the case where the ParticleSystem is not in the world frame. One way this can come up is if your world coordinate system is Earth-centric; the float coordinates of particles don't have enough precision to avoid terrible jitter and other rendering artifacts, so it's convenient to root the particle systems in a local Z-up coordinate system that gets moved around from time to time.
"

Tweak from Robert Osfield, converted code to use new Drawable::getWorldMatrices method
2008-09-18 10:39:37 +00:00
Robert Osfield
0969a5384b Improved the constness of parameters the Node::getWorldMatrices(..) method.
Added Drawable::getWorldMatrices(const Node*) method.
2008-09-18 10:38:18 +00:00
Robert Osfield
93d4090169 From Rob Bloemkool, "This is a submission for src/osgPlugins/ogr/ReaderWriterOGR.cpp
- adds display of options when using osgconv --formats.
- adds useGroupPerFeature option to have each feature in a separate group. Usage: OSG_OPTIMIZER=OFF osgconv -e ogr -O addGroupPerFeature <infile> <outfile>
"
2008-09-17 20:02:39 +00:00
Robert Osfield
17161a9363 From Ewe Woessner, "I looked at the Anaglyphic stereo implementation in SceneView.cpp and think I spotted some copy-paste bugs.
osg::ColorMask* leftColorMask = _renderStageLeft->getColorMask();
if (!leftColorMask)
{
   leftColorMask = new osg::ColorMask();
   _renderStageLeft->setColorMask(leftColorMask);
               ^^^^ here it said right, I think this should be Left.
}


// ensure that right eye color planes are active.
osg::ColorMask* rightColorMask = _renderStageRight->getColorMask();
                                             ^^^^ similar here, I think this should be right
if (!rightColorMask)
{
   rightColorMask = new osg::ColorMask();
   _renderStageRight->setColorMask(rightColorMask);
}

and i further removed an unnecessary setColorMask."
2008-09-17 19:51:35 +00:00
Robert Osfield
cc079453da From Mattias Helsing,
CMakeLists.txt changes: "I installed latest Cmake(2.6.1) on a new machine and got a CMP008
warning from cmake. This fix set up osg to use the old behaviour which
have worked before. We might set this to NEW but I need to do more
testing first. I'l be able to test this on winxp with msvc80/90 and
ubuntu hardy with gcc-4.2.

quote from cmake cvs log
policy CMP0008 to decides how to treat full path libraries that do not
appear to be valid library file names.  Such libraries worked by
accident in the VS IDE and Xcode generators with CMake 2.4 and below."


OsgMarcroUtils.cmake changes: "On Philips suggestion truncated a redundant if/else construction in
OsgMacroUtils to avoid developer warnings in cmake-2.6.1 concerning
cmake policy CMP0008 which allows full paths to libraries only with
valid library names
"
2008-09-17 19:25:40 +00:00
Robert Osfield
377a553295 From Alberto Luaces, "Cygwin's cmake build adds a "d" postfix to the plugins installed in debug
mode. Nevertheless, the code doesn't acknowledge that, so I had problems with
debug versions of the library not being able to open their plugins whereas
the release versions worked fine.

I have made the same changes in Registry.cpp that are available for the rest
of platforms appending that "d" to their plugins. I have also updated the
CMakeLists.txt file to get "_DEBUG" defined at compilation time. I have
copied the already existent conditional block because of cmake's bizarre
operator precedence. Since Cygwin defines both CYGWIN and WIN32, the
following would suffice:

IF(CYGWIN OR UNIX AND NOT WIN32 AND NOT APPLE)

Sadly, it actually doesn't work, so I wrote a new conditional block just for
Cygwin. I could join the two blocks when the parentheses support is added in
newer versions of cmake."
2008-09-17 18:56:59 +00:00
Robert Osfield
ff119b78cd From Adrian Egli, "i came around reviewing my code, and found now finally a solution to remove the polygon offset issue. as we all know the polygon offset has a different behaviour on different GPU system (ATI, NVidia) and this make the use of
polygon offset complicate. so i looked for a solution to remove this offset.

i changed the shader, also the filtering (default: on) use now a correct 3x3 filter:
 1 0 1
 0 2 0
 1 0 1

div: 6

of course a better one would be
 1 2 1
 2 4 2
 1 2 1

div: 16
but this isn't as performant as the simple filter above is. because we need only 5 texture lookups instead of 9, and the result is still good, if you wish we can add a enum to change the pcf filter type once, if there is a need.


testet on NVidia Quatro 570M and on ATI Radeon X1600

"
2008-09-17 18:54:23 +00:00
Robert Osfield
19d02d8c78 From Adrian Egli, "I changed the PSSM shadow map implementation, if we have filtered turned on, it should be now correct. The implementation is more robut on different scene. i tested it on NVIDIA card against a park scene, a chess board and a terrain.
unfort. i couldn't test it on any ATI system. may there will be still another problem there. if there are still some artefacts. we should try out better fZOffSet value
"
2008-09-17 18:51:17 +00:00
Robert Osfield
7f39dc3499 From Bill Prendergast, "Found a typo in CameraRenderOrderSortOp in osg/GraphicsContext.cpp
(V2.6.0 and prior) as noted below:

struct CameraRenderOrderSortOp
{
   inline bool operator() (const Camera* lhs,const Camera* rhs) const
   {
       if (lhs->getRenderOrder()<rhs->getRenderOrder()) return true;
       if (rhs->getRenderOrder()<lhs->getRenderOrder()) return false;
--->    return lhs->getRenderOrderNum()<lhs->getRenderOrderNum();
              ^^^                      ^^^
   }
};

Corrected code attached."
2008-09-17 18:42:52 +00:00
Robert Osfield
274aa49f8a From Christophe Loustaunau,"
I have found some errors on the example osgGeometryShaders. It's about the varying in the geometry shader.
take a look at the varying vec4 v_color.
In the vertex shader, v_color is initialized to gl_vertex
then in the geometry shader v_color is initialized to gl_PositionIn[0]
and in the fragment shader v_color is used as the fragment color.

Try to initialized v_color to vec4(1.0, 0.0, 0.0, 1.0) in the vertex shader and comment the line :
"    v_color = v;\n"  in the geometry shader, and you will see the lines as black !

It's because you have to use keywords in and out.

extract from : http://www.opengl.org/registry/specs/EXT/geometry_shader4.txt :

in - for function parameters passed into a function or for input varying
variables (geometry only)

out - for function parameters passed back out of a function, but not
initialized for use when passed in. Also for output varying variables
(geometry only).

Then for a geometry shader, a varying must be an array :
extract from : http://www.opengl.org/registry/specs/EXT/geometry_shader4.txt :

Since a geometry shader operates on primitives, each input varying variable needs to be
declared as an array. Each element of such an array corresponds to a
vertex of the primitive being processed. If the varying variable is
declared as a scalar or matrix in the vertex shader, it will be a
one-dimensional array in the geometry shader. Each array can optionally
have a size declared. If a size is not specified, it inferred by the
linker and depends on the value of the input primitive type.


Here is a patch based on the svn version of osg that correct that.
"
2008-09-17 17:25:39 +00:00
Robert Osfield
5209b33c31 From Max Bandazian, "Lines 302-305 of WindowManager.cpp seem to have a parenthesizing error - the code is
if(
                (!win || win->getVisibilityMode() == Window::VM_PARTIAL) &&
                !win->isPointerXYWithinVisible(x, y)
            ) continue;

But it probably should be

if (!win || (win->getVisibilityMode() == Window::VM_PARTIAL) && !win->isPointerXYWithinVisible(x, y)))
   continue;

The effect of the bug is to segfault if a non-osgWidgets::Window node hasn't been excluded from picking via NodeMask."
2008-09-17 17:13:13 +00:00
Robert Osfield
5052432cc7 Updated wrappers 2008-09-17 17:07:52 +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
0598ac3b69 Updated osgwidget examples to use the new osg::clone() methods 2008-09-17 14:23:25 +00:00
Robert Osfield
fbeabc23e0 Updated wrappers of osgWidget 2008-09-17 14:23:05 +00:00
Robert Osfield
5c5ab84420 Tweaks to facilitate osgWrapper build 2008-09-17 14:21:47 +00:00
Robert Osfield
7ec5632bcc Introduce new templated clone(..) methods that return the correct type of object cloned. 2008-09-17 14:21:19 +00:00
Robert Osfield
97b37cb117 Added support for finding DCMTK-3.5.4 installed lib/include placement 2008-09-17 11:43:14 +00:00
Robert Osfield
d57ad27fcc Added osgVolume to docs and wrappers 2008-09-16 18:41:13 +00:00
Robert Osfield
6ea2adf1f5 Introduced beginings of osgVolume NodeKit. 2008-09-16 15:32:23 +00:00
Robert Osfield
28af7882f5 Complted the first pass at the DCMTK based dicom loader 2008-09-16 15:31:47 +00:00
Robert Osfield
b5474780c3 Change the GLSL textureRec and texture2D parameters to use .st to make sure they only use 2D coords.
Add setResizeNonPowerOfTwoHint to false for Texture2D.
2008-09-16 09:31:29 +00:00
Robert Osfield
d07f3d5662 Added optional usage of DCMTK in the dicom plugin 2008-09-15 19:59:12 +00:00
Robert Osfield
c7b66322be From Ralf Habacker, removed redundent SwitchLayer::clear() 2008-09-15 11:27:30 +00:00
Robert Osfield
d71a6f6cab Introduced Geometry::containsSharedArrays() and Geometry::duplicateSharedArrays() to
support a fix to the osgUtil::Simplifier that couldn't handle shared arrays
2008-09-14 10:31:27 +00:00
Robert Osfield
b55ed0c56b Added reading of whole directories of images 2008-09-13 13:38:06 +00:00
Robert Osfield
995ead176a Introduced TransferFunction1D::assign(ValueMap&). 2008-09-13 09:09:51 +00:00
Robert Osfield
b000198cc4 Removed use of ints and reading from gl_FragColor in shader 2008-09-12 15:41:30 +00:00
Robert Osfield
dc1b52aa7c Updated version numbers in prep for up comming dev release 2008-09-11 16:11:51 +00:00
Robert Osfield
9c97895116 Added an svn update into the make ChangeLog entry. 2008-09-11 16:06:37 +00:00
Robert Osfield
f494bc5b8a Updated wrappers 2008-09-11 16:01:17 +00:00
Robert Osfield
e1930d127e Refinements to SwitchLayer and WhiteListTileLoadedCallback 2008-09-11 14:28:42 +00:00
Robert Osfield
2be243deda Added support for SwitchLayer into GeometryTechnique 2008-09-11 14:27:50 +00:00
Robert Osfield
ff299eb104 Introduced osgTerrain::WhiteListTileLoadedCallback for the management of options terrain layers 2008-09-11 13:21:58 +00:00
Robert Osfield
a214a677f8 First cut of WhiteListTileLoadedCallback 2008-09-11 10:40:48 +00:00
Robert Osfield
04a3f0da1c Changed the createGeodeFromImage code to use the non power of two extension, and disabled mipmapping 2008-09-11 09:26:14 +00:00
Robert Osfield
4f6b405edf Added support for reading source image file names from the command line. 2008-09-11 09:05:16 +00:00
Robert Osfield
b4b5b5ea41 Introduced TerrainTile::TileLoadedCallback 2008-09-10 18:11:54 +00:00
Robert Osfield
ed4bd41574 Removed unneccessary compound name usage 2008-09-10 16:17:17 +00:00
Robert Osfield
898a0c11c2 Removed debugging output 2008-09-10 11:38:49 +00:00
Robert Osfield
f738ab8fe2 Changed the image reading so that it leverages the osgDB::Input::readImage() method
to ensure that it picks up on any local paths set on the Input object.
2008-09-10 11:28:47 +00:00
Robert Osfield
c266cef6b1 Changed the path management so that the node path is prepended on the database path list, rather than replacing it. 2008-09-10 11:27:45 +00:00
Robert Osfield
b0cf7823a7 Added playing of the imagesequence on creation of the imagesequence 2008-09-10 11:27:00 +00:00
Robert Osfield
45ccf11161 Added osg::Image::set/getWriteHint() that allows images themselves to control how
they are written to disk, either inline or as an external file.  Added support for
this in the .ive plugin.  Default of WriteHint is NO_PREFERNCE, in which case it's
up to the reader/writer to decide.
2008-09-10 11:26:30 +00:00
Robert Osfield
c478ad08fc Fix for when looping is is disabled 2008-09-04 17:30:56 +00:00
Stephan Maximilian HUBER
db83ee7add From Stephan Huber: updated XCode-project 2008-09-04 14:23:29 +00:00
Robert Osfield
d2e29efcd9 Added acceptance of .ogv extensions in xine-lib plugin 2008-09-02 16:13:54 +00:00
Robert Osfield
08883dbf6c Added setSetName/getSetName() methods 2008-09-02 12:55:26 +00:00
Robert Osfield
0a5a91f5a1 Update ChangeLog 2008-09-01 16:28:02 +00:00
Robert Osfield
8759984f52 Replaced uint with unsigned int 2008-09-01 15:29:22 +00:00
Robert Osfield
8044188457 Introduced a OSG_MAINTAINER section of cmake build to help support making tags and branches 2008-09-01 15:27:35 +00:00
Robert Osfield
d10d0137b9 Updated wrappers 2008-09-01 14:05:40 +00:00
Robert Osfield
13878d9a2e Changed curr and min to current and minimum respectively, to avoid compile problems under Windows 2008-09-01 14:03:41 +00:00
Robert Osfield
99a294ebae Implemented support for ShapeAttributeList, used John Vidar Larring's initial
submission as a base, but implementing the user data functionality in a different
way to facilitate more flexible user data support
2008-09-01 12:40:33 +00:00
Robert Osfield
befa2112f8 From John Vidar Larring, initial cut of .ive support for ShapeAttributeList user data 2008-09-01 12:39:19 +00:00
Robert Osfield
4a18b9cee1 Updated version for 2.7.2 dev release 2008-09-01 11:09:03 +00:00
Robert Osfield
58f4290310 Updated wrappers 2008-09-01 10:49:22 +00:00
Robert Osfield
6d9206224d Added call to free in setValue methods to prevent potential memory leak 2008-09-01 10:48:28 +00:00
Robert Osfield
2582e0342a From Mathias Froehilch,"Current include/osgSim/ShapeAttribute also misses string.h include because of
strdup.
Attached is the changed file."
2008-09-01 10:46:50 +00:00
Robert Osfield
7945f94246 From He Sicong, "I found a bug here in VERTICAL_SPLIT stereo type:
The vertical separation not actually displayed as it is set.  So some
display the up and down stereo images style will not be correct.
Someone may forget to change the "Horizontal" to "Vertical" after
copying and pasting the code from above HORIZONTAL_SPLIT code segment.
I've attached the file. By replacing the incorrect "Horizontal" to
"Vertical", the bug is gone.
"
2008-09-01 10:22:06 +00:00
Robert Osfield
5484981693 Removed std:: from in front of strcmp and added a string.h 2008-09-01 10:19:06 +00:00
Robert Osfield
2ce8fbdcf9 From Wojciech Lewandowski, "Most recent changes to CameraPathEventHandler change path writing method. Now control points are written on the fly. But default stream precision is not adjusted as it used to and remains set to 6 digits (at least with VS 2008) so larger coordinates like positions on Earth Ellipsoid loose lots of fidelity. This patch fixes this issue.
"
2008-09-01 10:06:19 +00:00
Robert Osfield
8fec858b49 Build fixes for Windows 2008-09-01 09:57:35 +00:00
Robert Osfield
bc747b0935 Added CompositeLayer::addLayer(setname,filename) convinience function 2008-08-29 09:28:28 +00:00
Robert Osfield
141296c323 From Michael Guerrero, "I've attached the files with the new addition of the "registered = true"
flag set."
2008-08-29 09:26:07 +00:00
Robert Osfield
ed617f87df Introduce the concept of layer set name, using the osg::Object::s/getName() to store
the setname, and using a compound string (set:setname:filename) in place of standard filename when reading and writing
files.
2008-08-28 16:15:57 +00:00
Robert Osfield
c8ef144532 Converted AutoTransform to use doubles. 2008-08-28 09:43:00 +00:00
Robert Osfield
95a359bdab Introduced SwitchLayer which will form the basis of provided support for varients 2008-08-27 10:13:30 +00:00
Robert Osfield
9499cfa420 Improved the GLSL implementation. 2008-08-26 17:40:04 +00:00
Robert Osfield
4a5e9e1861 Added ChangeLog target for updating the ChangeLog, and updated the ChangeLog and AUTHORS files 2008-08-26 12:55:26 +00:00
Robert Osfield
6af69a3615 Added wrapper build target for generating the osgWrappers 2008-08-26 12:05:24 +00:00
Robert Osfield
86d2eb1e4a Added provisional block in computePositions() 2008-08-26 09:39:45 +00:00
Robert Osfield
11bd5f39d4 From Ulrich Hertlein, attached is a small fix for a mismatched function signature 2008-08-26 08:41:30 +00:00
Robert Osfield
908f49f6e3 Updated version number for 2.7.1 release, and added OSG_FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL Cmake option
that enables the occlusion query workaround for an OpenGL driver crash
2008-08-25 16:44:48 +00:00
Robert Osfield
7f042b803a From Doug McCorkle, via Paul Martz who writes : "Summary: Some platforms/configurations cause application crashes if the
occlusion query result is not ready for retrieval when the app tries to
retrieve it. This fix adds an application-level wait loop to ensure the
result is ready for retrieval. This code is not compiled by default; add "-D
FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL" to get this code.

Full, gory details, to the best of my recollection:

The conditions under which we encountered this issue are as follows: 64-bit
processor, Mac/Linux OS, multiple NVIDIA GPUs, multiple concurrent draw
threads, VRJuggler/SceneView-based viewer, and a scene graph containing
OcclusionQueryNodes. Todd wrote a small test program that produces an almost
instant crash in this environment. We verified the crash does not occur in a
similar environment with a 32-bit processor, but we have not yet tested on
Windows and have not yet tested with osgViewer.

The OpenGL spec states clearly that, if an occlusion query result is not yet
ready, an app can go ahead and attempt to retrieve it, and OpenGL will
simply block until the result is ready. Indeed, this is how
OcclusionQueryNode is written, and this has worked fine on several platforms
and configurations until Todd's test program.

By trial and error and dumb luck, we were able to workaround the crash by
inserting a wait loop that forces the app to only retrieve the query after
OpenGL says it is available. As this should not be required (OpenGL should
do this implicitly, and more efficiently), the wait loop code is not
compiled by default. Developers requiring this work around must explicitly
add "-D FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL" to the compile
options to include the wait loop."
2008-08-25 16:43:40 +00:00
Robert Osfield
38efb23901 From Liang Aibin, added support for :
osgFX::Effect
    osgFX::AnisotropicLighting
    osgFX::BumpMapping
    osgFX::Cartoon
    osgFX::Scribe
    osgFX::SpecularHighlights.
2008-08-25 15:57:17 +00:00
Robert Osfield
d3dda658a8 From Liang Aibin, removed redundent spaces 2008-08-25 15:37:48 +00:00
Robert Osfield
5c2a4b014e From Michael Guerrero, Fixed crash that occurred when openning an new movie file after all previous movie ImageStream had been closed. Also add a missing close of the movie file. 2008-08-25 15:20:42 +00:00
Robert Osfield
0c9214636f From Paul Martz, "This change fixes a problem with PAT nodes during FLT export."
Note, Paul Martz has merged this patch into OpenSceneGraph-2.6.
2008-08-25 15:03:31 +00:00
Robert Osfield
43d19c11cf From Guillaume Chouvenc, "I have added the file StateAttribute.cpp in src/osgPlugins/osg
to support the reading and writing of StateAttribute Callback
in osg files.
"
2008-08-25 14:59:06 +00:00
Robert Osfield
8d5bfeddee From Guillaume Chouvenc, "I have modified Uniform.cpp and StateSet.cpp in src/osgPlugins/osg
to support the reading and writing of Uniform Callback and
StateSet Callback in osg files."
2008-08-25 14:54:11 +00:00
Robert Osfield
6c047f7abe Added testing of max texture size using a realize operation 2008-08-25 11:37:53 +00:00
Robert Osfield
94c6c9d32a Added support for event handler for non shader path, enable alpha func 2008-08-25 10:38:39 +00:00
Robert Osfield
a2c1dc85dc Removed debug info 2008-08-25 10:38:07 +00:00
Robert Osfield
ff35465a33 Moved _stateset = new StateSet instances to setStateSet(new StateSet) to make
sure the wiring up of the StateSet parents is done consistently
2008-08-25 10:20:20 +00:00
Robert Osfield
8d8852bc23 Added command line arguments to Viewer constructor, and added meaningful error message when no 3d image is provided 2008-08-25 09:53:24 +00:00
Robert Osfield
78e22f24c2 Introduced initial cut of a dicom loader, which uses ITK to do the loading. 2008-08-22 16:39:17 +00:00
Robert Osfield
8c8421e7a2 Added warning message 2008-08-22 16:37:56 +00:00
Robert Osfield
f5105510f3 Added support for reading the image transform from UserData in the form of a Matrix. 2008-08-22 16:35:49 +00:00
Robert Osfield
f930e707e8 Added checked against an empty _kdNodes list before commensing with intersection 2008-08-19 17:41:55 +00:00
Robert Osfield
3cec676d98 Added --mip command line option which enables Maximum Intensity Projection filtering 2008-08-18 15:08:04 +00:00
Robert Osfield
8303f03b24 Added .ive support for BlendEquation 2008-08-18 15:06:41 +00:00
Robert Osfield
4adb68c802 Added BlendEquation .osg support 2008-08-18 14:49:16 +00:00
Robert Osfield
1efe363137 Updated AUTHORS file for 2.7.0 release 2008-08-18 12:39:18 +00:00
Robert Osfield
f17fe26c64 Updated ChangeLog for 2.7.0 release 2008-08-18 11:55:17 +00:00
Robert Osfield
9bc5d7f000 Updated wrappers 2008-08-18 11:48:07 +00:00
Robert Osfield
8ecf508fda From Sergey Leontyev, "1. In StyleManager
when applying styles to a Label element the code below runs in a infinite loop.

The reason for this is that nothing increments the Reader "r" in the case when applying a style to label,

so I advance the reader when no match was found. 

( To replicate the error apply style to any label)

 

replaced this:

                while(!r.eof()) if(_styles[style]->applyStyle(t, r)) inc = true;

 

with this:

                while(!r.eof())

                 {

                                if(_styles[style]->applyStyle(t, r))

                                    inc = true;

                                else

                                    r.advanceOverCurrentFieldOrBlock();

                 }            

 

 

I tested it and it works well for me, I did not find any problems with it.

 

 

2.  Added style support for Canvas element, event though there is no styles to apply yet.

It is usefull for someone who inherits from Canvas class to develop another element.

 If applyStyle(Canvas) does not exist

there is no way to apply style to the  element that inherited from Canvas element.

 

Added virtual

     bool applyStyle(Canvas).

 

and in added call to apply style if the Object is of type Canvas:

StyleManager::_applyStyleToObject(osg::Object* obj, const std::string& style) {

...

 

else if(!std::string("Canvas").compare(c))

return _coerceAndApply<Canvas>(obj,style,c);

 "
2008-08-18 11:21:41 +00:00
Robert Osfield
0b39044666 Ran fixtabs to enforce four space tabs 2008-08-18 11:17:44 +00:00
Robert Osfield
9c8e44659f From Erik van Dekker,
"I made several modifications:

 

    * The cause of my errors was that my OSG source directory path contains spaces. To fix this issue I wrapped all paths with quotes, as stated in doxygen documentation.

 

    * I also received some warning messages about deprecated doxygen settings, which I fixed by updating the doxygen file, i.e. running \u2018doxygen \u2013u doxygen.cmake\u2018. By running this command deprecated doxygen options are removed, some option comments have changed and quite some options have been added (I kept their default settings unless mentioned).

 

    * I was surprised to find that the doxygen OUTPUT_DIRECTORY was set to \u201c${OpenSceneGraph_SOURCE_DIR}/doc\u201d, which does not seem appropriate for out of source builds; I changed this to \u201c${OpenSceneGraph_BINARY_DIR}/doc\u201d. (On the other hand, maybe a cmake selectable option should be given to the user?)

 

    * Fixed two warnings I received about unexpected end-of-list-markers in \u2018osg\AnimationPath and \u2018osgUtil\CullVisitor due to excess trailing points in comments.

 

    * Fixed a warning in osgWidget\StyleInterface due to an #include directive (strangely) placed inside a namespace.

 

    * Fixed a warning in osg\Camera due to the META_Object macro that confused doxygen. Adding a semi-colon fixed this.

 

    * Removed auto_Mainpage from the INCLUDE option, because I am positive that this file does not belong there; It never generated useful documentation anyway.

 

    * I added the OSG version number environment variable to the PROJECT_NUMBER option so that the version number is now shown on the main page of generated documentation (e.g. index.html).

 

    * Changed option FULL_PATH_NAMES to YES, but made sure STRIP_FROM_PATH stripped the absolute path until the include dir. This fixed an issue that created mangled names for identical filenames in different directories. E.g. osg/Export and osgDB/Export are now correctly named.

 

    * Changed option SHOW_DIRECTORIES to yes, which is a case of preference I guess.

 "
2008-08-18 11:00:40 +00:00
Robert Osfield
87b79bd221 Removed todo entry 2008-08-18 10:47:43 +00:00
Robert Osfield
3de3b2dccc From Maceij Krol, "I have implement frame based expiration of PagedLOD children.
New attribute DatabasePager::_expiryFrames sets number of frames a PagedLOD child is kept in memory. The attribute is set with DatabasePager::setExpiryFrames method or OSG_EXPIRY_FRAMES environmental variable.

New attribute PagedLOD::PerRangeData::_
frameNumber contains frame number of last cull traversal.

Children of PagedLOD are expired when time _AND_ number of frames since last cull traversal exceed OSG_EXPIRY_DELAY _AND_ OSG_EXPIRY_FRAMES respectively. By default OSG_EXPIRY_FRAMES = 1 which means that nodes from last cull/rendering
traversal will not be expired even if last cull time exceeds OSG_EXPIRY_DELAY. Setting OSG_EXPIRY_FRAMES = 0 revokes previous behaviour of PagedLOD.

Setting OSG_EXPIRY_FRAMES > 0 fixes problems of children reloading in lazy rendering applications. Required behaviour is achieved by manipulating OSG_EXPIRY_DELAY and OSG_EXPIRY_FRAMES together.

Two interface changes are made:

DatabasePager::updateSceneGraph(double currentFrameTime) is replaced by DatabasePager::updateSceneGraph(const osg::FrameStamp &frameStamp). The previous method is in #if 0 clause in the header file. Robert, decide if You want to include it.

PagedLOD::removeExpiredChildren(double expiryTime, NodeList &removedChildren) is deprecated (warning is printed), when subclassing use PagedLOD::removeExpiredChildren(double expiryTime, int expiryFrame, NodeList &removedChildren) instead. "
2008-08-17 16:52:35 +00:00
Robert Osfield
0c234e7997 From Jason Beverage, "I've got a few machines that OSG incorrectly believes support FRAME_BUFFER_OBJECTS so I am manually trying to set the renderTargetImplementation to PIXEL_BUFFER or PIXEL_BUFFER_RTT. I noticed that this call wasn't setting the camera's overlay data properly because the setRenderTargetImplementation simply calls init() which only does anything for OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY. Any subsequent calls to getOverlayData will simply return the cached OverlayData instead of setting it up.
My fix updates the camera's render target implementation for all OverlayData objects in the OverlayDataMap."
2008-08-17 16:45:09 +00:00
Robert Osfield
f0c2b89fc5 From Paul Palumbo, "Fixes a typo in coverage antialiasing code... Without this fix, get incorrect antialiasing results. " 2008-08-15 17:35:04 +00:00
Robert Osfield
dceb3cbe88 From Jutta Sauer, "We added a raise window method to GraphicsWindow. And added two
implementations for Win32 and X11.

"
2008-08-15 17:32:26 +00:00
Robert Osfield
b6886cdbb2 Updated version numbers in prep for next dev release 2008-08-15 17:26:06 +00:00
Robert Osfield
0448b31f93 From Frashid Larshkari, "I modified the vertical/horizontal interlace stereo modes so that they
use the osg::State::applyMode for enabling/disabling certain while
rendering the stencil mask. Previously some of these calls were
overriding the scene graph states because the global state was not
aware of this change.

"
2008-08-15 17:25:42 +00:00
Robert Osfield
5400e570c7 Added support for geometry shader attributes 2008-08-15 17:18:10 +00:00
Robert Osfield
7cd4641ece From Stephane Lamoliatte, "I added the osg::Program parameters support for the osg plug'in.
Now we could correctly configure geometry shaders in osg files."

Notes from Robert Osfield, renamed the names of the parameters to be less GL centric and more human readable.
2008-08-15 16:43:56 +00:00
Robert Osfield
38f6cddc2c Changed osg::ImageSequence::set/getDuration to set/getLength() to be in keeping with the
osg::ImageStream's getLength().
2008-08-15 16:21:44 +00:00
Robert Osfield
b6292f4537 Fixed the name of _playToggle 2008-08-15 13:07:04 +00:00
Robert Osfield
c6c5cdaf89 Updated wrappers 2008-08-15 13:06:18 +00:00
Robert Osfield
927942a0f8 Further work on osg::ImageSequence, improving pause functionality, and introducing new seek(double time) method 2008-08-15 12:45:20 +00:00
Robert Osfield
49e7358bf6 Added initial looping and pause play support 2008-08-14 16:29:12 +00:00
Robert Osfield
56001f3d82 Added event handler to toggling looping and play/pause 2008-08-14 16:28:45 +00:00
Robert Osfield
bcbd50af39 Implemented a reference eye point and associated methods in support of intersecting billboards 2008-08-14 14:22:39 +00:00
Robert Osfield
760ccdf2ef From Eric Sokolowski, added OSX release notes to READEME 2008-08-05 20:05:25 +00:00
Robert Osfield
367c107c11 Added osgWidget to doc building 2008-08-05 20:05:07 +00:00
Robert Osfield
6f6f56c795 Improved the doxygen docs over the various namespaces 2008-08-05 19:17:09 +00:00
Robert Osfield
4584cf2440 From Eric Sokolowki, disabled default build of 64bit under OSX to prevent build problems 2008-08-05 16:05:59 +00:00
Robert Osfield
c49bd6e4eb Merged from OpenSceneGraph-2.6 branch 2008-08-05 15:27:37 +00:00
Robert Osfield
f17b307305 Added NullStream class that automatically creates and delete the NullStreamBuffer, thus fixing a memory leak 2008-08-05 15:11:47 +00:00
Robert Osfield
7a7ee85f69 From Eric Sokolowski, "Fixed the build of the osgViewer library to get GL/glx.h from the right place, when building on OSX with X11" 2008-08-05 15:06:22 +00:00
Robert Osfield
7f8183f64c Merged changes to OpenSceneGraph-2.6 into trunk using :
svn merge -r 8729:8734 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches/OpenSceneGraph-2.6 .
2008-08-05 11:17:48 +00:00
Robert Osfield
800ca9b8ed Added -losgWidget to the list of libs 2008-08-04 20:48:46 +00:00
Robert Osfield
fe207a09c1 From Sherman Wilcox, "Minor change to bool setGLExtensionFuncPtr(T& t, const char* str1) and
setGLExtensionFuncPtr(T& t, const char* str1, const char* str2) -
functions returned false even on success."
2008-08-04 17:08:28 +00:00
Robert Osfield
77227e6c55 Updated AUTHORS file 2008-08-04 15:09:16 +00:00
Robert Osfield
a68e173f3a Updated ChangeLog 2008-08-04 15:08:39 +00:00
Robert Osfield
a414997ea5 Updated news for 2.6.0 release rc2 2008-08-04 15:08:24 +00:00
Robert Osfield
02f131c7fe From Philip Lowman, workaround of Centos 5's missing definition of GL_MAX_SAMPLES_EXT. 2008-08-04 14:01:42 +00:00
Robert Osfield
384d2921fd Moved initial drawable setup to within the mutex locked section to avoid multi-threaded crash on startup. 2008-08-04 12:47:14 +00:00
Robert Osfield
6595562442 Removed debug info 2008-08-04 12:27:22 +00:00
Robert Osfield
c8001915f6 From Ulrich Hertlien, "attached is a patch to src/osgPlugins/quicktime/QTImportExport.cpp that fixes loading images using the quicktime loader. Also fixes some minor bugs like uninitialized variables and incorrect deletes.
I'm a bit puzzled why this didn't pop up for more people as it's quite severe: basically the filename was never set!""
2008-08-04 09:05:29 +00:00
Robert Osfield
fcc8426226 Added a small epsilon expansion of the bounding box being clipped/intersected against, to avoid numberic errors causing problems. 2008-08-04 08:45:08 +00:00
Robert Osfield
268b79d03f Improved the terrain intersection code so that it produces more stable terrain movements. 2008-08-03 20:35:45 +00:00
Robert Osfield
f81ff952a2 merged 2.6 branch changes back into trunk using : svn merge -r 8699:8706 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches/OpenSceneGraph-2.6 . 2008-08-03 16:57:09 +00:00
Robert Osfield
ced418ccb5 Moved bb expansion out of loop. 2008-08-03 16:48:12 +00:00
Robert Osfield
abed295566 Updated ChangeLog and AUTHORS.txt file for relese candidate 2008-07-25 21:09:37 +00:00
Robert Osfield
5b5e3e5f78 Updated version numbers to 2.6.0 2008-07-25 21:01:57 +00:00
Robert Osfield
f2e87d6188 Updated REAME and NEWS for 2.6 branch 2008-07-25 21:00:12 +00:00
Robert Osfield
bdd558af3b Updated wrappers 2008-07-25 20:50:59 +00:00
Robert Osfield
5cac386fa6 Renamed enums in osgWidget from ALLCAPITALS to normal OSG conventional of AllCapital 2008-07-25 20:50:42 +00:00
Robert Osfield
eed365aef4 Added PluginQuery function to wrappers 2008-07-25 20:49:17 +00:00
Robert Osfield
f4d74b66cf Added OSGPL Copyright notices 2008-07-25 20:04:41 +00:00
Robert Osfield
ff5da51dcb Restructured classes to better fit with style of the rest of the OSG. 2008-07-25 19:57:17 +00:00
Robert Osfield
727925a1c2 Added include to help wrapper building 2008-07-25 19:53:18 +00:00
Robert Osfield
e525dd21bf Improved handling of PAGE_AND_RETAIN_IMAGES 2008-07-25 18:44:13 +00:00
Robert Osfield
65d5ef608d Reverted back to using std::list<std::String> 2008-07-25 17:42:37 +00:00
Robert Osfield
d137394169 Added Mode support 2008-07-25 16:23:00 +00:00
Robert Osfield
d0890ab250 Updated wrappers, and further refined the ImageSequence API 2008-07-25 16:11:51 +00:00
Robert Osfield
d8d2bc4193 From Ulrich Hertlein, "as I hinted at on osg-users in the "obj loader: map_* only reads last component" thread, this submission broke material/texture loading for some files I have that specify texture matrix scaling.
The following link shows a very comprehensive list of .mtl file options:
http://local.wasp.uwa.edu.au/~pbourke/dataformats/mtl/

Attached is a patch that should fix spacey filenames and optional texture scale/offset.  I have tested it with files I have that I modified to contain spaces in the texture filenames."
2008-07-25 15:45:40 +00:00
Stephan Maximilian HUBER
55199b8e38 From Stephan Huber: updated XCode-project 2008-07-25 15:38:12 +00:00
Robert Osfield
ec4d189b64 Added ImageSequence to .ive plugin, added support for multiple ImageThreads in osgDB::ImagePager 2008-07-25 13:45:07 +00:00
Robert Osfield
0d1656055c Moved PluginQuery from osgconv into osgDB 2008-07-25 10:18:36 +00:00
Robert Osfield
5cdb5c055c Added extension docs 2008-07-25 10:18:14 +00:00
Robert Osfield
7c6aba874b Added option docs 2008-07-25 09:46:05 +00:00
Robert Osfield
7cb4c46908 Added missing returns 2008-07-24 17:38:50 +00:00
Robert Osfield
79fbab4a95 From Paul Martz, "Not sure about the descriptions, so I left those blank. But at least "osgconv --formats" will display the .ive options now." 2008-07-24 13:25:49 +00:00
Robert Osfield
c8d3e81e08 Updated wrappers 2008-07-24 12:48:25 +00:00
Robert Osfield
2cf44741d7 Added getCurrentCamera/getCurrentRenderStage methods 2008-07-24 12:47:55 +00:00
Robert Osfield
6915bce1a2 Added a getCurrentRenderStage() and getCurrentCamera() convninience methods, and
converted the CullVisitor::apply(OcclusionQueryNode&) implementation to use the
new getCurrentCamera method.
2008-07-24 12:18:49 +00:00
Robert Osfield
53aad98d09 Improved the feedback for when a plugin isn't available. 2008-07-24 12:06:05 +00:00
Robert Osfield
7dabdf5d7e Added supportOptions() entry docs 2008-07-24 12:01:45 +00:00
Robert Osfield
efd20ea643 Added --format extname and --plugin pluginname extensions, and improved formating 2008-07-24 12:01:23 +00:00
Robert Osfield
ea309e2677 From Bob Kuehne, "fix for filenames that have spaces within their name."
Note form Robert, changed std::cout to osg::notify(osg::INFO)
2008-07-24 11:22:43 +00:00
Robert Osfield
4fe8907748 Updated wrappers 2008-07-23 22:19:37 +00:00
Robert Osfield
ec9218ad1f Refactored OverlayData so that its possible to subclass OverlayNode/OverlayData. 2008-07-23 22:19:29 +00:00
Robert Osfield
820586a3d0 Added wrappers 2008-07-23 21:52:03 +00:00
Robert Osfield
dc05f2ef95 Moved helper classes into Protected section 2008-07-23 21:49:07 +00:00
Robert Osfield
86ca0860cc From Paul Martz, typo fixes 2008-07-23 21:25:09 +00:00
Robert Osfield
bfcc7473b8 Applied filename fix suggested by Andrew Bettison. 2008-07-23 19:06:14 +00:00
Robert Osfield
daa3d2381a Implemented ImagePager internals 2008-07-23 19:04:46 +00:00
Robert Osfield
6488ff23a5 Fixed unitialized variable 2008-07-23 15:42:02 +00:00
Robert Osfield
cc2af85c96 Further work on ImageSequence 2008-07-22 20:20:16 +00:00
Robert Osfield
c9dc578186 Added support for pruning old images, recording the Duration in the .osg file, and -o filename output support in osgimagesequence. 2008-07-22 16:44:49 +00:00
Robert Osfield
66c2add024 Improved position when multiple videos are provided 2008-07-22 15:58:40 +00:00
Robert Osfield
ec13321bd7 Updated wrappers 2008-07-22 15:21:24 +00:00
Robert Osfield
669d6be0b2 Fixed handling of TextureCubeMap's with mipmapped/ImageSequence/PBO's. 2008-07-22 14:47:59 +00:00
Robert Osfield
14771d3a4d Added ImageSequence IO support in Texture classes 2008-07-22 12:40:02 +00:00
Robert Osfield
5ab73e9f80 Added support for ImageSequence to all Texture classes 2008-07-22 12:28:46 +00:00
Robert Osfield
74a1b7881e Disabled the setting of Texture::setUnrefImageOnApply(true) when the imagery is
an ImageStream.
2008-07-22 10:13:57 +00:00
Robert Osfield
f513700450 From Mario Valle, "The attached osgWidget source solves three compilation warnings on VC 7.1 on WindowsXP (OSG 2.5.5).
BTW the construct is absolutely legal C++, but VC 7.1 has a different idea..."
2008-07-22 09:02:44 +00:00
Robert Osfield
19e3b1624d Moved osgViewer::ScreenCaptureHandler's WindowCaptureCallback from head into .cpp
to clean up headers and avoid wrapper build issues.

Updated wrappers
2008-07-21 23:42:59 +00:00
Robert Osfield
e8344a614d Removed the reducent non const get methods 2008-07-21 22:38:11 +00:00
Robert Osfield
cad2f6d4fc From Jean-Sebastien Guay, "Changes attached so that the CaptureOperation is passed in the constructor of the ScreenCaptureHandler (default 0 = default CaptureOperation). This way, you can do:
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler(
   new osgViewer::WriteToFileCaptureOperation("filename", "jpg")));

and the filename will be what you want. The WriteToFileCaptureOperation will add the context ID and the file number (if in SEQUENTIAL_NUMBER mode) to the file name.

(The attached also clarifies some notify messages, and corrects the comment when adding the handler in osgviewer.cpp)

I also remembered, the current architecture could allow a different CaptureOperation for each context, but currently the API only allows setting one CaptureOperation for all contexts. This could be improved if need be.

"
2008-07-21 21:28:48 +00:00
Robert Osfield
5e80c3856f From Ruth Lang, "using osg version 2.5.5 and compiling my program under OpenSUSE 11.0
with  gcc (version 4.3.1) I got the following error message in
include/osgUtil/TriStripVisitor and Tessellator

error: type qualifiers ignored on function return type

The errors belong all to a INLINE function definition. Find attached my
modified version."
2008-07-21 21:20:21 +00:00
Robert Osfield
573044ceea From Mario Valle, signed/unsgined warning fix 2008-07-21 21:17:05 +00:00
Robert Osfield
041a06b89d Further work on osg::ImageSequence/osgDB::ImagePager 2008-07-21 21:00:57 +00:00
Robert Osfield
73bcc2613c Upated version number for dev release 2008-07-21 20:44:37 +00:00
Robert Osfield
e4b22e44d2 Moved the ~Record body into the .cpp to avoid a MipsPro compile error (due to a compiler bug) 2008-07-21 19:23:03 +00:00
Robert Osfield
34a085a1bd Added call to OpenThreads::Thread::cancel(); 2008-07-21 17:45:28 +00:00
Robert Osfield
6796b4f70d Updated wrappers 2008-07-21 17:39:55 +00:00
Robert Osfield
acd7e65687 Added basic image sequencing 2008-07-21 17:28:22 +00:00
Robert Osfield
f088d113f6 Added non const getAuthenticationMap(). 2008-07-21 17:27:59 +00:00
Robert Osfield
2125c9843b Moved the if (!buffer) check to infront of the memory initialization 2008-07-21 16:17:41 +00:00
Robert Osfield
dc19bcc7e0 Added --login <url> <username> <password> http authentication. 2008-07-21 15:05:08 +00:00
Robert Osfield
7ec7b8d9cb Added --login url username password http authentication option 2008-07-21 15:04:19 +00:00
Robert Osfield
ac61676368 Initial cut of osgimagesequence example 2008-07-21 10:57:06 +00:00
Stephan Maximilian HUBER
d930308de4 From Stephan Huber: updated XCode-project 2008-07-21 10:48:14 +00:00
Robert Osfield
09e7bcdf4e Added ImagePager first cut, and updated wrappers 2008-07-21 10:10:01 +00:00
Robert Osfield
c2432b22da Added first cut of ImageStream IO wrapper 2008-07-21 09:55:15 +00:00
Robert Osfield
d12708e6f6 First cut of osgDB::ImagePager for updating osg::ImageSequence 2008-07-21 09:47:39 +00:00
Robert Osfield
d17a255d8e First cut of osg::ImageSequence class 2008-07-21 09:46:53 +00:00
Robert Osfield
3814731c27 From Adrain Elgi, added osgGA to link list 2008-07-18 21:17:35 +00:00
Robert Osfield
18e9d2d53b Introduce a custom atof function that always assumes data comes in form 10.10 with
the full stop used as a decimal place.
2008-07-18 11:39:06 +00:00
Robert Osfield
46796978fd From Jean-Sebastien Guay and Robert Osfiled, osgViewer::ScreenCaptureHandler for
taking screenshots
2008-07-17 16:12:39 +00:00
Robert Osfield
198ae2ba56 Updated version and AUTHORS.txt for 2.5.5 release 2008-07-17 14:25:04 +00:00
Robert Osfield
c7b2578d5f Updated ChangeLog for 2.5.5 release 2008-07-17 14:18:59 +00:00
Robert Osfield
43e2c5fadf Updated wrappers 2008-07-17 14:13:13 +00:00
Robert Osfield
4aed0a7eac From Ulrich Hertlein, "attached are some minor tweaks:
- fixed typos in osgViewer/ViewerBase
- const-ness in include/osg/View findSlaveIndexForCamera
- supported options for STL reader, fixed return values to reflect proper errors
- supported options for DirectX reader, fixed return values
- normals pseudo-loader: scaling normals to a const (but variable) fraction of the bounding sphere radius
"
2008-07-17 13:51:14 +00:00
Robert Osfield
dd9364df0e Updated ChangeLog 2008-07-17 13:32:47 +00:00
Stephan Maximilian HUBER
1274feb66b From Stephan Huber: updated XCode project 2008-07-17 13:23:43 +00:00
Robert Osfield
8751bdbc97 Updated wrappers 2008-07-17 12:26:42 +00:00
Robert Osfield
969884e6c2 Moved AuthenticalMap/AuthenticationDetails out in their own files 2008-07-17 12:13:04 +00:00
Robert Osfield
adaf71fa19 Added osgDB::AuthenticationMap/Details to osgDB and curl plugin to add the ability
to authenticate http transfers
2008-07-17 11:55:55 +00:00
Robert Osfield
a6c72dc21c Removed net plugin for Xcode projects 2008-07-16 19:07:01 +00:00
Robert Osfield
cacb509f60 Moved .net plugin out into Deprecated section of osg svn repostitory 2008-07-16 16:19:54 +00:00
Robert Osfield
b0d1f419e3 Fixed path to font 2008-07-16 16:19:19 +00:00
Robert Osfield
2fefc911fd Set the default setting of LineWidth to 2.0 to ensure that old default behavior
is maintained.
2008-07-16 16:05:43 +00:00
Robert Osfield
c3a4237e3a From Vincent Bourdier, removed line with setWidth(2.0) as this code prevents
user settings of line with.
2008-07-16 16:04:27 +00:00
Robert Osfield
c33f7e5720 Cleaned up the updateStateSet code 2008-07-16 15:58:51 +00:00
Robert Osfield
b068777c22 Refactored the MultiTextureControl node callback so that the update is now
done as an update callback, with the elevation aquired via a cull callback
2008-07-16 15:58:15 +00:00
Robert Osfield
270a671c75 Updated wrappers 2008-07-16 13:29:35 +00:00
Robert Osfield
5f0f80cab2 Changed int's to unsigned int's to avoid warnings 2008-07-16 13:26:06 +00:00
Robert Osfield
850034ab75 Moved the _textureObjectBuffer assignment to after the imagery has been download to avoid crashes under multi-threaded compile of texture objects (was causing a crash with 3D Textures, but is something that would happen with other Texture types as well.) 2008-07-16 13:23:58 +00:00
Stephan Maximilian HUBER
ccf22f6a15 From Stephan Huber: updated XCode-project, included osgWidget-Framework 2008-07-16 12:53:58 +00:00
Robert Osfield
41bd615f3a Removed a division by precomputing the associated values 2008-07-16 11:40:01 +00:00
Robert Osfield
a20e5791d9 From Jeremy Moles, Updated file references to reflect new data in OpenSceneGraph-Data 2008-07-15 22:30:51 +00:00
Robert Osfield
a8cb408213 Added osgWidget wrappers 2008-07-15 22:13:35 +00:00
Robert Osfield
8fe0820bb8 Converted tabs to four spaces 2008-07-15 22:03:59 +00:00
Robert Osfield
e6c99b0434 Fixed typo 2008-07-15 21:28:22 +00:00
Robert Osfield
e9368c6fa3 Moved the private sections int protected to allow subclasses acces to all methods/members.
Moved public section to top of the class definition to make it more consistent with the rest of the OSG.
2008-07-15 20:30:56 +00:00
Robert Osfield
a383f7ee34 Fixed name of lib 2008-07-15 19:42:49 +00:00
Robert Osfield
47255490a9 Changed IMPORT to "Import option", and "EXPORT:" to "Export option:" in supportsOptions() docs make it a little more friendly and understandable 2008-07-15 19:28:30 +00:00
Robert Osfield
115787f8e9 From Paul Martz, "Here's documentation for the export options of the FLT plugin. I also labeled the import options as such." 2008-07-15 19:26:20 +00:00
Robert Osfield
f4cb039a3c Updated version number to 2.5.5 in prep for dev release 2008-07-15 19:24:48 +00:00
Robert Osfield
abe16fa571 Changed the version setup code to be consistent with the rest of the OSG 2008-07-15 19:24:22 +00:00
Robert Osfield
b343cbfc5f Removed now redundent example 2008-07-15 19:23:48 +00:00
Robert Osfield
c989b98f2e From Gino van den Bergen, "The VRML plugin in the current 2.5.4 release will not compile under VC8.0 when the project file is generated using CMake 2.6. The attached CMakeLists.txt will fix this problem. The file replaces the CMakeLists.txt file in src/osgPlugins/vrml.
NB: It is assumed that the antlr and regex libs are located in $(OPENVRML_DIR)/lib.
 "
2008-07-15 19:02:20 +00:00
Robert Osfield
f1138fa684 From Jean-Sebastian Guay, "Here are the CMakeLists.txt files for the osgWidget examples, changed to use SETUP_EXAMPLE like the other examples." 2008-07-15 18:53:16 +00:00
Robert Osfield
43cedf9eb4 Fixed typo 2008-07-15 18:12:17 +00:00
Robert Osfield
c2b77aa08e From Jeremy Moles, import of the osgWidget NodeKit, sourced from the original http://osgwidget.googlecode.com/svn/trunk
Notes from Robert Osfield, I've merged osgWidget trunk, and added/changed CMakeLists.txt file to make it suitable for inclusion in the core OSG, and moved imagery/scripts/shaders out into OpenSceneGraph-Data
2008-07-15 17:21:25 +00:00
Robert Osfield
0c3d119cea Updated wrappers 2008-07-15 14:24:46 +00:00
Robert Osfield
35bc9c7dd2 From Art Trevs, Removed GLeunm version setAttachment() to avoid ambigiuity with
whether to enable MRT.
2008-07-15 14:24:21 +00:00
Robert Osfield
c88d34ee97 Renamed Archive::ArchiveStatus to ReaderWriter::ArchiveStatus 2008-07-15 14:15:42 +00:00
Robert Osfield
59f6e0cdcf Updated wrappers 2008-07-15 10:45:07 +00:00
Robert Osfield
3e96a9d448 Missing check-ins 2008-07-15 09:55:33 +00:00
Robert Osfield
f22c06acbe Added --plugins and --formats query support into osgconv to help with querying the
available plugins and the file formats/protocols they support
2008-07-14 20:22:38 +00:00
Robert Osfield
5ab4af80c5 Added missing ac3d supportsExtensions() constructor 2008-07-14 20:11:37 +00:00
Robert Osfield
042c823278 Added initial cut at plugin query code 2008-07-14 08:48:49 +00:00
Robert Osfield
02b456bcfa Converted plugins to use the new supportsExtension()/supportsOptions/supportsProtocl() methods
to help enable better querying of supported features
2008-07-13 22:18:59 +00:00
Robert Osfield
cb98cddc31 Added new ReaderWriter methods for recording what protocols, extensions and options are
support by ReaderWriters
2008-07-13 15:24:45 +00:00
Robert Osfield
6aa604f31a From Paul Martz, removed uneccessary libraries from link line 2008-07-13 12:34:06 +00:00
Robert Osfield
8babab1f42 Updated date for 2.5.4 release 2008-07-12 17:44:51 +00:00
Robert Osfield
a3e28a795f Added an OSG_EXPORT 2008-07-12 17:30:17 +00:00
Robert Osfield
bbc98be4f9 Updated Authors for dev release 2008-07-12 16:11:14 +00:00
Robert Osfield
a2f9aef0fc Updated ChangeLog for dev release 2008-07-12 15:29:30 +00:00
Robert Osfield
4ca61c38f0 From Doug McCorkle, "Attached is patch that corrects/improves the following issues with the OBJ loader:
1. Added options to control wether the osgUtil::Tessellator or osgUtil::TriStripVisitor are run. By default they still run just as before.
2. Added support for the Emissive material. The data was being read from the mtl file but was never being applied to the model.
3. This is the main bug addressed, when a model is read in with an alpha value specified like:

newmtl Material__8
       Ns 24
       d 0.33
       illum 2
       Kd 0.204 0.204 0.204
       Ks 0 0 0
       Ka 0.153 0.153 0.153

where the alpha value is d. The loader would then overwrite the alpha value when reading the diffuse, specular, and ambient colors. I have changed all the material color readers to only set the values they read and to use the default colors specified in the constructor of the obj class. With these changes, the obj reader now handles opacity correctly if the alpha value is specified before the material colo"
2008-07-12 12:00:58 +00:00
Robert Osfield
ccb50019e4 Cleaned up osgkdtree example 2008-07-12 11:19:25 +00:00
Robert Osfield
de33a031d4 Updated version numbers for dev release 2008-07-11 20:01:12 +00:00
Robert Osfield
2b5708888e From Adrain Egli, "i added a default scene with 7 different draggers attached. it's more easy to test the draggers." 2008-07-11 19:52:25 +00:00
Robert Osfield
360e7629d0 From Christophe Loustaunau, "For our application, we need to write tiff file in floats. I have change a little bit the readerWritterTiff :
It check the data type of the image ( img.getDataType() ) and if it's GL_FLOAT :It save the tiff with float values.
Otherwise it does the same thing as before."
2008-07-11 19:43:01 +00:00
Robert Osfield
0e2dea9a39 From Liang Aibin, " In lastest svn version of OSG, the .ive plugin missing osg::Light, it
does not process I/O for osg::Light. Now I have fixed it as follows:
 
2. In DataInputStream.cpp, I add support code in DataInputStream::readStateAttribute
    for osg::Light.
 
3. In DataOutputStream.cpp, I add support code in DataOutputStream::writeStateAttribute
    for osg::Light.
 "
2008-07-11 19:23:49 +00:00
Robert Osfield
ef1ee63f03 From Joakim Simmonson,
"Opcodes.h:
* Added INVALID_OP as -1 in the Opcodes enum. Note that INVALID_OP is not an actual opcode defined in the OpenFlight format. The purpose of INVALID_OP is to mark an opcode variable as invalid or uninitialized.

ReaderWriterFLT.cpp:
* The header node is returned if it exists, even if the file does not contain a node hierarchy. The old behaviour returned a ERROR_IN_READING_FILE error.
* Changed opcodes initialized to -1 to the new enum value INVALID_OP."
2008-07-11 17:46:30 +00:00
Robert Osfield
1489eeb228 From Joakim Simmonsson, fixed various spelling typos in comments 2008-07-11 17:41:50 +00:00
Robert Osfield
161e01dc5d From Mathias Froehlich, "Due to the recent data variance changes/discussion:
Change the ac3d loader that can as such only deliver static models to set the
data variance to static for the returned model.
"
2008-07-11 17:35:13 +00:00
Robert Osfield
45b2fb8db7 Increased the buffer and fixed the buffer calculation when moving backwards into objects 2008-07-11 17:07:05 +00:00
Robert Osfield
61a81d8e06 Updated KdTree code to refect new cleaned up API 2008-07-11 16:51:11 +00:00
Robert Osfield
9866eb93f8 Tweaked the KdTree intersection performance testing code block 2008-07-11 16:50:43 +00:00
Robert Osfield
8a6c25425e Updated wrappers 2008-07-11 16:48:55 +00:00
Robert Osfield
a856459a86 Moved the building and intersecting of the KdTree into the .cpp, and cleaned up
the header to ready it for wider usage
2008-07-11 16:48:39 +00:00
Robert Osfield
d3fd43cc6f Streamlined KdTree implementation 2008-07-10 15:50:10 +00:00
Robert Osfield
29d66125e2 Updated wrappers 2008-07-09 19:43:02 +00:00
Robert Osfield
8edee96275 Cleaned up KdTree implementation 2008-07-09 19:42:15 +00:00
Robert Osfield
7be3d1ae02 Reordered KdLeaf/KdNode so that the first element to be accessed is first in the data structure 2008-07-09 19:41:36 +00:00
Robert Osfield
c41ca3d6a0 Introduced code for doing dummy test traversals - used for benchmarking KdTree code. 2008-07-09 19:40:10 +00:00
Robert Osfield
15e5bdbcae Added range of camera manipulators and a center of screen test intersection that
is insticated by pressing 'c' key
2008-07-09 19:28:00 +00:00
Robert Osfield
cbf5429c19 Introduce a intersecion performance testing code path, #if def'd out for now. 2008-07-09 19:26:40 +00:00
Robert Osfield
a00f94ac18 Updated wrappers 2008-07-09 12:37:59 +00:00
Robert Osfield
ee9b23f670 Fixed set method 2008-07-08 18:02:09 +00:00
Robert Osfield
2851429333 Added optional control of whether to use KdTrees for intersections 2008-07-08 17:35:10 +00:00
Robert Osfield
134c86c2d5 Implement hierachy culling in KdTree::intersect(..) 2008-07-07 20:27:56 +00:00
Robert Osfield
f1db402f2b Improved the handling of KdTree intersections 2008-07-07 14:27:58 +00:00
Robert Osfield
d05236bfb4 Implemented intial KdTree triangle intersection code, but without culling implemented 2008-07-07 13:21:37 +00:00
Robert Osfield
e8487b8830 Added KdTreeBuilder calls into FindCompileableGLObjectsVisitor, and an alternative
path that explictly calls the KdTreeBuilde when required in cases when no pre compile of GL objects is required.
2008-07-07 10:46:22 +00:00
Robert Osfield
682be50e2a Changed types to avoid warnings under Windows 2008-07-07 09:40:30 +00:00
Robert Osfield
c4e8d6ee42 Changed the DatabasePager so that it bypasses the Registry::readNode() method and calls
readNodeImplementation() directly to avoid calling the KdTreeBuilder.   

Updated wrappers.
2008-07-06 18:27:10 +00:00
Robert Osfield
3965fe357b Moved KdTree build code into osg::KdTree 2008-07-06 12:14:19 +00:00
Robert Osfield
10595e49e3 Added handling of co-incident start and end points. 2008-07-05 17:29:07 +00:00
Robert Osfield
9a9c543ffa Ported intersection code to use new osgUtil::LineSegmentIntersector/IntersectionVisitor. 2008-07-05 16:39:28 +00:00
Robert Osfield
e70e3a6d5d Converted TerrainManipulator to use osgUtil::InterectionVisitor rather than the
old IntersectVisitor
2008-07-04 19:16:19 +00:00
Robert Osfield
db57d2504e Added KdTree intersection support into LineSegmentIntersector 2008-07-04 17:02:02 +00:00
Robert Osfield
44d144997e Added prelimnary KdTree data structure and automatic kdtree build support
into osgDB::Registry/osgTerrain so that newly created subgraphs can have 
KdTree built on all osg::Geometry automatically on load/creation.
2008-07-04 15:57:48 +00:00
Robert Osfield
bc1032653c Moved vertex indicies method into a single block with deprecated doc lines 2008-07-04 11:51:55 +00:00
Robert Osfield
e2ae39c8f6 Introduced bounding boxes to KDLeaf and KDNode structs 2008-07-03 17:18:14 +00:00
Robert Osfield
178d6ff423 Added new data structure + build algorithm that places triangles into leaves
without being shared, but with varying the boundaries of leaves so that they
may overlap.
2008-07-03 15:49:28 +00:00
Robert Osfield
3f025bec5d From Mario Valle, "xed the following warning on Linux 64 bits Athlon:
/users/mvalle/OSG/OpenSceneGraph/src/osg/BufferObject.cpp: In member function `virtual void osg::ElementBufferObject::compileBuffer(osg::State&) const':
/users/mvalle/OSG/OpenSceneGraph/src/osg/BufferObject.cpp:600: warning: cast to pointer from integer of different size"
2008-07-03 15:01:04 +00:00
Robert Osfield
14c86a5389 From Mario Valle, removed extraneous spaces 2008-07-03 14:59:07 +00:00
Robert Osfield
7db303b16b Added header guards 2008-07-03 11:23:44 +00:00
Robert Osfield
f0defbd824 Refactored example so that the example will be able to run different kdtree data strucutres/algorithms. 2008-07-03 11:22:23 +00:00
Robert Osfield
d62a4ef6d0 From Eric Sokolowsky, "The check for Leopard to build 4-way binaries by default was broken. Here is an updated CMakeLists.txt file to fix the problem." 2008-07-03 11:07:59 +00:00
Robert Osfield
1729ec0819 Implement an experiemental triangle kdtree building support 2008-07-03 10:24:20 +00:00
Robert Osfield
45d5376503 Set the DataVariance on FadeText to DYNAMIC to reflect their nature 2008-07-03 10:03:06 +00:00
Robert Osfield
a65b74d287 Updated wrappers 2008-07-02 10:00:09 +00:00
Robert Osfield
201522feb3 Introduced support for UNSCPECIFIED and STATIC DataVariance of StateSet/Textures 2008-07-02 09:25:08 +00:00
Robert Osfield
aa593fcd2d From Colin McDonald, "There is a problem reading bmp files containing a colour palette,
due to an incorrect scan line length calculation.  Attached is a fix,
and a little bmp file which demonstrates the problem."
2008-07-01 19:04:29 +00:00
Robert Osfield
dba344feba From Lilin Xiong, "I change ive plugin a little for osgText inout, so the ive plugin supports backdrop setting,
and Text3D, FadeText inout :

1. in DataInputStream.cpp, add 1286--1293 lines;
2. in Text.cpp, add some code for text's Backdrop setting;
3. in IveVersion.h, add line 39,  increase the VERSION to VERSION_028(line 41)
4. in ReadWrite.h,  add line 146,147
5. add file FadeText.h, FadeText.cpp, Text3D.h, Text3D.cpp."
2008-07-01 18:37:13 +00:00
Robert Osfield
82ed445a31 Added Vec3Array arrange pointer to avoid dynamic cast 2008-07-01 13:56:02 +00:00
Robert Osfield
c6ba70e3ad From Mathias Froehlich, "It appears not to be sufficient to set a cmake variable to get a define in
such a config file. Instead set that variable to 1. Also included a small compile fix, that appears to be required  than ..."
2008-07-01 09:40:06 +00:00
Robert Osfield
bec0fc9c32 Added guards against FBO not being supported/setup 2008-06-30 16:53:06 +00:00
Robert Osfield
55ea6e5e23 Updated README date for 2.5.3 dev release 2008-06-29 13:41:07 +00:00
Robert Osfield
5e0169f664 Changed the Optimizer::StateVisitor so that it can individually decide whether
to optimize away duplicate state with dynamic, static and unspecified DataVarience.  By default
the code now optimizes away duplicate state with either static and unspecied state, previously 
it was just handling static state.
2008-06-29 12:22:50 +00:00
Robert Osfield
8820d0bb1d Added realize of new graphics contexts to handle new views being added with
unrealized windows
2008-06-28 16:59:26 +00:00
Robert Osfield
fec2a8fabe Changed back to use an std::vector<> rather than a std::list for RequestQueue to
avoid member template problems under Solaris.
2008-06-27 19:40:52 +00:00
Robert Osfield
a9b05e0815 Refactored the sort of the requestQueue so that there is single code path for doing the sort. 2008-06-27 18:59:27 +00:00
Robert Osfield
214491dd94 From Mathias Froehlich, "Update to the configure check for msvc 7.1.
MemoryBarrier() is used in the implementation, so it should be checked.
This in effect disables the faster atomic ops on msvc 7.1 and older, even if
only the MemoryBarrier() call is missing. But it ensures for the fist cut
that it will build everywhere. If somebody cares for msvc 7.1 enough and has
one for testing installed, he might provide the apropriate defines to guard
that MemoryBarrier() call.

I tested that msvc8 32/64bit still passes the configure tests and compiles.
"
2008-06-27 16:47:43 +00:00
Robert Osfield
1057d74a11 Simplified the MixinVector class so that it no longer supports custom allocators,
instead just uses std::vector<>'s default allocators.
2008-06-27 12:44:41 +00:00
Robert Osfield
34f58482e6 Moved the apply(&) default implementations from the header into the NodeVisitor.cpp,
and changed the casts to use static_cast<>.
2008-06-27 12:35:56 +00:00
Stephan Maximilian HUBER
46931464ef from Stephan Huber: updated XCode project 2008-06-27 11:47:06 +00:00
Robert Osfield
9a80c331a2 From Andre Normann, "with version 8504, I am not able to compile osgwrappers under Windows, because there are some DLL export macros missing. I fixed it and put the files in the attached zip file.
"
2008-06-27 10:17:38 +00:00
Robert Osfield
1a8017fecf Updated authors and osgversion 2008-06-26 19:51:24 +00:00
Robert Osfield
1b433f808b Updated ChangeLog 2008-06-26 19:47:00 +00:00
Robert Osfield
6d53566654 Updated wrappers 2008-06-26 19:21:54 +00:00
Robert Osfield
8dc1143263 From Paul Martz, "The method IntersectionVisitor::apply(osg::PagedLOD&) appears to attempt to identify a "highest res" child of the PagedLOD and only allow intersection on that child. The implementation appears to be flawed in two cases:
1) The "highest res" child is assumed to be the child with index "getNumFileNames()-1" or "getNumChildren()-1". As a result, PagedLODs that do not sort children from furthest to nearest will intersect with the wrong child. (see attached "case1.osg" to reproduce this problem.)
 
2) The code assumes there is only one highest res child. As a result. PagedLODs with multiple children at the same highest res range can only intersect one of those children. ("case2.osg" demonstrates this issue; you can only pick the quad on the right.)
 
I've attached a modified IntersectionVisitor.cpp that attempts to resolve these issues. It identifies a highest res range based on the range mode, then continues traversal on all valid children corresponding to that range description. Only in the case of a malformed PagedLOD does the code fall back to getting the last child in the list.
 "
2008-06-26 18:34:01 +00:00
Robert Osfield
f523515aed From Morten Haukness, "When cloning effects osg crashes because the copy constructur tries to run av pure virtual method (setUpEmitterAndProgram). The right thing to do when cloning an effect is to run the inherited version og buildEffect and setUpEmitterAndProgram.
"
2008-06-26 18:06:24 +00:00
Robert Osfield
44c125a801 Changed the removeCamera() method so that it now actively calls releaseGLObjects()
on all children of a camera that aren't shared with other cameras on that context.

This change fixes problems with allocating and deleting views.
2008-06-26 16:45:50 +00:00
Robert Osfield
53636db5bc From Mathias Froehlich, updated CMakeLists.txt to build the Atomic.cpp 2008-06-26 15:06:44 +00:00
Robert Osfield
e48fad59dd From Eric Sokolowski, added enforcement of CMake 2.6.0 under OSX. 2008-06-26 13:09:54 +00:00
Robert Osfield
12044a43d9 From Eric Sokolowski, Cmake support for osgviewerCocoa 2008-06-26 13:08:24 +00:00
Robert Osfield
260d0d384f From Mathias Froehlich, build fixes for various unices 2008-06-26 12:08:37 +00:00
Robert Osfield
c32ee85d3d From Mathias Froehlich, added do not edit comments to Config.in so that the autogenerated
Config files have an appropriate warning notice
2008-06-26 10:33:47 +00:00
Robert Osfield
5a4ce5a387 From Mathias Froechlich, "Attached is a change to that atomic stuff to move the win32, msvc
implementation of the atomic increment and decrement into a implementation
file.
This way inlining and compiler optimization can no longer happen for these
implementations, but it fixes compilation on win32 msvc targets. I expect
that this is still faster than with with mutexes.

Also the i386 gcc target gets atomic operations with this patch. By using an
implementation file we can guarantee that we have the right compiler flags
available."
2008-06-26 10:27:16 +00:00
Robert Osfield
37765805ff Fixed pedantic warning 2008-06-23 15:11:37 +00:00
Robert Osfield
0b6e605795 From Mathias Froehlich, "fixed win32/win64 configure check and win32/win64
atomic related compile failures with msvs2005. Attached changes to make win32
really use the atomic stuff. There are pointer typecast problems and some
historic alignment restrictions that I just took from a previous similar
implementation of mine without looking deep enough. "
2008-06-23 14:51:34 +00:00
Robert Osfield
62fb2d4634 From Mathieu Marache, "Suibject: CMakeList ADD_DEFINITION for CMAKE_DEBUG_POSTFIX broken
I needed a -DCMAKE_DEBUG_POSTFIX="d" not a -D"CMAKE_DEBUG_POSTFIX=d".

This corrects the build for the CMake 2.4 and 2.6 series

The error was in compiling osgDB/Registry.cpp
"
2008-06-23 11:14:06 +00:00
Robert Osfield
87b74c1f54 Commented out the explict install of the Config files as including these files into
the header list allows the normal Cmake install support to install them.
2008-06-23 10:18:04 +00:00
Robert Osfield
275811d02a From Eric Sokolowsky, "I have made a number of changes intended to get a few things working better on OSX. However, since I'm still pretty new at Mac development and cmake I'm not entirely certain that the changes I have made are benign on other platforms. I have tested these changes on Leopard with CMake 2.6 generating Xcode 3.0 projects, compiling on ppc and i386 for 10.5 and 10.4, and on Linux (CentOS) and everything still seems to work ok. Here are the changes I made (against OSG svn as of this afternoon):
- Added osgviewerCocoa example to APPLE builds
- Fixed corrupt Xcode project generation with CMake 2.6 dealing with ADD_DEFINITIONS and CMake Policy CMP0005 on Leopard
- Resolved CMP0006 warning for examples and programs by setting BUNDLE DESTINATION to same as RUNTIME DESTINATION with CMake 2.6
- Fixed freetype plugin on Leopard to avoid OpenGL linking problem
- Figured out how to use a custom Info.plist included in the project (see osgviewerCocoa application CMakeLists.txt)"
2008-06-23 09:57:45 +00:00
Stephan Maximilian HUBER
6766039ef7 From Stephan Huber: added missing config files and updated xcode-project 2008-06-23 08:06:07 +00:00
Robert Osfield
1e3183a355 Quietened down debug info 2008-06-21 17:56:38 +00:00
Robert Osfield
af271f99ec Added support for X11's overrideRedirect functionality 2008-06-21 17:50:58 +00:00
Robert Osfield
113a77b219 Converted tabs to four spaces 2008-06-21 11:34:01 +00:00
Robert Osfield
415d45525c Changed the include/osg/Config and include/OpenThreads/Config references to use the assocaited CMake variable for these headers 2008-06-20 19:52:14 +00:00
Robert Osfield
e56ff4d5c6 Updated ChangeLog 2008-06-20 19:51:21 +00:00
Robert Osfield
ff811736fc From Terry Welsh, added missing MixinVector header 2008-06-20 17:32:27 +00:00
Robert Osfield
779a7c46ac Added OSG_WINDOWING_SYSTEM cmake option string to allow toggling between X11 and Carbon under OSX. 2008-06-20 16:57:22 +00:00
Robert Osfield
a71939c5bb From Mathias Froehlich, moved optional config variables into include/osg/Config file that
is automatically created by cmake according to its own settings.
2008-06-20 15:50:53 +00:00
Robert Osfield
7b19b987ec Updated ChangeLog 2008-06-20 15:49:15 +00:00
Robert Osfield
8aa7c330f8 Changed const double* to const Matrix::value_type* to ensure changes in Matrix type don't break the build 2008-06-20 15:28:38 +00:00
Robert Osfield
be185cb3af From Terry Welsh, new flatten static transforms visitor that duplicates subgraphs that are shared beneath differnt static transforms
From Robert Osfield, made a range of changes to Terry's visitor integrating it into osgUtil::Optimizer and 
changing the code to use a style more like the rest of the OSG.
2008-06-20 13:16:35 +00:00
Robert Osfield
ce13510b47 From Mathias Froehlich, made the include of bin directory for include/OpenThreads/Config only used when doing out of source builds 2008-06-20 11:16:06 +00:00
Robert Osfield
bc6e5b5da2 Updated version numbers for dev releases 2008-06-20 11:11:47 +00:00
Robert Osfield
0e7920f144 From Mathias Froehlich, "Fixes a compile of src/osgSim/ShapeAttribute.cpp on suse 10.2." 2008-06-20 10:46:33 +00:00
Robert Osfield
3672ba51e7 From Melchior Franz, fixed typo on variable name 2008-06-20 09:46:45 +00:00
Robert Osfield
5db501941d From Mathias Froehlich, add search path to enable out of source builds to find include/OpenThreads/Config. 2008-06-20 09:42:57 +00:00
Robert Osfield
96a80666c9 Updated wrappers 2008-06-19 20:42:10 +00:00
Robert Osfield
2011028ee7 From Neil Groves,
"I have taken the liberty of updating a few files so that there is no longer any derivation from std::vector. I have done this by adding a new file osg/MixinVector and by updating only two others: osg/PrimitiveSet and osg/Array. You will notice that this actually removes what is acknowledged as a \u2018hack\u2019 in osg/PrimitiveSet.

With the original code I did manage to find memory leaks with some compiler options on VC 8 and 9, as well as Intel compiler. I determined the leak existence by instrumenting the destructor code, and by use of a garbage collector as a leak detector (in a similar manner to the Firefox project). Hence in contrast to what I said originally, it is exhibiting symptoms on at least some platforms.

Since I am trying to be a good OSG citizen I got out my editor and started hacking! I have built and tested on Linux (Ubuntu) with GCC 4.x and Windows VC 8 SP1. It appears that nothing is broken, and that I\u2019m using less memory J"
2008-06-19 20:38:38 +00:00
Robert Osfield
d6469b87c1 From Mathieu Marache, "submission for inclusion to support mpg and avi files when using the quicktime plugin on windows" 2008-06-19 17:35:45 +00:00
Robert Osfield
936edacc92 From Mathias Froehlich, added support for using OpenThreads::Atomic for thread safe ref/unref. 2008-06-19 17:30:38 +00:00
Robert Osfield
2ba5f002d2 from Andrew Bettison, LineStipple support for .ive 2008-06-19 14:57:36 +00:00
Robert Osfield
0faaf93dc2 From Adrian Egli, "Improvements to the PSSM implementation" 2008-06-19 14:45:54 +00:00
Robert Osfield
cc9d12f34f From Rudolf Weidemann, "in the OpenFlight format materials can have editable names.
In the OSG OpenFlight plugin these names are ignored when reading, and
empty strings are written.

As we need these names in the OSG scene graph by our application, I
changed the plugin code, so the names are now stored in class
"osg::Material" (derived from "osg::Object") by
 material->setName();
(see "PaletteRecords.cpp, line 195) when reading the file, and written
to file by
 dos.writeString( m.Material->getName(), 12 );
(see MaterialPaletteManager.cpp, line 80).

As these names otherwise get lost when reading an OpenFlight file and
writing it again e.g. by
 osgconv example.flt converted_example.flt
these changes make the plugin more complete.

The changes were made to OSG revision 8425, and were tested by
 osgconv example.flt converted_example.flt
comparing the material palettes of both files inside Multigen Creator."
2008-06-19 14:35:18 +00:00
Robert Osfield
dd13893861 From Farshid Lashkari, "I noticed some problems when setting up CameraNodes that inherit
viewport settings in stereo mode. It seems that the SceneView::cull()
method will pass the full size viewport to the left/right
cullvisitors, instead of the modified stereo viewport. I made quite a
few changes to SceneView to fix the issue. The SceneView::cullStage()
method will now receive the viewport as an argument, instead of using
the global viewport. The SceneView::cull() method will pass the
modifed viewport to cullStage when rendering in stereo.

There are 2 new private methods computeLeftEyeViewport() and
computeRightEyeViewport() that will compute the stereo viewports. I
also modified the draw() function so it applies the correct viewport
to the prerender stages. These changes are only necessary for
horizontal/vertical split stereo."
2008-06-19 14:29:38 +00:00
Robert Osfield
c3c727b822 From Andrew Bettison, "Attached are changes for src/osgPlugins/ive (version 2.4.0) that implement LineStipple read/write support for the ive file format." 2008-06-19 14:14:20 +00:00
Robert Osfield
37d81679b7 From Paul Melis, "Here is a reworked version of the osgviewerWX example. It changes the GraphicsWindowWX to only inherit from osgViewer::GraphicsWindow and adds a standalone widget, called OSGCanvas, that derives from wxGLCanvas. This solves a problem with the GraphicsWindowWX instance being destructed twice (see "Crash in osgviewerWX" of June 12th on osg-users). At program exit, the main frame deletes all of its children widgets and therefore calls GraphicsWindowWX's destructor, bypassing OSG's reference counting. The GraphicsWindowWX instance is then later destructed a second time when the reference held by osg::Camera goes to zero. This bug isn't exposed by the example directly, but if people are going to use the example as a basis (like the poster in the mentioned thread) they very likely will run into this problem.
"
2008-06-19 13:49:36 +00:00
Robert Osfield
4c9b3de4a1 Updated wrappers to fix OpenThreads::Atomic build issues. 2008-06-19 13:28:33 +00:00
Robert Osfield
a94cfccdce From Michael Platings, fixed typo error in renderbin assignment 2008-06-19 12:02:20 +00:00
Robert Osfield
061be3d084 In Program::PerContextProgram changed const Uniform* to osg::ref_ptr<const Uniform*> to avoid the possibility of a uniform being deleted
and another being created and assigned at the same address which previously confused the uniform tracking code and introduced a bug.
2008-06-19 11:58:34 +00:00
Robert Osfield
174f9bbfe0 From Michael Platings and Robert Osfield, added support for controlling,
via StateSet::setNestedRenderBin(bool) whether the new RenderBin should be nested
with the existing RenderBin, or be nested with the enclosing RenderStage.
2008-06-19 11:09:20 +00:00
Robert Osfield
0abf539b60 Updated wrappers 2008-06-18 20:27:06 +00:00
Robert Osfield
f06d50a7eb From Michael Platings, implemented check against max number of supported samples to ensure that the number of samples is safely capped to what the hardware is capable of, avoiding GL errors and graceful fallback 2008-06-18 20:24:12 +00:00
Robert Osfield
45fcb25765 From Liang Aibin:
"1. Location: <OSG_SOURCE_ROOT>\src\osgPlugins\osg\Fog.cpp
   Reason: ".osg" writter plugins output incorrected string for osg::Fog's Mode.
   How to Fix:
     Line 138 in Fog.cpp: case(Fog::LINEAR): return "NERVER";
     Change to:           case(Fog::LINEAR): return "LINEAR";
2. Location: <OSG_SOURCE_ROOT>\src\osgPlugins\ive\
   Reason: ".ive" writter plugins missing to process "osg::Fog".
   How to Fix:
   (1). Line 86 in ReadWrite.h:
        Add: #define IVEFOG                          0x00001133
   (2). In CMakeLists.txt
        "SET(TARGET_SRC" section Add: Fog.cpp
        "SET(TARGET_H" section Add: Fog.h
   (3). In DataInputStream.cpp
        Line 54,Add:    #include "Fog.h"
        Line 1185,Add:  else if(attributeID == IVEFOG){
                            attribute = new osg::Fog();
                            ((ive::Fog*)(attribute))->read(this);
                        }
   (4). In DataOutputStream.cpp
        Line 57,Add:    #include "Fog.h"
        Line 832,Add:   // This is a Fog
                        else if(dynamic_cast<const osg::Fog*>(attribute)){
                            ((ive::Fog*)(attribute))->write(this);
                        }
   (5). Add newly created ive::Fog Object in Fog.h and Fog.cpp.
"
2008-06-18 20:17:13 +00:00
Robert Osfield
0a0034aebb Updated wrappers 2008-06-18 16:46:38 +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
959c01557c Convert string handling to use strdup and free rather then awkward new char[]
code paths
2008-06-18 16:28:52 +00:00
Robert Osfield
7ae28bea0d Added --fbo-samples value and --color-samples value command line paramters for enabling fbo multisampling 2008-06-18 14:21:22 +00:00
Robert Osfield
90ea0bd95f From Michael Platings and Paul Palumbo, multi-sample FBO support 2008-06-18 14:09:11 +00:00
Robert Osfield
7bef1bd16a From Jean-Sebastien Guay, "When copying a node that had uniforms on it, the copy constructor of osg::Uniform would not copy the array of the original uniform (either _intArray or _floatArray) because none had been allocated and the copy constructor checks that *both* this's array and rhs's array are valid.
I added a call to allocateDataArray() if rhs has (at least) one valid array, which should allocate the right array according to the type. Since the type was copied from rhs, it should create the same array as rhs has, so then it should copy the data in the following lines.
"
2008-06-18 12:01:52 +00:00
Robert Osfield
df87106d4b From Bob Kuehne, "added multi-texture support (alpha/trans images)" 2008-06-18 11:56:50 +00:00
Robert Osfield
b82e24b08d Updated wrappers 2008-06-18 11:51:22 +00:00
Robert Osfield
dd137c2442 From Bob Kuehne, "this submission extends the osgViewer::RecordCameraPathHandler to have an optionally-enabled auto-incrementing filename. default behavior is still the same, but there's one new method to enable autoincrementing filenames."
From Robert Osfield, modified the above so that the number increments come after the filename rather than before.
2008-06-18 11:13:51 +00:00
Robert Osfield
bc79df7cd8 From Gino van den Bergen, "Added support for vrml primitive caching" 2008-06-18 10:51:02 +00:00
Robert Osfield
7dc3ad4b5e From David Callu, "fixed bounding box bug" 2008-06-18 10:46:05 +00:00
Robert Osfield
d7e9e5e495 From Mathias Froehlich, OpenThreads::Atomic support 2008-06-17 17:43:59 +00:00
Robert Osfield
7cfe00d3d9 Added overriding of CullSettings::inheritCullSettings() into osg::Camera to
properly inherit the clear colour.
2008-06-16 20:22:16 +00:00
Robert Osfield
4e7dd7f0db Changed class to struct 2008-06-16 16:06:01 +00:00
Robert Osfield
f10cb3c388 Added mutex to serialize access to the trpager 2008-06-16 13:20:51 +00:00
Robert Osfield
68e750626a Checking in missing header changes 2008-06-16 09:32:22 +00:00
Robert Osfield
b7a548923c Refactored the management of the request queues so that the appropraite mutex is locked when DatabaseRequest objects are modified 2008-06-12 16:33:24 +00:00
Robert Osfield
fac838f791 Updated wrappers, authors and readme for 2.5.2 dev release 2008-06-06 19:57:56 +00:00
Robert Osfield
5c98e1609d Updated ChangeLog 2008-06-06 19:41:28 +00:00
Robert Osfield
3585375d59 Updated versions for 2.5.2 dev release 2008-06-06 17:45:33 +00:00
Robert Osfield
20e6ec7b23 From Jean-Sebastien Guay, "The new osgscreencapture example was being installed to bin instead of to share/OpenSceneGraph/bin, this is because the CMakeLists.txt used SETUP_APPLICATION instead of SETUP_EXAMPLE. Corrected CMakeLists.txt attached.
"
2008-06-06 16:45:07 +00:00
Robert Osfield
239f4e5c42 From Stephane Lamoliatte, "fix to reading of DatabasePath property" 2008-06-06 16:41:24 +00:00
Robert Osfield
1ee9b09e06 From Glenn Waldron, "I'm using an IntersectionVisitor with a PagedLOD database, employing a ReadCallback to allow the intersector to traverse the paged nodes. I discovered that if the visitor is unable (for any reason) to load a subtile via the ReadCallback, the intersection fails. However, I had the requirement to "fall back" on the lower-resolution parent tile and settle for that intersection.
This was easy to implement simply by overriding IntersectionVisitor::apply(PagedLOD). My question is: Are there any opinions on whether this should be the default behavior? If it makes sense, I will submit the change; if not, no worries."
2008-06-06 16:28:27 +00:00
Robert Osfield
01c284429b From Paul Melis, "Here's an updated include/osgText/Text3D that forces recomputation of the glyph repr when the character depth is updated, also when the rendering mode is set.
This caused a Text3D object read from a .osg file to not have the correct depth."
2008-06-06 16:25:14 +00:00
Robert Osfield
c2a4825afa From Mathieu Marache, "I have made the logo plugin work again (a simple copy and paste problem) and added the path of the logo file (if not empty) to the data file path in order to be able to find images relatively." 2008-06-06 14:59:17 +00:00
Robert Osfield
b6a0f3d8d0 Cleaned up implementation to only use simple structure 2008-06-06 14:10:20 +00:00
Robert Osfield
6fb62b9604 Renamed _rendergraph to _stateGraph to better reflect its function 2008-06-06 13:21:57 +00:00
Robert Osfield
ed45e32355 Introduce a lower overhead data structure for leaves. 2008-06-06 13:21:27 +00:00
Robert Osfield
aa73e1d1d4 Added update traversal to run prior to doing kdtree build to make sure that
costs in build osgTerrain databases isn't incurred during the build traversal.
2008-06-06 10:51:23 +00:00
Robert Osfield
238d482230 Quitened down the release context message 2008-06-06 09:08:16 +00:00
Robert Osfield
cf97035a45 Added OSGDB_EXPORT 2008-06-06 08:42:37 +00:00
Robert Osfield
ac068178aa Added timing code 2008-06-05 18:52:29 +00:00
Robert Osfield
a9b1ea660d Basic implementation of kdtree generation based on vertices 2008-06-05 17:28:06 +00:00
Robert Osfield
abfb5bbb8d Added accep(Shape&) 2008-06-05 13:46:19 +00:00
Robert Osfield
9212d4dd95 Further work on fleshing out basic classes 2008-06-04 17:59:39 +00:00
Robert Osfield
c57b288e54 Updated wrappers 2008-06-04 16:53:17 +00:00
Robert Osfield
282fa84789 Added support for optionally calling releaseContext at the end of each
renderinTraversals() to help with cases where uses are driving multiple
contexts from mulitple viewers in a single threaded frame loop.
2008-06-04 16:46:14 +00:00
Robert Osfield
338be0b926 Fleshed out some basic kd-tree data structures. 2008-06-03 17:29:27 +00:00
Robert Osfield
8d0c7890ce First cut of osgkdtree example, this will be used as a base of the development of
native kdtree support to help speed up intersection testing.
2008-06-03 16:13:49 +00:00
Robert Osfield
a32d336c90 Added missing updateBlock() 2008-06-03 15:49:59 +00:00
Robert Osfield
71187a2c56 From Mario Valle, fixed warnings 2008-06-03 13:07:40 +00:00
Robert Osfield
6873d4237c Ran merge to get rid of tabs 2008-06-03 13:06:54 +00:00
Robert Osfield
ef601e6add From Marco Lehmann and Robert Osfield, this fix was implemented by Robert but
is based on suggested fix from Marco for fixing a crash due to lack of
thread safety in std::ofstream("/dev/null");  The fix is to use a custom stream
buffer that just discards all data.  The implementation is also twice as fast
as the old /dev/null based approach.
2008-06-03 11:31:42 +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
e09e07d45b Added support for assigning GraphicsContext to individual GUIEventAdapter events,
and use of this within osgViewer::View to better track the sources of events.
2008-06-02 17:34:47 +00:00
Robert Osfield
213a2d8d13 Changed FIND_PACKAGE(PkgConfig) to INCLUDE(FindPkgConfig OPTIONAL) as per
suggestion from Philip Lowman.
2008-05-31 08:47:15 +00:00
Robert Osfield
840eab0109 Updated authors and version file for 2.5.1 dev release 2008-05-30 21:23:49 +00:00
Robert Osfield
af974b2590 Updated ChangeLog 2008-05-30 21:12:44 +00:00
Robert Osfield
03d12b4b94 Added version check on FIND_PACKAGE(PkgConfig) to attempt to fix build with older versions of CMake 2008-05-30 21:08:28 +00:00
Robert Osfield
65772e451c Added applyMaskAction(CLEAR_COLOR) to Camera::setClearColor() to enable proper inheritance 2008-05-30 20:15:31 +00:00
Robert Osfield
c714e46ff6 Updated ChangeLog 2008-05-30 17:03:32 +00:00
Robert Osfield
5c30b98785 From Jean-Sebastien Guay, "This is a fix for the warning we've been discussing on osg-users. CMake 2.6.0 allows quotes to be unescaped in strings in ADD_DEFINITIONS statements, where we had to escape them before (CMake 2.4.x). Setting CMake policy CMP0005 to OLD removes the warning for 2.6.0, and the quotes are still escaped, so it still works with 2.4.x.
"
2008-05-30 16:53:45 +00:00
Robert Osfield
0a6b4d5709 From Luc Frauciel, Added support for osgTerrain::ValidDataOperator.
From Robert Osfield, added versioning to the above.
2008-05-30 12:59:49 +00:00
Robert Osfield
9cd56609db Updated packgage number for 2.5.1 developer release 2008-05-30 11:44:06 +00:00
Robert Osfield
0cc38108a5 Fixed cirular reference in DatabaseRequest 2008-05-30 11:43:04 +00:00
Robert Osfield
f07d106366 Moved enum to public scope and rebuilt wrappers to fix wrapper build error 2008-05-29 13:54:59 +00:00
Robert Osfield
7a2c403992 Added code to catch erroneous Dof axis settings 2008-05-29 11:45:31 +00:00
Robert Osfield
e1eeabcea0 Improved the NaN depth detection within CullVisitor and debug output. 2008-05-29 11:13:29 +00:00
Robert Osfield
2a11d25bbc Improved the NaN error detection and reporting. 2008-05-29 11:09:56 +00:00
Robert Osfield
4745ab040b Added catch for NaN depth values 2008-05-28 17:56:22 +00:00
Robert Osfield
7c23951ee1 From Wojiech Lewandowski, Workaround for wglMakeCurrent bug in NVidia drivers by
calling wglMakeCurrent twice.

This bug has been reported to NVidia, confirmed and fixed by NVidia but awaits verifiaction and release if a driver which fixes this bug.
2008-05-28 16:14:08 +00:00
Robert Osfield
3ca777f31e Updated wrappers 2008-05-28 14:37:50 +00:00
Robert Osfield
1047f970bb From Adrian Egli, improvements to ParallelSplitShadowMap implementation 2008-05-28 14:11:22 +00:00
Robert Osfield
8e91926ca5 From Thibault Genessay, "The PNG plugin crashes when you try to read a malformed file (attached
is an example). This can happen in circumstances that are not
manageable by the OSG itself (e.g. 3rd party buggy program) but one
would expect the plugin to be able to recover by returning
ReadResult::ERROR_IN_READING_FILE.

libpng provides two callbacks for warnings and errors - those are
currently unused. By default, they point to function that call exit()
or something similar (the default error callback never returns). This
patch registers the callbacks using libpng's mechanisms, makes the
warning callback emit an osg::notify(osg::WARN) message and the error
callback throw an error. The reading process is enclosed in a
try...catch block. Upon error, the memory is freed and
ReadResult::ERROR_IN_READING_FILE is returned.
"
2008-05-28 13:51:56 +00:00
Robert Osfield
7e0184f080 From Thibault Genessay, "On Windows, when setting a cursor through
osgViewer::GraphicsWindow::setCursor() the new cursor type is recorded
but not applied until windows sends another WM_SETCURSOR message. This
delays the application of the cursor to the next mouse event.

The attached file fixes this by setting the new cursor with a call to
::SetCursor() immediately.
"
2008-05-28 13:45:40 +00:00
Robert Osfield
8573194aa0 From Michael Platings, "Yes it's definitely a driver problem - I submitted a bug report to
nvidia 6 months ago and the issue is still "in progress". I've given up
waiting for them!

Platform - various Intel Windows XP SP2 PCs with various nvidia cards
including GeForce 8800 GTS and Quadro FX 4500, and various driver
versions including the latest WHQL 175.16.

I investigated your concerns about glGenerateMipmapEXT being slower than
GL_GENERATE_MIPMAP_SGIS, and for power-of-two textures, to my surprise
it is. For a 512*512 texture, glGenerateMipmapEXT takes on average 10ms,
while GL_GENERATE_MIPMAP_SGIS takes on average 6ms. Therefore I have
modified the code to only use glGenerateMipmapEXT if the texture has a
non-power-of-two width or height. I am resubmitting all the files
previously submitted (only "Texture.cpp" has significant changes since
my previous submission, I've also replaced tabs with spaces in
"Texture").
"
2008-05-28 13:01:44 +00:00
Robert Osfield
712b6cb2d9 From Mathieu Marache,
first post:

"I had the problem that debug and release version of the plugins had the same name under linux. These minors modification to Registry and the CMake support files enable to have both Release and Debug version of the plugins to coexist and be found by there respective runtimes."

follow up post:

"I've gone ahead and added a preprocessor directive with the editable CMAKE_DEBUG_POSTFIX. I modified Registry.cpp to take this new preprocessor directive called OSG_DEBUG_POSTFIX while looking for libraries in Debug mode for the windows (msvc) and the linux platforms.

MinGW, cygwin and Apple are still left out this proposal."


Notes from Robert Osfield, completed the work in change d entries to use OSG_DEBUG_POSTFIX
2008-05-28 12:49:47 +00:00
Robert Osfield
e68e474c90 Updated wrappers 2008-05-28 11:58:46 +00:00
Robert Osfield
8677c4d6d6 From Michael Platings, "On nvidia cards mipmap generation for non-power-of-two textures with
GL_GENERATE_MIPMAP_SGIS is very slow (over half a second for a 720*576
texture). However, glGenerateMipmapEXT() performs well (16ms for the
same texture), so I have modified the attached files to use
Texture::generateMipmap() if glGenerateMipmapEXT is supported, instead
of enabling & disabling GL_GENERATE_MIPMAP_SGIS."

Notes, from Robert Osfield, I've tested the out of the previous path using
GL_GENERATE_MIPMAP_SGIS and non power of two textures on NVidia 7800GT and
Nvidia linux drivers with the image size 720x576 and only get compile times
of 56ms, so the above half second speed looks to be a driver bug.  With
Muchael's changes the cost goes done to less than 5ms, so it's certainly 
an effective change, even given that Michael's poor expereiences with
GL_GENERATE_MIP_SGIS do look to be a driver bug.
2008-05-28 11:19:41 +00:00
Robert Osfield
20f3e74643 From Brad Anderegg, "This submission fixes two bugs and helps some performance problems we have been having with txp databases.
The first bug is that the terrain tiles will page out to a lower LOD when they are right in front of you.  The issue appears to be with the blacklisting heuristic which forces a tile to LOD 1, commenting out the usage of blacklisting with the LOD Nodes fixes our problem.  This code change was made to line 29 of TXPPageLOD.cpp.

 

The second bug we were experiencing is that the database reader options never make it through to the archive loader.  The use case for us appeared when the FID codes for the terrain were no longer on the materials.  As it turns out the archive was being created twice, once by TXPNode and once by the ReaderWriterTXP on getArchive() so the options never actually got set on the archive that was being loaded.  The fix is to first create the archive by calling getArchive on the ReaderWriterTXP, which stores it in a map for reference later, and then passing that archive into the TXPNode for it to set its internal member.  With this code change we only create one archive (not sure what creating two did) and our options flags get set properly on the database.

 

The changes made are in TXPNode.h line 72 where the TXPArchive is now passed in.  In the TXPNode.cpp the loadArchive(TXPArchive*) was changed to have the default behavior if NULL is passed in, if an archive is passed in then it does not load it since all the loading is done in the ReaderWriterTXP::getArchive().  The only other place that loadArchive is called is in TXPIO.cpp where a modification was made to pass in NULL which will have the same behavior as it used to.  The last change is the little block of code starting on line 57 of ReaderWriterTXP.cpp, this was changed so that it first calls getArchive() which caches the archives in a map does some loading stuff and returns a pointer to it which is then passed in as a parameter to TXPNode::loadArchive().

 

The performance changes were made to TXPParser.cpp line 163 where we use to osgUtil::Optimizer on the node before passing it off, and on line 1456 we changed the geometry to use display lists.  These small changes actually made drastic performance increases for us, as much as 1000% on certain laptops.

 

As far as testing goes, we have tested these changes with at least 5 txp databases on a variety of different computers including Mac OS and Linux.  The base version used is 2.4."
2008-05-27 20:53:43 +00:00
Robert Osfield
6877a814fb From Cedric Pinson, "By default it's the normal behaviour, it means it's "d" extension for debug library and executable. But if you want to change that you can.
The reason is if you want to build an application that use a library that use openscenegraph you have to build the full chain in debug or in release.
On windows you have no choice, but on linux you can link with both version without rebuilding everything ...

The patch consist only to change the line on one line
SET(CMAKE_DEBUG_POSTFIX "d")
with
SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows")"
2008-05-27 17:42:56 +00:00
Robert Osfield
e427d50d9a From Lars Nilson, bug fix to Sector::computeMatrix() 2008-05-27 17:32:26 +00:00
Robert Osfield
7ab1219ea3 Added handling of \ within srings by using \\ 2008-05-27 16:32:17 +00:00
Robert Osfield
526f8cd8dc Updated wrappers 2008-05-27 15:42:40 +00:00
Robert Osfield
4d60d73eca Reorginized the TerrainTile/TerrainTechnique dirty mechanism so that TerrainTile
now holds the dirty flag and enables/disables event traversal in response dirty
being set/unset.  This allows terrain to be automatically updated in response
to Terrain scale and sample ratio changes.
2008-05-27 15:30:20 +00:00
Robert Osfield
aee0e8dc37 Introduced a TerrainHandler that adjust the sameple ratio and vertical scale
of terrain interactively using the 'r','R' and 'v','V' keys respecitvely.
2008-05-27 15:28:39 +00:00
Robert Osfield
1519d0d546 From John Vidar Larring, "Added vertical scale as a property of osgTerrain::Terrain. Lets you configure vertical scale when initializing the terrain model. E.g:
osgTerrain::Terrain* terrain = findTopMostNodeOfType<osgTerrain::Terrain>(model.get());
  if (!terrain)
  {
      terrain = new osgTerrain::Terrain;
      terrain->addChild(model.get());
      terrain->setVerticalScale(2.0f);
      model = terrain;
  }
  viewerWindow->setSceneData(model.get());
"
2008-05-27 13:11:47 +00:00
Robert Osfield
b41404546e Updated version numbers in prep for 2.5.1 release 2008-05-27 12:07:58 +00:00
Robert Osfield
169b1a02ad From Gino van den Bergen, "I've refactored the single ReadedWriterVRML2.cpp into multiple files. The reason for doing this was to break up the horribly long function
osg::ref_ptr<osg::Node> ReaderWriterVRML2::convertFromVRML(openvrml::node *obj)
 
The fixes are:
 
* Added the source's parent directory as search directory for image files.
* The material properties are now set in the stateset of the Geode rather than the Geometry. This will allow geometries to be reused with different material properties in future updates.
 
NB: I planned for a caching scheme in which multiple occurences of the same primitive (e.g., Cylinders with radius 0.8 and height 1.2), would use the same Geometry object. Unfortunately, my planning moved me to other areas, but I might still finish the caching scheme in a quiet hour. For the time being I decided it would be a good thing to already submit my current changes.
 "
2008-05-27 12:06:50 +00:00
Robert Osfield
7230d54011 From Mathias Froehlich, "Included a fix for my past pbuffer change. The version test fo 'need at least
glx 1.1' was broken, even if no implementation had yet a chance to trigger
that :)

Attached a fix for that broken test.
Based on rev 8358"
2008-05-27 11:13:16 +00:00
Robert Osfield
dd6d04e088 From Andrew Bettison, "Problem: the LineStipple pattern when read from an OSG node file is always 0xFFFF, even though specified otherwise in the OSG file.
Cause: possibly a copy/paste typo in src/osgPlugins/osg/LineStipple.cc, line 61:
  if (fr[0].matchWord("functionMask") && fr[1].getUInt(mask))

Solution: change to:
  if (fr[0].matchWord("pattern") && fr[1].getUInt(mask))"
2008-05-27 11:07:52 +00:00
Robert Osfield
3c6b6e4d97 From Stephane Lamoliatte, "Here is a patch that fix the strange bug describe on the osg-user group.
Finally it seems to not come from the empty geode. The origin of the problem seems to be the uniform initialization during the building of the program which call a glUseProgram.
If your scene never display the node that contains the shader and if there is no other shader on the scene, this "glUseProgram" is the only one that is called during your simulation. So, this shader is applied on all the scene.

I fix this bug by switching off the shader (by calling glUseProgram(0) ) during the compilation of a state which does not contain the shader.
"
2008-05-27 11:04:52 +00:00
Robert Osfield
66a1996a5a From Wang Rui, "I have just done some changes on the classic osgdb_gif plugin (based on OSG 2.5.0). I wish our developers may use the newly written GIF reading plugin to attach animate GIF files as textures now! In my opinion, a GIF is much smaller than AVI and MOVs, and much more efficient sometimes.
Changes includes:
1. A new GifImageStream class (inherit from osg::ImageStream and OpenThreads::Thread) have already been added to implement different operations of a GIF movie, such like playing, pausing, rewinding, setting time and so on.
2. Some small changes to decode_row() and gif_read_stream(), which make the transparency of GIF images correctly.
3. Just a few changes to the ReaderWriterGIF::readGIFStream() function, which ensure that animate GIFs are loaded by GifImageStream (and the function returns GifImageStream objects) and static GIFs unchanged (still use the old method and returns osg::Image objects!).
 
Attachments are the cpp file and an animate GIF file for further test. Just rebuild the osgdb_gif project and use osgviewer or osgmovie to view it.
The plugin has been tested on Windows and Arch Linux."
2008-05-27 10:50:26 +00:00
Robert Osfield
476cb5373e From Philip Lowman, post 1:
"Here is a collection of changes which should fix issues building the OSG with CMake 2.6.0 (along with some other changes)

CMakeLists.txt:
* Set CMP0003 to supress warning about linking against -lpthread (which is a
  non-absolute library location).  (CMake 2.6.x fix)
* Modified the WIN32_USE_MP and a couple of other Visual Studio specific flags
  to be in an IF(MSVC) block  (minor tweak to reduce exposing this stuff on MinGW builds)
* Includes my second set of glu tesselator autodetection changes that you
seemed to want but haven't committed yet.

src/OpenThreads/pthreads/CMakeLists.txt:
* Eliminates warning when compiling on Linux about spaces in link line (CMake 2.6.x fix)

CMakeModules/OsgMacroUtils.cmake:
* Tweaks to make the macros behave properly under CMake 2.6.0 (doesn't change behavior under CMake 2.4.x)

CMakeModules/Find3rdPartyDependencies.cmake:
* Adds the NO_DEFAULT_PATH option to all of the search options so that things in C:\Program Files\OpenSceneGraph aren't accidently picked up during configure time and instead only things in the "3rdParty" folder are discovered. (general bugfix)
"

post 2:
"Ok, hold the presses.  I just discovered that for some odd reason the osgdb_* plugins under Linux aren't getting put under the osgPlugins-2.5.0 folder.  Not exactly sure why this broke, the folder was there, just empty.  I'll have to look into it this evening."

post 3:

"Fixed, was caused by the switch to CMAKE_LIBRARY_OUTPUT_DIRECTORY and some code in osgPlugins/CMakeLists.txt that effectively overrides LIBRARY_OUTPUT_PATH on non-MSVC compilers to dump the plugins in the plugins folder.  I tweaked it to override CMAKE_LIBRARY_OUTPUT_DIRECTORY as well.  Seems to work fine."
2008-05-26 22:36:58 +00:00
Robert Osfield
51dd9676db From Paul Martz, "When exporting a DrawArrays PrimitiveSet, the DAE plugin computes an incorrect nbVerticesPerPoly if the first index is not zero. The issue can be reproduced easily with:
osgconv cessna.osg cessna.dae
 
Examination of the resulting .dae file reveals several out-of-range tristrip indices; viewing the .dae file in osgviewer causes a crash when OSG tries to lookup those indices.
 
Attached resolves this issue."
2008-05-26 22:34:06 +00:00
Robert Osfield
804c91c8c1 From Art Tevs, "I've attached a patch for the Texture2DArray which solves problems of loading image data into the texture array. So here are a small description:
- Solves issues of loading image data into the texture memory
- Print a warning if images are of different dimensions or have different internal formats (GL specification requires images to be the same)


Patch is tested and seems to work fine. It shouldn't break any other functionality. It should go into include/osg and src/osg
"
2008-05-26 21:53:57 +00:00
Robert Osfield
1f8ff7916c Fixed copyright notice typo 2008-05-26 21:44:14 +00:00
Robert Osfield
4c81aa0aa7 From Paul Martz, "The attached code changes StateSet::merge() so that it copies RenderBin data such as the rendering hint and RenderBin details from rhs into "this", only if "this" has RenderBin mode set to INHERIT.
It replaces a comment by you indicating something along these lines should be done. To me, this seems like the right thing to do."
2008-05-26 21:33:41 +00:00
Robert Osfield
8f6ca1dc6c From Gino, "According to the 1.4.1 COLLADA spec (2nd ed) the standard behavior for fx_sampler_wrap_common is as follows
CLAMP ->GL_CLAMP_TO_EDGE
NONE->GL_CLAMP_TO_BORDER

The current 2.5.0 daePlugin assumes the following binding

CLAMP ->GL_CLAMP
NONE->GL_REPEAT

Notably the GL_CLAMP binding will result in visible black seams on input files that use otherwise matching textures. Replacing GL_CLAMP by GL_CLAMP_TO_EDGE solves this problem. I've updated both the read and write functions.
"
2008-05-26 21:32:05 +00:00
Robert Osfield
ee6f055bc5 From Philip Lowman, "I changed the test name to be a little easier to understand and defaulted Linux & Windows builds to false and to skip the compile check as you desired.
"
2008-05-26 21:18:41 +00:00
Robert Osfield
3d163c3412 Updated wrappers 2008-05-26 21:10:10 +00:00
Robert Osfield
ae303e38e9 From Paul Melis, "Here is an update to the osgviewerWX example. Keyboard events were not always received because the GraphicsWindowWX wasn't receiving focus. It now receives focus when the mouse enters the window.
* I split the mouse handling from a monolithic method to separate ones, slightly cleaner than a whole bunch of if()'s, especially with another case of the mouse entering the canvas.
* I changed the EVT_KEY_DOWN handler to an EVT_CHAR handler, although that now makes the up and down handler assymetric. The new down-handler returns translated key codes, so when you press the S key (without anything else), it actually returns 's' and not 'S' as the EVT_KEY_DOWN did. This means that statistics can be called up in the viewer window, while the example previously only printed a "Stats output:" line to the console. I'm not truly happy that the up handler returns _untranslated_ key codes. But solving this completely would probably mean adding some table that translated from wxWidgets' untranslated key codes to OSG's internal ones. This might be interesting to add, as anyone using OSG + wxWidgets in any serious manner would also have to add this.
* I commented out the evt.Skip()'s in the keyboard handlers as these would only be necessary if there were some key events that are not handled. But currently all key events are simply forwarded.
* I changed the handling of a mouse drag to a more general mouse move"
2008-05-26 21:09:54 +00:00
Robert Osfield
189049f9bd From Colin McDonald, "I had to tighten a declaration in OpenFlight/FltWriteResult.h, as the Solaris SunStudio 11 compiler was being picky and wouldn't compile." 2008-05-26 21:04:47 +00:00
Robert Osfield
55e98d390e Added debug block to output the location of the master camera for each View in a Viewer. 2008-05-26 20:46:21 +00:00
Robert Osfield
cac6e2facb Added continuous recording of the animation path to the RecordAnimationPathHandler 2008-05-26 17:30:43 +00:00
Robert Osfield
7592e50cde Introduce --pbuffer-only width height option, and added fps reporting to stats output 2008-05-26 16:25:31 +00:00
Robert Osfield
57ce3f820e Added basic --pbuffer width height support 2008-05-26 15:41:54 +00:00
Robert Osfield
7aac7ef381 Added better stats reporting 2008-05-26 14:30:48 +00:00
Robert Osfield
bb1f6ff7c1 Added feedback of pixel format chosen for read back 2008-05-26 12:01:24 +00:00
Robert Osfield
8ed9b303f1 Added automatic selection of the pixel type according to the window type 2008-05-26 11:59:25 +00:00
Robert Osfield
d2afe3e956 Added option for doing triple buffering, and set the default read format
to GL_RGBA
2008-05-26 11:53:51 +00:00
Robert Osfield
dc7db11e63 Switch to using an inital draw callback when use --start-frame 2008-05-25 22:06:41 +00:00
Robert Osfield
5664c51cf0 Added option for setting whether the front or back buffer should be read using
--front and --back command line options.
2008-05-25 21:52:32 +00:00
Robert Osfield
28fd4b07c9 Added option for controlling whether the front buffer is read at the start of the
frame or the back buffer at the end of the frame.
2008-05-25 21:35:39 +00:00
Robert Osfield
c1f7c766ef Added check for pkg-config so that build only use related package checks when
it's supported
2008-05-25 11:21:40 +00:00
Robert Osfield
a88567a852 Added #define's for PixelBufferObject extensions.
Added docs for Camera::DrawCallback
2008-05-24 11:05:10 +00:00
Robert Osfield
9623731185 Added RenderStage::setClear*() methods from Camera::getClear*() sources 2008-05-24 09:24:37 +00:00
Robert Osfield
cc07d064bf Changed default format to GL_BGR 2008-05-24 08:13:55 +00:00
Robert Osfield
90308d22aa Added single buffered and double buffered PBO support, and --no-pbo,
--single-pbo and --double-pbo command line parameters
2008-05-23 16:26:03 +00:00
Robert Osfield
f9f1aab67d Added basic glReadPixels code 2008-05-22 17:50:22 +00:00
Robert Osfield
fd76054eac Added camera final callback attachment code. 2008-05-22 15:43:01 +00:00
Robert Osfield
0a3737eb2c Fixed name of source file 2008-05-22 13:11:23 +00:00
Robert Osfield
29d067639c Added new osgscreencapture example folder, implementation to follow 2008-05-22 13:10:40 +00:00
Robert Osfield
6a16cbfca4 Reorginaized the DatabaseQueue's to avoid warnings under Windows 2008-05-22 12:38:36 +00:00
Robert Osfield
e6e4074143 Fixed warning by adding in missing return 2008-05-22 11:21:04 +00:00
Robert Osfield
58f5ebab19 Checking in missed header 2008-05-22 08:31:56 +00:00
Robert Osfield
7b003b24ea Refactored DatabasePager and related classes to introduce support for
multi-threaded paging, where the Pager manages threads of reading local
and http files via seperate threads.  This makes it possible to smoothly
browse large databases where parts of the data are locally cached while
others are on a remote server.  Previously with this type of dataset 
the pager would stall all paging while http requests were being served,
even when parts of the models are still loadable virtue of being in the 
local cache.

Also as part of the refactoring the DatabaseRequest are now stored in the
ProxyNode/PagedLOD nodes to facilitate quite updating in the cull traversal,
with the new code avoiding mutex locks and searches.  Previous on big 
databases the overhead involved in make database requests could accumulate
to a point where it'd cause the cull traversal to break frame.  The overhead
now is negligable.

Finally OSG_FILE_CACHE support has been moved from the curl plugin into
the DatabasePager.  Eventually this functionality will be moved out into
osgDB for more general usage.
2008-05-21 21:09:45 +00:00
Robert Osfield
100cc12ecb Moved the compile to after the updateSceneView 2008-05-20 09:28:44 +00:00
Robert Osfield
24fec21002 Updated wrappers 2008-05-14 20:22:01 +00:00
Robert Osfield
646fc43747 Introduced preliminary support for asynchronous file read requests,
ReaderWriter::ReadResult now has a FILE_REQUEST enum.
  ReaderWriter::Options now has a s/getAsynchronousFileReadHint() parameter methods.

  libcurl based plugin now detects enabing of the AsynchronousFileReadHint, but
  as yet does not handle async requests - handling everything syncronously.
  
  DatabasePager now by default will enable AsynchronousFileReadHint for http
  based file requests
2008-05-14 17:03:57 +00:00
Robert Osfield
d7c4e6f26e Moved the cache file writing into StreamObject so that the cache file is only
created once data is being read.
2008-05-14 14:59:50 +00:00
Robert Osfield
6be1928447 Introduced a thread safe map which manages a single EasyCurl object per thread. 2008-05-14 13:16:36 +00:00
Robert Osfield
094dcd9bfd Refactor curl usage so that a new EasyCurl class wraps up the curl handle and
reading from curl.
2008-05-14 12:47:26 +00:00
Robert Osfield
5f443e75a9 Fixed lat/long ordering 2008-05-13 18:28:26 +00:00
Robert Osfield
e28ae8c7f3 Added support for -e level minX minY maxX maxY extents controls 2008-05-13 17:27:29 +00:00
Robert Osfield
83f6f13914 Added --file-cache directoryname command line option support to readNodeFiles(ArgumentParser&)
to make it easier to specify a local file cache, in place of the default OSG_FILE_CACHE
env var.
2008-05-13 14:08:32 +00:00
Robert Osfield
0ed71961d4 Further work on computing of lat/long range of PagedLOD subgraphs 2008-05-13 12:36:39 +00:00
Robert Osfield
f3d36055ef From Steven Thomas, "Subject: Collada fix
There was a problem converting a file to Collada by using osgconv like this:

osgconv file.osg file.dae

You would get an error message:

I/O error : Permission denied
I/O error : Permission denied
error : xmlNewTextWriterFilename : out of memory!
Error: daeLIBXMLPlugin::write(file://cessna.dae) failed
Warning: Error in writing to "cessna.dae".

This was due to some bad URI processing code in the Collada plugin. The attached file fixes this by using the Collada DOM's URI processing functions. After this change the file will convert successfully in the local directory.
"
2008-05-13 10:56:10 +00:00
Robert Osfield
c81b02bca4 Added signal handling code, and prelimary lat/long computation 2008-05-12 16:59:04 +00:00
Robert Osfield
61f630e163 Added missing getBound() method 2008-05-12 15:42:20 +00:00
Robert Osfield
7e8e7587be Update ChangeLog and wrappers for 2.5.0 dev release 2008-05-12 12:16:58 +00:00
Robert Osfield
d2c5142ecc Updated AUTHORS for 2.5.0 release 2008-05-12 12:16:14 +00:00
Robert Osfield
7a074acd49 From Mathias Froehlich, Fixed FrameBufferObject attachement code to handle cases
where no texture or image is attached
2008-05-12 11:39:02 +00:00
Robert Osfield
1d2bd834a4 Updated version number for 2.5.0 dev release 2008-05-12 11:01:54 +00:00
Robert Osfield
965c72f5bd From Eric Sokolowski and Robert Osfield, moved command line option usage setup
from osgviewer example into osg::ArgumentParser and osgViewer::Viewer to make
them more universally available.
2008-05-12 10:55:55 +00:00
Robert Osfield
61cb0833b9 From Bob Kuehne, "* add easy multiple texture targets support for obj by refactoring texture
load into it's own method.

* use new method from step 1 to load 'map_opacity' textures from .mtl files"
2008-05-12 10:18:41 +00:00
Robert Osfield
db2cf75b23 From Mathias Froehlich, fixed typo 2008-05-12 10:16:40 +00:00
Robert Osfield
a7e5972f82 Added CARIO_FOUND into svg plugins checks 2008-05-11 14:26:27 +00:00
Robert Osfield
13acf6420f From Miguel Escriva, Here you will find a SVG Image Reader. It renders a SVG file as an osg::Image using cairo and rsvg. 2008-05-11 14:23:19 +00:00
Robert Osfield
412717c151 From Paul Martz, "This change adds support for osg::Billboards to the OpenFlight exporter.
It might seem odd that the change actually removes the stub apply(Billboard&) method, but it turns out Billboards are easily supported in subordinate routines of the existing apply(Geode&) method with s dynamic_cast, so there's no need for a separate apply(Billboard&)."
2008-05-10 17:25:42 +00:00
Robert Osfield
e9589ebb49 From Paul Martz, "Another round of plugin enhancements.
3DC: Output now uses osg::notify.
JPEG: Now returns correct error code for empty input file.
FreeType: Prevent possible crash if Options is NULL."
2008-05-10 17:23:12 +00:00
Robert Osfield
4d7b2edd4c Moved compile setup from osgViewer::ViewerBase into osgViewer::Renderer to
avoid threading issues associated with compile running in a parallel with 
update/cull on the first frame.

Also added automatic recompile when a new SceneData is applied to a View.
2008-05-10 17:04:02 +00:00
Robert Osfield
0dfba5dbe5 Added --file-cache command line option to compliment -c 2008-05-09 17:22:49 +00:00
Robert Osfield
b12069e14c Initial cut of file cache population app 2008-05-09 17:08:31 +00:00
Robert Osfield
ebf653369a From Art Trevs, set the _geometryVerticesOut to default to 1 as a workaround
for OpenGL driver bug that incorrectly reports a warning when value is 0.
2008-05-09 11:54:24 +00:00
Robert Osfield
61e3285ffc From Paul Martz, "Attached are some minor plugin fixes. PNM, RGB, and JPEG would all crash if attempting to read an empty file, and FLT would go into an infinite loop. All are fixed with this change.
I also fixed some return values for a couple of these, changing FILE_NOT_HANDLED to ERROR_IN_READING_FILE where appropriate."
2008-05-09 11:27:03 +00:00
Robert Osfield
01f58ffbb2 From Jeremy Moles, fixed window resize problem 2008-05-09 10:27:59 +00:00
Robert Osfield
f733bf17e9 Added missing check against handling invalid bounding sphere's 2008-05-08 17:02:08 +00:00
Robert Osfield
59653bcc08 From Eric Sokolowsky, "I found one compilation error in OSG 2.4 in the Inventor plugin, where one node (SoTextureCoordinate3) was assumed to be available in all versions of Inventor but is actually only available in Coin. The use of the node is now protected by #ifdef __COIN__ constructs. The attachment is based on OSG 2.4, not SVN." 2008-05-08 16:48:49 +00:00
Robert Osfield
9e6c3a7628 From Melchior Franz, "In KDE I switch desktops with Super-Tab, and occasionally I
get an excess Tab key report when switching back to an OSG
application (usually FlightGear :-). Although KDE has consumed
the Tab, it's sometimes still in the XKeymapEvent's key_vector,
and followed by a Tab KeyRelease event.

Avoid this artifact by
- asking for a "fresh" keymap (via XQueryKeymap()), rather than
 using the unreliable(?) XKeymapEvent's key_vector, and by
- flushing all key events on focus-in (to avoid the KeyRelease)

After Super-press, Tab-press, Super-release, Tab-release (note
the wrong release order!) I still get an extra Tab event. But
this is not surprising and not exactly wrong either. Also it's
hard to avoid, as we can't see what happened to the keyboard
before we regained focus.

Files changed:
 src/osgViewer/GraphicsWindowX11.cpp
 include/osgViewer/api/X11/GraphicsWindowX11"
2008-05-08 16:45:59 +00:00
Robert Osfield
4345382316 From Jeremy Moles, osgviewerGTK example 2008-05-08 16:39:10 +00:00
Robert Osfield
ebf3804c84 From Sebastien Messerschmidt, "attached you'll find a patch for the shp-plugin.
I've spotted huge memory leaks int ShapeParser and fixed them.
Also, there was a missing destructor (PolygonM) and a missing member initialization (PolygonZ)
Would be nice if someone could test the changes.

To release the memory just if no reading error happened (and therefore the arrays would be valid) I've added an macro to release and reset the pointers at once. I'm not using macros myself very often as I don't like them, but I think it doesn't hurt in this code.

"
2008-05-08 15:17:53 +00:00
Robert Osfield
dc0355fc84 Updated ChangeLog and osgversion to catch Raymond de Vries name correctly 2008-05-08 15:14:13 +00:00
Robert Osfield
b9359048d6 From Raymond de Vries, "This fix tests the right variable before it is allocated. Fortunately, until now it tested another variable (_particleSizeUniform, which is, at that moment, not allocated as well) and everything went ok. So it does not fix a crash or so, it is a matter of correct code.
Line 353 is changed from

if (!_particleSizeUniform)

to

if (!_particleColorUniform)
"
2008-05-08 14:00:00 +00:00
Robert Osfield
6d61e554b4 From Paul Martz, "As I discovered prior to the 2.4 release, the FLT export geometry backend was using some old turn-on code, originally written just to enable other development but not intended for actual release. Sadly, my OSG training commitments prevented me from fixing this prior to 2.4.
In essence, the FLT exporter was emitting a full set of Mesh records each time it encountered a PrimitiveSet.
 
Attached is a fix. The code now emits the Mesh set up records, then iterates over all PrimitiveSets and emits a Mesh Primitive record per PrimitiveSet.
 
It also loops over PrimitiveSets twice, first writing Face records according to the mode, the writing Mesh records (again according to the mode).
 
The final change included here is support for GL_POINTS as single-vertex Face records.
 
Billboards are still to come."
2008-05-08 13:56:28 +00:00
Robert Osfield
0df8d414f4 Updated wrappers 2008-05-08 13:46:58 +00:00
Robert Osfield
dd1a2bcaec From Roland Smeenk, "Small typo and implementation fix for setInitialDrawCallback." 2008-05-08 13:22:52 +00:00
Robert Osfield
47814e50a4 From Philip Lowman, "Attached is a patch to the toplevel CMakeLists.txt which adds an automated test for OSG_GLU_TESS_CALLBACK_TRIPLEDOT. This should help ease initial configuration on OS X systems." 2008-05-08 12:55:01 +00:00
Robert Osfield
973f104704 From Garrett Potts and Robert Osfield, changes to build against Collada DOM 2.x 2008-05-08 12:36:07 +00:00
Robert Osfield
38133f8772 Updated the doxygen docs to explain the deprecated status of SceneView 2008-05-08 09:16:24 +00:00
Robert Osfield
5fbb582856 Commented out checking of DISPLAY env var 2008-05-07 17:06:36 +00:00
Robert Osfield
fd6a812dd0 Updated wrappers 2008-05-07 14:32:39 +00:00
Robert Osfield
22c7699fa1 From Bob Kuehne, Added doxygen docs clarification of ReadResult enum values 2008-05-07 14:30:58 +00:00
Robert Osfield
01f58e2b76 From Donald Cipperly, "This is a fix to eliminate >> errors in VS 7.1" 2008-05-07 14:24:14 +00:00
Robert Osfield
96f2062115 From Miguel Escriva, "Attached to this mail you will find some files to work with the Philips WOWvx displays.
It's implemented in the same way that 3D Spherical Display and Panoramic Spherical Display.

You can test it running:
   osgviewer --wowvx-20 cow.osg
   osgviewer --wowvx-42 cow.osg
depending on the size of your Philips WOWvx display (20" or 42")

Other arguments you can use to control the 3D effect are:

--wow-content <value>
   This value defines the kind of content that can be:
      0: No depth
      1: Signage
      2: Movie
      3: CGI
      4: Still

--wow-factor <value>
   Percentage of the display recommended depth value. Default 64, Range [0-255]

--wow-offset <value>
   Amount of range behind the screen. Default 128, Range [0-255]
      0: Range is shifted in the direction of the viewer.
      128: Range is equally divided in front and behind the screen.
      255: Range is shifted away from the viewer.
      "
2008-05-07 14:17:15 +00:00
Robert Osfield
7c94ff2b6d From Terry Welsh, fixed typo of getEnd() 2008-05-07 13:49:32 +00:00
Robert Osfield
4f881b9a09 From Jeremy Moles,"Here's a small example I us to test text rendering in osgWidget; I
figured it might be helpful to folks in OSG who need to do the same.
"
2008-05-07 13:46:24 +00:00
Robert Osfield
10c3044499 From Farshid Lashkari, "I've added hardware mipmap support to Texture3D." 2008-05-07 13:42:29 +00:00
Robert Osfield
14a7b5dd08 Added doxygen comments for attach 2008-05-07 11:59:15 +00:00
Robert Osfield
6ef7e6dcaf Updated package numbers for OSG-2.4, OT-2.2.1 release 2008-04-26 11:13:08 +00:00
1430 changed files with 149924 additions and 40985 deletions

View File

@@ -1,183 +1,224 @@
OpenSceneGraph Library 2.4.0
OpenSceneGraph Library 2.8.2
307 Contributors:
373 Contributors:
Firstname Surname
-----------------
Robert Osfield
Don Burns
Marco Jez
Mike Weiblen
Paul Martz
Mike Weiblen
Mathias Fr<46>hlich
Eric Wing
Stephan Huber
Brede Johansen
Geoff Michel
Stephan Huber
Farshid Lashkari
Bob Kuehne
Ulrich Hertlein
Martin Lavery
Eric Sokolowsky
Mathias Fr<46>hlich
Tree
Jean-Sebastien Guay
Martin Lavery
David Callu
Tree
Luigi Calori
Trajce Nikolov
Mike Wittman
Jean-Sebastien Guay
Pavel Moloshtan
Tom Jolley
Wojciech Lewandowski
Paul Melis
Colin McDonald
Andy Skinner
Roger James
Pavel Moloshtan
Mattias Helsing
Tom Jolley
Jeremy Moles
Jason Beverage
Norman Vine
Colin McDonald
Cedric Pinson
Art Tevs
Alberto Farre
Roland Smeenk
Michael Platings
Andr<EFBFBD> Garneau
Ruben Lopez
Randall Hopper
Wojciech Lewandowski
Jason Daly
J.P. Delport
Adrian Egli
Olaf Flebbe
Mathieu Marache
Gideon May
Don Tidrow
Sherman Wilcox
Romano Jos<6F> Magacho da Silva
Per Fahlberg
Michael Gronager
Joakim Simonsson
David Spilling
Daniel Sj<53>lie
Chris Hanson
Per Fahlberg
Jeremy Moles
J.P. Delport
David Spilling
Art Tevs
Sherman Wilcox
Joran Jessurun
Jason Beverage
Paul Melis
Jason Daly
Frederic Marmond
Alberto Luaces
Philip Lowman
Chris Denham
Melchior Franz
Lionel Lagarde
David Fries
Bryan Thrall
Terry Welsh
Serge Lages
Joran Jessurun
Frederic Marmond
Boris Bralo
Yefei He
Tim Moore
Stephane Lamoliatte
Sondra Iverson
Serge Lages
Rune Schmidt Jensen
Rainer Oder
Neil Groves
Mike Connell
Melchior Franz
Joakim Simonsson
Martin Aumueller
Mario Valle
Gordon Tomlinson
Gino van den Bergen
Carlo Camporesi
Ben Discoe
Andreas Ekstrand
Adrian Egli
Thibault Genessay
Sukender
Sasa Bistrovic
Martin Naylor
Martin Aumueller
Markus Trenkwalder
Loic Dachary
Joseph Steel
John Shue
Jan Peciva
Jan Ciger
Gordon Tomlinson
Bryan Thrall
Glenn Waldron
Brad Colbert
Vivek Rajan
Sean Spicer
Ravi Mathur
Peter Hrenka
Nikolaus Hanekamp
Neil Salter
Mihai Radu
Michael Platings
Michael Hartman
Luc Frauciel
Laurens Voerman
David Guthrie
Corbin Holtz
Brad Christiansen
Blasius Czink
Toshiyuki Takahei
Thom DeCarlo
Terry Welsh
Stephane Lamoliatte
Tatsuhiro Nishioka
Simon Julier
Sebastien Grignard
Romano Magacho
Philip Lowman
Richard Schmidt
Riccardo Corsi
Ralf Habacker
Paul de Repentigny
Luc Frauciel
Liang Aibin
Leandro Motta Barros
John Vidar Larring
John Kelso
Glenn Waldron
Daniel Larimer
Csaba Halasz
Colin Dunlop
Cedric Pinson
Bruce Clay
Alberto Luaces
Alberto Barbati
Vladimir Shabanov
Uwe Woessner
Tony Horrobin
Tim Moore
Thibault Genessay
Sohey Yamamoto
Roland Smeenk
Richard Schmidt
Rudolf Wiedemann
Rafa Gaitan
Phil Atkin
Peter Hrenka
Neil Hughes
Miguel Escriva
Mattias Linde
Mattias Helsing
Mathieu Marache
Maria Ten
Ken Sewell
Julian Ortiz
Jeremy Bell
Jaromir Vitek
James French
Gary Quinn
Garrett Potts
Gabor Dorka
Fabio Mierlo
Fabien Lavignotte
Doug McCorkle
Donn Mielcarek
Donald Cipperly
Domenico Mangieri
Charles Cole
Blake Williams
Antoine Hue
Andrew Bettison
Andreas Goebel
Anders Backman
Ali Botorabi
Zach Deedler
Yuzhong Shen
Wang Rui
Tugkan Calapoglu
Tim Daoust
Terrex
Tanguy Fautr<74>
Sylvain Marie
Steve Lunsford
Stephane Simon
Stephan Eilemann
Stanislav Blinov
Riccardo Corsi
Sergey Leontyev
Sebastian Messerschmidt
Rene Molenaar
Ralf Kern
Pierre Haritchabalet
Perry Miller
Paul Obermeier
Neil Hughes
Nathan Monteleone
Morn<EFBFBD> Pistorius
Michael Henheffer
Michael Guerrero
Maya Leonard
Max Behensky
Max Bandazian
Mathew May
Martin Spott
Martijn Kragtwijk
Konstantin Sinitsyn
Kevin Moiule
Keith Steffen
Katharina Plugge
Joseph Winston
John Aughey
Johan Nouvel
Jim Vaughan
James Moliere
Igor Kravtchenko
He Sicong
Gustavo Wagner
Gino van den Bergen
Guillaume Chouvenc
Gerrick Bivins
George Tarantilis
Garret Potts
Fabio Mierlo
Frederic Bouvier
Ferdi Smit
Ewe Woessner
Erik den Dekker
Emmanuel Roche
Edgar Ellis
Donald Cipperly
Don Leich
David Ergo
Daniel Trstenjak
Csaba Halasz
Christophe Loustaunau
Brad Anderegg
Andrew Sampson
Andrew Lorino
Andreas Goebel
Zbigniew Sroczynski
Yuri Vilmanis
Warren Macchi
@@ -187,40 +228,51 @@ Volker Walkiewicz
Vladimir Vukicevic
Vlad Danciu
Vincent Vivanloc
Vincent Bourdier
Vasily Radostev
Vaclav Bilek
Tyge
Troy Yee
Tomas Hnilica
Tino Schwarze
Thomas Weidner
Thom Carlo
Tery Welsh
Tatsuhiro Nishioka
Tanguy Fautr<74>
Steven Thomas
Simon Hammett
Sid Byce
Shuxing Xiao
Shane Arnott
Sebastien Kuntz
Sebastian Messerschimdt
Rudolf Wiedemann
Ruth Lang
Ruben Smelik
Ross Anderson
Ronny Krueger
Robert Swain
Rob Bloemkool
Rick Pingry
Rene Molenaar
Rick Appleton
Ricard Schmidt
Reinhard Sainitzer
Rein Kadijk
Raymond de Vries
Ragnar Hammarqvist
Qing Shen
Piotr Rak
Philipp Siemoleit
Philipp M<>chler
Paul Obermeier
Petr Salinger
Paul Palumbo
Paul Fredrikson
Paul Fotheringham
Patrick Hartling
Parag Chaudhur
Panagiotis Papadakos
Panagiotis Koutsourakis
Orhun Birsoy
Ole-Morten Duesund
Nicolas Brodu
Nathan Cournia
Morn<EFBFBD> Pistorius
Morten Haukness
Mirko Viviani
Mikkel Gjøl
Mike Garrity
@@ -228,81 +280,94 @@ Michael Polak
Michael Morrison
Michael Logan
Max Rhiener
Max Behensky
Mauricio Hofmam
Matthew May
Matt Green
Matt Burke
Mathia Walker
Mason Menninger
Martin Spott
Martin Amueller
Mario Valle
Martins Innus
Mario Guimaraes
Marin Lavery
Marco Lehmann
Marcin Prus
Maciej Krol
Lukas Diduch
Louis Hamilton
Lilin Xiong
Lewis Harmon
Lars Nilson
Kyle Centers
Kristopher Bixler
Karsten Weiss
Karl Heijdenberg
Jutta Sauer
Julian Scheid
Josh Portway
John Tan
John Grant
John Donovan
John Davis
John Argentieri
Joan Abadie
Jeroen den Dekker
Jean-Christophe Lombardo
Jay Zuckerman
Jason Howlett
Jason Ballenger
J.E. Hoffmann
Humar Carmona
Henrique Bucher
He Sicong
Hautio Jari
Guillaume Millet
Graeme Harkness
Glen Waldron
Gian Lorenzetto
George Papagiannakis
Gary Quinn
Galen Faidley
Frederic Bouvier
Frashid Lashkari
Frank Warmerdam
Frank Midgley
Frank Lindeman
Frank Lichtenheld
Ferdinand Cornelissen
Fajran Iman
Fabien Dachicourt
Emmanuel Roche
Edmond Gheury
Ed Ralston
Duvan Cope
Duncan Cavens
Drew Whitehouse
Douglas A. Pouk
Doug McCorkle
Dean Iverson
David Jung
David Gurhrie
Danny Valente
Daniel Stien
Dan Minor
Cyril Brulebois
Cory Riddell
Clay Fowler
Chuck Sembroski
Chuck Seberion
Christopher Blaesius
Christian Kaser
Chris McGlone
Carlos Garcea
Bruno Herbelin
Brian Keener
Brandon Hamm
Brad Anderegg
Bora Utka
Blasius Czink
Bj<EFBFBD>rn Hein
Bill Prendergast
Benoit Laniel
Ben van Basten
Bart Gallet
Axel Volley
Andy Preece
Andrew Reyonolds
Andreas Jochens
Andre Normann
Almalric Alexandre
Allen Bierbaum
Alexandre Amalric
@@ -310,4 +375,5 @@ Alberto Jaspe
Alan Purvis
Alan Ott
Alan Harris
Alan Dickinson
Adam Richard

View File

@@ -1,23 +1,41 @@
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
IF(WIN32)
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)
ELSE(WIN32)
IF(APPLE)
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)
IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4 AND ${CMAKE_PATCH_VERSION} LESS 7)
MESSAGE("Warning: A critical CMake bug exists in 2.4.6 and below. Trying to build Universal Binaries will result in a compile error that seems unrelated. Either avoid building Universal Binaries by changing the CMAKE_OSX_ARCHITECTURES field to list only your architecture, or upgrade to the current CVS version of CMake or a newer stable version if it exists.")
ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4 AND ${CMAKE_PATCH_VERSION} LESS 7)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
ELSE(APPLE)
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0 FATAL_ERROR)
ENDIF(APPLE)
ENDIF(WIN32)
if(COMMAND cmake_policy)
# Works around warnings libraries linked against that don't
# have absolute paths (e.g. -lpthreads)
cmake_policy(SET CMP0003 NEW)
# Works around warnings about escaped quotes in ADD_DEFINITIONS
# statements.
cmake_policy(SET CMP0005 NEW)
# cmake-2.6.1 introduces policy cmp0008 decide how to treat full path libraries that do not appear to be valid library file names
# quote from cvslog "Such libraries worked by accident in the VS IDE and Xcode generators in CMake 2.4 and below."
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND ${CMAKE_PATCH_VERSION} GREATER 0)
cmake_policy(SET CMP0008 OLD)
endif(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND ${CMAKE_PATCH_VERSION} GREATER 0)
endif(COMMAND cmake_policy)
PROJECT(OpenSceneGraph)
SET(OPENSCENEGRAPH_MAJOR_VERSION 2)
SET(OPENSCENEGRAPH_MINOR_VERSION 4)
SET(OPENSCENEGRAPH_PATCH_VERSION 0)
SET(OPENSCENEGRAPH_SOVERSION 35)
SET(OPENSCENEGRAPH_MINOR_VERSION 8)
SET(OPENSCENEGRAPH_PATCH_VERSION 2)
SET(OPENSCENEGRAPH_SOVERSION 55)
# set to 0 when not a release candidate, non zero means that any generated
# svn tags will be treated as release candidates of given number
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 0)
SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION})
@@ -44,34 +62,83 @@ SET(OpenThreads_SOURCE_DIR ${OpenSceneGraph_SOURCE_DIR})
# Maybe this can be used override existing behavior if needed?
SET(CMAKE_MODULE_PATH "${OpenSceneGraph_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
# Mainly for Windows as a convenience. This will find a directory in parallel with the
# OSG source that contains 3rd party headers and libraries.
# Use of relative paths in CMake is ill-advised, but don't know of any alternatives in this case
#SET(CMAKE_INCLUDE_PATH "${OpenSceneGraph_SOURCE_DIR}/../3rdParty/include;${CMAKE_INCLUDE_PATH}")
#SET(CMAKE_LIBRARY_PATH "${OpenSceneGraph_SOURCE_DIR}/../3rdParty/lib;${CMAKE_LIBRARY_PATH}")
IF(USING_OSG_OP_OT_TRIPLE_SET)
SET(CMAKE_INCLUDE_PATH "${OpenSceneGraph_SOURCE_DIR}/../../3rdParty/include;${CMAKE_INCLUDE_PATH}")
SET(CMAKE_LIBRARY_PATH "${OpenSceneGraph_SOURCE_DIR}/../../3rdParty/lib;${CMAKE_LIBRARY_PATH}")
ENDIF(USING_OSG_OP_OT_TRIPLE_SET)
# Okay, here's the problem: On some platforms, linking against OpenThreads
# is not enough and explicit linking to the underlying thread library
# is not enough and explicit linking to the underlying thread library
# is also required (e.g. FreeBSD). But OpenThreads may be built with different
# backends (Pthreads, Sproc, Windows) so we don't know what the underlying
# thread library is because some platforms support multiple backends (e.g.
# IRIX supports Sproc and Pthreads). Linking all libraries won't work
# backends (Pthreads, Sproc, Windows) so we don't know what the underlying
# thread library is because some platforms support multiple backends (e.g.
# IRIX supports Sproc and Pthreads). Linking all libraries won't work
# because the libraries may be incompatible.
# So the current solution is to attempt best guess linking and exempt certain
# So the current solution is to attempt best guess linking and exempt certain
# cases. With IRIX, we're going to hope explicit linking to the underlying
# library is not necessary. We currently don't case for pthreads on Windows
# which might be an issue on things like Cygwin. This may need to be fixed.
FIND_PACKAGE(Threads)
IF(CMAKE_SYSTEM MATCHES IRIX)
# Erase CMAKE_THREAD_LIBS_INIT and hope it works
SET(CMAKE_THREAD_LIBS_INIT "" CACHE INTERNAL "")
SET(CMAKE_THREAD_LIBS_INIT "" CACHE INTERNAL "")
ENDIF(CMAKE_SYSTEM MATCHES IRIX)
OPTION(OSG_MAINTAINER "Enable OpenSceneGraph maintainer build methods, such as making svn branches, tags, updating ChangeLog." OFF)
IF (OSG_MAINTAINER)
#SET(OPENSCENEGRAPH_SVN "trunk")
SET(OPENSCENEGRAPH_SVN "branches")
SET(OPENSCENEGRAPH_BRANCH OpenSceneGraph-${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION})
#
# Provide target for tagging a release
#
SET(SVNCOMMAND svn)
SET(SVNTRUNKDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk)
SET(SVNTAGDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags)
SET(SVNBRANCHDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches)
IF (OPENSCENEGRAPH_SVN STREQUAL "trunk")
SET(SVNSOURCEDIR ${SVNTRUNKDIR})
ELSE (OPENSCENEGRAPH_SVN STREQUAL "trunk")
SET(SVNSOURCEDIR ${SVNBRANCHDIR}/${OPENSCENEGRAPH_BRANCH})
ENDIF(OPENSCENEGRAPH_SVN STREQUAL "trunk")
IF (OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0)
SET(RELEASE_NAME OpenSceneGraph-${OPENSCENEGRAPH_VERSION})
ELSE (OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0)
SET(RELEASE_NAME OpenSceneGraph-${OPENSCENEGRAPH_VERSION}-rc${OPENSCENEGRAPH_RELEASE_CANDIDATE})
ENDIF(OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0)
ADD_CUSTOM_TARGET(tag-test
COMMAND echo ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNTAGDIR}/${RELEASE_NAME} -m "Release ${RELEASE_NAME}"
)
ADD_CUSTOM_TARGET(tag-run
COMMAND ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNTAGDIR}/${RELEASE_NAME} -m "Release ${RELEASE_NAME}"
)
ADD_CUSTOM_TARGET(branch-test
COMMAND echo ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNBRANCHDIR}/${OPENSCENEGRAPH_BRANCH} -m "Branch ${OPENSCENEGRAPH_BRANCH}"
)
ADD_CUSTOM_TARGET(branch-run
COMMAND ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNBRANCHDIR}/${OPENSCENEGRAPH_BRANCH} -m "Branch ${OPENSCENEGRAPH_BRANCH}"
)
#
# Provide target for generating ChangeLog
#
SET(GENERATELOGS svn2cl)
ADD_CUSTOM_TARGET(ChangeLog
COMMAND ${SVNCOMMAND} update
COMMAND ${GENERATELOGS} ${SVNSOURCEDIR}
)
ENDIF(OSG_MAINTAINER)
# Find OpenGL
FIND_PACKAGE(OpenGL)
@@ -87,49 +154,42 @@ IF(UNIX)
# Some Unicies need explicit linkage to the Math library or the build fails.
FIND_LIBRARY(MATH_LIBRARY m)
ENDIF(UNIX)
# Make the headers visible to everything
IF(NOT ${PROJECT_BINARY_DIR} EQUAL ${PROJECT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include)
ENDIF(NOT ${PROJECT_BINARY_DIR} EQUAL ${PROJECT_SOURCE_DIR})
INCLUDE_DIRECTORIES(
${OpenSceneGraph_SOURCE_DIR}/include
${OPENGL_INCLUDE_DIR}
)
# Common global definitions
#ADD_DEFINITIONS(-D)
# Platform specific definitions
IF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT)
SET(DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT OFF)
IF (CMAKE_SYSTEM MATCHES "AIX.*")
SET(DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT ON)
ENDIF(CMAKE_SYSTEM MATCHES "AIX.*")
IF (APPLE)
SET(DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT ON)
ENDIF(APPLE)
ENDIF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT)
OPTION(OSG_GLU_TESS_CALLBACK_TRIPLEDOT "Set to ON to build build with (...) version of GLU tesselator callback" ${DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT})
IF (OSG_GLU_TESS_CALLBACK_TRIPLEDOT)
ADD_DEFINITIONS(-DGLU_TESS_CALLBACK_TRIPLEDOT)
ENDIF(OSG_GLU_TESS_CALLBACK_TRIPLEDOT)
IF(WIN32)
# This option is to enable the /MP switch for Visual Studio 2005 and above compilers
OPTION(WIN32_USE_MP "Set to ON to build OpenSceneGraph with the /MP option (Visual Studio 2005 and above)." OFF)
MARK_AS_ADVANCED(WIN32_USE_MP)
IF(WIN32_USE_MP)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
ENDIF(WIN32_USE_MP)
IF(MSVC)
# This option is to enable the /MP switch for Visual Studio 2005 and above compilers
OPTION(WIN32_USE_MP "Set to ON to build OpenSceneGraph with the /MP option (Visual Studio 2005 and above)." OFF)
MARK_AS_ADVANCED(WIN32_USE_MP)
IF(WIN32_USE_MP)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
ENDIF(WIN32_USE_MP)
# turn off various warnings
# foreach(warning 4244 4251 4267 4275 4290 4786 4305 4996)
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd${warning}")
# endforeach(warning)
# More MSVC specific compilation flags
ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
ENDIF(MSVC)
ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
#needed for net plugin
SET (OSG_SOCKET_LIBS wsock32)
# Both Cygwin and Msys need -DNOMINMAX ???
@@ -137,13 +197,13 @@ IF(WIN32)
ADD_DEFINITIONS(-DNOMINMAX)
ENDIF(UNIX)
########################################################################################################
# the foolowing options are MSVC specific,
# the first OSG_MSVC_VERSIONED_DLL activate a custom build-time layout that should allow to run examples and application
# the following options are MSVC specific,
# the first OSG_MSVC_VERSIONED_DLL activate a custom build-time layout that should allow to run examples and application
# fron bin folder without requiring installation step.
# it also prepend "osg${OPENSCENEGRAPH_SOVERSION}-" to only .dll files, leaving .lib files untouched in lib
# it also use a hack to get rid of Debug and Release folder in MSVC projects
# it also use a hack to get rid of Debug and Release folder in MSVC projects
# all the .dll and .pdb are in bin and all the .lib and .exp are in lib
#
#
# the second option disable incremental linking in debug build , that is enabled by default by CMake
##########################################################################################################
@@ -187,27 +247,41 @@ ENDIF(WIN32)
OPTION(OSG_USE_FLOAT_MATRIX "Set to ON to build OpenSceneGraph with float Matrix instead of double." OFF)
MARK_AS_ADVANCED(OSG_USE_FLOAT_MATRIX)
IF(OSG_USE_FLOAT_MATRIX)
ADD_DEFINITIONS(-DOSG_USE_FLOAT_MATRIX)
ENDIF(OSG_USE_FLOAT_MATRIX)
OPTION(OSG_USE_FLOAT_PLANE "Set to ON to build OpenSceneGraph with float Plane instead of double." OFF)
MARK_AS_ADVANCED(OSG_USE_FLOAT_PLANE)
IF(OSG_USE_FLOAT_PLANE)
ADD_DEFINITIONS(-DOSG_USE_FLOAT_PLANE)
ENDIF(OSG_USE_FLOAT_PLANE)
OPTION(OSG_USE_FLOAT_BOUNDINGSPHERE "Set to ON to build OpenSceneGraph with float BoundingSphere instead of double." ON)
MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGSPHERE)
IF(NOT OSG_USE_FLOAT_BOUNDINGSPHERE)
ADD_DEFINITIONS(-DOSG_USE_DOUBLE_BOUNDINGSPHERE)
ENDIF(NOT OSG_USE_FLOAT_BOUNDINGSPHERE)
OPTION(OSG_USE_FLOAT_BOUNDINGBOX "Set to ON to build OpenSceneGraph with float BoundingBox instead of double." ON)
MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGBOX)
IF(NOT OSG_USE_FLOAT_BOUNDINGBOX)
ADD_DEFINITIONS(-DOSG_USE_DOUBLE_BOUNDINGBOX)
ENDIF(NOT OSG_USE_FLOAT_BOUNDINGBOX)
OPTION(OSG_USE_UTF8_FILENAME "Set to ON to use a UTF8 locale for filenames instead of the default locale." OFF)
MARK_AS_ADVANCED(OSG_USE_UTF8_FILENAME)
OPTION(OSG_DISABLE_MSVC_WARNINGS "Set to OFF to not disable MSVC warnings generated by OSG headers." ON)
MARK_AS_ADVANCED(OSG_DISABLE_MSVC_WARNINGS)
OPTION(OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION "Set to ON to use the ref_ptr<> T* operator() output conversion. " ON)
################################################################################
# Set Config file
SET(OPENSCENEGRAPH_CONFIG_HEADER "${PROJECT_BINARY_DIR}/include/osg/Config")
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/osg/Config.in"
"${OPENSCENEGRAPH_CONFIG_HEADER}")
# INSTALL_FILES(/include/osg/ FILES "${OPENSCENEGRAPH_CONFIG_HEADER}")
################################################################################
# Optional build components
# OSG Applications
OPTION(BUILD_OSG_APPLICATIONS "Enable to build OSG Applications (e.g. osgviewer)" ON)
# OSG Examples
OPTION(BUILD_OSG_EXAMPLES "Enable to build OSG Examples" OFF)
################################################################################
# 3rd Party Dependency Stuff
@@ -217,52 +291,126 @@ ENDIF(WIN32)
# Common to all platforms:
FIND_PACKAGE(FreeType)
FIND_PACKAGE(FLTK)
FIND_PACKAGE(GLUT)
FIND_PACKAGE(SDL)
FIND_PACKAGE(FOX)
FIND_PACKAGE(Inventor)
FIND_PACKAGE(Jasper)
FIND_PACKAGE(OpenEXR)
FIND_PACKAGE(COLLADA)
FIND_PACKAGE(ZLIB)
FIND_PACKAGE(Xine)
FIND_PACKAGE(OpenVRML)
FIND_PACKAGE(Performer)
FIND_PACKAGE(ZLIB)
FIND_PACKAGE(GDAL)
FIND_PACKAGE(CURL)
FIND_PACKAGE(ITK)
FIND_PACKAGE(LibVNCServer)
FIND_PACKAGE(OurDCMTK)
FIND_PACKAGE(XUL)
SET(wxWidgets_USE_LIBS base core gl net)
FIND_PACKAGE(wxWidgets)
#use pkg-config to find various modues
INCLUDE(FindPkgConfig OPTIONAL)
# To select a specific version of QT define DESIRED_QT_VERSION
# via cmake -DDESIRED_QT_VERSION=4
IF (DESIRED_QT_VERSION)
IF(PKG_CONFIG_FOUND)
IF (DESIRED_QT_VERSION MATCHES 4)
FIND_PACKAGE(Qt4)
ELSE(DESIRED_QT_VERSION MATCHES 4)
FIND_PACKAGE(Qt3)
ENDIF(DESIRED_QT_VERSION MATCHES 4)
ELSE(DESIRED_QT_VERSION)
INCLUDE(FindPkgConfig)
FIND_PACKAGE(Qt4)
IF (NOT QT4_FOUND)
FIND_PACKAGE(Qt3)
ENDIF(NOT QT4_FOUND)
ENDIF(DESIRED_QT_VERSION)
PKG_CHECK_MODULES(GTK gtk+-2.0)
IF(WIN32)
PKG_CHECK_MODULES(GTKGL gtkglext-win32-1.0)
ELSE(WIN32)
PKG_CHECK_MODULES(GTKGL gtkglext-x11-1.0)
ENDIF(WIN32)
PKG_CHECK_MODULES(RSVG librsvg-2.0)
PKG_CHECK_MODULES(CAIRO cairo)
PKG_CHECK_MODULES(POPPLER poppler-glib)
ENDIF(PKG_CONFIG_FOUND)
#optional example related dependencies
IF (BUILD_OSG_EXAMPLES)
FIND_PACKAGE(FLTK)
FIND_PACKAGE(GLUT)
FIND_PACKAGE(SDL)
FIND_PACKAGE(FOX)
SET(wxWidgets_USE_LIBS base core gl net)
FIND_PACKAGE(wxWidgets)
# To select a specific version of QT define DESIRED_QT_VERSION
# via cmake -DDESIRED_QT_VERSION=4
IF (DESIRED_QT_VERSION)
IF (DESIRED_QT_VERSION MATCHES 4)
FIND_PACKAGE(Qt4)
ELSE(DESIRED_QT_VERSION MATCHES 4)
FIND_PACKAGE(Qt3)
ENDIF(DESIRED_QT_VERSION MATCHES 4)
ELSE(DESIRED_QT_VERSION)
FIND_PACKAGE(Qt4)
IF (NOT QT4_FOUND)
FIND_PACKAGE(Qt3)
ENDIF(NOT QT4_FOUND)
ENDIF(DESIRED_QT_VERSION)
ENDIF(BUILD_OSG_EXAMPLES)
#
# Test to determine if we want the "tripledot" form of the GLU tesselator callback.
#
IF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT)
IF(WIN32 OR CMAKE_SYSTEM_NAME MATCHES "Linux")
# Skip the compile check for platforms that never need the variable
# form.
SET(DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT false)
ELSE(WIN32 OR CMAKE_SYSTEM_NAME MATCHES "Linux")
# For other platforms perform the check
INCLUDE(CheckCXXSourceCompiles)
SET(CMAKE_REQUIRED_DEFINITIONS -DGLU_TESS_CALLBACK_TRIPLEDOT)
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/include ${GLUT_INCLUDE_DIR} ${GL_INCLUDE_DIR})
SET(CMAKE_REQUIRED_LIBRARIES ${GLUT_LIBRARY} ${GL_LIBRARY})
CHECK_CXX_SOURCE_COMPILES(
"#include <osg/GL>
#include <osg/GLU>
static void testcb(GLvoid *, void*) { }
int main() {
GLUtesselator *t = gluNewTess();
gluTessCallback(t, GLU_TESS_VERTEX_DATA, (GLU_TESS_CALLBACK) testcb);
return 0;
}"
GLU_Tesselator_Needs_Variable_Parameter_Callback_Convention_Failure_Means_No)
SET(DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT
${GLU_Tesselator_Needs_Variable_Parameter_Callback_Convention_Failure_Means_No})
ENDIF(WIN32 OR CMAKE_SYSTEM_NAME MATCHES "Linux")
ENDIF(NOT DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT)
OPTION(OSG_GLU_TESS_CALLBACK_TRIPLEDOT "Set to ON to build with variable parameter (...) version of GLU tesselator callback" ${DEFAULT_GLU_TESS_CALLBACK_TRIPLEDOT})
IF(OSG_GLU_TESS_CALLBACK_TRIPLEDOT)
ADD_DEFINITIONS(-DGLU_TESS_CALLBACK_TRIPLEDOT)
ENDIF(OSG_GLU_TESS_CALLBACK_TRIPLEDOT)
# Platform specific:
# (We can approach this one of two ways. We can try to FIND everything
# and simply check if we found the packages before actually building
# or we can hardcode the cases. The advantage of the former is that
# or we can hardcode the cases. The advantage of the former is that
# packages that are installed on platforms that don't require them
# will still get built (presuming no compatibility issues). But this
# also means modules that are redundant may get built. For example,
# will still get built (presuming no compatibility issues). But this
# also means modules that are redundant may get built. For example,
# OS X doesn't need GIF, JPEG, PNG, TIFF, etc because it uses QuickTime.
# Also, it will clutter the CMake menu with "NOT_FOUND".
# The downside to the latter is that it is harder to build those
@@ -280,8 +428,8 @@ IF(NOT APPLE)
IF(WIN32)
FIND_PACKAGE(QuickTime)
ENDIF(WIN32)
ELSE(NOT APPLE)
ELSE(NOT APPLE)
FIND_PACKAGE(QuickTime)
ENDIF(NOT APPLE)
@@ -296,7 +444,20 @@ ENDIF("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
################################################################################
# Installation stuff
SET(CMAKE_DEBUG_POSTFIX "d")
SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows")
ADD_DEFINITIONS(-DOSG_DEBUG_POSTFIX=${CMAKE_DEBUG_POSTFIX})
IF(UNIX AND NOT WIN32)
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
ADD_DEFINITIONS("-D_DEBUG")
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
ENDIF(UNIX AND NOT WIN32)
IF(CYGWIN)
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
ADD_DEFINITIONS("-D_DEBUG")
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
ENDIF(CYGWIN)
IF(UNIX AND NOT WIN32 AND NOT APPLE)
IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
@@ -307,7 +468,10 @@ ENDIF(UNIX AND NOT WIN32 AND NOT APPLE)
IF(NOT DEFINED LIB_POSTFIX)
SET(LIB_POSTFIX "")
ENDIF(NOT DEFINED LIB_POSTFIX)
# Here we apparantly do some funky stuff with making the bin/ and lib/
# folders which is probably needed to work around a very old CMake bug?
#SET(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin/${CMAKE_SYSTEM_NAME})
SET(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin)
MAKE_DIRECTORY(${OUTPUT_BINDIR})
@@ -315,17 +479,32 @@ IF(MSVC AND NOT MSVC_IDE)
MAKE_DIRECTORY(${OUTPUT_BINDIR}/${OSG_PLUGINS})
ENDIF(MSVC AND NOT MSVC_IDE)
SET(EXECUTABLE_OUTPUT_PATH ${OUTPUT_BINDIR})
#SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib/${CMAKE_SYSTEM_NAME})
SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib)
MAKE_DIRECTORY(${OUTPUT_LIBDIR})
IF(NOT MSVC)
MAKE_DIRECTORY(${OUTPUT_LIBDIR}/${OSG_PLUGINS})
ENDIF(NOT MSVC)
SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})
# On CMake 2.4.x use EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH and later
# we work around the DLL placement by use of the PREFIX target property hack
#
# On CMake 2.6.x use the newly minted CMAKE_LIBRARY_OUTPUT_DIRECTORY,
# CMAKE_ARCHIVE_OUTPUT_DIRECTORY & CMAKE_RUNTIME_OUTPUT_DIRECTORY
IF(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 4)
# If CMake >= 2.6.0
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
IF(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
ELSE(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
ENDIF(WIN32)
ELSE(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 4)
SET(EXECUTABLE_OUTPUT_PATH ${OUTPUT_BINDIR})
SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})
ENDIF(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 4)
#SET(INSTALL_BINDIR OpenSceneGraph/bin)
#SET(INSTALL_INCDIR OpenSceneGraph/include)
@@ -356,6 +535,68 @@ SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} CACHE STRING "You may add additiona
# This is unofficial so this may be removed or changed at anytime.
SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} CACHE STRING "(EXPERIMENTAL) You may add additional search paths here. Use ; to separate multiple paths.")
# This is for an advanced option to give aggressive warnings
# under different compilers. If yours is not implemented, this option
# will not be made available.
IF(CMAKE_COMPILER_IS_GNUCXX)
# To be complete, we might also do GNUCC flags,
# but everything here is C++ code.
# -Wshadow and -Woverloaded-virtual are also interesting flags, but OSG
# returns too many hits.
# FYI, if we do implement GNUCC, then -Wmissing-prototypes in another
# interesting C-specific flag.
# Also, there is a bug in gcc 4.0. Under C++, -pedantic will create
# errors instead of warnings for certain issues, including superfluous
# semicolons and commas, and the use of long long. -fpermissive seems
# to be the workaround.
SET(OSG_AGGRESSIVE_WARNING_FLAGS -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -fpermissive)
# Previous included -Wformat=2 in OSG_AGGRESSIVE_WARNING_FLAGS but had to remove it due to standard library errors
ELSE(CMAKE_COMPILER_IS_GNUCXX)
IF(MSVC)
# FIXME: What are good aggressive warning flags for Visual Studio?
# And do we need to further subcase this for different versions of VS?
# CMake variables: MSVC60, MSVC70, MSVC71, MSVC80, CMAKE_COMPILER_2005
SET(OSG_AGGRESSIVE_WARNING_FLAGS /W4 /wd4706 /wd4127 /wd4100)
ELSE(MSVC)
# CMake lacks an elseif, so other non-gcc, non-VS compilers need
# to be listed below. If unhandled, OSG_AGGRESSIVE_WARNING_FLAGS should
# remain unset.
ENDIF(MSVC)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
# This part is for the CMake menu option to toggle the warnings on/off.
# This will only be made available if we set values for OSG_AGGRESSIVE_WARNING_FLAGS.
IF(OSG_AGGRESSIVE_WARNING_FLAGS)
IF (APPLE)
SET(DEFAULT_USE_AGGRESSIVE_WARNINGS OFF)
ELSE(APPLE)
SET(DEFAULT_USE_AGGRESSIVE_WARNINGS ON)
ENDIF(APPLE)
OPTION(OSG_USE_AGGRESSIVE_WARNINGS "Enable to activate aggressive warnings" ${DEFAULT_USE_AGGRESSIVE_WARNINGS})
MARK_AS_ADVANCED(OSG_USE_AGGRESSIVE_WARNINGS)
IF(OSG_USE_AGGRESSIVE_WARNINGS)
# Add flags defined by OSG_AGGRESSIVE_WARNING_FLAGS if they aren't already there
FOREACH(flag ${OSG_AGGRESSIVE_WARNING_FLAGS})
IF(NOT CMAKE_CXX_FLAGS MATCHES "${flag}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "${flag}")
ENDFOREACH(flag)
ELSE(OSG_USE_AGGRESSIVE_WARNINGS)
# Remove all flags considered aggresive
FOREACH(flag ${OSG_AGGRESSIVE_WARNING_FLAGS})
STRING(REGEX REPLACE "${flag}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDFOREACH(flag)
ENDIF(OSG_USE_AGGRESSIVE_WARNINGS)
ENDIF(OSG_AGGRESSIVE_WARNING_FLAGS)
# Dynamic vs Static Linking
OPTION(DYNAMIC_OPENSCENEGRAPH "Set to ON to build OpenSceneGraph for dynamic linking. Use OFF for static." ON)
@@ -369,89 +610,37 @@ INCLUDE(OsgMacroUtils)
# OSG Core
ADD_SUBDIRECTORY(src)
# OSG Applications
OPTION(BUILD_OSG_APPLICATIONS "Enable to build OSG Applications (e.g. osgviewer)" ON)
IF (BUILD_OSG_APPLICATIONS)
ADD_SUBDIRECTORY(applications)
ENDIF(BUILD_OSG_APPLICATIONS)
# OSG Examples
OPTION(BUILD_OSG_EXAMPLES "Enable to build OSG Examples" OFF)
IF (BUILD_OSG_EXAMPLES)
ADD_SUBDIRECTORY(examples)
ENDIF(BUILD_OSG_EXAMPLES)
# This is for an advanced option to give aggressive warnings
# under different compilers. If yours is not implemented, this option
# will not be made available.
IF(CMAKE_COMPILER_IS_GNUCXX)
# To be complete, we might also do GNUCC flags,
# but everything here is C++ code.
# -Wshadow and -Woverloaded-virtual are also interesting flags, but OSG
# returns too many hits.
# FYI, if we do implement GNUCC, then -Wmissing-prototypes in another
# interesting C-specific flag.
# Also, there is a bug in gcc 4.0. Under C++, -pedantic will create
# errors instead of warnings for certain issues, including superfluous
# semicolons and commas, and the use of long long. -fpermissive seems
# to be the workaround.
SET(OSG_AGGRESSIVE_WARNING_FLAGS "-Wall -Wparentheses -Wformat=2 -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -fpermissive")
ELSE(CMAKE_COMPILER_IS_GNUCXX)
IF(MSVC)
# FIXME: What are good aggressive warning flags for Visual Studio?
# And do we need to further subcase this for different versions of VS?
# CMake variables: MSVC60, MSVC70, MSVC71, MSVC80, CMAKE_COMPILER_2005
SET(OSG_AGGRESSIVE_WARNING_FLAGS "/Wall /W4")
ELSE(MSVC)
# CMake lacks an elseif, so other non-gcc, non-VS compilers need
# to be listed below. If unhandled, OSG_AGGRESSIVE_WARNING_FLAGS should
# remain unset.
ENDIF(MSVC)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
# This part is for the CMake menu option to toggle the warnings on/off.
# This will only be made available if we set values for OSG_AGGRESSIVE_WARNING_FLAGS.
IF(OSG_AGGRESSIVE_WARNING_FLAGS)
OPTION(OSG_USE_AGGRESSIVE_WARNINGS "Enable to activate aggressive warnings" OFF)
MARK_AS_ADVANCED(OSG_USE_AGGRESSIVE_WARNINGS)
IF(OSG_USE_AGGRESSIVE_WARNINGS)
IF(NOT "${OLD_CMAKE_CXX_FLAGS_WAS_SET}")
SET(OLD_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE INTERNAL "Old CXX flags")
SET(OLD_CMAKE_CXX_FLAGS_WAS_SET 1 CACHE INTERNAL "Old CXX flags was set")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OSG_AGGRESSIVE_WARNING_FLAGS}" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ENDIF(NOT "${OLD_CMAKE_CXX_FLAGS_WAS_SET}")
ELSE(OSG_USE_AGGRESSIVE_WARNINGS)
# FIXME: This will lose any changes made after OLD_CMAKE_CXX_FLAGS was
# set. The better way would be to parse the string and remove each
# option explicitly.
IF("${OLD_CMAKE_CXX_FLAGS_WAS_SET}")
SET(CMAKE_CXX_FLAGS "${OLD_CMAKE_CXX_FLAGS}" CACHE STRING "Flags used by the compiler during all build types." FORCE)
SET(OLD_CMAKE_CXX_FLAGS_WAS_SET 0 CACHE INTERNAL "Old CXX flags was set")
ENDIF("${OLD_CMAKE_CXX_FLAGS_WAS_SET}")
ENDIF(OSG_USE_AGGRESSIVE_WARNINGS)
ENDIF(OSG_AGGRESSIVE_WARNING_FLAGS)
# Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4
# Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4
# and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support.
IF(APPLE)
# These are just defaults/recommendations, but how we want to build
# out of the box. But the user needs to be able to change these options.
# So we must only set the values the first time CMake is run, or we
# So we must only set the values the first time CMake is run, or we
# will overwrite any changes the user sets.
# FORCE is used because the options are not reflected in the UI otherwise.
# Seems like a good place to add version specific compiler flags too.
IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
# This is really fragile, but CMake doesn't provide the OS system
# version information we need. (Darwin versions can be changed
# This is really fragile, but CMake doesn't provide the OS system
# version information we need. (Darwin versions can be changed
# independently of OS X versions.)
# It does look like CMake handles the CMAKE_OSX_SYSROOT automatically.
IF(EXISTS /Developer/SDKs/10.5.sdk)
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386;ppc64;x86_64" CACHE STRING "Build architectures for OSX" FORCE)
IF(EXISTS /Developer/SDKs/MacOSX10.5.sdk)
# 64-bit compiles are not supported with Carbon. We should enable
# 64-bit compilation by default once osgviewer has been
# rewritten with Cocoa.
#SET(CMAKE_OSX_ARCHITECTURES "ppc;i386;ppc64;x86_64" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ELSE(EXISTS /Developer/SDKs/10.5.sdk)
ELSE(EXISTS /Developer/SDKs/MacOSX10.5.sdk)
IF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.4 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
@@ -460,71 +649,193 @@ IF(APPLE)
# Should break down further to set the -mmacosx-version-min,
# but the SDK detection is too unreliable here.
ENDIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
ENDIF(EXISTS /Developer/SDKs/10.5.sdk)
ENDIF(EXISTS /Developer/SDKs/MacOSX10.5.sdk)
ENDIF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
OPTION(OSG_BUILD_APPLICATION_BUNDLES "Enable the building of applications and examples as OSX Bundles" OFF)
ENDIF(APPLE)
OPTION(BUILD_REF_DOCS "Build OpenSceneGraph reference documentation using doxygen (use: make DoxygenDoc)" OFF)
IF(BUILD_REF_DOCS)
SET(BUILD_DOCUMENTATION YES)
OPTION(BUILD_REF_DOCS_SEARCHENGINE "Enable doxygen's search engine (requires that documentation to be installed on a php enabled web server)" OFF)
OPTION(BUILD_REF_DOCS_TAGFILE "Generate a tag file named osg.tag on the documentation web server" OFF)
ENDIF(BUILD_REF_DOCS)
#
# Provide target for generating wrappers
#
SET(GENWRAPPER genwrapper)
ADD_CUSTOM_TARGET(wrappers
COMMAND ${GENWRAPPER} -c ${OpenSceneGraph_SOURCE_DIR}/src/osgWrappers/genwrapper.conf -t ${OpenSceneGraph_SOURCE_DIR}/src/osgWrappers/Doxyfile.template -d ${OpenSceneGraph_SOURCE_DIR} | doxygen -
COMMAND ${GENWRAPPER} -c ${OpenSceneGraph_SOURCE_DIR}/src/osgWrappers/genwrapper.conf -l ${OpenSceneGraph_SOURCE_DIR}
)
# For Doxygen
#FIXME: I haven't figured out what to do with OSG's multiple doxyfiles
# and footer.
INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
OPTION(BUILD_DOCUMENTATION "Build osg documentation" OFF)
OPTION(BUILD_DOCUMENTATION "Build OpenSceneGraph reference documentation using doxygen (use: make DoxygenDoc)" OFF)
MARK_AS_ADVANCED(CLEAR BUILD_DOCUMENTATION)
# To build the documention, you will have to enable it
# and then do the equivalent of "make DoxygenDoc".
IF(BUILD_DOCUMENTATION)
SET(BUILD_DOCUMENTATION YES)
OPTION(BUILD_REF_DOCS_SEARCHENGINE "Enable doxygen's search engine (requires that documentation to be installed on a php enabled web server)" OFF)
IF(BUILD_REF_DOCS_SEARCHENGINE)
SET(SEARCHENGINE YES)
ELSE(BUILD_REF_DOCS_SEARCHENGINE)
SET(SEARCHENGINE NO)
ENDIF(BUILD_REF_DOCS_SEARCHENGINE)
OPTION(BUILD_REF_DOCS_TAGFILE "Generate a tag file named osg.tag on the documentation web server" OFF)
IF(BUILD_REF_DOCS_TAGFILE)
SET(GENERATE_TAGFILE "doc/OpenSceneGraphReferenceDocs/osg.tag")
SET(GENERATE_TAGFILE "${OpenSceneGraph_BINARY_DIR}/doc/OpenSceneGraphReferenceDocs/osg.tag")
ELSE(BUILD_REF_DOCS_TAGFILE)
SET(GENERATE_TAGFILE "")
ENDIF(BUILD_REF_DOCS_TAGFILE)
IF(DOT)
SET(HAVE_DOT YES)
ELSE(DOT)
SET(HAVE_DOT NO)
ENDIF(DOT)
# This processes our Doxyfile.in and substitutes paths to generate
# If html help generation was requested. DOCUMENTATION_HTML_HELP is defined by Documentation.cmake
SET(GENERATE_HTMLHELP "NO")
IF(DOCUMENTATION_HTML_HELP)
# on windows Documentation.cmake finds the html help workshop fi it exists. On u*ix we might have it with wine but no way to point it out
IF(NOT WIN32)
SET(HTML_HELP_COMPILER "" CACHE FILEPATH "Enter location of the HTML help compiler to let doxygen compile html")
MARK_AS_ADVANCED(HTML_HELP_COMPILER)
ENDIF(NOT WIN32)
# this var sets a proper value in .doxygen files when coniguring them below
SET(GENERATE_HTMLHELP "YES")
endif(DOCUMENTATION_HTML_HELP)
# This processes our doxyfile.cmake and substitutes paths to generate
# a final Doxyfile
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/doxyfile.cmake
${PROJECT_BINARY_DIR}/doc/doxyfile
${PROJECT_BINARY_DIR}/doc/openscenegraph.doxyfile
)
# copy the osg logo to documentations target folder
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/PlatformSpecifics/Windows/icons/src/osg32-32.png
${PROJECT_BINARY_DIR}/doc/OpenSceneGraphReferenceDocs/osg32-32.png COPYONLY
)
#INSTALL(FILES ${PROJECT_BINARY_DIR}/doc/${PROJECT_NAME}ReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm DESTINATION doc OPTIONAL COMPONENT openscenegraph-doc)
INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/doc/OpenSceneGraphReferenceDocs DESTINATION doc COMPONENT openscenegraph-doc)
# now set up openthreads documentation generation
IF(BUILD_REF_DOCS_TAGFILE)
SET(GENERATE_TAGFILE "${OpenSceneGraph_BINARY_DIR}/doc/OpenThreadsReferenceDocs/ot.tag")
ENDIF(BUILD_REF_DOCS_TAGFILE)
# This processes our openthreads.doxyfile.cmake and generate a final doxyfile
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/openthreads.doxyfile.cmake
${PROJECT_BINARY_DIR}/doc/openthreads.doxyfile
)
# copy the osg logo to documentations target folder
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/PlatformSpecifics/Windows/icons/src/osg32-32.png
${PROJECT_BINARY_DIR}/doc/OpenThreadsReferenceDocs/osg32-32.png COPYONLY
)
#INSTALL(FILES ${PROJECT_BINARY_DIR}/doc/${PROJECT_NAME}ReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm DESTINATION doc OPTIONAL COMPONENT openscenegraph-doc)
INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/doc/OpenThreadsReferenceDocs DESTINATION doc COMPONENT openthreads-doc)
# Process our other doxyfiles but don't create targets for these
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/all_Doxyfile
${PROJECT_BINARY_DIR}/doc/all_Doxyfile)
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/auto_Doxyfile
${PROJECT_BINARY_DIR}/doc/auto_Doxyfile)
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/core_Doxyfile
${PROJECT_BINARY_DIR}/doc/core_Doxyfile)
# This creates a new target to build documentation.
# It runs ${DOXYGEN} which is the full path and executable to
# Doxygen on your system, set by the FindDoxygen.cmake module
# (called by FindDocumentation.cmake).
# It runs the final generated Doxyfile against it.
# The DOT_PATH is substituted into the Doxyfile.
ADD_CUSTOM_TARGET(DoxygenDoc ${DOXYGEN}
${PROJECT_BINARY_DIR}/doc/doxyfile
ADD_CUSTOM_TARGET(doc_openscenegraph ${DOXYGEN}
${PROJECT_BINARY_DIR}/doc/openscenegraph.doxyfile
)
ADD_CUSTOM_TARGET(doc_openthreads ${DOXYGEN}
${PROJECT_BINARY_DIR}/doc/openthreads.doxyfile
)
ENDIF(BUILD_DOCUMENTATION)
OPTION(BUILD_DASHBOARD_REPORTS "Set to ON to activate reporting of OpenSceneGraph builds here http://www.cdash.org/CDashPublic/index.php?project=OpenSceneGraph" OFF)
IF(BUILD_DASHBOARD_REPORTS)
# The following are required to uses Dart and the Cdash dashboard
# viewable here : http://www.cdash.org/CDashPublic/index.php?project=OpenSceneGraph
INCLUDE(Dart)
ENDIF(BUILD_DASHBOARD_REPORTS)
# present the packaging option only if we have the cpack command defined (effectively >= 2.6.0)
IF(CMAKE_CPACK_COMMAND)
OPTION(BUILD_OSG_PACKAGES "Set to ON to generate CPack configuration files and packaging targets" OFF)
IF(BUILD_OSG_PACKAGES)
INCLUDE(OsgCPack)
ENDIF(BUILD_OSG_PACKAGES)
ENDIF(CMAKE_CPACK_COMMAND)
# Generate pkg-config configuration file
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/packaging/pkgconfig/openscenegraph.pc.in
${PROJECT_BINARY_DIR}/packaging/pkgconfig/openscenegraph.pc
@ONLY
)
INSTALL(FILES ${PROJECT_BINARY_DIR}/packaging/pkgconfig/openscenegraph.pc DESTINATION lib${LIB_POSTFIX}/pkgconfig COMPONENT libopenscenegraph-dev)
# Run this as late as possible so users can easier spot the message
IF (${CMAKE_INSTALL_PREFIX} STREQUAL "/usr/local")
SET(REQUIRES_LIBPATH_MESSAGE ON)
ENDIF(${CMAKE_INSTALL_PREFIX} STREQUAL "/usr/local")
IF(REQUIRES_LIBPATH_MESSAGE)
IF (NOT OSG_LIBPATH_MESSAGE_HAS_BEEN_RUN_BEFORE)
SET(OSG_LIBPATH_MESSAGE_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether the libpath message has been reported before")
MESSAGE("\nThe build system is configured to instal libraries to ${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}\n"
"Your applications may not be able to find your installed libraries unless you:\n"
" set your LD_LIBRARY_PATH (user specific) or\n"
" update your ld.so configuration (system wide)")
IF(IS_DIRECTORY /etc/ld.so.conf.d)
MESSAGE("You have an ld.so.conf.d directory on your system, so if you wish to ensure that\n"
"applications find the installed osg libraries, system wide, you could install a\n"
"openscenegraph specific ld.so configuration with:\n"
" sudo make install_ld_conf\n")
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/packaging/ld.so.conf.d/openscenegraph.conf.in
${PROJECT_BINARY_DIR}/packaging/ld.so.conf.d/openscenegraph.conf
)
ADD_CUSTOM_TARGET(install_ld_conf ${CMAKE_COMMAND} -E copy_if_different
${PROJECT_BINARY_DIR}/packaging/ld.so.conf.d/openscenegraph.conf
/etc/ld.so.conf.d/openscenegraph.conf
COMMAND ldconfig
COMMENT "Copying openscenegraph.conf to /etc/ld.so.conf.d and running ldconfig"
)
ELSE(IS_DIRECTORY /etc/ld.so.conf.d)
IF(EXISTS /etc/ld.so.conf)
MESSAGE("You have an ld.so.conf file in /etc, if you wish to ensure \n"
"that applications find the installed osg libraries, system wide, you\n"
"could add ${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX} to it.")
ENDIF(EXISTS /etc/ld.so.conf)
ENDIF(IS_DIRECTORY /etc/ld.so.conf.d)
# emit a message during installation.
INSTALL(CODE "MESSAGE(\"Libraries were installed to ${CMAKE_INSTALL_PREFIX}lib${LIB_POSTFIX}.\\nYou may need to update your ld.so configuration. \")")
ENDIF(NOT OSG_LIBPATH_MESSAGE_HAS_BEEN_RUN_BEFORE)
ELSE(REQUIRES_LIBPATH_MESSAGE)
SET(OSG_LIBPATH_MESSAGE_HAS_BEEN_RUN_BEFORE 0 CACHE INTERNAL "Flag to track whether the libpath message has been reported before")
ENDIF(REQUIRES_LIBPATH_MESSAGE)
# This needs to be run very last so other parts of the scripts can take
# advantage of this.
IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
SET(OSG_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
ENDIF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
#-----------------------------------------------------------------------------
### uninstall target
#-----------------------------------------------------------------------------
@@ -534,4 +845,3 @@ CONFIGURE_FILE(
IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")

View File

@@ -0,0 +1,118 @@
# Check for availability of atomic operations
# This module defines
# OPENTHREADS_HAVE_ATOMIC_OPS
INCLUDE(CheckCXXSourceRuns)
# Do step by step checking,
CHECK_CXX_SOURCE_RUNS("
#include <cstdlib>
int main()
{
unsigned value = 0;
void* ptr = &value;
__sync_add_and_fetch(&value, 1);
__sync_synchronize();
__sync_sub_and_fetch(&value, 1);
if (!__sync_bool_compare_and_swap(&value, 0, 1))
return EXIT_FAILURE;
if (!__sync_bool_compare_and_swap(&ptr, ptr, ptr))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
CHECK_CXX_SOURCE_RUNS("
#include <stdlib.h>
int main(int, const char**)
{
unsigned value = 0;
void* ptr = &value;
__add_and_fetch(&value, 1);
__synchronize(value);
__sub_and_fetch(&value, 1);
if (!__compare_and_swap(&value, 0, 1))
return EXIT_FAILURE;
if (!__compare_and_swap((unsigned long*)&ptr, (unsigned long)ptr, (unsigned long)ptr))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)
CHECK_CXX_SOURCE_RUNS("
#include <atomic.h>
#include <cstdlib>
int main(int, const char**)
{
uint_t value = 0;
void* ptr = &value;
atomic_inc_uint_nv(&value);
membar_consumer();
atomic_dec_uint_nv(&value);
if (0 != atomic_cas_uint(&value, 0, 1))
return EXIT_FAILURE;
if (ptr != atomic_cas_ptr(&ptr, ptr, ptr))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_SUN)
CHECK_CXX_SOURCE_RUNS("
#include <windows.h>
#include <intrin.h>
#include <cstdlib>
#pragma intrinsic(_InterlockedAnd)
#pragma intrinsic(_InterlockedOr)
#pragma intrinsic(_InterlockedXor)
int main(int, const char**)
{
volatile long value = 0;
long data = 0;
long* volatile ptr = &data;
InterlockedIncrement(&value);
MemoryBarrier();
InterlockedDecrement(&value);
if (0 != InterlockedCompareExchange(&value, 1, 0))
return EXIT_FAILURE;
if (ptr != InterlockedCompareExchangePointer((PVOID volatile*)&ptr, (PVOID)ptr, (PVOID)ptr))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
CHECK_CXX_SOURCE_RUNS("
#include <libkern/OSAtomic.h>
int main()
{
volatile int32_t value = 0;
long data = 0;
long * volatile ptr = &data;
OSAtomicIncrement32(&value);
OSMemoryBarrier();
OSAtomicDecrement32(&value);
OSAtomicCompareAndSwapInt(value, 1, &value);
OSAtomicCompareAndSwapPtr(ptr, ptr, (void * volatile *)&ptr);
}
" _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_SUN AND NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED AND NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
ENDIF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_SUN AND NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED AND NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)

View File

@@ -5,8 +5,8 @@
MACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES SEARCHPATHLIST DEBUGSUFFIX)
MESSAGE(STATUS "searching ${DEPNAME} -->${INCLUDEFILE}<-->${LIBRARY}<-->${SEARCHPATHLIST}<--")
MESSAGE(STATUS "searching ${DEPNAME} -->${INCLUDEFILE}<-->${LIBRARY_NAMES}<-->${SEARCHPATHLIST}<--")
SET(MY_PATH_INCLUDE )
SET(MY_PATH_LIB )
@@ -14,9 +14,10 @@ MACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES SEARCHPATHLIST DEBUGSUFF
SET(MY_PATH_INCLUDE ${MY_PATH_INCLUDE} ${MYPATH}/include)
SET(MY_PATH_LIB ${MY_PATH_LIB} ${MYPATH}/lib)
ENDFOREACH( MYPATH ${SEARCHPATHLIST} )
FIND_PATH("${DEPNAME}_INCLUDE_DIR" ${INCLUDEFILE}
${MY_PATH_INCLUDE}
NO_DEFAULT_PATH
)
MARK_AS_ADVANCED("${DEPNAME}_INCLUDE_DIR")
#MESSAGE( " ${DEPNAME}_INCLUDE_DIR --> ${${DEPNAME}_INCLUDE_DIR}<--")
@@ -24,6 +25,7 @@ MACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES SEARCHPATHLIST DEBUGSUFF
FIND_LIBRARY("${DEPNAME}_LIBRARY"
NAMES ${LIBRARY_NAMES}
PATHS ${MY_PATH_LIB}
NO_DEFAULT_PATH
)
SET(LIBRARY_NAMES_DEBUG "")
FOREACH(LIBNAME ${LIBRARY_NAMES})
@@ -32,6 +34,7 @@ MACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES SEARCHPATHLIST DEBUGSUFF
FIND_LIBRARY("${DEPNAME}_LIBRARY_DEBUG"
NAMES ${LIBRARY_NAMES_DEBUG}
PATHS ${MY_PATH_LIB}
NO_DEFAULT_PATH
)
MARK_AS_ADVANCED("${DEPNAME}_LIBRARY")
#MESSAGE( " ${DEPNAME}_LIBRARY --> ${${DEPNAME}_LIBRARY}<--")
@@ -52,12 +55,13 @@ ENDMACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES SEARCHPATHLIST DEBUGS
MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
FIND_DEPENDENCY(TIFF tiff.h libtiff ${OSG_3RDPARTY_BIN} "D")
FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype234;freetype234MT;freetype235" ${OSG_3RDPARTY_BIN} "_D")
FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype234;freetype234MT;freetype235;freetype237" ${OSG_3RDPARTY_BIN} "_D")
IF(FREETYPE_FOUND)
#forcing subsequent FindFreeType stuff to not search for other variables.... kind of a hack
SET(FREETYPE_INCLUDE_DIR_ft2build ${FREETYPE_INCLUDE_DIR} CACHE PATH "")
SET(FREETYPE_INCLUDE_DIR_freetype2 ${FREETYPE_INCLUDE_DIR} CACHE PATH "")
SET(FREETYPE_INCLUDE_DIR_ft2build ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE)
SET(FREETYPE_INCLUDE_DIR_freetype2 ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE)
MARK_AS_ADVANCED(FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2)
SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
ENDIF(FREETYPE_FOUND)
FIND_DEPENDENCY(CURL curl/curl.h "libcurl;curllib" ${OSG_3RDPARTY_BIN} "D")
FIND_DEPENDENCY(JPEG jpeglib.h libjpeg ${OSG_3RDPARTY_BIN} "D")

View File

@@ -1,15 +1,22 @@
# Locate gdal
# This module defines
# COLLADA_LIBRARY
# COLLADA_FOUND, if false, do not try to link to gdal
# Locate Collada
# This module defines:
# COLLADA_INCLUDE_DIR, where to find the headers
#
# COLLADA_LIBRARY, COLLADA_LIBRARY_DEBUG
# COLLADA_FOUND, if false, do not try to link to Collada dynamically
#
# COLLADA_LIBRARY_STATIC, COLLADA_LIBRARY_STATIC_DEBUG
# COLLADA_STATIC_FOUND, if false, do not try to link to Collada statically
#
# $COLLADA_DIR is an environment variable that would
# correspond to the ./configure --prefix=$COLLADA_DIR
#
# Created by Robert Osfield.
SET(COLLADA_DOM_ROOT "$ENV{COLLADA_DIR}/dom" CACHE PATH "Location of Collada DOM directory")
FIND_PATH(COLLADA_INCLUDE_DIR dae.h
${COLLADA_DOM_ROOT}/include
$ENV{COLLADA_DIR}/include
$ENV{COLLADA_DIR}
$ENV{OSGDIR}/include
@@ -18,7 +25,9 @@ FIND_PATH(COLLADA_INCLUDE_DIR dae.h
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/usr/local/include/colladadom
/usr/include/
/usr/include/colladadom
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
@@ -27,9 +36,11 @@ FIND_PATH(COLLADA_INCLUDE_DIR dae.h
/usr/freeware/include
)
FIND_LIBRARY(COLLADA_LIBRARY
NAMES collada_dom
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
NAMES collada_dom collada14dom libcollada14dom21
PATHS
${COLLADA_DOM_ROOT}/build/vc8-1.4
$ENV{COLLADA_DIR}/build/vc8-1.4
$ENV{COLLADA_DIR}/lib
$ENV{COLLADA_DIR}/lib-dbg
$ENV{COLLADA_DIR}
@@ -39,7 +50,9 @@ FIND_LIBRARY(COLLADA_LIBRARY
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/sw/lib
/opt/local/lib
/opt/csw/lib
@@ -48,9 +61,216 @@ FIND_LIBRARY(COLLADA_LIBRARY
/usr/freeware/lib64
)
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG
NAMES collada_dom-d collada14dom-d libcollada14dom21-d
PATHS
${COLLADA_DOM_ROOT}/build/vc8-1.4-d
$ENV{COLLADA_DIR}/build/vc8-1.4-d
$ENV{COLLADA_DIR}/lib
$ENV{COLLADA_DIR}/lib-dbg
$ENV{COLLADA_DIR}
$ENV{OSGDIR}/lib
$ENV{OSGDIR}
$ENV{OSG_ROOT}/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
/usr/freeware/lib64
)
FIND_LIBRARY(COLLADA_STATIC_LIBRARY
NAMES libcollada14dom21-s
PATHS
${COLLADA_DOM_ROOT}/build/vc8-1.4
$ENV{COLLADA_DIR}/build/vc8-1.4
$ENV{COLLADA_DIR}/lib
$ENV{COLLADA_DIR}/lib-dbg
$ENV{COLLADA_DIR}
$ENV{OSGDIR}/lib
$ENV{OSGDIR}
$ENV{OSG_ROOT}/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
/usr/freeware/lib64
)
FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
NAMES collada_dom-sd collada14dom-sd libcollada14dom21-sd
PATHS
${COLLADA_DOM_ROOT}/build/vc8-1.4-d
$ENV{COLLADA_DIR}/build/vc8-1.4-d
$ENV{COLLADA_DIR}/lib
$ENV{COLLADA_DIR}/lib-dbg
$ENV{COLLADA_DIR}
$ENV{OSGDIR}/lib
$ENV{OSGDIR}
$ENV{OSG_ROOT}/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
/usr/freeware/lib64
)
IF(COLLADA_STATIC_LIBRARY)
# find extra libraries that the static linking requires
FIND_PACKAGE(LibXml2)
IF (LIBXML2_FOUND)
SET(COLLADA_LIBXML_LIBRARY ${LIBXML2_LIBRARIES})
ELSE(LIBXML2_FOUND)
IF(WIN32)
FIND_LIBRARY(COLLADA_LIBXML_LIBRARY
NAMES libxml2
PATHS
${COLLADA_DOM_ROOT}/external-libs/libxml2/win32/lib
${COLLADA_DOM_ROOT}/external-libs/libxml2/mingw/lib
)
ENDIF(WIN32)
ENDIF(LIBXML2_FOUND)
FIND_PACKAGE(ZLIB)
IF (ZLIB_FOUND)
SET(COLLADA_ZLIB_LIBRARY ${ZLIB_LIBRARY})
ELSE(ZLIB_FOUND)
IF(WIN32)
FIND_LIBRARY(COLLADA_ZLIB_LIBRARY
NAMES zlib
PATHS
${COLLADA_DOM_ROOT}/external-libs/libxml2/win32/lib
${COLLADA_DOM_ROOT}/external-libs/libxml2/mingw/lib
)
ENDIF(WIN32)
ENDIF(ZLIB_FOUND)
IF(WIN32)
FIND_LIBRARY(COLLADA_PCRECPP_LIBRARY
NAMES pcrecpp
PATHS
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/vc8
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/vc9
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw
)
FIND_LIBRARY(COLLADA_PCRECPP_LIBRARY_DEBUG
NAMES pcrecpp-d
PATHS
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/vc8
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/vc9
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw
)
FIND_LIBRARY(COLLADA_PCRE_LIBRARY
NAMES pcre
PATHS
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/vc8
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/vc9
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw
)
FIND_LIBRARY(COLLADA_PCRE_LIBRARY_DEBUG
NAMES pcre-d
PATHS
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/vc8
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/vc9
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mac
${COLLADA_DOM_ROOT}/external-libs/pcre/lib/mingw
)
FIND_LIBRARY(COLLADA_MINIZIP_LIBRARY
NAMES minizip
PATHS
${COLLADA_DOM_ROOT}/external-libs/minizip/win32/lib
${COLLADA_DOM_ROOT}/external-libs/minizip/mac
)
FIND_LIBRARY(COLLADA_MINIZIP_LIBRARY_DEBUG
NAMES minizip-d
PATHS
${COLLADA_DOM_ROOT}/external-libs/minizip/win32/lib
${COLLADA_DOM_ROOT}/external-libs/minizip/mac
)
ENDIF(WIN32)
ENDIF(COLLADA_STATIC_LIBRARY)
IF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
IF(WIN32)
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY
NAMES libboost_filesystem
PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/vc8
${COLLADA_DOM_ROOT}/external-libs/boost/lib/vc9
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
)
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY_DEBUG
NAMES libboost_filesystem-d
PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/vc8
${COLLADA_DOM_ROOT}/external-libs/boost/lib/vc9
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
)
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY
NAMES libboost_system
PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/vc8
${COLLADA_DOM_ROOT}/external-libs/boost/lib/vc9
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
)
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY_DEBUG
NAMES libboost_system-d
PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/vc8
${COLLADA_DOM_ROOT}/external-libs/boost/lib/vc9
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
)
FIND_PATH(COLLADA_BOOST_INCLUDE_DIR boost/filesystem/convenience.hpp
${COLLADA_DOM_ROOT}/external-libs/boost
)
ENDIF(WIN32)
ENDIF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
SET(COLLADA_FOUND "NO")
IF(COLLADA_LIBRARY AND COLLADA_INCLUDE_DIR)
SET(COLLADA_FOUND "YES")
ENDIF(COLLADA_LIBRARY AND COLLADA_INCLUDE_DIR)
IF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
IF (COLLADA_INCLUDE_DIR)
SET(COLLADA_FOUND "YES")
ENDIF(COLLADA_INCLUDE_DIR)
ENDIF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)

View File

@@ -20,6 +20,7 @@
# #include "gdal.h"
FIND_PATH(GDAL_INCLUDE_DIR gdal.h
PATHS
$ENV{GDAL_DIR}
NO_DEFAULT_PATH
PATH_SUFFIXES include

View File

@@ -0,0 +1,74 @@
# Locate libvncserver
# This module defines
# LIBVNCSERVER_LIBRARY
# LIBVNCSERVER_FOUND, if false, do not try to link to libvncserver
# LIBVNCSERVER_INCLUDE_DIR, where to find the headers
#
# $LIBVNCSERVER_DIR is an environment variable that would
# correspond to the ./configure --prefix=$LIBVNCSERVER_DIR
# used in building libvncserver.
FIND_PATH(LIBVNCSERVER_INCLUDE_DIR rfb/rfb.h
$ENV{LIBVNCSERVER_DIR}/include
$ENV{LIBVNCSERVER_DIR}
$ENV{OSGDIR}/include
$ENV{OSGDIR}
$ENV{OSG_ROOT}/include
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
/usr/freeware/include
)
FIND_LIBRARY(LIBVNCCLIENT_LIBRARY
NAMES vncclient
PATHS
$ENV{LIBVNCSERVER_DIR}/lib
$ENV{LIBVNCSERVER_DIR}
$ENV{OSGDIR}/lib
$ENV{OSGDIR}
$ENV{OSG_ROOT}/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
/usr/freeware/lib64
)
FIND_LIBRARY(LIBVNCSERVER_LIBRARY
NAMES vncserver
PATHS
$ENV{LIBVNCSERVER_DIR}/lib
$ENV{LIBVNCSERVER_DIR}
$ENV{OSGDIR}/lib
$ENV{OSGDIR}
$ENV{OSG_ROOT}/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
/usr/freeware/lib64
)
SET(LIBVNCSERVER_FOUND "NO")
IF(LIBVNCSERVER_LIBRARY AND LIBVNCSERVER_INCLUDE_DIR)
SET(LIBVNCSERVER_FOUND "YES")
ENDIF(LIBVNCSERVER_LIBRARY AND LIBVNCSERVER_INCLUDE_DIR)

View File

@@ -10,37 +10,42 @@
# Created by Robert Osfield.
FIND_PATH(OSG_INCLUDE_DIR osg/Node
${OSG_DIR}/include
$ENV{OSG_DIR}/include
$ENV{OSG_DIR}
$ENV{OSGDIR}/include
$ENV{OSGDIR}
$ENV{OSG_ROOT}/include
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
/usr/freeware/include
NO_DEFAULT_PATH
)
FIND_PATH(OSG_INCLUDE_DIR osg/Node)
MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
FIND_LIBRARY(${MYLIBRARY}
NAMES ${MYLIBRARYNAME}
FIND_LIBRARY("${MYLIBRARY}_DEBUG"
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
PATHS
${OSG_DIR}/lib/Debug
${OSG_DIR}/lib
$ENV{OSG_DIR}/lib/debug
$ENV{OSG_DIR}/lib
$ENV{OSG_DIR}
$ENV{OSGDIR}/lib
$ENV{OSGDIR}
$ENV{OSG_ROOT}/lib
NO_DEFAULT_PATH
)
FIND_LIBRARY("${MYLIBRARY}_DEBUG"
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/sw/lib
/opt/local/lib
/opt/csw/lib
@@ -48,16 +53,57 @@ MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
/usr/freeware/lib64
)
FIND_LIBRARY(${MYLIBRARY}
NAMES ${MYLIBRARYNAME}
PATHS
${OSG_DIR}/lib/Release
${OSG_DIR}/lib
$ENV{OSG_DIR}/lib/Release
$ENV{OSG_DIR}/lib
$ENV{OSG_DIR}
$ENV{OSGDIR}/lib
$ENV{OSGDIR}
$ENV{OSG_ROOT}/lib
NO_DEFAULT_PATH
)
FIND_LIBRARY(${MYLIBRARY}
NAMES ${MYLIBRARYNAME}
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
/usr/freeware/lib64
)
IF( NOT ${MYLIBRARY}_DEBUG)
IF(MYLIBRARY)
SET(${MYLIBRARY}_DEBUG ${MYLIBRARY})
ENDIF(MYLIBRARY)
ENDIF( NOT ${MYLIBRARY}_DEBUG)
ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME)
FIND_OSG_LIBRARY(OSG_LIBRARY osg)
FIND_OSG_LIBRARY(OSGGA_LIBRARY osgGA)
FIND_OSG_LIBRARY(OSGUTIL_LIBRARY osgUtil)
FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB)
FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText)
FIND_OSG_LIBRARY(OSGWIDGET_LIBRARY osgWidget)
FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain)
FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX)
FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer)
FIND_OSG_LIBRARY(OSGVOLUME_LIBRARY osgVolume)
FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)
SET(OSG_FOUND "NO")
IF(OSG_LIBRARY AND OSG_INCLUDE_DIR)

View File

@@ -0,0 +1,77 @@
# Locate OpenEXR
# This module defines
# OPENEXR_LIBRARY
# OPENEXR_FOUND, if false, do not try to link to OpenEXR
# OPENEXR_INCLUDE_DIR, where to find the headers
#
# $OPENEXR_DIR is an environment variable that would
# correspond to the ./configure --prefix=$OPENEXR_DIR
#
# Created by Robert Osfield.
FIND_PATH(OPENEXR_INCLUDE_DIR OpenEXR/ImfIO.h
$ENV{OPENEXR_DIR}/include
$ENV{OPENEXR_DIR}
$ENV{OSGDIR}/include
$ENV{OSGDIR}
$ENV{OSG_ROOT}/include
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
/usr/freeware/include
)
FIND_LIBRARY(OPENEXR_IlmIlf_LIBRARY
NAMES IlmImf
PATHS
$ENV{OPENEXR_DIR}/lib
$ENV{OPENEXR_DIR}
$ENV{OSGDIR}/lib
$ENV{OSGDIR}
$ENV{OSG_ROOT}/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
/usr/freeware/lib64
)
FIND_LIBRARY(OPENEXR_Half_LIBRARY
NAMES Half
PATHS
$ENV{OPENEXR_DIR}/lib
$ENV{OPENEXR_DIR}
$ENV{OSGDIR}/lib
$ENV{OSGDIR}
$ENV{OSG_ROOT}/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
/usr/freeware/lib64
)
SET(OPENEXR_FOUND "NO")
IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_Half_LIBRARY)
SET(OPENEXR_LIBRARIES
${OPENEXR_IlmIlf_LIBRARY}
${OPENEXR_Half_LIBRARY}
)
SET(OPENEXR_FOUND "YES")
ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_Half_LIBRARY)

View File

@@ -0,0 +1,180 @@
# - find DCMTK libraries
#
# DCMTK_INCLUDE_DIRS - Directories to include to use DCMTK
# DCMTK_LIBRARIES - Files to link against to use DCMTK
# DCMTK_FOUND - If false, don't try to use DCMTK
# DCMTK_DIR - (optional) Source directory for DCMTK
#
# DCMTK_DIR can be used to make it simpler to find the various include
# directories and compiled libraries if you've just compiled it in the
# source tree. Just set it to the root of the tree where you extracted
# the source.
#
# Written for VXL by Amitha Perera.
# Modified by Robert Osfied to enable support for install placements of DCMTK 3.5.4 versions onwards
FIND_PATH( DCMTK_ROOT_INCLUDE_DIR dcmtk/config/osconfig.h
${DCMTK_DIR}/config/include
${DCMTK_DIR}/include
/usr/local/include/
/usr/include/
/usr/local/dicom/include/
)
FIND_PATH( DCMTK_config_INCLUDE_DIR osconfig.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/config
${DCMTK_DIR}/config/include
${DCMTK_DIR}/include
/usr/local/include/dcmtk/config
/usr/include/dcmtk/config
/usr/local/dicom/include/dcmtk/config
)
FIND_PATH( DCMTK_ofstd_INCLUDE_DIR ofstdinc.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/ofstd
${DCMTK_DIR}/ofstd/include
${DCMTK_DIR}/include/ofstd
/usr/local/include/dcmtk/ofstd
/usr/include/dcmtk/ofstd
/usr/local/dicom/include/dcmtk/ofstd
)
FIND_LIBRARY( DCMTK_ofstd_LIBRARY ofstd
${DCMTK_DIR}/ofstd/libsrc
${DCMTK_DIR}/ofstd/libsrc/Release
${DCMTK_DIR}/ofstd/libsrc/Debug
${DCMTK_DIR}/ofstd/Release
${DCMTK_DIR}/ofstd/Debug
${DCMTK_DIR}/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
)
FIND_PATH( DCMTK_dcmdata_INCLUDE_DIR dctypes.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmdata
${DCMTK_DIR}/dcmdata/include
${DCMTK_DIR}/include/dcmdata
/usr/local/include/dcmtk/dcmdata
/usr/include/dcmtk/dcmdata
/usr/local/dicom/include/dcmtk/dcmdata
)
FIND_LIBRARY( DCMTK_dcmdata_LIBRARY dcmdata
${DCMTK_DIR}/dcmdata/libsrc
${DCMTK_DIR}/dcmdata/libsrc/Release
${DCMTK_DIR}/dcmdata/libsrc/Debug
${DCMTK_DIR}/dcmdata/Release
${DCMTK_DIR}/dcmdata/Debug
${DCMTK_DIR}/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
)
FIND_PATH( DCMTK_dcmimgle_INCLUDE_DIR dcmimage.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmimgle
${DCMTK_DIR}/dcmimgle/include
${DCMTK_DIR}/include/dcmimgle
/usr/local/include/dcmtk/dcmimgle
/usr/include/dcmtk/dcmimgle
/usr/local/dicom/include/dcmtk/dcmimgle
)
FIND_LIBRARY( DCMTK_dcmimgle_LIBRARY dcmimgle
${DCMTK_DIR}/dcmimgle/libsrc
${DCMTK_DIR}/dcmimgle/libsrc/Release
${DCMTK_DIR}/dcmimgle/libsrc/Debug
${DCMTK_DIR}/dcmimgle/Release
${DCMTK_DIR}/dcmimgle/Debug
${DCMTK_DIR}/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
)
FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
${DCMTK_DIR}/imagectn/libsrc/Release
${DCMTK_DIR}/imagectn/libsrc/
${DCMTK_DIR}/imagectn/libsrc/Debug
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
)
FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
${DCMTK_DIR}/dcmnet/libsrc/Release
${DCMTK_DIR}/dcmnet/libsrc/Debug
${DCMTK_DIR}/dcmnet/libsrc/
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
)
IF( DCMTK_config_INCLUDE_DIR
AND DCMTK_ofstd_INCLUDE_DIR
AND DCMTK_ofstd_LIBRARY
AND DCMTK_dcmdata_INCLUDE_DIR
AND DCMTK_dcmdata_LIBRARY
AND DCMTK_dcmimgle_INCLUDE_DIR
AND DCMTK_dcmimgle_LIBRARY )
SET( DCMTK_FOUND "YES" )
SET( DCMTK_INCLUDE_DIRS
${DCMTK_config_INCLUDE_DIR}
${DCMTK_ofstd_INCLUDE_DIR}
${DCMTK_dcmdata_INCLUDE_DIR}
${DCMTK_dcmimgle_INCLUDE_DIR}
)
SET( DCMTK_LIBRARIES
${DCMTK_dcmimgle_LIBRARY}
${DCMTK_dcmdata_LIBRARY}
${DCMTK_ofstd_LIBRARY}
${DCMTK_config_LIBRARY}
)
IF(DCMTK_imagedb_LIBRARY)
SET( DCMTK_LIBRARIES
${DCMTK_LIBRARIES}
${DCMTK_imagedb_LIBRARY}
)
ENDIF(DCMTK_imagedb_LIBRARY)
IF(DCMTK_dcmnet_LIBRARY)
SET( DCMTK_LIBRARIES
${DCMTK_LIBRARIES}
${DCMTK_dcmnet_LIBRARY}
)
ENDIF(DCMTK_dcmnet_LIBRARY)
IF( WIN32 )
SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 )
ENDIF( WIN32 )
ENDIF( DCMTK_config_INCLUDE_DIR
AND DCMTK_ofstd_INCLUDE_DIR
AND DCMTK_ofstd_LIBRARY
AND DCMTK_dcmdata_INCLUDE_DIR
AND DCMTK_dcmdata_LIBRARY
AND DCMTK_dcmimgle_INCLUDE_DIR
AND DCMTK_dcmimgle_LIBRARY )
IF( NOT DCMTK_FOUND )
SET( DCMTK_DIR "" CACHE PATH "Root of DCMTK source tree (optional)." )
MARK_AS_ADVANCED( DCMTK_DIR )
ENDIF( NOT DCMTK_FOUND )

235
CMakeModules/FindXUL.cmake Normal file
View File

@@ -0,0 +1,235 @@
# Locate XUL
# This module defines
# XUL_LIBRARIES
# XUL_FOUND, if false, do not try to link to gdal
# XUL_INCLUDE_DIR, where to find the headers
#
# $XUL_DIR is an environment variable that would
# correspond to the ./configure --prefix=$XUL_DIR
#
# Created by Robert Osfield.
#use pkg-config to find various modues
INCLUDE(FindPkgConfig OPTIONAL)
IF(PKG_CONFIG_FOUND)
INCLUDE(FindPkgConfig)
pkg_check_modules(XULRUNNER_XPCOM xulrunner-xpcom<=1.8.9)
pkg_check_modules(XULRUNNER_JS xulrunner-js)
pkg_check_modules(XULRUNNER_NSPR xulrunner-nspr)
pkg_check_modules(XULRUNNER_NSS xulrunner-nss)
ENDIF(PKG_CONFIG_FOUND)
# Added check to make sure that nsIBaseWindow.h is available, as it's not a standard part the of 1.8.x SDK
FIND_PATH(NSIBASEWINDOW_INCLUDE_DIR widget/nsIBaseWindow.h
PATHS ${XULRUNNER_XPCOM_INCLUDE_DIRS}
$ENV{OSG_DIR}/include/xulrunner
$ENV{OSG_DIR}/include
$ENV{OSG_DIR}/xulrunner
$ENV{OSG_DIR}
$ENV{OSGDIR}/include/xulrunner
$ENV{OSGDIR}/include
$ENV{OSGDIR}/xulrunner
$ENV{OSGDIR}
$ENV{OSG_ROOT}/include/xulrunner
$ENV{OSG_ROOT}/include
~/Library/Frameworks
/Library/Frameworks
/usr/local/include/xulrunner
/usr/local/include
/usr/include/xulrunner
/usr/include
/sw/include/xulrunner # Fink
/sw/include # Fink
/opt/local/include/xulrunner # DarwinPorts
/opt/local/include # DarwinPorts
/opt/csw/include/xulrunner # Blastwave
/opt/csw/include # Blastwave
/opt/include/xulrunner
/opt/include
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/xulrunner
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
/usr/freeware/include/xulrunner
/usr/freeware/include
)
FIND_PATH(XUL_INCLUDE_DIR nsEmbedAPI.h
PATHS ${XULRUNNER_XPCOM_INCLUDE_DIRS}
$ENV{OSG_DIR}/include/xulrunner
$ENV{OSG_DIR}/include
$ENV{OSG_DIR}/xulrunner
$ENV{OSG_DIR}
$ENV{OSGDIR}/include/xulrunner
$ENV{OSGDIR}/include
$ENV{OSGDIR}/xulrunner
$ENV{OSGDIR}
$ENV{OSG_ROOT}/include/xulrunner
$ENV{OSG_ROOT}/include
~/Library/Frameworks
/Library/Frameworks
/usr/local/include/xulrunner
/usr/local/include
/usr/include/xulrunner
/usr/include
/sw/include/xulrunner # Fink
/sw/include # Fink
/opt/local/include/xulrunner # DarwinPorts
/opt/local/include # DarwinPorts
/opt/csw/include/xulrunner # Blastwave
/opt/csw/include # Blastwave
/opt/include/xulrunner
/opt/include
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/xulrunner
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
/usr/freeware/include/xulrunner
/usr/freeware/include
)
FIND_PATH(NSPR_INCLUDE_DIR prtypes.h
PATHS ${XULRUNNER_NSPR_INCLUDE_DIRS}
$ENV{OSG_DIR}/include/nspr
$ENV{OSG_DIR}/include
$ENV{OSG_DIR}/nspr
$ENV{OSG_DIR}
$ENV{OSGDIR}/include/nspr
$ENV{OSGDIR}/include
$ENV{OSGDIR}/nspr
$ENV{OSGDIR}
$ENV{OSG_ROOT}/include/nspr
$ENV{OSG_ROOT}/include
~/Library/Frameworks
/Library/Frameworks
/usr/local/include/nspr
/usr/local/include
/usr/include/nspr
/usr/include
/sw/include/nspr # Fink
/sw/include # Fink
/opt/local/include/nspr # DarwinPorts
/opt/local/include # DarwinPorts
/opt/csw/include/nspr # Blastwave
/opt/csw/include # Blastwave
/opt/include/nspr
/opt/include
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/nspr
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
/usr/freeware/include/nspr
/usr/freeware/include
)
FIND_PATH(MOZJS_INCLUDE_DIR jsapi.h
PATHS ${XULRUNNER_JS_INCLUDE_DIRS}
$ENV{OSG_DIR}/include/mozjs
$ENV{OSG_DIR}/include
$ENV{OSG_DIR}/mozjs
$ENV{OSG_DIR}
$ENV{OSGDIR}/include/mozjs
$ENV{OSGDIR}/include
$ENV{OSGDIR}/mozjs
$ENV{OSGDIR}
$ENV{OSG_ROOT}/include/mozjs
$ENV{OSG_ROOT}/include
~/Library/Frameworks
/Library/Frameworks
/usr/local/include/mozjs
/usr/local/include
/usr/include/mozjs
/usr/include
/sw/include/mozjs # Fink
/sw/include # Fink
/opt/local/include/mozjs # DarwinPorts
/opt/local/include # DarwinPorts
/opt/csw/include/mozjs # Blastwave
/opt/csw/include # Blastwave
/opt/include/mozjs
/opt/include
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/mozjs
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
/usr/freeware/include/mozjs
/usr/freeware/include
)
FIND_PATH(XUL_DIR
NAMES components/appshell.xpt
PATHS
$ENV{OSG_DIR}/lib
$ENV{OSG_DIR}
$ENV{OSGDIR}/lib
$ENV{OSGDIR}
$ENV{OSG_ROOT}/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib/xulrunner
/usr/local/lib
/usr/lib/xulrunner
/usr/lib
/sw/lib/xulrunner
/sw/lib
/opt/local/lib/xulrunner
/opt/local/lib
/opt/csw/lib/xulrunner
/opt/csw/lib
/opt/lib/xulrunner
/opt/lib
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
/usr/freeware/lib64/xulrunner
/usr/freeware/lib64
)
MACRO(FIND_XUL_LIBRARY MYLIBRARY MYLIBRARYNAME)
FIND_LIBRARY(${MYLIBRARY}
PATHS ${XULRUNNER_XPCOM_LIBRARY_DIRS}
PATHS ${XULRUNNER_JS_LIBRARY_DIRS}
PATHS ${XULRUNNER_NSPR_LIBRARY_DIRS}
PATHS ${XULRUNNER_NSS_LIBRARY_DIRS}
NAMES ${MYLIBRARYNAME}
PATHS
$ENV{OSG_DIR}/lib
$ENV{OSG_DIR}
$ENV{OSGDIR}/lib
$ENV{OSGDIR}
$ENV{OSG_ROOT}/lib
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib/xulrunner
/usr/local/lib
/usr/lib/xulrunner
/usr/lib
/sw/lib/xulrunner
/sw/lib
/opt/local/lib/xulrunner
/opt/local/lib
/opt/csw/lib/xulrunner
/opt/csw/lib
/opt/lib/xulrunner
/opt/lib
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
/usr/freeware/lib64/xulrunner
/usr/freeware/lib64
)
ENDMACRO(FIND_XUL_LIBRARY LIBRARY LIBRARYNAME)
FIND_XUL_LIBRARY(XUL_LIBRARY xul plds4 plc4 nspr4)
FIND_XUL_LIBRARY(XUL_MOZJS_LIBRARY mozjs)
FIND_XUL_LIBRARY(XUL_XPCOM_LIBRARY xpcom)
FIND_XUL_LIBRARY(XUL_PLUGIN_LIBRARY plds4)
FIND_XUL_LIBRARY(XUL_NSS_LIBRARY nss3)
SET(XUL_FOUND "NO")
IF(XUL_LIBRARY AND XUL_INCLUDE_DIR AND NSIBASEWINDOW_INCLUDE_DIR)
SET(XUL_FOUND "YES")
SET(XUL_LIBRARIES ${XUL_LIBRARY} ${XUL_MOZJS_LIBRARY} ${XUL_XPCOM_LIBRARY} ${XUL_PLUGIN_LIBRARY} ${XUL_NSS_LIBRARY})
SET(XUL_INCLUDE_DIRS ${XUL_INCLUDE_DIR} ${NSPR_INCLUDE_DIR} ${MOZJS_INCLUDE_DIR})
ENDIF(XUL_LIBRARY AND XUL_INCLUDE_DIR AND NSIBASEWINDOW_INCLUDE_DIR)
# MESSAGE("XUL_INCLUDE_DIR " ${XUL_INCLUDE_DIR})
# MESSAGE("XUL_LIBRARIES " ${XUL_LIBRARIES})

View File

@@ -1,12 +1,12 @@
# Locate gdal
# Locate zlib
# This module defines
# ZLIB_LIBRARY
# ZLIB_FOUND, if false, do not try to link to gdal
# ZLIB_FOUND, if false, do not try to link to zlib
# ZLIB_INCLUDE_DIR, where to find the headers
#
# $ZLIB_DIR is an environment variable that would
# correspond to the ./configure --prefix=$ZLIB_DIR
# used in building gdal.
# used in building zlib.
#
# Created by Ulrich Hertlein.
@@ -29,7 +29,7 @@ FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
)
FIND_LIBRARY(ZLIB_LIBRARY
NAMES z libz
NAMES z libz zlib
PATHS
$ENV{ZLIB_DIR}/lib
$ENV{ZLIB_DIR}

View File

@@ -22,17 +22,19 @@ SOURCE_GROUP(
)
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
HANDLE_MSVC_DLL()
HANDLE_MSVC_DLL()
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)
INSTALL(
TARGETS ${LIB_NAME}
RUNTIME DESTINATION ${INSTALL_BINDIR}
LIBRARY DESTINATION ${INSTALL_LIBDIR}
ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR}
RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph
LIBRARY DESTINATION ${INSTALL_LIBDIR} COMPONENT libopenscenegraph
ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev
)
# FIXME: Do not run for OS X framework
INSTALL(
FILES ${LIB_PUBLIC_HEADERS}
DESTINATION ${INSTALL_INCDIR}/${LIB_NAME}
COMPONENT libopenscenegraph-dev
)

144
CMakeModules/OsgCPack.cmake Normal file
View File

@@ -0,0 +1,144 @@
# This script sets up packaging targets for each "COMPONENT" as specified in INSTALL commands
#
# for each component a CPackConfig-<component>.cmake is generated in the build tree
# and a target is added to call cpack for it (e.g. package_openscenegaph
# A target for generating a package with everything that gets INSTALLED is generated (package_openscenegraph-all)
# A target for making all of the abaove packages is generated (package_ALL)
#
# package filenames are created on the form <package>-<platform>-<arch>[-<compiler>]-<build_type>[-static].tar.gz
# ...where compiler optionally set using a cmake gui (OSG_CPACK_COMPILER). This script tries to guess compiler version for msvc generators
# ...build_type matches CMAKE_BUILD_TYPE for all generators but the msvc ones
# resolve architecture. The reason i "change" i686 to i386 is that debian packages
# require i386 so this is for the future
IF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
SET(SYSTEM_ARCH "i386")
ELSE()
SET(SYSTEM_ARCH ${CMAKE_SYSTEM_PROCESSOR})
ENDIF()
# set a default system name - use CMake setting (Linux|Windows|...)
SET(SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
#message(STATUS "CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}")
#message(STATUS "CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}")
# for msvc the SYSTEM_NAME is set win32/64 instead of "Windows"
IF(MSVC)
IF(CMAKE_CL_64)
SET(SYSTEM_NAME "win64")
ELSE()
SET(SYSTEM_NAME "win32")
ENDIF()
ENDIF()
# Guess the compiler (is this desired for other platforms than windows?)
IF(NOT DEFINED OSG_CPACK_COMPILER)
INCLUDE(OsgDetermineCompiler)
ENDIF()
# expose the compiler setting to the user
SET(OSG_CPACK_COMPILER "${OSG_COMPILER}" CACHE STRING "This ia short string (vc90, vc80sp1, gcc-4.3, ...) describing your compiler. The string is used for creating package filenames")
IF(OSG_CPACK_COMPILER)
SET(OSG_CPACK_SYSTEM_SPEC_STRING ${SYSTEM_NAME}-${SYSTEM_ARCH}-${OSG_CPACK_COMPILER})
ELSE()
SET(OSG_CPACK_SYSTEM_SPEC_STRING ${SYSTEM_NAME}-${SYSTEM_ARCH})
ENDIF()
## variables that apply to all packages
SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${OPENSCENEGRAPH_VERSION}")
# these goes for all platforms. Setting these stops the CPack.cmake script from generating options about other package compression formats (.z .tz, etc.)
IF(WIN32)
SET(CPACK_GENERATOR "ZIP")
ELSE()
SET(CPACK_GENERATOR "TGZ")
ENDIF()
SET(CPACK_SOURCE_GENERATOR "TGZ")
# for ms visual studio we use it's internally defined variable to get the configuration (debug,release, ...)
IF(MSVC_IDE)
SET(OSG_CPACK_CONFIGURATION "$(OutDir)")
SET(PACKAGE_TARGET_PREFIX "Package ")
ELSE()
# on un*x an empty CMAKE_BUILD_TYPE means release
IF(CMAKE_BUILD_TYPE)
SET(OSG_CPACK_CONFIGURATION ${CMAKE_BUILD_TYPE})
ELSE()
SET(OSG_CPACK_CONFIGURATION "Release")
ENDIF()
SET(PACKAGE_TARGET_PREFIX "package_")
ENDIF()
# Get all defined components
GET_CMAKE_PROPERTY(CPACK_COMPONENTS_ALL COMPONENTS)
IF(NOT CPACK_COMPONENTS_ALL)
# cmake 2.6.0 don't supply the COMPONENTS property.
# I set it manually to be the packages that can always be packaged
MESSAGE("When building packages please consider using cmake version 2.6.1 or above")
SET(CPACK_COMPONENTS_ALL libopenscenegraph libopenthreads openscenegraph libopenscenegraph-dev libopenthreads-dev)
ENDIF()
# Create a target that will be used to generate all packages defined below
SET(PACKAGE_ALL_TARGETNAME "${PACKAGE_TARGET_PREFIX}ALL")
ADD_CUSTOM_TARGET(${PACKAGE_ALL_TARGETNAME})
MACRO(GENERATE_PACKAGING_TARGET package_name)
SET(CPACK_PACKAGE_NAME ${package_name})
# the doc packages don't need a system-arch specification
IF(${package} MATCHES -doc)
SET(OSG_PACKAGE_FILE_NAME ${package_name}-${OPENSCENEGRAPH_VERSION})
ELSE()
SET(OSG_PACKAGE_FILE_NAME ${package_name}-${OPENSCENEGRAPH_VERSION}-${OSG_CPACK_SYSTEM_SPEC_STRING}-${OSG_CPACK_CONFIGURATION})
IF(NOT DYNAMIC_OPENSCENEGRAPH)
SET(OSG_PACKAGE_FILE_NAME ${OSG_PACKAGE_FILE_NAME}-static)
ENDIF()
ENDIF()
CONFIGURE_FILE("${OpenSceneGraph_SOURCE_DIR}/CMakeModules/OsgCPackConfig.cmake.in" "${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake" IMMEDIATE)
SET(PACKAGE_TARGETNAME "${PACKAGE_TARGET_PREFIX}${package_name}")
# This is naive and will probably need fixing eventually
IF(MSVC)
SET(MOVE_COMMAND "move")
ELSE()
SET(MOVE_COMMAND "mv")
ENDIF()
# Set in and out archive filenames. Windows = zip, others = tar.gz
IF(WIN32)
SET(ARCHIVE_EXT "zip")
ELSE()
SET(ARCHIVE_EXT "tar.gz")
ENDIF()
# Create a target that creates the current package
# and rename the package to give it proper filename
ADD_CUSTOM_TARGET(${PACKAGE_TARGETNAME})
ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_TARGETNAME}
COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake
COMMAND "${MOVE_COMMAND}" "${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}" "${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
COMMAND ${CMAKE_COMMAND} -E echo "renamed ${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT} -> ${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
COMMENT "Run CPack packaging for ${package_name}..."
)
# Add the exact same custom command to the all package generating target.
# I can't use add_dependencies to do this because it would allow parallell building of packages so am going brute here
ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_ALL_TARGETNAME}
COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake
COMMAND "${MOVE_COMMAND}" "${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}" "${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
COMMAND ${CMAKE_COMMAND} -E echo "renamed ${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT} -> ${OSG_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
)
ENDMACRO(GENERATE_PACKAGING_TARGET)
# Create configs and targets for a package including all components
SET(OSG_CPACK_COMPONENT ALL)
GENERATE_PACKAGING_TARGET(openscenegraph-all)
# Create configs and targets for each component
FOREACH(package ${CPACK_COMPONENTS_ALL})
SET(OSG_CPACK_COMPONENT ${package})
GENERATE_PACKAGING_TARGET(${package})
ENDFOREACH()

View File

@@ -0,0 +1,71 @@
# This file will be configured to contain variables for CPack. These variables
# should be set in the CMake list file of the project before CPack module is
# included. Example variables are:
# CPACK_GENERATOR - Generator used to create package
# CPACK_INSTALL_CMAKE_PROJECTS - For each project (path, name, component)
# CPACK_CMAKE_GENERATOR - CMake Generator used for the projects
# CPACK_INSTALL_COMMANDS - Extra commands to install components
# CPACK_INSTALL_DIRECTORIES - Extra directories to install
# CPACK_PACKAGE_DESCRIPTION_FILE - Description file for the package
# CPACK_PACKAGE_DESCRIPTION_SUMMARY - Summary of the package
# CPACK_PACKAGE_EXECUTABLES - List of pairs of executables and labels
# CPACK_PACKAGE_FILE_NAME - Name of the package generated
# CPACK_PACKAGE_ICON - Icon used for the package
# CPACK_PACKAGE_INSTALL_DIRECTORY - Name of directory for the installer
# CPACK_PACKAGE_NAME - Package project name
# CPACK_PACKAGE_VENDOR - Package project vendor
# CPACK_PACKAGE_VERSION - Package project version
# CPACK_PACKAGE_VERSION_MAJOR - Package project version (major)
# CPACK_PACKAGE_VERSION_MINOR - Package project version (minor)
# CPACK_PACKAGE_VERSION_PATCH - Package project version (patch)
# There are certain generator specific ones
# NSIS Generator:
# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Name of the registry key for the installer
# CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra commands used during uninstall
# CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra commands used during install
SET(CPACK_BINARY_BUNDLE "${CPACK_BINARY_BUNDLE}")
SET(CPACK_BINARY_CYGWIN "${CPACK_BINARY_CYGWIN}")
SET(CPACK_BINARY_DEB "${CPACK_BINARY_DEB}")
SET(CPACK_BINARY_NSIS "${CPACK_BINARY_NSIS}")
SET(CPACK_BINARY_OSXX11 "${CPACK_BINARY_OSXX11}")
SET(CPACK_BINARY_PACKAGEMAKER "${CPACK_BINARY_PACKAGEMAKER}")
SET(CPACK_BINARY_RPM "${CPACK_BINARY_RPM}")
SET(CPACK_BINARY_STGZ "${CPACK_BINARY_STGZ}")
SET(CPACK_BINARY_TBZ2 "${CPACK_BINARY_TBZ2}")
SET(CPACK_BINARY_TGZ "${CPACK_BINARY_TGZ}")
SET(CPACK_BINARY_TZ "${CPACK_BINARY_TZ}")
SET(CPACK_BINARY_ZIP "${CPACK_BINARY_ZIP}")
SET(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
SET(CPACK_COMPONENTS_ALL "${CPACK_COMPONENTS_ALL}")
SET(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "TRUE")
SET(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "TRUE")
SET(CPACK_GENERATOR "${CPACK_GENERATOR}")
SET(CPACK_INSTALL_CMAKE_PROJECTS "${OpenSceneGraph_BINARY_DIR};OpenSceneGraph;${OSG_CPACK_COMPONENT};/")
SET(CPACK_INSTALL_PREFIX "${CPACK_INSTALL_PREFIX}")
SET(CPACK_MODULE_PATH "${OpenSceneGraph_SOURCE_DIR}/CMakeModules;")
SET(CPACK_NSIS_DISPLAY_NAME "${CMAKE_PROJECT_NAME} ${OPENSCENEGRAPH_VERSION}")
SET(CPACK_NSIS_INSTALLER_ICON_CODE "")
SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
SET(CPACK_OUTPUT_CONFIG_FILE "${PROJECT_BINARY_DIR}/CPackConfig-${OSG_CPACK_COMPONENT}.cmake")
SET(CPACK_PACKAGE_DEFAULT_LOCATION "/")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OpenSceneGraph_SOURCE_DIR}/README.txt")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The OpenSceneGraph is an open source high performance 3d graphics toolkit")
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CMAKE_PROJECT_NAME}-${OPENSCENEGRAPH_VERSION}")
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}")
SET(CPACK_PACKAGE_RELOCATABLE "true")
SET(CPACK_PACKAGE_VENDOR "The OpenSceneGraph developers and contributors lead by Robert Osfield")
SET(CPACK_PACKAGE_VERSION "${OPENSCENEGRAPH_VERSION}")
SET(CPACK_PACKAGE_VERSION_MAJOR "${OPENSCENEGRAPH_MAJOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR "${OPENSCENEGRAPH_MINOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_PATCH "${OPENSCENEGRAPH_PATCH_VERSION}")
SET(CPACK_RESOURCE_FILE_LICENSE "${OpenSceneGraph_SOURCE_DIR}/LICENSE.txt")
SET(CPACK_RESOURCE_FILE_README "${OpenSceneGraph_SOURCE_DIR}/README.txt")
SET(CPACK_RESOURCE_FILE_WELCOME "${OpenSceneGraph_SOURCE_DIR}/NEWS.txt")
SET(CPACK_SET_DESTDIR "OFF")
SET(CPACK_STRIP_FILES "ON")

View File

@@ -0,0 +1,81 @@
# - Figure out what compiler (and version) cmake is generating for
# Once done this will define:
#
# Variable:
# OSG_COMPILER
#
IF(CMAKE_COMPILER_IS_GNUCXX)
EXEC_PROGRAM(
${CMAKE_CXX_COMPILER}
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE gcc_compiler_version
)
#MESSAGE("GCC Version: ${gcc_compiler_version}")
ELSE(CMAKE_COMPILER_IS_GNUCXX)
IF(MSVC)
IF(MSVC60)
SET(OSG_COMPILER "vc60")
ENDIF(MSVC60)
IF(MSVC70)
SET(OSG_COMPILER "vc70")
ENDIF(MSVC70)
IF(MSVC71)
SET(OSG_COMPILER "vc71")
ENDIF(MSVC71)
IF(MSVC80)
SET(OSG_COMPILER "vc80")
ENDIF(MSVC80)
IF(MSVC90)
SET(OSG_COMPILER "vc90")
ENDIF(MSVC90)
IF(MSVC80)
MESSAGE(STATUS "Checking if compiler has service pack 1 installed...")
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx" "int main() {return 0;}\n")
TRY_COMPILE(_TRY_RESULT
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
CMAKE_FLAGS -D CMAKE_VERBOSE_MAKEFILE=ON
OUTPUT_VARIABLE OUTPUT
)
IF(_TRY_RESULT)
# parse for exact compiler version
STRING(REGEX MATCH "Compiler Version [0-9]+.[0-9]+.[0-9]+.[0-9]+" vc_compiler_version "${OUTPUT}")
IF(vc_compiler_version)
#MESSAGE("${vc_compiler_version}")
STRING(REGEX MATCHALL "[0-9]+" CL_VERSION_LIST "${vc_compiler_version}")
LIST(GET CL_VERSION_LIST 0 CL_MAJOR_VERSION)
LIST(GET CL_VERSION_LIST 1 CL_MINOR_VERSION)
LIST(GET CL_VERSION_LIST 2 CL_PATCH_VERSION)
LIST(GET CL_VERSION_LIST 3 CL_EXTRA_VERSION)
ENDIF(vc_compiler_version)
# Standard vc80 is 14.00.50727.42, sp1 14.00.50727.762, sp2?
# Standard vc90 is 9.0.30729.1, sp1 ?
IF(CL_EXTRA_VERSION EQUAL 762)
SET(OSG_COMPILER "vc80sp1")
ELSE(CL_EXTRA_VERSION EQUAL 762)
SET(OSG_COMPILER "vc80")
ENDIF(CL_EXTRA_VERSION EQUAL 762)
# parse for exact visual studio version
#IF(MSVC_IDE)
# string(REGEX MATCH "Visual Studio Version [0-9]+.[0-9]+.[0-9]+.[0-9]+" vs_version "${OUTPUT}")
# IF(vs_version)
# MESSAGE("${vs_version}")
# string(REGEX MATCHALL "[0-9]+" VS_VERSION_LIST "${vs_version}")
# list(GET VS_VERSION_LIST 0 VS_MAJOR_VERSION)
# list(GET VS_VERSION_LIST 1 VS_MINOR_VERSION)
# list(GET VS_VERSION_LIST 2 VS_PATCH_VERSION)
# list(GET VS_VERSION_LIST 3 VS_EXTRA_VERSION)
# ENDIF(vs_version)
#ENDIF(MSVC_IDE)
ENDIF(_TRY_RESULT)
ENDIF(MSVC80)
ENDIF(MSVC)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)

View File

@@ -21,22 +21,22 @@ MACRO(LINK_WITH_VARIABLES TRGTNAME)
ENDMACRO(LINK_WITH_VARIABLES TRGTNAME)
MACRO(LINK_INTERNAL TRGTNAME)
FOREACH(LINKLIB ${ARGN})
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
#when using versioned names, the .dll name differ from .lib name, there is a problem with that:
#CMake 2.4.7, at least seem to use PREFIX instead of IMPORT_PREFIX for computing linkage info to use into projects,
# so we full path name to specify linkage, this prevent automatic inferencing of dependencies, so we add explicit depemdencies
#to library targets used
IF(NOT MSVC_IDE)
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}.lib" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}.lib")
ELSE(NOT MSVC_IDE)
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
ENDIF(NOT MSVC_IDE)
ADD_DEPENDENCIES(${TRGTNAME} ${LINKLIB})
ELSE(MSVC AND OSG_MSVC_VERSIONED_DLL)
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${LINKLIB}" debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)
ENDFOREACH(LINKLIB)
IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
TARGET_LINK_LIBRARIES(${TRGTNAME} ${ARGN})
ELSE(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
FOREACH(LINKLIB ${ARGN})
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
#when using versioned names, the .dll name differ from .lib name, there is a problem with that:
#CMake 2.4.7, at least seem to use PREFIX instead of IMPORT_PREFIX for computing linkage info to use into projects,
# so we full path name to specify linkage, this prevent automatic inferencing of dependencies, so we add explicit depemdencies
#to library targets used
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}.lib" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}.lib")
ADD_DEPENDENCIES(${TRGTNAME} ${LINKLIB})
ELSE(MSVC AND OSG_MSVC_VERSIONED_DLL)
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${LINKLIB}" debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)
ENDFOREACH(LINKLIB)
ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
ENDMACRO(LINK_INTERNAL TRGTNAME)
MACRO(LINK_EXTERNAL TRGTNAME)
@@ -118,7 +118,7 @@ ENDMACRO(SETUP_LINK_LIBRARIES)
MACRO(SETUP_PLUGIN PLUGIN_NAME)
SET(TARGET_NAME ${PLUGIN_NAME} )
SET(TARGET_NAME ${PLUGIN_NAME} )
#MESSAGE("in -->SETUP_PLUGIN<-- ${TARGET_NAME}-->${TARGET_SRC} <--> ${TARGET_H}<--")
@@ -130,8 +130,15 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
IF(NOT TARGET_LABEL)
SET(TARGET_LABEL "${TARGET_DEFAULT_LABEL_PREFIX} ${TARGET_NAME}")
ENDIF(NOT TARGET_LABEL)
## plugins gets put in libopenscenegraph by default
IF(${ARGC} GREATER 1)
SET(PACKAGE_COMPONENT libopenscenegraph-${ARGV1})
ELSE(${ARGC} GREATER 1)
SET(PACKAGE_COMPONENT libopenscenegraph)
ENDIF(${ARGC} GREATER 1)
# here we use the command to generate the library
# here we use the command to generate the library
IF (DYNAMIC_OPENSCENEGRAPH)
ADD_LIBRARY(${TARGET_TARGETNAME} MODULE ${TARGET_SRC} ${TARGET_H})
@@ -141,40 +148,57 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
#not sure if needed, but for plugins only Msvc need the d suffix
IF(NOT MSVC)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_POSTFIX "")
IF(NOT UNIX)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_POSTFIX "")
ENDIF(NOT UNIX)
ELSE(NOT MSVC)
IF(OSG_MSVC_VERSIONED_DLL)
IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
IF(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "${OSG_PLUGINS}/")
ELSE(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../${OSG_PLUGINS}/")
ENDIF(NOT MSVC_IDE)
ELSE(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
IF(OSG_MSVC_VERSIONED_DLL)
#this is a hack... the build place is set to lib/<debug or release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR
#the .lib will be crated in ../ so going straight in lib by the IMPORT_PREFIX property
#because we want dll placed in OUTPUT_BINDIR ie the bin folder sibling of lib, we can use ../../bin to go there,
#it is hardcoded, we should compute OUTPUT_BINDIR position relative to OUTPUT_LIBDIR ... to be implemented
#changing bin to something else breaks this hack
#the dll are placed in bin/${OSG_PLUGINS}
IF(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../bin/${OSG_PLUGINS}/")
ELSE(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../../bin/${OSG_PLUGINS}/" IMPORT_PREFIX "../")
ENDIF(NOT MSVC_IDE)
ELSE(OSG_MSVC_VERSIONED_DLL)
#in standard mode (unversioned) the .lib and .dll are placed in lib/<debug or release>/${OSG_PLUGINS}.
#here the PREFIX property has been used, the same result would be accomplidhe by prepending ${OSG_PLUGINS}/ to OUTPUT_NAME target property
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "${OSG_PLUGINS}/")
ENDIF(OSG_MSVC_VERSIONED_DLL)
ELSE(OSG_MSVC_VERSIONED_DLL)
#in standard mode (unversioned) the .lib and .dll are placed in lib/<debug or release>/${OSG_PLUGINS}.
#here the PREFIX property has been used, the same result would be accomplidhe by prepending ${OSG_PLUGINS}/ to OUTPUT_NAME target property
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "${OSG_PLUGINS}/")
ENDIF(OSG_MSVC_VERSIONED_DLL)
ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
ENDIF(NOT MSVC)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
SETUP_LINK_LIBRARIES()
#the installation path are differentiated for win32 that install in bib versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
IF(WIN32)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib/${OSG_PLUGINS} LIBRARY DESTINATION bin/${OSG_PLUGINS} )
INSTALL(TARGETS ${TARGET_TARGETNAME}
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
ARCHIVE DESTINATION lib/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
ELSE(WIN32)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} )
INSTALL(TARGETS ${TARGET_TARGETNAME}
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
ENDIF(WIN32)
ENDMACRO(SETUP_PLUGIN)
@@ -227,12 +251,15 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
ADD_EXECUTABLE(${TARGET_TARGETNAME} ${PLATFORM_SPECIFIC_CONTROL} ${TARGET_SRC} ${TARGET_H})
ENDIF(${IS_COMMANDLINE_APP})
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES OUTPUT_NAME ${TARGET_NAME})
IF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../")
ENDIF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL)
SETUP_LINK_LIBRARIES()
ENDMACRO(SETUP_EXE)
@@ -250,7 +277,11 @@ MACRO(SETUP_APPLICATION APPLICATION_NAME)
SETUP_EXE(${IS_COMMANDLINE_APP})
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin )
IF(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin BUNDLE DESTINATION bin)
ELSE(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin COMPONENT openscenegraph )
ENDIF(APPLE)
ENDMACRO(SETUP_APPLICATION)
@@ -273,7 +304,11 @@ MACRO(SETUP_EXAMPLE EXAMPLE_NAME)
SETUP_EXE(${IS_COMMANDLINE_APP})
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin )
IF(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin BUNDLE DESTINATION share/OpenSceneGraph/bin )
ELSE(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples )
ENDIF(APPLE)
ENDMACRO(SETUP_EXAMPLE)
@@ -286,12 +321,12 @@ ENDMACRO(SETUP_COMMANDLINE_EXAMPLE)
# Takes two optional arguments -- osg prefix and osg version
MACRO(HANDLE_MSVC_DLL)
#this is a hack... the build place is set to lib/<debug or release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR
#the .lib will be crated in ../ so going straight in lib by the IMPORT_PREFIX property
#because we want dll placed in OUTPUT_BINDIR ie the bin folder sibling of lib, we can use ../../bin to go there,
#it is hardcoded, we should compute OUTPUT_BINDIR position relative to OUTPUT_LIBDIR ... to be implemented
#changing bin to something else breaks this hack
#the dll are versioned by prefixing the name with osg${OPENSCENEGRAPH_SOVERSION}-
#this is a hack... the build place is set to lib/<debug or release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR
#the .lib will be crated in ../ so going straight in lib by the IMPORT_PREFIX property
#because we want dll placed in OUTPUT_BINDIR ie the bin folder sibling of lib, we can use ../../bin to go there,
#it is hardcoded, we should compute OUTPUT_BINDIR position relative to OUTPUT_LIBDIR ... to be implemented
#changing bin to something else breaks this hack
#the dll are versioned by prefixing the name with osg${OPENSCENEGRAPH_SOVERSION}-
# LIB_PREFIX: use "osg" by default, else whatever we've been given.
IF(${ARGC} GREATER 0)
@@ -309,18 +344,20 @@ MACRO(HANDLE_MSVC_DLL)
IF(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../bin/${LIB_PREFIX}${LIB_SOVERSION}-")
SET(NEW_LIB_NAME "${OUTPUT_BINDIR}/${LIB_PREFIX}${LIB_SOVERSION}-${LIB_NAME}")
ADD_CUSTOM_COMMAND(
TARGET ${LIB_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${NEW_LIB_NAME}.lib" "${OUTPUT_LIBDIR}/${LIB_NAME}.lib"
COMMAND ${CMAKE_COMMAND} -E copy "${NEW_LIB_NAME}.exp" "${OUTPUT_LIBDIR}/${LIB_NAME}.exp"
COMMAND ${CMAKE_COMMAND} -E remove "${NEW_LIB_NAME}.lib"
COMMAND ${CMAKE_COMMAND} -E remove "${NEW_LIB_NAME}.exp"
)
ELSE(NOT MSVC_IDE)
IF (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
SET(NEW_LIB_NAME "${OUTPUT_BINDIR}/${LIB_PREFIX}${LIB_SOVERSION}-${LIB_NAME}")
ADD_CUSTOM_COMMAND(
TARGET ${LIB_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${NEW_LIB_NAME}.lib" "${OUTPUT_LIBDIR}/${LIB_NAME}.lib"
COMMAND ${CMAKE_COMMAND} -E copy "${NEW_LIB_NAME}.exp" "${OUTPUT_LIBDIR}/${LIB_NAME}.exp"
COMMAND ${CMAKE_COMMAND} -E remove "${NEW_LIB_NAME}.lib"
COMMAND ${CMAKE_COMMAND} -E remove "${NEW_LIB_NAME}.exp"
)
ENDIF (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
ELSE(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
ENDIF(NOT MSVC_IDE)
ENDIF(NOT MSVC_IDE)
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/osg${OPENSCENEGRAPH_SOVERSION}-")
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../")

13
CTestConfig.cmake Normal file
View File

@@ -0,0 +1,13 @@
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(Dart)
set(CTEST_PROJECT_NAME "OpenSceneGraph")
set(CTEST_NIGHTLY_START_TIME "00:00:00 CET")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "cdash.openscenegraph.org")
set(CTEST_DROP_LOCATION "/submit.php?project=OpenSceneGraph")
set(CTEST_DROP_SITE_CDASH TRUE)

45244
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@@ -13,8 +13,9 @@
under the terms of the OpenSceneGraph Public License (OSGPL) version 0.0
or later.
Notes: the OSGPL is based on the LGPL, with the 4 exceptions laid in the wxWindows
section below. The LGPL in the final section of this license.
Notes: the OSGPL is based on the LGPL, with the 4 exceptions laid
out in the wxWindows section below. The LGPL is contained in the
final section of this license.
-------------------------------------------------------------------------------
@@ -187,7 +188,7 @@ modification follow. Pay close attention to the difference between a
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other

277
NEWS.txt
View File

@@ -1,6 +1,283 @@
OSG News
========
= !OpenSceneGraph 2.8.2 release - bug fix release =
PERTHSHIRE, Scotland - 28th July 2009 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.8.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.8 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.8 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
=== Open-source development delivers industry-leading features and performance ===
The !OpenSceneGraph 2.8.2 release is the culmination of 10 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
=== Updates between 2.8.2 and 2.8.1 releases include: ===
* Build fixes for:
* !RedHat Enterprise Linux
* Building of dicom plugin with ITK under Linux
* Crash fixes to:
* crash during window destruction under Windows when using closing a MFC based !GraphicsWindow
* deadlock under Windows due threading issues with atomic operations in Win32 Barrier implementation
* !OpenFlight plugin crashed due to not handling spaces at the end of option strings
* !OpenFlight plugin crashed when exported scene graphs contain no TexEnv objects
* osganimationtimeline crashed when example model was not found
* Bug fixes to :
* vertical anchor in osgWidget::Widow was inverted
* bsp an mdl plugins to better handling transparency and lighting
* computation of sector range in osgSim::!LightPoint
* extension checking of FBO packed stencil support
* position of tabs at corners of manipulators
* threading bug in .osg plugin that occurred during multi-threaded initialization
* alignment of Text what setting alignment after assign text string
* loading of compressed texture arrays
* texture generate mipmap for non power of two textures
* regression in X11 key symbol remapping, improved support for Russian keyboards
* regression of !StencilMask setting in !RenderStage
* small memory leak in X11 usage
* Transform::computeBound() double !BoundingSphere support
* Resize handling when master and slave Cameras share the same !GraphicsContext
* Handling of locale in plugins and env var parsing so it always follows the '.' decimal place convention regardless of the desktop/application locale.
=== Updates between 2.8.1 and 2.8.0 releases include: ===
* Build fixes under FreeBSD and IBM AIX, and RedHat Enterprise Linux
* Improved compatibility with SWIG wrapper building
* Crash fixes in osg::State, osg::Geometry and osgWidget
* Bug fixes to :
* draw instanced support
* Optimizer - MergeGeometryVisitor, RemoveLoadedProxyNodesVisitor and SpatializeGroupsVistor
* hdr image loader
* handling of opacity maps in 3ds loader
* dxf loader
* frame buffer object
* cursor/event handling in windows
* windows threading
* memory leak in Collada loader
* fixes to display lists/vbo creation that prevent crash under ATI drivers
* subface PolygonOffset setting in OpenFlight
* osgconv --formats under OSX
* osgTerrain::Layer bounding volume calculation
=== Updates between 2.8 and 2.6 include: ===
* New osgVolume library for volume rendering, with support for:
* High quality GPU based Ray tracing
* Transfer functions
* Per pixel lighting
* Iso surface rendering
* Maximum Intensity Projection rendering
* Non-power-of-two 3D textures, and 3D texture compression
* DICOM loading for reading dicom medical data
* New osgAnimation library for character and scene animation.
* New plugin for reading Biovision hierarchical files (.BVH) to generate character motion animations.
* New osgShadow support for Light Space Perspective Shadow Maps (LispSM).
* Three new scene graph widgets for placing traditional 2D capability into fully interactive 3D scenes:
* PDF widget (based on libPoppler)
* VNC client widget (based on libVNCServer)
* Internet browser client widget (based on Gecko/UBrowser)
* New plugins for loading Half-Life 2 maps and models.
* New plugin for loading EXR, high dynamic range imagery
* Improvements to !DatabasePager, tailored for low latency paging.
* Improved runtime stats collection and on screen reporting.
* Performance improvements through optimization of matrix operations.
* Support for the OpenGL "draw instanced" extension.
* Support for zlib compressed native .ive and .gz files
* Improvements to COLLADA support.
* Build reporting using CDash
* New packaging support using CPack
* A wide range of build and bug fixes
=== Downloads and Licensing ===
!OpenSceneGraph is open-source, so full source code is provided, and can be copied, modified and used free of charge for commercial and non-commercial use. Access to the source allows end users greater flexibility in how they develop, debug and deploy their applications. They gain productivity and freedom by being able to leverage the tool chain in accordance with their own release cycles. Downloads of binaries and source can be found in the [http://www.openscenegraph.org/projects/osg/wiki/Downloads Downloads] section of the openscenegraph.org website.
!OpenSceneGraph is released under the [http://www.openscenegraph.org/projects/osg/wiki/Legal OpenSceneGraph Public License], which is based on the Lesser GNU Public License (LGPL), permitting the software to be used free of charge across the full spectrum of commercial and open-source applications. Furthermore, it allows both static and dynamic linking of the !OpenSceneGraph libraries without restricting the licensing of the user's software.
=== !OpenSceneGraph Books now available ===
The !OpenSceneGraph Quick Start Guide is now available in Chinese as well as English, and alongside the Reference Manual, books can be found at [http://www.osgbooks.com OsgBooks].
=== Professional support and services ===
!OpenSceneGraph project is backed up with professional services by [http://www.openscenegraph.com OpenSceneGraph Professional Services], based in Scotland, and [http://www.skew-matrix.com Skew-Matrix] and [http://www.blue-newt.com Blue-Newt Software] both based in the USA, and a range of [wiki:Community/Contractors Contractors] from around the world. Services available include:
* Confidential Professional Support
* Bespoke development
* Consultancy
* Training
=== Community support and contributions ===
The diverse and growing community of over 2000 developers is centred around the public osg-users mailing list, where members discuss how best to use !OpenSceneGraph, provide mutual support, and coordinate development of new features and bug fixes. Members of this community come from many different countries with backgrounds ranging from some of the world's largest aerospace companies, game companies, and visual simulation specialists to university researchers, students and hobbyists.
The !OpenSceneGraph project owes a great deal to the community for its development and support, in particular we wish to thank the [http://www.openscenegraph.org/projects/osg/wiki/Support/Contributors/TwoPointEight 365 individuals] from around the world that have directly contributed to the development and refinement of the !OpenSceneGraph code base.
----
About !OpenSceneGraph: [[BR]]
The !OpenSceneGraph Project was founded in September 1999 by Don Burns and Robert Osfield.
Further information, screenshots, downloads, documentation, and support links can be found on the !OpenSceneGraph project website http://www.openscenegraph.org.
About !OpenSceneGraph Professional Services:[[BR]]
!OpenSceneGraph Professional Services, founded by project lead Robert Osfield in April 2001, is based in Callander, Perhshire, Scotland, and provides professional services on top of !OpenSceneGraph. Further information about the services it provides can be found at http://www.openscenegraph.com.
----------------------------------------------------------------------------------------
= !OpenSceneGraph 2.8.1 release - bug fix release =
PERTHSHIRE, Scotland - 19th May 2009 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.8.1, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.8 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.8 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
=== Open-source development delivers industry-leading features and performance ===
The !OpenSceneGraph 2.8.1 release is the culmination of 10 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
=== Updates between 2.8.1 and 2.8.0 releases include: ===
* Build fixes under FreeBSD and IBM AIX, and RedHat Enterprise Linux.
* Improved compatibility with SWIG wrapper building
* Crash fixes in osg::State, osg::Geometry and osgWidget.
* Bug fixes to :
* draw instanced support
* Optimizer - MergeGeometryVisitor, RemoveLoadedProxyNodesVisitor and SpatializeGroupsVistor
* hdr image loader
* handling of opacity maps in 3ds loader
* dxf loader
* frame buffer object
* cursor/event handling in windows
* windows threading
* memory leak in Collada loader
* fixes to display lists/vbo creation that prevent crash under ATI drivers
* subface PolygonOffset setting in OpenFlight
* osgconv --formats under OSX
* osgTerrain::Layer bounding volume calculation.
=== Updates between 2.8 and 2.6 include: ===
* New osgVolume library for volume rendering, with support for:
* High quality GPU based Ray tracing
* Transfer functions
* Per pixel lighting
* Iso surface rendering
* Maximum Intensity Projection rendering
* Non-power-of-two 3D textures, and 3D texture compression
* DICOM loading for reading dicom medical data
* New osgAnimation library for character and scene animation.
* New plugin for reading Biovision hierarchical files (.BVH) to generate character motion animations.
* New osgShadow support for Light Space Perspective Shadow Maps (LispSM).
* Three new scene graph widgets for placing traditional 2D capability into fully interactive 3D scenes:
* PDF widget (based on libPoppler)
* VNC client widget (based on libVNCServer)
* Internet browser client widget (based on Gecko/UBrowser)
* New plugins for loading Half-Life 2 maps and models.
* New plugin for loading EXR, high dynamic range imagery
* Improvements to !DatabasePager, tailored for low latency paging.
* Improved runtime stats collection and on screen reporting.
* Performance improvements through optimization of matrix operations.
* Support for the OpenGL "draw instanced" extension.
* Support for zlib compressed native .ive and .gz files
* Improvements to COLLADA support.
* Build reporting using CDash
* New packaging support using CPack
* A wide range of build and bug fixes
=== Downloads and Licensing ===
!OpenSceneGraph is open-source, so full source code is provided, and can be copied, modified and used free of charge for commercial and non-commercial use. Access to the source allows end users greater flexibility in how they develop, debug and deploy their applications. They gain productivity and freedom by being able to leverage the tool chain in accordance with their own release cycles. Downloads of binaries and source can be found in the [http://www.openscenegraph.org/projects/osg/wiki/Downloads Downloads] section of the openscenegraph.org website.
!OpenSceneGraph is released under the [http://www.openscenegraph.org/projects/osg/wiki/Legal OpenSceneGraph Public License], which is based on the Lesser GNU Public License (LGPL), permitting the software to be used free of charge across the full spectrum of commercial and open-source applications. Furthermore, it allows both static and dynamic linking of the !OpenSceneGraph libraries without restricting the licensing of the user's software.
=== !OpenSceneGraph Books now available ===
The !OpenSceneGraph Quick Start Guide is now available in Chinese as well as English, and alongside the Reference Manual, books can be found at [http://www.osgbooks.com OsgBooks].
=== Professional support and services ===
!OpenSceneGraph project is backed up with professional services by [http://www.openscenegraph.com OpenSceneGraph Professional Services], based in Scotland, and [http://www.skew-matrix.com Skew-Matrix] and [http://www.blue-newt.com Blue-Newt Software] both based in the USA, and a range of [wiki:Community/Contractors Contractors] from around the world. Services available include:
* Confidential Professional Support
* Bespoke development
* Consultancy
* Training
=== Community support and contributions ===
The diverse and growing community of over 2000 developers is centred around the public osg-users mailing list, where members discuss how best to use !OpenSceneGraph, provide mutual support, and coordinate development of new features and bug fixes. Members of this community come from many different countries with backgrounds ranging from some of the world's largest aerospace companies, game companies, and visual simulation specialists to university researchers, students and hobbyists.
The !OpenSceneGraph project owes a great deal to the community for its development and support, in particular we wish to thank the [http://www.openscenegraph.org/projects/osg/wiki/Support/Contributors/TwoPointEight 365 individuals] from around the world that have directly contributed to the development and refinement of the !OpenSceneGraph code base.
----
About !OpenSceneGraph: [[BR]]
The !OpenSceneGraph Project was founded in September 1999 by Don Burns and Robert Osfield.
Further information, screenshots, downloads, documentation, and support links can be found on the !OpenSceneGraph project website http://www.openscenegraph.org.
About !OpenSceneGraph Professional Services:[[BR]]
!OpenSceneGraph Professional Services, founded by project lead Robert Osfield in April 2001, is based in Callander, Perhshire, Scotland, and provides professional services on top of !OpenSceneGraph. Further information about the services it provides can be found at http://www.openscenegraph.com.
----------------------------------------------------------------------------------------
= !OpenSceneGraph 2.6 release adds osgWidget library, KdTree intersections, Anti-aliased FBOsand much more. =
PERTHSHIRE, Scotland - 5th August 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.6, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.6 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.6 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
=== Open-source development delivers industry-leading features and performance ===
The !OpenSceneGraph 2.6 release is the culmination of 9 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
=== Updates include: ===
* New osgWidget library for scene graph based graphics user interface elements (beta release).
* KdTree support, with automatic KdTree generation on load and use of KdTree during line intersections which massively improves intersection speeds.
* Precision improvements to line intersections, provide accurate whole earth intersection.
* OpenGL Multi-sample FrameBufferObject support.
* New osg::ImageSequence class for doing texture animation of a series of image files.
* New database optimizer that is able to remove static transforms by duplicating shared geometries.
* Use glGenerateMipmap to speed up mipmap generation in non power-of-two textures.
* New osgViewer::ScreenCaptureHandler for adding screen shot support to osgViewer applications.
* New osgscreencapture example that demonstrates use of double buffer PixelBufferObject's for streaming of imagery from the screen.
* New utility application osgfilecache which can be used to populate the local cache for given lat/lon ranges and levels.
* Rewritten DatabasePager that now supports multiple database reading threads. This includes handling of HTTP requests via a separate reading thread, vastly improving the speed of updates when handling HTTP hosted databases that have already partially been downloaded to local file cache.
* Support for a file cache for locally caching paged databases hosted over HTTP.
* Support for http authentication in osgDB and the libcurl plugin
* New osgconv --format <fmt>, --formats and --plugins command line options for listing available plugins and the file formats/options they support.
* Performance improvements in handling TerraPage.
* Animated GIF support.
* New SVG image loader.
* Improvements to the .obj loader to support a wider range of .obj files and material properties.
* Support for thread safe Atomic reference counting.
* Support for COLLADA DOM 2.x
* Support for Philips WOWvx 3D auto-stereoscopic displays
* New include/osg/Config and include/OpenThreads/Config configuration files, that are automatically generated by CMake, which make more straight forward to build end users applications against OpenSceneGraph versions built with non default build options.
* Support for CMake 2.6
* A wide range of build and bug fixes
=== Downloads and Licensing ===
!OpenSceneGraph is open-source so full source code is provided, and can be copied, modified and used free of charge for commercial and non-commercial use. Access to the source allows end users greater flexibility in how they develop, debug and deploy their applications. They gain productivity and freedom by being able to leverage the tool chain in accordance with their own release cycles. Downloads of binaries and source can be found in the [http://www.openscenegraph.org/projects/osg/wiki/Downloads Downloads] section of the openscenegraph.org website.
!OpenSceneGraph is released under the [http://www.openscenegraph.org/projects/osg/wiki/Legal OpenSceneGraph Public License], which is based on the Lesser GNU Public License (LGPL), permitting the software to be used free of charge across the full spectrum of commercial and open-source applications. Furthermore, it allows both static and dynamic linking of the !OpenSceneGraph libraries without restricting the licensing of the user's software.
=== !OpenSceneGraph Books now available ===
The !OpenSceneGraph Quick Start Guide is now available in Chinese as well as English, and alongside the Reference Manual books can be found at [http://www.osgbooks.com OsgBooks].
=== Professional support and services ===
!OpenSceneGraph project is backed up with professional services by [http://openscenegraph.com OpenSceneGraph Professional Services], based in Scotland, and [http://www.skew-matrix.com Skew-Matrix] and [http://www.blue-newt.com Blue-Newt Software] both based in the USA, and a range of [wiki:Community/Contractors Contractors] from around the world. Services available include:
* Confidential Professional Support
* Bespoke development
* Consultancy
* Training
=== Community support and contributions ===
The diverse and growing community of over 1900 developers is centred around the public osg-users mailing list, where members discuss how best to use !OpenSceneGraph, provide mutual support, and coordinate development of new features and bug fixes. Members of this community come from many different countries with backgrounds ranging from some of the world's largest aerospace companies, game companies, and visual simulation specialists to university researchers, students and hobbyists.
The !OpenSceneGraph project owes a great deal to the community for its development and support, in particular we wish to thank the [http://www.openscenegraph.org/projects/osg/wiki/Support/Contributors/TwoPointSix 324 individuals] from around the world that have directly contributed to the development and refinement of the !OpenSceneGraph code base.
----
About !OpenSceneGraph:[[BR]]
!OpenSceneGraph Project was founded in September 1999 by Don Burns and Robert Osfield.
Further information, screenshots, downloads, documentation, and support links can be found on the !OpenSceneGraph project website http://www.openscenegraph.org.
About !OpenSceneGraph Professional Services:[[BR]]
!OpenSceneGraph Professional Services, founded by project lead Robert Osfield in April 2001, is based in Callander, Perhshire, Scotland, and provides professional services on top of !OpenSceneGraph. Further information about the services it provides can be found at http://www.openscenegraph.com.
----------------------------------------------------------------------------------------
= !OpenSceneGraph 2.4 release adds geometry shaders, multiple render targets, support for terrabyte scale terrain databases, writing to !OpenFlight and much more. =
PERTHSHIRE, Scotland - 25th April 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.4, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.4 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.4 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.

View File

@@ -5,8 +5,8 @@ REM trees.
REM mew 2004-07-16
cd ..\..
set PATH=%CD%\OpenThreads\bin\win32;%CD%\OpenSceneGraph\bin\win32;%CD%\3rdParty\bin;%PATH%
set OSG_FILE_PATH=%CD%\OpenSceneGraph-Data;%CD%\OpenSceneGraph-Data\Images;%CD%\OpenSceneGraph-Data\fonts;%OSG_FILE_PATH%
set PATH=%CD%\OpenThreads\bin\win32;%CD%\bin;%CD%\3rdParty\bin;%PATH%
set OSG_FILE_PATH=%CD%\OpenSceneGraph-Data;%OSG_FILE_PATH%
REM uncomment one of these for your desired notify level...
rem set OSG_NOTIFY_LEVEL=ALWAYS

View File

@@ -12,10 +12,9 @@ subscribe to our public mailing list:
http://www.openscenegraph.org/projects/osg/wiki/MailingLists
Robert Osfield.
Project Lead.
25th April 2008.
28th July 2009.
--
@@ -66,9 +65,82 @@ system should help guide you through the process:
Under OSX you can either use the CMake build system above, or use the
Xcode projects that you will find in the OpenSceneGraph/Xcode
directory.
directory. See release notes on OSX CMake build below.
For further details on compilation, installation and platform-specific
information read "Getting Started" guide:
http://www.openscenegraph.org/projects/osg/wiki/Support/GettingStarted
-- Release notes on OSX build, by Eric Sokolowsky, August 5, 2008
There are several ways to compile OpenSceneGraph under OSX. The
recommended way is to use CMake 2.6 to generate Xcode projects, then use
Xcode to build the library. The default project will be able to build
Debug or Release libraries, examples, and sample applications. Here are
some key settings to consider when using CMake:
BUILD_OSG_EXAMPLES - By default this is turned off. Turn this setting on
to compile many great example programs.
CMAKE_OSX_ARCHITECTURES - Xcode can create applications, executables,
libraries, and frameworks that can be run on more than one architecture.
Use this setting to indicate the architectures on which to build OSG.
Possibilities include ppc, ppc64, i386, and x86_64. Building OSG using
either of the 64-bit options (ppc64 and x86_64) has its own caveats
below.
OSG_BUILD_APPLICATION_BUNDLES - Normally only executable binaries are
created for the examples and sample applications. Turn this option on if
you want to create real OSX .app bundles. There are caveats to creating
.app bundles, see below.
OSG_WINDOWING_SYSTEM - You have the choice to use Carbon or X11 when
building applications on OSX. Under Leopard and later, X11 applications,
when started, will automatically launch X11 when needed. However,
full-screen X11 applications will still show the menu bar at the top of
the screen. Since many parts of the Carbon user interface are not
64-bit, X11 is the only supported option for OSX applications compiled
for ppc64 or x86_64.
There is an Xcode directory in the base of the OSG software
distribution, but its future is limited, and will be discontinued once
the CMake project generator completely implements its functionality.
APPLICATION BUNDLES (.app bundles)
The example programs when built as application bundles only contain the
executable file. They do not contain the dependent libraries as would a
normal bundle, so they are not generally portable to other machines.
They also do not know where to find plugins. An environmental variable
OSG_LIBRARY_PATH may be set to point to the location where the plugin
.so files are located. OSG_FILE_PATH may be set to point to the location
where data files are located. Setting OSG_FILE_PATH to the
OpenSceneGraph-Data directory is very useful when testing OSG by running
the example programs.
Many of the example programs use command-line arguments. When
double-clicking on an application (or using the equivalent "open"
command on the command line) only those examples and applications that
do not require command-line arguments will successfully run. The
executable file within the .app bundle can be run from the command-line
if command-line arguments are needed.
64-BIT APPLICATION SUPPORT
OpenSceneGraph will not compile successfully when OSG_WINDOWING_SYSTEM is
Carbon and either x86_64 or ppc64 is selected under CMAKE_OSX_ARCHITECTURES,
as Carbon is a 32bit only API. A version of the osgviewer library written in
Cocoa is needed. However, OSG may be compiled under 64-bits if the X11
windowing system is selected. However, Two parts of the OSG default
distribution will not work with 64-bit X11: the osgviewerWX example
program and the osgdb_qt (Quicktime) plugin. These must be removed from
the Xcode project after Cmake generates it in order to compile with
64-bit architectures. The lack of the latter means that images such as
jpeg, tiff, png, and gif will not work, nor will animations dependent on
Quicktime. A new ImageIO-based plugin is being developed to handle the
still images, and a QTKit plugin will need to be developed to handle
animations.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,20 @@
#ifndef _OPENTHREADS_CONFIG
#define _OPENTHREADS_CONFIG
#include <AvailabilityMacros.h>
#define _OPENTHREADS_ATOMIC_USE_MUTEX
#if defined(MAC_OS_X_VERSION_10_5)
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
#define _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC
#undef _OPENTHREADS_ATOMIC_USE_MUTEX
#endif
#endif
/* #undef _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS */
/* #undef _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS */
/* #undef _OPENTHREADS_ATOMIC_USE_SUN */
/* #undef _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED */
/* #undef _OPENTHREADS_ATOMIC_USE_MUTEX */
#endif

View File

@@ -0,0 +1,10 @@
#ifndef OSG_CONFIG
#define OSG_CONFIG 1
/* #undef OSG_USE_FLOAT_MATRIX */
/* #undef OSG_USE_FLOAT_PLANE */
#define OSG_USE_FLOAT_BOUNDINGSPHERE
#define OSG_USE_FLOAT_BOUNDINGBOX
/* #undef OSG_ENFORCE_THREADSAFE */
#endif

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>osgAnimation</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>org.OpenSceneGraph.osgAnimation</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.7.0</string>
</dict>
</plist>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>osgVolume</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>org.OpenSceneGraph.osgVolume</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.7.0</string>
</dict>
</plist>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>osgWidget</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>org.OpenSceneGraph.osgWidget</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.2.0</string>
</dict>
</plist>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>osgWidget</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>org.OpenSceneGraph.osgWidget</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.2.0</string>
</dict>
</plist>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>osganimationviewer</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>org.OpenSceneGraph.osganimationviewer</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
<string></string>
</dict>
</plist>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>osgimagesequence</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>org.OpenSceneGraph.osgimagesequence</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
<string></string>
</dict>
</plist>

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>osgmanipulator</string>
<string>osgmanipulator-example</string>
<key>CFBundleIdentifier</key>
<string>com.MySoftwareCompany.osgmanipulator</string>
<key>CFBundleVersion</key>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>osgwidgetmenu</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>org.OpenSceneGraph.osgwidgetmenu</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
<string></string>
</dict>
</plist>

View File

@@ -26,19 +26,20 @@ SET(TARGET_COMMON_LIBRARIES
osgText
)
ADD_SUBDIRECTORY(osgviewer)
ADD_SUBDIRECTORY(osgarchive)
ADD_SUBDIRECTORY(osgconv)
ADD_SUBDIRECTORY(osgversion)
IF(DYNAMIC_OPENSCENEGRAPH)
#REWRITE_CMAKELIST(ADD_OSG_EXAMPLE)
ADD_SUBDIRECTORY(osgviewer)
ADD_SUBDIRECTORY(osgarchive)
ADD_SUBDIRECTORY(osgconv)
ADD_SUBDIRECTORY(osgfilecache)
ADD_SUBDIRECTORY(osgversion)
#MESSAGE("---->${MY_EXAMPLE_LIST}<---------")
##########to get all the variables of Cmake
#GET_CMAKE_PROPERTY(MYVARS VARIABLES)
#FOREACH(myvar ${MYVARS})
# FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt
# "${myvar} -->${${myvar}}<-\n"
# )
#ENDFOREACH(myvar)
ELSE(DYNAMIC_OPENSCENEGRAPH)
# need to define this on win32 or linker cries about _declspecs
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ADD_SUBDIRECTORY(osgversion)
ENDIF(DYNAMIC_OPENSCENEGRAPH)

View File

@@ -79,7 +79,12 @@ int main( int argc, char **argv )
else if (fileType==osgDB::DIRECTORY)
{
osgDB::DirectoryContents directory = osgDB::getDirectoryContents(arguments[pos]);
files.insert(files.end(),directory.begin(),directory.end());
osgDB::DirectoryContents::iterator it = directory.begin();
while( it != directory.end())
{
files.push_back(filePath + "/" + (*it));
++it;
}
}
}
else

View File

@@ -1,7 +1,13 @@
#this file is automatically generated
SET(TARGET_SRC OrientationConverter.cpp osgconv.cpp )
SET(TARGET_H OrientationConverter.h )
SET(TARGET_SRC
OrientationConverter.cpp
osgconv.cpp
)
SET(TARGET_H
OrientationConverter.h
)
#### end var setup ###
SETUP_APPLICATION(osgconv)

View File

@@ -17,6 +17,7 @@
#include <osgDB/WriteFile>
#include <osgDB/FileNameUtils>
#include <osgDB/ReaderWriter>
#include <osgDB/PluginQuery>
#include <osgUtil/Optimizer>
#include <osgUtil/Simplifier>
@@ -492,6 +493,17 @@ static void usage( const char *prog, const char *msg )
" their own color values (--addMissingColours also accepted)."<< std::endl;
osg::notify(osg::NOTICE)<<" --overallNormal - Replace normals with a single overall normal."<< std::endl;
osg::notify( osg::NOTICE ) << std::endl;
osg::notify( osg::NOTICE ) <<
" --formats - Lists all supported formats and their supported options." << std::endl;
osg::notify( osg::NOTICE ) <<
" --format <format> - Displays information about the spefied <format>, where <format>\n"
" is the file extension, such as \"flt\"." << std::endl;
osg::notify( osg::NOTICE ) <<
" --plugins - Lists all supported plugin files." << std::endl;
osg::notify( osg::NOTICE ) <<
" --plugin >plugin> - Displays information about the spefied <plugin>, where <plugin>\n"
" is the plugin's full path and file name." << std::endl;
}
@@ -506,6 +518,8 @@ int main( int argc, char **argv )
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display command line parameters");
arguments.getApplicationUsage()->addCommandLineOption("--help-env","Display environmental variables available");
//arguments.getApplicationUsage()->addCommandLineOption("--formats","List supported file formats");
//arguments.getApplicationUsage()->addCommandLineOption("--plugins","List database olugins");
// if user request help write it out to cout.
@@ -522,6 +536,45 @@ int main( int argc, char **argv )
return 1;
}
if (arguments.read("--plugins"))
{
osgDB::FileNameList plugins = osgDB::listAllAvailablePlugins();
for(osgDB::FileNameList::iterator itr = plugins.begin();
itr != plugins.end();
++itr)
{
std::cout<<"Plugin "<<*itr<<std::endl;
}
return 0;
}
std::string plugin;
if (arguments.read("--plugin", plugin))
{
osgDB::outputPluginDetails(std::cout, plugin);
return 0;
}
std::string ext;
if (arguments.read("--format", ext))
{
plugin = osgDB::Registry::instance()->createLibraryNameForExtension(ext);
osgDB::outputPluginDetails(std::cout, plugin);
return 0;
}
if (arguments.read("--formats"))
{
osgDB::FileNameList plugins = osgDB::listAllAvailablePlugins();
for(osgDB::FileNameList::iterator itr = plugins.begin();
itr != plugins.end();
++itr)
{
osgDB::outputPluginDetails(std::cout,*itr);
}
return 0;
}
if (arguments.argc()<=1)
{
arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION);
@@ -540,7 +593,6 @@ int main( int argc, char **argv )
osgDB::Registry::instance()->setOptions(options);
}
std::string ext;
while (arguments.read("-e",ext))
{
std::string libName = osgDB::Registry::instance()->createLibraryNameForExtension(ext);

View File

@@ -0,0 +1,7 @@
SET(TARGET_SRC osgfilecache.cpp )
SET(TARGET_ADDED_LIBRARIES osgTerrain )
#### end var setup ###
SETUP_APPLICATION(osgfilecache)

View File

@@ -0,0 +1,489 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This application is open source and may be redistributed and/or modified
* freely and without restriction, both in commericial and non commericial applications,
* as long as this copyright notice is maintained.
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <osg/Timer>
#include <osg/ArgumentParser>
#include <osg/ApplicationUsage>
#include <osg/CoordinateSystemNode>
#include <osg/Geometry>
#include <osg/io_utils>
#include <osgTerrain/TerrainTile>
#include <osgDB/Archive>
#include <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include <osgDB/FileUtils>
#include <osgDB/FileCache>
#include <osgDB/FileNameUtils>
#include <iostream>
#include <algorithm>
#include <signal.h>
#include <stdlib.h>
static bool s_ExitApplication = false;
struct Extents
{
Extents():
_maxLevel(0),
_min(DBL_MAX,DBL_MAX),
_max(-DBL_MAX,-DBL_MAX) {}
Extents(unsigned int maxLevel, double minX, double minY, double maxX, double maxY):
_maxLevel(maxLevel),
_min(minX, minY),
_max(maxX, maxY) {}
Extents(const Extents& extents):
_maxLevel(extents._maxLevel),
_min(extents._min),
_max(extents._max) {}
Extents& operator = (const Extents& rhs)
{
if (&rhs == this) return *this;
_maxLevel = rhs._maxLevel;
_min = rhs._min;
_max = rhs._max;
return *this;
}
bool intersects(unsigned level, osg::Vec2d& in_min, osg::Vec2d& in_max)
{
osg::notify(osg::INFO)<<"intersects("<<level<<", min="<<in_min<<" max="<<in_max<<")"<<std::endl;
osg::notify(osg::INFO)<<" _maxLevel="<<_maxLevel<<", _min="<<_min<<" _max="<<_max<<std::endl;
if (level>_maxLevel) return false;
osg::Vec2d union_min, union_max;
// handle mins
if (_min.x()!=DBL_MAX && in_min.x()!=DBL_MAX)
{
// both _min.x() and in_min.x() are defined so use max of two
union_min.x() = _min.x()>in_min.x() ? _min.x() : in_min.x();
}
else
{
// one or both _min.x() and in_min.x() aren't defined so use min of two
union_min.x() = _min.x()<in_min.x() ? _min.x() : in_min.x();
}
if (_min.y()!=DBL_MAX && in_min.y()!=DBL_MAX)
{
// both _min.y() and in_min.y() are defined so use max of two
union_min.y() = _min.y()>in_min.y() ? _min.y() : in_min.y();
}
else
{
// one or both _min.y() and in_min.y() aren't defined so use min of two
union_min.y() = _min.y()<in_min.y() ? _min.y() : in_min.y();
}
// handle maxs
if (_max.x()!=-DBL_MAX && in_max.x()!=-DBL_MAX)
{
// both _max.x() and in_max.x() are defined so use max of two
union_max.x() = _max.x()<in_max.x() ? _max.x() : in_max.x();
}
else
{
// one or both _max.x() and in_max.x() aren't defined so use max of two
union_max.x() = _max.x()>in_max.x() ? _max.x() : in_max.x();
}
if (_max.y()!=-DBL_MAX && in_max.y()!=-DBL_MAX)
{
// both _max.y() and in_max.y() are defined so use max of two
union_max.y() = _max.y()<in_max.y() ? _max.y() : in_max.y();
}
else
{
// one or both _max.y() and in_max.y() aren't defined so use max of two
union_max.y() = _max.y()>in_max.y() ? _max.y() : in_max.y();
}
bool result = union_min.x()<union_max.x() && union_min.y()<union_max.y() ;
osg::notify(osg::INFO)<<" union_min="<<union_min<<" union_max="<<union_max<<" result = "<<result<<std::endl;
return result;
}
unsigned int _maxLevel;
osg::Vec2d _min;
osg::Vec2d _max;
};
class LoadDataVisitor : public osg::NodeVisitor
{
public:
LoadDataVisitor():
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
_currentLevel(0) {}
void setFileCache(osgDB::FileCache* fileCache) { _fileCache = fileCache; }
void addExtents(unsigned int maxLevel, double minX, double minY, double maxX, double maxY)
{
_extentsList.push_back(Extents(maxLevel, minX, minY, maxX, maxY));
}
void addExtents(unsigned int maxLevel)
{
_extentsList.push_back(Extents(maxLevel, DBL_MAX, DBL_MAX, -DBL_MAX, -DBL_MAX));
}
void apply(osg::CoordinateSystemNode& cs)
{
_csnStack.push_back(&cs);
if (!s_ExitApplication) traverse(cs);
_csnStack.pop_back();
}
void apply(osg::Group& group)
{
if (s_ExitApplication) return;
osgTerrain::TerrainTile* terrainTile = dynamic_cast<osgTerrain::TerrainTile*>(&group);
osgTerrain::Locator* locator = terrainTile ? terrainTile->getLocator() : 0;
if (locator)
{
osg::Vec3d l00(0.0,0.0,0.0);
osg::Vec3d l10(1.0,0.0,0.0);
osg::Vec3d l11(1.0,1.0,0.0);
osg::Vec3d l01(0.0,1.0,0.0);
osg::Vec3d w00, w10, w11, w01;
locator->convertLocalToModel(l00, w00);
locator->convertLocalToModel(l10, w10);
locator->convertLocalToModel(l11, w11);
locator->convertLocalToModel(l01, w01);
if (locator->getEllipsoidModel() &&
locator->getCoordinateSystemType()==osgTerrain::Locator::GEOCENTRIC)
{
convertXYZToLatLongHeight(locator->getEllipsoidModel(), w00);
convertXYZToLatLongHeight(locator->getEllipsoidModel(), w10);
convertXYZToLatLongHeight(locator->getEllipsoidModel(), w11);
convertXYZToLatLongHeight(locator->getEllipsoidModel(), w01);
}
updateBound(w00);
updateBound(w10);
updateBound(w11);
updateBound(w01);
return;
}
traverse(group);
}
void apply(osg::Transform& transform)
{
osg::Matrix matrix;
if (!_matrixStack.empty()) matrix = _matrixStack.back();
transform.computeLocalToWorldMatrix(matrix,this);
pushMatrix(matrix);
traverse(transform);
popMatrix();
}
void apply(osg::PagedLOD& plod)
{
if (s_ExitApplication) return;
++_currentLevel;
initBound();
// first compute the bounds of this subgraph
for(unsigned int i=0; i<plod.getNumFileNames(); ++i)
{
if (plod.getFileName(i).empty())
{
traverse(plod);
}
}
if (intersects())
{
for(unsigned int i=0; i<plod.getNumFileNames(); ++i)
{
osg::notify(osg::INFO)<<" filename["<<i<<"] "<<plod.getFileName(i)<<std::endl;
if (!plod.getFileName(i).empty())
{
std::string filename;
if (!plod.getDatabasePath().empty())
{
filename = plod.getDatabasePath() + plod.getFileName(i);
}
else
{
filename = plod.getFileName(i);
}
osg::ref_ptr<osg::Node> node = readNodeFileAndWriteToCache(filename);
if (!s_ExitApplication && node.valid()) node->accept(*this);
}
}
}
--_currentLevel;
}
void apply(osg::Geode& geode)
{
for(unsigned int i=0; i<geode.getNumDrawables(); ++i)
{
osg::Geometry* geom = geode.getDrawable(i)->asGeometry();
if (geom)
{
osg::Vec3Array* vertices = dynamic_cast<osg::Vec3Array*>(geom->getVertexArray());
if (vertices) updateBound(*vertices);
}
}
}
osg::Node* readNodeFileAndWriteToCache(const std::string& filename)
{
if (_fileCache.valid() && osgDB::containsServerAddress(filename))
{
if (_fileCache->existsInCache(filename))
{
osg::notify(osg::NOTICE)<<"reading from FileCache: "<<filename<<std::endl;
return _fileCache->readNode(filename, osgDB::Registry::instance()->getOptions()).takeNode();
}
else
{
osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl;
osg::Node* node = osgDB::readNodeFile(filename);
if (node)
{
osg::notify(osg::NOTICE)<<"write to FileCache : "<<filename<<std::endl;
_fileCache->writeNode(*node, filename, osgDB::Registry::instance()->getOptions());
}
return node;
}
}
else
{
osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl;
return osgDB::readNodeFile(filename);
}
}
protected:
inline void pushMatrix(osg::Matrix& matrix) { _matrixStack.push_back(matrix); }
inline void popMatrix() { _matrixStack.pop_back(); }
void convertXYZToLatLongHeight(osg::EllipsoidModel* em, osg::Vec3d& v)
{
em->convertXYZToLatLongHeight(v.x(), v.y(), v.z(),
v.y(), v.x(), v.z());
v.x() = osg::RadiansToDegrees(v.x());
v.y() = osg::RadiansToDegrees(v.y());
}
void initBound()
{
_min.set(DBL_MAX, DBL_MAX);
_max.set(-DBL_MAX, -DBL_MAX);
}
void updateBound(osg::Vec3d& v)
{
if (v.x() < _min.x()) _min.x() = v.x();
if (v.y() < _min.y()) _min.y() = v.y();
if (v.x() > _max.x()) _max.x() = v.x();
if (v.y() > _max.y()) _max.y() = v.y();
}
void updateBound(osg::Vec3Array& vertices)
{
// set up matrix
osg::Matrix matrix;
if (!_matrixStack.empty()) matrix = _matrixStack.back();
// set up ellipsoid model
osg::EllipsoidModel* em = !_csnStack.empty() ? _csnStack.back()->getEllipsoidModel() : 0;
for(osg::Vec3Array::iterator itr = vertices.begin();
itr != vertices.end();
++itr)
{
osg::Vec3d v = osg::Vec3d(*itr) * matrix;
if (em) convertXYZToLatLongHeight(em, v);
updateBound(v);
}
}
bool intersects()
{
osg::notify(osg::INFO)<<"intersects() _min = "<<_min<<" _max = "<<_max<<std::endl;
for(ExtentsList::iterator itr = _extentsList.begin();
itr != _extentsList.end();
++itr)
{
if (itr->intersects(_currentLevel, _min, _max)) return true;
}
return false;
}
typedef std::vector<Extents> ExtentsList;
typedef std::vector<osg::Matrix> MatrixStack;
typedef std::vector<osg::CoordinateSystemNode*> CSNStack;
osg::ref_ptr<osgDB::FileCache> _fileCache;
ExtentsList _extentsList;
unsigned int _currentLevel;
MatrixStack _matrixStack;
CSNStack _csnStack;
osg::Vec2d _min;
osg::Vec2d _max;
};
static void signalHandler(int sig)
{
printf("\nCaught signal %d, requesting exit...\n\n",sig);
s_ExitApplication = true;
}
int main( int argc, char **argv )
{
#ifndef _WIN32
signal(SIGHUP, signalHandler);
signal(SIGQUIT, signalHandler);
signal(SIGKILL, signalHandler);
signal(SIGUSR1, signalHandler);
signal(SIGUSR2, signalHandler);
#endif
signal(SIGABRT, signalHandler);
signal(SIGINT, signalHandler);
signal(SIGTERM, signalHandler);
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
// set up the usage document, in case we need to print out how to use this program.
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is an application for collecting a set of seperate files into a single archive file that can be later read in OSG applications..");
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
arguments.getApplicationUsage()->addCommandLineOption("-l level","Read down to level across the whole database.");
arguments.getApplicationUsage()->addCommandLineOption("-e level minX minY maxX maxY","Read down to <level> across the extents minX, minY to maxY, maxY. Note, for geocentric datase X and Y are longitude and latitude respectively.");
arguments.getApplicationUsage()->addCommandLineOption("-c directory","Shorthand for --file-cache directory.");
arguments.getApplicationUsage()->addCommandLineOption("--file-cache directory","Set directory as to place cache download files.");
// if user request help write it out to cout.
if (arguments.read("-h") || arguments.read("--help"))
{
arguments.getApplicationUsage()->write(std::cout);
return 1;
}
LoadDataVisitor ldv;
std::string fileCachePath;
while(arguments.read("--file-cache",fileCachePath) || arguments.read("-c",fileCachePath)) {}
if (fileCachePath.empty())
{
const char* env_fileCachePath = getenv("OSG_FILE_CACHE");
if (env_fileCachePath)
{
fileCachePath = env_fileCachePath;
}
}
if (fileCachePath.empty())
{
std::cout<<"No path to the file cache defined, please set OSG_FILE_PATH env var, or use --file-cache <directory> to set a suitable directory for the file cache."<<std::endl;
return 1;
}
ldv.setFileCache(new osgDB::FileCache(fileCachePath));
unsigned int maxLevels = 0;
while(arguments.read("-l",maxLevels))
{
ldv.addExtents(maxLevels);
}
double minX, maxX, minY, maxY;
while(arguments.read("-e",maxLevels, minX, minY, maxX, maxY))
{
ldv.addExtents(maxLevels, minX, minY, maxX, maxY);
}
std::string filename;
for(int i=1; i<arguments.argc(); ++i)
{
if (!arguments.isOption(i))
{
filename = arguments[i];
break;
}
}
if (filename.empty())
{
std::cout<<"No file to load specified."<<std::endl;
return 1;
}
osg::ref_ptr<osg::Node> loadedModel = ldv.readNodeFileAndWriteToCache(filename);
if (!loadedModel)
{
std::cout<<"No data loaded, please specify a database to load"<<std::endl;
return 1;
}
loadedModel->accept(ldv);
if (s_ExitApplication)
{
std::cout<<"osgfilecache cleanly exited in response to signal."<<std::endl;
}
return 0;
}

View File

@@ -1,8 +1,14 @@
SET(TARGET_SRC osgversion.cpp )
IF (OSG_MAINTAINER)
SET(TARGET_SRC ${TARGET_SRC} Contributors.cpp )
ADD_DEFINITIONS("-DBUILD_CONTRIBUTORS")
ENDIF(OSG_MAINTAINER)
SET(TARGET_COMMON_LIBRARIES
OpenThreads
osg
osgDB
)
SETUP_COMMANDLINE_APPLICATION(osgversion)

View File

@@ -0,0 +1,838 @@
// The majority of the application is dedicated to building the
// current contribitors list by parsing the ChangeLog, it just takes
// one line in the main itself to report the version number.
#include <set>
#include <vector>
#include <iostream>
#include <OpenThreads/Version>
#include <osg/Notify>
#include <osg/Version>
#include <osg/ArgumentParser>
#include <osg/ApplicationUsage>
#include <osg/Matrix>
#include <osg/Plane>
#include <osg/BoundingBox>
#include <osg/BoundingSphere>
#include <osgDB/fstream>
using namespace std;
#if defined(_MSC_VER)
#pragma setlocale("C")
#endif
typedef pair<string, string> NamePair;
typedef map<NamePair, unsigned int> NameMap;
typedef vector<string> Words;
NamePair EmptyNamePair;
NamePair NameRobertOsfield("Robert", "Osfield");
NamePair NameDonBurns ("Don", "Burns");
const char* validNames[] =
{
"de",
"den",
"van"
};
const char* invalidNames[] =
{
"Added",
"AnimationPath",
"AnimationPathCallback",
"AnimationPathManipulator",
"ArgumentParser",
"AttrData",
"AutoTransform",
"AutoTransform.",
"Azimuth",
"BlenColour(Vec4",
"Camera",
"CameraBarrierCallback",
"CameraNode",
"Canvas",
"CluserCullingCallback",
"ClusterCullingCallback",
"CoordinateSystem",
"CoordinateSystemNode",
"CoordinateSystemNode&",
"CopyOp",
"Copyright",
"Core",
"Creator",
"CullCallbacks",
"CullingSettngs",
"CullVisitor",
"CullVistor",
"Cygwin",
"DatabasePager",
"DataSet",
"DataVariance",
"DeleteHandler",
"DisplaySettings",
"Drawable",
"DrawElementsUByte",
"Endian",
"Escape",
"EventQueue",
"Face",
"Files",
"Fixed",
"Fixes",
"FluidProgram",
"FontImplementation",
"FrameStats",
"Framstamp",
"FreeBSD",
"Geode",
"GeoemtryTechnique",
"GeometryTechnique",
"GeoSet",
"GraphicsContext",
"GraphicsContextImplementation",
"GraphicsThread",
"GraphicsWindowX11",
"Group",
"Image",
"ImageOptions",
"Images",
"Images/SolarSystem",
"ImageStream",
"Improved",
"IndexBlock",
"IndexFaceSets",
"IntersectVisitor",
"Inventor",
"KdTree",
"KeyboardMouse",
"KeyboardMouseCallback",
"LightModel",
"LightPointNode",
"LineSegment",
"LineStipple",
"Logos",
"LongIDRecord",
"Make",
"Makefile",
"Material",
"Matrix",
"Matrix*",
"MatrixManipulator",
"MatrixTransform",
"MemoryManager",
"MergeGeometryVisitor",
"MeshRecord",
"Mode",
"Mr",
"Multigen",
"New",
"NewCullVisitor",
"NodeVisitor",
"Object",
"OpenDX",
"OpenSceneGraph",
"OpenSceneGraph-2",
"OpenSceneGraph-osgWidget-dev",
"OpenThreads",
"OperationThread",
"Optimizer",
"OrientationConverter",
"Osfields",
"Ouput",
"Output",
"OveralyNode",
"PagedLOD",
"PageLOD",
"Paging",
"ParentList",
"Performer",
"PickHandler",
"PixelDataBufferObject",
"PolygonStipple",
"PolytopeVisitor",
"PrimitiveIndexFunctor",
"Prodcuer",
"Producer",
"ProducerEventCallback",
"Program",
"Proxy",
"ProxyNode",
"Quake3",
"Quicktime",
"ReaderWriters",
"ReentrantMutex",
"Referenced",
"ReferenceFrame",
"Removed",
"RemoveLoadedProxyNodes",
"RenderStage",
"RenderTargetFallback",
"RenderToTextureStage",
"SceneGraphBuilder",
"SceneView",
"Sequence",
"Shape",
"SimpleViewer",
"SimpleViewer",
"SmokeTrailEffect",
"Source",
"SpotExponent",
"State",
"StateAttribute",
"Stats",
"StatsVisitor",
"Studio",
"Support",
"Switch",
"TechniqueEventHandler",
"TerraPage",
"TessellationHints",
"TestManipulator",
"TestSupportCallback",
"TexEnv",
"TexMat(Matrix",
"Texture",
"Texture2DArray",
"Texture3D",
"TextureCubeMap",
"TextureObjectManager",
"TextureRectangle",
"TextureRectangle(Image*",
"TextureType",
"Texuture",
"TriStripVisitor",
"TrPageViewer",
"Uniform",
"UseFarLineSegments",
"UserData",
"Valve",
"Vec*",
"Vec2d",
"Vec3d",
"Vec4ub",
"Version",
"VertexData",
"View",
"Viewer",
"ViewPoint",
"Viewport",
"Viewport",
"Visual",
"VisualStudio",
"WindowData",
"Windows",
"X",
"Xcode",
"Y"
};
struct TypoCorrection
{
const char* original;
const char* corrected;
};
TypoCorrection typoCorrections[] =
{
{"Aderian", "Adrian"},
{"Adndre", "Andre"},
{"Adrain", "Adrian"},
{"Amueller", "Aumueller"},
{"Andew", "Andrew"},
{"André", "Andr<EFBFBD>"},
{"Antione", "Antoine"},
{"Antonoine", "Antoine"},
{"Atr", "Art"},
{"Baverage", "Beverage"},
{"Bistroviae", "Bistrovic"},
{"Callue", "Callu"},
{"Christaiansen", "Christiansen"},
{"Cobin", "Corbin"},
{"Comporesi", "Camporesi"},
{"Connel", "Connell"},
{"Cullu", "Callu"},
{"Daneil", "Daniel"},
{"Daust", "Daoust"},
{"Daved", "David"},
{"Drederic", "Frederic"},
{"Eileman", "Eilemann"},
{"Elgi", "Egli"},
{"Fabian", "Fabien"},
{"Fautre", "Fautr<EFBFBD>"},
{"Frashid", "Farshid"},
{"Fred", "Frederic"},
{"Fredrick", "Frederic"},
{"Fredric", "Frederic"},
{"Froechlich", "Fr<EFBFBD>hlich"},
{"Froehilch", "Fr<EFBFBD>hlich"},
{"Froehlich", "Fr<EFBFBD>hlich"},
{"Froelich", "Fr<EFBFBD>hlich"},
{"Froenlich", "Fr<EFBFBD>hlich"},
{"Fröhlich", "Fr<EFBFBD>hlich"},
{"Fruciel", "Frauciel"},
{"García", "Garcea"},
{"Garrat", "Garrett"},
{"Garret", "Garrett"},
{"Geof", "Geoff"},
{"Giatan", "Gaitan"},
{"Gronenger", "Gronager"},
{"Gronger", "Gronager"},
{"Haritchablaet", "Haritchabalet"},
{"Hebelin", "Herbelin"},
{"Heirtlein", "Hertlein"},
{"Heirtlein", "Hertlein"},
{"Hertleinm", "Hertlein"},
{"Hertlien", "Hertlein"},
{"Hi", "He"},
{"Hooper", "Hopper"},
{"Inverson", "Iverson"},
{"Iversion", "Iverson"},
{"Jean-Sebastein", "Jean-Sebastien"},
{"Jean-Sebastian", "Jean-Sebastien"},
{"Jean-Sebastirn", "Jean-Sebastien"},
{"Jea-Sebastien", "Jean-Sebastien"},
{"Johhansen", "Johansen"},
{"Johnansen", "Johansen"},
{"Johnasen", "Johansen"},
{"Jolly", "Jolley"},
{"Jose", "Jos<EFBFBD>"},
{"José", "Jos<EFBFBD>"},
{"Joson", "Jason"},
{"J", "Jos<EFBFBD>"},
{"Keuhne", "Kuehne"},
{"Kheune", "Kuehne"},
{"Lagrade", "Lagarde"},
{"Largade", "Lagarde"},
{"Larshkari", "Lashkari"},
{"Lashakari", "Lashkari"},
{"Lashari", "Lashkari"},
{"Lasharki", "Lashkari"},
{"Laskari", "Lashkari"},
{"Leandowski", "Lewandowski"},
{"Lawandowski", "Lewandowski"},
{"Lucas", "Luaces"},
{"Lugi", "Luigi"},
{"Lweandowski", "Lewandowski"},
{"Maceij", "Maciej"},
{"Machler", "M<EFBFBD>chler"},
{"Macro", "Marco"},
{"Maechler", "M<EFBFBD>chler"},
{"Mahai", "Mihai"},
{"Mammond", "Marmond"},
{"March", "Marco"},
{"Martsz", "Martz"},
{"Marz", "Martz"},
{"Matz", "Martz"},
{"Melchoir", "Melchior"},
{"Mellis", "Melis"},
{"Messerschimdt", "Messerschmidt"},
{"Micheal", "Michael"},
{"Mihair", "Mihai"},
{"Molishtan", "Moloshtan"},
{"Molishtan", "Moloshtan"},
{"Moloshton", "Moloshtan"},
{"Morné", "Morn<EFBFBD>"},
{"Morne", "Morn<EFBFBD>"},
{"Moule", "Moiule"},
{"Narache", "Marache"},
{"Nicklov", "Nikolov"},
{"Nickolov", "Nikolov"},
{"Olad", "Olaf"},
{"Olar", "Olaf"},
{"Oritz", "Ortiz"},
{"Osfeld", "Osfield"},
{"Osfied", "Osfield"},
{"Pail", "Paul"},
{"Rajce", "Trajce"},
{"Randal", "Randall"},
{"Robet", "Robert"},
{"Rodger", "Roger"},
{"Rolad", "Roland"},
{"Rucard", "Richard"},
{"Sekender", "Sukender"},
{"Sewel", "Sewell"},
{"Simmonson", "Simonsson"},
{"Simmonsson", "Simonsson"},
{"Sjolie", "Sj<EFBFBD>lie"},
{"Sjölie", "Sj<EFBFBD>lie"},
{"Skinnder", "Skinner"},
{"Sokolosky", "Sokolowsky"},
{"Sokolowky", "Sokolowsky"},
{"Sokolowki", "Sokolowsky"},
{"Sokolowski", "Sokolowsky"},
{"Sokolsky", "Sokolowsky"},
{"Sokolwsky", "Sokolowsky"},
{"Sonda", "Sondra"},
{"Stansilav", "Stanislav"},
{"Stefan", "Stephan"},
{"Stell", "Steel"},
{"Sylvan", "Sylvain"},
{"Takeahei", "Takahei"},
{"Takehei", "Takahei"},
{"Tery", "Terry"},
{"Tarantilils", "Tarantilis"},
{"Trastenjak", "Trstenjak"},
{"Urlich", "Ulrich"},
{"Vines", "Vine"},
{"Waldrom", "Waldron"},
{"Wedner", "Weidner"},
{"Weidemann", "Wiedemann"},
{"Wieblen", "Weiblen"},
{"Woesnner", "Woessner"},
{"Wojchiech", "Wojciech"},
{"Wojiech", "Wojciech"},
{"Xennon", "Hanson"},
{"Yefrei", "Yefei"},
{"Yfei", "Yefei"}
};
struct NameCorrection
{
const char* originalFirst;
const char* originalSecond;
const char* correctedFirst;
const char* correctedSecond;
};
NameCorrection nameCorrections[] =
{
{"Marc", "Sciabica",
"Mark", "Sciabica"},
{"Jean", "Sebastien",
"Jean-Sebastien", "Guay"},
{"Michale", "Platings",
"Michael", "Platings"},
{"Mick", "",
"Maik", "Keller"},
{"Gary", "Quin",
"Gary", "Quinn"},
{"BjornHein", "",
"Bj<EFBFBD>rn", "Hein"},
{"Bjorn", "Hein",
"Bj<EFBFBD>rn", "Hein"},
{"Erik", "van",
"Erik", "den Dekker"},
{"Erik", "den",
"Erik", "den Dekker"},
{"Jeoen", "den",
"Jeroen", "den Dekker"},
{"John", "Vidar",
"John", "Vidar Larring"},
{"John", "Vida",
"John", "Vidar Larring"},
{"Sebastien", "Messerschmidt",
"Sebastian", "Messerschmidt"},
{"Mattias", "Fr<EFBFBD>hlich",
"Mathias", "Fr<EFBFBD>hlich"},
{"Mathias", "Helsing",
"Mattias", "Helsing"},
{"Jose", "Delport",
"J.P.", "Delport"},
{"Jos<EFBFBD>", "Delport",
"J.P.", "Delport"},
{"Franz", "Melchior",
"Melchior", "Franz"},
{"Glen", "Waldon",
"Glenn", "Waldron"},
{"Ralf", "Karn",
"Ralf", "Kern"},
{"Donny", "Cipperly",
"Donald", "Cipperly"},
{"Gino", "van",
"Gino", "van den Bergen"},
{"Radu", "Mihai",
"Mihai", "Radu"},
{"Art", "Trevs",
"Art", "Tevs"},
{"Tim", "More",
"Tim", "Moore"},
{"Andre", "Garneau",
"Andr<EFBFBD>", "Garneau"},
{"Eric", "Hammil",
"Chris", "Hanson"},
{"Paul", "de",
"Paul", "de Repentigny"},
{"Raymond", "de",
"Raymond", "de Vries"},
{"Nick", "",
"Trajce", "Nikolov"},
{"Daniel", "",
"Daniel", "Sj<EFBFBD>lie"},
{"Julia", "Ortiz",
"Julian", "Ortiz"},
{"Rune", "Schmidt",
"Rune", "Schmidt Jensen"},
{"Romano", "Jos<EFBFBD>",
"Romano", "Jos<EFBFBD> Magacho da Silva"},
{"Rommano", "Silva",
"Romano", "Jos<EFBFBD> Magacho da Silva"},
{"Leandro", "Motta",
"Leandro", "Motta Barros"},
{"A", "Botorabi",
"Ali", "Botorabi"},
{"Waltice", "",
"Walter", "J. Altice"},
{"Drew", "",
"Drew", "Whitehouse"},
{"Douglas", "A",
"Douglas", "A. Pouk"},
{"Colin", "MacDonald",
"Colin", "McDonald"},
{"Nikolov", "Trajce",
"Trajce", "Nikolov"},
{"Frauciel", "Luc",
"Luc", "Frauciel"},
};
bool validName(const string& first)
{
// Check for valid names
for (unsigned int i = 0; i < sizeof(validNames) / sizeof(char*); ++i)
{
if (first == validNames[i])
{
return true;
}
}
if (first.empty()) return false;
if (first[0] < 'A' || first[0] > 'Z') return false;
if (first.size() >= 2 && (first[1] < 'a' || first[1] > 'z') && (first[1] != '.') && (first[1] != ',')) return false;
// Check for invalid names
for (unsigned int i = 0; i < sizeof(invalidNames) / sizeof(char*); ++i)
{
if (first == invalidNames[i])
{
return false;
}
}
// Default to a valid name
return true;
}
string typoCorrection(const string& name)
{
// Loop over all known typo corrections
for (unsigned int i = 0; i < sizeof(typoCorrections) / sizeof(TypoCorrection); ++i)
{
// If a typo is found
if (name == typoCorrections[i].original)
{
// Return the correction
return typoCorrections[i].corrected;
}
}
return name;
}
void nameCorrection(NamePair& name)
{
// Loop over all known name corrections
for (unsigned int i = 0; i < sizeof(nameCorrections) / sizeof(NameCorrection); ++i)
{
// If a matching name is found
if (name.first == nameCorrections[i].originalFirst &&
name.second == nameCorrections[i].originalSecond)
{
// Return the correction
name.first = nameCorrections[i].correctedFirst;
name.second = nameCorrections[i].correctedSecond;
// Early out, since we don't want corrections of corrections
return;
}
}
}
void lastValidCharacter(const string& name, unsigned int& pos, char c)
{
for (unsigned int i = 0; i < pos; ++i)
{
if (name[i] == c)
{
pos = i;
return;
}
}
}
void lastValidCharacter(const string& name, unsigned int& last)
{
lastValidCharacter(name, last, '.');
lastValidCharacter(name, last, ',');
lastValidCharacter(name, last, '\'');
lastValidCharacter(name, last, '/');
lastValidCharacter(name, last, '\\');
lastValidCharacter(name, last, ':');
lastValidCharacter(name, last, ';');
lastValidCharacter(name, last, ')');
}
NamePair createName(const string& first, const string& second)
{
if (first.empty()) return EmptyNamePair;
// cout << "first = " << first << " second = " << second << endl;
unsigned int last = first.size();
lastValidCharacter(first, last);
if (last == 0) return EmptyNamePair;
string name;
name.append(first.begin(), first.begin() + last);
if (!validName(name)) return EmptyNamePair;
name = typoCorrection(name);
if (second.empty() ||
!validName(second))
{
// filter any single or two letter words as unlike to be names.
if (name.size() <= 2) return EmptyNamePair;
return NamePair(name, "");
}
last = second.size();
lastValidCharacter(second, last);
if (last > 0)
{
string surname(second.begin(), second.begin() + last);
if (validName(surname))
{
surname = typoCorrection(surname);
return NamePair(name, surname);
}
}
// filter any single or two letter words as unlike to be names.
if (name.size() <= 2) return EmptyNamePair;
return NamePair(name, "");
}
bool submissionsSequence(const Words& words, unsigned int& i)
{
if (i + 1 >= words.size()) return false;
if (words[i] == "From" ||
words[i] == "from" ||
words[i] == "From:" ||
words[i] == "from:" ||
words[i] == "Merged" ||
words[i] == "Integrated") return true;
if (i + 2 >= words.size()) return false;
if (words[i] == "submitted" && words[i + 1] == "by")
{
i += 1;
return true;
}
if (words[i] == "Folded" && words[i + 1] == "in")
{
i += 1;
return true;
}
if (words[i] == "Rolled" && words[i + 1] == "in")
{
i += 1;
return true;
}
if (words[i] == "Checked" && words[i + 1] == "in")
{
i += 1;
return true;
}
if (i + 3 >= words.size()) return false;
if (words[i] == "sent" && words[i + 1] == "in" && words[i + 2] == "by")
{
i += 2;
return true;
}
return false;
}
void readContributors(NameMap& names, const string& file)
{
osgDB::ifstream fin(file.c_str());
Words words;
while(fin)
{
string keyword;
fin >> keyword;
words.push_back(keyword);
}
string blank_string;
for(unsigned int i = 0; i < words.size(); ++i)
{
if (submissionsSequence(words, i))
{
if (i + 2 < words.size() && validName(words[i + 1]))
{
NamePair name = createName(words[i + 1], words[i + 2]);
nameCorrection(name);
if (!name.first.empty()) ++names[name];
i += 2;
}
else if (i + 1 < words.size() && validName(words[i + 1]))
{
NamePair name = createName(words[i + 1], blank_string);
nameCorrection(name);
if (!name.first.empty()) ++names[name];
i += 1;
}
}
else
{
if (words[i] == "robert")
{
++names[NameRobertOsfield];
}
else if (words[i] == "don")
{
++names[NameDonBurns];
}
}
}
// reassign fisrt name entries to their full names entries
if (names.size() > 1)
{
for (NameMap::iterator itr = names.begin(); itr != names.end(); )
{
if (itr->first.second.empty())
{
NameMap::iterator next_itr = itr;
++next_itr;
if (next_itr != names.end() && itr->first.first == next_itr->first.first)
{
next_itr->second += itr->second;
names.erase(itr);
itr = next_itr;
}
else
{
++itr;
}
}
else
{
++itr;
}
}
}
// remove the double entries from Robert's contributions
if (names.size() > 1)
{
for (NameMap::iterator itr = names.begin(); itr != names.end(); ++itr)
{
if (itr->first != NameRobertOsfield && itr->first != NameDonBurns)
{
names[NameRobertOsfield] -= itr->second;
}
}
}
}
void buildContributors(NameMap& names)
{
// top five contributors
++names[NamePair("Robert", "Osfield")];
++names[NamePair("Don", "Burns")];
++names[NamePair("Marco", "Jez")];
++names[NamePair("Mike", "Weiblen")];
++names[NamePair("Geoff", "Michel")];
++names[NamePair("Ben", "van Basten")];
// contributors that don't appear in the ChangeLog due to their contributions
// being before CVS started for the OSG, or before the name logging began.
++names[NamePair("Karsten", "Weiss")];
++names[NamePair("Graeme", "Harkness")];
++names[NamePair("Axel", "Volley")];
++names[NamePair("Nikolaus", "Hanekamp")];
++names[NamePair("Kristopher", "Bixler")];
++names[NamePair("Tanguy", "Fautr<EFBFBD>")];
++names[NamePair("J.E.", "Hoffmann")];
}
void printContributors(const std::string& changeLog, bool printNumEntries)
{
NameMap names;
buildContributors(names);
if (!changeLog.empty())
{
readContributors(names, changeLog);
}
typedef multimap<unsigned int, NamePair> SortedNameMap;
SortedNameMap sortedNames;
for (NameMap::iterator itr = names.begin(); itr != names.end(); ++itr)
{
sortedNames.insert(SortedNameMap::value_type(itr->second, itr->first));
}
cout << names.size() << " Contributors:" << endl << endl;
if (printNumEntries)
{
cout << "Entries Firstname Surname" << endl;
cout << "-------------------------" << endl;
for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr)
{
cout << sitr->first << "\t" << sitr->second.first << " " << sitr->second.second << endl;
}
}
else
{
cout << "Firstname Surname" << endl;
cout << "-----------------" << endl;
for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr)
{
cout << sitr->second.first << " " << sitr->second.second << endl;
}
}
}

View File

@@ -1,3 +1,14 @@
// The majority of the application is dedicated to building the
// current contribitors list by parsing the ChangeLog, it just takes
// one line in the main itself to report the version number.
#include <set>
#include <vector>
#include <iostream>
#include <OpenThreads/Version>
#include <osg/Notify>
#include <osg/Version>
#include <osg/ArgumentParser>
#include <osg/ApplicationUsage>
@@ -7,890 +18,137 @@
#include <osg/BoundingBox>
#include <osg/BoundingSphere>
#include <OpenThreads/Version>
#include <set>
#include <vector>
#include <iostream>
#include <fstream>
// the majority of the application is dedicated to building the
// current contribitors list by parsing the ChangeLog, it just takes
// one line in the main itself to report the version number.
#if defined(_MSC_VER)
#pragma setlocale("C")
#ifdef BUILD_CONTRIBUTORS
extern void printContributors(const std::string& changeLog, bool printNumEntries);
#endif
typedef std::pair<std::string, std::string> NamePair;
typedef std::map<NamePair,unsigned int> NameMap;
typedef std::vector< std::string > Words;
using namespace std;
NamePair EmptyNamePair;
NamePair NameRobertOsfield("Robert","Osfield");
NamePair NameDonBurns("Don","Burns");
bool validName(const std::string& first)
int main( int argc, char** argv)
{
if (first=="de") return true;
osg::ArgumentParser arguments(&argc, argv);
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName() + " [options]");
arguments.getApplicationUsage()->addCommandLineOption("-h or --help", "Display this information");
arguments.getApplicationUsage()->addCommandLineOption("--version-number", "Print out version number only");
arguments.getApplicationUsage()->addCommandLineOption("--major-number", "Print out major version number only");
arguments.getApplicationUsage()->addCommandLineOption("--minor-number", "Print out minor version number only");
arguments.getApplicationUsage()->addCommandLineOption("--patch-number", "Print out patch version number only");
arguments.getApplicationUsage()->addCommandLineOption("--so-number ", "Print out shared object version number only");
arguments.getApplicationUsage()->addCommandLineOption("--openthreads-version-number", "Print out version number for OpenThreads only");
arguments.getApplicationUsage()->addCommandLineOption("--openthreads-soversion-number", "Print out shared object version number for OpenThreads only");
arguments.getApplicationUsage()->addCommandLineOption("Matrix::value_type", "Print the value of Matrix::value_type");
arguments.getApplicationUsage()->addCommandLineOption("Plane::value_type", "Print the value of Plane::value_type");
arguments.getApplicationUsage()->addCommandLineOption("BoundingSphere::value_type", "Print the value of BoundingSphere::value_type");
arguments.getApplicationUsage()->addCommandLineOption("BoundingBox::value_type", "Print the value of BoundingBox::value_type");
if (first.empty()) return false;
if (first[0]<'A' || first[0]>'Z') return false;
if (first.size()>=2 && (first[1]<'a' || first[1]>'z') && (first[1]!='.') && (first[1]!=',')) return false;
if (first=="Xcode") return false;
if (first=="Added") return false;
if (first=="Camera") return false;
if (first=="CameraNode") return false;
if (first=="CopyOp") return false;
if (first=="Fixed") return false;
if (first=="View") return false;
if (first=="GraphicsContext") return false;
if (first=="WindowData") return false;
if (first=="ViewPoint") return false;
if (first=="PickHandler") return false;
if (first=="Program") return false;
if (first=="Object") return false;
if (first=="OpenSceneGraph") return false;
if (first=="SpotExponent") return false;
if (first=="Framstamp") return false;
if (first=="Stats") return false;
if (first=="Group") return false;
if (first=="Texture") return false;
if (first=="Texture2DArray") return false;
if (first=="Creator") return false;
if (first=="CullVisitor") return false;
if (first=="Drawable") return false;
if (first=="Geode") return false;
if (first=="GeoSet") return false;
if (first=="Image") return false;
if (first=="Face") return false;
if (first=="Images/SolarSystem") return false;
if (first=="IntersectVisitor") return false;
if (first=="LongIDRecord") return false;
if (first=="Makefile") return false;
if (first=="Matrix") return false;
if (first=="MemoryManager") return false;
if (first=="MeshRecord") return false;
if (first=="Multigen") return false;
if (first=="NewCullVisitor") return false;
if (first=="Output") return false;
if (first=="PageLOD") return false;
if (first=="Improved") return false;
if (first=="PagedLOD") return false;
if (first=="Referenced") return false;
if (first=="StateAttribute") return false;
if (first=="Switch") return false;
if (first=="TechniqueEventHandler") return false;
if (first=="Uniform") return false;
if (first=="Vec*") return false;
if (first=="Viewer") return false;
if (first=="VisualStudio") return false;
if (first=="X") return false;
if (first=="Y") return false;
if (first=="Producer") return false;
if (first=="New") return false;
if (first=="Removed") return false;
if (first=="Ouput") return false;
if (first=="ReaderWriters") return false;
if (first=="NodeVisitor") return false;
if (first=="Fixes") return false;
if (first=="FontImplementation") return false;
if (first=="DisplaySettings") return false;
if (first=="AnimationPath") return false;
if (first=="AnimationPathCallback") return false;
if (first=="AnimationPathManipulator") return false;
if (first=="ArgumentParser") return false;
if (first=="AttrData") return false;
if (first=="Azimuth") return false;
if (first=="CluserCullingCallback") return false;
if (first=="ClusterCullingCallback") return false;
if (first=="CoordinateSystem") return false;
if (first=="CoordinateSystemNode") return false;
if (first=="CoordinateSystemNode&") return false;
if (first=="Copyright") return false;
if (first=="Cygwin") return false;
if (first=="CullCallbacks") return false;
if (first=="CullingSettngs") return false;
if (first=="DataVariance") return false;
if (first=="DatabasePager") return false;
if (first=="DrawElementsUByte") return false;
if (first=="Escape") return false;
if (first=="FluidProgram") return false;
if (first=="FrameStats") return false;
if (first=="FreeBSD") return false;
if (first=="GraphicsContextImplementation") return false;
if (first=="GraphicsThread") return false;
if (first=="Images") return false;
if (first=="IndexBlock") return false;
if (first=="Inventor") return false;
if (first=="Make") return false;
if (first=="Material") return false;
if (first=="MergeGeometryVisitor") return false;
if (first=="Mode") return false;
if (first=="Prodcuer") return false;
if (first=="ProxyNode") return false;
if (first=="ReentrantMutex") return false;
if (first=="ReferenceFrame") return false;
if (first=="RemoveLoadedProxyNodes") return false;
if (first=="RenderTargetFallback") return false;
if (first=="RenderToTextureStage") return false;
if (first=="Sequence") return false;
if (first=="Shape") return false;
if (first=="TessellationHints") return false;
if (first=="Support") return false;
if (first=="State") return false;
if (first=="SmokeTrailEffect") return false;
if (first=="TexEnv") return false;
if (first=="Texture3D") return false;
if (first=="TextureCubeMap") return false;
if (first=="TextureObjectManager") return false;
if (first=="TextureRectangle(Image*") return false;
if (first=="TextureType") return false;
if (first=="Texuture") return false;
if (first=="TriStripVisitor") return false;
if (first=="UserData") return false;
if (first=="Viewport") return false;
if (first=="Visual") return false;
if (first=="Studio") return false;
if (first=="Vec2d") return false;
if (first=="Vec3d") return false;
if (first=="Windows") return false;
if (first=="Version") return false;
if (first=="Viewport") return false;
if (first=="Core") return false;
if (first=="DataSet") return false;
if (first=="Endian") return false;
if (first=="ImageOptions") return false;
if (first=="ImageStream") return false;
if (first=="KeyboardMouse") return false;
if (first=="KeyboardMouseCallback") return false;
if (first=="AutoTransform") return false;
if (first=="AutoTransform.") return false;
if (first=="LightModel") return false;
if (first=="MatrixManipulator") return false;
if (first=="MatrixTransform") return false;
if (first=="OpenDX") return false;
if (first=="ParentList") return false;
if (first=="TerraPage") return false;
if (first=="OveralyNode") return false;
if (first=="OpenThreads") return false;
if (first=="PolygonStipple") return false;
if (first=="SceneView") return false;
if (first=="PrimitiveIndexFunctor") return false;
if (first=="PolytopeVisitor") return false;
if (first=="Performer") return false;
if (first=="Paging") return false;
if (first=="CameraBarrierCallback") return false;
if (first=="TestSupportCallback") return false;
if (first=="Quake3") return false;
if (first=="BlenColour(Vec4") return false;
if (first=="UseFarLineSegments") return false;
if (first=="TextureRectangle") return false;
if (first=="DeleteHandler") return false;
if (first=="EventQueue") return false;
if (first=="TrPageViewer") return false;
if (first=="TestManipulator") return false;
if (first=="ProducerEventCallback") return false;
if (first=="OrientationConverter") return false;
if (first=="Logos") return false;
if (first=="StatsVisitor") return false;
if (first=="LineStipple") return false;
if (first=="Files") return false;
if (first=="Mr") return false;
if (first=="Osfields") return false;
if (first=="Optimizer") return false;
if (first=="RenderStage") return false;
if (first=="Matrix*") return false;
if (first=="Vec4ub") return false;
if (first=="Proxy") return false;
if (first=="CullVistor") return false;
if (first=="SimpleViewer") return false;
if (first=="TexMat(Matrix") return false;
if (first=="GraphicsWindowX11") return false;
if (first=="OperationThread") return false;
if (first=="SimpleViewer") return false;
if (first=="IndexFaceSets") return false;
if (first=="Quicktime") return false;
if (first=="SceneGraphBuilder") return false;
if (first=="LightPointNode") return false;
if (first=="GeometryTechnique") return false;
if (first=="GeoemtryTechnique") return false;
return true;
}
std::string typoCorrection(const std::string& name)
{
#if 0
if (name=="") return "";
if (name=="") return "";
if (name=="") return "";
if (name=="") return "";
#ifdef BUILD_CONTRIBUTORS
arguments.getApplicationUsage()->addCommandLineOption("-r <file> or --read <file>", "Read the ChangeLog to generate an estimated contributors list.");
arguments.getApplicationUsage()->addCommandLineOption("--entries", "Print out number of entries into the ChangeLog file for each contributor.");
#endif
if (name=="Martsz") return "Martz";
if (name=="Matz") return "Martz";
if (name=="Froenlich") return "Fr<EFBFBD>hlich";
if (name=="Froechlich") return "Fr<EFBFBD>hlich";
if (name=="Froelich") return "Fr<EFBFBD>hlich";
if (name=="Fruciel") return "Frauciel";
if (name=="Hebelin") return "Herbelin";
if (name=="Jea-Sebastien") return "Jean-Sebastien";
if (name=="Robet") return "Robert";
if (name=="Morné") return "Morn<EFBFBD>";
if (name=="Adndre") return "Andre";
if (name=="Mellis") return "Melis";
if (name=="Rajce") return "Trajce";
if (name=="Trastenjak") return "Trstenjak";
if (name=="Baverage") return "Beverage";
if (name=="Bistroviae") return "Bistrovic";
if (name=="Christaiansen") return "Christiansen";
if (name=="Cobin") return "Corbin";
if (name=="Connel") return "Connell";
if (name=="Daust") return "Daoust";
if (name=="Lugi") return "Luigi";
if (name=="Daved") return "David";
if (name=="Fred") return "Frederic";
if (name=="Drederic") return "Frederic";
if (name=="Fredrick") return "Frederic";
if (name=="Fredric") return "Frederic";
if (name=="Garrat") return "Garret";
if (name=="Geof") return "Geoff";
if (name=="Gronenger") return "Gronager";
if (name=="Gronger") return "Gronager";
if (name=="Heirtlein") return "Hertlein";
if (name=="Heirtlein") return "Hertlein";
if (name=="Heirtlein") return "Hertlein";
if (name=="Hertlien") return "Hertlein";
if (name=="Narache") return "Marache";
if (name=="Hi") return "He";
if (name=="Hooper") return "Hopper";
if (name=="Inverson") return "Iverson";
if (name=="Iversion") return "Iverson";
if (name=="Jeoen") return "Joran";
if (name=="Johhansen") return "Johansen";
if (name=="Johnansen") return "Johansen";
if (name=="Johnasen") return "Johansen";
if (name=="Jolly") return "Jolley";
if (name=="Jose") return "Jos<EFBFBD>";
if (name=="Joson") return "Jason";
if (name=="J") return "Jos<EFBFBD>";
if (name=="Keuhne") return "Kuehne";
if (name=="Kheune") return "Kuehne";
if (name=="Lashakari") return "Lashkari";
if (name=="Lashari") return "Lashkari";
if (name=="Lasharki") return "Lashkari";
if (name=="Laskari") return "Lashkari";
if (name=="Macro") return "Marco";
if (name=="Mammond") return "Marmond";
if (name=="March") return "Marco";
if (name=="Marz") return "Martz";
if (name=="Micheal") return "Michael";
if (name=="Molishtan") return "Moloshtan";
if (name=="Molishtan") return "Moloshtan";
if (name=="Moloshton") return "Moloshtan";
if (name=="Moule") return "Moiule";
if (name=="Nicklov") return "Nikolov";
if (name=="Nickolov") return "Nikolov";
if (name=="Olad") return "Olaf";
if (name=="Olar") return "Olaf";
if (name=="Oritz") return "Ortiz";
if (name=="Osfied") return "Osfield";
if (name=="Pail") return "Paul";
if (name=="Randal") return "Randall";
if (name=="Rodger") return "Roger";
if (name=="Sewel") return "Sewell";
if (name=="Sjolie") return "Sj<EFBFBD>lie";
if (name=="Sokolosky") return "Sokolowsky";
if (name=="Sokolowski") return "Sokolowsky";
if (name=="Sokolsky") return "Sokolowsky";
if (name=="Sonda") return "Sondra";
if (name=="Stansilav") return "Stanislav";
if (name=="Stefan") return "Stephan";
if (name=="Stell") return "Steel";
if (name=="Takeahei") return "Takahei";
if (name=="Takehei") return "Takahei";
if (name=="Tarantilils") return "Tarantilis";
if (name=="Vines") return "Vine";
if (name=="Wieblen") return "Weiblen";
if (name=="Xennon") return "Hanson";
if (name=="Yefrei") return "Yefei";
if (name=="Yfei") return "Yefei";
if (name=="Antonoine") return "Antoine";
if (name=="Antione") return "Antoine";
if (name=="Andew") return "Andrew";
if (name=="Daneil") return "Daniel";
if (name=="André") return "Andr<EFBFBD>";
if (name=="García") return "Garcea";
if (name=="Sjölie") return "Sj<EFBFBD>lie";
if (name=="José") return "Jos<EFBFBD>";
if (name=="Fröhlich") return "Fr<EFBFBD>hlich";
if (name=="Froehlich") return "Fr<EFBFBD>hlich";
if (name=="Eileman") return "Eilemann";
if (name=="Skinnder") return "Skinner";
if (name=="Mihair") return "Mihai";
if (name=="Mahai") return "Mihai";
if (name=="Wojiech" || name=="Wojchiech") return "Wojciech";
if (name=="Leandowski" || name=="Lawandowski") return "Lewandowski";
if (name=="Aderian") return "Adrian";
if (name=="Callue") return "Callu";
if (name=="Waldrom") return "Waldron";
if (name=="Atr") return "Art";
if (name=="Sylvan") return "Sylvain";
if (name=="Giatan") return "Gaitan";
if (name=="Melchoir") return "Melchior";
if (name=="Simmonsson") return "Simonsson";
if (name=="Sokolwsky") return "Sokolowsky";
if (name=="Cullu") return "Callu";
if (name=="Comporesi") return "Camporesi";
if (name=="Machler") return "M<EFBFBD>chler";
if (name=="Maechler") return "M<EFBFBD>chler";
return name;
}
void nameCorrection(NamePair& name)
{
if ((name.first=="Jose" || name.first=="Jos<EFBFBD>") && name.second=="Delport")
// if user request help write it out to cout.
if (arguments.read("-h") || arguments.read("--help"))
{
name.first = "J.P.";
name.second = "Delport";
cout << arguments.getApplicationUsage()->getCommandLineUsage() << endl;
arguments.getApplicationUsage()->write(cout, arguments.getApplicationUsage()->getCommandLineOptions());
return 1;
}
if (name.first=="Franz" && name.second=="Melchior")
{
name.first = "Melchior";
name.second = "Franz";
}
if (name.first=="Glen" && name.second=="Waldon")
{
name.first = "Glenn";
name.second = "Waldron";
}
if (name.first=="Ralf" && name.second=="Karn")
{
name.first = "Ralf";
name.second = "Kern";
}
if (name.first=="Donny" && name.second=="Cipperly")
{
name.first = "Donald";
name.second = "Cipperly";
}
if (name.first=="Gino" && name.second=="")
{
name.first = "Gino";
name.second = "van den Bergen";
}
if (name.first=="Radu" && name.second=="Mihai")
{
name.first = "Mihai";
name.second = "Radu";
}
if (name.first=="Art" && name.second=="Trevs")
{
name.first = "Art";
name.second = "Tevs";
}
if (name.first=="Tim" && name.second=="More")
{
name.first = "Tim";
name.second = "Moore";
}
if (name.first=="Andre" && name.second=="Garneau")
{
name.first = "Andr<EFBFBD>";
name.second = "Garneau";
}
if (name.first=="Eric" && name.second=="Hammil")
{
name.first = "Chris";
name.second = "Hanson";
}
if (name.first=="Paul" && name.second=="de")
{
name.first = "Paul";
name.second = "de Repentigny";
}
if (name.first=="Nick" && name.second=="")
{
name.first = "Trajce";
name.second = "Nikolov";
}
if (name.first=="Daniel" && name.second=="")
{
name.first = "Daniel";
name.second = "Sj<EFBFBD>lie";
}
if (name.first=="Julia" && name.second=="Ortiz")
{
name.first = "Julian";
name.second = "Ortiz";
}
if (name.first=="Rune" && name.second=="Schmidt")
{
name.first = "Rune";
name.second = "Schmidt Jensen";
}
if (name.first=="Romano" && name.second=="Jos<EFBFBD>")
{
name.first = "Romano";
name.second = "Jos<EFBFBD> Magacho da Silva";
}
if (name.first=="Rommano" && name.second=="Silva")
{
name.first = "Romano";
name.second = "Jos<EFBFBD> Magacho da Silva";
}
if (name.first=="Leandro" && name.second=="Motta")
{
name.first = "Leandro";
name.second = "Motta Barros";
}
if (name.first=="A" && name.second=="Botorabi")
{
name.first = "Ali";
name.second = "Botorabi";
}
if (name.first=="Waltice" && name.second=="")
{
name.first = "Walter";
name.second = "J. Altice";
}
if (name.first=="Drew" && name.second=="")
{
name.first = "Drew";
name.second = "Whitehouse";
}
if (name.first=="Douglas" && name.second=="A")
{
name.first = "Douglas";
name.second = "A. Pouk";
}
if (name.first=="Colin" && name.second=="MacDonald")
{
name.first = "Colin";
name.second = "McDonald";
}
if (name.first=="Nikolov" && name.second=="Trajce")
{
name.first = "Trajce";
name.second = "Nikolov";
}
if (name.first=="Frauciel" && name.second=="Luc")
{
name.first = "Luc";
name.second = "Frauciel";
}
}
void lastValidCharacter(const std::string& name, unsigned int& pos,char c)
{
for(unsigned int i=0;i<pos;++i)
{
if (name[i]==c)
{
pos = i;
return;
}
}
}
void lastValidCharacter(const std::string& name, unsigned int& last)
{
lastValidCharacter(name, last, '.');
lastValidCharacter(name, last, ',');
lastValidCharacter(name, last, '\'');
lastValidCharacter(name, last, '/');
lastValidCharacter(name, last, '\\');
lastValidCharacter(name, last, ':');
lastValidCharacter(name, last, ';');
lastValidCharacter(name, last, ')');
}
NamePair createName(const std::string& first, const std::string& second)
{
if (first.empty()) return EmptyNamePair;
unsigned int last = first.size();
lastValidCharacter(first, last);
if (last==0) return EmptyNamePair;
std::string name;
name.append(first.begin(), first.begin()+last);
if (!validName(name)) return EmptyNamePair;
name = typoCorrection(name);
if (second.empty() ||
!validName(second))
{
// filter any single or two letter words as unlike to be names.
if (name.size()<=2) return EmptyNamePair;
return NamePair(name,"");
}
last = second.size();
lastValidCharacter(second, last);
if (last>0)
{
std::string surname(second.begin(), second.begin()+last);
if (validName(surname))
{
surname = typoCorrection(surname);
return NamePair(name, surname);
}
}
// filter any single or two letter words as unlike to be names.
if (name.size()<=2) return EmptyNamePair;
return NamePair(name,"");
}
bool submissionsSequence(const Words& words, unsigned int& i)
{
if (i+1>=words.size()) return false;
if (words[i]=="From" ||
words[i]=="from" ||
words[i]=="From:" ||
words[i]=="from:" ||
words[i]=="Merged" ||
words[i]=="Integrated") return true;
if (i+2>=words.size()) return false;
if (words[i]=="submitted" && words[i+1]=="by")
{
i+=1;
return true;
}
if (words[i]=="Folded" && words[i+1]=="in")
{
i+=1;
return true;
}
if (words[i]=="Rolled" && words[i+1]=="in")
{
i+=1;
return true;
}
if (words[i]=="Checked" && words[i+1]=="in")
{
i+=1;
return true;
}
if (i+3>=words.size()) return false;
if (words[i]=="sent" && words[i+1]=="in" && words[i+2]=="by")
{
i+=2;
return true;
}
return false;
}
void readContributors(NameMap& names, const std::string& file)
{
std::ifstream fin(file.c_str());
Words words;
while(fin)
{
std::string keyword;
fin >> keyword;
words.push_back(keyword);
}
std::string blank_string;
for(unsigned int i=0; i< words.size(); ++i)
{
if (submissionsSequence(words,i))
{
if (i+2<words.size() && validName(words[i+1]))
{
NamePair name = createName(words[i+1], words[i+2]);
nameCorrection(name);
if (!name.first.empty()) ++names[name];
i+=2;
}
else if (i+1<words.size() && validName(words[i+1]))
{
NamePair name = createName(words[i+1], blank_string);
nameCorrection(name);
if (!name.first.empty()) ++names[name];
i+=1;
}
}
else
{
if (words[i]=="robert:")
{
++names[NameRobertOsfield];
}
else if (words[i]=="don:")
{
++names[NameDonBurns];
}
}
}
// reassign fisrt name entries to their full names entries
if (names.size()>1)
{
for(NameMap::iterator itr = names.begin();
itr != names.end();
)
{
if (itr->first.second.empty())
{
NameMap::iterator next_itr = itr;
++next_itr;
if (next_itr!=names.end() && itr->first.first==next_itr->first.first)
{
next_itr->second += itr->second;
names.erase(itr);
itr = next_itr;
}
else
{
++itr;
}
}
else
{
++itr;
}
}
}
// remove the double entries from Robert's contributions
if (names.size()>1)
{
for(NameMap::iterator itr = names.begin();
itr != names.end();
++itr)
{
if (itr->first != NameRobertOsfield && itr->first != NameDonBurns )
{
names[NameRobertOsfield] -= itr->second;
}
}
}
}
void buildContributors(NameMap& names)
{
// top five contributors
++names[NamePair("Robert","Osfield")];
++names[NamePair("Don","Burns")];
++names[NamePair("Marco","Jez")];
++names[NamePair("Mike","Weiblen")];
++names[NamePair("Geoff","Michel")];
++names[NamePair("Ben","van Basten")];
// contributors that don't appear in the ChangeLog due to their contributions
// being before CVS started for the OSG, or before the name logging began.
++names[NamePair("Karsten","Weiss")];
++names[NamePair("Graeme","Harkness")];
++names[NamePair("Axel","Volley")];
++names[NamePair("Nikolaus","Hanekamp")];
++names[NamePair("Kristopher","Bixler")];
++names[NamePair("Tanguy","Fautr<EFBFBD>")];
++names[NamePair("J.E.","Hoffmann")];
}
int main( int argc, char **argv)
{
osg::ArgumentParser arguments(&argc,argv);
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options]");
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
arguments.getApplicationUsage()->addCommandLineOption("--entries","Print out number of entries into the ChangeLog file for each contributor.");
arguments.getApplicationUsage()->addCommandLineOption("--version-number","Print out version number only");
arguments.getApplicationUsage()->addCommandLineOption("--major-number","Print out major version number only");
arguments.getApplicationUsage()->addCommandLineOption("--minor-number","Print out minor version number only");
arguments.getApplicationUsage()->addCommandLineOption("--patch-number","Print out patch version number only");
arguments.getApplicationUsage()->addCommandLineOption("--so-number ","Print out shared object version number only");
arguments.getApplicationUsage()->addCommandLineOption("--openthreads-version-number","Print out version number for OpenThreads only");
arguments.getApplicationUsage()->addCommandLineOption("--openthreads-soversion-number","Print out shared object version number for OpenThreads only");
arguments.getApplicationUsage()->addCommandLineOption("Matrix::value_type","Print the value of Matrix::value_type");
arguments.getApplicationUsage()->addCommandLineOption("Plane::value_type","Print the value of Plane::value_type");
arguments.getApplicationUsage()->addCommandLineOption("BoundingSphere::value_type","Print the value of BoundingSphere::value_type");
arguments.getApplicationUsage()->addCommandLineOption("BoundingBox::value_type","Print the value of BoundingBox::value_type");
arguments.getApplicationUsage()->addCommandLineOption("-r <file> or --read <file>","Read the ChangeLog to generate an estimated contributors list.");
if (arguments.read("--version-number"))
{
std::cout<<osgGetVersion()<<std::endl;
cout << osgGetVersion() << endl;
return 0;
}
if (arguments.read("--major-number"))
{
std::cout<<OPENSCENEGRAPH_MAJOR_VERSION<<std::endl;
cout << OPENSCENEGRAPH_MAJOR_VERSION << endl;
return 0;
}
if (arguments.read("--minor-number"))
{
std::cout<<OPENSCENEGRAPH_MINOR_VERSION<<std::endl;
cout << OPENSCENEGRAPH_MINOR_VERSION << endl;
return 0;
}
if (arguments.read("--patch-number"))
{
std::cout<<OPENSCENEGRAPH_PATCH_VERSION<<std::endl;
cout << OPENSCENEGRAPH_PATCH_VERSION << endl;
return 0;
}
if (arguments.read("--soversion-number") || arguments.read("--so-number") )
{
std::cout<<osgGetSOVersion()<<std::endl;
cout << osgGetSOVersion() << endl;
return 0;
}
if (arguments.read("--openthreads-version-number"))
{
std::cout<<OpenThreadsGetVersion()<<std::endl;
cout << OpenThreadsGetVersion() << endl;
return 0;
}
if (arguments.read("--openthreads-major-number"))
{
std::cout<<OPENTHREADS_MAJOR_VERSION<<std::endl;
cout << OPENTHREADS_MAJOR_VERSION << endl;
return 0;
}
if (arguments.read("--openthreads-minor-number"))
{
std::cout<<OPENTHREADS_MINOR_VERSION<<std::endl;
cout << OPENTHREADS_MINOR_VERSION << endl;
return 0;
}
if (arguments.read("--openthreads-patch-number"))
{
std::cout<<OPENTHREADS_PATCH_VERSION<<std::endl;
cout << OPENTHREADS_PATCH_VERSION << endl;
return 0;
}
if (arguments.read("--openthreads-soversion-number"))
{
std::cout<<OpenThreadsGetSOVersion()<<std::endl;
cout << OpenThreadsGetSOVersion() << endl;
return 0;
}
if (arguments.read("Matrix::value_type"))
{
std::cout<<((sizeof(osg::Matrix::value_type)==4)?"float":"double")<<std::endl;
cout << ((sizeof(osg::Matrix::value_type) == 4) ? "float" : "double") << endl;
return 0;
}
if (arguments.read("Plane::value_type"))
{
std::cout<<((sizeof(osg::Plane::value_type)==4)?"float":"double")<<std::endl;
cout << ((sizeof(osg::Plane::value_type) == 4) ? "float" : "double") << endl;
return 0;
}
if (arguments.read("BoundingSphere::value_type"))
{
std::cout<<((sizeof(osg::BoundingSphere::value_type)==4)?"float":"double")<<std::endl;
cout << ((sizeof(osg::BoundingSphere::value_type) == 4) ? "float" : "double") << endl;
return 0;
}
if (arguments.read("BoundingBox::value_type"))
{
std::cout<<((sizeof(osg::BoundingBox::value_type)==4)?"float":"double")<<std::endl;
cout << ((sizeof(osg::BoundingBox::value_type) == 4) ? "float" : "double") << endl;
return 0;
}
std::cout<<osgGetLibraryName()<< " "<< osgGetVersion()<<std::endl<<std::endl;
bool printContributors = false;
bool printNumEntries = false;
while ( arguments.read("--entries"))
cout << osgGetLibraryName() << " " << osgGetVersion() << endl << endl;
#ifdef BUILD_CONTRIBUTORS
string changeLog;
while (arguments.read("-r", changeLog) ||
arguments.read("--read", changeLog))
{
printContributors = true;
printNumEntries = true;
}
std::string changeLog;
while ( arguments.read("-r",changeLog) || arguments.read("--read",changeLog)) printContributors = true;
// if user request help write it out to cout.
if (arguments.read("-h") || arguments.read("--help"))
{
std::cout<<arguments.getApplicationUsage()->getCommandLineUsage()<<std::endl;
arguments.getApplicationUsage()->write(std::cout,arguments.getApplicationUsage()->getCommandLineOptions());
return 1;
}
if (printContributors)
{
NameMap names;
buildContributors(names);
if (!changeLog.empty())
{
readContributors(names, changeLog);
}
typedef std::multimap<unsigned int, NamePair> SortedNameMap;
SortedNameMap sortedNames;
for(NameMap::iterator itr = names.begin();
itr != names.end();
++itr)
{
sortedNames.insert(SortedNameMap::value_type(itr->second, itr->first));
}
std::cout<<names.size()<<" Contributors:"<<std::endl<<std::endl;
if (printNumEntries)
{
std::cout<<"Entries Firstname Surname"<<std::endl;
std::cout<<"-------------------------"<<std::endl;
for(SortedNameMap::reverse_iterator sitr = sortedNames.rbegin();
sitr != sortedNames.rend();
++sitr)
{
std::cout<<sitr->first<<"\t"<<sitr->second.first<<" "<<sitr->second.second<<std::endl;
}
}
else
{
std::cout<<"Firstname Surname"<<std::endl;
std::cout<<"-----------------"<<std::endl;
for(SortedNameMap::reverse_iterator sitr = sortedNames.rbegin();
sitr != sortedNames.rend();
++sitr)
{
std::cout<<sitr->second.first<<" "<<sitr->second.second<<std::endl;
}
}
printContributors(changeLog, arguments.read("--entries"));
}
#endif
return 0;
}

View File

@@ -39,27 +39,16 @@ int main(int argc, char** argv)
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
arguments.getApplicationUsage()->addCommandLineOption("--image <filename>","Load an image and render it on a quad");
arguments.getApplicationUsage()->addCommandLineOption("--dem <filename>","Load an image/DEM and render it on a HeightField");
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display command line parameters");
arguments.getApplicationUsage()->addCommandLineOption("--help-env","Display environmental variables available");
arguments.getApplicationUsage()->addCommandLineOption("--help-keys","Display keyboard & mouse bindings available");
arguments.getApplicationUsage()->addCommandLineOption("--help-all","Display all command line, env vars and keyboard & mouse bindings.");
arguments.getApplicationUsage()->addCommandLineOption("--SingleThreaded","Select SingleThreaded threading model for viewer.");
arguments.getApplicationUsage()->addCommandLineOption("--CullDrawThreadPerContext","Select CullDrawThreadPerContext threading model for viewer.");
arguments.getApplicationUsage()->addCommandLineOption("--DrawThreadPerContext","Select DrawThreadPerContext threading model for viewer.");
arguments.getApplicationUsage()->addCommandLineOption("--CullThreadPerCameraDrawThreadPerContext","Select CullThreadPerCameraDrawThreadPerContext threading model for viewer.");
arguments.getApplicationUsage()->addCommandLineOption("--login <url> <username> <password>","Provide authentication information for http file access.");
// if user request help write it out to cout.
bool helpAll = arguments.read("--help-all");
unsigned int helpType = ((helpAll || arguments.read("-h") || arguments.read("--help"))? osg::ApplicationUsage::COMMAND_LINE_OPTION : 0 ) |
((helpAll || arguments.read("--help-env"))? osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE : 0 ) |
((helpAll || arguments.read("--help-keys"))? osg::ApplicationUsage::KEYBOARD_MOUSE_BINDING : 0 );
if (helpType)
osgViewer::Viewer viewer(arguments);
unsigned int helpType = 0;
if ((helpType = arguments.readHelpType()))
{
arguments.getApplicationUsage()->write(std::cout, helpType);
return 1;
}
osgViewer::Viewer viewer(arguments);
// report any errors if they have occurred when parsing the program arguments.
if (arguments.errors())
@@ -74,6 +63,19 @@ int main(int argc, char** argv)
return 1;
}
std::string url, username, password;
while(arguments.read("--login",url, username, password))
{
if (!osgDB::Registry::instance()->getAuthenticationMap())
{
osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap);
osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails(
url,
new osgDB::AuthenticationDetails(username, password)
);
}
}
// set up the camera manipulators.
{
osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator;
@@ -121,6 +123,9 @@ int main(int argc, char** argv)
// add the LOD Scale handler
viewer.addEventHandler(new osgViewer::LODScaleHandler);
// add the screen capture handler
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
// load the data
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
if (!loadedModel)

2
configure vendored
View File

@@ -1 +1 @@
cmake . -DCMAKE_BUILD_TYPE=Release
cmake . -DCMAKE_BUILD_TYPE=Release $@

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -348,7 +348,7 @@ SHOW_USED_FILES = YES
# The QUIET tag can be used to turn on/off the messages that are generated
# by doxygen. Possible values are YES and NO. If left blank NO is used.
QUIET = NO
QUIET = YES
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated by doxygen. Possible values are YES and NO. If left blank

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,10 @@
<hr>
<address><small>Generated at $datetime for the <a href="http://www.openscenegraph.org/">OpenSceneGraph</a>
<table border="0"><tr><td>
<img src="osg32-32.png" alt="osg logo" />
</td><td>
<address><small>Generated at $datetime for the <a href="http://www.openscenegraph.org/">$projectname</a>
by <a href="http://www.doxygen.org">doxygen</a> $doxygenversion.</small></address>
<!-- Dimitri van Heesch's e-mail address removed, lest he get messages on the Open Scene Graph -->
<!-- Dimitri van Heesch's e-mail address removed, lest he get messages on the OpenSceneGraph -->
</td></tr></table>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,254 @@
# Doxyfile 1.5.7.1
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = OpenThreads
PROJECT_NUMBER = ${OPENTHREADS_VERSION}
OUTPUT_DIRECTORY = "${PROJECT_BINARY_DIR}/doc/"
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = "${OpenSceneGraph_SOURCE_DIR}/include/"
STRIP_FROM_INC_PATH =
SHORT_NAMES = YES
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = NO
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = YES
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
LAYOUT_FILE =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = "${OpenSceneGraph_SOURCE_DIR}/include/OpenThreads"
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *include* \
*.cpp
RECURSIVE = YES
EXCLUDE = .svn
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */.svn/*
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 2
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = OpenThreadsReferenceDocs
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER = "${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html"
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
HTML_DYNAMIC_SECTIONS = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
GENERATE_HTMLHELP = ${GENERATE_HTMLHELP}
CHM_FILE = "../OpenThreadsReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm"
HHC_LOCATION = "${HTML_HELP_COMPILER}"
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
GENERATE_QHP = NO
QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc
QHG_LOCATION =
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
FORMULA_FONTSIZE = 10
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE = ${GENERATE_TAGFILE}
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
DOT_FONTNAME = FreeSans
DOT_FONTSIZE = 10
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = NO
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = YES
INCLUDE_GRAPH = NO
INCLUDED_BY_GRAPH = NO
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = YES
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = ${SEARCHENGINE}

View File

@@ -5,18 +5,20 @@ SET(TARGET_DEFAULT_PREFIX "example_")
SET(TARGET_DEFAULT_LABEL_PREFIX "Examples")
SET(TARGET_COMMON_LIBRARIES
OpenThreads
osg
osgDB
osgUtil
osgGA
osgViewer
osgText
OpenThreads
osg
osgDB
osgUtil
osgGA
osgViewer
osgText
)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osg2cpp)
ADD_SUBDIRECTORY(osganimate)
ADD_SUBDIRECTORY(osgautocapture)
ADD_SUBDIRECTORY(osgautotransform)
ADD_SUBDIRECTORY(osgbillboard)
ADD_SUBDIRECTORY(osgblendequation)
@@ -28,20 +30,25 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgcopy)
ADD_SUBDIRECTORY(osgcubemap)
ADD_SUBDIRECTORY(osgdelaunay)
ADD_SUBDIRECTORY(osgcluster)
ADD_SUBDIRECTORY(osgdepthpartition)
ADD_SUBDIRECTORY(osgdepthpeeling)
ADD_SUBDIRECTORY(osgdrawinstanced)
ADD_SUBDIRECTORY(osgdistortion)
ADD_SUBDIRECTORY(osgfadetext)
ADD_SUBDIRECTORY(osgfont)
ADD_SUBDIRECTORY(osgforest)
ADD_SUBDIRECTORY(osgfxbrowser)
ADD_SUBDIRECTORY(osggameoflife)
ADD_SUBDIRECTORY(osggeodemo)
ADD_SUBDIRECTORY(osggeometry)
ADD_SUBDIRECTORY(osggeometryshaders)
ADD_SUBDIRECTORY(osghangglide)
ADD_SUBDIRECTORY(osghud)
ADD_SUBDIRECTORY(osgimagesequence)
ADD_SUBDIRECTORY(osgimpostor)
ADD_SUBDIRECTORY(osgintersection)
ADD_SUBDIRECTORY(osgmultiplerendertargets)
ADD_SUBDIRECTORY(osgkdtree)
ADD_SUBDIRECTORY(osgkeyboard)
ADD_SUBDIRECTORY(osgkeyboardmouse)
ADD_SUBDIRECTORY(osglauncher)
@@ -50,12 +57,15 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osglogicop)
ADD_SUBDIRECTORY(osglogo)
ADD_SUBDIRECTORY(osgmanipulator)
ADD_SUBDIRECTORY(osgmemorytest)
ADD_SUBDIRECTORY(osgmotionblur)
ADD_SUBDIRECTORY(osgmovie)
ADD_SUBDIRECTORY(osgmultiplerendertargets)
ADD_SUBDIRECTORY(osgmultitexture)
ADD_SUBDIRECTORY(osgmultitexturecontrol)
ADD_SUBDIRECTORY(osgoccluder)
ADD_SUBDIRECTORY(osgocclusionquery)
ADD_SUBDIRECTORY(osgpackeddepthstencil)
ADD_SUBDIRECTORY(osgpagedlod)
ADD_SUBDIRECTORY(osgparametric)
ADD_SUBDIRECTORY(osgparticle)
@@ -69,7 +79,9 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgprerender)
ADD_SUBDIRECTORY(osgprerendercubemap)
ADD_SUBDIRECTORY(osgreflect)
ADD_SUBDIRECTORY(osgrobot)
ADD_SUBDIRECTORY(osgscalarbar)
ADD_SUBDIRECTORY(osgscreencapture)
ADD_SUBDIRECTORY(osgscribe)
ADD_SUBDIRECTORY(osgsequence)
ADD_SUBDIRECTORY(osgshaders)
@@ -79,6 +91,7 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgsharedarray)
ADD_SUBDIRECTORY(osgsimplifier)
ADD_SUBDIRECTORY(osgsimulation)
ADD_SUBDIRECTORY(osgsidebyside)
ADD_SUBDIRECTORY(osgslice)
ADD_SUBDIRECTORY(osgspacewarp)
ADD_SUBDIRECTORY(osgspheresegment)
@@ -87,7 +100,7 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgstereomatch)
ADD_SUBDIRECTORY(osgteapot)
ADD_SUBDIRECTORY(osgterrain)
ADD_SUBDIRECTORY(osgtessellate)#)
ADD_SUBDIRECTORY(osgtessellate)
ADD_SUBDIRECTORY(osgtext)
ADD_SUBDIRECTORY(osgtext3D)
ADD_SUBDIRECTORY(osgtexture1D)
@@ -99,7 +112,31 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgvertexprogram)
ADD_SUBDIRECTORY(osgvolume)
ADD_SUBDIRECTORY(osgwindows)
ADD_SUBDIRECTORY(osganimationtimeline)
ADD_SUBDIRECTORY(osganimationnode)
ADD_SUBDIRECTORY(osganimationmakepath)
ADD_SUBDIRECTORY(osganimationskinning)
ADD_SUBDIRECTORY(osganimationsolid)
ADD_SUBDIRECTORY(osganimationviewer)
ADD_SUBDIRECTORY(osgbrowser)
ADD_SUBDIRECTORY(osgwidgetaddremove)
ADD_SUBDIRECTORY(osgwidgetbox)
ADD_SUBDIRECTORY(osgwidgetcanvas)
ADD_SUBDIRECTORY(osgwidgetframe)
ADD_SUBDIRECTORY(osgwidgetinput)
ADD_SUBDIRECTORY(osgwidgetlabel)
ADD_SUBDIRECTORY(osgwidgetmessagebox)
ADD_SUBDIRECTORY(osgwidgetmenu)
ADD_SUBDIRECTORY(osgwidgetnotebook)
ADD_SUBDIRECTORY(osgwidgetperformance)
ADD_SUBDIRECTORY(osgwidgetscrolled)
ADD_SUBDIRECTORY(osgwidgetshader)
ADD_SUBDIRECTORY(osgwidgetstyled)
ADD_SUBDIRECTORY(osgwidgettable)
ADD_SUBDIRECTORY(osgwidgetwindow)
ADD_SUBDIRECTORY(osgpdf)
IF (BUILD_OSG_WRAPPERS)
ADD_SUBDIRECTORY(osgintrospection)
ENDIF(BUILD_OSG_WRAPPERS)
@@ -112,6 +149,10 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgviewerSDL)
ENDIF(SDL_FOUND)
IF (GTKGL_FOUND)
ADD_SUBDIRECTORY(osgviewerGTK)
ENDIF(GTKGL_FOUND)
IF (FOX_FOUND)
ADD_SUBDIRECTORY(osgviewerFOX)
ENDIF(FOX_FOUND)
@@ -120,9 +161,9 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgviewerWX)
ENDIF(wxWidgets_FOUND)
IF (QT_FOUND)
IF (QT_FOUND AND QT_QTOPENGL_LIBRARY)
ADD_SUBDIRECTORY(osgviewerQT)
ENDIF(QT_FOUND)
ENDIF(QT_FOUND AND QT_QTOPENGL_LIBRARY)
IF (FLTK_FOUND)
ADD_SUBDIRECTORY(osgviewerFLTK)
@@ -138,10 +179,24 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ENDIF(WIN32)
IF (APPLE)
ADD_SUBDIRECTORY(osgviewerCocoa)
ENDIF(APPLE)
IF (LIBVNCSERVER_FOUND)
ADD_SUBDIRECTORY(osgvnc)
ENDIF(LIBVNCSERVER_FOUND)
#ADD_SUBDIRECTORY(osgcegui)
#to add subject to find socket#ADD_SUBDIRECTORY(osgcluster)
ELSE(DYNAMIC_OPENSCENEGRAPH)
#needed on win32 or the linker get confused by _declspec declarations
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ADD_SUBDIRECTORY(osgstaticviewer)

View File

@@ -0,0 +1,6 @@
SET(TARGET_SRC
osg2cpp.cpp
)
#### end var setup ###
SETUP_APPLICATION(osg2cpp)

View File

@@ -0,0 +1,102 @@
#include <osg/ArgumentParser>
#include <osg/ApplicationUsage>
#include <osgDB/ReadFile>
#include <osgDB/FileNameUtils>
#include <osgDB/fstream>
#include <iostream>
void writeShader(osg::Shader* shader, const std::string& cppFileName, const std::string& variableName)
{
osgDB::ofstream fout(cppFileName.c_str());
if (!fout)
{
std::cout<<"Error: could not open file `"<<cppFileName<<"` for writing."<<std::endl;
}
std::string shaderSource = shader->getShaderSource();
std::string variableString = std::string("char ")+variableName+std::string("[] = ");
std::string::size_type startOfLine = 0;
std::string::size_type endOfLine = shaderSource.find_first_of('\n', startOfLine);
if (endOfLine==std::string::npos)
{
fout<<variableString<<shaderSource<<"\\n\";"<<std::endl;
}
else
{
std::string padding(variableString.size(),' ');
fout<<variableString<<"\""<<shaderSource.substr(startOfLine,endOfLine-startOfLine)<<"\\n\""<<std::endl;
startOfLine = endOfLine+1;
endOfLine = shaderSource.find_first_of('\n', startOfLine);
while (endOfLine != std::string::npos)
{
fout<<padding<<"\""<<shaderSource.substr(startOfLine,endOfLine-startOfLine)<<"\\n\""<<std::endl;
startOfLine = endOfLine + 1;
endOfLine = shaderSource.find_first_of('\n', startOfLine);
}
fout<<padding<<"\""<<shaderSource.substr(startOfLine,endOfLine-startOfLine)<<"\\n\";"<<std::endl;
}
std::cout<<"Written shader to `"<<cppFileName<<"`"<<std::endl;
}
int main( int argc, char **argv )
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
// set up the usage document, in case we need to print out how to use this program.
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is a utility for converting between various input and output databases formats.");
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
arguments.getApplicationUsage()->addCommandLineOption("--shader <filename>","Shader file to create a .cpp file for.");
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display command line parameters");
// if user request help write it out to cout.
if (arguments.read("-h") || arguments.read("--help"))
{
arguments.getApplicationUsage()->write(std::cout);
return 1;
}
std::string filename;
if (arguments.read("--shader",filename))
{
osg::ref_ptr<osg::Shader> shader = osgDB::readShaderFile(filename);
if (shader.valid())
{
std::string name = osgDB::getStrippedName(filename);
std::string invalidCharacters = "-+/\\*=(){}[]:;<>,.?@'~#`!\"";
std::string numbericCharacters = "0123456789";
std::string::size_type pos = name.find_first_of(invalidCharacters);
while (pos != std::string::npos)
{
name[pos] = '_';
pos = name.find_first_of(invalidCharacters);
}
std::string ext = osgDB::getFileExtension(filename);
std::string cppFileName = name + "_" + ext + ".cpp";
std::string variableName = name + "_" + ext;
writeShader(shader.get(), cppFileName, variableName);
return 0;
}
else
{
std::cout<<"Error: could not find file '"<<filename<<"'"<<std::endl;
return 1;
}
}
std::cout<<"No appropriate command line options used."<<std::endl;
arguments.getApplicationUsage()->write(std::cout);
return 1;
}

View File

@@ -0,0 +1,3 @@
SET(TARGET_SRC osganimationmakepath.cpp )
SET(TARGET_ADDED_LIBRARIES osgAnimation )
SETUP_EXAMPLE(osganimationmakepath)

View File

@@ -0,0 +1,338 @@
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*
* Authors:
* Jeremy Moles <jeremy@emperorlinux.com>
* Cedric Pinson <mornifle@plopbyte.net>
*/
#include <iostream>
#include <osg/io_utils>
#include <osg/Geometry>
#include <osg/Shape>
#include <osg/ShapeDrawable>
#include <osg/Material>
#include <osg/MatrixTransform>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgGA/TrackballManipulator>
#include <osgAnimation/Sampler>
class AnimtkUpdateCallback : public osg::NodeCallback
{
public:
META_Object(osgAnimation, AnimtkUpdateCallback);
AnimtkUpdateCallback()
{
_sampler = new osgAnimation::Vec3CubicBezierSampler;
_playing = false;
_lastUpdate = 0;
}
AnimtkUpdateCallback(const AnimtkUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
osg::Object(val, copyop),
osg::NodeCallback(val, copyop),
_sampler(val._sampler),
_startTime(val._startTime),
_currentTime(val._currentTime),
_playing(val._playing),
_lastUpdate(val._lastUpdate)
{
}
/** Callback method called by the NodeVisitor when visiting a node.*/
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
nv->getFrameStamp() &&
nv->getFrameStamp()->getFrameNumber() != _lastUpdate)
{
_lastUpdate = nv->getFrameStamp()->getFrameNumber();
_currentTime = osg::Timer::instance()->tick();
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
{
osg::MatrixTransform* transform = dynamic_cast<osg::MatrixTransform*>(node);
if (transform) {
osg::Vec3 result;
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
float duration = _sampler->getEndTime() - _sampler->getStartTime();
t = fmod(t, duration);
t += _sampler->getStartTime();
_sampler->getValueAt(t, result);
transform->setMatrix(osg::Matrix::translate(result));
}
}
}
// note, callback is responsible for scenegraph traversal so
// they must call traverse(node,nv) to ensure that the
// scene graph subtree (and associated callbacks) are traversed.
traverse(node,nv);
}
void start() { _startTime = osg::Timer::instance()->tick(); _currentTime = _startTime; _playing = true;}
void stop() { _currentTime = _startTime; _playing = false;}
osg::ref_ptr<osgAnimation::Vec3CubicBezierSampler> _sampler;
osg::Timer_t _startTime;
osg::Timer_t _currentTime;
bool _playing;
int _lastUpdate;
};
class AnimtkStateSetUpdateCallback : public osg::StateSet::Callback
{
public:
META_Object(osgAnimation, AnimtkStateSetUpdateCallback);
AnimtkStateSetUpdateCallback()
{
_sampler = new osgAnimation::Vec4LinearSampler;
_playing = false;
_lastUpdate = 0;
}
AnimtkStateSetUpdateCallback(const AnimtkStateSetUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
osg::Object(val, copyop),
osg::StateSet::Callback(val, copyop),
_sampler(val._sampler),
_startTime(val._startTime),
_currentTime(val._currentTime),
_playing(val._playing),
_lastUpdate(val._lastUpdate)
{
}
/** Callback method called by the NodeVisitor when visiting a node.*/
virtual void operator()(osg::StateSet* state, osg::NodeVisitor* nv)
{
if (state &&
nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
nv->getFrameStamp() &&
nv->getFrameStamp()->getFrameNumber() != _lastUpdate) {
_lastUpdate = nv->getFrameStamp()->getFrameNumber();
_currentTime = osg::Timer::instance()->tick();
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
{
osg::Material* material = dynamic_cast<osg::Material*>(state->getAttribute(osg::StateAttribute::MATERIAL));
if (material)
{
osg::Vec4 result;
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
float duration = _sampler->getEndTime() - _sampler->getStartTime();
t = fmod(t, duration);
t += _sampler->getStartTime();
_sampler->getValueAt(t, result);
material->setDiffuse(osg::Material::FRONT_AND_BACK, result);
}
}
}
}
void start() { _startTime = osg::Timer::instance()->tick(); _currentTime = _startTime; _playing = true;}
void stop() { _currentTime = _startTime; _playing = false;}
osg::ref_ptr<osgAnimation::Vec4LinearSampler> _sampler;
osg::Timer_t _startTime;
osg::Timer_t _currentTime;
bool _playing;
int _lastUpdate;
};
// This won't really give good results in any situation, but it does demonstrate
// on possible "fast" usage...
class MakePathTimeCallback: public AnimtkUpdateCallback
{
osg::ref_ptr<osg::Geode> _geode;
float _lastAdd;
float _addSeconds;
public:
MakePathTimeCallback(osg::Geode* geode):
_geode(geode),
_lastAdd(0.0f),
_addSeconds(0.08f) {
}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
if(_lastAdd + _addSeconds <= t && t <= 8.0f)
{
osg::Vec3 pos;
_sampler->getValueAt(t, pos);
_geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(pos, 0.5f)));
_geode->dirtyBound();
_lastAdd += _addSeconds;
}
AnimtkUpdateCallback::operator()(node, nv);
}
};
// This will give great results if you DO NOT have VSYNC enabled and can generate
// decent FPS.
class MakePathDistanceCallback: public AnimtkUpdateCallback
{
osg::ref_ptr<osg::Geode> _geode;
osg::Vec3 _lastAdd;
float _threshold;
unsigned int _count;
public:
MakePathDistanceCallback(osg::Geode* geode):
_geode(geode),
_threshold(0.5f),
_count(0) {}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
static bool countReported = false;
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
osg::Vec3 pos;
_sampler->getValueAt(t, pos);
osg::Vec3 distance = _lastAdd - pos;
if(t <= 8.0f && distance.length() >= _threshold)
{
_geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(pos, 0.25f)));
_lastAdd = pos;
_count++;
}
else if(t > 8.0f)
{
if(!countReported) std::cout << "Created " << _count << " nodes." << std::endl;
countReported = true;
}
AnimtkUpdateCallback::operator()(node, nv);
}
};
osg::StateSet* setupStateSet()
{
osg::StateSet* st = new osg::StateSet();
st->setAttributeAndModes(new osg::Material(), true);
st->setMode(GL_BLEND, true);
AnimtkStateSetUpdateCallback* callback = new AnimtkStateSetUpdateCallback();
osgAnimation::Vec4KeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer();
keys->push_back(osgAnimation::Vec4Keyframe(0, osg::Vec4(1,0,0,1)));
keys->push_back(osgAnimation::Vec4Keyframe(2, osg::Vec4(0.,1,0,1)));
keys->push_back(osgAnimation::Vec4Keyframe(4, osg::Vec4(0,0,1,1)));
keys->push_back(osgAnimation::Vec4Keyframe(6, osg::Vec4(0,0,1,1)));
keys->push_back(osgAnimation::Vec4Keyframe(8, osg::Vec4(0,1,0,1)));
keys->push_back(osgAnimation::Vec4Keyframe(10, osg::Vec4(1,0,0,1)));
callback->start();
st->setUpdateCallback(callback);
return st;
}
osg::MatrixTransform* setupAnimtkNode(osg::Geode* staticGeode)
{
osg::Vec3 v[5];
v[0] = osg::Vec3( 0, 0, 0);
v[1] = osg::Vec3(20, 40, 60);
v[2] = osg::Vec3(40, 60, 20);
v[3] = osg::Vec3(60, 20, 40);
v[4] = osg::Vec3( 0, 0, 0);
osg::MatrixTransform* node = new osg::MatrixTransform();
AnimtkUpdateCallback* callback = new MakePathDistanceCallback(staticGeode);
osgAnimation::Vec3CubicBezierKeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer();
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(0, osgAnimation::Vec3CubicBezier(
v[0],
v[0] + (v[0] - v[3]),
v[1] - (v[1] - v[0])
)));
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(2, osgAnimation::Vec3CubicBezier(
v[1],
v[1] + (v[1] - v[0]),
v[2] - (v[2] - v[1])
)));
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(4, osgAnimation::Vec3CubicBezier(
v[2],
v[2] + (v[2] - v[1]),
v[3] - (v[3] - v[2])
)));
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(6, osgAnimation::Vec3CubicBezier(
v[3],
v[3] + (v[3] - v[2]),
v[4] - (v[4] - v[3])
)));
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(8, osgAnimation::Vec3CubicBezier(
v[4],
v[4] + (v[4] - v[3]),
v[0] - (v[0] - v[4])
)));
callback->start();
node->setUpdateCallback(callback);
osg::Geode* geode = new osg::Geode();
geode->setStateSet(setupStateSet());
geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0f, 0.0f, 0.0f), 2)));
node->addChild(geode);
return node;
}
int main(int argc, char** argv)
{
osg::ArgumentParser arguments(&argc, argv);
osgViewer::Viewer viewer(arguments);
osgGA::TrackballManipulator* tbm = new osgGA::TrackballManipulator();
viewer.setCameraManipulator(tbm);
viewer.addEventHandler(new osgViewer::StatsHandler());
viewer.addEventHandler(new osgViewer::WindowSizeHandler());
osg::Group* root = new osg::Group();
osg::Geode* geode = new osg::Geode();
geode->setStateSet(setupStateSet());
root->setInitialBound(osg::BoundingSphere(osg::Vec3(10,0,20), 50));
root->addChild(setupAnimtkNode(geode));
root->addChild(geode);
viewer.setSceneData(root);
// tbm->setDistance(150);
return viewer.run();
}

View File

@@ -0,0 +1,3 @@
SET(TARGET_SRC osganimationnode.cpp )
SET(TARGET_ADDED_LIBRARIES osgAnimation )
SETUP_EXAMPLE(osganimationnode)

View File

@@ -0,0 +1,274 @@
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <iostream>
#include <osg/Geometry>
#include <osg/Shape>
#include <osg/ShapeDrawable>
#include <osgViewer/Viewer>
#include <osgGA/TrackballManipulator>
#include <osg/MatrixTransform>
#include <osg/Material>
#include <osgAnimation/Sampler>
class AnimtkUpdateCallback : public osg::NodeCallback
{
public:
META_Object(osgAnimation, AnimtkUpdateCallback);
AnimtkUpdateCallback()
{
_sampler = new osgAnimation::Vec3CubicBezierSampler;
_playing = false;
_lastUpdate = 0;
}
AnimtkUpdateCallback(const AnimtkUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
osg::Object(val, copyop),
osg::NodeCallback(val, copyop),
_sampler(val._sampler),
_startTime(val._startTime),
_currentTime(val._currentTime),
_playing(val._playing),
_lastUpdate(val._lastUpdate)
{
}
/** Callback method called by the NodeVisitor when visiting a node.*/
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
nv->getFrameStamp() &&
nv->getFrameStamp()->getFrameNumber() != _lastUpdate) {
_lastUpdate = nv->getFrameStamp()->getFrameNumber();
_currentTime = osg::Timer::instance()->tick();
if (_playing && _sampler.get() && _sampler->getKeyframeContainer()) {
osg::MatrixTransform* transform = dynamic_cast<osg::MatrixTransform*>(node);
if (transform) {
osg::Vec3 result;
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
float duration = _sampler->getEndTime() - _sampler->getStartTime();
t = fmod(t, duration);
t += _sampler->getStartTime();
_sampler->getValueAt(t, result);
transform->setMatrix(osg::Matrix::translate(result));
}
}
}
// note, callback is responsible for scenegraph traversal so
// they must call traverse(node,nv) to ensure that the
// scene graph subtree (and associated callbacks) are traversed.
traverse(node,nv);
}
void start() { _startTime = osg::Timer::instance()->tick(); _currentTime = _startTime; _playing = true;}
void stop() { _currentTime = _startTime; _playing = false;}
osg::ref_ptr<osgAnimation::Vec3CubicBezierSampler> _sampler;
osg::Timer_t _startTime;
osg::Timer_t _currentTime;
bool _playing;
int _lastUpdate;
};
class AnimtkStateSetUpdateCallback : public osg::StateSet::Callback
{
public:
META_Object(osgAnimation, AnimtkStateSetUpdateCallback);
AnimtkStateSetUpdateCallback()
{
_sampler = new osgAnimation::Vec4LinearSampler;
_playing = false;
_lastUpdate = 0;
}
AnimtkStateSetUpdateCallback(const AnimtkStateSetUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
osg::Object(val, copyop),
osg::StateSet::Callback(val, copyop),
_sampler(val._sampler),
_startTime(val._startTime),
_currentTime(val._currentTime),
_playing(val._playing),
_lastUpdate(val._lastUpdate)
{
}
/** Callback method called by the NodeVisitor when visiting a node.*/
virtual void operator()(osg::StateSet* state, osg::NodeVisitor* nv)
{
if (state &&
nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
nv->getFrameStamp() &&
nv->getFrameStamp()->getFrameNumber() != _lastUpdate)
{
_lastUpdate = nv->getFrameStamp()->getFrameNumber();
_currentTime = osg::Timer::instance()->tick();
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
{
osg::Material* material = dynamic_cast<osg::Material*>(state->getAttribute(osg::StateAttribute::MATERIAL));
if (material)
{
osg::Vec4 result;
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
float duration = _sampler->getEndTime() - _sampler->getStartTime();
t = fmod(t, duration);
t += _sampler->getStartTime();
_sampler->getValueAt(t, result);
material->setDiffuse(osg::Material::FRONT_AND_BACK, result);
}
}
}
}
void start() { _startTime = osg::Timer::instance()->tick(); _currentTime = _startTime; _playing = true;}
void stop() { _currentTime = _startTime; _playing = false;}
osg::ref_ptr<osgAnimation::Vec4LinearSampler> _sampler;
osg::Timer_t _startTime;
osg::Timer_t _currentTime;
bool _playing;
int _lastUpdate;
};
osg::Geode* createAxis()
{
osg::Geode* geode = new osg::Geode;
osg::ref_ptr<osg::Geometry> geometry (new osg::Geometry());
osg::ref_ptr<osg::Vec3Array> vertices (new osg::Vec3Array());
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
vertices->push_back (osg::Vec3 ( 10.0, 0.0, 0.0));
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
vertices->push_back (osg::Vec3 ( 0.0, 10.0, 0.0));
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 10.0));
geometry->setVertexArray (vertices.get());
osg::ref_ptr<osg::Vec4Array> colors (new osg::Vec4Array());
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
geometry->setColorArray (colors.get());
geometry->setColorBinding (osg::Geometry::BIND_PER_VERTEX);
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
geode->addDrawable( geometry.get() );
geode->getOrCreateStateSet()->setMode(GL_LIGHTING, false);
return geode;
}
osg::StateSet* setupStateSet()
{
osg::StateSet* st = new osg::StateSet;
st->setAttributeAndModes(new osg::Material, true);
st->setMode(GL_BLEND, true);
AnimtkStateSetUpdateCallback* callback = new AnimtkStateSetUpdateCallback;
osgAnimation::Vec4KeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer();
keys->push_back(osgAnimation::Vec4Keyframe(0, osg::Vec4(0,0,0,0)));
keys->push_back(osgAnimation::Vec4Keyframe(2, osg::Vec4(0.5,0,0,0.5)));
keys->push_back(osgAnimation::Vec4Keyframe(4, osg::Vec4(0,0.5,0,1)));
keys->push_back(osgAnimation::Vec4Keyframe(6, osg::Vec4(0,0,0.5,1)));
keys->push_back(osgAnimation::Vec4Keyframe(8, osg::Vec4(1,1,1,0.5)));
keys->push_back(osgAnimation::Vec4Keyframe(10, osg::Vec4(0,0,0,0)));
callback->start();
st->setUpdateCallback(callback);
return st;
}
osg::Node* setupCube()
{
osg::Geode* geode = new osg::Geode;
geode->addDrawable(new osg::ShapeDrawable(new osg::Box(osg::Vec3(0.0f,0.0f,0.0f),2)));
geode->setStateSet(setupStateSet());
return geode;
}
osg::MatrixTransform* setupAnimtkNode()
{
osg::Vec3 v[5];
v[0] = osg::Vec3(0,0,0);
v[1] = osg::Vec3(10,-50,0);
v[2] = osg::Vec3(30,-10,20);
v[3] = osg::Vec3(-10,20,-20);
v[4] = osg::Vec3(0,0,0);
osg::MatrixTransform* node = new osg::MatrixTransform;
AnimtkUpdateCallback* callback = new AnimtkUpdateCallback;
osgAnimation::Vec3CubicBezierKeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer();
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(0, osgAnimation::Vec3CubicBezier(
v[0], // pos
v[0] + (v[0] - v[3]), // p1
v[1] - (v[1] - v[0]) // p2
)));
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(2, osgAnimation::Vec3CubicBezier(
v[1], // pos
v[1] + (v[1] - v[0]),
v[2] - (v[2] - v[1])
)));
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(4, osgAnimation::Vec3CubicBezier(
v[2], // pos
v[2] + (v[2] - v[1]),
v[3] - (v[3] - v[2])
)));
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(6, osgAnimation::Vec3CubicBezier(
v[3], // pos
v[3] + (v[3] - v[2]),
v[4] - (v[4] - v[3])
)));
keys->push_back(osgAnimation::Vec3CubicBezierKeyframe(8, osgAnimation::Vec3CubicBezier(
v[4], // pos
v[4] + (v[4] - v[3]),
v[0] - (v[0] - v[4])
)));
callback->start();
node->setUpdateCallback(callback);
node->addChild(setupCube());
return node;
}
int main (int argc, char* argv[])
{
osg::ArgumentParser arguments(&argc, argv);
osgViewer::Viewer viewer(arguments);
osgGA::TrackballManipulator* manipulator = new osgGA::TrackballManipulator();
viewer.setCameraManipulator(manipulator);
osg::Group* root = new osg::Group;
root->setInitialBound(osg::BoundingSphere(osg::Vec3(10,0,10), 30));
root->addChild(createAxis());
osg::MatrixTransform* node = setupAnimtkNode();
node->addChild(createAxis());
root->addChild(node);
viewer.setSceneData( root );
viewer.realize();
while (!viewer.done())
{
viewer.frame();
}
}

View File

@@ -0,0 +1,3 @@
SET(TARGET_SRC osganimationskinning.cpp )
SET(TARGET_ADDED_LIBRARIES osgAnimation )
SETUP_EXAMPLE(osganimationskinning)

View File

@@ -0,0 +1,267 @@
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <iostream>
#include <osg/Geometry>
#include <osg/MatrixTransform>
#include <osg/Geode>
#include <osgViewer/Viewer>
#include <osgGA/TrackballManipulator>
#include <osgUtil/SmoothingVisitor>
#include <osg/io_utils>
#include <osgAnimation/Bone>
#include <osgAnimation/Skeleton>
#include <osgAnimation/RigGeometry>
#include <osgAnimation/Skinning>
#include <osgAnimation/BasicAnimationManager>
osg::Geode* createAxis()
{
osg::Geode* geode (new osg::Geode());
osg::Geometry* geometry (new osg::Geometry());
osg::Vec3Array* vertices (new osg::Vec3Array());
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
vertices->push_back (osg::Vec3 ( 1.0, 0.0, 0.0));
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
vertices->push_back (osg::Vec3 ( 0.0, 1.0, 0.0));
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 1.0));
geometry->setVertexArray (vertices);
osg::Vec4Array* colors (new osg::Vec4Array());
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
geometry->setColorArray (colors);
geometry->setColorBinding (osg::Geometry::BIND_PER_VERTEX);
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
geode->addDrawable( geometry );
return geode;
}
osgAnimation::RigGeometry* createTesselatedBox(int nsplit, float size)
{
osgAnimation::RigGeometry* geometry = new osgAnimation::RigGeometry;
osg::ref_ptr<osg::Vec3Array> vertices (new osg::Vec3Array());
osg::ref_ptr<osg::Vec3Array> colors (new osg::Vec3Array());
geometry->setVertexArray (vertices.get());
geometry->setColorArray (colors.get());
geometry->setColorBinding (osg::Geometry::BIND_PER_VERTEX);
float step = size / nsplit;
float s = 0.5/4.0;
for (int i = 0; i < nsplit; i++)
{
float x = -1 + i * step;
std::cout << x << std::endl;
vertices->push_back (osg::Vec3 ( x, s, s));
vertices->push_back (osg::Vec3 ( x, -s, s));
vertices->push_back (osg::Vec3 ( x, -s, -s));
vertices->push_back (osg::Vec3 ( x, s, -s));
osg::Vec3 c (0,0,0);
c[i%3] = 1;
colors->push_back (c);
colors->push_back (c);
colors->push_back (c);
colors->push_back (c);
}
osg::ref_ptr<osg::UIntArray> array = new osg::UIntArray;
for (int i = 0; i < nsplit - 1; i++)
{
int base = i * 4;
array->push_back(base);
array->push_back(base+1);
array->push_back(base+4);
array->push_back(base+1);
array->push_back(base+5);
array->push_back(base+4);
array->push_back(base+3);
array->push_back(base);
array->push_back(base+4);
array->push_back(base+7);
array->push_back(base+3);
array->push_back(base+4);
array->push_back(base+5);
array->push_back(base+1);
array->push_back(base+2);
array->push_back(base+2);
array->push_back(base+6);
array->push_back(base+5);
array->push_back(base+2);
array->push_back(base+3);
array->push_back(base+7);
array->push_back(base+6);
array->push_back(base+2);
array->push_back(base+7);
}
geometry->addPrimitiveSet(new osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES, array->size(), &array->front()));
geometry->setUseDisplayList( false );
return geometry;
}
void initVertexMap(osgAnimation::Bone* b0,
osgAnimation::Bone* b1,
osgAnimation::Bone* b2,
osgAnimation::RigGeometry* geom,
osg::Vec3Array* array)
{
osgAnimation::VertexInfluenceSet vertexesInfluences;
osgAnimation::VertexInfluenceMap* vim = new osgAnimation::VertexInfluenceMap;
(*vim)[b0->getName()].setName(b0->getName());
(*vim)[b1->getName()].setName(b1->getName());
(*vim)[b2->getName()].setName(b2->getName());
for (int i = 0; i < (int)array->size(); i++)
{
float val = (*array)[i][0];
std::cout << val << std::endl;
if (val >= -1 && val <= 0)
(*vim)[b0->getName()].push_back(osgAnimation::VertexIndexWeight(i,1));
else if ( val > 0 && val <= 1)
(*vim)[b1->getName()].push_back(osgAnimation::VertexIndexWeight(i,1));
else if ( val > 1)
(*vim)[b2->getName()].push_back(osgAnimation::VertexIndexWeight(i,1));
}
geom->setInfluenceMap(vim);
}
int main (int argc, char* argv[])
{
osg::ArgumentParser arguments(&argc, argv);
osgViewer::Viewer viewer(arguments);
viewer.setCameraManipulator(new osgGA::TrackballManipulator());
osg::ref_ptr<osgAnimation::Skeleton> skelroot = new osgAnimation::Skeleton;
skelroot->setDefaultUpdateCallback();
osg::ref_ptr<osgAnimation::Bone> root = new osgAnimation::Bone;
{
root->setBindMatrixInBoneSpace(osg::Matrix::identity());
root->setBindMatrixInBoneSpace(osg::Matrix::translate(-1,0,0));
root->setName("root");
root->setDefaultUpdateCallback();
}
osg::ref_ptr<osgAnimation::Bone> right0 = new osgAnimation::Bone;
right0->setBindMatrixInBoneSpace(osg::Matrix::translate(1,0,0));
right0->setName("right0");
right0->setDefaultUpdateCallback("right0");
osg::ref_ptr<osgAnimation::Bone> right1 = new osgAnimation::Bone;
right1->setBindMatrixInBoneSpace(osg::Matrix::translate(1,0,0));
right1->setName("right1");
right1->setDefaultUpdateCallback("right1");
root->addChild(right0.get());
right0->addChild(right1.get());
skelroot->addChild(root.get());
osg::Group* scene = new osg::Group;
osg::ref_ptr<osgAnimation::BasicAnimationManager> manager = new osgAnimation::BasicAnimationManager;
scene->setUpdateCallback(manager.get());
osgAnimation::Animation* anim = new osgAnimation::Animation;
{
osgAnimation::QuatKeyframeContainer* keys0 = new osgAnimation::QuatKeyframeContainer;
osg::Quat rotate;
rotate.makeRotate(osg::PI_2, osg::Vec3(0,0,1));
keys0->push_back(osgAnimation::QuatKeyframe(0,osg::Quat(0,0,0,1)));
keys0->push_back(osgAnimation::QuatKeyframe(3,rotate));
keys0->push_back(osgAnimation::QuatKeyframe(6,rotate));
osgAnimation::QuatSphericalLinearSampler* sampler = new osgAnimation::QuatSphericalLinearSampler;
sampler->setKeyframeContainer(keys0);
// osgAnimation::AnimationUpdateCallback* cb = dynamic_cast<osgAnimation::AnimationUpdateCallback*>(right0->getUpdateCallback());
osgAnimation::QuatSphericalLinearChannel* channel = new osgAnimation::QuatSphericalLinearChannel(sampler);
channel->setName("quaternion");
channel->setTargetName("right0");
anim->addChannel(channel);
}
{
osgAnimation::QuatKeyframeContainer* keys1 = new osgAnimation::QuatKeyframeContainer;
osg::Quat rotate;
rotate.makeRotate(osg::PI_2, osg::Vec3(0,0,1));
keys1->push_back(osgAnimation::QuatKeyframe(0,osg::Quat(0,0,0,1)));
keys1->push_back(osgAnimation::QuatKeyframe(3,osg::Quat(0,0,0,1)));
keys1->push_back(osgAnimation::QuatKeyframe(6,rotate));
osgAnimation::QuatSphericalLinearSampler* sampler = new osgAnimation::QuatSphericalLinearSampler;
sampler->setKeyframeContainer(keys1);
osgAnimation::QuatSphericalLinearChannel* channel = new osgAnimation::QuatSphericalLinearChannel(sampler);
//osgAnimation::AnimationUpdateCallback* cb = dynamic_cast<osgAnimation::AnimationUpdateCallback*>(right1->getUpdateCallback());
channel->setName("quaternion");
channel->setTargetName("right1");
anim->addChannel(channel);
}
manager->registerAnimation(anim);
manager->buildTargetReference();
// let's start !
manager->playAnimation(anim);
// we will use local data from the skeleton
osg::MatrixTransform* rootTransform = new osg::MatrixTransform;
rootTransform->setMatrix(osg::Matrix::rotate(osg::PI_2,osg::Vec3(1,0,0)));
right0->addChild(createAxis());
right0->setDataVariance(osg::Object::DYNAMIC);
right1->addChild(createAxis());
right1->setDataVariance(osg::Object::DYNAMIC);
osg::MatrixTransform* trueroot = new osg::MatrixTransform;
trueroot->setMatrix(osg::Matrix(root->getMatrixInBoneSpace().ptr()));
trueroot->addChild(createAxis());
trueroot->addChild(skelroot.get());
trueroot->setDataVariance(osg::Object::DYNAMIC);
rootTransform->addChild(trueroot);
scene->addChild(rootTransform);
osgAnimation::RigGeometry* geom = createTesselatedBox(4, 4.0);
osg::Geode* geode = new osg::Geode;
geode->addDrawable(geom);
skelroot->addChild(geode);
osg::ref_ptr<osg::Vec3Array> src = dynamic_cast<osg::Vec3Array*>(geom->getVertexArray());
geom->getOrCreateStateSet()->setMode(GL_LIGHTING, false);
geom->setDataVariance(osg::Object::DYNAMIC);
initVertexMap(root.get(), right0.get(), right1.get(), geom, src.get());
// let's run !
viewer.setSceneData( scene );
viewer.realize();
while (!viewer.done())
{
viewer.frame();
}
return 0;
}

View File

@@ -0,0 +1,3 @@
SET(TARGET_SRC osganimationsolid.cpp )
SET(TARGET_ADDED_LIBRARIES osgAnimation )
SETUP_EXAMPLE(osganimationsolid)

View File

@@ -0,0 +1,121 @@
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <iostream>
#include <osg/Geometry>
#include <osg/Shape>
#include <osg/ShapeDrawable>
#include <osgViewer/Viewer>
#include <osgGA/TrackballManipulator>
#include <osg/MatrixTransform>
#include <osgAnimation/BasicAnimationManager>
#include <osgAnimation/Channel>
#include <osgAnimation/UpdateCallback>
using namespace osgAnimation;
osg::ref_ptr<osg::Geode> createAxis()
{
osg::ref_ptr<osg::Geode> geode (new osg::Geode());
osg::ref_ptr<osg::Geometry> geometry (new osg::Geometry());
osg::ref_ptr<osg::Vec3Array> vertices (new osg::Vec3Array());
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
vertices->push_back (osg::Vec3 ( 10.0, 0.0, 0.0));
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
vertices->push_back (osg::Vec3 ( 0.0, 10.0, 0.0));
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 0.0));
vertices->push_back (osg::Vec3 ( 0.0, 0.0, 10.0));
geometry->setVertexArray (vertices.get());
osg::ref_ptr<osg::Vec4Array> colors (new osg::Vec4Array());
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
colors->push_back (osg::Vec4 (1.0f, 0.0f, 0.0f, 1.0f));
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
geometry->setColorArray (colors.get());
geometry->setColorBinding (osg::Geometry::BIND_PER_VERTEX);
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
geode->addDrawable( geometry.get() );
geode->getOrCreateStateSet()->setMode(GL_LIGHTING, false);
return geode;
}
int main (int argc, char* argv[])
{
osg::ArgumentParser arguments(&argc, argv);
osgViewer::Viewer viewer(arguments);
viewer.setCameraManipulator(new osgGA::TrackballManipulator());
osg::Group* root = new osg::Group;
osg::ref_ptr<osg::Geode> axe = createAxis();
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
geode->addDrawable(new osg::ShapeDrawable(new osg::Box(osg::Vec3(0.0f,0.0f,0.0f),0.5)));
osg::ref_ptr<osg::MatrixTransform> trans = new osg::MatrixTransform();
trans->setName("AnimatedNode");
trans->setDataVariance(osg::Object::DYNAMIC);
trans->setUpdateCallback(new osgAnimation::UpdateTransform("AnimatedCallback"));
trans->setMatrix(osg::Matrix::identity());
trans->addChild (geode.get());
root->addChild (axe.get());
root->addChild (trans.get());
// Define a scheduler for our animations
osg::Group* grp = new osg::Group;
osgAnimation::BasicAnimationManager* mng = new osgAnimation::BasicAnimationManager();
grp->setUpdateCallback(mng);
grp->addChild(root);
// And we finaly define our channel
osgAnimation::Vec3LinearChannel* channelAnimation1 = new osgAnimation::Vec3LinearChannel;
channelAnimation1->setTargetName("AnimatedCallback");
channelAnimation1->setName("position");
channelAnimation1->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::Vec3Keyframe(0, osg::Vec3(0,0,0)));
channelAnimation1->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::Vec3Keyframe(2, osg::Vec3(1,1,0)));
osgAnimation::Animation* anim1 = new osgAnimation::Animation;
anim1->addChannel(channelAnimation1);
anim1->setPlaymode(osgAnimation::Animation::PPONG);
osgAnimation::Vec3LinearChannel* channelAnimation2 = new osgAnimation::Vec3LinearChannel;
channelAnimation2->setTargetName("AnimatedCallback");
channelAnimation2->setName("euler");
channelAnimation2->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::Vec3Keyframe(0, osg::Vec3(0,0,0)));
channelAnimation2->getOrCreateSampler()->getOrCreateKeyframeContainer()->push_back(osgAnimation::Vec3Keyframe(1.5, osg::Vec3(2*osg::PI,0,0)));
osgAnimation::Animation* anim2 = new osgAnimation::Animation;
anim2->addChannel(channelAnimation2);
anim2->setPlaymode(osgAnimation::Animation::LOOP);
// We register all animation inside the scheduler
mng->registerAnimation(anim1);
mng->registerAnimation(anim2);
mng->playAnimation(anim1);
mng->playAnimation(anim2);
viewer.setSceneData( grp );
return viewer.run();
}

View File

@@ -0,0 +1,3 @@
SET(TARGET_SRC osganimationtimeline.cpp )
SET(TARGET_ADDED_LIBRARIES osgAnimation )
SETUP_EXAMPLE(osganimationtimeline)

View File

@@ -0,0 +1,218 @@
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net>
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <iostream>
#include <osgDB/ReadFile>
#include <osgViewer/ViewerEventHandlers>
#include <osgGA/TrackballManipulator>
#include <osgGA/FlightManipulator>
#include <osgGA/DriveManipulator>
#include <osgGA/KeySwitchMatrixManipulator>
#include <osgGA/StateSetManipulator>
#include <osgGA/AnimationPathManipulator>
#include <osgGA/TerrainManipulator>
#include <osgAnimation/Bone>
#include <osgAnimation/Skeleton>
#include <osgAnimation/RigGeometry>
#include <osgAnimation/Skinning>
#include <osgAnimation/Timeline>
#include <osgAnimation/AnimationManagerBase>
#include <osgAnimation/TimelineAnimationManager>
struct NoseBegin : public osgAnimation::Action::Callback
{
virtual void operator()(osgAnimation::Action* action)
{
std::cout << "sacrebleu, it scratches my nose, let me scratch it" << std::endl;
std::cout << "process NoseBegin call back " << action->getName() << std::endl << std::endl;
}
};
struct NoseEnd : public osgAnimation::Action::Callback
{
virtual void operator()(osgAnimation::Action* action)
{
std::cout << "shhhrt shrrrrt shhhhhhrrrrt, haaa it's better"<< std::endl;
std::cout << "process NoseEnd call back " << action->getName() << std::endl << std::endl;
}
};
struct ExampleTimelineUsage : public osgGA::GUIEventHandler
{
osg::ref_ptr<osgAnimation::StripAnimation> _mainLoop;
osg::ref_ptr<osgAnimation::StripAnimation> _scratchHead;
osg::ref_ptr<osgAnimation::StripAnimation> _scratchNose;
osg::ref_ptr<osgAnimation::TimelineAnimationManager> _manager;
bool _releaseKey;
ExampleTimelineUsage(osgAnimation::TimelineAnimationManager* manager)
{
_releaseKey = false;
_manager = manager;
const osgAnimation::AnimationList& list = _manager->getAnimationList();
osgAnimation::AnimationMap map;
for (osgAnimation::AnimationList::const_iterator it = list.begin(); it != list.end(); it++)
map[(*it)->getName()] = *it;
_mainLoop = new osgAnimation::StripAnimation(map["Idle_Main"].get(),0.0,0.0);
_mainLoop->setLoop(0); // means forever
_scratchHead = new osgAnimation::StripAnimation(map["Idle_Head_Scratch.02"].get(),0.2,0.3);
_scratchHead->setLoop(1); // one time
map["Idle_Nose_Scratch.01"]->setDuration(10.0); // set this animation duration to 10 seconds
_scratchNose = new osgAnimation::StripAnimation(map["Idle_Nose_Scratch.01"].get(),0.2,0.3);
_scratchNose->setLoop(1); // one time
// add the main loop at priority 0 at time 0.
osgAnimation::Timeline* tml = _manager->getTimeline();
tml->play();
tml->addActionAt(0.0, _mainLoop.get(), 0);
// add a scratch head priority 1 at 3.0 second.
tml->addActionAt(5.0, _scratchHead.get(), 1);
// populate time with scratch head
for (int i = 1; i < 20; i++)
{
// we add a scratch head priority 1 each 10 second
// note:
// it's possible to add the same instance more then once on the timeline
// the only things you need to take care is if you remove it. It will remove
// all instance that exist on the timeline. If you need to differtiate
// it's better to create a new instance
tml->addActionAt(5.0 + 10.0 * i, _scratchHead.get(), 1);
}
// we will add the scratch nose action only when the player hit a key
// in the operator()
// now we will add callback at end and begin of animation of Idle_Nose_Scratch.02
_scratchNose->setCallback(0.0, new NoseBegin);
_scratchNose->setCallback(_scratchNose->getNumFrames()-1, new NoseEnd);
}
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter&)
{
if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP)
{
_releaseKey = true;
}
return false;
}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
if (nv && nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
{
if (_releaseKey) // we hit a key and release it execute an action
{
osgAnimation::Timeline* tml = _manager->getTimeline();
// dont play if already playing
if (!tml->isActive(_scratchNose.get()))
{
// add this animation on top of two other
// we add one to evaluate the animation at the next frame, else we
// will miss the current frame
tml->addActionAt(tml->getCurrentFrame() + 1, _scratchNose.get(), 2);
}
_releaseKey = false;
}
}
else
{
osgGA::EventVisitor* ev = dynamic_cast<osgGA::EventVisitor*>(nv);
if (ev && ev->getActionAdapter() && !ev->getEvents().empty())
{
for(osgGA::EventQueue::Events::iterator itr = ev->getEvents().begin();
itr != ev->getEvents().end();
++itr)
{
handleWithCheckAgainstIgnoreHandledEventsMask(*(*itr), *(ev->getActionAdapter()), node, nv);
}
}
}
traverse(node, nv);
}
};
int main (int argc, char* argv[])
{
std::cerr << "This example works only with nathan.osg" << std::endl;
osg::ArgumentParser psr(&argc, argv);
osgViewer::Viewer viewer(psr);
std::string file = "nathan.osg";
if(argc >= 2)
file = psr[1];
// replace the manager
osg::Group* root = dynamic_cast<osg::Group*>(osgDB::readNodeFile(file));
if (!root) {
osg::notify(osg::FATAL) << "can't read file " << file << std::endl;
return 1;
}
osgAnimation::AnimationManagerBase* animationManager = dynamic_cast<osgAnimation::AnimationManagerBase*>(root->getUpdateCallback());
if(!animationManager)
{
osg::notify(osg::FATAL) << "Did not find AnimationManagerBase updateCallback needed to animate elements" << std::endl;
return 1;
}
osg::ref_ptr<osgAnimation::TimelineAnimationManager> tl = new osgAnimation::TimelineAnimationManager(*animationManager);
root->setUpdateCallback(tl.get());
ExampleTimelineUsage* callback = new ExampleTimelineUsage(tl.get());
root->setEventCallback(callback);
root->getUpdateCallback()->addNestedCallback(callback);
// add the state manipulator
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
// add the thread model handler
viewer.addEventHandler(new osgViewer::ThreadingHandler);
// add the window size toggle handler
viewer.addEventHandler(new osgViewer::WindowSizeHandler);
// add the stats handler
viewer.addEventHandler(new osgViewer::StatsHandler);
// add the help handler
viewer.addEventHandler(new osgViewer::HelpHandler(psr.getApplicationUsage()));
// add the LOD Scale handler
viewer.addEventHandler(new osgViewer::LODScaleHandler);
// add the screen capture handler
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
viewer.setSceneData(root);
return viewer.run();
}

View File

@@ -0,0 +1,124 @@
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*
* Authors:
* Cedric Pinson <mornifle@plopbyte.net>
* jeremy Moles <jeremy@emperorlinux.com>
*/
#ifndef ANIMTKVIEWER_H
#define ANIMTKVIEWER_H
#include <osg/Node>
#include <osgDB/ReadFile>
#include <osgAnimation/BasicAnimationManager>
class AnimtkViewerModelController
{
public:
typedef std::vector<std::string> AnimationMapVector;
static AnimtkViewerModelController& instance()
{
static AnimtkViewerModelController avmc;
return avmc;
}
static bool setModel(osgAnimation::BasicAnimationManager* model)
{
AnimtkViewerModelController& self = instance();
self._model = model;
for (osgAnimation::AnimationList::const_iterator it = self._model->getAnimationList().begin(); it != self._model->getAnimationList().end(); it++)
self._map[(*it)->getName()] = *it;
for(osgAnimation::AnimationMap::iterator it = self._map.begin(); it != self._map.end(); it++)
self._amv.push_back(it->first);
return true;
}
bool list()
{
std::cout << "Animation List:" << std::endl;
for(osgAnimation::AnimationMap::iterator it = _map.begin(); it != _map.end(); it++)
std::cout << it->first << std::endl;
return true;
}
bool play()
{
if(_focus < _amv.size())
{
std::cout << "Play " << _amv[_focus] << std::endl;
_model->playAnimation(_map[_amv[_focus]].get());
return true;
}
return false;
}
bool stop()
{
if(_focus < _amv.size())
{
std::cout << "Stop " << _amv[_focus] << std::endl;
_model->stopAnimation(_map[_amv[_focus]].get());
return true;
}
return false;
}
bool next()
{
_focus = (_focus + 1) % _map.size();
std::cout << "Current now is " << _amv[_focus] << std::endl;
return true;
}
bool previous()
{
_focus = (_map.size() + _focus - 1) % _map.size();
std::cout << "Current now is " << _amv[_focus] << std::endl;
return true;
}
bool playByName(const std::string& name)
{
for(unsigned int i = 0; i < _amv.size(); i++) if(_amv[i] == name) _focus = i;
_model->playAnimation(_map[name].get());
return true;
}
const std::string& getCurrentAnimationName() const
{
return _amv[_focus];
}
const AnimationMapVector& getAnimationMap() const
{
return _amv;
}
private:
osg::ref_ptr<osgAnimation::BasicAnimationManager> _model;
osgAnimation::AnimationMap _map;
AnimationMapVector _amv;
unsigned int _focus;
AnimtkViewerModelController():
_model(0),
_focus(0) {}
};
#endif

View File

@@ -0,0 +1,174 @@
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*
* Authors:
* Cedric Pinson <mornifle@plopbyte.net>
* jeremy Moles <jeremy@emperorlinux.com>
*/
#include "AnimtkViewerKeyHandler"
#include "AnimtkViewerGUI"
#include <iostream>
#include <osg/io_utils>
#include <osg/Geometry>
#include <osg/MatrixTransform>
#include <osg/Geode>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgWidget/ViewerEventHandlers>
#include <osgGA/TrackballManipulator>
#include <osgGA/StateSetManipulator>
#include <osgDB/ReadFile>
#include <osgAnimation/AnimationManagerBase>
#include <osgAnimation/Bone>
const int WIDTH = 1440;
const int HEIGHT = 900;
osg::Geode* createAxis()
{
osg::Geode* geode = new osg::Geode();
osg::Geometry* geometry = new osg::Geometry();
osg::Vec3Array* vertices = new osg::Vec3Array();
osg::Vec4Array* colors = new osg::Vec4Array();
vertices->push_back(osg::Vec3(0.0f, 0.0f, 0.0f));
vertices->push_back(osg::Vec3(1.0f, 0.0f, 0.0f));
vertices->push_back(osg::Vec3(0.0f, 0.0f, 0.0f));
vertices->push_back(osg::Vec3(0.0f, 1.0f, 0.0f));
vertices->push_back(osg::Vec3(0.0f, 0.0f, 0.0f));
vertices->push_back(osg::Vec3(0.0f, 0.0f, 1.0f));
colors->push_back(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f));
colors->push_back(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f));
colors->push_back(osg::Vec4(0.0f, 1.0f, 0.0f, 1.0f));
colors->push_back(osg::Vec4(0.0f, 1.0f, 0.0f, 1.0f));
colors->push_back(osg::Vec4(0.0f, 0.0f, 1.0f, 1.0f));
colors->push_back(osg::Vec4(0.0f, 0.0f, 1.0f, 1.0f));
geometry->setVertexArray(vertices);
geometry->setColorArray(colors);
geometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES, 0, 6));
geometry->getOrCreateStateSet()->setMode(GL_LIGHTING, false);
geode->addDrawable(geometry);
return geode;
}
struct AnimationManagerFinder : public osg::NodeVisitor
{
osg::ref_ptr<osgAnimation::BasicAnimationManager> _am;
AnimationManagerFinder() : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {}
void apply(osg::Node& node) {
if (_am.valid())
return;
if (node.getUpdateCallback()) {
osgAnimation::AnimationManagerBase* b = dynamic_cast<osgAnimation::AnimationManagerBase*>(node.getUpdateCallback());
if (b) {
_am = new osgAnimation::BasicAnimationManager(*b);
return;
}
}
traverse(node);
}
};
struct AddHelperBone : public osg::NodeVisitor
{
AddHelperBone() : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {}
void apply(osg::Transform& node) {
osgAnimation::Bone* bone = dynamic_cast<osgAnimation::Bone*>(&node);
if (bone)
bone->addChild(createAxis());
traverse(node);
}
};
int main(int argc, char** argv)
{
osg::ArgumentParser arguments(&argc, argv);
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is a 3d poker game client");
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","List command line options.");
arguments.getApplicationUsage()->addCommandLineOption("--drawbone","draw helps to display bones.");
if (arguments.read("-h") || arguments.read("--help"))
{
arguments.getApplicationUsage()->write(std::cout, osg::ApplicationUsage::COMMAND_LINE_OPTION);
return 0;
}
if (arguments.argc()<=1)
{
arguments.getApplicationUsage()->write(std::cout, osg::ApplicationUsage::COMMAND_LINE_OPTION);
return 1;
}
bool drawBone = false;
if (arguments.read("--drawbone"))
drawBone = true;
osgViewer::Viewer viewer(arguments);
osg::ref_ptr<osg::Group> group = new osg::Group();
osg::Group* node = dynamic_cast<osg::Group*>(osgDB::readNodeFiles(arguments)); //dynamic_cast<osgAnimation::AnimationManager*>(osgDB::readNodeFile(psr[1]));
if(!node)
{
std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl;
return 1;
}
// Set our Singleton's model.
AnimationManagerFinder finder;
node->accept(finder);
if (finder._am.valid()) {
node->setUpdateCallback(finder._am.get());
AnimtkViewerModelController::setModel(finder._am.get());
} else {
osg::notify(osg::WARN) << "no osgAnimation::AnimationManagerBase found in the subgraph, no animations available" << std::endl;
}
if (drawBone) {
osg::notify(osg::INFO) << "Add Bones Helper" << std::endl;
AddHelperBone addHelper;
node->accept(addHelper);
}
node->addChild(createAxis());
AnimtkViewerGUI* gui = new AnimtkViewerGUI(&viewer, WIDTH, HEIGHT, 0x1234);
osg::Camera* camera = gui->createParentOrthoCamera();
node->setNodeMask(0x0001);
group->addChild(node);
group->addChild(camera);
viewer.addEventHandler(new AnimtkKeyEventHandler());
viewer.addEventHandler(new osgViewer::StatsHandler());
viewer.addEventHandler(new osgViewer::WindowSizeHandler());
viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));
viewer.addEventHandler(new osgWidget::MouseHandler(gui));
viewer.addEventHandler(new osgWidget::KeyboardHandler(gui));
viewer.addEventHandler(new osgWidget::ResizeHandler(gui, camera));
viewer.setSceneData(group.get());
viewer.setUpViewInWindow(40, 40, WIDTH, HEIGHT);
return viewer.run();
}

View File

@@ -0,0 +1,46 @@
/* -*-c++-*-
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
Authors:
Jeremy Moles <jeremy@emperorlinux.com>
Cedric Pinson <mornifle@plopbyte.net>
*/
#ifndef ANIMTKVIEWERGUI_H
#define ANIMTKVIEWERGUI_H
#include <osgWidget/WindowManager>
class AnimtkViewerGUI: public osgWidget::WindowManager {
osg::ref_ptr<osgWidget::Box> _buttonBox;
osg::ref_ptr<osgWidget::Box> _listBox;
osg::ref_ptr<osgWidget::Box> _labelBox;
protected:
osgWidget::Widget* _createButton(const std::string&);
bool _buttonPush(osgWidget::Event&);
bool _listMouseHover(osgWidget::Event&);
void _createButtonBox();
void _createListBox();
void _createLabelBox();
public:
AnimtkViewerGUI(osgViewer::View*, float, float, unsigned int);
};
#endif

View File

@@ -0,0 +1,407 @@
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*
* Authors:
* Cedric Pinson <mornifle@plopbyte.net>
* jeremy Moles <jeremy@emperorlinux.com>
*/
#include "AnimtkViewer"
#include "AnimtkViewerGUI"
#include <osg/Version>
#include <osgWidget/WindowManager>
#include <osgAnimation/EaseMotion>
const std::string IMAGE_PATH = "osgWidget/";
template <class T>
struct Sampler: public osg::Drawable::UpdateCallback
{
T _motion;
Sampler() {
}
};
typedef Sampler<osgAnimation::OutQuadMotion> WidgetSampler;
struct ButtonFunctor: public WidgetSampler
{
float _direction;
float _previous;
const float _speed;
ButtonFunctor(): _speed(5) { _direction = -_speed; _previous = 0;}
bool enter(osgWidget::Event&)
{
_direction = _speed;
return true;
}
bool leave(osgWidget::Event&)
{
_direction = -_speed;
return true;
}
void update(osg::NodeVisitor* nv , osg::Drawable* geom)
{
const osg::FrameStamp* f = nv->getFrameStamp();
float dt = f->getSimulationTime() - _previous;
_previous = f->getSimulationTime();
update(dt,dynamic_cast<osgWidget::Widget*>(geom));
}
void update(float t, osgWidget::Widget* w)
{
if (!w) return;
_motion.update(t*_direction);
float val = _motion.getValue()*0.5;
val += 0.5;
if (val >= 1.0)
val = 1.0;
w->setColor(osg::Vec4(val, val, val, 1));
}
};
struct LabelFunctor: public WidgetSampler
{
float _previous;
bool _active;
const float _fadeOutTime;
osgAnimation::OutCubicMotion _scaleSampler;
LabelFunctor():
_fadeOutTime(1.5f)
{
_previous = 0.0f;
_active = false;
_scaleSampler = osgAnimation::OutCubicMotion(0.5, 1.0, 1.0);
}
void setActive(bool active)
{
_active = active;
if(active) _motion.reset();
_scaleSampler.reset();
}
void update(osg::NodeVisitor* nv , osg::Drawable* geom)
{
const osg::FrameStamp* f = nv->getFrameStamp();
float st = f->getSimulationTime();
float dt = st - _previous;
_previous = st;
if(!_active) return;
update(dt, dynamic_cast<osgWidget::Label*>(geom));
updateScale(dt, dynamic_cast<osgWidget::Label*>(geom));
}
void update(float t, osgWidget::Label* w)
{
if(!w) return;
_motion.update(t / _fadeOutTime);
float val = _motion.getValue();
if(val >= 1.0f) {
_motion.reset();
_active = false;
}
w->setFontColor(osg::Vec4(0.0f, 0.0f, 0.0f, (1.0f - val) * 0.7f));
}
void updateScale(float t, osgWidget::Label* w)
{
_scaleSampler.update(t);
float val = _scaleSampler.getValue();
osgWidget::Window* win = w->getParent();
win->setScale(val);
win->update();
}
};
struct ListFunctor: public osg::NodeCallback
{
float _previous;
int _direction;
osgAnimation::InQuadMotion _transformSampler;
ListFunctor()
{
_direction = 1;
_previous = 0;
_transformSampler.update(1.0f);
}
void toggleShown()
{
if(_direction == 1) _direction = -1;
else _direction = 1;
}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
const osg::FrameStamp* f = nv->getFrameStamp();
float st = f->getSimulationTime();
float dt = st - _previous;
_previous = st;
_transformSampler.update((dt * _direction) / 0.5f);
float val = _transformSampler.getValue();
if(val > 1.0f || val < 0.0f) return;
osgWidget::Window* win = dynamic_cast<osgWidget::Window*>(node);
float w = win->getWidth();
float wmw = win->getWindowManager()->getWidth();
win->setX((wmw - w) + (val * w));
win->update();
}
};
// This is a temporary hack to "prevent" dragging on Widgets and Windows.
bool eatDrag(osgWidget::Event&)
{
return true;
}
AnimtkViewerGUI::AnimtkViewerGUI(osgViewer::View* view, float w, float h, unsigned int mask):
osgWidget::WindowManager(view, w, h, mask, 0)
{
_createButtonBox();
_createLabelBox();
_createListBox();
_labelBox->setAnchorHorizontal(osgWidget::Window::HA_LEFT);
_labelBox->setY(74.0f);
_labelBox->setVisibilityMode(osgWidget::Window::VM_ENTIRE);
_listBox->setOrigin(getWidth(), 74.0f);
addChild(_buttonBox.get());
addChild(_labelBox.get());
addChild(_listBox.get());
resizeAllWindows();
// Remember, you can't call resizePercent until AFTER the box is parented
// by a WindowManager; how could it possibly resize itself if it doesn't know
// how large it's viewable area is?
_buttonBox->resizePercent(100.0f);
_buttonBox->resizeAdd(0.0f, 10.0f);
}
osgWidget::Widget* AnimtkViewerGUI::_createButton(const std::string& name)
{
osgWidget::Widget* b = new osgWidget::Widget(name, 64.0f, 64.0f);
if(!b) return 0;
b->setImage(IMAGE_PATH + name + ".png", true);
b->setEventMask(osgWidget::EVENT_MASK_MOUSE_DRAG);
ButtonFunctor* bt = new ButtonFunctor();
b->setUpdateCallback(bt);
b->addCallback(new osgWidget::Callback(&ButtonFunctor::enter, bt, osgWidget::EVENT_MOUSE_ENTER));
b->addCallback(new osgWidget::Callback(&ButtonFunctor::leave, bt, osgWidget::EVENT_MOUSE_LEAVE));
b->addCallback(new osgWidget::Callback(&AnimtkViewerGUI::_buttonPush, this, osgWidget::EVENT_MOUSE_PUSH));
b->addCallback(new osgWidget::Callback(&eatDrag, osgWidget::EVENT_MOUSE_DRAG));
return b;
}
bool AnimtkViewerGUI::_listMouseHover(osgWidget::Event& ev)
{
osgWidget::Label* l = dynamic_cast<osgWidget::Label*>(ev.getWidget());
if(!l) return false;
if(ev.type == osgWidget::EVENT_MOUSE_ENTER) l->setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
else if(ev.type == osgWidget::EVENT_MOUSE_LEAVE) l->setFontColor(1.0f, 1.0f, 1.0f, 0.3f);
else if(ev.type == osgWidget::EVENT_MOUSE_PUSH) {
AnimtkViewerModelController::instance().playByName(ev.getWidget()->getName());
}
else return false;
return true;
}
bool AnimtkViewerGUI::_buttonPush(osgWidget::Event& ev)
{
if(!ev.getWidget()) return false;
osgWidget::Label* l = static_cast<osgWidget::Label*>(_labelBox->getByName("label"));
if(!l) return false;
LabelFunctor* lf = dynamic_cast<LabelFunctor*>(l->getUpdateCallback());
if(!lf) return false;
// We're safe at this point, so begin processing.
AnimtkViewerModelController& mc = AnimtkViewerModelController::instance();
std::string name = ev.getWidget()->getName();
if(name == "play") mc.play();
else if(name == "stop") mc.stop();
else if(name == "next")
{
mc.next();
l->setFontColor(osg::Vec4(0.0f, 0.0f, 0.0f, 0.7f));
l->setLabel(mc.getCurrentAnimationName());
lf->setActive(true);
}
else if(name == "back")
{
mc.previous();
l->setFontColor(osg::Vec4(0.0f, 0.0f, 0.0f, 0.7f));
l->setLabel(mc.getCurrentAnimationName());
lf->setActive(true);
}
else if(name == "pause")
{
}
else if(name == "open")
{
ListFunctor* lsf = dynamic_cast<ListFunctor*>(_listBox->getUpdateCallback());
if(!lsf) return false;
lsf->toggleShown();
}
else return false;
return true;
}
void AnimtkViewerGUI::_createButtonBox()
{
_buttonBox = new osgWidget::Box("buttonBox", osgWidget::Box::HORIZONTAL);
osgWidget::Widget* space = new osgWidget::Widget("nullSpace", 0.0f, 0.0f);
osgWidget::Widget* back = _createButton("back");
osgWidget::Widget* next = _createButton("next");
osgWidget::Widget* play = _createButton("play");
osgWidget::Widget* pause = _createButton("pause");
osgWidget::Widget* stop = _createButton("stop");
osgWidget::Widget* open = _createButton("open");
space->setCanFill(true);
space->setColor(0.0f, 0.0f, 0.0f, 0.0f);
_buttonBox->addWidget(space);
_buttonBox->addWidget(back);
_buttonBox->addWidget(next);
_buttonBox->addWidget(play);
_buttonBox->addWidget(pause);
_buttonBox->addWidget(stop);
_buttonBox->addWidget(open);
_buttonBox->addWidget(osg::clone(space, "space1", osg::CopyOp::DEEP_COPY_ALL));
_buttonBox->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.7f);
_buttonBox->setEventMask(osgWidget::EVENT_MASK_MOUSE_DRAG);
_buttonBox->addCallback(new osgWidget::Callback(&eatDrag, osgWidget::EVENT_MOUSE_DRAG));
}
void AnimtkViewerGUI::_createListBox()
{
_listBox = new osgWidget::Box("listBox", osgWidget::Box::VERTICAL);
const AnimtkViewerModelController::AnimationMapVector& amv =
AnimtkViewerModelController::instance().getAnimationMap()
;
for(
AnimtkViewerModelController::AnimationMapVector::const_iterator i = amv.begin();
i != amv.end();
i++
)
{
osgWidget::Label* label = new osgWidget::Label(*i);
label->setCanFill(true);
label->setFont("fonts/Vera.ttf");
label->setFontSize(15);
label->setFontColor(1.0f, 1.0f, 1.0f, 0.3f);
label->setPadding(5.0f);
label->setAlignHorizontal(osgWidget::Widget::HA_RIGHT);
label->setLabel(*i);
label->setEventMask(osgWidget::EVENT_MASK_MOUSE_DRAG);
label->addCallback(new osgWidget::Callback(&AnimtkViewerGUI::_listMouseHover, this, osgWidget::EVENT_MOUSE_ENTER));
label->addCallback(new osgWidget::Callback(&AnimtkViewerGUI::_listMouseHover, this, osgWidget::EVENT_MOUSE_LEAVE));
label->addCallback(new osgWidget::Callback(&AnimtkViewerGUI::_listMouseHover, this, osgWidget::EVENT_MOUSE_PUSH));
_listBox->addWidget(label);
}
ListFunctor* lf = new ListFunctor();
_listBox->setUpdateCallback(lf);
_listBox->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.7f);
}
void AnimtkViewerGUI::_createLabelBox()
{
_labelBox = new osgWidget::Box("labelBox", osgWidget::Box::VERTICAL);
osgWidget::Label* label = new osgWidget::Label("label");
label->setFont("fonts/Vera.ttf");
label->setFontSize(50);
label->setFontColor(0.0f, 0.0f, 0.0f, 0.7f);
label->setAlignHorizontal(osgWidget::Widget::HA_LEFT);
label->setPadding(10.0f);
LabelFunctor* lf = new LabelFunctor();
label->setUpdateCallback(lf);
_labelBox->addWidget(label);
_labelBox->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.0f);
}

View File

@@ -0,0 +1,53 @@
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Authors:
*
* Cedric Pinson <mornifle@plopbyte.net>
*
*/
#ifndef ANIMTKVIEWER_KEYHANDLER_H
#define ANIMTKVIEWER_KEYHANDLER_H
#include "AnimtkViewer"
#include <osgGA/GUIEventHandler>
class AnimtkKeyEventHandler : public osgGA::GUIEventHandler
{
public:
AnimtkKeyEventHandler();
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa,
osg::Object*, osg::NodeVisitor*);
void printUsage() const;
protected:
enum Binding
{
List,
Help,
Play,
Next,
Prev
};
std::map<Binding, int> _actionKeys;
};
#endif

View File

@@ -0,0 +1,63 @@
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Authors:
*
* Cedric Pinson <mornifle@plopbyte.net>
*
*/
#include "AnimtkViewerKeyHandler"
AnimtkKeyEventHandler::AnimtkKeyEventHandler()
{
_actionKeys[List] = 'l';
_actionKeys[Help] = 'h';
_actionKeys[Play] = 'p';
_actionKeys[Next] = ']';
_actionKeys[Prev] = '[';
}
void AnimtkKeyEventHandler::printUsage() const
{
std::cout << (char) _actionKeys.find(Help)->second << " for Help" << std::endl;
std::cout << (char) _actionKeys.find(List)->second << " for List" << std::endl;
std::cout << (char) _actionKeys.find(Play)->second << " for Play" << std::endl;
std::cout << (char) _actionKeys.find(Next)->second << " for select Next item" << std::endl;
std::cout << (char) _actionKeys.find(Prev)->second << " for select Previous item" << std::endl;
}
bool AnimtkKeyEventHandler::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter&,
osg::Object*, osg::NodeVisitor*)
{
AnimtkViewerModelController& mc = AnimtkViewerModelController::instance();
if(ea.getEventType() == osgGA::GUIEventAdapter::KEYDOWN)
{
if (ea.getKey() == _actionKeys[List]) return mc.list();
else if (ea.getKey() == _actionKeys[Play]) return mc.play();
else if (ea.getKey() == _actionKeys[Next]) return mc.next();
else if (ea.getKey() == _actionKeys[Prev]) return mc.previous();
else if (ea.getKey() == _actionKeys[Help])
{
printUsage();
return true;
}
}
return false;
}

View File

@@ -0,0 +1,7 @@
SET(TARGET_SRC
AnimtkViewer.cpp
AnimtkViewerKeyHandler.cpp
AnimtkViewerGUI.cpp
)
SET(TARGET_ADDED_LIBRARIES osgAnimation osgWidget)
SETUP_EXAMPLE(osganimationviewer)

View File

@@ -0,0 +1,4 @@
SET(TARGET_SRC osgautocapture.cpp )
#### end var setup ###
SETUP_EXAMPLE(osgautocapture)

View File

@@ -0,0 +1,346 @@
/**
* TODO:
* 1) Change example to use offscreen rendering (pbuffer) so that it becomes a true commandline tool with now windows
* 2) Make example work with other threading models than SingleThreaded
* 3) Add support for autocapture to movies
*
*/
#include <osg/ArgumentParser>
#include <osg/CoordinateSystemNode>
#include <osg/Matrix>
#include <osg/NodeVisitor>
#include <osgUtil/IntersectionVisitor>
#include <osgUtil/GLObjectsVisitor>
#include <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include <osgGA/DriveManipulator>
#include <osgGA/FlightManipulator>
#include <osgGA/KeySwitchMatrixManipulator>
#include <osgGA/TerrainManipulator>
#include <osgGA/TrackballManipulator>
#include <osgTerrain/Terrain>
#include <osgTerrain/GeometryTechnique>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgViewer/Renderer>
#include <iostream>
#include <sstream>
/** Helper class*/
template<class T>
class FindTopMostNodeOfTypeVisitor : public osg::NodeVisitor
{
public:
FindTopMostNodeOfTypeVisitor():
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
_foundNode(0)
{}
void apply(osg::Node& node)
{
T* result = dynamic_cast<T*>(&node);
if (result)
_foundNode = result;
else
traverse(node);
}
T* _foundNode;
};
/** Convenience function*/
template<class T>
T* findTopMostNodeOfType(osg::Node* node)
{
if (!node) return 0;
FindTopMostNodeOfTypeVisitor<T> fnotv;
node->accept(fnotv);
return fnotv._foundNode;
}
/** Capture the frame buffer and write image to disk*/
class WindowCaptureCallback : public osg::Camera::DrawCallback
{
public:
WindowCaptureCallback(GLenum readBuffer, const std::string& name):
_readBuffer(readBuffer),
_fileName(name)
{
_image = new osg::Image;
}
virtual void operator () (osg::RenderInfo& renderInfo) const
{
glReadBuffer(_readBuffer);
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
osg::GraphicsContext* gc = renderInfo.getState()->getGraphicsContext();
if (gc->getTraits())
{
GLenum pixelFormat;
if (gc->getTraits()->alpha)
pixelFormat = GL_RGBA;
else
pixelFormat = GL_RGB;
int width = gc->getTraits()->width;
int height = gc->getTraits()->height;
std::cout<<"Capture: size="<<width<<"x"<<height<<", format="<<(pixelFormat == GL_RGBA ? "GL_RGBA":"GL_RGB")<<std::endl;
_image->readPixels(0, 0, width, height, pixelFormat, GL_UNSIGNED_BYTE);
}
if (!_fileName.empty())
{
std::cout << "Writing to: " << _fileName << std::endl;
osgDB::writeImageFile(*_image, _fileName);
}
}
protected:
GLenum _readBuffer;
std::string _fileName;
osg::ref_ptr<osg::Image> _image;
mutable OpenThreads::Mutex _mutex;
};
/** Do Culling only while loading PagedLODs*/
class CustomRenderer : public osgViewer::Renderer
{
public:
CustomRenderer(osg::Camera* camera)
: osgViewer::Renderer(camera),
_cullOnly(true)
{
setTargetFrameRate(1);
setMinimumTimeAvailableForGLCompileAndDeletePerFrame(1);
}
/** Set flag to omit drawing in renderingTraversals */
void setCullOnly(bool on) { _cullOnly = on; }
virtual void operator () (osg::GraphicsContext* /*context*/)
{
if (_graphicsThreadDoesCull)
{
if (_cullOnly)
cull();
else
cull_draw();
}
}
virtual void cull()
{
osgUtil::SceneView* sceneView = _sceneView[0].get();
if (!sceneView || _done ) return;
updateSceneView(sceneView);
osgViewer::View* view = dynamic_cast<osgViewer::View*>(_camera->getView());
if (view) sceneView->setFusionDistance(view->getFusionDistanceMode(), view->getFusionDistanceValue());
sceneView->inheritCullSettings(*(sceneView->getCamera()));
sceneView->cull();
}
bool _cullOnly;
};
//===============================================================
// MAIN
//
int main( int argc, char **argv )
{
osg::ArgumentParser arguments(&argc, argv);
osg::ApplicationUsage* usage = arguments.getApplicationUsage();
usage->setApplicationName(arguments.getApplicationName());
usage->setDescription(arguments.getApplicationName()+" loads a model, sets a camera position and automatically captures screenshot to disk");
usage->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
usage->addCommandLineOption("--camera <lat> <lon> <alt> <heading> <incline> <roll>", "Specify camera position for image capture. Angles are specified in degrees and altitude in meters above sealevel (e.g. --camera 55 10 300000 0 30 0)");
usage->addCommandLineOption("--filename", "Filename for the captured image", "autocapture.jpg");
usage->addCommandLineOption("--db-threads", "Number of DatabasePager threads to use", "2");
usage->addCommandLineOption("--active", "Use active rendering instead of passive / lazy rendering");
// Construct the viewer and register options arguments.
osgViewer::Viewer viewer(arguments);
if (arguments.argc()<=1)
{
arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION);
return 1;
}
// Get user specified number of DatabaseThreads
int dbThreads = 2;
arguments.read("--db-threads", dbThreads);
if (dbThreads < 1) dbThreads = 1;
osg::DisplaySettings::instance()->setNumOfDatabaseThreadsHint(dbThreads);
// Get user specified file name
std::string fileName("autocapture.jpg");
arguments.read("--filename", fileName);
// Rendering mode is passive by default
bool activeMode = false;
if (arguments.read("--active"))
activeMode = true;
// Read camera settings for screenshot
double lat=50;
double lon=10;
double alt=2000;
double heading=0;
double incline=45;
double roll=0;
bool camera_specified=false;
if (arguments.read("--camera", lat, lon, alt, heading, incline, roll))
{
camera_specified=true;
lat = osg::DegreesToRadians(lat);
lon = osg::DegreesToRadians(lon);
heading = osg::DegreesToRadians(heading);
incline = osg::DegreesToRadians(incline);
roll = osg::DegreesToRadians(roll);
}
// load the data
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
if (!loadedModel)
{
std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl;
return 1;
}
// any option left unread are converted into errors to write out later.
arguments.reportRemainingOptionsAsUnrecognized();
// report any errors if they have occurred when parsing the program arguments.
if (arguments.errors())
{
arguments.writeErrorMessages(std::cout);
return 1;
}
// Setup specified camera
if (camera_specified)
{
osg::CoordinateSystemNode* csn = findTopMostNodeOfType<osg::CoordinateSystemNode>(loadedModel.get());
if(!csn) return 1;
// Compute eye point in world coordiantes
osg::Vec3d eye;
csn->getEllipsoidModel()->convertLatLongHeightToXYZ(lat, lon, alt, eye.x(), eye.y(), eye.z());
// Build matrix for computing target vector
osg::Matrixd target_matrix = osg::Matrixd::rotate(-heading, osg::Vec3d(1,0,0),
-lat, osg::Vec3d(0,1,0),
lon, osg::Vec3d(0,0,1));
// Compute tangent vector ...
osg::Vec3d tangent = target_matrix.preMult(osg::Vec3d(0, 0, 1));
// Compute non-inclined, non-rolled up vector ...
osg::Vec3d up(eye);
up.normalize();
// Incline by rotating the target- and up vector around the tangent/up-vector
// cross-product ...
osg::Vec3d up_cross_tangent = up ^ tangent;
osg::Matrixd incline_matrix = osg::Matrixd::rotate(incline, up_cross_tangent);
osg::Vec3d target = incline_matrix.preMult(tangent);
// Roll by rotating the up vector around the target vector ...
osg::Matrixd roll_matrix = incline_matrix * osg::Matrixd::rotate(roll, target);
up = roll_matrix.preMult(up);
viewer.getCamera()->setViewMatrixAsLookAt(eye, eye+target, up);
}
else
{
// Only add camera manipulators if camera is not specified
camera_specified=false;
osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator;
keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::TrackballManipulator() );
keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() );
keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() );
keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() );
}
// Optimize DatabasePager for auto-capture
osgDB::DatabasePager* pager = viewer.getDatabasePager();
pager->setDoPreCompile(false);
// Install custom renderer
osg::ref_ptr<CustomRenderer> customRenderer = new CustomRenderer(viewer.getCamera());
viewer.getCamera()->setRenderer(customRenderer.get());
// Override threading model
viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);
// Set the final SceneData to show
viewer.setSceneData(loadedModel.get());
// Realize GUI
viewer.realize();
//--- Load PageLOD tiles ---
// Initiate the first PagedLOD request
viewer.frame();
osg::Timer_t beforeLoadTick = osg::Timer::instance()->tick();
// Keep updating and culling until full level of detail is reached
while(!viewer.done() && pager->getRequestsInProgress())
{
// std::cout <<pager->getRequestsInProgress()<<" ";
viewer.updateTraversal();
viewer.renderingTraversals();
}
// std::cout<<std::endl;
osg::Timer_t afterLoadTick = osg::Timer::instance()->tick();
std::cout<<"Load and Compile time = "<<osg::Timer::instance()->delta_s(beforeLoadTick, afterLoadTick)<<" seconds"<<std::endl;
//--- Capture the image!!! ---
if (!activeMode)
{
// Do cull and draw to render the scene correctly
customRenderer->setCullOnly(false);
// Add the WindowCaptureCallback now that we have full resolution
viewer.getCamera()->setFinalDrawCallback(new WindowCaptureCallback(GL_BACK, fileName));
osg::Timer_t beforeRenderTick = osg::Timer::instance()->tick();
// Do rendering with capture callback
viewer.renderingTraversals();
osg::Timer_t afterRenderTick = osg::Timer::instance()->tick();
std::cout<<"Rendring time = "<<osg::Timer::instance()->delta_s(beforeRenderTick, afterRenderTick) <<" seconds"<<std::endl;
return 0;
}
else
{
return viewer.run();
}
}

View File

@@ -0,0 +1,9 @@
SET(TARGET_SRC
osgbrowser.cpp
)
SET(TARGET_ADDED_LIBRARIES osgWidget)
#### end var setup ###
SETUP_EXAMPLE(osgbrowser)

View File

@@ -0,0 +1,41 @@
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgWidget/Browser>
int main(int argc,char** argv)
{
osg::ArgumentParser arguments(&argc, argv);
osgWidget::BrowserManager::instance()->init(arguments[0]);
osgViewer::Viewer viewer(arguments);
osgWidget::GeometryHints hints(osg::Vec3(0.0f,0.0f,0.0f),
osg::Vec3(1.0f,0.0f,0.0f),
osg::Vec3(0.0f,0.0f,1.0f),
osg::Vec4(1.0f,1.0f,1.0f,1.0f),
osgWidget::GeometryHints::RESIZE_HEIGHT_TO_MAINTAINCE_ASPECT_RATIO);
osg::ref_ptr<osg::Group> group = new osg::Group;
for(int i=1; i<arguments.argc(); ++i)
{
if (!arguments.isOption(i))
{
osg::ref_ptr<osgWidget::Browser> browser = new osgWidget::Browser;
if (browser->open(arguments[i], hints))
{
group->addChild(browser.get());
hints.position.x() += 1.1f;
}
}
}
viewer.setSceneData(group.get());
viewer.addEventHandler(new osgViewer::StatsHandler);
return viewer.run();
}

View File

@@ -0,0 +1,12 @@
SET(TARGET_SRC
broadcaster.cpp
receiver.cpp
osgcluster.cpp
)
IF (WIN32)
SET(TARGET_EXTERNAL_LIBRARIES ws2_32)
ENDIF(WIN32)
#### end var setup ###
SETUP_EXAMPLE(osgcluster)

View File

@@ -37,7 +37,7 @@
#if defined(__linux)
#include <unistd.h>
#include <linux/sockios.h>
#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#include <unistd.h>
#include <sys/sockio.h>
#elif defined(__sgi)
@@ -164,7 +164,7 @@ void Broadcaster::setHost( const char *hostname )
struct hostent *h;
if( (h = gethostbyname( hostname )) == 0L )
{
fprintf( stderr, "Broadcaster::setHost() - Cannot resolv an address for \"%s\".\n", hostname );
fprintf( stderr, "Broadcaster::setHost() - Cannot resolve an address for \"%s\".\n", hostname );
_address = 0;
}
else
@@ -196,7 +196,7 @@ void Broadcaster::sync( void )
unsigned int size = sizeof( SOCKADDR_IN );
sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
int err = WSAGetLastError ();
int *dum = (int*) _buffer;
if (err!=0) fprintf( stderr, "Broadcaster::sync() - error %d\n",err );
#else
unsigned int size = sizeof( struct sockaddr_in );
sendto( _so, (const void *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );

View File

@@ -386,7 +386,7 @@ class DataConverter
_swapBytes = !_swapBytes;
}
cameraPacket._masterKilled = readUInt();
cameraPacket._masterKilled = readUInt()!=0;
read(cameraPacket._matrix);
read(cameraPacket._frameStamp);
@@ -413,7 +413,7 @@ void CameraPacket::readEventQueue(osgViewer::Viewer& viewer)
void CameraPacket::writeEventQueue(osgViewer::Viewer& viewer)
{
osg::notify(osg::INFO)<<"recieved events = "<<_events.size()<<std::endl;
osg::notify(osg::INFO)<<"received events = "<<_events.size()<<std::endl;
viewer.getEventQueue()->appendEvents(_events);
}
@@ -437,7 +437,7 @@ int main( int argc, char **argv )
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
arguments.getApplicationUsage()->addCommandLineOption("-m","Set viewer to MASTER mode, sending view via packets.");
arguments.getApplicationUsage()->addCommandLineOption("-s","Set viewer to SLAVE mode, reciving view via packets.");
arguments.getApplicationUsage()->addCommandLineOption("-s","Set viewer to SLAVE mode, receiving view via packets.");
arguments.getApplicationUsage()->addCommandLineOption("-n <int>","Socket number to transmit packets");
arguments.getApplicationUsage()->addCommandLineOption("-f <float>","Field of view of camera");
arguments.getApplicationUsage()->addCommandLineOption("-o <float>","Offset angle of camera");

View File

@@ -142,7 +142,7 @@ void Receiver::sync( void )
recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)
int err = WSAGetLastError ();
int *dum = (int*) _buffer;
if (err!=0) fprintf( stderr, "Receiver::sync() - error %d\n",err );
while( select( _so+1, &fdset, 0L, 0L, &tv ) )
{

View File

@@ -16,6 +16,8 @@
* THE SOFTWARE.
*/
#include <iostream>
#include <osgUtil/Optimizer>
#include <osgDB/ReadFile>
@@ -44,19 +46,19 @@
// class to handle events with a pick
class PickHandler : public osgGA::GUIEventHandler {
public:
public:
PickHandler():
_mx(0.0f),
_my(0.0f) {}
~PickHandler() {}
bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
{
osgViewer::View* view = dynamic_cast<osgViewer::View*>(&aa);
if (!view) return false;
switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::PUSH):
@@ -78,7 +80,7 @@ public:
}
return false;
}
void pick(osgViewer::View* view, float x, float y)
{
osg::Node* node = 0;
@@ -91,7 +93,7 @@ public:
osg::NodePath& nodePath = intersection.nodePath;
node = (nodePath.size()>=1)?nodePath[nodePath.size()-1]:0;
parent = (nodePath.size()>=2)?dynamic_cast<osg::Group*>(nodePath[nodePath.size()-2]):0;
}
}
// now we try to decorate the hit node by the osgFX::Scribe to show that its been "picked"
if (parent && node)
@@ -119,7 +121,7 @@ public:
}
}
float _mx, _my;
};
@@ -130,26 +132,28 @@ int main( int argc, char **argv )
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
// read the scene from the list of file specified commandline args.
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments);
if (!scene) return 1;
if (!scene)
{
std::cout << argv[0] << ": requires filename argument." << std::endl;
return 1;
}
// construct the viewer.
osgViewer::CompositeViewer viewer(arguments);
if (arguments.read("-1"))
{
{
osgViewer::View* view = new osgViewer::View;
view->setName("Single view");
view->setSceneData(osgDB::readNodeFile("fountain.osg"));
view->addEventHandler( new osgViewer::StatsHandler );
view->setUpViewAcrossAllScreens();
view->setCameraManipulator(new osgGA::TrackballManipulator);
viewer.addView(view);
@@ -162,6 +166,7 @@ int main( int argc, char **argv )
// view one
{
osgViewer::View* view = new osgViewer::View;
view->setName("View one");
viewer.addView(view);
view->setUpViewOnSingleScreen(0);
@@ -174,30 +179,31 @@ int main( int argc, char **argv )
view->addEventHandler( statesetManipulator.get() );
}
// view two
{
osgViewer::View* view = new osgViewer::View;
view->setName("View two");
viewer.addView(view);
view->setUpViewOnSingleScreen(1);
view->setSceneData(scene.get());
view->setCameraManipulator(new osgGA::TrackballManipulator);
view->addEventHandler( new osgViewer::StatsHandler );
// add the handler for doing the picking
view->addEventHandler(new PickHandler());
}
}
if (arguments.read("-3") || viewer.getNumViews()==0)
{
{
osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface();
if (!wsi)
if (!wsi)
{
osg::notify(osg::NOTICE)<<"Error, no WindowSystemInterface available, cannot create windows."<<std::endl;
return 1;
@@ -233,9 +239,11 @@ int main( int argc, char **argv )
// view one
{
osgViewer::View* view = new osgViewer::View;
view->setName("View one");
viewer.addView(view);
view->setSceneData(scene.get());
view->getCamera()->setName("Cam one");
view->getCamera()->setViewport(new osg::Viewport(0,0, traits->width/2, traits->height/2));
view->getCamera()->setGraphicsContext(gc.get());
view->setCameraManipulator(new osgGA::TrackballManipulator);
@@ -245,7 +253,7 @@ int main( int argc, char **argv )
statesetManipulator->setStateSet(view->getCamera()->getOrCreateStateSet());
view->addEventHandler( statesetManipulator.get() );
view->addEventHandler( new osgViewer::StatsHandler );
view->addEventHandler( new osgViewer::HelpHandler );
view->addEventHandler( new osgViewer::WindowSizeHandler );
@@ -256,25 +264,29 @@ int main( int argc, char **argv )
// view two
{
osgViewer::View* view = new osgViewer::View;
view->setName("View two");
viewer.addView(view);
view->setSceneData(scene.get());
view->getCamera()->setName("Cam two");
view->getCamera()->setViewport(new osg::Viewport(traits->width/2,0, traits->width/2, traits->height/2));
view->getCamera()->setGraphicsContext(gc.get());
view->setCameraManipulator(new osgGA::TrackballManipulator);
// add the handler for doing the picking
view->addEventHandler(new PickHandler());
}
// view three
{
osgViewer::View* view = new osgViewer::View;
view->setName("View three");
viewer.addView(view);
view->setSceneData(osgDB::readNodeFile("cessnafire.osg"));
view->getCamera()->setName("Cam three");
view->getCamera()->setProjectionMatrixAsPerspective(30.0, double(traits->width) / double(traits->height/2), 1.0, 1000.0);
view->getCamera()->setViewport(new osg::Viewport(0, traits->height/2, traits->width, traits->height/2));
view->getCamera()->setGraphicsContext(gc.get());
@@ -283,11 +295,12 @@ int main( int argc, char **argv )
}
while (arguments.read("-s")) { viewer.setThreadingModel(osgViewer::CompositeViewer::SingleThreaded); }
while (arguments.read("-g")) { viewer.setThreadingModel(osgViewer::CompositeViewer::CullDrawThreadPerContext); }
while (arguments.read("-c")) { viewer.setThreadingModel(osgViewer::CompositeViewer::CullThreadPerCameraDrawThreadPerContext); }
// run the viewer's main frame loop
return viewer.run();
}

View File

@@ -9,18 +9,18 @@
#include <assert.h>
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <osg/Geometry>
#include <osg/Geode>
#include <osgDB/FileUtils>
#include <osgDB/fstream>
bool Utility::readFile(const char* fName, std::string& s)
{
std::string foundFile = osgDB::findDataFile(fName);
if (foundFile.empty()) return false;
std::ifstream is;//(fName);
osgDB::ifstream is;//(fName);
is.open(foundFile.c_str());
if (is.fail())
{
@@ -73,7 +73,7 @@ double Utility::getNoise(unsigned x, unsigned y, unsigned random)
int n = x + y * 57 + random * 131;
n = (n<<13) ^ n;
double noise = (1.0f - ( (n * (n * n * 15731 + 789221) +
1376312589)&0x7fffffff)* 0.000000000931322574615478515625f);
1376312589)&0x7fffffff)* 0.000000000931322574615478515625f);
return noise;
}
@@ -86,13 +86,13 @@ double Utility::smoothNoise(unsigned width, unsigned height, unsigned x, unsigne
return noise[x + y*width];
double corners = (noise[x-1 + (y-1) *width]
+noise[x+1 + (y-1)*width]
+noise[x-1 + (y+1) * width]
+noise[x+1 + (y+1) * width]) / 16.0;
+noise[x+1 + (y-1)*width]
+noise[x-1 + (y+1) * width]
+noise[x+1 + (y+1) * width]) / 16.0;
double sides = (noise[x-1 + y*width]
+noise[x+1 + y*width]
+noise[x + (y-1)*width]
+noise[x + (y+1)*width]) / 8.0;
+noise[x+1 + y*width]
+noise[x + (y-1)*width]
+noise[x + (y+1)*width]) / 8.0;
double center = noise[x + y*width] / 4.0;
return corners + sides + center;

View File

@@ -174,27 +174,12 @@ public:
private:
void rotate(float x, float y)
{
osg::Matrixd baseMatrix = _modelGroupTransform->getMatrix();
osg::Matrix baseMatrix = _modelGroupTransform->getMatrix();
osg::Matrixd preTransMatrix;
osg::Matrixd postTransMatrix;
osg::Matrixd rotMatrixX;
osg::Matrixd rotMatrixZ;
preTransMatrix.makeTranslate(_rotCenter);
postTransMatrix.makeTranslate(-_rotCenter);
rotMatrixZ.makeRotate((x - _prevX) * 3., osg::Vec3d(0.0, 0.0,1.0));
baseMatrix.preMult(preTransMatrix);
baseMatrix.preMult(rotMatrixZ);
baseMatrix.preMult(postTransMatrix);
rotMatrixX.makeRotate(-(y - _prevY) * 3., (baseMatrix * osg::Vec3d(1.0, 0.0,0.0)));
baseMatrix.preMult(preTransMatrix);
baseMatrix.preMult(rotMatrixX);
baseMatrix.preMult(postTransMatrix);
baseMatrix.preMultTranslate(_rotCenter);
baseMatrix.preMultRotate(osg::Quat((x - _prevX) * 3, osg::Vec3d(0.0, 0.0, 1.0)));
baseMatrix.preMultRotate(osg::Quat(-(y - _prevY) * 3, (baseMatrix * osg::Vec3d(1.0, 0.0, 0.0))));
baseMatrix.preMultTranslate(-_rotCenter);
_modelGroupTransform->setMatrix(baseMatrix);

View File

@@ -0,0 +1,4 @@
SET(TARGET_SRC osgdrawinstanced.cpp )
#### end var setup ###
SETUP_EXAMPLE(osgdrawinstanced)

View File

@@ -0,0 +1,150 @@
/* OpenSceneGraph example, osgdrawinstanced.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
//
// This code is copyright (c) 2008 Skew Matrix Software LLC. You may use
// the code under the licensing terms described above.
//
#include <osgDB/ReadFile>
#include <osgViewer/Viewer>
#include <osg/Geometry>
#include <osg/Texture2D>
#include <osgDB/WriteFile>
#include <iostream>
void
createDAIGeometry( osg::Geometry& geom, int nInstances=1 )
{
const float halfDimX( .5 );
const float halfDimZ( .5 );
osg::Vec3Array* v = new osg::Vec3Array;
v->resize( 4 );
geom.setVertexArray( v );
// Geometry for a single quad.
(*v)[ 0 ] = osg::Vec3( -halfDimX, 0., -halfDimZ );
(*v)[ 1 ] = osg::Vec3( halfDimX, 0., -halfDimZ );
(*v)[ 2 ] = osg::Vec3( halfDimX, 0., halfDimZ );
(*v)[ 3 ] = osg::Vec3( -halfDimX, 0., halfDimZ );
// Use the DrawArraysInstanced PrimitiveSet and tell it to draw 1024 instances.
geom.addPrimitiveSet( new osg::DrawArrays( GL_QUADS, 0, 4, nInstances ) );
}
osg::StateSet*
createStateSet()
{
osg::ref_ptr< osg::StateSet > ss = new osg::StateSet;
// Create a vertex program that references the gl_InstanceID to
// render each instance uniquely. gl_InstanceID will be in the range
// 0 to numInstances-1 (1023 in our case).
std::string vertexSource =
"uniform sampler2D osgLogo; \n"
"uniform float osg_SimulationTime; \n"
"void main() \n"
"{ \n"
// Using the instance ID, generate "texture coords" for this instance.
"vec2 tC; \n"
"const float r = gl_InstanceID / 32.; \n"
"tC.s = fract( r ); tC.t = floor( r ) / 32.; \n"
// Get the color from the OSG logo.
"gl_FrontColor = texture2D( osgLogo, tC ); \n"
// Use the (scaled) tex coord to translate the position of the vertices.
"vec4 pos = vec4( tC.s * 48., 0., tC.t * 48., 1. ); \n"
// Compute a rotation angle from the instanceID and elapsed time.
"float timeOffset = gl_InstanceID / (32. * 32.); \n"
"float angle = ( osg_SimulationTime - timeOffset ) * 6.283; \n"
"float sa = sin( angle ); \n"
"float ca = cos( angle ); \n"
// New orientation, rotate around z axis.
"vec4 newX = vec4( ca, sa, 0., 0. ); \n"
"vec4 newY = vec4( sa, ca, 0., 0. ); \n"
"vec4 newZ = vec4( 0., 0., 1., 0. ); \n"
"mat4 mV = mat4( newX, newY, newZ, pos ); \n"
"gl_Position = ( gl_ModelViewProjectionMatrix * mV * gl_Vertex ); \n"
"} \n";
osg::ref_ptr< osg::Shader > vertexShader = new osg::Shader();
vertexShader->setType( osg::Shader::VERTEX );
vertexShader->setShaderSource( vertexSource );
osg::ref_ptr< osg::Program > program = new osg::Program();
program->addShader( vertexShader.get() );
ss->setAttribute( program.get(),
osg::StateAttribute::ON | osg::StateAttribute::PROTECTED );
osg::ref_ptr< osg::Image> iLogo = osgDB::readImageFile( "Images/osg128.png" );
if( !iLogo.valid() )
{
osg::notify( osg::ALWAYS ) << "Can't open image file osg128.png" << std::endl;
return( NULL );
}
osg::Texture2D* texLogo = new osg::Texture2D( iLogo.get() );
texLogo->setFilter( osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR );
texLogo->setFilter( osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR );
ss->setTextureAttribute( 0, texLogo );
osg::ref_ptr< osg::Uniform > texLogoUniform =
new osg::Uniform( "osgLogo", 0 );
ss->addUniform( texLogoUniform.get() );
return( ss.release() );
}
int main( int argc, char **argv )
{
osg::ArgumentParser arguments(&argc, argv);
// Make a scene graph consisting of a single Geode, containing
// a single Geometry, and a single PrimitiveSet.
osg::ref_ptr< osg::Geode > geode = new osg::Geode;
osg::ref_ptr< osg::Geometry > geom = new osg::Geometry;
// Configure the Geometry for use with EXT_draw_arrays:
// DL off and buffer objects on.
geom->setUseDisplayList( false );
geom->setUseVertexBufferObjects( true );
// OSG has no clue where out vertex shader will place the geometric data,
// so specify an initial bound to allow proper culling and near/far computation.
osg::BoundingBox bb( -1., -.1, -1., 49., 1., 49. );
geom->setInitialBound( bb );
// Add geometric data and the PrimitiveSet. Specify numInstances as 32*32 or 1024.
createDAIGeometry( *geom, 32*32 );
geode->addDrawable( geom.get() );
// Create a StateSet to render the instanced Geometry.
osg::ref_ptr< osg::StateSet > ss = createStateSet();
geode->setStateSet( ss.get() );
// osgDB::writeNodeFile(*geode, "instanced.osg");
osgViewer::Viewer viewer(arguments);
viewer.setSceneData( geode.get() );
return viewer.run();
}

View File

@@ -0,0 +1,4 @@
SET(TARGET_SRC osgfont.cpp)
SET(TARGET_ADDED_LIBRARIES osgText)
SETUP_EXAMPLE(osgfont)

View File

@@ -0,0 +1,141 @@
#include <cstdlib>
#include <sstream>
#include <osg/io_utils>
#include <osg/ArgumentParser>
#include <osg/Geode>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
void textInfo(osgText::Text* text)
{
const osgText::Text::TextureGlyphQuadMap& tgqm = text->getTextureGlyphQuadMap();
const osgText::Text::TextureGlyphQuadMap::const_iterator tgqmi = tgqm.begin();
const osgText::Text::GlyphQuads& gq = tgqmi->second;
osgText::String& s = text->getText();
for(unsigned int i = 0; i < s.size(); i++)
{
osg::Vec2 ul = gq.getCoords()[0 + (i * 4)]; // upperLeft
osg::Vec2 ll = gq.getCoords()[1 + (i * 4)]; // lowerLeft
osg::Vec2 lr = gq.getCoords()[2 + (i * 4)]; // lowerRight
osg::Vec2 ur = gq.getCoords()[3 + (i * 4)]; // upperRight
/*
osg::Vec3 ul = gq.getTransformedCoords(0)[0 + (i * 4)];
osg::Vec3 ll = gq.getTransformedCoords(0)[1 + (i * 4)];
osg::Vec3 lr = gq.getTransformedCoords(0)[2 + (i * 4)];
osg::Vec3 ur = gq.getTransformedCoords(0)[3 + (i * 4)];
*/
osg::notify(osg::NOTICE)
<< "'" << static_cast<char>(s[i]) << "':"
<< " width(" << lr.x() - ll.x() << ")"
<< " height(" << ul.y() - ll.y() << ")" << std::endl << "\t"
<< "ul(" << ul << "), "
<< "ll(" << ll << "), "
<< "lr(" << lr << "), "
<< "ur(" << ur << ")"
<< std::endl
;
}
}
osg::Camera* createOrthoCamera(double width, double height)
{
osg::Camera* camera = new osg::Camera();
camera->getOrCreateStateSet()->setMode(
GL_LIGHTING,
osg::StateAttribute::PROTECTED | osg::StateAttribute::OFF
);
osg::Matrix m = osg::Matrix::ortho2D(0.0f, width, 0.0f, height);
camera->setProjectionMatrix(m);
camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
camera->setViewMatrix(osg::Matrix::identity());
camera->setClearMask(GL_DEPTH_BUFFER_BIT);
camera->setRenderOrder(osg::Camera::POST_RENDER);
return camera;
}
osgText::Text* createLabel(const std::string& l, const char* f, unsigned int size)
{
static osg::Vec3 pos(10.0f, 10.0f, 0.0f);
osgText::Text* label = new osgText::Text();
osgText::Font* font = osgText::readFontFile(f);
label->setFont(font);
label->setCharacterSize(size);
label->setFontResolution(size, size);
label->setColor(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
label->setPosition(pos);
label->setAlignment(osgText::Text::LEFT_BOTTOM);
// It seems to be important we do this last to get best results?
label->setText(l);
textInfo(label);
pos.y() += size + 10.0f;
return label;
}
typedef std::list<unsigned int> Sizes;
int main(int argc, char** argv)
{
osgViewer::Viewer viewer;
osg::ArgumentParser args(&argc, argv);
// Make sure we have the minimum args...
if(argc <= 2)
{
osg::notify(osg::FATAL) << "usage: " << args[0] << " fontfile size1 [size2 ...]" << std::endl;
return 1;
}
viewer.addEventHandler(new osgViewer::StatsHandler());
viewer.addEventHandler(new osgViewer::WindowSizeHandler());
osg::Group* group = new osg::Group();
osg::Camera* camera = createOrthoCamera(1280.0f, 1024.0f);
// Create the list of desired sizes.
Sizes sizes;
for(int i = 2; i < argc; i++)
{
if(!args.isNumber(i)) continue;
sizes.push_back(std::atoi(args[i]));
}
osg::Geode* geode = new osg::Geode();
// Add all of our osgText drawables.
for(Sizes::const_iterator i = sizes.begin(); i != sizes.end(); i++)
{
std::stringstream ss;
ss << *i << " 1234567890 abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ";
geode->addDrawable(createLabel(ss.str(), args[1], *i));
}
camera->addChild(geode);
group->addChild(camera);
viewer.setSceneData(group);
return viewer.run();
}

View File

@@ -36,12 +36,15 @@
#include <osgDB/ReadFile>
#include <osgDB/FileUtils>
#include <osgUtil/IntersectVisitor>
#include <osgUtil/LineSegmentIntersector>
#include <osgUtil/IntersectionVisitor>
#include <osgUtil/SmoothingVisitor>
#include <osgText/Text>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgGA/StateSetManipulator>
#include <iostream>
@@ -508,22 +511,22 @@ void ForestTechniqueManager::createTreeList(osg::Node* terrain,const osg::Vec3&
if (terrain)
{
osgUtil::IntersectVisitor iv;
osg::ref_ptr<osg::LineSegment> segDown = new osg::LineSegment;
osg::ref_ptr<osgUtil::LineSegmentIntersector> intersector =
new osgUtil::LineSegmentIntersector(tree->_position,tree->_position+osg::Vec3(0.0f,0.0f,size.z()));
segDown->set(tree->_position,tree->_position+osg::Vec3(0.0f,0.0f,size.z()));
iv.addLineSegment(segDown.get());
osgUtil::IntersectionVisitor iv(intersector.get());
terrain->accept(iv);
if (iv.hits())
if (intersector->containsIntersections())
{
osgUtil::IntersectVisitor::HitList& hitList = iv.getHitList(segDown.get());
if (!hitList.empty())
osgUtil::LineSegmentIntersector::Intersections& intersections = intersector->getIntersections();
for(osgUtil::LineSegmentIntersector::Intersections::iterator itr = intersections.begin();
itr != intersections.end();
++itr)
{
osg::Vec3 ip = hitList.front().getWorldIntersectPoint();
osg::Vec3 np = hitList.front().getWorldIntersectNormal();
tree->_position = ip;
const osgUtil::LineSegmentIntersector::Intersection& intersection = *itr;
tree->_position = intersection.getWorldIntersectPoint();
}
}
}
@@ -1099,6 +1102,9 @@ int main( int argc, char **argv )
osg::ref_ptr<ForestTechniqueManager> ttm = new ForestTechniqueManager;
// add the stats handler
viewer.addEventHandler(new osgViewer::StatsHandler);
viewer.addEventHandler(new TechniqueEventHandler(ttm.get()));
viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));

View File

@@ -0,0 +1,11 @@
SET(TARGET_SRC
GameOfLifePass.cpp
osggameoflife.cpp
)
SET(TARGET_H
GameOfLifePass.h
)
#### end var setup ###
SETUP_EXAMPLE(osggameoflife)

View File

@@ -0,0 +1,204 @@
/* OpenSceneGraph example, osggameoflife.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "GameOfLifePass.h"
#include <osgDB/FileUtils>
#include <iostream>
ProcessPass::ProcessPass(osg::TextureRectangle *in_tex,
osg::TextureRectangle *out_tex,
int width, int height):
_TextureWidth(width),
_TextureHeight(height)
{
_RootGroup = new osg::Group;
_InTexture = in_tex;
_OutTexture = out_tex;
_Camera = new osg::Camera;
setupCamera();
_Camera->addChild(createTexturedQuad().get());
_RootGroup->addChild(_Camera.get());
setShader("shaders/gameoflife.frag");
}
ProcessPass::~ProcessPass()
{
}
osg::ref_ptr<osg::Group> ProcessPass::createTexturedQuad()
{
osg::ref_ptr<osg::Group> top_group = new osg::Group;
osg::ref_ptr<osg::Geode> quad_geode = new osg::Geode;
osg::ref_ptr<osg::Vec3Array> quad_coords = new osg::Vec3Array; // vertex coords
// counter-clockwise
quad_coords->push_back(osg::Vec3d(0, 0, -1));
quad_coords->push_back(osg::Vec3d(1, 0, -1));
quad_coords->push_back(osg::Vec3d(1, 1, -1));
quad_coords->push_back(osg::Vec3d(0, 1, -1));
osg::ref_ptr<osg::Vec2Array> quad_tcoords = new osg::Vec2Array; // texture coords
quad_tcoords->push_back(osg::Vec2(0, 0));
quad_tcoords->push_back(osg::Vec2(_TextureWidth, 0));
quad_tcoords->push_back(osg::Vec2(_TextureWidth, _TextureHeight));
quad_tcoords->push_back(osg::Vec2(0, _TextureHeight));
osg::ref_ptr<osg::Geometry> quad_geom = new osg::Geometry;
osg::ref_ptr<osg::DrawArrays> quad_da = new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4);
osg::ref_ptr<osg::Vec4Array> quad_colors = new osg::Vec4Array;
quad_colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
quad_geom->setVertexArray(quad_coords.get());
quad_geom->setTexCoordArray(0, quad_tcoords.get());
quad_geom->addPrimitiveSet(quad_da.get());
quad_geom->setColorArray(quad_colors.get());
quad_geom->setColorBinding(osg::Geometry::BIND_OVERALL);
_StateSet = quad_geom->getOrCreateStateSet();
_StateSet->setMode(GL_LIGHTING,osg::StateAttribute::OFF);
_StateSet->setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF);
_StateSet->setTextureAttributeAndModes(0, _InTexture.get(), osg::StateAttribute::ON);
_StateSet->addUniform(new osg::Uniform("textureIn", 0));
quad_geode->addDrawable(quad_geom.get());
top_group->addChild(quad_geode.get());
return top_group;
}
void ProcessPass::setupCamera()
{
// clearing
_Camera->setClearMask(GL_DEPTH_BUFFER_BIT);
// projection and view
_Camera->setProjectionMatrix(osg::Matrix::ortho2D(0,1,0,1));
_Camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
_Camera->setViewMatrix(osg::Matrix::identity());
// viewport
_Camera->setViewport(0, 0, _TextureWidth, _TextureHeight);
_Camera->setRenderOrder(osg::Camera::PRE_RENDER);
_Camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
_Camera->attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER), _OutTexture.get());
}
void ProcessPass::setShader(std::string filename)
{
std::string foundFile = osgDB::findDataFile(filename);
if (foundFile.empty())
{
osg::notify(osg::NOTICE)<<"Could not file shader file: "<<filename<<std::endl;
return;
}
osg::ref_ptr<osg::Shader> fshader = new osg::Shader( osg::Shader::FRAGMENT );
fshader->loadShaderSourceFromFile(foundFile);
_FragmentProgram = 0;
_FragmentProgram = new osg::Program;
_FragmentProgram->addShader(fshader.get());
_StateSet->setAttributeAndModes(_FragmentProgram.get(), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE );
}
////////////////////////////////////////////////////////////////////////
GameOfLifePass::GameOfLifePass(osg::Image *in_image)
{
_TextureWidth = in_image->s();
_TextureHeight = in_image->t();
_RootGroup = new osg::Group;
_BranchSwith[0] = new osg::Switch;
_BranchSwith[1] = new osg::Switch;
_RootGroup->addChild(_BranchSwith[0].get());
_RootGroup->addChild(_BranchSwith[1].get());
_ActiveBranch = 0;
activateBranch();
createOutputTextures();
_InOutTextureLife[0]->setImage(in_image);
_ProcessPass[0] = new ProcessPass(_InOutTextureLife[0].get(),
_InOutTextureLife[1].get(),
_TextureWidth, _TextureHeight);
// For the other pass, the input/output textures are flipped
_ProcessPass[1] = new ProcessPass(_InOutTextureLife[1].get(),
_InOutTextureLife[0].get(),
_TextureWidth, _TextureHeight);
_BranchSwith[0]->addChild(_ProcessPass[0]->getRoot().get());
_BranchSwith[1]->addChild(_ProcessPass[1]->getRoot().get());
}
GameOfLifePass::~GameOfLifePass()
{
delete _ProcessPass[0];
delete _ProcessPass[1];
}
osg::ref_ptr<osg::TextureRectangle> GameOfLifePass::getOutputTexture()
{
int out_tex = (_ActiveBranch == 0) ? 1 : 0;
return _ProcessPass[out_tex]->getOutputTexture();
}
void GameOfLifePass::activateBranch()
{
int onb = _ActiveBranch;
int offb = (onb == 1) ? 0 : 1;
_BranchSwith[onb]->setAllChildrenOn();
_BranchSwith[offb]->setAllChildrenOff();
}
void GameOfLifePass::flip()
{
_ActiveBranch = (_ActiveBranch == 1) ? 0 : 1;
activateBranch();
}
void GameOfLifePass::createOutputTextures()
{
for (int i=0; i<2; i++) {
_InOutTextureLife[i] = new osg::TextureRectangle;
_InOutTextureLife[i]->setTextureSize(_TextureWidth, _TextureHeight);
_InOutTextureLife[i]->setInternalFormat(GL_RGBA);
_InOutTextureLife[i]->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::NEAREST);
_InOutTextureLife[i]->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::NEAREST);
}
}

View File

@@ -0,0 +1,83 @@
/* OpenSceneGraph example, osggameoflife.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef GAMEOFLIFEPASS_H
#define GAMEOFLIFEPASS_H 1
#include <osg/ref_ptr>
#include <osg/Group>
#include <osg/Switch>
#include <osg/Camera>
#include <osg/Geode>
#include <osg/Geometry>
#include <osg/Texture2D>
#include <osg/TextureRectangle>
class ProcessPass {
public:
ProcessPass(osg::TextureRectangle *in_tex,
osg::TextureRectangle *out_tex,
int width, int height);
~ProcessPass();
osg::ref_ptr<osg::Group> getRoot() { return _RootGroup; }
osg::ref_ptr<osg::TextureRectangle> getOutputTexture() { return _OutTexture; }
void setShader(std::string filename);
private:
osg::ref_ptr<osg::Group> createTexturedQuad();
void setupCamera();
osg::ref_ptr<osg::Group> _RootGroup;
osg::ref_ptr<osg::Camera> _Camera;
osg::ref_ptr<osg::TextureRectangle> _InTexture;
osg::ref_ptr<osg::TextureRectangle> _OutTexture;
int _TextureWidth;
int _TextureHeight;
osg::ref_ptr<osg::Program> _FragmentProgram;
osg::ref_ptr<osg::StateSet> _StateSet;
};
class GameOfLifePass {
public:
GameOfLifePass(osg::Image *in_image);
~GameOfLifePass();
osg::ref_ptr<osg::Group> getRoot() { return _RootGroup; }
osg::ref_ptr<osg::TextureRectangle> getOutputTexture();
void setShader(std::string filename);
// Switch branches so we flip textures
void flip();
private:
osg::ref_ptr<osg::Group> createTexturedQuad();
void setupCamera();
void createOutputTextures();
void activateBranch();
osg::ref_ptr<osg::Group> _RootGroup;
osg::ref_ptr<osg::Camera> _Camera;
osg::ref_ptr<osg::TextureRectangle> _InOutTextureLife[2];
int _TextureWidth;
int _TextureHeight;
int _ActiveBranch;
osg::ref_ptr<osg::Program> _FragmentProgram;
osg::ref_ptr<osg::StateSet> _StateSet;
osg::ref_ptr<osg::Switch> _BranchSwith[2];
ProcessPass *_ProcessPass[2];
};
#endif //GAMEOFLIFEPASS_H

View File

@@ -0,0 +1,154 @@
/* OpenSceneGraph example, osggameoflife.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <osg/Vec3>
#include <osg/Vec4>
#include <osg/Geometry>
#include <osg/Geode>
#include <osg/TextureRectangle>
#include <osgDB/FileUtils>
#include <osgDB/ReadFile>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgGA/TrackballManipulator>
#include <iostream>
#include "GameOfLifePass.h"
GameOfLifePass *golpass;
osg::ref_ptr<osg::StateSet> geomss; // stateset where we can attach textures
osg::Node* createScene(osg::Image *start_im)
{
int width = start_im->s();
int height = start_im->t();
osg::Group* topnode = new osg::Group;
// create quad to display image on
osg::ref_ptr<osg::Geode> geode = new osg::Geode();
// each geom will contain a quad
osg::ref_ptr<osg::DrawArrays> da = new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4);
osg::ref_ptr<osg::Vec4Array> colors = new osg::Vec4Array;
colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
osg::ref_ptr<osg::Vec2Array> tcoords = new osg::Vec2Array; // texture coords
tcoords->push_back(osg::Vec2(0, 0));
tcoords->push_back(osg::Vec2(width, 0));
tcoords->push_back(osg::Vec2(width, height));
tcoords->push_back(osg::Vec2(0, height));
osg::ref_ptr<osg::Vec3Array> vcoords = new osg::Vec3Array; // vertex coords
osg::ref_ptr<osg::Geometry> geom = new osg::Geometry;
// initial viewer camera looks along y
vcoords->push_back(osg::Vec3d(0, 0, 0));
vcoords->push_back(osg::Vec3d(width, 0, 0));
vcoords->push_back(osg::Vec3d(width, 0, height));
vcoords->push_back(osg::Vec3d(0, 0, height));
geom->setVertexArray(vcoords.get());
geom->setTexCoordArray(0,tcoords.get());
geom->addPrimitiveSet(da.get());
geom->setColorArray(colors.get());
geom->setColorBinding(osg::Geometry::BIND_OVERALL);
geomss = geom->getOrCreateStateSet();
geomss->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
geode->addDrawable(geom.get());
topnode->addChild(geode.get());
// create the ping pong processing passes
golpass = new GameOfLifePass(start_im);
topnode->addChild(golpass->getRoot().get());
// attach the output of the processing to the geom
geomss->setTextureAttributeAndModes(0,
golpass->getOutputTexture().get(),
osg::StateAttribute::ON);
return topnode;
}
int main(int argc, char *argv[])
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
// set up the usage document, in case we need to print out how to use this program.
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates ping pong rendering with FBOs and mutliple rendering branches. It uses Conway's Game of Life to illustrate the concept.");
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] --startim start_image");
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
arguments.getApplicationUsage()->addCommandLineOption("--startim","The initial image to seed the game of life with.");
// if user request help write it out to cout.
if (arguments.read("-h") || arguments.read("--help"))
{
arguments.getApplicationUsage()->write(std::cout);
return 1;
}
std::string startName("");
while(arguments.read("--startim", startName)) {}
if (startName == "") {
arguments.getApplicationUsage()->write(std::cout);
return 1;
}
// load the image
osg::ref_ptr<osg::Image> startIm = osgDB::readImageFile(startName);
if (!startIm) {
std::cout << "Could not load start image.\n";
return(1);
}
osg::Node* scene = createScene(startIm.get());
// construct the viewer.
osgViewer::Viewer viewer;
viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);
// add the stats handler
viewer.addEventHandler(new osgViewer::StatsHandler);
viewer.setSceneData(scene);
viewer.realize();
viewer.setCameraManipulator( new osgGA::TrackballManipulator );
while(!viewer.done())
{
viewer.frame();
// flip the textures after we've completed a frame
golpass->flip();
// attach the proper output to view
geomss->setTextureAttributeAndModes(0,
golpass->getOutputTexture().get(),
osg::StateAttribute::ON);
}
return 0;
}

View File

@@ -110,7 +110,7 @@ int main( int argc, char **argv )
osg::Node* rootnode = osgDB::readNodeFiles(arguments);
if (!rootnode)
{
osg::notify(osg::NOTICE)<<"Please specify and geo model filename on the command line."<<std::endl;
osg::notify(osg::NOTICE)<<"Please specify a geo model filename on the command line."<<std::endl;
return 1;
}

View File

@@ -84,11 +84,12 @@ static const char* geomSource = {
"#version 120\n"
"#extension GL_EXT_geometry_shader4 : enable\n"
"uniform float u_anim1;\n"
"varying vec4 v_color;\n"
"varying in vec4 v_color[];\n"
"varying out vec4 v_color_out;\n"
"void main(void)\n"
"{\n"
" vec4 v = gl_PositionIn[0];\n"
" v_color = v;\n"
" v_color_out = v + v_color[0];\n"
"\n"
" gl_Position = v + vec4(u_anim1,0.,0.,0.); EmitVertex();\n"
" gl_Position = v - vec4(u_anim1,0.,0.,0.); EmitVertex();\n"
@@ -105,10 +106,10 @@ static const char* fragSource = {
"#version 120\n"
"#extension GL_EXT_geometry_shader4 : enable\n"
"uniform float u_anim1;\n"
"varying vec4 v_color;\n"
"varying vec4 v_color_out;\n"
"void main(void)\n"
"{\n"
" gl_FragColor = v_color;\n"
" gl_FragColor = v_color_out;\n"
"}\n"
};
@@ -178,7 +179,7 @@ public:
///////////////////////////////////////////////////////////////////////////
int main( int argc, char *argv[] )
int main( int , char** )
{
osg::Geode* root( new osg::Geode );
root->addDrawable( new SomePoints );

View File

@@ -54,7 +54,7 @@ public:
if (cv)
{
osg::Vec3 eyePointLocal = cv->getEyeLocal();
matrix.preMult(osg::Matrix::translate(eyePointLocal.x(),eyePointLocal.y(),0.0f));
matrix.preMultTranslate(osg::Vec3(eyePointLocal.x(),eyePointLocal.y(),0.0f));
}
return true;
}
@@ -68,7 +68,7 @@ public:
if (cv)
{
osg::Vec3 eyePointLocal = cv->getEyeLocal();
matrix.postMult(osg::Matrix::translate(-eyePointLocal.x(),-eyePointLocal.y(),0.0f));
matrix.postMultTranslate(osg::Vec3(-eyePointLocal.x(),-eyePointLocal.y(),0.0f));
}
return true;
}

View File

@@ -236,7 +236,7 @@ struct SnapeImageHandler : public osgGA::GUIEventHandler
_key(key),
_snapImage(si) {}
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter&)
{
if (ea.getHandled()) return false;

View File

@@ -0,0 +1,4 @@
SET(TARGET_SRC osgimagesequence.cpp )
#### end var setup ###
SETUP_EXAMPLE(osgimagesequence)

View File

@@ -0,0 +1,360 @@
/* OpenSceneGraph example, osgtexture3D.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <osg/Node>
#include <osg/Geometry>
#include <osg/Notify>
#include <osg/Texture1D>
#include <osg/Texture2D>
#include <osg/Texture3D>
#include <osg/TextureRectangle>
#include <osg/ImageSequence>
#include <osg/Geode>
#include <osgDB/Registry>
#include <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <iostream>
//
// A simple demo demonstrating how to set on an animated texture using an osg::ImageSequence
//
osg::StateSet* createState(osg::ArgumentParser& arguments)
{
osg::ref_ptr<osg::ImageSequence> imageSequence = new osg::ImageSequence;
bool preLoad = true;
while (arguments.read("--page-and-discard"))
{
imageSequence->setMode(osg::ImageSequence::PAGE_AND_DISCARD_USED_IMAGES);
preLoad = false;
}
while (arguments.read("--page-and-retain"))
{
imageSequence->setMode(osg::ImageSequence::PAGE_AND_RETAIN_IMAGES);
preLoad = false;
}
while (arguments.read("--preload"))
{
imageSequence->setMode(osg::ImageSequence::PRE_LOAD_ALL_IMAGES);
preLoad = true;
}
double length = -1.0;
while (arguments.read("--length",length)) {}
if (arguments.argc()>1)
{
for(int i=1; i<arguments.argc(); ++i)
{
if (preLoad)
{
osg::ref_ptr<osg::Image> image = osgDB::readImageFile(arguments[i]);
if (image.valid())
{
imageSequence->addImage(image.get());
}
}
else
{
imageSequence->addImageFile(arguments[i]);
}
}
if (length>0.0)
{
imageSequence->setLength(length);
}
else
{
unsigned int maxNum = osg::maximum(imageSequence->getFileNames().size(),
imageSequence->getImages().size());
imageSequence->setLength(float(maxNum)*0.1f);
}
}
else
{
if (length>0.0)
{
imageSequence->setLength(length);
}
else
{
imageSequence->setLength(4.0);
}
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posx.png"));
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negx.png"));
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posy.png"));
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negy.png"));
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posz.png"));
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negz.png"));
}
// start the image sequence playing
imageSequence->play();
#if 1
osg::Texture2D* texture = new osg::Texture2D;
texture->setFilter(osg::Texture::MIN_FILTER,osg::Texture::LINEAR);
texture->setFilter(osg::Texture::MAG_FILTER,osg::Texture::LINEAR);
texture->setWrap(osg::Texture::WRAP_R,osg::Texture::REPEAT);
texture->setResizeNonPowerOfTwoHint(false);
texture->setImage(imageSequence.get());
//texture->setTextureSize(512,512);
#else
osg::TextureRectangle* texture = new osg::TextureRectangle;
texture->setFilter(osg::Texture::MIN_FILTER,osg::Texture::LINEAR);
texture->setFilter(osg::Texture::MAG_FILTER,osg::Texture::LINEAR);
texture->setWrap(osg::Texture::WRAP_R,osg::Texture::REPEAT);
texture->setImage(imageSequence.get());
//texture->setTextureSize(512,512);
#endif
// create the StateSet to store the texture data
osg::StateSet* stateset = new osg::StateSet;
stateset->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON);
return stateset;
}
osg::Node* createModel(osg::ArgumentParser& arguments)
{
// create the geometry of the model, just a simple 2d quad right now.
osg::Geode* geode = new osg::Geode;
geode->addDrawable(osg::createTexturedQuadGeometry(osg::Vec3(0.0f,0.0f,0.0), osg::Vec3(1.0f,0.0f,0.0), osg::Vec3(0.0f,0.0f,1.0f)));
geode->setStateSet(createState(arguments));
return geode;
}
osg::ImageStream* s_imageStream = 0;
class MovieEventHandler : public osgGA::GUIEventHandler
{
public:
MovieEventHandler():_playToggle(true),_trackMouse(false) {}
void setMouseTracking(bool track) { _trackMouse = track; }
bool getMouseTracking() const { return _trackMouse; }
void set(osg::Node* node);
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor* nv);
virtual void getUsage(osg::ApplicationUsage& usage) const;
typedef std::vector< osg::observer_ptr<osg::ImageStream> > ImageStreamList;
protected:
virtual ~MovieEventHandler() {}
class FindImageStreamsVisitor : public osg::NodeVisitor
{
public:
FindImageStreamsVisitor(ImageStreamList& imageStreamList):
_imageStreamList(imageStreamList) {}
virtual void apply(osg::Geode& geode)
{
apply(geode.getStateSet());
for(unsigned int i=0;i<geode.getNumDrawables();++i)
{
apply(geode.getDrawable(i)->getStateSet());
}
traverse(geode);
}
virtual void apply(osg::Node& node)
{
apply(node.getStateSet());
traverse(node);
}
inline void apply(osg::StateSet* stateset)
{
if (!stateset) return;
osg::StateAttribute* attr = stateset->getTextureAttribute(0,osg::StateAttribute::TEXTURE);
if (attr)
{
osg::Texture2D* texture2D = dynamic_cast<osg::Texture2D*>(attr);
if (texture2D) apply(dynamic_cast<osg::ImageStream*>(texture2D->getImage()));
osg::TextureRectangle* textureRec = dynamic_cast<osg::TextureRectangle*>(attr);
if (textureRec) apply(dynamic_cast<osg::ImageStream*>(textureRec->getImage()));
}
}
inline void apply(osg::ImageStream* imagestream)
{
if (imagestream)
{
_imageStreamList.push_back(imagestream);
s_imageStream = imagestream;
}
}
ImageStreamList& _imageStreamList;
protected:
FindImageStreamsVisitor& operator = (const FindImageStreamsVisitor&) { return *this; }
};
bool _playToggle;
bool _trackMouse;
ImageStreamList _imageStreamList;
};
void MovieEventHandler::set(osg::Node* node)
{
_imageStreamList.clear();
if (node)
{
FindImageStreamsVisitor fisv(_imageStreamList);
node->accept(fisv);
}
}
bool MovieEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor* nv)
{
switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::KEYDOWN):
{
if (ea.getKey()=='p')
{
for(ImageStreamList::iterator itr=_imageStreamList.begin();
itr!=_imageStreamList.end();
++itr)
{
if ((*itr)->getStatus()==osg::ImageStream::PLAYING)
{
// playing, so pause
std::cout<<"Pause"<<std::endl;
(*itr)->pause();
}
else
{
// playing, so pause
std::cout<<"Play"<<std::endl;
(*itr)->play();
}
}
return true;
}
else if (ea.getKey()=='r')
{
for(ImageStreamList::iterator itr=_imageStreamList.begin();
itr!=_imageStreamList.end();
++itr)
{
std::cout<<"Restart"<<std::endl;
(*itr)->rewind();
}
return true;
}
else if (ea.getKey()=='L')
{
for(ImageStreamList::iterator itr=_imageStreamList.begin();
itr!=_imageStreamList.end();
++itr)
{
if ( (*itr)->getLoopingMode() == osg::ImageStream::LOOPING)
{
std::cout<<"Toggle Looping Off"<<std::endl;
(*itr)->setLoopingMode( osg::ImageStream::NO_LOOPING );
}
else
{
std::cout<<"Toggle Looping On"<<std::endl;
(*itr)->setLoopingMode( osg::ImageStream::LOOPING );
}
}
return true;
}
return false;
}
default:
return false;
}
}
void MovieEventHandler::getUsage(osg::ApplicationUsage& usage) const
{
usage.addKeyboardMouseBinding("p","Play/Pause movie");
usage.addKeyboardMouseBinding("r","Restart movie");
usage.addKeyboardMouseBinding("l","Toggle looping of movie");
}
int main(int argc, char **argv)
{
osg::ArgumentParser arguments(&argc,argv);
// construct the viewer.
osgViewer::Viewer viewer(arguments);
std::string filename;
arguments.read("-o",filename);
// create a model from the images and pass it to the viewer.
viewer.setSceneData(createModel(arguments));
// pass the model to the MovieEventHandler so it can pick out ImageStream's to manipulate.
MovieEventHandler* meh = new MovieEventHandler();
meh->set( viewer.getSceneData() );
viewer.addEventHandler( meh );
viewer.addEventHandler( new osgViewer::StatsHandler());
if (!filename.empty())
{
osgDB::writeNodeFile(*viewer.getSceneData(),filename);
}
return viewer.run();
}

View File

@@ -0,0 +1,9 @@
SET(TARGET_SRC
osgkdtree.cpp
)
SET(TARGET_ADDED_LIBRARIES osgSim )
#### end var setup ###
SETUP_EXAMPLE(osgkdtree)

Some files were not shown because too many files have changed in this diff Show More