LineFilter

Introduction

vtkLineFilter - filters lines in polydata

vtkLineFilter is a filter that only let’s through lines of a vtkPolydata.

Methods

extend

Method used to decorate a given object (publicAPI+model) with vtkLineFilter characteristics.

Argument Type Required Description
publicAPI Yes object on which methods will be bounds (public)
model Yes object on which data structure will be bounds (protected)
initialValues ILineFilterInitialValues No (default: {})

newInstance

Method used to create a new instance of vtkLineFilter

Argument Type Required Description
initialValues ILineFilterInitialValues No for pre-setting some of its content

requestData

Argument Type Required Description
inData Yes
outData Yes

Source

index.d.ts
import { vtkAlgorithm, vtkObject } from '../../../interfaces';

/**
*
*/
export interface ILineFilterInitialValues {}

type vtkLineFilterBase = vtkObject & vtkAlgorithm;

export interface vtkLineFilter extends vtkLineFilterBase {
/**
*
* @param inData
* @param outData
*/
requestData(inData: any, outData: any): void;
}

/**
* Method used to decorate a given object (publicAPI+model) with vtkLineFilter characteristics.
*
* @param publicAPI object on which methods will be bounds (public)
* @param model object on which data structure will be bounds (protected)
* @param {ILineFilterInitialValues} [initialValues] (default: {})
*/
export function extend(
publicAPI: object,
model: object,
initialValues?: ILineFilterInitialValues
): void;

/**
* Method used to create a new instance of vtkLineFilter
* @param {ILineFilterInitialValues} [initialValues] for pre-setting some of its content
*/
export function newInstance(
initialValues?: ILineFilterInitialValues
): vtkLineFilter;

/**
* vtkLineFilter - filters lines in polydata
*
* vtkLineFilter is a filter that only let's through lines of a vtkPolydata.
*/
export declare const vtkLineFilter: {
newInstance: typeof newInstance;
extend: typeof extend;
};
export default vtkLineFilter;
index.js
import macro from 'vtk.js/Sources/macros';
import vtkPolyData from 'vtk.js/Sources/Common/DataModel/PolyData';

// ----------------------------------------------------------------------------
// vtkLineFilter methods
// ----------------------------------------------------------------------------

function vtkLineFilter(publicAPI, model) {
// Set our classname
model.classHierarchy.push('vtkLineFilter');

publicAPI.requestData = (inData, outData) => {
const dataset = vtkPolyData.newInstance();

dataset.getPoints().setData(inData[0].getPoints().getData());
dataset.getLines().setData(inData[0].getLines().getData());

outData[0] = dataset;
};
}

// ----------------------------------------------------------------------------

const DEFAULT_VALUES = {};

// ----------------------------------------------------------------------------

export function extend(publicAPI, model, initialValues = {}) {
Object.assign(model, DEFAULT_VALUES, initialValues);

// Build VTK API
macro.setGet(publicAPI, model, []);

// Make this a VTK object
macro.obj(publicAPI, model);

// Also make it an algorithm with one input and one output
macro.algo(publicAPI, model, 1, 1);

// Object specific methods
vtkLineFilter(publicAPI, model);
}

// ----------------------------------------------------------------------------

export const newInstance = macro.newInstance(extend, 'vtkLineFilter');

// ----------------------------------------------------------------------------

export default { newInstance, extend };