import macro from 'vtk.js/Sources/macros'; import vtkPolyData from 'vtk.js/Sources/Common/DataModel/PolyData';
const { vtkErrorMacro } = macro;
export const BOUNDS_MAP = [ 0, 2, 4, 1, 2, 4, 0, 3, 4, 1, 3, 4, 0, 2, 5, 1, 2, 5, 0, 3, 5, 1, 3, 5, ];
export const LINE_ARRAY = [ 2, 0, 1, 2, 2, 3, 2, 4, 5, 2, 6, 7, 2, 0, 2, 2, 1, 3, 2, 4, 6, 2, 5, 7, 2, 0, 4, 2, 1, 5, 2, 2, 6, 2, 3, 7, ];
function vtkOutlineFilter(publicAPI, model) { model.classHierarchy.push('vtkOutlineFilter');
publicAPI.requestData = (inData, outData) => { const input = inData[0];
if (!input) { vtkErrorMacro('Invalid or missing input'); return; }
const bounds = input.getBounds(); const output = vtkPolyData.newInstance();
output .getPoints() .setData(Float32Array.from(BOUNDS_MAP.map((idx) => bounds[idx])), 3); output.getLines().setData(Uint16Array.from(LINE_ARRAY));
outData[0] = output; }; }
const DEFAULT_VALUES = {};
export function extend(publicAPI, model, initialValues = {}) { Object.assign(model, DEFAULT_VALUES, initialValues);
macro.obj(publicAPI, model);
macro.algo(publicAPI, model, 1, 1);
vtkOutlineFilter(publicAPI, model); }
export const newInstance = macro.newInstance(extend, 'vtkOutlineFilter');
export default { newInstance, extend, BOUNDS_MAP, LINE_ARRAY };
|