25#ifndef _SOURCE_TFSIMULATOR_H_
26#define _SOURCE_TFSIMULATOR_H_
28#include "TissueForge_private.h"
32#include "cuda/tfSimulatorConfig.h"
129 enum class EngineIntegrator :
int {
130 FORWARD_EULER = TissueForge::EngineIntegrator::FORWARD_EULER,
131 RUNGE_KUTTA_4 = TissueForge::EngineIntegrator::RUNGE_KUTTA_4
172 enum class DpiScalingPolicy : std::uint8_t {
175 #ifdef CORRADE_TARGET_APPLE
179 #ifndef CORRADE_TARGET_APPLE
186 #ifdef CORRADE_TARGET_APPLE
194 struct rendering::Application *app;
344 std::vector<rendering::GlfwWindow*> windows;
389 _title = std::move(
title);
408 return _dpiScalingPolicy;
426 void setDpiScaling(
const fVector2 &vec)
432 void setSizeAndScaling(
const iVector2& size, Simulator::DpiScalingPolicy dpiScalingPolicy = Simulator::DpiScalingPolicy::Default) {
434 _dpiScalingPolicy = dpiScalingPolicy;
439 void setSizeAndScaling(
const iVector2& size,
const FVector2& dpiScaling) {
441 _dpiScaling = dpiScaling;
475 bool windowless()
const {
479 void setWindowless(
bool val) {
484 return universeConfig.nParticles;
487 void setSize(
int i ) {
488 universeConfig.nParticles = i;
498 if(_seed != NULL) *_seed =
seed;
499 else _seed =
new unsigned int(
seed);
503 return _throwingExceptions;
506 void setThrowingExceptions(
const bool &throwingExceptions) {
507 _throwingExceptions = throwingExceptions;
512 return _importDataFilePath;
517 return _importDataFilePath;
522 if(_importDataFilePath) {
523 delete _importDataFilePath;
524 _importDataFilePath = NULL;
528 void setImportDataFilePath(
const std::string &_path) {
529 clearImportDataFilePath();
530 _importDataFilePath =
new std::string();
531 *_importDataFilePath = _path;
549 uint32_t _windowFlags;
550 Simulator::DpiScalingPolicy _dpiScalingPolicy;
551 FVector2 _dpiScaling;
553 unsigned int *_seed = NULL;
554 bool _throwingExceptions =
false;
555 std::string *_importDataFilePath = NULL;
577 #ifndef MAGNUM_TARGET_GLES
587 #if defined(DOXYGEN_GENERATING_OUTPUT) || defined(GLFW_CONTEXT_NO_ERROR)
661 std::int32_t
version()
const {
return _version; }
686 _colorBufferSize = size;
700 _depthBufferSize = size;
714 _stencilBufferSize = size;
730 _sampleCount = count;
745 _srgbCapable = enabled;
751 iVector4 _colorBufferSize;
752 std::int32_t _depthBufferSize, _stencilBufferSize;
753 std::int32_t _sampleCount;
754 std::int32_t _version;
763 CAPI_FUNC(
HRESULT) modules_init();
OpenGL context configuration.
Definition tfSimulator.h:569
GLConfig & setDepthBufferSize(std::int32_t size)
Set depth buffer size.
Definition tfSimulator.h:699
std::int32_t version() const
Context version.
Definition tfSimulator.h:661
GLConfig & setStencilBufferSize(std::int32_t size)
Set stencil buffer size.
Definition tfSimulator.h:713
std::int32_t sampleCount() const
Sample count.
Definition tfSimulator.h:719
std::int32_t depthBufferSize() const
Depth buffer size.
Definition tfSimulator.h:691
GLConfig & setFlags(Flags flags)
Set context flags.
Definition tfSimulator.h:629
GLConfig & setSampleCount(std::int32_t count)
Set sample count.
Definition tfSimulator.h:729
std::int32_t stencilBufferSize() const
Stencil buffer size.
Definition tfSimulator.h:705
GLConfig & setSrgbCapable(bool enabled)
Set sRGB-capable default framebuffer.
Definition tfSimulator.h:744
GLConfig & setVersion(std::int32_t version)
Set context version.
Definition tfSimulator.h:671
iVector4 colorBufferSize() const
Color buffer size.
Definition tfSimulator.h:677
GLConfig & addFlags(Flags flags)
Add context flags.
Definition tfSimulator.h:642
bool isSrgbCapable() const
sRGB-capable default framebuffer
Definition tfSimulator.h:735
GLConfig & clearFlags(Flags flags)
Clear context flags.
Definition tfSimulator.h:655
Flag
Context flag.
Definition tfSimulator.h:576
@ ForwardCompatible
Definition tfSimulator.h:584
@ Stereo
Definition tfSimulator.h:605
@ Debug
Definition tfSimulator.h:603
uint32_t Flags
Context flags.
Definition tfSimulator.h:613
Flags flags() const
Context flags.
Definition tfSimulator.h:619
GLConfig & setColorBufferSize(const iVector4 &size)
Set color buffer size.
Definition tfSimulator.h:685
Tissue Forge I/O.
Definition tfThreeDFAngleMeshGenerator.h:28
HRESULT toFile(const T &dataElement, const MetaData &metaData, IOElement &fileElement)
Convert an object to an intermediate I/O object.
HRESULT fromFile(const IOElement &fileElement, const MetaData &metaData, T *dataElement)
Instantiate an object from an intermediate I/O object.
Tissue Forge rendering and visualization.
Definition tfAngle.h:38
Include Python header, disable linking to pythonX_d.lib on Windows in debug mode.
Definition tfAngleConfig.h:26
HRESULT setIsTerminalInteractiveShell(const bool &_interactive)
Set whether running interactively.
bool isTerminalInteractiveShell()
Test whether running interactively.
HRESULT Simulator_init(const std::vector< std::string > &argv)
Definition tfSimulator.h:368
unsigned int * seed()
Definition tfSimulator.h:492
void setWindowFlags(uint32_t windowFlags)
Set window flags.
Definition tfSimulator.h:470
void setTitle(std::string title)
Set window title.
Definition tfSimulator.h:387
UniverseConfig universeConfig
Definition tfSimulator.h:535
void clearImportDataFilePath()
Definition tfSimulator.h:521
void setWindowSize(const iVector2 &size)
Set window size.
Definition tfSimulator.h:453
iVector2 windowSize() const
Window size.
Definition tfSimulator.h:393
std::string * importDataFilePath()
Definition tfSimulator.h:511
std::vector< FVector4 > clipPlanes
Definition tfSimulator.h:544
bool hasImportDataFilePath() const
Definition tfSimulator.h:516
fVector2 dpiScaling() const
Custom DPI scaling.
Definition tfSimulator.h:421
Simulator::DpiScalingPolicy dpiScalingPolicy() const
DPI scaling policy.
Definition tfSimulator.h:406
void setSeed(const unsigned int &seed)
Definition tfSimulator.h:497
std::string title() const
Window title.
Definition tfSimulator.h:376
uint32_t windowFlags() const
Window flags.
Definition tfSimulator.h:459
The Simulator is the entry point to simulation, this is the very first object that needs to be initia...
Definition tfSimulator.h:59
static HRESULT waitEvents()
static HRESULT close()
Closes the main window, while the application / simulation continues to run.
static HRESULT postEmptyEvent()
static HRESULT swapInterval(int si)
static HRESULT show()
Shows any windows that were specified in the config. Does not start the universe time propagation unl...
static HRESULT run(FloatP_t et)
Runs the event loop until all windows close or simulation time expires. Automatically performs univer...
static bool throwingExceptions()
Options
Definition tfSimulator.h:140
@ GlDebug
Definition tfSimulator.h:167
@ GlStereo
Definition tfSimulator.h:169
@ GlNoError
Definition tfSimulator.h:159
@ GlForwardCompatible
Definition tfSimulator.h:150
static const int getNumThreads()
WindowFlags
Window flag.
Definition tfSimulator.h:70
@ Focused
Definition tfSimulator.h:112
@ Resizable
Definition tfSimulator.h:79
@ AutoIconify
Definition tfSimulator.h:105
@ AlwaysOnTop
Definition tfSimulator.h:97
@ Maximized
Definition tfSimulator.h:88
@ Fullscreen
Definition tfSimulator.h:72
@ Borderless
Definition tfSimulator.h:77
@ Hidden
Definition tfSimulator.h:80
@ Contextless
Definition tfSimulator.h:124
@ Minimized
Definition tfSimulator.h:91
static HRESULT throwExceptions(const bool &_throw)
HRESULT makeCurrent()
Make the instance the global simulator object.
static HRESULT waitEventsTimeout(FloatP_t timeout)
static HRESULT pollEvents()
Initialize an engine with the given data.
Definition tfUniverse.h:243
CUDA runtime control interface for Simulator.
Definition tfSimulatorConfig.h:40
Definition tfApplication.h:189
Definition tfGlfwWindow.h:38
int32_t HRESULT
Definition tf_port.h:255