Skip to content

Conversation

@najlkin
Copy link
Contributor

@najlkin najlkin commented May 12, 2025

This PR adds headless (no GUI) visualization using EGL standard. The new EglWindow serves as an alternative backend instead of SdlWindow, which is no longer needed directly and the code uses general GLWindow base class instead. The headless rendering is available in the following ways:

  • from command line with option -hl (control key q should be used to quit after the visualization is done)
  • saved streams when started with the above option (end of the input stream closes the visualization)
  • from scripts, starting them with the above option or through headless command before the visualization command(s), which are then performed without autopausing (end of the script files closes the visualization)
  • server started with the -hl option, where end of the input streams also closes the visualization(s)

↪️ dependencies:

🌟 bonus features:

  • moved SDL-based content to sdl directory (and similarly EGL-based to egl), cleaning up file hierarchy
  • fixed handling of screenshot command in scripts, as criticized in Screenshot does not behaves reliably in glvs script #254
  • fixed caching of MFEM in CI tests (MPI option was not recognized)
  • removed using namespace std pollution (i.e., uncontrolled spreading through header files)

📎 todo:

  • CI building (only Ubuntu)
  • server mode
  • CI tests?

✔️ testing:

  • some cmd lines
  • some scripts
  • some saved streams
  • inline visualization
  • js

najlkin added 30 commits May 2, 2025 13:12
@tzanio
Copy link
Member

tzanio commented May 25, 2025

Ok, the headless server works nicely now. It should be tested in combination with parallel applications on clusters. If IP/TCP sockets cause some problems, we could try to use Unix sockets locally on the node 🤔 .

That's awesome, thanks @najlkin !

@najlkin najlkin mentioned this pull request May 28, 2025
3 tasks
@tzanio
Copy link
Member

tzanio commented May 28, 2025

@justinlaughlin, what happens if we load a steam with "screenshot" command in the web version?

@najlkin
Copy link
Contributor Author

najlkin commented May 28, 2025

I think an error 😁 , because glvis-js supports only keys and valuerange commands apart from the data loading ones (see #315 ). But you may enter keys S to get a screenshot. I wonder what will happen then 🤔 .

@v-dobrev
Copy link
Member

@justinlaughlin, what happens if we load a steam with "screenshot" command in the web version?

I think an error 😁 , because glvis-js supports only keys and valuerange commands apart from the data loading ones (see #315 ). But you may enter keys S to get a screenshot. I wonder what will happen then 🤔 .

I think pressing S will "download" the new file that is created by the C++ code, so depending on your browser configuration, the file may be saved directly to your "Downloads" folder without a prompt, or you may get a "save file" dialog box to choose where to save the file.

@najlkin
Copy link
Contributor Author

najlkin commented May 30, 2025

Hmm, at least in basic.html nothing happens after S. It would be too nice to get a file 🙃 . I guess it violates some security policies and the code does not get a writing file handle 🚫 .

@najlkin
Copy link
Contributor Author

najlkin commented May 30, 2025

But in glvis live, it works😮 . However, there is a special code for it, handling specifically S, calling saveScreenshot() in index.js. You get glvis.png file for download. It shares SaveAsPNG() with the main code, so there is a potential for headless operation if you are thinking that way 😉 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Screenshot does not behaves reliably in glvs script

4 participants