VTK  9.5.20250718
vtkStandaloneSession.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
18#ifndef vtkStandaloneSession_h
19#define vtkStandaloneSession_h
20
21#include "vtkType.h" // for vtkTypeUInt32
22#include "vtkWebAssemblySessionModule.h" // for no export macro
23
24#include <emscripten/val.h> // for emscripten::val
25
26VTK_ABI_NAMESPACE_BEGIN
27
28typedef struct vtkSessionImpl* vtkSession;
29class VTKWEBASSEMBLYSESSION_EXPORT vtkStandaloneSession
30{
31public:
34
38 vtkTypeUInt32 Create(const std::string& className);
39
43 void Destroy(vtkTypeUInt32 object);
44
48 void Set(vtkTypeUInt32 object, emscripten::val properties);
49
53 emscripten::val Get(vtkTypeUInt32 object);
54
59 emscripten::val Invoke(vtkTypeUInt32 object, const std::string& methodName, emscripten::val args);
60
64 unsigned long Observe(
65 vtkTypeUInt32 object, const std::string& eventName, emscripten::val jsFunction);
66
70 bool UnObserve(vtkTypeUInt32 object, unsigned long tag);
71
73};
74
75VTK_ABI_NAMESPACE_END
76#endif
A standalone session for managing VTK objects in a WebAssembly environment.
vtkTypeUInt32 Create(const std::string &className)
Create an object of type className.
emscripten::val Get(vtkTypeUInt32 object)
Get all properties of a VTKObject.
void Set(vtkTypeUInt32 object, emscripten::val properties)
Set properties of a VTKObject.
emscripten::val Invoke(vtkTypeUInt32 object, const std::string &methodName, emscripten::val args)
Invoke a function methodName on object with args and return the result in a VTKJson.
bool UnObserve(vtkTypeUInt32 object, unsigned long tag)
Remove an observer from a VTKObject.
unsigned long Observe(vtkTypeUInt32 object, const std::string &eventName, emscripten::val jsFunction)
Add an observer to a VTKObject for a specific event.
void Destroy(vtkTypeUInt32 object)
Destroy a VTKObject.
struct vtkSessionImpl * vtkSession