factory that chooses vtkViewNodes to create specific to WebGL
Registers functions to create WebGL ViewNodes for vtk
registerOverride(apiName, createFunc)
Give a function pointer to a class that will manufacture a
vtkViewNode when given a class name string.
createNode(apiName)
Creates and returns a vtkViewNode for the provided renderable.
Source
index.jsimport macro from 'vtk.js/Sources/macros'; import vtkViewNodeFactory from 'vtk.js/Sources/Rendering/SceneGraph/ViewNodeFactory';
const CLASS_MAPPING = Object.create(null);
export function registerOverride(className, fn) { CLASS_MAPPING[className] = fn; }
function vtkOpenGLViewNodeFactory(publicAPI, model) { model.classHierarchy.push('vtkOpenGLViewNodeFactory'); }
const DEFAULT_VALUES = {};
export function extend(publicAPI, model, initialValues = {}) { Object.assign(model, DEFAULT_VALUES, initialValues);
model.overrides = CLASS_MAPPING;
vtkViewNodeFactory.extend(publicAPI, model, initialValues);
vtkOpenGLViewNodeFactory(publicAPI, model); }
export const newInstance = macro.newInstance( extend, 'vtkOpenGLViewNodeFactory' );
export default { newInstance, extend };
|