StickMapper

Introduction

vtkStickMapper inherits from vtkMapper.

See Also

vtkMapper

Methods

extend

Method use to decorate a given object (publicAPI+model) with vtkStickMapper 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 IStickMappereInitialValues No (default: {})

getRadius

getScaleArray

newInstance

Method use to create a new instance of vtkStickMapper

setRadius

Argument Type Required Description
radius Number Yes

setScaleArray

Argument Type Required Description
scaleArray Yes

Source

index.d.ts
import vtkMapper, { IMapperInitialValues } from '../Mapper';

interface IStickMappereInitialValues extends IMapperInitialValues {
radius?: number;
length?: number;
scaleArray?: number[];
orientationArray?: number[];
}

export interface vtkStickMapper extends vtkMapper {
/**
*
*/
getRadius(): number;

/**
*
*/
getScaleArray(): number[];

/**
*
* @param {Number} radius
*/
setRadius(radius: number): boolean;

/**
*
* @param scaleArray
*/
setScaleArray(scaleArray: number[]): boolean;
}

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

/**
* Method use to create a new instance of vtkStickMapper
*/
export function newInstance(
initialValues?: IStickMappereInitialValues
): vtkStickMapper;

/**
* vtkStickMapper inherits from vtkMapper.
*
* @see vtkMapper
*/
export declare const vtkStickMapper: {
newInstance: typeof newInstance;
extend: typeof extend;
};
export default vtkStickMapper;
index.js
import macro from 'vtk.js/Sources/macros';
import vtkMapper from 'vtk.js/Sources/Rendering/Core/Mapper';

// ----------------------------------------------------------------------------
// vtkStickMapper methods
// ----------------------------------------------------------------------------

function vtkStickMapper(publicAPI, model) {
// Set our className
model.classHierarchy.push('vtkStickMapper');
}

// ----------------------------------------------------------------------------
// Object factory
// ----------------------------------------------------------------------------

const DEFAULT_VALUES = {
scaleArray: null,
orientationArray: null,
radius: 0.025,
length: 0.1,
};

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

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

// Inheritance
vtkMapper.extend(publicAPI, model, initialValues);

macro.setGet(publicAPI, model, [
'scaleArray',
'orientationArray',
'radius',
'length',
]);

// Object methods
vtkStickMapper(publicAPI, model);
}

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

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

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

export default { newInstance, extend };