Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfCSimulator.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of Tissue Forge.
3 * Copyright (c) 2022-2024 T.J. Sego
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 ******************************************************************************/
19
25#ifndef _WRAPS_C_TFCSIMULATOR_H_
26#define _WRAPS_C_TFCSIMULATOR_H_
27
28#include "tf_port_c.h"
29
30#include "tfCUniverse.h"
31
32// Handles
33
35 int FORWARD_EULER;
36 int RUNGE_KUTTA_4;
37};
38
43struct CAPI_EXPORT tfSimulatorConfigHandle {
44 void *tfObj;
45};
46
51struct CAPI_EXPORT tfSimulatorHandle {
52 void *tfObj;
53};
54
55
57// Simulator::EngineIntegrator //
59
60
68
69
71// Simulator::Config //
73
74
81CAPI_FUNC(HRESULT) tfSimulatorConfig_init(struct tfSimulatorConfigHandle *handle);
82
91CAPI_FUNC(HRESULT) tfSimulatorConfig_getTitle(struct tfSimulatorConfigHandle *handle, char **title, unsigned int *numChars);
92
100CAPI_FUNC(HRESULT) tfSimulatorConfig_setTitle(struct tfSimulatorConfigHandle *handle, char *title);
101
110CAPI_FUNC(HRESULT) tfSimulatorConfig_getWindowSize(struct tfSimulatorConfigHandle *handle, unsigned int *x, unsigned int *y);
111
120CAPI_FUNC(HRESULT) tfSimulatorConfig_setWindowSize(struct tfSimulatorConfigHandle *handle, unsigned int x, unsigned int y);
121
129CAPI_FUNC(HRESULT) tfSimulatorConfig_getSeed(struct tfSimulatorConfigHandle *handle, unsigned int *seed);
130
138CAPI_FUNC(HRESULT) tfSimulatorConfig_setSeed(struct tfSimulatorConfigHandle *handle, unsigned int seed);
139
147CAPI_FUNC(HRESULT) tfSimulatorConfig_getWindowless(struct tfSimulatorConfigHandle *handle, bool *windowless);
148
156CAPI_FUNC(HRESULT) tfSimulatorConfig_setWindowless(struct tfSimulatorConfigHandle *handle, bool windowless);
157
166CAPI_FUNC(HRESULT) tfSimulatorConfig_getImportDataFilePath(struct tfSimulatorConfigHandle *handle, char **filePath, unsigned int *numChars);
167
175CAPI_FUNC(HRESULT) tfSimulatorConfig_setImportDataFilePath(struct tfSimulatorConfigHandle *handle, char *filePath);
176
185CAPI_FUNC(HRESULT) tfSimulatorConfig_getClipPlanes(struct tfSimulatorConfigHandle *handle, float **clipPlanes, unsigned int *numClipPlanes);
186
195CAPI_FUNC(HRESULT) tfSimulatorConfig_setClipPlanes(struct tfSimulatorConfigHandle *handle, float *clipPlanes, unsigned int numClipPlanes);
196
204CAPI_FUNC(HRESULT) tfSimulatorConfig_getUniverseConfig(struct tfSimulatorConfigHandle *handle, struct tfUniverseConfigHandle *confHandle);
205
212CAPI_FUNC(HRESULT) tfSimulatorConfig_destroy(struct tfSimulatorConfigHandle *handle);
213
214
216// Simulator //
218
226CAPI_FUNC(HRESULT) tfSimulator_init(char **argv, unsigned int nargs);
227
236CAPI_FUNC(HRESULT) tfSimulator_initC(struct tfSimulatorConfigHandle *conf, char **appArgv, unsigned int nargs);
237
244CAPI_FUNC(HRESULT) tfSimulator_get(struct tfSimulatorHandle *handle);
245
252CAPI_FUNC(HRESULT) tfSimulator_makeCurrent(struct tfSimulatorHandle *handle);
253
261CAPI_FUNC(HRESULT) tfSimulator_run(tfFloatP_t et);
262
270CAPI_FUNC(HRESULT) tfSimulator_show();
271
277CAPI_FUNC(HRESULT) tfSimulator_close();
278
284CAPI_FUNC(HRESULT) tfSimulator_destroy();
285
291CAPI_FUNC(HRESULT) tfSimulator_redraw();
292
299CAPI_FUNC(HRESULT) tfSimulator_getNumThreads(unsigned int *numThreads);
300
301
303// Module functions //
305
306
312
316CAPI_FUNC(HRESULT) tfSetIsTerminalInteractiveShell(bool _interactive);
317
318#endif // _WRAPS_C_TFCSIMULATOR_H_
Handle to a Simulator::Config instance.
Definition tfCSimulator.h:43
Definition tfCSimulator.h:34
Handle to a Simulator instance.
Definition tfCSimulator.h:51
Handle to a UniverseConfig instance.
Definition tfCUniverse.h:39
HRESULT tfSimulatorConfig_setWindowless(struct tfSimulatorConfigHandle *handle, bool windowless)
Set the windowless flag.
HRESULT tfSimulatorConfig_setImportDataFilePath(struct tfSimulatorConfigHandle *handle, char *filePath)
Set the imported data file path during initialization, if any.
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_destroy()
Destroy the simulation.
bool tfIsTerminalInteractiveShell()
Test whether running interactively.
HRESULT tfSimulatorConfig_getWindowless(struct tfSimulatorConfigHandle *handle, bool *windowless)
Get the windowless flag.
HRESULT tfSimulatorConfig_setSeed(struct tfSimulatorConfigHandle *handle, unsigned int seed)
Set the random number generator seed.
HRESULT tfSimulatorConfig_init(struct tfSimulatorConfigHandle *handle)
Initialize a new instance.
HRESULT tfSimulatorConfig_setWindowSize(struct tfSimulatorConfigHandle *handle, unsigned int x, unsigned int y)
Set the window size.
HRESULT tfSimulatorEngineIntegrator_init(struct tfSimulatorEngineIntegratorHandle *handle)
Populate engine integrator enums.
HRESULT tfSimulator_close()
Closes the main window, while the application / simulation continues to run.
HRESULT tfSimulatorConfig_getSeed(struct tfSimulatorConfigHandle *handle, unsigned int *seed)
Get the random number generator seed. If none is set, returns NULL.
HRESULT tfSimulator_show()
Shows any windows that were specified in the config.
HRESULT tfSimulator_run(tfFloatP_t et)
Runs the event loop until all windows close or simulation time expires. Automatically performs univer...
HRESULT tfSimulatorConfig_getClipPlanes(struct tfSimulatorConfigHandle *handle, float **clipPlanes, unsigned int *numClipPlanes)
Get the current clip planes.
HRESULT tfSimulatorConfig_getImportDataFilePath(struct tfSimulatorConfigHandle *handle, char **filePath, unsigned int *numChars)
Get the imported data file path during initialization, if any.
HRESULT tfSimulator_makeCurrent(struct tfSimulatorHandle *handle)
Make the instance the global simulator object.
HRESULT tfSimulatorConfig_getTitle(struct tfSimulatorConfigHandle *handle, char **title, unsigned int *numChars)
Get the title of a configuration.
HRESULT tfSimulator_getNumThreads(unsigned int *numThreads)
Get the number of threads.
HRESULT tfSimulator_redraw()
Issue call to rendering update.
HRESULT tfSimulator_get(struct tfSimulatorHandle *handle)
Gets the global simulator object.
HRESULT tfSimulatorConfig_setClipPlanes(struct tfSimulatorConfigHandle *handle, float *clipPlanes, unsigned int numClipPlanes)
Set the clip planes.
HRESULT tfSimulatorConfig_destroy(struct tfSimulatorConfigHandle *handle)
Destroy an instance.
HRESULT tfSimulatorConfig_getUniverseConfig(struct tfSimulatorConfigHandle *handle, struct tfUniverseConfigHandle *confHandle)
Get the universe configuration.
HRESULT tfSimulatorConfig_getWindowSize(struct tfSimulatorConfigHandle *handle, unsigned int *x, unsigned int *y)
Get the window size.
HRESULT tfSimulatorConfig_setTitle(struct tfSimulatorConfigHandle *handle, char *title)
Set the title of a configuration.
HRESULT tfSetIsTerminalInteractiveShell(bool _interactive)
Set whether running interactively.