vtkModuleSerialization#

vtk_module_generate_library_serdes_registrar#

Generate functions that register (de)serialization functions for all classes in a library. module-serialization

vtk_module_generate_library_serdes_registrar(
  MODULE             <module>
  EXPORT_MACRO_NAME  <export_macro_name>
  EXPORT_FILE_NAME   <export_file_name>
  REGISTRAR_HEADER   <registrar_header>
  REGISTRAR_SOURCE   <registrar_source>
  CLASSES            <class>...)

Declares registrar function for MODULE in REGISTRAR_HEADER and writes implementation of the registrar in REGISTRAR_SOURCE.

  • MODULE: The name of a module.

  • EXPORT_MACRO_NAME: The name of the export macro for MODULE.

  • EXPORT_FILE_NAME: The name of the header file which defines EXPORT_MACRO_NAME for MODULE.

  • REGISTRAR_HEADER: This file will hold the declaration of registrar function for MODULE.

  • REGISTRAR_SOURCE: This file will contain the implementation of registrar function for MODULE.

  • CLASSES: List of classes that will be registered with (de)serializer in this library.

vtk_module_generate_libraries_serdes_registrar#

Generate functions that register (de)serialization handlers for a collection of modules. module-serialization

vtk_module_generate_libraries_serdes_registrar(
  REGISTRAR_NAME     <registrar_name>
  REGISTRAR_SOURCE   <registrar_source>
  [MANDATORY_MODULES  <module>...]
  [OPTIONAL_MODULES   <module>...])

Invokes registrar functions for all modules from OPTIONAL_MODULES and MANDATORY_MODULES. Code is generated in REGISTRAR_SOURCE.

  • REGISTRAR_NAME: The name of the registrar function.

  • REGISTRAR_SOURCE: This file will contain the implementation of registrar function which registers handlers for all MANDATORY_MODULES and OPTIONAL_MODULES.

  • MANDATORY_MODULES: A list of PUBLIC or PRIVATE dependencies of the module which REGISTRAR_SOURCE is compiled into.

  • OPTIONAL_MODULES: A list of optional dependencies of the module which REGISTRAR_SOURCE is compiled into.

_vtk_module_serdes_generate_sources#

Generate (de)serialization functions for classes that belong to MODULE in SERDES_SOURCES. module-serialization

_vtk_module_serdes_generate_sources(
  MODULE              <module>
  SERIALIZED_CLASSES  <serialized_classes>
  SERDES_SOURCES      <serdes_sources>)
  • MODULE: Generates serialization sources for all classes in MODULE

  • SERIALIZED_CLASSES: This variable will contain the list of all classes that were serialized.

  • SERDES_SOURCES: This variable will contain the list of all sources that were generated for SERIALIZED_CLASSES in MODULE.

vtk_module_serdes#

Generate (de)serialization code for all classes in a MODULE. module-serialization

vtk_module_serdes(
  MODULE            <module>
  EXPORT_MACRO_NAME <export_macro_name>
  EXPORT_FILE_NAME  <export_file_name>
  REGISTRAR_HEADER  <header>
  REGISTRAR_SOURCE  <source>
  SERDES_SOURCES    <serdes_sources>)
  • MODULE: The name of a module.

  • EXPORT_MACRO_NAME: The name of the export macro for MODULE.

  • EXPORT_FILE_NAME: The name of the header file which defines EXPORT_MACRO_NAME for MODULE.

  • REGISTRAR_HEADER: This file will contain declaration of registrar function for MODULE.

  • REGISTRAR_SOURCE: This file will contain implementation of registrar function for MODULE.

  • SERDES_SOURCES: This variable holds the list of generated source files with vtkWrapSerDes for all classes in MODULE.

vtk_module_add_serdes_wasm_package#

Adds a WebAssembly package that facilitates deserialization of VTK classes in a WASM environment for MODULE. |module-wrapping-serdes|

vtk_module_add_serdes_wasm_package(
  [ASYNC]
  MODULE                <module>
  OUTPUT_NAME           <output_name>
  [INSTALL_COMPONENT     <install_component>]
  [INSTALL_DESTINATION   <install_destination>]
  [EXTRA_SOURCES         <extra_sources>...]
  [EXTRA_COMPILE_OPTIONS <extra_compile_options>...]
  [EXTRA_LINK_OPTIONS    <extra_link_options>...])
  • ASYNC: If specified, the generated package will be linked with -sJSPI=1 flag. The generated package will support asynchronous string-based method calls. This option is required if MODULE depends on VTK::RenderingWebGPU to support asynchronous webgpu APIs.

  • MODULE: The name of a module.

  • OUTPUT_NAME: The name of the output file that will be generated. This file will contain the bindings for the WebAssembly module.

  • INSTALL_COMPONENT: Installation component of the install rules created by this function. Defaults to runtime.

  • INSTALL_DESTINATION: The destination directory where the generated WebAssembly package will be installed. Defaults to ${CMAKE_INSTALL_BINDIR}.

  • EXTRA_SOURCES: Additional sources that will be compiled into the WebAssembly package. This is useful for adding custom JavaScript wrappers or other C++ sources that are not part of the VTK module but are needed for the WebAssembly package.

  • EXTRA_COMPILE_OPTIONS: Additional compile options that will be passed to the WebAssembly package.

  • EXTRA_LINK_OPTIONS: Additional link options that will be passed to the WebAssembly package.