Skip to content

Commit de21d44

Browse files
authored
Unify GUI naming by removing osg suffix (#2257)
1 parent 7160371 commit de21d44

File tree

188 files changed

+1149
-1272
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+1149
-1272
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ else()
205205
dart_option(BUILD_SHARED_LIBS "Build shared libraries" ON CATEGORY build)
206206
endif()
207207
dart_option(DART_BUILD_DARTPY "Build dartpy" OFF CATEGORY build)
208-
dart_option(DART_BUILD_GUI "Build osgDart library" ON CATEGORY build)
208+
dart_option(DART_BUILD_GUI "Build GUI library" ON CATEGORY build)
209209
dart_option(DART_BUILD_COLLISION_BULLET "Embed the Bullet collision backend into the core dart target" OFF CATEGORY build)
210210
dart_option(DART_BUILD_COLLISION_ODE "Embed the ODE collision backend into the core dart target" OFF CATEGORY build)
211211
dart_option(DART_BUILD_EXAMPLES "Build example targets" ON CATEGORY build)
@@ -555,7 +555,7 @@ if(DART_VERBOSE)
555555
message(STATUS "Compiler version : ${CMAKE_CXX_COMPILER_VERSION}")
556556
message(STATUS "Build type : ${CMAKE_BUILD_TYPE}")
557557
message(STATUS "BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
558-
message(STATUS "Build gui (OSG) : ${DART_BUILD_GUI}")
558+
message(STATUS "Build gui : ${DART_BUILD_GUI}")
559559
message(STATUS "Install path : ${CMAKE_INSTALL_PREFIX}")
560560
message(STATUS "CXX_FLAGS : ${CMAKE_CXX_FLAGS}")
561561
if(CMAKE_BUILD_TYPE_UPPERCASE STREQUAL "RELEASE")

dart/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${DART_BINARY_DIR}/lib")
3737
# gui, [assimp, eigen3, fcl, fmt]
3838
# dart-utils - {dart}, utils, utils/sdf, [tinyxml2]
3939
# dart-utils-urdf - {dart-utils}, utils/urdf, [urdfdom]
40-
# dart-gui - {dart-utils}, gui/osg, gui/osg/render, [openscenegraph]
40+
# dart-gui - {dart-utils}, gui, gui/render, [openscenegraph]
4141

4242
#===============================================================================
4343
# Components - (dependency component), {dependency targets}

dart/dynamics/EulerJoint.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class DART_API EulerJoint : public detail::EulerJointBase
9090
/// Set the axis order
9191
/// @param[in] _order Axis order
9292
/// @param[in] _renameDofs If true, the names of dofs in this joint will be
93-
/// renmaed according to the axis order.
93+
/// renamed according to the axis order.
9494
void setAxisOrder(AxisOrder _order, bool _renameDofs = true);
9595

9696
/// Return the axis order

dart/dynamics/PlanarJoint.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,25 +100,25 @@ class DART_API PlanarJoint : public detail::PlanarJointBase
100100

101101
/// @brief Set plane type as XY-plane
102102
/// @param[in] _renameDofs If true, the names of dofs in this joint will be
103-
/// renmaed according to the plane type.
103+
/// renamed according to the plane type.
104104
void setXYPlane(bool _renameDofs = true);
105105

106106
/// @brief Set plane type as YZ-plane
107107
/// @param[in] _renameDofs If true, the names of dofs in this joint will be
108-
/// renmaed according to the plane type.
108+
/// renamed according to the plane type.
109109
void setYZPlane(bool _renameDofs = true);
110110

111111
/// @brief Set plane type as ZX-plane
112112
/// @param[in] _renameDofs If true, the names of dofs in this joint will be
113-
/// renmaed according to the plane type.
113+
/// renamed according to the plane type.
114114
void setZXPlane(bool _renameDofs = true);
115115

116116
/// @brief Set plane type as arbitrary plane with two orthogonal translational
117117
/// axes
118118
/// @param[in] _transAxis1 An orthogonal translational axis
119119
/// @param[in] _transAxis2 Another orthogonal translation axis
120120
/// @param[in] _renameDofs If true, the names of dofs in this joint will be
121-
/// renmaed according to the plane type.
121+
/// renamed according to the plane type.
122122
void setArbitraryPlane(
123123
const Eigen::Vector3d& _transAxis1,
124124
const Eigen::Vector3d& _transAxis2,

dart/dynamics/TranslationalJoint2D.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,24 +94,24 @@ class DART_API TranslationalJoint2D : public detail::TranslationalJoint2DBase
9494

9595
/// Sets plane type as XY-plane
9696
/// @param[in] renameDofs If true, the names of dofs in this joint will be
97-
/// renmaed according to the plane type.
97+
/// renamed according to the plane type.
9898
void setXYPlane(bool renameDofs = true);
9999

100100
/// Sets plane type as YZ-plane
101101
/// @param[in] renameDofs If true, the names of dofs in this joint will be
102-
/// renmaed according to the plane type.
102+
/// renamed according to the plane type.
103103
void setYZPlane(bool renameDofs = true);
104104

105105
/// Sets plane type as ZX-plane
106106
/// @param[in] renameDofs If true, the names of dofs in this joint will be
107-
/// renmaed according to the plane type.
107+
/// renamed according to the plane type.
108108
void setZXPlane(bool renameDofs = true);
109109

110110
/// Sets plane type as arbitrary plane with two orthogonal translational axes
111111
/// @param[in] transAxis1 First translational axis
112112
/// @param[in] transAxis2 Second translational axis
113113
/// @param[in] renameDofs If true, the names of dofs in this joint will be
114-
/// renmaed according to the plane type.
114+
/// renamed according to the plane type.
115115
void setArbitraryPlane(
116116
const Eigen::Vector3d& transAxis1,
117117
const Eigen::Vector3d& transAxis2,

dart/gui/CMakeLists.txt

Lines changed: 101 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,102 @@
1-
# Note: The dart-gui component is backed entirely by OpenSceneGraph (OSG).
2-
# OSG is currently the only GUI backend and lives under dart/gui/osg.
1+
if(NOT DART_BUILD_GUI)
2+
message(STATUS "Skipping GUI (DART_BUILD_GUI == ${DART_BUILD_GUI})")
3+
return()
4+
endif()
35

4-
# Add subdirectories
5-
add_subdirectory(osg)
6+
# Set local target/component names
7+
set(target_name ${PROJECT_NAME}-gui)
8+
set(component_name gui)
9+
set(component_dependencies )
10+
set(component_dependency_packages )
11+
set(link_libraries )
12+
13+
# Dependency checks
14+
dart_check_dependent_target(${target_name} dart-utils)
15+
16+
# OpenSceneGraph
17+
dart_find_package(OpenSceneGraph)
18+
dart_check_required_package(OpenSceneGraph "dart-gui" "OpenSceneGraph")
19+
list(APPEND component_dependency_packages OpenSceneGraph)
20+
21+
# ImGui
22+
if(DART_USE_SYSTEM_IMGUI)
23+
list(APPEND component_dependency_packages imgui)
24+
list(APPEND link_libraries imgui::imgui)
25+
else()
26+
list(APPEND component_dependencies imgui)
27+
list(APPEND link_libraries dart-imgui-lib)
28+
endif()
29+
30+
# Search all header and source files
31+
file(GLOB hdrs "*.hpp")
32+
file(GLOB srcs "*.cpp")
33+
file(GLOB detail_hdrs "detail/*.hpp")
34+
file(GLOB detail_srcs "detail/*.cpp")
35+
36+
set(dart_gui_hdrs ${hdrs} ${detail_hdrs})
37+
set(dart_gui_srcs ${srcs} ${detail_srcs})
38+
39+
add_subdirectory(render)
40+
41+
file(GLOB render_hdrs "render/*.hpp")
42+
43+
# Add target
44+
dart_add_library(${target_name} ${dart_gui_hdrs} ${dart_gui_srcs})
45+
target_link_libraries(${target_name} dart-utils osg::osg ${link_libraries})
46+
47+
if(MSVC AND BUILD_SHARED_LIBS)
48+
if(CMAKE_CONFIGURATION_TYPES)
49+
foreach(_cfg ${CMAKE_CONFIGURATION_TYPES})
50+
string(TOUPPER "${_cfg}" _cfg_upper)
51+
set_target_properties(
52+
${target_name}
53+
PROPERTIES
54+
ARCHIVE_OUTPUT_DIRECTORY_${_cfg_upper}
55+
"${DART_BINARY_DIR}/lib/${_cfg}"
56+
)
57+
endforeach()
58+
else()
59+
set_target_properties(
60+
${target_name}
61+
PROPERTIES
62+
ARCHIVE_OUTPUT_DIRECTORY "${DART_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE}"
63+
)
64+
endif()
65+
endif()
66+
67+
# Component
68+
add_component(${PROJECT_NAME} ${component_name})
69+
add_component_targets(${PROJECT_NAME} ${component_name} ${target_name})
70+
add_component_dependencies(${PROJECT_NAME} ${component_name} utils ${component_dependencies})
71+
add_component_dependency_packages(${PROJECT_NAME} ${component_name} ${component_dependency_packages})
72+
73+
# Generate header for this namespace
74+
dart_get_filename_components(header_names "gui headers" ${hdrs})
75+
list(APPEND header_names "render/All.hpp")
76+
dart_generate_component_headers(
77+
COMPONENT_NAME gui
78+
TARGET_DIR "dart/gui/"
79+
OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}"
80+
HEADERS ${header_names}
81+
SOURCE_HEADERS ${hdrs} ${detail_hdrs} ${render_hdrs}
82+
)
83+
84+
# Install (includes All.hpp, gui.hpp for component compatibility,
85+
# and generated PascalCase headers for case compatibility)
86+
install(
87+
FILES ${hdrs} ${CMAKE_CURRENT_BINARY_DIR}/All.hpp ${CMAKE_CURRENT_BINARY_DIR}/gui.hpp
88+
DESTINATION include/dart/gui
89+
COMPONENT headers
90+
)
91+
install(
92+
FILES ${detail_hdrs}
93+
DESTINATION include/dart/gui/detail
94+
COMPONENT headers
95+
)
96+
# Install generated compatibility headers preserving subdirectory structure
97+
dart_install_compat_headers(
98+
COMPAT_HEADERS ${DART_GENERATED_COMPAT_HEADERS}
99+
DESTINATION_PREFIX include/dart/gui
100+
)
101+
102+
dart_format_add(${hdrs} ${srcs} ${dart_gui_hdrs} ${dart_gui_srcs})

dart/gui/osg/CameraMode.hpp renamed to dart/gui/CameraMode.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
* POSSIBILITY OF SUCH DAMAGE.
3131
*/
3232

33-
#ifndef DART_GUI_OSG_CAMERAMODE_HPP_
34-
#define DART_GUI_OSG_CAMERAMODE_HPP_
33+
#ifndef DART_GUI_CAMERAMODE_HPP_
34+
#define DART_GUI_CAMERAMODE_HPP_
3535

36-
#include <dart/gui/osg/Export.hpp>
36+
#include <dart/gui/Export.hpp>
3737

3838
#include <string>
3939

40-
namespace dart::gui::osg {
40+
namespace dart::gui {
4141

4242
/// Camera mode
4343
enum class CameraMode
@@ -53,6 +53,6 @@ enum class CameraMode
5353

5454
DART_GUI_API std::string toString(CameraMode mode);
5555

56-
} // namespace dart::gui::osg
56+
} // namespace dart::gui
5757

58-
#endif // DART_GUI_OSG_CAMERAMODE_HPP_
58+
#endif // DART_GUI_CAMERAMODE_HPP_

dart/gui/osg/DefaultEventHandler.cpp renamed to dart/gui/DefaultEventHandler.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,22 @@
3030
* POSSIBILITY OF SUCH DAMAGE.
3131
*/
3232

33-
#include "dart/gui/osg/DefaultEventHandler.hpp"
33+
#include "dart/gui/DefaultEventHandler.hpp"
3434

3535
#include "dart/dynamics/Entity.hpp"
3636
#include "dart/dynamics/ShapeFrame.hpp"
37-
#include "dart/gui/osg/MouseEventHandler.hpp"
38-
#include "dart/gui/osg/ShapeFrameNode.hpp"
39-
#include "dart/gui/osg/Utils.hpp"
40-
#include "dart/gui/osg/Viewer.hpp"
41-
#include "dart/gui/osg/render/ShapeNode.hpp"
37+
#include "dart/gui/MouseEventHandler.hpp"
38+
#include "dart/gui/ShapeFrameNode.hpp"
39+
#include "dart/gui/Utils.hpp"
40+
#include "dart/gui/Viewer.hpp"
41+
#include "dart/gui/render/ShapeNode.hpp"
4242

4343
#include <osgGA/GUIEventAdapter>
4444

4545
#include <iostream>
4646

4747
namespace dart {
4848
namespace gui {
49-
namespace osg {
5049

5150
DefaultEventHandler::DefaultEventHandler(Viewer* _viewer)
5251
: mViewer(_viewer),
@@ -422,6 +421,5 @@ void DefaultEventHandler::handleDestructionNotification(
422421
mMouseEventHandlers.erase(it);
423422
}
424423

425-
} // namespace osg
426424
} // namespace gui
427425
} // namespace dart

dart/gui/osg/DefaultEventHandler.hpp renamed to dart/gui/DefaultEventHandler.hpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
* POSSIBILITY OF SUCH DAMAGE.
3131
*/
3232

33-
#ifndef DART_GUI_OSG_DEFAULTEVENTHANDLER_HPP_
34-
#define DART_GUI_OSG_DEFAULTEVENTHANDLER_HPP_
33+
#ifndef DART_GUI_DEFAULTEVENTHANDLER_HPP_
34+
#define DART_GUI_DEFAULTEVENTHANDLER_HPP_
3535

36-
#include <dart/gui/osg/Export.hpp>
36+
#include <dart/gui/Export.hpp>
3737

3838
#include <dart/common/ClassWithVirtualBase.hpp>
3939
#include <dart/common/Observer.hpp>
@@ -55,7 +55,6 @@ class Entity;
5555
} // namespace dynamics
5656

5757
namespace gui {
58-
namespace osg {
5958

6059
struct PickInfo
6160
{
@@ -199,7 +198,7 @@ class DART_GUI_API DefaultEventHandler : public ::osgGA::GUIEventHandler,
199198
void handleDestructionNotification(
200199
const dart::common::Subject* _subject) override;
201200

202-
/// dart::gui::osg::Viewer that this event handler is tied to
201+
/// dart::gui::Viewer that this event handler is tied to
203202
Viewer* mViewer;
204203

205204
/// Set of MouseEventHandlers that are tied to this DefaultEventHandler
@@ -232,8 +231,7 @@ class DART_GUI_API DefaultEventHandler : public ::osgGA::GUIEventHandler,
232231
};
233232
DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
234233

235-
} // namespace osg
236234
} // namespace gui
237235
} // namespace dart
238236

239-
#endif // DART_GUI_OSG_DEFAULTEVENTHANDLER_HPP_
237+
#endif // DART_GUI_DEFAULTEVENTHANDLER_HPP_

0 commit comments

Comments
 (0)