Code Monkey home page Code Monkey logo

sofaglfw's Introduction

SofaGLFW

Gitter Support

download forks stars

This SOFA plugin brings a simple GUI based on GLFW (a spiritual successor of Glut).

It only needs Sofa.Simulation.Graph, Sofa.Component.Visual, Sofa.GUI.Common and Sofa.GL as dependencies. Integration of GLFW is automatic (automatic fetching and integration with CMake), and linked statically (does not need a glfw.dll to be shipped with)

This GUI is launchable with the standard runSofa (with the parameter "-g glfw"), or can be used with a (provided) stand-alone executable runSofaGLFW (which needs much less dependencies than runSofa)

Lastly, this GUI was designed to support multiple windows in the same time and multiple simulations.

Dependencies

Linux

Unix-like systems such as Linux need a few extra packages for GLFW. Read the documentation on the GLFW website (section Installing dependencies). For example, if you are on Ubuntu running X11, you need to do:

sudo apt install xorg-dev

Others

No dependencies

Compilation

As any plugin, to compile SofaGLFW, follow the instructions on the SOFA documentation website.

Keyboard Shortcuts

  • CTRL+F: switch to fullscreen
  • Escape: close the app
  • Space: play/pause the simulation

Command Line Options

runSofaGLFW accepts the following command line options:

  • -f or --file to specify the scene file to load. If not defined, the default scene file Demos/caduceus.scn is loaded.
  • -a or --start: if true, starts the simulation just after opening. True by default.
  • -s or --fullscreen: set full screen at startup. False by default.
  • -l or --load: load given plugins as a comma-separated list. Example: -l SofaPython3

Dear ImGui

By default, SofaGLFW does not show any user interface. Only the keyboard allows limited interactions with the simulation. That is why a user interface based on Dear ImGui is provided, in the form of a SOFA plugin.

By default, this interface is not compiled. The CMake variable PLUGIN_SOFAIMGUI must be set to ON.

Integration of Dear ImGui is automatic (automatic fetching and integration with CMake), and linked statically.

Dependencies

SofaImGui depends on SofaGLFW, so it must also be activated.

The GUI relies on the NFD-extended library. Therefore, it comes with its dependencies. See the list on GitHub.

Compilation

As any plugin, to compile SofaImGui, follow the instructions on the SOFA documentation website.

Usage

To run SOFA with the GUI from SofaImGui, execute the following command:

runSofa -l SofaImGui -g imgui
  • -l SofaImGui: loads the plugin in order to be able to use the GUI (see the documentation)
  • -g imgui: selects the runSofa GUI to be the one from SofaImGui

It is possible to run the Dear ImGui-based GUI by default when running the command ./runSofa (without the -l and -g arguments). To do so, add the SofaImGui plugin into the list of loaded plugin in the plugin_list.conf file (see the documentation). Then, run runSofa -g imgui at least once so that runSofa save the last used GUI. After that, ./runSofa will load the imgui GUI.

Windows

The GUI is based on dockable windows. Each window gathers related features. Here are all the available windows:

Window Description
Performances display simple metrics related to application performances: ms/frame, FPS, graph
Profiler display detailed metrics related to the physics loop performances
Scene Graph show the scene graph and the Data associated to each components
Display Flags filter which components are rendered in the 3D view
Plugin show a list of plugins currently loaded
Components show a detailed list of components currently loaded
Log all the messages sent by SOFA

Screenshots

MainGUI

sofaglfw's People

Contributors

alxbilger avatar bakpaul avatar brunob81hk avatar fredroy avatar guparan avatar hugtalbot avatar jnbrunet avatar lamriaimen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.