SOFA API  1a4bb3e7
Open source framework for multi-physics simuation
sofa::gui::common::GUIManager Class Reference

#include <GUIManager.h>

Classes

struct  GUICreator
 

Static Protected Attributes

static std::list< GUICreatorguiCreators
 
static std::vector< std::string > guiOptions
 
static BaseGUIcurrentGUI = nullptr
 
static std::string valid_guiname = ""
 
static ArgumentParsercurrentArgumentParser = nullptr
 

Static Public Member Functions

static int Init (const char *argv0, const char *name="")
 
static int RegisterGUI (const char *name, CreateGUIFn *creator, RegisterGUIParameters *parameters=nullptr, int priority=0)
 Set parameter for a gui creation and Store in the guiCreators list. More...
 
static const charGetValidGUIName ()
 
static const std::string & GetCurrentGUIName ()
 
static std::vector< std::string > ListSupportedGUI ()
 
static std::string ListSupportedGUI (char separator)
 
static void RegisterParameters (ArgumentParser *parser)
 
static int createGUI (sofa::simulation::NodeSPtr groot=nullptr, const char *filename=nullptr)
 
static void closeGUI ()
 
static BaseGUIgetGUI ()
 
Static methods for direct access to GUI
static int MainLoop (sofa::simulation::NodeSPtr groot=nullptr, const char *filename=nullptr)
 
static void Redraw ()
 
static sofa::simulation::NodeCurrentSimulation ()
 
static void SetScene (sofa::simulation::NodeSPtr groot, const char *filename=nullptr, bool temporaryFile=false)
 
static void SetDimension (int width, int height)
 
static void SetFullScreen ()
 
static void CenterWindow ()
 
static void SaveScreenshot (const char *filename)
 

Static Protected Member Functions

static GUICreatorGetGUICreator (const char *name=nullptr)
 Comparaison between guiname passed as parameter and all guiname store in guiCreators list. More...
 

Attribute details

◆ currentArgumentParser

ArgumentParser * sofa::gui::common::GUIManager::currentArgumentParser = nullptr
staticprotected

◆ currentGUI

BaseGUI * sofa::gui::common::GUIManager::currentGUI = nullptr
staticprotected

◆ guiCreators

std::list< GUIManager::GUICreator > sofa::gui::common::GUIManager::guiCreators
staticprotected

◆ guiOptions

std::vector<std::string> sofa::gui::common::GUIManager::guiOptions
staticprotected

◆ valid_guiname

std::string sofa::gui::common::GUIManager::valid_guiname = ""
staticprotected

Function details

◆ CenterWindow()

void sofa::gui::common::GUIManager::CenterWindow ( )
static

◆ closeGUI()

void sofa::gui::common::GUIManager::closeGUI ( )
static

◆ createGUI()

int sofa::gui::common::GUIManager::createGUI ( sofa::simulation::NodeSPtr  groot = nullptr,
const char filename = nullptr 
)
static

◆ CurrentSimulation()

sofa::simulation::Node * sofa::gui::common::GUIManager::CurrentSimulation ( )
static

◆ GetCurrentGUIName()

const std::string & sofa::gui::common::GUIManager::GetCurrentGUIName ( )
static

◆ getGUI()

BaseGUI * sofa::gui::common::GUIManager::getGUI ( )
static

◆ GetGUICreator()

GUIManager::GUICreator * sofa::gui::common::GUIManager::GetGUICreator ( const char name = nullptr)
staticprotected

Comparaison between guiname passed as parameter and all guiname store in guiCreators list.

Parameters
name: It is the name of your gui.
Returns
nullptr if the name don't match with any guiCreators name, the correct pointer otherwise

◆ GetValidGUIName()

const char * sofa::gui::common::GUIManager::GetValidGUIName ( )
static

◆ Init()

int sofa::gui::common::GUIManager::Init ( const char argv0,
const char name = "" 
)
static

◆ ListSupportedGUI() [1/2]

std::vector< std::string > sofa::gui::common::GUIManager::ListSupportedGUI ( )
static

◆ ListSupportedGUI() [2/2]

std::string sofa::gui::common::GUIManager::ListSupportedGUI ( char  separator)
static

◆ MainLoop()

int sofa::gui::common::GUIManager::MainLoop ( sofa::simulation::NodeSPtr  groot = nullptr,
const char filename = nullptr 
)
static

◆ Redraw()

void sofa::gui::common::GUIManager::Redraw ( )
static

◆ RegisterGUI()

int sofa::gui::common::GUIManager::RegisterGUI ( const char name,
CreateGUIFn creator,
RegisterGUIParameters parameters = nullptr,
int  priority = 0 
)
static

Set parameter for a gui creation and Store in the guiCreators list.

Parameters
name: It is the name of your gui. This name is compared with the name parameter when you set GUIManager::Init(name). It must be the same.
creator: The pointer function which call when GUIManager::createGUI()
init: The pointer function which call when GUIManager::Init()
priority: If nothing is given as name GUIManager::Init parameter GUIManager::valid_guiname is automaticly set compared with the priority
Returns
1 if the name is already used (failed), 0 if restry succed

◆ RegisterParameters()

void sofa::gui::common::GUIManager::RegisterParameters ( ArgumentParser parser)
static

◆ SaveScreenshot()

void sofa::gui::common::GUIManager::SaveScreenshot ( const char filename)
static

◆ SetDimension()

void sofa::gui::common::GUIManager::SetDimension ( int  width,
int  height 
)
static

◆ SetFullScreen()

void sofa::gui::common::GUIManager::SetFullScreen ( )
static

◆ SetScene()

void sofa::gui::common::GUIManager::SetScene ( sofa::simulation::NodeSPtr  groot,
const char filename = nullptr,
bool  temporaryFile = false 
)
static