SOFA API  014b24ea
Open source framework for multi-physics simuation
sofa::gui::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 char * GetValidGUIName ()
 
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::Node::SPtr groot=nullptr, const char *filename=nullptr)
 
static void closeGUI ()
 
static BaseGUIgetGUI ()
 
Static methods for direct access to GUI
static int MainLoop (sofa::simulation::Node::SPtr groot=nullptr, const char *filename=nullptr)
 
static void Redraw ()
 
static sofa::simulation::NodeCurrentSimulation ()
 
static void SetScene (sofa::simulation::Node::SPtr groot, const char *filename=nullptr, bool temporaryFile=false)
 
static void SetDimension (int width, int height)
 
static void SetFullScreen ()
 
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

ArgumentParser * sofa::gui::GUIManager::currentArgumentParser = nullptr
staticprotected
BaseGUI * sofa::gui::GUIManager::currentGUI = nullptr
staticprotected
std::list< GUIManager::GUICreator > sofa::gui::GUIManager::guiCreators
staticprotected
std::vector<std::string> sofa::gui::GUIManager::guiOptions
staticprotected
std::string sofa::gui::GUIManager::valid_guiname = ""
staticprotected

Function details

void sofa::gui::GUIManager::closeGUI ( )
static
int sofa::gui::GUIManager::createGUI ( sofa::simulation::Node::SPtr  groot = nullptr,
const char *  filename = nullptr 
)
static
sofa::simulation::Node * sofa::gui::GUIManager::CurrentSimulation ( )
static
const std::string & sofa::gui::GUIManager::GetCurrentGUIName ( )
static
BaseGUI * sofa::gui::GUIManager::getGUI ( )
static
GUIManager::GUICreator * sofa::gui::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
const char * sofa::gui::GUIManager::GetValidGUIName ( )
static
int sofa::gui::GUIManager::Init ( const char *  argv0,
const char *  name = "" 
)
static
std::vector< std::string > sofa::gui::GUIManager::ListSupportedGUI ( )
static
std::string sofa::gui::GUIManager::ListSupportedGUI ( char  separator)
static
int sofa::gui::GUIManager::MainLoop ( sofa::simulation::Node::SPtr  groot = nullptr,
const char *  filename = nullptr 
)
static
void sofa::gui::GUIManager::Redraw ( )
static
int sofa::gui::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
void sofa::gui::GUIManager::RegisterParameters ( ArgumentParser parser)
static
void sofa::gui::GUIManager::SaveScreenshot ( const char *  filename)
static
void sofa::gui::GUIManager::SetDimension ( int  width,
int  height 
)
static
void sofa::gui::GUIManager::SetFullScreen ( )
static
void sofa::gui::GUIManager::SetScene ( sofa::simulation::Node::SPtr  groot,
const char *  filename = nullptr,
bool  temporaryFile = false 
)
static