Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions bindings/SofaGui/Bindings.SofaGuiConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ if(Sofa.GUI.Batch_FOUND)
find_package(Sofa.GUI.Batch QUIET REQUIRED)
endif()

if(Sofa.GUI.Qt_FOUND)
find_package(Sofa.GUI.Qt QUIET REQUIRED)
endif()

if(Sofa.GUI.HeadlessRecorder_FOUND)
find_package(Sofa.GUI.HeadlessRecorder QUIET REQUIRED)
endif()
Expand Down
6 changes: 0 additions & 6 deletions bindings/SofaGui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ if(Sofa.GUI.Batch_FOUND AND SP3_WITH_SOFAGUIBATCH)
list(APPEND SUPPORTED_GUIS Sofa.GUI.Batch)
endif()

sofa_find_package(Sofa.GUI.Qt QUIET)
CMAKE_DEPENDENT_OPTION(SP3_WITH_SOFAGUIQT "Enable the SOFA Qt gui component." ON "Sofa.GUI.Qt_FOUND" OFF)
if(Sofa.GUI.Qt_FOUND AND SP3_WITH_SOFAGUIQT)
list(APPEND SUPPORTED_GUIS Sofa.GUI.Qt)
endif()

sofa_find_package(Sofa.GUI.HeadlessRecorder QUIET)
CMAKE_DEPENDENT_OPTION(SP3_WITH_SOFAGUIHEADLESSRECORDER "Enable the SOFA HeadlessRecorder gui component." ON "Sofa.GUI.HeadlessRecorder_FOUND" OFF)
if(Sofa.GUI.HeadlessRecorder_FOUND AND SP3_WITH_SOFAGUIHEADLESSRECORDER)
Expand Down
30 changes: 0 additions & 30 deletions bindings/SofaGui/src/SofaPython3/SofaGui/Module_SofaGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ using sofa::helper::system::FileSystem;
#define HAS_GUI_BATCH
#endif

#if __has_include(<sofa/gui/qt/init.h>)
#include <sofa/gui/qt/init.h>
#include <sofa/gui/qt/qt.conf.h>
#define HAS_GUI_QT
#endif

#if __has_include(<sofa/gui/headlessrecorder/init.h>)
#include <sofa/gui/headlessrecorder/init.h>
#define HAS_GUI_HEADLESSRECORDER
Expand Down Expand Up @@ -70,34 +64,10 @@ PYBIND11_MODULE(Gui, m) {

)doc";

#ifdef HAS_GUI_QT
std::string sofaPrefixAbsolute = sofa::helper::Utils::getSofaPathPrefix();
std::string inputFilepath = FileSystem::cleanPath(sofaPrefixAbsolute + "/bin/qt.conf");
bool success = sofa::gui::qt::loadQtConfWithCustomPrefix(inputFilepath, sofaPrefixAbsolute);
if(success)
{
msg_info("Sofa.Gui") << "Loaded qt.conf from " << inputFilepath << " customized with Prefix = " << sofaPrefixAbsolute;
}
else
{
msg_warning("Sofa.Gui") << "Failed loading and/or customizing qt.conf from " << inputFilepath;

std::cout << "qt_resource_data:" << std::endl;
for (auto d : qt_resource_data)
{
std::cout << d;
}
std::cout << std::endl;
}
#endif // HAS_GUI_QT

// forcefullly link libraries at compile-time
#ifdef HAS_GUI_BATCH
sofa::gui::batch::init();
#endif
#ifdef HAS_GUI_QT
sofa::gui::qt::init();
#endif
#ifdef HAS_GUI_HEADLESSRECORDER
sofa::gui::headlessrecorder::init();
#endif
Expand Down
3 changes: 2 additions & 1 deletion examples/basic-addGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# Choose in your script to activate or not the GUI
USE_GUI = True


def main():
import SofaRuntime
import Sofa.Gui
Expand All @@ -21,6 +20,8 @@ def main():
for iteration in range(10):
Sofa.Simulation.animate(root, root.dt.value)
else:
import SofaQt

# Find out the supported GUIs
print ("Supported GUIs are: " + Sofa.Gui.GUIManager.ListSupportedGUI(","))
# Launch the GUI (qt or qglviewer)
Expand Down
1 change: 1 addition & 0 deletions examples/emptyController.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def createScene(root):
def main():
import SofaRuntime
import Sofa.Gui
import SofaQt

root=Sofa.Core.Node("root")
createScene(root)
Expand Down
1 change: 1 addition & 0 deletions examples/emptyDataEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def createScene(root):
def main():
import Sofa.Gui
import SofaRuntime
import SofaQt

root=Sofa.Core.Node("root")
createScene(root)
Expand Down
1 change: 1 addition & 0 deletions examples/emptyForceField.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def createScene(root):
def main():
import SofaRuntime
import Sofa.Gui
import SofaQt

root=Sofa.Core.Node("root")
createScene(root)
Expand Down
1 change: 1 addition & 0 deletions examples/example-forcefield.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def createScene(root):
def main():
import SofaRuntime
import Sofa.Gui
import SofaQt

root=Sofa.Core.Node("root")
createScene(root)
Expand Down
2 changes: 2 additions & 0 deletions examples/liver-scriptcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def main():
Sofa.Simulation.initRoot(root)

if not USE_GUI:
import SofaQt

for iteration in range(10):
Sofa.Simulation.animate(root, root.dt.value)
else:
Expand Down
2 changes: 2 additions & 0 deletions examples/liver.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def main():
for iteration in range(10):
Sofa.Simulation.animate(root, root.dt.value)
else:
import SofaQt

Sofa.Gui.GUIManager.Init("myscene", "qglviewer")
Sofa.Gui.GUIManager.createGUI(root, __file__)
Sofa.Gui.GUIManager.SetDimension(1080, 1080)
Expand Down
1 change: 1 addition & 0 deletions examples/loadXMLfromPython.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def createScene(root):
def main():
import SofaRuntime
import Sofa.Gui
import SofaQt

root = Sofa.Core.Node("root")
createScene(root)
Expand Down
Loading