From f81ff952a289de5046a9f767660a64a71b4c37cc Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 3 Aug 2008 16:57:09 +0000 Subject: [PATCH] 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 . --- include/osgUtil/Optimizer | 34 +++---- .../osgViewer/api/Win32/GraphicsWindowWin32 | 6 ++ include/osgWidget/Window | 8 +- .../win32/Win32ConditionPrivateData.h | 1 + src/OpenThreads/win32/Win32Thread.cpp | 1 + src/osgUtil/Optimizer.cpp | 2 +- src/osgViewer/GraphicsWindowWin32.cpp | 88 ++++++++++++++++++- 7 files changed, 116 insertions(+), 24 deletions(-) diff --git a/include/osgUtil/Optimizer b/include/osgUtil/Optimizer index 8ee3b5e35..11f4da648 100644 --- a/include/osgUtil/Optimizer +++ b/include/osgUtil/Optimizer @@ -67,23 +67,23 @@ class OSGUTIL_EXPORT Optimizer enum OptimizationOptions { - FLATTEN_STATIC_TRANSFORMS = 0x001, - REMOVE_REDUNDANT_NODES = 0x002, - REMOVE_LOADED_PROXY_NODES = 0x004, - COMBINE_ADJACENT_LODS = 0x008, - SHARE_DUPLICATE_STATE = 0x010, - MERGE_GEOMETRY = 0x020, - CHECK_GEOMETRY = 0x040, - SPATIALIZE_GROUPS = 0x080, - COPY_SHARED_NODES = 0x100, - TRISTRIP_GEOMETRY = 0x200, - TESSELLATE_GEOMETRY = 0x400, - OPTIMIZE_TEXTURE_SETTINGS = 0x800, - MERGE_GEODES = 0x1000, - FLATTEN_BILLBOARDS = 0x2000, - TEXTURE_ATLAS_BUILDER = 0x4000, - STATIC_OBJECT_DETECTION = 0x8000, - FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS = 0x100, + FLATTEN_STATIC_TRANSFORMS = (1 << 0), + REMOVE_REDUNDANT_NODES = (1 << 1), + REMOVE_LOADED_PROXY_NODES = (1 << 2), + COMBINE_ADJACENT_LODS = (1 << 3), + SHARE_DUPLICATE_STATE = (1 << 4), + MERGE_GEOMETRY = (1 << 5), + CHECK_GEOMETRY = (1 << 6), + SPATIALIZE_GROUPS = (1 << 7), + COPY_SHARED_NODES = (1 << 8), + TRISTRIP_GEOMETRY = (1 << 9), + TESSELLATE_GEOMETRY = (1 << 10), + OPTIMIZE_TEXTURE_SETTINGS = (1 << 11), + MERGE_GEODES = (1 << 12), + FLATTEN_BILLBOARDS = (1 << 13), + TEXTURE_ATLAS_BUILDER = (1 << 14), + STATIC_OBJECT_DETECTION = (1 << 15), + FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS = (1 << 16), DEFAULT_OPTIMIZATIONS = FLATTEN_STATIC_TRANSFORMS | REMOVE_REDUNDANT_NODES | REMOVE_LOADED_PROXY_NODES | diff --git a/include/osgViewer/api/Win32/GraphicsWindowWin32 b/include/osgViewer/api/Win32/GraphicsWindowWin32 index 408b4b31b..29beed0f6 100644 --- a/include/osgViewer/api/Win32/GraphicsWindowWin32 +++ b/include/osgViewer/api/Win32/GraphicsWindowWin32 @@ -174,8 +174,14 @@ class OSGVIEWER_EXPORT GraphicsWindowWin32 : public osgViewer::GraphicsWindow bool _destroying; MouseCursor _mouseCursor; + + /// Persist which mouse cursor was used before switching to the resize cursors. + MouseCursor _appMouseCursor; std::map _mouseCursorMap; + + std::map _keyMap; + }; } diff --git a/include/osgWidget/Window b/include/osgWidget/Window index c13a8e50c..d89c7c96e 100644 --- a/include/osgWidget/Window +++ b/include/osgWidget/Window @@ -29,13 +29,13 @@ namespace osgWidget { // These are helper callbacks you can attach to Windows that will make them moveable, // rotatable, and scalable respectively. -bool callbackWindowMove (Event&); -bool callbackWindowRotate (Event&); -bool callbackWindowScale (Event&); +bool OSGWIDGET_EXPORT callbackWindowMove (Event&); +bool OSGWIDGET_EXPORT callbackWindowRotate (Event&); +bool OSGWIDGET_EXPORT callbackWindowScale (Event&); // These are helper callbacks you can attach to Windows to that will make various // keyboard events behave as you might imagine. -bool callbackWindowTabFocus(Event&); +bool OSGWIDGET_EXPORT callbackWindowTabFocus(Event&); class OSGWIDGET_EXPORT Window: public osg::MatrixTransform, diff --git a/src/OpenThreads/win32/Win32ConditionPrivateData.h b/src/OpenThreads/win32/Win32ConditionPrivateData.h index 0c2ec6bf0..5a14b74e0 100644 --- a/src/OpenThreads/win32/Win32ConditionPrivateData.h +++ b/src/OpenThreads/win32/Win32ConditionPrivateData.h @@ -21,6 +21,7 @@ #ifndef _WINDOWS_ #define WIN32_LEAN_AND_MEAN +#define _WIN32_WINNT 0x0400 #include #endif diff --git a/src/OpenThreads/win32/Win32Thread.cpp b/src/OpenThreads/win32/Win32Thread.cpp index dc414aa3a..86f52a218 100644 --- a/src/OpenThreads/win32/Win32Thread.cpp +++ b/src/OpenThreads/win32/Win32Thread.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #if defined(_MSC_VER) && (_MSC_VER < 1300) #ifdef __SGI_STL diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index b946e29c5..0cce6c635 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -2770,7 +2770,7 @@ bool Optimizer::SpatializeGroupsVisitor::divide(osg::Geode* geode, unsigned int bool yAxis = (bb.yMax()-bb.yMin())>divide_distance; bool zAxis = (bb.zMax()-bb.zMin())>divide_distance; - osg::notify(osg::NOTICE)<<"INFO "<className()<<" num drawables = "<getNumDrawables()<<" xAxis="<className()<<" num drawables = "<getNumDrawables()<<" xAxis="<