Skip to content

Commit 7df33a8

Browse files
committed
[SofaGui] Update GUI related modules
1 parent 33070ab commit 7df33a8

4 files changed

Lines changed: 23 additions & 24 deletions

File tree

bindings/SofaGui/Bindings.SofaGuiConfig.cmake.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ find_package(SofaPython3 QUIET REQUIRED COMPONENTS Plugin Bindings.Sofa)
77

88
find_package(Sofa.GL QUIET REQUIRED)
99
find_package(Sofa.Core QUIET REQUIRED)
10-
find_package(SofaGuiCommon QUIET REQUIRED)
1110
find_package(SofaGui QUIET REQUIRED)
1211

1312
# If we are importing this config file and the target is not yet there this is indicating that

bindings/SofaGui/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ SP3_add_python_module(
2121
DESTINATION Sofa
2222
SOURCES ${SOURCE_FILES}
2323
HEADERS ${HEADER_FILES}
24-
DEPENDS Sofa.Core SofaGuiCommon SofaGui SofaPython3::Plugin SofaPython3::Bindings.Sofa.Core
24+
DEPENDS Sofa.Core SofaGui SofaPython3::Plugin SofaPython3::Bindings.Sofa.Core
2525
)
2626

2727
sofa_create_component_in_package_with_targets(

bindings/SofaGui/src/SofaPython3/SofaGui/Binding_BaseGui.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@
2020

2121
#include "Binding_BaseGui.h"
2222

23-
#include <sofa/gui/BaseGUI.h>
23+
#include <sofa/gui/common/BaseGUI.h>
2424

2525
namespace py = pybind11;
2626

2727
namespace sofapython3 {
28-
using sofa::gui::BaseGUI;
28+
using sofa::gui::common::BaseGUI;
2929
using sofa::simulation::Node;
3030

3131
void moduleAddBaseGui(py::module& m)
3232
{
33-
py::class_<sofa::gui::BaseGUI, std::unique_ptr<sofa::gui::BaseGUI, py::nodelete>> baseGUI(m, "BaseGUI");
33+
py::class_<sofa::gui::common::BaseGUI, std::unique_ptr<sofa::gui::common::BaseGUI, py::nodelete>> baseGUI(m, "BaseGUI");
3434

3535
/*
3636
* Sofa.Gui.BaseGUI.SetBackgroundImage
@@ -41,8 +41,8 @@ void moduleAddBaseGui(py::module& m)
4141
:param filename: Path to the image which will become the background of the viewer.
4242
:type filename: str
4343
)doc";
44-
baseGUI.def("setBackgroundImage", &sofa::gui::BaseGUI::setBackgroundImage, SetBackgroundImageDoc);
44+
baseGUI.def("setBackgroundImage", &sofa::gui::common::BaseGUI::setBackgroundImage, SetBackgroundImageDoc);
4545

4646
}
4747

48-
} // namespace sofapython3
48+
} // namespace sofapython3

bindings/SofaGui/src/SofaPython3/SofaGui/Binding_GUIManager.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#include <pybind11/stl.h>
2222

2323
#include <SofaPython3/SofaGui/Binding_GUIManager.h>
24-
#include <sofa/gui/GUIManager.h>
25-
#include <sofa/gui/BaseGUI.h>
24+
#include <sofa/gui/common/GUIManager.h>
25+
#include <sofa/gui/common/BaseGUI.h>
2626
#include <sofa/simulation/Node.h>
2727

2828
/// Makes an alias for the pybind11 namespace to increase readability.
@@ -32,7 +32,7 @@ namespace sofapython3 {
3232

3333
void moduleAddGuiManager(py::module& m)
3434
{
35-
py::class_<sofa::gui::GUIManager> guiManager(m, "GUIManager");
35+
py::class_<sofa::gui::common::GUIManager> guiManager(m, "GUIManager");
3636

3737
/*
3838
* Sofa.Gui.GUIManager.ListSupportedGUI
@@ -45,8 +45,8 @@ void moduleAddGuiManager(py::module& m)
4545
:return: A string containing each available GUIs. If the parameter 'separator' is omitted, a list containing the
4646
available GUIs is returned instead of a string.
4747
)doc";
48-
guiManager.def_static("ListSupportedGUI", py::overload_cast<>(&sofa::gui::GUIManager::ListSupportedGUI), listSupportedGUIDoc);
49-
guiManager.def_static("ListSupportedGUI", py::overload_cast<char>(&sofa::gui::GUIManager::ListSupportedGUI), listSupportedGUIDoc );
48+
guiManager.def_static("ListSupportedGUI", py::overload_cast<>(&sofa::gui::common::GUIManager::ListSupportedGUI), listSupportedGUIDoc);
49+
guiManager.def_static("ListSupportedGUI", py::overload_cast<char>(&sofa::gui::common::GUIManager::ListSupportedGUI), listSupportedGUIDoc );
5050

5151

5252
/*
@@ -60,7 +60,7 @@ void moduleAddGuiManager(py::module& m)
6060
:param gui_name: The name of the GUI used. See Sofa.Gui.GUIManager.ListSupportedGUI(). (optional)
6161
:type gui_name: str
6262
)doc";
63-
guiManager.def_static("Init", &sofa::gui::GUIManager::Init, py::arg("program_name"), py::arg("gui_name") = "", initDoc);
63+
guiManager.def_static("Init", &sofa::gui::common::GUIManager::Init, py::arg("program_name"), py::arg("gui_name") = "", initDoc);
6464

6565

6666
/*
@@ -76,10 +76,10 @@ void moduleAddGuiManager(py::module& m)
7676
:return: 0 if the GUI creation succeed, 1 otherwise
7777
)doc";
7878
guiManager.def_static("createGUI", [](sofa::simulation::Node & node, const std::string & filename) -> int {
79-
return sofa::gui::GUIManager::createGUI(&node, filename.c_str());
79+
return sofa::gui::common::GUIManager::createGUI(&node, filename.c_str());
8080
}, createGUIDoc);
8181
guiManager.def_static("createGUI", [](sofa::simulation::Node & node) -> int {
82-
return sofa::gui::GUIManager::createGUI(&node);
82+
return sofa::gui::common::GUIManager::createGUI(&node);
8383
}, createGUIDoc);
8484

8585

@@ -89,7 +89,7 @@ void moduleAddGuiManager(py::module& m)
8989
const auto closeGUIDoc = R"doc(
9090
Close the current GUI.
9191
)doc";
92-
guiManager.def_static("closeGUI", &sofa::gui::GUIManager::closeGUI, closeGUIDoc);
92+
guiManager.def_static("closeGUI", &sofa::gui::common::GUIManager::closeGUI, closeGUIDoc);
9393

9494

9595
/*
@@ -106,7 +106,7 @@ void moduleAddGuiManager(py::module& m)
106106
:type temporaryFile: bool
107107
)doc";
108108
guiManager.def_static("SetScene", [](sofa::simulation::Node & node, const char * filename = nullptr, bool temporaryFile = false) {
109-
sofa::gui::GUIManager::SetScene(&node, filename, temporaryFile);
109+
sofa::gui::common::GUIManager::SetScene(&node, filename, temporaryFile);
110110
}, py::arg("root"), py::arg("filename") = nullptr, py::arg("temporaryFile") = false, setSceneDoc);
111111

112112

@@ -125,10 +125,10 @@ void moduleAddGuiManager(py::module& m)
125125
:return: 0 if the main loop succeed, 1 otherwise
126126
)doc";
127127
guiManager.def_static("MainLoop", [](sofa::simulation::Node & node, const std::string & filename) -> int {
128-
return sofa::gui::GUIManager::MainLoop(&node, filename.c_str());
128+
return sofa::gui::common::GUIManager::MainLoop(&node, filename.c_str());
129129
}, mainLoopDoc);
130130
guiManager.def_static("MainLoop", [](sofa::simulation::Node & node) -> int {
131-
return sofa::gui::GUIManager::MainLoop(&node);
131+
return sofa::gui::common::GUIManager::MainLoop(&node);
132132
}, mainLoopDoc);
133133

134134

@@ -145,7 +145,7 @@ void moduleAddGuiManager(py::module& m)
145145
:param height:
146146
:type height: int
147147
)doc";
148-
guiManager.def_static("SetDimension", &sofa::gui::GUIManager::SetDimension, setDimensionDoc);
148+
guiManager.def_static("SetDimension", &sofa::gui::common::GUIManager::SetDimension, setDimensionDoc);
149149

150150

151151
/*
@@ -154,7 +154,7 @@ void moduleAddGuiManager(py::module& m)
154154
const auto SetFullScreenDoc = R"doc(
155155
Set the GUI in full screen mode.
156156
)doc";
157-
guiManager.def_static("SetFullScreen", &sofa::gui::GUIManager::SetFullScreen, SetFullScreenDoc);
157+
guiManager.def_static("SetFullScreen", &sofa::gui::common::GUIManager::SetFullScreen, SetFullScreenDoc);
158158

159159
/*
160160
* Sofa.Gui.GUIManager.SaveScreenshot
@@ -165,15 +165,15 @@ void moduleAddGuiManager(py::module& m)
165165
:param filename: Where to save the screenshot.
166166
:type filename: str
167167
)doc";
168-
guiManager.def_static("SaveScreenshot", &sofa::gui::GUIManager::SaveScreenshot, SaveScreenshotDoc);
168+
guiManager.def_static("SaveScreenshot", &sofa::gui::common::GUIManager::SaveScreenshot, SaveScreenshotDoc);
169169

170170
/*
171171
* Sofa.Gui.GUIManager.GetGUI
172172
*/
173173
const auto GetGUIDoc = R"doc(
174174
Get the current GUI.
175175
)doc";
176-
guiManager.def_static("GetGUI", &sofa::gui::GUIManager::getGUI, GetGUIDoc);
176+
guiManager.def_static("GetGUI", &sofa::gui::common::GUIManager::getGUI, GetGUIDoc);
177177
}
178178

179-
} /// namespace sofapython3
179+
} /// namespace sofapython3

0 commit comments

Comments
 (0)