spirit-code / spirit

Atomistic Spin Simulation Framework
http://spirit-code.github.io
MIT License
117 stars 52 forks source link

New desktop GUI using ImGui #583

Closed GPMueller closed 3 years ago

GPMueller commented 3 years ago

Closes #20. Closes #68. Closes #112. Closes #119. Closes #178. Closes #213. Closes #247. Closes #401. Closes #407. Closes #448. Closes #452. Closes #473. Closes #474. Closes #546.

Related to issue #511.

Note: the API for setting the Hamiltonian at runtime has been implemented on the branch fixed-imgui.

codecov[bot] commented 3 years ago

Codecov Report

Merging #583 (4cdd5e3) into develop (11fe938) will decrease coverage by 0.00%. The diff coverage is 26.96%.

:exclamation: Current head 4cdd5e3 differs from pull request most recent head e899140. Consider uploading reports for the commit e899140 to get more accurate results

@@             Coverage Diff             @@
##           develop     #583      +/-   ##
===========================================
- Coverage    48.00%   48.00%   -0.01%     
===========================================
  Files           72       72              
  Lines        11250    11249       -1     
===========================================
- Hits          5401     5400       -1     
  Misses        5849     5849              
coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 79.821% when pulling e8991403777829f3162a9f77360fcc09961b6b8d on feature-imgui into 11fe93816eb108aa83966c1495f092b2df93c4a5 on develop.

GPMueller commented 3 years ago

The imgui web app has apparently been broken by commit 9becfa5d0aa3fb9a7e663ac9a92228452b506cae. The bug is triggered by any calls to setOption<VFRendering::View::Option::IS_VISIBLE_IMPLEMENTATION> from within the RendererWidgets. It seems to be because the OpenGL context for ImGui, set in MainWindow::draw (emscripten_webgl_make_context_current( context_imgui )), is still the current context when these shader-changing functions are called within the widgets.

A solution might be to create a std::deque<std::function<void()>> onto which the vfr-calls are placed. This queue could be worked off by MainWIndow between emscripten_webgl_make_context_current( context_vfr ) and rendering_layer.draw( display_w, display_h ).

GPMueller commented 3 years ago

Note: bf2bb6a59e14df045922bc7227c48e5b96b0c210, updating ImGui to v1.81, adds the tables feature. This could be used to display and allow to edit the exchange and DM interaction pairs.

Since the desktop web app now (since 4981481d91622c025cdae7ba4e30fa338d4cfe5f) seems to work correctly, it would be a good time to add the mobile and desktop web apps to the list of CI artifacts.

GPMueller commented 3 years ago

I have added some basic documentation of the IM GUI usage and build process. From my side, this PR can be merged now. I would recommend doing fixes and improvements on feature-branches rather than further increasing the size of this PR.