import macro from 'vtk.js/Sources/macros';
function vtkRenderPass(publicAPI, model) { model.classHierarchy.push('vtkRenderPass');
publicAPI.getOperation = () => model.currentOperation;
publicAPI.setCurrentOperation = (val) => { model.currentOperation = val; model.currentTraverseOperation = `traverse${macro.capitalize( model.currentOperation )}`; };
publicAPI.getTraverseOperation = () => model.currentTraverseOperation;
publicAPI.traverse = (viewNode, parent = null) => { if (model.deleted) { return; }
model._currentParent = parent;
model.preDelegateOperations.forEach((val) => { publicAPI.setCurrentOperation(val); viewNode.traverse(publicAPI); }); model.delegates.forEach((val) => { val.traverse(viewNode, publicAPI); }); model.postDelegateOperations.forEach((val) => { publicAPI.setCurrentOperation(val); viewNode.traverse(publicAPI); }); }; }
const DEFAULT_VALUES = { delegates: [], currentOperation: null, preDelegateOperations: [], postDelegateOperations: [], currentParent: null, };
export function extend(publicAPI, model, initialValues = {}) { Object.assign(model, DEFAULT_VALUES, initialValues);
macro.obj(publicAPI, model); macro.get(publicAPI, model, ['currentOperation']); macro.setGet(publicAPI, model, [ 'delegates', '_currentParent', 'preDelegateOperations', 'postDelegateOperations', ]); macro.moveToProtected(publicAPI, model, ['currentParent']);
vtkRenderPass(publicAPI, model); }
export const newInstance = macro.newInstance(extend, 'vtkRenderPass');
export default { newInstance, extend };
|