Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfCSimulator.h File Reference
#include "tf_port_c.h"
#include "tfCUniverse.h"
Include dependency graph for tfCSimulator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tfSimulatorEngineIntegratorHandle
 
struct  tfSimulatorConfigHandle
 Handle to a Simulator::Config instance. More...
 
struct  tfSimulatorHandle
 Handle to a Simulator instance. More...
 

Functions

HRESULT tfSimulatorEngineIntegrator_init (struct tfSimulatorEngineIntegratorHandle *handle)
 Populate engine integrator enums.
 
HRESULT tfSimulatorConfig_init (struct tfSimulatorConfigHandle *handle)
 Initialize a new instance.
 
HRESULT tfSimulatorConfig_getTitle (struct tfSimulatorConfigHandle *handle, char **title, unsigned int *numChars)
 Get the title of a configuration.
 
HRESULT tfSimulatorConfig_setTitle (struct tfSimulatorConfigHandle *handle, char *title)
 Set the title of a configuration.
 
HRESULT tfSimulatorConfig_getWindowSize (struct tfSimulatorConfigHandle *handle, unsigned int *x, unsigned int *y)
 Get the window size.
 
HRESULT tfSimulatorConfig_setWindowSize (struct tfSimulatorConfigHandle *handle, unsigned int x, unsigned int y)
 Set the window size.
 
HRESULT tfSimulatorConfig_getSeed (struct tfSimulatorConfigHandle *handle, unsigned int *seed)
 Get the random number generator seed. If none is set, returns NULL.
 
HRESULT tfSimulatorConfig_setSeed (struct tfSimulatorConfigHandle *handle, unsigned int seed)
 Set the random number generator seed.
 
HRESULT tfSimulatorConfig_getWindowless (struct tfSimulatorConfigHandle *handle, bool *windowless)
 Get the windowless flag.
 
HRESULT tfSimulatorConfig_setWindowless (struct tfSimulatorConfigHandle *handle, bool windowless)
 Set the windowless flag.
 
HRESULT tfSimulatorConfig_getImportDataFilePath (struct tfSimulatorConfigHandle *handle, char **filePath, unsigned int *numChars)
 Get the imported data file path during initialization, if any.
 
HRESULT tfSimulatorConfig_setImportDataFilePath (struct tfSimulatorConfigHandle *handle, char *filePath)
 Set the imported data file path during initialization, if any.
 
HRESULT tfSimulatorConfig_getClipPlanes (struct tfSimulatorConfigHandle *handle, float **clipPlanes, unsigned int *numClipPlanes)
 Get the current clip planes.
 
HRESULT tfSimulatorConfig_setClipPlanes (struct tfSimulatorConfigHandle *handle, float *clipPlanes, unsigned int numClipPlanes)
 Set the clip planes.
 
HRESULT tfSimulatorConfig_getUniverseConfig (struct tfSimulatorConfigHandle *handle, struct tfUniverseConfigHandle *confHandle)
 Get the universe configuration.
 
HRESULT tfSimulatorConfig_destroy (struct tfSimulatorConfigHandle *handle)
 Destroy an instance.
 
HRESULT tfSimulator_init (char **argv, unsigned int nargs)
 Main simulator init method.
 
HRESULT tfSimulator_initC (struct tfSimulatorConfigHandle *conf, char **appArgv, unsigned int nargs)
 Main simulator init method.
 
HRESULT tfSimulator_get (struct tfSimulatorHandle *handle)
 Gets the global simulator object.
 
HRESULT tfSimulator_makeCurrent (struct tfSimulatorHandle *handle)
 Make the instance the global simulator object.
 
HRESULT tfSimulator_run (tfFloatP_t et)
 Runs the event loop until all windows close or simulation time expires. Automatically performs universe time propogation.
 
HRESULT tfSimulator_show ()
 Shows any windows that were specified in the config.
 
HRESULT tfSimulator_close ()
 Closes the main window, while the application / simulation continues to run.
 
HRESULT tfSimulator_destroy ()
 Destroy the simulation.
 
HRESULT tfSimulator_redraw ()
 Issue call to rendering update.
 
HRESULT tfSimulator_getNumThreads (unsigned int *numThreads)
 Get the number of threads.
 
bool tfIsTerminalInteractiveShell ()
 Test whether running interactively.
 
HRESULT tfSetIsTerminalInteractiveShell (bool _interactive)
 Set whether running interactively.
 

Function Documentation

◆ tfSimulator_close()

HRESULT tfSimulator_close ( )

Closes the main window, while the application / simulation continues to run.

Returns
S_OK on success

◆ tfSimulator_destroy()

HRESULT tfSimulator_destroy ( )

Destroy the simulation.

Returns
S_OK on success

◆ tfSimulator_get()

HRESULT tfSimulator_get ( struct tfSimulatorHandle * handle)

Gets the global simulator object.

Parameters
handlehandle
Returns
S_OK on success

◆ tfSimulator_getNumThreads()

HRESULT tfSimulator_getNumThreads ( unsigned int * numThreads)

Get the number of threads.

Parameters
numThreadsnumber of threads
Returns
S_OK on success

◆ tfSimulator_init()

HRESULT tfSimulator_init ( char ** argv,
unsigned int nargs )

Main simulator init method.

Parameters
argvinitializer arguments
nargsnumber of arguments
Returns
S_OK on success

◆ tfSimulator_initC()

HRESULT tfSimulator_initC ( struct tfSimulatorConfigHandle * conf,
char ** appArgv,
unsigned int nargs )

Main simulator init method.

Parameters
confconfiguration
appArgvapp arguments
nargsnumber of app arguments
Returns
S_OK on success

◆ tfSimulator_makeCurrent()

HRESULT tfSimulator_makeCurrent ( struct tfSimulatorHandle * handle)

Make the instance the global simulator object.

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfSimulator_redraw()

HRESULT tfSimulator_redraw ( )

Issue call to rendering update.

Returns
S_OK on success

◆ tfSimulator_run()

HRESULT tfSimulator_run ( tfFloatP_t et)

Runs the event loop until all windows close or simulation time expires. Automatically performs universe time propogation.

Parameters
etperiod to execute, in units of simulation time; a negative number runs infinitely
Returns
S_OK on success

◆ tfSimulator_show()

HRESULT tfSimulator_show ( )

Shows any windows that were specified in the config.

Does not start the universe time propagation unlike tfSimulator_run().

Returns
S_OK on success

◆ tfSimulatorConfig_destroy()

HRESULT tfSimulatorConfig_destroy ( struct tfSimulatorConfigHandle * handle)

Destroy an instance.

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfSimulatorConfig_getClipPlanes()

HRESULT tfSimulatorConfig_getClipPlanes ( struct tfSimulatorConfigHandle * handle,
float ** clipPlanes,
unsigned int * numClipPlanes )

Get the current clip planes.

Parameters
handlepopulated handle
clipPlanesclip planes
numClipPlanesnumber of clip planes
Returns
S_OK on success

◆ tfSimulatorConfig_getImportDataFilePath()

HRESULT tfSimulatorConfig_getImportDataFilePath ( struct tfSimulatorConfigHandle * handle,
char ** filePath,
unsigned int * numChars )

Get the imported data file path during initialization, if any.

Parameters
handlepopulated handle
filePathfile path
numCharsnumber of characters
Returns
S_OK on success

◆ tfSimulatorConfig_getSeed()

HRESULT tfSimulatorConfig_getSeed ( struct tfSimulatorConfigHandle * handle,
unsigned int * seed )

Get the random number generator seed. If none is set, returns NULL.

Parameters
handlepopulated handle
seedrandom number generator seed
Returns
S_OK on success

◆ tfSimulatorConfig_getTitle()

HRESULT tfSimulatorConfig_getTitle ( struct tfSimulatorConfigHandle * handle,
char ** title,
unsigned int * numChars )

Get the title of a configuration.

Parameters
handlepopulated handle
titletitle
numCharsnumber of characters
Returns
S_OK on success

◆ tfSimulatorConfig_getUniverseConfig()

HRESULT tfSimulatorConfig_getUniverseConfig ( struct tfSimulatorConfigHandle * handle,
struct tfUniverseConfigHandle * confHandle )

Get the universe configuration.

Parameters
handlepopulated handle
confHandlehandle to populate
Returns
S_OK on success

◆ tfSimulatorConfig_getWindowless()

HRESULT tfSimulatorConfig_getWindowless ( struct tfSimulatorConfigHandle * handle,
bool * windowless )

Get the windowless flag.

Parameters
handlepopulated handle
windowlesswindowless flag
Returns
HRESULT

◆ tfSimulatorConfig_getWindowSize()

HRESULT tfSimulatorConfig_getWindowSize ( struct tfSimulatorConfigHandle * handle,
unsigned int * x,
unsigned int * y )

Get the window size.

Parameters
handlepopulated handle
xwidth
yheight
Returns
S_OK on success

◆ tfSimulatorConfig_init()

HRESULT tfSimulatorConfig_init ( struct tfSimulatorConfigHandle * handle)

Initialize a new instance.

Parameters
handlehandle to populate
Returns
S_OK on success

◆ tfSimulatorConfig_setClipPlanes()

HRESULT tfSimulatorConfig_setClipPlanes ( struct tfSimulatorConfigHandle * handle,
float * clipPlanes,
unsigned int numClipPlanes )

Set the clip planes.

Parameters
handlepopulated handle
clipPlanesclip planes
numClipPlanesnumber of clip planes
Returns
HRESULT

◆ tfSimulatorConfig_setImportDataFilePath()

HRESULT tfSimulatorConfig_setImportDataFilePath ( struct tfSimulatorConfigHandle * handle,
char * filePath )

Set the imported data file path during initialization, if any.

Parameters
handlepopulated handle
filePathfile path
Returns
S_OK on success

◆ tfSimulatorConfig_setSeed()

HRESULT tfSimulatorConfig_setSeed ( struct tfSimulatorConfigHandle * handle,
unsigned int seed )

Set the random number generator seed.

Parameters
handlepopulated handle
seedrandom number generator seed
Returns
S_OK on success

◆ tfSimulatorConfig_setTitle()

HRESULT tfSimulatorConfig_setTitle ( struct tfSimulatorConfigHandle * handle,
char * title )

Set the title of a configuration.

Parameters
handlepopulated handle
titletitle
Returns
S_OK on success

◆ tfSimulatorConfig_setWindowless()

HRESULT tfSimulatorConfig_setWindowless ( struct tfSimulatorConfigHandle * handle,
bool windowless )

Set the windowless flag.

Parameters
handlepopulated handle
windowlesswindowless flag
Returns
HRESULT

◆ tfSimulatorConfig_setWindowSize()

HRESULT tfSimulatorConfig_setWindowSize ( struct tfSimulatorConfigHandle * handle,
unsigned int x,
unsigned int y )

Set the window size.

Parameters
handlepopulated handle
xwidth
yheight
Returns
S_OK on success

◆ tfSimulatorEngineIntegrator_init()

HRESULT tfSimulatorEngineIntegrator_init ( struct tfSimulatorEngineIntegratorHandle * handle)

Populate engine integrator enums.

Parameters
handlehandle to populate
Returns
S_OK on success