4#ifndef vtkWebAssemblySessionHelper_h
5#define vtkWebAssemblySessionHelper_h
7#include <emscripten/val.h>
9#include "vtkABINamespace.h"
13VTK_ABI_NAMESPACE_BEGIN
24using namespace emscripten;
27thread_local const val Uint8Array = val::global(
"Uint8Array");
28thread_local const val Uint32Array = val::global(
"Uint32Array");
29thread_local const val JSON = val::global(
"JSON");
30thread_local const val Array = val::global(
"Array");
46 const auto jsonString = JSON.call<val>(
"stringify", inputJson->JsonValue).as<std::string>();
47 const auto length = jsonString.length();
48 char* result =
new char[length + 1];
49 snprintf(result, length + 1,
"%s", jsonString.c_str());
55 result->
JsonValue = JSON.call<val>(
"parse", std::string(inputString));
vtkSessionJsonParseFunc ParseJson
int InteractorManagesTheEventLoop
vtkSessionJsonStringifyFunc StringifyJson
emscripten::val JsonValue
This header file provides the C API for working with standalone/remote visualization applications.
struct vtkSessionImpl * vtkSession
struct vtkSessionJsonImpl * vtkSessionJson