AbstractPointLocator

Introduction

vtkAbstractPointLocator

Methods

extend

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

getBounds

Get the bounds of this object.

Returns

Type Description
Bounds

setBounds

Set the bounds of this object.

Argument Type Required Description
input Bounds Yes

Source

index.d.ts
import { vtkObject } from '../../../interfaces';
import { Bounds } from '../../../types';
import { ILocatorInitialValues } from '../Locator';

/**
*
*/
export interface IAbstractPointLocatorInitialValues
extends ILocatorInitialValues {
bounds?: Bounds;
numberOfBuckets: number;
}

export interface vtkAbstractPointLocator extends vtkObject {
/**
* Set the bounds of this object.
* @param {Bounds} input
*/
setBounds(input: Bounds): void;

/**
* Get the bounds of this object.
* @returns {Bounds}
*/
getBounds(): Bounds;
}

// ----------------------------------------------------------------------------
// Static API
// ----------------------------------------------------------------------------

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

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

/**
* vtkAbstractPointLocator
*/
export declare const vtkAbstractPointLocator: {
extend: typeof extend;
};

export default vtkAbstractPointLocator;
index.js
import macro from 'vtk.js/Sources/macros';
import vtkLocator from 'vtk.js/Sources/Common/DataModel/Locator';

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

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

function defaultValues(initialValues) {
return {
bounds: null,
numberOfBuckets: 0,
...initialValues,
};
}

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

export function extend(publicAPI, model, initialValues = {}) {
vtkLocator.extend(publicAPI, model, defaultValues(initialValues));

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

macro.get(publicAPI, model, ['numberOfBuckets']);

macro.setGetArray(publicAPI, model, ['bounds'], 6);

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

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

export default { extend };