SphereMapper

Introduction

vtkSphereMapper inherits from vtkMapper.

Methods

extend

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

getRadius

getScaleArray

newInstance

Method use to create a new instance of vtkSphereMapper

setRadius

Argument Type Required Description
radius Number Yes

setScaleArray

Argument Type Required Description
scaleArray Yes

Source

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

export interface ISphereInitialValues extends IMapperInitialValues {
radius?: number;
}

export interface vtkSphereMapper extends vtkMapper {

/**
*
*/
getRadius(): number;

/**
*
*/
getScaleArray(): any;

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

/**
*
* @param scaleArray
*/
setScaleArray(scaleArray: any): boolean;
}

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

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

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

// ----------------------------------------------------------------------------
// vtkSphereMapper methods
// ----------------------------------------------------------------------------

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

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

const DEFAULT_VALUES = {
scaleArray: null,
radius: 0.05,
};

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

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

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

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

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

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

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

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

export default { newInstance, extend };