Skip to content

Commit 296d09d

Browse files
authored
[SofaGui] Remove Sofa.Gui.Qt references (#489)
* remove sofaguiqt references * update examples using qt guis
1 parent 493f174 commit 296d09d

File tree

11 files changed

+11
-41
lines changed

11 files changed

+11
-41
lines changed

bindings/SofaGui/Bindings.SofaGuiConfig.cmake.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ if(Sofa.GUI.Batch_FOUND)
1212
find_package(Sofa.GUI.Batch QUIET REQUIRED)
1313
endif()
1414

15-
if(Sofa.GUI.Qt_FOUND)
16-
find_package(Sofa.GUI.Qt QUIET REQUIRED)
17-
endif()
18-
1915
if(Sofa.GUI.HeadlessRecorder_FOUND)
2016
find_package(Sofa.GUI.HeadlessRecorder QUIET REQUIRED)
2117
endif()

bindings/SofaGui/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ if(Sofa.GUI.Batch_FOUND AND SP3_WITH_SOFAGUIBATCH)
2121
list(APPEND SUPPORTED_GUIS Sofa.GUI.Batch)
2222
endif()
2323

24-
sofa_find_package(Sofa.GUI.Qt QUIET)
25-
CMAKE_DEPENDENT_OPTION(SP3_WITH_SOFAGUIQT "Enable the SOFA Qt gui component." ON "Sofa.GUI.Qt_FOUND" OFF)
26-
if(Sofa.GUI.Qt_FOUND AND SP3_WITH_SOFAGUIQT)
27-
list(APPEND SUPPORTED_GUIS Sofa.GUI.Qt)
28-
endif()
29-
3024
sofa_find_package(Sofa.GUI.HeadlessRecorder QUIET)
3125
CMAKE_DEPENDENT_OPTION(SP3_WITH_SOFAGUIHEADLESSRECORDER "Enable the SOFA HeadlessRecorder gui component." ON "Sofa.GUI.HeadlessRecorder_FOUND" OFF)
3226
if(Sofa.GUI.HeadlessRecorder_FOUND AND SP3_WITH_SOFAGUIHEADLESSRECORDER)

bindings/SofaGui/src/SofaPython3/SofaGui/Module_SofaGui.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ using sofa::helper::system::FileSystem;
3131
#define HAS_GUI_BATCH
3232
#endif
3333

34-
#if __has_include(<sofa/gui/qt/init.h>)
35-
#include <sofa/gui/qt/init.h>
36-
#include <sofa/gui/qt/qt.conf.h>
37-
#define HAS_GUI_QT
38-
#endif
39-
4034
#if __has_include(<sofa/gui/headlessrecorder/init.h>)
4135
#include <sofa/gui/headlessrecorder/init.h>
4236
#define HAS_GUI_HEADLESSRECORDER
@@ -70,34 +64,10 @@ PYBIND11_MODULE(Gui, m) {
7064
7165
)doc";
7266

73-
#ifdef HAS_GUI_QT
74-
std::string sofaPrefixAbsolute = sofa::helper::Utils::getSofaPathPrefix();
75-
std::string inputFilepath = FileSystem::cleanPath(sofaPrefixAbsolute + "/bin/qt.conf");
76-
bool success = sofa::gui::qt::loadQtConfWithCustomPrefix(inputFilepath, sofaPrefixAbsolute);
77-
if(success)
78-
{
79-
msg_info("Sofa.Gui") << "Loaded qt.conf from " << inputFilepath << " customized with Prefix = " << sofaPrefixAbsolute;
80-
}
81-
else
82-
{
83-
msg_warning("Sofa.Gui") << "Failed loading and/or customizing qt.conf from " << inputFilepath;
84-
85-
std::cout << "qt_resource_data:" << std::endl;
86-
for (auto d : qt_resource_data)
87-
{
88-
std::cout << d;
89-
}
90-
std::cout << std::endl;
91-
}
92-
#endif // HAS_GUI_QT
93-
9467
// forcefullly link libraries at compile-time
9568
#ifdef HAS_GUI_BATCH
9669
sofa::gui::batch::init();
9770
#endif
98-
#ifdef HAS_GUI_QT
99-
sofa::gui::qt::init();
100-
#endif
10171
#ifdef HAS_GUI_HEADLESSRECORDER
10272
sofa::gui::headlessrecorder::init();
10373
#endif

examples/basic-addGUI.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# Choose in your script to activate or not the GUI
66
USE_GUI = True
77

8-
98
def main():
109
import SofaRuntime
1110
import Sofa.Gui
@@ -21,6 +20,8 @@ def main():
2120
for iteration in range(10):
2221
Sofa.Simulation.animate(root, root.dt.value)
2322
else:
23+
import SofaQt
24+
2425
# Find out the supported GUIs
2526
print ("Supported GUIs are: " + Sofa.Gui.GUIManager.ListSupportedGUI(","))
2627
# Launch the GUI (qt or qglviewer)

examples/emptyController.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def createScene(root):
9696
def main():
9797
import SofaRuntime
9898
import Sofa.Gui
99+
import SofaQt
99100

100101
root=Sofa.Core.Node("root")
101102
createScene(root)

examples/emptyDataEngine.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def createScene(root):
3333
def main():
3434
import Sofa.Gui
3535
import SofaRuntime
36+
import SofaQt
3637

3738
root=Sofa.Core.Node("root")
3839
createScene(root)

examples/emptyForceField.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def createScene(root):
5858
def main():
5959
import SofaRuntime
6060
import Sofa.Gui
61+
import SofaQt
6162

6263
root=Sofa.Core.Node("root")
6364
createScene(root)

examples/example-forcefield.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def createScene(root):
6060
def main():
6161
import SofaRuntime
6262
import Sofa.Gui
63+
import SofaQt
6364

6465
root=Sofa.Core.Node("root")
6566
createScene(root)

examples/liver-scriptcontroller.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ def main():
1515
Sofa.Simulation.initRoot(root)
1616

1717
if not USE_GUI:
18+
import SofaQt
19+
1820
for iteration in range(10):
1921
Sofa.Simulation.animate(root, root.dt.value)
2022
else:

examples/liver.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ def main():
1818
for iteration in range(10):
1919
Sofa.Simulation.animate(root, root.dt.value)
2020
else:
21+
import SofaQt
22+
2123
Sofa.Gui.GUIManager.Init("myscene", "qglviewer")
2224
Sofa.Gui.GUIManager.createGUI(root, __file__)
2325
Sofa.Gui.GUIManager.SetDimension(1080, 1080)

0 commit comments

Comments
 (0)