import macro from 'vtk.js/Sources/macros'; import vtkXMLWriter from 'vtk.js/Sources/IO/XML/XMLWriter';
function vtkXMLImageDataWriter(publicAPI, model) { model.classHierarchy.push('vtkXMLImageDataWriter');
const superClass = { ...publicAPI };
publicAPI.create = (dataObject) => { const parent = superClass.create(dataObject);
const imageData = parent.ele('ImageData', { WholeExtent: dataObject.getExtent().join(' '), Origin: dataObject.getOrigin().join(' '), Spacing: dataObject.getSpacing().join(' '), Direction: dataObject.getDirection().join(' '), });
const piece = imageData.ele('Piece', { Extent: dataObject.getExtent().join(' '), });
publicAPI.processDataSetAttributes( piece, 'PointData', dataObject.getPointData() );
publicAPI.processDataSetAttributes( piece, 'CellData', dataObject.getCellData() );
return parent; }; }
const DEFAULT_VALUES = { dataType: 'ImageData', };
export function extend(publicAPI, model, initialValues = {}) { Object.assign(model, DEFAULT_VALUES, initialValues); vtkXMLWriter.extend(publicAPI, model, initialValues); vtkXMLImageDataWriter(publicAPI, model); }
export const newInstance = macro.newInstance(extend, 'vtkXMLImageDataWriter');
export default { newInstance, extend };
|