From eebbe36451286fdbf46fe53c43b73b1471dbee86 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Wed, 20 Jan 2016 12:48:01 -0500 Subject: [PATCH 01/10] Move osgKido directory under kido/gui with renamed to osg --- kido/gui/CMakeLists.txt | 5 +++++ {osgKido => kido/gui/osg}/CMakeLists.txt | 0 {osgKido => kido/gui/osg}/DefaultEventHandler.cpp | 0 {osgKido => kido/gui/osg}/DefaultEventHandler.hpp | 0 {osgKido => kido/gui/osg}/DragAndDrop.cpp | 0 {osgKido => kido/gui/osg}/DragAndDrop.hpp | 0 {osgKido => kido/gui/osg}/EntityNode.cpp | 0 {osgKido => kido/gui/osg}/EntityNode.hpp | 0 {osgKido => kido/gui/osg}/FrameNode.cpp | 0 {osgKido => kido/gui/osg}/FrameNode.hpp | 0 {osgKido => kido/gui/osg}/InteractiveFrame.cpp | 0 {osgKido => kido/gui/osg}/InteractiveFrame.hpp | 0 {osgKido => kido/gui/osg}/MouseEventHandler.hpp | 0 {osgKido => kido/gui/osg}/SupportPolygonVisual.cpp | 0 {osgKido => kido/gui/osg}/SupportPolygonVisual.hpp | 0 {osgKido => kido/gui/osg}/TrackballManipulator.cpp | 0 {osgKido => kido/gui/osg}/TrackballManipulator.hpp | 0 {osgKido => kido/gui/osg}/Utils.hpp | 0 {osgKido => kido/gui/osg}/Viewer.cpp | 0 {osgKido => kido/gui/osg}/Viewer.hpp | 0 {osgKido => kido/gui/osg}/WorldNode.cpp | 0 {osgKido => kido/gui/osg}/WorldNode.hpp | 0 {osgKido => kido/gui/osg}/examples/CMakeLists.txt | 0 {osgKido => kido/gui/osg}/examples/osgAtlasPuppet.cpp | 0 {osgKido => kido/gui/osg}/examples/osgDragAndDrop.cpp | 0 {osgKido => kido/gui/osg}/examples/osgHuboPuppet.cpp | 0 .../gui/osg}/examples/osgOperationalSpaceControl.cpp | 0 {osgKido => kido/gui/osg}/examples/osgSoftBodies.cpp | 0 {osgKido => kido/gui/osg}/osgKido.hpp.in | 0 {osgKido => kido/gui/osg}/render/BoxShapeNode.cpp | 0 {osgKido => kido/gui/osg}/render/BoxShapeNode.hpp | 0 {osgKido => kido/gui/osg}/render/CMakeLists.txt | 0 {osgKido => kido/gui/osg}/render/CylinderShapeNode.cpp | 0 {osgKido => kido/gui/osg}/render/CylinderShapeNode.hpp | 0 {osgKido => kido/gui/osg}/render/EllipsoidShapeNode.cpp | 0 {osgKido => kido/gui/osg}/render/EllipsoidShapeNode.hpp | 0 {osgKido => kido/gui/osg}/render/LineSegmentShapeNode.cpp | 0 {osgKido => kido/gui/osg}/render/LineSegmentShapeNode.hpp | 0 {osgKido => kido/gui/osg}/render/MeshShapeNode.cpp | 0 {osgKido => kido/gui/osg}/render/MeshShapeNode.hpp | 0 {osgKido => kido/gui/osg}/render/PlaneShapeNode.cpp | 0 {osgKido => kido/gui/osg}/render/PlaneShapeNode.hpp | 0 {osgKido => kido/gui/osg}/render/ShapeNode.cpp | 0 {osgKido => kido/gui/osg}/render/ShapeNode.hpp | 0 {osgKido => kido/gui/osg}/render/SoftMeshShapeNode.cpp | 0 {osgKido => kido/gui/osg}/render/SoftMeshShapeNode.hpp | 0 {osgKido => kido/gui/osg}/render/WarningShapeNode.cpp | 0 {osgKido => kido/gui/osg}/render/WarningShapeNode.hpp | 0 {osgKido => kido/gui/osg}/render/render.hpp.in | 0 49 files changed, 5 insertions(+) rename {osgKido => kido/gui/osg}/CMakeLists.txt (100%) rename {osgKido => kido/gui/osg}/DefaultEventHandler.cpp (100%) rename {osgKido => kido/gui/osg}/DefaultEventHandler.hpp (100%) rename {osgKido => kido/gui/osg}/DragAndDrop.cpp (100%) rename {osgKido => kido/gui/osg}/DragAndDrop.hpp (100%) rename {osgKido => kido/gui/osg}/EntityNode.cpp (100%) rename {osgKido => kido/gui/osg}/EntityNode.hpp (100%) rename {osgKido => kido/gui/osg}/FrameNode.cpp (100%) rename {osgKido => kido/gui/osg}/FrameNode.hpp (100%) rename {osgKido => kido/gui/osg}/InteractiveFrame.cpp (100%) rename {osgKido => kido/gui/osg}/InteractiveFrame.hpp (100%) rename {osgKido => kido/gui/osg}/MouseEventHandler.hpp (100%) rename {osgKido => kido/gui/osg}/SupportPolygonVisual.cpp (100%) rename {osgKido => kido/gui/osg}/SupportPolygonVisual.hpp (100%) rename {osgKido => kido/gui/osg}/TrackballManipulator.cpp (100%) rename {osgKido => kido/gui/osg}/TrackballManipulator.hpp (100%) rename {osgKido => kido/gui/osg}/Utils.hpp (100%) rename {osgKido => kido/gui/osg}/Viewer.cpp (100%) rename {osgKido => kido/gui/osg}/Viewer.hpp (100%) rename {osgKido => kido/gui/osg}/WorldNode.cpp (100%) rename {osgKido => kido/gui/osg}/WorldNode.hpp (100%) rename {osgKido => kido/gui/osg}/examples/CMakeLists.txt (100%) rename {osgKido => kido/gui/osg}/examples/osgAtlasPuppet.cpp (100%) rename {osgKido => kido/gui/osg}/examples/osgDragAndDrop.cpp (100%) rename {osgKido => kido/gui/osg}/examples/osgHuboPuppet.cpp (100%) rename {osgKido => kido/gui/osg}/examples/osgOperationalSpaceControl.cpp (100%) rename {osgKido => kido/gui/osg}/examples/osgSoftBodies.cpp (100%) rename {osgKido => kido/gui/osg}/osgKido.hpp.in (100%) rename {osgKido => kido/gui/osg}/render/BoxShapeNode.cpp (100%) rename {osgKido => kido/gui/osg}/render/BoxShapeNode.hpp (100%) rename {osgKido => kido/gui/osg}/render/CMakeLists.txt (100%) rename {osgKido => kido/gui/osg}/render/CylinderShapeNode.cpp (100%) rename {osgKido => kido/gui/osg}/render/CylinderShapeNode.hpp (100%) rename {osgKido => kido/gui/osg}/render/EllipsoidShapeNode.cpp (100%) rename {osgKido => kido/gui/osg}/render/EllipsoidShapeNode.hpp (100%) rename {osgKido => kido/gui/osg}/render/LineSegmentShapeNode.cpp (100%) rename {osgKido => kido/gui/osg}/render/LineSegmentShapeNode.hpp (100%) rename {osgKido => kido/gui/osg}/render/MeshShapeNode.cpp (100%) rename {osgKido => kido/gui/osg}/render/MeshShapeNode.hpp (100%) rename {osgKido => kido/gui/osg}/render/PlaneShapeNode.cpp (100%) rename {osgKido => kido/gui/osg}/render/PlaneShapeNode.hpp (100%) rename {osgKido => kido/gui/osg}/render/ShapeNode.cpp (100%) rename {osgKido => kido/gui/osg}/render/ShapeNode.hpp (100%) rename {osgKido => kido/gui/osg}/render/SoftMeshShapeNode.cpp (100%) rename {osgKido => kido/gui/osg}/render/SoftMeshShapeNode.hpp (100%) rename {osgKido => kido/gui/osg}/render/WarningShapeNode.cpp (100%) rename {osgKido => kido/gui/osg}/render/WarningShapeNode.hpp (100%) rename {osgKido => kido/gui/osg}/render/render.hpp.in (100%) diff --git a/kido/gui/CMakeLists.txt b/kido/gui/CMakeLists.txt index 73db8310f73f3..66982803bbb2a 100644 --- a/kido/gui/CMakeLists.txt +++ b/kido/gui/CMakeLists.txt @@ -4,6 +4,11 @@ file(GLOB hdrs "*.hpp") include_directories(SYSTEM ${GLUT_INCLUDE_DIR}) +# Add subdirectories +if(HAVE_OPENSCENEGRAPH) + add_subdirectory(osgKido) +endif(HAVE_OPENSCENEGRAPH) + # Library kido_add_library(kido-gui ${srcs} ${hdrs}) target_link_libraries(kido-gui kido kido-utils ${GLUT_LIBRARY}) diff --git a/osgKido/CMakeLists.txt b/kido/gui/osg/CMakeLists.txt similarity index 100% rename from osgKido/CMakeLists.txt rename to kido/gui/osg/CMakeLists.txt diff --git a/osgKido/DefaultEventHandler.cpp b/kido/gui/osg/DefaultEventHandler.cpp similarity index 100% rename from osgKido/DefaultEventHandler.cpp rename to kido/gui/osg/DefaultEventHandler.cpp diff --git a/osgKido/DefaultEventHandler.hpp b/kido/gui/osg/DefaultEventHandler.hpp similarity index 100% rename from osgKido/DefaultEventHandler.hpp rename to kido/gui/osg/DefaultEventHandler.hpp diff --git a/osgKido/DragAndDrop.cpp b/kido/gui/osg/DragAndDrop.cpp similarity index 100% rename from osgKido/DragAndDrop.cpp rename to kido/gui/osg/DragAndDrop.cpp diff --git a/osgKido/DragAndDrop.hpp b/kido/gui/osg/DragAndDrop.hpp similarity index 100% rename from osgKido/DragAndDrop.hpp rename to kido/gui/osg/DragAndDrop.hpp diff --git a/osgKido/EntityNode.cpp b/kido/gui/osg/EntityNode.cpp similarity index 100% rename from osgKido/EntityNode.cpp rename to kido/gui/osg/EntityNode.cpp diff --git a/osgKido/EntityNode.hpp b/kido/gui/osg/EntityNode.hpp similarity index 100% rename from osgKido/EntityNode.hpp rename to kido/gui/osg/EntityNode.hpp diff --git a/osgKido/FrameNode.cpp b/kido/gui/osg/FrameNode.cpp similarity index 100% rename from osgKido/FrameNode.cpp rename to kido/gui/osg/FrameNode.cpp diff --git a/osgKido/FrameNode.hpp b/kido/gui/osg/FrameNode.hpp similarity index 100% rename from osgKido/FrameNode.hpp rename to kido/gui/osg/FrameNode.hpp diff --git a/osgKido/InteractiveFrame.cpp b/kido/gui/osg/InteractiveFrame.cpp similarity index 100% rename from osgKido/InteractiveFrame.cpp rename to kido/gui/osg/InteractiveFrame.cpp diff --git a/osgKido/InteractiveFrame.hpp b/kido/gui/osg/InteractiveFrame.hpp similarity index 100% rename from osgKido/InteractiveFrame.hpp rename to kido/gui/osg/InteractiveFrame.hpp diff --git a/osgKido/MouseEventHandler.hpp b/kido/gui/osg/MouseEventHandler.hpp similarity index 100% rename from osgKido/MouseEventHandler.hpp rename to kido/gui/osg/MouseEventHandler.hpp diff --git a/osgKido/SupportPolygonVisual.cpp b/kido/gui/osg/SupportPolygonVisual.cpp similarity index 100% rename from osgKido/SupportPolygonVisual.cpp rename to kido/gui/osg/SupportPolygonVisual.cpp diff --git a/osgKido/SupportPolygonVisual.hpp b/kido/gui/osg/SupportPolygonVisual.hpp similarity index 100% rename from osgKido/SupportPolygonVisual.hpp rename to kido/gui/osg/SupportPolygonVisual.hpp diff --git a/osgKido/TrackballManipulator.cpp b/kido/gui/osg/TrackballManipulator.cpp similarity index 100% rename from osgKido/TrackballManipulator.cpp rename to kido/gui/osg/TrackballManipulator.cpp diff --git a/osgKido/TrackballManipulator.hpp b/kido/gui/osg/TrackballManipulator.hpp similarity index 100% rename from osgKido/TrackballManipulator.hpp rename to kido/gui/osg/TrackballManipulator.hpp diff --git a/osgKido/Utils.hpp b/kido/gui/osg/Utils.hpp similarity index 100% rename from osgKido/Utils.hpp rename to kido/gui/osg/Utils.hpp diff --git a/osgKido/Viewer.cpp b/kido/gui/osg/Viewer.cpp similarity index 100% rename from osgKido/Viewer.cpp rename to kido/gui/osg/Viewer.cpp diff --git a/osgKido/Viewer.hpp b/kido/gui/osg/Viewer.hpp similarity index 100% rename from osgKido/Viewer.hpp rename to kido/gui/osg/Viewer.hpp diff --git a/osgKido/WorldNode.cpp b/kido/gui/osg/WorldNode.cpp similarity index 100% rename from osgKido/WorldNode.cpp rename to kido/gui/osg/WorldNode.cpp diff --git a/osgKido/WorldNode.hpp b/kido/gui/osg/WorldNode.hpp similarity index 100% rename from osgKido/WorldNode.hpp rename to kido/gui/osg/WorldNode.hpp diff --git a/osgKido/examples/CMakeLists.txt b/kido/gui/osg/examples/CMakeLists.txt similarity index 100% rename from osgKido/examples/CMakeLists.txt rename to kido/gui/osg/examples/CMakeLists.txt diff --git a/osgKido/examples/osgAtlasPuppet.cpp b/kido/gui/osg/examples/osgAtlasPuppet.cpp similarity index 100% rename from osgKido/examples/osgAtlasPuppet.cpp rename to kido/gui/osg/examples/osgAtlasPuppet.cpp diff --git a/osgKido/examples/osgDragAndDrop.cpp b/kido/gui/osg/examples/osgDragAndDrop.cpp similarity index 100% rename from osgKido/examples/osgDragAndDrop.cpp rename to kido/gui/osg/examples/osgDragAndDrop.cpp diff --git a/osgKido/examples/osgHuboPuppet.cpp b/kido/gui/osg/examples/osgHuboPuppet.cpp similarity index 100% rename from osgKido/examples/osgHuboPuppet.cpp rename to kido/gui/osg/examples/osgHuboPuppet.cpp diff --git a/osgKido/examples/osgOperationalSpaceControl.cpp b/kido/gui/osg/examples/osgOperationalSpaceControl.cpp similarity index 100% rename from osgKido/examples/osgOperationalSpaceControl.cpp rename to kido/gui/osg/examples/osgOperationalSpaceControl.cpp diff --git a/osgKido/examples/osgSoftBodies.cpp b/kido/gui/osg/examples/osgSoftBodies.cpp similarity index 100% rename from osgKido/examples/osgSoftBodies.cpp rename to kido/gui/osg/examples/osgSoftBodies.cpp diff --git a/osgKido/osgKido.hpp.in b/kido/gui/osg/osgKido.hpp.in similarity index 100% rename from osgKido/osgKido.hpp.in rename to kido/gui/osg/osgKido.hpp.in diff --git a/osgKido/render/BoxShapeNode.cpp b/kido/gui/osg/render/BoxShapeNode.cpp similarity index 100% rename from osgKido/render/BoxShapeNode.cpp rename to kido/gui/osg/render/BoxShapeNode.cpp diff --git a/osgKido/render/BoxShapeNode.hpp b/kido/gui/osg/render/BoxShapeNode.hpp similarity index 100% rename from osgKido/render/BoxShapeNode.hpp rename to kido/gui/osg/render/BoxShapeNode.hpp diff --git a/osgKido/render/CMakeLists.txt b/kido/gui/osg/render/CMakeLists.txt similarity index 100% rename from osgKido/render/CMakeLists.txt rename to kido/gui/osg/render/CMakeLists.txt diff --git a/osgKido/render/CylinderShapeNode.cpp b/kido/gui/osg/render/CylinderShapeNode.cpp similarity index 100% rename from osgKido/render/CylinderShapeNode.cpp rename to kido/gui/osg/render/CylinderShapeNode.cpp diff --git a/osgKido/render/CylinderShapeNode.hpp b/kido/gui/osg/render/CylinderShapeNode.hpp similarity index 100% rename from osgKido/render/CylinderShapeNode.hpp rename to kido/gui/osg/render/CylinderShapeNode.hpp diff --git a/osgKido/render/EllipsoidShapeNode.cpp b/kido/gui/osg/render/EllipsoidShapeNode.cpp similarity index 100% rename from osgKido/render/EllipsoidShapeNode.cpp rename to kido/gui/osg/render/EllipsoidShapeNode.cpp diff --git a/osgKido/render/EllipsoidShapeNode.hpp b/kido/gui/osg/render/EllipsoidShapeNode.hpp similarity index 100% rename from osgKido/render/EllipsoidShapeNode.hpp rename to kido/gui/osg/render/EllipsoidShapeNode.hpp diff --git a/osgKido/render/LineSegmentShapeNode.cpp b/kido/gui/osg/render/LineSegmentShapeNode.cpp similarity index 100% rename from osgKido/render/LineSegmentShapeNode.cpp rename to kido/gui/osg/render/LineSegmentShapeNode.cpp diff --git a/osgKido/render/LineSegmentShapeNode.hpp b/kido/gui/osg/render/LineSegmentShapeNode.hpp similarity index 100% rename from osgKido/render/LineSegmentShapeNode.hpp rename to kido/gui/osg/render/LineSegmentShapeNode.hpp diff --git a/osgKido/render/MeshShapeNode.cpp b/kido/gui/osg/render/MeshShapeNode.cpp similarity index 100% rename from osgKido/render/MeshShapeNode.cpp rename to kido/gui/osg/render/MeshShapeNode.cpp diff --git a/osgKido/render/MeshShapeNode.hpp b/kido/gui/osg/render/MeshShapeNode.hpp similarity index 100% rename from osgKido/render/MeshShapeNode.hpp rename to kido/gui/osg/render/MeshShapeNode.hpp diff --git a/osgKido/render/PlaneShapeNode.cpp b/kido/gui/osg/render/PlaneShapeNode.cpp similarity index 100% rename from osgKido/render/PlaneShapeNode.cpp rename to kido/gui/osg/render/PlaneShapeNode.cpp diff --git a/osgKido/render/PlaneShapeNode.hpp b/kido/gui/osg/render/PlaneShapeNode.hpp similarity index 100% rename from osgKido/render/PlaneShapeNode.hpp rename to kido/gui/osg/render/PlaneShapeNode.hpp diff --git a/osgKido/render/ShapeNode.cpp b/kido/gui/osg/render/ShapeNode.cpp similarity index 100% rename from osgKido/render/ShapeNode.cpp rename to kido/gui/osg/render/ShapeNode.cpp diff --git a/osgKido/render/ShapeNode.hpp b/kido/gui/osg/render/ShapeNode.hpp similarity index 100% rename from osgKido/render/ShapeNode.hpp rename to kido/gui/osg/render/ShapeNode.hpp diff --git a/osgKido/render/SoftMeshShapeNode.cpp b/kido/gui/osg/render/SoftMeshShapeNode.cpp similarity index 100% rename from osgKido/render/SoftMeshShapeNode.cpp rename to kido/gui/osg/render/SoftMeshShapeNode.cpp diff --git a/osgKido/render/SoftMeshShapeNode.hpp b/kido/gui/osg/render/SoftMeshShapeNode.hpp similarity index 100% rename from osgKido/render/SoftMeshShapeNode.hpp rename to kido/gui/osg/render/SoftMeshShapeNode.hpp diff --git a/osgKido/render/WarningShapeNode.cpp b/kido/gui/osg/render/WarningShapeNode.cpp similarity index 100% rename from osgKido/render/WarningShapeNode.cpp rename to kido/gui/osg/render/WarningShapeNode.cpp diff --git a/osgKido/render/WarningShapeNode.hpp b/kido/gui/osg/render/WarningShapeNode.hpp similarity index 100% rename from osgKido/render/WarningShapeNode.hpp rename to kido/gui/osg/render/WarningShapeNode.hpp diff --git a/osgKido/render/render.hpp.in b/kido/gui/osg/render/render.hpp.in similarity index 100% rename from osgKido/render/render.hpp.in rename to kido/gui/osg/render/render.hpp.in From 70abb5de73361697aad1d86d3db6b9ef6e6297fb Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Wed, 20 Jan 2016 14:22:33 -0500 Subject: [PATCH 02/10] Add open-scene-graph and remove gtest in the dependency list of before_install_osx.sh --- ci/before_install_osx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/before_install_osx.sh b/ci/before_install_osx.sh index e80330ad26dc9..1b15cc39e397b 100755 --- a/ci/before_install_osx.sh +++ b/ci/before_install_osx.sh @@ -20,7 +20,7 @@ ipopt ros/deps/urdfdom ros/deps/urdfdom_headers ros/deps/console_bridge -ros/deps/gtest +open-scene-graph ' brew install $PACKAGES | grep -v '%$' From 17d9fee95b5a84eb16587f0c56dd3b0f01a5739a Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Wed, 20 Jan 2016 14:30:48 -0500 Subject: [PATCH 03/10] Change osgKido namespace to kido::gui --- CMakeLists.txt | 29 ++++- kido/config.hpp.in | 1 + kido/gui/CMakeLists.txt | 3 +- kido/gui/osg/CMakeLists.txt | 109 +++++++----------- kido/gui/osg/DefaultEventHandler.cpp | 19 +-- kido/gui/osg/DefaultEventHandler.hpp | 9 +- kido/gui/osg/DragAndDrop.cpp | 41 +++---- kido/gui/osg/DragAndDrop.hpp | 13 +-- kido/gui/osg/EntityNode.cpp | 28 ++--- kido/gui/osg/EntityNode.hpp | 8 +- kido/gui/osg/FrameNode.cpp | 13 ++- kido/gui/osg/FrameNode.hpp | 8 +- kido/gui/osg/InteractiveFrame.cpp | 9 +- kido/gui/osg/InteractiveFrame.hpp | 8 +- kido/gui/osg/MouseEventHandler.hpp | 9 +- kido/gui/osg/SupportPolygonVisual.cpp | 6 +- kido/gui/osg/SupportPolygonVisual.hpp | 8 +- kido/gui/osg/TrackballManipulator.cpp | 9 +- kido/gui/osg/TrackballManipulator.hpp | 11 +- kido/gui/osg/Viewer.cpp | 23 ++-- kido/gui/osg/Viewer.hpp | 16 ++- kido/gui/osg/WorldNode.cpp | 13 ++- kido/gui/osg/WorldNode.hpp | 16 ++- kido/gui/osg/examples/CMakeLists.txt | 4 +- kido/gui/osg/examples/osgAtlasPuppet.cpp | 26 ++--- kido/gui/osg/examples/osgDragAndDrop.cpp | 8 +- kido/gui/osg/examples/osgHuboPuppet.cpp | 31 +++-- .../examples/osgOperationalSpaceControl.cpp | 14 +-- kido/gui/osg/examples/osgSoftBodies.cpp | 6 +- kido/gui/osg/{osgKido.hpp.in => osg.hpp.in} | 0 kido/gui/osg/render/BoxShapeNode.cpp | 10 +- kido/gui/osg/render/BoxShapeNode.hpp | 9 +- kido/gui/osg/render/CMakeLists.txt | 20 ++-- kido/gui/osg/render/CylinderShapeNode.cpp | 10 +- kido/gui/osg/render/CylinderShapeNode.hpp | 9 +- kido/gui/osg/render/EllipsoidShapeNode.cpp | 10 +- kido/gui/osg/render/EllipsoidShapeNode.hpp | 9 +- kido/gui/osg/render/LineSegmentShapeNode.cpp | 10 +- kido/gui/osg/render/LineSegmentShapeNode.hpp | 9 +- kido/gui/osg/render/MeshShapeNode.cpp | 12 +- kido/gui/osg/render/MeshShapeNode.hpp | 9 +- kido/gui/osg/render/PlaneShapeNode.cpp | 10 +- kido/gui/osg/render/PlaneShapeNode.hpp | 9 +- kido/gui/osg/render/ShapeNode.cpp | 10 +- kido/gui/osg/render/ShapeNode.hpp | 7 +- kido/gui/osg/render/SoftMeshShapeNode.cpp | 10 +- kido/gui/osg/render/SoftMeshShapeNode.hpp | 9 +- kido/gui/osg/render/WarningShapeNode.cpp | 12 +- kido/gui/osg/render/WarningShapeNode.hpp | 8 +- kido/gui/osg/render/render.hpp.in | 2 +- 50 files changed, 360 insertions(+), 332 deletions(-) rename kido/gui/osg/{osgKido.hpp.in => osg.hpp.in} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index bce2336ee2953..8d81acc6162cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -255,6 +255,31 @@ else() endif() endif() +# OpenSceneGraph +find_package(OpenSceneGraph 3.0 QUIET + COMPONENTS osg osgViewer osgManipulator osgGA osgDB) +if(OPENSCENEGRAPH_FOUND) + message(STATUS "Looking for OpenSceneGraph -- ${OPENSCENEGRAPH_VERSION} found") + set(HAVE_OPENSCENEGRAPH TRUE) +else(OPENSCENEGRAPH_FOUND) + # kido-gui-osg requires both OSG and OpenThreads. This section attempts to + # identify which of those are missing from the building machine and offer + # advice to the user for getting osgKido to build. + find_package(OpenThreads QUIET) + if(OPENTHREADS_FOUND) + set(warning_msg "Could NOT find OpenSceneGraph") + else(OPENTHREADS_FOUND) + if(OSG_LIBRARY) + set(warning_msg "Could NOT find OpenThreads") + else(OSG_LIBRARY) + set(warning_msg "Could NOT find OpenSceneGraph nor OpenThreads") + endif(OSG_LIBRARY) + endif(OPENTHREADS_FOUND) + message(WARNING "${warning_msg} -- we will skip kido-gui-osg\n" + "If you believe you do have both OSG and OpenThreads installed, try setting OSG_DIR") + set(HAVE_OPENSCENEGRAPH FALSE) +endif(OPENSCENEGRAPH_FOUND) + # FLANN find_package(FLANN 1.8.4 QUIET) if(FLANN_FOUND) @@ -567,10 +592,6 @@ install(FILES package.xml DESTINATION share/${PROJECT_NAME}) #=============================================================================== add_subdirectory(kido) -if(KIDO_BUILD_OSGKIDO) - add_subdirectory(osgKido) -endif(KIDO_BUILD_OSGKIDO) - # Unit tests if(KIDO_BUILD_UNITTESTS) enable_testing() diff --git a/kido/config.hpp.in b/kido/config.hpp.in index 970bffc135a94..e2038861c0929 100644 --- a/kido/config.hpp.in +++ b/kido/config.hpp.in @@ -46,6 +46,7 @@ #cmakedefine HAVE_IPOPT 1 #cmakedefine HAVE_SNOPT 1 #cmakedefine HAVE_BULLET_COLLISION 1 +#cmakedefine HAVE_OPENSCENEGRAPH 1 #define KIDO_ROOT_PATH "@CMAKE_SOURCE_DIR@/" #define KIDO_DATA_PATH "@CMAKE_SOURCE_DIR@/data/" diff --git a/kido/gui/CMakeLists.txt b/kido/gui/CMakeLists.txt index 66982803bbb2a..a0a7125f7f267 100644 --- a/kido/gui/CMakeLists.txt +++ b/kido/gui/CMakeLists.txt @@ -6,7 +6,7 @@ include_directories(SYSTEM ${GLUT_INCLUDE_DIR}) # Add subdirectories if(HAVE_OPENSCENEGRAPH) - add_subdirectory(osgKido) + add_subdirectory(osg) endif(HAVE_OPENSCENEGRAPH) # Library @@ -15,6 +15,7 @@ target_link_libraries(kido-gui kido kido-utils ${GLUT_LIBRARY}) # Generate header for this namespace kido_get_filename_components(header_names "gui headers" ${hdrs}) +list(APPEND header_names "osg/osg.hpp") kido_generate_include_header_list( gui_headers "kido/gui/" diff --git a/kido/gui/osg/CMakeLists.txt b/kido/gui/osg/CMakeLists.txt index b9c1d5fc4e464..ba2efafd05eaa 100644 --- a/kido/gui/osg/CMakeLists.txt +++ b/kido/gui/osg/CMakeLists.txt @@ -1,69 +1,40 @@ -# Check if OpenSceneGraph is available on the build machine -find_package(OpenSceneGraph 3.0 QUIET - COMPONENTS osg osgViewer osgManipulator osgGA osgDB) - -if(${OPENSCENEGRAPH_FOUND}) - - message(STATUS "Found OpenSceneGraph ${OPENSCENEGRAPH_VERSION} -- Building osgKido") - - include_directories(SYSTEM ${OPENSCENEGRAPH_INCLUDE_DIRS}) - - file(GLOB srcs "*.cpp" "render/*.cpp" "render/*.hpp") - file(GLOB hdrs "*.hpp") - - kido_add_library(kido-gui-osg ${srcs} ${hdrs}) - target_link_libraries(kido-gui-osg kido kido-utils ${OPENSCENEGRAPH_LIBRARIES}) - - kido_get_filename_components(header_names "gui-osg headers" ${hdrs}) - list(APPEND header_names "render/render.hpp") - kido_generate_include_header_list( - gui_osg_headers - "osgKido/" - "gui-osg headers" - ${header_names} - ) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/osgKido.hpp.in - ${CMAKE_CURRENT_BINARY_DIR}/osgKido.hpp - ) - - add_subdirectory(render) - - if(${KIDO_BUILD_EXAMPLES}) - add_subdirectory(examples) - endif(${KIDO_BUILD_EXAMPLES}) - - install( - FILES ${osgKido_hdrs} ${CMAKE_CURRENT_BINARY_DIR}/osgKido.hpp - DESTINATION include/osgKido - COMPONENT headers - ) - - install(TARGETS kido-gui-osg EXPORT KIDOTargets DESTINATION lib) - -else(${OPENSCENEGRAPH_FOUND}) - - # osgKido requires both OSG and OpenThreads. This section attempts to identify - # which of those are missing from the building machine and offer advice to the - # user for getting osgKido to build. - - find_package(OpenThreads QUIET) - if(${OPENTHREADS_FOUND}) - - set(warning_msg "Could NOT find OpenSceneGraph") - - else(${OPENTHREADS_FOUND}) - - if(OSG_LIBRARY) - set(warning_msg "Could NOT find OpenThreads") - else(OSG_LIBRARY) - set(warning_msg "Could NOT find OpenSceneGraph nor OpenThreads") - endif(OSG_LIBRARY) - - endif(${OPENTHREADS_FOUND}) - - message(WARNING "${warning_msg} -- we will skip osgKido\n" - "If you believe you do have both OSG and OpenThreads installed, try setting OSG_DIR") - -endif(${OPENSCENEGRAPH_FOUND}) - +include_directories(SYSTEM ${OPENSCENEGRAPH_INCLUDE_DIRS}) + +# Search all header and source files +file(GLOB srcs "*.cpp") +file(GLOB hdrs "*.hpp") + +set(kido_gui_osg_srcs ${srcs}) +set(kido_gui_osg_hdrs ${hdrs}) + +add_subdirectory(render) + +# Library +kido_add_library(kido-gui-osg ${kido_gui_osg_srcs} ${kido_gui_osg_hdrs}) +target_link_libraries(kido-gui-osg kido kido-utils ${OPENSCENEGRAPH_LIBRARIES}) + +# Generate header for this namespace +kido_get_filename_components(header_names "gui osg headers" ${hdrs}) +list(APPEND header_names "render/render.hpp") +kido_generate_include_header_list( + gui_osg_headers + "kido/gui/osg/" + "gui osg headers" + ${header_names} +) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/osg.hpp.in + ${CMAKE_CURRENT_BINARY_DIR}/osg.hpp +) + +if(${KIDO_BUILD_EXAMPLES}) + add_subdirectory(examples) +endif(${KIDO_BUILD_EXAMPLES}) + +# Install +install( + FILES ${hdrs} ${CMAKE_CURRENT_BINARY_DIR}/osg.hpp + DESTINATION include/kido/gui/osg + COMPONENT headers +) +install(TARGETS kido-gui-osg EXPORT KIDOTargets DESTINATION lib) diff --git a/kido/gui/osg/DefaultEventHandler.cpp b/kido/gui/osg/DefaultEventHandler.cpp index cb3d87167b090..28cfb61cf4d04 100644 --- a/kido/gui/osg/DefaultEventHandler.cpp +++ b/kido/gui/osg/DefaultEventHandler.cpp @@ -36,20 +36,20 @@ #include -#include "osgKido/DefaultEventHandler.hpp" -#include "osgKido/MouseEventHandler.hpp" -#include "osgKido/Viewer.hpp" -#include "osgKido/render/ShapeNode.hpp" -#include "osgKido/EntityNode.hpp" -#include "osgKido/Utils.hpp" +#include "kido/gui/osg/DefaultEventHandler.hpp" +#include "kido/gui/osg/MouseEventHandler.hpp" +#include "kido/gui/osg/Viewer.hpp" +#include "kido/gui/osg/render/ShapeNode.hpp" +#include "kido/gui/osg/EntityNode.hpp" +#include "kido/gui/osg/Utils.hpp" #include "kido/dynamics/Entity.hpp" #include -namespace osgKido -{ +namespace kido { +namespace gui { DefaultEventHandler::DefaultEventHandler(Viewer* _viewer) : mViewer(_viewer), @@ -442,4 +442,5 @@ void DefaultEventHandler::handleDestructionNotification( mMouseEventHandlers.erase(it); } -} // namespace osgKido +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/DefaultEventHandler.hpp b/kido/gui/osg/DefaultEventHandler.hpp index 3a434ed948d6b..20ed1705f3287 100644 --- a/kido/gui/osg/DefaultEventHandler.hpp +++ b/kido/gui/osg/DefaultEventHandler.hpp @@ -49,13 +49,13 @@ #include "kido/common/Observer.hpp" namespace kido { + namespace dynamics { class Entity; class Shape; } // dynamics -} // kido -namespace osgKido +namespace gui { struct PickInfo @@ -198,7 +198,7 @@ class DefaultEventHandler : public osgGA::GUIEventHandler, virtual void handleDestructionNotification( const kido::common::Subject* _subject) override; - /// osgKido::Viewer that this event handler is tied to + /// kido::gui::Viewer that this event handler is tied to Viewer* mViewer; /// Set of MouseEventHandlers that are tied to this DefaultEventHandler @@ -231,6 +231,7 @@ class DefaultEventHandler : public osgGA::GUIEventHandler, }; -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_DEFAULTEVENTHANDLER_HPP diff --git a/kido/gui/osg/DragAndDrop.cpp b/kido/gui/osg/DragAndDrop.cpp index e02d533010861..ea83d4bca0a7c 100644 --- a/kido/gui/osg/DragAndDrop.cpp +++ b/kido/gui/osg/DragAndDrop.cpp @@ -34,11 +34,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "osgKido/DragAndDrop.hpp" -#include "osgKido/DefaultEventHandler.hpp" -#include "osgKido/Viewer.hpp" -#include "osgKido/InteractiveFrame.hpp" -#include "osgKido/MouseEventHandler.hpp" +#include "kido/gui/osg/DragAndDrop.hpp" +#include "kido/gui/osg/DefaultEventHandler.hpp" +#include "kido/gui/osg/Viewer.hpp" +#include "kido/gui/osg/InteractiveFrame.hpp" +#include "kido/gui/osg/MouseEventHandler.hpp" #include "kido/dynamics/SimpleFrame.hpp" #include "kido/dynamics/MeshShape.hpp" @@ -49,7 +49,8 @@ #include "kido/math/Helpers.hpp" -namespace osgKido { +namespace kido { +namespace gui { DragAndDrop::DragAndDrop(Viewer* viewer, kido::dynamics::Entity* entity) : mViewer(viewer), @@ -83,12 +84,12 @@ void DragAndDrop::update() if(nullptr == mEntity) return; - osgKido::MouseButtonEvent event = + kido::gui::MouseButtonEvent event = mViewer->getDefaultEventHandler()->getButtonEvent(LEFT_MOUSE); if(mAmMoving) { - if(osgKido::BUTTON_RELEASE == event) + if(kido::gui::BUTTON_RELEASE == event) { mAmMoving = false; release(); @@ -98,13 +99,13 @@ void DragAndDrop::update() } else // not moving { - if(osgKido::BUTTON_PUSH == event) + if(kido::gui::BUTTON_PUSH == event) { - const std::vector& picks = + const std::vector& picks = mViewer->getDefaultEventHandler()->getButtonPicks( - osgKido::LEFT_MOUSE, osgKido::BUTTON_PUSH); + kido::gui::LEFT_MOUSE, kido::gui::BUTTON_PUSH); - for(const osgKido::PickInfo& pick : picks) + for(const kido::gui::PickInfo& pick : picks) { if(pick.entity == mEntity) { @@ -332,25 +333,25 @@ void SimpleFrameShapeDnD::update() if(nullptr == mEntity || nullptr == mShape) return; - osgKido::MouseButtonEvent event = + kido::gui::MouseButtonEvent event = mViewer->getDefaultEventHandler()->getButtonEvent(LEFT_MOUSE); if(mAmMoving) { - if(osgKido::BUTTON_RELEASE == event) + if(kido::gui::BUTTON_RELEASE == event) mAmMoving = false; move(); } else { - if(osgKido::BUTTON_PUSH == event) + if(kido::gui::BUTTON_PUSH == event) { - const std::vector& picks = + const std::vector& picks = mViewer->getDefaultEventHandler()->getButtonPicks( - osgKido::LEFT_MOUSE, osgKido::BUTTON_PUSH); + kido::gui::LEFT_MOUSE, kido::gui::BUTTON_PUSH); - for(const osgKido::PickInfo& pick : picks) + for(const kido::gui::PickInfo& pick : picks) { if(pick.entity == mEntity && pick.shape.get() == mShape) { @@ -801,5 +802,5 @@ osgGA::GUIEventAdapter::ModKeyMask BodyNodeDnD::getJointRestrictionModKey() cons return mJointRestrictionModKey; } - -} // namespace osgKido +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/DragAndDrop.hpp b/kido/gui/osg/DragAndDrop.hpp index 00f494fedcbad..2996244a82347 100644 --- a/kido/gui/osg/DragAndDrop.hpp +++ b/kido/gui/osg/DragAndDrop.hpp @@ -47,19 +47,18 @@ #include "DefaultEventHandler.hpp" namespace kido { + namespace dynamics { class SimpleFrame; } // namespace dynamics -} // namespace kido -namespace osgKido -{ +namespace gui { class Viewer; class InteractiveFrame; /// DragAndDrop is a class that facilitates enabling various kinds of kido -/// Entities to be dragged and dropped in an osgKido environment +/// Entities to be dragged and dropped in an kido-gui-osg environment class DragAndDrop : public kido::common::Subject, public kido::common::Observer { @@ -245,7 +244,7 @@ class InteractiveFrameDnD : public DragAndDrop public: /// Constructor - InteractiveFrameDnD(Viewer* viewer, osgKido::InteractiveFrame* frame); + InteractiveFrameDnD(Viewer* viewer, kido::gui::InteractiveFrame* frame); /// Virtual destructor virtual ~InteractiveFrameDnD() = default; @@ -357,7 +356,7 @@ class BodyNodeDnD : public DragAndDrop size_t mAdditionalBodyNodes; }; -} // namespace osgKido - +} // namespace gui +} // namespace kido #endif // OSGKIDO_DRAGANDDROP_HPP diff --git a/kido/gui/osg/EntityNode.cpp b/kido/gui/osg/EntityNode.cpp index 83834dd9f7d38..ac5eaac507e3e 100644 --- a/kido/gui/osg/EntityNode.cpp +++ b/kido/gui/osg/EntityNode.cpp @@ -34,16 +34,16 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "osgKido/EntityNode.hpp" -#include "osgKido/render/ShapeNode.hpp" -#include "osgKido/render/BoxShapeNode.hpp" -#include "osgKido/render/EllipsoidShapeNode.hpp" -#include "osgKido/render/CylinderShapeNode.hpp" -#include "osgKido/render/PlaneShapeNode.hpp" -#include "osgKido/render/MeshShapeNode.hpp" -#include "osgKido/render/SoftMeshShapeNode.hpp" -#include "osgKido/render/LineSegmentShapeNode.hpp" -#include "osgKido/render/WarningShapeNode.hpp" +#include "kido/gui/osg/EntityNode.hpp" +#include "kido/gui/osg/render/ShapeNode.hpp" +#include "kido/gui/osg/render/BoxShapeNode.hpp" +#include "kido/gui/osg/render/EllipsoidShapeNode.hpp" +#include "kido/gui/osg/render/CylinderShapeNode.hpp" +#include "kido/gui/osg/render/PlaneShapeNode.hpp" +#include "kido/gui/osg/render/MeshShapeNode.hpp" +#include "kido/gui/osg/render/SoftMeshShapeNode.hpp" +#include "kido/gui/osg/render/LineSegmentShapeNode.hpp" +#include "kido/gui/osg/render/WarningShapeNode.hpp" #include "kido/common/Console.hpp" #include "kido/dynamics/Entity.hpp" @@ -55,7 +55,8 @@ #include "kido/dynamics/SoftMeshShape.hpp" #include "kido/dynamics/LineSegmentShape.hpp" -namespace osgKido { +namespace kido { +namespace gui { EntityNode::EntityNode(kido::dynamics::Entity* _entity, FrameNode* _parent) : mEntity(_entity), @@ -156,7 +157,7 @@ void EntityNode::refreshShapeNode(std::shared_ptr shape) static void warnAboutUnsuccessfulCast(const std::string& shapeType, const std::string& entityName) { - dtwarn << "[osgKido::EntityNode::createShapeNode] A Shape in '" << entityName + dtwarn << "[kido::gui::EntityNode::createShapeNode] A Shape in '" << entityName << "' claimed to be a '" << shapeType << "' but it failed to be " << "dynamically cast to that type. " << "It will not be added to the OSG tree, " @@ -262,4 +263,5 @@ void EntityNode::createShapeNode(std::shared_ptr shape) addChild(node->getNode()); } -} // namespace osgKido +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/EntityNode.hpp b/kido/gui/osg/EntityNode.hpp index 54d9186190ad0..0123757dabb93 100644 --- a/kido/gui/osg/EntityNode.hpp +++ b/kido/gui/osg/EntityNode.hpp @@ -43,14 +43,13 @@ #include namespace kido { + namespace dynamics { class Entity; class Shape; } // namespace dynamics -} // namespace kido -namespace osgKido -{ +namespace gui { namespace render { class ShapeNode; @@ -116,6 +115,7 @@ class EntityNode : public osg::Group }; -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_ENTITYNODE_HPP diff --git a/kido/gui/osg/FrameNode.cpp b/kido/gui/osg/FrameNode.cpp index 223e31c59853e..aa36c76d5a71f 100644 --- a/kido/gui/osg/FrameNode.cpp +++ b/kido/gui/osg/FrameNode.cpp @@ -34,14 +34,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "osgKido/FrameNode.hpp" -#include "osgKido/EntityNode.hpp" -#include "osgKido/Utils.hpp" +#include "kido/gui/osg/FrameNode.hpp" +#include "kido/gui/osg/EntityNode.hpp" +#include "kido/gui/osg/Utils.hpp" #include "kido/dynamics/Frame.hpp" -namespace osgKido -{ +namespace kido { +namespace gui { FrameNode::FrameNode(kido::dynamics::Frame* _frame, WorldNode* _worldNode, bool _relative, bool _recursive) @@ -212,4 +212,5 @@ void FrameNode::createEntityNode(kido::dynamics::Entity* _entity) addChild(node); } -} // namespace osgKido +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/FrameNode.hpp b/kido/gui/osg/FrameNode.hpp index 9fb4023bb1585..db08bd627f40c 100644 --- a/kido/gui/osg/FrameNode.hpp +++ b/kido/gui/osg/FrameNode.hpp @@ -41,14 +41,13 @@ #include namespace kido { + namespace dynamics { class Frame; class Entity; } // namespace dynamics -} // namespace kido -namespace osgKido -{ +namespace gui { class WorldNode; class EntityNode; @@ -122,6 +121,7 @@ class FrameNode : public osg::MatrixTransform }; -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_FRAMENODE_HPP diff --git a/kido/gui/osg/InteractiveFrame.cpp b/kido/gui/osg/InteractiveFrame.cpp index 460d0f9f9b34e..250bbdd326c12 100644 --- a/kido/gui/osg/InteractiveFrame.cpp +++ b/kido/gui/osg/InteractiveFrame.cpp @@ -34,13 +34,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "osgKido/InteractiveFrame.hpp" +#include "kido/gui/osg/InteractiveFrame.hpp" #include "kido/dynamics/MeshShape.hpp" #include "kido/dynamics/ArrowShape.hpp" #include "kido/dynamics/LineSegmentShape.hpp" #include "kido/common/Console.hpp" -namespace osgKido { +namespace kido { +namespace gui { //============================================================================== InteractiveTool::InteractiveTool(InteractiveFrame* frame, double defaultAlpha, @@ -515,5 +516,5 @@ void InteractiveFrame::deleteAllTools() delete mTools[i][j]; } -} // namespace osgKido - +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/InteractiveFrame.hpp b/kido/gui/osg/InteractiveFrame.hpp index daf36da627bf7..502ff1b086264 100644 --- a/kido/gui/osg/InteractiveFrame.hpp +++ b/kido/gui/osg/InteractiveFrame.hpp @@ -40,13 +40,12 @@ #include "kido/dynamics/SimpleFrame.hpp" namespace kido { + namespace dynamics { class MeshShape; } // namespace dynamics -} // namespace kido -namespace osgKido -{ +namespace gui { class InteractiveFrame; @@ -145,6 +144,7 @@ class InteractiveFrame : public kido::dynamics::SimpleFrame typedef std::shared_ptr InteractiveFramePtr; -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_INTERACTIVEFRAME_HPP diff --git a/kido/gui/osg/MouseEventHandler.hpp b/kido/gui/osg/MouseEventHandler.hpp index f022324dbe682..31c936fa14d28 100644 --- a/kido/gui/osg/MouseEventHandler.hpp +++ b/kido/gui/osg/MouseEventHandler.hpp @@ -40,10 +40,10 @@ #include "kido/common/Subject.hpp" #include "kido/common/Observer.hpp" -#include "osgKido/DefaultEventHandler.hpp" +#include "kido/gui/osg/DefaultEventHandler.hpp" -namespace osgKido -{ +namespace kido { +namespace gui { class DefaultEventHandler; @@ -72,6 +72,7 @@ class MouseEventHandler : public virtual kido::common::Subject, }; -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_MOUSEEVENTHANDLER_HPP diff --git a/kido/gui/osg/SupportPolygonVisual.cpp b/kido/gui/osg/SupportPolygonVisual.cpp index 7e0842bd98584..ad3a5a5af8c2c 100644 --- a/kido/gui/osg/SupportPolygonVisual.cpp +++ b/kido/gui/osg/SupportPolygonVisual.cpp @@ -42,7 +42,8 @@ #include "SupportPolygonVisual.hpp" -namespace osgKido { +namespace kido { +namespace gui { //============================================================================== SupportPolygonVisual::SupportPolygonVisual(const kido::dynamics::SkeletonPtr& skeleton, @@ -399,4 +400,5 @@ void SupportPolygonVisual::initialize() addChild(mComNode); } -} // namespace osgKido +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/SupportPolygonVisual.hpp b/kido/gui/osg/SupportPolygonVisual.hpp index 57389961ca2e1..b683ea1c39f22 100644 --- a/kido/gui/osg/SupportPolygonVisual.hpp +++ b/kido/gui/osg/SupportPolygonVisual.hpp @@ -41,10 +41,11 @@ #include "kido/dynamics/SmartPointer.hpp" -#include "osgKido/Viewer.hpp" +#include "kido/gui/osg/Viewer.hpp" #include "FrameNode.hpp" -namespace osgKido { +namespace kido { +namespace gui { /// Attach this to a Viewer in order to visualize the support polygon of a /// Skeleton @@ -196,6 +197,7 @@ class SupportPolygonVisual : public ViewerAttachment osg::ref_ptr mComNode; }; -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_SUPPORTPOLYGONVISUAL_HPP diff --git a/kido/gui/osg/TrackballManipulator.cpp b/kido/gui/osg/TrackballManipulator.cpp index 6b86e65609aaf..bdf709adf726a 100644 --- a/kido/gui/osg/TrackballManipulator.cpp +++ b/kido/gui/osg/TrackballManipulator.cpp @@ -34,10 +34,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "osgKido/TrackballManipulator.hpp" +#include "kido/gui/osg/TrackballManipulator.hpp" -namespace osgKido -{ +namespace kido { +namespace gui { //============================================================================== TrackballManipulator::TrackballManipulator(int flags) @@ -77,4 +77,5 @@ bool TrackballManipulator::performMovementRightMouseButton( eventTimeDelta, dx, dy); } -} // namespace osgKido +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/TrackballManipulator.hpp b/kido/gui/osg/TrackballManipulator.hpp index ccdc02ceefca5..348cdbc8b2dd6 100644 --- a/kido/gui/osg/TrackballManipulator.hpp +++ b/kido/gui/osg/TrackballManipulator.hpp @@ -39,8 +39,8 @@ #include -namespace osgKido -{ +namespace kido { +namespace gui { class OSGGA_EXPORT TrackballManipulator : public osgGA::OrbitManipulator { @@ -65,10 +65,11 @@ class OSGGA_EXPORT TrackballManipulator : public osgGA::OrbitManipulator const double dx, const double dy) override; - META_Object( osgKido, TrackballManipulator ) - // TODO(MXG): Consider applying the META macros to every osgKido Node + META_Object( kido-gui-osg, TrackballManipulator ) + // TODO(MXG): Consider applying the META macros to every kido-gui-osg Node }; -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_TRACKBALLMANIPULATOR_HPP diff --git a/kido/gui/osg/Viewer.cpp b/kido/gui/osg/Viewer.cpp index 9f8927e400a5e..50e33b45ebbea 100644 --- a/kido/gui/osg/Viewer.cpp +++ b/kido/gui/osg/Viewer.cpp @@ -39,12 +39,12 @@ #include #include -#include "osgKido/Viewer.hpp" -#include "osgKido/TrackballManipulator.hpp" -#include "osgKido/DefaultEventHandler.hpp" -#include "osgKido/DragAndDrop.hpp" -#include "osgKido/WorldNode.hpp" -#include "osgKido/Utils.hpp" +#include "kido/gui/osg/Viewer.hpp" +#include "kido/gui/osg/TrackballManipulator.hpp" +#include "kido/gui/osg/DefaultEventHandler.hpp" +#include "kido/gui/osg/DragAndDrop.hpp" +#include "kido/gui/osg/WorldNode.hpp" +#include "kido/gui/osg/Utils.hpp" #include "kido/simulation/World.hpp" @@ -52,8 +52,8 @@ #include "kido/dynamics/Shape.hpp" #include "kido/dynamics/BodyNode.hpp" -namespace osgKido -{ +namespace kido { +namespace gui { class SaveScreen : public osg::Camera::DrawCallback { @@ -208,7 +208,7 @@ Viewer::Viewer(const osg::Vec4& clearColor) mAllowSimulation(true), mHeadlights(true) { - setCameraManipulator(new osgKido::TrackballManipulator); + setCameraManipulator(new kido::gui::TrackballManipulator); addInstructionText("Left-click: Interaction\n"); addInstructionText("Right-click: Rotate view\n"); addInstructionText("Middle-click: Translate view\n"); @@ -660,7 +660,7 @@ SimpleFrameShapeDnD* Viewer::enableDragAndDrop( //============================================================================== InteractiveFrameDnD* Viewer::enableDragAndDrop( - osgKido::InteractiveFrame* _frame) + kido::gui::InteractiveFrame* _frame) { if(nullptr == _frame) return nullptr; @@ -827,4 +827,5 @@ const osg::ref_ptr& Viewer::getRootGroup() const return mRootGroup; } -} // namespace osgKido +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/Viewer.hpp b/kido/gui/osg/Viewer.hpp index 1d2638bf3d4bc..7dd752b31a13d 100644 --- a/kido/gui/osg/Viewer.hpp +++ b/kido/gui/osg/Viewer.hpp @@ -60,10 +60,7 @@ class Shape; class BodyNode; } // namespace dynamics -} // namespace kido - -namespace osgKido -{ +namespace gui { class WorldNode; class DefaultEventHandler; @@ -121,7 +118,7 @@ class Viewer : public osgViewer::Viewer, public kido::common::Subject { public: - /// Constructor for osgKido::Viewer. This will automatically create the + /// Constructor for kido::gui::Viewer. This will automatically create the /// default event handler. Viewer(const osg::Vec4& clearColor = osg::Vec4(0.9,0.9,0.9,1.0)); @@ -157,7 +154,7 @@ class Viewer : public osgViewer::Viewer, public kido::common::Subject /// Returns true if the Viewer is currently recording. bool isRecording() const; - /// Creates the default event handler for this osgKido::Viewer + /// Creates the default event handler for this kido::gui::Viewer virtual void switchDefaultEventHandler(bool _on); /// Return a pointer to the default event handler @@ -317,7 +314,7 @@ class Viewer : public osgViewer::Viewer, public kido::common::Subject /// Name for the next screen capture std::string mScreenCapName; - /// Default WorldNodeEventHandler for this osgKido::Viewer + /// Default WorldNodeEventHandler for this kido::gui::Viewer osg::ref_ptr mDefaultEventHandler; /// The root node of this Viewer @@ -353,7 +350,7 @@ class Viewer : public osgViewer::Viewer, public kido::common::Subject /// True iff headlights were last set to be on bool mHeadlights; - /// Map of WorldNodes in this osgKido::Viewer. A WorldNode will map to true + /// Map of WorldNodes in this kido::gui::Viewer. A WorldNode will map to true /// iff it is currently active std::map mWorldNodes; @@ -380,6 +377,7 @@ class Viewer : public osgViewer::Viewer, public kido::common::Subject std::map mBodyNodeDnDMap; }; -} +} // namespace gui +} // namespace kido #endif // OSGKIDO_VIEWER_HPP diff --git a/kido/gui/osg/WorldNode.cpp b/kido/gui/osg/WorldNode.cpp index d10bbad830871..9da4b06d478ae 100644 --- a/kido/gui/osg/WorldNode.cpp +++ b/kido/gui/osg/WorldNode.cpp @@ -36,16 +36,16 @@ #include -#include "osgKido/WorldNode.hpp" -#include "osgKido/FrameNode.hpp" -#include "osgKido/EntityNode.hpp" +#include "kido/gui/osg/WorldNode.hpp" +#include "kido/gui/osg/FrameNode.hpp" +#include "kido/gui/osg/EntityNode.hpp" #include "kido/simulation/World.hpp" #include "kido/dynamics/Skeleton.hpp" #include "kido/dynamics/BodyNode.hpp" -namespace osgKido -{ +namespace kido { +namespace gui { class WorldNodeCallback : public osg::NodeCallback { @@ -303,4 +303,5 @@ void WorldNode::createBaseEntityNode(kido::dynamics::Entity* _entity) mNodeToEntity[entityNode] = _entity; } -} // namespace osgKido +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/WorldNode.hpp b/kido/gui/osg/WorldNode.hpp index 6f0a808667fb5..38d9df5342822 100644 --- a/kido/gui/osg/WorldNode.hpp +++ b/kido/gui/osg/WorldNode.hpp @@ -41,7 +41,7 @@ #include #include -#include "osgKido/Viewer.hpp" +#include "kido/gui/osg/Viewer.hpp" namespace kido { @@ -52,12 +52,9 @@ class World; namespace dynamics { class Frame; class Entity; -} +} // namespace dynamics -} // namespace kido - -namespace osgKido -{ +namespace gui { class FrameNode; class EntityNode; @@ -138,9 +135,9 @@ class WorldNode : public osg::Group /// Destructor virtual ~WorldNode(); - /// Called when this world gets added to an osgKido::Viewer. Override this + /// Called when this world gets added to an kido::gui::Viewer. Override this /// function to customize the way your WorldNode starts up in an - /// osgKido::Viewer. Default behavior does nothing. + /// kido::gui::Viewer. Default behavior does nothing. virtual void setupViewer(); /// Clear the utilization flags of each child node @@ -194,6 +191,7 @@ class WorldNode : public osg::Group }; -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_WORLDNODE_HPP diff --git a/kido/gui/osg/examples/CMakeLists.txt b/kido/gui/osg/examples/CMakeLists.txt index 0d35342cfd186..2edcb70ce8393 100644 --- a/kido/gui/osg/examples/CMakeLists.txt +++ b/kido/gui/osg/examples/CMakeLists.txt @@ -2,13 +2,13 @@ file(GLOB osgkido_examples_src "*.cpp") list(SORT osgkido_examples_src) message(STATUS "") -message(STATUS "[ osgKido Examples ]") +message(STATUS "[ kido-gui-osg Examples ]") foreach(example ${osgkido_examples_src}) get_filename_component(example_base ${example} NAME_WE) message(STATUS "Adding example: " ${example_base}) add_executable(${example_base} ${example}) - target_link_libraries(${example_base} kido osgKido ${OPENSCENEGRAPH_LIBRARIES}) + target_link_libraries(${example_base} kido kido-gui-osg ${OPENSCENEGRAPH_LIBRARIES}) endforeach(example) diff --git a/kido/gui/osg/examples/osgAtlasPuppet.cpp b/kido/gui/osg/examples/osgAtlasPuppet.cpp index 0ef5d70ccf978..f17581a51e2be 100644 --- a/kido/gui/osg/examples/osgAtlasPuppet.cpp +++ b/kido/gui/osg/examples/osgAtlasPuppet.cpp @@ -34,8 +34,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "osgKido/osgKido.hpp" - #include "kido/kido.hpp" using namespace kido::common; @@ -134,7 +132,7 @@ class RelaxedPosture : public kido::optimizer::Function Eigen::VectorXd mWeights; }; -class TeleoperationWorld : public osgKido::WorldNode +class TeleoperationWorld : public kido::gui::WorldNode { public: @@ -153,7 +151,7 @@ class TeleoperationWorld : public osgKido::WorldNode }; TeleoperationWorld(WorldPtr _world, SkeletonPtr _robot) - : osgKido::WorldNode(_world), + : kido::gui::WorldNode(_world), mAtlas(_robot), iter(0), l_foot(_robot->getEndEffector("l_foot")), @@ -267,7 +265,7 @@ class InputHandler : public osgGA::GUIEventHandler { public: - InputHandler(osgKido::Viewer* viewer, TeleoperationWorld* teleop, + InputHandler(kido::gui::Viewer* viewer, TeleoperationWorld* teleop, const SkeletonPtr& atlas, const WorldPtr& world) : mViewer(viewer), mTeleop(teleop), @@ -462,7 +460,7 @@ class InputHandler : public osgGA::GUIEventHandler protected: - osgKido::Viewer* mViewer; + kido::gui::Viewer* mViewer; TeleoperationWorld* mTeleop; @@ -592,7 +590,7 @@ void setupEndEffectors(const SkeletonPtr& atlas) l_hand->setDefaultRelativeTransform(tf_hand, true); // Create an interactive frame to use as the target for the left hand - osgKido::InteractiveFramePtr lh_target(new osgKido::InteractiveFrame( + kido::gui::InteractiveFramePtr lh_target(new kido::gui::InteractiveFrame( Frame::World(), "lh_target")); // Set the target of the left hand to the interactive frame. We pass true into @@ -628,7 +626,7 @@ void setupEndEffectors(const SkeletonPtr& atlas) r_hand->setDefaultRelativeTransform(tf_hand, true); // Create an interactive frame to use as the target for the right hand - osgKido::InteractiveFramePtr rh_target(new osgKido::InteractiveFrame( + kido::gui::InteractiveFramePtr rh_target(new kido::gui::InteractiveFrame( Frame::World(), "rh_target")); // Create the right hand's IK and set its target @@ -678,7 +676,7 @@ void setupEndEffectors(const SkeletonPtr& atlas) l_foot->setRelativeTransform(tf_foot); // Create an interactive frame to use as the target for the left foot - osgKido::InteractiveFramePtr lf_target(new osgKido::InteractiveFrame( + kido::gui::InteractiveFramePtr lf_target(new kido::gui::InteractiveFrame( Frame::World(), "lf_target")); // Create the left foot's IK and set its target @@ -707,7 +705,7 @@ void setupEndEffectors(const SkeletonPtr& atlas) r_foot->setRelativeTransform(tf_foot); // Create an interactive frame to use as the target for the right foot - osgKido::InteractiveFramePtr rf_target(new osgKido::InteractiveFrame( + kido::gui::InteractiveFramePtr rf_target(new kido::gui::InteractiveFrame( Frame::World(), "rf_target")); // Create the right foot's IK module and set its target @@ -818,7 +816,7 @@ void setupWholeBodySolver(const SkeletonPtr& atlas) // that some work much better for user interaction than others. } -void enableDragAndDrops(osgKido::Viewer& viewer, const SkeletonPtr& atlas) +void enableDragAndDrops(kido::gui::Viewer& viewer, const SkeletonPtr& atlas) { // Turn on drag-and-drop for the whole Skeleton for(size_t i=0; i < atlas->getNumBodyNodes(); ++i) @@ -831,7 +829,7 @@ void enableDragAndDrops(osgKido::Viewer& viewer, const SkeletonPtr& atlas) continue; // Check whether the target is an interactive frame, and add it if it is - if(const auto& frame = std::dynamic_pointer_cast( + if(const auto& frame = std::dynamic_pointer_cast( ee->getIK()->getTarget())) viewer.enableDragAndDrop(frame.get()); } @@ -855,7 +853,7 @@ int main() osg::ref_ptr node = new TeleoperationWorld(world, atlas); - osgKido::Viewer viewer; + kido::gui::Viewer viewer; // Prevent this World from simulating viewer.allowSimulation(false); @@ -867,7 +865,7 @@ int main() enableDragAndDrops(viewer, atlas); // Attach a support polygon visualizer - viewer.addAttachment(new osgKido::SupportPolygonVisual( + viewer.addAttachment(new kido::gui::SupportPolygonVisual( atlas, display_elevation)); // Print out instructions for the viewer diff --git a/kido/gui/osg/examples/osgDragAndDrop.cpp b/kido/gui/osg/examples/osgDragAndDrop.cpp index a23d20fc2498c..1170fc627e381 100644 --- a/kido/gui/osg/examples/osgDragAndDrop.cpp +++ b/kido/gui/osg/examples/osgDragAndDrop.cpp @@ -34,8 +34,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "osgKido/osgKido.hpp" - #include "kido/kido.hpp" using namespace kido::dynamics; @@ -47,7 +45,7 @@ int main() Eigen::Isometry3d tf(Eigen::Isometry3d::Identity()); tf.translation() = Eigen::Vector3d(4,-4,0); - osgKido::InteractiveFramePtr frame(new osgKido::InteractiveFrame( + kido::gui::InteractiveFramePtr frame(new kido::gui::InteractiveFrame( Frame::World(), "interactive frame", tf, 2.0)); world->addSimpleFrame(frame); @@ -82,9 +80,9 @@ int main() world->addSimpleFrame(z_marker); - osg::ref_ptr node = new osgKido::WorldNode(world); + osg::ref_ptr node = new kido::gui::WorldNode(world); - osgKido::Viewer viewer; + kido::gui::Viewer viewer; viewer.addWorldNode(node); viewer.enableDragAndDrop(frame.get()); viewer.enableDragAndDrop(draggable.get()); diff --git a/kido/gui/osg/examples/osgHuboPuppet.cpp b/kido/gui/osg/examples/osgHuboPuppet.cpp index 5dc84b4aa0275..99cb68a53120a 100644 --- a/kido/gui/osg/examples/osgHuboPuppet.cpp +++ b/kido/gui/osg/examples/osgHuboPuppet.cpp @@ -36,9 +36,6 @@ #include "kido/kido.hpp" -#include "osgKido/osgKido.hpp" - - using namespace kido::dynamics; using namespace kido::simulation; @@ -693,7 +690,7 @@ class HuboLegIK : public InverseKinematics::Analytical }; -class TeleoperationWorld : public osgKido::WorldNode +class TeleoperationWorld : public kido::gui::WorldNode { public: @@ -712,7 +709,7 @@ class TeleoperationWorld : public osgKido::WorldNode }; TeleoperationWorld(WorldPtr _world, SkeletonPtr _robot) - : osgKido::WorldNode(_world), + : kido::gui::WorldNode(_world), mHubo(_robot), iter(0), l_foot(_robot->getEndEffector("l_foot")), @@ -834,7 +831,7 @@ class InputHandler : public osgGA::GUIEventHandler { public: - InputHandler(osgKido::Viewer* viewer, TeleoperationWorld* teleop, + InputHandler(kido::gui::Viewer* viewer, TeleoperationWorld* teleop, const SkeletonPtr& hubo, const WorldPtr& world) : mViewer(viewer), mTeleop(teleop), @@ -1034,7 +1031,7 @@ class InputHandler : public osgGA::GUIEventHandler protected: - osgKido::Viewer* mViewer; + kido::gui::Viewer* mViewer; TeleoperationWorld* mTeleop; @@ -1151,7 +1148,7 @@ void setupEndEffectors(const SkeletonPtr& hubo) createEndEffector("l_hand"); l_hand->setDefaultRelativeTransform(tf_hand, true); - osgKido::InteractiveFramePtr lh_target(new osgKido::InteractiveFrame( + kido::gui::InteractiveFramePtr lh_target(new kido::gui::InteractiveFrame( Frame::World(), "lh_target")); l_hand->getIK(true)->setTarget(lh_target); @@ -1178,7 +1175,7 @@ void setupEndEffectors(const SkeletonPtr& hubo) createEndEffector("r_hand"); r_hand->setDefaultRelativeTransform(tf_hand, true); - osgKido::InteractiveFramePtr rh_target(new osgKido::InteractiveFrame( + kido::gui::InteractiveFramePtr rh_target(new kido::gui::InteractiveFrame( Frame::World(), "rh_target")); r_hand->getIK(true)->setTarget(rh_target); @@ -1221,7 +1218,7 @@ void setupEndEffectors(const SkeletonPtr& hubo) createEndEffector("l_foot"); l_foot->setDefaultRelativeTransform(tf_foot, true); - osgKido::InteractiveFramePtr lf_target(new osgKido::InteractiveFrame( + kido::gui::InteractiveFramePtr lf_target(new kido::gui::InteractiveFrame( Frame::World(), "lf_target")); l_foot->getIK(true)->setTarget(lf_target); @@ -1244,7 +1241,7 @@ void setupEndEffectors(const SkeletonPtr& hubo) createEndEffector("r_foot"); r_foot->setDefaultRelativeTransform(tf_foot, true); - osgKido::InteractiveFramePtr rf_target(new osgKido::InteractiveFrame( + kido::gui::InteractiveFramePtr rf_target(new kido::gui::InteractiveFrame( Frame::World(), "rf_target")); r_foot->getIK(true)->setTarget(rf_target); @@ -1275,7 +1272,7 @@ void setupEndEffectors(const SkeletonPtr& hubo) EndEffector* l_peg = hubo->getBodyNode("Body_LWP")->createEndEffector("l_peg"); l_peg->setDefaultRelativeTransform(tf_peg, true); - osgKido::InteractiveFramePtr lp_target(new osgKido::InteractiveFrame( + kido::gui::InteractiveFramePtr lp_target(new kido::gui::InteractiveFrame( Frame::World(), "lp_target")); l_peg->getIK(true)->setTarget(lp_target); @@ -1293,7 +1290,7 @@ void setupEndEffectors(const SkeletonPtr& hubo) EndEffector* r_peg = hubo->getBodyNode("Body_RWP")->createEndEffector("r_peg"); r_peg->setDefaultRelativeTransform(tf_peg, true); - osgKido::InteractiveFramePtr rp_target(new osgKido::InteractiveFrame( + kido::gui::InteractiveFramePtr rp_target(new kido::gui::InteractiveFrame( Frame::World(), "rp_target")); r_peg->getIK(true)->setTarget(rp_target); @@ -1315,7 +1312,7 @@ void setupEndEffectors(const SkeletonPtr& hubo) r_foot->getIK()->getTarget()->setTransform(r_foot->getTransform()); } -void enableDragAndDrops(osgKido::Viewer& viewer, const SkeletonPtr& hubo) +void enableDragAndDrops(kido::gui::Viewer& viewer, const SkeletonPtr& hubo) { // Turn on drag-and-drop for the whole Skeleton for(size_t i=0; i < hubo->getNumBodyNodes(); ++i) @@ -1328,7 +1325,7 @@ void enableDragAndDrops(osgKido::Viewer& viewer, const SkeletonPtr& hubo) continue; // Check whether the target is an interactive frame, and add it if it is - if(const auto& frame = std::dynamic_pointer_cast( + if(const auto& frame = std::dynamic_pointer_cast( ee->getIK()->getTarget())) viewer.enableDragAndDrop(frame.get()); } @@ -1390,7 +1387,7 @@ int main() osg::ref_ptr node = new TeleoperationWorld(world, hubo); - osgKido::Viewer viewer; + kido::gui::Viewer viewer; viewer.allowSimulation(false); viewer.addWorldNode(node); @@ -1399,7 +1396,7 @@ int main() viewer.addEventHandler(new InputHandler(&viewer, node, hubo, world)); double display_elevation = 0.05; - viewer.addAttachment(new osgKido::SupportPolygonVisual( + viewer.addAttachment(new kido::gui::SupportPolygonVisual( hubo, display_elevation)); std::cout << viewer.getInstructions() << std::endl; diff --git a/kido/gui/osg/examples/osgOperationalSpaceControl.cpp b/kido/gui/osg/examples/osgOperationalSpaceControl.cpp index fa1d2f44e6375..66c5b8a07989e 100644 --- a/kido/gui/osg/examples/osgOperationalSpaceControl.cpp +++ b/kido/gui/osg/examples/osgOperationalSpaceControl.cpp @@ -35,20 +35,18 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "osgKido/osgKido.hpp" - #include "kido/kido.hpp" using namespace kido::common; using namespace kido::dynamics; using namespace kido::math; -class OperationalSpaceControlWorld : public osgKido::WorldNode +class OperationalSpaceControlWorld : public kido::gui::WorldNode { public: OperationalSpaceControlWorld(kido::simulation::WorldPtr _world) - : osgKido::WorldNode(_world) + : kido::gui::WorldNode(_world) { // Extract the relevant pointers mRobot = mWorld->getSkeleton(0); @@ -111,7 +109,7 @@ class OperationalSpaceControlWorld : public osgKido::WorldNode mRobot->setForces(mForces); } - osgKido::DragAndDrop* dnd; + kido::gui::DragAndDrop* dnd; protected: @@ -143,7 +141,7 @@ class ConstraintEventHandler : public osgGA::GUIEventHandler { public: - ConstraintEventHandler(osgKido::DragAndDrop* dnd = nullptr) + ConstraintEventHandler(kido::gui::DragAndDrop* dnd = nullptr) : mDnD(dnd) { clearConstraints(); @@ -249,7 +247,7 @@ class ConstraintEventHandler : public osgGA::GUIEventHandler bool mConstrained[3]; - kido::sub_ptr mDnD; + kido::sub_ptr mDnD; }; int main() @@ -296,7 +294,7 @@ int main() node->setNumStepsPerCycle(10); // Create the Viewer instance - osgKido::Viewer viewer; + kido::gui::Viewer viewer; viewer.addWorldNode(node); viewer.simulate(true); diff --git a/kido/gui/osg/examples/osgSoftBodies.cpp b/kido/gui/osg/examples/osgSoftBodies.cpp index be8c9c2f80b67..208d8b258a101 100644 --- a/kido/gui/osg/examples/osgSoftBodies.cpp +++ b/kido/gui/osg/examples/osgSoftBodies.cpp @@ -37,8 +37,6 @@ #include "kido/kido.hpp" -#include "osgKido/osgKido.hpp" - #include int main() @@ -48,12 +46,12 @@ int main() kido::simulation::WorldPtr world = kido::utils::SkelParser::readWorld(KIDO_DATA_PATH"skel/softBodies.skel"); - osg::ref_ptr node = new osgKido::WorldNode(world); + osg::ref_ptr node = new kido::gui::WorldNode(world); node->simulate(true); node->setNumStepsPerCycle(15); - osgKido::Viewer viewer; + kido::gui::Viewer viewer; viewer.addWorldNode(node); std::cout << viewer.getInstructions() << std::endl; diff --git a/kido/gui/osg/osgKido.hpp.in b/kido/gui/osg/osg.hpp.in similarity index 100% rename from kido/gui/osg/osgKido.hpp.in rename to kido/gui/osg/osg.hpp.in diff --git a/kido/gui/osg/render/BoxShapeNode.cpp b/kido/gui/osg/render/BoxShapeNode.cpp index 86d9a3825a300..d8ecb057fc4e0 100644 --- a/kido/gui/osg/render/BoxShapeNode.cpp +++ b/kido/gui/osg/render/BoxShapeNode.cpp @@ -37,12 +37,13 @@ #include #include -#include "osgKido/render/BoxShapeNode.hpp" -#include "osgKido/Utils.hpp" +#include "kido/gui/osg/render/BoxShapeNode.hpp" +#include "kido/gui/osg/Utils.hpp" #include "kido/dynamics/BoxShape.hpp" -namespace osgKido { +namespace kido { +namespace gui { namespace render { class BoxShapeGeode : public ShapeNode, public osg::Geode @@ -208,4 +209,5 @@ BoxShapeDrawable::~BoxShapeDrawable() } } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/render/BoxShapeNode.hpp b/kido/gui/osg/render/BoxShapeNode.hpp index acee771086616..f838e931419d1 100644 --- a/kido/gui/osg/render/BoxShapeNode.hpp +++ b/kido/gui/osg/render/BoxShapeNode.hpp @@ -39,15 +39,15 @@ #include -#include "osgKido/render/ShapeNode.hpp" +#include "kido/gui/osg/render/ShapeNode.hpp" namespace kido { + namespace dynamics { class BoxShape; } // namespace dynamics -} // namespace kido -namespace osgKido { +namespace gui { namespace render { class BoxShapeGeode; @@ -73,6 +73,7 @@ class BoxShapeNode : public ShapeNode, public osg::MatrixTransform }; } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_RENDER_BOXSHAPENODE_HPP diff --git a/kido/gui/osg/render/CMakeLists.txt b/kido/gui/osg/render/CMakeLists.txt index e380cb0c8c3c0..07785bbd86fe3 100644 --- a/kido/gui/osg/render/CMakeLists.txt +++ b/kido/gui/osg/render/CMakeLists.txt @@ -1,10 +1,15 @@ -file(GLOB osgKido_render_hdrs "*.hpp") +# Search all header and source files +file(GLOB srcs "*.cpp") +file(GLOB hdrs "*.hpp") -kido_get_filename_components(header_names "osgKido render headers" ${osgKido_render_hdrs}) +set(kido_gui_osg_srcs ${kido_gui_osg_srcs} ${srcs} PARENT_SCOPE) +set(kido_gui_osg_hdrs ${kido_gui_osg_hdrs} ${hdrs} PARENT_SCOPE) + +kido_get_filename_components(header_names "gui osg render headers" ${hdrs}) kido_generate_include_header_list( - osgKido_render_headers - "osgKido/render/" - "osgKido render headers" + gui_osg_render_headers + "kido/gui/osg/render/" + "gui osg render headers" ${header_names} ) configure_file( @@ -12,8 +17,9 @@ configure_file( ${CMAKE_CURRENT_BINARY_DIR}/render.hpp ) +# Install install( - FILES ${osgKido_render_hdrs} ${CMAKE_CURRENT_BINARY_DIR}/render.hpp - DESTINATION include/osgKido/render + FILES ${hdrs} ${CMAKE_CURRENT_BINARY_DIR}/render.hpp + DESTINATION include/kido/gui/osg/render COMPONENT headers ) diff --git a/kido/gui/osg/render/CylinderShapeNode.cpp b/kido/gui/osg/render/CylinderShapeNode.cpp index b2cfc7354790d..0c634c392af9c 100644 --- a/kido/gui/osg/render/CylinderShapeNode.cpp +++ b/kido/gui/osg/render/CylinderShapeNode.cpp @@ -37,12 +37,13 @@ #include #include -#include "osgKido/render/CylinderShapeNode.hpp" -#include "osgKido/Utils.hpp" +#include "kido/gui/osg/render/CylinderShapeNode.hpp" +#include "kido/gui/osg/Utils.hpp" #include "kido/dynamics/CylinderShape.hpp" -namespace osgKido { +namespace kido { +namespace gui { namespace render { class CylinderShapeGeode : public ShapeNode, public osg::Geode @@ -214,4 +215,5 @@ CylinderShapeDrawable::~CylinderShapeDrawable() } } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/render/CylinderShapeNode.hpp b/kido/gui/osg/render/CylinderShapeNode.hpp index 8790d77c3db6c..a95cb0afbb999 100644 --- a/kido/gui/osg/render/CylinderShapeNode.hpp +++ b/kido/gui/osg/render/CylinderShapeNode.hpp @@ -39,15 +39,15 @@ #include -#include "osgKido/render/ShapeNode.hpp" +#include "kido/gui/osg/render/ShapeNode.hpp" namespace kido { + namespace dynamics { class CylinderShape; } // namespace dynamics -} // namespace kido -namespace osgKido { +namespace gui { namespace render { class CylinderShapeGeode; @@ -73,6 +73,7 @@ class CylinderShapeNode : public ShapeNode, public osg::MatrixTransform }; } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_RENDER_CYLINDERSHAPENODE_HPP diff --git a/kido/gui/osg/render/EllipsoidShapeNode.cpp b/kido/gui/osg/render/EllipsoidShapeNode.cpp index 3ff4f028eb057..39008ebe0fcda 100644 --- a/kido/gui/osg/render/EllipsoidShapeNode.cpp +++ b/kido/gui/osg/render/EllipsoidShapeNode.cpp @@ -39,12 +39,13 @@ #include #include -#include "osgKido/render/EllipsoidShapeNode.hpp" -#include "osgKido/Utils.hpp" +#include "kido/gui/osg/render/EllipsoidShapeNode.hpp" +#include "kido/gui/osg/Utils.hpp" #include "kido/dynamics/EllipsoidShape.hpp" -namespace osgKido { +namespace kido { +namespace gui { namespace render { class EllipsoidShapeGeode : public ShapeNode, public osg::Geode @@ -231,4 +232,5 @@ EllipsoidShapeDrawable::~EllipsoidShapeDrawable() } } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/render/EllipsoidShapeNode.hpp b/kido/gui/osg/render/EllipsoidShapeNode.hpp index 2e77a35a579f8..a64c11a635ab6 100644 --- a/kido/gui/osg/render/EllipsoidShapeNode.hpp +++ b/kido/gui/osg/render/EllipsoidShapeNode.hpp @@ -40,15 +40,15 @@ #include #include -#include "osgKido/render/ShapeNode.hpp" +#include "kido/gui/osg/render/ShapeNode.hpp" namespace kido { + namespace dynamics { class EllipsoidShape; } // namespace dynamics -} // namespace kido -namespace osgKido { +namespace gui { namespace render { class EllipsoidShapeGeode; @@ -75,6 +75,7 @@ class EllipsoidShapeNode : public ShapeNode, public osg::MatrixTransform }; } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_RENDER_ELLIPSOIDSHAPENODE_HPP diff --git a/kido/gui/osg/render/LineSegmentShapeNode.cpp b/kido/gui/osg/render/LineSegmentShapeNode.cpp index 3e86afcbf2d36..82861419e5aa2 100644 --- a/kido/gui/osg/render/LineSegmentShapeNode.cpp +++ b/kido/gui/osg/render/LineSegmentShapeNode.cpp @@ -38,12 +38,13 @@ #include #include -#include "osgKido/render/LineSegmentShapeNode.hpp" -#include "osgKido/Utils.hpp" +#include "kido/gui/osg/render/LineSegmentShapeNode.hpp" +#include "kido/gui/osg/Utils.hpp" #include "kido/dynamics/LineSegmentShape.hpp" -namespace osgKido { +namespace kido { +namespace gui { namespace render { class LineSegmentShapeGeode : public ShapeNode, public osg::Geode @@ -255,4 +256,5 @@ LineSegmentShapeDrawable::~LineSegmentShapeDrawable() } } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/render/LineSegmentShapeNode.hpp b/kido/gui/osg/render/LineSegmentShapeNode.hpp index 74f3d06caaf7d..0455a6c26fe02 100644 --- a/kido/gui/osg/render/LineSegmentShapeNode.hpp +++ b/kido/gui/osg/render/LineSegmentShapeNode.hpp @@ -39,15 +39,15 @@ #include -#include "osgKido/render/ShapeNode.hpp" +#include "kido/gui/osg/render/ShapeNode.hpp" namespace kido { + namespace dynamics { class LineSegmentShape; } // namespace dynamics -} // namespace kido -namespace osgKido { +namespace gui { namespace render { class LineSegmentShapeGeode; @@ -73,6 +73,7 @@ class LineSegmentShapeNode : public ShapeNode, public osg::MatrixTransform }; } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_RENDER_LINESEGMENTSHAPENODE_HPP diff --git a/kido/gui/osg/render/MeshShapeNode.cpp b/kido/gui/osg/render/MeshShapeNode.cpp index 2351291717037..2aaa4b6ab9694 100644 --- a/kido/gui/osg/render/MeshShapeNode.cpp +++ b/kido/gui/osg/render/MeshShapeNode.cpp @@ -41,13 +41,14 @@ #include #include -#include "osgKido/render/MeshShapeNode.hpp" -#include "osgKido/Utils.hpp" +#include "kido/gui/osg/render/MeshShapeNode.hpp" +#include "kido/gui/osg/Utils.hpp" #include "kido/dynamics/MeshShape.hpp" #include "kido/common/Console.hpp" -namespace osgKido { +namespace kido { +namespace gui { namespace render { class osgAiNode : public ShapeNode, public osg::MatrixTransform @@ -684,5 +685,6 @@ MeshShapeGeometry::~MeshShapeGeometry() // Do nothing } -} // render -} // osgKido +} // namespace render +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/render/MeshShapeNode.hpp b/kido/gui/osg/render/MeshShapeNode.hpp index 65fa719a649b2..18c55a70197cf 100644 --- a/kido/gui/osg/render/MeshShapeNode.hpp +++ b/kido/gui/osg/render/MeshShapeNode.hpp @@ -43,17 +43,17 @@ #include #include -#include "osgKido/render/ShapeNode.hpp" +#include "kido/gui/osg/render/ShapeNode.hpp" struct aiNode; namespace kido { + namespace dynamics { class MeshShape; } // namespace dynamics -} // namespace kido -namespace osgKido { +namespace gui { namespace render { class osgAiNode; @@ -83,6 +83,7 @@ class MeshShapeNode : public ShapeNode, public osg::MatrixTransform }; } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_RENDER_MESHSHAPENODE_HPP diff --git a/kido/gui/osg/render/PlaneShapeNode.cpp b/kido/gui/osg/render/PlaneShapeNode.cpp index e490fbc21d4ca..4907cc17b838b 100644 --- a/kido/gui/osg/render/PlaneShapeNode.cpp +++ b/kido/gui/osg/render/PlaneShapeNode.cpp @@ -37,12 +37,13 @@ #include #include -#include "osgKido/render/PlaneShapeNode.hpp" -#include "osgKido/Utils.hpp" +#include "kido/gui/osg/render/PlaneShapeNode.hpp" +#include "kido/gui/osg/Utils.hpp" #include "kido/dynamics/PlaneShape.hpp" -namespace osgKido { +namespace kido { +namespace gui { namespace render { class PlaneShapeGeode : public ShapeNode, public osg::Geode @@ -215,4 +216,5 @@ PlaneShapeDrawable::~PlaneShapeDrawable() } } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/render/PlaneShapeNode.hpp b/kido/gui/osg/render/PlaneShapeNode.hpp index 7bcaab6acd006..d63fe4d0d075f 100644 --- a/kido/gui/osg/render/PlaneShapeNode.hpp +++ b/kido/gui/osg/render/PlaneShapeNode.hpp @@ -39,15 +39,15 @@ #include -#include "osgKido/render/ShapeNode.hpp" +#include "kido/gui/osg/render/ShapeNode.hpp" namespace kido { + namespace dynamics { class PlaneShape; } // namespace dynamics -} // namespace kido -namespace osgKido { +namespace gui { namespace render { class PlaneShapeGeode; @@ -73,6 +73,7 @@ class PlaneShapeNode : public ShapeNode, public osg::MatrixTransform }; } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_RENDER_PLANESHAPENODE_HPP diff --git a/kido/gui/osg/render/ShapeNode.cpp b/kido/gui/osg/render/ShapeNode.cpp index 80fd7a0a05e28..56e1a9dbf085c 100644 --- a/kido/gui/osg/render/ShapeNode.cpp +++ b/kido/gui/osg/render/ShapeNode.cpp @@ -34,10 +34,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "osgKido/render/ShapeNode.hpp" -#include "osgKido/EntityNode.hpp" +#include "kido/gui/osg/render/ShapeNode.hpp" +#include "kido/gui/osg/EntityNode.hpp" -namespace osgKido { +namespace kido { +namespace gui { namespace render { ShapeNode::ShapeNode(std::shared_ptr _shape, @@ -100,4 +101,5 @@ void ShapeNode::clearUtilization() } } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/render/ShapeNode.hpp b/kido/gui/osg/render/ShapeNode.hpp index 36b980ad1df31..3f2bcc16d15e9 100644 --- a/kido/gui/osg/render/ShapeNode.hpp +++ b/kido/gui/osg/render/ShapeNode.hpp @@ -44,12 +44,12 @@ class Node; } // namespace osg namespace kido { + namespace dynamics { class Shape; } // namespace dynamics -} // namespace kido -namespace osgKido { +namespace gui { class EntityNode; @@ -107,6 +107,7 @@ class ShapeNode }; } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_RENDER_SHAPEGEODE_HPP diff --git a/kido/gui/osg/render/SoftMeshShapeNode.cpp b/kido/gui/osg/render/SoftMeshShapeNode.cpp index 8c6d87c9243d5..6b1386eb12060 100644 --- a/kido/gui/osg/render/SoftMeshShapeNode.cpp +++ b/kido/gui/osg/render/SoftMeshShapeNode.cpp @@ -37,14 +37,15 @@ #include #include -#include "osgKido/render/SoftMeshShapeNode.hpp" -#include "osgKido/Utils.hpp" +#include "kido/gui/osg/render/SoftMeshShapeNode.hpp" +#include "kido/gui/osg/Utils.hpp" #include "kido/dynamics/SoftMeshShape.hpp" #include "kido/dynamics/SoftBodyNode.hpp" #include "kido/dynamics/PointMass.hpp" -namespace osgKido { +namespace kido { +namespace gui { namespace render { class SoftMeshShapeGeode : public ShapeNode, public osg::Geode @@ -295,4 +296,5 @@ SoftMeshShapeDrawable::~SoftMeshShapeDrawable() } } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/render/SoftMeshShapeNode.hpp b/kido/gui/osg/render/SoftMeshShapeNode.hpp index 3ec2ff9838297..67ac61482f706 100644 --- a/kido/gui/osg/render/SoftMeshShapeNode.hpp +++ b/kido/gui/osg/render/SoftMeshShapeNode.hpp @@ -39,15 +39,15 @@ #include -#include "osgKido/render/ShapeNode.hpp" +#include "kido/gui/osg/render/ShapeNode.hpp" namespace kido { + namespace dynamics { class SoftMeshShape; } // namespace dynamics -} // namespace kido -namespace osgKido { +namespace gui { namespace render { class SoftMeshShapeGeode; @@ -74,6 +74,7 @@ class SoftMeshShapeNode : public ShapeNode, public osg::MatrixTransform }; } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_RENDER_SOFTMESHSHAPENODE_HPP diff --git a/kido/gui/osg/render/WarningShapeNode.cpp b/kido/gui/osg/render/WarningShapeNode.cpp index 9712adba95afb..50deca3222170 100644 --- a/kido/gui/osg/render/WarningShapeNode.cpp +++ b/kido/gui/osg/render/WarningShapeNode.cpp @@ -34,14 +34,15 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "osgKido/render/WarningShapeNode.hpp" -#include "osgKido/EntityNode.hpp" +#include "kido/gui/osg/render/WarningShapeNode.hpp" +#include "kido/gui/osg/EntityNode.hpp" #include "kido/dynamics/Shape.hpp" #include "kido/dynamics/Entity.hpp" #include "kido/common/Console.hpp" -namespace osgKido { +namespace kido { +namespace gui { namespace render { WarningShapeNode::WarningShapeNode(std::shared_ptr shape, @@ -50,7 +51,7 @@ WarningShapeNode::WarningShapeNode(std::shared_ptr shape, { dtwarn << "Shape type (" << shape->getShapeType() << ") found in Entity '" << parent->getEntity()->getName() - << "' is not currently supported by osgKido, " + << "' is not currently supported by kido-gui-osg, " << "and will not be rendered\n"; } @@ -67,4 +68,5 @@ WarningShapeNode::~WarningShapeNode() } } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido diff --git a/kido/gui/osg/render/WarningShapeNode.hpp b/kido/gui/osg/render/WarningShapeNode.hpp index 5b31311bd87c2..c84e763e7424b 100644 --- a/kido/gui/osg/render/WarningShapeNode.hpp +++ b/kido/gui/osg/render/WarningShapeNode.hpp @@ -40,9 +40,10 @@ #include #include -#include "osgKido/render/ShapeNode.hpp" +#include "kido/gui/osg/render/ShapeNode.hpp" -namespace osgKido { +namespace kido { +namespace gui { namespace render { class WarningShapeNode : public ShapeNode, public osg::Node @@ -61,6 +62,7 @@ class WarningShapeNode : public ShapeNode, public osg::Node }; } // namespace render -} // namespace osgKido +} // namespace gui +} // namespace kido #endif // OSGKIDO_RENDER_WARNINGSHAPENODE_HPP diff --git a/kido/gui/osg/render/render.hpp.in b/kido/gui/osg/render/render.hpp.in index 5874ce7b64225..aef94331e1b36 100644 --- a/kido/gui/osg/render/render.hpp.in +++ b/kido/gui/osg/render/render.hpp.in @@ -1,3 +1,3 @@ // Automatically generated file by cmake -${osgKido_render_headers} +${gui_osg_render_headers} From cefd85a93fb048e330fffe67e05e097c589c92e2 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Wed, 20 Jan 2016 14:33:40 -0500 Subject: [PATCH 04/10] Update debian meta files for kido-gui-osg --- debian/libosgKido0-dev.install | 4 ++-- debian/libosgKido0.1.install | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/libosgKido0-dev.install b/debian/libosgKido0-dev.install index 19e510c300a9b..086902d673e0f 100644 --- a/debian/libosgKido0-dev.install +++ b/debian/libosgKido0-dev.install @@ -1,2 +1,2 @@ -usr/include/osgKido/* -usr/lib/libosgKido.so +usr/include/kido/gui/osg/* +usr/lib/libkido-gui-osg.so diff --git a/debian/libosgKido0.1.install b/debian/libosgKido0.1.install index 2cfeb840980b6..0a303514691b0 100644 --- a/debian/libosgKido0.1.install +++ b/debian/libosgKido0.1.install @@ -1 +1 @@ -usr/lib/libosgKido.so.* +usr/lib/libkido-gui-osg.so.* From dcc849c7d81f392a078f6434f1665e3e2f1decc6 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Wed, 20 Jan 2016 14:37:00 -0500 Subject: [PATCH 05/10] Add todo comment on KIDO_BUILD_OSGKIDO cmake option --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d81acc6162cc..6bf14978118e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,7 +69,7 @@ if(MSVC) else() option(BUILD_SHARED_LIBS "Build shared libraries" ON) endif() -option(KIDO_BUILD_OSGKIDO "Build osgKido library" ON) +option(KIDO_BUILD_OSGKIDO "Build osgKido library" ON) # TODO(JS): we probably should remove this option or add another build options for other extensions as well for consistency. option(KIDO_BUILD_EXAMPLES "Build examples" ON) option(KIDO_BUILD_TUTORIALS "Build tutorials" ON) option(KIDO_BUILD_UNITTESTS "Build unit tests" ON) From f36f21ed5403d447c44b57f916654228de1a7d36 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Wed, 20 Jan 2016 16:16:44 -0500 Subject: [PATCH 06/10] Update todo comment on cmake build options for extension libraries (#590) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bf14978118e8..bbde0297178fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,7 +69,7 @@ if(MSVC) else() option(BUILD_SHARED_LIBS "Build shared libraries" ON) endif() -option(KIDO_BUILD_OSGKIDO "Build osgKido library" ON) # TODO(JS): we probably should remove this option or add another build options for other extensions as well for consistency. +option(KIDO_BUILD_OSGKIDO "Build osgKido library" ON) # TODO(JS): Rename the option name to more relevant name to osg GUI and add more options for other extensions (#590). option(KIDO_BUILD_EXAMPLES "Build examples" ON) option(KIDO_BUILD_TUTORIALS "Build tutorials" ON) option(KIDO_BUILD_UNITTESTS "Build unit tests" ON) From 4a7ed505c7e3957e44eef2f0473c1fc626516173 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Wed, 20 Jan 2016 16:25:21 -0500 Subject: [PATCH 07/10] Update debian package name for kido-gui-osg --- debian/control | 32 +++++++++---------- ...v.install => libkido-gui-osg0-dev.install} | 0 ...0.1.install => libkido-gui-osg0.1.install} | 0 3 files changed, 15 insertions(+), 17 deletions(-) rename debian/{libosgKido0-dev.install => libkido-gui-osg0-dev.install} (100%) rename debian/{libosgKido0.1.install => libkido-gui-osg0.1.install} (100%) diff --git a/debian/control b/debian/control index 814f05dcef78b..d43a65721e512 100644 --- a/debian/control +++ b/debian/control @@ -283,14 +283,15 @@ Description: Kinematics Dynamics and Optimization Library for Animation and Robo Multibody dynamic simulation in KIDO is an extension of RTQL8, an open source software created by the Georgia Tech Graphics Lab. -Package: libkido-optimizer-nlopt0-dev +Package: libkido-gui-osg0-dev Section: libdevel Architecture: any Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, - libkido0-dev, - libkido-optimizer-nlopt0.1 (= ${binary:Version}), - libnlopt-dev + libkido-gui0-dev, + libkido-gui-osg0.1 (= ${binary:Version}), + libopenthreads-dev, + libopenscenegraph-dev Description: Kinematics Dynamics and Optimization Library for Animation and Robotics, development component files KIDO is a collaborative, cross-platform, open source library created by the Georgia Tech Graphics Lab and Humanoid Robotics Lab. The library provides data @@ -315,7 +316,7 @@ Description: Kinematics Dynamics and Optimization Library for Animation and Robo Multibody dynamic simulation in KIDO is an extension of RTQL8, an open source software created by the Georgia Tech Graphics Lab. -Package: libkido-optimizer-nlopt0.1 +Package: libkido-gui-osg0.1 Section: libs Architecture: any Pre-Depends: ${misc:Pre-Depends} @@ -345,14 +346,14 @@ Description: Kinematics Dynamics and Optimization Library for Animation and Robo Multibody dynamic simulation in KIDO is an extension of RTQL8, an open source software created by the Georgia Tech Graphics Lab. -Package: libkido-optimizer-ipopt0-dev +Package: libkido-optimizer-nlopt0-dev Section: libdevel Architecture: any Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, libkido0-dev, - libkido-optimizer-ipopt0.1 (= ${binary:Version}), - coinor-libipopt-dev + libkido-optimizer-nlopt0.1 (= ${binary:Version}), + libnlopt-dev Description: Kinematics Dynamics and Optimization Library for Animation and Robotics, development component files KIDO is a collaborative, cross-platform, open source library created by the Georgia Tech Graphics Lab and Humanoid Robotics Lab. The library provides data @@ -377,7 +378,7 @@ Description: Kinematics Dynamics and Optimization Library for Animation and Robo Multibody dynamic simulation in KIDO is an extension of RTQL8, an open source software created by the Georgia Tech Graphics Lab. -Package: libkido-optimizer-ipopt0.1 +Package: libkido-optimizer-nlopt0.1 Section: libs Architecture: any Pre-Depends: ${misc:Pre-Depends} @@ -407,17 +408,14 @@ Description: Kinematics Dynamics and Optimization Library for Animation and Robo Multibody dynamic simulation in KIDO is an extension of RTQL8, an open source software created by the Georgia Tech Graphics Lab. -Package: libosgKido0-dev +Package: libkido-optimizer-ipopt0-dev Section: libdevel Architecture: any Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, libkido0-dev, - libkido-planning0-dev, - libkido-utils0-dev, - libosgKido0.1 (= ${binary:Version}), - libopenthreads-dev, - libopenscenegraph-dev + libkido-optimizer-ipopt0.1 (= ${binary:Version}), + coinor-libipopt-dev Description: Kinematics Dynamics and Optimization Library for Animation and Robotics, development component files KIDO is a collaborative, cross-platform, open source library created by the Georgia Tech Graphics Lab and Humanoid Robotics Lab. The library provides data @@ -442,7 +440,7 @@ Description: Kinematics Dynamics and Optimization Library for Animation and Robo Multibody dynamic simulation in KIDO is an extension of RTQL8, an open source software created by the Georgia Tech Graphics Lab. -Package: libosgKido0.1 +Package: libkido-optimizer-ipopt0.1 Section: libs Architecture: any Pre-Depends: ${misc:Pre-Depends} @@ -470,4 +468,4 @@ Description: Kinematics Dynamics and Optimization Library for Animation and Robo KIDO has applications in robotics and computer animation because it features a multibody dynamic simulator and tools for control and motion planning. Multibody dynamic simulation in KIDO is an extension of RTQL8, an open source - software created by the Georgia Tech Graphics Lab. \ No newline at end of file + software created by the Georgia Tech Graphics Lab. diff --git a/debian/libosgKido0-dev.install b/debian/libkido-gui-osg0-dev.install similarity index 100% rename from debian/libosgKido0-dev.install rename to debian/libkido-gui-osg0-dev.install diff --git a/debian/libosgKido0.1.install b/debian/libkido-gui-osg0.1.install similarity index 100% rename from debian/libosgKido0.1.install rename to debian/libkido-gui-osg0.1.install From adf210f569f41ee41f29ed79ed4a28a253c2be68 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Thu, 21 Jan 2016 00:11:22 -0500 Subject: [PATCH 08/10] Use kido::gui::osg namespace for osg gui - Use leading :: namespace (global namespace) to differ OpenSceneGraph's osg namespace from kido::gui::osg --- kido/gui/osg/DefaultEventHandler.cpp | 16 +-- kido/gui/osg/DefaultEventHandler.hpp | 7 +- kido/gui/osg/DragAndDrop.cpp | 26 ++-- kido/gui/osg/DragAndDrop.hpp | 4 +- kido/gui/osg/EntityNode.cpp | 2 + kido/gui/osg/EntityNode.hpp | 4 +- kido/gui/osg/FrameNode.cpp | 6 +- kido/gui/osg/FrameNode.hpp | 4 +- kido/gui/osg/InteractiveFrame.cpp | 2 + kido/gui/osg/InteractiveFrame.hpp | 2 + kido/gui/osg/MouseEventHandler.hpp | 2 + kido/gui/osg/SupportPolygonVisual.cpp | 30 ++--- kido/gui/osg/SupportPolygonVisual.hpp | 16 +-- kido/gui/osg/TrackballManipulator.cpp | 4 +- kido/gui/osg/TrackballManipulator.hpp | 6 +- kido/gui/osg/Utils.hpp | 12 +- kido/gui/osg/Viewer.cpp | 112 +++++++++--------- kido/gui/osg/Viewer.hpp | 40 ++++--- kido/gui/osg/WorldNode.cpp | 14 ++- kido/gui/osg/WorldNode.hpp | 8 +- kido/gui/osg/examples/osgAtlasPuppet.cpp | 32 ++--- kido/gui/osg/examples/osgDragAndDrop.cpp | 12 +- kido/gui/osg/examples/osgHuboPuppet.cpp | 36 +++--- .../examples/osgOperationalSpaceControl.cpp | 20 ++-- kido/gui/osg/examples/osgSoftBodies.cpp | 4 +- kido/gui/osg/render/BoxShapeNode.cpp | 18 +-- kido/gui/osg/render/BoxShapeNode.hpp | 4 +- kido/gui/osg/render/CylinderShapeNode.cpp | 18 +-- kido/gui/osg/render/CylinderShapeNode.hpp | 4 +- kido/gui/osg/render/EllipsoidShapeNode.cpp | 18 +-- kido/gui/osg/render/EllipsoidShapeNode.hpp | 4 +- kido/gui/osg/render/LineSegmentShapeNode.cpp | 34 +++--- kido/gui/osg/render/LineSegmentShapeNode.hpp | 4 +- kido/gui/osg/render/MeshShapeNode.cpp | 112 +++++++++--------- kido/gui/osg/render/MeshShapeNode.hpp | 8 +- kido/gui/osg/render/PlaneShapeNode.cpp | 20 ++-- kido/gui/osg/render/PlaneShapeNode.hpp | 4 +- kido/gui/osg/render/ShapeNode.cpp | 8 +- kido/gui/osg/render/ShapeNode.hpp | 14 +-- kido/gui/osg/render/SoftMeshShapeNode.cpp | 34 +++--- kido/gui/osg/render/SoftMeshShapeNode.hpp | 4 +- kido/gui/osg/render/WarningShapeNode.cpp | 2 + kido/gui/osg/render/WarningShapeNode.hpp | 4 +- 43 files changed, 403 insertions(+), 332 deletions(-) diff --git a/kido/gui/osg/DefaultEventHandler.cpp b/kido/gui/osg/DefaultEventHandler.cpp index 28cfb61cf4d04..4d6e9fc38c24a 100644 --- a/kido/gui/osg/DefaultEventHandler.cpp +++ b/kido/gui/osg/DefaultEventHandler.cpp @@ -50,6 +50,7 @@ namespace kido { namespace gui { +namespace osg { DefaultEventHandler::DefaultEventHandler(Viewer* _viewer) : mViewer(_viewer), @@ -103,7 +104,7 @@ Eigen::Vector3d DefaultEventHandler::getDeltaCursor( ConstraintType _constraint, const Eigen::Vector3d& _constraintVector) const { - osg::Vec3d eye, center, up; + ::osg::Vec3d eye, center, up; mViewer->getCamera()->getViewMatrixAsLookAt(eye, center, up); Eigen::Vector3d near, far; @@ -150,15 +151,15 @@ void DefaultEventHandler::getNearAndFarPointUnderCursor(Eigen::Vector3d& near, Eigen::Vector3d& far, double distance) const { - osg::Camera* C = mViewer->getCamera(); - osg::Matrix VPW = C->getViewMatrix() * C->getProjectionMatrix() + ::osg::Camera* C = mViewer->getCamera(); + ::osg::Matrix VPW = C->getViewMatrix() * C->getProjectionMatrix() * C->getViewport()->computeWindowMatrix(); - osg::Matrix invVPW; + ::osg::Matrix invVPW; invVPW.invert(VPW); double x = getWindowCursorX(), y = getWindowCursorY(); - osg::Vec3 osgNear = osg::Vec3(x,y,0.0) * invVPW; - osg::Vec3 osgFar = osg::Vec3(x,y,distance) * invVPW; + ::osg::Vec3 osgNear = ::osg::Vec3(x,y,0.0) * invVPW; + ::osg::Vec3 osgFar = ::osg::Vec3(x,y,distance) * invVPW; near = osgToEigVec3(osgNear); far = osgToEigVec3(osgFar); @@ -224,7 +225,7 @@ void DefaultEventHandler::pick(std::vector& infoVector, infoVector.reserve(hlist.size()); for(const osgUtil::LineSegmentIntersector::Intersection& intersect : hlist) { - osg::Drawable* drawable = intersect.drawable; + ::osg::Drawable* drawable = intersect.drawable; render::ShapeNode* shape = dynamic_cast(drawable->getParent(0)); if(shape) @@ -442,5 +443,6 @@ void DefaultEventHandler::handleDestructionNotification( mMouseEventHandlers.erase(it); } +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/DefaultEventHandler.hpp b/kido/gui/osg/DefaultEventHandler.hpp index 20ed1705f3287..22997b10108db 100644 --- a/kido/gui/osg/DefaultEventHandler.hpp +++ b/kido/gui/osg/DefaultEventHandler.hpp @@ -55,8 +55,8 @@ class Entity; class Shape; } // dynamics -namespace gui -{ +namespace gui { +namespace osg { struct PickInfo { @@ -198,7 +198,7 @@ class DefaultEventHandler : public osgGA::GUIEventHandler, virtual void handleDestructionNotification( const kido::common::Subject* _subject) override; - /// kido::gui::Viewer that this event handler is tied to + /// kido::gui::osg::Viewer that this event handler is tied to Viewer* mViewer; /// Set of MouseEventHandlers that are tied to this DefaultEventHandler @@ -231,6 +231,7 @@ class DefaultEventHandler : public osgGA::GUIEventHandler, }; +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/DragAndDrop.cpp b/kido/gui/osg/DragAndDrop.cpp index ea83d4bca0a7c..b997a42a1b92c 100644 --- a/kido/gui/osg/DragAndDrop.cpp +++ b/kido/gui/osg/DragAndDrop.cpp @@ -51,6 +51,7 @@ namespace kido { namespace gui { +namespace osg { DragAndDrop::DragAndDrop(Viewer* viewer, kido::dynamics::Entity* entity) : mViewer(viewer), @@ -84,12 +85,12 @@ void DragAndDrop::update() if(nullptr == mEntity) return; - kido::gui::MouseButtonEvent event = + kido::gui::osg::MouseButtonEvent event = mViewer->getDefaultEventHandler()->getButtonEvent(LEFT_MOUSE); if(mAmMoving) { - if(kido::gui::BUTTON_RELEASE == event) + if(kido::gui::osg::BUTTON_RELEASE == event) { mAmMoving = false; release(); @@ -99,13 +100,13 @@ void DragAndDrop::update() } else // not moving { - if(kido::gui::BUTTON_PUSH == event) + if(kido::gui::osg::BUTTON_PUSH == event) { - const std::vector& picks = + const std::vector& picks = mViewer->getDefaultEventHandler()->getButtonPicks( - kido::gui::LEFT_MOUSE, kido::gui::BUTTON_PUSH); + kido::gui::osg::LEFT_MOUSE, kido::gui::osg::BUTTON_PUSH); - for(const kido::gui::PickInfo& pick : picks) + for(const kido::gui::osg::PickInfo& pick : picks) { if(pick.entity == mEntity) { @@ -333,25 +334,25 @@ void SimpleFrameShapeDnD::update() if(nullptr == mEntity || nullptr == mShape) return; - kido::gui::MouseButtonEvent event = + kido::gui::osg::MouseButtonEvent event = mViewer->getDefaultEventHandler()->getButtonEvent(LEFT_MOUSE); if(mAmMoving) { - if(kido::gui::BUTTON_RELEASE == event) + if(kido::gui::osg::BUTTON_RELEASE == event) mAmMoving = false; move(); } else { - if(kido::gui::BUTTON_PUSH == event) + if(kido::gui::osg::BUTTON_PUSH == event) { - const std::vector& picks = + const std::vector& picks = mViewer->getDefaultEventHandler()->getButtonPicks( - kido::gui::LEFT_MOUSE, kido::gui::BUTTON_PUSH); + kido::gui::osg::LEFT_MOUSE, kido::gui::osg::BUTTON_PUSH); - for(const kido::gui::PickInfo& pick : picks) + for(const kido::gui::osg::PickInfo& pick : picks) { if(pick.entity == mEntity && pick.shape.get() == mShape) { @@ -802,5 +803,6 @@ osgGA::GUIEventAdapter::ModKeyMask BodyNodeDnD::getJointRestrictionModKey() cons return mJointRestrictionModKey; } +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/DragAndDrop.hpp b/kido/gui/osg/DragAndDrop.hpp index 2996244a82347..dc432439ac8ab 100644 --- a/kido/gui/osg/DragAndDrop.hpp +++ b/kido/gui/osg/DragAndDrop.hpp @@ -53,6 +53,7 @@ class SimpleFrame; } // namespace dynamics namespace gui { +namespace osg { class Viewer; class InteractiveFrame; @@ -244,7 +245,7 @@ class InteractiveFrameDnD : public DragAndDrop public: /// Constructor - InteractiveFrameDnD(Viewer* viewer, kido::gui::InteractiveFrame* frame); + InteractiveFrameDnD(Viewer* viewer, kido::gui::osg::InteractiveFrame* frame); /// Virtual destructor virtual ~InteractiveFrameDnD() = default; @@ -356,6 +357,7 @@ class BodyNodeDnD : public DragAndDrop size_t mAdditionalBodyNodes; }; +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/EntityNode.cpp b/kido/gui/osg/EntityNode.cpp index ac5eaac507e3e..0377d2d215c00 100644 --- a/kido/gui/osg/EntityNode.cpp +++ b/kido/gui/osg/EntityNode.cpp @@ -57,6 +57,7 @@ namespace kido { namespace gui { +namespace osg { EntityNode::EntityNode(kido::dynamics::Entity* _entity, FrameNode* _parent) : mEntity(_entity), @@ -263,5 +264,6 @@ void EntityNode::createShapeNode(std::shared_ptr shape) addChild(node->getNode()); } +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/EntityNode.hpp b/kido/gui/osg/EntityNode.hpp index 0123757dabb93..128e09cae3fa5 100644 --- a/kido/gui/osg/EntityNode.hpp +++ b/kido/gui/osg/EntityNode.hpp @@ -50,6 +50,7 @@ class Shape; } // namespace dynamics namespace gui { +namespace osg { namespace render { class ShapeNode; @@ -57,7 +58,7 @@ class ShapeNode; class FrameNode; -class EntityNode : public osg::Group +class EntityNode : public ::osg::Group { public: @@ -115,6 +116,7 @@ class EntityNode : public osg::Group }; +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/FrameNode.cpp b/kido/gui/osg/FrameNode.cpp index aa36c76d5a71f..be19291ab133c 100644 --- a/kido/gui/osg/FrameNode.cpp +++ b/kido/gui/osg/FrameNode.cpp @@ -42,6 +42,7 @@ namespace kido { namespace gui { +namespace osg { FrameNode::FrameNode(kido::dynamics::Frame* _frame, WorldNode* _worldNode, bool _relative, bool _recursive) @@ -178,7 +179,7 @@ void FrameNode::refreshFrameNode(kido::dynamics::Frame* _frame) //============================================================================== void FrameNode::createFrameNode(kido::dynamics::Frame* _frame) { - osg::ref_ptr node = new FrameNode(_frame, mWorldNode, true, true); + ::osg::ref_ptr node = new FrameNode(_frame, mWorldNode, true, true); mFrameToNode[_frame] = node.get(); mNodeToFrame[node.get()] = _frame; @@ -204,7 +205,7 @@ void FrameNode::refreshEntityNode(kido::dynamics::Entity* _entity) //============================================================================== void FrameNode::createEntityNode(kido::dynamics::Entity* _entity) { - osg::ref_ptr node = new EntityNode(_entity, this); + ::osg::ref_ptr node = new EntityNode(_entity, this); mEntityToNode[_entity] = node.get(); mNodeToEntity[node.get()] = _entity; @@ -212,5 +213,6 @@ void FrameNode::createEntityNode(kido::dynamics::Entity* _entity) addChild(node); } +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/FrameNode.hpp b/kido/gui/osg/FrameNode.hpp index db08bd627f40c..d9d712d902513 100644 --- a/kido/gui/osg/FrameNode.hpp +++ b/kido/gui/osg/FrameNode.hpp @@ -48,11 +48,12 @@ class Entity; } // namespace dynamics namespace gui { +namespace osg { class WorldNode; class EntityNode; -class FrameNode : public osg::MatrixTransform +class FrameNode : public ::osg::MatrixTransform { public: @@ -121,6 +122,7 @@ class FrameNode : public osg::MatrixTransform }; +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/InteractiveFrame.cpp b/kido/gui/osg/InteractiveFrame.cpp index 250bbdd326c12..13c24d6b81866 100644 --- a/kido/gui/osg/InteractiveFrame.cpp +++ b/kido/gui/osg/InteractiveFrame.cpp @@ -42,6 +42,7 @@ namespace kido { namespace gui { +namespace osg { //============================================================================== InteractiveTool::InteractiveTool(InteractiveFrame* frame, double defaultAlpha, @@ -516,5 +517,6 @@ void InteractiveFrame::deleteAllTools() delete mTools[i][j]; } +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/InteractiveFrame.hpp b/kido/gui/osg/InteractiveFrame.hpp index 502ff1b086264..2a2b1a165a901 100644 --- a/kido/gui/osg/InteractiveFrame.hpp +++ b/kido/gui/osg/InteractiveFrame.hpp @@ -46,6 +46,7 @@ class MeshShape; } // namespace dynamics namespace gui { +namespace osg { class InteractiveFrame; @@ -144,6 +145,7 @@ class InteractiveFrame : public kido::dynamics::SimpleFrame typedef std::shared_ptr InteractiveFramePtr; +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/MouseEventHandler.hpp b/kido/gui/osg/MouseEventHandler.hpp index 31c936fa14d28..b5d489e134c36 100644 --- a/kido/gui/osg/MouseEventHandler.hpp +++ b/kido/gui/osg/MouseEventHandler.hpp @@ -44,6 +44,7 @@ namespace kido { namespace gui { +namespace osg { class DefaultEventHandler; @@ -72,6 +73,7 @@ class MouseEventHandler : public virtual kido::common::Subject, }; +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/SupportPolygonVisual.cpp b/kido/gui/osg/SupportPolygonVisual.cpp index ad3a5a5af8c2c..a3f72488b6f07 100644 --- a/kido/gui/osg/SupportPolygonVisual.cpp +++ b/kido/gui/osg/SupportPolygonVisual.cpp @@ -44,6 +44,7 @@ namespace kido { namespace gui { +namespace osg { //============================================================================== SupportPolygonVisual::SupportPolygonVisual(const kido::dynamics::SkeletonPtr& skeleton, @@ -118,14 +119,14 @@ void SupportPolygonVisual::displayPolygon(bool display) //============================================================================== void SupportPolygonVisual::setPolygonColor(const Eigen::Vector4d& color) { - (*mPolygonColor)[0] = osg::Vec4(color[0], color[1], color[2], color[3]); - mPolygonGeom->setColorArray(mPolygonColor, osg::Array::BIND_OVERALL); + (*mPolygonColor)[0] = ::osg::Vec4(color[0], color[1], color[2], color[3]); + mPolygonGeom->setColorArray(mPolygonColor, ::osg::Array::BIND_OVERALL); } //============================================================================== Eigen::Vector4d SupportPolygonVisual::getPolygonColor() const { - const osg::Vec4& c = (*mPolygonColor)[0]; + const ::osg::Vec4& c = (*mPolygonColor)[0]; return Eigen::Vector4d(c[0], c[1], c[2], c[3]); } @@ -255,7 +256,7 @@ void SupportPolygonVisual::refresh() { const Eigen::Vector3d& v = axes.first*poly[i][0] + axes.second*poly[i][1] + up*mElevation; - (*mVertices)[i] = osg::Vec3(v[0], v[1], v[2]); + (*mVertices)[i] = ::osg::Vec3(v[0], v[1], v[2]); (*mFaces)[i] = i; } @@ -346,27 +347,27 @@ void SupportPolygonVisual::refresh() void SupportPolygonVisual::initialize() { mDisplayPolygon = true; - mPolygonGeode = new osg::Geode; - mPolygonGeode->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF); + mPolygonGeode = new ::osg::Geode; + mPolygonGeode->getOrCreateStateSet()->setMode(GL_LIGHTING, ::osg::StateAttribute::OFF); addChild(mPolygonGeode); - mPolygonGeom = new osg::Geometry; + mPolygonGeom = new ::osg::Geometry; mPolygonGeode->addDrawable(mPolygonGeom); - mVertices = new osg::Vec3Array; + mVertices = new ::osg::Vec3Array; mPolygonGeom->setVertexArray(mVertices); - mPolygonGeom->setDataVariance(osg::Object::DYNAMIC); + mPolygonGeom->setDataVariance(::osg::Object::DYNAMIC); - osg::Vec4 color(0.1, 0.9, 0.1, 1.0); - mPolygonColor = new osg::Vec4Array; + ::osg::Vec4 color(0.1, 0.9, 0.1, 1.0); + mPolygonColor = new ::osg::Vec4Array; mPolygonColor->resize(1); (*mPolygonColor)[0] = color; mPolygonGeom->setColorArray(mPolygonColor); - mPolygonGeom->setColorBinding(osg::Geometry::BIND_OVERALL); + mPolygonGeom->setColorBinding(::osg::Geometry::BIND_OVERALL); - mFaces = new osg::DrawElementsUShort(osg::PrimitiveSet::TRIANGLE_FAN, 0); + mFaces = new ::osg::DrawElementsUShort(::osg::PrimitiveSet::TRIANGLE_FAN, 0); mPolygonGeom->addPrimitiveSet(mFaces); - mPolygonGeom->setColorArray(mPolygonColor, osg::Array::BIND_OVERALL); + mPolygonGeom->setColorArray(mPolygonColor, ::osg::Array::BIND_OVERALL); mDisplayCentroid = true; mCentroid = std::make_shared( @@ -400,5 +401,6 @@ void SupportPolygonVisual::initialize() addChild(mComNode); } +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/SupportPolygonVisual.hpp b/kido/gui/osg/SupportPolygonVisual.hpp index b683ea1c39f22..df8af3f259b89 100644 --- a/kido/gui/osg/SupportPolygonVisual.hpp +++ b/kido/gui/osg/SupportPolygonVisual.hpp @@ -46,6 +46,7 @@ namespace kido { namespace gui { +namespace osg { /// Attach this to a Viewer in order to visualize the support polygon of a /// Skeleton @@ -176,27 +177,28 @@ class SupportPolygonVisual : public ViewerAttachment Eigen::Vector4d mInvalidColor; /// Color for the polygon - osg::ref_ptr mPolygonColor; + ::osg::ref_ptr<::osg::Vec4Array> mPolygonColor; /// Geode to hold the polygon - osg::ref_ptr mPolygonGeode; + ::osg::ref_ptr<::osg::Geode> mPolygonGeode; /// Geometry to describe the polygon - osg::ref_ptr mPolygonGeom; + ::osg::ref_ptr<::osg::Geometry> mPolygonGeom; /// Vertices of the polygon - osg::ref_ptr mVertices; + ::osg::ref_ptr<::osg::Vec3Array> mVertices; /// Faces of the polygon - osg::ref_ptr mFaces; + ::osg::ref_ptr<::osg::DrawElementsUShort> mFaces; /// Node to render the centroid - osg::ref_ptr mCentroidNode; + ::osg::ref_ptr mCentroidNode; /// Node to render the COM - osg::ref_ptr mComNode; + ::osg::ref_ptr mComNode; }; +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/TrackballManipulator.cpp b/kido/gui/osg/TrackballManipulator.cpp index bdf709adf726a..64af579945f87 100644 --- a/kido/gui/osg/TrackballManipulator.cpp +++ b/kido/gui/osg/TrackballManipulator.cpp @@ -38,6 +38,7 @@ namespace kido { namespace gui { +namespace osg { //============================================================================== TrackballManipulator::TrackballManipulator(int flags) @@ -49,7 +50,7 @@ TrackballManipulator::TrackballManipulator(int flags) //============================================================================== TrackballManipulator::TrackballManipulator(const TrackballManipulator& tm, - const osg::CopyOp& copyOp) + const ::osg::CopyOp& copyOp) : osgGA::OrbitManipulator(tm, copyOp) { // Do nothing @@ -77,5 +78,6 @@ bool TrackballManipulator::performMovementRightMouseButton( eventTimeDelta, dx, dy); } +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/TrackballManipulator.hpp b/kido/gui/osg/TrackballManipulator.hpp index 348cdbc8b2dd6..de302558e77ba 100644 --- a/kido/gui/osg/TrackballManipulator.hpp +++ b/kido/gui/osg/TrackballManipulator.hpp @@ -41,6 +41,7 @@ namespace kido { namespace gui { +namespace osg { class OSGGA_EXPORT TrackballManipulator : public osgGA::OrbitManipulator { @@ -50,7 +51,7 @@ class OSGGA_EXPORT TrackballManipulator : public osgGA::OrbitManipulator /// Copy-constructor TrackballManipulator(const TrackballManipulator& tm, - const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY); + const ::osg::CopyOp& copyOp = ::osg::CopyOp::SHALLOW_COPY); /// Destructor virtual ~TrackballManipulator(); @@ -65,10 +66,11 @@ class OSGGA_EXPORT TrackballManipulator : public osgGA::OrbitManipulator const double dx, const double dy) override; - META_Object( kido-gui-osg, TrackballManipulator ) + //META_Object( kido-gui-osg, TrackballManipulator ) // TODO(MXG): Consider applying the META macros to every kido-gui-osg Node }; +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/Utils.hpp b/kido/gui/osg/Utils.hpp index f88633fc93d31..1d44a9578b59f 100644 --- a/kido/gui/osg/Utils.hpp +++ b/kido/gui/osg/Utils.hpp @@ -66,26 +66,26 @@ osg::Matrix eigToOsgMatrix(const Eigen::DenseBase& M) //============================================================================== template -osg::Vec3d eigToOsgVec3(const Eigen::MatrixBase& vec) +::osg::Vec3d eigToOsgVec3(const Eigen::MatrixBase& vec) { - return osg::Vec3d(vec[0], vec[1], vec[2]); + return ::osg::Vec3d(vec[0], vec[1], vec[2]); } //============================================================================== -inline Eigen::Vector3d osgToEigVec3(const osg::Vec3d& vec) +inline Eigen::Vector3d osgToEigVec3(const ::osg::Vec3d& vec) { return Eigen::Vector3d(vec[0], vec[1], vec[2]); } //============================================================================== template -osg::Vec4d eigToOsgVec4(const Eigen::MatrixBase& vec) +::osg::Vec4d eigToOsgVec4(const Eigen::MatrixBase& vec) { - return osg::Vec4d(vec[0], vec[1], vec[2], vec[3]); + return ::osg::Vec4d(vec[0], vec[1], vec[2], vec[3]); } //============================================================================== -inline Eigen::Vector4d osgToEigVec4(const osg::Vec4d& vec) +inline Eigen::Vector4d osgToEigVec4(const ::osg::Vec4d& vec) { return Eigen::Vector4d(vec[0], vec[1], vec[2], vec[3]); } diff --git a/kido/gui/osg/Viewer.cpp b/kido/gui/osg/Viewer.cpp index 50e33b45ebbea..fe5315b4aadd5 100644 --- a/kido/gui/osg/Viewer.cpp +++ b/kido/gui/osg/Viewer.cpp @@ -54,28 +54,29 @@ namespace kido { namespace gui { +namespace osg { -class SaveScreen : public osg::Camera::DrawCallback +class SaveScreen : public ::osg::Camera::DrawCallback { public: SaveScreen(Viewer* viewer) : mViewer(viewer), - mImage(new osg::Image), + mImage(new ::osg::Image), mCamera(mViewer->getCamera()) { // Do nothing } - virtual void operator () (osg::RenderInfo& renderInfo) const + virtual void operator () (::osg::RenderInfo& renderInfo) const { - osg::Camera::DrawCallback::operator ()(renderInfo); + ::osg::Camera::DrawCallback::operator ()(renderInfo); if(mViewer->mRecording || mViewer->mScreenCapture) { int x, y; unsigned int width, height; - osg::ref_ptr vp = mCamera->getViewport(); + ::osg::ref_ptr<::osg::Viewport> vp = mCamera->getViewport(); x = vp->x(); y = vp->y(); width = vp->width(); @@ -127,19 +128,19 @@ class SaveScreen : public osg::Camera::DrawCallback Viewer* mViewer; - osg::ref_ptr mImage; + ::osg::ref_ptr<::osg::Image> mImage; - osg::ref_ptr mCamera; + ::osg::ref_ptr<::osg::Camera> mCamera; }; //============================================================================== -class ViewerAttachmentCallback : public osg::NodeCallback +class ViewerAttachmentCallback : public ::osg::NodeCallback { public: - virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) + virtual void operator()(::osg::Node* node, ::osg::NodeVisitor* nv) { - osg::ref_ptr attachment = + ::osg::ref_ptr attachment = dynamic_cast(node); if(attachment) @@ -193,22 +194,22 @@ void ViewerAttachment::attach(Viewer* newViewer) } //============================================================================== -Viewer::Viewer(const osg::Vec4& clearColor) +Viewer::Viewer(const ::osg::Vec4& clearColor) : mImageSequenceNum(0), mImageDigits(0), - mRootGroup(new osg::Group), - mLightGroup(new osg::Group), - mLight1(new osg::Light), - mLightSource1(new osg::LightSource), - mLight2(new osg::Light), - mLightSource2(new osg::LightSource), - mUpwards(osg::Vec3(0,0,1)), - mOver(osg::Vec3(0,1,0)), + mRootGroup(new ::osg::Group), + mLightGroup(new ::osg::Group), + mLight1(new ::osg::Light), + mLightSource1(new ::osg::LightSource), + mLight2(new ::osg::Light), + mLightSource2(new ::osg::LightSource), + mUpwards(::osg::Vec3(0,0,1)), + mOver(::osg::Vec3(0,1,0)), mSimulating(false), mAllowSimulation(true), mHeadlights(true) { - setCameraManipulator(new kido::gui::TrackballManipulator); + setCameraManipulator(new kido::gui::osg::TrackballManipulator); addInstructionText("Left-click: Interaction\n"); addInstructionText("Right-click: Rotate view\n"); addInstructionText("Middle-click: Translate view\n"); @@ -320,46 +321,46 @@ void Viewer::switchHeadlights(bool _on) { if(getLight()) { - getLight()->setAmbient(osg::Vec4(0.1,0.1,0.1,1.0)); - getLight()->setDiffuse(osg::Vec4(0.8,0.8,0.8,1.0)); - getLight()->setSpecular(osg::Vec4(1.0,1.0,1.0,1.0)); + getLight()->setAmbient(::osg::Vec4(0.1,0.1,0.1,1.0)); + getLight()->setDiffuse(::osg::Vec4(0.8,0.8,0.8,1.0)); + getLight()->setSpecular(::osg::Vec4(1.0,1.0,1.0,1.0)); } if(mLight1) { - mLight1->setAmbient(osg::Vec4(0.0,0.0,0.0,1.0)); - mLight1->setDiffuse(osg::Vec4(0.0,0.0,0.0,1.0)); - mLight1->setSpecular(osg::Vec4(0.0,0.0,0.0,1.0)); + mLight1->setAmbient(::osg::Vec4(0.0,0.0,0.0,1.0)); + mLight1->setDiffuse(::osg::Vec4(0.0,0.0,0.0,1.0)); + mLight1->setSpecular(::osg::Vec4(0.0,0.0,0.0,1.0)); } if(mLight2) { - mLight2->setAmbient(osg::Vec4(0.0,0.0,0.0,1.0)); - mLight2->setDiffuse(osg::Vec4(0.0,0.0,0.0,1.0)); - mLight2->setSpecular(osg::Vec4(0.0,0.0,0.0,1.0)); + mLight2->setAmbient(::osg::Vec4(0.0,0.0,0.0,1.0)); + mLight2->setDiffuse(::osg::Vec4(0.0,0.0,0.0,1.0)); + mLight2->setSpecular(::osg::Vec4(0.0,0.0,0.0,1.0)); } } else { if(getLight()) { - getLight()->setAmbient(osg::Vec4(0.1,0.1,0.1,1.0)); - getLight()->setDiffuse(osg::Vec4(0.0,0.0,0.0,1.0)); - getLight()->setSpecular(osg::Vec4(0.0,0.0,0.0,1.0)); + getLight()->setAmbient(::osg::Vec4(0.1,0.1,0.1,1.0)); + getLight()->setDiffuse(::osg::Vec4(0.0,0.0,0.0,1.0)); + getLight()->setSpecular(::osg::Vec4(0.0,0.0,0.0,1.0)); } if(mLight1) { - mLight1->setAmbient(osg::Vec4(0.0,0.0,0.0,1.0)); - mLight1->setDiffuse(osg::Vec4(0.7,0.7,0.7,1.0)); - mLight1->setSpecular(osg::Vec4(0.9,0.9,0.9,1.0)); + mLight1->setAmbient(::osg::Vec4(0.0,0.0,0.0,1.0)); + mLight1->setDiffuse(::osg::Vec4(0.7,0.7,0.7,1.0)); + mLight1->setSpecular(::osg::Vec4(0.9,0.9,0.9,1.0)); } if(mLight2) { - mLight2->setAmbient(osg::Vec4(0.0,0.0,0.0,1.0)); - mLight2->setDiffuse(osg::Vec4(0.3,0.3,0.3,1.0)); - mLight2->setSpecular(osg::Vec4(0.4,0.4,0.4,1.0)); + mLight2->setAmbient(::osg::Vec4(0.0,0.0,0.0,1.0)); + mLight2->setDiffuse(::osg::Vec4(0.3,0.3,0.3,1.0)); + mLight2->setSpecular(::osg::Vec4(0.4,0.4,0.4,1.0)); } } } @@ -459,13 +460,13 @@ const std::unordered_set& Viewer::getAttachments() const } //============================================================================== -osg::Group* Viewer::getLightGroup() +::osg::Group* Viewer::getLightGroup() { return mLightGroup; } //============================================================================== -const osg::Group* Viewer::getLightGroup() const +const ::osg::Group* Viewer::getLightGroup() const { return mLightGroup; } @@ -476,19 +477,19 @@ void Viewer::setupDefaultLights() setUpwardsDirection(mUpwards); switchHeadlights(true); - osg::ref_ptr lightSS = mRootGroup->getOrCreateStateSet(); + ::osg::ref_ptr<::osg::StateSet> lightSS = mRootGroup->getOrCreateStateSet(); mLight1->setLightNum(1); mLightSource1->setLight(mLight1); - mLightSource1->setLocalStateSetModes(osg::StateAttribute::ON); - mLightSource1->setStateSetModes(*lightSS, osg::StateAttribute::ON); + mLightSource1->setLocalStateSetModes(::osg::StateAttribute::ON); + mLightSource1->setStateSetModes(*lightSS, ::osg::StateAttribute::ON); mLightGroup->removeChild(mLightSource1); // Make sure the LightSource is not already present mLightGroup->addChild(mLightSource1); mLight2->setLightNum(2); mLightSource2->setLight(mLight2); - mLightSource2->setLocalStateSetModes(osg::StateAttribute::ON); - mLightSource2->setStateSetModes(*lightSS, osg::StateAttribute::ON); + mLightSource2->setLocalStateSetModes(::osg::StateAttribute::ON); + mLightSource2->setStateSetModes(*lightSS, ::osg::StateAttribute::ON); mLightGroup->removeChild(mLightSource2); mLightGroup->addChild(mLightSource2); @@ -497,23 +498,23 @@ void Viewer::setupDefaultLights() } //============================================================================== -void Viewer::setUpwardsDirection(const osg::Vec3& _up) +void Viewer::setUpwardsDirection(const ::osg::Vec3& _up) { mUpwards = _up; if(mUpwards.length() > 0) mUpwards.normalize(); else - mUpwards = osg::Vec3(0,0,1); + mUpwards = ::osg::Vec3(0,0,1); - mOver = _up^osg::Vec3(1,0,0); // Note: operator^ is the cross product operator in OSG + mOver = _up^::osg::Vec3(1,0,0); // Note: operator^ is the cross product operator in OSG if(mOver.length() < 1e-12) - mOver = osg::Vec3(0,0,1)^_up; + mOver = ::osg::Vec3(0,0,1)^_up; mOver.normalize(); - osg::Vec3 p1 = mUpwards+mOver; - mLight1->setPosition(osg::Vec4(p1[0], p1[1], p1[2], 0.0)); - osg::Vec3 p2 = mUpwards-mOver; - mLight2->setPosition(osg::Vec4(p2[0], p2[1], p2[2], 0.0)); + ::osg::Vec3 p1 = mUpwards+mOver; + mLight1->setPosition(::osg::Vec4(p1[0], p1[1], p1[2], 0.0)); + ::osg::Vec3 p2 = mUpwards-mOver; + mLight2->setPosition(::osg::Vec4(p2[0], p2[1], p2[2], 0.0)); } //============================================================================== @@ -660,7 +661,7 @@ SimpleFrameShapeDnD* Viewer::enableDragAndDrop( //============================================================================== InteractiveFrameDnD* Viewer::enableDragAndDrop( - kido::gui::InteractiveFrame* _frame) + kido::gui::osg::InteractiveFrame* _frame) { if(nullptr == _frame) return nullptr; @@ -822,10 +823,11 @@ void Viewer::updateDragAndDrops() } //============================================================================== -const osg::ref_ptr& Viewer::getRootGroup() const +const ::osg::ref_ptr<::osg::Group>& Viewer::getRootGroup() const { return mRootGroup; } +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/Viewer.hpp b/kido/gui/osg/Viewer.hpp index 7dd752b31a13d..be07ca1901a01 100644 --- a/kido/gui/osg/Viewer.hpp +++ b/kido/gui/osg/Viewer.hpp @@ -61,6 +61,7 @@ class BodyNode; } // namespace dynamics namespace gui { +namespace osg { class WorldNode; class DefaultEventHandler; @@ -73,7 +74,7 @@ class BodyNodeDnD; class Viewer; class SaveScreen; -class ViewerAttachment : public virtual osg::Group +class ViewerAttachment : public virtual ::osg::Group { public: @@ -118,9 +119,9 @@ class Viewer : public osgViewer::Viewer, public kido::common::Subject { public: - /// Constructor for kido::gui::Viewer. This will automatically create the + /// Constructor for kido::gui::osg::Viewer. This will automatically create the /// default event handler. - Viewer(const osg::Vec4& clearColor = osg::Vec4(0.9,0.9,0.9,1.0)); + Viewer(const ::osg::Vec4& clearColor = ::osg::Vec4(0.9,0.9,0.9,1.0)); /// Destructor virtual ~Viewer(); @@ -154,7 +155,7 @@ class Viewer : public osgViewer::Viewer, public kido::common::Subject /// Returns true if the Viewer is currently recording. bool isRecording() const; - /// Creates the default event handler for this kido::gui::Viewer + /// Creates the default event handler for this kido::gui::osg::Viewer virtual void switchDefaultEventHandler(bool _on); /// Return a pointer to the default event handler @@ -193,17 +194,17 @@ class Viewer : public osgViewer::Viewer, public kido::common::Subject const std::unordered_set& getAttachments() const; /// Get the Group node that contains the LightSources for this Viewer - osg::Group* getLightGroup(); + ::osg::Group* getLightGroup(); /// Get the Group node that contains the LightSources for this Viewer - const osg::Group* getLightGroup() const; + const ::osg::Group* getLightGroup() const; /// Set up the default lighting scheme void setupDefaultLights(); /// Set the direction that this Viewer should consider to be upwards (default /// is <0,0,1>) - void setUpwardsDirection(const osg::Vec3& _up); + void setUpwardsDirection(const ::osg::Vec3& _up); /// Set the direction that this Viewer should consider to be upwards (default /// is <0,0,1>) @@ -287,7 +288,7 @@ class Viewer : public osgViewer::Viewer, public kido::common::Subject void updateDragAndDrops(); /// Get the root osg::Group of this Viewer - const osg::ref_ptr& getRootGroup() const; + const ::osg::ref_ptr<::osg::Group>& getRootGroup() const; protected: @@ -314,32 +315,32 @@ class Viewer : public osgViewer::Viewer, public kido::common::Subject /// Name for the next screen capture std::string mScreenCapName; - /// Default WorldNodeEventHandler for this kido::gui::Viewer - osg::ref_ptr mDefaultEventHandler; + /// Default WorldNodeEventHandler for this kido::gui::osg::Viewer + ::osg::ref_ptr mDefaultEventHandler; /// The root node of this Viewer - osg::ref_ptr mRootGroup; + ::osg::ref_ptr<::osg::Group> mRootGroup; /// The Group Node containing light sources - osg::ref_ptr mLightGroup; + ::osg::ref_ptr<::osg::Group> mLightGroup; /// Non-headlights Light #1 - osg::ref_ptr mLight1; + ::osg::ref_ptr<::osg::Light> mLight1; /// Non-headlights LightSource #1 - osg::ref_ptr mLightSource1; + ::osg::ref_ptr<::osg::LightSource> mLightSource1; /// Non-headlights Light #2 - osg::ref_ptr mLight2; + ::osg::ref_ptr<::osg::Light> mLight2; /// Non-headlights LightSource #2 - osg::ref_ptr mLightSource2; + ::osg::ref_ptr<::osg::LightSource> mLightSource2; /// Vector pointing upwards - osg::Vec3 mUpwards; + ::osg::Vec3 mUpwards; /// Vector pointing to the side - osg::Vec3 mOver; + ::osg::Vec3 mOver; /// True iff this Viewer is currently simulating bool mSimulating; @@ -350,7 +351,7 @@ class Viewer : public osgViewer::Viewer, public kido::common::Subject /// True iff headlights were last set to be on bool mHeadlights; - /// Map of WorldNodes in this kido::gui::Viewer. A WorldNode will map to true + /// Map of WorldNodes in this kido::gui::osg::Viewer. A WorldNode will map to true /// iff it is currently active std::map mWorldNodes; @@ -377,6 +378,7 @@ class Viewer : public osgViewer::Viewer, public kido::common::Subject std::map mBodyNodeDnDMap; }; +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/WorldNode.cpp b/kido/gui/osg/WorldNode.cpp index 9da4b06d478ae..2bf637eccc359 100644 --- a/kido/gui/osg/WorldNode.cpp +++ b/kido/gui/osg/WorldNode.cpp @@ -46,14 +46,15 @@ namespace kido { namespace gui { +namespace osg { -class WorldNodeCallback : public osg::NodeCallback +class WorldNodeCallback : public ::osg::NodeCallback { public: - virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) + virtual void operator()(::osg::Node* node, ::osg::NodeVisitor* nv) { - osg::ref_ptr currentNode = dynamic_cast(node); + ::osg::ref_ptr currentNode = dynamic_cast(node); if(currentNode) currentNode->refresh(); @@ -248,7 +249,7 @@ void WorldNode::refreshBaseFrameNode(kido::dynamics::Frame* _frame) //============================================================================== void WorldNode::createBaseFrameNode(kido::dynamics::Frame* _frame) { - osg::ref_ptr node = new FrameNode(_frame, this, false, true); + ::osg::ref_ptr node = new FrameNode(_frame, this, false, true); mFrameToNode[_frame] = node.get(); mNodeToFrame[node.get()] = _frame; @@ -291,11 +292,11 @@ void WorldNode::createBaseEntityNode(kido::dynamics::Entity* _entity) else parentFrame = _entity->getParentFrame(); - osg::ref_ptr parentFrameNode = + ::osg::ref_ptr parentFrameNode = new FrameNode(parentFrame, this, false, false); addChild(parentFrameNode); - osg::ref_ptr entityNode = + ::osg::ref_ptr entityNode = new EntityNode(_entity, parentFrameNode); parentFrameNode->addChild(entityNode); @@ -303,5 +304,6 @@ void WorldNode::createBaseEntityNode(kido::dynamics::Entity* _entity) mNodeToEntity[entityNode] = _entity; } +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/WorldNode.hpp b/kido/gui/osg/WorldNode.hpp index 38d9df5342822..7a7e28867b49f 100644 --- a/kido/gui/osg/WorldNode.hpp +++ b/kido/gui/osg/WorldNode.hpp @@ -55,13 +55,14 @@ class Entity; } // namespace dynamics namespace gui { +namespace osg { class FrameNode; class EntityNode; class Viewer; /// WorldNode class encapsulates a World to be displayed in OpenSceneGraph -class WorldNode : public osg::Group +class WorldNode : public ::osg::Group { public: @@ -135,9 +136,9 @@ class WorldNode : public osg::Group /// Destructor virtual ~WorldNode(); - /// Called when this world gets added to an kido::gui::Viewer. Override this + /// Called when this world gets added to an kido::gui::osg::Viewer. Override this /// function to customize the way your WorldNode starts up in an - /// kido::gui::Viewer. Default behavior does nothing. + /// kido::gui::osg::Viewer. Default behavior does nothing. virtual void setupViewer(); /// Clear the utilization flags of each child node @@ -191,6 +192,7 @@ class WorldNode : public osg::Group }; +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/examples/osgAtlasPuppet.cpp b/kido/gui/osg/examples/osgAtlasPuppet.cpp index f17581a51e2be..395fa243a42bd 100644 --- a/kido/gui/osg/examples/osgAtlasPuppet.cpp +++ b/kido/gui/osg/examples/osgAtlasPuppet.cpp @@ -132,7 +132,7 @@ class RelaxedPosture : public kido::optimizer::Function Eigen::VectorXd mWeights; }; -class TeleoperationWorld : public kido::gui::WorldNode +class TeleoperationWorld : public kido::gui::osg::WorldNode { public: @@ -151,7 +151,7 @@ class TeleoperationWorld : public kido::gui::WorldNode }; TeleoperationWorld(WorldPtr _world, SkeletonPtr _robot) - : kido::gui::WorldNode(_world), + : kido::gui::osg::WorldNode(_world), mAtlas(_robot), iter(0), l_foot(_robot->getEndEffector("l_foot")), @@ -265,7 +265,7 @@ class InputHandler : public osgGA::GUIEventHandler { public: - InputHandler(kido::gui::Viewer* viewer, TeleoperationWorld* teleop, + InputHandler(kido::gui::osg::Viewer* viewer, TeleoperationWorld* teleop, const SkeletonPtr& atlas, const WorldPtr& world) : mViewer(viewer), mTeleop(teleop), @@ -460,7 +460,7 @@ class InputHandler : public osgGA::GUIEventHandler protected: - kido::gui::Viewer* mViewer; + kido::gui::osg::Viewer* mViewer; TeleoperationWorld* mTeleop; @@ -590,7 +590,7 @@ void setupEndEffectors(const SkeletonPtr& atlas) l_hand->setDefaultRelativeTransform(tf_hand, true); // Create an interactive frame to use as the target for the left hand - kido::gui::InteractiveFramePtr lh_target(new kido::gui::InteractiveFrame( + kido::gui::osg::InteractiveFramePtr lh_target(new kido::gui::osg::InteractiveFrame( Frame::World(), "lh_target")); // Set the target of the left hand to the interactive frame. We pass true into @@ -626,7 +626,7 @@ void setupEndEffectors(const SkeletonPtr& atlas) r_hand->setDefaultRelativeTransform(tf_hand, true); // Create an interactive frame to use as the target for the right hand - kido::gui::InteractiveFramePtr rh_target(new kido::gui::InteractiveFrame( + kido::gui::osg::InteractiveFramePtr rh_target(new kido::gui::osg::InteractiveFrame( Frame::World(), "rh_target")); // Create the right hand's IK and set its target @@ -676,7 +676,7 @@ void setupEndEffectors(const SkeletonPtr& atlas) l_foot->setRelativeTransform(tf_foot); // Create an interactive frame to use as the target for the left foot - kido::gui::InteractiveFramePtr lf_target(new kido::gui::InteractiveFrame( + kido::gui::osg::InteractiveFramePtr lf_target(new kido::gui::osg::InteractiveFrame( Frame::World(), "lf_target")); // Create the left foot's IK and set its target @@ -705,7 +705,7 @@ void setupEndEffectors(const SkeletonPtr& atlas) r_foot->setRelativeTransform(tf_foot); // Create an interactive frame to use as the target for the right foot - kido::gui::InteractiveFramePtr rf_target(new kido::gui::InteractiveFrame( + kido::gui::osg::InteractiveFramePtr rf_target(new kido::gui::osg::InteractiveFrame( Frame::World(), "rf_target")); // Create the right foot's IK module and set its target @@ -816,7 +816,7 @@ void setupWholeBodySolver(const SkeletonPtr& atlas) // that some work much better for user interaction than others. } -void enableDragAndDrops(kido::gui::Viewer& viewer, const SkeletonPtr& atlas) +void enableDragAndDrops(kido::gui::osg::Viewer& viewer, const SkeletonPtr& atlas) { // Turn on drag-and-drop for the whole Skeleton for(size_t i=0; i < atlas->getNumBodyNodes(); ++i) @@ -829,7 +829,7 @@ void enableDragAndDrops(kido::gui::Viewer& viewer, const SkeletonPtr& atlas) continue; // Check whether the target is an interactive frame, and add it if it is - if(const auto& frame = std::dynamic_pointer_cast( + if(const auto& frame = std::dynamic_pointer_cast( ee->getIK()->getTarget())) viewer.enableDragAndDrop(frame.get()); } @@ -851,9 +851,9 @@ int main() setupWholeBodySolver(atlas); - osg::ref_ptr node = new TeleoperationWorld(world, atlas); + ::osg::ref_ptr node = new TeleoperationWorld(world, atlas); - kido::gui::Viewer viewer; + kido::gui::osg::Viewer viewer; // Prevent this World from simulating viewer.allowSimulation(false); @@ -865,7 +865,7 @@ int main() enableDragAndDrops(viewer, atlas); // Attach a support polygon visualizer - viewer.addAttachment(new kido::gui::SupportPolygonVisual( + viewer.addAttachment(new kido::gui::osg::SupportPolygonVisual( atlas, display_elevation)); // Print out instructions for the viewer @@ -894,9 +894,9 @@ int main() viewer.setUpViewInWindow(0, 0, 1280, 960); // Set up the default viewing position - viewer.getCameraManipulator()->setHomePosition(osg::Vec3( 5.34, 3.00, 2.41), - osg::Vec3( 0.00, 0.00, 1.00), - osg::Vec3(-0.20, -0.08, 0.98)); + viewer.getCameraManipulator()->setHomePosition(::osg::Vec3( 5.34, 3.00, 2.41), + ::osg::Vec3( 0.00, 0.00, 1.00), + ::osg::Vec3(-0.20, -0.08, 0.98)); // Reset the camera manipulator so that it starts in the new viewing position viewer.setCameraManipulator(viewer.getCameraManipulator()); diff --git a/kido/gui/osg/examples/osgDragAndDrop.cpp b/kido/gui/osg/examples/osgDragAndDrop.cpp index 1170fc627e381..00c0f459dc7ab 100644 --- a/kido/gui/osg/examples/osgDragAndDrop.cpp +++ b/kido/gui/osg/examples/osgDragAndDrop.cpp @@ -45,7 +45,7 @@ int main() Eigen::Isometry3d tf(Eigen::Isometry3d::Identity()); tf.translation() = Eigen::Vector3d(4,-4,0); - kido::gui::InteractiveFramePtr frame(new kido::gui::InteractiveFrame( + kido::gui::osg::InteractiveFramePtr frame(new kido::gui::osg::InteractiveFrame( Frame::World(), "interactive frame", tf, 2.0)); world->addSimpleFrame(frame); @@ -80,9 +80,9 @@ int main() world->addSimpleFrame(z_marker); - osg::ref_ptr node = new kido::gui::WorldNode(world); + ::osg::ref_ptr node = new kido::gui::osg::WorldNode(world); - kido::gui::Viewer viewer; + kido::gui::osg::Viewer viewer; viewer.addWorldNode(node); viewer.enableDragAndDrop(frame.get()); viewer.enableDragAndDrop(draggable.get()); @@ -92,9 +92,9 @@ int main() viewer.setUpViewInWindow(0, 0, 640, 480); - viewer.getCameraManipulator()->setHomePosition(osg::Vec3(20.0, 17.0, 17.0), - osg::Vec3(0.0, 0.0, 0.0), - osg::Vec3(0, 0, 1)); + viewer.getCameraManipulator()->setHomePosition(::osg::Vec3(20.0, 17.0, 17.0), + ::osg::Vec3(0.0, 0.0, 0.0), + ::osg::Vec3(0, 0, 1)); viewer.setCameraManipulator(viewer.getCameraManipulator()); viewer.run(); diff --git a/kido/gui/osg/examples/osgHuboPuppet.cpp b/kido/gui/osg/examples/osgHuboPuppet.cpp index 99cb68a53120a..e3f77a5838411 100644 --- a/kido/gui/osg/examples/osgHuboPuppet.cpp +++ b/kido/gui/osg/examples/osgHuboPuppet.cpp @@ -690,7 +690,7 @@ class HuboLegIK : public InverseKinematics::Analytical }; -class TeleoperationWorld : public kido::gui::WorldNode +class TeleoperationWorld : public kido::gui::osg::WorldNode { public: @@ -709,7 +709,7 @@ class TeleoperationWorld : public kido::gui::WorldNode }; TeleoperationWorld(WorldPtr _world, SkeletonPtr _robot) - : kido::gui::WorldNode(_world), + : kido::gui::osg::WorldNode(_world), mHubo(_robot), iter(0), l_foot(_robot->getEndEffector("l_foot")), @@ -831,7 +831,7 @@ class InputHandler : public osgGA::GUIEventHandler { public: - InputHandler(kido::gui::Viewer* viewer, TeleoperationWorld* teleop, + InputHandler(kido::gui::osg::Viewer* viewer, TeleoperationWorld* teleop, const SkeletonPtr& hubo, const WorldPtr& world) : mViewer(viewer), mTeleop(teleop), @@ -1031,7 +1031,7 @@ class InputHandler : public osgGA::GUIEventHandler protected: - kido::gui::Viewer* mViewer; + kido::gui::osg::Viewer* mViewer; TeleoperationWorld* mTeleop; @@ -1148,7 +1148,7 @@ void setupEndEffectors(const SkeletonPtr& hubo) createEndEffector("l_hand"); l_hand->setDefaultRelativeTransform(tf_hand, true); - kido::gui::InteractiveFramePtr lh_target(new kido::gui::InteractiveFrame( + kido::gui::osg::InteractiveFramePtr lh_target(new kido::gui::osg::InteractiveFrame( Frame::World(), "lh_target")); l_hand->getIK(true)->setTarget(lh_target); @@ -1175,7 +1175,7 @@ void setupEndEffectors(const SkeletonPtr& hubo) createEndEffector("r_hand"); r_hand->setDefaultRelativeTransform(tf_hand, true); - kido::gui::InteractiveFramePtr rh_target(new kido::gui::InteractiveFrame( + kido::gui::osg::InteractiveFramePtr rh_target(new kido::gui::osg::InteractiveFrame( Frame::World(), "rh_target")); r_hand->getIK(true)->setTarget(rh_target); @@ -1218,7 +1218,7 @@ void setupEndEffectors(const SkeletonPtr& hubo) createEndEffector("l_foot"); l_foot->setDefaultRelativeTransform(tf_foot, true); - kido::gui::InteractiveFramePtr lf_target(new kido::gui::InteractiveFrame( + kido::gui::osg::InteractiveFramePtr lf_target(new kido::gui::osg::InteractiveFrame( Frame::World(), "lf_target")); l_foot->getIK(true)->setTarget(lf_target); @@ -1241,7 +1241,7 @@ void setupEndEffectors(const SkeletonPtr& hubo) createEndEffector("r_foot"); r_foot->setDefaultRelativeTransform(tf_foot, true); - kido::gui::InteractiveFramePtr rf_target(new kido::gui::InteractiveFrame( + kido::gui::osg::InteractiveFramePtr rf_target(new kido::gui::osg::InteractiveFrame( Frame::World(), "rf_target")); r_foot->getIK(true)->setTarget(rf_target); @@ -1272,7 +1272,7 @@ void setupEndEffectors(const SkeletonPtr& hubo) EndEffector* l_peg = hubo->getBodyNode("Body_LWP")->createEndEffector("l_peg"); l_peg->setDefaultRelativeTransform(tf_peg, true); - kido::gui::InteractiveFramePtr lp_target(new kido::gui::InteractiveFrame( + kido::gui::osg::InteractiveFramePtr lp_target(new kido::gui::osg::InteractiveFrame( Frame::World(), "lp_target")); l_peg->getIK(true)->setTarget(lp_target); @@ -1290,7 +1290,7 @@ void setupEndEffectors(const SkeletonPtr& hubo) EndEffector* r_peg = hubo->getBodyNode("Body_RWP")->createEndEffector("r_peg"); r_peg->setDefaultRelativeTransform(tf_peg, true); - kido::gui::InteractiveFramePtr rp_target(new kido::gui::InteractiveFrame( + kido::gui::osg::InteractiveFramePtr rp_target(new kido::gui::osg::InteractiveFrame( Frame::World(), "rp_target")); r_peg->getIK(true)->setTarget(rp_target); @@ -1312,7 +1312,7 @@ void setupEndEffectors(const SkeletonPtr& hubo) r_foot->getIK()->getTarget()->setTransform(r_foot->getTransform()); } -void enableDragAndDrops(kido::gui::Viewer& viewer, const SkeletonPtr& hubo) +void enableDragAndDrops(kido::gui::osg::Viewer& viewer, const SkeletonPtr& hubo) { // Turn on drag-and-drop for the whole Skeleton for(size_t i=0; i < hubo->getNumBodyNodes(); ++i) @@ -1325,7 +1325,7 @@ void enableDragAndDrops(kido::gui::Viewer& viewer, const SkeletonPtr& hubo) continue; // Check whether the target is an interactive frame, and add it if it is - if(const auto& frame = std::dynamic_pointer_cast( + if(const auto& frame = std::dynamic_pointer_cast( ee->getIK()->getTarget())) viewer.enableDragAndDrop(frame.get()); } @@ -1385,9 +1385,9 @@ int main() setupWholeBodySolver(hubo); - osg::ref_ptr node = new TeleoperationWorld(world, hubo); + ::osg::ref_ptr node = new TeleoperationWorld(world, hubo); - kido::gui::Viewer viewer; + kido::gui::osg::Viewer viewer; viewer.allowSimulation(false); viewer.addWorldNode(node); @@ -1396,7 +1396,7 @@ int main() viewer.addEventHandler(new InputHandler(&viewer, node, hubo, world)); double display_elevation = 0.05; - viewer.addAttachment(new kido::gui::SupportPolygonVisual( + viewer.addAttachment(new kido::gui::osg::SupportPolygonVisual( hubo, display_elevation)); std::cout << viewer.getInstructions() << std::endl; @@ -1420,9 +1420,9 @@ int main() viewer.setUpViewInWindow(0, 0, 1280, 960); // Set up the default viewing position - viewer.getCameraManipulator()->setHomePosition(osg::Vec3( 5.34, 3.00, 1.91), - osg::Vec3( 0.00, 0.00, 0.50), - osg::Vec3(-0.20, -0.08, 0.98)); + viewer.getCameraManipulator()->setHomePosition(::osg::Vec3( 5.34, 3.00, 1.91), + ::osg::Vec3( 0.00, 0.00, 0.50), + ::osg::Vec3(-0.20, -0.08, 0.98)); // Reset the camera manipulator so that it starts in the new viewing position viewer.setCameraManipulator(viewer.getCameraManipulator()); diff --git a/kido/gui/osg/examples/osgOperationalSpaceControl.cpp b/kido/gui/osg/examples/osgOperationalSpaceControl.cpp index 66c5b8a07989e..4c60187b75795 100644 --- a/kido/gui/osg/examples/osgOperationalSpaceControl.cpp +++ b/kido/gui/osg/examples/osgOperationalSpaceControl.cpp @@ -41,12 +41,12 @@ using namespace kido::common; using namespace kido::dynamics; using namespace kido::math; -class OperationalSpaceControlWorld : public kido::gui::WorldNode +class OperationalSpaceControlWorld : public kido::gui::osg::WorldNode { public: OperationalSpaceControlWorld(kido::simulation::WorldPtr _world) - : kido::gui::WorldNode(_world) + : kido::gui::osg::WorldNode(_world) { // Extract the relevant pointers mRobot = mWorld->getSkeleton(0); @@ -109,7 +109,7 @@ class OperationalSpaceControlWorld : public kido::gui::WorldNode mRobot->setForces(mForces); } - kido::gui::DragAndDrop* dnd; + kido::gui::osg::DragAndDrop* dnd; protected: @@ -141,7 +141,7 @@ class ConstraintEventHandler : public osgGA::GUIEventHandler { public: - ConstraintEventHandler(kido::gui::DragAndDrop* dnd = nullptr) + ConstraintEventHandler(kido::gui::osg::DragAndDrop* dnd = nullptr) : mDnD(dnd) { clearConstraints(); @@ -247,7 +247,7 @@ class ConstraintEventHandler : public osgGA::GUIEventHandler bool mConstrained[3]; - kido::sub_ptr mDnD; + kido::sub_ptr mDnD; }; int main() @@ -289,12 +289,12 @@ int main() ground->getJoint(0)->setTransformFromParentBodyNode(ground_tf); // Create an instance of our customized WorldNode - osg::ref_ptr node = + ::osg::ref_ptr node = new OperationalSpaceControlWorld(world); node->setNumStepsPerCycle(10); // Create the Viewer instance - kido::gui::Viewer viewer; + kido::gui::osg::Viewer viewer; viewer.addWorldNode(node); viewer.simulate(true); @@ -307,9 +307,9 @@ int main() // Set up the window to be 640x480 pixels viewer.setUpViewInWindow(0, 0, 640, 480); - viewer.getCameraManipulator()->setHomePosition(osg::Vec3( 2.57, 3.14, 1.64), - osg::Vec3( 0.00, 0.00, 0.00), - osg::Vec3(-0.24, -0.25, 0.94)); + viewer.getCameraManipulator()->setHomePosition(::osg::Vec3( 2.57, 3.14, 1.64), + ::osg::Vec3( 0.00, 0.00, 0.00), + ::osg::Vec3(-0.24, -0.25, 0.94)); // We need to re-dirty the CameraManipulator by passing it into the viewer // again, so that the viewer knows to update its HomePosition setting viewer.setCameraManipulator(viewer.getCameraManipulator()); diff --git a/kido/gui/osg/examples/osgSoftBodies.cpp b/kido/gui/osg/examples/osgSoftBodies.cpp index 208d8b258a101..43ca1176b4788 100644 --- a/kido/gui/osg/examples/osgSoftBodies.cpp +++ b/kido/gui/osg/examples/osgSoftBodies.cpp @@ -46,12 +46,12 @@ int main() kido::simulation::WorldPtr world = kido::utils::SkelParser::readWorld(KIDO_DATA_PATH"skel/softBodies.skel"); - osg::ref_ptr node = new kido::gui::WorldNode(world); + ::osg::ref_ptr node = new kido::gui::osg::WorldNode(world); node->simulate(true); node->setNumStepsPerCycle(15); - kido::gui::Viewer viewer; + kido::gui::osg::Viewer viewer; viewer.addWorldNode(node); std::cout << viewer.getInstructions() << std::endl; diff --git a/kido/gui/osg/render/BoxShapeNode.cpp b/kido/gui/osg/render/BoxShapeNode.cpp index d8ecb057fc4e0..7e68adfa03f7d 100644 --- a/kido/gui/osg/render/BoxShapeNode.cpp +++ b/kido/gui/osg/render/BoxShapeNode.cpp @@ -44,9 +44,10 @@ namespace kido { namespace gui { +namespace osg { namespace render { -class BoxShapeGeode : public ShapeNode, public osg::Geode +class BoxShapeGeode : public ShapeNode, public ::osg::Geode { public: @@ -67,7 +68,7 @@ class BoxShapeGeode : public ShapeNode, public osg::Geode }; //============================================================================== -class BoxShapeDrawable : public osg::ShapeDrawable +class BoxShapeDrawable : public ::osg::ShapeDrawable { public: @@ -138,8 +139,8 @@ BoxShapeGeode::BoxShapeGeode(kido::dynamics::BoxShape* shape, mBoxShape(shape), mDrawable(nullptr) { - getOrCreateStateSet()->setMode(GL_BLEND, osg::StateAttribute::ON); - getOrCreateStateSet()->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); + getOrCreateStateSet()->setMode(GL_BLEND, ::osg::StateAttribute::ON); + getOrCreateStateSet()->setRenderingHint(::osg::StateSet::TRANSPARENT_BIN); extractData(); } @@ -181,16 +182,16 @@ BoxShapeDrawable::BoxShapeDrawable(kido::dynamics::BoxShape* shape) void BoxShapeDrawable::refresh(bool firstTime) { if(mBoxShape->getDataVariance() == kido::dynamics::Shape::STATIC) - setDataVariance(osg::Object::STATIC); + setDataVariance(::osg::Object::STATIC); else - setDataVariance(osg::Object::DYNAMIC); + setDataVariance(::osg::Object::DYNAMIC); if(mBoxShape->checkDataVariance(kido::dynamics::Shape::DYNAMIC_PRIMITIVE) || firstTime) { const Eigen::Vector3d& d = mBoxShape->getSize(); - osg::ref_ptr osg_shape = new osg::Box(osg::Vec3(0,0,0), - d[0], d[1], d[2]); + ::osg::ref_ptr<::osg::Box> osg_shape = new ::osg::Box(::osg::Vec3(0,0,0), + d[0], d[1], d[2]); setShape(osg_shape); dirtyDisplayList(); } @@ -209,5 +210,6 @@ BoxShapeDrawable::~BoxShapeDrawable() } } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/BoxShapeNode.hpp b/kido/gui/osg/render/BoxShapeNode.hpp index f838e931419d1..859ffc159b509 100644 --- a/kido/gui/osg/render/BoxShapeNode.hpp +++ b/kido/gui/osg/render/BoxShapeNode.hpp @@ -48,12 +48,13 @@ class BoxShape; } // namespace dynamics namespace gui { +namespace osg { namespace render { class BoxShapeGeode; class BoxShapeDrawable; -class BoxShapeNode : public ShapeNode, public osg::MatrixTransform +class BoxShapeNode : public ShapeNode, public ::osg::MatrixTransform { public: @@ -73,6 +74,7 @@ class BoxShapeNode : public ShapeNode, public osg::MatrixTransform }; } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/CylinderShapeNode.cpp b/kido/gui/osg/render/CylinderShapeNode.cpp index 0c634c392af9c..759d6684d7ee5 100644 --- a/kido/gui/osg/render/CylinderShapeNode.cpp +++ b/kido/gui/osg/render/CylinderShapeNode.cpp @@ -44,9 +44,10 @@ namespace kido { namespace gui { +namespace osg { namespace render { -class CylinderShapeGeode : public ShapeNode, public osg::Geode +class CylinderShapeGeode : public ShapeNode, public ::osg::Geode { public: @@ -67,7 +68,7 @@ class CylinderShapeGeode : public ShapeNode, public osg::Geode }; //============================================================================== -class CylinderShapeDrawable : public osg::ShapeDrawable +class CylinderShapeDrawable : public ::osg::ShapeDrawable { public: @@ -141,8 +142,8 @@ CylinderShapeGeode::CylinderShapeGeode(kido::dynamics::CylinderShape* shape, mCylinderShape(shape), mDrawable(nullptr) { - getOrCreateStateSet()->setMode(GL_BLEND, osg::StateAttribute::ON); - getOrCreateStateSet()->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); + getOrCreateStateSet()->setMode(GL_BLEND, ::osg::StateAttribute::ON); + getOrCreateStateSet()->setRenderingHint(::osg::StateSet::TRANSPARENT_BIN); extractData(); } @@ -186,17 +187,17 @@ CylinderShapeDrawable::CylinderShapeDrawable( void CylinderShapeDrawable::refresh(bool firstTime) { if(mCylinderShape->getDataVariance() == kido::dynamics::Shape::STATIC) - setDataVariance(osg::Object::STATIC); + setDataVariance(::osg::Object::STATIC); else - setDataVariance(osg::Object::DYNAMIC); + setDataVariance(::osg::Object::DYNAMIC); if(mCylinderShape->checkDataVariance(kido::dynamics::Shape::DYNAMIC_PRIMITIVE) || firstTime) { double R = mCylinderShape->getRadius(); double h = mCylinderShape->getHeight(); - osg::ref_ptr osg_shape = - new osg::Cylinder(osg::Vec3(0,0,0), R, h); + ::osg::ref_ptr<::osg::Cylinder> osg_shape = + new ::osg::Cylinder(::osg::Vec3(0,0,0), R, h); setShape(osg_shape); dirtyDisplayList(); } @@ -215,5 +216,6 @@ CylinderShapeDrawable::~CylinderShapeDrawable() } } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/CylinderShapeNode.hpp b/kido/gui/osg/render/CylinderShapeNode.hpp index a95cb0afbb999..0556800c04d55 100644 --- a/kido/gui/osg/render/CylinderShapeNode.hpp +++ b/kido/gui/osg/render/CylinderShapeNode.hpp @@ -48,12 +48,13 @@ class CylinderShape; } // namespace dynamics namespace gui { +namespace osg { namespace render { class CylinderShapeGeode; class CylinderShapeDrawable; -class CylinderShapeNode : public ShapeNode, public osg::MatrixTransform +class CylinderShapeNode : public ShapeNode, public ::osg::MatrixTransform { public: @@ -73,6 +74,7 @@ class CylinderShapeNode : public ShapeNode, public osg::MatrixTransform }; } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/EllipsoidShapeNode.cpp b/kido/gui/osg/render/EllipsoidShapeNode.cpp index 39008ebe0fcda..66a62035c6c61 100644 --- a/kido/gui/osg/render/EllipsoidShapeNode.cpp +++ b/kido/gui/osg/render/EllipsoidShapeNode.cpp @@ -46,9 +46,10 @@ namespace kido { namespace gui { +namespace osg { namespace render { -class EllipsoidShapeGeode : public ShapeNode, public osg::Geode +class EllipsoidShapeGeode : public ShapeNode, public ::osg::Geode { public: @@ -70,7 +71,7 @@ class EllipsoidShapeGeode : public ShapeNode, public osg::Geode }; //============================================================================== -class EllipsoidShapeDrawable : public osg::ShapeDrawable +class EllipsoidShapeDrawable : public ::osg::ShapeDrawable { public: @@ -158,8 +159,8 @@ EllipsoidShapeGeode::EllipsoidShapeGeode(kido::dynamics::EllipsoidShape* shape, mEllipsoidShape(shape), mDrawable(nullptr) { - getOrCreateStateSet()->setMode(GL_BLEND, osg::StateAttribute::ON); - getOrCreateStateSet()->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); + getOrCreateStateSet()->setMode(GL_BLEND, ::osg::StateAttribute::ON); + getOrCreateStateSet()->setRenderingHint(::osg::StateSet::TRANSPARENT_BIN); extractData(); } @@ -203,15 +204,15 @@ EllipsoidShapeDrawable::EllipsoidShapeDrawable( void EllipsoidShapeDrawable::refresh(bool firstTime) { if(mEllipsoidShape->getDataVariance() == kido::dynamics::Shape::STATIC) - setDataVariance(osg::Object::STATIC); + setDataVariance(::osg::Object::STATIC); else - setDataVariance(osg::Object::DYNAMIC); + setDataVariance(::osg::Object::DYNAMIC); if(mEllipsoidShape->checkDataVariance(kido::dynamics::Shape::DYNAMIC_PRIMITIVE) || firstTime) { - osg::ref_ptr osg_shape = nullptr; - osg_shape = new osg::Sphere(osg::Vec3(0,0,0), + ::osg::ref_ptr<::osg::Sphere> osg_shape = nullptr; + osg_shape = new ::osg::Sphere(::osg::Vec3(0,0,0), 0.5*smallestComponent(mEllipsoidShape->getSize())); setShape(osg_shape); @@ -232,5 +233,6 @@ EllipsoidShapeDrawable::~EllipsoidShapeDrawable() } } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/EllipsoidShapeNode.hpp b/kido/gui/osg/render/EllipsoidShapeNode.hpp index a64c11a635ab6..adbcab4f69e98 100644 --- a/kido/gui/osg/render/EllipsoidShapeNode.hpp +++ b/kido/gui/osg/render/EllipsoidShapeNode.hpp @@ -49,12 +49,13 @@ class EllipsoidShape; } // namespace dynamics namespace gui { +namespace osg { namespace render { class EllipsoidShapeGeode; class EllipsoidShapeDrawable; -class EllipsoidShapeNode : public ShapeNode, public osg::MatrixTransform +class EllipsoidShapeNode : public ShapeNode, public ::osg::MatrixTransform { public: @@ -75,6 +76,7 @@ class EllipsoidShapeNode : public ShapeNode, public osg::MatrixTransform }; } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/LineSegmentShapeNode.cpp b/kido/gui/osg/render/LineSegmentShapeNode.cpp index 82861419e5aa2..ad6d050bab20c 100644 --- a/kido/gui/osg/render/LineSegmentShapeNode.cpp +++ b/kido/gui/osg/render/LineSegmentShapeNode.cpp @@ -45,9 +45,10 @@ namespace kido { namespace gui { +namespace osg { namespace render { -class LineSegmentShapeGeode : public ShapeNode, public osg::Geode +class LineSegmentShapeGeode : public ShapeNode, public ::osg::Geode { public: @@ -64,12 +65,12 @@ class LineSegmentShapeGeode : public ShapeNode, public osg::Geode std::shared_ptr mLineSegmentShape; LineSegmentShapeDrawable* mDrawable; - osg::ref_ptr mLineWidth; + ::osg::ref_ptr<::osg::LineWidth> mLineWidth; }; //============================================================================== -class LineSegmentShapeDrawable : public osg::Geometry +class LineSegmentShapeDrawable : public ::osg::Geometry { public: @@ -83,8 +84,8 @@ class LineSegmentShapeDrawable : public osg::Geometry kido::dynamics::LineSegmentShape* mLineSegmentShape; - osg::ref_ptr mVertices; - osg::ref_ptr mColors; + ::osg::ref_ptr<::osg::Vec3Array> mVertices; + ::osg::ref_ptr<::osg::Vec4Array> mColors; }; //============================================================================== @@ -141,11 +142,11 @@ LineSegmentShapeGeode::LineSegmentShapeGeode( : ShapeNode(shape, parent, this), mLineSegmentShape(shape), mDrawable(nullptr), - mLineWidth(new osg::LineWidth) + mLineWidth(new ::osg::LineWidth) { - getOrCreateStateSet()->setMode(GL_BLEND, osg::StateAttribute::ON); - getOrCreateStateSet()->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); - getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF); + getOrCreateStateSet()->setMode(GL_BLEND, ::osg::StateAttribute::ON); + getOrCreateStateSet()->setRenderingHint(::osg::StateSet::TRANSPARENT_BIN); + getOrCreateStateSet()->setMode(GL_LIGHTING, ::osg::StateAttribute::OFF); extractData(true); } @@ -187,8 +188,8 @@ LineSegmentShapeGeode::~LineSegmentShapeGeode() LineSegmentShapeDrawable::LineSegmentShapeDrawable( kido::dynamics::LineSegmentShape* shape) : mLineSegmentShape(shape), - mVertices(new osg::Vec3Array), - mColors(new osg::Vec4Array) + mVertices(new ::osg::Vec3Array), + mColors(new ::osg::Vec4Array) { refresh(true); } @@ -197,9 +198,9 @@ LineSegmentShapeDrawable::LineSegmentShapeDrawable( void LineSegmentShapeDrawable::refresh(bool firstTime) { if(mLineSegmentShape->getDataVariance() == kido::dynamics::Shape::STATIC) - setDataVariance(osg::Object::STATIC); + setDataVariance(::osg::Object::STATIC); else - setDataVariance(osg::Object::DYNAMIC); + setDataVariance(::osg::Object::DYNAMIC); const std::vector& vertices = mLineSegmentShape->getVertices(); @@ -210,8 +211,8 @@ void LineSegmentShapeDrawable::refresh(bool firstTime) if( mLineSegmentShape->checkDataVariance(kido::dynamics::Shape::DYNAMIC_ELEMENTS) || firstTime) { - osg::ref_ptr elements = - new osg::DrawElementsUInt(GL_LINES); + ::osg::ref_ptr<::osg::DrawElementsUInt> elements = + new ::osg::DrawElementsUInt(GL_LINES); elements->reserve(2*connections.size()); for(size_t i=0; i < connections.size(); ++i) @@ -245,7 +246,7 @@ void LineSegmentShapeDrawable::refresh(bool firstTime) (*mColors)[0] = eigToOsgVec4(mLineSegmentShape->getRGBA()); - setColorArray(mColors, osg::Array::BIND_OVERALL); + setColorArray(mColors, ::osg::Array::BIND_OVERALL); } } @@ -256,5 +257,6 @@ LineSegmentShapeDrawable::~LineSegmentShapeDrawable() } } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/LineSegmentShapeNode.hpp b/kido/gui/osg/render/LineSegmentShapeNode.hpp index 0455a6c26fe02..b8f7e5c4c000b 100644 --- a/kido/gui/osg/render/LineSegmentShapeNode.hpp +++ b/kido/gui/osg/render/LineSegmentShapeNode.hpp @@ -48,12 +48,13 @@ class LineSegmentShape; } // namespace dynamics namespace gui { +namespace osg { namespace render { class LineSegmentShapeGeode; class LineSegmentShapeDrawable; -class LineSegmentShapeNode : public ShapeNode, public osg::MatrixTransform +class LineSegmentShapeNode : public ShapeNode, public ::osg::MatrixTransform { public: @@ -73,6 +74,7 @@ class LineSegmentShapeNode : public ShapeNode, public osg::MatrixTransform }; } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/MeshShapeNode.cpp b/kido/gui/osg/render/MeshShapeNode.cpp index 2aaa4b6ab9694..0af2dea7eeae2 100644 --- a/kido/gui/osg/render/MeshShapeNode.cpp +++ b/kido/gui/osg/render/MeshShapeNode.cpp @@ -49,9 +49,10 @@ namespace kido { namespace gui { +namespace osg { namespace render { -class osgAiNode : public ShapeNode, public osg::MatrixTransform +class osgAiNode : public ShapeNode, public ::osg::MatrixTransform { public: @@ -79,7 +80,7 @@ class osgAiNode : public ShapeNode, public osg::MatrixTransform }; //============================================================================== -class MeshShapeGeode : public ShapeNode, public osg::Geode +class MeshShapeGeode : public ShapeNode, public ::osg::Geode { public: @@ -104,7 +105,7 @@ class MeshShapeGeode : public ShapeNode, public osg::Geode }; //============================================================================== -class MeshShapeGeometry : public ShapeNode, public osg::Geometry +class MeshShapeGeometry : public ShapeNode, public ::osg::Geometry { public: @@ -120,9 +121,9 @@ class MeshShapeGeometry : public ShapeNode, public osg::Geometry virtual ~MeshShapeGeometry(); - osg::ref_ptr mVertices; - osg::ref_ptr mNormals; - osg::ref_ptr mColors; + ::osg::ref_ptr<::osg::Vec3Array> mVertices; + ::osg::ref_ptr<::osg::Vec3Array> mNormals; + ::osg::ref_ptr<::osg::Vec4Array> mColors; kido::dynamics::MeshShape* mMeshShape; const aiMesh* mAiMesh; @@ -182,19 +183,19 @@ void MeshShapeNode::extractData(bool firstTime) for(size_t i=0; imNumMaterials; ++i) { aiMaterial* aiMat = scene->mMaterials[i]; - osg::ref_ptr material = new osg::Material; + ::osg::ref_ptr<::osg::Material> material = new ::osg::Material; aiColor4D c; if(aiGetMaterialColor(aiMat, AI_MATKEY_COLOR_AMBIENT, &c)==AI_SUCCESS) { - material->setAmbient(osg::Material::FRONT_AND_BACK, - osg::Vec4(c.r, c.g, c.b, c.a)); + material->setAmbient(::osg::Material::FRONT_AND_BACK, + ::osg::Vec4(c.r, c.g, c.b, c.a)); } if(aiGetMaterialColor(aiMat, AI_MATKEY_COLOR_DIFFUSE, &c)==AI_SUCCESS) { - material->setDiffuse(osg::Material::FRONT_AND_BACK, - osg::Vec4(c.r, c.g, c.b, c.a)); + material->setDiffuse(::osg::Material::FRONT_AND_BACK, + ::osg::Vec4(c.r, c.g, c.b, c.a)); } if(aiGetMaterialColor(aiMat, AI_MATKEY_COLOR_SPECULAR, &c)==AI_SUCCESS) @@ -202,14 +203,14 @@ void MeshShapeNode::extractData(bool firstTime) // Some files have insane specular vectors like [1.0, 1.0, 1.0, 1.0], so // we weed those out here if(checkSpecularSanity(c)) - material->setSpecular(osg::Material::FRONT_AND_BACK, - osg::Vec4(c.r, c.g, c.b, c.a)); + material->setSpecular(::osg::Material::FRONT_AND_BACK, + ::osg::Vec4(c.r, c.g, c.b, c.a)); } if(aiGetMaterialColor(aiMat, AI_MATKEY_COLOR_EMISSIVE, &c)==AI_SUCCESS) { - material->setEmission(osg::Material::FRONT_AND_BACK, - osg::Vec4(c.r, c.g, c.b, c.a)); + material->setEmission(::osg::Material::FRONT_AND_BACK, + ::osg::Vec4(c.r, c.g, c.b, c.a)); } unsigned int maxValue = 1; @@ -221,11 +222,11 @@ void MeshShapeNode::extractData(bool firstTime) if(aiGetMaterialFloatArray(aiMat, AI_MATKEY_SHININESS_STRENGTH, &strength, &maxValue)==AI_SUCCESS) shininess *= strength; - material->setShininess(osg::Material::FRONT_AND_BACK, shininess); + material->setShininess(::osg::Material::FRONT_AND_BACK, shininess); } else { - material->setShininess(osg::Material::FRONT_AND_BACK, 0.0f); + material->setShininess(::osg::Material::FRONT_AND_BACK, 0.0f); } mMaterials.push_back(material); @@ -264,7 +265,7 @@ void MeshShapeNode::extractData(bool firstTime) } //============================================================================== -osg::Material* MeshShapeNode::getMaterial(size_t index) const +::osg::Material* MeshShapeNode::getMaterial(size_t index) const { if(index < mMaterials.size()) return mMaterials[index]; @@ -320,7 +321,7 @@ void osgAiNode::extractData(bool firstTime) { aiMatrix4x4 M = mAiNode->mTransformation; M.Transpose(); - setMatrix(osg::Matrixf((float*)(&M))); + setMatrix(::osg::Matrixf((float*)(&M))); } for(size_t i=0; imNumChildren; ++i) @@ -385,9 +386,9 @@ MeshShapeGeode::MeshShapeGeode(kido::dynamics::MeshShape* shape, mAiNode(node), mMainNode(parentNode) { - getOrCreateStateSet()->setMode(GL_BLEND, osg::StateAttribute::ON); - getOrCreateStateSet()->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); - getOrCreateStateSet()->setAttributeAndModes(new osg::CullFace(osg::CullFace::BACK)); + getOrCreateStateSet()->setMode(GL_BLEND, ::osg::StateAttribute::ON); + getOrCreateStateSet()->setRenderingHint(::osg::StateSet::TRANSPARENT_BIN); + getOrCreateStateSet()->setAttributeAndModes(new ::osg::CullFace(::osg::CullFace::BACK)); extractData(true); } @@ -466,9 +467,9 @@ MeshShapeGeometry::MeshShapeGeometry(kido::dynamics::MeshShape* shape, MeshShapeGeode* parentGeode, aiMesh* mesh) : ShapeNode(parentNode->getShape(), parentEntity, parentGeode), - mVertices(new osg::Vec3Array), - mNormals(new osg::Vec3Array), - mColors(new osg::Vec4Array), + mVertices(new ::osg::Vec3Array), + mNormals(new ::osg::Vec3Array), + mColors(new ::osg::Vec4Array), mMeshShape(shape), mAiMesh(mesh), mMainNode(parentNode) @@ -491,18 +492,18 @@ void MeshShapeGeometry::refresh() void MeshShapeGeometry::extractData(bool firstTime) { if(mShape->getDataVariance() == kido::dynamics::Shape::STATIC) - setDataVariance(osg::Object::STATIC); + setDataVariance(::osg::Object::STATIC); else - setDataVariance(osg::Object::DYNAMIC); + setDataVariance(::osg::Object::DYNAMIC); if( mShape->checkDataVariance(kido::dynamics::Shape::DYNAMIC_ELEMENTS) || firstTime) { - osg::ref_ptr elements[4]; - elements[0] = new osg::DrawElementsUInt(GL_POINTS); - elements[1] = new osg::DrawElementsUInt(GL_LINES); - elements[2] = new osg::DrawElementsUInt(GL_TRIANGLES); - elements[3] = new osg::DrawElementsUInt(GL_QUADS); + ::osg::ref_ptr<::osg::DrawElementsUInt> elements[4]; + elements[0] = new ::osg::DrawElementsUInt(GL_POINTS); + elements[1] = new ::osg::DrawElementsUInt(GL_LINES); + elements[2] = new ::osg::DrawElementsUInt(GL_TRIANGLES); + elements[3] = new ::osg::DrawElementsUInt(GL_QUADS); for(size_t i=0; imNumFaces; ++i) { @@ -510,15 +511,15 @@ void MeshShapeGeometry::extractData(bool firstTime) if(face.mNumIndices > 4) // We have some arbitrary polygon { - osg::ref_ptr polygon = - new osg::DrawElementsUInt(GL_POLYGON); + ::osg::ref_ptr<::osg::DrawElementsUInt> polygon = + new ::osg::DrawElementsUInt(GL_POLYGON); for(size_t j=0; jpush_back(face.mIndices[j]); addPrimitiveSet(polygon); } else if(face.mNumIndices > 0) { - osg::DrawElementsUInt* elem = elements[face.mNumIndices-1]; + ::osg::DrawElementsUInt* elem = elements[face.mNumIndices-1]; for(size_t j=0; jpush_back(face.mIndices[j]); } @@ -542,12 +543,12 @@ void MeshShapeGeometry::extractData(bool firstTime) for(size_t i=0; imNumVertices; ++i) { const aiVector3D& v = mAiMesh->mVertices[i]; - (*mVertices)[i] = osg::Vec3(v.x, v.y, v.z); + (*mVertices)[i] = ::osg::Vec3(v.x, v.y, v.z); if(mAiMesh->mNormals) { const aiVector3D& n = mAiMesh->mNormals[i]; - (*mNormals)[i] = osg::Vec3(n.x, n.y, n.z); + (*mNormals)[i] = ::osg::Vec3(n.x, n.y, n.z); } // TODO(MXG): Consider computing normals for meshes that don't come with // normal data per vertex @@ -555,7 +556,7 @@ void MeshShapeGeometry::extractData(bool firstTime) setVertexArray(mVertices); if(mAiMesh->mNormals) - setNormalArray(mNormals, osg::Array::BIND_PER_VERTEX); + setNormalArray(mNormals, ::osg::Array::BIND_PER_VERTEX); } if( mShape->checkDataVariance(kido::dynamics::Shape::DYNAMIC_COLOR) @@ -586,11 +587,11 @@ void MeshShapeGeometry::extractData(bool firstTime) for(size_t i=0; imNumVertices; ++i) { const aiColor4D& c = colors[i]; - (*mColors)[i] = osg::Vec4(c.r, c.g, c.b, c.a); + (*mColors)[i] = ::osg::Vec4(c.r, c.g, c.b, c.a); } setColorArray(mColors); - setColorBinding(osg::Geometry::BIND_PER_VERTEX); + setColorBinding(::osg::Geometry::BIND_PER_VERTEX); } } @@ -604,11 +605,11 @@ void MeshShapeGeometry::extractData(bool firstTime) mMainNode->getMaterial(mAiMesh->mMaterialIndex)); } else - getOrCreateStateSet()->removeAttribute(osg::StateAttribute::MATERIAL); + getOrCreateStateSet()->removeAttribute(::osg::StateAttribute::MATERIAL); } else { - getOrCreateStateSet()->removeAttribute(osg::StateAttribute::MATERIAL); + getOrCreateStateSet()->removeAttribute(::osg::StateAttribute::MATERIAL); } const aiVector3D* aiTexCoords = mAiMesh->mTextureCoords[0]; @@ -623,10 +624,10 @@ void MeshShapeGeometry::extractData(bool firstTime) if(mColors->size() != 1) mColors->resize(1); - (*mColors)[0] = osg::Vec4(c[0], c[1], c[2], c[3]); + (*mColors)[0] = ::osg::Vec4(c[0], c[1], c[2], c[3]); setColorArray(mColors); - setColorBinding(osg::Geometry::BIND_OVERALL); + setColorBinding(::osg::Geometry::BIND_OVERALL); } } @@ -642,35 +643,35 @@ void MeshShapeGeometry::extractData(bool firstTime) { case 1: { - osg::ref_ptr texture = - new osg::FloatArray(mAiMesh->mNumVertices); + ::osg::ref_ptr<::osg::FloatArray> texture = + new ::osg::FloatArray(mAiMesh->mNumVertices); for(size_t i=0; imNumVertices; ++i) (*texture)[i] = aiTexCoords[i].x; - setTexCoordArray(unit, texture, osg::Array::BIND_PER_VERTEX); + setTexCoordArray(unit, texture, ::osg::Array::BIND_PER_VERTEX); break; } case 2: { - osg::ref_ptr texture = - new osg::Vec2Array(mAiMesh->mNumVertices); + ::osg::ref_ptr<::osg::Vec2Array> texture = + new ::osg::Vec2Array(mAiMesh->mNumVertices); for(size_t i=0; imNumVertices; ++i) { const aiVector3D& t = aiTexCoords[i]; - (*texture)[i] = osg::Vec2(t.x, t.y); + (*texture)[i] = ::osg::Vec2(t.x, t.y); } - setTexCoordArray(unit, texture, osg::Array::BIND_PER_VERTEX); + setTexCoordArray(unit, texture, ::osg::Array::BIND_PER_VERTEX); break; } case 3: { - osg::ref_ptr texture = - new osg::Vec3Array(mAiMesh->mNumVertices); + ::osg::ref_ptr<::osg::Vec3Array> texture = + new ::osg::Vec3Array(mAiMesh->mNumVertices); for(size_t i=0; imNumVertices; ++i) { const aiVector3D& t = aiTexCoords[i]; - (*texture)[i] = osg::Vec3(t.x, t.y, t.z); + (*texture)[i] = ::osg::Vec3(t.x, t.y, t.z); } - setTexCoordArray(unit, texture, osg::Array::BIND_PER_VERTEX); + setTexCoordArray(unit, texture, ::osg::Array::BIND_PER_VERTEX); break; } } // switch(mAiMesh->mNumUVComponents[unit]) @@ -686,5 +687,6 @@ MeshShapeGeometry::~MeshShapeGeometry() } } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/MeshShapeNode.hpp b/kido/gui/osg/render/MeshShapeNode.hpp index 18c55a70197cf..f6f3fcb10e78c 100644 --- a/kido/gui/osg/render/MeshShapeNode.hpp +++ b/kido/gui/osg/render/MeshShapeNode.hpp @@ -54,13 +54,14 @@ class MeshShape; } // namespace dynamics namespace gui { +namespace osg { namespace render { class osgAiNode; class MeshShapeGeode; class MeshShapeGeometry; -class MeshShapeNode : public ShapeNode, public osg::MatrixTransform +class MeshShapeNode : public ShapeNode, public ::osg::MatrixTransform { public: @@ -70,7 +71,7 @@ class MeshShapeNode : public ShapeNode, public osg::MatrixTransform void refresh(); void extractData(bool firstTime); - osg::Material* getMaterial(size_t index) const; + ::osg::Material* getMaterial(size_t index) const; protected: @@ -78,11 +79,12 @@ class MeshShapeNode : public ShapeNode, public osg::MatrixTransform std::shared_ptr mMeshShape; osgAiNode* mRootAiNode; - std::vector< osg::ref_ptr > mMaterials; + std::vector< ::osg::ref_ptr<::osg::Material> > mMaterials; }; } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/PlaneShapeNode.cpp b/kido/gui/osg/render/PlaneShapeNode.cpp index 4907cc17b838b..0f274c8ee909b 100644 --- a/kido/gui/osg/render/PlaneShapeNode.cpp +++ b/kido/gui/osg/render/PlaneShapeNode.cpp @@ -44,9 +44,10 @@ namespace kido { namespace gui { +namespace osg { namespace render { -class PlaneShapeGeode : public ShapeNode, public osg::Geode +class PlaneShapeGeode : public ShapeNode, public ::osg::Geode { public: @@ -67,7 +68,7 @@ class PlaneShapeGeode : public ShapeNode, public osg::Geode }; //============================================================================== -class PlaneShapeDrawable : public osg::ShapeDrawable +class PlaneShapeDrawable : public ::osg::ShapeDrawable { public: @@ -140,8 +141,8 @@ PlaneShapeGeode::PlaneShapeGeode(kido::dynamics::PlaneShape* shape, mPlaneShape(shape), mDrawable(nullptr) { - getOrCreateStateSet()->setMode(GL_BLEND, osg::StateAttribute::ON); - getOrCreateStateSet()->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); + getOrCreateStateSet()->setMode(GL_BLEND, ::osg::StateAttribute::ON); + getOrCreateStateSet()->setRenderingHint(::osg::StateSet::TRANSPARENT_BIN); extractData(); } @@ -185,18 +186,18 @@ PlaneShapeDrawable::PlaneShapeDrawable(kido::dynamics::PlaneShape* shape, void PlaneShapeDrawable::refresh(bool firstTime) { if(mPlaneShape->getDataVariance() == kido::dynamics::Shape::STATIC) - setDataVariance(osg::Object::STATIC); + setDataVariance(::osg::Object::STATIC); else - setDataVariance(osg::Object::DYNAMIC); + setDataVariance(::osg::Object::DYNAMIC); if(mPlaneShape->checkDataVariance(kido::dynamics::Shape::DYNAMIC_PRIMITIVE) || firstTime) { const Eigen::Vector3d& n = mPlaneShape->getNormal(); const Eigen::Vector3d& p = mPlaneShape->getOffset()*n; - osg::ref_ptr osg_shape = new osg::InfinitePlane; - static_cast(*osg_shape) = - osg::Plane(eigToOsgVec3(n), eigToOsgVec3(p)); + ::osg::ref_ptr<::osg::InfinitePlane> osg_shape = new ::osg::InfinitePlane; + static_cast<::osg::Plane&>(*osg_shape) = + ::osg::Plane(eigToOsgVec3(n), eigToOsgVec3(p)); setShape(osg_shape); dirtyDisplayList(); @@ -216,5 +217,6 @@ PlaneShapeDrawable::~PlaneShapeDrawable() } } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/PlaneShapeNode.hpp b/kido/gui/osg/render/PlaneShapeNode.hpp index d63fe4d0d075f..2d995040197ac 100644 --- a/kido/gui/osg/render/PlaneShapeNode.hpp +++ b/kido/gui/osg/render/PlaneShapeNode.hpp @@ -48,12 +48,13 @@ class PlaneShape; } // namespace dynamics namespace gui { +namespace osg { namespace render { class PlaneShapeGeode; class PlaneShapeDrawable; -class PlaneShapeNode : public ShapeNode, public osg::MatrixTransform +class PlaneShapeNode : public ShapeNode, public ::osg::MatrixTransform { public: @@ -73,6 +74,7 @@ class PlaneShapeNode : public ShapeNode, public osg::MatrixTransform }; } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/ShapeNode.cpp b/kido/gui/osg/render/ShapeNode.cpp index 56e1a9dbf085c..8a4bb7276107f 100644 --- a/kido/gui/osg/render/ShapeNode.cpp +++ b/kido/gui/osg/render/ShapeNode.cpp @@ -39,11 +39,12 @@ namespace kido { namespace gui { +namespace osg { namespace render { ShapeNode::ShapeNode(std::shared_ptr _shape, EntityNode* _parent, - osg::Node* _node) + ::osg::Node* _node) : mShape(_shape), mNode(_node), mParentEntity(_parent), @@ -65,13 +66,13 @@ std::shared_ptr ShapeNode::getShape() const } //============================================================================== -osg::Node* ShapeNode::getNode() +::osg::Node* ShapeNode::getNode() { return mNode; } //============================================================================== -const osg::Node* ShapeNode::getNode() const +const ::osg::Node* ShapeNode::getNode() const { return mNode; } @@ -101,5 +102,6 @@ void ShapeNode::clearUtilization() } } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/ShapeNode.hpp b/kido/gui/osg/render/ShapeNode.hpp index 3f2bcc16d15e9..3124dfb3230ff 100644 --- a/kido/gui/osg/render/ShapeNode.hpp +++ b/kido/gui/osg/render/ShapeNode.hpp @@ -39,9 +39,7 @@ #include -namespace osg { -class Node; -} // namespace osg +#include namespace kido { @@ -50,6 +48,7 @@ class Shape; } // namespace dynamics namespace gui { +namespace osg { class EntityNode; @@ -61,7 +60,7 @@ class ShapeNode ShapeNode(std::shared_ptr _shape, EntityNode* _parent, - osg::Node* _node); + ::osg::Node* _node); virtual ~ShapeNode(); @@ -69,10 +68,10 @@ class ShapeNode std::shared_ptr getShape() const; /// Cast this ShapeNode into an osg::Node - osg::Node* getNode(); + ::osg::Node* getNode(); /// Cast this ShapeNode into an osg::Node - const osg::Node* getNode() const; + const ::osg::Node* getNode() const; /// Pointer to the parent EntityNode of this ShapeNode EntityNode* getParentEntityNode(); @@ -94,7 +93,7 @@ class ShapeNode const std::shared_ptr mShape; /// Should generally be equal to 'this' - osg::Node* const mNode; + ::osg::Node* const mNode; /// Pointer to the parent EntityNode of this ShapeNode EntityNode* mParentEntity; @@ -107,6 +106,7 @@ class ShapeNode }; } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/SoftMeshShapeNode.cpp b/kido/gui/osg/render/SoftMeshShapeNode.cpp index 6b1386eb12060..31fe5f2e82230 100644 --- a/kido/gui/osg/render/SoftMeshShapeNode.cpp +++ b/kido/gui/osg/render/SoftMeshShapeNode.cpp @@ -46,9 +46,10 @@ namespace kido { namespace gui { +namespace osg { namespace render { -class SoftMeshShapeGeode : public ShapeNode, public osg::Geode +class SoftMeshShapeGeode : public ShapeNode, public ::osg::Geode { public: @@ -69,7 +70,7 @@ class SoftMeshShapeGeode : public ShapeNode, public osg::Geode }; //============================================================================== -class SoftMeshShapeDrawable : public osg::Geometry +class SoftMeshShapeDrawable : public ::osg::Geometry { public: @@ -81,9 +82,9 @@ class SoftMeshShapeDrawable : public osg::Geometry virtual ~SoftMeshShapeDrawable(); - osg::ref_ptr mVertices; - osg::ref_ptr mNormals; - osg::ref_ptr mColors; + ::osg::ref_ptr<::osg::Vec3Array> mVertices; + ::osg::ref_ptr<::osg::Vec3Array> mNormals; + ::osg::ref_ptr<::osg::Vec4Array> mColors; std::vector mEigNormals; @@ -148,8 +149,8 @@ SoftMeshShapeGeode::SoftMeshShapeGeode( mSoftMeshShape(shape), mDrawable(nullptr) { - getOrCreateStateSet()->setMode(GL_BLEND, osg::StateAttribute::ON); - getOrCreateStateSet()->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); + getOrCreateStateSet()->setMode(GL_BLEND, ::osg::StateAttribute::ON); + getOrCreateStateSet()->setRenderingHint(::osg::StateSet::TRANSPARENT_BIN); extractData(); } @@ -183,9 +184,9 @@ SoftMeshShapeGeode::~SoftMeshShapeGeode() //============================================================================== SoftMeshShapeDrawable::SoftMeshShapeDrawable( kido::dynamics::SoftMeshShape* shape) - : mVertices(new osg::Vec3Array), - mNormals(new osg::Vec3Array), - mColors(new osg::Vec4Array), + : mVertices(new ::osg::Vec3Array), + mNormals(new ::osg::Vec3Array), + mColors(new ::osg::Vec4Array), mSoftMeshShape(shape) { refresh(true); @@ -230,17 +231,17 @@ static void computeNormals(std::vector& normals, void SoftMeshShapeDrawable::refresh(bool firstTime) { if(mSoftMeshShape->getDataVariance() == kido::dynamics::Shape::STATIC) - setDataVariance(osg::Object::STATIC); + setDataVariance(::osg::Object::STATIC); else - setDataVariance(osg::Object::DYNAMIC); + setDataVariance(::osg::Object::DYNAMIC); const kido::dynamics::SoftBodyNode* bn = mSoftMeshShape->getSoftBodyNode(); if(mSoftMeshShape->checkDataVariance(kido::dynamics::Shape::DYNAMIC_ELEMENTS) || firstTime) { - osg::ref_ptr elements = - new osg::DrawElementsUInt(GL_TRIANGLES); + ::osg::ref_ptr<::osg::DrawElementsUInt> elements = + new ::osg::DrawElementsUInt(GL_TRIANGLES); elements->reserve(3*bn->getNumFaces()); for(size_t i=0; i < bn->getNumFaces(); ++i) @@ -274,7 +275,7 @@ void SoftMeshShapeDrawable::refresh(bool firstTime) } setVertexArray(mVertices); - setNormalArray(mNormals, osg::Array::BIND_PER_VERTEX); + setNormalArray(mNormals, ::osg::Array::BIND_PER_VERTEX); } if( mSoftMeshShape->checkDataVariance(kido::dynamics::Shape::DYNAMIC_COLOR) @@ -285,7 +286,7 @@ void SoftMeshShapeDrawable::refresh(bool firstTime) (*mColors)[0] = eigToOsgVec4(mSoftMeshShape->getRGBA()); - setColorArray(mColors, osg::Array::BIND_OVERALL); + setColorArray(mColors, ::osg::Array::BIND_OVERALL); } } @@ -296,5 +297,6 @@ SoftMeshShapeDrawable::~SoftMeshShapeDrawable() } } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/SoftMeshShapeNode.hpp b/kido/gui/osg/render/SoftMeshShapeNode.hpp index 67ac61482f706..20c5fb07ec579 100644 --- a/kido/gui/osg/render/SoftMeshShapeNode.hpp +++ b/kido/gui/osg/render/SoftMeshShapeNode.hpp @@ -48,12 +48,13 @@ class SoftMeshShape; } // namespace dynamics namespace gui { +namespace osg { namespace render { class SoftMeshShapeGeode; class SoftMeshShapeDrawable; -class SoftMeshShapeNode : public ShapeNode, public osg::MatrixTransform +class SoftMeshShapeNode : public ShapeNode, public ::osg::MatrixTransform { public: @@ -74,6 +75,7 @@ class SoftMeshShapeNode : public ShapeNode, public osg::MatrixTransform }; } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/WarningShapeNode.cpp b/kido/gui/osg/render/WarningShapeNode.cpp index 50deca3222170..1271b2898b40d 100644 --- a/kido/gui/osg/render/WarningShapeNode.cpp +++ b/kido/gui/osg/render/WarningShapeNode.cpp @@ -43,6 +43,7 @@ namespace kido { namespace gui { +namespace osg { namespace render { WarningShapeNode::WarningShapeNode(std::shared_ptr shape, @@ -68,5 +69,6 @@ WarningShapeNode::~WarningShapeNode() } } // namespace render +} // namespace osg } // namespace gui } // namespace kido diff --git a/kido/gui/osg/render/WarningShapeNode.hpp b/kido/gui/osg/render/WarningShapeNode.hpp index c84e763e7424b..f0dc951c2b99e 100644 --- a/kido/gui/osg/render/WarningShapeNode.hpp +++ b/kido/gui/osg/render/WarningShapeNode.hpp @@ -44,9 +44,10 @@ namespace kido { namespace gui { +namespace osg { namespace render { -class WarningShapeNode : public ShapeNode, public osg::Node +class WarningShapeNode : public ShapeNode, public ::osg::Node { public: @@ -62,6 +63,7 @@ class WarningShapeNode : public ShapeNode, public osg::Node }; } // namespace render +} // namespace osg } // namespace gui } // namespace kido From 0476bc74c329076ea5396960edbd286215760c19 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Thu, 21 Jan 2016 00:15:14 -0500 Subject: [PATCH 09/10] Update header guards of for new namespace kido::gui::osg --- kido/gui/osg/DefaultEventHandler.hpp | 6 +++--- kido/gui/osg/DragAndDrop.hpp | 6 +++--- kido/gui/osg/EntityNode.hpp | 6 +++--- kido/gui/osg/FrameNode.hpp | 6 +++--- kido/gui/osg/InteractiveFrame.hpp | 6 +++--- kido/gui/osg/MouseEventHandler.hpp | 6 +++--- kido/gui/osg/SupportPolygonVisual.hpp | 6 +++--- kido/gui/osg/TrackballManipulator.hpp | 6 +++--- kido/gui/osg/Utils.hpp | 6 +++--- kido/gui/osg/Viewer.hpp | 6 +++--- kido/gui/osg/WorldNode.hpp | 6 +++--- kido/gui/osg/render/BoxShapeNode.hpp | 6 +++--- kido/gui/osg/render/CylinderShapeNode.hpp | 6 +++--- kido/gui/osg/render/EllipsoidShapeNode.hpp | 6 +++--- kido/gui/osg/render/LineSegmentShapeNode.hpp | 6 +++--- kido/gui/osg/render/MeshShapeNode.hpp | 6 +++--- kido/gui/osg/render/PlaneShapeNode.hpp | 6 +++--- kido/gui/osg/render/ShapeNode.hpp | 6 +++--- kido/gui/osg/render/SoftMeshShapeNode.hpp | 6 +++--- kido/gui/osg/render/WarningShapeNode.hpp | 6 +++--- 20 files changed, 60 insertions(+), 60 deletions(-) diff --git a/kido/gui/osg/DefaultEventHandler.hpp b/kido/gui/osg/DefaultEventHandler.hpp index 22997b10108db..744a06fbeb22f 100644 --- a/kido/gui/osg/DefaultEventHandler.hpp +++ b/kido/gui/osg/DefaultEventHandler.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_DEFAULTEVENTHANDLER_HPP -#define OSGKIDO_DEFAULTEVENTHANDLER_HPP +#ifndef KIDO_GUI_OSG_DEFAULTEVENTHANDLER_HPP +#define KIDO_GUI_OSG_DEFAULTEVENTHANDLER_HPP #include #include @@ -235,4 +235,4 @@ class DefaultEventHandler : public osgGA::GUIEventHandler, } // namespace gui } // namespace kido -#endif // OSGKIDO_DEFAULTEVENTHANDLER_HPP +#endif // KIDO_GUI_OSG_DEFAULTEVENTHANDLER_HPP diff --git a/kido/gui/osg/DragAndDrop.hpp b/kido/gui/osg/DragAndDrop.hpp index dc432439ac8ab..29c5470562f4d 100644 --- a/kido/gui/osg/DragAndDrop.hpp +++ b/kido/gui/osg/DragAndDrop.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_DRAGANDDROP_HPP -#define OSGKIDO_DRAGANDDROP_HPP +#ifndef KIDO_GUI_OSG_DRAGANDDROP_HPP +#define KIDO_GUI_OSG_DRAGANDDROP_HPP #include @@ -361,4 +361,4 @@ class BodyNodeDnD : public DragAndDrop } // namespace gui } // namespace kido -#endif // OSGKIDO_DRAGANDDROP_HPP +#endif // KIDO_GUI_OSG_DRAGANDDROP_HPP diff --git a/kido/gui/osg/EntityNode.hpp b/kido/gui/osg/EntityNode.hpp index 128e09cae3fa5..4b550571dcf81 100644 --- a/kido/gui/osg/EntityNode.hpp +++ b/kido/gui/osg/EntityNode.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_ENTITYNODE_HPP -#define OSGKIDO_ENTITYNODE_HPP +#ifndef KIDO_GUI_OSG_ENTITYNODE_HPP +#define KIDO_GUI_OSG_ENTITYNODE_HPP #include #include @@ -120,4 +120,4 @@ class EntityNode : public ::osg::Group } // namespace gui } // namespace kido -#endif // OSGKIDO_ENTITYNODE_HPP +#endif // KIDO_GUI_OSG_ENTITYNODE_HPP diff --git a/kido/gui/osg/FrameNode.hpp b/kido/gui/osg/FrameNode.hpp index d9d712d902513..150ebc2e021d5 100644 --- a/kido/gui/osg/FrameNode.hpp +++ b/kido/gui/osg/FrameNode.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_FRAMENODE_HPP -#define OSGKIDO_FRAMENODE_HPP +#ifndef KIDO_GUI_OSG_FRAMENODE_HPP +#define KIDO_GUI_OSG_FRAMENODE_HPP #include #include @@ -126,4 +126,4 @@ class FrameNode : public ::osg::MatrixTransform } // namespace gui } // namespace kido -#endif // OSGKIDO_FRAMENODE_HPP +#endif // KIDO_GUI_OSG_FRAMENODE_HPP diff --git a/kido/gui/osg/InteractiveFrame.hpp b/kido/gui/osg/InteractiveFrame.hpp index 2a2b1a165a901..2321dedcbb60f 100644 --- a/kido/gui/osg/InteractiveFrame.hpp +++ b/kido/gui/osg/InteractiveFrame.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_INTERACTIVEFRAME_HPP -#define OSGKIDO_INTERACTIVEFRAME_HPP +#ifndef KIDO_GUI_OSG_INTERACTIVEFRAME_HPP +#define KIDO_GUI_OSG_INTERACTIVEFRAME_HPP #include "kido/dynamics/SimpleFrame.hpp" @@ -149,4 +149,4 @@ typedef std::shared_ptr InteractiveFramePtr; } // namespace gui } // namespace kido -#endif // OSGKIDO_INTERACTIVEFRAME_HPP +#endif // KIDO_GUI_OSG_INTERACTIVEFRAME_HPP diff --git a/kido/gui/osg/MouseEventHandler.hpp b/kido/gui/osg/MouseEventHandler.hpp index b5d489e134c36..753ad075f9cfc 100644 --- a/kido/gui/osg/MouseEventHandler.hpp +++ b/kido/gui/osg/MouseEventHandler.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_MOUSEEVENTHANDLER_HPP -#define OSGKIDO_MOUSEEVENTHANDLER_HPP +#ifndef KIDO_GUI_OSG_MOUSEEVENTHANDLER_HPP +#define KIDO_GUI_OSG_MOUSEEVENTHANDLER_HPP #include "kido/common/Subject.hpp" #include "kido/common/Observer.hpp" @@ -77,4 +77,4 @@ class MouseEventHandler : public virtual kido::common::Subject, } // namespace gui } // namespace kido -#endif // OSGKIDO_MOUSEEVENTHANDLER_HPP +#endif // KIDO_GUI_OSG_MOUSEEVENTHANDLER_HPP diff --git a/kido/gui/osg/SupportPolygonVisual.hpp b/kido/gui/osg/SupportPolygonVisual.hpp index df8af3f259b89..bc547799ece1d 100644 --- a/kido/gui/osg/SupportPolygonVisual.hpp +++ b/kido/gui/osg/SupportPolygonVisual.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_SUPPORTPOLYGONVISUAL_HPP -#define OSGKIDO_SUPPORTPOLYGONVISUAL_HPP +#ifndef KIDO_GUI_OSG_SUPPORTPOLYGONVISUAL_HPP +#define KIDO_GUI_OSG_SUPPORTPOLYGONVISUAL_HPP #include @@ -202,4 +202,4 @@ class SupportPolygonVisual : public ViewerAttachment } // namespace gui } // namespace kido -#endif // OSGKIDO_SUPPORTPOLYGONVISUAL_HPP +#endif // KIDO_GUI_OSG_SUPPORTPOLYGONVISUAL_HPP diff --git a/kido/gui/osg/TrackballManipulator.hpp b/kido/gui/osg/TrackballManipulator.hpp index de302558e77ba..29fc5fc09f993 100644 --- a/kido/gui/osg/TrackballManipulator.hpp +++ b/kido/gui/osg/TrackballManipulator.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_TRACKBALLMANIPULATOR_HPP -#define OSGKIDO_TRACKBALLMANIPULATOR_HPP +#ifndef KIDO_GUI_OSG_TRACKBALLMANIPULATOR_HPP +#define KIDO_GUI_OSG_TRACKBALLMANIPULATOR_HPP #include @@ -74,4 +74,4 @@ class OSGGA_EXPORT TrackballManipulator : public osgGA::OrbitManipulator } // namespace gui } // namespace kido -#endif // OSGKIDO_TRACKBALLMANIPULATOR_HPP +#endif // KIDO_GUI_OSG_TRACKBALLMANIPULATOR_HPP diff --git a/kido/gui/osg/Utils.hpp b/kido/gui/osg/Utils.hpp index 1d44a9578b59f..dac911fabf49c 100644 --- a/kido/gui/osg/Utils.hpp +++ b/kido/gui/osg/Utils.hpp @@ -35,8 +35,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_UTILS_HPP -#define OSGKIDO_UTILS_HPP +#ifndef KIDO_GUI_OSG_UTILS_HPP +#define KIDO_GUI_OSG_UTILS_HPP #include @@ -90,4 +90,4 @@ inline Eigen::Vector4d osgToEigVec4(const ::osg::Vec4d& vec) return Eigen::Vector4d(vec[0], vec[1], vec[2], vec[3]); } -#endif // OSGKIDO_UTILS_HPP +#endif // KIDO_GUI_OSG_UTILS_HPP diff --git a/kido/gui/osg/Viewer.hpp b/kido/gui/osg/Viewer.hpp index be07ca1901a01..4d3897651d761 100644 --- a/kido/gui/osg/Viewer.hpp +++ b/kido/gui/osg/Viewer.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_VIEWER_HPP -#define OSGKIDO_VIEWER_HPP +#ifndef KIDO_GUI_OSG_VIEWER_HPP +#define KIDO_GUI_OSG_VIEWER_HPP #include #include @@ -382,4 +382,4 @@ class Viewer : public osgViewer::Viewer, public kido::common::Subject } // namespace gui } // namespace kido -#endif // OSGKIDO_VIEWER_HPP +#endif // KIDO_GUI_OSG_VIEWER_HPP diff --git a/kido/gui/osg/WorldNode.hpp b/kido/gui/osg/WorldNode.hpp index 7a7e28867b49f..a880598fabf5e 100644 --- a/kido/gui/osg/WorldNode.hpp +++ b/kido/gui/osg/WorldNode.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_WORLDNODE_HPP -#define OSGKIDO_WORLDNODE_HPP +#ifndef KIDO_GUI_OSG_WORLDNODE_HPP +#define KIDO_GUI_OSG_WORLDNODE_HPP #include #include @@ -196,4 +196,4 @@ class WorldNode : public ::osg::Group } // namespace gui } // namespace kido -#endif // OSGKIDO_WORLDNODE_HPP +#endif // KIDO_GUI_OSG_WORLDNODE_HPP diff --git a/kido/gui/osg/render/BoxShapeNode.hpp b/kido/gui/osg/render/BoxShapeNode.hpp index 859ffc159b509..31af6b55c9026 100644 --- a/kido/gui/osg/render/BoxShapeNode.hpp +++ b/kido/gui/osg/render/BoxShapeNode.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_RENDER_BOXSHAPENODE_HPP -#define OSGKIDO_RENDER_BOXSHAPENODE_HPP +#ifndef KIDO_GUI_OSG_RENDER_RENDER_BOXSHAPENODE_HPP +#define KIDO_GUI_OSG_RENDER_RENDER_BOXSHAPENODE_HPP #include @@ -78,4 +78,4 @@ class BoxShapeNode : public ShapeNode, public ::osg::MatrixTransform } // namespace gui } // namespace kido -#endif // OSGKIDO_RENDER_BOXSHAPENODE_HPP +#endif // KIDO_GUI_OSG_RENDER_BOXSHAPENODE_HPP diff --git a/kido/gui/osg/render/CylinderShapeNode.hpp b/kido/gui/osg/render/CylinderShapeNode.hpp index 0556800c04d55..894fd0745310f 100644 --- a/kido/gui/osg/render/CylinderShapeNode.hpp +++ b/kido/gui/osg/render/CylinderShapeNode.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_RENDER_CYLINDERSHAPENODE_HPP -#define OSGKIDO_RENDER_CYLINDERSHAPENODE_HPP +#ifndef KIDO_GUI_OSG_RENDER_RENDER_CYLINDERSHAPENODE_HPP +#define KIDO_GUI_OSG_RENDER_RENDER_CYLINDERSHAPENODE_HPP #include @@ -78,4 +78,4 @@ class CylinderShapeNode : public ShapeNode, public ::osg::MatrixTransform } // namespace gui } // namespace kido -#endif // OSGKIDO_RENDER_CYLINDERSHAPENODE_HPP +#endif // KIDO_GUI_OSG_RENDER_CYLINDERSHAPENODE_HPP diff --git a/kido/gui/osg/render/EllipsoidShapeNode.hpp b/kido/gui/osg/render/EllipsoidShapeNode.hpp index adbcab4f69e98..abab6fc8a6629 100644 --- a/kido/gui/osg/render/EllipsoidShapeNode.hpp +++ b/kido/gui/osg/render/EllipsoidShapeNode.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_RENDER_ELLIPSOIDSHAPENODE_HPP -#define OSGKIDO_RENDER_ELLIPSOIDSHAPENODE_HPP +#ifndef KIDO_GUI_OSG_RENDER_RENDER_ELLIPSOIDSHAPENODE_HPP +#define KIDO_GUI_OSG_RENDER_RENDER_ELLIPSOIDSHAPENODE_HPP #include #include @@ -80,4 +80,4 @@ class EllipsoidShapeNode : public ShapeNode, public ::osg::MatrixTransform } // namespace gui } // namespace kido -#endif // OSGKIDO_RENDER_ELLIPSOIDSHAPENODE_HPP +#endif // KIDO_GUI_OSG_RENDER_ELLIPSOIDSHAPENODE_HPP diff --git a/kido/gui/osg/render/LineSegmentShapeNode.hpp b/kido/gui/osg/render/LineSegmentShapeNode.hpp index b8f7e5c4c000b..20c7b0ea6a969 100644 --- a/kido/gui/osg/render/LineSegmentShapeNode.hpp +++ b/kido/gui/osg/render/LineSegmentShapeNode.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_RENDER_LINESEGMENTSHAPENODE_HPP -#define OSGKIDO_RENDER_LINESEGMENTSHAPENODE_HPP +#ifndef KIDO_GUI_OSG_RENDER_RENDER_LINESEGMENTSHAPENODE_HPP +#define KIDO_GUI_OSG_RENDER_RENDER_LINESEGMENTSHAPENODE_HPP #include @@ -78,4 +78,4 @@ class LineSegmentShapeNode : public ShapeNode, public ::osg::MatrixTransform } // namespace gui } // namespace kido -#endif // OSGKIDO_RENDER_LINESEGMENTSHAPENODE_HPP +#endif // KIDO_GUI_OSG_RENDER_LINESEGMENTSHAPENODE_HPP diff --git a/kido/gui/osg/render/MeshShapeNode.hpp b/kido/gui/osg/render/MeshShapeNode.hpp index f6f3fcb10e78c..a75d5bad24115 100644 --- a/kido/gui/osg/render/MeshShapeNode.hpp +++ b/kido/gui/osg/render/MeshShapeNode.hpp @@ -35,8 +35,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_RENDER_MESHSHAPENODE_HPP -#define OSGKIDO_RENDER_MESHSHAPENODE_HPP +#ifndef KIDO_GUI_OSG_RENDER_RENDER_MESHSHAPENODE_HPP +#define KIDO_GUI_OSG_RENDER_RENDER_MESHSHAPENODE_HPP #include @@ -88,4 +88,4 @@ class MeshShapeNode : public ShapeNode, public ::osg::MatrixTransform } // namespace gui } // namespace kido -#endif // OSGKIDO_RENDER_MESHSHAPENODE_HPP +#endif // KIDO_GUI_OSG_RENDER_MESHSHAPENODE_HPP diff --git a/kido/gui/osg/render/PlaneShapeNode.hpp b/kido/gui/osg/render/PlaneShapeNode.hpp index 2d995040197ac..c89bab2988c40 100644 --- a/kido/gui/osg/render/PlaneShapeNode.hpp +++ b/kido/gui/osg/render/PlaneShapeNode.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_RENDER_PLANESHAPENODE_HPP -#define OSGKIDO_RENDER_PLANESHAPENODE_HPP +#ifndef KIDO_GUI_OSG_RENDER_RENDER_PLANESHAPENODE_HPP +#define KIDO_GUI_OSG_RENDER_RENDER_PLANESHAPENODE_HPP #include @@ -78,4 +78,4 @@ class PlaneShapeNode : public ShapeNode, public ::osg::MatrixTransform } // namespace gui } // namespace kido -#endif // OSGKIDO_RENDER_PLANESHAPENODE_HPP +#endif // KIDO_GUI_OSG_RENDER_PLANESHAPENODE_HPP diff --git a/kido/gui/osg/render/ShapeNode.hpp b/kido/gui/osg/render/ShapeNode.hpp index 3124dfb3230ff..99b348f751c51 100644 --- a/kido/gui/osg/render/ShapeNode.hpp +++ b/kido/gui/osg/render/ShapeNode.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_RENDER_SHAPEGEODE_HPP -#define OSGKIDO_RENDER_SHAPEGEODE_HPP +#ifndef KIDO_GUI_OSG_RENDER_RENDER_SHAPEGEODE_HPP +#define KIDO_GUI_OSG_RENDER_RENDER_SHAPEGEODE_HPP #include @@ -110,4 +110,4 @@ class ShapeNode } // namespace gui } // namespace kido -#endif // OSGKIDO_RENDER_SHAPEGEODE_HPP +#endif // KIDO_GUI_OSG_RENDER_SHAPEGEODE_HPP diff --git a/kido/gui/osg/render/SoftMeshShapeNode.hpp b/kido/gui/osg/render/SoftMeshShapeNode.hpp index 20c5fb07ec579..031daaaa26f6c 100644 --- a/kido/gui/osg/render/SoftMeshShapeNode.hpp +++ b/kido/gui/osg/render/SoftMeshShapeNode.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_RENDER_SOFTMESHSHAPENODE_H -#define OSGKIDO_RENDER_SOFTMESHSHAPENODE_H +#ifndef KIDO_GUI_OSG_RENDER_RENDER_SOFTMESHSHAPENODE_H +#define KIDO_GUI_OSG_RENDER_RENDER_SOFTMESHSHAPENODE_H #include @@ -79,4 +79,4 @@ class SoftMeshShapeNode : public ShapeNode, public ::osg::MatrixTransform } // namespace gui } // namespace kido -#endif // OSGKIDO_RENDER_SOFTMESHSHAPENODE_HPP +#endif // KIDO_GUI_OSG_RENDER_SOFTMESHSHAPENODE_HPP diff --git a/kido/gui/osg/render/WarningShapeNode.hpp b/kido/gui/osg/render/WarningShapeNode.hpp index f0dc951c2b99e..df3dfd1582bf9 100644 --- a/kido/gui/osg/render/WarningShapeNode.hpp +++ b/kido/gui/osg/render/WarningShapeNode.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef OSGKIDO_RENDER_WARNINGSHAPENODE_H -#define OSGKIDO_RENDER_WARNINGSHAPENODE_H +#ifndef KIDO_GUI_OSG_RENDER_RENDER_WARNINGSHAPENODE_H +#define KIDO_GUI_OSG_RENDER_RENDER_WARNINGSHAPENODE_H #include #include @@ -67,4 +67,4 @@ class WarningShapeNode : public ShapeNode, public ::osg::Node } // namespace gui } // namespace kido -#endif // OSGKIDO_RENDER_WARNINGSHAPENODE_HPP +#endif // KIDO_GUI_OSG_RENDER_WARNINGSHAPENODE_HPP From 69ea914aa843eeb548cff2a974524dad7b535dd6 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Thu, 21 Jan 2016 00:19:54 -0500 Subject: [PATCH 10/10] Fix header guards style in gui::osg::render --- kido/gui/osg/render/SoftMeshShapeNode.hpp | 4 ++-- kido/gui/osg/render/WarningShapeNode.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kido/gui/osg/render/SoftMeshShapeNode.hpp b/kido/gui/osg/render/SoftMeshShapeNode.hpp index 031daaaa26f6c..e09ca1348b1d8 100644 --- a/kido/gui/osg/render/SoftMeshShapeNode.hpp +++ b/kido/gui/osg/render/SoftMeshShapeNode.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef KIDO_GUI_OSG_RENDER_RENDER_SOFTMESHSHAPENODE_H -#define KIDO_GUI_OSG_RENDER_RENDER_SOFTMESHSHAPENODE_H +#ifndef KIDO_GUI_OSG_RENDER_RENDER_SOFTMESHSHAPENODE_HPP +#define KIDO_GUI_OSG_RENDER_RENDER_SOFTMESHSHAPENODE_HPP #include diff --git a/kido/gui/osg/render/WarningShapeNode.hpp b/kido/gui/osg/render/WarningShapeNode.hpp index df3dfd1582bf9..114ef62994e53 100644 --- a/kido/gui/osg/render/WarningShapeNode.hpp +++ b/kido/gui/osg/render/WarningShapeNode.hpp @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef KIDO_GUI_OSG_RENDER_RENDER_WARNINGSHAPENODE_H -#define KIDO_GUI_OSG_RENDER_RENDER_WARNINGSHAPENODE_H +#ifndef KIDO_GUI_OSG_RENDER_RENDER_WARNINGSHAPENODE_HPP +#define KIDO_GUI_OSG_RENDER_RENDER_WARNINGSHAPENODE_HPP #include #include