VTK
9.5.20250715
|
Provides a remote session interface wrapped around vtk.h for managing VTK objects and states in a WebAssembly environment. More...
#include <vtkRemoteSession.h>
Public Member Functions | |
vtkRemoteSession () | |
Constructor for vtkRemoteSession initializes the session. | |
~vtkRemoteSession () | |
Destructor for vtkRemoteSession cleans up the session. | |
bool | RegisterState (emscripten::val state) |
Registers a state with the session. | |
bool | UnRegisterState (vtkTypeUInt32 object) |
Unregisters a state associated with a VTK object handle. | |
emscripten::val | GetState (vtkTypeUInt32 object) |
Retrieves the state associated with a VTK object handle. | |
void | Set (vtkTypeUInt32 object, emscripten::val properties) |
Set properties of a VTKObject. | |
emscripten::val | Get (vtkTypeUInt32 object) |
Get all properties of a VTKObject. | |
void | SkipProperty (const std::string &className, const std::string &propertyName) |
Skips a property during serialization or deserialization. | |
void | UnSkipProperty (const std::string &className, const std::string &propertyName) |
Unskips a previously skipped property. | |
bool | RegisterBlob (const std::string &hash, emscripten::val jsArray) |
Registers a binary blob with the session. | |
bool | UnRegisterBlob (const std::string &hash) |
Unregisters a binary blob from the session. | |
emscripten::val | GetBlob (const std::string &hash) |
Retrieves a binary blob by its hash. | |
emscripten::val | Invoke (vtkTypeUInt32 object, const std::string &methodName, emscripten::val args) |
Invokes a method on a VTK object. | |
emscripten::val | GetAllDependencies (vtkTypeUInt32 object) |
Retrieves all dependencies of a VTK object. | |
void | UpdateObjectFromState (emscripten::val state) |
Updates a VTK object from a given state. | |
void | UpdateStateFromObject (vtkTypeUInt32 object) |
Updates the state from a given VTK object. | |
bool | SetSize (vtkTypeUInt32 object, int width, int height) |
Sets the size of a VTK object. | |
bool | Render (vtkTypeUInt32 object) |
Renders a VTK object. | |
bool | ResetCamera (vtkTypeUInt32 object) |
Resets the camera for a VTK object. | |
bool | StartEventLoop (vtkTypeUInt32 object) |
Starts an event loop for a VTK object. | |
bool | StopEventLoop (vtkTypeUInt32 object) |
Stops an event loop for a VTK object. | |
bool | BindRenderWindow (vtkTypeUInt32 object, const std::string canvasSelector) |
Binds a render window to a VTK object. | |
unsigned long | Observe (vtkTypeUInt32 object, const std::string &eventName, emscripten::val jsFunction) |
Observes an event on a VTK object. | |
bool | UnObserve (vtkTypeUInt32 object, unsigned long tag) |
Removes an observer from a VTK object. | |
void | Export (const std::string &fileName) |
Exports states into fileName.states.json and blobs into fileName.blobs.json . | |
void | Import (const std::string &stateFileName, const std::string &blobFileName) |
Imports states and blobs from files. | |
void | UpdateObjectsFromStates () |
Updates all VTK objects from their corresponding states. | |
void | UpdateStatesFromObjects () |
Updates all states from their corresponding VTK objects. | |
void | PruneUnusedBlobs () |
Removes unused blobs from the session. | |
void | PruneUnusedObjects () |
Removes unused VTK objects from the session. | |
void | PruneUnusedStates () |
Removes unused states from the session. | |
void | Clear () |
Clears all states, objects, and blobs from the session. | |
std::size_t | GetTotalBlobMemoryUsage () |
Retrieves the total memory usage of all blobs. | |
std::size_t | GetTotalVTKDataObjectMemoryUsage () |
Retrieves the total memory usage of all VTK data objects. | |
void | PrintSceneManagerInformation () |
Prints information about the scene manager. | |
void | SetDeserializerLogVerbosity (const std::string &verbosityLevel) |
Sets the verbosity level for the deserializer log. | |
void | SetInvokerLogVerbosity (const std::string &verbosityLevel) |
Sets the verbosity level for the invoker log. | |
void | SetObjectManagerLogVerbosity (const std::string &verbosityLevel) |
Sets the verbosity level for the object manager log. | |
void | SetSerializerLogVerbosity (const std::string &verbosityLevel) |
Sets the verbosity level for the serializer log. | |
Public Attributes | |
vtkSession | Session |
Provides a remote session interface wrapped around vtk.h for managing VTK objects and states in a WebAssembly environment.
The vtkRemoteSession
class allows interaction with VTK objects and their states in a WebAssembly context. It provides methods for registering, unregistering, and retrieving states and blobs, as well as invoking methods on VTK objects. Additionally, it supports resizing windows, rendering scene, resetting camera, starting/stopping interactor event loops, and retrieving object dependencies. The class also includes utilities for pruning unused resources and importing/exporting states and blobs.
Key features include:
This class is designed to work with Emscripten through JavaScript bindings.
Definition at line 43 of file vtkRemoteSession.h.
vtkRemoteSession::vtkRemoteSession | ( | ) |
Constructor for vtkRemoteSession initializes the session.
vtkRemoteSession::~vtkRemoteSession | ( | ) |
Destructor for vtkRemoteSession cleans up the session.
bool vtkRemoteSession::RegisterState | ( | emscripten::val | state | ) |
Registers a state with the session.
state | A JavaScript object representing the state to register. |
bool vtkRemoteSession::UnRegisterState | ( | vtkTypeUInt32 | object | ) |
Unregisters a state associated with a VTK object handle.
object | The handle of the VTK object whose state is to be unregistered. |
emscripten::val vtkRemoteSession::GetState | ( | vtkTypeUInt32 | object | ) |
Retrieves the state associated with a VTK object handle.
object | The handle of the VTK object. |
void vtkRemoteSession::Set | ( | vtkTypeUInt32 | object, |
emscripten::val | properties | ||
) |
Set properties of a VTKObject.
emscripten::val vtkRemoteSession::Get | ( | vtkTypeUInt32 | object | ) |
Get all properties of a VTKObject.
void vtkRemoteSession::SkipProperty | ( | const std::string & | className, |
const std::string & | propertyName | ||
) |
Skips a property during serialization or deserialization.
className | The name of the class containing the property. |
propertyName | The name of the property to skip. |
void vtkRemoteSession::UnSkipProperty | ( | const std::string & | className, |
const std::string & | propertyName | ||
) |
Unskips a previously skipped property.
className | The name of the class containing the property. |
propertyName | The name of the property to unskip. |
bool vtkRemoteSession::RegisterBlob | ( | const std::string & | hash, |
emscripten::val | jsArray | ||
) |
Registers a binary blob with the session.
hash | A unique hash identifying the blob. |
jsArray | A JavaScript array containing the blob data. |
bool vtkRemoteSession::UnRegisterBlob | ( | const std::string & | hash | ) |
Unregisters a binary blob from the session.
hash | The unique hash identifying the blob. |
emscripten::val vtkRemoteSession::GetBlob | ( | const std::string & | hash | ) |
Retrieves a binary blob by its hash.
hash | The unique hash identifying the blob. |
emscripten::val vtkRemoteSession::Invoke | ( | vtkTypeUInt32 | object, |
const std::string & | methodName, | ||
emscripten::val | args | ||
) |
Invokes a method on a VTK object.
object | The handle of the VTK object. |
methodName | The name of the method to invoke. |
args | A JavaScript object containing the method arguments. |
emscripten::val vtkRemoteSession::GetAllDependencies | ( | vtkTypeUInt32 | object | ) |
Retrieves all dependencies of a VTK object.
object | The handle of the VTK object. |
void vtkRemoteSession::UpdateObjectFromState | ( | emscripten::val | state | ) |
Updates a VTK object from a given state.
state | A JavaScript object representing the state. |
void vtkRemoteSession::UpdateStateFromObject | ( | vtkTypeUInt32 | object | ) |
Updates the state from a given VTK object.
object | The handle of the VTK object. |
bool vtkRemoteSession::SetSize | ( | vtkTypeUInt32 | object, |
int | width, | ||
int | height | ||
) |
Sets the size of a VTK object.
object | The handle of the VTK object. |
width | The desired width. |
height | The desired height. |
bool vtkRemoteSession::Render | ( | vtkTypeUInt32 | object | ) |
Renders a VTK object.
object | The handle of the VTK object. |
bool vtkRemoteSession::ResetCamera | ( | vtkTypeUInt32 | object | ) |
Resets the camera for a VTK object.
object | The handle of the VTK object. |
bool vtkRemoteSession::StartEventLoop | ( | vtkTypeUInt32 | object | ) |
Starts an event loop for a VTK object.
object | The handle of the VTK object. |
bool vtkRemoteSession::StopEventLoop | ( | vtkTypeUInt32 | object | ) |
Stops an event loop for a VTK object.
object | The handle of the VTK object. |
bool vtkRemoteSession::BindRenderWindow | ( | vtkTypeUInt32 | object, |
const std::string | canvasSelector | ||
) |
Binds a render window to a VTK object.
object | The handle of the VTK object. |
canvasSelector | The CSS selector for the canvas element. |
unsigned long vtkRemoteSession::Observe | ( | vtkTypeUInt32 | object, |
const std::string & | eventName, | ||
emscripten::val | jsFunction | ||
) |
Observes an event on a VTK object.
object | The handle of the VTK object. |
eventName | The name of the event to observe. |
jsFunction | A JavaScript function to call when the event occurs. |
bool vtkRemoteSession::UnObserve | ( | vtkTypeUInt32 | object, |
unsigned long | tag | ||
) |
Removes an observer from a VTK object.
object | The handle of the VTK object. |
tag | The unique tag identifying the observer. |
void vtkRemoteSession::Export | ( | const std::string & | fileName | ) |
Exports states into fileName.states.json
and blobs into fileName.blobs.json
.
fileName | The name of the file. |
void vtkRemoteSession::Import | ( | const std::string & | stateFileName, |
const std::string & | blobFileName | ||
) |
Imports states and blobs from files.
stateFileName | The name of the file containing the states. |
blobFileName | The name of the file containing the blobs. |
void vtkRemoteSession::UpdateObjectsFromStates | ( | ) |
Updates all VTK objects from their corresponding states.
void vtkRemoteSession::UpdateStatesFromObjects | ( | ) |
Updates all states from their corresponding VTK objects.
void vtkRemoteSession::PruneUnusedBlobs | ( | ) |
Removes unused blobs from the session.
void vtkRemoteSession::PruneUnusedObjects | ( | ) |
Removes unused VTK objects from the session.
void vtkRemoteSession::PruneUnusedStates | ( | ) |
Removes unused states from the session.
void vtkRemoteSession::Clear | ( | ) |
Clears all states, objects, and blobs from the session.
std::size_t vtkRemoteSession::GetTotalBlobMemoryUsage | ( | ) |
Retrieves the total memory usage of all blobs.
std::size_t vtkRemoteSession::GetTotalVTKDataObjectMemoryUsage | ( | ) |
Retrieves the total memory usage of all VTK data objects.
void vtkRemoteSession::PrintSceneManagerInformation | ( | ) |
Prints information about the scene manager.
void vtkRemoteSession::SetDeserializerLogVerbosity | ( | const std::string & | verbosityLevel | ) |
Sets the verbosity level for the deserializer log.
verbosityLevel | The desired verbosity level. |
void vtkRemoteSession::SetInvokerLogVerbosity | ( | const std::string & | verbosityLevel | ) |
Sets the verbosity level for the invoker log.
verbosityLevel | The desired verbosity level. |
void vtkRemoteSession::SetObjectManagerLogVerbosity | ( | const std::string & | verbosityLevel | ) |
Sets the verbosity level for the object manager log.
verbosityLevel | The desired verbosity level. |
void vtkRemoteSession::SetSerializerLogVerbosity | ( | const std::string & | verbosityLevel | ) |
Sets the verbosity level for the serializer log.
verbosityLevel | The desired verbosity level. |
vtkSession vtkRemoteSession::Session |
Definition at line 300 of file vtkRemoteSession.h.