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

#include <BatchGUI.h>

Inheritance diagram for sofa::gui::batch::BatchGUI:

Protected Attributes

std::ostringstream m_dumpVisitorStream
 
sofa::simulation::NodeSPtr groot
 
std::string filename
 

Static Protected Attributes

static signed int nbIter = BatchGUI::DEFAULT_NUMBER_OF_ITERATIONS
 
static std::string nbIterInp =""
 
static bool hideProgressBar { false }
 
- Static Protected Attributes inherited from sofa::gui::common::BaseGUI
static std::string mGuiName = ""
 
static std::string configDirectoryPath = "."
 
static std::string screenshotDirectoryPath = "."
 
static const charmProgramName = nullptr
 
static ArgumentParsermArgumentParser = nullptr
 

Public Member Functions

bool canBeDefaultGUI () const override
 
methods each GUI must implement
 BatchGUI ()
 
void setScene (sofa::simulation::NodeSPtr groot, const char *filename="", bool temporaryFile=false) override
 Register the scene in our GUI. More...
 
void resetScene ()
 
int mainLoop () override
 
void redraw () override
 Update the GUI. More...
 
int closeGUI () override
 Close the GUI. More...
 
sofa::simulation::NodecurrentSimulation () override
 Get the rootNode of the sofa scene. More...
 
- Public Member Functions inherited from sofa::gui::common::BaseGUI
virtual void configureGUI (sofa::simulation::NodeSPtr groot)
 Use a component setting to configure our GUI. More...
 
void exportGnuplot (sofa::simulation::Node *node, std::string gnuplot_directory="")
 
virtual void setDumpState (bool)
 
virtual void setLogTime (bool)
 
virtual void setExportState (bool)
 
virtual void setGnuplotPath (const std::string &)
 
virtual void initViewer (BaseViewer *)
 
virtual void setViewerConfiguration (sofa::component::setting::ViewerSetting *)
 
virtual void setViewerResolution (int, int)
 
virtual void setFullScreen ()
 
virtual void centerWindow ()
 
virtual void setBackgroundColor (const sofa::type::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::setting::MouseButtonSetting *)
 
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...
 

Protected Member Functions

 ~BatchGUI () override
 The destructor should not be called directly. Use the closeGUI() method instead. More...
 
void startDumpVisitor ()
 
void stopDumpVisitor ()
 
void exportJson (const std::string &timerOutputStr, int iterationNumber) const
 Export a text file (with json extension) containing the timer output string. More...
 
- Protected Member Functions inherited from sofa::gui::common::BaseGUI
 BaseGUI ()
 
virtual ~BaseGUI ()
 The destructor should not be called directly. Use the closeGUI() method instead. More...
 

Static Protected Member Functions

static bool canExportJson (const std::string &timerOutputStr, const std::string &timerId)
 Return true if the timer output string has a json string and the timer is setup to output json. More...
 

registration of each GUI

static const signed int DEFAULT_NUMBER_OF_ITERATIONS = 1000
 
static BaseGUICreateGUI (const char *name, sofa::simulation::NodeSPtr groot=nullptr, const char *filename=nullptr)
 
static int RegisterGUIParameters (common::ArgumentParser *argumentParser)
 
static void OnNbIterChange (const common::ArgumentParser *, const std::string &strValue)
 

Additional Inherited Members

- Static Public Member Functions inherited from sofa::gui::common::BaseGUI
static std::string & GetGUIName ()
 
static const charGetProgramName ()
 
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)
 

Attribute details

◆ DEFAULT_NUMBER_OF_ITERATIONS

constexpr signed int sofa::gui::batch::BatchGUI::DEFAULT_NUMBER_OF_ITERATIONS = 1000
staticconstexpr

◆ filename

std::string sofa::gui::batch::BatchGUI::filename
protected

◆ groot

sofa::simulation::NodeSPtr sofa::gui::batch::BatchGUI::groot
protected

◆ hideProgressBar

bool sofa::gui::batch::BatchGUI::hideProgressBar { false }
inlinestaticprotected

◆ m_dumpVisitorStream

std::ostringstream sofa::gui::batch::BatchGUI::m_dumpVisitorStream
protected

◆ nbIter

signed int sofa::gui::batch::BatchGUI::nbIter = BatchGUI::DEFAULT_NUMBER_OF_ITERATIONS
staticprotected

◆ nbIterInp

std::string sofa::gui::batch::BatchGUI::nbIterInp =""
staticprotected

Constructor details

◆ BatchGUI()

sofa::gui::batch::BatchGUI::BatchGUI ( )

◆ ~BatchGUI()

sofa::gui::batch::BatchGUI::~BatchGUI ( )
overrideprotected

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

Function details

◆ canBeDefaultGUI()

bool sofa::gui::batch::BatchGUI::canBeDefaultGUI ( ) const
inlineoverridevirtual

If the function returns true: when the GUI is created, its name will be saved so that it will be created when no GUI is specified. If the function returns false, the GUI name is not saved, and the last one will be used when no GUI is specified.

Reimplemented from sofa::gui::common::BaseGUI.

◆ canExportJson()

bool sofa::gui::batch::BatchGUI::canExportJson ( const std::string &  timerOutputStr,
const std::string &  timerId 
)
staticprotected

Return true if the timer output string has a json string and the timer is setup to output json.

◆ closeGUI()

int sofa::gui::batch::BatchGUI::closeGUI ( )
overridevirtual

Close the GUI.

Implements sofa::gui::common::BaseGUI.

◆ CreateGUI()

BaseGUI * sofa::gui::batch::BatchGUI::CreateGUI ( const char name,
sofa::simulation::NodeSPtr  groot = nullptr,
const char filename = nullptr 
)
static

◆ currentSimulation()

sofa::simulation::Node * sofa::gui::batch::BatchGUI::currentSimulation ( )
overridevirtual

Get the rootNode of the sofa scene.

Implements sofa::gui::common::BaseGUI.

◆ exportJson()

void sofa::gui::batch::BatchGUI::exportJson ( const std::string &  timerOutputStr,
int  iterationNumber 
) const
protected

Export a text file (with json extension) containing the timer output string.

◆ mainLoop()

int sofa::gui::batch::BatchGUI::mainLoop ( )
overridevirtual

◆ OnNbIterChange()

void sofa::gui::batch::BatchGUI::OnNbIterChange ( const common::ArgumentParser argumentParser,
const std::string &  strValue 
)
static

◆ redraw()

void sofa::gui::batch::BatchGUI::redraw ( )
overridevirtual

Update the GUI.

Implements sofa::gui::common::BaseGUI.

◆ RegisterGUIParameters()

int sofa::gui::batch::BatchGUI::RegisterGUIParameters ( common::ArgumentParser argumentParser)
static

◆ resetScene()

void sofa::gui::batch::BatchGUI::resetScene ( )

◆ setScene()

void sofa::gui::batch::BatchGUI::setScene ( sofa::simulation::NodeSPtr  groot,
const char filename = "",
bool  temporaryFile = false 
)
overridevirtual

Register the scene in our GUI.

Implements sofa::gui::common::BaseGUI.

◆ startDumpVisitor()

void sofa::gui::batch::BatchGUI::startDumpVisitor ( )
protected

◆ stopDumpVisitor()

void sofa::gui::batch::BatchGUI::stopDumpVisitor ( )
protected