Sofa.Gui.GUIManager

class Sofa.Gui.GUIManager

Bases: pybind11_object

static GetGUI() Sofa.Gui.BaseGUI

Get the current GUI.

static Init(program_name: str, gui_name: str = '') int

Initialize the GUI

Parameters:
  • program_name (str) – The name of the current program or script. (optional)

  • gui_name (str) – The name of the GUI used. See Sofa.Gui.GUIManager.ListSupportedGUI(). (optional)

static ListSupportedGUI(*args, **kwargs)

Overloaded function.

  1. ListSupportedGUI() -> List[str]

    List the supported GUIs.

    param separator:

    Character used to separate the names of the GUIs. (optional)

    type separator:

    Char

    return:

    A string containing each available GUIs. If the parameter ‘separator’ is omitted, a list containing the available GUIs is returned instead of a string.

  2. ListSupportedGUI(arg0: str) -> str

    List the supported GUIs.

    param separator:

    Character used to separate the names of the GUIs. (optional)

    type separator:

    Char

    return:

    A string containing each available GUIs. If the parameter ‘separator’ is omitted, a list containing the available GUIs is returned instead of a string.

static MainLoop(*args, **kwargs)

Overloaded function.

  1. MainLoop(arg0: Sofa.Core.Node, arg1: str) -> int

    Main loop of the GUI.

    Calling the main loop will steal the execution control of the script until the GUI is closed.

    param node:

    The root node of the current scene to draw into the GUI.

    type node:

    Node&

    param filename:

    The current script filename (optional)

    type filename:

    str

    return:

    0 if the main loop succeed, 1 otherwise

  2. MainLoop(arg0: Sofa.Core.Node) -> int

    Main loop of the GUI.

    Calling the main loop will steal the execution control of the script until the GUI is closed.

    param node:

    The root node of the current scene to draw into the GUI.

    type node:

    Node&

    param filename:

    The current script filename (optional)

    type filename:

    str

    return:

    0 if the main loop succeed, 1 otherwise

static SaveScreenshot(arg0: str) None

Save the current frame into a file.

Parameters:

filename (str) – Where to save the screenshot.

static SetDimension(arg0: int, arg1: int) None

Set the GUI’s dimensions.

This must be called after Sofa.Gui.GUIManager.createGUI

Parameters:
  • width (int) –

  • height (int) –

static SetFullScreen() None

Set the GUI in full screen mode.

static SetScene(root: Sofa.Core.Node, filename: str = None, temporaryFile: bool = False) None

Set the active scene.

Parameters:
  • node (Node&) – The root node of the current scene to draw into the GUI.

  • filename (str) – The current script filename (optional)

  • temporaryFile (bool) – Whether the file is temporary (default to false)

static closeGUI() None

Close the current GUI.

static createGUI(*args, **kwargs)

Overloaded function.

  1. createGUI(arg0: Sofa.Core.Node, arg1: str) -> int

    Create the GUI.

    param node:

    The root node of the current scene to draw into the GUI.

    type node:

    Node&

    param filename:

    The current script filename (optional)

    type filename:

    str

    return:

    0 if the GUI creation succeed, 1 otherwise

  2. createGUI(arg0: Sofa.Core.Node) -> int

    Create the GUI.

    param node:

    The root node of the current scene to draw into the GUI.

    type node:

    Node&

    param filename:

    The current script filename (optional)

    type filename:

    str

    return:

    0 if the GUI creation succeed, 1 otherwise