explicit Application.shutdown function as counterpart to Application.initialize
- Dominant language
- C++
- Stars
- 14k
- Forks
- 2.6k
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 6
Description
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Came across a case where it makes more sense to run `visualization.gui.application` in background thread instead of main thread and push everything there using `push_to_main_thread`. For gui library as well as FilamentEngine it seems irrelevant which thread the gui is actually controlled by as long as `push_to_main_thread` is consequently used. It just must always be the same thread. Issues only arise when run on background thread and than python is closed.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
have an explicit `visualization.gui.application.shutdown()` method which internally cleanly shuts down FilamentEngine and deinitialised the gui system completely. After call to `visualization.gui.application.shutdown()` the program should be back in the state before the initial call to `visualization.gui.application.initialize()` which must be called again before using an gui functionality.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
- Risk uncaught panic exception from FilamentEngine
- unloading modules -> not leading to expected result in python as underlying c/c++ libraries may not be fully unloaded and thus reinitialization has no effect.
**Additional context**
Add any other context or screenshots about the feature request here.
**EDIT attached example program**
Attached an example python module providing viewer which can be attached to and script or program as the viewer thread is running in back ground. The shutdown command which deinitializes the gui environment and calls resetupon FilamentEngine would prevent the Exception thrown when tremination or restarting in debugger. Anything else is consequently handled by push to b main thread and thus safe.
[NICE_Viewer.py.gz](https://github.com/isl-org/Open3D/files/7161844/NICE_Viewer.py.gz)
Commands:
file ... to display single file
objdir ... display one *.obj file after the other found in the specified directory
plydir ... display one *.ply file after the other found in the specified directory
n ... when list of files loaded throug objdir or plydir command display the content of the next file
p ... when list of files loaded through objdir or plydir command displaythe content of previous file
The gui in addition offers the actions show vertex vertexnormals, facenormals, both and clearnormals for displaying a specific set of normals. Before display of normals can be switched between vertex, face or both types of normals clearnormals has to be used to clear the current set if created. (is just a tool for debugging and development and not production)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.