SOFA API  c76874b7
Open source framework for multi-physics simuation
sofa::gui::BaseGUI Class Referenceabstract

#include <BaseGUI.h>

Inheritance diagram for sofa::gui::BaseGUI:

Static Protected Attributes

static std::string mGuiName = ""
 
static std::string configDirectoryPath = "."
 
static std::string screenshotDirectoryPath = "."
 
static const char * mProgramName = nullptr
 
static ArgumentParsermArgumentParser = nullptr
 

Public Member Functions

virtual void configureGUI (sofa::simulation::Node::SPtr groot)
 Use a component setting to configure our GUI. More...
 
void exportGnuplot (sofa::simulation::Node *node, std::string gnuplot_directory="")
 
methods each GUI must implement

Start the GUI loop

virtual int mainLoop ()=0
 
virtual void redraw ()=0
 Update the GUI. More...
 
virtual int closeGUI ()=0
 Close the GUI. More...
 
virtual void setScene (sofa::simulation::Node::SPtr groot, const char *filename=nullptr, bool temporaryFile=false)=0
 Register the scene in our GUI. More...
 
virtual sofa::simulation::NodecurrentSimulation ()=0
 Get the rootNode of the sofa scene. More...
 
methods to configure the GUI
virtual void setDumpState (bool)
 
virtual void setLogTime (bool)
 
virtual void setExportState (bool)
 
virtual void setRecordPath (const std::string &)
 
virtual void setGnuplotPath (const std::string &)
 
virtual void initViewer (BaseViewer *)
 
virtual void setViewerConfiguration (sofa::component::configurationsetting::ViewerSetting *)
 
virtual void setViewerResolution (int, int)
 
virtual void setFullScreen ()
 
virtual void setBackgroundColor (const sofa::helper::types::RGBAColor &)
 
virtual void setBackgroundImage (const std::string &)
 
virtual BaseViewergetViewer ()
 
virtual void registerViewer (BaseViewer *)
 
virtual bool saveScreenshot (const std::string &filename, int compression_level=-1)
 
virtual void setMouseButtonConfiguration (sofa::component::configurationsetting::MouseButtonSetting *)
 
methods to communicate with the GUI

Do one step of the GUI loop

virtual void stepMainLoop ()
 
virtual void sendMessage (const std::string &, const std::string &)
 Send a (script) message. More...
 
virtual void showFPS (double)
 Force the displayed FPS value (if any) More...
 

Static Public Member Functions

static std::string & GetGUIName ()
 
static const char * GetProgramName ()
 
static void SetProgramName (const char *argv0)
 
static void SetArgumentParser (ArgumentParser *parser)
 
static const std::string & getConfigDirectoryPath ()
 
static const std::string & getScreenshotDirectoryPath ()
 
static void setConfigDirectoryPath (const std::string &path, bool createIfNecessary=false)
 
static void setScreenshotDirectoryPath (const std::string &path, bool createIfNecessary=false)
 

Protected Member Functions

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

Attribute details

std::string sofa::gui::BaseGUI::configDirectoryPath = "."
staticprotected
ArgumentParser * sofa::gui::BaseGUI::mArgumentParser = nullptr
staticprotected
std::string sofa::gui::BaseGUI::mGuiName = ""
staticprotected
const char * sofa::gui::BaseGUI::mProgramName = nullptr
staticprotected
std::string sofa::gui::BaseGUI::screenshotDirectoryPath = "."
staticprotected

Constructor details

sofa::gui::BaseGUI::BaseGUI ( )
protected
sofa::gui::BaseGUI::~BaseGUI ( )
protectedvirtual

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

Function details

virtual int sofa::gui::BaseGUI::closeGUI ( )
pure virtual
void sofa::gui::BaseGUI::configureGUI ( sofa::simulation::Node::SPtr  groot)
virtual

Use a component setting to configure our GUI.

virtual sofa::simulation::Node* sofa::gui::BaseGUI::currentSimulation ( )
pure virtual

Get the rootNode of the sofa scene.

Implemented in sofa::gui::qt::RealGUI, sofa::gui::hRecorder::HeadlessRecorder, and sofa::gui::BatchGUI.

void sofa::gui::BaseGUI::exportGnuplot ( sofa::simulation::Node node,
std::string  gnuplot_directory = "" 
)
const std::string & sofa::gui::BaseGUI::getConfigDirectoryPath ( )
static
static std::string& sofa::gui::BaseGUI::GetGUIName ( )
inlinestatic
static const char* sofa::gui::BaseGUI::GetProgramName ( )
inlinestatic
const std::string & sofa::gui::BaseGUI::getScreenshotDirectoryPath ( )
static
virtual BaseViewer* sofa::gui::BaseGUI::getViewer ( )
inlinevirtual

Reimplemented in sofa::gui::qt::RealGUI.

virtual void sofa::gui::BaseGUI::initViewer ( BaseViewer )
inlinevirtual

Reimplemented in sofa::gui::qt::RealGUI.

virtual int sofa::gui::BaseGUI::mainLoop ( )
pure virtual
virtual void sofa::gui::BaseGUI::redraw ( )
pure virtual

Update the GUI.

Implemented in sofa::gui::hRecorder::HeadlessRecorder, and sofa::gui::BatchGUI.

virtual void sofa::gui::BaseGUI::registerViewer ( BaseViewer )
inlinevirtual

Reimplemented in sofa::gui::qt::RealGUI.

bool sofa::gui::BaseGUI::saveScreenshot ( const std::string &  filename,
int  compression_level = -1 
)
virtual
virtual void sofa::gui::BaseGUI::sendMessage ( const std::string &  ,
const std::string &   
)
inlinevirtual

Send a (script) message.

static void sofa::gui::BaseGUI::SetArgumentParser ( ArgumentParser parser)
inlinestatic
virtual void sofa::gui::BaseGUI::setBackgroundColor ( const sofa::helper::types::RGBAColor )
inlinevirtual

Reimplemented in sofa::gui::qt::RealGUI.

virtual void sofa::gui::BaseGUI::setBackgroundImage ( const std::string &  )
inlinevirtual

Reimplemented in sofa::gui::qt::RealGUI.

void sofa::gui::BaseGUI::setConfigDirectoryPath ( const std::string &  path,
bool  createIfNecessary = false 
)
static
virtual void sofa::gui::BaseGUI::setDumpState ( bool  )
inlinevirtual

Reimplemented in sofa::gui::qt::RealGUI.

virtual void sofa::gui::BaseGUI::setExportState ( bool  )
inlinevirtual

Reimplemented in sofa::gui::qt::RealGUI.

virtual void sofa::gui::BaseGUI::setFullScreen ( )
inlinevirtual

Reimplemented in sofa::gui::qt::RealGUI.

virtual void sofa::gui::BaseGUI::setGnuplotPath ( const std::string &  )
inlinevirtual

Reimplemented in sofa::gui::qt::RealGUI.

virtual void sofa::gui::BaseGUI::setLogTime ( bool  )
inlinevirtual

Reimplemented in sofa::gui::qt::RealGUI.

virtual void sofa::gui::BaseGUI::setMouseButtonConfiguration ( sofa::component::configurationsetting::MouseButtonSetting )
inlinevirtual

Reimplemented in sofa::gui::qt::RealGUI.

static void sofa::gui::BaseGUI::SetProgramName ( const char *  argv0)
inlinestatic
virtual void sofa::gui::BaseGUI::setRecordPath ( const std::string &  )
inlinevirtual

Reimplemented in sofa::gui::qt::RealGUI.

virtual void sofa::gui::BaseGUI::setScene ( sofa::simulation::Node::SPtr  groot,
const char *  filename = nullptr,
bool  temporaryFile = false 
)
pure virtual

Register the scene in our GUI.

Implemented in sofa::gui::qt::RealGUI, sofa::gui::hRecorder::HeadlessRecorder, and sofa::gui::BatchGUI.

void sofa::gui::BaseGUI::setScreenshotDirectoryPath ( const std::string &  path,
bool  createIfNecessary = false 
)
static
virtual void sofa::gui::BaseGUI::setViewerConfiguration ( sofa::component::configurationsetting::ViewerSetting )
inlinevirtual

Reimplemented in sofa::gui::qt::RealGUI.

virtual void sofa::gui::BaseGUI::setViewerResolution ( int  ,
int   
)
inlinevirtual
virtual void sofa::gui::BaseGUI::showFPS ( double  )
inlinevirtual

Force the displayed FPS value (if any)

Reimplemented in sofa::gui::qt::RealGUI.

virtual void sofa::gui::BaseGUI::stepMainLoop ( )
inlinevirtual

Reimplemented in sofa::gui::qt::RealGUI.