sofa::gui::SofaGUI Class Reference

#include <SofaGUI.h>

Inheritance diagram for sofa::gui::SofaGUI:

Inheritance graph
[legend]
Collaboration diagram for sofa::gui::SofaGUI:

Collaboration graph
[legend]

registration of each GUI

static int RegisterGUI (const char *name, CreateGUIFn *creator, InitGUIFn *init=NULL, int priority=0)
typedef int InitGUIFn (const char *name, const std::vector< std::string > &options)
typedef SofaGUI * CreateGUIFn (const char *name, const std::vector< std::string > &options, sofa::simulation::Node *groot, const char *filename)

Data Structures

struct  GUICreator

Public Member Functions

methods each GUI must implement
 SofaGUI ()
virtual int mainLoop ()=0
virtual void redraw ()=0
virtual int closeGUI ()=0
virtual sofa::simulation::Node * currentSimulation ()=0

Static Public Member Functions

Static methods for direct access to GUI
static void SetProgramName (const char *argv0)
static const char * GetProgramName ()
static std::vector< std::string > ListSupportedGUI ()
static std::string ListSupportedGUI (char separator)
static const char * GetGUIName ()
static void SetGUIName (const char *name="")
static void AddGUIOption (const char *option)
static int Init ()
static int Init (const char *argv0, const char *name="")
static int MainLoop (sofa::simulation::Node *groot=NULL, const char *filename=NULL)
static SofaGUI * CurrentGUI ()
static void Redraw ()
static sofa::simulation::Node * CurrentSimulation ()

Protected Member Functions

virtual ~SofaGUI ()
 The destructor should not be called directly. Use the closeGUI() method instead.

Static Protected Member Functions

static std::list< GUICreator > & guiCreators ()
static GUICreator * GetGUICreator (const char *name=NULL)

Static Protected Attributes

static const char * programName = NULL
static std::string guiName = ""
static std::vector< std::string > guiOptions
static SofaGUI * currentGUI = NULL

Detailed Description

Definition at line 41 of file SofaGUI.h.


Constructor & Destructor Documentation

sofa::gui::SofaGUI::SofaGUI (  ) 

Definition at line 166 of file SofaGUI.cpp.

References currentGUI.

sofa::gui::SofaGUI::~SofaGUI (  )  [protected, virtual]

The destructor should not be called directly. Use the closeGUI() method instead.

Definition at line 174 of file SofaGUI.cpp.

References currentGUI.


Member Function Documentation

void sofa::gui::SofaGUI::AddGUIOption ( const char *  option  )  [static]

Definition at line 106 of file SofaGUI.cpp.

References guiOptions.

virtual int sofa::gui::SofaGUI::closeGUI (  )  [pure virtual]

typedef SofaGUI* sofa::gui::SofaGUI::CreateGUIFn ( const char *  name,
const std::vector< std::string > &  options,
sofa::simulation::Node *  groot,
const char *  filename 
)

SofaGUI * sofa::gui::SofaGUI::CurrentGUI (  )  [static]

Definition at line 128 of file SofaGUI.cpp.

References currentGUI.

virtual sofa::simulation::Node* sofa::gui::SofaGUI::currentSimulation (  )  [pure virtual]

sofa::simulation::Node * sofa::gui::SofaGUI::CurrentSimulation (  )  [static]

Definition at line 138 of file SofaGUI.cpp.

References currentGUI, and currentSimulation().

Referenced by main().

SofaGUI::GUICreator * sofa::gui::SofaGUI::GetGUICreator ( const char *  name = NULL  )  [static, protected]

Definition at line 111 of file SofaGUI.cpp.

References GetGUIName(), guiCreators(), and ListSupportedGUI().

Referenced by Init(), and MainLoop().

const char * sofa::gui::SofaGUI::GetGUIName (  )  [static]

Definition at line 80 of file SofaGUI.cpp.

References guiCreators(), and guiName.

Referenced by GetGUICreator(), Init(), main(), MainLoop(), and sofa::gui::qt::SofaModeler::runInSofa().

const char * sofa::gui::SofaGUI::GetProgramName (  )  [static]

Definition at line 53 of file SofaGUI.cpp.

References programName.

Referenced by sofa::gui::qt::RealGUI::CreateGUI().

std::list< SofaGUI::GUICreator > & sofa::gui::SofaGUI::guiCreators (  )  [static, protected]

Definition at line 41 of file SofaGUI.cpp.

Referenced by GetGUICreator(), GetGUIName(), Init(), ListSupportedGUI(), and RegisterGUI().

static int sofa::gui::SofaGUI::Init ( const char *  argv0,
const char *  name = "" 
) [inline, static]

Definition at line 63 of file SofaGUI.h.

References Init(), SetGUIName(), and SetProgramName().

int sofa::gui::SofaGUI::Init (  )  [static]

typedef int sofa::gui::SofaGUI::InitGUIFn ( const char *  name,
const std::vector< std::string > &  options 
)

std::string sofa::gui::SofaGUI::ListSupportedGUI ( char  separator  )  [static]

Definition at line 68 of file SofaGUI.cpp.

References guiCreators().

std::vector< std::string > sofa::gui::SofaGUI::ListSupportedGUI (  )  [static]

Definition at line 58 of file SofaGUI.cpp.

References guiCreators().

Referenced by GetGUICreator(), and main().

virtual int sofa::gui::SofaGUI::mainLoop (  )  [pure virtual]

int sofa::gui::SofaGUI::MainLoop ( sofa::simulation::Node *  groot = NULL,
const char *  filename = NULL 
) [static]

virtual void sofa::gui::SofaGUI::redraw (  )  [pure virtual]

void sofa::gui::SofaGUI::Redraw (  )  [static]

Definition at line 133 of file SofaGUI.cpp.

References currentGUI, and redraw().

int sofa::gui::SofaGUI::RegisterGUI ( const char *  name,
CreateGUIFn *  creator,
InitGUIFn *  init = NULL,
int  priority = 0 
) [static]

void sofa::gui::SofaGUI::SetGUIName ( const char *  name = ""  )  [static]

Definition at line 101 of file SofaGUI.cpp.

References guiName.

Referenced by Init().

void sofa::gui::SofaGUI::SetProgramName ( const char *  argv0  )  [static]

Definition at line 47 of file SofaGUI.cpp.

References programName.

Referenced by Init(), and main().


Field Documentation

SofaGUI * sofa::gui::SofaGUI::currentGUI = NULL [static, protected]

Definition at line 115 of file SofaGUI.h.

Referenced by CurrentGUI(), CurrentSimulation(), Init(), MainLoop(), Redraw(), SofaGUI(), and ~SofaGUI().

std::string sofa::gui::SofaGUI::guiName = "" [static, protected]

Definition at line 113 of file SofaGUI.h.

Referenced by GetGUIName(), and SetGUIName().

std::vector< std::string > sofa::gui::SofaGUI::guiOptions [static, protected]

Definition at line 114 of file SofaGUI.h.

Referenced by AddGUIOption(), Init(), and MainLoop().

const char * sofa::gui::SofaGUI::programName = NULL [static, protected]

Definition at line 112 of file SofaGUI.h.

Referenced by GetProgramName(), and SetProgramName().


The documentation for this class was generated from the following files:

Generated on Sun Nov 23 04:24:07 2008 for Sofa by  doxygen 1.5.7.1