diff --git a/Sources/Common/Core/Base64/index.d.ts b/Sources/Common/Core/Base64/index.d.ts index d42cc787f51..429abf45fb8 100755 --- a/Sources/Common/Core/Base64/index.d.ts +++ b/Sources/Common/Core/Base64/index.d.ts @@ -17,8 +17,8 @@ export function toArrayBuffer(b64Str: string): ArrayBuffer; export function fromArrayBuffer(ab: ArrayBuffer): string; interface Base64 { - toArrayBuffer: typeof toArrayBuffer, - fromArrayBuffer: typeof fromArrayBuffer, + toArrayBuffer: typeof toArrayBuffer; + fromArrayBuffer: typeof fromArrayBuffer; } export default Base64; diff --git a/Sources/Common/Core/CellArray/index.d.ts b/Sources/Common/Core/CellArray/index.d.ts index 0d1cce742c1..786e0c1d7ac 100755 --- a/Sources/Common/Core/CellArray/index.d.ts +++ b/Sources/Common/Core/CellArray/index.d.ts @@ -1,12 +1,11 @@ -import { TypedArray } from "../../../types"; -import vtkDataArray, { IDataArrayInitialValues } from "../../Core/DataArray"; - +import { TypedArray } from '../../../types'; +import vtkDataArray, { IDataArrayInitialValues } from '../../Core/DataArray'; /** * The inital values of a vtkCellArray. */ export interface ICellArrayInitialValues extends IDataArrayInitialValues { - empty?: boolean; + empty?: boolean; } /** @@ -14,37 +13,36 @@ export interface ICellArrayInitialValues extends IDataArrayInitialValues { * Only via `setData` or `insertNextCell` */ export interface vtkCellArray extends vtkDataArray { + /** + * Get the number of cells in the array. + * @param {Boolean} [recompute] Recompute the number of cells. + */ + getNumberOfCells(recompute?: boolean): number; - /** - * Get the number of cells in the array. - * @param {Boolean} [recompute] Recompute the number of cells. - */ - getNumberOfCells(recompute?: boolean): number; - - /** - * Get the sizes of the cells in this array. - * @param {Boolean} [recompute] Recompute the cell sizes. - */ - getCellSizes(recompute?: boolean): any; + /** + * Get the sizes of the cells in this array. + * @param {Boolean} [recompute] Recompute the cell sizes. + */ + getCellSizes(recompute?: boolean): any; - /** - * Set the data of this array. - * @param {Number[]|TypedArray} typedArray The Array value. - */ - setData(typedArray: number[]|TypedArray): void; + /** + * Set the data of this array. + * @param {Number[]|TypedArray} typedArray The Array value. + */ + setData(typedArray: number[] | TypedArray): void; - /** - * Returns the point indices at the given location as a subarray. - * @param loc - */ - getCell(loc: any): void; + /** + * Returns the point indices at the given location as a subarray. + * @param loc + */ + getCell(loc: any): void; - /** - * Insert a cell to this array in the next available slot. - * @param {Number[]} cellPointIds The list of point ids (NOT prefixed with the number of points) - * @returns {Number} Idx of where the cell was inserted - */ - insertNextCell(cellPointIds: number[]): number; + /** + * Insert a cell to this array in the next available slot. + * @param {Number[]} cellPointIds The list of point ids (NOT prefixed with the number of points) + * @returns {Number} Idx of where the cell was inserted + */ + insertNextCell(cellPointIds: number[]): number; } /** @@ -54,14 +52,19 @@ export interface vtkCellArray extends vtkDataArray { * @param model object on which data structure will be bounds (protected) * @param {ICellArrayInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ICellArrayInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ICellArrayInitialValues +): void; /** * Method used to create a new instance of vtkCellArray * @param {ICellArrayInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ICellArrayInitialValues): vtkCellArray; - +export function newInstance( + initialValues?: ICellArrayInitialValues +): vtkCellArray; /** * @static @@ -69,22 +72,22 @@ export function newInstance(initialValues?: ICellArrayInitialValues): vtkCellArr */ export function extractCellSizes(cellArray: any): any; - /** - * @static - * @param cellArray - */ +/** + * @static + * @param cellArray + */ export function getNumberOfCells(cellArray: any): any; /** * vtkCellArray stores dataset topologies as an explicit connectivity table * listing the point ids that make up each cell. - * + * * @see [vtkDataArray](./Common_Core_DataArray.html) */ export declare const vtkCellArray: { - newInstance: typeof newInstance; - extend: typeof extend; - extractCellSizes: typeof extractCellSizes; - getNumberOfCells: typeof getNumberOfCells; -} + newInstance: typeof newInstance; + extend: typeof extend; + extractCellSizes: typeof extractCellSizes; + getNumberOfCells: typeof getNumberOfCells; +}; export default vtkCellArray; diff --git a/Sources/Common/Core/DataArray/index.d.ts b/Sources/Common/Core/DataArray/index.d.ts index a236b322786..08573949c52 100644 --- a/Sources/Common/Core/DataArray/index.d.ts +++ b/Sources/Common/Core/DataArray/index.d.ts @@ -1,449 +1,465 @@ -import { vtkObject, vtkRange } from "../../../interfaces"; -import { float, int, Nullable, Range, TypedArray } from "../../../types"; - - -/** - * Output of the rangeHelper instance - */ -interface VtkStatisticInformation { - min: number; - max: number; - count: number; - sum: number; - mean: number; -} - -/** - * Helper class used to compute data range of a set of numbers - */ -interface vtkRangeHelper { - add(value: number): void; - get(): VtkStatisticInformation; - getRange(): vtkRange; -} - -/** - * The inital values of a vtkDataArray. - */ -export interface IDataArrayInitialValues { - dataType?: string; - empty?: boolean; - name?: string; - numberOfComponents?: number; - rangeTuple?: Range; - size?: number; - values?: Array|TypedArray; -} - -export interface vtkDataArray extends vtkObject { - - /** - * Get the size, in bytes, of the lowest-level element of an array. - */ - getElementComponentSize(): number; - - /** - * Get the component for a given tupleIdx. - * @param {Number} tupleIdx - * @param {Number} [componentIndex] (default: 0) - */ - getComponent(tupleIdx: number, componentIndex?: number): number; - - /** - * Set the component value for a given tupleIdx and componentIndex. - * @param {Number} tupleIdx - * @param {Number} componentIndex - * @param {Number} value - */ - setComponent(tupleIdx: number, componentIndex: number, value: number): void; - - /** - * - */ - getData(): number[]|TypedArray; - - /** - * Call this method when the underlying data has changed - * This method calls `modified()` - * For example, when you need to modify chunks of the array, it is faster - * to get the underlying array with `getData()`, modify it, and then call - * `dataChange()`. - */ - dataChange(): void; - - /** - * Get the range of the given component. - * - * @param {Number} componentIndex (default: -1) - */ - getRange(componentIndex?: number): Range; - - /** - * - * @param {vtkRange} rangeValue - * @param {Number} componentIndex - */ - setRange(rangeValue: vtkRange, componentIndex: number): Range; - - /** - * Set the given tuple at the given index. - * @param {Number} idx - * @param {Array|TypedArray} tuple - */ - setTuple(idx: number, tuple: Array|TypedArray): void; - - /** - * Set the given tuples starting at the given index. - * @param {Number} idx - * @param {Array|TypedArray} tuples - */ - setTuples(idx: number, tuples: Array|TypedArray): void; - - /** - * Get the tuple at the given index. - * - * For performance reasons, it is advised to pass a 'tupleToFill': - * `const x = [];` - * `for (int i = 0; i < N; ++i) { - * ` dataArray.getTuple(idx, x);` - * ` ...` - * instead of: - * `for (int i = 0; i < N; ++i) { - * ` const x = dataArray.getTuple(idx);` - * `...` - * @param {Number} idx - * @param {Number[]|TypedArray} [tupleToFill] (default []) - * @returns {Number[]|TypedArray} - */ - getTuple(idx: number, tupleToFill?: number[]|TypedArray): number[]|TypedArray; - - /** - * Get the tuples between fromId (inclusive) and toId (exclusive). - * - * If fromId or toId is negative, it refers to a tuple index from the - * end of the underlying typedArray. - * If the range between fromId and toId is invalid, getTuples returns - * null. - * - * NOTE: Any changes to the returned TypedArray will result in changes to - * this DataArray's underlying TypedArray. - * - * @param {Number} [fromId] (default: 0) - * @param {Number} [toId] (default: publicAPI.getNumberOfTuples()) - * @returns {Nullable} - */ - getTuples(fromId?: number, toId?: number): Nullable; - - /** - * Insert the given tuple at the given index. - * NOTE: May resize the data values array. "Safe" version of setTuple. - * - * A typical usage is when `vtkDataArray` is initialized with - * `initialValues = { size: 0, values: new Uint8Array(1000) }`, where - * an empty but pre-allocated array with 1'000 components is created. - * The component values can then be inserted with `insertTuple()` or - * `insertNextTuple()` without requiring new memory allocation until - * the size of 1'000 is exceeded (e.g. after inserting the 250th - * 4-component tuple). - * - * `insertTuple` increases the number of tuples (`getNumberOfTuples()`). - * - * @see insertNextTuple - * @see getNumberOfTuples - * - * @param {Number} idx - * @param {Array|TypedArray} tuple - * @returns {Number} Index of the inserted tuple - */ - insertTuple(idx: number, tuple: Array|TypedArray): number; - - /** - * Insert tuples starting at the given idx. - * - * @param {Number} idx - * @param {Array|TypedArray} tuples Flat array of tuples to insert - * @returns The index of the last inserted tuple - */ - insertTuples(idx: number, tuples: Array|TypedArray): number; - - /** - * Insert the given tuple at the next available slot and return the index of the insertion. - * NOTE: May resize the data values array. "Safe" version of setTuple. - * - * @see insertTuple - * - * @param {Array|TypedArray} tuple - * @returns {Number} Index of the inserted tuple. - */ - insertNextTuple(tuple: Array|TypedArray): number; - - /** - * Convenience function to insert an array of tuples with insertNextTuple. - * NOTE: tuples.length must be a multiple of `getNumberOfComponents`. - * @param {Array|TypedArray} tuples - * @returns The index of the last inserted tuple - */ - insertNextTuples(tuples: Array|TypedArray): number; - - /** - * - * @param {Number} [idx] (default: 1) - * @returns {Number} - */ - getTupleLocation(idx?: number): number; - - /** - * Get the dimension (n) of the components. - * @returns {Number} - */ - getNumberOfComponents(): number; - - /** - * Get the actual number of values in the array, which is equal to `getNumberOfTuples() * getNumberOfComponents()`. - * @returns {Number} - */ - getNumberOfValues(): number; - - /** - * Get the actual number of complete tuples (a component group) in the array. - * @returns {Number} - */ - getNumberOfTuples(): number; - - /** - * Convenient method to search the index of the first matching tuple in the array. - * This is a naïve search, consider using a "locator" instead. - * @param {Array|TypedArray} tupleToSearch - * @param {Number} precision (1e-6 by default) - * @returns {Number} the index of the tuple if found, -1 otherwise. - */ - findTuple(tupleToSearch: Array|TypedArray, precision?: number): number; - - /** - * Get the data type of this array as a string. - * @returns {String} - */ - getDataType(): string; - - /** - * Return a clone of this array. - * @returns {vtkDataArray} - */ - newClone(): vtkDataArray; - - /** - * Get the name of the array. - * @returns {String} - */ - getName(): string; - - /** - * Set the data of this array. - * Optionally pass ´numberOfComponents´ to overwrite this dataArray's - * numberOfComponents. - * If this dataArray's numberOfComponents doesn't divide the given array's - * length, this dataArray's numberOfComponents is set to 1. - * - * @param {Number[]|TypedArray} typedArray The Array value. - * @param {Number} [numberOfComponents] - */ - setData(typedArray: number[]|TypedArray, numberOfComponents?: number): void; - - /** - * Get the state of this array. - * @returns {object} - */ - getState(): object; - - /** - * Deep copy of another vtkDataArray into this one. - * @param {vtkDataArray} other - */ - deepCopy(other: vtkDataArray): void; - - /** - * Interpolate between the tuples retrieved from source1 - * and source2 with the resp. indices and set the - * resulting tuple to the idx of this DataArray. - * - * @param {int} idx, - * @param {vtkDataArray} source1, - * @param {int} source1Idx, - * @param {vtkDataArray} source2, - * @param {int} source2Idx, - * @param {float} t - */ - interpolateTuple( - idx: int, - source1: vtkDataArray, - source1Idx: int, - source2: vtkDataArray, - source2Idx: int, - t: float - ): void; - - /** - * Resize the array to the requested number of tuples and preserve data. - * Increasing the array size may allocate extra memory beyond what was - * requested. - * Decreasing the array size will trim memory to the requested size. - * model.size WILL be modified according ot the new size. - * If requestedNumTuples > getNumberOfTuples(), - * it creates a new typed array and copies the old values to the new array. - * If requestedNumTuples < getNumberOfTuples(), the typed array is untouched, - * only model.size is modified. - * @param {Number} requestedNumTuples Final expected number of tuples; must be >= 0 - * @returns {Boolean} True if a resize occured, false otherwise - * @see insertNextTuple - * @see insertNextTuples - * @see initialize - */ - resize(requestedNumTuples: number): boolean; - - /** - * Reset this array. - * NOTE: This won't touch the actual memory of the underlying typedArray. - * @see insertNextTuple - * @see insertNextTuples - */ - initialize(): void; - - // --- via macro -- - - /** - * Set the name of this array. - * @param {String} name - * @returns {Boolean} - */ - setName(name: string): boolean; - - /** - * Set the dimension (n) of the components. - * @param {Number} numberOfComponents - */ - setNumberOfComponents(numberOfComponents: number): boolean; -} - -// ---------------------------------------------------------------------------- -// Static API -// ---------------------------------------------------------------------------- - -/** - * Compute range of a given array. The array could be composed of tuples and - * individual component range could be computed as well as magnitude. - * - * ```js - * const array = [x0, y0, z0, x1, y1, z1, ..., xn, yn, zn]; - * const { min: yMin, max: yMax } = computeRange(array, 1, 3); - * const { min: minMagnitude, max: maxMagnitude } = computeRange(array, -1, 3); - * ``` - * - * @param {Number[]} values Array to go through to extract the range from - * @param {Number} [component] (default: 0) indice to use inside tuple size - * @param {Number} [numberOfComponents] (default: 1) size of the tuple - */ -export function computeRange(values: ArrayLike, component?: number, numberOfComponents?: number): vtkRange; - -/** - * Compute range of a given array, it only supports 1D arrays. - * - * @param {Number[]} values Array to go through to extract the range from - * @param {Number} offset offset index to select the desired component in the tuple - * @param {Number} numberOfComponents size of tuple in a multi-channel array - */ -export function fastComputeRange(values: ArrayLike, offset: number, numberOfComponents: number): vtkRange; - -/** - * @deprecated please use `fastComputeRange` instead - * Create helper object that can be used to gather min, max, count, sum of - * a set of values. - */ -export function createRangeHelper(): vtkRangeHelper - -/** - * Return the name of a typed array - * - * ```js - * const isFloat32 = ('Float32Array' === getDataType(array)); - * const clone = new macro.TYPED_ARRAYS[getDataType(array)](array.length); - * ``` - * - * @param typedArray to extract its type from - */ -export function getDataType(typedArray: TypedArray): string - -/** - * Return the max norm of a given vtkDataArray - * - * @param dataArray to process - */ -export function getMaxNorm(dataArray: vtkDataArray): number - -/** - * Method use to decorate a given object (publicAPI+model) with vtkDataArray characteristics. - * - * @param publicAPI object on which methods will be bounds (public) - * @param model object on which data structure will be bounds (protected) - * @param {object} [initialValues] (default: {}) Must pass a number > 0 for `size` except if `empty: true` is also passed or a non-empty typed array for `values`. - */ -export function extend(publicAPI: object, model: object, initialValues?: IDataArrayInitialValues): void; - -// ---------------------------------------------------------------------------- - -/** - * Method use to create a new instance of vtkDataArray - * @param {object} [initialValues] for pre-setting some of its content - */ -export function newInstance(initialValues?: object): vtkDataArray; - -/** - * Constants capturing the number of bytes per element based on its data type. - */ -export enum DataTypeByteSize { - Int8Array, - Uint8Array, - Uint8ClampedArray, - Int16Array, - Uint16Array, - Int32Array, - Uint32Array, - Float32Array, - Float64Array, -} - -/** - * Constants capturing the various VTK data types. - */ -export enum VtkDataTypes { - VOID, - CHAR, - SIGNED_CHAR, - UNSIGNED_CHAR, - SHORT, - UNSIGNED_SHORT, - INT, - UNSIGNED_INT, - FLOAT, - DOUBLE, -} - -/** - * vtkDataArray is an abstract superclass for data array objects containing - * numeric data. - */ -export declare const vtkDataArray: { - newInstance: typeof newInstance, - extend: typeof extend, - // static - computeRange: typeof computeRange, - createRangeHelper: typeof createRangeHelper, - fastComputeRange: typeof fastComputeRange, - getDataType: typeof getDataType, - getMaxNorm: typeof getMaxNorm, - // constants - DataTypeByteSize: typeof DataTypeByteSize, - VtkDataTypes: typeof VtkDataTypes, - DefaultDataType: VtkDataTypes, -}; - -export default vtkDataArray; +import { vtkObject, vtkRange } from '../../../interfaces'; +import { float, int, Nullable, Range, TypedArray } from '../../../types'; + +/** + * Output of the rangeHelper instance + */ +interface VtkStatisticInformation { + min: number; + max: number; + count: number; + sum: number; + mean: number; +} + +/** + * Helper class used to compute data range of a set of numbers + */ +interface vtkRangeHelper { + add(value: number): void; + get(): VtkStatisticInformation; + getRange(): vtkRange; +} + +/** + * The inital values of a vtkDataArray. + */ +export interface IDataArrayInitialValues { + dataType?: string; + empty?: boolean; + name?: string; + numberOfComponents?: number; + rangeTuple?: Range; + size?: number; + values?: Array | TypedArray; +} + +export interface vtkDataArray extends vtkObject { + /** + * Get the size, in bytes, of the lowest-level element of an array. + */ + getElementComponentSize(): number; + + /** + * Get the component for a given tupleIdx. + * @param {Number} tupleIdx + * @param {Number} [componentIndex] (default: 0) + */ + getComponent(tupleIdx: number, componentIndex?: number): number; + + /** + * Set the component value for a given tupleIdx and componentIndex. + * @param {Number} tupleIdx + * @param {Number} componentIndex + * @param {Number} value + */ + setComponent(tupleIdx: number, componentIndex: number, value: number): void; + + /** + * + */ + getData(): number[] | TypedArray; + + /** + * Call this method when the underlying data has changed + * This method calls `modified()` + * For example, when you need to modify chunks of the array, it is faster + * to get the underlying array with `getData()`, modify it, and then call + * `dataChange()`. + */ + dataChange(): void; + + /** + * Get the range of the given component. + * + * @param {Number} componentIndex (default: -1) + */ + getRange(componentIndex?: number): Range; + + /** + * + * @param {vtkRange} rangeValue + * @param {Number} componentIndex + */ + setRange(rangeValue: vtkRange, componentIndex: number): Range; + + /** + * Set the given tuple at the given index. + * @param {Number} idx + * @param {Array|TypedArray} tuple + */ + setTuple(idx: number, tuple: Array | TypedArray): void; + + /** + * Set the given tuples starting at the given index. + * @param {Number} idx + * @param {Array|TypedArray} tuples + */ + setTuples(idx: number, tuples: Array | TypedArray): void; + + /** + * Get the tuple at the given index. + * + * For performance reasons, it is advised to pass a 'tupleToFill': + * `const x = [];` + * `for (int i = 0; i < N; ++i) { + * ` dataArray.getTuple(idx, x);` + * ` ...` + * instead of: + * `for (int i = 0; i < N; ++i) { + * ` const x = dataArray.getTuple(idx);` + * `...` + * @param {Number} idx + * @param {Number[]|TypedArray} [tupleToFill] (default []) + * @returns {Number[]|TypedArray} + */ + getTuple( + idx: number, + tupleToFill?: number[] | TypedArray + ): number[] | TypedArray; + + /** + * Get the tuples between fromId (inclusive) and toId (exclusive). + * + * If fromId or toId is negative, it refers to a tuple index from the + * end of the underlying typedArray. + * If the range between fromId and toId is invalid, getTuples returns + * null. + * + * NOTE: Any changes to the returned TypedArray will result in changes to + * this DataArray's underlying TypedArray. + * + * @param {Number} [fromId] (default: 0) + * @param {Number} [toId] (default: publicAPI.getNumberOfTuples()) + * @returns {Nullable} + */ + getTuples(fromId?: number, toId?: number): Nullable; + + /** + * Insert the given tuple at the given index. + * NOTE: May resize the data values array. "Safe" version of setTuple. + * + * A typical usage is when `vtkDataArray` is initialized with + * `initialValues = { size: 0, values: new Uint8Array(1000) }`, where + * an empty but pre-allocated array with 1'000 components is created. + * The component values can then be inserted with `insertTuple()` or + * `insertNextTuple()` without requiring new memory allocation until + * the size of 1'000 is exceeded (e.g. after inserting the 250th + * 4-component tuple). + * + * `insertTuple` increases the number of tuples (`getNumberOfTuples()`). + * + * @see insertNextTuple + * @see getNumberOfTuples + * + * @param {Number} idx + * @param {Array|TypedArray} tuple + * @returns {Number} Index of the inserted tuple + */ + insertTuple(idx: number, tuple: Array | TypedArray): number; + + /** + * Insert tuples starting at the given idx. + * + * @param {Number} idx + * @param {Array|TypedArray} tuples Flat array of tuples to insert + * @returns The index of the last inserted tuple + */ + insertTuples(idx: number, tuples: Array | TypedArray): number; + + /** + * Insert the given tuple at the next available slot and return the index of the insertion. + * NOTE: May resize the data values array. "Safe" version of setTuple. + * + * @see insertTuple + * + * @param {Array|TypedArray} tuple + * @returns {Number} Index of the inserted tuple. + */ + insertNextTuple(tuple: Array | TypedArray): number; + + /** + * Convenience function to insert an array of tuples with insertNextTuple. + * NOTE: tuples.length must be a multiple of `getNumberOfComponents`. + * @param {Array|TypedArray} tuples + * @returns The index of the last inserted tuple + */ + insertNextTuples(tuples: Array | TypedArray): number; + + /** + * + * @param {Number} [idx] (default: 1) + * @returns {Number} + */ + getTupleLocation(idx?: number): number; + + /** + * Get the dimension (n) of the components. + * @returns {Number} + */ + getNumberOfComponents(): number; + + /** + * Get the actual number of values in the array, which is equal to `getNumberOfTuples() * getNumberOfComponents()`. + * @returns {Number} + */ + getNumberOfValues(): number; + + /** + * Get the actual number of complete tuples (a component group) in the array. + * @returns {Number} + */ + getNumberOfTuples(): number; + + /** + * Convenient method to search the index of the first matching tuple in the array. + * This is a naïve search, consider using a "locator" instead. + * @param {Array|TypedArray} tupleToSearch + * @param {Number} precision (1e-6 by default) + * @returns {Number} the index of the tuple if found, -1 otherwise. + */ + findTuple( + tupleToSearch: Array | TypedArray, + precision?: number + ): number; + + /** + * Get the data type of this array as a string. + * @returns {String} + */ + getDataType(): string; + + /** + * Return a clone of this array. + * @returns {vtkDataArray} + */ + newClone(): vtkDataArray; + + /** + * Get the name of the array. + * @returns {String} + */ + getName(): string; + + /** + * Set the data of this array. + * Optionally pass ´numberOfComponents´ to overwrite this dataArray's + * numberOfComponents. + * If this dataArray's numberOfComponents doesn't divide the given array's + * length, this dataArray's numberOfComponents is set to 1. + * + * @param {Number[]|TypedArray} typedArray The Array value. + * @param {Number} [numberOfComponents] + */ + setData(typedArray: number[] | TypedArray, numberOfComponents?: number): void; + + /** + * Get the state of this array. + * @returns {object} + */ + getState(): object; + + /** + * Deep copy of another vtkDataArray into this one. + * @param {vtkDataArray} other + */ + deepCopy(other: vtkDataArray): void; + + /** + * Interpolate between the tuples retrieved from source1 + * and source2 with the resp. indices and set the + * resulting tuple to the idx of this DataArray. + * + * @param {int} idx, + * @param {vtkDataArray} source1, + * @param {int} source1Idx, + * @param {vtkDataArray} source2, + * @param {int} source2Idx, + * @param {float} t + */ + interpolateTuple( + idx: int, + source1: vtkDataArray, + source1Idx: int, + source2: vtkDataArray, + source2Idx: int, + t: float + ): void; + + /** + * Resize the array to the requested number of tuples and preserve data. + * Increasing the array size may allocate extra memory beyond what was + * requested. + * Decreasing the array size will trim memory to the requested size. + * model.size WILL be modified according ot the new size. + * If requestedNumTuples > getNumberOfTuples(), + * it creates a new typed array and copies the old values to the new array. + * If requestedNumTuples < getNumberOfTuples(), the typed array is untouched, + * only model.size is modified. + * @param {Number} requestedNumTuples Final expected number of tuples; must be >= 0 + * @returns {Boolean} True if a resize occured, false otherwise + * @see insertNextTuple + * @see insertNextTuples + * @see initialize + */ + resize(requestedNumTuples: number): boolean; + + /** + * Reset this array. + * NOTE: This won't touch the actual memory of the underlying typedArray. + * @see insertNextTuple + * @see insertNextTuples + */ + initialize(): void; + + // --- via macro -- + + /** + * Set the name of this array. + * @param {String} name + * @returns {Boolean} + */ + setName(name: string): boolean; + + /** + * Set the dimension (n) of the components. + * @param {Number} numberOfComponents + */ + setNumberOfComponents(numberOfComponents: number): boolean; +} + +// ---------------------------------------------------------------------------- +// Static API +// ---------------------------------------------------------------------------- + +/** + * Compute range of a given array. The array could be composed of tuples and + * individual component range could be computed as well as magnitude. + * + * ```js + * const array = [x0, y0, z0, x1, y1, z1, ..., xn, yn, zn]; + * const { min: yMin, max: yMax } = computeRange(array, 1, 3); + * const { min: minMagnitude, max: maxMagnitude } = computeRange(array, -1, 3); + * ``` + * + * @param {Number[]} values Array to go through to extract the range from + * @param {Number} [component] (default: 0) indice to use inside tuple size + * @param {Number} [numberOfComponents] (default: 1) size of the tuple + */ +export function computeRange( + values: ArrayLike, + component?: number, + numberOfComponents?: number +): vtkRange; + +/** + * Compute range of a given array, it only supports 1D arrays. + * + * @param {Number[]} values Array to go through to extract the range from + * @param {Number} offset offset index to select the desired component in the tuple + * @param {Number} numberOfComponents size of tuple in a multi-channel array + */ +export function fastComputeRange( + values: ArrayLike, + offset: number, + numberOfComponents: number +): vtkRange; + +/** + * @deprecated please use `fastComputeRange` instead + * Create helper object that can be used to gather min, max, count, sum of + * a set of values. + */ +export function createRangeHelper(): vtkRangeHelper; + +/** + * Return the name of a typed array + * + * ```js + * const isFloat32 = ('Float32Array' === getDataType(array)); + * const clone = new macro.TYPED_ARRAYS[getDataType(array)](array.length); + * ``` + * + * @param typedArray to extract its type from + */ +export function getDataType(typedArray: TypedArray): string; + +/** + * Return the max norm of a given vtkDataArray + * + * @param dataArray to process + */ +export function getMaxNorm(dataArray: vtkDataArray): number; + +/** + * Method use to decorate a given object (publicAPI+model) with vtkDataArray characteristics. + * + * @param publicAPI object on which methods will be bounds (public) + * @param model object on which data structure will be bounds (protected) + * @param {object} [initialValues] (default: {}) Must pass a number > 0 for `size` except if `empty: true` is also passed or a non-empty typed array for `values`. + */ +export function extend( + publicAPI: object, + model: object, + initialValues?: IDataArrayInitialValues +): void; + +// ---------------------------------------------------------------------------- + +/** + * Method use to create a new instance of vtkDataArray + * @param {object} [initialValues] for pre-setting some of its content + */ +export function newInstance(initialValues?: object): vtkDataArray; + +/** + * Constants capturing the number of bytes per element based on its data type. + */ +export enum DataTypeByteSize { + Int8Array, + Uint8Array, + Uint8ClampedArray, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, +} + +/** + * Constants capturing the various VTK data types. + */ +export enum VtkDataTypes { + VOID, + CHAR, + SIGNED_CHAR, + UNSIGNED_CHAR, + SHORT, + UNSIGNED_SHORT, + INT, + UNSIGNED_INT, + FLOAT, + DOUBLE, +} + +/** + * vtkDataArray is an abstract superclass for data array objects containing + * numeric data. + */ +export declare const vtkDataArray: { + newInstance: typeof newInstance; + extend: typeof extend; + // static + computeRange: typeof computeRange; + createRangeHelper: typeof createRangeHelper; + fastComputeRange: typeof fastComputeRange; + getDataType: typeof getDataType; + getMaxNorm: typeof getMaxNorm; + // constants + DataTypeByteSize: typeof DataTypeByteSize; + VtkDataTypes: typeof VtkDataTypes; + DefaultDataType: VtkDataTypes; +}; + +export default vtkDataArray; diff --git a/Sources/Common/Core/Endian/index.d.ts b/Sources/Common/Core/Endian/index.d.ts index 09fd17422fc..fa2f960e21b 100755 --- a/Sources/Common/Core/Endian/index.d.ts +++ b/Sources/Common/Core/Endian/index.d.ts @@ -1,15 +1,15 @@ -import { Nullable } from "../../../types"; +import { Nullable } from '../../../types'; /** * Get the endianness */ export function getEndianness(): Nullable; -export const ENDIANNESS : string; +export const ENDIANNESS: string; /** - * - * @param {ArrayBuffer} buffer - * @param {Number} wordSize + * + * @param {ArrayBuffer} buffer + * @param {Number} wordSize */ -export function swapBytes(buffer : ArrayBuffer, wordSize : number): void; +export function swapBytes(buffer: ArrayBuffer, wordSize: number): void; diff --git a/Sources/Common/Core/HalfFloat/index.d.ts b/Sources/Common/Core/HalfFloat/index.d.ts index 9beebb8b7e2..2f943fbe3be 100644 --- a/Sources/Common/Core/HalfFloat/index.d.ts +++ b/Sources/Common/Core/HalfFloat/index.d.ts @@ -17,8 +17,8 @@ export function toHalf(input: number): number; export function fromHalf(input: number): number; export declare const HalfFloat: { - toHalf: typeof toHalf; - fromHalf: typeof fromHalf; -} + toHalf: typeof toHalf; + fromHalf: typeof fromHalf; +}; export default HalfFloat; diff --git a/Sources/Common/Core/ImageHelper/index.d.ts b/Sources/Common/Core/ImageHelper/index.d.ts index 4fed6a4cf97..38907f104f8 100755 --- a/Sources/Common/Core/ImageHelper/index.d.ts +++ b/Sources/Common/Core/ImageHelper/index.d.ts @@ -1,9 +1,9 @@ -import vtkImageData from "../../../Common/DataModel/ImageData"; +import vtkImageData from '../../../Common/DataModel/ImageData'; interface ITransform { - flipX: boolean; - flipY: boolean; - rotate: number; + flipX: boolean; + flipY: boolean; + rotate: number; } /** @@ -14,11 +14,17 @@ interface ITransform { * @param {HTMLCanvasElement} canvas The HTML canvas to convert. * @param {Number[]} [boundingBox] A bounding box of type [top, left, width, height] */ -export function canvasToImageData(canvas : HTMLCanvasElement, boundingBox?: number[]): vtkImageData; +export function canvasToImageData( + canvas: HTMLCanvasElement, + boundingBox?: number[] +): vtkImageData; /** * Converts an Image object to a vtkImageData. * @param {HTMLImageElement} image The HTML image to convert. * @param {ITransform} [transform] default={flipX: false, flipY: false, rotate: 0} */ -export function imageToImageData(image : HTMLImageElement, transform?: ITransform): vtkImageData; +export function imageToImageData( + image: HTMLImageElement, + transform?: ITransform +): vtkImageData; diff --git a/Sources/Common/Core/LookupTable/index.d.ts b/Sources/Common/Core/LookupTable/index.d.ts index 2294b28bafa..732ba4ad885 100644 --- a/Sources/Common/Core/LookupTable/index.d.ts +++ b/Sources/Common/Core/LookupTable/index.d.ts @@ -1,261 +1,259 @@ -import { Range, RGBAColor } from "../../../types"; -import vtkScalarsToColors from "../ScalarsToColors"; +import { Range, RGBAColor } from '../../../types'; +import vtkScalarsToColors from '../ScalarsToColors'; /** - * + * */ -export interface ILookupTableInitialValues { -} +export interface ILookupTableInitialValues {} export interface vtkLookupTable extends vtkScalarsToColors { - - /** - * - */ - buildSpecialColors(): void; - - /** - * - */ - forceBuild(): void; - - /** - * - */ - getAboveRangeColor(): RGBAColor; - - /** - * - */ - getAboveRangeColorByReference(): RGBAColor; - - /** - * - */ - getAlphaRange(): Range; - - /** - * - */ - getAlphaRangeByReference(): Range; - - /** - * - */ - getBelowRangeColor(): RGBAColor; - - /** - * - */ - getBelowRangeColorByReference(): RGBAColor; - - /** - * - */ - getHueRange(): Range; - - /** - * - */ - getHueRangeByReference(): Range; - - /** - * - */ - getNanColor(): RGBAColor; - - /** - * - */ - getNanColorByReference(): RGBAColor; - - /** - * - */ - getNumberOfAnnotatedValues(): number; - - /** - * - */ - getNumberOfAvailableColors(): number; - - /** - * - */ - getNumberOfColors(): number; - - /** - * - */ - getRange(): Range; - - /** - * - */ - getSaturationRange(): Range; - - /** - * - */ - getSaturationRangeByReference(): Range; - - /** - * - */ - getUseAboveRangeColor(): boolean; - - /** - * - */ - getUseBelowRangeColor(): boolean; - - /** - * - */ - getValueRange(): Range; - - /** - * - */ - getValueRangeByReference(): Range; - - /** - * - * @param v - * @param table - * @param p - */ - indexedLookupFunction(v: number, table: any, p: object): RGBAColor; - - /** - * - * @param v - * @param p - */ - linearIndexLookup(v: number, p: object): number; - - /** - * - * @param v - * @param table - * @param p - */ - linearLookup(v: number, table: any, p: object): RGBAColor; - - /** - * - * @param range - * @param p - */ - lookupShiftAndScale(range: Range, p: object): boolean - - /** - * - * @param aboveRangeColor - */ - setAboveRangeColor(aboveRangeColor: RGBAColor): boolean; - - /** - * - * @param aboveRangeColor - */ - setAboveRangeColorFrom(aboveRangeColor: RGBAColor): boolean; - - /** - * - * @param alphaRange - */ - setAlphaRange(alphaRange: Range): boolean; - - /** - * - * @param alphaRange - */ - setAlphaRangeFrom(alphaRange: Range): boolean; - - /** - * - * @param belowRangeColor - */ - setBelowRangeColor(belowRangeColor: RGBAColor): boolean; - - /** - * - * @param belowRangeColor - */ - setBelowRangeColorFrom(belowRangeColor: RGBAColor): boolean; - - /** - * - * @param hueRange - */ - setHueRange(hueRange: Range): boolean; - - /** - * - * @param hueRange - */ - setHueRangeFrom(hueRange: Range): boolean; - - /** - * - * @param nanColor - */ - setNanColor(nanColor: RGBAColor): boolean; - - /** - * - * @param nanColor - */ - setNanColorFrom(nanColor: RGBAColor): boolean; - - /** - * - * @param numberOfColors - */ - setNumberOfColors(numberOfColors: number): boolean; - - /** - * - * @param saturationRange - */ - setSaturationRange(saturationRange: Range): boolean; - - /** - * - * @param saturationRange - */ - setSaturationRangeFrom(saturationRange: Range): boolean; - - /** - * - * @param table - */ - setTable(table: any): boolean; - - /** - * - * @param useAboveRangeColor - */ - setUseAboveRangeColor(useAboveRangeColor: boolean): boolean; - - /** - * - * @param useBelowRangeColor - */ - setUseBelowRangeColor(useBelowRangeColor: boolean): boolean; - - /** - * - * @param valueRange - */ - setValueRange(valueRange: Range): boolean; - - /** - * - * @param valueRange - */ - setValueRangeFrom(valueRange: Range): boolean; + /** + * + */ + buildSpecialColors(): void; + + /** + * + */ + forceBuild(): void; + + /** + * + */ + getAboveRangeColor(): RGBAColor; + + /** + * + */ + getAboveRangeColorByReference(): RGBAColor; + + /** + * + */ + getAlphaRange(): Range; + + /** + * + */ + getAlphaRangeByReference(): Range; + + /** + * + */ + getBelowRangeColor(): RGBAColor; + + /** + * + */ + getBelowRangeColorByReference(): RGBAColor; + + /** + * + */ + getHueRange(): Range; + + /** + * + */ + getHueRangeByReference(): Range; + + /** + * + */ + getNanColor(): RGBAColor; + + /** + * + */ + getNanColorByReference(): RGBAColor; + + /** + * + */ + getNumberOfAnnotatedValues(): number; + + /** + * + */ + getNumberOfAvailableColors(): number; + + /** + * + */ + getNumberOfColors(): number; + + /** + * + */ + getRange(): Range; + + /** + * + */ + getSaturationRange(): Range; + + /** + * + */ + getSaturationRangeByReference(): Range; + + /** + * + */ + getUseAboveRangeColor(): boolean; + + /** + * + */ + getUseBelowRangeColor(): boolean; + + /** + * + */ + getValueRange(): Range; + + /** + * + */ + getValueRangeByReference(): Range; + + /** + * + * @param v + * @param table + * @param p + */ + indexedLookupFunction(v: number, table: any, p: object): RGBAColor; + + /** + * + * @param v + * @param p + */ + linearIndexLookup(v: number, p: object): number; + + /** + * + * @param v + * @param table + * @param p + */ + linearLookup(v: number, table: any, p: object): RGBAColor; + + /** + * + * @param range + * @param p + */ + lookupShiftAndScale(range: Range, p: object): boolean; + + /** + * + * @param aboveRangeColor + */ + setAboveRangeColor(aboveRangeColor: RGBAColor): boolean; + + /** + * + * @param aboveRangeColor + */ + setAboveRangeColorFrom(aboveRangeColor: RGBAColor): boolean; + + /** + * + * @param alphaRange + */ + setAlphaRange(alphaRange: Range): boolean; + + /** + * + * @param alphaRange + */ + setAlphaRangeFrom(alphaRange: Range): boolean; + + /** + * + * @param belowRangeColor + */ + setBelowRangeColor(belowRangeColor: RGBAColor): boolean; + + /** + * + * @param belowRangeColor + */ + setBelowRangeColorFrom(belowRangeColor: RGBAColor): boolean; + + /** + * + * @param hueRange + */ + setHueRange(hueRange: Range): boolean; + + /** + * + * @param hueRange + */ + setHueRangeFrom(hueRange: Range): boolean; + + /** + * + * @param nanColor + */ + setNanColor(nanColor: RGBAColor): boolean; + + /** + * + * @param nanColor + */ + setNanColorFrom(nanColor: RGBAColor): boolean; + + /** + * + * @param numberOfColors + */ + setNumberOfColors(numberOfColors: number): boolean; + + /** + * + * @param saturationRange + */ + setSaturationRange(saturationRange: Range): boolean; + + /** + * + * @param saturationRange + */ + setSaturationRangeFrom(saturationRange: Range): boolean; + + /** + * + * @param table + */ + setTable(table: any): boolean; + + /** + * + * @param useAboveRangeColor + */ + setUseAboveRangeColor(useAboveRangeColor: boolean): boolean; + + /** + * + * @param useBelowRangeColor + */ + setUseBelowRangeColor(useBelowRangeColor: boolean): boolean; + + /** + * + * @param valueRange + */ + setValueRange(valueRange: Range): boolean; + + /** + * + * @param valueRange + */ + setValueRangeFrom(valueRange: Range): boolean; } /** @@ -265,20 +263,25 @@ export interface vtkLookupTable extends vtkScalarsToColors { * @param model object on which data structure will be bounds (protected) * @param {ILookupTableInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ILookupTableInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ILookupTableInitialValues +): void; /** * Method used to create a new instance of vtkLookupTable * @param {ILookupTableInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ILookupTableInitialValues): vtkLookupTable; - +export function newInstance( + initialValues?: ILookupTableInitialValues +): vtkLookupTable; /** * vtkLookupTable is a 2D widget for manipulating a marker prop */ export declare const vtkLookupTable: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkLookupTable; diff --git a/Sources/Common/Core/Math/index.d.ts b/Sources/Common/Core/Math/index.d.ts index 241e1991f59..d54f888a6a5 100755 --- a/Sources/Common/Core/Math/index.d.ts +++ b/Sources/Common/Core/Math/index.d.ts @@ -1,4 +1,16 @@ -import { Bounds, Extent, HSVColor, RGBAColor, RGBColor, Matrix, Matrix3x3, Range, Vector2, Vector3, Vector4 } from "../../../types"; +import { + Bounds, + Extent, + HSVColor, + RGBAColor, + RGBColor, + Matrix, + Matrix3x3, + Range, + Vector2, + Vector3, + Vector4, +} from '../../../types'; /** * @@ -13,7 +25,12 @@ export function createArray(size?: number): number[]; * @param {Number} row1 index of first row to swap with the other. * @param {Number} row2 index of second row to swap with the other. */ -export function swapRowsMatrix_nxn(matrix: number[], n: number, row1: number, row2: number): void; +export function swapRowsMatrix_nxn( + matrix: number[], + n: number, + row1: number, + row2: number +): void; /** * Given two columns indices, swap the two columns of a nxn matrix @@ -22,7 +39,12 @@ export function swapRowsMatrix_nxn(matrix: number[], n: number, row1: number, ro * @param {Number} column1 index of first col to swap with the other. * @param {Number} column2 index of second col to swap with the other. */ - export function swapColumnsMatrix_nxn(matrix: number[], n: number, column1: number, column2: number): void; +export function swapColumnsMatrix_nxn( + matrix: number[], + n: number, + column1: number, + column2: number +): void; /** * Get the number π. @@ -97,7 +119,11 @@ export function arrayMax(arr: number[], offset: number, stride: number): number; * @param {Number} offset The offset. * @param {Number} stride The stride. */ -export function arrayRange(arr: number[], offset: number, stride: number): number[]; +export function arrayRange( + arr: number[], + offset: number, + stride: number +): number[]; /** * Gives the exponent of the lowest power of two not less than x. @@ -197,8 +223,8 @@ export function subtract(a: Vector3, b: Vector3, out: Vector3): Vector3; /** * - * @param {Vector3} vec - * @param {Number} scalar + * @param {Vector3} vec + * @param {Number} scalar * @example * ```js * vec[3] * scalar => vec[3] @@ -208,8 +234,8 @@ export function multiplyScalar(vec: Vector3, scalar: number): Vector3; /** * - * @param {Vector2} vec - * @param {Number} scalar + * @param {Vector2} vec + * @param {Number} scalar * @example * ```js * vec[3] * scalar => vec[3] @@ -220,7 +246,7 @@ export function multiplyScalar2D(vec: Vector2, scalar: number): Vector2; /** * * @param {Vector3} a - * @param {Vector3} b + * @param {Vector3} b * @param {Number} scalar * @param {Vector3} out * @example @@ -228,20 +254,30 @@ export function multiplyScalar2D(vec: Vector2, scalar: number): Vector2; * a[3] + b[3] * scalar => out[3] * ``` */ -export function multiplyAccumulate(a: Vector3, b: Vector3, scalar: number, out: Vector3): Vector3; +export function multiplyAccumulate( + a: Vector3, + b: Vector3, + scalar: number, + out: Vector3 +): Vector3; /** * * @param {Vector2} a * @param {Vector2} b - * @param {Number} scalar + * @param {Number} scalar * @param {Vector2} out * @example * ```js * a[2] + b[2] * scalar => out[2] * ``` */ -export function multiplyAccumulate2D(a: Vector2, b: Vector2, scalar: number, out: Vector2): Vector2; +export function multiplyAccumulate2D( + a: Vector2, + b: Vector2, + scalar: number, + out: Vector2 +): Vector2; /** * @@ -272,8 +308,8 @@ export function cross(x: Vector3, y: Vector3, out: Vector3): Vector3; /** * - * @param {Number[]} x - * @param {Number} n + * @param {Number[]} x + * @param {Number} n */ export function norm(x: number[], n: number): number; @@ -290,7 +326,12 @@ export function normalize(x: Vector3): number; * @param {Vector3} z The third vector. * @param {Number} theta */ -export function perpendiculars(x: Vector3, y: Vector3, z: Vector3, theta: number): void; +export function perpendiculars( + x: Vector3, + y: Vector3, + z: Vector3, + theta: number +): void; /** * @@ -298,7 +339,11 @@ export function perpendiculars(x: Vector3, y: Vector3, z: Vector3, theta: number * @param {Vector3} b * @param {Vector3} projection */ -export function projectVector(a: Vector3, b: Vector3, projection: Vector3): boolean; +export function projectVector( + a: Vector3, + b: Vector3, + projection: Vector3 +): boolean; /** * @@ -314,7 +359,11 @@ export function dot2D(x: Vector2, y: Vector2): number; * @param {Vector2} b The second 2D vector. * @param {Vector2} projection The projection 2D vector. */ -export function projectVector2D(a: Vector2, b: Vector2, projection: Vector2): boolean; +export function projectVector2D( + a: Vector2, + b: Vector2, + projection: Vector2 +): boolean; /** * Compute distance squared between two points p1 and p2. @@ -330,7 +379,6 @@ export function distance2BetweenPoints(x: Vector3, y: Vector3): number; */ export function angleBetweenVectors(v1: Vector3, v2: Vector3): number; - /** * Signed angle between v1 and v2 with regards to plane defined by normal vN. * angle between v1 and v2 with regards to plane defined by normal vN.Signed @@ -338,10 +386,13 @@ export function angleBetweenVectors(v1: Vector3, v2: Vector3): number; * vN.t3(mat_3x3, in_3, out_3) * @param {Vector3} v1 The first 3D vector. * @param {Vector3} v2 The second 3D vector. - * @param {Vector3} vN + * @param {Vector3} vN */ -export function signedAngleBetweenVectors(v1: Vector3, v2: Vector3, vN: Vector3): number; - +export function signedAngleBetweenVectors( + v1: Vector3, + v2: Vector3, + vN: Vector3 +): number; /** * Compute the amplitude of a Gaussian function with mean=0 and specified variance. @@ -349,7 +400,11 @@ export function signedAngleBetweenVectors(v1: Vector3, v2: Vector3, vN: Vector3) * @param {Number} variance The variance value. * @param {Number} position The position value. */ -export function gaussianAmplitude(mean: number, variance: number, position: number): number; +export function gaussianAmplitude( + mean: number, + variance: number, + position: number +): number; /** * Compute the amplitude of an unnormalized Gaussian function with mean=0 and @@ -358,7 +413,11 @@ export function gaussianAmplitude(mean: number, variance: number, position: numb * @param {Number} variance The variance value. * @param {Number} position The position value. */ -export function gaussianWeight(mean: number, variance: number, position: number): number; +export function gaussianWeight( + mean: number, + variance: number, + position: number +): number; /** * Outer product of two 2-vectors. @@ -382,98 +441,144 @@ export function normalize2D(x: Vector2): number; /** * - * @param {Number[]} args + * @param {Number[]} args */ export function determinant2x2(args: number[]): number; /** * Fill a 4x4 matrix with the given row vectors - * @param {Vector4} row0 + * @param {Vector4} row0 * @param {Vector4} row1 * @param {Vector4} row2 * @param {Vector4} row3 * @param {Matrix} mat */ -export function rowsToMat4(row0: Vector4, row1: Vector4, row2: Vector4, row3: Vector4, mat: Matrix): Matrix; +export function rowsToMat4( + row0: Vector4, + row1: Vector4, + row2: Vector4, + row3: Vector4, + mat: Matrix +): Matrix; /** * Fill a 4x4 matrix with the given column vectors - * @param {Vector4} column0 + * @param {Vector4} column0 * @param {Vector4} column1 * @param {Vector4} column2 * @param {Vector4} column3 * @param {Matrix} mat */ -export function columnsToMat4(column0: Vector4, column1: Vector4, column2: Vector4, column3: Vector4, mat: Matrix): Matrix; +export function columnsToMat4( + column0: Vector4, + column1: Vector4, + column2: Vector4, + column3: Vector4, + mat: Matrix +): Matrix; - /** +/** * Fill a 3x3 matrix with the given row vectors - * @param {Vector3} row0 + * @param {Vector3} row0 * @param {Vector3} row1 * @param {Vector3} row2 * @param {Matrix} mat */ -export function rowsToMat3(row0: Vector3, row1: Vector3, row2: Vector3, mat: Matrix): Matrix; +export function rowsToMat3( + row0: Vector3, + row1: Vector3, + row2: Vector3, + mat: Matrix +): Matrix; - /** +/** * Fill a 3x3 matrix with the given column vectors - * @param {Vector3} column0 + * @param {Vector3} column0 * @param {Vector3} column1 * @param {Vector3} column2 * @param {Matrix} mat */ -export function columnsToMat3(column0: Vector3, column1: Vector3, column2: Vector3, mat: Matrix): Matrix; +export function columnsToMat3( + column0: Vector3, + column1: Vector3, + column2: Vector3, + mat: Matrix +): Matrix; /** * LU Factorization of a 3x3 matrix. - * @param {Matrix3x3} mat_3x3 - * @param {Vector3} index_3 + * @param {Matrix3x3} mat_3x3 + * @param {Vector3} index_3 */ export function LUFactor3x3(mat_3x3: Matrix3x3, index_3: Vector3): void; /** * LU back substitution for a 3x3 matrix. - * @param {Matrix3x3} mat_3x3 - * @param {Vector3} index_3 - * @param {Vector3} x_3 + * @param {Matrix3x3} mat_3x3 + * @param {Vector3} index_3 + * @param {Vector3} x_3 */ -export function LUSolve3x3(mat_3x3: Matrix3x3, index_3: Vector3, x_3: Vector3): void; +export function LUSolve3x3( + mat_3x3: Matrix3x3, + index_3: Vector3, + x_3: Vector3 +): void; /** * Solve mat_3x3y_3 = x_3 for y and place the result in y. - * @param {Matrix3x3} mat_3x3 - * @param {Vector3} x_3 - * @param {Vector3} y_3 + * @param {Matrix3x3} mat_3x3 + * @param {Vector3} x_3 + * @param {Vector3} y_3 */ -export function linearSolve3x3(mat_3x3: Matrix3x3, x_3: Vector3, y_3: Vector3): void; +export function linearSolve3x3( + mat_3x3: Matrix3x3, + x_3: Vector3, + y_3: Vector3 +): void; /** * - * @param {Matrix3x3} mat_3x3 - * @param {Vector3} in_3 - * @param {Vector3} out_3 + * @param {Matrix3x3} mat_3x3 + * @param {Vector3} in_3 + * @param {Vector3} out_3 */ -export function multiply3x3_vect3(mat_3x3: Matrix3x3, in_3: Vector3, out_3: Vector3): void; +export function multiply3x3_vect3( + mat_3x3: Matrix3x3, + in_3: Vector3, + out_3: Vector3 +): void; /** * - * @param {Matrix3x3} a_3x3 - * @param {Matrix3x3} b_3x3 - * @param {Matrix3x3} out_3x3 + * @param {Matrix3x3} a_3x3 + * @param {Matrix3x3} b_3x3 + * @param {Matrix3x3} out_3x3 */ -export function multiply3x3_mat3(a_3x3: Matrix3x3, b_3x3: Matrix3x3, out_3x3: Matrix3x3): void; +export function multiply3x3_mat3( + a_3x3: Matrix3x3, + b_3x3: Matrix3x3, + out_3x3: Matrix3x3 +): void; /** * Multiply two matrices. - * @param {Matrix} a - * @param {Matrix} b - * @param {Number} rowA - * @param {Number} colA - * @param {Number} rowB - * @param {Number} colB - * @param {Matrix} outRowAColB - */ -export function multiplyMatrix(a: Matrix, b: Matrix, rowA: number, colA: number, rowB: number, colB: number, outRowAColB: Matrix): void; + * @param {Matrix} a + * @param {Matrix} b + * @param {Number} rowA + * @param {Number} colA + * @param {Number} rowB + * @param {Number} colB + * @param {Matrix} outRowAColB + */ +export function multiplyMatrix( + a: Matrix, + b: Matrix, + rowA: number, + colA: number, + rowB: number, + colB: number, + outRowAColB: Matrix +): void; /** * Transpose a 3x3 matrix. @@ -533,9 +638,12 @@ export function determinant3x3(mat_3x3: Matrix3x3): number; /** * * @param {Vector4} quat_4 - * @param {Matrix3x3} mat_3x3 + * @param {Matrix3x3} mat_3x3 */ -export function quaternionToMatrix3x3(quat_4: Vector4, mat_3x3: Matrix3x3): void; +export function quaternionToMatrix3x3( + quat_4: Vector4, + mat_3x3: Matrix3x3 +): void; /** * Returns true if elements of both arrays are equals. @@ -547,89 +655,118 @@ export function areEquals(a: number[], b: number[], eps?: number): boolean; /** * - * @param {Number} num - * @param {Number} [digits] + * @param {Number} num + * @param {Number} [digits] */ export function roundNumber(num: number, digits?: number): number; /** * - * @param {Vector3} vector - * @param {Vector3} [out] - * @param {Number} [digits] + * @param {Vector3} vector + * @param {Vector3} [out] + * @param {Number} [digits] */ -export function roundVector(vector: Vector3, out?: Vector3, digits?: number): Vector3; +export function roundVector( + vector: Vector3, + out?: Vector3, + digits?: number +): Vector3; /** -* Jacobi iteration for the solution of eigenvectors/eigenvalues. Input matrix a is modified (the upper triangle is filled with zeros) -* @param {Matrix} a real symetric nxn matrix -* @param {Number} n matrix size -* @param {Number[]} w vector of size n to store eigenvalues (stored in decreasing order) -* @param {Number[]} v matrix of size nxn to store eigenvectors (stored in decreasing order, normalized) -*/ + * Jacobi iteration for the solution of eigenvectors/eigenvalues. Input matrix a is modified (the upper triangle is filled with zeros) + * @param {Matrix} a real symetric nxn matrix + * @param {Number} n matrix size + * @param {Number[]} w vector of size n to store eigenvalues (stored in decreasing order) + * @param {Number[]} v matrix of size nxn to store eigenvectors (stored in decreasing order, normalized) + */ export function jacobiN(a: Matrix, n: number, w: number[], v: number[]): number; /** * - * @param {Matrix3x3} mat_3x3 - * @param {Vector4} quat_4 + * @param {Matrix3x3} mat_3x3 + * @param {Vector4} quat_4 */ -export function matrix3x3ToQuaternion(mat_3x3: Matrix3x3, quat_4: Vector4): void; +export function matrix3x3ToQuaternion( + mat_3x3: Matrix3x3, + quat_4: Vector4 +): void; /** * - * @param {Vector4} quat_1 - * @param {Vector4} quat_2 - * @param {Vector4} quat_out + * @param {Vector4} quat_1 + * @param {Vector4} quat_2 + * @param {Vector4} quat_out */ -export function multiplyQuaternion(quat_1: Vector4, quat_2: Vector4, quat_out: Vector4): void; +export function multiplyQuaternion( + quat_1: Vector4, + quat_2: Vector4, + quat_out: Vector4 +): void; /** * - * @param {Matrix3x3} a_3x3 - * @param {Matrix3x3} out_3x3 + * @param {Matrix3x3} a_3x3 + * @param {Matrix3x3} out_3x3 */ export function orthogonalize3x3(a_3x3: Matrix3x3, out_3x3: Matrix3x3): void; /** * - * @param {Matrix3x3} a_3x3 - * @param {Vector3} w_3 - * @param {Matrix3x3} v_3x3 + * @param {Matrix3x3} a_3x3 + * @param {Vector3} w_3 + * @param {Matrix3x3} v_3x3 */ -export function diagonalize3x3(a_3x3: Matrix3x3, w_3: Vector3, v_3x3: Matrix3x3): void; +export function diagonalize3x3( + a_3x3: Matrix3x3, + w_3: Vector3, + v_3x3: Matrix3x3 +): void; /** * - * @param {Matrix3x3} a_3x3 - * @param {Matrix3x3} u_3x3 - * @param {Vector3} w_3 - * @param {Matrix3x3} vT_3x3 + * @param {Matrix3x3} a_3x3 + * @param {Matrix3x3} u_3x3 + * @param {Vector3} w_3 + * @param {Matrix3x3} vT_3x3 */ -export function singularValueDecomposition3x3(a_3x3: Matrix3x3, u_3x3: Matrix3x3, w_3: Vector3, vT_3x3: Matrix3x3): void; +export function singularValueDecomposition3x3( + a_3x3: Matrix3x3, + u_3x3: Matrix3x3, + w_3: Vector3, + vT_3x3: Matrix3x3 +): void; /** * - * @param {Matrix} A - * @param {Number[]} index - * @param {Number} size + * @param {Matrix} A + * @param {Number[]} index + * @param {Number} size */ -export function luFactorLinearSystem(A: Matrix, index: number[], size: number): number; +export function luFactorLinearSystem( + A: Matrix, + index: number[], + size: number +): number; /** * - * @param {Matrix} A - * @param {Number[]} index - * @param {Number[]} x - * @param {Number} size + * @param {Matrix} A + * @param {Number[]} index + * @param {Number[]} x + * @param {Number} size */ -export function luSolveLinearSystem(A: Matrix, index: number[], x: number[], size: number): void; +export function luSolveLinearSystem( + A: Matrix, + index: number[], + x: number[], + size: number +): void; /** * - * @param {Matrix} A - * @param {Number[]} x - * @param {Number} size + * @param {Matrix} A + * @param {Number[]} x + * @param {Number} size */ export function solveLinearSystem(A: Matrix, x: number[], size: number): number; @@ -638,24 +775,30 @@ export function solveLinearSystem(A: Matrix, x: number[], size: number): number; * @param {Matrix} A The input matrix. It is modified during the inversion. * @param {Matrix} AI The output inverse matrix. Can be the same as input matrix. * @param {Number} [size] The square size of the matrix to invert : 4 for a 4x4 - * @param {Number[]} [index] - * @param {Number[]} [column] + * @param {Number[]} [index] + * @param {Number[]} [column] * @return AI on success, null otherwise */ -export function invertMatrix(A: Matrix, AI: Matrix, size?: number, index?: number[], column?: number[]): Matrix|null; +export function invertMatrix( + A: Matrix, + AI: Matrix, + size?: number, + index?: number[], + column?: number[] +): Matrix | null; /** * - * @param {Matrix} A - * @param {Number} size + * @param {Matrix} A + * @param {Number} size */ export function estimateMatrixCondition(A: Matrix, size: number): number; /** * - * @param {Matrix3x3} a_3x3 - * @param {Number[]} w - * @param {Number[]} v + * @param {Matrix3x3} a_3x3 + * @param {Number[]} w + * @param {Number[]} v */ export function jacobi(a_3x3: Matrix3x3, w: number[], v: number[]): number; @@ -668,12 +811,17 @@ export function jacobi(a_3x3: Matrix3x3, w: number[], v: number[]): number; * by xOrder, M' dimension is xOrder by yOrder. M' should be pre-allocated. All * matrices are row major. The resultant matrix M' should be pre-multiplied to * X' to get 0', or transposed and then post multiplied to X to get 0 - * @param {Number} numberOfSamples - * @param {Matrix} xt - * @param {Number} xOrder - * @param {Matrix} mt + * @param {Number} numberOfSamples + * @param {Matrix} xt + * @param {Number} xOrder + * @param {Matrix} mt */ -export function solveHomogeneousLeastSquares(numberOfSamples: number, xt: Matrix, xOrder: number, mt: Matrix): number; +export function solveHomogeneousLeastSquares( + numberOfSamples: number, + xt: Matrix, + xOrder: number, + mt: Matrix +): number; /** * Solves for the least squares best fit matrix for the equation X'M' = Y'. Uses @@ -686,20 +834,28 @@ export function solveHomogeneousLeastSquares(numberOfSamples: number, xt: Matrix * Y==0, and if so, invokes SolveHomogeneousLeastSquares. For better performance * when the system is known not to be homogeneous, invoke with * checkHomogeneous=0. - * @param {Number} numberOfSamples - * @param {Matrix} xt - * @param {Number} xOrder - * @param {Matrix} yt - * @param {Number} yOrder - * @param {Matrix} mt - * @param {Boolean} [checkHomogeneous] - */ -export function solveLeastSquares(numberOfSamples: number, xt: Matrix, xOrder: number, yt: Matrix, yOrder: number, mt: Matrix, checkHomogeneous?: boolean): number; + * @param {Number} numberOfSamples + * @param {Matrix} xt + * @param {Number} xOrder + * @param {Matrix} yt + * @param {Number} yOrder + * @param {Matrix} mt + * @param {Boolean} [checkHomogeneous] + */ +export function solveLeastSquares( + numberOfSamples: number, + xt: Matrix, + xOrder: number, + yt: Matrix, + yOrder: number, + mt: Matrix, + checkHomogeneous?: boolean +): number; /** * - * @param {String} hexStr - * @param {Number[]} [outFloatArray] + * @param {String} hexStr + * @param {Number[]} [outFloatArray] */ export function hex2float(hexStr: string, outFloatArray?: number[]): number[]; @@ -719,21 +875,21 @@ export function hsv2rgb(hsv: HSVColor, rgb: RGBColor): void; /** * - * @param {Vector3} lab - * @param {Vector3} xyz + * @param {Vector3} lab + * @param {Vector3} xyz */ export function lab2xyz(lab: Vector3, xyz: Vector3): void; /** * - * @param {Vector3} xyz - * @param {Vector3} lab + * @param {Vector3} xyz + * @param {Vector3} lab */ export function xyz2lab(xyz: Vector3, lab: Vector3): void; /** * - * @param {Vector3} xyz + * @param {Vector3} xyz * @param {RGBColor} rgb An Array of the RGB color. */ export function xyz2rgb(xyz: Vector3, rgb: RGBColor): void; @@ -741,20 +897,20 @@ export function xyz2rgb(xyz: Vector3, rgb: RGBColor): void; /** * * @param {RGBColor} rgb An Array of the RGB color. - * @param {Vector3} xyz + * @param {Vector3} xyz */ export function rgb2xyz(rgb: RGBColor, xyz: Vector3): void; /** * - * @param {RGBColor} rgb - * @param {Vector3} lab + * @param {RGBColor} rgb + * @param {Vector3} lab */ export function rgb2lab(rgb: RGBColor, lab: Vector3): void; /** * - * @param {Vector3} lab + * @param {Vector3} lab * @param {RGBColor} rgb An Array of the RGB color. */ export function lab2rgb(lab: Vector3, rgb: RGBColor): void; @@ -778,7 +934,11 @@ export function areBoundsInitialized(bounds: Bounds): boolean; * @param {Bounds} bounds Output array that hold bounds, optionally empty. * @deprecated please use vtkBoundingBox.addPoints(vtkBoundingBox.reset([]), points) */ -export function computeBoundsFromPoints(point1: Vector3, point2: Vector3, bounds: Bounds): Bounds; +export function computeBoundsFromPoints( + point1: Vector3, + point2: Vector3, + bounds: Bounds +): Bounds; /** * Clamp some value against a range. @@ -786,7 +946,11 @@ export function computeBoundsFromPoints(point1: Vector3, point2: Vector3, bounds * @param {Number} minValue The minimum value. * @param {Number} maxValue The maximum value. */ -export function clampValue(value: number, minValue: number, maxValue: number): number; +export function clampValue( + value: number, + minValue: number, + maxValue: number +): number; /** * Clamp some vector against a range. @@ -795,19 +959,24 @@ export function clampValue(value: number, minValue: number, maxValue: number): n * @param {Vector3} maxVector The maximum vector. * @param {Vector3} out The output vector. */ -export function clampVector(vector: Vector3, minVector: Vector3, maxVector: Vector3, out: Vector3): Vector3; +export function clampVector( + vector: Vector3, + minVector: Vector3, + maxVector: Vector3, + out: Vector3 +): Vector3; /** * - * @param {Vector3} vector - * @param {Vector3} out + * @param {Vector3} vector + * @param {Vector3} out */ export function roundVector(vector: Vector3, out: Vector3): Vector3; /** * - * @param {Number} value - * @param {Range} range + * @param {Number} value + * @param {Range} range */ export function clampAndNormalizeValue(value: number, range: Range): number; @@ -827,7 +996,10 @@ export function getAdjustedScalarRange(): void; * @param {Extent} extent1 The first extent. * @param {Extent} extent2 The second extent. */ -export function extentIsWithinOtherExtent(extent1: Extent, extent2: Extent): number; +export function extentIsWithinOtherExtent( + extent1: Extent, + extent2: Extent +): number; /** * Check if first 3D bounds is within the second 3D bounds. @@ -835,7 +1007,11 @@ export function extentIsWithinOtherExtent(extent1: Extent, extent2: Extent): num * @param {Bounds} bounds2_6 The second bounds. * @param {Vector3} delta_3 The error margin along each axis. */ -export function boundsIsWithinOtherBounds(bounds1_6: Bounds, bounds2_6: Bounds, delta_3: Vector3): number; +export function boundsIsWithinOtherBounds( + bounds1_6: Bounds, + bounds2_6: Bounds, + delta_3: Vector3 +): number; /** * Check if point is within the given 3D bounds. @@ -843,7 +1019,11 @@ export function boundsIsWithinOtherBounds(bounds1_6: Bounds, bounds2_6: Bounds, * @param {Bounds} bounds_6 The bounds. * @param {Vector3} delta_3 The error margin along each axis. */ -export function pointIsWithinBounds(point_3: Vector3, bounds_6: Bounds, delta_3: Vector3): number; +export function pointIsWithinBounds( + point_3: Vector3, + bounds_6: Bounds, + delta_3: Vector3 +): number; /** * In Euclidean space, there is a unique circle passing through any given three @@ -859,7 +1039,12 @@ export function pointIsWithinBounds(point_3: Vector3, bounds_6: Bounds, delta_3: * @param {Vector3} p3 The coordinate of the third point. * @param {Vector3} center The coordinate of the center point. */ -export function solve3PointCircle(p1: Vector3, p2: Vector3, p3: Vector3, center: Vector3): number; +export function solve3PointCircle( + p1: Vector3, + p2: Vector3, + p3: Vector3, + center: Vector3 +): number; /** * Determines whether the passed value is a infinite number. @@ -874,7 +1059,7 @@ export function createUninitializedBounds(): Bounds; /** * - * @param {Number[]} vector + * @param {Number[]} vector */ export function getMajorAxisIndex(vector: number[]): number; @@ -885,11 +1070,14 @@ export function getMajorAxisIndex(vector: number[]): number; * the greatest absolute value from the remaining row and columns * For each association, a -1 or a 1 is set in the output, depending on * the sign of the value in the original matrix - * + * * @param {Number[]} matrix The matrix of size nxn * @param {Number[]} n The size of the square matrix, defaults to 3 */ -export function getSparseOrthogonalMatrix(matrix: number[], n: number): number[]; +export function getSparseOrthogonalMatrix( + matrix: number[], + n: number +): number[]; /** * @@ -899,10 +1087,13 @@ export function floatToHex2(value: number): string; /** * - * @param {RGBColor} rgbArray - * @param {string} [prefix] + * @param {RGBColor} rgbArray + * @param {string} [prefix] */ -export function floatRGB2HexCode(rgbArray: RGBColor | RGBAColor, prefix?: string): string; +export function floatRGB2HexCode( + rgbArray: RGBColor | RGBAColor, + prefix?: string +): string; /** * Convert RGB or RGBA color array to CSS representation @@ -936,119 +1127,119 @@ export function isFinite(value: any): boolean; * number generation (for backward compatibility only). */ export declare const vtkMath: { - createArray: typeof createArray; - swapRowsMatrix_nxn: typeof swapRowsMatrix_nxn; - swapColumnsMatrix_nxn: typeof swapColumnsMatrix_nxn; - Pi: typeof Pi; - radiansFromDegrees: typeof radiansFromDegrees; - degreesFromRadians: typeof degreesFromRadians; - round: typeof round; - floor: typeof floor; - ceil: typeof ceil; - min: typeof min; - max: typeof max; - arrayMin: typeof arrayMin; - arrayMax: typeof arrayMax; - arrayRange: typeof arrayRange; - ceilLog2: typeof ceilLog2; - factorial: typeof factorial; - gaussian: typeof gaussian; - nearestPowerOfTwo: typeof nearestPowerOfTwo; - isPowerOfTwo: typeof isPowerOfTwo; - binomial: typeof binomial; - beginCombination: typeof beginCombination; - nextCombination: typeof nextCombination; - randomSeed: typeof randomSeed; - getSeed: typeof getSeed; - random: typeof random; - add: typeof add; - subtract: typeof subtract; - multiplyScalar: typeof multiplyScalar; - multiplyScalar2D: typeof multiplyScalar2D; - multiplyAccumulate: typeof multiplyAccumulate; - multiplyAccumulate2D: typeof multiplyAccumulate2D; - dot: typeof dot; - outer: typeof outer; - cross: typeof cross; - norm: typeof norm; - normalize: typeof normalize; - perpendiculars: typeof perpendiculars; - projectVector: typeof projectVector; - dot2D: typeof dot2D; - projectVector2D: typeof projectVector2D; - distance2BetweenPoints: typeof distance2BetweenPoints; - angleBetweenVectors: typeof angleBetweenVectors; - gaussianAmplitude: typeof gaussianAmplitude; - gaussianWeight: typeof gaussianWeight; - outer2D: typeof outer2D; - norm2D: typeof norm2D; - normalize2D: typeof normalize2D; - determinant2x2: typeof determinant2x2; - rowsToMat4: typeof rowsToMat4; - columnsToMat4: typeof columnsToMat4; - rowsToMat3: typeof rowsToMat3; - columnsToMat3: typeof columnsToMat3; - LUFactor3x3: typeof LUFactor3x3; - LUSolve3x3: typeof LUSolve3x3; - linearSolve3x3: typeof linearSolve3x3; - multiply3x3_vect3: typeof multiply3x3_vect3; - multiply3x3_mat3: typeof multiply3x3_mat3; - multiplyMatrix: typeof multiplyMatrix; - transpose3x3: typeof transpose3x3; - invert3x3: typeof invert3x3; - identity3x3: typeof identity3x3; - determinant3x3: typeof determinant3x3; - quaternionToMatrix3x3: typeof quaternionToMatrix3x3; - areEquals: typeof areEquals; - areMatricesEqual: typeof areEquals; - roundNumber: typeof roundNumber; - roundVector: typeof roundVector; - jacobiN: typeof jacobiN; - matrix3x3ToQuaternion: typeof matrix3x3ToQuaternion; - multiplyQuaternion: typeof multiplyQuaternion; - orthogonalize3x3: typeof orthogonalize3x3; - diagonalize3x3: typeof diagonalize3x3; - singularValueDecomposition3x3: typeof singularValueDecomposition3x3; - luFactorLinearSystem: typeof luFactorLinearSystem; - luSolveLinearSystem: typeof luSolveLinearSystem; - solveLinearSystem: typeof solveLinearSystem; - invertMatrix: typeof invertMatrix; - estimateMatrixCondition: typeof estimateMatrixCondition; - jacobi: typeof jacobi; - solveHomogeneousLeastSquares: typeof solveHomogeneousLeastSquares; - solveLeastSquares: typeof solveLeastSquares; - hex2float: typeof hex2float; - rgb2hsv: typeof rgb2hsv; - hsv2rgb: typeof hsv2rgb; - lab2xyz: typeof lab2xyz; - xyz2lab: typeof xyz2lab; - xyz2rgb: typeof xyz2rgb; - rgb2xyz: typeof rgb2xyz; - rgb2lab: typeof rgb2lab; - lab2rgb: typeof lab2rgb; - uninitializeBounds: typeof uninitializeBounds; - areBoundsInitialized: typeof areBoundsInitialized; - computeBoundsFromPoints: typeof computeBoundsFromPoints; - clampValue: typeof clampValue; - clampVector: typeof clampVector; - clampAndNormalizeValue: typeof clampAndNormalizeValue; - getScalarTypeFittingRange: typeof getScalarTypeFittingRange; - getAdjustedScalarRange: typeof getAdjustedScalarRange; - extentIsWithinOtherExtent: typeof extentIsWithinOtherExtent; - boundsIsWithinOtherBounds: typeof boundsIsWithinOtherBounds; - pointIsWithinBounds: typeof pointIsWithinBounds; - solve3PointCircle: typeof solve3PointCircle; - isInf: typeof isInf; - createUninitializedBounds: typeof createUninitializedBounds; - getMajorAxisIndex: typeof getMajorAxisIndex; - getSparseOrthogonalMatrix: typeof getSparseOrthogonalMatrix; - floatToHex2: typeof floatToHex2; - floatRGB2HexCode: typeof floatRGB2HexCode; - float2CssRGBA: typeof float2CssRGBA; - inf: number; - negInf: number; - isNan: typeof isNaN, - isNaN: typeof isNaN; - isFinite: typeof isFinite -} + createArray: typeof createArray; + swapRowsMatrix_nxn: typeof swapRowsMatrix_nxn; + swapColumnsMatrix_nxn: typeof swapColumnsMatrix_nxn; + Pi: typeof Pi; + radiansFromDegrees: typeof radiansFromDegrees; + degreesFromRadians: typeof degreesFromRadians; + round: typeof round; + floor: typeof floor; + ceil: typeof ceil; + min: typeof min; + max: typeof max; + arrayMin: typeof arrayMin; + arrayMax: typeof arrayMax; + arrayRange: typeof arrayRange; + ceilLog2: typeof ceilLog2; + factorial: typeof factorial; + gaussian: typeof gaussian; + nearestPowerOfTwo: typeof nearestPowerOfTwo; + isPowerOfTwo: typeof isPowerOfTwo; + binomial: typeof binomial; + beginCombination: typeof beginCombination; + nextCombination: typeof nextCombination; + randomSeed: typeof randomSeed; + getSeed: typeof getSeed; + random: typeof random; + add: typeof add; + subtract: typeof subtract; + multiplyScalar: typeof multiplyScalar; + multiplyScalar2D: typeof multiplyScalar2D; + multiplyAccumulate: typeof multiplyAccumulate; + multiplyAccumulate2D: typeof multiplyAccumulate2D; + dot: typeof dot; + outer: typeof outer; + cross: typeof cross; + norm: typeof norm; + normalize: typeof normalize; + perpendiculars: typeof perpendiculars; + projectVector: typeof projectVector; + dot2D: typeof dot2D; + projectVector2D: typeof projectVector2D; + distance2BetweenPoints: typeof distance2BetweenPoints; + angleBetweenVectors: typeof angleBetweenVectors; + gaussianAmplitude: typeof gaussianAmplitude; + gaussianWeight: typeof gaussianWeight; + outer2D: typeof outer2D; + norm2D: typeof norm2D; + normalize2D: typeof normalize2D; + determinant2x2: typeof determinant2x2; + rowsToMat4: typeof rowsToMat4; + columnsToMat4: typeof columnsToMat4; + rowsToMat3: typeof rowsToMat3; + columnsToMat3: typeof columnsToMat3; + LUFactor3x3: typeof LUFactor3x3; + LUSolve3x3: typeof LUSolve3x3; + linearSolve3x3: typeof linearSolve3x3; + multiply3x3_vect3: typeof multiply3x3_vect3; + multiply3x3_mat3: typeof multiply3x3_mat3; + multiplyMatrix: typeof multiplyMatrix; + transpose3x3: typeof transpose3x3; + invert3x3: typeof invert3x3; + identity3x3: typeof identity3x3; + determinant3x3: typeof determinant3x3; + quaternionToMatrix3x3: typeof quaternionToMatrix3x3; + areEquals: typeof areEquals; + areMatricesEqual: typeof areEquals; + roundNumber: typeof roundNumber; + roundVector: typeof roundVector; + jacobiN: typeof jacobiN; + matrix3x3ToQuaternion: typeof matrix3x3ToQuaternion; + multiplyQuaternion: typeof multiplyQuaternion; + orthogonalize3x3: typeof orthogonalize3x3; + diagonalize3x3: typeof diagonalize3x3; + singularValueDecomposition3x3: typeof singularValueDecomposition3x3; + luFactorLinearSystem: typeof luFactorLinearSystem; + luSolveLinearSystem: typeof luSolveLinearSystem; + solveLinearSystem: typeof solveLinearSystem; + invertMatrix: typeof invertMatrix; + estimateMatrixCondition: typeof estimateMatrixCondition; + jacobi: typeof jacobi; + solveHomogeneousLeastSquares: typeof solveHomogeneousLeastSquares; + solveLeastSquares: typeof solveLeastSquares; + hex2float: typeof hex2float; + rgb2hsv: typeof rgb2hsv; + hsv2rgb: typeof hsv2rgb; + lab2xyz: typeof lab2xyz; + xyz2lab: typeof xyz2lab; + xyz2rgb: typeof xyz2rgb; + rgb2xyz: typeof rgb2xyz; + rgb2lab: typeof rgb2lab; + lab2rgb: typeof lab2rgb; + uninitializeBounds: typeof uninitializeBounds; + areBoundsInitialized: typeof areBoundsInitialized; + computeBoundsFromPoints: typeof computeBoundsFromPoints; + clampValue: typeof clampValue; + clampVector: typeof clampVector; + clampAndNormalizeValue: typeof clampAndNormalizeValue; + getScalarTypeFittingRange: typeof getScalarTypeFittingRange; + getAdjustedScalarRange: typeof getAdjustedScalarRange; + extentIsWithinOtherExtent: typeof extentIsWithinOtherExtent; + boundsIsWithinOtherBounds: typeof boundsIsWithinOtherBounds; + pointIsWithinBounds: typeof pointIsWithinBounds; + solve3PointCircle: typeof solve3PointCircle; + isInf: typeof isInf; + createUninitializedBounds: typeof createUninitializedBounds; + getMajorAxisIndex: typeof getMajorAxisIndex; + getSparseOrthogonalMatrix: typeof getSparseOrthogonalMatrix; + floatToHex2: typeof floatToHex2; + floatRGB2HexCode: typeof floatRGB2HexCode; + float2CssRGBA: typeof float2CssRGBA; + inf: number; + negInf: number; + isNan: typeof isNaN; + isNaN: typeof isNaN; + isFinite: typeof isFinite; +}; export default vtkMath; diff --git a/Sources/Common/Core/MatrixBuilder/index.d.ts b/Sources/Common/Core/MatrixBuilder/index.d.ts index 7df578c6b5c..32a0e0f017b 100755 --- a/Sources/Common/Core/MatrixBuilder/index.d.ts +++ b/Sources/Common/Core/MatrixBuilder/index.d.ts @@ -2,137 +2,142 @@ import { mat3, mat4 } from 'gl-matrix'; import { TypedArray, Vector3 } from '../../../types'; declare interface Transform { - - /** - * - * @param {Boolean} [useDegree] - */ - new (useDegree?: boolean); - - /** - * Multiplies the current matrix with a transformation matrix created by - * normalizing both direction vectors and rotating around the axis of the - * crossProduct by the angle from the dotProduct of the two directions. - * @param {Number[]} originDirection - * @param {Number[]} targetDirection - */ - rotateFromDirections(originDirection: number[], targetDirection: number[]): Transform - - /** - * Normalizes the axis of rotation then rotates the current matrix `angle` - * degrees/radians around the provided axis. - * @param {Number} angle - * @param {Vector3} axis - */ - rotate(angle: number, axis: Vector3): Transform - - /** - * Rotates `angle` degrees/radians around the X axis. - * @param {Number} angle - */ - rotateX(angle: number): Transform - - /** - * Rotates `angle` degrees/radians around the Y axis. - * @param {Number} angle - */ - rotateY(angle: number): Transform - - /** - * Rotates `angle` degrees/radians around the Z axis. - * @param {Number} angle - */ - rotateZ(angle: number): Transform - - /** - * Translates the matrix by x, y, z. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - translate(x: number, y: number, z: number): Transform - - /** - * Scales the matrix by sx, sy, sz. - * @param {Number} sx - * @param {Number} sy - * @param {Number} sz - */ - scale(sx: number, sy: number, sz: number): Transform - - /** - * - * @param {mat4} mat4x4 - */ - multiply(mat4x4: mat4): Transform - - /** - * Multiply the current matrix with the provided 3x3 matrix. - * @param {mat3} mat3x3 column-first matrix - */ - multiply3x3(mat3x3: mat3): Transform - - /** - * Resets the MatrixBuilder to the Identity matrix. - */ - identity(): Transform - - /** - * Inverts the MatrixBuilder matrix. - */ - invert(): Transform - - /** - * Multiplies the array by the MatrixBuilder's internal matrix, in sets of - * 3. Updates the array in place. If specified, `offset` starts at a given - * position in the array, and `nbIterations` will determine the number of - * iterations (sets of 3) to loop through. Assumes the `typedArray` is an - * array of multiples of 3, unless specifically handling with offset and - * iterations. Returns the instance for chaining. - * @param {Number[]|TypedArray} typedArray The Array value. - * @param {Number} [offset] - * @param {Number} [nbIterations] - */ - apply(typedArray: number[]|TypedArray, offset?: number, nbIterations?: number): Transform - - /** - * Returns the internal `mat4` matrix. - */ - getMatrix(): mat4; - - /** - * Copies the given `mat4` into the builder. Useful if you already have a - * transformation matrix and want to transform it further. Returns the - * instance for chaining. - * @param {mat4} mat4x4 - */ - setMatrix(mat4x4: mat4): Transform + /** + * + * @param {Boolean} [useDegree] + */ + new (useDegree?: boolean); + + /** + * Multiplies the current matrix with a transformation matrix created by + * normalizing both direction vectors and rotating around the axis of the + * crossProduct by the angle from the dotProduct of the two directions. + * @param {Number[]} originDirection + * @param {Number[]} targetDirection + */ + rotateFromDirections( + originDirection: number[], + targetDirection: number[] + ): Transform; + + /** + * Normalizes the axis of rotation then rotates the current matrix `angle` + * degrees/radians around the provided axis. + * @param {Number} angle + * @param {Vector3} axis + */ + rotate(angle: number, axis: Vector3): Transform; + + /** + * Rotates `angle` degrees/radians around the X axis. + * @param {Number} angle + */ + rotateX(angle: number): Transform; + + /** + * Rotates `angle` degrees/radians around the Y axis. + * @param {Number} angle + */ + rotateY(angle: number): Transform; + + /** + * Rotates `angle` degrees/radians around the Z axis. + * @param {Number} angle + */ + rotateZ(angle: number): Transform; + + /** + * Translates the matrix by x, y, z. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + translate(x: number, y: number, z: number): Transform; + + /** + * Scales the matrix by sx, sy, sz. + * @param {Number} sx + * @param {Number} sy + * @param {Number} sz + */ + scale(sx: number, sy: number, sz: number): Transform; + + /** + * + * @param {mat4} mat4x4 + */ + multiply(mat4x4: mat4): Transform; + + /** + * Multiply the current matrix with the provided 3x3 matrix. + * @param {mat3} mat3x3 column-first matrix + */ + multiply3x3(mat3x3: mat3): Transform; + + /** + * Resets the MatrixBuilder to the Identity matrix. + */ + identity(): Transform; + + /** + * Inverts the MatrixBuilder matrix. + */ + invert(): Transform; + + /** + * Multiplies the array by the MatrixBuilder's internal matrix, in sets of + * 3. Updates the array in place. If specified, `offset` starts at a given + * position in the array, and `nbIterations` will determine the number of + * iterations (sets of 3) to loop through. Assumes the `typedArray` is an + * array of multiples of 3, unless specifically handling with offset and + * iterations. Returns the instance for chaining. + * @param {Number[]|TypedArray} typedArray The Array value. + * @param {Number} [offset] + * @param {Number} [nbIterations] + */ + apply( + typedArray: number[] | TypedArray, + offset?: number, + nbIterations?: number + ): Transform; + + /** + * Returns the internal `mat4` matrix. + */ + getMatrix(): mat4; + + /** + * Copies the given `mat4` into the builder. Useful if you already have a + * transformation matrix and want to transform it further. Returns the + * instance for chaining. + * @param {mat4} mat4x4 + */ + setMatrix(mat4x4: mat4): Transform; } /** - * + * * @return {Transform} */ declare function buildFromDegree(): Transform; /** - * + * * @return {Transform} */ declare function buildFromRadian(): Transform; - /** * The `vtkMatrixBuilder` class provides a system to create a mat4 * transformation matrix. All functions return the MatrixBuilder Object * instance, allowing transformations to be chained. - * + * * @example * ```js * let point = [2,5,12]; * vtkMatrixBuilder.buildFromDegree().translate(1,0,2).rotateZ(45).apply(point); * ``` - * + * * The vtkMatrixBuilder class has two functions, `vtkMatrixBuilder.buildFromDegree()` and * `vtkMatrixbuilder.buildFromRadian()`, predefining the angle format used for * transformations and returning a MatrixBuilder instance. The matrix is @@ -140,8 +145,8 @@ declare function buildFromRadian(): Transform; * */ export declare const vtkMatrixBuilder: { - buildFromDegree: typeof buildFromDegree, - buildFromRadian: typeof buildFromRadian, + buildFromDegree: typeof buildFromDegree; + buildFromRadian: typeof buildFromRadian; }; export default vtkMatrixBuilder; diff --git a/Sources/Common/Core/Points/index.d.ts b/Sources/Common/Core/Points/index.d.ts index b1665eeedcf..b7e629bfc09 100755 --- a/Sources/Common/Core/Points/index.d.ts +++ b/Sources/Common/Core/Points/index.d.ts @@ -1,106 +1,114 @@ -import vtkDataArray from '../../../Common/Core/DataArray'; -import { Bounds, TypedArray } from '../../../types'; - -/** - * - */ -export interface IPointsInitialValues { - empty?: boolean; - numberOfComponents?: number; - bounds?: Bounds; -} - -export interface vtkPoints extends vtkDataArray { - - /** - * Trigger the computation of bounds - */ - computeBounds(): Bounds; - - /** - * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @return {Bounds} The bounds for the mapper. - */ - getBounds(): Bounds; - - /** - * Get the coordinate of a point. - * @param {Number} idx The index of point. - * @param {Number[]|TypedArray} [tupleToFill] (default []) - * @returns {Number[]|TypedArray} - */ - getPoint(idx: number, tupleToFill?: number[]|TypedArray): number[]|TypedArray; - - /** - * Convenient method to search a point in the array. - * This is a naïve search. Consider using a "locator" instead. - * @param {Array|TypedArray} pointToSearch - * @param {Number} precision (1e-6 by default) - * @returns {Number} the index of the point if found, -1 otherwise. - */ - findPoint(pointToSearch: Array|TypedArray, precision?: number): number; - - /** - * Get the number of points for this object can hold. - */ - getNumberOfPoints(): number; - - /** - * Set the number of points for this object to hold. - * - * ```js - * points.getData()[0] = x; - * points.getData()[1] = y; - * points.getData()[2] = z; - * ``` - * - * @param {Number} nbPoints - * @param {Number} [dimension] - */ - setNumberOfPoints(nbPoints: number, dimension?: number): void; - - /** - * Set the (x,y,z) coordinates of a point based on its index. - * @param {Number} idx The index of point. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setPoint(idx: number, x: number, y: number, z: number): void; - - /** - * Insert the (x,y,z) coordinates of a point at the next available slot. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - * @returns {Number} Index of the inserted point. - */ - insertNextPoint(x: number, y: number, z: number): number; -} - -/** - * Method used to decorate a given object (publicAPI+model) with vtkPoints characteristics. - * - * @param publicAPI object on which methods will be bounds (public) - * @param model object on which data structure will be bounds (protected) - * @param {IPointsInitialValues} [initialValues] (default: {}) - */ -export function extend(publicAPI: object, model: object, initialValues?: IPointsInitialValues): void; - -/** - * Method used to create a new instance of vtkPoints - * @param {IPointsInitialValues} [initialValues] for pre-setting some of its content - */ -export function newInstance(initialValues?: IPointsInitialValues): vtkPoints; - - -/** - * vtkPoints represents 3D points. The data model for vtkPoints is an array - * of vx-vy-vz triplets accessible by (point or cell) id. - */ - -export declare const vtkPoints: { - newInstance: typeof newInstance; - extend: typeof extend; -} -export default vtkPoints; +import vtkDataArray from '../../../Common/Core/DataArray'; +import { Bounds, TypedArray } from '../../../types'; + +/** + * + */ +export interface IPointsInitialValues { + empty?: boolean; + numberOfComponents?: number; + bounds?: Bounds; +} + +export interface vtkPoints extends vtkDataArray { + /** + * Trigger the computation of bounds + */ + computeBounds(): Bounds; + + /** + * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @return {Bounds} The bounds for the mapper. + */ + getBounds(): Bounds; + + /** + * Get the coordinate of a point. + * @param {Number} idx The index of point. + * @param {Number[]|TypedArray} [tupleToFill] (default []) + * @returns {Number[]|TypedArray} + */ + getPoint( + idx: number, + tupleToFill?: number[] | TypedArray + ): number[] | TypedArray; + + /** + * Convenient method to search a point in the array. + * This is a naïve search. Consider using a "locator" instead. + * @param {Array|TypedArray} pointToSearch + * @param {Number} precision (1e-6 by default) + * @returns {Number} the index of the point if found, -1 otherwise. + */ + findPoint( + pointToSearch: Array | TypedArray, + precision?: number + ): number; + + /** + * Get the number of points for this object can hold. + */ + getNumberOfPoints(): number; + + /** + * Set the number of points for this object to hold. + * + * ```js + * points.getData()[0] = x; + * points.getData()[1] = y; + * points.getData()[2] = z; + * ``` + * + * @param {Number} nbPoints + * @param {Number} [dimension] + */ + setNumberOfPoints(nbPoints: number, dimension?: number): void; + + /** + * Set the (x,y,z) coordinates of a point based on its index. + * @param {Number} idx The index of point. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setPoint(idx: number, x: number, y: number, z: number): void; + + /** + * Insert the (x,y,z) coordinates of a point at the next available slot. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + * @returns {Number} Index of the inserted point. + */ + insertNextPoint(x: number, y: number, z: number): number; +} + +/** + * Method used to decorate a given object (publicAPI+model) with vtkPoints characteristics. + * + * @param publicAPI object on which methods will be bounds (public) + * @param model object on which data structure will be bounds (protected) + * @param {IPointsInitialValues} [initialValues] (default: {}) + */ +export function extend( + publicAPI: object, + model: object, + initialValues?: IPointsInitialValues +): void; + +/** + * Method used to create a new instance of vtkPoints + * @param {IPointsInitialValues} [initialValues] for pre-setting some of its content + */ +export function newInstance(initialValues?: IPointsInitialValues): vtkPoints; + +/** + * vtkPoints represents 3D points. The data model for vtkPoints is an array + * of vx-vy-vz triplets accessible by (point or cell) id. + */ + +export declare const vtkPoints: { + newInstance: typeof newInstance; + extend: typeof extend; +}; +export default vtkPoints; diff --git a/Sources/Common/Core/PriorityQueue/index.d.ts b/Sources/Common/Core/PriorityQueue/index.d.ts index 42b248c5257..ff8c0c0b902 100755 --- a/Sources/Common/Core/PriorityQueue/index.d.ts +++ b/Sources/Common/Core/PriorityQueue/index.d.ts @@ -1,36 +1,35 @@ -import { vtkObject } from "../../../interfaces" ; +import { vtkObject } from '../../../interfaces'; /** * */ export interface IPriorityQueueInitialValues { - elements?: Array; + elements?: Array; } export interface vtkPriorityQueue extends vtkObject { + /** + * Push an element to the queue while defining a priority. + * @param {Number} priority The priority of the element. + * @param element + */ + push(priority: number, element: any): void; - /** - * Push an element to the queue while defining a priority. - * @param {Number} priority The priority of the element. - * @param element - */ - push(priority: number, element: any): void; - - /** - * - */ - pop(): any | null; - - /** - * Delete an element from the queue by its ID. - * @param {Number} id The id of the element. - */ - deleteById(id: number): void; - - /** - * Get the length of the queue. - */ - length(): number; + /** + * + */ + pop(): any | null; + + /** + * Delete an element from the queue by its ID. + * @param {Number} id The id of the element. + */ + deleteById(id: number): void; + + /** + * Get the length of the queue. + */ + length(): number; } /** @@ -40,14 +39,19 @@ export interface vtkPriorityQueue extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IPriorityQueueInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPriorityQueueInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPriorityQueueInitialValues +): void; /** * Method used to create a new instance of vtkPriorityQueue * @param {IPriorityQueueInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IPriorityQueueInitialValues): vtkPriorityQueue; - +export function newInstance( + initialValues?: IPriorityQueueInitialValues +): vtkPriorityQueue; /** * vtkPriorityQueue is a general object for creating and manipulating lists of @@ -56,7 +60,7 @@ export function newInstance(initialValues?: IPriorityQueueInitialValues): vtkPri * smallest values. */ export declare const vtkPriorityQueue: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkPriorityQueue; diff --git a/Sources/Common/Core/ProgressHandler/index.d.ts b/Sources/Common/Core/ProgressHandler/index.d.ts index 629fd36b6d4..11202782d00 100755 --- a/Sources/Common/Core/ProgressHandler/index.d.ts +++ b/Sources/Common/Core/ProgressHandler/index.d.ts @@ -1,45 +1,44 @@ -import { vtkObject } from "../../../interfaces" ; +import { vtkObject } from '../../../interfaces'; /** * */ export interface IProgressHandlerInitialValues { - workCount?: number; + workCount?: number; } export interface vtkProgressHandler extends vtkObject { - - /** - * - */ - getWorkCount(): number; + /** + * + */ + getWorkCount(): number; - /** - * - */ - startWork(): void; - - /** - * - */ - stopWork(): void; - - /** - * - */ - isWorking(): boolean; - - /** - * - * @param promise - */ - wrapPromise(promise : any): Promise; - - /** - * - * @param fn - */ - wrapPromiseFunction(fn : any): any; + /** + * + */ + startWork(): void; + + /** + * + */ + stopWork(): void; + + /** + * + */ + isWorking(): boolean; + + /** + * + * @param promise + */ + wrapPromise(promise: any): Promise; + + /** + * + * @param fn + */ + wrapPromiseFunction(fn: any): any; } /** @@ -49,22 +48,28 @@ export interface vtkProgressHandler extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IProgressHandlerInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IProgressHandlerInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IProgressHandlerInitialValues +): void; /** * Method used to create a new instance of vtkProgressHandler * @param {IProgressHandlerInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IProgressHandlerInitialValues): vtkProgressHandler; +export function newInstance( + initialValues?: IProgressHandlerInitialValues +): vtkProgressHandler; /** * vtkProgressHandler stores dataset topologies as an explicit connectivity table * listing the point ids that make up each cell. - * + * * @see vtkDataArray */ export declare const vtkProgressHandler: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkProgressHandler; diff --git a/Sources/Common/Core/ScalarsToColors/Constants.d.ts b/Sources/Common/Core/ScalarsToColors/Constants.d.ts index 6d71f2f596c..e62cd1bcf8a 100644 --- a/Sources/Common/Core/ScalarsToColors/Constants.d.ts +++ b/Sources/Common/Core/ScalarsToColors/Constants.d.ts @@ -1,18 +1,18 @@ export declare enum VectorMode { - MAGNITUDE = 0, - COMPONENT = 1, - RGBCOLORS = 2, + MAGNITUDE = 0, + COMPONENT = 1, + RGBCOLORS = 2, } export declare enum ScalarMappingTarget { - LUMINANCE = 1, - LUMINANCE_ALPHA = 2, - RGB = 3, - RGBA = 4, + LUMINANCE = 1, + LUMINANCE_ALPHA = 2, + RGB = 3, + RGBA = 4, } declare const _default: { - VectorMode: typeof VectorMode; - ScalarMappingTarget: typeof ScalarMappingTarget; + VectorMode: typeof VectorMode; + ScalarMappingTarget: typeof ScalarMappingTarget; }; export default _default; diff --git a/Sources/Common/Core/ScalarsToColors/index.d.ts b/Sources/Common/Core/ScalarsToColors/index.d.ts index c1939beadc7..a02ce227be7 100755 --- a/Sources/Common/Core/ScalarsToColors/index.d.ts +++ b/Sources/Common/Core/ScalarsToColors/index.d.ts @@ -1,335 +1,354 @@ -import { vtkObject } from "../../../interfaces"; -import { ColorMode } from "../../../Rendering/Core/Mapper/Constants"; -import { Range } from "../../../types"; -import vtkDataArray from "../DataArray"; -import { ScalarMappingTarget, VectorMode } from "./Constants"; +import { vtkObject } from '../../../interfaces'; +import { ColorMode } from '../../../Rendering/Core/Mapper/Constants'; +import { Range } from '../../../types'; +import vtkDataArray from '../DataArray'; +import { ScalarMappingTarget, VectorMode } from './Constants'; /** * */ export interface IScalarsToColorsInitialValues { - alpha?: number; - vectorComponent?: number; - vectorSize?: number; - indexedLookup?: boolean; + alpha?: number; + vectorComponent?: number; + vectorSize?: number; + indexedLookup?: boolean; } export interface vtkScalarsToColors extends vtkObject { - - /** - * Perform any processing required (if any) before processing scalars. - */ - build(): void; - - /** - * - * @param value - */ - checkForAnnotatedValue(value: any): number; - - /** - * - * @param colors - * @param numComp - * @param numTuples - */ - convertToRGBA(colors: any, numComp: number, numTuples: number): void; - - /** - * Specify an additional opacity (alpha) value to blend with. - */ - getAlpha(): number; - - /** - * - * @param {Number} idx - */ - getAnnotatedValue(idx: number): void; - - /** - * - * @param val - */ - getAnnotatedValueIndex(val: any): number; - - /** - * An unsafe version of vtkScalarsToColors.checkForAnnotatedValue for - * internal use (no pointer checks performed) - * @param value - */ - getAnnotatedValueIndexInternal(value: any): number; - - /** - * - * @param {Number} idx - */ - getAnnotation(idx: number): string; - - /** - * - * @param val - * @param rgba - */ - getAnnotationColor(val: any, rgba: any): void; - - /** - * - * @param val - * @param rgba - */ - getIndexedColor(val: number, rgba: any): void; - - /** - * - */ - getIndexedLookup(): boolean; - - /** - * - */ - getMappingRange(): Range; - - /** - * - */ - getMappingRangeByReference(): Range; - - /** - * Return the annotated value at a particular index in the list of annotations. - */ - getNumberOfAnnotatedValues(): number; - - /** - * Get the number of available colors for mapping to. - */ - getNumberOfAvailableColors(): number; - - /** - * - */ - getRange(): Range; - - /** - * Get which component of a vector to map to colors. - */ - getVectorComponent(): number; - - /** - * - */ - getVectorMode(): VectorMode; - - /** - * - */ - getVectorSize(): number; - - /** - * @see areScalarsOpaque - */ - isOpaque(): boolean; - - /** - * Returns false if scalars are Uint8 LA or RGBA with A < 255, - * otherwise rely on getAlpha() in case of direct mapping, - * otherwise return isOpaque() - * - * @see isOpaque, getAlpha - * - * @param {vtkDataArray} scalars - * @param {ColorMode} colorMode - * @param {Number} componentIn - * - */ - areScalarsOpaque(scalars: vtkDataArray, colorMode: ColorMode, componentIn: number): boolean; - - /** - * - * @param newColors - * @param colors - * @param {Number} alpha - * @param convtFun - */ - luminanceAlphaToRGBA(newColors: any, colors: any, alpha: number, convtFun: any): void; - - /** - * - * @param newColors - * @param colors - * @param {Number} alpha - * @param convtFun - */ - luminanceToRGBA(newColors: any, colors: any, alpha: number, convtFun: any): void; - - /** - * Internal methods that map a data array into a 4-component, unsigned char - * RGBA array. The color mode determines the behavior of mapping. If - * ColorMode.DEFAULT is set, then unsigned char data arrays are treated as - * colors (and converted to RGBA if necessary); If ColorMode.DIRECT_SCALARS - * is set, then all arrays are treated as colors (integer types are clamped - * in the range 0-255, floating point arrays are clamped in the range - * 0.0-1.0. Note 'char' does not have enough values to represent a color so - * mapping this type is considered an error); otherwise, the data is mapped - * through this instance of ScalarsToColors. The component argument is used - * for data arrays with more than one component; it indicates which - * component to use to do the blending. When the component argument is -1, - * then the this object uses its own selected technique to change a vector - * into a scalar to map. - * @param scalars - * @param {ColorMode} colorMode - * @param {Number} componentIn - */ - mapScalars(scalars: any, colorMode: ColorMode, componentIn: number): void; - - /** - * Map a set of vector values through the table - * @param input - * @param output - * @param {ScalarMappingTarget} outputFormat - * @param vectorComponentIn - * @param {Number} vectorSizeIn - */ - mapVectorsThroughTable(input: any, output: any, outputFormat: ScalarMappingTarget, vectorComponentIn: number, vectorSizeIn: number): void; - - /** - * - * @param input - * @param output - * @param {Number} compsToUse - */ - mapVectorsToMagnitude(input: any, output: any, compsToUse: number): void; - - /** - * - * @param newColors - * @param colors - * @param {Number} alpha - * @param convtFun - */ - rGBAToRGBA(newColors: any, colors: any, alpha: number, convtFun: any): void; - - /** - * - * @param newColors - * @param colors - * @param {Number} alpha - * @param convtFun - */ - rGBToRGBA(newColors: any, colors: any, alpha: number, convtFun: any): void; - - /** - * Remove an existing entry from the list of annotated values. - * @param value - */ - removeAnnotation(value: any): boolean; - - /** - * Remove all existing values and their annotations. - */ - resetAnnotations(): void; - - /** - * - * @param {Number} alpha - */ - setAlpha(alpha: number): boolean; - - /** - * - * @param value - * @param annotation - */ - setAnnotation(value: any, annotation: any): number; - - /** - * - * @param values - * @param annotations - */ - setAnnotations(values: any, annotations: any): void; - - /** - * - * @param {Boolean} indexedLookup - */ - setIndexedLookup(indexedLookup: boolean): boolean; - - /** - * - * @param {Range} mappingRange - */ - setMappingRange(mappingRange: Range): boolean; - - /** - * - * @param {Number} min - * @param {Number} max - */ - setMappingRange(min: number, max: number): boolean; - - /** - * - * @param {Range} mappingRange - */ - setMappingRangeFrom(mappingRange: Range): boolean; - - /** - * - * @param {Number} min - * @param {Number} max - */ - setRange(min: number, max: number): boolean; - - /** - * If the mapper does not select which component of a vector to map to - * colors, you can specify it here. - * @param {Number} vectorComponent The value of the vector mode. - */ - setVectorComponent(vectorComponent: number): boolean; - - /** - * Change mode that maps vectors by magnitude vs. component. If the mode is - * "RGBColors", then the vectors components are scaled to the range and - * passed directly as the colors. - * @param {VectorMode} vectorMode The value of the vector mode. - */ - setVectorMode(vectorMode: VectorMode): boolean; - - /** - * Set vectorMode to `VectorMode.MAGNITUDE` - */ - setVectorModeToMagnitude(): boolean; - - /** - * Set vectorMode to `VectorMode.COMPONENT` - */ - setVectorModeToComponent(): boolean; - - /** - * When mapping vectors, consider only the number of components selected by - * `vectorSize` to be part of the vector, and ignore any other components. Set - * to -1 to map all components. If this is not set to -1, then you can use - * `setVectorComponent` to set which scalar component will be the first - * component in the vector to be mapped. - */ - setVectorModeToRGBColors(): boolean; - - /** - * When mapping vectors, consider only the number of components selected by - * VectorSize to be part of the vector, and ignore any other components. - * @param {Number} vectorSize The value of the vectorSize. - */ - setVectorSize(vectorSize: number): boolean; - - /** - * Update the map from annotated values to indices in the array of annotations. - */ - updateAnnotatedValueMap(): boolean; - - /** - * - */ - usingLogScale(): boolean; + /** + * Perform any processing required (if any) before processing scalars. + */ + build(): void; + + /** + * + * @param value + */ + checkForAnnotatedValue(value: any): number; + + /** + * + * @param colors + * @param numComp + * @param numTuples + */ + convertToRGBA(colors: any, numComp: number, numTuples: number): void; + + /** + * Specify an additional opacity (alpha) value to blend with. + */ + getAlpha(): number; + + /** + * + * @param {Number} idx + */ + getAnnotatedValue(idx: number): void; + + /** + * + * @param val + */ + getAnnotatedValueIndex(val: any): number; + + /** + * An unsafe version of vtkScalarsToColors.checkForAnnotatedValue for + * internal use (no pointer checks performed) + * @param value + */ + getAnnotatedValueIndexInternal(value: any): number; + + /** + * + * @param {Number} idx + */ + getAnnotation(idx: number): string; + + /** + * + * @param val + * @param rgba + */ + getAnnotationColor(val: any, rgba: any): void; + + /** + * + * @param val + * @param rgba + */ + getIndexedColor(val: number, rgba: any): void; + + /** + * + */ + getIndexedLookup(): boolean; + + /** + * + */ + getMappingRange(): Range; + + /** + * + */ + getMappingRangeByReference(): Range; + + /** + * Return the annotated value at a particular index in the list of annotations. + */ + getNumberOfAnnotatedValues(): number; + + /** + * Get the number of available colors for mapping to. + */ + getNumberOfAvailableColors(): number; + + /** + * + */ + getRange(): Range; + + /** + * Get which component of a vector to map to colors. + */ + getVectorComponent(): number; + + /** + * + */ + getVectorMode(): VectorMode; + + /** + * + */ + getVectorSize(): number; + + /** + * @see areScalarsOpaque + */ + isOpaque(): boolean; + + /** + * Returns false if scalars are Uint8 LA or RGBA with A < 255, + * otherwise rely on getAlpha() in case of direct mapping, + * otherwise return isOpaque() + * + * @see isOpaque, getAlpha + * + * @param {vtkDataArray} scalars + * @param {ColorMode} colorMode + * @param {Number} componentIn + * + */ + areScalarsOpaque( + scalars: vtkDataArray, + colorMode: ColorMode, + componentIn: number + ): boolean; + + /** + * + * @param newColors + * @param colors + * @param {Number} alpha + * @param convtFun + */ + luminanceAlphaToRGBA( + newColors: any, + colors: any, + alpha: number, + convtFun: any + ): void; + + /** + * + * @param newColors + * @param colors + * @param {Number} alpha + * @param convtFun + */ + luminanceToRGBA( + newColors: any, + colors: any, + alpha: number, + convtFun: any + ): void; + + /** + * Internal methods that map a data array into a 4-component, unsigned char + * RGBA array. The color mode determines the behavior of mapping. If + * ColorMode.DEFAULT is set, then unsigned char data arrays are treated as + * colors (and converted to RGBA if necessary); If ColorMode.DIRECT_SCALARS + * is set, then all arrays are treated as colors (integer types are clamped + * in the range 0-255, floating point arrays are clamped in the range + * 0.0-1.0. Note 'char' does not have enough values to represent a color so + * mapping this type is considered an error); otherwise, the data is mapped + * through this instance of ScalarsToColors. The component argument is used + * for data arrays with more than one component; it indicates which + * component to use to do the blending. When the component argument is -1, + * then the this object uses its own selected technique to change a vector + * into a scalar to map. + * @param scalars + * @param {ColorMode} colorMode + * @param {Number} componentIn + */ + mapScalars(scalars: any, colorMode: ColorMode, componentIn: number): void; + + /** + * Map a set of vector values through the table + * @param input + * @param output + * @param {ScalarMappingTarget} outputFormat + * @param vectorComponentIn + * @param {Number} vectorSizeIn + */ + mapVectorsThroughTable( + input: any, + output: any, + outputFormat: ScalarMappingTarget, + vectorComponentIn: number, + vectorSizeIn: number + ): void; + + /** + * + * @param input + * @param output + * @param {Number} compsToUse + */ + mapVectorsToMagnitude(input: any, output: any, compsToUse: number): void; + + /** + * + * @param newColors + * @param colors + * @param {Number} alpha + * @param convtFun + */ + rGBAToRGBA(newColors: any, colors: any, alpha: number, convtFun: any): void; + + /** + * + * @param newColors + * @param colors + * @param {Number} alpha + * @param convtFun + */ + rGBToRGBA(newColors: any, colors: any, alpha: number, convtFun: any): void; + + /** + * Remove an existing entry from the list of annotated values. + * @param value + */ + removeAnnotation(value: any): boolean; + + /** + * Remove all existing values and their annotations. + */ + resetAnnotations(): void; + + /** + * + * @param {Number} alpha + */ + setAlpha(alpha: number): boolean; + + /** + * + * @param value + * @param annotation + */ + setAnnotation(value: any, annotation: any): number; + + /** + * + * @param values + * @param annotations + */ + setAnnotations(values: any, annotations: any): void; + + /** + * + * @param {Boolean} indexedLookup + */ + setIndexedLookup(indexedLookup: boolean): boolean; + + /** + * + * @param {Range} mappingRange + */ + setMappingRange(mappingRange: Range): boolean; + + /** + * + * @param {Number} min + * @param {Number} max + */ + setMappingRange(min: number, max: number): boolean; + + /** + * + * @param {Range} mappingRange + */ + setMappingRangeFrom(mappingRange: Range): boolean; + + /** + * + * @param {Number} min + * @param {Number} max + */ + setRange(min: number, max: number): boolean; + + /** + * If the mapper does not select which component of a vector to map to + * colors, you can specify it here. + * @param {Number} vectorComponent The value of the vector mode. + */ + setVectorComponent(vectorComponent: number): boolean; + + /** + * Change mode that maps vectors by magnitude vs. component. If the mode is + * "RGBColors", then the vectors components are scaled to the range and + * passed directly as the colors. + * @param {VectorMode} vectorMode The value of the vector mode. + */ + setVectorMode(vectorMode: VectorMode): boolean; + + /** + * Set vectorMode to `VectorMode.MAGNITUDE` + */ + setVectorModeToMagnitude(): boolean; + + /** + * Set vectorMode to `VectorMode.COMPONENT` + */ + setVectorModeToComponent(): boolean; + + /** + * When mapping vectors, consider only the number of components selected by + * `vectorSize` to be part of the vector, and ignore any other components. Set + * to -1 to map all components. If this is not set to -1, then you can use + * `setVectorComponent` to set which scalar component will be the first + * component in the vector to be mapped. + */ + setVectorModeToRGBColors(): boolean; + + /** + * When mapping vectors, consider only the number of components selected by + * VectorSize to be part of the vector, and ignore any other components. + * @param {Number} vectorSize The value of the vectorSize. + */ + setVectorSize(vectorSize: number): boolean; + + /** + * Update the map from annotated values to indices in the array of annotations. + */ + updateAnnotatedValueMap(): boolean; + + /** + * + */ + usingLogScale(): boolean; } /** @@ -339,13 +358,19 @@ export interface vtkScalarsToColors extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IScalarsToColorsInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IScalarsToColorsInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IScalarsToColorsInitialValues +): void; /** * Method used to create a new instance of vtkScalarsToColors * @param {IScalarsToColorsInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IScalarsToColorsInitialValues): vtkScalarsToColors; +export function newInstance( + initialValues?: IScalarsToColorsInitialValues +): vtkScalarsToColors; /** * vtkScalarsToColors is a general-purpose base class for objects that convert @@ -369,9 +394,9 @@ export function newInstance(initialValues?: IScalarsToColorsInitialValues): vtkS * index in the list of annotations with the number of colors in the table. */ export declare const vtkScalarsToColors: { - newInstance: typeof newInstance; - extend: typeof extend; - VectorMode: typeof VectorMode; - ScalarMappingTarget: typeof VectorMode; -} + newInstance: typeof newInstance; + extend: typeof extend; + VectorMode: typeof VectorMode; + ScalarMappingTarget: typeof VectorMode; +}; export default vtkScalarsToColors; diff --git a/Sources/Common/Core/StringArray/index.d.ts b/Sources/Common/Core/StringArray/index.d.ts index d14fbe0712c..e4b8ad824d5 100755 --- a/Sources/Common/Core/StringArray/index.d.ts +++ b/Sources/Common/Core/StringArray/index.d.ts @@ -1,95 +1,94 @@ -import { vtkObject } from "../../../interfaces" ; +import { vtkObject } from '../../../interfaces'; /** * */ export interface IStringArrayInitialValues { - name?: string; - numberOfComponents?: number; - size: number; - dataType?: string; + name?: string; + numberOfComponents?: number; + size: number; + dataType?: string; } export interface vtkStringArray extends vtkObject { - - /** - * Get the data component at the location specified by tupleIdx and compIdx. - * @param {Number} tupleIdx - * @param {Number} [compIdx] - */ - getComponent(tupleIdx: number, compIdx?: number): void; - - /** - * - */ - getData(): string[]; - - /** - * - */ - getDataType(): string; - - /** - * - */ - getName(): string; - - /** - * - */ - getNumberOfComponents(): number; - - /** - * - */ - getNumberOfValues(): number; - - /** - * - */ - getNumberOfTuples(): number; - - /** - * - * @param {Number} idx - * @param {String[]} [tupleToFill] - */ - getTuple(idx: number, tupleToFill?: string[]): string[]; - - /** - * - * @param {Number} [idx] - */ - getTupleLocation(idx?: number): number; - - /** - * - */ - newClone(): void; - - /** - * Set the data component at the location specified by tupleIdx and compIdx - * to value. - * Note that i is less than NumberOfTuples and j is less than - * NumberOfComponents. Make sure enough memory has been allocated - * (use SetNumberOfTuples() and SetNumberOfComponents()). - * @param {Number} tupleIdx - * @param {Number} compIdx - * @param {String} value - */ - setComponent(tupleIdx: number, compIdx: number, value: string): void; - - /** - * - * @param {String[]} array - * @param {Number} numberOfComponents - */ - setData(array: string[], numberOfComponents: number): void; - - /** - * - */ - setName(name: string): boolean; + /** + * Get the data component at the location specified by tupleIdx and compIdx. + * @param {Number} tupleIdx + * @param {Number} [compIdx] + */ + getComponent(tupleIdx: number, compIdx?: number): void; + + /** + * + */ + getData(): string[]; + + /** + * + */ + getDataType(): string; + + /** + * + */ + getName(): string; + + /** + * + */ + getNumberOfComponents(): number; + + /** + * + */ + getNumberOfValues(): number; + + /** + * + */ + getNumberOfTuples(): number; + + /** + * + * @param {Number} idx + * @param {String[]} [tupleToFill] + */ + getTuple(idx: number, tupleToFill?: string[]): string[]; + + /** + * + * @param {Number} [idx] + */ + getTupleLocation(idx?: number): number; + + /** + * + */ + newClone(): void; + + /** + * Set the data component at the location specified by tupleIdx and compIdx + * to value. + * Note that i is less than NumberOfTuples and j is less than + * NumberOfComponents. Make sure enough memory has been allocated + * (use SetNumberOfTuples() and SetNumberOfComponents()). + * @param {Number} tupleIdx + * @param {Number} compIdx + * @param {String} value + */ + setComponent(tupleIdx: number, compIdx: number, value: string): void; + + /** + * + * @param {String[]} array + * @param {Number} numberOfComponents + */ + setData(array: string[], numberOfComponents: number): void; + + /** + * + */ + setName(name: string): boolean; } /** @@ -99,13 +98,19 @@ export interface vtkStringArray extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IStringArrayInitialValues} initialValues (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues: IStringArrayInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues: IStringArrayInitialValues +): void; /** * Method used to create a new instance of vtkStringArray * @param {IStringArrayInitialValues} initialValues for pre-setting some of its content */ -export function newInstance(initialValues: IStringArrayInitialValues): vtkStringArray; +export function newInstance( + initialValues: IStringArrayInitialValues +): vtkStringArray; /** * Points and cells may sometimes have associated data that are stored as @@ -113,7 +118,7 @@ export function newInstance(initialValues: IStringArrayInitialValues): vtkString * provides a clean way to store and access those strings. */ export declare const vtkStringArray: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkStringArray; diff --git a/Sources/Common/Core/URLExtract/index.d.ts b/Sources/Common/Core/URLExtract/index.d.ts index 1d0cb2f89fd..46178bd083c 100755 --- a/Sources/Common/Core/URLExtract/index.d.ts +++ b/Sources/Common/Core/URLExtract/index.d.ts @@ -1,12 +1,15 @@ /** - * - * @param {Boolean} [castToNativeType] - * @param {String} [query] + * + * @param {Boolean} [castToNativeType] + * @param {String} [query] */ -export function extractURLParameters(castToNativeType?: boolean, query?: string): object; +export function extractURLParameters( + castToNativeType?: boolean, + query?: string +): object; /** - * - * @param {String} str The type value as string. + * + * @param {String} str The type value as string. */ export function toNativeType(str: string): void; diff --git a/Sources/Common/Core/VariantArray/index.d.ts b/Sources/Common/Core/VariantArray/index.d.ts index 7a6b69a468a..a488c6c0dc6 100755 --- a/Sources/Common/Core/VariantArray/index.d.ts +++ b/Sources/Common/Core/VariantArray/index.d.ts @@ -1,95 +1,94 @@ -import { vtkObject } from "../../../interfaces" ; +import { vtkObject } from '../../../interfaces'; /** * */ export interface IVariantArrayInitialValues { - name?: string; - numberOfComponents?: number; - size: number; - dataType?: string; + name?: string; + numberOfComponents?: number; + size: number; + dataType?: string; } export interface vtkVariantArray extends vtkObject { - - /** - * Get the data component at the location specified by tupleIdx and compIdx. - * @param {Number} tupleIdx - * @param {Number} [compIdx] - */ - getComponent(tupleIdx: number, compIdx?: number): void; - - /** - * - */ - getData(): Array; - - /** - * - */ - getDataType(): string; - - /** - * - */ - getName(): string; - - /** - * - */ - getNumberOfComponents(): number; - - /** - * - */ - getNumberOfValues(): number; - - /** - * - */ - getNumberOfTuples(): number; - - /** - * - * @param {Number} idx - * @param {Array} [tupleToFill] - */ - getTuple(idx: number, tupleToFill?: Array): Array; - - /** - * - * @param {Number} [idx] - */ - getTupleLocation(idx?: number): number; - - /** - * - */ - newClone(): void; - - /** - * Set the data component at the location specified by tupleIdx and compIdx - * to value. - * Note that i is less than NumberOfTuples and j is less than - * NumberOfComponents. Make sure enough memory has been allocated - * (use SetNumberOfTuples() and SetNumberOfComponents()). - * @param {Number} tupleIdx - * @param {Number} compIdx - * @param {String} value - */ - setComponent(tupleIdx: number, compIdx: number, value: string): void; - - /** - * - * @param {Array} array - * @param {Number} numberOfComponents - */ - setData(array: Array, numberOfComponents: number): void; - - /** - * - */ - setName(name: string): boolean; + /** + * Get the data component at the location specified by tupleIdx and compIdx. + * @param {Number} tupleIdx + * @param {Number} [compIdx] + */ + getComponent(tupleIdx: number, compIdx?: number): void; + + /** + * + */ + getData(): Array; + + /** + * + */ + getDataType(): string; + + /** + * + */ + getName(): string; + + /** + * + */ + getNumberOfComponents(): number; + + /** + * + */ + getNumberOfValues(): number; + + /** + * + */ + getNumberOfTuples(): number; + + /** + * + * @param {Number} idx + * @param {Array} [tupleToFill] + */ + getTuple(idx: number, tupleToFill?: Array): Array; + + /** + * + * @param {Number} [idx] + */ + getTupleLocation(idx?: number): number; + + /** + * + */ + newClone(): void; + + /** + * Set the data component at the location specified by tupleIdx and compIdx + * to value. + * Note that i is less than NumberOfTuples and j is less than + * NumberOfComponents. Make sure enough memory has been allocated + * (use SetNumberOfTuples() and SetNumberOfComponents()). + * @param {Number} tupleIdx + * @param {Number} compIdx + * @param {String} value + */ + setComponent(tupleIdx: number, compIdx: number, value: string): void; + + /** + * + * @param {Array} array + * @param {Number} numberOfComponents + */ + setData(array: Array, numberOfComponents: number): void; + + /** + * + */ + setName(name: string): boolean; } /** @@ -99,19 +98,25 @@ export interface vtkVariantArray extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IVariantArrayInitialValues} initialValues (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues: IVariantArrayInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues: IVariantArrayInitialValues +): void; /** * Method used to create a new instance of vtkVariantArray * @param {IVariantArrayInitialValues} initialValues for pre-setting some of its content */ -export function newInstance(initialValues: IVariantArrayInitialValues): vtkVariantArray; +export function newInstance( + initialValues: IVariantArrayInitialValues +): vtkVariantArray; /** * An array holding vtkVariants. */ export declare const vtkVariantArray: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkVariantArray; diff --git a/Sources/Common/DataModel/AbstractPointLocator/index.d.ts b/Sources/Common/DataModel/AbstractPointLocator/index.d.ts index 8b879633bf8..822e112b0e3 100644 --- a/Sources/Common/DataModel/AbstractPointLocator/index.d.ts +++ b/Sources/Common/DataModel/AbstractPointLocator/index.d.ts @@ -1,28 +1,28 @@ -import { vtkObject } from "../../../interfaces"; -import { Bounds } from "../../../types"; -import { ILocatorInitialValues } from "../Locator"; +import { vtkObject } from '../../../interfaces'; +import { Bounds } from '../../../types'; +import { ILocatorInitialValues } from '../Locator'; /** * */ export interface IAbstractPointLocatorInitialValues - extends ILocatorInitialValues { - bounds?: Bounds; - numberOfBuckets: number; + 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; + /** + * Set the bounds of this object. + * @param {Bounds} input + */ + setBounds(input: Bounds): void; + + /** + * Get the bounds of this object. + * @returns {Bounds} + */ + getBounds(): Bounds; } // ---------------------------------------------------------------------------- @@ -37,9 +37,9 @@ export interface vtkAbstractPointLocator extends vtkObject { * @param {IAbstractPointLocatorInitialValues} [initialValues] (default: {}) */ export function extend( - publicAPI: object, - model: object, - initialValues?: IAbstractPointLocatorInitialValues + publicAPI: object, + model: object, + initialValues?: IAbstractPointLocatorInitialValues ): void; // ---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ export function extend( * vtkAbstractPointLocator */ export declare const vtkAbstractPointLocator: { - extend: typeof extend; + extend: typeof extend; }; export default vtkAbstractPointLocator; diff --git a/Sources/Common/DataModel/Box/index.d.ts b/Sources/Common/DataModel/Box/index.d.ts index e2321b68030..17da8cad9c4 100644 --- a/Sources/Common/DataModel/Box/index.d.ts +++ b/Sources/Common/DataModel/Box/index.d.ts @@ -1,64 +1,64 @@ -import { vtkObject } from "../../../interfaces"; -import { Bounds, Vector3 } from "../../../types"; - +import { vtkObject } from '../../../interfaces'; +import { Bounds, Vector3 } from '../../../types'; export interface IBoxInitialValues { - bbox?: Bounds; + bbox?: Bounds; } export interface IBoxIntersections { - t1, t2: number; - x1, x2: Vector3; - } - -export interface vtkBox extends vtkObject { + t1; + t2: number; + x1; + x2: Vector3; +} - /** - * Add the bounds for the box. - * @param {Bounds} bounds - */ - addBounds(bounds: Bounds): void; +export interface vtkBox extends vtkObject { + /** + * Add the bounds for the box. + * @param {Bounds} bounds + */ + addBounds(bounds: Bounds): void; - /** - * - * @param other - */ - addBox(other: any): void; + /** + * + * @param other + */ + addBox(other: any): void; - /** - * - * @param {Vector3} x The point coordinate. - */ - evaluateFunction(x: Vector3): number; + /** + * + * @param {Vector3} x The point coordinate. + */ + evaluateFunction(x: Vector3): number; - /** - * Intersect box with line and return the parametric values and points of the two intercepts - * @param bounds - * @param p1 - * @param p2 - * returns @object IBoxIntersections {t1, t2, x1, x2} object containing the t1, t2 parametric values and - * x1, x2 coordinates of the line intercept points in the bounding box or undefined - */ - intersectWithLine(p1: Vector3, p2: Vector3) : IBoxIntersections | undefined; + /** + * Intersect box with line and return the parametric values and points of the two intercepts + * @param bounds + * @param p1 + * @param p2 + * returns @object IBoxIntersections {t1, t2, x1, x2} object containing the t1, t2 parametric values and + * x1, x2 coordinates of the line intercept points in the bounding box or undefined + */ + intersectWithLine(p1: Vector3, p2: Vector3): IBoxIntersections | undefined; - /** - * - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - evaluateFunction(x: number, y: number, z: number ): number; + /** + * + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + evaluateFunction(x: number, y: number, z: number): number; - /** - * Get the bounds for the box. - */ - getBounds(): Bounds; + /** + * Get the bounds for the box. + */ + getBounds(): Bounds; - /** - * Set the bounds for the box. - * @param {Bounds} bounds The bounds for the box. - */ - setBounds(bounds: Bounds): void; + /** + * Set the bounds for the box. + * @param {Bounds} bounds The bounds for the box. + */ + setBounds(bounds: Bounds): void; } /** @@ -68,7 +68,11 @@ export interface vtkBox extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IBoxInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IBoxInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IBoxInitialValues +): void; /** * Method used to create a new instance of vtkBox. @@ -80,7 +84,11 @@ export function newInstance(initialValues?: IBoxInitialValues): vtkBox; // Bounding box intersection code from David Gobbi. Go through the // bounding planes one at a time and compute the parametric coordinate // of each intersection and return the parametric values and the calculated points -export function intersectWithLine(bounds, p1, p2): IBoxIntersections | undefined; +export function intersectWithLine( + bounds, + p1, + p2 +): IBoxIntersections | undefined; /** * vtkBox provides methods for creating a 1D cubic spline object from given @@ -88,8 +96,8 @@ export function intersectWithLine(bounds, p1, p2): IBoxIntersections | undefined * at any given point inside the spline intervals. */ export declare const vtkBox: { - newInstance: typeof newInstance, - extend: typeof extend, - intersectWithLine: typeof intersectWithLine + newInstance: typeof newInstance; + extend: typeof extend; + intersectWithLine: typeof intersectWithLine; }; export default vtkBox; diff --git a/Sources/Common/DataModel/CardinalSpline1D/index.d.ts b/Sources/Common/DataModel/CardinalSpline1D/index.d.ts index baa24b4f297..703306c51a6 100755 --- a/Sources/Common/DataModel/CardinalSpline1D/index.d.ts +++ b/Sources/Common/DataModel/CardinalSpline1D/index.d.ts @@ -1,39 +1,58 @@ import { Vector3 } from '../../../types'; -import vtkSpline1D, { ISpline1DInitialValues, BoundaryCondition } from '../Spline1D'; +import vtkSpline1D, { + ISpline1DInitialValues, + BoundaryCondition, +} from '../Spline1D'; -export interface ICardinalSpline1DInitialValues extends ISpline1DInitialValues {} +export interface ICardinalSpline1DInitialValues + extends ISpline1DInitialValues {} export interface vtkCardinalSpline1D extends vtkSpline1D { + /** + * + * @param {Number} size + * @param {Float32Array} work + * @param {Vector3} x + * @param {Vector3} y + */ + computeCloseCoefficients( + size: number, + work: Float32Array, + x: Vector3, + y: Vector3 + ): void; - /** - * - * @param {Number} size - * @param {Float32Array} work - * @param {Vector3} x - * @param {Vector3} y - */ - computeCloseCoefficients(size: number, work: Float32Array, x: Vector3, y: Vector3): void; + /** + * + * @param {Number} size + * @param {Float32Array} work + * @param {Vector3} x + * @param {Vector3} y + * @param {Object} options + * @param {BoundaryCondition} options.leftConstraint + * @param {Number} options.leftValue + * @param {BoundaryCondition} options.rightConstraint + * @param {Number} options.rightValue + */ + computeOpenCoefficients( + size: number, + work: Float32Array, + x: Vector3, + y: Vector3, + options: { + leftConstraint: BoundaryCondition; + leftValue: number; + rightConstraint: BoundaryCondition; + rightValue: Number; + } + ): void; - /** - * - * @param {Number} size - * @param {Float32Array} work - * @param {Vector3} x - * @param {Vector3} y - * @param {Object} options - * @param {BoundaryCondition} options.leftConstraint - * @param {Number} options.leftValue - * @param {BoundaryCondition} options.rightConstraint - * @param {Number} options.rightValue - */ - computeOpenCoefficients(size: number, work: Float32Array, x: Vector3, y: Vector3, options: { leftConstraint: BoundaryCondition, leftValue: number, rightConstraint: BoundaryCondition, rightValue: Number }): void; - - /** - * - * @param {Number} intervalIndex - * @param {Number} t - */ - getValue(intervalIndex: number, t: number): number; + /** + * + * @param {Number} intervalIndex + * @param {Number} t + */ + getValue(intervalIndex: number, t: number): number; } /** @@ -43,13 +62,19 @@ export interface vtkCardinalSpline1D extends vtkSpline1D { * @param model object on which data structure will be bounds (protected) * @param {ICardinalSpline1DInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ICardinalSpline1DInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ICardinalSpline1DInitialValues +): void; /** * Method used to create a new instance of vtkCardinalSpline1D. * @param {ICardinalSpline1DInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ICardinalSpline1DInitialValues): vtkCardinalSpline1D; +export function newInstance( + initialValues?: ICardinalSpline1DInitialValues +): vtkCardinalSpline1D; /** * vtkCardinalSpline1D provides methods for creating a 1D cubic spline object @@ -57,7 +82,7 @@ export function newInstance(initialValues?: ICardinalSpline1DInitialValues): vtk * derivative at any given point inside the spline intervals. */ export declare const vtkCardinalSpline1D: { - newInstance: typeof newInstance, - extend: typeof extend + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkCardinalSpline1D; diff --git a/Sources/Common/DataModel/Cell/index.d.ts b/Sources/Common/DataModel/Cell/index.d.ts index 3b364f78d8a..5e185e74d8c 100755 --- a/Sources/Common/DataModel/Cell/index.d.ts +++ b/Sources/Common/DataModel/Cell/index.d.ts @@ -1,82 +1,81 @@ -import { vtkObject } from "../../../interfaces" ; -import { Bounds, Vector3 } from "../../../types"; +import { vtkObject } from '../../../interfaces'; +import { Bounds, Vector3 } from '../../../types'; import vtkPoints from '../../Core/Points'; export interface ICellInitialValues { - bounds?: Bounds; - pointsIds?: number[]; + bounds?: Bounds; + pointsIds?: number[]; } export interface vtkCell extends vtkObject { + /** + * Copy this cell by completely copying internal data structures. + * @param {vtkCell} cell The cell you want to use. + */ + deepCopy(cell: vtkCell): void; - /** - * Copy this cell by completely copying internal data structures. - * @param {vtkCell} cell The cell you want to use. - */ - deepCopy(cell: vtkCell): void; + /** + * Initialize the cell with point coordinates and cell point ids, example : + * + * ```js + * const points = vtkPoints.newInstance(); + * points.setData(Float32Array.from([0, 0, 0, 0, 0, 1, ..., 255, 255, 255])); + * const pointIdsList = [13, 10, 235]; + * // Create cell + * const triangle = vtkTriangle.newInstance(); + * // Initialize cell + * triangle.initialize(points, pointIdsList); + * ``` + * + * If pointIdsList is null, points are shallow copied and pointIdsList is + * generated as such: [0, 1, ..., N-1] where N is the number of points. If + * pointIdsList is not null, only pointIdsList point coordinates are copied into + * the cell. pointIdsList is shallow copied. + * @param {vtkPoints} points + * @param {Number[]} [pointIdsList] + */ + initialize(points: vtkPoints, pointIdsList?: number[]): void; - /** - * Initialize the cell with point coordinates and cell point ids, example : - * - * ```js - * const points = vtkPoints.newInstance(); - * points.setData(Float32Array.from([0, 0, 0, 0, 0, 1, ..., 255, 255, 255])); - * const pointIdsList = [13, 10, 235]; - * // Create cell - * const triangle = vtkTriangle.newInstance(); - * // Initialize cell - * triangle.initialize(points, pointIdsList); - * ``` - * - * If pointIdsList is null, points are shallow copied and pointIdsList is - * generated as such: [0, 1, ..., N-1] where N is the number of points. If - * pointIdsList is not null, only pointIdsList point coordinates are copied into - * the cell. pointIdsList is shallow copied. - * @param {vtkPoints} points - * @param {Number[]} [pointIdsList] - */ - initialize(points: vtkPoints, pointIdsList?: number[]): void; + /** + * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @return {Bounds} The bounds for the mapper. + */ + getBounds(): Bounds; - /** - * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @return {Bounds} The bounds for the mapper. - */ - getBounds(): Bounds; + /** + * Compute Length squared of cell (i.e., bounding box diagonal squared). + */ + getLength2(): number; - /** - * Compute Length squared of cell (i.e., bounding box diagonal squared). - */ - getLength2(): number; + /** + * Get the distance of the parametric coordinate provided to the cell. If + * inside the cell, a distance of zero is returned. This is used during + * picking to get the correct cell picked. (The tolerance will occasionally + * allow cells to be picked who are not really intersected "inside" the + * cell.) + * @param {Vector3} pcoords The coordinates of the point. + * + */ + getParametricDistance(pcoords: Vector3): number; - /** - * Get the distance of the parametric coordinate provided to the cell. If - * inside the cell, a distance of zero is returned. This is used during - * picking to get the correct cell picked. (The tolerance will occasionally - * allow cells to be picked who are not really intersected "inside" the - * cell.) - * @param {Vector3} pcoords The coordinates of the point. - * - */ - getParametricDistance(pcoords: Vector3): number; + /** + * + */ + getPoints(): vtkPoints; - /** - * - */ - getPoints(): vtkPoints; + /** + * + */ + getPointsIds(): number[]; - /** - * - */ - getPointsIds(): number[]; + /** + * Get the number of points in the cell. + */ + getNumberOfPoints(): number; - /** - * Get the number of points in the cell. - */ - getNumberOfPoints(): number; - - // getCellDimension(): void; - // intersectWithLine(p1: any, p2: any, tol: any, t: any, x: any, pcoords: any, subId: any): void; - // evaluatePosition(x: Vector3, closestPoint: Vector3, subId: number, pcoords: Vector3, dist2: number, weights: any): void; + // getCellDimension(): void; + // intersectWithLine(p1: any, p2: any, tol: any, t: any, x: any, pcoords: any, subId: any): void; + // evaluatePosition(x: Vector3, closestPoint: Vector3, subId: number, pcoords: Vector3, dist2: number, weights: any): void; } /** @@ -86,7 +85,11 @@ export interface vtkCell extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {ICellInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ICellInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ICellInitialValues +): void; /** * Method used to create a new instance of vtkCell. @@ -98,7 +101,7 @@ export function newInstance(initialValues?: ICellInitialValues): vtkCell; * vtkCell is an abstract method to define a cell */ export declare const vtkCell: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkCell; diff --git a/Sources/Common/DataModel/Collection/index.d.ts b/Sources/Common/DataModel/Collection/index.d.ts index 447703cd86a..3753edcb78a 100644 --- a/Sources/Common/DataModel/Collection/index.d.ts +++ b/Sources/Common/DataModel/Collection/index.d.ts @@ -1,93 +1,103 @@ -import { vtkObject } from "../../../interfaces"; -import { Nullable } from "../../../types"; +import { vtkObject } from '../../../interfaces'; +import { Nullable } from '../../../types'; /** * */ export interface ICollectionInitialValues { - collection?: vtkObject[]; + collection?: vtkObject[]; } - export interface vtkCollection extends vtkObject { - - /** - * Add item (vtkObject) to the collection - * @param {vtkObject} item item to be added to the collection - */ - addItem(item: vtkObject): void; - - /** - * Add item (vtkObject) to the collection _at_ the given index. - * This differs from VTK-C++ where insertItem inserts at position - * after the provided index value. - * @param {number} idx index where the new item should be inserted. - * @param {vtkObject} item item to be inserted - */ - insertItem(idx: number, item: vtkObject): void; - - /** - * Replace an existing item (vtkObject) with a new one - * @param {number} idx index of item to be replaced - * @param {vtkObject} item - */ - replaceItem(idx: number, item: vtkObject): void; - - /** - * Remove an existing item from the collection - * @param {number|vtkObject} inValue index or reference of an item to be removed - */ - removeItem(inValue: number|vtkObject): void; - - /** - * Remove all items from the collection - */ - removeAllItems(): void; - - /** - * Check if a provided item is already present in the collection - */ - isItemPresent(item: vtkObject): boolean; - - /** - * Get the total number of items in the collection - */ - getNumberOfItems(): number; - - /** - * Check if the collection is empty - */ - empty(): boolean; - - /** - * get the current item and provided index, returns null if index is out of bounds - */ - getItem(idx: number): Nullable; - - /** - * Execute a passed function on every item in the collection - * @param callbackfn callback function to be executed on every item in the collection - */ - forEach(callbackfn: (value: T, index: number, array: readonly T[]) => void): void; - - /** - * Execute a passed function on every item in the collection, in order to calculate an aggregated return value. - * @param callbackfn callback function to be used for aggregating a single value from each item in the collection - * @param initialValue starting value to calculate aggregation - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T; - - /** - * Similar to forEach, but returns an array of resulting values. - * @param callbackfn callback function to execute on each item in the collection, that returns a value. - */ - map(callbackfn: (value: T, index: number, array: readonly T[]) => void): void; - - /** - * Check each element for modified time and update the collection's - * MTime to the latest timestamp from individual items in the collection. - */ - updateMTimeWithElements(): void; + /** + * Add item (vtkObject) to the collection + * @param {vtkObject} item item to be added to the collection + */ + addItem(item: vtkObject): void; + + /** + * Add item (vtkObject) to the collection _at_ the given index. + * This differs from VTK-C++ where insertItem inserts at position + * after the provided index value. + * @param {number} idx index where the new item should be inserted. + * @param {vtkObject} item item to be inserted + */ + insertItem(idx: number, item: vtkObject): void; + + /** + * Replace an existing item (vtkObject) with a new one + * @param {number} idx index of item to be replaced + * @param {vtkObject} item + */ + replaceItem(idx: number, item: vtkObject): void; + + /** + * Remove an existing item from the collection + * @param {number|vtkObject} inValue index or reference of an item to be removed + */ + removeItem(inValue: number | vtkObject): void; + + /** + * Remove all items from the collection + */ + removeAllItems(): void; + + /** + * Check if a provided item is already present in the collection + */ + isItemPresent(item: vtkObject): boolean; + + /** + * Get the total number of items in the collection + */ + getNumberOfItems(): number; + + /** + * Check if the collection is empty + */ + empty(): boolean; + + /** + * get the current item and provided index, returns null if index is out of bounds + */ + getItem(idx: number): Nullable; + + /** + * Execute a passed function on every item in the collection + * @param callbackfn callback function to be executed on every item in the collection + */ + forEach( + callbackfn: (value: T, index: number, array: readonly T[]) => void + ): void; + + /** + * Execute a passed function on every item in the collection, in order to calculate an aggregated return value. + * @param callbackfn callback function to be used for aggregating a single value from each item in the collection + * @param initialValue starting value to calculate aggregation + */ + reduce( + callbackfn: ( + previousValue: T, + currentValue: T, + currentIndex: number, + array: readonly T[] + ) => T, + initialValue: T + ): T; + + /** + * Similar to forEach, but returns an array of resulting values. + * @param callbackfn callback function to execute on each item in the collection, that returns a value. + */ + map( + callbackfn: (value: T, index: number, array: readonly T[]) => void + ): void; + + /** + * Check each element for modified time and update the collection's + * MTime to the latest timestamp from individual items in the collection. + */ + updateMTimeWithElements(): void; } /** @@ -97,13 +107,19 @@ export interface vtkCollection extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {ICollectionInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues? : ICollectionInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ICollectionInitialValues +): void; /** * Method used to create a new instance of vtkCollection. * @param {ICollectionInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues? : ICollectionInitialValues): vtkCollection; +export function newInstance( + initialValues?: ICollectionInitialValues +): vtkCollection; /** * vtkCollection is a container of multiple vtkObject items. @@ -112,7 +128,7 @@ export function newInstance(initialValues? : ICollectionInitialValues): vtkColle * to other filters and mappers as a single unit. */ export declare const vtkCollection: { - newInstance: typeof newInstance; - extend: typeof extend; + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkCollection; diff --git a/Sources/Common/DataModel/Cone/index.d.ts b/Sources/Common/DataModel/Cone/index.d.ts index 55063b0b524..3da020260d6 100755 --- a/Sources/Common/DataModel/Cone/index.d.ts +++ b/Sources/Common/DataModel/Cone/index.d.ts @@ -1,37 +1,36 @@ -import { vtkObject } from "../../../interfaces" ; -import { Vector3 } from "../../../types"; +import { vtkObject } from '../../../interfaces'; +import { Vector3 } from '../../../types'; /** - * + * */ export interface IConeInitialValues { - angle?: number; + angle?: number; } export interface vtkCone extends vtkObject { + /** + * Given the point x evaluate the cone equation. + * @param {Vector3} x The point coordinate. + */ + evaluateFunction(x: Vector3): number[]; - /** - * Given the point x evaluate the cone equation. - * @param {Vector3} x The point coordinate. - */ - evaluateFunction(x: Vector3): number[]; - - /** - * Given the point x evaluate the equation for the cone gradient. - * @param {Vector3} x The point coordinate. - */ - evaluateGradient(x: Vector3): number[]; + /** + * Given the point x evaluate the equation for the cone gradient. + * @param {Vector3} x The point coordinate. + */ + evaluateGradient(x: Vector3): number[]; - /** - * Get the angle of the cone. - */ - getAngle(): number; + /** + * Get the angle of the cone. + */ + getAngle(): number; - /** - * Set the value representing the angle of the cone. - * @param {Number} angle The angle of the cone. - */ - setAngle(angle: number): boolean; + /** + * Set the value representing the angle of the cone. + * @param {Number} angle The angle of the cone. + */ + setAngle(angle: number): boolean; } /** @@ -41,7 +40,11 @@ export interface vtkCone extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IConeInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IConeInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IConeInitialValues +): void; /** * Method used to create a new instance of vtkCone. @@ -49,7 +52,7 @@ export function extend(publicAPI: object, model: object, initialValues?: IConeIn */ export function newInstance(initialValues?: IConeInitialValues): vtkCone; -/** +/** * vtkCone computes the implicit function and/or gradient for a cone. vtkCone is * a concrete implementation of vtkImplicitFunction. TODO: Currently the cone's * axis of rotation is along the x-axis with the apex at the origin. To @@ -58,7 +61,7 @@ export function newInstance(initialValues?: IConeInitialValues): vtkCone; * implicit function level, and should be added. */ export declare const vtkCone: { - newInstance: typeof newInstance, - extend: typeof extend; + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkCone; diff --git a/Sources/Common/DataModel/Cylinder/index.d.ts b/Sources/Common/DataModel/Cylinder/index.d.ts index 363f513a4bd..f6f2cae5f55 100755 --- a/Sources/Common/DataModel/Cylinder/index.d.ts +++ b/Sources/Common/DataModel/Cylinder/index.d.ts @@ -1,112 +1,111 @@ -import { vtkObject } from "../../../interfaces" ; -import { Vector3 } from "../../../types"; +import { vtkObject } from '../../../interfaces'; +import { Vector3 } from '../../../types'; /** - * + * */ export interface ICylinderInitialValues { - radius?: number; - center?: number[]; - axis?: number[]; + radius?: number; + center?: number[]; + axis?: number[]; } export interface vtkCylinder extends vtkObject { - - /** - * Given the point xyz (three floating value) evaluate the cylinder - * equation. - * @param {Vector3} xyz The point coordinate. - */ - evaluateFunction(xyz: Vector3): number[]; - - /** - * Given the point xyz (three floating values) evaluate the equation for the - * cylinder gradient. - * @param {Vector3} xyz The point coordinate. - */ - evaluateGradient(xyz: Vector3): number[]; - - /** - * Get the angle of the cone. - */ - getAngle(): number; - - /** - * Get the axis of the cylinder. - */ - getAxis(): number[]; - - /** - * Get the axis of the cylinder. - */ - getAxisByReference(): number[]; - - /** - * Get the center of the cylinder. - */ - getCenter(): number[]; - - /** - * Get the center of the cylinder. - */ - getCenterByReference(): number[]; - - /** - * Get the radius of the cylinder. - */ - getRadius(): number; - - /** - * Set the value representing the angle of the cone. - * @param {Number} angle The angle of the cone. - */ - setAngle(angle: number): boolean; - - /** - * Set the axis of the cylinder. - * @param {Number[]} axis The axis coordinate. - */ - setAxis(axis: number[]): boolean; - - /** - * Set the axis of the cylinder. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setAxis(x: number, y: number, z: number): boolean; - - /** - * Set the axis of the cylinder. - * @param {Number[]} axis The axis coordinate. - */ - setAxisFrom(axis: number[]): boolean; - - /** - * Set the center of the cylinder. - * @param {Number[]} center The center coordinate. - */ - setCenter(center: number[]): boolean; - - /** - * Set the center of the cylinder. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setCenter(x: number, y: number, z: number): boolean; - - /** - * Set the center of the cylinder. - * @param {Number[]} center The center coordinate. - */ - setCenterFrom(center: number[]): boolean; - - /** - * Set the radius of the cylinder. - * @param {Number} radius The radius of the cylinder. - */ - setRadius(radius: number): boolean; + /** + * Given the point xyz (three floating value) evaluate the cylinder + * equation. + * @param {Vector3} xyz The point coordinate. + */ + evaluateFunction(xyz: Vector3): number[]; + + /** + * Given the point xyz (three floating values) evaluate the equation for the + * cylinder gradient. + * @param {Vector3} xyz The point coordinate. + */ + evaluateGradient(xyz: Vector3): number[]; + + /** + * Get the angle of the cone. + */ + getAngle(): number; + + /** + * Get the axis of the cylinder. + */ + getAxis(): number[]; + + /** + * Get the axis of the cylinder. + */ + getAxisByReference(): number[]; + + /** + * Get the center of the cylinder. + */ + getCenter(): number[]; + + /** + * Get the center of the cylinder. + */ + getCenterByReference(): number[]; + + /** + * Get the radius of the cylinder. + */ + getRadius(): number; + + /** + * Set the value representing the angle of the cone. + * @param {Number} angle The angle of the cone. + */ + setAngle(angle: number): boolean; + + /** + * Set the axis of the cylinder. + * @param {Number[]} axis The axis coordinate. + */ + setAxis(axis: number[]): boolean; + + /** + * Set the axis of the cylinder. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setAxis(x: number, y: number, z: number): boolean; + + /** + * Set the axis of the cylinder. + * @param {Number[]} axis The axis coordinate. + */ + setAxisFrom(axis: number[]): boolean; + + /** + * Set the center of the cylinder. + * @param {Number[]} center The center coordinate. + */ + setCenter(center: number[]): boolean; + + /** + * Set the center of the cylinder. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setCenter(x: number, y: number, z: number): boolean; + + /** + * Set the center of the cylinder. + * @param {Number[]} center The center coordinate. + */ + setCenterFrom(center: number[]): boolean; + + /** + * Set the radius of the cylinder. + * @param {Number} radius The radius of the cylinder. + */ + setRadius(radius: number): boolean; } /** @@ -116,31 +115,42 @@ export interface vtkCylinder extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {ICylinderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ICylinderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ICylinderInitialValues +): void; /** * Method used to create a new instance of vtkCylinder. * @param {ICylinderInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ICylinderInitialValues): vtkCylinder; +export function newInstance( + initialValues?: ICylinderInitialValues +): vtkCylinder; /** * Evaluate of the cylinder equation without setting the data members center and * radius. - * @param {Number} radius - * @param {Number} center - * @param {Number[]} axis - * @param {Number[]} x + * @param {Number} radius + * @param {Number} center + * @param {Number[]} axis + * @param {Number[]} x */ -export function evaluate(radius: number, center: number[], axis: number[], x: number[]): number; +export function evaluate( + radius: number, + center: number[], + axis: number[], + x: number[] +): number; -/** +/** * vtkCylinder computes the implicit function and/or gradient for a cylinder. * vtkCylinder is a concrete implementation of vtkImplicitFunction. */ export declare const vtkCylinder: { - newInstance: typeof newInstance, - extend: typeof extend; - evaluate: typeof evaluate; + newInstance: typeof newInstance; + extend: typeof extend; + evaluate: typeof evaluate; }; export default vtkCylinder; diff --git a/Sources/Common/DataModel/DataSet/Constants.d.ts b/Sources/Common/DataModel/DataSet/Constants.d.ts index 48d6075c157..16921ce7345 100644 --- a/Sources/Common/DataModel/DataSet/Constants.d.ts +++ b/Sources/Common/DataModel/DataSet/Constants.d.ts @@ -1,12 +1,12 @@ export declare enum FieldAssociations { - FIELD_ASSOCIATION_POINTS = 0, - FIELD_ASSOCIATION_CELLS = 1, - FIELD_ASSOCIATION_NONE = 2, - FIELD_ASSOCIATION_POINTS_THEN_CELLS = 3, - FIELD_ASSOCIATION_VERTICES = 4, - FIELD_ASSOCIATION_EDGES = 5, - FIELD_ASSOCIATION_ROWS = 6, - NUMBER_OF_ASSOCIATIONS = 7, + FIELD_ASSOCIATION_POINTS = 0, + FIELD_ASSOCIATION_CELLS = 1, + FIELD_ASSOCIATION_NONE = 2, + FIELD_ASSOCIATION_POINTS_THEN_CELLS = 3, + FIELD_ASSOCIATION_VERTICES = 4, + FIELD_ASSOCIATION_EDGES = 5, + FIELD_ASSOCIATION_ROWS = 6, + NUMBER_OF_ASSOCIATIONS = 7, } export declare enum FieldDataTypes { @@ -15,7 +15,7 @@ export declare enum FieldDataTypes { COORDINATE = 1, POINT_DATA = 1, POINT = 2, - POINT_FIELD_DATA = 2, + POINT_FIELD_DATA = 2, CELL = 3, CELL_FIELD_DATA = 3, VERTEX = 4, diff --git a/Sources/Common/DataModel/DataSet/index.d.ts b/Sources/Common/DataModel/DataSet/index.d.ts index 3911cd27e0e..bcf2977987d 100755 --- a/Sources/Common/DataModel/DataSet/index.d.ts +++ b/Sources/Common/DataModel/DataSet/index.d.ts @@ -1,6 +1,6 @@ import vtkDataSetAttributes from '../DataSetAttributes'; -import { vtkObject } from "../../../interfaces" ; -import { FieldAssociations, FieldDataTypes } from "./Constants"; +import { vtkObject } from '../../../interfaces'; +import { FieldAssociations, FieldDataTypes } from './Constants'; /** * @@ -8,39 +8,38 @@ import { FieldAssociations, FieldDataTypes } from "./Constants"; export interface IDataSetInitialValues {} export interface vtkDataSet extends vtkObject { + /** + * Get dataset's cell data + */ + getCellData(): vtkDataSetAttributes; - /** - * Get dataset's cell data - */ - getCellData(): vtkDataSetAttributes; + /** + * Get dataset's field data + */ + getFieldData(): vtkDataSetAttributes; - /** - * Get dataset's field data - */ - getFieldData(): vtkDataSetAttributes; + /** + * Get dataset's point data. + */ + getPointData(): vtkDataSetAttributes; - /** - * Get dataset's point data. - */ - getPointData(): vtkDataSetAttributes; + /** + * Set dataset's cell data + * @param {vtkDataSetAttributes} cellData + */ + setCellData(cellData: vtkDataSetAttributes): boolean; - /** - * Set dataset's cell data - * @param {vtkDataSetAttributes} cellData - */ - setCellData(cellData: vtkDataSetAttributes): boolean; + /** + * Set dataset's field data + * @param {vtkDataSetAttributes} fieldData + */ + setFieldData(fieldData: vtkDataSetAttributes): boolean; - /** - * Set dataset's field data - * @param {vtkDataSetAttributes} fieldData - */ - setFieldData(fieldData: vtkDataSetAttributes): boolean; - - /** - * Set dataset's point data. - * @param {vtkDataSetAttributes} pointData - */ - setPointData(pointData: vtkDataSetAttributes): boolean; + /** + * Set dataset's point data. + * @param {vtkDataSetAttributes} pointData + */ + setPointData(pointData: vtkDataSetAttributes): boolean; } /** @@ -50,13 +49,17 @@ export interface vtkDataSet extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IDataSetInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues? : IDataSetInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IDataSetInitialValues +): void; /** * Method used to create a new instance of vtkDataSet. * @param {IDataSetInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues? : IDataSetInitialValues): vtkDataSet; +export function newInstance(initialValues?: IDataSetInitialValues): vtkDataSet; /** * vtkDataSet is an abstract class that specifies an interface for dataset @@ -75,9 +78,9 @@ export function newInstance(initialValues? : IDataSetInitialValues): vtkDataSet; * operate on cell data, both cell and point data, either one, or none. */ export declare const vtkDataSet: { - newInstance: typeof newInstance; - extend: typeof extend; - FieldAssociation: typeof FieldAssociations; - FieldDataTypes: typeof FieldDataTypes; + newInstance: typeof newInstance; + extend: typeof extend; + FieldAssociation: typeof FieldAssociations; + FieldDataTypes: typeof FieldDataTypes; }; export default vtkDataSet; diff --git a/Sources/Common/DataModel/DataSetAttributes/FieldData.d.ts b/Sources/Common/DataModel/DataSetAttributes/FieldData.d.ts index 6c55d00f72e..d53b2bb2452 100755 --- a/Sources/Common/DataModel/DataSetAttributes/FieldData.d.ts +++ b/Sources/Common/DataModel/DataSetAttributes/FieldData.d.ts @@ -1,218 +1,223 @@ -import { vtkObject } from "../../../interfaces" ; -import { Nullable } from "../../../types"; -import type vtkDataArray from "../../Core/DataArray"; +import { vtkObject } from '../../../interfaces'; +import { Nullable } from '../../../types'; +import type vtkDataArray from '../../Core/DataArray'; /** - * + * */ export interface IFieldDataInitialValues { - arrays?: vtkDataArray[]; - copyFieldFlags?: Array; - doCopyAllOn?: boolean; - doCopyAllOff?: boolean; + arrays?: vtkDataArray[]; + copyFieldFlags?: Array; + doCopyAllOn?: boolean; + doCopyAllOff?: boolean; } /** - * + * */ interface IArrayWithIndex { - array: vtkDataArray, - index: number; + array: vtkDataArray; + index: number; } export interface vtkFieldData extends vtkObject { - - /** - * - */ - initialize(): void; - - /** - * - */ - initializeFields(): void; - - /** - * - * @param {vtkFieldData} other - */ - copyStructure(other: vtkFieldData): void; - - /** - * Get the number of arrays. - */ - getNumberOfArrays(): number; - - /** - * Get the number of active arrays. - */ - getNumberOfActiveArrays(): number; - - /** - * Add a new array. - * If an array with the same name already exists, it is replaced instead. - * @param {vtkDataArray} arr - */ - addArray(arr: vtkDataArray): number; - - /** - * Remove all the arrays. - */ - removeAllArrays(): void; - - /** - * Remove an array. - * @param {String} arrayName The name of the array. - */ - removeArray(arrayName: string): void; - - /** - * Remove an array by its index. - * @param {Number} arrayIdx The index of the array to remove. - */ - removeArrayByIndex(arrayIdx: number): void; - - /** - * Get all arrays. - */ - getArrays(): vtkDataArray[]; - - /** - * - * @param {number | string} arraySpec index or name of the array - */ - getArray(arraySpec: number | string): Nullable; - - /** - * Get an array by its name. - * @param {String} arrayName The name of the array. - */ - getArrayByName(arrayName: string): Nullable; - - /** - * - * @param {String} arrayName The name of the array. - */ - getArrayWithIndex(arrayName: string): IArrayWithIndex; - - /** - * Get an array by its index. - * @param {Number} idx The index of the array. - */ - getArrayByIndex(idx: number): Nullable; - - /** - * Return true if there exists an array with the given arraName. False otherwise. - * @param {String} arrayName The name of the array. - */ - hasArray(arrayName: string): boolean; - - /** - * Get the name of an array at the given index. - * @param {Number} idx The index of the array. - */ - getArrayName(idx: number): string; - - /** - * - */ - getCopyFieldFlags(): object; - - /** - * Get the flag of the array that has the given name. - * @param {String} arrayName The name of the array. - */ - getFlag(arrayName: string): boolean; - - /** - * Pass data from one fieldData to another at the given index. - * @param {vtkFieldData} other - * @param {Number} [fromId] (default: -1) - * @param {Number} [toId] (default: -1) - */ - passData(other: vtkFieldData, fromId?: number, toId?: number): void; - - /** - * Works like passData, but interpolates the values between the two given fromIds. - * @param {vtkFieldData} other - * @param {Number} [fromId1] (default: -1) - * @param {Number} [fromId2] (default: -1) - * @param {Number} [toId] (default: -1) - * @param {Number} [t] (default: 0.5) - */ - interpolateData(other: vtkFieldData, fromId1?: number, fromId2?: number, toId?: number, t?: number): void; - - /** - * - * @param {String} arrayName The name of the array. - */ - copyFieldOn(arrayName: string): void; - - /** - * - * @param {String} arrayName The name of the array. - */ - copyFieldOff(arrayName: string): void; - - /** - * - */ - copyAllOn(): void; - - /** - * - */ - copyAllOff(): void; - - /** - * - */ - clearFieldFlags(): void; - - /** - * - * @param {vtkFieldData} other - */ - deepCopy(other: vtkFieldData): void; - - /** - * - * @param {vtkFieldData} other - */ - copyFlags(other: vtkFieldData): void; - - /** - * TODO: publicAPI.squeeze = () => model.arrays.forEach(entry => entry.data.squeeze()); - */ - reset(): void; - - /** - * Return the `Modified Time` which is a monotonic increasing integer - * global for all vtkObjects. - * - * This allow to solve a question such as: - * - Is that object created/modified after another one? - * - Do I need to re-execute this filter, or not? ... - * - * @return {Number} the global modified time. - */ - getMTime(): number; - - /** - * TODO: publicAPI.getField = (ids, other) => { copy ids from other into this model's arrays } - * TODO: publicAPI.getArrayContainingComponent = (component) => ... - */ - getNumberOfComponents(): number; - - /** - * - */ - getNumberOfTuples(): number; - - /** - * - */ - getState(): object; + /** + * + */ + initialize(): void; + + /** + * + */ + initializeFields(): void; + + /** + * + * @param {vtkFieldData} other + */ + copyStructure(other: vtkFieldData): void; + + /** + * Get the number of arrays. + */ + getNumberOfArrays(): number; + + /** + * Get the number of active arrays. + */ + getNumberOfActiveArrays(): number; + + /** + * Add a new array. + * If an array with the same name already exists, it is replaced instead. + * @param {vtkDataArray} arr + */ + addArray(arr: vtkDataArray): number; + + /** + * Remove all the arrays. + */ + removeAllArrays(): void; + + /** + * Remove an array. + * @param {String} arrayName The name of the array. + */ + removeArray(arrayName: string): void; + + /** + * Remove an array by its index. + * @param {Number} arrayIdx The index of the array to remove. + */ + removeArrayByIndex(arrayIdx: number): void; + + /** + * Get all arrays. + */ + getArrays(): vtkDataArray[]; + + /** + * + * @param {number | string} arraySpec index or name of the array + */ + getArray(arraySpec: number | string): Nullable; + + /** + * Get an array by its name. + * @param {String} arrayName The name of the array. + */ + getArrayByName(arrayName: string): Nullable; + + /** + * + * @param {String} arrayName The name of the array. + */ + getArrayWithIndex(arrayName: string): IArrayWithIndex; + + /** + * Get an array by its index. + * @param {Number} idx The index of the array. + */ + getArrayByIndex(idx: number): Nullable; + + /** + * Return true if there exists an array with the given arraName. False otherwise. + * @param {String} arrayName The name of the array. + */ + hasArray(arrayName: string): boolean; + + /** + * Get the name of an array at the given index. + * @param {Number} idx The index of the array. + */ + getArrayName(idx: number): string; + + /** + * + */ + getCopyFieldFlags(): object; + + /** + * Get the flag of the array that has the given name. + * @param {String} arrayName The name of the array. + */ + getFlag(arrayName: string): boolean; + + /** + * Pass data from one fieldData to another at the given index. + * @param {vtkFieldData} other + * @param {Number} [fromId] (default: -1) + * @param {Number} [toId] (default: -1) + */ + passData(other: vtkFieldData, fromId?: number, toId?: number): void; + + /** + * Works like passData, but interpolates the values between the two given fromIds. + * @param {vtkFieldData} other + * @param {Number} [fromId1] (default: -1) + * @param {Number} [fromId2] (default: -1) + * @param {Number} [toId] (default: -1) + * @param {Number} [t] (default: 0.5) + */ + interpolateData( + other: vtkFieldData, + fromId1?: number, + fromId2?: number, + toId?: number, + t?: number + ): void; + + /** + * + * @param {String} arrayName The name of the array. + */ + copyFieldOn(arrayName: string): void; + + /** + * + * @param {String} arrayName The name of the array. + */ + copyFieldOff(arrayName: string): void; + + /** + * + */ + copyAllOn(): void; + + /** + * + */ + copyAllOff(): void; + + /** + * + */ + clearFieldFlags(): void; + + /** + * + * @param {vtkFieldData} other + */ + deepCopy(other: vtkFieldData): void; + + /** + * + * @param {vtkFieldData} other + */ + copyFlags(other: vtkFieldData): void; + + /** + * TODO: publicAPI.squeeze = () => model.arrays.forEach(entry => entry.data.squeeze()); + */ + reset(): void; + + /** + * Return the `Modified Time` which is a monotonic increasing integer + * global for all vtkObjects. + * + * This allow to solve a question such as: + * - Is that object created/modified after another one? + * - Do I need to re-execute this filter, or not? ... + * + * @return {Number} the global modified time. + */ + getMTime(): number; + + /** + * TODO: publicAPI.getField = (ids, other) => { copy ids from other into this model's arrays } + * TODO: publicAPI.getArrayContainingComponent = (component) => ... + */ + getNumberOfComponents(): number; + + /** + * + */ + getNumberOfTuples(): number; + + /** + * + */ + getState(): object; } /** @@ -222,19 +227,25 @@ export interface vtkFieldData extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IFieldDataInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IFieldDataInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IFieldDataInitialValues +): void; /** * Method used to create a new instance of vtkFieldData. * @param {IFieldDataInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IFieldDataInitialValues): vtkFieldData; +export function newInstance( + initialValues?: IFieldDataInitialValues +): vtkFieldData; /** - * + * */ export declare const vtkFieldData: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkFieldData; diff --git a/Sources/Common/DataModel/DataSetAttributes/index.d.ts b/Sources/Common/DataModel/DataSetAttributes/index.d.ts index 0c25e12859d..b7726055ab4 100755 --- a/Sources/Common/DataModel/DataSetAttributes/index.d.ts +++ b/Sources/Common/DataModel/DataSetAttributes/index.d.ts @@ -1,443 +1,442 @@ -import { vtkObject } from "../../../interfaces" ; +import { vtkObject } from '../../../interfaces'; import { IFieldDataInitialValues, vtkFieldData } from './FieldData'; import vtkDataArray from '../../Core/DataArray'; export enum AttributeTypes { - SCALARS, - VECTORS, - NORMALS, - TCOORDS, - TENSORS, - GLOBALIDS, - PEDIGREEIDS, - EDGEFLAG, - NUM_ATTRIBUTES, + SCALARS, + VECTORS, + NORMALS, + TCOORDS, + TENSORS, + GLOBALIDS, + PEDIGREEIDS, + EDGEFLAG, + NUM_ATTRIBUTES, } export enum AttributeLimitTypes { - MAX, - EXACT, - NOLIMIT, + MAX, + EXACT, + NOLIMIT, } export enum CellGhostTypes { - /** - * The cell is present on multiple processors - */ - DUPLICATECELL, - /** - * The cell has more neighbors than in a regular mesh - */ - HIGHCONNECTIVITYCELL, - /** - * The cell has less neighbors than in a regular mesh - */ - LOWCONNECTIVITYCELL, - /** - * Tther cells are present that refines it. - */ - REFINEDCELL, - /** - * The cell is on the exterior of the data set - */ - EXTERIORCELL, - /** - * The cell is needed to maintain connectivity, but the data values should be ignored. - */ - HIDDENCELL, + /** + * The cell is present on multiple processors + */ + DUPLICATECELL, + /** + * The cell has more neighbors than in a regular mesh + */ + HIGHCONNECTIVITYCELL, + /** + * The cell has less neighbors than in a regular mesh + */ + LOWCONNECTIVITYCELL, + /** + * Tther cells are present that refines it. + */ + REFINEDCELL, + /** + * The cell is on the exterior of the data set + */ + EXTERIORCELL, + /** + * The cell is needed to maintain connectivity, but the data values should be ignored. + */ + HIDDENCELL, } export enum PointGhostTypes { - /** - * The cell is present on multiple processors - */ - DUPLICATEPOINT, - /** - * The point is needed to maintain connectivity, but the data values should be ignored. - */ - HIDDENPOINT + /** + * The cell is present on multiple processors + */ + DUPLICATEPOINT, + /** + * The point is needed to maintain connectivity, but the data values should be ignored. + */ + HIDDENPOINT, } export enum AttributeCopyOperations { - COPYTUPLE, - INTERPOLATE, - PASSDATA, - /** - * All of the above - */ - ALLCOPY, + COPYTUPLE, + INTERPOLATE, + PASSDATA, + /** + * All of the above + */ + ALLCOPY, } export const ghostArrayName: string; export enum DesiredOutputPrecision { - /** - * Use the point type that does not truncate any data - */ - DEFAULT, - /** - * Use Float32Array - */ - SINGLE, - /** - * Use Float64Array - */ - DOUBLE, + /** + * Use the point type that does not truncate any data + */ + DEFAULT, + /** + * Use Float32Array + */ + SINGLE, + /** + * Use Float64Array + */ + DOUBLE, } /** * */ -export interface IDataSetAttributesInitialValues extends IFieldDataInitialValues { - activeScalars?: number; - activeVectors?: number; - activeTensors?: number; - activeNormals?: number; - activeTCoords?: number; - activeGlobalIds?: number; - activePedigreeIds?: number; +export interface IDataSetAttributesInitialValues + extends IFieldDataInitialValues { + activeScalars?: number; + activeVectors?: number; + activeTensors?: number; + activeNormals?: number; + activeTCoords?: number; + activeGlobalIds?: number; + activePedigreeIds?: number; } export interface vtkDataSetAttributes extends vtkFieldData { - - /** - * @todo No yet Implemented - * @param x - */ - checkNumberOfComponents(x: any): boolean; - - /** - * - * @param {string} attType - */ - getActiveAttribute(attType: string): any; - - /** - * Get a list of attribute names that the given array - * is for this vtkDataSetAttributes. - * @param {vtkDataArray} arr - * @returns {String[]} - */ - getAttributes(arr: vtkDataArray): string[]; - - /** - * - */ - getActiveScalars(): number; - - /** - * - */ - getActiveVectors(): number; - - /** - * - */ - getActiveTensors(): number; - - /** - * - */ - getActiveNormals(): number; - - /** - * - */ - getActiveTCoords(): number; - - /** - * - */ - getActiveGlobalIds(): number; - - /** - * - */ - getActivePedigreeIds(): number; - - /** - * Get the scalar data. - */ - getScalars(): vtkDataArray; - - /** - * Get the vectors data. - */ - getVectors(): vtkDataArray; - - /** - * Get the normal data. - */ - getNormals(): vtkDataArray; - - /** - * Get the texture coordinate data. - */ - getTCoords(): vtkDataArray; - - /** - * Get the tensors data. - */ - getTensors(): vtkDataArray; - - /** - * Get the global id data. - */ - getGlobalIds(): vtkDataArray; - - /** - * Get the pedigree id data. - */ - getPedigreeIds(): vtkDataArray; - - /** - * - * @param arr - * @param uncleanAttType - */ - setAttribute(arr: any, uncleanAttType: string): number; - - /** - * - * @param {string} arrayName - * @param attType - */ - setActiveAttributeByName(arrayName: string, attType: any): number; - - /** - * - * @param {Number} arrayIdx - * @param uncleanAttType - */ - setActiveAttributeByIndex(arrayIdx: number, uncleanAttType: string): number; - - /** - * Override to allow proper handling of active attributes - */ - removeAllArrays(): void; - - /** - * Override to allow proper handling of active attributes - * @param {string} arrayName The name of the array. - */ - removeArray(arrayName: string): void; - - /** - * Override to allow proper handling of active attributes - * @param {Number} arrayIdx The index of the array. - */ - removeArrayByIndex(arrayIdx: number): void; - - /** - * - */ - initializeAttributeCopyFlags(): void; - - /** - * - * @param {Number} activeScalars - */ - setActiveScalars(activeScalars: number): boolean; - - /** - * - * @param {Number} activeVectors - */ - setActiveVectors(activeVectors: number): boolean; - - /** - * - * @param {Number} activeTensors - */ - setActiveTensors(activeTensors: number): boolean; - - /** - * - * @param {Number} activeNormals - */ - setActiveNormals(activeNormals: number): boolean; - - /** - * - * @param {Number} activeTCoords - */ - setActiveTCoords(activeTCoords: number): boolean; - - /** - * - * @param {Number} activeGlobalIds - */ - setActiveGlobalIds(activeGlobalIds: number): boolean; - - /** - * - * @param {Number} activePedigreeIds - */ - setActivePedigreeIds(activePedigreeIds: number): boolean; - - /** - * Try to copy the state of the other to ourselves by just using references. - * - * @param other instance to copy the reference from - * @param debug (default: false) if true feedback will be provided when mismatch happen - * @override - */ - shallowCopy(other: vtkObject, debug?: boolean): void; - - /** - * - * @param {string} arrayName The name of the array to activate. - */ - setActiveScalars(arrayName: string): boolean; - - /** - * - * @param {string} arrayName The name of the array to activate. - */ - setActiveVectors(arrayName: string): boolean; - - /** - * - * @param {string} arrayName The name of the array to activate. - */ - setActiveNormals(arrayName: string): boolean; - - /** - * - * @param {string} arrayName The name of the array to activate. - */ - setActiveTCoords(arrayName: string): boolean; - - /** - * - * @param {string} arrayName The name of the array to activate. - */ - setActiveTensors(arrayName: string): boolean; - - /** - * - * @param {string} arrayName The name of the array to activate. - */ - setActiveGlobalIds(arrayName: string): boolean; - - /** - * - * @param {string} arrayName The name of the array to activate. - */ - setActivePedigreeIds(arrayName: string): boolean; - - /** - * Set the scalar data. - * @param {vtkDataArray} scalars The scalar data. - */ - setScalars(scalars: vtkDataArray): boolean; - - /** - * Set the vector data. - * @param {vtkDataArray} vectors The vector data. - */ - setVectors(vectors: vtkDataArray): boolean; - - /** - * Set the normal data. - * @param {vtkDataArray} normals The normal data. - */ - setNormals(normals: vtkDataArray): boolean; - - /** - * Set the texture coordinate data. - * @param {vtkDataArray} tcoords The texture coordinate data. - */ - setTCoords(tcoords: vtkDataArray): boolean; - - /** - * Set the tensor data. - * @param {vtkDataArray} tensors The tensor data. - */ - setTensors(tensors: vtkDataArray): boolean; - - /** - * Set the global id data. - * @param {vtkDataArray} globalIds The global id data. - */ - setGlobalIds(globalIds: vtkDataArray): boolean; - - /** - * Set the pedigree id data. - * @param {vtkDataArray} pedigreeids The pedigree id data. - */ - setPedigreeIds(pedigreeIds: vtkDataArray): boolean; - - /** - * - */ - copyScalarsOn(): void; - - /** - * - */ - copyVectorsOn(): void; - - /** - * - */ - copyNormalsOn(): void; - - /** - * - */ - copyTCoordsOn(): void; - - /** - * - */ - copyTensorsOn(): void; - - /** - * - */ - copyGlobalIdsOn(): void; - - /** - * - */ - copyPedigreeIdsOn(): void; - - /** - * - */ - copyScalarsOff(): void; - - /** - * - */ - copyVectorsOff(): void; - - /** - * - */ - copyNormalsOff(): void; - - /** - * - */ - copyTCoordsOff(): void; - - /** - * - */ - copyTensorsOff(): void; - - /** - * - */ - copyGlobalIdsOff(): void; - - /** - * - */ - copyPedigreeIdsOff(): void; - + /** + * @todo No yet Implemented + * @param x + */ + checkNumberOfComponents(x: any): boolean; + + /** + * + * @param {string} attType + */ + getActiveAttribute(attType: string): any; + + /** + * Get a list of attribute names that the given array + * is for this vtkDataSetAttributes. + * @param {vtkDataArray} arr + * @returns {String[]} + */ + getAttributes(arr: vtkDataArray): string[]; + + /** + * + */ + getActiveScalars(): number; + + /** + * + */ + getActiveVectors(): number; + + /** + * + */ + getActiveTensors(): number; + + /** + * + */ + getActiveNormals(): number; + + /** + * + */ + getActiveTCoords(): number; + + /** + * + */ + getActiveGlobalIds(): number; + + /** + * + */ + getActivePedigreeIds(): number; + + /** + * Get the scalar data. + */ + getScalars(): vtkDataArray; + + /** + * Get the vectors data. + */ + getVectors(): vtkDataArray; + + /** + * Get the normal data. + */ + getNormals(): vtkDataArray; + + /** + * Get the texture coordinate data. + */ + getTCoords(): vtkDataArray; + + /** + * Get the tensors data. + */ + getTensors(): vtkDataArray; + + /** + * Get the global id data. + */ + getGlobalIds(): vtkDataArray; + + /** + * Get the pedigree id data. + */ + getPedigreeIds(): vtkDataArray; + + /** + * + * @param arr + * @param uncleanAttType + */ + setAttribute(arr: any, uncleanAttType: string): number; + + /** + * + * @param {string} arrayName + * @param attType + */ + setActiveAttributeByName(arrayName: string, attType: any): number; + + /** + * + * @param {Number} arrayIdx + * @param uncleanAttType + */ + setActiveAttributeByIndex(arrayIdx: number, uncleanAttType: string): number; + + /** + * Override to allow proper handling of active attributes + */ + removeAllArrays(): void; + + /** + * Override to allow proper handling of active attributes + * @param {string} arrayName The name of the array. + */ + removeArray(arrayName: string): void; + + /** + * Override to allow proper handling of active attributes + * @param {Number} arrayIdx The index of the array. + */ + removeArrayByIndex(arrayIdx: number): void; + + /** + * + */ + initializeAttributeCopyFlags(): void; + + /** + * + * @param {Number} activeScalars + */ + setActiveScalars(activeScalars: number): boolean; + + /** + * + * @param {Number} activeVectors + */ + setActiveVectors(activeVectors: number): boolean; + + /** + * + * @param {Number} activeTensors + */ + setActiveTensors(activeTensors: number): boolean; + + /** + * + * @param {Number} activeNormals + */ + setActiveNormals(activeNormals: number): boolean; + + /** + * + * @param {Number} activeTCoords + */ + setActiveTCoords(activeTCoords: number): boolean; + + /** + * + * @param {Number} activeGlobalIds + */ + setActiveGlobalIds(activeGlobalIds: number): boolean; + + /** + * + * @param {Number} activePedigreeIds + */ + setActivePedigreeIds(activePedigreeIds: number): boolean; + + /** + * Try to copy the state of the other to ourselves by just using references. + * + * @param other instance to copy the reference from + * @param debug (default: false) if true feedback will be provided when mismatch happen + * @override + */ + shallowCopy(other: vtkObject, debug?: boolean): void; + + /** + * + * @param {string} arrayName The name of the array to activate. + */ + setActiveScalars(arrayName: string): boolean; + + /** + * + * @param {string} arrayName The name of the array to activate. + */ + setActiveVectors(arrayName: string): boolean; + + /** + * + * @param {string} arrayName The name of the array to activate. + */ + setActiveNormals(arrayName: string): boolean; + + /** + * + * @param {string} arrayName The name of the array to activate. + */ + setActiveTCoords(arrayName: string): boolean; + + /** + * + * @param {string} arrayName The name of the array to activate. + */ + setActiveTensors(arrayName: string): boolean; + + /** + * + * @param {string} arrayName The name of the array to activate. + */ + setActiveGlobalIds(arrayName: string): boolean; + + /** + * + * @param {string} arrayName The name of the array to activate. + */ + setActivePedigreeIds(arrayName: string): boolean; + + /** + * Set the scalar data. + * @param {vtkDataArray} scalars The scalar data. + */ + setScalars(scalars: vtkDataArray): boolean; + + /** + * Set the vector data. + * @param {vtkDataArray} vectors The vector data. + */ + setVectors(vectors: vtkDataArray): boolean; + + /** + * Set the normal data. + * @param {vtkDataArray} normals The normal data. + */ + setNormals(normals: vtkDataArray): boolean; + + /** + * Set the texture coordinate data. + * @param {vtkDataArray} tcoords The texture coordinate data. + */ + setTCoords(tcoords: vtkDataArray): boolean; + + /** + * Set the tensor data. + * @param {vtkDataArray} tensors The tensor data. + */ + setTensors(tensors: vtkDataArray): boolean; + + /** + * Set the global id data. + * @param {vtkDataArray} globalIds The global id data. + */ + setGlobalIds(globalIds: vtkDataArray): boolean; + + /** + * Set the pedigree id data. + * @param {vtkDataArray} pedigreeids The pedigree id data. + */ + setPedigreeIds(pedigreeIds: vtkDataArray): boolean; + + /** + * + */ + copyScalarsOn(): void; + + /** + * + */ + copyVectorsOn(): void; + + /** + * + */ + copyNormalsOn(): void; + + /** + * + */ + copyTCoordsOn(): void; + + /** + * + */ + copyTensorsOn(): void; + + /** + * + */ + copyGlobalIdsOn(): void; + + /** + * + */ + copyPedigreeIdsOn(): void; + + /** + * + */ + copyScalarsOff(): void; + + /** + * + */ + copyVectorsOff(): void; + + /** + * + */ + copyNormalsOff(): void; + + /** + * + */ + copyTCoordsOff(): void; + + /** + * + */ + copyTensorsOff(): void; + + /** + * + */ + copyGlobalIdsOff(): void; + + /** + * + */ + copyPedigreeIdsOff(): void; } /** @@ -447,13 +446,19 @@ export interface vtkDataSetAttributes extends vtkFieldData { * @param model object on which data structure will be bounds (protected) * @param {IDataSetAttributesInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IDataSetAttributesInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IDataSetAttributesInitialValues +): void; /** * Method used to create a new instance of vtkDataSetAttributes. * @param {IDataSetAttributesInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IDataSetAttributesInitialValues): vtkDataSetAttributes; +export function newInstance( + initialValues?: IDataSetAttributesInitialValues +): vtkDataSetAttributes; /** * vtkDataSetAttributes is a class that is used to represent and manipulate @@ -481,7 +486,7 @@ export function newInstance(initialValues?: IDataSetAttributesInitialValues): vt * destination, for only those attributes that are held by all. */ export declare const vtkDataSetAttributes: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkDataSetAttributes; diff --git a/Sources/Common/DataModel/EdgeLocator/index.d.ts b/Sources/Common/DataModel/EdgeLocator/index.d.ts index f35fefed3ba..71d87b83891 100644 --- a/Sources/Common/DataModel/EdgeLocator/index.d.ts +++ b/Sources/Common/DataModel/EdgeLocator/index.d.ts @@ -1,79 +1,82 @@ -import { Nullable } from "../../../types"; - -/** - * - */ -export interface IEdgeLocatorInitialValues { - oriented?: boolean; -} - -export interface IEdge { - key: number; - edgeId: number; - value?: T; -} - -export interface vtkEdgeLocator { - /** - * Remove all the edges previously added. - */ - initialize(): void; - - /** - * Returns the inserted edge or null if no edge was inserted. - * @param {Number} pointId0 Edge first point id - * @param {Number} pointId1 Edge last point id - * @return {IEdge|null} an edge object ({ key, edgeId, value }) or null - */ - isInsertedEdge(pointId0: number, pointId1: number): Nullable>; - - /** - * Insert edge if it does not already exist. - * Returns the existing or newly inserted edge. - * - * @param {Number} pointId0 Edge first point id - * @param {Number} pointId1 Edge last point id - * @param {unknown} value Optional value option - * @return {IEdge|null} an edge object ({ key, edgeId, value }) or null - * @see insertEdge() - * @see isInsertedEdge() - */ - insertUniqueEdge(pointId0: number, pointId1: number, value?: T): IEdge; - - /** - * Insert edge. If the edge already exists, it is overwritten by this - * new edge. You may verify that the edge did not previously exist with - * `isInsertedEdge()`. - * Returns the newly inserted edge. - * @param {Number} pointId0 Edge first point id - * @param {Number} pointId1 Edge last point id - * @param {unknown} value Optional value option - * @return {Edge|null} an edge object ({ key, edgeId, value }) or null - * @see isInsertedEdge - * @see insertUniqueEdge - */ - insertEdge(pointId0: number, pointId1: number, value?: T): IEdge; -} - -// ---------------------------------------------------------------------------- -// Static API -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- - -/** - * Method use to create a new instance of vtkEdgeLocator - * @param {IEdgeLocatorInitialValues} [initialValues] for pre-setting some of its content - */ -export function newInstance( - initialValues?: IEdgeLocatorInitialValues -): vtkEdgeLocator; - -/** - * vtkEdgeLocator - */ -export declare const vtkEdgeLocator: { - newInstance: typeof newInstance; -}; - -export default vtkEdgeLocator; +import { Nullable } from '../../../types'; + +/** + * + */ +export interface IEdgeLocatorInitialValues { + oriented?: boolean; +} + +export interface IEdge { + key: number; + edgeId: number; + value?: T; +} + +export interface vtkEdgeLocator { + /** + * Remove all the edges previously added. + */ + initialize(): void; + + /** + * Returns the inserted edge or null if no edge was inserted. + * @param {Number} pointId0 Edge first point id + * @param {Number} pointId1 Edge last point id + * @return {IEdge|null} an edge object ({ key, edgeId, value }) or null + */ + isInsertedEdge( + pointId0: number, + pointId1: number + ): Nullable>; + + /** + * Insert edge if it does not already exist. + * Returns the existing or newly inserted edge. + * + * @param {Number} pointId0 Edge first point id + * @param {Number} pointId1 Edge last point id + * @param {unknown} value Optional value option + * @return {IEdge|null} an edge object ({ key, edgeId, value }) or null + * @see insertEdge() + * @see isInsertedEdge() + */ + insertUniqueEdge(pointId0: number, pointId1: number, value?: T): IEdge; + + /** + * Insert edge. If the edge already exists, it is overwritten by this + * new edge. You may verify that the edge did not previously exist with + * `isInsertedEdge()`. + * Returns the newly inserted edge. + * @param {Number} pointId0 Edge first point id + * @param {Number} pointId1 Edge last point id + * @param {unknown} value Optional value option + * @return {Edge|null} an edge object ({ key, edgeId, value }) or null + * @see isInsertedEdge + * @see insertUniqueEdge + */ + insertEdge(pointId0: number, pointId1: number, value?: T): IEdge; +} + +// ---------------------------------------------------------------------------- +// Static API +// ---------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------- + +/** + * Method use to create a new instance of vtkEdgeLocator + * @param {IEdgeLocatorInitialValues} [initialValues] for pre-setting some of its content + */ +export function newInstance( + initialValues?: IEdgeLocatorInitialValues +): vtkEdgeLocator; + +/** + * vtkEdgeLocator + */ +export declare const vtkEdgeLocator: { + newInstance: typeof newInstance; +}; + +export default vtkEdgeLocator; diff --git a/Sources/Common/DataModel/ITKHelper/index.d.ts b/Sources/Common/DataModel/ITKHelper/index.d.ts index 63357b2ef68..2a3ea6d93f3 100644 --- a/Sources/Common/DataModel/ITKHelper/index.d.ts +++ b/Sources/Common/DataModel/ITKHelper/index.d.ts @@ -1,54 +1,65 @@ -import vtkPolyData from "../PolyData"; -import vtkImageData from "../ImageData"; +import vtkPolyData from '../PolyData'; +import vtkImageData from '../ImageData'; export interface IOptions { - pointDataName?: string; - scalarArrayName?: string; - cellDataName?: string; + pointDataName?: string; + scalarArrayName?: string; + cellDataName?: string; } /** * Converts an itk-wasm Image to a vtk.js vtkImageData. * Requires an itk-wasm Image as input. - * @param itkImage - * @param {IOptions} [options] + * @param itkImage + * @param {IOptions} [options] */ -export function convertItkToVtkImage(itkImage: any, options?: IOptions): vtkImageData; +export function convertItkToVtkImage( + itkImage: any, + options?: IOptions +): vtkImageData; /** * Converts a vtk.js vtkImageData to an itk-wasm Image. * Requires a vtk.js vtkImageData as input. - * @param {vtkImageData} vtkImage - * @param {IOptions} [options] + * @param {vtkImageData} vtkImage + * @param {IOptions} [options] */ -export function convertVtkToItkImage(vtkImage: vtkImageData, options?: IOptions): any; +export function convertVtkToItkImage( + vtkImage: vtkImageData, + options?: IOptions +): any; /** * Converts an itk-wasm PolyData to a vtk.js vtkPolyData. * Requires an itk-wasm PolyData as input. - * @param itkPolyData - * @param {IOptions} [options] + * @param itkPolyData + * @param {IOptions} [options] */ -export function convertItkToVtkPolyData(itkPolyData: any, options?: IOptions): vtkPolyData; +export function convertItkToVtkPolyData( + itkPolyData: any, + options?: IOptions +): vtkPolyData; /** * Converts a vtk.js vtkPolyData to an itk-wasm PolyData. * Requires a vtk.js vtkPolyData as input. - * - * @param {vtkPolyData} polyData - * @param {IOptions} [options] + * + * @param {vtkPolyData} polyData + * @param {IOptions} [options] */ -export function convertVtkToItkPolyData(polyData: vtkPolyData, options?: IOptions): any; +export function convertVtkToItkPolyData( + polyData: vtkPolyData, + options?: IOptions +): any; - -/** +/** * vtkITKHelper is a helper which provides a set of functions to work with * itk-wasm module. */ export declare const vtkITKHelper: { - convertItkToVtkImage: typeof convertItkToVtkImage, - convertVtkToItkImage: typeof convertVtkToItkImage, - convertItkToVtkPolyData: typeof convertItkToVtkPolyData, - convertVtkToItkPolyData: typeof convertVtkToItkPolyData, + convertItkToVtkImage: typeof convertItkToVtkImage; + convertVtkToItkImage: typeof convertVtkToItkImage; + convertItkToVtkPolyData: typeof convertItkToVtkPolyData; + convertVtkToItkPolyData: typeof convertVtkToItkPolyData; }; export default vtkITKHelper; diff --git a/Sources/Common/DataModel/ImageData/index.d.ts b/Sources/Common/DataModel/ImageData/index.d.ts index 5128123ff81..50d974bb9bf 100755 --- a/Sources/Common/DataModel/ImageData/index.d.ts +++ b/Sources/Common/DataModel/ImageData/index.d.ts @@ -6,348 +6,364 @@ import vtkDataSet, { IDataSetInitialValues } from '../DataSet'; * */ export interface IImageDataInitialValues extends IDataSetInitialValues { - spacing?: number[]; - origin?: number[]; - extent?: number[]; + spacing?: number[]; + origin?: number[]; + extent?: number[]; } interface IComputeHistogram { - minimum: number; - maximum: number; - average: number; - variance: number; - sigma: number; + minimum: number; + maximum: number; + average: number; + variance: number; + sigma: number; } export interface vtkImageData extends vtkDataSet { - - /** - * Returns an object with `{ minimum, maximum, average, variance, sigma, count }` - * of the imageData points found within the provided `worldBounds`. - * - * `voxelFunc(index, bounds)` is an optional function that is called with - * the `[i,j,k]` index and index `bounds`, expected to return truthy if the - * data point should be counted in the histogram, and falsey if not. - * @param {Bounds} worldBounds The bounds of the world. - * @param [voxelFunc] - */ - computeHistogram(worldBounds: Bounds, voxelFunc?: any): IComputeHistogram; - - /** - * Returns an `array[3]` of values to multiply an `[i,j,k]` index to convert - * into the actual data array index, from the provided extent. - * `numberOfComponents` should match the Scalar components. - * @internal - * @param {Extent} extent - * @param {Number} [numberOfComponents] - */ - computeIncrements(extent: Extent, numberOfComponents?: number): number[] - - /** - * Converts an `[i,j,k]` index to the flat data array index. Returns `NaN` - * if any of the i,j,k bounds are outside the data Extent. - * @internal - * @param {Vector3} ijk The localized `[i,j,k]` pixel array position. Float values will be rounded. - * @return {Number} the corresponding flattened index in the scalar array - */ - computeOffsetIndex(ijk: Vector3): number; - - /** - * Calculates the `indexToWorld` and `worldToIndex` conversion matrices from - * the origin, direction, and spacing. Shouldn't need to call this as it is - * handled internally, and updated whenever the vtkImageData is modified. - * @internal - */ - computeTransforms(): void; - - /** - * Returns a bounds array from a given Extent, useful if you need to - * calculate the world bounds of a subset of the imageData's data. - * @internal - * @param {Extent} ex - */ - extentToBounds(ex: Extent): Bounds; - - /** - * Get image extents without translation (i.e. with origin set to [0,0,0]) and under unit spacing - * (i.e. spacing = [1, 1, 1]). - * This includes a padding of 0.5 pixel/voxel in each principal direction. - * The padding is necessary for conventional images (textures, png, bmp) - * as well as medical images and volumes, since each pixel/voxel has a pre-defined width - * (based on specified spacing) including the ones on the boundary of the image. - * @internal - */ - getSpatialExtent(): Extent; - - /** - * Returns the axis-aligned bounds of vtkImageData in world coordinates. - * The axis-aligned Bounds of a vtkImage are returned as pairs of world coordinates - * ```[x_min, x_max, y_min, y_max, z_min, z_max]``` these are calculated - * from the Extent, Origin, and Spacing, defined - * through - * ```js - * [ - * (i_min - 0.5)*Spacing[0] + Origin[0], (i_max + 0.5)*Spacing[0] + Origin[0], - * (j_min - 0.5)*Spacing[1] + Origin[1], (j_max + 0.5)*Spacing[1] + Origin[1], - * (k_min - 0.5)*Spacing[2] + Origin[2], (k_max + 0.5)*Spacing[2] + Origin[2] - * ]; - * ``` - * Note that this includes a padding of 0.5 voxel spacing in each principal direction, - * as well as any orientation of the image. - * You can't directly set the bounds. First you need to decide how many - * pixels across your image will be (i.e. what the extent should be), and - * then you must find the origin and spacing that will produce the bounds - * that you need from the extent that you have. This is simple algebra. In - * general, always set the extent to start at zero, e.g. `[0, 9, 0, 9, 0, - * 9]` for a 10x10x10 image. Calling `setDimensions(10,10,10)` does exactly - * the same thing as `setExtent(0,9,0,9,0,9)` but you should always do the - * latter to be explicit about where your extent starts. - * Such an image of dimensions [10, 10, 10], origin [0, 0, 0] and voxel-spacing of 1.0, - * will result in bounds equal to [-0.5, 9.5, -0.5, 9.5, -0.5, 9.5]. - * @return {Bounds} The bounds for the mapper. - */ - getBounds(): Bounds; - - /** - * Get the `[x,y,z]` location of the center of the imageData. - */ - getCenter(): Vector3; - - /** - * Get dimensions of this structured points dataset. It is the number of - * points on each axis. Dimensions are computed from Extents during this - * call. - */ - getDimensions(): Vector3; - - /** - * Direction is a `mat3` matrix corresponding to the axes directions in - * world coordinates for the I, J, K axes of the image. Direction must form - * an orthonormal basis. - */ - getDirection(): mat3; - - /** - * The maximal extent of the projection. - * @default [0, -1, 0, -1, 0, -1] - */ - getExtent(): Extent; - - /** - * - * @default [0, -1, 0, -1, 0, -1] - */ - getExtentByReference(): Extent; - - /** - * Returns the data array index for the point at the provided world position. - * @param {Vector3} xyz The [x,y,z] array in world coordinates. - * @return {number} the corresponding pixel's index in the scalar array. - */ - getOffsetIndexFromWorld(xyz: Vector3): number; - - /** - * - */ - getNumberOfCells(): number; - - /** - * Get the number of points composing the dataset. - */ - getNumberOfPoints(): number; - - /** - * Get the world position of a data point. Index is the point's index in the - * 1D data array. - * @param {Number} index - */ - getPoint(index: number): Vector3; - - /** - * Get the origin of the dataset. The origin is the position in world - * coordinates of the point of extent (0,0,0). This point does not have to - * be part of the dataset, in other words, the dataset extent does not have - * to start at (0,0,0) and the origin can be outside of the dataset bounding - * box. The origin plus spacing determine the position in space of the - * points. - */ - getOrigin(): Vector3; - - /** - * Get the origin of the dataset. The origin is the position in world - */ - getOriginByReference(): Vector3; - - /** - * Returns the scalar value for the point at the provided world position, or - * `NaN` if the world bounds are outside the volumeData bounds. `comp` is - * the scalar component index, for multi-component scalar data. - * @param {Vector3} xyz The [x,y,z] array in world coordinates. - * @param {Number} [comp] The scalar component index for multi-component scalars. - * @return {number|NaN} The corresponding pixel's scalar value. - */ - getScalarValueFromWorld(xyz: Vector3, comp?: number): number; - - /** - * Set the spacing [width, height, length] of the cubical cells that compose - * the data set. - */ - getSpacing(): Vector3; - - /** - * - */ - getSpacingByReference(): Vector3; - - /** - * Returns the `mat4` matrices used to convert between world and index. - * `worldToIndex` is the inverse matrix of `indexToWorld`. Both are made - * with `Float64Array`. - */ - getIndexToWorld(): mat4; - - /** - * Returns the `mat4` matrices used to convert between world and index. - * `worldToIndex` is the inverse matrix of `indexToWorld`. Both are made - * with `Float64Array`. - */ - getWorldToIndex(): mat4; - - /** - * this is the fast version, requires vec3 arguments - * @param {ReadonlyVec3} vin - * @param {vec3} [vout] - */ - indexToWorldVec3(vin: ReadonlyVec3, vout?: vec3): vec3; - - /** - * Converts the input index vector `[i,j,k]` to world values `[x,y,z]`. - * If an out vector is not provided, a new one is created. If provided, it - * modifies the out vector array in place, but also returns it. - * @param {ReadonlyVec3} ain - * @param {vec3} [aout] - */ - indexToWorld(ain: ReadonlyVec3, aout?: vec3): vec3; - - /** - * Calculate the corresponding world bounds for the given index bounds - * `[i_min, i_max, j_min, j_max, k_min, k_max]`. Modifies `out` in place if - * provided, or returns a new array. Returned bounds are NOT padded based - * on voxel spacing (see getBounds). The output is merely a bounding box - * calculated considering voxels as grid points. - * @param {Bounds} bin - * @param {Bounds} [bout] - */ - indexToWorldBounds(bin: Bounds, bout?: Bounds): Bounds; - - /** - * Set the values of the extent, from `0` to `(i-1)`, etc. - * @param dims - */ - setDimensions(dims: number[]): void; - - /** - * Set the values of the extent, from `0` to `(i-1)`, etc. - * @param {Number} i - * @param {Number} j - * @param {Number} k - */ - setDimensions(i: number, j: number, k: number): void; - - /** - * The direction matrix is a 3x3 basis for the I, J, K axes - * of the image. The rows of the matrix correspond to the - * axes directions in world coordinates. Direction must - * form an orthonormal basis, results are undefined if - * it is not. - * @param {mat3} direction - */ - setDirection(direction: mat3): boolean; - - /** - * The direction matrix is a 3x3 basis for the I, J, K axes - * of the image. The rows of the matrix correspond to the - * axes directions in world coordinates. Direction must - * form an orthonormal basis, results are undefined if - * it is not. - * @param e00 - * @param e01 - * @param e02 - * @param e10 - * @param e11 - * @param e12 - * @param e20 - * @param e21 - * @param e22 - */ - setDirection(e00: number, e01: number, e02: number, e10: number, e11: number, e12: number, e20: number, e21: number, e22: number): boolean; - - /** - * Set the extent. - * @param {Extent} extent - */ - setExtent(extent: Extent): boolean; - - /** - * - * @param {Number} x1 The x coordinate of the first point. - * @param {Number} x2 The x coordinate of the second point. - * @param {Number} y1 The y coordinate of the first point. - * @param {Number} y2 The y coordinate of the second point. - * @param {Number} z1 The z coordinate of the first point. - * @param {Number} z2 The z coordinate of the second point. - */ - setExtent(x1: number, x2: number, y1: number, y2: number, z1: number, z2: number): void; - - /** - * Set the origin of the image. - * @param {Vector3} origin The coordinate of the origin point. - */ - setOrigin(origin: Vector3): boolean; - - /** - * Set the origin of the image. - * @param {Vector3} origin The coordinate of the origin point. - */ - setOriginFrom(origin: Vector3): boolean; - - /** - * - * @param spacing - */ - setSpacing(spacing: number[]): boolean; - - /** - * - * @param spacing - */ - setSpacingFrom(spacing: number[]): boolean; - - /** - * this is the fast version, requires vec3 arguments - * @param vin - * @param [vout] - */ - worldToIndexVec3(vin: ReadonlyVec3, vout?: vec3): vec3; - - /** - * Converts the input world vector `[x,y,z]` to approximate index values - * `[i,j,k]`. Should be rounded to integers before attempting to access the - * index. If an out vector is not provided, a new one is created. If provided, it - * modifies the out vector array in place, but also returns it. - * @param ain - * @param [aout] - */ - worldToIndex(ain: ReadonlyVec3, aout?: vec3): vec3; - - /** - * Calculate the corresponding index bounds for the given world bounds - * `[x_min, x_max, y_min, y_max, z_min, z_max]`. Modifies `out` in place if - * provided, or returns a new array. - * @param {Bounds} bin - * @param {Bounds} [bout] - */ - worldToIndexBounds(bin: Bounds, bout?: Bounds): number[]; + /** + * Returns an object with `{ minimum, maximum, average, variance, sigma, count }` + * of the imageData points found within the provided `worldBounds`. + * + * `voxelFunc(index, bounds)` is an optional function that is called with + * the `[i,j,k]` index and index `bounds`, expected to return truthy if the + * data point should be counted in the histogram, and falsey if not. + * @param {Bounds} worldBounds The bounds of the world. + * @param [voxelFunc] + */ + computeHistogram(worldBounds: Bounds, voxelFunc?: any): IComputeHistogram; + + /** + * Returns an `array[3]` of values to multiply an `[i,j,k]` index to convert + * into the actual data array index, from the provided extent. + * `numberOfComponents` should match the Scalar components. + * @internal + * @param {Extent} extent + * @param {Number} [numberOfComponents] + */ + computeIncrements(extent: Extent, numberOfComponents?: number): number[]; + + /** + * Converts an `[i,j,k]` index to the flat data array index. Returns `NaN` + * if any of the i,j,k bounds are outside the data Extent. + * @internal + * @param {Vector3} ijk The localized `[i,j,k]` pixel array position. Float values will be rounded. + * @return {Number} the corresponding flattened index in the scalar array + */ + computeOffsetIndex(ijk: Vector3): number; + + /** + * Calculates the `indexToWorld` and `worldToIndex` conversion matrices from + * the origin, direction, and spacing. Shouldn't need to call this as it is + * handled internally, and updated whenever the vtkImageData is modified. + * @internal + */ + computeTransforms(): void; + + /** + * Returns a bounds array from a given Extent, useful if you need to + * calculate the world bounds of a subset of the imageData's data. + * @internal + * @param {Extent} ex + */ + extentToBounds(ex: Extent): Bounds; + + /** + * Get image extents without translation (i.e. with origin set to [0,0,0]) and under unit spacing + * (i.e. spacing = [1, 1, 1]). + * This includes a padding of 0.5 pixel/voxel in each principal direction. + * The padding is necessary for conventional images (textures, png, bmp) + * as well as medical images and volumes, since each pixel/voxel has a pre-defined width + * (based on specified spacing) including the ones on the boundary of the image. + * @internal + */ + getSpatialExtent(): Extent; + + /** + * Returns the axis-aligned bounds of vtkImageData in world coordinates. + * The axis-aligned Bounds of a vtkImage are returned as pairs of world coordinates + * ```[x_min, x_max, y_min, y_max, z_min, z_max]``` these are calculated + * from the Extent, Origin, and Spacing, defined + * through + * ```js + * [ + * (i_min - 0.5)*Spacing[0] + Origin[0], (i_max + 0.5)*Spacing[0] + Origin[0], + * (j_min - 0.5)*Spacing[1] + Origin[1], (j_max + 0.5)*Spacing[1] + Origin[1], + * (k_min - 0.5)*Spacing[2] + Origin[2], (k_max + 0.5)*Spacing[2] + Origin[2] + * ]; + * ``` + * Note that this includes a padding of 0.5 voxel spacing in each principal direction, + * as well as any orientation of the image. + * You can't directly set the bounds. First you need to decide how many + * pixels across your image will be (i.e. what the extent should be), and + * then you must find the origin and spacing that will produce the bounds + * that you need from the extent that you have. This is simple algebra. In + * general, always set the extent to start at zero, e.g. `[0, 9, 0, 9, 0, + * 9]` for a 10x10x10 image. Calling `setDimensions(10,10,10)` does exactly + * the same thing as `setExtent(0,9,0,9,0,9)` but you should always do the + * latter to be explicit about where your extent starts. + * Such an image of dimensions [10, 10, 10], origin [0, 0, 0] and voxel-spacing of 1.0, + * will result in bounds equal to [-0.5, 9.5, -0.5, 9.5, -0.5, 9.5]. + * @return {Bounds} The bounds for the mapper. + */ + getBounds(): Bounds; + + /** + * Get the `[x,y,z]` location of the center of the imageData. + */ + getCenter(): Vector3; + + /** + * Get dimensions of this structured points dataset. It is the number of + * points on each axis. Dimensions are computed from Extents during this + * call. + */ + getDimensions(): Vector3; + + /** + * Direction is a `mat3` matrix corresponding to the axes directions in + * world coordinates for the I, J, K axes of the image. Direction must form + * an orthonormal basis. + */ + getDirection(): mat3; + + /** + * The maximal extent of the projection. + * @default [0, -1, 0, -1, 0, -1] + */ + getExtent(): Extent; + + /** + * + * @default [0, -1, 0, -1, 0, -1] + */ + getExtentByReference(): Extent; + + /** + * Returns the data array index for the point at the provided world position. + * @param {Vector3} xyz The [x,y,z] array in world coordinates. + * @return {number} the corresponding pixel's index in the scalar array. + */ + getOffsetIndexFromWorld(xyz: Vector3): number; + + /** + * + */ + getNumberOfCells(): number; + + /** + * Get the number of points composing the dataset. + */ + getNumberOfPoints(): number; + + /** + * Get the world position of a data point. Index is the point's index in the + * 1D data array. + * @param {Number} index + */ + getPoint(index: number): Vector3; + + /** + * Get the origin of the dataset. The origin is the position in world + * coordinates of the point of extent (0,0,0). This point does not have to + * be part of the dataset, in other words, the dataset extent does not have + * to start at (0,0,0) and the origin can be outside of the dataset bounding + * box. The origin plus spacing determine the position in space of the + * points. + */ + getOrigin(): Vector3; + + /** + * Get the origin of the dataset. The origin is the position in world + */ + getOriginByReference(): Vector3; + + /** + * Returns the scalar value for the point at the provided world position, or + * `NaN` if the world bounds are outside the volumeData bounds. `comp` is + * the scalar component index, for multi-component scalar data. + * @param {Vector3} xyz The [x,y,z] array in world coordinates. + * @param {Number} [comp] The scalar component index for multi-component scalars. + * @return {number|NaN} The corresponding pixel's scalar value. + */ + getScalarValueFromWorld(xyz: Vector3, comp?: number): number; + + /** + * Set the spacing [width, height, length] of the cubical cells that compose + * the data set. + */ + getSpacing(): Vector3; + + /** + * + */ + getSpacingByReference(): Vector3; + + /** + * Returns the `mat4` matrices used to convert between world and index. + * `worldToIndex` is the inverse matrix of `indexToWorld`. Both are made + * with `Float64Array`. + */ + getIndexToWorld(): mat4; + + /** + * Returns the `mat4` matrices used to convert between world and index. + * `worldToIndex` is the inverse matrix of `indexToWorld`. Both are made + * with `Float64Array`. + */ + getWorldToIndex(): mat4; + + /** + * this is the fast version, requires vec3 arguments + * @param {ReadonlyVec3} vin + * @param {vec3} [vout] + */ + indexToWorldVec3(vin: ReadonlyVec3, vout?: vec3): vec3; + + /** + * Converts the input index vector `[i,j,k]` to world values `[x,y,z]`. + * If an out vector is not provided, a new one is created. If provided, it + * modifies the out vector array in place, but also returns it. + * @param {ReadonlyVec3} ain + * @param {vec3} [aout] + */ + indexToWorld(ain: ReadonlyVec3, aout?: vec3): vec3; + + /** + * Calculate the corresponding world bounds for the given index bounds + * `[i_min, i_max, j_min, j_max, k_min, k_max]`. Modifies `out` in place if + * provided, or returns a new array. Returned bounds are NOT padded based + * on voxel spacing (see getBounds). The output is merely a bounding box + * calculated considering voxels as grid points. + * @param {Bounds} bin + * @param {Bounds} [bout] + */ + indexToWorldBounds(bin: Bounds, bout?: Bounds): Bounds; + + /** + * Set the values of the extent, from `0` to `(i-1)`, etc. + * @param dims + */ + setDimensions(dims: number[]): void; + + /** + * Set the values of the extent, from `0` to `(i-1)`, etc. + * @param {Number} i + * @param {Number} j + * @param {Number} k + */ + setDimensions(i: number, j: number, k: number): void; + + /** + * The direction matrix is a 3x3 basis for the I, J, K axes + * of the image. The rows of the matrix correspond to the + * axes directions in world coordinates. Direction must + * form an orthonormal basis, results are undefined if + * it is not. + * @param {mat3} direction + */ + setDirection(direction: mat3): boolean; + + /** + * The direction matrix is a 3x3 basis for the I, J, K axes + * of the image. The rows of the matrix correspond to the + * axes directions in world coordinates. Direction must + * form an orthonormal basis, results are undefined if + * it is not. + * @param e00 + * @param e01 + * @param e02 + * @param e10 + * @param e11 + * @param e12 + * @param e20 + * @param e21 + * @param e22 + */ + setDirection( + e00: number, + e01: number, + e02: number, + e10: number, + e11: number, + e12: number, + e20: number, + e21: number, + e22: number + ): boolean; + + /** + * Set the extent. + * @param {Extent} extent + */ + setExtent(extent: Extent): boolean; + + /** + * + * @param {Number} x1 The x coordinate of the first point. + * @param {Number} x2 The x coordinate of the second point. + * @param {Number} y1 The y coordinate of the first point. + * @param {Number} y2 The y coordinate of the second point. + * @param {Number} z1 The z coordinate of the first point. + * @param {Number} z2 The z coordinate of the second point. + */ + setExtent( + x1: number, + x2: number, + y1: number, + y2: number, + z1: number, + z2: number + ): void; + + /** + * Set the origin of the image. + * @param {Vector3} origin The coordinate of the origin point. + */ + setOrigin(origin: Vector3): boolean; + + /** + * Set the origin of the image. + * @param {Vector3} origin The coordinate of the origin point. + */ + setOriginFrom(origin: Vector3): boolean; + + /** + * + * @param spacing + */ + setSpacing(spacing: number[]): boolean; + + /** + * + * @param spacing + */ + setSpacingFrom(spacing: number[]): boolean; + + /** + * this is the fast version, requires vec3 arguments + * @param vin + * @param [vout] + */ + worldToIndexVec3(vin: ReadonlyVec3, vout?: vec3): vec3; + + /** + * Converts the input world vector `[x,y,z]` to approximate index values + * `[i,j,k]`. Should be rounded to integers before attempting to access the + * index. If an out vector is not provided, a new one is created. If provided, it + * modifies the out vector array in place, but also returns it. + * @param ain + * @param [aout] + */ + worldToIndex(ain: ReadonlyVec3, aout?: vec3): vec3; + + /** + * Calculate the corresponding index bounds for the given world bounds + * `[x_min, x_max, y_min, y_max, z_min, z_max]`. Modifies `out` in place if + * provided, or returns a new array. + * @param {Bounds} bin + * @param {Bounds} [bout] + */ + worldToIndexBounds(bin: Bounds, bout?: Bounds): number[]; } /** @@ -357,13 +373,19 @@ export interface vtkImageData extends vtkDataSet { * @param model object on which data structure will be bounds (protected) * @param {IImageDataInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IImageDataInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IImageDataInitialValues +): void; /** * Method used to create a new instance of vtkImageData. * @param {IImageDataInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IImageDataInitialValues): vtkImageData; +export function newInstance( + initialValues?: IImageDataInitialValues +): vtkImageData; /** * vtkImageData is a data object that is a concrete implementation of @@ -372,7 +394,7 @@ export function newInstance(initialValues?: IImageDataInitialValues): vtkImageDa * (voxel data) and pixmaps. All vtkDataSet functions are inherited. */ export declare const vtkImageData: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkImageData; diff --git a/Sources/Common/DataModel/IncrementalOctreeNode/index.d.ts b/Sources/Common/DataModel/IncrementalOctreeNode/index.d.ts index 9f4e07addce..ff626149eb6 100644 --- a/Sources/Common/DataModel/IncrementalOctreeNode/index.d.ts +++ b/Sources/Common/DataModel/IncrementalOctreeNode/index.d.ts @@ -1,262 +1,262 @@ -import { vtkObject } from "../../../interfaces"; -import { Bounds, Vector3 } from "../../../types"; -import vtkPoints from "../../Core/Points"; +import { vtkObject } from '../../../interfaces'; +import { Bounds, Vector3 } from '../../../types'; +import vtkPoints from '../../Core/Points'; /** * */ export interface IIncrementalOctreeNodeInitialValues { - pointIdSet?: number[]; - minBounds?: Bounds; - maxBounds?: Bounds; - minDataBounds?: Bounds; - maxDataBounds?: Bounds; - parent?: vtkIncrementalOctreeNode; - children?: vtkIncrementalOctreeNode[]; + pointIdSet?: number[]; + minBounds?: Bounds; + maxBounds?: Bounds; + minDataBounds?: Bounds; + maxDataBounds?: Bounds; + parent?: vtkIncrementalOctreeNode; + children?: vtkIncrementalOctreeNode[]; } export interface vtkIncrementalOctreeNode extends vtkObject { - /** - * Create a list object for storing point indices. - */ - createPointIdSet(): void; + /** + * Create a list object for storing point indices. + */ + createPointIdSet(): void; - /** - * Set the spatial bounding box of the node. This function sets a default - * data bounding box. - * - * @param {Number} x1 - * @param {Number} x2 - * @param {Number} y1 - * @param {Number} y2 - * @param {Number} z1 - * @param {Number} z2 - */ - setBounds( - x1: number, - x2: number, - y1: number, - y2: number, - z1: number, - z2: number - ): void; + /** + * Set the spatial bounding box of the node. This function sets a default + * data bounding box. + * + * @param {Number} x1 + * @param {Number} x2 + * @param {Number} y1 + * @param {Number} y2 + * @param {Number} z1 + * @param {Number} z2 + */ + setBounds( + x1: number, + x2: number, + y1: number, + y2: number, + z1: number, + z2: number + ): void; - /** - * Get the spatial bounding box of the node. The values are returned via - * an array in order of: x_min, x_max, y_min, y_max, z_min, z_max. - * - * @param {Bounds} bounds - */ - getBounds(bounds: Bounds): void; + /** + * Get the spatial bounding box of the node. The values are returned via + * an array in order of: x_min, x_max, y_min, y_max, z_min, z_max. + * + * @param {Bounds} bounds + */ + getBounds(bounds: Bounds): void; - /** - * @param {Vector3} point - */ - getChildIndex(point: Vector3): number; - - /** - * @param {Vector3} point - */ - containsPoint(point: Vector3): boolean; - - /** - * @param {Vector3} point - */ - containsPointByData(point: Vector3): boolean; + /** + * @param {Vector3} point + */ + getChildIndex(point: Vector3): number; - /** - * Given a point inserted to either this node (a leaf node) or a descendant - * leaf (of this node --- when this node is a non-leaf node), update the - * counter and the data bounding box for this node only. The data bounding box - * is considered only if updateData is non-zero. The returned value indicates - * whether (1) or not (0) the data bounding box is actually updated. Note that - * argument nHits must be 1 unless this node is updated with a number (nHits) - * of exactly duplicate points as a whole via a single call to this function. - * - * @param {Vector3} point - * @param {Number} nHits - * @param {Boolean} updateData - */ - updateCounterAndDataBounds( - point: Vector3, - nHits: number, - updateData: boolean - ): boolean; + /** + * @param {Vector3} point + */ + containsPoint(point: Vector3): boolean; - /** - * Given a point inserted to either this node (a leaf node) or a descendant - * leaf (of this node --- when this node is a non-leaf node), update the - * counter and the data bounding box recursively bottom-up until a specified - * node. The data bounding box is considered only if updateData is non-zero. - * The returned value indicates whether (true) or not (false) the data bounding box - * is actually updated. Note that argument nHits must be 1 unless this node - * is updated with a number (nHits) of exactly duplicate points as a whole - * via a single call to this function. - * - * @param {Vector3} point - * @param {Number} nHits - * @param {Boolean} updateData - * @param {vtkIncrementalOctreeNode} endNode - */ - updateCounterAndDataBoundsRecursively( - point: Vector3, - nHits: number, - updateData: boolean, - endNode: vtkIncrementalOctreeNode - ): boolean; + /** + * @param {Vector3} point + */ + containsPointByData(point: Vector3): boolean; - /** - * Given a point, determine whether (true) or not (false) it is an exact duplicate - * of all the points, if any, maintained in this node. In other words, to - * check if this given point and all existing points, if any, of this node - * are exactly duplicate with one another. - * - * @param {Vector3} point - */ - containsDuplicatePointsOnly(point: Vector3): boolean; + /** + * Given a point inserted to either this node (a leaf node) or a descendant + * leaf (of this node --- when this node is a non-leaf node), update the + * counter and the data bounding box for this node only. The data bounding box + * is considered only if updateData is non-zero. The returned value indicates + * whether (1) or not (0) the data bounding box is actually updated. Note that + * argument nHits must be 1 unless this node is updated with a number (nHits) + * of exactly duplicate points as a whole via a single call to this function. + * + * @param {Vector3} point + * @param {Number} nHits + * @param {Boolean} updateData + */ + updateCounterAndDataBounds( + point: Vector3, + nHits: number, + updateData: boolean + ): boolean; - /** - * Determine whether or not this node is a leaf. - */ - isLeaf(): boolean; + /** + * Given a point inserted to either this node (a leaf node) or a descendant + * leaf (of this node --- when this node is a non-leaf node), update the + * counter and the data bounding box recursively bottom-up until a specified + * node. The data bounding box is considered only if updateData is non-zero. + * The returned value indicates whether (true) or not (false) the data bounding box + * is actually updated. Note that argument nHits must be 1 unless this node + * is updated with a number (nHits) of exactly duplicate points as a whole + * via a single call to this function. + * + * @param {Vector3} point + * @param {Number} nHits + * @param {Boolean} updateData + * @param {vtkIncrementalOctreeNode} endNode + */ + updateCounterAndDataBoundsRecursively( + point: Vector3, + nHits: number, + updateData: boolean, + endNode: vtkIncrementalOctreeNode + ): boolean; - /** - * Get the child at the given index i. - * i must be an int between 0 and 7. - * - * @param {Number} i - */ - getChild(i: number): vtkIncrementalOctreeNode; + /** + * Given a point, determine whether (true) or not (false) it is an exact duplicate + * of all the points, if any, maintained in this node. In other words, to + * check if this given point and all existing points, if any, of this node + * are exactly duplicate with one another. + * + * @param {Vector3} point + */ + containsDuplicatePointsOnly(point: Vector3): boolean; - /** - * Given a number (>= threshold) of all exactly duplicate points (accessible - * via points and pntIds, but with exactly the same 3D coordinate) maintained - * in this leaf node and a point (absolutely not a duplicate any more, with - * pntIdx storing the index in points)) to be inserted to this node, separate - * all the duplicate points from this new point by means of usually recursive - * node sub-division such that the former points are inserted to a descendant - * leaf while the new point is inserted to a sibling of this descendant leaf. - * Argument ptMode specifies whether the point is not inserted at all but only - * the point index is provided upon 0, the point is inserted via vtkPoints:: - * InsertPoint() upon 1, or this point is instead inserted through vtkPoints:: - * InsertNextPoint() upon 2. - * - * @param {vtkPoints} points - * @param {Number[]} pntIds - * @param {Vector3} newPnt - * @param {Number} pntIdx - * @param {Number} maxPts - * @param {Number} ptMode - */ - separateExactlyDuplicatePointsFromNewInsertion( - points: vtkPoints, - pntIds: number[], - newPnt: Vector3, - pntIdx: number, - maxPts: number, - ptMode: number - ): void; + /** + * Determine whether or not this node is a leaf. + */ + isLeaf(): boolean; - /** - * Divide this LEAF node into eight child nodes as the number of points - * maintained by this leaf node has reached the threshold maxPts while - * another point newPnt is just going to be inserted to it. The available - * point-indices pntIds are distributed to the child nodes based on the - * point coordinates (available through points). Note that this function - * can incur recursive node-division to determine the specific leaf node - * for accepting the new point (with pntIdx storing the index in points) - * because the existing maxPts points may fall within only one of the eight - * child nodes to make a radically imbalanced layout within the node (to - * be divided). Argument ptMode specifies whether the point is not inserted - * at all but instead only the point index is provided upon 0, the point is - * inserted via vtkPoints.InsertPoint() upon 1, or the point is inserted by - * vtkPoints.InsertNextPoint() upon 2. The returned value of this function - * indicates whether pntIds needs to be destroyed (1) or just unregistered - * from this node as it has been attached to another node (0). - * numberOfNodes in the tree is updated with new created nodes - * - * @param {vtkPoints} points - * @param {Number[]} pntIds - * @param {Vector3} newPnt - * @param {Number} pntIdx - * @param {Number} maxPts - * @param {Number} ptMode - * @param {Number} numberOfNodes - */ - createChildNodes( - points: vtkPoints, - pntIds: number[], - newPnt: Vector3, - pntIdx: number, - maxPts: number, - ptMode: number, - numberOfNodes: number - ): { success: boolean; numberOfNodes: number; pointIdx: number }; + /** + * Get the child at the given index i. + * i must be an int between 0 and 7. + * + * @param {Number} i + */ + getChild(i: number): vtkIncrementalOctreeNode; - /** - * This function is called after a successful point-insertion check and - * only applies to a leaf node. Prior to a call to this function, the - * octree should have been retrieved top-down to find the specific leaf - * node in which this new point (newPt) will be inserted. The actual index - * of the new point (to be inserted to points) is stored in pntId. Argument - * ptMode specifies whether the point is not inserted at all but instead only - * the point index is provided upon 0, the point is inserted via vtkPoints. - * insertPoint() upon 1, or it is inserted via vtkPoints.insertNextPoint() - * upon 2. For case 0, pntId needs to be specified. For cases 1 and 2, the - * actual point index is returned via pntId. Note that this function always - * returns 1 to indicate the success of point insertion. - * numberOfNodes is the number of nodes present in the tree at this time. - * it is used to assign an ID to each node which can be used to associate - * application specific information with each node. It is updated if new nodes - * are added to the tree. - * - * @param {Number} points - * @param {Number} newPnt - * @param {Number} maxPts - * @param {Number} pntId - * @param {Number} ptMode - * @param {Number} numberOfNodes - */ - insertPoint( - points: number, - newPnt: number, - maxPts: number, - pntId: number, - ptMode: number, - numberOfNodes: number - ): { numberOfNodes: number; pointIdx: number }; + /** + * Given a number (>= threshold) of all exactly duplicate points (accessible + * via points and pntIds, but with exactly the same 3D coordinate) maintained + * in this leaf node and a point (absolutely not a duplicate any more, with + * pntIdx storing the index in points)) to be inserted to this node, separate + * all the duplicate points from this new point by means of usually recursive + * node sub-division such that the former points are inserted to a descendant + * leaf while the new point is inserted to a sibling of this descendant leaf. + * Argument ptMode specifies whether the point is not inserted at all but only + * the point index is provided upon 0, the point is inserted via vtkPoints:: + * InsertPoint() upon 1, or this point is instead inserted through vtkPoints:: + * InsertNextPoint() upon 2. + * + * @param {vtkPoints} points + * @param {Number[]} pntIds + * @param {Vector3} newPnt + * @param {Number} pntIdx + * @param {Number} maxPts + * @param {Number} ptMode + */ + separateExactlyDuplicatePointsFromNewInsertion( + points: vtkPoints, + pntIds: number[], + newPnt: Vector3, + pntIdx: number, + maxPts: number, + ptMode: number + ): void; - /** - * Compute the minimum squared distance from a point to this node, with all - * six boundaries considered. The data bounding box is checked if checkData - * is non-zero. The closest on-boundary point is returned via closest. - * - * @param {Vector3} point - * @param {Vector3} closest - * @param {Boolean} innerOnly - * @param {vtkIncrementalOctreeNode} rootNode - * @param {Boolean} checkData - * @returns {Number} - */ - getDistance2ToBoundary( - point: Vector3, - closest: Vector3, - innerOnly: boolean, - rootNode: vtkIncrementalOctreeNode, - checkData: boolean - ): number; + /** + * Divide this LEAF node into eight child nodes as the number of points + * maintained by this leaf node has reached the threshold maxPts while + * another point newPnt is just going to be inserted to it. The available + * point-indices pntIds are distributed to the child nodes based on the + * point coordinates (available through points). Note that this function + * can incur recursive node-division to determine the specific leaf node + * for accepting the new point (with pntIdx storing the index in points) + * because the existing maxPts points may fall within only one of the eight + * child nodes to make a radically imbalanced layout within the node (to + * be divided). Argument ptMode specifies whether the point is not inserted + * at all but instead only the point index is provided upon 0, the point is + * inserted via vtkPoints.InsertPoint() upon 1, or the point is inserted by + * vtkPoints.InsertNextPoint() upon 2. The returned value of this function + * indicates whether pntIds needs to be destroyed (1) or just unregistered + * from this node as it has been attached to another node (0). + * numberOfNodes in the tree is updated with new created nodes + * + * @param {vtkPoints} points + * @param {Number[]} pntIds + * @param {Vector3} newPnt + * @param {Number} pntIdx + * @param {Number} maxPts + * @param {Number} ptMode + * @param {Number} numberOfNodes + */ + createChildNodes( + points: vtkPoints, + pntIds: number[], + newPnt: Vector3, + pntIdx: number, + maxPts: number, + ptMode: number, + numberOfNodes: number + ): { success: boolean; numberOfNodes: number; pointIdx: number }; - /** - * Given a point inside this node, get the minimum squared distance to all - * inner boundaries. An inner boundary is a node's face that is shared by - * another non-root node. - * - * @param {Vector3} point - * @param {vtkIncrementalOctreeNode} rootNode - */ - getDistance2ToInnerBoundary( - point: Vector3, - rootNode: vtkIncrementalOctreeNode - ): number; + /** + * This function is called after a successful point-insertion check and + * only applies to a leaf node. Prior to a call to this function, the + * octree should have been retrieved top-down to find the specific leaf + * node in which this new point (newPt) will be inserted. The actual index + * of the new point (to be inserted to points) is stored in pntId. Argument + * ptMode specifies whether the point is not inserted at all but instead only + * the point index is provided upon 0, the point is inserted via vtkPoints. + * insertPoint() upon 1, or it is inserted via vtkPoints.insertNextPoint() + * upon 2. For case 0, pntId needs to be specified. For cases 1 and 2, the + * actual point index is returned via pntId. Note that this function always + * returns 1 to indicate the success of point insertion. + * numberOfNodes is the number of nodes present in the tree at this time. + * it is used to assign an ID to each node which can be used to associate + * application specific information with each node. It is updated if new nodes + * are added to the tree. + * + * @param {Number} points + * @param {Number} newPnt + * @param {Number} maxPts + * @param {Number} pntId + * @param {Number} ptMode + * @param {Number} numberOfNodes + */ + insertPoint( + points: number, + newPnt: number, + maxPts: number, + pntId: number, + ptMode: number, + numberOfNodes: number + ): { numberOfNodes: number; pointIdx: number }; + + /** + * Compute the minimum squared distance from a point to this node, with all + * six boundaries considered. The data bounding box is checked if checkData + * is non-zero. The closest on-boundary point is returned via closest. + * + * @param {Vector3} point + * @param {Vector3} closest + * @param {Boolean} innerOnly + * @param {vtkIncrementalOctreeNode} rootNode + * @param {Boolean} checkData + * @returns {Number} + */ + getDistance2ToBoundary( + point: Vector3, + closest: Vector3, + innerOnly: boolean, + rootNode: vtkIncrementalOctreeNode, + checkData: boolean + ): number; + + /** + * Given a point inside this node, get the minimum squared distance to all + * inner boundaries. An inner boundary is a node's face that is shared by + * another non-root node. + * + * @param {Vector3} point + * @param {vtkIncrementalOctreeNode} rootNode + */ + getDistance2ToInnerBoundary( + point: Vector3, + rootNode: vtkIncrementalOctreeNode + ): number; } // ---------------------------------------------------------------------------- @@ -271,9 +271,9 @@ export interface vtkIncrementalOctreeNode extends vtkObject { * @param {object} [initialValues] (default: {}) */ export function extend( - publicAPI: object, - model: object, - initialValues?: object + publicAPI: object, + model: object, + initialValues?: object ): void; // ---------------------------------------------------------------------------- @@ -283,15 +283,15 @@ export function extend( * @param {IIncrementalOctreeNodeInitialValues} [initialValues] for pre-setting some of its content */ export function newInstance( - initialValues?: IIncrementalOctreeNodeInitialValues + initialValues?: IIncrementalOctreeNodeInitialValues ): vtkIncrementalOctreeNode; /** * vtkIncrementalOctreeNode */ export declare const vtkIncrementalOctreeNode: { - newInstance: typeof newInstance; - extend: typeof extend; + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkIncrementalOctreeNode; diff --git a/Sources/Common/DataModel/IncrementalOctreePointLocator/index.d.ts b/Sources/Common/DataModel/IncrementalOctreePointLocator/index.d.ts index 15cdc68a753..87b3ffc1654 100644 --- a/Sources/Common/DataModel/IncrementalOctreePointLocator/index.d.ts +++ b/Sources/Common/DataModel/IncrementalOctreePointLocator/index.d.ts @@ -1,27 +1,27 @@ -import { vtkObject } from "../../../interfaces"; -import vtkPoints from "../../Core/Points"; -import vtkIncrementalOctreeNode from "../IncrementalOctreeNode"; -import { IAbstractPointLocatorInitialValues } from "../AbstractPointLocator"; +import { vtkObject } from '../../../interfaces'; +import vtkPoints from '../../Core/Points'; +import vtkIncrementalOctreeNode from '../IncrementalOctreeNode'; +import { IAbstractPointLocatorInitialValues } from '../AbstractPointLocator'; /** * */ export interface IIncrementalOctreePointLocatorInitialValues - extends IAbstractPointLocatorInitialValues { - fudgeFactor: number; - octreeMaxDimSize: number; - buildCubicOctree: boolean; - maxPointsPerLeaf: number; - insertTolerance2: number; - locatorPoints: vtkPoints; - octreeRootNode: vtkIncrementalOctreeNode; - numberOfNodes: number; + extends IAbstractPointLocatorInitialValues { + fudgeFactor: number; + octreeMaxDimSize: number; + buildCubicOctree: boolean; + maxPointsPerLeaf: number; + insertTolerance2: number; + locatorPoints: vtkPoints; + octreeRootNode: vtkIncrementalOctreeNode; + numberOfNodes: number; } type vtkIncrementalOctreePointLocatorBase = vtkObject; export interface vtkIncrementalOctreePointLocator - extends vtkIncrementalOctreePointLocatorBase {} + extends vtkIncrementalOctreePointLocatorBase {} // ---------------------------------------------------------------------------- // Static API @@ -35,9 +35,9 @@ export interface vtkIncrementalOctreePointLocator * @param {object} [initialValues] (default: {}) */ export function extend( - publicAPI: object, - model: object, - initialValues?: IIncrementalOctreePointLocatorInitialValues + publicAPI: object, + model: object, + initialValues?: IIncrementalOctreePointLocatorInitialValues ): void; // ---------------------------------------------------------------------------- @@ -47,15 +47,15 @@ export function extend( * @param {IIncrementalOctreePointLocatorInitialValues} [initialValues] for pre-setting some of its content */ export function newInstance( - initialValues?: IIncrementalOctreePointLocatorInitialValues + initialValues?: IIncrementalOctreePointLocatorInitialValues ): vtkIncrementalOctreePointLocator; /** * vtkIncrementalOctreePointLocator */ export declare const vtkIncrementalOctreePointLocator: { - newInstance: typeof newInstance; - extend: typeof extend; + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkIncrementalOctreePointLocator; diff --git a/Sources/Common/DataModel/KochanekSpline1D/index.d.ts b/Sources/Common/DataModel/KochanekSpline1D/index.d.ts index 183af28fc4d..dce24d92f62 100755 --- a/Sources/Common/DataModel/KochanekSpline1D/index.d.ts +++ b/Sources/Common/DataModel/KochanekSpline1D/index.d.ts @@ -1,42 +1,60 @@ -import vtkSpline1D, { ISpline1DInitialValues, BoundaryCondition } from '../Spline1D'; +import vtkSpline1D, { + ISpline1DInitialValues, + BoundaryCondition, +} from '../Spline1D'; export interface IKochanekSpline1DInitialValues extends ISpline1DInitialValues { - tension?: number; - bias?: number; - continuity?: number; + tension?: number; + bias?: number; + continuity?: number; } export interface vtkKochanekSpline1D extends vtkSpline1D { + /** + * + * @param {Number} size + * @param {Float32Array} work + * @param {Number[]} x + * @param {Number[]} y + */ + computeCloseCoefficients( + size: number, + work: Float32Array, + x: number[], + y: number[] + ): void; - /** - * - * @param {Number} size - * @param {Float32Array} work - * @param {Number[]} x - * @param {Number[]} y - */ - computeCloseCoefficients(size: number, work: Float32Array, x: number[], y: number[]): void; + /** + * + * @param {Number} size + * @param {Float32Array} work + * @param {Number[]} x + * @param {Number[]} y + * @param {Object} options + * @param {BoundaryCondition} options.leftConstraint + * @param {Number} options.leftValue + * @param {BoundaryCondition} options.rightConstraint + * @param {Number} options.rightValue + */ + computeOpenCoefficients( + size: number, + work: Float32Array, + x: number[], + y: number[], + options: { + leftConstraint: BoundaryCondition; + leftValue: number; + rightConstraint: BoundaryCondition; + rightValue: Number; + } + ): void; - /** - * - * @param {Number} size - * @param {Float32Array} work - * @param {Number[]} x - * @param {Number[]} y - * @param {Object} options - * @param {BoundaryCondition} options.leftConstraint - * @param {Number} options.leftValue - * @param {BoundaryCondition} options.rightConstraint - * @param {Number} options.rightValue - */ - computeOpenCoefficients(size: number, work: Float32Array, x: number[], y: number[], options: { leftConstraint: BoundaryCondition, leftValue: number, rightConstraint: BoundaryCondition, rightValue: Number }): void; - - /** - * - * @param {Number} intervalIndex - * @param {Number} t - */ - getValue(intervalIndex: number, t: number): number; + /** + * + * @param {Number} intervalIndex + * @param {Number} t + */ + getValue(intervalIndex: number, t: number): number; } /** @@ -46,13 +64,19 @@ export interface vtkKochanekSpline1D extends vtkSpline1D { * @param model object on which data structure will be bounds (protected) * @param {IKochanekSpline1DInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IKochanekSpline1DInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IKochanekSpline1DInitialValues +): void; /** * Method used to create a new instance of vtkKochanekSpline1D. * @param {IKochanekSpline1DInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IKochanekSpline1DInitialValues): vtkKochanekSpline1D; +export function newInstance( + initialValues?: IKochanekSpline1DInitialValues +): vtkKochanekSpline1D; /** * vtkKochanekSpline1D provides methods for creating a Kochanek interpolating @@ -61,7 +85,7 @@ export function newInstance(initialValues?: IKochanekSpline1DInitialValues): vtk */ export declare const vtkKochanekSpline1D: { - newInstance: typeof newInstance, - extend: typeof extend + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkKochanekSpline1D; diff --git a/Sources/Common/DataModel/Line/index.d.ts b/Sources/Common/DataModel/Line/index.d.ts index d33b87463f6..0b151f410f1 100755 --- a/Sources/Common/DataModel/Line/index.d.ts +++ b/Sources/Common/DataModel/Line/index.d.ts @@ -3,80 +3,85 @@ import { Vector3, Vector2, Nullable } from '../../../types'; import vtkCell from '../Cell'; export enum IntersectionState { - NO_INTERSECTION, - YES_INTERSECTION, - ON_LINE, + NO_INTERSECTION, + YES_INTERSECTION, + ON_LINE, } export interface ILineInitialValues { - orientations: Nullable; + orientations: Nullable; } export interface IIntersectWithLine { - intersect: number; - t: number; - subId: number; - evaluation?: number; - betweenPoints?: boolean; + intersect: number; + t: number; + subId: number; + evaluation?: number; + betweenPoints?: boolean; } interface IDistanceToLine { - t: number; - distance: number; + t: number; + distance: number; } export interface vtkLine extends vtkCell { - - /** - * Get the topological dimensional of the cell (0, 1, 2 or 3). - */ - getCellDimension(): number; - - /** - * Get the list of orientations (a list of quat) for each point of the line. - * Can be null if the line is not oriented - */ - getOrientations(): Nullable; - - /** - * @see getOrientations - * @param orientations The list of orientation per point of the centerline - */ - setOrientations(orientations: Nullable): boolean; - - /** - * Compute the intersection point of the intersection between line and line - * defined by p1 and p2. tol Tolerance use for the position evaluation x is - * the point which intersect triangle (computed in function) pcoords - * parametric coordinates (computed in function) A javascript object is - * returned : - * - * ```js - * { - * evaluation: define if the line has been intersected or not - * subId: always set to 0 - * t: tolerance of the intersection - * } - * ``` - * @param {Vector3} p1 The first point coordinate. - * @param {Vector3} p2 The second point coordinate. - * @param {Number} tol The tolerance to use. - * @param {Vector3} x The point which intersect triangle. - * @param {Vector3} pcoords The parametric coordinates. - */ - intersectWithLine(p1: Vector3, p2: Vector3, tol: number, x: Vector3, pcoords: Vector3): IIntersectWithLine; - - /** - * Determine the global coordinates `x' and parametric coordinates `pcoords' in the cell. - */ - evaluateLocation(pcoords: Vector3, x: Vector3, weights: Vector2): void - - /** - * Determine the global orientation `q' and parametric coordinates `pcoords' in the cell. - * Use slerp to interpolate orientation - * Returns wether the orientation has been set in `q' - */ - evaluateOrientation(pcoords: Vector3, q: quat, weights: Vector2): boolean + /** + * Get the topological dimensional of the cell (0, 1, 2 or 3). + */ + getCellDimension(): number; + + /** + * Get the list of orientations (a list of quat) for each point of the line. + * Can be null if the line is not oriented + */ + getOrientations(): Nullable; + + /** + * @see getOrientations + * @param orientations The list of orientation per point of the centerline + */ + setOrientations(orientations: Nullable): boolean; + + /** + * Compute the intersection point of the intersection between line and line + * defined by p1 and p2. tol Tolerance use for the position evaluation x is + * the point which intersect triangle (computed in function) pcoords + * parametric coordinates (computed in function) A javascript object is + * returned : + * + * ```js + * { + * evaluation: define if the line has been intersected or not + * subId: always set to 0 + * t: tolerance of the intersection + * } + * ``` + * @param {Vector3} p1 The first point coordinate. + * @param {Vector3} p2 The second point coordinate. + * @param {Number} tol The tolerance to use. + * @param {Vector3} x The point which intersect triangle. + * @param {Vector3} pcoords The parametric coordinates. + */ + intersectWithLine( + p1: Vector3, + p2: Vector3, + tol: number, + x: Vector3, + pcoords: Vector3 + ): IIntersectWithLine; + + /** + * Determine the global coordinates `x' and parametric coordinates `pcoords' in the cell. + */ + evaluateLocation(pcoords: Vector3, x: Vector3, weights: Vector2): void; + + /** + * Determine the global orientation `q' and parametric coordinates `pcoords' in the cell. + * Use slerp to interpolate orientation + * Returns wether the orientation has been set in `q' + */ + evaluateOrientation(pcoords: Vector3, q: quat, weights: Vector2): boolean; } /** @@ -86,7 +91,11 @@ export interface vtkLine extends vtkCell { * @param model object on which data structure will be bounds (protected) * @param {ILineInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ILineInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ILineInitialValues +): void; /** * Method used to create a new instance of vtkLine. @@ -98,7 +107,7 @@ export function newInstance(initialValues?: ILineInitialValues): vtkLine; * Compute the distance from x to the line composed by p1 and p2. If an object * is set as a fourth argument, then the closest point on the line from x will * be set into it. - * + * * ```js * { * t: tolerance of the distance @@ -106,12 +115,17 @@ export function newInstance(initialValues?: ILineInitialValues): vtkLine; * } * ``` * @static - * @param {Vector3} x - * @param {Vector3} p1 - * @param {Vector3} p2 - * @param {Vector3} [closestPoint] + * @param {Vector3} x + * @param {Vector3} p1 + * @param {Vector3} p2 + * @param {Vector3} [closestPoint] */ -export function distanceToLine(x: Vector3, p1: Vector3, p2: Vector3, closestPoint?: Vector3): IDistanceToLine; +export function distanceToLine( + x: Vector3, + p1: Vector3, + p2: Vector3, + closestPoint?: Vector3 +): IDistanceToLine; /** * Performs intersection of two finite 3D lines. An intersection is found if the @@ -121,7 +135,7 @@ export function distanceToLine(x: Vector3, p1: Vector3, p2: Vector3, closestPoin * parametric coordinates of the lines at the position of closest approach. * Careful, u and v are filled inside the function. Outside the function, they * have to be access with : u[0] and v[0] return IntersectionState enum : - * + * * ```js * enum IntersectionState { * NO_INTERSECTION, @@ -130,25 +144,32 @@ export function distanceToLine(x: Vector3, p1: Vector3, p2: Vector3, closestPoin * } * ``` * @static - * @param {Vector3} a1 - * @param {Vector3} a2 - * @param {Vector3} b1 - * @param {Vector3} b2 - * @param {Vector3} u - * @param {Vector3} v + * @param {Vector3} a1 + * @param {Vector3} a2 + * @param {Vector3} b1 + * @param {Vector3} b2 + * @param {Vector3} u + * @param {Vector3} v */ -export function intersection(a1: Vector3, a2: Vector3, b1: Vector3, b2: Vector3, u: Vector3, v: Vector3): IntersectionState; +export function intersection( + a1: Vector3, + a2: Vector3, + b1: Vector3, + b2: Vector3, + u: Vector3, + v: Vector3 +): IntersectionState; -/** +/** * vtkLine is a cell which representant a line. * It contains static method to make some computations directly link to line. - * + * * @see vtkCell */ export declare const vtkLine: { - newInstance: typeof newInstance, - extend: typeof extend; - distanceToLine: typeof distanceToLine; - intersection: typeof intersection; + newInstance: typeof newInstance; + extend: typeof extend; + distanceToLine: typeof distanceToLine; + intersection: typeof intersection; }; export default vtkLine; diff --git a/Sources/Common/DataModel/Locator/index.d.ts b/Sources/Common/DataModel/Locator/index.d.ts index b362da504ce..39c047be514 100644 --- a/Sources/Common/DataModel/Locator/index.d.ts +++ b/Sources/Common/DataModel/Locator/index.d.ts @@ -1,15 +1,15 @@ -import { vtkObject } from "../../../interfaces"; +import { vtkObject } from '../../../interfaces'; /** * */ export interface ILocatorInitialValues { - dataSet?: number[]; - maxLevel?: number; - level?: number; - automatic?: boolean; - tolerance?: number; - useExistingSearchStructure?: boolean; + dataSet?: number[]; + maxLevel?: number; + level?: number; + automatic?: boolean; + tolerance?: number; + useExistingSearchStructure?: boolean; } export interface vtkLocator extends vtkObject {} @@ -26,9 +26,9 @@ export interface vtkLocator extends vtkObject {} * @param {ILocatorInitialValues} [initialValues] (default: {}) */ export function extend( - publicAPI: object, - model: object, - initialValues?: ILocatorInitialValues + publicAPI: object, + model: object, + initialValues?: ILocatorInitialValues ): void; // ---------------------------------------------------------------------------- @@ -37,7 +37,7 @@ export function extend( * vtkLocator */ export declare const vtkLocator: { - extend: typeof extend; + extend: typeof extend; }; export default vtkLocator; diff --git a/Sources/Common/DataModel/PiecewiseFunction/index.d.ts b/Sources/Common/DataModel/PiecewiseFunction/index.d.ts index 98baf68bc15..5b52ff93c9d 100644 --- a/Sources/Common/DataModel/PiecewiseFunction/index.d.ts +++ b/Sources/Common/DataModel/PiecewiseFunction/index.d.ts @@ -1,207 +1,217 @@ -import { vtkObject } from "../../../interfaces" ; -import { Range } from "../../../types"; +import { vtkObject } from '../../../interfaces'; +import { Range } from '../../../types'; export interface IPiecewiseFunctionInitialValues { - range?: Range, - clamping?: boolean, - allowDuplicateScalars?: boolean, + range?: Range; + clamping?: boolean; + allowDuplicateScalars?: boolean; } export interface vtkPiecewiseFunction extends vtkObject { - - /** - * Add points to the function. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - */ - addPoint(x: number, y: number): void; - - /** - * Add points to the function. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} midpoint - * @param {Number} sharpness - */ - addPointLong(x: number, y: number, midpoint: number, sharpness: number): number; - - /** - * Add a line segment to the function. - * @param {Number} x1 The first point x coordinate. - * @param {Number} y1 The first point y coordinate. - * @param {Number} x2 The second point x coordinate. - * @param {Number} y2 The second point y coordinate. - */ - addSegment(x1: number, y1: number, x2: number, y2: number): void; - - /** - * Remove all points out of the new range, and make sure there is a point at - * each end of that range. - * @param {Range} range - */ - adjustRange(range: Range): number; - - /** - * Estimates the minimum size of a table such that it would correctly sample - * this function. - */ - estimateMinNumberOfSamples(): number; - - /** - * Traverses the nodes to find the minimum distance. - */ - findMinimumXDistance(): number; - - /** - * Toggle whether to allow duplicate scalar values in the piecewise function - * (off by default). - */ - getAllowDuplicateScalars(): boolean; - - /** - * When zero range clamping is Off, GetValue() returns 0.0 when a value is - * requested outside of the points specified. - * - * When zero range clamping is On, GetValue() returns the value at the value - * at the lowest point for a request below all points specified and returns - * the value at the highest point for a request above all points specified. - * On is the default. - */ - getClamping(): boolean; - - /** - * Returns a pointer to the data stored in the table. - */ - getDataPointer(): any[]; - - /** - * Returns the first point location which precedes a non-zero segment of the - * function. - */ - getFirstNonZeroValue(): number; - - /** - * For the node specified by index, set/get the location (X), value (Y), - * midpoint, and sharpness values at the node. - * @param {Number} index - * @param val - */ - getNodeValue(index: number, val: any[]): void; - - /** - * Returns the min and max node locations of the function. - */ - getRange(): Range; - - /** - * Returns the min and max node locations of the function. - */ - getRangeByReference(): Range; - - /** - * Get the number of points used to specify the function. - */ - getSize(): number; - - /** - * Fills in an array of function values evaluated at regular intervals. - * @param {Number} xStart - * @param {Number} xEnd - * @param {Number} size - * @param table - * @param {Number} [stride] - */ - getTable(xStart: number, xEnd: number, size: number, table: any, stride?: number): void; - - /** - * Return the type of function: Function Types: - * * 0 : Constant (No change in slope between end points) - * * 1 : NonDecreasing (Always increasing or zero slope) - * * 2 : NonIncreasing (Always decreasing or zero slope) - * * 3 : Varied (Contains both decreasing and increasing slopes) - */ - getType(): 'Constant' | 'NonDecreasing' | 'NonIncreasing' | 'Varied'; - - /** - * Returns the value of the function at the specified location using the - * specified interpolation. - */ - getValue(): any; - - /** - * Removes all points from the function. - */ - removeAllPoints(): void; - - /** - * Remove the first point found at the given x location Return the index of - * the remove point if any, -1 otherwise. - * @param {Number} x - */ - removePoint(x: number): number; - - /** - * - * @param {Boolean} allowDuplicateScalars - */ - setAllowDuplicateScalars(allowDuplicateScalars: boolean): boolean; - - /** - * When zero range clamping is Off, GetValue() returns 0.0 when a value is - * requested outside of the points specified. - * - * When zero range clamping is On, GetValue() returns the value at the value - * at the lowest point for a request below all points specified and returns - * the value at the highest point for a request above all points specified. - * On is the default. - * @param {Boolean} clamping - */ - setClamping(clamping: boolean): boolean; - - /** - * - * @param {Number} index - * @param val - */ - setNodeValue(index: number, val: any[]): number; - - /** - * - * @param nodes - */ - setNodes(nodes: any[]): void; - - /** - * - * @param {Range} range - */ - setRange(range: Range): boolean; - - /** - * - * @param {Number} min - * @param {Number} max - */ - setRange(min: number, max: number): boolean; - - /** - * - * @param {Range} range - */ - setRangeFrom(range: Range): boolean; - - /** + /** + * Add points to the function. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + */ + addPoint(x: number, y: number): void; + + /** + * Add points to the function. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} midpoint + * @param {Number} sharpness + */ + addPointLong( + x: number, + y: number, + midpoint: number, + sharpness: number + ): number; + + /** + * Add a line segment to the function. + * @param {Number} x1 The first point x coordinate. + * @param {Number} y1 The first point y coordinate. + * @param {Number} x2 The second point x coordinate. + * @param {Number} y2 The second point y coordinate. + */ + addSegment(x1: number, y1: number, x2: number, y2: number): void; + + /** + * Remove all points out of the new range, and make sure there is a point at + * each end of that range. + * @param {Range} range + */ + adjustRange(range: Range): number; + + /** + * Estimates the minimum size of a table such that it would correctly sample + * this function. + */ + estimateMinNumberOfSamples(): number; + + /** + * Traverses the nodes to find the minimum distance. + */ + findMinimumXDistance(): number; + + /** + * Toggle whether to allow duplicate scalar values in the piecewise function + * (off by default). + */ + getAllowDuplicateScalars(): boolean; + + /** + * When zero range clamping is Off, GetValue() returns 0.0 when a value is + * requested outside of the points specified. + * + * When zero range clamping is On, GetValue() returns the value at the value + * at the lowest point for a request below all points specified and returns + * the value at the highest point for a request above all points specified. + * On is the default. + */ + getClamping(): boolean; + + /** + * Returns a pointer to the data stored in the table. + */ + getDataPointer(): any[]; + + /** + * Returns the first point location which precedes a non-zero segment of the + * function. + */ + getFirstNonZeroValue(): number; + + /** + * For the node specified by index, set/get the location (X), value (Y), + * midpoint, and sharpness values at the node. + * @param {Number} index + * @param val + */ + getNodeValue(index: number, val: any[]): void; + + /** + * Returns the min and max node locations of the function. + */ + getRange(): Range; + + /** + * Returns the min and max node locations of the function. + */ + getRangeByReference(): Range; + + /** + * Get the number of points used to specify the function. + */ + getSize(): number; + + /** + * Fills in an array of function values evaluated at regular intervals. + * @param {Number} xStart + * @param {Number} xEnd + * @param {Number} size + * @param table + * @param {Number} [stride] + */ + getTable( + xStart: number, + xEnd: number, + size: number, + table: any, + stride?: number + ): void; + + /** + * Return the type of function: Function Types: + * * 0 : Constant (No change in slope between end points) + * * 1 : NonDecreasing (Always increasing or zero slope) + * * 2 : NonIncreasing (Always decreasing or zero slope) + * * 3 : Varied (Contains both decreasing and increasing slopes) + */ + getType(): 'Constant' | 'NonDecreasing' | 'NonIncreasing' | 'Varied'; + + /** + * Returns the value of the function at the specified location using the + * specified interpolation. + */ + getValue(): any; + + /** + * Removes all points from the function. + */ + removeAllPoints(): void; + + /** + * Remove the first point found at the given x location Return the index of + * the remove point if any, -1 otherwise. + * @param {Number} x + */ + removePoint(x: number): number; + + /** + * + * @param {Boolean} allowDuplicateScalars + */ + setAllowDuplicateScalars(allowDuplicateScalars: boolean): boolean; + + /** + * When zero range clamping is Off, GetValue() returns 0.0 when a value is + * requested outside of the points specified. + * + * When zero range clamping is On, GetValue() returns the value at the value + * at the lowest point for a request below all points specified and returns + * the value at the highest point for a request above all points specified. + * On is the default. + * @param {Boolean} clamping + */ + setClamping(clamping: boolean): boolean; + + /** + * + * @param {Number} index + * @param val + */ + setNodeValue(index: number, val: any[]): number; + + /** + * + * @param nodes + */ + setNodes(nodes: any[]): void; + + /** + * + * @param {Range} range + */ + setRange(range: Range): boolean; + + /** + * + * @param {Number} min + * @param {Number} max + */ + setRange(min: number, max: number): boolean; + + /** + * + * @param {Range} range + */ + setRangeFrom(range: Range): boolean; + + /** * Internal method to sort the vector and update the Range whenever a node * is added, edited or removed. */ - sortAndUpdateRange(): void; + sortAndUpdateRange(): void; - /** - * Returns true if the range has been updated and Modified() has been - * called. - */ - updateRange(): boolean; + /** + * Returns true if the range has been updated and Modified() has been + * called. + */ + updateRange(): boolean; } /** @@ -211,13 +221,19 @@ export interface vtkPiecewiseFunction extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IPiecewiseFunctionInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPiecewiseFunctionInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPiecewiseFunctionInitialValues +): void; /** * Method used to create a new instance of vtkPiecewiseFunction. * @param {IPiecewiseFunctionInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IPiecewiseFunctionInitialValues): vtkPiecewiseFunction; +export function newInstance( + initialValues?: IPiecewiseFunctionInitialValues +): vtkPiecewiseFunction; /** * vtkPiecewiseFunction Defines a piecewise function mapping. This mapping @@ -235,7 +251,7 @@ export function newInstance(initialValues?: IPiecewiseFunctionInitialValues): vt * points (which do not have Sharpness and Midpoint parameters) will default to * Midpoint = 0.5 (halfway between the control points) and Sharpness = 0.0 * (linear). - * + * * @example * ```js * const ofun = vtkPiecewiseFunction.newInstance(); @@ -243,11 +259,11 @@ export function newInstance(initialValues?: IPiecewiseFunctionInitialValues): vt * ofun.addPoint(1200.0, 0.2); * ofun.addPoint(4000.0, 0.4); * ``` - * + * * @see [vtkColorTransferFunction](./Rendering_Core_ColorTransferFunction.html) */ export declare const vtkPiecewiseFunction: { - newInstance: typeof newInstance, - extend: typeof extend; + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkPiecewiseFunction; diff --git a/Sources/Common/DataModel/Plane/index.d.ts b/Sources/Common/DataModel/Plane/index.d.ts index 086d20a8b82..56a09d65eb9 100755 --- a/Sources/Common/DataModel/Plane/index.d.ts +++ b/Sources/Common/DataModel/Plane/index.d.ts @@ -1,200 +1,201 @@ -import { vtkObject } from "../../../interfaces" ; -import { Vector3 } from "../../../types"; +import { vtkObject } from '../../../interfaces'; +import { Vector3 } from '../../../types'; /** * */ export interface IPlaneInitialValues { - normal?: Vector3; - origin?: Vector3; + normal?: Vector3; + origin?: Vector3; } interface IIntersectWithLine { - intersection: boolean; - betweenPoints: boolean; - t: number; - x: Vector3; + intersection: boolean; + betweenPoints: boolean; + t: number; + x: Vector3; } - export interface vtkPlane extends vtkObject { - - /** - * Get the distance of a point x to a plane defined by n (x-p0) = 0. - * The normal n must be magnitude = 1. - * @param {Vector3} x The point coordiante. - */ - distanceToPlane(x: Vector3): number; - - /** - * Get plane normal. - * Plane is defined by point and normal. - */ - getNormal(): Vector3; - - /** - * Get plane normal. - * Plane is defined by point and normal. - */ - getNormalByReference(): Vector3; - - /** - * Get the origin of the plane - */ - getOrigin(): Vector3; - - /** - * Get the origin of the plane - */ - getOriginByReference(): Vector3; - - /** - * - * @param {Vector3} x The point coordinate. - * @param {Vector3} xproj The projection point's coordinate. - */ - projectPoint(x: Vector3, xproj: Vector3): void; - - /** - * Project a vector v onto plane. The projected vector is returned in vproj. - * @param {Vector3} v The vector coordinate. - * @param {Vector3} vproj The projection vector's coordinate.. - */ - projectVector(v: Vector3, vproj: Vector3): void; - - /** - * Translate the plane in the direction of the normal by the distance - * specified. Negative values move the plane in the opposite direction. - * @param {Number} distance - */ - push(distance: number): void; - - /** - * - * @param {Vector3} x The point coordinate. - * @param {Vector3} xproj The projection point's coordinate. - */ - generalizedProjectPoint(x: Vector3, xproj: Vector3): void; - - /** - * Evaluate plane equation for point x. - * - * Accepts both an array point representation and individual xyz arguments. - * - * ```js - * plane.evaluateFunction([0.0, 0.0, 0.0]); - * plane.evaluateFunction(0.0, 0.0, 0.0); - * ``` - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - evaluateFunction(x: number, y: number, z: number): number; - - /** - * Evaluate plane equation for point x. - * - * Accepts both an array point representation and individual xyz arguments. - * - * ```js - * plane.evaluateFunction([0.0, 0.0, 0.0]); - * plane.evaluateFunction(0.0, 0.0, 0.0); - * ``` - * @param {Vector3} value - */ - evaluateFunction(value: Vector3): number; - - /** - * Given the point xyz (three floating values) evaluate the equation for the - * plane gradient. Note that the normal and origin must have already been - * specified. The method returns an array of three floats. - * @param xyz - */ - evaluateGradient(xyz: any): Vector3; - - /** - * Given a line defined by the two points p1,p2; and a plane defined by the - * normal n and point p0, compute an intersection. Return an object: - * - * ```js - * let obj = {intersection: ..., betweenPoints: ..., t: ..., x: ...}; - * ``` - * - * where: - * - **intersection** (_boolean_): indicates if the plane and line - * intersect. - * - **betweenPoints** (_boolean_): indicates if the intersection is between - * the provided points. True if (0 <= t <= 1), and false otherwise. - * - **t** (_Number_): parametric coordinate along the line. - * - **x** (_Array_): coordinates of intersection. - * - * If the plane and line are parallel, intersection is false and t is set to - * Number.MAX_VALUE. - * @param {Vector3} p1 The first point coordiante. - * @param {Vector3} p2 The second point coordiante. - */ - intersectWithLine(p1: Vector3, p2: Vector3): IIntersectWithLine; - - /** - * Given a planes defined by the normals n0 & n1 and origin points p0 & p1, - * compute the line representing the plane intersection. Return an object: - * - * ```js - * let obj = {intersection: ..., error: ..., l0: ..., l1: ...}; - * ``` - * - * where: - * - * - **intersection** (_boolean_): indicates if the two planes intersect. - * Intersection is true if (0 <= t <= 1), and false otherwise. - * - **l0** (_Array_): coordinates of point 0 of the intersection line. - * - **l1** (_Array_): coordinates of point 1 of the intersection line. - * - **error** (_String|null_): Conditional, if the planes do not intersect, - * is it because they are coplanar (`COINCIDE`) or parallel (`DISJOINT`). - * @param {Vector3} planeOrigin - * @param {Vector3} planeNormal - */ - intersectWithPlane(planeOrigin: Vector3, planeNormal: Vector3): IIntersectWithLine; - - /** - * Set the normal of the plane. - * @param {Vector3} normal The normal coordinate. - */ - setNormal(normal: Vector3): boolean; - - /** - * Set the normal of the plane. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setNormal(x: number, y: number, z: number): boolean; - - /** - * Set the normal object. - * @param {Vector3} normal The normal coordinate. - */ - setNormalFrom(normal: Vector3): boolean; - - /** - * Set the origin of the plane. - * @param {Vector3} origin The coordinate of the origin point. - */ - setOrigin(origin: Vector3): boolean; - - /** - * Set the origin of the plane. - * @param {Number} x The x coordinate of the origin point. - * @param {Number} y The y coordinate of the origin point. - * @param {Number} z The z coordinate of the origin point. - */ - setOrigin(x: number, y: number, z: number): boolean; - - /** - * Set the origin of the plane. - * @param {Vector3} origin The coordinate of the origin point. - */ - setOriginFrom(origin: Vector3): boolean; + /** + * Get the distance of a point x to a plane defined by n (x-p0) = 0. + * The normal n must be magnitude = 1. + * @param {Vector3} x The point coordiante. + */ + distanceToPlane(x: Vector3): number; + + /** + * Get plane normal. + * Plane is defined by point and normal. + */ + getNormal(): Vector3; + + /** + * Get plane normal. + * Plane is defined by point and normal. + */ + getNormalByReference(): Vector3; + + /** + * Get the origin of the plane + */ + getOrigin(): Vector3; + + /** + * Get the origin of the plane + */ + getOriginByReference(): Vector3; + + /** + * + * @param {Vector3} x The point coordinate. + * @param {Vector3} xproj The projection point's coordinate. + */ + projectPoint(x: Vector3, xproj: Vector3): void; + + /** + * Project a vector v onto plane. The projected vector is returned in vproj. + * @param {Vector3} v The vector coordinate. + * @param {Vector3} vproj The projection vector's coordinate.. + */ + projectVector(v: Vector3, vproj: Vector3): void; + + /** + * Translate the plane in the direction of the normal by the distance + * specified. Negative values move the plane in the opposite direction. + * @param {Number} distance + */ + push(distance: number): void; + + /** + * + * @param {Vector3} x The point coordinate. + * @param {Vector3} xproj The projection point's coordinate. + */ + generalizedProjectPoint(x: Vector3, xproj: Vector3): void; + + /** + * Evaluate plane equation for point x. + * + * Accepts both an array point representation and individual xyz arguments. + * + * ```js + * plane.evaluateFunction([0.0, 0.0, 0.0]); + * plane.evaluateFunction(0.0, 0.0, 0.0); + * ``` + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + evaluateFunction(x: number, y: number, z: number): number; + + /** + * Evaluate plane equation for point x. + * + * Accepts both an array point representation and individual xyz arguments. + * + * ```js + * plane.evaluateFunction([0.0, 0.0, 0.0]); + * plane.evaluateFunction(0.0, 0.0, 0.0); + * ``` + * @param {Vector3} value + */ + evaluateFunction(value: Vector3): number; + + /** + * Given the point xyz (three floating values) evaluate the equation for the + * plane gradient. Note that the normal and origin must have already been + * specified. The method returns an array of three floats. + * @param xyz + */ + evaluateGradient(xyz: any): Vector3; + + /** + * Given a line defined by the two points p1,p2; and a plane defined by the + * normal n and point p0, compute an intersection. Return an object: + * + * ```js + * let obj = {intersection: ..., betweenPoints: ..., t: ..., x: ...}; + * ``` + * + * where: + * - **intersection** (_boolean_): indicates if the plane and line + * intersect. + * - **betweenPoints** (_boolean_): indicates if the intersection is between + * the provided points. True if (0 <= t <= 1), and false otherwise. + * - **t** (_Number_): parametric coordinate along the line. + * - **x** (_Array_): coordinates of intersection. + * + * If the plane and line are parallel, intersection is false and t is set to + * Number.MAX_VALUE. + * @param {Vector3} p1 The first point coordiante. + * @param {Vector3} p2 The second point coordiante. + */ + intersectWithLine(p1: Vector3, p2: Vector3): IIntersectWithLine; + + /** + * Given a planes defined by the normals n0 & n1 and origin points p0 & p1, + * compute the line representing the plane intersection. Return an object: + * + * ```js + * let obj = {intersection: ..., error: ..., l0: ..., l1: ...}; + * ``` + * + * where: + * + * - **intersection** (_boolean_): indicates if the two planes intersect. + * Intersection is true if (0 <= t <= 1), and false otherwise. + * - **l0** (_Array_): coordinates of point 0 of the intersection line. + * - **l1** (_Array_): coordinates of point 1 of the intersection line. + * - **error** (_String|null_): Conditional, if the planes do not intersect, + * is it because they are coplanar (`COINCIDE`) or parallel (`DISJOINT`). + * @param {Vector3} planeOrigin + * @param {Vector3} planeNormal + */ + intersectWithPlane( + planeOrigin: Vector3, + planeNormal: Vector3 + ): IIntersectWithLine; + + /** + * Set the normal of the plane. + * @param {Vector3} normal The normal coordinate. + */ + setNormal(normal: Vector3): boolean; + + /** + * Set the normal of the plane. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setNormal(x: number, y: number, z: number): boolean; + + /** + * Set the normal object. + * @param {Vector3} normal The normal coordinate. + */ + setNormalFrom(normal: Vector3): boolean; + + /** + * Set the origin of the plane. + * @param {Vector3} origin The coordinate of the origin point. + */ + setOrigin(origin: Vector3): boolean; + + /** + * Set the origin of the plane. + * @param {Number} x The x coordinate of the origin point. + * @param {Number} y The y coordinate of the origin point. + * @param {Number} z The z coordinate of the origin point. + */ + setOrigin(x: number, y: number, z: number): boolean; + + /** + * Set the origin of the plane. + * @param {Vector3} origin The coordinate of the origin point. + */ + setOriginFrom(origin: Vector3): boolean; } /** @@ -204,7 +205,11 @@ export interface vtkPlane extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IPlaneInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPlaneInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPlaneInitialValues +): void; /** * Method used to create a new instance of vtkPlane. @@ -215,9 +220,9 @@ export function newInstance(initialValues?: IPlaneInitialValues): vtkPlane; /** * Quick evaluation of plane equation n(x-origin) = 0. * @static - * @param {Vector3} normal + * @param {Vector3} normal * @param {Vector3} origin The coordinate of the origin point. - * @param {Vector3} x + * @param {Vector3} x */ export function evaluate(normal: Vector3, origin: Vector3, x: Vector3): number; @@ -225,11 +230,15 @@ export function evaluate(normal: Vector3, origin: Vector3, x: Vector3): number; * Return the distance of a point x to a plane defined by n (x-p0) = 0. * The normal n must be magnitude = 1. * @static - * @param {Vector3} x + * @param {Vector3} x * @param {Vector3} origin The coordinate of the origin point. - * @param {Vector3} normal + * @param {Vector3} normal */ -export function distanceToPlane(x: Vector3, origin: Vector3, normal: Vector3): number; +export function distanceToPlane( + x: Vector3, + origin: Vector3, + normal: Vector3 +): number; /** * Project a point x onto plane defined by origin and normal. The projected point @@ -237,22 +246,31 @@ export function distanceToPlane(x: Vector3, origin: Vector3, normal: Vector3): n * !!! note * normal assumed to have magnitude 1. * @static - * @param {Vector3} x + * @param {Vector3} x * @param {Vector3} origin The coordinate of the origin point. - * @param {Vector3} normal - * @param {Vector3} xproj + * @param {Vector3} normal + * @param {Vector3} xproj */ -export function projectPoint(x: any, origin: Vector3, normal: Vector3, xproj: Vector3): void; +export function projectPoint( + x: any, + origin: Vector3, + normal: Vector3, + xproj: Vector3 +): void; /** * Project a vector v onto a plane defined by a normal. The projected vector is * returned in vproj. * @static * @param {Vector3} v The vector coordinate. - * @param {Vector3} normal + * @param {Vector3} normal * @param {Vector3} vproj The projection vector's coordinate.. */ -export function projectVector(v: Vector3, normal: Vector3, vproj: Vector3,): void; +export function projectVector( + v: Vector3, + normal: Vector3, + vproj: Vector3 +): void; /** * Project a point x onto plane defined by origin and normal. The projected @@ -266,43 +284,52 @@ export function projectVector(v: Vector3, normal: Vector3, vproj: Vector3,): voi * @param {Vector3} normal * @param {Vector3} xproj */ -export function generalizedProjectPoint(x: any, origin: Vector3, normal: Vector3, xproj: Vector3): void; +export function generalizedProjectPoint( + x: any, + origin: Vector3, + normal: Vector3, + xproj: Vector3 +): void; /** * Given a line defined by the two points p1,p2; and a plane defined by the normal n and point p0, compute an intersection. * Return an object: - * + * * ```js * let obj = {intersection: ..., betweenPoints: ..., t: ..., x: ...}; * ``` - * + * * where: * - **intersection** (_boolean_): indicates if the plane and line intersect. * - **betweenPoints** (_boolean_): indicates if the intersection is between the provided points. True if (0 <= t <= 1), and false otherwise. * - **t** (_Number_): parametric coordinate along the line. * - **x** (_Array_): coordinates of intersection. - * + * * If the plane and line are parallel, intersection is false and t is set to * Number.MAX_VALUE. * @static - * @param {Vector3} p1 - * @param {Vector3} p2 + * @param {Vector3} p1 + * @param {Vector3} p2 * @param {Vector3} origin The coordinate of the origin point. - * @param {Vector3} normal + * @param {Vector3} normal */ -export function intersectWithLine(p1: Vector3, p2: Vector3, origin: Vector3, normal: Vector3): IIntersectWithLine; - +export function intersectWithLine( + p1: Vector3, + p2: Vector3, + origin: Vector3, + normal: Vector3 +): IIntersectWithLine; /** * Given a planes defined by the normals n0 & n1 and origin points p0 & p1, * compute the line representing the plane intersection. Return an object: - * + * * ```js * let obj = {intersection: ..., error: ..., l0: ..., l1: ...}; * ``` - * + * * where: - * + * * - **intersection** (_boolean_): indicates if the two planes intersect. * Intersection is true if (0 <= t <= 1), and false otherwise. * - **l0** (_Array_): coordinates of point 0 of the intersection line. @@ -310,12 +337,17 @@ export function intersectWithLine(p1: Vector3, p2: Vector3, origin: Vector3, nor * - **error** (_String|null_): Conditional, if the planes do not intersect, * is it because they are coplanar (`COINCIDE`) or parallel (`DISJOINT`). * @static - * @param {Vector3} plane1Origin - * @param {Vector3} plane1Normal - * @param {Vector3} plane2Origin - * @param {Vector3} plane2Normal + * @param {Vector3} plane1Origin + * @param {Vector3} plane1Normal + * @param {Vector3} plane2Origin + * @param {Vector3} plane2Normal */ -export function intersectWithPlane(plane1Origin: Vector3, plane1Normal: Vector3, plane2Origin: Vector3, plane2Normal: Vector3): IIntersectWithLine; +export function intersectWithPlane( + plane1Origin: Vector3, + plane1Normal: Vector3, + plane2Origin: Vector3, + plane2Normal: Vector3 +): IIntersectWithLine; /** * Constants for the `intersectWithPlane` function. @@ -333,14 +365,14 @@ export declare const DISJOINT: string; * plane normal. */ export declare const vtkPlane: { - newInstance: typeof newInstance, - extend: typeof extend, - evaluate: typeof evaluate, - distanceToPlane: typeof distanceToPlane, - projectPoint: typeof projectPoint, - projectVector: typeof projectVector, - generalizedProjectPoint: typeof generalizedProjectPoint, - intersectWithLine: typeof intersectWithLine, - intersectWithPlane: typeof intersectWithPlane, + newInstance: typeof newInstance; + extend: typeof extend; + evaluate: typeof evaluate; + distanceToPlane: typeof distanceToPlane; + projectPoint: typeof projectPoint; + projectVector: typeof projectVector; + generalizedProjectPoint: typeof generalizedProjectPoint; + intersectWithLine: typeof intersectWithLine; + intersectWithPlane: typeof intersectWithPlane; }; export default vtkPlane; diff --git a/Sources/Common/DataModel/PointSet/index.d.ts b/Sources/Common/DataModel/PointSet/index.d.ts index fea7406848a..76e172699c9 100755 --- a/Sources/Common/DataModel/PointSet/index.d.ts +++ b/Sources/Common/DataModel/PointSet/index.d.ts @@ -5,36 +5,34 @@ import vtkDataSet, { IDataSetInitialValues } from '../DataSet'; /** * */ -export interface IPointSetInitialValues extends IDataSetInitialValues { -} +export interface IPointSetInitialValues extends IDataSetInitialValues {} export interface vtkPointSet extends vtkDataSet { + /** + * Compute the (X, Y, Z) bounds of the data. + */ + computeBounds(): void; - /** - * Compute the (X, Y, Z) bounds of the data. - */ - computeBounds(): void; - - /** - * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @return {Bounds} The bounds for the mapper. - */ - getBounds(): Bounds; + /** + * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @return {Bounds} The bounds for the mapper. + */ + getBounds(): Bounds; - /** - * - */ - getNumberOfPoints(): number; + /** + * + */ + getNumberOfPoints(): number; - /** - * - */ - getPoints(): vtkPoints; + /** + * + */ + getPoints(): vtkPoints; - /** - * - */ - setPoints(points: vtkPoints): boolean; + /** + * + */ + setPoints(points: vtkPoints): boolean; } /** @@ -44,13 +42,19 @@ export interface vtkPointSet extends vtkDataSet { * @param model object on which data structure will be bounds (protected) * @param {IPointSetInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPointSetInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPointSetInitialValues +): void; /** * Method used to create a new instance of vtkPointSet. * @param {IPointSetInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IPointSetInitialValues): vtkPointSet; +export function newInstance( + initialValues?: IPointSetInitialValues +): vtkPointSet; /** * vtkPointSet is an abstract class that specifies the interface for @@ -61,7 +65,7 @@ export function newInstance(initialValues?: IPointSetInitialValues): vtkPointSet * positions implicitly. */ export declare const vtkPointSet: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkPointSet; diff --git a/Sources/Common/DataModel/PolyData/Constants.d.ts b/Sources/Common/DataModel/PolyData/Constants.d.ts index b662ba52544..16bf84c9d9a 100644 --- a/Sources/Common/DataModel/PolyData/Constants.d.ts +++ b/Sources/Common/DataModel/PolyData/Constants.d.ts @@ -1,6 +1,6 @@ -export declare const POLYDATA_FIELDS : string[]; +export declare const POLYDATA_FIELDS: string[]; declare const _default: { - POLYDATA_FIELDS: typeof POLYDATA_FIELDS; + POLYDATA_FIELDS: typeof POLYDATA_FIELDS; }; export default _default; diff --git a/Sources/Common/DataModel/PolyData/index.d.ts b/Sources/Common/DataModel/PolyData/index.d.ts index b8642aba14a..3f86c14561c 100755 --- a/Sources/Common/DataModel/PolyData/index.d.ts +++ b/Sources/Common/DataModel/PolyData/index.d.ts @@ -5,144 +5,141 @@ import vtkPointSet, { IPointSetInitialValues } from '../PointSet'; /** * */ -export interface IPolyDataInitialValues extends IPointSetInitialValues { -} - +export interface IPolyDataInitialValues extends IPointSetInitialValues {} export interface vtkPolyData extends vtkPointSet { - - /** - * Create data structure that allows random access of cells. - */ - buildCells(): void; - - /** - * Create upward links from points to cells that use each point. Enables - * topologically complex queries. - * @param {Number} initialSize - */ - buildLinks(initialSize?: number): void; - - /** - * If you know the type of cell, you may provide it to improve performances. - * @param {Number} cellId - * @param cellHint - */ - getCell(cellId: number, cellHint: any): void; - - /** - * Get the neighbors at an edge. - * @param {Number} cellId The Id of the cell. - * @param {Vector3} point1 The first point coordinate. - * @param {Vector3} point2 The second point coordinate. - */ - getCellEdgeNeighbors(cellId: number, point1: Vector3, point2: Vector3): void; - - /** - * Get a list of point ids that define a cell. - * @param {Number} cellId The Id of the cell. - * @return an object made of the cellType and a subarray `cellPointIds` of the cell points. - */ - getCellPoints(cellId: number): object; - - /** - * Get the type of the cell - * @param {Number} cellId The Id of the cell. - * @return CellType The type of the cell. - */ - getCellType(cellId: number): CellType; - - /** - * Get the cell array defining cells. - */ - getCells(): vtkCellArray; - - /** - * Get the cell array defining lines. - */ - getLines(): vtkCellArray; - - /** - * - */ - getLinks(): any; - - /** - * Determine the number of cells composing the polydata. - */ - getNumberOfCells(): number; - - /** - * Determine the number of lines composing the polydata. - */ - getNumberOfLines(): number; - - /** - * Determine the number of points composing the polydata. - */ - getNumberOfPoints(): number; - - /** - * Determine the number of polys composing the polydata. - */ - getNumberOfPolys(): number; - - /** - * Determine the number of strips composing the polydata. - */ - getNumberOfStrips(): number; - - /** - * Determine the number of vertices composing the polydata. - */ - getNumberOfVerts(): number; - - /** - * Topological inquiry to get cells using point. - * @param ptId - */ - getPointCells(ptId: any): void; - - /** - * Get the cell array defining polys. - */ - getPolys(): vtkCellArray; - - /** - * Get the cell array defining strips. - */ - getStrips(): vtkCellArray; - - /** - * Get the cell array defining vertices. - * If there are no vertices, an empty array will be returned (convenience to - * simplify traversal). - */ - getVerts(): vtkCellArray; - - /** - * Set the cell array defining lines. - * @param {vtkCellArray} lines The cell array defining lines. - */ - setLines(lines: vtkCellArray): boolean; - - /** - * Set the cell array defining polys. - * @param {vtkCellArray} polys The cell array defining polys. - */ - setPolys(polys: vtkCellArray): boolean; - - /** - * Set the cell array defining strips. - * @param {vtkCellArray} strips The cell array defining strips. - */ - setStrips(strips: vtkCellArray): boolean; - - /** - * Set the cell array defining vertices. - * @param {vtkCellArray} verts The cell array defining vertices. - */ - setVerts(verts: vtkCellArray): boolean; + /** + * Create data structure that allows random access of cells. + */ + buildCells(): void; + + /** + * Create upward links from points to cells that use each point. Enables + * topologically complex queries. + * @param {Number} initialSize + */ + buildLinks(initialSize?: number): void; + + /** + * If you know the type of cell, you may provide it to improve performances. + * @param {Number} cellId + * @param cellHint + */ + getCell(cellId: number, cellHint: any): void; + + /** + * Get the neighbors at an edge. + * @param {Number} cellId The Id of the cell. + * @param {Vector3} point1 The first point coordinate. + * @param {Vector3} point2 The second point coordinate. + */ + getCellEdgeNeighbors(cellId: number, point1: Vector3, point2: Vector3): void; + + /** + * Get a list of point ids that define a cell. + * @param {Number} cellId The Id of the cell. + * @return an object made of the cellType and a subarray `cellPointIds` of the cell points. + */ + getCellPoints(cellId: number): object; + + /** + * Get the type of the cell + * @param {Number} cellId The Id of the cell. + * @return CellType The type of the cell. + */ + getCellType(cellId: number): CellType; + + /** + * Get the cell array defining cells. + */ + getCells(): vtkCellArray; + + /** + * Get the cell array defining lines. + */ + getLines(): vtkCellArray; + + /** + * + */ + getLinks(): any; + + /** + * Determine the number of cells composing the polydata. + */ + getNumberOfCells(): number; + + /** + * Determine the number of lines composing the polydata. + */ + getNumberOfLines(): number; + + /** + * Determine the number of points composing the polydata. + */ + getNumberOfPoints(): number; + + /** + * Determine the number of polys composing the polydata. + */ + getNumberOfPolys(): number; + + /** + * Determine the number of strips composing the polydata. + */ + getNumberOfStrips(): number; + + /** + * Determine the number of vertices composing the polydata. + */ + getNumberOfVerts(): number; + + /** + * Topological inquiry to get cells using point. + * @param ptId + */ + getPointCells(ptId: any): void; + + /** + * Get the cell array defining polys. + */ + getPolys(): vtkCellArray; + + /** + * Get the cell array defining strips. + */ + getStrips(): vtkCellArray; + + /** + * Get the cell array defining vertices. + * If there are no vertices, an empty array will be returned (convenience to + * simplify traversal). + */ + getVerts(): vtkCellArray; + + /** + * Set the cell array defining lines. + * @param {vtkCellArray} lines The cell array defining lines. + */ + setLines(lines: vtkCellArray): boolean; + + /** + * Set the cell array defining polys. + * @param {vtkCellArray} polys The cell array defining polys. + */ + setPolys(polys: vtkCellArray): boolean; + + /** + * Set the cell array defining strips. + * @param {vtkCellArray} strips The cell array defining strips. + */ + setStrips(strips: vtkCellArray): boolean; + + /** + * Set the cell array defining vertices. + * @param {vtkCellArray} verts The cell array defining vertices. + */ + setVerts(verts: vtkCellArray): boolean; } /** @@ -152,19 +149,25 @@ export interface vtkPolyData extends vtkPointSet { * @param model object on which data structure will be bounds (protected) * @param {IPolyDataInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPolyDataInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPolyDataInitialValues +): void; /** * Method used to create a new instance of vtkPolyData. * @param {IPolyDataInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IPolyDataInitialValues): vtkPolyData; +export function newInstance( + initialValues?: IPolyDataInitialValues +): vtkPolyData; /** * vtkPolyData is a dataset that represents a geometric structure consisting of vertices, lines, polygons, and/or strips. */ export declare const vtkPolyData: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkPolyData; diff --git a/Sources/Common/DataModel/PolyLine/index.d.ts b/Sources/Common/DataModel/PolyLine/index.d.ts index 28b0eaaa930..e1d5b08d6bc 100644 --- a/Sources/Common/DataModel/PolyLine/index.d.ts +++ b/Sources/Common/DataModel/PolyLine/index.d.ts @@ -3,51 +3,68 @@ import { Nullable, Vector2, Vector3 } from '../../../types'; import vtkCell, { ICellInitialValues } from '../Cell'; import { IIntersectWithLine } from '../Line'; -export interface IPolyLineInitialValues extends ICellInitialValues { } +export interface IPolyLineInitialValues extends ICellInitialValues {} export interface vtkPolyLine extends vtkCell { + /** + * Get the topological dimensional of the cell (0, 1, 2 or 3). + */ + getCellDimension(): number; - /** - * Get the topological dimensional of the cell (0, 1, 2 or 3). - */ - getCellDimension(): number; - - /** - * @param {number} t1 - * @param {number} t2 - * @param {Vector3} p1 The first point coordinate. - * @param {Vector3} p2 The second point coordinate. - * @param {Number} tol The tolerance to use. - * @param {Vector3} x The point which intersect the line. - * @param {Vector3} pcoords The parametric coordinates. - */ - intersectWithLine(t1: number, t2: number, p1: Vector3, p2: Vector3, tol: number, x: Vector3, pcoords: Vector3): IIntersectWithLine; + /** + * @param {number} t1 + * @param {number} t2 + * @param {Vector3} p1 The first point coordinate. + * @param {Vector3} p2 The second point coordinate. + * @param {Number} tol The tolerance to use. + * @param {Vector3} x The point which intersect the line. + * @param {Vector3} pcoords The parametric coordinates. + */ + intersectWithLine( + t1: number, + t2: number, + p1: Vector3, + p2: Vector3, + tol: number, + x: Vector3, + pcoords: Vector3 + ): IIntersectWithLine; /** * Determine global coordinate (x[3]) from subId and parametric coordinates. * Also set interpolation weights. (There are two weights for the two * points of the line segment specified by subId) - * + * * @param {number} subId * @param {Vector3} pcoords The parametric coordinates * @param {Vector3} x The global coordinate * @param {Vector2} weights The interpolation weights */ - evaluateLocation(subId: number, pcoords: Vector3, x: Vector3, weights: Vector2): void + evaluateLocation( + subId: number, + pcoords: Vector3, + x: Vector3, + weights: Vector2 + ): void; /** * Determine global orientation (q[3]) from subId and parametric coordinates. * This uses the same algorithm as vtkLine (interpolates using slerp). * Also set interpolation weights. (There are two weights for the two * points of the line segment specified by subId) - * + * * @param {number} subId * @param {Vector3} pcoords The parametric coordinates * @param {Vector3} q The global orientation * @param {Vector2} weights The interpolation weights * @returns {boolean} Wether the orientation has been set in `q' */ - evaluateOrientation(subId: number, pcoords: Vector3, q: quat, weights: Vector2): boolean + evaluateOrientation( + subId: number, + pcoords: Vector3, + q: quat, + weights: Vector2 + ): boolean; /** * Returns an array containing for each pointIdx between 0 (included) and @@ -56,14 +73,14 @@ export interface vtkPolyLine extends vtkCell { * In particular if tda = publicAPI.getDistancesToFirstPoint(), then tda[0] = 0 * and tda[tda.length - 1] is the total length of the polyline */ - getDistancesToFirstPoint(): number[] + getDistancesToFirstPoint(): number[]; /** * Returns the subId of the segment at the given distance from the first * point of the polyline * If the distance is negative or greater than the total length of the * polyline, returns -1 - * + * * @param distance The distance from the first point of the polyline */ findPointIdAtDistanceFromFirstPoint(distance: number): number; @@ -101,22 +118,28 @@ export interface vtkPolyLine extends vtkCell { * @param model object on which data structure will be bounds (protected) * @param {IPolyLineInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPolyLineInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPolyLineInitialValues +): void; /** * Method used to create a new instance of vtkPolyLine. * @param {IPolyLineInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IPolyLineInitialValues): vtkPolyLine; +export function newInstance( + initialValues?: IPolyLineInitialValues +): vtkPolyLine; -/** +/** * vtkPolyLine is a cell which representant a poly line. - * + * * @see vtkCell */ export declare const vtkPolyLine: { - newInstance: typeof newInstance, - extend: typeof extend; + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkPolyLine; diff --git a/Sources/Common/DataModel/Polygon/index.d.ts b/Sources/Common/DataModel/Polygon/index.d.ts index 9842609ed8e..625ff29a82e 100644 --- a/Sources/Common/DataModel/Polygon/index.d.ts +++ b/Sources/Common/DataModel/Polygon/index.d.ts @@ -1,44 +1,42 @@ -import { vtkObject } from "../../../interfaces"; -import { Bounds, TypedArray, Vector3 } from "../../../types"; +import { vtkObject } from '../../../interfaces'; +import { Bounds, TypedArray, Vector3 } from '../../../types'; export interface IPolygonInitialValues { - firstPoint?: Vector3, - pointCount?: number, - tris?: Vector3[], + firstPoint?: Vector3; + pointCount?: number; + tris?: Vector3[]; } /** * Different states which pointInPolygon could return. */ export enum PolygonIntersectionState { - FAILURE, - OUTSIDE, - INSIDE, - INTERSECTION, - ON_LINE, + FAILURE, + OUTSIDE, + INSIDE, + INTERSECTION, + ON_LINE, } export interface vtkPolygon extends vtkObject { + /** + * Get the array of triangles that triangulate the polygon. + */ + getPointArray(): Vector3[]; - /** - * Get the array of triangles that triangulate the polygon. - */ - getPointArray(): Vector3[]; - - /** - * Set the polygon's points. - * @param {Vector3[]} points The polygon's points. - */ - setPoints(points: Vector3[]): void; - - /** - * Triangulate this polygon. - * The output data must be accessed through `getPointArray`. - * The output data contains points by group of three: each three-group - * defines one triangle. - */ - triangulate(): void; + /** + * Set the polygon's points. + * @param {Vector3[]} points The polygon's points. + */ + setPoints(points: Vector3[]): void; + /** + * Triangulate this polygon. + * The output data must be accessed through `getPointArray`. + * The output data contains points by group of three: each three-group + * defines one triangle. + */ + triangulate(): void; } /** @@ -57,7 +55,7 @@ export interface vtkPolygon extends vtkObject { */ export function pointInPolygon( point: Vector3, - vertices: Array|TypedArray, + vertices: Array | TypedArray, bounds: Bounds, normal: Vector3 ): PolygonIntersectionState; @@ -69,7 +67,11 @@ export function pointInPolygon( * @param model object on which data structure will be bounds (protected) * @param {IPolygonInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPolygonInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPolygonInitialValues +): void; /** * Method used to create a new instance of vtkPolygon. @@ -79,15 +81,14 @@ export function newInstance(initialValues?: IPolygonInitialValues): vtkPolygon; /** * vtkPolygon represents a 2D n-sided polygon. - * + * * The polygons cannot have any internal holes, and cannot self-intersect. * Define the polygon with n-points ordered in the counter-clockwise direction. * Do not repeat the last point. */ export declare const vtkPolygon: { - newInstance: typeof newInstance, - extend: typeof extend; - // static - + newInstance: typeof newInstance; + extend: typeof extend; + // static }; export default vtkPolygon; diff --git a/Sources/Common/DataModel/SelectionNode/Constants.d.ts b/Sources/Common/DataModel/SelectionNode/Constants.d.ts index a01cc84912b..e00a8db2c6c 100644 --- a/Sources/Common/DataModel/SelectionNode/Constants.d.ts +++ b/Sources/Common/DataModel/SelectionNode/Constants.d.ts @@ -1,27 +1,27 @@ export declare enum SelectionContent { - GLOBALIDS = 0, - PEDIGREEIDS = 1, - VALUES = 2, - INDICES = 3, - FRUSTUM = 4, - LOCATIONS = 5, - THRESHOLDS = 6, - BLOCKS = 7, - QUERY = 8, + GLOBALIDS = 0, + PEDIGREEIDS = 1, + VALUES = 2, + INDICES = 3, + FRUSTUM = 4, + LOCATIONS = 5, + THRESHOLDS = 6, + BLOCKS = 7, + QUERY = 8, } export declare enum SelectionField { - CELL = 0, - POINT = 1, - FIELD = 2, - VERTEX = 3, - EDGE = 4, - ROW = 5, + CELL = 0, + POINT = 1, + FIELD = 2, + VERTEX = 3, + EDGE = 4, + ROW = 5, } declare const _default: { - SelectionContent: typeof SelectionContent; - SelectionField: typeof SelectionField; -} + SelectionContent: typeof SelectionContent; + SelectionField: typeof SelectionField; +}; export default _default; diff --git a/Sources/Common/DataModel/SelectionNode/index.d.ts b/Sources/Common/DataModel/SelectionNode/index.d.ts index 7623b8590b3..fa006c85331 100644 --- a/Sources/Common/DataModel/SelectionNode/index.d.ts +++ b/Sources/Common/DataModel/SelectionNode/index.d.ts @@ -1,70 +1,70 @@ -import { vtkObject } from "../../../interfaces" ; -import { Bounds } from "../../../types"; -import { SelectionContent, SelectionField } from "./Constants"; -import vtkProp from "../../../Rendering/Core/Prop"; +import { vtkObject } from '../../../interfaces'; +import { Bounds } from '../../../types'; +import { SelectionContent, SelectionField } from './Constants'; +import vtkProp from '../../../Rendering/Core/Prop'; export interface ISelectionNodeInitialValues { - contentType?: SelectionContent; - fieldType?: SelectionField; - properties?: ISelectionNodeProperties; - selectionList?: number[]; + contentType?: SelectionContent; + fieldType?: SelectionField; + properties?: ISelectionNodeProperties; + selectionList?: number[]; } export interface ISelectionNodeProperties { - propID?: number; - prop?: vtkProp; - compositeID?: number; - attributeID?: number; - pixelCount?: number; - displayPosition?: [number, number, number]; - worldPosition?: [number, number, number]; + propID?: number; + prop?: vtkProp; + compositeID?: number; + attributeID?: number; + pixelCount?: number; + displayPosition?: [number, number, number]; + worldPosition?: [number, number, number]; } export interface vtkSelectionNode extends vtkObject { - /** - * Get the bounds of the selection points. - */ - getBounds(): Bounds; + /** + * Get the bounds of the selection points. + */ + getBounds(): Bounds; - /** - * Returns -1 if not initialized. - */ - getContentType(): SelectionContent | -1; + /** + * Returns -1 if not initialized. + */ + getContentType(): SelectionContent | -1; - /** - * This functions is called internally by VTK.js and is not intended for public use. - */ - setContentType(contentType: SelectionContent): void; + /** + * This functions is called internally by VTK.js and is not intended for public use. + */ + setContentType(contentType: SelectionContent): void; - /** - * Returns -1 if not initialized. - */ - getFieldType(): SelectionField | -1; + /** + * Returns -1 if not initialized. + */ + getFieldType(): SelectionField | -1; - /** - * This functions is called internally by VTK.js and is not intended for public use. - */ - setFieldType(fieldType: SelectionField): void; + /** + * This functions is called internally by VTK.js and is not intended for public use. + */ + setFieldType(fieldType: SelectionField): void; - /** - * Get the selection properties. - */ - getProperties(): ISelectionNodeProperties; + /** + * Get the selection properties. + */ + getProperties(): ISelectionNodeProperties; - /** - * This functions is called internally by VTK.js and is not intended for public use. - */ - setProperties(properties: ISelectionNodeProperties): boolean; - - /** - * Get the list of the underlying selected attribute IDs. - */ - getSelectionList(): number[]; + /** + * This functions is called internally by VTK.js and is not intended for public use. + */ + setProperties(properties: ISelectionNodeProperties): boolean; - /** - * This functions is called internally by VTK.js and is not intended for public use. - */ - setSelectionList(selectionAttributeIDs: ISelectionNodeProperties): boolean; + /** + * Get the list of the underlying selected attribute IDs. + */ + getSelectionList(): number[]; + + /** + * This functions is called internally by VTK.js and is not intended for public use. + */ + setSelectionList(selectionAttributeIDs: ISelectionNodeProperties): boolean; } /** @@ -74,25 +74,31 @@ export interface vtkSelectionNode extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {ISelectionNodeInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ISelectionNodeInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ISelectionNodeInitialValues +): void; /** * Method used to create a new instance of vtkSelectionNode. * @param {ISelectionNodeInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ISelectionNodeInitialValues): vtkSelectionNode; +export function newInstance( + initialValues?: ISelectionNodeInitialValues +): vtkSelectionNode; /** * vtkSelectionNode represents a 2D n-sided polygon. - * + * * The polygons cannot have any internal holes, and cannot self-intersect. * Define the polygon with n-points ordered in the counter-clockwise direction. * Do not repeat the last point. */ export declare const vtkSelectionNode: { - newInstance: typeof newInstance, - extend: typeof extend; - SelectionContent: typeof SelectionContent; - SelectionField: typeof SelectionField; + newInstance: typeof newInstance; + extend: typeof extend; + SelectionContent: typeof SelectionContent; + SelectionField: typeof SelectionField; }; export default vtkSelectionNode; diff --git a/Sources/Common/DataModel/Sphere/index.d.ts b/Sources/Common/DataModel/Sphere/index.d.ts index 31b9bccbed0..b137b4bddf7 100755 --- a/Sources/Common/DataModel/Sphere/index.d.ts +++ b/Sources/Common/DataModel/Sphere/index.d.ts @@ -1,68 +1,66 @@ -import { vtkObject } from "../../../interfaces" ; -import { Bounds, Vector3 } from "../../../types"; - +import { vtkObject } from '../../../interfaces'; +import { Bounds, Vector3 } from '../../../types'; export interface ISphereInitialValues { - radius?: number; - center?: Vector3; + radius?: number; + center?: Vector3; } export interface vtkSphere extends vtkObject { - - /** - * Given the point xyz (three floating value) evaluate the sphere - * equation. - * @param {Vector3} xyz The point coordinate. - */ - evaluateFunction(xyz: Vector3): number[]; - - /** - * Given the point xyz (three floating values) evaluate the equation for the - * sphere gradient. - * @param {Vector3} xyz The point coordinate. - */ - evaluateGradient(xyz: Vector3): number[]; - - /** - * Get the center of the sphere. - */ - getCenter(): Vector3; - - /** - * Get the center of the sphere. - */ - getCenterByReference(): Vector3; - - /** - * Get the radius of the sphere. - */ - getRadius(): number; - - /** - * Set the center of the sphere. - * @param {Vector3} center The center coordinate. - */ - setCenter(center: Vector3): boolean; - - /** - * Set the center of the sphere. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setCenter(x: number, y: number, z: number): boolean; - - /** - * Set the center of the sphere. - * @param {Vector3} center The center coordinate. - */ - setCenterFrom(center: Vector3): boolean; - - /** - * Set the radius of the sphere. - * @param {Number} radius The radius of the sphere. - */ - setRadius(radius: number): boolean; + /** + * Given the point xyz (three floating value) evaluate the sphere + * equation. + * @param {Vector3} xyz The point coordinate. + */ + evaluateFunction(xyz: Vector3): number[]; + + /** + * Given the point xyz (three floating values) evaluate the equation for the + * sphere gradient. + * @param {Vector3} xyz The point coordinate. + */ + evaluateGradient(xyz: Vector3): number[]; + + /** + * Get the center of the sphere. + */ + getCenter(): Vector3; + + /** + * Get the center of the sphere. + */ + getCenterByReference(): Vector3; + + /** + * Get the radius of the sphere. + */ + getRadius(): number; + + /** + * Set the center of the sphere. + * @param {Vector3} center The center coordinate. + */ + setCenter(center: Vector3): boolean; + + /** + * Set the center of the sphere. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setCenter(x: number, y: number, z: number): boolean; + + /** + * Set the center of the sphere. + * @param {Vector3} center The center coordinate. + */ + setCenterFrom(center: Vector3): boolean; + + /** + * Set the radius of the sphere. + * @param {Number} radius The radius of the sphere. + */ + setRadius(radius: number): boolean; } /** @@ -72,7 +70,11 @@ export interface vtkSphere extends vtkObject { * @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; +export function extend( + publicAPI: object, + model: object, + initialValues?: ISphereInitialValues +): void; /** * Method used to create a new instance of vtkSphere. @@ -81,17 +83,17 @@ export function extend(publicAPI: object, model: object, initialValues?: ISphere export function newInstance(initialValues?: ISphereInitialValues): vtkSphere; /** -* @param {Number} radius -* @param {Vector3} center -* @param {Vector3} x -*/ + * @param {Number} radius + * @param {Vector3} center + * @param {Vector3} x + */ declare function evaluate(radius: number, center: Vector3, x: Vector3): number; /** -* -* @param {Vector3} point -* @param {Bounds} bounds -*/ + * + * @param {Vector3} point + * @param {Bounds} bounds + */ declare function isPointIn3DEllipse(point: Vector3, bounds: Bounds): boolean; /** @@ -100,9 +102,9 @@ declare function isPointIn3DEllipse(point: Vector3, bounds: Bounds): boolean; * at any given point inside the spline intervals. */ export declare const vtkSphere: { - newInstance: typeof newInstance, - extend: typeof extend; - evaluate: typeof evaluate; - isPointIn3DEllipse: typeof isPointIn3DEllipse; + newInstance: typeof newInstance; + extend: typeof extend; + evaluate: typeof evaluate; + isPointIn3DEllipse: typeof isPointIn3DEllipse; }; export default vtkSphere; diff --git a/Sources/Common/DataModel/Spline1D/index.d.ts b/Sources/Common/DataModel/Spline1D/index.d.ts index 9b431baf3d7..67b0e112563 100755 --- a/Sources/Common/DataModel/Spline1D/index.d.ts +++ b/Sources/Common/DataModel/Spline1D/index.d.ts @@ -1,5 +1,4 @@ -import { vtkObject } from "../../../interfaces" ; - +import { vtkObject } from '../../../interfaces'; export interface ISpline1DInitialValues {} @@ -10,43 +9,58 @@ export interface ISpline1DInitialValues {} // SECOND_DERIVATIVE_INTERIOR_POINT : desired second derivative at boundary point is the boundary value given times second derivative // at first interior point. export enum BoundaryCondition { - DEFAULT, - DERIVATIVE, - SECOND_DERIVATIVE, - SECOND_DERIVATIVE_INTERIOR_POINT, - } + DEFAULT, + DERIVATIVE, + SECOND_DERIVATIVE, + SECOND_DERIVATIVE_INTERIOR_POINT, +} export interface vtkSpline1D extends vtkObject { + /** + * + * @param {Number} size + * @param {Float32Array} work + * @param {Number[]} x + * @param {Number[]} y + */ + computeCloseCoefficients( + size: number, + work: Float32Array, + x: number[], + y: number[] + ): void; + + /** + * + * @param {Number} size + * @param {Float32Array} work + * @param {Number[]} x + * @param {Number[]} y + * @param {Object} options + * @param {BoundaryCondition} options.leftConstraint + * @param {Number} options.leftValue + * @param {BoundaryCondition} options.rightConstraint + * @param {Number} options.rightValue + */ + computeOpenCoefficients( + size: number, + work: Float32Array, + x: number[], + y: number[], + options: { + leftConstraint: BoundaryCondition; + leftValue: number; + rightConstraint: BoundaryCondition; + rightValue: Number; + } + ): void; - /** - * - * @param {Number} size - * @param {Float32Array} work - * @param {Number[]} x - * @param {Number[]} y - */ - computeCloseCoefficients(size: number, work: Float32Array, x: number[], y: number[]): void; - - /** - * - * @param {Number} size - * @param {Float32Array} work - * @param {Number[]} x - * @param {Number[]} y - * @param {Object} options - * @param {BoundaryCondition} options.leftConstraint - * @param {Number} options.leftValue - * @param {BoundaryCondition} options.rightConstraint - * @param {Number} options.rightValue - */ - computeOpenCoefficients(size: number, work: Float32Array, x: number[], y: number[], options: { leftConstraint: BoundaryCondition, leftValue: number, rightConstraint: BoundaryCondition, rightValue: Number }): void; - - /** - * - * @param {Number} intervalIndex - * @param {Number} t - */ - getValue(intervalIndex: number, t: number): void; + /** + * + * @param {Number} intervalIndex + * @param {Number} t + */ + getValue(intervalIndex: number, t: number): void; } /** @@ -56,13 +70,19 @@ export interface vtkSpline1D extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {ISpline1DInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ISpline1DInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ISpline1DInitialValues +): void; /** * Method used to create a new instance of vtkSpline1D. * @param {ISpline1DInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ISpline1DInitialValues): vtkSpline1D; +export function newInstance( + initialValues?: ISpline1DInitialValues +): vtkSpline1D; /** * vtkSpline1D provides methods for creating a 1D cubic spline object from given @@ -70,7 +90,7 @@ export function newInstance(initialValues?: ISpline1DInitialValues): vtkSpline1D * at any given point inside the spline intervals. */ export declare const vtkSpline1D: { - newInstance: typeof newInstance, - extend: typeof extend + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkSpline1D; diff --git a/Sources/Common/DataModel/Spline3D/Constants.d.ts b/Sources/Common/DataModel/Spline3D/Constants.d.ts index 66daf3acc79..d4f23cd3b18 100644 --- a/Sources/Common/DataModel/Spline3D/Constants.d.ts +++ b/Sources/Common/DataModel/Spline3D/Constants.d.ts @@ -1,9 +1,9 @@ export declare enum splineKind { - CARDINAL_SPLINE = 'CARDINAL_SPLINE', - KOCHANEK_SPLINE = 'KOCHANEK_SPLINE', + CARDINAL_SPLINE = 'CARDINAL_SPLINE', + KOCHANEK_SPLINE = 'KOCHANEK_SPLINE', } declare const _default: { - splineKind: typeof splineKind; + splineKind: typeof splineKind; }; export default _default; diff --git a/Sources/Common/DataModel/Spline3D/index.d.ts b/Sources/Common/DataModel/Spline3D/index.d.ts index 7a3c032ffe2..4ac3babcb22 100755 --- a/Sources/Common/DataModel/Spline3D/index.d.ts +++ b/Sources/Common/DataModel/Spline3D/index.d.ts @@ -1,29 +1,28 @@ -import { vtkObject } from "../../../interfaces"; -import { splineKind } from "./Constants"; +import { vtkObject } from '../../../interfaces'; +import { splineKind } from './Constants'; export interface ISpline3DInitialValues { - close?: boolean; - intervals?: any; - kind?: splineKind, - tension?: number; - continuity?: number; - bias?: number; + close?: boolean; + intervals?: any; + kind?: splineKind; + tension?: number; + continuity?: number; + bias?: number; } export interface vtkSpline3D extends vtkObject { + /** + * + * @param points + */ + computeCoefficients(points: number[]): void; - /** - * - * @param points - */ - computeCoefficients(points: number[]): void; - - /** - * - * @param {Number} intervalIndex - * @param {Number} t - */ - getPoint(intervalIndex: number, t: number): number[]; + /** + * + * @param {Number} intervalIndex + * @param {Number} t + */ + getPoint(intervalIndex: number, t: number): number[]; } /** @@ -33,13 +32,19 @@ export interface vtkSpline3D extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {ISpline3DInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ISpline3DInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ISpline3DInitialValues +): void; /** * Method used to create a new instance of vtkSpline3D. * @param {ISpline3DInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ISpline3DInitialValues): vtkSpline3D; +export function newInstance( + initialValues?: ISpline3DInitialValues +): vtkSpline3D; /** * vtkSpline3D provides methods for creating a 1D cubic spline object from given @@ -47,7 +52,7 @@ export function newInstance(initialValues?: ISpline3DInitialValues): vtkSpline3D * at any given point inside the spline intervals. */ export declare const vtkSpline3D: { - newInstance: typeof newInstance; - extend: typeof extend; + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkSpline3D; diff --git a/Sources/Common/Transform/LandmarkTransform/index.d.ts b/Sources/Common/Transform/LandmarkTransform/index.d.ts index aff817db145..265fed71d02 100644 --- a/Sources/Common/Transform/LandmarkTransform/index.d.ts +++ b/Sources/Common/Transform/LandmarkTransform/index.d.ts @@ -3,68 +3,66 @@ import { vtkObject } from '../../../interfaces'; import vtkPoints from '../../Core/Points'; export enum Mode { - RIGID_BODY, - SIMILARITY, - AFFINE, + RIGID_BODY, + SIMILARITY, + AFFINE, } -export interface ILandmarkTransformInitialValues { - mode?: Mode; +export interface ILandmarkTransformInitialValues { + mode?: Mode; } - export interface vtkLandmarkTransform extends vtkObject { - - /** - * Mat4 matrix, result of the landmark transform. - * If vtkLandmarkTransformed failed, default is identity. - */ - getMatrix(): mat4; - - /** - * Get the number of degrees of freedom to constrain the solution to. - */ - getMode(): Mode; - - /** - * Get list of 3D points which defines the source points. - */ - getSourceLandmark(): vtkPoints; - - /** - * Get list of 3D points which defines the target points. - */ - getTargetLandmark(): vtkPoints; - - /** - * Set the number of degrees of freedom to constrain the solution to: - * - * - `Mode.RIGID_BODY` : Rotation and translation onlu - * - `Mode.SIMILARITY` : rotation, translation and isotropic scaling - * - `Mode.AFFINE` : collinearity is preserved. Ratios of distances along a line are preserved. - * - * @param {Mode} mode The value of mode. - * @default SIMILARITY - */ - setMode(mode: Mode): boolean; - - /** - * Set list of 3D points which defines the source points. - * @param {vtkPoints} sourceLandmark - */ - setSourceLandmark(sourceLandmark: vtkPoints): boolean; - - /** - * Set list of 3D points which defines the target points. - * @param {vtkPoints} targetLandmark - */ - setTargetLandmark(targetLandmark: vtkPoints): boolean; - - /** - * Launch the computation of the matrix according to target and source - * points. - */ - update(): void; + /** + * Mat4 matrix, result of the landmark transform. + * If vtkLandmarkTransformed failed, default is identity. + */ + getMatrix(): mat4; + + /** + * Get the number of degrees of freedom to constrain the solution to. + */ + getMode(): Mode; + + /** + * Get list of 3D points which defines the source points. + */ + getSourceLandmark(): vtkPoints; + + /** + * Get list of 3D points which defines the target points. + */ + getTargetLandmark(): vtkPoints; + + /** + * Set the number of degrees of freedom to constrain the solution to: + * + * - `Mode.RIGID_BODY` : Rotation and translation onlu + * - `Mode.SIMILARITY` : rotation, translation and isotropic scaling + * - `Mode.AFFINE` : collinearity is preserved. Ratios of distances along a line are preserved. + * + * @param {Mode} mode The value of mode. + * @default SIMILARITY + */ + setMode(mode: Mode): boolean; + + /** + * Set list of 3D points which defines the source points. + * @param {vtkPoints} sourceLandmark + */ + setSourceLandmark(sourceLandmark: vtkPoints): boolean; + + /** + * Set list of 3D points which defines the target points. + * @param {vtkPoints} targetLandmark + */ + setTargetLandmark(targetLandmark: vtkPoints): boolean; + + /** + * Launch the computation of the matrix according to target and source + * points. + */ + update(): void; } /** @@ -74,23 +72,28 @@ export interface vtkLandmarkTransform extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {ILandmarkTransformInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ILandmarkTransformInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ILandmarkTransformInitialValues +): void; /** * Method used to create a new instance of vtkLandmarkTransform. * @param {ILandmarkTransformInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ILandmarkTransformInitialValues): vtkLandmarkTransform; - +export function newInstance( + initialValues?: ILandmarkTransformInitialValues +): vtkLandmarkTransform; /** * vtkLandmarkTransform is a cell which representant a triangle. It contains static * method to make some computations directly link to triangle. - * + * * @example * '''js * import vtkLandmarkTransform from '@kitware/vtk.js/Common/Transform/LandmarkTransform'; - * + * * const transform = LandmarkTransform.New(); * transform.setMode(Mode.RIGID_BODY); * transform.setSourceLandmark(...); // vtkPoints @@ -100,7 +103,7 @@ export function newInstance(initialValues?: ILandmarkTransformInitialValues): vt * ''' */ export declare const vtkLandmarkTransform: { - newInstance: typeof newInstance, - extend: typeof extend; + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkLandmarkTransform; diff --git a/Sources/Common/Transform/Transform/index.d.ts b/Sources/Common/Transform/Transform/index.d.ts index 94ae435efc3..e20fb948b1d 100644 --- a/Sources/Common/Transform/Transform/index.d.ts +++ b/Sources/Common/Transform/Transform/index.d.ts @@ -2,131 +2,148 @@ import { mat4, vec3 } from 'gl-matrix'; import { vtkObject } from '../../../interfaces'; import { TypedArray } from '../../../types'; -export interface ITransformInitialValues { - preMultiplyFlag?: boolean; - matrix?: number[]; +export interface ITransformInitialValues { + preMultiplyFlag?: boolean; + matrix?: number[]; } type TSlicableArray = number[] | TypedArray; - export interface vtkTransform extends vtkObject { - - /** - * Mat4 matrix, used by vtkTransform to transform points, vertices, matrices... - * Default is identity. - */ - getMatrix(): mat4; - - /** - * @see getMatrix - * @param {mat4} matrix - */ - setMatrix(matrix: mat4): boolean; - - /** - * @see getMatrix - * Matrix is stored using gl-matrix conventions: column major - * @param e00 - * @param e01 - * @param e02 - * @param e03 - * @param e10 - * @param e11 - * @param e12 - * @param e13 - * @param e20 - * @param e21 - * @param e22 - * @param e23 - * @param e30 - * @param e31 - * @param e32 - * @param e33 - */ - setMatrix(e00: number, e01: number, e02: number, e03: number, e10: number, e11: number, e12: number, e13: number, e20: number, e21: number, e22: number, e23: number, e30: number, e31: number, e32: number, e33: number): boolean; - - /** - * The value of preMultiplyFlag indicates how matrix multiplications should occur. - * - * When in premultiply mode: - * All subsequent operations will occur before those already represented in the current transformation. - * In homogeneous matrix notation, M = M*A where M is the current transformation matrix and A is the applied matrix. - * - * When in postmultiply mode: - * All subsequent operations will occur after those already represented in the current transformation. - * In homogeneous matrix notation, M = A*M where M is the current transformation matrix and A is the applied matrix. - * - * This flag is also used in @see transformMatrix and @see transformMatrices to indicate how transform is applied to matrices: - * Premultiply: O_i = M * A_i - * Postmultiply: O_i = A_i * M - * where M is the current transformation matrix, A_i are the matrices in argument, O_i are the output matrices. - * - * The default is PreMultiply. - */ - getPreMultiplyFlag(): boolean; - - /** - * @see getPreMultiplyFlag - * @param preMultiplyFlag - */ - setPreMultiplyFlag(preMultiplyFlag: boolean): boolean; - - /** - * Set preMultiplyFlag to true - * @see getPreMultiplyFlag - */ - preMultiply(): void; - - /** - * Set preMultiplyFlag to false - * @see getPreMultiplyFlag - */ - postMultiply(): void; - - /** - * Transform a single point using the internal transform matrix - * The resulting point is: Pout = M * Pin where M is the internal matrix, Pin and Pout the in and out points - * @param point The point to transform, is not modified (except if point === out) - * @param out The receiving output point, is modified, can be the same as point - * @returns The out parameter - */ - transformPoint(point: vec3, out: vec3): vec3; - - /** - * Transform multiple points using the internal transform matrix - * See @see transformPoint for more info - * Modify the out array only - * @param points An array (typed or not) containing n*3 elements or of shape (n, 3) - * @param out An array (typed or not) containing n*3 elements or of shape (n, 3) - */ - transformPoints(points: TSlicableArray, out: TSlicableArray): TSlicableArray; - - - /** - * Transform a single matrix using the internal transform matrix - * The resulting matrix is: - * Mout = M * Min when in premultiply mode - * Mout = Min * M when in postmultiply mode - * @param matrix The matrix to transform, is not modified (except if matrix === out) - * @param out The receiving output matrix, is modified, can be the same as matrix - * @returns The out parameter - */ - transformMatrix(matrix: mat4, out: mat4): mat4; - - /** - * Transform multiple matrices using the internal transform matrix - * See @see transformMatrix for more info - * Modify the out array only - * @param matrices An array (typed or not) containing n*16 elements or of shape (n, 16) - * @param out An array (typed or not) containing n*16 elements or of shape (n, 16) - */ - transformMatrices(matrices: TSlicableArray, out: TSlicableArray): TSlicableArray; - - /** - * @returns A new transform with an inversed internal matrix. Also copy the premultiply flag @see getPreMultiplyFlag. - */ - getInverse(): vtkTransform; + /** + * Mat4 matrix, used by vtkTransform to transform points, vertices, matrices... + * Default is identity. + */ + getMatrix(): mat4; + + /** + * @see getMatrix + * @param {mat4} matrix + */ + setMatrix(matrix: mat4): boolean; + + /** + * @see getMatrix + * Matrix is stored using gl-matrix conventions: column major + * @param e00 + * @param e01 + * @param e02 + * @param e03 + * @param e10 + * @param e11 + * @param e12 + * @param e13 + * @param e20 + * @param e21 + * @param e22 + * @param e23 + * @param e30 + * @param e31 + * @param e32 + * @param e33 + */ + setMatrix( + e00: number, + e01: number, + e02: number, + e03: number, + e10: number, + e11: number, + e12: number, + e13: number, + e20: number, + e21: number, + e22: number, + e23: number, + e30: number, + e31: number, + e32: number, + e33: number + ): boolean; + + /** + * The value of preMultiplyFlag indicates how matrix multiplications should occur. + * + * When in premultiply mode: + * All subsequent operations will occur before those already represented in the current transformation. + * In homogeneous matrix notation, M = M*A where M is the current transformation matrix and A is the applied matrix. + * + * When in postmultiply mode: + * All subsequent operations will occur after those already represented in the current transformation. + * In homogeneous matrix notation, M = A*M where M is the current transformation matrix and A is the applied matrix. + * + * This flag is also used in @see transformMatrix and @see transformMatrices to indicate how transform is applied to matrices: + * Premultiply: O_i = M * A_i + * Postmultiply: O_i = A_i * M + * where M is the current transformation matrix, A_i are the matrices in argument, O_i are the output matrices. + * + * The default is PreMultiply. + */ + getPreMultiplyFlag(): boolean; + + /** + * @see getPreMultiplyFlag + * @param preMultiplyFlag + */ + setPreMultiplyFlag(preMultiplyFlag: boolean): boolean; + + /** + * Set preMultiplyFlag to true + * @see getPreMultiplyFlag + */ + preMultiply(): void; + + /** + * Set preMultiplyFlag to false + * @see getPreMultiplyFlag + */ + postMultiply(): void; + + /** + * Transform a single point using the internal transform matrix + * The resulting point is: Pout = M * Pin where M is the internal matrix, Pin and Pout the in and out points + * @param point The point to transform, is not modified (except if point === out) + * @param out The receiving output point, is modified, can be the same as point + * @returns The out parameter + */ + transformPoint(point: vec3, out: vec3): vec3; + + /** + * Transform multiple points using the internal transform matrix + * See @see transformPoint for more info + * Modify the out array only + * @param points An array (typed or not) containing n*3 elements or of shape (n, 3) + * @param out An array (typed or not) containing n*3 elements or of shape (n, 3) + */ + transformPoints(points: TSlicableArray, out: TSlicableArray): TSlicableArray; + + /** + * Transform a single matrix using the internal transform matrix + * The resulting matrix is: + * Mout = M * Min when in premultiply mode + * Mout = Min * M when in postmultiply mode + * @param matrix The matrix to transform, is not modified (except if matrix === out) + * @param out The receiving output matrix, is modified, can be the same as matrix + * @returns The out parameter + */ + transformMatrix(matrix: mat4, out: mat4): mat4; + + /** + * Transform multiple matrices using the internal transform matrix + * See @see transformMatrix for more info + * Modify the out array only + * @param matrices An array (typed or not) containing n*16 elements or of shape (n, 16) + * @param out An array (typed or not) containing n*16 elements or of shape (n, 16) + */ + transformMatrices( + matrices: TSlicableArray, + out: TSlicableArray + ): TSlicableArray; + + /** + * @returns A new transform with an inversed internal matrix. Also copy the premultiply flag @see getPreMultiplyFlag. + */ + getInverse(): vtkTransform; } /** @@ -136,14 +153,19 @@ export interface vtkTransform extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {ITransformInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ITransformInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ITransformInitialValues +): void; /** * Method used to create a new instance of vtkTransform. * @param {ITransformInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ITransformInitialValues): vtkTransform; - +export function newInstance( + initialValues?: ITransformInitialValues +): vtkTransform; /** * vtkTransform describes linear transformations via a 4x4 matrix. @@ -158,7 +180,7 @@ export function newInstance(initialValues?: ITransformInitialValues): vtkTransfo * ```js * import vtkTransform from '@kitware/vtk.js/Common/Transform/Transform'; * import vtkMatrixBuilder from '@kitware/vtk.js/Common/Core/MatrixBuilder'; - * + * * const transform = vtkTransform.newInstance(); * const matrix = vtkMatrixBuilder * .buildFromDegree() @@ -171,7 +193,7 @@ export function newInstance(initialValues?: ITransformInitialValues): vtkTransfo * ``` */ export declare const vtkTransform: { - newInstance: typeof newInstance, - extend: typeof extend; + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkTransform; diff --git a/Sources/Filters/General/AppendPolyData/index.d.ts b/Sources/Filters/General/AppendPolyData/index.d.ts index a058881d1b6..39fc227ca3d 100755 --- a/Sources/Filters/General/AppendPolyData/index.d.ts +++ b/Sources/Filters/General/AppendPolyData/index.d.ts @@ -1,50 +1,51 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; export enum DesiredOutputPrecision { - /** - * Output precision should match the input precision - */ - DEFAULT, + /** + * Output precision should match the input precision + */ + DEFAULT, - /** - * Output single-precision floating-point (i.e. float32) - */ - SINGLE, + /** + * Output single-precision floating-point (i.e. float32) + */ + SINGLE, - /** - * Output double-precision floating point (i.e. float64) - */ - DOUBLE + /** + * Output double-precision floating point (i.e. float64) + */ + DOUBLE, } /** * */ export interface IAppendPolyDataInitialValues { - outputPointsPrecision?: DesiredOutputPrecision; + outputPointsPrecision?: DesiredOutputPrecision; } type vtkAppendPolyDataBase = vtkObject & vtkAlgorithm; export interface vtkAppendPolyData extends vtkAppendPolyDataBase { + /** + * Get the desired precision for the output types. + */ + getOutputPointsPrecision(): DesiredOutputPrecision; - /** - * Get the desired precision for the output types. - */ - getOutputPointsPrecision(): DesiredOutputPrecision; + /** + * Set the desired precision for the output types. + * @param outputPointsPrecision + */ + setOutputPointsPrecision( + outputPointsPrecision: DesiredOutputPrecision + ): boolean; - /** - * Set the desired precision for the output types. - * @param outputPointsPrecision - */ - setOutputPointsPrecision(outputPointsPrecision: DesiredOutputPrecision): boolean; - - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; } /** @@ -54,14 +55,19 @@ export interface vtkAppendPolyData extends vtkAppendPolyDataBase { * @param model object on which data structure will be bounds (protected) * @param {IAppendPolyDataInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IAppendPolyDataInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IAppendPolyDataInitialValues +): void; /** * Method used to create a new instance of vtkAppendPolyData * @param {IAppendPolyDataInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IAppendPolyDataInitialValues): vtkAppendPolyData; - +export function newInstance( + initialValues?: IAppendPolyDataInitialValues +): vtkAppendPolyData; /** * vtkAppendPolyData - append one or more polygonal datasets together @@ -72,13 +78,13 @@ export function newInstance(initialValues?: IAppendPolyDataInitialValues): vtkAp * only if all datasets have the point and/or cell attributes available. (For * example, if one dataset has point scalars but another does not, point scalars * will not be appended.) - * + * * @example * Provide the first input to the filter via the standard * `setInput(Data/Connection)` methods. Any additional inputs can be provided via * the `addInput(Data/Connection)` methods. When only a single input is provided, * it is passed through as is to the output. - * + * * ```js * const cone = vtkConeSource.newInstance(); * const cylinder = vtkCylinderSource.newInstance(); @@ -91,7 +97,7 @@ export function newInstance(initialValues?: IAppendPolyDataInitialValues): vtkAp * ``` */ export declare const vtkAppendPolyData: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkAppendPolyData; diff --git a/Sources/Filters/General/ClipClosedSurface/index.d.ts b/Sources/Filters/General/ClipClosedSurface/index.d.ts index b3353e62ec1..fda21ffe07c 100644 --- a/Sources/Filters/General/ClipClosedSurface/index.d.ts +++ b/Sources/Filters/General/ClipClosedSurface/index.d.ts @@ -1,58 +1,58 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import { Vector3 } from "../../../types"; -import vtkPlane from "../../../Common/DataModel/Plane"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import { Vector3 } from '../../../types'; +import vtkPlane from '../../../Common/DataModel/Plane'; /** * */ export enum ScalarMode { - NONE, - COLORS, - LABELS, + NONE, + COLORS, + LABELS, } /** * */ export interface IClipClosedSurfaceInitialValues { - clippingPlanes?: vtkPlane[]; - tolerance?: number; - passPointData?: boolean; - triangulatePolys?: boolean; - scalarMode?: ScalarMode; - generateOutline?: boolean; - generateFaces?: boolean; - activePlaneId?: number; - baseColor?: Vector3; - clipColor?: Vector3; - activePlaneColor?: Vector3; - triangulationErrorDisplay?: boolean; + clippingPlanes?: vtkPlane[]; + tolerance?: number; + passPointData?: boolean; + triangulatePolys?: boolean; + scalarMode?: ScalarMode; + generateOutline?: boolean; + generateFaces?: boolean; + activePlaneId?: number; + baseColor?: Vector3; + clipColor?: Vector3; + activePlaneColor?: Vector3; + triangulationErrorDisplay?: boolean; } type vtkClipClosedSurfaceBase = vtkObject & vtkAlgorithm; export interface vtkClipClosedSurface extends vtkClipClosedSurfaceBase { - /** - * - * @param {any} inData - * @param {any} outData - */ - requestData(inData: any, outData: any): void; + /** + * + * @param {any} inData + * @param {any} outData + */ + requestData(inData: any, outData: any): void; - /** - * Set scalarMode to NONE. - */ - setScalarModeToNone(): void; + /** + * Set scalarMode to NONE. + */ + setScalarModeToNone(): void; - /** - * Set scalarMode to COLOR. - */ - setScalarModeToColor(): void; + /** + * Set scalarMode to COLOR. + */ + setScalarModeToColor(): void; - /** - * Set scalarMode to LABEL. - */ - setScalarModeToLabel(): void; + /** + * Set scalarMode to LABEL. + */ + setScalarModeToLabel(): void; } // ---------------------------------------------------------------------------- @@ -67,9 +67,9 @@ export interface vtkClipClosedSurface extends vtkClipClosedSurfaceBase { * @param {object} [initialValues] (default: {}) */ export function extend( - publicAPI: object, - model: object, - initialValues?: IClipClosedSurfaceInitialValues + publicAPI: object, + model: object, + initialValues?: IClipClosedSurfaceInitialValues ): void; // ---------------------------------------------------------------------------- @@ -79,17 +79,17 @@ export function extend( * @param {IClipClosedSurfaceInitialValues} [initialValues] for pre-setting some of its content */ export function newInstance( - initialValues?: IClipClosedSurfaceInitialValues + initialValues?: IClipClosedSurfaceInitialValues ): vtkClipClosedSurface; /** * vtkClipClosedSurface */ export declare const vtkClipClosedSurface: { - newInstance: typeof newInstance; - extend: typeof extend; - // constants - ScalarMode: typeof ScalarMode; + newInstance: typeof newInstance; + extend: typeof extend; + // constants + ScalarMode: typeof ScalarMode; }; export default vtkClipClosedSurface; diff --git a/Sources/Filters/General/ContourTriangulator/index.d.ts b/Sources/Filters/General/ContourTriangulator/index.d.ts index 5e7c9998582..1ca3a83f475 100644 --- a/Sources/Filters/General/ContourTriangulator/index.d.ts +++ b/Sources/Filters/General/ContourTriangulator/index.d.ts @@ -1,39 +1,39 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import { Nullable, TypedArray, Vector3 } from "../../../types"; -import vtkCellArray from "../../../Common/Core/CellArray"; -import vtkPolyData from "../../../Common/DataModel/PolyData"; -import vtkPoints from "../../../Common/Core/Points"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import { Nullable, TypedArray, Vector3 } from '../../../types'; +import vtkCellArray from '../../../Common/Core/CellArray'; +import vtkPolyData from '../../../Common/DataModel/PolyData'; +import vtkPoints from '../../../Common/Core/Points'; /** * */ export interface IContourTriangulatorInitialValues { - triangulatePolys?: boolean; + triangulatePolys?: boolean; } type vtkContourTriangulatorBase = vtkObject & vtkAlgorithm; export interface vtkContourTriangulator extends vtkContourTriangulatorBase { - /** - * - * @param {any} inData - * @param {any} outData - */ - requestData(inData: any, outData: any): void; + /** + * + * @param {any} inData + * @param {any} outData + */ + requestData(inData: any, outData: any): void; - /** - * Sets the behavior of the filter regarding polys. - * @param {boolean} triangulate whether the filter should triangulate polys - * or leave them untouched. True by default - * @return {boolean} true if it changes - */ - setTriangulatePolys(triangulate: boolean): boolean; + /** + * Sets the behavior of the filter regarding polys. + * @param {boolean} triangulate whether the filter should triangulate polys + * or leave them untouched. True by default + * @return {boolean} true if it changes + */ + setTriangulatePolys(triangulate: boolean): boolean; - /** - * Returns the behavior of the filter regarding polys. - * @return {boolean} True if the filter triangulates polys, false otherwise. - */ - getTriangulatePolys(): boolean; + /** + * Returns the behavior of the filter regarding polys. + * @return {boolean} True if the filter triangulates polys, false otherwise. + */ + getTriangulatePolys(): boolean; } // ---------------------------------------------------------------------------- @@ -72,13 +72,13 @@ export interface vtkContourTriangulator extends vtkContourTriangulatorBase { * false otherwise. */ export function triangulateContours( - polyData: vtkPolyData, - firstLine: number, - numLines: number, - polys: vtkCellArray, - normal: Nullable, - triangulatePolys?: boolean, - diagnoseOnTriangulationError?: boolean + polyData: vtkPolyData, + firstLine: number, + numLines: number, + polys: vtkCellArray, + normal: Nullable, + triangulatePolys?: boolean, + diagnoseOnTriangulationError?: boolean ): boolean; /** @@ -94,9 +94,9 @@ export function triangulateContours( * false otherwise. */ export function triangulatePolygon( - polygon: Array | TypedArray, - points: vtkPoints, - triangles: vtkCellArray + polygon: Array | TypedArray, + points: vtkPoints, + triangles: vtkCellArray ): boolean; /** @@ -107,9 +107,9 @@ export function triangulatePolygon( * @param {IContourTriangulatorInitialValues} [initialValues] (default: {}) */ export function extend( - publicAPI: object, - model: object, - initialValues?: IContourTriangulatorInitialValues + publicAPI: object, + model: object, + initialValues?: IContourTriangulatorInitialValues ): void; // ---------------------------------------------------------------------------- @@ -119,18 +119,18 @@ export function extend( * @param {IContourTriangulatorInitialValues} [initialValues] for pre-setting some of its content */ export function newInstance( - initialValues?: IContourTriangulatorInitialValues + initialValues?: IContourTriangulatorInitialValues ): vtkContourTriangulator; /** * vtkContourTriangulator */ export declare const vtkContourTriangulator: { - newInstance: typeof newInstance; - extend: typeof extend; - // static - triangulateContours: typeof triangulateContours; - triangulatePolygon: typeof triangulatePolygon; + newInstance: typeof newInstance; + extend: typeof extend; + // static + triangulateContours: typeof triangulateContours; + triangulatePolygon: typeof triangulatePolygon; }; export default vtkContourTriangulator; diff --git a/Sources/Filters/General/ImageCropFilter/index.d.ts b/Sources/Filters/General/ImageCropFilter/index.d.ts index b657a51539c..d47b7d5043e 100755 --- a/Sources/Filters/General/ImageCropFilter/index.d.ts +++ b/Sources/Filters/General/ImageCropFilter/index.d.ts @@ -1,4 +1,4 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; type CroppingPlanes = number[]; @@ -6,53 +6,52 @@ type CroppingPlanes = number[]; * */ export interface IImageCropFilterInitialValues { - croppingPlanes?: CroppingPlanes; + croppingPlanes?: CroppingPlanes; } type vtkImageCropFilterBase = vtkObject & vtkAlgorithm; export interface vtkImageCropFilter extends vtkImageCropFilterBase { + /** + * Get The cropping planes, in IJK space. + * @default [0, 0, 0, 0, 0, 0]. + */ + getCroppingPlanes(): CroppingPlanes; - /** - * Get The cropping planes, in IJK space. - * @default [0, 0, 0, 0, 0, 0]. - */ - getCroppingPlanes(): CroppingPlanes; + /** + * Get The cropping planes, in IJK space. + * @default [0, 0, 0, 0, 0, 0]. + */ + getCroppingPlanesByReference(): CroppingPlanes; - /** - * Get The cropping planes, in IJK space. - * @default [0, 0, 0, 0, 0, 0]. - */ - getCroppingPlanesByReference(): CroppingPlanes; + /** + * + */ + isResetAvailable(): boolean; - /** - * - */ - isResetAvailable(): boolean; + /** + * + */ + reset(): void; - /** - * - */ - reset(): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; + /** + * + * @param croppingPlanes + */ + setCroppingPlanes(croppingPlanes: CroppingPlanes): boolean; - /** - * - * @param croppingPlanes - */ - setCroppingPlanes(croppingPlanes: CroppingPlanes): boolean; - - /** - * - * @param croppingPlanes - */ - setCroppingPlanesFrom(croppingPlanes: CroppingPlanes): boolean; + /** + * + * @param croppingPlanes + */ + setCroppingPlanesFrom(croppingPlanes: CroppingPlanes): boolean; } /** @@ -62,24 +61,29 @@ export interface vtkImageCropFilter extends vtkImageCropFilterBase { * @param model object on which data structure will be bounds (protected) * @param {IImageCropFilterInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IImageCropFilterInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IImageCropFilterInitialValues +): void; /** * Method used to create a new instance of vtkImageCropFilter * @param {IImageCropFilterInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IImageCropFilterInitialValues): vtkImageCropFilter; - +export function newInstance( + initialValues?: IImageCropFilterInitialValues +): vtkImageCropFilter; /** * The vtkImageCropFilter will crop a vtkImageData. This will only crop against - * IJK-aligned planes. - * + * IJK-aligned planes. + * * Note this is slow on large datasets due to CPU-bound * cropping. */ export declare const vtkImageCropFilter: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkImageCropFilter; diff --git a/Sources/Filters/General/ImageDataOutlineFilter/index.d.ts b/Sources/Filters/General/ImageDataOutlineFilter/index.d.ts index fdfb5e6d150..501535b7184 100644 --- a/Sources/Filters/General/ImageDataOutlineFilter/index.d.ts +++ b/Sources/Filters/General/ImageDataOutlineFilter/index.d.ts @@ -1,46 +1,45 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import vtkImageData from "../../../Common/DataModel/ImageData"; -import vtkPolyData from "../../../Common/DataModel/PolyData"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import vtkImageData from '../../../Common/DataModel/ImageData'; +import vtkPolyData from '../../../Common/DataModel/PolyData'; export const LINE_ARRAY: number[]; -export interface IImageDataOutlineFilterInitialValues { -} +export interface IImageDataOutlineFilterInitialValues {} type vtkImageDataOutlineFilterBase = vtkObject & vtkAlgorithm; -export interface vtkImageDataOutlineFilter extends vtkImageDataOutlineFilterBase { - /** - * - * @param inData - * @param outData - */ - requestData(inData: vtkImageData, outData: vtkPolyData): void; - - /** - * Flag that indicates whether the output will generate faces of the outline. - * @returns {boolean} - */ - getGenerateFaces(): boolean; +export interface vtkImageDataOutlineFilter + extends vtkImageDataOutlineFilterBase { + /** + * + * @param inData + * @param outData + */ + requestData(inData: vtkImageData, outData: vtkPolyData): void; - /** - * Flag that indicates whether the output will generate wireframe lines of the outline. - * @returns {boolean} - */ - getGenerateLines(): boolean; + /** + * Flag that indicates whether the output will generate faces of the outline. + * @returns {boolean} + */ + getGenerateFaces(): boolean; - /** - * Flag to indicate that the output should generate wireframe of the outline. - * @param {boolean} generateLines - */ - setGenerateLines(generateLines: boolean): boolean; + /** + * Flag that indicates whether the output will generate wireframe lines of the outline. + * @returns {boolean} + */ + getGenerateLines(): boolean; - /** - * Flag to indicate that the output should generate triangulated faces of the outline. - * @param {boolean} generateFaces - */ - setGenerateFaces(generateFaces: boolean): boolean; + /** + * Flag to indicate that the output should generate wireframe of the outline. + * @param {boolean} generateLines + */ + setGenerateLines(generateLines: boolean): boolean; + /** + * Flag to indicate that the output should generate triangulated faces of the outline. + * @param {boolean} generateFaces + */ + setGenerateFaces(generateFaces: boolean): boolean; } /** @@ -51,14 +50,19 @@ export interface vtkImageDataOutlineFilter extends vtkImageDataOutlineFilterBase * @param model object on which data structure will be bounds (protected) * @param {IImageDataOutlineFilterInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IImageDataOutlineFilterInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IImageDataOutlineFilterInitialValues +): void; /** * Method used to create a new instance of vtkImageDataOutlineFilter * @param {IImageDataOutlineFilterInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IImageDataOutlineFilterInitialValues): vtkImageDataOutlineFilter; - +export function newInstance( + initialValues?: IImageDataOutlineFilterInitialValues +): vtkImageDataOutlineFilter; /** * vtkImageDataOutlineFilter - A filter that generates oriented outline for @@ -68,10 +72,10 @@ export function newInstance(initialValues?: IImageDataOutlineFilterInitialValues * triangulated rectangular-cuboid as an outline of an input vtkImageData. * It takes into account the orientation / DirectionMatrix of the image, so the * output outline may not be axes aligned. - * + * */ export declare const vtkImageDataOutlineFilter: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkImageDataOutlineFilter; diff --git a/Sources/Filters/General/ImageOutlineFilter/index.d.ts b/Sources/Filters/General/ImageOutlineFilter/index.d.ts index 4171e6df808..385f85c6f57 100755 --- a/Sources/Filters/General/ImageOutlineFilter/index.d.ts +++ b/Sources/Filters/General/ImageOutlineFilter/index.d.ts @@ -1,47 +1,46 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; /** - * + * */ export interface IImageOutlineFilterInitialValues { - slicingMode?: number; - background?: number; + slicingMode?: number; + background?: number; } type vtkImageOutlineFilterBase = vtkObject & vtkAlgorithm; export interface vtkImageOutlineFilter extends vtkImageOutlineFilterBase { + /** + * + * @default 0 + */ + getBackground(): number; - /** - * - * @default 0 - */ - getBackground(): number; - - /** - * - * @default 2 - */ - getSlicingMode(): number; + /** + * + * @default 2 + */ + getSlicingMode(): number; - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; - /** - * - * @param background - */ - setBackground(background: number): boolean; + /** + * + * @param background + */ + setBackground(background: number): boolean; - /** - * - * @param slicingMode - */ - setSlicingMode(slicingMode: number): boolean; + /** + * + * @param slicingMode + */ + setSlicingMode(slicingMode: number): boolean; } /** @@ -51,24 +50,29 @@ export interface vtkImageOutlineFilter extends vtkImageOutlineFilterBase { * @param model object on which data structure will be bounds (protected) * @param {IImageOutlineFilterInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IImageOutlineFilterInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IImageOutlineFilterInitialValues +): void; /** * Method used to create a new instance of vtkImageOutlineFilter * @param {IImageOutlineFilterInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IImageOutlineFilterInitialValues): vtkImageOutlineFilter; - +export function newInstance( + initialValues?: IImageOutlineFilterInitialValues +): vtkImageOutlineFilter; /** * vtkImageOutlineFilter - generates outline of labelmap from an vtkImageData - * input in a given direction (slicing mode). + * input in a given direction (slicing mode). * * vtkImageOutlineFilter creates a region (labelmap) outline based on input data * given . The output is a vtkImageData object containing only boundary voxels. */ export declare const vtkImageOutlineFilter: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkImageOutlineFilter; diff --git a/Sources/Filters/General/ImageSliceFilter/index.d.ts b/Sources/Filters/General/ImageSliceFilter/index.d.ts index 101f848d88c..b0f57fa3647 100755 --- a/Sources/Filters/General/ImageSliceFilter/index.d.ts +++ b/Sources/Filters/General/ImageSliceFilter/index.d.ts @@ -1,45 +1,44 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; /** - * + * */ export interface IImageSliceFilterInitialValues { - sliceIndex?: number + sliceIndex?: number; } type vtkImageSliceFilterBase = vtkObject & vtkAlgorithm; export interface vtkImageSliceFilter extends vtkImageSliceFilterBase { + /** + * + */ + getOrientation(): any; - /** - * - */ - getOrientation(): any; - - /** - * - * @default 0 - */ - getSliceIndex(): number; + /** + * + * @default 0 + */ + getSliceIndex(): number; - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; - /** - * - * @param orientation - */ - setOrientation(orientation: any): boolean; + /** + * + * @param orientation + */ + setOrientation(orientation: any): boolean; - /** - * - * @param sliceIndex - */ - setSliceIndex(sliceIndex: number): boolean; + /** + * + * @param sliceIndex + */ + setSliceIndex(sliceIndex: number): boolean; } /** @@ -49,20 +48,25 @@ export interface vtkImageSliceFilter extends vtkImageSliceFilterBase { * @param model object on which data structure will be bounds (protected) * @param {IImageSliceFilterInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IImageSliceFilterInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IImageSliceFilterInitialValues +): void; /** * Method used to create a new instance of vtkImageSliceFilter * @param {IImageSliceFilterInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IImageSliceFilterInitialValues): vtkImageSliceFilter; - +export function newInstance( + initialValues?: IImageSliceFilterInitialValues +): vtkImageSliceFilter; /** * */ export declare const vtkImageSliceFilter: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkImageSliceFilter; diff --git a/Sources/Filters/General/ImageStreamline/index.d.ts b/Sources/Filters/General/ImageStreamline/index.d.ts index 2b86f07f5de..4a9906e14a8 100644 --- a/Sources/Filters/General/ImageStreamline/index.d.ts +++ b/Sources/Filters/General/ImageStreamline/index.d.ts @@ -1,101 +1,123 @@ -import vtkImageData from "../../../Common/DataModel/ImageData"; -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import { Bounds, Extent, Vector2, Vector3 } from "../../../types"; +import vtkImageData from '../../../Common/DataModel/ImageData'; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import { Bounds, Extent, Vector2, Vector3 } from '../../../types'; /** - * + * */ export interface IImageStreamlineInitialValues { - integrationStep?: number, - maximumNumberOfSteps?: number, + integrationStep?: number; + maximumNumberOfSteps?: number; } type vtkImageStreamlineBase = vtkObject & vtkAlgorithm; export interface vtkImageStreamline extends vtkImageStreamlineBase { - - /** - * - * @param velArray - * @param image - * @param {Number} delT - * @param {Number[]} xyz - */ - computeNextStep(velArray: any, image: any, delT: number, xyz: number[]): boolean; - - /** - * - * @param {Vector3} x - * @param {Vector3} ijk - * @param {Vector3} pcoords - * @param {Extent} extent - * @param {Vector3} spacing - * @param {Vector3} origin - * @param {Bounds} bounds - */ - computeStructuredCoordinates(x: Vector3, ijk: Vector3, pcoords: Vector3, extent: Extent, spacing: Vector3, origin: Vector3, bounds: Bounds): boolean; - - /** - * Get the step length (delT) used during integration. - */ - getIntegrationStep(): number; - - /** - * Get the number of steps to be used in the integration. - */ - getMaximumNumberOfSteps(): number; - - /** - * - * @param {Vector3} ijk - * @param {Vector2} dims - * @param {Number[]} ids - */ - getVoxelIndices(ijk: Vector3, dims: Vector2, ids: number[]): void; - - /** - * - * @param {Vector3} pcoords - * @param {Number[]} sf - */ - interpolationFunctions(pcoords: Vector3, sf: number[]): void; - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * Set the step length (delT) used during integration. - * @param {Number} integrationStep - */ - setIntegrationStep(integrationStep: number): boolean; - - /** - * Set the number of steps to be used in the integration. - * Integration can terminal earlier if the streamline leaves the domain. - * @param {Number} maximumNumberOfSteps - */ - setMaximumNumberOfSteps(maximumNumberOfSteps: number): boolean; - - /** - * - * @param velArray - * @param {vtkImageData} image - * @param {Number[]} seed - * @param {Number} offset - */ - streamIntegrate(velArray: any, image: vtkImageData, seed: number[], offset: number): any[]; - - /** - * - * @param {Number[]} xyz - * @param velArray - * @param {vtkImageData} image - * @param velAtArg - */ - vectorAt(xyz: number[], velArray: any, image: vtkImageData, velAtArg: any): boolean; + /** + * + * @param velArray + * @param image + * @param {Number} delT + * @param {Number[]} xyz + */ + computeNextStep( + velArray: any, + image: any, + delT: number, + xyz: number[] + ): boolean; + + /** + * + * @param {Vector3} x + * @param {Vector3} ijk + * @param {Vector3} pcoords + * @param {Extent} extent + * @param {Vector3} spacing + * @param {Vector3} origin + * @param {Bounds} bounds + */ + computeStructuredCoordinates( + x: Vector3, + ijk: Vector3, + pcoords: Vector3, + extent: Extent, + spacing: Vector3, + origin: Vector3, + bounds: Bounds + ): boolean; + + /** + * Get the step length (delT) used during integration. + */ + getIntegrationStep(): number; + + /** + * Get the number of steps to be used in the integration. + */ + getMaximumNumberOfSteps(): number; + + /** + * + * @param {Vector3} ijk + * @param {Vector2} dims + * @param {Number[]} ids + */ + getVoxelIndices(ijk: Vector3, dims: Vector2, ids: number[]): void; + + /** + * + * @param {Vector3} pcoords + * @param {Number[]} sf + */ + interpolationFunctions(pcoords: Vector3, sf: number[]): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * Set the step length (delT) used during integration. + * @param {Number} integrationStep + */ + setIntegrationStep(integrationStep: number): boolean; + + /** + * Set the number of steps to be used in the integration. + * Integration can terminal earlier if the streamline leaves the domain. + * @param {Number} maximumNumberOfSteps + */ + setMaximumNumberOfSteps(maximumNumberOfSteps: number): boolean; + + /** + * + * @param velArray + * @param {vtkImageData} image + * @param {Number[]} seed + * @param {Number} offset + */ + streamIntegrate( + velArray: any, + image: vtkImageData, + seed: number[], + offset: number + ): any[]; + + /** + * + * @param {Number[]} xyz + * @param velArray + * @param {vtkImageData} image + * @param velAtArg + */ + vectorAt( + xyz: number[], + velArray: any, + image: vtkImageData, + velAtArg: any + ): boolean; } /** @@ -105,18 +127,23 @@ export interface vtkImageStreamline extends vtkImageStreamlineBase { * @param model object on which data structure will be bounds (protected) * @param {IImageStreamlineInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IImageStreamlineInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IImageStreamlineInitialValues +): void; /** * Method used to create a new instance of vtkImageStreamline * @param {IImageStreamlineInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IImageStreamlineInitialValues): vtkImageStreamline; - +export function newInstance( + initialValues?: IImageStreamlineInitialValues +): vtkImageStreamline; /** * vtkImageStreamline - integrate streamlines in a vtkImageData - * + * * vtkImageStreamline is a filter that generates streamlines from a vtkImageData * input over which a vector field is defined. This filter will look for vectors * (i.e. getVectors()) in the input. It will then integrate these vectors, using @@ -129,7 +156,7 @@ export function newInstance(initialValues?: IImageStreamlineInitialValues): vtkI * the points of the streamline. */ export declare const vtkImageStreamline: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkImageStreamline; diff --git a/Sources/Filters/General/LineFilter/index.d.ts b/Sources/Filters/General/LineFilter/index.d.ts index 6f98913b573..b9eec5395c7 100755 --- a/Sources/Filters/General/LineFilter/index.d.ts +++ b/Sources/Filters/General/LineFilter/index.d.ts @@ -1,21 +1,19 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; /** * */ -export interface ILineFilterInitialValues { -} +export interface ILineFilterInitialValues {} type vtkLineFilterBase = vtkObject & vtkAlgorithm; export interface vtkLineFilter extends vtkLineFilterBase { - - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; } /** @@ -25,14 +23,19 @@ export interface vtkLineFilter extends vtkLineFilterBase { * @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; +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; - +export function newInstance( + initialValues?: ILineFilterInitialValues +): vtkLineFilter; /** * vtkLineFilter - filters lines in polydata @@ -40,7 +43,7 @@ export function newInstance(initialValues?: ILineFilterInitialValues): vtkLineFi * vtkLineFilter is a filter that only let's through lines of a vtkPolydata. */ export declare const vtkLineFilter: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkLineFilter; diff --git a/Sources/Filters/General/OutlineFilter/index.d.ts b/Sources/Filters/General/OutlineFilter/index.d.ts index 87fcac948cd..0ea4c61acb6 100755 --- a/Sources/Filters/General/OutlineFilter/index.d.ts +++ b/Sources/Filters/General/OutlineFilter/index.d.ts @@ -1,25 +1,23 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; export const BOUNDS_MAP: number[]; export const LINE_ARRAY: number[]; /* - * + * */ -export interface IOutlineFilterInitialValues { -} +export interface IOutlineFilterInitialValues {} type vtkOutlineFilterBase = vtkObject & vtkAlgorithm; export interface vtkOutlineFilter extends vtkOutlineFilterBase { - - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; } /** @@ -29,14 +27,19 @@ export interface vtkOutlineFilter extends vtkOutlineFilterBase { * @param model object on which data structure will be bounds (protected) * @param {IOutlineFilterInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IOutlineFilterInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IOutlineFilterInitialValues +): void; /** * Method used to create a new instance of vtkOutlineFilter * @param {IOutlineFilterInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IOutlineFilterInitialValues): vtkOutlineFilter; - +export function newInstance( + initialValues?: IOutlineFilterInitialValues +): vtkOutlineFilter; /** * vtkOutlineFilter - A filter that generates triangles for larger cells @@ -45,7 +48,7 @@ export function newInstance(initialValues?: IOutlineFilterInitialValues): vtkOut * triangles. */ export declare const vtkOutlineFilter: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkOutlineFilter; diff --git a/Sources/Filters/General/TriangleFilter/index.d.ts b/Sources/Filters/General/TriangleFilter/index.d.ts index 3a1c5855057..b2d6426fa9a 100755 --- a/Sources/Filters/General/TriangleFilter/index.d.ts +++ b/Sources/Filters/General/TriangleFilter/index.d.ts @@ -1,27 +1,26 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; /** * */ export interface ITriangleFilterInitialValues { - errorCount?: number; + errorCount?: number; } type vtkTriangleFilterBase = vtkObject & vtkAlgorithm; export interface vtkTriangleFilter extends vtkTriangleFilterBase { - - /** - * Get the desired precision for the output types. - */ - getErrorCount(): number; - - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; + /** + * Get the desired precision for the output types. + */ + getErrorCount(): number; + + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; } /** @@ -31,14 +30,19 @@ export interface vtkTriangleFilter extends vtkTriangleFilterBase { * @param model object on which data structure will be bounds (protected) * @param {ITriangleFilterInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ITriangleFilterInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ITriangleFilterInitialValues +): void; /** * Method used to create a new instance of vtkTriangleFilter * @param {ITriangleFilterInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ITriangleFilterInitialValues): vtkTriangleFilter; - +export function newInstance( + initialValues?: ITriangleFilterInitialValues +): vtkTriangleFilter; /** * vtkTriangleFilter - A filter that generates triangles for larger cells @@ -47,7 +51,7 @@ export function newInstance(initialValues?: ITriangleFilterInitialValues): vtkTr * triangles. */ export declare const vtkTriangleFilter: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkTriangleFilter; diff --git a/Sources/Filters/General/TubeFilter/index.d.ts b/Sources/Filters/General/TubeFilter/index.d.ts index 241d1596dd0..f29a951fe55 100755 --- a/Sources/Filters/General/TubeFilter/index.d.ts +++ b/Sources/Filters/General/TubeFilter/index.d.ts @@ -1,203 +1,204 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import { DesiredOutputPrecision } from "../../../Common/DataModel/DataSetAttributes"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import { DesiredOutputPrecision } from '../../../Common/DataModel/DataSetAttributes'; export enum VaryRadius { - VARY_RADIUS_OFF, - VARY_RADIUS_BY_SCALAR, - VARY_RADIUS_BY_VECTOR, - VARY_RADIUS_BY_ABSOLUTE_SCALAR + VARY_RADIUS_OFF, + VARY_RADIUS_BY_SCALAR, + VARY_RADIUS_BY_VECTOR, + VARY_RADIUS_BY_ABSOLUTE_SCALAR, } export enum GenerateTCoords { - TCOORDS_OFF, - TCOORDS_FROM_NORMALIZED_LENGTH, - TCOORDS_FROM_LENGTH, - TCOORDS_FROM_SCALARS + TCOORDS_OFF, + TCOORDS_FROM_NORMALIZED_LENGTH, + TCOORDS_FROM_LENGTH, + TCOORDS_FROM_SCALARS, } /** * */ export interface ITubeFilterInitialValues { - outputPointsPrecision?: DesiredOutputPrecision, - radius?: number; - varyRadius?: VaryRadius, - numberOfSides?: number; - radiusFactor?: number; - defaultNormal?: number[]; - useDefaultNormal?: boolean; - sidesShareVertices?: boolean; - capping?: boolean; - onRatio?: number; - offset?: number; - generateTCoords?: GenerateTCoords, - textureLength?: number; + outputPointsPrecision?: DesiredOutputPrecision; + radius?: number; + varyRadius?: VaryRadius; + numberOfSides?: number; + radiusFactor?: number; + defaultNormal?: number[]; + useDefaultNormal?: boolean; + sidesShareVertices?: boolean; + capping?: boolean; + onRatio?: number; + offset?: number; + generateTCoords?: GenerateTCoords; + textureLength?: number; } type vtkTubeFilterBase = vtkObject & vtkAlgorithm; export interface vtkTubeFilter extends vtkTubeFilterBase { - - /** - * Get the desired precision for the output types. - */ - getOutputPointsPrecision(): DesiredOutputPrecision; - - /** - * Get the minimum tube radius. - */ - getRadius(): number; - - /** - * Get variation of tube radius with scalar or vector values. - */ - getVaryRadius(): VaryRadius; - - /** - * Get the number of sides for the tube. - */ - getNumberOfSides(): number; - - /** - * Get the maximum tube radius in terms of a multiple of the minimum radius. - */ - getRadiusFactor(): number; - - /** - * Get the default normal value. - */ - getDefaultNormal(): number[]; - - /** - * Get useDefaultNormal value. - */ - getUseDefaultNormal(): boolean; - - /** - * Get sidesShareVertices value. - */ - getSidesShareVertices(): boolean; - - /** - * Get whether the capping is enabled or not. - */ - getCapping(): boolean; - - /** - * Get onRatio value. - */ - getOnRatio(): number; - - /** - * Get offset value. - */ - getOffset(): number; - - /** - * Get generateTCoords value. - */ - getGenerateTCoords(): GenerateTCoords; - - /** - * Get textureLength value. - */ - getTextureLength(): number; - - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * Set the desired precision for the output types. - * @param {DesiredOutputPrecision} outputPointsPrecision - */ - setOutputPointsPrecision(outputPointsPrecision: DesiredOutputPrecision): boolean; - - /** - * Set the minimum tube radius (minimum because the tube radius may vary). - * @param {Number} radius - */ - setRadius(radius: number): boolean; - - /** - * Enable or disable variation of tube radius with scalar or vector values. - * @param {VaryRadius} varyRadius - */ - setVaryRadius(varyRadius: VaryRadius): boolean; - - /** - * Set the number of sides for the tube. At a minimum, number of sides is 3. - * @param {Number} numberOfSides - */ - setNumberOfSides(numberOfSides: number): boolean; - - /** - * Set the maximum tube radius in terms of a multiple of the minimum radius. - * @param {Number} radiusFactor - */ - setRadiusFactor(radiusFactor: number): boolean; - - /** - * Set the default normal to use if no normals are supplied. Requires that - * useDefaultNormal is set. - * @param defaultNormal - */ - setDefaultNormal(defaultNormal: number[]): boolean; - - /** - * Control whether to use the defaultNormal. - * @param {Boolean} useDefaultNormal - */ - setUseDefaultNormal(useDefaultNormal: boolean): boolean; - - /** - * Control whether the tube sides should share vertices. This creates - * independent strips, with constant normals so the tube is always faceted - * in appearance. - * @param {Boolean} sidesShareVertices - */ - setSidesShareVertices(sidesShareVertices: boolean): boolean; - - /** - * Enable / disable capping the ends of the tube with polygons. - * @param {Boolean} capping - */ - setCapping(capping: boolean): boolean; - - /** - * Control the stripping of tubes. If OnRatio is greater than 1, then every - * nth tube side is turned on, beginning with the offset side. - * @param {Number} onRatio - */ - setOnRatio(onRatio: number): boolean; - - /** - * Control the stripping of tubes. The offset sets the first tube side that - * is visible. Offset is generally used with onRatio to create nifty - * stripping effects. - * @param {Number} offset - */ - setOffset(offset: number): boolean; - - /** - * Control whether and how texture coordinates are produced. This is useful - * for stripping the tube with length textures, etc. If you use scalars to - * create the texture, the scalars are assumed to be monotonically - * increasing (or decreasing). - * @param {GenerateTCoords} generateTCoords - */ - setGenerateTCoords(generateTCoords: GenerateTCoords): boolean; - - /** - * Control the conversion of units during texture coordinates calculation. - * The texture length indicates what length (whether calculated from scalars - * or length) is mapped to [0, 1) texture space. - * @param {Number} textureLength - */ - setTextureLength(textureLength: number): boolean; + /** + * Get the desired precision for the output types. + */ + getOutputPointsPrecision(): DesiredOutputPrecision; + + /** + * Get the minimum tube radius. + */ + getRadius(): number; + + /** + * Get variation of tube radius with scalar or vector values. + */ + getVaryRadius(): VaryRadius; + + /** + * Get the number of sides for the tube. + */ + getNumberOfSides(): number; + + /** + * Get the maximum tube radius in terms of a multiple of the minimum radius. + */ + getRadiusFactor(): number; + + /** + * Get the default normal value. + */ + getDefaultNormal(): number[]; + + /** + * Get useDefaultNormal value. + */ + getUseDefaultNormal(): boolean; + + /** + * Get sidesShareVertices value. + */ + getSidesShareVertices(): boolean; + + /** + * Get whether the capping is enabled or not. + */ + getCapping(): boolean; + + /** + * Get onRatio value. + */ + getOnRatio(): number; + + /** + * Get offset value. + */ + getOffset(): number; + + /** + * Get generateTCoords value. + */ + getGenerateTCoords(): GenerateTCoords; + + /** + * Get textureLength value. + */ + getTextureLength(): number; + + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * Set the desired precision for the output types. + * @param {DesiredOutputPrecision} outputPointsPrecision + */ + setOutputPointsPrecision( + outputPointsPrecision: DesiredOutputPrecision + ): boolean; + + /** + * Set the minimum tube radius (minimum because the tube radius may vary). + * @param {Number} radius + */ + setRadius(radius: number): boolean; + + /** + * Enable or disable variation of tube radius with scalar or vector values. + * @param {VaryRadius} varyRadius + */ + setVaryRadius(varyRadius: VaryRadius): boolean; + + /** + * Set the number of sides for the tube. At a minimum, number of sides is 3. + * @param {Number} numberOfSides + */ + setNumberOfSides(numberOfSides: number): boolean; + + /** + * Set the maximum tube radius in terms of a multiple of the minimum radius. + * @param {Number} radiusFactor + */ + setRadiusFactor(radiusFactor: number): boolean; + + /** + * Set the default normal to use if no normals are supplied. Requires that + * useDefaultNormal is set. + * @param defaultNormal + */ + setDefaultNormal(defaultNormal: number[]): boolean; + + /** + * Control whether to use the defaultNormal. + * @param {Boolean} useDefaultNormal + */ + setUseDefaultNormal(useDefaultNormal: boolean): boolean; + + /** + * Control whether the tube sides should share vertices. This creates + * independent strips, with constant normals so the tube is always faceted + * in appearance. + * @param {Boolean} sidesShareVertices + */ + setSidesShareVertices(sidesShareVertices: boolean): boolean; + + /** + * Enable / disable capping the ends of the tube with polygons. + * @param {Boolean} capping + */ + setCapping(capping: boolean): boolean; + + /** + * Control the stripping of tubes. If OnRatio is greater than 1, then every + * nth tube side is turned on, beginning with the offset side. + * @param {Number} onRatio + */ + setOnRatio(onRatio: number): boolean; + + /** + * Control the stripping of tubes. The offset sets the first tube side that + * is visible. Offset is generally used with onRatio to create nifty + * stripping effects. + * @param {Number} offset + */ + setOffset(offset: number): boolean; + + /** + * Control whether and how texture coordinates are produced. This is useful + * for stripping the tube with length textures, etc. If you use scalars to + * create the texture, the scalars are assumed to be monotonically + * increasing (or decreasing). + * @param {GenerateTCoords} generateTCoords + */ + setGenerateTCoords(generateTCoords: GenerateTCoords): boolean; + + /** + * Control the conversion of units during texture coordinates calculation. + * The texture length indicates what length (whether calculated from scalars + * or length) is mapped to [0, 1) texture space. + * @param {Number} textureLength + */ + setTextureLength(textureLength: number): boolean; } /** @@ -207,14 +208,19 @@ export interface vtkTubeFilter extends vtkTubeFilterBase { * @param model object on which data structure will be bounds (protected) * @param {ITubeFilterInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ITubeFilterInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ITubeFilterInitialValues +): void; /** * Method used to create a new instance of vtkTubeFilter * @param {ITubeFilterInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ITubeFilterInitialValues): vtkTubeFilter; - +export function newInstance( + initialValues?: ITubeFilterInitialValues +): vtkTubeFilter; /** * vtkTubeFilter - A filter that generates tubes around lines @@ -245,7 +251,7 @@ export function newInstance(initialValues?: ITubeFilterInitialValues): vtkTubeFi * criteria, then that line is not tubed. */ export declare const vtkTubeFilter: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkTubeFilter; diff --git a/Sources/Filters/Sources/Arrow2DSource/index.d.ts b/Sources/Filters/Sources/Arrow2DSource/index.d.ts index b67c9e4298f..a2203d9d4c0 100755 --- a/Sources/Filters/Sources/Arrow2DSource/index.d.ts +++ b/Sources/Filters/Sources/Arrow2DSource/index.d.ts @@ -1,156 +1,158 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import { Vector3 } from "../../../types"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import { Vector3 } from '../../../types'; export enum ShapeType { - TRIANGLE, - STAR, - ARROW_4, - ARROW_6 + TRIANGLE, + STAR, + ARROW_4, + ARROW_6, } /** * */ export interface IArrow2DSourceInitialValues { - base?: number; - height?: number; - width?: number; - thickness?: number; - center?: Vector3; - pointType?: string; - origin?: Vector3; - direction?: Vector3; + base?: number; + height?: number; + width?: number; + thickness?: number; + center?: Vector3; + pointType?: string; + origin?: Vector3; + direction?: Vector3; } -type vtkArrow2DSourceBase = vtkObject & Omit; +type vtkArrow2DSourceBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkArrow2DSource extends vtkArrow2DSourceBase { - - /** - * Get the cap the base of the cone with a polygon. - * @default 0 - */ - getBase(): number; - - /** - * Get the center of the cone. - * @default [0, 0, 0] - */ - getCenter(): Vector3; - - /** - * Get the center of the cone. - */ - getCenterByReference(): Vector3; - - /** - * Get the orientation vector of the cone. - * @default [1.0, 0.0, 0.0] - */ - getDirection(): Vector3; - - /** - * Get the orientation vector of the cone. - */ - getDirectionByReference(): Vector3; - - /** - * Get the height of the cone. - * @default 1.0 - */ - getHeight(): number; - - /** - * Get the base thickness of the cone. - * @default 0.5 - */ - getThickness(): number; - - /** - * Get the number of facets used to represent the cone. - * @default 6 - */ - getWidth(): number; - - /** - * Expose methods - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * Turn on/off whether to cap the base of the cone with a polygon. - * @param {Number} base The value of the - */ - setBase(base: number): boolean; - - /** - * Set the center of the cone. - * It is located at the middle of the axis of the cone. - * !!! warning - * This is not the center of the base of the cone! - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - * @default [0, 0, 0] - */ - setCenter(x: number, y: number, z: number): boolean; - - /** - * Set the center of the cone. - * It is located at the middle of the axis of the cone. - * !!! warning - * This is not the center of the base of the cone! - * @param {Vector3} center The center of the cone coordinates. - * @default [0, 0, 0] - */ - setCenterFrom(center: Vector3): boolean; - - /** - * Set the direction for the arrow. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setDirection(x: number, y: number, z: number): boolean; - - /** - * Set the direction for the arrow 2D. - * @param {Vector3} direction The direction coordinates. - */ - setDirection(direction: Vector3): boolean; - - /** - * Set the direction for the arrow 2D. - * @param {Vector3} direction The direction coordinates. - */ - setDirectionFrom(direction: Vector3): boolean; - - /** - * Set the height of the cone. - * This is the height along the cone in its specified direction. - * @param {Number} height The height value. - */ - setHeight(height: number): boolean; - - /** - * Set the base thickness of the cone. - * @param {Number} thickness The thickness value. - */ - setThickness(thickness: number): boolean; - - /** - * Set the number of facets used to represent the cone. - * @param {Number} width The width value. - */ - setWidth(width: number): boolean; + /** + * Get the cap the base of the cone with a polygon. + * @default 0 + */ + getBase(): number; + + /** + * Get the center of the cone. + * @default [0, 0, 0] + */ + getCenter(): Vector3; + + /** + * Get the center of the cone. + */ + getCenterByReference(): Vector3; + + /** + * Get the orientation vector of the cone. + * @default [1.0, 0.0, 0.0] + */ + getDirection(): Vector3; + + /** + * Get the orientation vector of the cone. + */ + getDirectionByReference(): Vector3; + + /** + * Get the height of the cone. + * @default 1.0 + */ + getHeight(): number; + + /** + * Get the base thickness of the cone. + * @default 0.5 + */ + getThickness(): number; + + /** + * Get the number of facets used to represent the cone. + * @default 6 + */ + getWidth(): number; + + /** + * Expose methods + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * Turn on/off whether to cap the base of the cone with a polygon. + * @param {Number} base The value of the + */ + setBase(base: number): boolean; + + /** + * Set the center of the cone. + * It is located at the middle of the axis of the cone. + * !!! warning + * This is not the center of the base of the cone! + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + * @default [0, 0, 0] + */ + setCenter(x: number, y: number, z: number): boolean; + + /** + * Set the center of the cone. + * It is located at the middle of the axis of the cone. + * !!! warning + * This is not the center of the base of the cone! + * @param {Vector3} center The center of the cone coordinates. + * @default [0, 0, 0] + */ + setCenterFrom(center: Vector3): boolean; + + /** + * Set the direction for the arrow. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setDirection(x: number, y: number, z: number): boolean; + + /** + * Set the direction for the arrow 2D. + * @param {Vector3} direction The direction coordinates. + */ + setDirection(direction: Vector3): boolean; + + /** + * Set the direction for the arrow 2D. + * @param {Vector3} direction The direction coordinates. + */ + setDirectionFrom(direction: Vector3): boolean; + + /** + * Set the height of the cone. + * This is the height along the cone in its specified direction. + * @param {Number} height The height value. + */ + setHeight(height: number): boolean; + + /** + * Set the base thickness of the cone. + * @param {Number} thickness The thickness value. + */ + setThickness(thickness: number): boolean; + + /** + * Set the number of facets used to represent the cone. + * @param {Number} width The width value. + */ + setWidth(width: number): boolean; } /** @@ -160,13 +162,19 @@ export interface vtkArrow2DSource extends vtkArrow2DSourceBase { * @param model object on which data structure will be bounds (protected) * @param {IArrow2DSourceInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IArrow2DSourceInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IArrow2DSourceInitialValues +): void; /** * Method used to create a new instance of vtkArrow2DSource. * @param {IArrow2DSourceInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IArrow2DSourceInitialValues): vtkArrow2DSource; +export function newInstance( + initialValues?: IArrow2DSourceInitialValues +): vtkArrow2DSource; /** * vtkArrow2DSource creates a cone centered at a specified point and pointing in a specified direction. @@ -177,7 +185,7 @@ export function newInstance(initialValues?: IArrow2DSourceInitialValues): vtkArr * and to specify the height and thickness of the cone. */ export declare const vtkArrow2DSource: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkArrow2DSource; diff --git a/Sources/Filters/Sources/ArrowSource/index.d.ts b/Sources/Filters/Sources/ArrowSource/index.d.ts index d817f23a200..bf3c8774f7c 100755 --- a/Sources/Filters/Sources/ArrowSource/index.d.ts +++ b/Sources/Filters/Sources/ArrowSource/index.d.ts @@ -1,163 +1,171 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import { Vector3 } from "../../../types"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import { Vector3 } from '../../../types'; export enum ShapeType { - TRIANGLE, - STAR, - ARROW_4, - ARROW_6 + TRIANGLE, + STAR, + ARROW_4, + ARROW_6, } /** * */ export interface IArrowSourceInitialValues { - tipResolution?: number; - tipRadius?: number; - tipLength?: number; - shaftResolution?: number; - shaftRadius?: number; - invert?: boolean; - direction?: Vector3; - pointType?: string; + tipResolution?: number; + tipRadius?: number; + tipLength?: number; + shaftResolution?: number; + shaftRadius?: number; + invert?: boolean; + direction?: Vector3; + pointType?: string; } -type vtkArrowSourceBase = vtkObject & Omit; +type vtkArrowSourceBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkArrowSource extends vtkArrowSourceBase { - - /** - * Get the orientation vector of the cone. - * @default [1.0, 0.0, 0.0] - */ - getDirection(): Vector3; - - /** - * Get the orientation vector of the cone. - */ - getDirectionByReference(): Vector3; - - /** - * - * @default false - */ - getInvert(): boolean; - - /** - * Get the resolution of the shaft. - * @default 0.03 - */ - getShaftRadius(): number; - - /** - * Get the resolution of the shaft. - * @default 6 - */ - getShaftResolution(): number; - - /** - * Get the length of the tip. - * @default 0.35 - */ - getTipLength(): number; - - /** - * Get the radius of the tip. - * @default 0.1 - */ - getTipRadius(): number; - - /** - * Get the resolution of the tip. - * @default 6 - */ - getTipResolution(): number; - - /** - * Expose methods - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * Set the direction for the arrow. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setDirection(x: number, y: number, z: number): boolean; - - /** - * Set the direction for the arrow. - * @param {Vector3} direction The direction coordinates. - */ - setDirection(direction: Vector3): boolean; - - /** - * Set the direction for the arrow. - * @param {Vector3} direction The direction coordinates. - */ - setDirectionFrom(direction: Vector3): boolean; - - /** - * Inverts the arrow direction. - * When set to true, base is at [1, 0, 0] while the tip is at [0, 0, 0]. - * @param {Booolean} invert - */ - setInvert(invert: boolean): boolean; - - /** - * Set the radius of the shaft. - * @param {Number} shaftRadius - */ - setShaftRadius(shaftRadius: number): boolean; - - /** - * Set the resolution of the shaft. - * @param {Number} shaftResolution - */ - setShaftResolution(shaftResolution: number): boolean; - - /** - * Set the length of the tip. - * @param {Number} tipLength - */ - setTipLength(tipLength: number): boolean; - - /** - * Set the radius of the tip. - * @param {Number} tipRadius - */ - setTipRadius(tipRadius: number): boolean; - - /** - * Set the resolution of the tip. - * @param {Number} tipResolution - */ - setTipResolution(tipResolution: number): boolean; + /** + * Get the orientation vector of the cone. + * @default [1.0, 0.0, 0.0] + */ + getDirection(): Vector3; + + /** + * Get the orientation vector of the cone. + */ + getDirectionByReference(): Vector3; + + /** + * + * @default false + */ + getInvert(): boolean; + + /** + * Get the resolution of the shaft. + * @default 0.03 + */ + getShaftRadius(): number; + + /** + * Get the resolution of the shaft. + * @default 6 + */ + getShaftResolution(): number; + + /** + * Get the length of the tip. + * @default 0.35 + */ + getTipLength(): number; + + /** + * Get the radius of the tip. + * @default 0.1 + */ + getTipRadius(): number; + + /** + * Get the resolution of the tip. + * @default 6 + */ + getTipResolution(): number; + + /** + * Expose methods + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * Set the direction for the arrow. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setDirection(x: number, y: number, z: number): boolean; + + /** + * Set the direction for the arrow. + * @param {Vector3} direction The direction coordinates. + */ + setDirection(direction: Vector3): boolean; + + /** + * Set the direction for the arrow. + * @param {Vector3} direction The direction coordinates. + */ + setDirectionFrom(direction: Vector3): boolean; + + /** + * Inverts the arrow direction. + * When set to true, base is at [1, 0, 0] while the tip is at [0, 0, 0]. + * @param {Booolean} invert + */ + setInvert(invert: boolean): boolean; + + /** + * Set the radius of the shaft. + * @param {Number} shaftRadius + */ + setShaftRadius(shaftRadius: number): boolean; + + /** + * Set the resolution of the shaft. + * @param {Number} shaftResolution + */ + setShaftResolution(shaftResolution: number): boolean; + + /** + * Set the length of the tip. + * @param {Number} tipLength + */ + setTipLength(tipLength: number): boolean; + + /** + * Set the radius of the tip. + * @param {Number} tipRadius + */ + setTipRadius(tipRadius: number): boolean; + + /** + * Set the resolution of the tip. + * @param {Number} tipResolution + */ + setTipResolution(tipResolution: number): boolean; } /** * Method used to decorate a given object (publicAPI+model) with vtkArrowSource characteristics. * - * @param publicAPI object on which methods will be bounds (public) - * @param model object on which data structure will be bounds (protected) - * @param {IArrowSourceInitialValues} [initialValues] (default: {}) + * @param publicAPI object on which methods will be bounds (public) + * @param model object on which data structure will be bounds (protected) + * @param {IArrowSourceInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IArrowSourceInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IArrowSourceInitialValues +): void; /** * Method used to create a new instance of vtkArrowSource. - * @param {IArrowSourceInitialValues} [initialValues] for pre-setting some of its content + * @param {IArrowSourceInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IArrowSourceInitialValues): vtkArrowSource; +export function newInstance( + initialValues?: IArrowSourceInitialValues +): vtkArrowSource; /** * vtkArrowSource was intended to be used as the source for a glyph. @@ -166,11 +174,11 @@ export function newInstance(initialValues?: IArrowSourceInitialValues): vtkArrow * The resolution of the cone and shaft can be set and default to 6. * The radius of the cone and shaft can be set and default to 0.03 and 0.1. * The length of the tip can also be set, and defaults to 0.35. - * + * * @example * ```js * import vtkArrowSource from '@kitware/vtk.js/Filters/Sources/ArrowSource'; - * + * * const arrow = vtkArrowSource.newInstance({ * tipResolution: 6, * tipRadius: 0.1, @@ -183,7 +191,7 @@ export function newInstance(initialValues?: IArrowSourceInitialValues): vtkArrow * ``` */ export declare const vtkArrowSource: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkArrowSource; diff --git a/Sources/Filters/Sources/CircleSource/index.d.ts b/Sources/Filters/Sources/CircleSource/index.d.ts index 2218573785d..28d93b05c23 100755 --- a/Sources/Filters/Sources/CircleSource/index.d.ts +++ b/Sources/Filters/Sources/CircleSource/index.d.ts @@ -1,140 +1,142 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import { Vector3 } from "../../../types"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import { Vector3 } from '../../../types'; /** * */ export interface ICircleSourceInitialValues { - radius?: number; - resolution?: number; - center?: Vector3; - pointType?: string; - lines?: boolean; - face?: boolean; + radius?: number; + resolution?: number; + center?: Vector3; + pointType?: string; + lines?: boolean; + face?: boolean; } -type vtkCircleSourceBase = vtkObject & Omit; +type vtkCircleSourceBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkCircleSource extends vtkCircleSourceBase { - - /** - * Get the center of the cone. - * @default [0, 0, 0] - */ - getCenter(): Vector3; - - /** - * Get the center of the cone. - */ - getCenterByReference(): Vector3; - - /** - * Get the orientation vector of the cone. - * @default [1.0, 0.0, 0.0] - */ - getDirection(): Vector3; - - /** - * Get the orientation vector of the cone. - */ - getDirectionByReference(): Vector3; - - /** - * - * @default true - */ - getFace(): boolean; - - /** - * - * @default false - */ - getLines(): boolean; - - /** - * Get the radius of the cylinder base. - * @default 1.0 - */ - getRadius(): number; - - /** - * Get the number of facets used to define cylinder. - * @default 6 - */ - getResolution(): number; - - /** - * Expose methods - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * Set the direction for the circle. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setDirection(x: number, y: number, z: number): boolean; - - /** - * Set the direction for the circle. - * @param {Vector3} direction The direction coordinates. - */ - setDirection(direction: Vector3): boolean; - - /** - * Set the direction for the circle. - * @param {Vector3} direction The direction coordinates. - */ - setDirectionFrom(direction: Vector3): boolean; - - /** - * Set the center of the circle. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - * @default [0, 0, 0] - */ - setCenter(x: number, y: number, z: number): boolean; - - /** - * Set the center of the circle. - * @param {Vector3} center - * @default [0, 0, 0] - */ - setCenterFrom(center: Vector3): boolean; - - /** - * - * @param {Boolean} face - */ - setFace(face: boolean): boolean; - - /** - * - * @param {Boolean} lines - */ - setLines(lines: boolean): boolean; - - /** - * Set the radius of the circle. - * @param {Number} radius The radius of the circle. - */ - setRadius(radius: number): boolean; - - /** - * Set the resolution of the circle. - * @param {Number} resolution The resolution of the circle. - */ - setResolution(resolution: number): boolean; + /** + * Get the center of the cone. + * @default [0, 0, 0] + */ + getCenter(): Vector3; + + /** + * Get the center of the cone. + */ + getCenterByReference(): Vector3; + + /** + * Get the orientation vector of the cone. + * @default [1.0, 0.0, 0.0] + */ + getDirection(): Vector3; + + /** + * Get the orientation vector of the cone. + */ + getDirectionByReference(): Vector3; + + /** + * + * @default true + */ + getFace(): boolean; + + /** + * + * @default false + */ + getLines(): boolean; + + /** + * Get the radius of the cylinder base. + * @default 1.0 + */ + getRadius(): number; + + /** + * Get the number of facets used to define cylinder. + * @default 6 + */ + getResolution(): number; + + /** + * Expose methods + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * Set the direction for the circle. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setDirection(x: number, y: number, z: number): boolean; + + /** + * Set the direction for the circle. + * @param {Vector3} direction The direction coordinates. + */ + setDirection(direction: Vector3): boolean; + + /** + * Set the direction for the circle. + * @param {Vector3} direction The direction coordinates. + */ + setDirectionFrom(direction: Vector3): boolean; + + /** + * Set the center of the circle. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + * @default [0, 0, 0] + */ + setCenter(x: number, y: number, z: number): boolean; + + /** + * Set the center of the circle. + * @param {Vector3} center + * @default [0, 0, 0] + */ + setCenterFrom(center: Vector3): boolean; + + /** + * + * @param {Boolean} face + */ + setFace(face: boolean): boolean; + + /** + * + * @param {Boolean} lines + */ + setLines(lines: boolean): boolean; + + /** + * Set the radius of the circle. + * @param {Number} radius The radius of the circle. + */ + setRadius(radius: number): boolean; + + /** + * Set the resolution of the circle. + * @param {Number} resolution The resolution of the circle. + */ + setResolution(resolution: number): boolean; } /** @@ -144,13 +146,19 @@ export interface vtkCircleSource extends vtkCircleSourceBase { * @param model object on which data structure will be bounds (protected) * @param {ICircleSourceInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ICircleSourceInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ICircleSourceInitialValues +): void; /** * Method used to create a new instance of vtkCircleSource. * @param {ICircleSourceInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ICircleSourceInitialValues): vtkCircleSource; +export function newInstance( + initialValues?: ICircleSourceInitialValues +): vtkCircleSource; /** /** @@ -165,7 +173,7 @@ export function newInstance(initialValues?: ICircleSourceInitialValues): vtkCirc * ``` */ export declare const vtkCircleSource: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkCircleSource; diff --git a/Sources/Filters/Sources/ConeSource/index.d.ts b/Sources/Filters/Sources/ConeSource/index.d.ts index f58f43c78de..758db1a00cd 100755 --- a/Sources/Filters/Sources/ConeSource/index.d.ts +++ b/Sources/Filters/Sources/ConeSource/index.d.ts @@ -1,167 +1,169 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import { Vector3 } from "../../../types"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import { Vector3 } from '../../../types'; /** * */ export interface IConeSourceInitialValues { - height?: number; - radius?: number; - resolution?: number; - center?: Vector3 ; - direction?: Vector3; - capping?: boolean; - pointType?: string; + height?: number; + radius?: number; + resolution?: number; + center?: Vector3; + direction?: Vector3; + capping?: boolean; + pointType?: string; } -type vtkConeSourceBase = vtkObject & Omit; +type vtkConeSourceBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkConeSource extends vtkConeSourceBase { - - /** - * Get the cap the base of the cone with a polygon. - * @default true - */ - getCapping(): boolean; - - /** - * Get the center of the cone. - * @default [0, 0, 0] - */ - getCenter(): Vector3; - - /** - * Get the center of the cone. - */ - getCenterByReference(): Vector3; - - /** - * Get the orientation vector of the cone. - * @default [1.0, 0.0, 0.0] - */ - getDirection(): Vector3; - - /** - * Get the orientation vector of the cone. - */ - getDirectionByReference(): Vector3; - - /** - * Get the height of the cone. - * @default 1.0 - */ - getHeight(): number; - - /** - * Get the base radius of the cone. - * @default 0.5 - */ - getRadius(): number; - - /** - * Get the number of facets used to represent the cone. - * @default 6 - */ - getResolution(): number; - - /** - * Expose methods - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * Turn on/off whether to cap the base of the cone with a polygon. - * @param {Boolean} capping - */ - setCapping(capping: boolean): boolean; - - /** - * Set the center of the cone. - * It is located at the middle of the axis of the cone. - * !!! warning - * This is not the center of the base of the cone! - * @param {Number} x - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - * @default [0, 0, 0] - */ - setCenter(x: number, y: number, z: number): boolean; - - /** - * Set the center of the cone. - * It is located at the middle of the axis of the cone. - * !!! warning - * This is not the center of the base of the cone! - * @param {Vector3} center - * @default [0, 0, 0] - */ - setCenter(center: Vector3): boolean; - - /** - * Set the center of the cone. - * It is located at the middle of the axis of the cone. - * !!! warning - * This is not the center of the base of the cone! - * @param {Vector3} center - * @default [0, 0, 0] - */ - setCenterFrom(center: Vector3): boolean; - - /** - * Set the direction for the cone. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - * @default [1, 0, 0] - */ - setDirection(x: number, y: number, z: number): boolean; - - /** - * Set the direction for the cone. - * @param {Vector3} direction The direction coordinates. - */ - setDirection(direction: Vector3): boolean; - - /** - * Set the direction for the cone. - * @param {Vector3} direction - * @default [1, 0, 0] - */ - setDirection(direction: Vector3): boolean; - - /** - * Set the direction for the cone. - * @param {Vector3} direction - * @default [1, 0, 0] - */ - setDirectionFrom(direction: Vector3): boolean; - - /** - * Set the height of the cone. - * This is the height along the cone in its specified direction. - * @param {Number} height - */ - setHeight(height: number): boolean; - - /** - * Set the base radius of the cone. - * @param {Number} radius - */ - setRadius(radius: number): boolean; - - /** - * Set the number of facets used to represent the cone. - * @param resolution - */ - setResolution(resolution: number): boolean; + /** + * Get the cap the base of the cone with a polygon. + * @default true + */ + getCapping(): boolean; + + /** + * Get the center of the cone. + * @default [0, 0, 0] + */ + getCenter(): Vector3; + + /** + * Get the center of the cone. + */ + getCenterByReference(): Vector3; + + /** + * Get the orientation vector of the cone. + * @default [1.0, 0.0, 0.0] + */ + getDirection(): Vector3; + + /** + * Get the orientation vector of the cone. + */ + getDirectionByReference(): Vector3; + + /** + * Get the height of the cone. + * @default 1.0 + */ + getHeight(): number; + + /** + * Get the base radius of the cone. + * @default 0.5 + */ + getRadius(): number; + + /** + * Get the number of facets used to represent the cone. + * @default 6 + */ + getResolution(): number; + + /** + * Expose methods + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * Turn on/off whether to cap the base of the cone with a polygon. + * @param {Boolean} capping + */ + setCapping(capping: boolean): boolean; + + /** + * Set the center of the cone. + * It is located at the middle of the axis of the cone. + * !!! warning + * This is not the center of the base of the cone! + * @param {Number} x + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + * @default [0, 0, 0] + */ + setCenter(x: number, y: number, z: number): boolean; + + /** + * Set the center of the cone. + * It is located at the middle of the axis of the cone. + * !!! warning + * This is not the center of the base of the cone! + * @param {Vector3} center + * @default [0, 0, 0] + */ + setCenter(center: Vector3): boolean; + + /** + * Set the center of the cone. + * It is located at the middle of the axis of the cone. + * !!! warning + * This is not the center of the base of the cone! + * @param {Vector3} center + * @default [0, 0, 0] + */ + setCenterFrom(center: Vector3): boolean; + + /** + * Set the direction for the cone. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + * @default [1, 0, 0] + */ + setDirection(x: number, y: number, z: number): boolean; + + /** + * Set the direction for the cone. + * @param {Vector3} direction The direction coordinates. + */ + setDirection(direction: Vector3): boolean; + + /** + * Set the direction for the cone. + * @param {Vector3} direction + * @default [1, 0, 0] + */ + setDirection(direction: Vector3): boolean; + + /** + * Set the direction for the cone. + * @param {Vector3} direction + * @default [1, 0, 0] + */ + setDirectionFrom(direction: Vector3): boolean; + + /** + * Set the height of the cone. + * This is the height along the cone in its specified direction. + * @param {Number} height + */ + setHeight(height: number): boolean; + + /** + * Set the base radius of the cone. + * @param {Number} radius + */ + setRadius(radius: number): boolean; + + /** + * Set the number of facets used to represent the cone. + * @param resolution + */ + setResolution(resolution: number): boolean; } /** @@ -171,13 +173,19 @@ export interface vtkConeSource extends vtkConeSourceBase { * @param model object on which data structure will be bounds (protected) * @param {IConeSourceInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues ? : IConeSourceInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IConeSourceInitialValues +): void; /** * Method used to create a new instance of vtkConeSource. * @param {IConeSourceInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues ? : IConeSourceInitialValues): vtkConeSource; +export function newInstance( + initialValues?: IConeSourceInitialValues +): vtkConeSource; /** * vtkConeSource creates a cone centered at a specified point and pointing in a specified direction. @@ -186,17 +194,17 @@ export function newInstance(initialValues ? : IConeSourceInitialValues): vtkCone * if resolution=2, two crossed triangles are created. For resolution > 2, a 3D cone (with resolution number of sides) * is created. It also is possible to control whether the bottom of the cone is capped with a (resolution-sided) polygon, * and to specify the height and radius of the cone. - * + * * @example * ```js * import vtkConeSource from '@kitware/vtk.js/Filters/Sources/ConeSource'; - * + * * const cone = vtkConeSource.newInstance({ height: 2, radius: 1, resolution: 80 }); * const polydata = cone.getOutputData(); * ``` */ export declare const vtkConeSource: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkConeSource; diff --git a/Sources/Filters/Sources/CubeSource/index.d.ts b/Sources/Filters/Sources/CubeSource/index.d.ts index 5019010eed1..4eb1dd6a2ad 100755 --- a/Sources/Filters/Sources/CubeSource/index.d.ts +++ b/Sources/Filters/Sources/CubeSource/index.d.ts @@ -1,190 +1,201 @@ import { mat4 } from 'gl-matrix'; -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import { Bounds, Vector3 } from "../../../types"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import { Bounds, Vector3 } from '../../../types'; /** * */ export interface ICircleSourceInitialValues { - xLength?: number; - yLength?: number; - zLength?: number; - center?: Vector3; - rotations?: Vector3; - pointType?: string; - generate3DTextureCoordinates?: boolean; + xLength?: number; + yLength?: number; + zLength?: number; + center?: Vector3; + rotations?: Vector3; + pointType?: string; + generate3DTextureCoordinates?: boolean; } -type vtkCubeSourceBase = vtkObject & Omit; +type vtkCubeSourceBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkCubeSource extends vtkCubeSourceBase { - - /** - * Get the center of the cube. - * @default [0.0, 0.0, 0.0] - */ - getCenter(): Vector3; - - /** - * Get the center of the cube. - */ - getCenterByReference(): Vector3; - - /** - * - * @default false - */ - getGenerate3DTextureCoordinates(): boolean; - - /** - * Flag that indicates whether the output will generate faces of the outline. - * @returns {boolean} - */ - getGenerateFaces(): boolean; - - /** - * Flag that indicates whether the output will generate wireframe lines of the outline. - * @returns {boolean} - */ - getGenerateLines(): boolean; - - /** - * Get the 4x4 transformation set to apply as a final trasformation to the output. - * @param matrix - */ - getMatrix(): mat4; - - /** - * - * @default [0.0, 0.0, 0.0] - */ - getRotations(): Vector3; - - /** - * - * @default [0.0, 0.0, 0.0] - */ - getRotationsByReference(): Vector3; - - /** - * Get the length of the cube in the x-direction. - * @default 1.0 - */ - getXLength(): number; - - /** - * Get the length of the cube in the y-direction. - * @default 1.0 - */ - getYLength(): number; - - /** - * Get the length of the cube in the z-direction. - * @default 1.0 - */ - getZLength(): number; - - /** - * Expose methods - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * Convenience methods allows creation of cube by specifying bounding box. - * @param {Number} xMin - * @param {Number} xMax - * @param {Number} yMin - * @param {Number} yMax - * @param {Number} zMin - * @param {Number} zMax - */ - setBounds(xMin: number, xMax: number, yMin: number, yMax: number, zMin: number, zMax: number): boolean; - - /** - * Convenience methods allows creation of cube by specifying bounding box. - * @param {Bounds} bounds The bounds for the cube. - */ - setBounds(bounds: Bounds): boolean; - - /** - * Set the center of the cube. - * @param x - * @param y - * @param z - * @default [0, 0, 0] - */ - setCenter(x: number, y: number, z: number): boolean; - - /** - * Set the center of the cube. - * @param center - * @default [0, 0, 0] - */ - setCenterFrom(center: Vector3): boolean; - - /** - * - * @param generate3DTextureCoordinates - */ - setGenerate3DTextureCoordinates(generate3DTextureCoordinates: boolean): boolean; - - /** - * Flag to indicate that the output should generate wireframe of the outline. - * @param {boolean} generateLines - */ - setGenerateLines(generateLines: boolean): boolean; - - /** - * Flag to indicate that the output should generate triangulated faces of the outline. - * @param {boolean} generateFaces - */ - setGenerateFaces(generateFaces: boolean): boolean; - - /** - * Set a 4x4 transformation that will be applied as a final trasformation to the output. - * @param matrix - */ - setMatrix(matrix: mat4): boolean; - - /** - * Float array of size 3 representing the angles, in degrees, of rotation for the cube. - * @param xAngle - * @param yAngle - * @param zAngle - */ - setRotations(xAngle: number, yAngle: number, zAngle: number): boolean; - - /** - * - * @param {Vector3} rotations - */ - setRotationsFrom(rotations: Vector3): boolean; - - /** - * Set the length of the cube in the x-direction. - * @param xLength - */ - setXLength(xLength: number): boolean; - - /** - * Set the length of the cube in the y-direction. - * @param yLength - */ - setYLength(yLength: number): boolean; - - /** - * Set the length of the cube in the z-direction. - * @param zLength - */ - setZLength(zLength: number): boolean; + /** + * Get the center of the cube. + * @default [0.0, 0.0, 0.0] + */ + getCenter(): Vector3; + + /** + * Get the center of the cube. + */ + getCenterByReference(): Vector3; + + /** + * + * @default false + */ + getGenerate3DTextureCoordinates(): boolean; + + /** + * Flag that indicates whether the output will generate faces of the outline. + * @returns {boolean} + */ + getGenerateFaces(): boolean; + + /** + * Flag that indicates whether the output will generate wireframe lines of the outline. + * @returns {boolean} + */ + getGenerateLines(): boolean; + + /** + * Get the 4x4 transformation set to apply as a final trasformation to the output. + * @param matrix + */ + getMatrix(): mat4; + + /** + * + * @default [0.0, 0.0, 0.0] + */ + getRotations(): Vector3; + + /** + * + * @default [0.0, 0.0, 0.0] + */ + getRotationsByReference(): Vector3; + + /** + * Get the length of the cube in the x-direction. + * @default 1.0 + */ + getXLength(): number; + + /** + * Get the length of the cube in the y-direction. + * @default 1.0 + */ + getYLength(): number; + + /** + * Get the length of the cube in the z-direction. + * @default 1.0 + */ + getZLength(): number; + + /** + * Expose methods + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * Convenience methods allows creation of cube by specifying bounding box. + * @param {Number} xMin + * @param {Number} xMax + * @param {Number} yMin + * @param {Number} yMax + * @param {Number} zMin + * @param {Number} zMax + */ + setBounds( + xMin: number, + xMax: number, + yMin: number, + yMax: number, + zMin: number, + zMax: number + ): boolean; + + /** + * Convenience methods allows creation of cube by specifying bounding box. + * @param {Bounds} bounds The bounds for the cube. + */ + setBounds(bounds: Bounds): boolean; + + /** + * Set the center of the cube. + * @param x + * @param y + * @param z + * @default [0, 0, 0] + */ + setCenter(x: number, y: number, z: number): boolean; + + /** + * Set the center of the cube. + * @param center + * @default [0, 0, 0] + */ + setCenterFrom(center: Vector3): boolean; + + /** + * + * @param generate3DTextureCoordinates + */ + setGenerate3DTextureCoordinates( + generate3DTextureCoordinates: boolean + ): boolean; + + /** + * Flag to indicate that the output should generate wireframe of the outline. + * @param {boolean} generateLines + */ + setGenerateLines(generateLines: boolean): boolean; + + /** + * Flag to indicate that the output should generate triangulated faces of the outline. + * @param {boolean} generateFaces + */ + setGenerateFaces(generateFaces: boolean): boolean; + + /** + * Set a 4x4 transformation that will be applied as a final trasformation to the output. + * @param matrix + */ + setMatrix(matrix: mat4): boolean; + + /** + * Float array of size 3 representing the angles, in degrees, of rotation for the cube. + * @param xAngle + * @param yAngle + * @param zAngle + */ + setRotations(xAngle: number, yAngle: number, zAngle: number): boolean; + + /** + * + * @param {Vector3} rotations + */ + setRotationsFrom(rotations: Vector3): boolean; + + /** + * Set the length of the cube in the x-direction. + * @param xLength + */ + setXLength(xLength: number): boolean; + + /** + * Set the length of the cube in the y-direction. + * @param yLength + */ + setYLength(yLength: number): boolean; + + /** + * Set the length of the cube in the z-direction. + * @param zLength + */ + setZLength(zLength: number): boolean; } /** @@ -194,28 +205,34 @@ export interface vtkCubeSource extends vtkCubeSourceBase { * @param model object on which data structure will be bounds (protected) * @param {ICircleSourceInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ICircleSourceInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ICircleSourceInitialValues +): void; /** * Method used to create a new instance of vtkCubeSource. * @param {ICircleSourceInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ICircleSourceInitialValues): vtkCubeSource; +export function newInstance( + initialValues?: ICircleSourceInitialValues +): vtkCubeSource; /** * vtkCubeSource creates a cube centered at origin. The cube is represented with four-sided polygons. * It is possible to specify the length, width, and height of the cube independently. - * + * * @example * ```js * import vtkCubeSource from '@kitware/vtk.js/Filters/Sources/CubeSource'; - * + * * const cubeSource = vtkCubeSource.newInstance({ xLength: 5, yLength: 5, zLength: 5 }); * const polydata = cubeSource.getOutputData(); * ``` */ export declare const vtkCubeSource: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkCubeSource; diff --git a/Sources/Filters/Sources/Cursor3D/index.d.ts b/Sources/Filters/Sources/Cursor3D/index.d.ts index fd7cfc2ae0e..5c5c9d8e810 100755 --- a/Sources/Filters/Sources/Cursor3D/index.d.ts +++ b/Sources/Filters/Sources/Cursor3D/index.d.ts @@ -1,183 +1,184 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; import vtkPolyData from '../../../Common/DataModel/PolyData'; -import { Bounds, Vector3 } from "../../../types"; - +import { Bounds, Vector3 } from '../../../types'; /** * */ export interface ICursor3DInitialValues { - modelBounds?: Bounds; - focalPoint?: Vector3; - outline?: boolean; - axes?: boolean; - xShadows?: boolean; - yShadows?: boolean; - zShadows?: boolean; - wrap?: boolean; - translationMode?: boolean; + modelBounds?: Bounds; + focalPoint?: Vector3; + outline?: boolean; + axes?: boolean; + xShadows?: boolean; + yShadows?: boolean; + zShadows?: boolean; + wrap?: boolean; + translationMode?: boolean; } -type vtkCursor3DBase = vtkObject & Omit; +type vtkCursor3DBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkCursor3D extends vtkCursor3DBase { - - /** - * Turn every part of the 3D cursor off. - */ - allOff(): void; - - /** - * Turn every part of the 3D cursor on. - */ - allOn(): void; - - /** - * - */ - getAxes(): boolean; - - /** - * Get the position of cursor focus. - */ - getFocalPoint(): Vector3; - - /** - * - */ - getFocalPointByReference(): Vector3; - - /** - * - * @default null - */ - getFocus(): null | vtkPolyData; - - /** - * Set the boundary of the 3D cursor. - * @default [-1.0, 1.0, -1.0, 1.0, -1.0, 1.0] - */ - getModelBounds(): Bounds; - - /** - * - * @default [-1.0, 1.0, -1.0, 1.0, -1.0, 1.0] - */ - getModelBoundsByReference(): Bounds; - - /** - * - * @default true - */ - getOutline(): boolean; - - /** - * Get the translation mode. - * @default false - */ - getTranslationMode(): boolean; - - /** - * Get the state of the cursor wrapping. - * @default false - */ - getWrap(): boolean; - - /** - * Get the state of the wireframe x-shadows. - * @default true - */ - getXShadows(): boolean; - - /** - * Get the state of the wireframe y-shadows. - * @default true - */ - getYShadows(): boolean; - - /** - * Get the state of the wireframe z-shadows. - * @default true - */ - getZShadows(): boolean; - - /** - * Expose methods - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - /** - * - * @param {Boolean} flag - */ - setAll(flag: boolean): void; - - /** - * Turn on/off the wireframe axes. - * @param {Boolean} axes - */ - setAxes(axes: boolean): boolean; - - /** - * Set the position of cursor focus. - * If translation mode is on, then the entire cursor (including bounding - * box, cursor, and shadows) is translated. Otherwise, the focal point will - * either be clamped to the bounding box, or wrapped, if Wrap is on. (Note: - * this behavior requires that the bounding box is set prior to the focal - * point.) - * @param {Vector3} points - */ - setFocalPoint(points: Vector3): boolean; - - /** - * Set the boundary of the 3D cursor. - * @param {Bounds} bounds The bounds of the 3D cursor. - */ - setModelBounds(bounds: Bounds): boolean; - - /** - * Enable/disable the translation mode. - * If on, changes in cursor position cause the entire widget to translate - * along with the cursor. - * @param {Boolean} translationMode - */ - setTranslationMode(translationMode: boolean): boolean; - - /** - * Turn on/off cursor wrapping. - * If the cursor focus moves outside the specified bounds, - * the cursor will either be restrained against the nearest "wall" (Wrap=off), - * or it will wrap around (Wrap=on). - * @param {Number} wrap - */ - setWrap(wrap: number): boolean; - - /** + /** + * Turn every part of the 3D cursor off. + */ + allOff(): void; + + /** + * Turn every part of the 3D cursor on. + */ + allOn(): void; + + /** + * + */ + getAxes(): boolean; + + /** + * Get the position of cursor focus. + */ + getFocalPoint(): Vector3; + + /** + * + */ + getFocalPointByReference(): Vector3; + + /** + * + * @default null + */ + getFocus(): null | vtkPolyData; + + /** + * Set the boundary of the 3D cursor. + * @default [-1.0, 1.0, -1.0, 1.0, -1.0, 1.0] + */ + getModelBounds(): Bounds; + + /** + * + * @default [-1.0, 1.0, -1.0, 1.0, -1.0, 1.0] + */ + getModelBoundsByReference(): Bounds; + + /** + * + * @default true + */ + getOutline(): boolean; + + /** + * Get the translation mode. + * @default false + */ + getTranslationMode(): boolean; + + /** + * Get the state of the cursor wrapping. + * @default false + */ + getWrap(): boolean; + + /** + * Get the state of the wireframe x-shadows. + * @default true + */ + getXShadows(): boolean; + + /** + * Get the state of the wireframe y-shadows. + * @default true + */ + getYShadows(): boolean; + + /** + * Get the state of the wireframe z-shadows. + * @default true + */ + getZShadows(): boolean; + + /** + * Expose methods + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + /** + * + * @param {Boolean} flag + */ + setAll(flag: boolean): void; + + /** + * Turn on/off the wireframe axes. + * @param {Boolean} axes + */ + setAxes(axes: boolean): boolean; + + /** + * Set the position of cursor focus. + * If translation mode is on, then the entire cursor (including bounding + * box, cursor, and shadows) is translated. Otherwise, the focal point will + * either be clamped to the bounding box, or wrapped, if Wrap is on. (Note: + * this behavior requires that the bounding box is set prior to the focal + * point.) + * @param {Vector3} points + */ + setFocalPoint(points: Vector3): boolean; + + /** + * Set the boundary of the 3D cursor. + * @param {Bounds} bounds The bounds of the 3D cursor. + */ + setModelBounds(bounds: Bounds): boolean; + + /** + * Enable/disable the translation mode. + * If on, changes in cursor position cause the entire widget to translate + * along with the cursor. + * @param {Boolean} translationMode + */ + setTranslationMode(translationMode: boolean): boolean; + + /** + * Turn on/off cursor wrapping. + * If the cursor focus moves outside the specified bounds, + * the cursor will either be restrained against the nearest "wall" (Wrap=off), + * or it will wrap around (Wrap=on). + * @param {Number} wrap + */ + setWrap(wrap: number): boolean; + + /** * Turn on/off the wireframe x-shadows. * @param {Number} xLength */ - setXShadows(xLength: number): boolean; + setXShadows(xLength: number): boolean; - /** + /** * Turn on/off the wireframe y-shadows. * @param {Number} yLength */ - setYShadows(yLength: number): boolean; + setYShadows(yLength: number): boolean; - /** - * Turn on/off the wireframe z-shadows. - * @param {Number} zLength - */ - setZShadows(zLength: number): boolean; + /** + * Turn on/off the wireframe z-shadows. + * @param {Number} zLength + */ + setZShadows(zLength: number): boolean; } /** @@ -187,13 +188,19 @@ export interface vtkCursor3D extends vtkCursor3DBase { * @param model object on which data structure will be bounds (protected) * @param {ICursor3DInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ICursor3DInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ICursor3DInitialValues +): void; /** * Method used to create a new instance of vtkCursor3D. * @param {ICursor3DInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ICursor3DInitialValues): vtkCursor3D; +export function newInstance( + initialValues?: ICursor3DInitialValues +): vtkCursor3D; /** * vtkCursor3D is an object that generates a 3D representation of a cursor. The @@ -201,17 +208,17 @@ export function newInstance(initialValues?: ICursor3DInitialValues): vtkCursor3D * that meet at the cursor focus, and "shadows" or projections of the axes * against the sides of the bounding box. Each of these components can be turned * on/off. - * + * * @example * ```js * import vtkCursor3D from '@kitware/vtk.js/Filters/Sources/vtkCursor3D'; - * + * * const cursor = vtkCursor3D.newInstance({focalPoint: [0, 0, 0], modelBounds: [-100, 100, -100, 100, -100, 100]}); * const polyData = cursor.getOutputData(); * ``` */ export declare const vtkCursor3D: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkCursor3D; diff --git a/Sources/Filters/Sources/CylinderSource/index.d.ts b/Sources/Filters/Sources/CylinderSource/index.d.ts index ae66529a8e7..05b5cc9e774 100755 --- a/Sources/Filters/Sources/CylinderSource/index.d.ts +++ b/Sources/Filters/Sources/CylinderSource/index.d.ts @@ -1,174 +1,175 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import { Vector3 } from "../../../types"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import { Vector3 } from '../../../types'; /** * */ export interface ICylinderSourceInitialValues { - height?: number; - initAngle?: number; - otherRadius?: number; - radius?: number; - resolution?: number; - center?: Vector3; - direction?: Vector3; - capping?: boolean; - pointType?: string; + height?: number; + initAngle?: number; + otherRadius?: number; + radius?: number; + resolution?: number; + center?: Vector3; + direction?: Vector3; + capping?: boolean; + pointType?: string; } -type vtkCylinderSourceBase = vtkObject & Omit; +type vtkCylinderSourceBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkCylinderSource extends vtkCylinderSourceBase { - - /** - * Get the cap the base of the cylinder with a polygon. - * @default true - */ - getCapping(): boolean; - - /** - * Get the center of the cylinder. - * @default [0, 0, 0] - */ - getCenter(): Vector3; - - /** - * Get the center of the cylinder. - */ - getCenterByReference(): Vector3; - - /** - * Get the orientation vector of the cylinder. - * @default [1.0, 0.0, 0.0] - */ - getDirection(): Vector3; - - /** - * Get the orientation vector of the cylinder. - */ - getDirectionByReference(): Vector3; - - /** - * Get the height of the cylinder. - * @default 1.0 - */ - getHeight(): number; - - /** - * Get the initial angle along direction - * @default 0 - * @see getDirection - */ - getInitAngle(): number; - - /** - * Get the radius on Z axis. If not null and different from radius, - * the cylinder base becomes an ellipse instead of a circle. - * @default null - * @see getRadius() - */ - getOtherRadius(): number; - - /** - * Get the base radius of the cylinder. - * @default 0.5 - * @see getOtherRadius() - */ - getRadius(): number; - - /** - * Get the number of facets used to represent the cylinder. - * @default 6 - */ - getResolution(): number; - - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * Turn on/off whether to cap the base of the cone with a polygon. - * @param {Boolean} capping The capping value. - */ - setCapping(capping: boolean): boolean; - - /** - * Set the center of the cylinder. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - * @default [0, 0, 0] - */ - setCenter(x: number, y: number, z: number): boolean; - - /** - * Set the center of the cylinder. - * @param {Vector3} center The center point's coordinates. - * @default [0, 0, 0] - */ - setCenterFrom(center: Vector3): boolean; - - /** - * Set the direction for the cylinder. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setDirection(x: number, y: number, z: number): boolean; - - /** - * Set the direction for the cylinder. - * @param {Vector3} direction The direction coordinates. - */ - setDirection(direction: Vector3): boolean; - - /** - * Set the direction for the cylinder. - * @param {Vector3} direction The direction coordinates. - */ - setDirectionFrom(direction: Vector3): boolean; - - /** - * Set the height of the cylinder. - * @param {Number} height The height along the cylinder in its specified direction. - */ - setHeight(height: number): boolean; - - /** - * Set the initial angle along direction. - * @param {Number} initAngle The initial angle in radian. - */ - setInitAngle(initAngle: number): boolean; - - /** - * Set the base Z radius of the cylinder. - * @param {Number} radius The radius of the cylinder in Z. - * @see setRadius() - */ - setOtherRadius(radius: number): boolean; - - /** - * Set the base radius of the cylinder. - * @param {Number} radius The radius of the cylinder. - * @see setOtherRadius() - */ - setRadius(radius: number): boolean; - - /** - * Set the number of facets used to represent the cylinder. - * @param {Number} resolution The number of facets used to represent the cylinder. - */ - setResolution(resolution: number): boolean; - + /** + * Get the cap the base of the cylinder with a polygon. + * @default true + */ + getCapping(): boolean; + + /** + * Get the center of the cylinder. + * @default [0, 0, 0] + */ + getCenter(): Vector3; + + /** + * Get the center of the cylinder. + */ + getCenterByReference(): Vector3; + + /** + * Get the orientation vector of the cylinder. + * @default [1.0, 0.0, 0.0] + */ + getDirection(): Vector3; + + /** + * Get the orientation vector of the cylinder. + */ + getDirectionByReference(): Vector3; + + /** + * Get the height of the cylinder. + * @default 1.0 + */ + getHeight(): number; + + /** + * Get the initial angle along direction + * @default 0 + * @see getDirection + */ + getInitAngle(): number; + + /** + * Get the radius on Z axis. If not null and different from radius, + * the cylinder base becomes an ellipse instead of a circle. + * @default null + * @see getRadius() + */ + getOtherRadius(): number; + + /** + * Get the base radius of the cylinder. + * @default 0.5 + * @see getOtherRadius() + */ + getRadius(): number; + + /** + * Get the number of facets used to represent the cylinder. + * @default 6 + */ + getResolution(): number; + + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * Turn on/off whether to cap the base of the cone with a polygon. + * @param {Boolean} capping The capping value. + */ + setCapping(capping: boolean): boolean; + + /** + * Set the center of the cylinder. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + * @default [0, 0, 0] + */ + setCenter(x: number, y: number, z: number): boolean; + + /** + * Set the center of the cylinder. + * @param {Vector3} center The center point's coordinates. + * @default [0, 0, 0] + */ + setCenterFrom(center: Vector3): boolean; + + /** + * Set the direction for the cylinder. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setDirection(x: number, y: number, z: number): boolean; + + /** + * Set the direction for the cylinder. + * @param {Vector3} direction The direction coordinates. + */ + setDirection(direction: Vector3): boolean; + + /** + * Set the direction for the cylinder. + * @param {Vector3} direction The direction coordinates. + */ + setDirectionFrom(direction: Vector3): boolean; + + /** + * Set the height of the cylinder. + * @param {Number} height The height along the cylinder in its specified direction. + */ + setHeight(height: number): boolean; + + /** + * Set the initial angle along direction. + * @param {Number} initAngle The initial angle in radian. + */ + setInitAngle(initAngle: number): boolean; + + /** + * Set the base Z radius of the cylinder. + * @param {Number} radius The radius of the cylinder in Z. + * @see setRadius() + */ + setOtherRadius(radius: number): boolean; + + /** + * Set the base radius of the cylinder. + * @param {Number} radius The radius of the cylinder. + * @see setOtherRadius() + */ + setRadius(radius: number): boolean; + + /** + * Set the number of facets used to represent the cylinder. + * @param {Number} resolution The number of facets used to represent the cylinder. + */ + setResolution(resolution: number): boolean; } /** @@ -178,13 +179,19 @@ export interface vtkCylinderSource extends vtkCylinderSourceBase { * @param model object on which data structure will be bounds (protected) * @param {ICylinderSourceInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ICylinderSourceInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ICylinderSourceInitialValues +): void; /** * Method used to create a new instance of vtkCylinderSource. * @param {ICylinderSourceInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ICylinderSourceInitialValues): vtkCylinderSource; +export function newInstance( + initialValues?: ICylinderSourceInitialValues +): vtkCylinderSource; /** * vtkCylinderSource creates a polygonal cylinder centered at Center; @@ -192,17 +199,17 @@ export function newInstance(initialValues?: ICylinderSourceInitialValues): vtkCy * The height and radius of the cylinder can be specified, as well as the number of sides. * It is also possible to control whether the cylinder is open-ended or capped. * If you have the end points of the cylinder, you should use a vtkLineSource followed by a vtkTubeFilter instead of the vtkCylinderSource. - * + * * @example * ```js * import vtkCylinderSource from '@kitware/vtk.js/Filters/Sources/CylinderSource'; - * + * * const cylinder = vtkCylinderSource.newInstance({ height: 2, radius: 1, resolution: 80 }); * const polydata = cylinder.getOutputData(); * ``` */ export declare const vtkCylinderSource: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkCylinderSource; diff --git a/Sources/Filters/Sources/LineSource/index.d.ts b/Sources/Filters/Sources/LineSource/index.d.ts index 565ee0fca73..ea9d34c4bf7 100755 --- a/Sources/Filters/Sources/LineSource/index.d.ts +++ b/Sources/Filters/Sources/LineSource/index.d.ts @@ -1,100 +1,102 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import { Vector3 } from "../../../types"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import { Vector3 } from '../../../types'; /** * */ export interface ILineSourceInitialValues { - resolution?: number; - point1?: Vector3; - point2?: Vector3; - pointType?: string; + resolution?: number; + point1?: Vector3; + point2?: Vector3; + pointType?: string; } -type vtkLineSourceBase = vtkObject & Omit; +type vtkLineSourceBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkLineSource extends vtkLineSourceBase { - - /** - * Get the starting point of the line. - * @default [-1, 0, 0] - */ - getPoint1(): Vector3; - - /** - * Get the starting point of the line. - */ - getPoint1ByReference(): Vector3; - - /** - * Get the ending point of the line. - * @default [1, 0, 0] - */ - getPoint2(): Vector3; - - /** - * Get the ending point of the line. - */ - getPoint2ByReference(): Vector3; - - /** - * Get the resolution of the line. - * @default 6 - */ - getResolution(): number; - - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * Set the starting point of the line. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setPoint1(x: number, y: number, z: number): boolean; - - /** - * Set the starting point of the line. - * @param {Vector3} point1 The starting point's coordinates. - */ - setPoint1(point1: Vector3): boolean; - - /** - * Set the starting point of the line. - * @param {Vector3} point1 The starting point's coordinates. - */ - setPoint1From(point1: Vector3): boolean; - - /** - * Set the ending point of the line. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setPoint2(x: number, y: number, z: number): boolean; - - /** - * Set the ending point of the line. - * @param {Vector3} point2 The ending point's coordinates. - */ - setPoint2From(point2: Vector3): boolean; - - /** - * Set the number of segments used to represent the line. - * @param {Number} resolution The number of segments. - */ - setResolution(resolution: number): boolean; + /** + * Get the starting point of the line. + * @default [-1, 0, 0] + */ + getPoint1(): Vector3; + + /** + * Get the starting point of the line. + */ + getPoint1ByReference(): Vector3; + + /** + * Get the ending point of the line. + * @default [1, 0, 0] + */ + getPoint2(): Vector3; + + /** + * Get the ending point of the line. + */ + getPoint2ByReference(): Vector3; + + /** + * Get the resolution of the line. + * @default 6 + */ + getResolution(): number; + + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * Set the starting point of the line. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setPoint1(x: number, y: number, z: number): boolean; + + /** + * Set the starting point of the line. + * @param {Vector3} point1 The starting point's coordinates. + */ + setPoint1(point1: Vector3): boolean; + + /** + * Set the starting point of the line. + * @param {Vector3} point1 The starting point's coordinates. + */ + setPoint1From(point1: Vector3): boolean; + + /** + * Set the ending point of the line. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setPoint2(x: number, y: number, z: number): boolean; + + /** + * Set the ending point of the line. + * @param {Vector3} point2 The ending point's coordinates. + */ + setPoint2From(point2: Vector3): boolean; + + /** + * Set the number of segments used to represent the line. + * @param {Number} resolution The number of segments. + */ + setResolution(resolution: number): boolean; } /** @@ -104,29 +106,35 @@ export interface vtkLineSource extends vtkLineSourceBase { * @param model object on which data structure will be bounds (protected) * @param {ILineSourceInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ILineSourceInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ILineSourceInitialValues +): void; /** * Method used to create a new instance of vtkLineSource. * @param {ILineSourceInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ILineSourceInitialValues): vtkLineSource; +export function newInstance( + initialValues?: ILineSourceInitialValues +): vtkLineSource; /** * vtkLineSource creates a line segment from point1 to point2; * The resolution can be specified, which determines the number of points along the line. * Following a vtkLineSource by a vtkTubeFilter is a convenient way to create a cylinder based on endpoints. - * + * * @example * ```js * import vtkLineSource from '@kitware/vtk.js/Filters/Sources/LineSource'; - * + * * const line = vtkLineSource.newInstance({ resolution: 10 }); * const polydata = line.getOutputData(); * ``` */ export declare const vtkLineSource: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkLineSource; diff --git a/Sources/Filters/Sources/PlaneSource/index.d.ts b/Sources/Filters/Sources/PlaneSource/index.d.ts index ab43cbef35e..b8cb23a05bc 100755 --- a/Sources/Filters/Sources/PlaneSource/index.d.ts +++ b/Sources/Filters/Sources/PlaneSource/index.d.ts @@ -1,210 +1,212 @@ import { vec3 } from 'gl-matrix'; -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; import { Vector3 } from '../../../types'; /** - * + * */ export interface IPlaneSourceInitialValues { - xResolution?: number; - yResolution?: number; - origin?: Vector3; - point1?: Vector3; - point2?: Vector3; - pointType?: string; + xResolution?: number; + yResolution?: number; + origin?: Vector3; + point1?: Vector3; + point2?: Vector3; + pointType?: string; } -type vtkPlaneSourceBase = vtkObject & Omit; +type vtkPlaneSourceBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkPlaneSource extends vtkPlaneSourceBase { - - /** - * Get the center of the plane. - * @default [0, 0, 0] - */ - getCenter(): Vector3; - - /** - * Get the center of the plane. - */ - getCenterByReference(): Vector3; - - /** - * Get the normal of the plane. - * @default [0, 0, 1] - */ - getNormal(): Vector3; - - /** - * Get the normal of the plane. - */ - getNormalByReference(): Vector3; - - /** - * Get the origin of the plane, lower-left corner. - * @default [0, 0, 0] - */ - getOrigin(): Vector3; - - /** - * Get the origin of the plane, lower-left corner. - */ - getOriginByReference(): Vector3; - - /** - * Get the x axes of the plane. - * @default [1, 0, 0] - */ - getPoint1(): Vector3; - - /** - * Get the x axes of the plane. - */ - getPoint1ByReference(): Vector3; - - /** - * Get the y axes of the plane. - * @default [0, 1, 0] - */ - getPoint2(): Vector3; - - /** - * Get the y axes of the plane. - */ - getPoint2ByReference(): Vector3; - - /** - * Get the x resolution of the plane. - * @default 10 - */ - getXResolution(): number; - - /** - * Get the y resolution of the plane. - * @default 10 - */ - getYResolution(): number; - - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * Rotate plane around a given axis - * @param angle theta Angle (radian) to rotate about - * @param rotationAxis Axis to rotate around - */ - rotate(angle: number, rotationAxis: vec3): void; - - /** - * Set the center of the plane. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setCenter(x: number, y: number, z: number): void; - - /** - * Set the center of the plane. - * @param {Vector3} center The coordinate of the center point. - */ - setCenter(center: Vector3): void; - - /** - * Set the normal of the plane. - * @param {Vector3} normal The normal coordinate. - */ - setNormal(normal: Vector3): boolean; - - /** - * Set the normal of the plane. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setNormal(x: number, y: number, z: number): boolean; - - /** - * Set the normal of the plane. - * @param {Vector3} normal The normal coordinate. - */ - setNormalFrom(normal: Vector3): boolean; - - /** - * Set the origin of the plane. - * @param {Vector3} origin The coordinate of the origin point. - */ - setOrigin(origin: Vector3): boolean; - - /** - * Set the origin of the plane. - * @param {Number} x The x coordinate of the origin point. - * @param {Number} y The y coordinate of the origin point. - * @param {Number} z The z coordinate of the origin point. - */ - setOrigin(x: number, y: number, z: number): boolean; - - /** - * Set the origin of the plane. - * @param {Vector3} origin The coordinate of the origin point. - */ - setOriginFrom(origin: Vector3): boolean; - - /** - * Specify a point defining the first axis of the plane. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setPoint1(x: number, y: number, z: number): boolean; - - /** - * Specify a point defining the first axis of the plane. - * @param {Vector3} point1 - */ - setPoint1(point1: Vector3): boolean; - - /** - * Specify a point defining the second axis of the plane. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setPoint2(x: number, y: number, z: number): boolean; - - /** - * Specify a point defining the second axis of the plane. - * @param {Vector3} point2 - */ - setPoint2(point2: Vector3): boolean; - - /** - * Set the number of facets used to represent the cone. - * @param {Number} xResolution - */ - setXResolution(xResolution: number): boolean; - - /** - * Set the number of facets used to represent the cone. - * @param {Number} yResolution - */ - setYResolution(yResolution: number): boolean; - - /** - * - * @param {vec3} v1 - * @param {vec3} v2 - */ - updatePlane(v1: vec3, v2: vec3): boolean; + /** + * Get the center of the plane. + * @default [0, 0, 0] + */ + getCenter(): Vector3; + + /** + * Get the center of the plane. + */ + getCenterByReference(): Vector3; + + /** + * Get the normal of the plane. + * @default [0, 0, 1] + */ + getNormal(): Vector3; + + /** + * Get the normal of the plane. + */ + getNormalByReference(): Vector3; + + /** + * Get the origin of the plane, lower-left corner. + * @default [0, 0, 0] + */ + getOrigin(): Vector3; + + /** + * Get the origin of the plane, lower-left corner. + */ + getOriginByReference(): Vector3; + + /** + * Get the x axes of the plane. + * @default [1, 0, 0] + */ + getPoint1(): Vector3; + + /** + * Get the x axes of the plane. + */ + getPoint1ByReference(): Vector3; + + /** + * Get the y axes of the plane. + * @default [0, 1, 0] + */ + getPoint2(): Vector3; + + /** + * Get the y axes of the plane. + */ + getPoint2ByReference(): Vector3; + + /** + * Get the x resolution of the plane. + * @default 10 + */ + getXResolution(): number; + + /** + * Get the y resolution of the plane. + * @default 10 + */ + getYResolution(): number; + + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * Rotate plane around a given axis + * @param angle theta Angle (radian) to rotate about + * @param rotationAxis Axis to rotate around + */ + rotate(angle: number, rotationAxis: vec3): void; + + /** + * Set the center of the plane. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setCenter(x: number, y: number, z: number): void; + + /** + * Set the center of the plane. + * @param {Vector3} center The coordinate of the center point. + */ + setCenter(center: Vector3): void; + + /** + * Set the normal of the plane. + * @param {Vector3} normal The normal coordinate. + */ + setNormal(normal: Vector3): boolean; + + /** + * Set the normal of the plane. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setNormal(x: number, y: number, z: number): boolean; + + /** + * Set the normal of the plane. + * @param {Vector3} normal The normal coordinate. + */ + setNormalFrom(normal: Vector3): boolean; + + /** + * Set the origin of the plane. + * @param {Vector3} origin The coordinate of the origin point. + */ + setOrigin(origin: Vector3): boolean; + + /** + * Set the origin of the plane. + * @param {Number} x The x coordinate of the origin point. + * @param {Number} y The y coordinate of the origin point. + * @param {Number} z The z coordinate of the origin point. + */ + setOrigin(x: number, y: number, z: number): boolean; + + /** + * Set the origin of the plane. + * @param {Vector3} origin The coordinate of the origin point. + */ + setOriginFrom(origin: Vector3): boolean; + + /** + * Specify a point defining the first axis of the plane. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setPoint1(x: number, y: number, z: number): boolean; + + /** + * Specify a point defining the first axis of the plane. + * @param {Vector3} point1 + */ + setPoint1(point1: Vector3): boolean; + + /** + * Specify a point defining the second axis of the plane. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setPoint2(x: number, y: number, z: number): boolean; + + /** + * Specify a point defining the second axis of the plane. + * @param {Vector3} point2 + */ + setPoint2(point2: Vector3): boolean; + + /** + * Set the number of facets used to represent the cone. + * @param {Number} xResolution + */ + setXResolution(xResolution: number): boolean; + + /** + * Set the number of facets used to represent the cone. + * @param {Number} yResolution + */ + setYResolution(yResolution: number): boolean; + + /** + * + * @param {vec3} v1 + * @param {vec3} v2 + */ + updatePlane(v1: vec3, v2: vec3): boolean; } /** @@ -214,13 +216,19 @@ export interface vtkPlaneSource extends vtkPlaneSourceBase { * @param model object on which data structure will be bounds (protected) * @param {IPlaneSourceInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPlaneSourceInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPlaneSourceInitialValues +): void; /** * Method used to create a new instance of vtkPlaneSource. * @param {IPlaneSourceInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IPlaneSourceInitialValues): vtkPlaneSource; +export function newInstance( + initialValues?: IPlaneSourceInitialValues +): vtkPlaneSource; /** * vtkPlaneSource creates an m x n array of quadrilaterals arranged as a regular @@ -229,20 +237,20 @@ export function newInstance(initialValues?: IPlaneSourceInitialValues): vtkPlane * These axes do not have to be orthogonal - so you can create a parallelogram. * (The axes must not be parallel.) The resolution of the plane (i.e., number of * subdivisions) is controlled by the ivars XResolution and YResolution. - * + * * By default, the plane is centered at the origin and perpendicular to the z-axis, * with width and height of length 1 and resolutions set to 1. - * + * * @example * ```js * import vtkPlaneSource from '@kitware/vtk.js/Filters/Sources/PlaneSource'; - * + * * const plane = vtkPlaneSource.newInstance({ xResolution: 10, yResolution: 10 }); * const polydata = plane.getOutputData(); * ``` */ export declare const vtkPlaneSource: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkPlaneSource; diff --git a/Sources/Filters/Sources/PointSource/index.d.ts b/Sources/Filters/Sources/PointSource/index.d.ts index 3345ed21fd8..c897a6008b0 100755 --- a/Sources/Filters/Sources/PointSource/index.d.ts +++ b/Sources/Filters/Sources/PointSource/index.d.ts @@ -1,89 +1,91 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import { Vector3 } from "../../../types"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import { Vector3 } from '../../../types'; /** - * + * */ export interface IPointSourceInitialValues { - numberOfPoints?: number; - center?: Vector3; - radius?: number; - pointType?: string; + numberOfPoints?: number; + center?: Vector3; + radius?: number; + pointType?: string; } -type vtkPointSourceBase = vtkObject & Omit; +type vtkPointSourceBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkPointSource extends vtkPointSourceBase { - - /** - * Get the center of the plane. - * @default [0, 0, 0] - */ - getCenter(): Vector3; - - /** - * Get the center of the plane. - */ - getCenterByReference(): Vector3; - - /** - * Get the number of points to generate. - * @default 10 - */ - getNumberOfPoints(): number; - - /** - * Get the radius of the point cloud. - * @default 0.5 - */ - getRadius(): number; - - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * Set the center of the point cloud. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setCenter(x: number, y: number, z: number): boolean; - - /** - * Set the center of the point cloud. - * @param {Vector3} center The center point's coordinates. - */ - setCenter(center: Vector3): boolean; - - /** - * Set the center of the point cloud. - * @param {Vector3} center The center point's coordinates. - */ - setCenterFrom(center: Vector3): boolean; - - /** - * Set the number of points to generate. - * @param {Number} numberOfPoints The number of points to generate. - */ - setNumberOfPoints(numberOfPoints: number): boolean; - - /** - * Set the radius of the point cloud. If you are generating a Gaussian - * distribution, then this is the standard deviation for each of x, y, and - * z. - * @param {Number} radius The radius value. - */ - setRadius(radius: number): boolean; + /** + * Get the center of the plane. + * @default [0, 0, 0] + */ + getCenter(): Vector3; + + /** + * Get the center of the plane. + */ + getCenterByReference(): Vector3; + + /** + * Get the number of points to generate. + * @default 10 + */ + getNumberOfPoints(): number; + + /** + * Get the radius of the point cloud. + * @default 0.5 + */ + getRadius(): number; + + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * Set the center of the point cloud. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setCenter(x: number, y: number, z: number): boolean; + + /** + * Set the center of the point cloud. + * @param {Vector3} center The center point's coordinates. + */ + setCenter(center: Vector3): boolean; + + /** + * Set the center of the point cloud. + * @param {Vector3} center The center point's coordinates. + */ + setCenterFrom(center: Vector3): boolean; + + /** + * Set the number of points to generate. + * @param {Number} numberOfPoints The number of points to generate. + */ + setNumberOfPoints(numberOfPoints: number): boolean; + + /** + * Set the radius of the point cloud. If you are generating a Gaussian + * distribution, then this is the standard deviation for each of x, y, and + * z. + * @param {Number} radius The radius value. + */ + setRadius(radius: number): boolean; } /** @@ -93,13 +95,19 @@ export interface vtkPointSource extends vtkPointSourceBase { * @param model object on which data structure will be bounds (protected) * @param {IPointSourceInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPointSourceInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPointSourceInitialValues +): void; /** * Method used to create a new instance of vtkPointSource. * @param {IPointSourceInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IPointSourceInitialValues): vtkPointSource; +export function newInstance( + initialValues?: IPointSourceInitialValues +): vtkPointSource; /** * vtkPointSource is a source object that creates a user-specified number of @@ -108,17 +116,17 @@ export function newInstance(initialValues?: IPointSourceInitialValues): vtkPoint * generate random points only on the surface of the sphere. The output PolyData * has the specified number of points and 1 cell - a vtkPolyVertex containing * all of the points. - * + * * @example * ```js * import vtkPointSource from '@kitware/vtk.js/Filters/Sources/PointSource'; - * + * * const point = vtkPointSource.newInstance({ numberOfPoints: 10 }); * const polydata = point.getOutputData(); * ``` */ export declare const vtkPointSource: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkPointSource; diff --git a/Sources/Filters/Sources/SphereSource/index.d.ts b/Sources/Filters/Sources/SphereSource/index.d.ts index a04280685e1..1cc83d604a5 100755 --- a/Sources/Filters/Sources/SphereSource/index.d.ts +++ b/Sources/Filters/Sources/SphereSource/index.d.ts @@ -1,171 +1,172 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import { Vector3 } from "../../../types"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import { Vector3 } from '../../../types'; /** - * + * */ export interface ISphereSourceInitialValues { - radius?: number; - latLongTessellation?: boolean; - thetaResolution?: number; - startTheta?: number; - endTheta?: number; - phiResolution?: number; - startPhi?: number; - endPhi?: number; - center?: Vector3; - pointType?: string; + radius?: number; + latLongTessellation?: boolean; + thetaResolution?: number; + startTheta?: number; + endTheta?: number; + phiResolution?: number; + startPhi?: number; + endPhi?: number; + center?: Vector3; + pointType?: string; } -type vtkSphereSourceBase = vtkObject & Omit; +type vtkSphereSourceBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkSphereSource extends vtkSphereSourceBase { - - /** - * Get the center of the sphere. - * @default [0, 0, 0] - */ - getCenter(): Vector3; - - /** - * Get the center of the sphere. - */ - getCenterByReference(): Vector3; - - - /** - * Get the ending latitude angle. - * @default 180.0 - */ - getEndPhi(): number; - - /** - * Set the ending longitude angle. - * @default 360.0 - */ - getEndTheta(): number; - - /** - * - * @default false - */ - getLatLongTessellation(): boolean; - - /** - * Get the number of points in the latitude direction (ranging from StartPhi to EndPhi). - * @default 8 - */ - getPhiResolution(): number; - - /** - * Get the radius of sphere. - * @default 0.5 - */ - getRadius(): number; - - /** - * Get the starting latitude angle in degrees (0 is at north pole). - * @default 0.0 - */ - getStartPhi(): number; - - /** - * Get the starting longitude angle. - * @default 0.0 - */ - getStartTheta(): number; - - /** - * Get the number of points in the longitude direction (ranging from StartTheta to EndTheta). - * @default 8 - */ - getThetaResolution(): number; - - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * Set the center of the sphere. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setCenter(x: number, y: number, z: number): boolean; - - /** - * Set the center of the sphere. - * @param {Vector3} center The center point's coordinates. - */ - setCenter(center: Vector3): boolean; - - /** - * Set the center of the sphere. - * @param {Vector3} center The center point's coordinates. - */ - setCenterFrom(center: Vector3): boolean; - - /** - * Set the ending latitude angle. - * @param {Number} endPhi The ending latitude angle in degrees. - */ - setEndPhi(endPhi: number): boolean; - - /** - * Set the ending longitude angle. - * @param {Number} endTheta The ending latitude longitude in degrees. - */ - setEndTheta(endTheta: number): boolean; - - /** - * Cause the sphere to be tessellated with edges along the latitude and - * longitude lines. If off, triangles are generated at non-polar regions, - * which results in edges that are not parallel to latitude and longitude - * lines. If on, quadrilaterals are generated everywhere except at the - * poles. This can be useful for generating a wireframe sphere with natural - * latitude and longitude lines. - * @param {Boolean} latLongTessellation - */ - setLatLongTessellation(latLongTessellation: boolean): boolean; - - /** - * Set the number of points in the latitude direction (ranging from StartPhi to EndPhi). - * @param {Number} phiResolution The number of points. - */ - setPhiResolution(phiResolution: number): boolean; - - /** - * Set the radius of sphere. - * @param {Number} radius The radius of sphere. - */ - setRadius(radius: number): boolean; - - /** - * Set the starting longitude angle. - * @param {Number} startTheta The starting longitude angle in degrees. - */ - setStartTheta(startTheta: number): boolean; - - /** - * Set the starting latitude angle (0 is at north pole). - * @param {Number} startPhi The starting latitude angle in degrees. - */ - setStartPhi(startPhi: number): boolean; - - /** - * Set the number of points in the longitude direction (ranging from StartTheta to EndTheta). - * @param {Number} thetaResolution The number of points. - */ - setThetaResolution(thetaResolution: number): boolean; + /** + * Get the center of the sphere. + * @default [0, 0, 0] + */ + getCenter(): Vector3; + + /** + * Get the center of the sphere. + */ + getCenterByReference(): Vector3; + + /** + * Get the ending latitude angle. + * @default 180.0 + */ + getEndPhi(): number; + + /** + * Set the ending longitude angle. + * @default 360.0 + */ + getEndTheta(): number; + + /** + * + * @default false + */ + getLatLongTessellation(): boolean; + + /** + * Get the number of points in the latitude direction (ranging from StartPhi to EndPhi). + * @default 8 + */ + getPhiResolution(): number; + + /** + * Get the radius of sphere. + * @default 0.5 + */ + getRadius(): number; + + /** + * Get the starting latitude angle in degrees (0 is at north pole). + * @default 0.0 + */ + getStartPhi(): number; + + /** + * Get the starting longitude angle. + * @default 0.0 + */ + getStartTheta(): number; + + /** + * Get the number of points in the longitude direction (ranging from StartTheta to EndTheta). + * @default 8 + */ + getThetaResolution(): number; + + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * Set the center of the sphere. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setCenter(x: number, y: number, z: number): boolean; + + /** + * Set the center of the sphere. + * @param {Vector3} center The center point's coordinates. + */ + setCenter(center: Vector3): boolean; + + /** + * Set the center of the sphere. + * @param {Vector3} center The center point's coordinates. + */ + setCenterFrom(center: Vector3): boolean; + + /** + * Set the ending latitude angle. + * @param {Number} endPhi The ending latitude angle in degrees. + */ + setEndPhi(endPhi: number): boolean; + + /** + * Set the ending longitude angle. + * @param {Number} endTheta The ending latitude longitude in degrees. + */ + setEndTheta(endTheta: number): boolean; + + /** + * Cause the sphere to be tessellated with edges along the latitude and + * longitude lines. If off, triangles are generated at non-polar regions, + * which results in edges that are not parallel to latitude and longitude + * lines. If on, quadrilaterals are generated everywhere except at the + * poles. This can be useful for generating a wireframe sphere with natural + * latitude and longitude lines. + * @param {Boolean} latLongTessellation + */ + setLatLongTessellation(latLongTessellation: boolean): boolean; + + /** + * Set the number of points in the latitude direction (ranging from StartPhi to EndPhi). + * @param {Number} phiResolution The number of points. + */ + setPhiResolution(phiResolution: number): boolean; + + /** + * Set the radius of sphere. + * @param {Number} radius The radius of sphere. + */ + setRadius(radius: number): boolean; + + /** + * Set the starting longitude angle. + * @param {Number} startTheta The starting longitude angle in degrees. + */ + setStartTheta(startTheta: number): boolean; + + /** + * Set the starting latitude angle (0 is at north pole). + * @param {Number} startPhi The starting latitude angle in degrees. + */ + setStartPhi(startPhi: number): boolean; + + /** + * Set the number of points in the longitude direction (ranging from StartTheta to EndTheta). + * @param {Number} thetaResolution The number of points. + */ + setThetaResolution(thetaResolution: number): boolean; } /** @@ -175,13 +176,19 @@ export interface vtkSphereSource extends vtkSphereSourceBase { * @param model object on which data structure will be bounds (protected) * @param {ISphereSourceInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ISphereSourceInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ISphereSourceInitialValues +): void; /** * Method used to create a new instance of vtkSphereSource. * @param {ISphereSourceInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ISphereSourceInitialValues): vtkSphereSource; +export function newInstance( + initialValues?: ISphereSourceInitialValues +): vtkSphereSource; /** * vtkSphereSource is a source object that creates a user-specified number of @@ -190,17 +197,17 @@ export function newInstance(initialValues?: ISphereSourceInitialValues): vtkSphe * generate random points only on the surface of the sphere. The output PolyData * has the specified number of points and 1 cell - a vtkPolyVertex containing * all of the points. - * + * * @example * ```js * import vtkSphereSource from '@kitware/vtk.js/Filters/Sources/SphereSource'; - * + * * const sphere = vtkSphereSource.newInstance(); * const polydata = sphere.getOutputData(); * ``` */ export declare const vtkSphereSource: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkSphereSource; diff --git a/Sources/Filters/Texture/TextureMapToPlane/index.d.ts b/Sources/Filters/Texture/TextureMapToPlane/index.d.ts index afdfdbe716f..bcbe8587ae1 100755 --- a/Sources/Filters/Texture/TextureMapToPlane/index.d.ts +++ b/Sources/Filters/Texture/TextureMapToPlane/index.d.ts @@ -1,217 +1,216 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; /** * */ interface ITextureMapToPlane { - origin?: number[]; - point1?: number[]; - point2?: number[]; - normal?: number[]; - sRange?: number[]; - tRange?: number[]; - automaticPlaneGeneration?: number; + origin?: number[]; + point1?: number[]; + point2?: number[]; + normal?: number[]; + sRange?: number[]; + tRange?: number[]; + automaticPlaneGeneration?: number; } type vtkTextureMapToPlaneBase = vtkObject & vtkAlgorithm; export interface vtkTextureMapToPlane extends vtkTextureMapToPlaneBase { - - /** - * Get whether the automatic plane generation is set. - */ - getAutomaticPlaneGeneration(): number; - - /** - * Get the normal object. - */ - getNormal(): number[]; - - /** - * Get the normal object. - */ - getNormalByReference(): number[]; - - /** - * Get the origin of the plane. - */ - getOrigin(): number[]; - - /** - * Get the origin of the plane. - */ - getOriginByReference(): number[]; - - /** - * Get the point which defines the first axis of the plane. - */ - getPoint1(): number[]; - - /** - * Get the point which defines the first axis of the plane. - */ - getPoint1ByReference(): number[]; - - /** - * Get the point which defines the second axis of the plane - */ - getPoint2(): number[]; - - /** - * Get the point which defines the second axis of the plane - */ - getPoint2ByReference(): number[]; - - /** - * Get the s-coordinate range for texture s-t coordinate pair. - */ - getSRange(): number[]; - - /** - * Get the s-coordinate range for texture s-t coordinate pair. - */ - getSRangeByReference(): number[]; - - /** - * Get the t-coordinate range for texture s-t coordinate pair. - */ - getTRange(): number[]; - - /** - * Get the t-coordinate range for texture s-t coordinate pair. - */ - getTRangeByReference(): number[]; - - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * Turn on/off the automatic plane generation. - * @param {Number} automaticPlaneGeneration - */ - setAutomaticPlaneGeneration(automaticPlaneGeneration: number): boolean; - - /** - * Set the normal object. - * @param {Number[]} normal The normal object coordinates. - */ - setNormal(normal: number[]): boolean; - - /** - * Set the normal object. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setNormal(x: number, y: number, z: number): boolean; - - /** - * Set the normal object. - * @param {Number[]} normal The normal object coordinates. - */ - setNormalFrom(normal: number[]): boolean; - - /** - * Set the origin of the plane. - * @param {Number[]} origin The origin of the plane. - */ - setOrigin(origin: number[]): boolean; - - /** - * Set the origin of the plane. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setOrigin(x: number, y: number, z: number): boolean; - - /** - * Set the origin of the plane. - * @param {Number[]} origin The origin of the plane. - */ - setOriginFrom(origin: number[]): boolean; - - /** - * Set the point which defines the first axis of the plane. - * @param {Number[]} point1 The coordinate of the point. - */ - setPoint1(point1: number[]): boolean; - - /** - * Set the point which defines the first axis of the plane. - * @param {Number} x The x coordinate of the point. - * @param {Number} y The y coordinate of the point. - * @param {Number} z The z coordinate of the point. - */ - setPoint1(x: number, y: number, z: number): boolean; - - /** - * Set the point which defines the first axis of the plane. - * @param {Number[]} point1 The coordinate of the point. - */ - setPoint1From(point1: number[]): boolean; - - /** - * Set the point which defines the second axis of the plane - * @param {Number[]} point2 The coordinate of the point. - */ - setPoint2(point2: number[]): boolean; - - /** - * Set the point which defines the second axis of the plane - * @param {Number} x The x coordinate of the point. - * @param {Number} y The y coordinate of the point. - * @param {Number} z The z coordinate of the point. - */ - setPoint2(x: number, y: number, z: number): boolean; - - /** - * Set the point which defines the second axis of the plane - * @param {Number[]} point2 The coordinate of the point. - */ - setPoint2From(point2: number[]): boolean; - - /** - * Set the s-coordinate range for texture s-t coordinate pair. - * @param {Number[]} sRange The s-coordinate range. - */ - setSRange(sRange: number[]): boolean; - - /** - * Set the s-coordinate range for texture s-t coordinate pair. - * @param {Number} min The min of the s-coordinate range - * @param {Number} max The min of the s-coordinate range. - */ - setSRange(min: number, max: number): boolean; - - /** - * Set the s-coordinate range for texture s-t coordinate pair. - * @param {Number[]} sRange The s-coordinate range. - */ - setSRangeFrom(sRange: number[]): boolean; - - /** - * Set the t-coordinate range for texture s-t coordinate pair. - * @param {Number[]} tRange The t-coordinate range. - */ - setTRange(tRange: number[]): boolean; - - /** - * Set the t-coordinate range for texture s-t coordinate pair. - * @param {Number} min The min of the t-coordinate range - * @param {Number} max The min of the t-coordinate range. - */ - setTRange(min: number, max: number): boolean; - - /** - * Set the t-coordinate range for texture s-t coordinate pair. - * @param {Number[]} tRange The t-coordinate range. - */ - setTRangeFrom(tRange: number[]): boolean; + /** + * Get whether the automatic plane generation is set. + */ + getAutomaticPlaneGeneration(): number; + + /** + * Get the normal object. + */ + getNormal(): number[]; + + /** + * Get the normal object. + */ + getNormalByReference(): number[]; + + /** + * Get the origin of the plane. + */ + getOrigin(): number[]; + + /** + * Get the origin of the plane. + */ + getOriginByReference(): number[]; + + /** + * Get the point which defines the first axis of the plane. + */ + getPoint1(): number[]; + + /** + * Get the point which defines the first axis of the plane. + */ + getPoint1ByReference(): number[]; + + /** + * Get the point which defines the second axis of the plane + */ + getPoint2(): number[]; + + /** + * Get the point which defines the second axis of the plane + */ + getPoint2ByReference(): number[]; + + /** + * Get the s-coordinate range for texture s-t coordinate pair. + */ + getSRange(): number[]; + + /** + * Get the s-coordinate range for texture s-t coordinate pair. + */ + getSRangeByReference(): number[]; + + /** + * Get the t-coordinate range for texture s-t coordinate pair. + */ + getTRange(): number[]; + + /** + * Get the t-coordinate range for texture s-t coordinate pair. + */ + getTRangeByReference(): number[]; + + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * Turn on/off the automatic plane generation. + * @param {Number} automaticPlaneGeneration + */ + setAutomaticPlaneGeneration(automaticPlaneGeneration: number): boolean; + + /** + * Set the normal object. + * @param {Number[]} normal The normal object coordinates. + */ + setNormal(normal: number[]): boolean; + + /** + * Set the normal object. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setNormal(x: number, y: number, z: number): boolean; + + /** + * Set the normal object. + * @param {Number[]} normal The normal object coordinates. + */ + setNormalFrom(normal: number[]): boolean; + + /** + * Set the origin of the plane. + * @param {Number[]} origin The origin of the plane. + */ + setOrigin(origin: number[]): boolean; + + /** + * Set the origin of the plane. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setOrigin(x: number, y: number, z: number): boolean; + + /** + * Set the origin of the plane. + * @param {Number[]} origin The origin of the plane. + */ + setOriginFrom(origin: number[]): boolean; + + /** + * Set the point which defines the first axis of the plane. + * @param {Number[]} point1 The coordinate of the point. + */ + setPoint1(point1: number[]): boolean; + + /** + * Set the point which defines the first axis of the plane. + * @param {Number} x The x coordinate of the point. + * @param {Number} y The y coordinate of the point. + * @param {Number} z The z coordinate of the point. + */ + setPoint1(x: number, y: number, z: number): boolean; + + /** + * Set the point which defines the first axis of the plane. + * @param {Number[]} point1 The coordinate of the point. + */ + setPoint1From(point1: number[]): boolean; + + /** + * Set the point which defines the second axis of the plane + * @param {Number[]} point2 The coordinate of the point. + */ + setPoint2(point2: number[]): boolean; + + /** + * Set the point which defines the second axis of the plane + * @param {Number} x The x coordinate of the point. + * @param {Number} y The y coordinate of the point. + * @param {Number} z The z coordinate of the point. + */ + setPoint2(x: number, y: number, z: number): boolean; + + /** + * Set the point which defines the second axis of the plane + * @param {Number[]} point2 The coordinate of the point. + */ + setPoint2From(point2: number[]): boolean; + + /** + * Set the s-coordinate range for texture s-t coordinate pair. + * @param {Number[]} sRange The s-coordinate range. + */ + setSRange(sRange: number[]): boolean; + + /** + * Set the s-coordinate range for texture s-t coordinate pair. + * @param {Number} min The min of the s-coordinate range + * @param {Number} max The min of the s-coordinate range. + */ + setSRange(min: number, max: number): boolean; + + /** + * Set the s-coordinate range for texture s-t coordinate pair. + * @param {Number[]} sRange The s-coordinate range. + */ + setSRangeFrom(sRange: number[]): boolean; + + /** + * Set the t-coordinate range for texture s-t coordinate pair. + * @param {Number[]} tRange The t-coordinate range. + */ + setTRange(tRange: number[]): boolean; + + /** + * Set the t-coordinate range for texture s-t coordinate pair. + * @param {Number} min The min of the t-coordinate range + * @param {Number} max The min of the t-coordinate range. + */ + setTRange(min: number, max: number): boolean; + + /** + * Set the t-coordinate range for texture s-t coordinate pair. + * @param {Number[]} tRange The t-coordinate range. + */ + setTRangeFrom(tRange: number[]): boolean; } /** @@ -221,20 +220,26 @@ export interface vtkTextureMapToPlane extends vtkTextureMapToPlaneBase { * @param model object on which data structure will be bounds (protected) * @param {ITextureMapToPlane} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ITextureMapToPlane): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ITextureMapToPlane +): void; /** * Method used to create a new instance of vtkTextureMapToPlane * @param {ITextureMapToPlane} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ITextureMapToPlane): vtkTextureMapToPlane; +export function newInstance( + initialValues?: ITextureMapToPlane +): vtkTextureMapToPlane; /** * vtkTextureMapToPlane generate texture coordinates by mapping points to a * plane The TCoords DataArray is name 'Texture Coordinates' */ export declare const vtkTextureMapToPlane: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkTextureMapToPlane; diff --git a/Sources/Filters/Texture/TextureMapToSphere/index.d.ts b/Sources/Filters/Texture/TextureMapToSphere/index.d.ts index df490063f99..e3aa55227e3 100755 --- a/Sources/Filters/Texture/TextureMapToSphere/index.d.ts +++ b/Sources/Filters/Texture/TextureMapToSphere/index.d.ts @@ -1,81 +1,80 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; /** * */ interface ITextureMapToSphere { - center?: number[]; - automaticSphereGeneration?: number; - preventSeam?: number; + center?: number[]; + automaticSphereGeneration?: number; + preventSeam?: number; } type vtkTextureMapToSphereBase = vtkObject & vtkAlgorithm; export interface vtkTextureMapToSphere extends vtkTextureMapToSphereBase { - - /** - * Get whether the automatic sphere generation is set. - */ - getAutomaticSphereGeneration(): number; - - /** - * Get the point defining the center of the sphere. - */ - getCenter(): number[]; - - /** - * Get the normal object. - */ - getCenterByReference(): number[]; - - /** - * Get whether the prevent seam is set. - */ - getPreventSeam(): number; - - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * Turn on/off the automatic sphere generation. - * @param automaticSphereGeneration - */ - setAutomaticSphereGeneration(automaticSphereGeneration: number): boolean; - - /** - * Control how the texture coordinates are generated. - * - * If PreventSeam is set, the s-coordinate ranges : - * - * - from 0->1 and 1->0 corresponding to the theta angle variation between 0->180 and 180->0 degrees - * - Otherwise, the s-coordinate ranges from 0->1 between 0->360 degrees. - * @param preventSeam - */ - setPreventSeam(preventSeam: number): boolean; - - /** - * Set the point defining the center of the sphere. - * @param {Number[]} center The center point coordinates. - */ - setCenter(center: number[]): boolean; - - /** - * Set the point defining the center of the sphere. - * @param x - * @param y - * @param z - */ - setCenter(x: number, y: number, z: number): boolean; - - /** - * Set the point defining the center of the sphere. - * @param {Number[]} center The center point coordinates. - */ - setCenterFrom(center: number[]): boolean; + /** + * Get whether the automatic sphere generation is set. + */ + getAutomaticSphereGeneration(): number; + + /** + * Get the point defining the center of the sphere. + */ + getCenter(): number[]; + + /** + * Get the normal object. + */ + getCenterByReference(): number[]; + + /** + * Get whether the prevent seam is set. + */ + getPreventSeam(): number; + + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * Turn on/off the automatic sphere generation. + * @param automaticSphereGeneration + */ + setAutomaticSphereGeneration(automaticSphereGeneration: number): boolean; + + /** + * Control how the texture coordinates are generated. + * + * If PreventSeam is set, the s-coordinate ranges : + * + * - from 0->1 and 1->0 corresponding to the theta angle variation between 0->180 and 180->0 degrees + * - Otherwise, the s-coordinate ranges from 0->1 between 0->360 degrees. + * @param preventSeam + */ + setPreventSeam(preventSeam: number): boolean; + + /** + * Set the point defining the center of the sphere. + * @param {Number[]} center The center point coordinates. + */ + setCenter(center: number[]): boolean; + + /** + * Set the point defining the center of the sphere. + * @param x + * @param y + * @param z + */ + setCenter(x: number, y: number, z: number): boolean; + + /** + * Set the point defining the center of the sphere. + * @param {Number[]} center The center point coordinates. + */ + setCenterFrom(center: number[]): boolean; } /** @@ -85,20 +84,26 @@ export interface vtkTextureMapToSphere extends vtkTextureMapToSphereBase { * @param model object on which data structure will be bounds (protected) * @param {ITextureMapToSphere} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ITextureMapToSphere): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ITextureMapToSphere +): void; /** * Method used to create a new instance of vtkTextureMapToSphere * @param {ITextureMapToSphere} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ITextureMapToSphere): vtkTextureMapToSphere; +export function newInstance( + initialValues?: ITextureMapToSphere +): vtkTextureMapToSphere; /** * vtkTextureMapToSphere generate texture coordinates by mapping points to * sphere The TCoords DataArray is name 'Texture Coordinate' */ export declare const vtkTextureMapToSphere: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkTextureMapToSphere; diff --git a/Sources/IO/Core/DataAccessHelper/HtmlDataAccessHelper.d.ts b/Sources/IO/Core/DataAccessHelper/HtmlDataAccessHelper.d.ts index 4fde54adc5e..e65264faf0f 100644 --- a/Sources/IO/Core/DataAccessHelper/HtmlDataAccessHelper.d.ts +++ b/Sources/IO/Core/DataAccessHelper/HtmlDataAccessHelper.d.ts @@ -1,9 +1,22 @@ export interface HtmlDataAccessHelper { - fetchArray(instance: any, baseURL: string, array: object[], options?: object): Promise; - fetchJSON(instance: any, url: string, options?: object): Promise; - fetchText(instance: any, url: string, options?: object): Promise; - fetchBinary(instance: any, url: string, options?: object): Promise; - fetchImage(instance: any, url: string, options?: object): Promise; + fetchArray( + instance: any, + baseURL: string, + array: object[], + options?: object + ): Promise; + fetchJSON(instance: any, url: string, options?: object): Promise; + fetchText(instance: any, url: string, options?: object): Promise; + fetchBinary( + instance: any, + url: string, + options?: object + ): Promise; + fetchImage( + instance: any, + url: string, + options?: object + ): Promise; } export default HtmlDataAccessHelper; diff --git a/Sources/IO/Core/DataAccessHelper/HttpDataAccessHelper.d.ts b/Sources/IO/Core/DataAccessHelper/HttpDataAccessHelper.d.ts index 6cbb969fac2..50a421e9cd5 100644 --- a/Sources/IO/Core/DataAccessHelper/HttpDataAccessHelper.d.ts +++ b/Sources/IO/Core/DataAccessHelper/HttpDataAccessHelper.d.ts @@ -1,9 +1,22 @@ export interface HttpDataAccessHelper { - fetchArray(instance: any, baseURL: string, array: object[], options?: object): Promise; - fetchJSON(instance: any, url: string, options?: object): Promise; - fetchText(instance: any, url: string, options?: object): Promise; - fetchBinary(instance: any, url: string, options?: object): Promise; - fetchImage(instance: any, url: string, options?: object): Promise; + fetchArray( + instance: any, + baseURL: string, + array: object[], + options?: object + ): Promise; + fetchJSON(instance: any, url: string, options?: object): Promise; + fetchText(instance: any, url: string, options?: object): Promise; + fetchBinary( + instance: any, + url: string, + options?: object + ): Promise; + fetchImage( + instance: any, + url: string, + options?: object + ): Promise; } export default HttpDataAccessHelper; diff --git a/Sources/IO/Core/DataAccessHelper/JSZipDataAccessHelper.d.ts b/Sources/IO/Core/DataAccessHelper/JSZipDataAccessHelper.d.ts index bef821a5e2c..28e861bb126 100644 --- a/Sources/IO/Core/DataAccessHelper/JSZipDataAccessHelper.d.ts +++ b/Sources/IO/Core/DataAccessHelper/JSZipDataAccessHelper.d.ts @@ -1,13 +1,26 @@ interface IJSZipDataAccessHelper { - fetchArray(instance: any, baseURL: string, array: object[], options?: object): Promise; - fetchJSON(instance: any, url: string, options?: object): Promise; - fetchText(instance: any, url: string, options?: object): Promise; - fetchBinary(instance: any, url: string, options?: object): Promise; - fetchImage(instance: any, url: string, options?: object): Promise; + fetchArray( + instance: any, + baseURL: string, + array: object[], + options?: object + ): Promise; + fetchJSON(instance: any, url: string, options?: object): Promise; + fetchText(instance: any, url: string, options?: object): Promise; + fetchBinary( + instance: any, + url: string, + options?: object + ): Promise; + fetchImage( + instance: any, + url: string, + options?: object + ): Promise; } export interface JSZipDataAccessHelper { - create(createOptions: object): IJSZipDataAccessHelper + create(createOptions: object): IJSZipDataAccessHelper; } export default JSZipDataAccessHelper; diff --git a/Sources/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper.d.ts b/Sources/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper.d.ts index cbcc204a1ee..af7c869bc4d 100644 --- a/Sources/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper.d.ts +++ b/Sources/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper.d.ts @@ -1,9 +1,22 @@ export interface LiteHttpDataAccessHelper { - fetchArray(instance: any, baseURL: string, array: object[], options?: object): Promise; - fetchJSON(instance: any, url: string, options?: object): Promise; - fetchText(instance: any, url: string, options?: object): Promise; - fetchBinary(instance: any, url: string, options?: object): Promise; - fetchImage(instance: any, url: string, options?: object): Promise; + fetchArray( + instance: any, + baseURL: string, + array: object[], + options?: object + ): Promise; + fetchJSON(instance: any, url: string, options?: object): Promise; + fetchText(instance: any, url: string, options?: object): Promise; + fetchBinary( + instance: any, + url: string, + options?: object + ): Promise; + fetchImage( + instance: any, + url: string, + options?: object + ): Promise; } export default LiteHttpDataAccessHelper; diff --git a/Sources/IO/Core/DataAccessHelper/index.d.ts b/Sources/IO/Core/DataAccessHelper/index.d.ts index 44c873c82bc..a16503597fa 100644 --- a/Sources/IO/Core/DataAccessHelper/index.d.ts +++ b/Sources/IO/Core/DataAccessHelper/index.d.ts @@ -1,38 +1,52 @@ -import HtmlDataAccessHelper from "./HtmlDataAccessHelper"; -import HttpDataAccessHelper from "./HttpDataAccessHelper"; -import JSZipDataAccessHelper from "./JSZipDataAccessHelper"; -import LiteHttpDataAccessHelper from "./LiteHttpDataAccessHelper"; +import HtmlDataAccessHelper from './HtmlDataAccessHelper'; +import HttpDataAccessHelper from './HttpDataAccessHelper'; +import JSZipDataAccessHelper from './JSZipDataAccessHelper'; +import LiteHttpDataAccessHelper from './LiteHttpDataAccessHelper'; export function has(type: string): boolean; -export function get(type?: string, options?: object): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper +export function get( + type?: string, + options?: object +): + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper; export function registerType(type: string, fn: any): void; export interface DataAccessHelper { - /** - * - * @param {String} type - */ - has(type: string): boolean; + /** + * + * @param {String} type + */ + has(type: string): boolean; - /** - * - * @param {String} type - * @param options - */ - get(type?: string, options?: object): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper + /** + * + * @param {String} type + * @param options + */ + get( + type?: string, + options?: object + ): + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper; - /** - * - * @param {String} type - * @param fn - */ - registerType(type: string, fn: any): void; + /** + * + * @param {String} type + * @param fn + */ + registerType(type: string, fn: any): void; } export declare const DataAccessHelper: { - has: typeof has, - get: typeof get, - registerType: typeof registerType, -} + has: typeof has; + get: typeof get; + registerType: typeof registerType; +}; export default DataAccessHelper; diff --git a/Sources/IO/Core/HttpDataSetReader/index.d.ts b/Sources/IO/Core/HttpDataSetReader/index.d.ts index 5e2664aaaed..1f16aa07d6d 100644 --- a/Sources/IO/Core/HttpDataSetReader/index.d.ts +++ b/Sources/IO/Core/HttpDataSetReader/index.d.ts @@ -1,283 +1,311 @@ -import { vtkAlgorithm, vtkObject, vtkSubscription } from "../../../interfaces"; -import HtmlDataAccessHelper from "../DataAccessHelper/HtmlDataAccessHelper"; -import HttpDataAccessHelper from "../DataAccessHelper/HttpDataAccessHelper"; -import JSZipDataAccessHelper from "../DataAccessHelper/JSZipDataAccessHelper"; -import LiteHttpDataAccessHelper from "../DataAccessHelper/LiteHttpDataAccessHelper"; +import { vtkAlgorithm, vtkObject, vtkSubscription } from '../../../interfaces'; +import HtmlDataAccessHelper from '../DataAccessHelper/HtmlDataAccessHelper'; +import HttpDataAccessHelper from '../DataAccessHelper/HttpDataAccessHelper'; +import JSZipDataAccessHelper from '../DataAccessHelper/JSZipDataAccessHelper'; +import LiteHttpDataAccessHelper from '../DataAccessHelper/LiteHttpDataAccessHelper'; /** * */ export interface IHttpDataSetReaderInitialValues { - enableArray?: boolean; - fetchGzip?: boolean; - arrays?: any[]; - url?: string; - baseURL?: string; - requestCount?: number; + enableArray?: boolean; + fetchGzip?: boolean; + arrays?: any[]; + url?: string; + baseURL?: string; + requestCount?: number; } export interface IHttpDataSetReaderOptions { - fullpath?: string, - compression?: string, - loadData?: boolean; + fullpath?: string; + compression?: string; + loadData?: boolean; } export interface IHttpDataSetReaderArray { - location: string; - name: string; - enable: boolean; + location: string; + name: string; + enable: boolean; } export interface IRange { - max: number, - component: unknown, - min: number + max: number; + component: unknown; + min: number; } export interface IPointDataArray { - data: { - numberOfComponents: number, - name: string, - vtkClass: string, - dataType: string, - ranges: Array, - ref: { - registration: string, - encode: string, - basepath: string, - id: string - }, - size: number - } + data: { + numberOfComponents: number; + name: string; + vtkClass: string; + dataType: string; + ranges: Array; + ref: { + registration: string; + encode: string; + basepath: string; + id: string; + }; + size: number; + }; } export interface IDatasetManifest { - origin: [number, number, number], - cellData: { - arrays: Array, - vtkClass: string - }, - FieldData: { - arrays: Array, - vtkClass: string, - }, - vtkClass: string, - pointData: { - arrays: Array, - vtkClass: string - }, - spacing: [number, number, number], - extent: [number, number, number, number, number, number], - direction: [number, number, number, number, number, number, number, number, number], - metadata?: Record + origin: [number, number, number]; + cellData: { + arrays: Array; + vtkClass: string; + }; + FieldData: { + arrays: Array; + vtkClass: string; + }; + vtkClass: string; + pointData: { + arrays: Array; + vtkClass: string; + }; + spacing: [number, number, number]; + extent: [number, number, number, number, number, number]; + direction: [ + number, + number, + number, + number, + number, + number, + number, + number, + number + ]; + metadata?: Record; } export interface IParseObjectOptions { - loadData: boolean, - baseUrl: string, - deepCopy: boolean + loadData: boolean; + baseUrl: string; + deepCopy: boolean; } -type vtkHttpDataSetReaderBase = vtkObject & Omit; +type vtkHttpDataSetReaderBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkHttpDataSetReader extends vtkHttpDataSetReaderBase { - - /** - * Enable or disable a given array. - * - * ```js - * reader.enableArray('pointData', 'Temperature'); - * reader.enableArray('pointData', 'Pressure', false); - * reader.enableArray('cellData', 'CellId', true); - * reader.enableArray('fieldData', 'labels', true); - * ``` - * @param {String} location - * @param {String} name - * @param {Boolean} [enable] - */ - enableArray(location: string, name: string, enable?: boolean): void; - - /** - * Get the list of available array with their location and if they are - * enable or not for download using the __update()__ method. - */ - getArrays(): IHttpDataSetReaderArray[]; - - /** - * - */ - getArraysByReference(): IHttpDataSetReaderArray[]; - - /** - * Get the base url to use to download arrays or other data from the given - * dataset. - * - * ```js - * reader.setURL('/Data/can.ex2/index.json'); - * - * if (reader.getBaseURL() === '/Data/can.ex2') { - * console.log('Good guess...'); - * } - * ``` - */ - getBaseURL(): string; - - /** - * - */ - getDataAccessHelper(): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper; - - /** - * - */ - getEnableArray(): boolean; - - /** - * - */ - getFetchGzip(): boolean; - - /** - * Get the url of the object to load. - */ - getUrl(): string; - - /** - * Gets an array of all cached array ids. - */ - getCachedArrayIds(): string[]; - - - /** - * Gets the maximum size cached arrays are allowed to occupy. - * Size is given in MiB. - * If cache size is exceeded, the arrays that where not accessed - * the longest are removed. - * - * Special settings: - * -1 -> Cache unlimited - * 0 -> Cache disabled - * null -> Cache disabled - * undefined -> Cache disabled - */ - getMaxCacheSize(): number | null | undefined; - - /** - * Sets the maximum size cached arrays are allowed to occupy. - * Size is given in MiB. - * If cache size is exceeded, the arrays that where not accessed - * the longest are removed. - * If set to "undefined" the cache is unlimited. - * - * Special settings: - * -1 -> Cache unlimited - * 0 -> Cache disabled - * null -> Cache disabled - * undefined -> Cache disabled - */ - setMaxCacheSize(value: number | null | undefined): void; - - /** - * Clears all cached entries. - */ - clearCache(): void; - - /** - * - * @param {Boolean} busy - */ - invokeBusy(busy: boolean): void; - - /** - * Get the current status of the reader. True means busy and False means - * idle. - */ - isBusy(): boolean; - - /** - * - */ - loadData(): string; - - /** - * Attach listener to monitor when the reader is downloading data or not. - * - * ```js - * const subscription = reader.onBusy(busy => { - * console.log('Reader is', busy ? 'downloading' : 'idle'); - * }) - * - * reader.update(); - * // much later - * subscription.unsubscribe(); - * ``` - * @param callback - */ - onBusy(callback: (busy: boolean) => any): vtkSubscription; - - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * - * @param dataAccessHelper - */ - setDataAccessHelper(dataAccessHelper: HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper): boolean; - - /** - * - * @param progressCallback - */ - setProgressCallback(progressCallback: any): boolean; - - /** - * Set the url for the dataset to load. - * - * ```js - * const reader = HttpDataSetReader.newInstance(); - * isReady = reader.setURL('/Data/can.ex2/index.json'); - * - * // Same as - * const reader = HttpDataSetReader.newInstance({ url: '/Data/can.ex2/index.json' }); - * isReady = reader.updateMetadata(); - * ``` - * @param {String} url the url of the object to load. - * @param {IHttpDataSetReaderOptions} [option] The Draco reader options. - */ - setUrl(url: string, option?: IHttpDataSetReaderOptions): Promise; - - /** - * Set the dataset object to use for data fetching. - * - * @param {IDatasetManifest} manifest The dataset manifest object - * @param {IParseObjectOptions} options - */ - parseObject(manifest: IDatasetManifest, options: IParseObjectOptions): Promise; - - /** - * - */ - updateMetadata(): Promise; + /** + * Enable or disable a given array. + * + * ```js + * reader.enableArray('pointData', 'Temperature'); + * reader.enableArray('pointData', 'Pressure', false); + * reader.enableArray('cellData', 'CellId', true); + * reader.enableArray('fieldData', 'labels', true); + * ``` + * @param {String} location + * @param {String} name + * @param {Boolean} [enable] + */ + enableArray(location: string, name: string, enable?: boolean): void; + + /** + * Get the list of available array with their location and if they are + * enable or not for download using the __update()__ method. + */ + getArrays(): IHttpDataSetReaderArray[]; + + /** + * + */ + getArraysByReference(): IHttpDataSetReaderArray[]; + + /** + * Get the base url to use to download arrays or other data from the given + * dataset. + * + * ```js + * reader.setURL('/Data/can.ex2/index.json'); + * + * if (reader.getBaseURL() === '/Data/can.ex2') { + * console.log('Good guess...'); + * } + * ``` + */ + getBaseURL(): string; + + /** + * + */ + getDataAccessHelper(): + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper; + + /** + * + */ + getEnableArray(): boolean; + + /** + * + */ + getFetchGzip(): boolean; + + /** + * Get the url of the object to load. + */ + getUrl(): string; + + /** + * Gets an array of all cached array ids. + */ + getCachedArrayIds(): string[]; + + /** + * Gets the maximum size cached arrays are allowed to occupy. + * Size is given in MiB. + * If cache size is exceeded, the arrays that where not accessed + * the longest are removed. + * + * Special settings: + * -1 -> Cache unlimited + * 0 -> Cache disabled + * null -> Cache disabled + * undefined -> Cache disabled + */ + getMaxCacheSize(): number | null | undefined; + + /** + * Sets the maximum size cached arrays are allowed to occupy. + * Size is given in MiB. + * If cache size is exceeded, the arrays that where not accessed + * the longest are removed. + * If set to "undefined" the cache is unlimited. + * + * Special settings: + * -1 -> Cache unlimited + * 0 -> Cache disabled + * null -> Cache disabled + * undefined -> Cache disabled + */ + setMaxCacheSize(value: number | null | undefined): void; + + /** + * Clears all cached entries. + */ + clearCache(): void; + + /** + * + * @param {Boolean} busy + */ + invokeBusy(busy: boolean): void; + + /** + * Get the current status of the reader. True means busy and False means + * idle. + */ + isBusy(): boolean; + + /** + * + */ + loadData(): string; + + /** + * Attach listener to monitor when the reader is downloading data or not. + * + * ```js + * const subscription = reader.onBusy(busy => { + * console.log('Reader is', busy ? 'downloading' : 'idle'); + * }) + * + * reader.update(); + * // much later + * subscription.unsubscribe(); + * ``` + * @param callback + */ + onBusy(callback: (busy: boolean) => any): vtkSubscription; + + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * + * @param dataAccessHelper + */ + setDataAccessHelper( + dataAccessHelper: + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper + ): boolean; + + /** + * + * @param progressCallback + */ + setProgressCallback(progressCallback: any): boolean; + + /** + * Set the url for the dataset to load. + * + * ```js + * const reader = HttpDataSetReader.newInstance(); + * isReady = reader.setURL('/Data/can.ex2/index.json'); + * + * // Same as + * const reader = HttpDataSetReader.newInstance({ url: '/Data/can.ex2/index.json' }); + * isReady = reader.updateMetadata(); + * ``` + * @param {String} url the url of the object to load. + * @param {IHttpDataSetReaderOptions} [option] The Draco reader options. + */ + setUrl(url: string, option?: IHttpDataSetReaderOptions): Promise; + + /** + * Set the dataset object to use for data fetching. + * + * @param {IDatasetManifest} manifest The dataset manifest object + * @param {IParseObjectOptions} options + */ + parseObject( + manifest: IDatasetManifest, + options: IParseObjectOptions + ): Promise; + + /** + * + */ + updateMetadata(): Promise; } /** * Method used to decorate a given object (publicAPI+model) with vtkHttpDataSetReader characteristics. * - * @param publicAPI object on which methods will be bounds (public) - * @param model object on which data structure will be bounds (protected) - * @param {IHttpDataSetReaderInitialValues} [initialValues] (default: {}) + * @param publicAPI object on which methods will be bounds (public) + * @param model object on which data structure will be bounds (protected) + * @param {IHttpDataSetReaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IHttpDataSetReaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IHttpDataSetReaderInitialValues +): void; /** * Method used to create a new instance of vtkHttpDataSetReader while enabling a @@ -287,16 +315,18 @@ export function extend(publicAPI: object, model: object, initialValues?: IHttpDa * The __enableArray__ argument allow you to choose if you want to activate all * data array by default or if you will have to manually enable them before * downloading them. - * @param {IHttpDataSetReaderInitialValues} [initialValues] for pre-setting some of its content + * @param {IHttpDataSetReaderInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IHttpDataSetReaderInitialValues): vtkHttpDataSetReader; +export function newInstance( + initialValues?: IHttpDataSetReaderInitialValues +): vtkHttpDataSetReader; /** * The vtkHttpDataSetReader is using a custom format that only exist in vtk.js * which aims to simplify data fetching in an HTTP context. Basically the format * is composed of a JSON metadata file referencing all the required data array * as side binary files along with all the dataset configuration (i.e.: type, - * extent...). + * extent...). * * @example * ```js @@ -305,11 +335,11 @@ export function newInstance(initialValues?: IHttpDataSetReaderInitialValues): vt * const reader = vtkHttpDataSetReader.newInstance(); * reader.setURL('/Data/can.ex2/index.json').then((reader, dataset) => { * console.log('Metadata loaded with the geometry', dataset); - * + * * reader.getArrays().forEach(array => { * console.log('-', array.name, array.location, ':', array.enable); * }); - * + * * reader.update() * .then((reader, dataset) => { * console.log('dataset fully loaded', dataset); @@ -318,7 +348,7 @@ export function newInstance(initialValues?: IHttpDataSetReaderInitialValues): vt * ``` */ export declare const vtkHttpDataSetReader: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkHttpDataSetReader; diff --git a/Sources/IO/Core/HttpDataSetReader/test/MockDataAccessHelper.d.ts b/Sources/IO/Core/HttpDataSetReader/test/MockDataAccessHelper.d.ts index 75ee78eb517..225eecbd1da 100644 --- a/Sources/IO/Core/HttpDataSetReader/test/MockDataAccessHelper.d.ts +++ b/Sources/IO/Core/HttpDataSetReader/test/MockDataAccessHelper.d.ts @@ -3,22 +3,35 @@ */ export interface MockDataAccessHelperCallTrackerEntry { - promise: Promise; - called: Date; + promise: Promise; + called: Date; } export interface MockDataAccessHelperCallTracker { - fetchJSON: MockDataAccessHelperCallTrackerEntry[]; - fetchArray: MockDataAccessHelperCallTrackerEntry[]; + fetchJSON: MockDataAccessHelperCallTrackerEntry[]; + fetchArray: MockDataAccessHelperCallTrackerEntry[]; } export interface MockDataAccessHelper { - fetchArray(instance: any, baseURL: string, array: object[], options?: object): Promise; - fetchJSON(instance: any, url: string, options?: object): Promise; - fetchText(instance: any, url: string, options?: object): Promise; - fetchBinary(instance: any, url: string, options?: object): Promise; - fetchImage(instance: any, url: string, options?: object): Promise; - getCallTracker(): MockDataAccessHelperCallTracker; + fetchArray( + instance: any, + baseURL: string, + array: object[], + options?: object + ): Promise; + fetchJSON(instance: any, url: string, options?: object): Promise; + fetchText(instance: any, url: string, options?: object): Promise; + fetchBinary( + instance: any, + url: string, + options?: object + ): Promise; + fetchImage( + instance: any, + url: string, + options?: object + ): Promise; + getCallTracker(): MockDataAccessHelperCallTracker; } export default MockDataAccessHelper; diff --git a/Sources/IO/Core/HttpSceneLoader/index.d.ts b/Sources/IO/Core/HttpSceneLoader/index.d.ts index c3991736789..ac3cdb1f276 100644 --- a/Sources/IO/Core/HttpSceneLoader/index.d.ts +++ b/Sources/IO/Core/HttpSceneLoader/index.d.ts @@ -1,89 +1,88 @@ -import { vtkObject } from "../../../interfaces"; -import vtkAnnotatedCubeActor from "../../../Rendering/Core/AnnotatedCubeActor"; -import vtkAxesActor from "../../../Rendering/Core/AxesActor"; -import vtkRenderer from "../../../Rendering/Core/Renderer"; -import vtkRenderWindowInteractor from "../../../Rendering/Core/RenderWindowInteractor"; +import { vtkObject } from '../../../interfaces'; +import vtkAnnotatedCubeActor from '../../../Rendering/Core/AnnotatedCubeActor'; +import vtkAxesActor from '../../../Rendering/Core/AxesActor'; +import vtkRenderer from '../../../Rendering/Core/Renderer'; +import vtkRenderWindowInteractor from '../../../Rendering/Core/RenderWindowInteractor'; /** - * + * */ export interface IHttpSceneLoaderInitialValues { - fetchGzip?: boolean, - url?: string, - baseURL?: string, - animationHandler?: null, - startLODLoaders?: boolean, + fetchGzip?: boolean; + url?: string; + baseURL?: string; + animationHandler?: null; + startLODLoaders?: boolean; } export interface vtkHttpSceneLoader extends vtkObject { - - /** - * - */ - getAnimationHandler(): any; // vtkTimeStepBasedAnimationHandler - - /** - * - */ - getBaseURL(): string; - - /** - * - * @param {Boolean} fetchGzip - */ - getFetchGzip(fetchGzip: boolean): boolean; - - /** - * - */ - getMetadata(): any; - - /** - * - */ - getRenderer(): vtkRenderer; - - /** - * - */ - getScene(): object; - - /** - * - */ - getUrl(): string; - - /** - * - */ - invokeReady(): void; - - /** - * - */ - onReady(): void; - - /** - * - */ - resetScene(): void; - - /** - * - * @param {vtkRenderer} renderer The vtkRenderer instance. - */ - setRenderer(renderer: vtkRenderer): boolean; - - /** - * - * @param {String} url - */ - setUrl(url: string): void; - - /** - * - */ - update(): void; + /** + * + */ + getAnimationHandler(): any; // vtkTimeStepBasedAnimationHandler + + /** + * + */ + getBaseURL(): string; + + /** + * + * @param {Boolean} fetchGzip + */ + getFetchGzip(fetchGzip: boolean): boolean; + + /** + * + */ + getMetadata(): any; + + /** + * + */ + getRenderer(): vtkRenderer; + + /** + * + */ + getScene(): object; + + /** + * + */ + getUrl(): string; + + /** + * + */ + invokeReady(): void; + + /** + * + */ + onReady(): void; + + /** + * + */ + resetScene(): void; + + /** + * + * @param {vtkRenderer} renderer The vtkRenderer instance. + */ + setRenderer(renderer: vtkRenderer): boolean; + + /** + * + * @param {String} url + */ + setUrl(url: string): void; + + /** + * + */ + update(): void; } /** @@ -93,25 +92,31 @@ export interface vtkHttpSceneLoader extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IHttpSceneLoaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IHttpSceneLoaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IHttpSceneLoaderInitialValues +): void; /** * Method used to create a new instance of vtkHttpSceneLoader * @param {IHttpSceneLoaderInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IHttpSceneLoaderInitialValues): vtkHttpSceneLoader; +export function newInstance( + initialValues?: IHttpSceneLoaderInitialValues +): vtkHttpSceneLoader; /** - * - * @param sceneItem - * @param settings + * + * @param sceneItem + * @param settings */ export function applySettings(sceneItem: object, settings: object): void; /** - * - * @param typeName - * @param handler + * + * @param typeName + * @param handler */ export function updateDatasetTypeMapping(typeName: string, handler: any): void; @@ -119,9 +124,9 @@ export function updateDatasetTypeMapping(typeName: string, handler: any): void; * vtkHttpSceneLoader */ export declare const vtkHttpSceneLoader: { - newInstance: typeof newInstance; - extend: typeof extend; - applySettings: typeof applySettings; - updateDatasetTypeMapping: typeof updateDatasetTypeMapping; -} + newInstance: typeof newInstance; + extend: typeof extend; + applySettings: typeof applySettings; + updateDatasetTypeMapping: typeof updateDatasetTypeMapping; +}; export default vtkHttpSceneLoader; diff --git a/Sources/IO/Core/ImageStream/DefaultProtocol.d.ts b/Sources/IO/Core/ImageStream/DefaultProtocol.d.ts index 12f470fa343..1caaa516412 100644 --- a/Sources/IO/Core/ImageStream/DefaultProtocol.d.ts +++ b/Sources/IO/Core/ImageStream/DefaultProtocol.d.ts @@ -1,25 +1,32 @@ import { Size, Vector3 } from '../../../types'; declare function createMethods(session: any): { - subscribeToImageStream: (callback: any) => any; - unsubscribeToImageStream: (subscription: any) => any; - registerView: (viewId: string) => any; - unregisterView: (viewId: string) => any; - enableView: (viewId: string, enabled: boolean) => any; - render: (options?: { - size: Size; - view: number; - }) => any; - resetCamera: (view?: number) => any; - invalidateCache: (viewId: string) => any; - setQuality: (viewId: string, quality: number, ratio?: number) => any; - setSize: (viewId: string, width?: number, height?: number) => any; - setServerAnimationFPS: (fps?: number) => any; - getServerAnimationFPS: () => number; - startAnimation: (viewId?: number) => any; - stopAnimation: (viewId?: number) => any; - updateCamera: (viewId: string, focalPoint: Vector3, viewUp: Vector3, position: Vector3, forceUpdate?: boolean) => any; - updateCameraParameters: (viewId?: number, parameters?: {}, forceUpdate?: boolean) => any; -} + subscribeToImageStream: (callback: any) => any; + unsubscribeToImageStream: (subscription: any) => any; + registerView: (viewId: string) => any; + unregisterView: (viewId: string) => any; + enableView: (viewId: string, enabled: boolean) => any; + render: (options?: { size: Size; view: number }) => any; + resetCamera: (view?: number) => any; + invalidateCache: (viewId: string) => any; + setQuality: (viewId: string, quality: number, ratio?: number) => any; + setSize: (viewId: string, width?: number, height?: number) => any; + setServerAnimationFPS: (fps?: number) => any; + getServerAnimationFPS: () => number; + startAnimation: (viewId?: number) => any; + stopAnimation: (viewId?: number) => any; + updateCamera: ( + viewId: string, + focalPoint: Vector3, + viewUp: Vector3, + position: Vector3, + forceUpdate?: boolean + ) => any; + updateCameraParameters: ( + viewId?: number, + parameters?: {}, + forceUpdate?: boolean + ) => any; +}; export default createMethods; diff --git a/Sources/IO/Core/ImageStream/ViewStream.d.ts b/Sources/IO/Core/ImageStream/ViewStream.d.ts index e51a09ca351..17e65d9de94 100644 --- a/Sources/IO/Core/ImageStream/ViewStream.d.ts +++ b/Sources/IO/Core/ImageStream/ViewStream.d.ts @@ -23,16 +23,16 @@ export interface IViewStreamInitialValues { } interface IMetaData { - size: Size, - id: string, - memory: number, - workTime: number, + size: Size; + id: string; + memory: number; + workTime: number; } interface IEvent { - url: string, - fps: number[], - metadata: IMetaData, + url: string; + fps: number[]; + metadata: IMetaData; } export interface vtkViewStream extends vtkObject { diff --git a/Sources/IO/Core/ImageStream/index.d.ts b/Sources/IO/Core/ImageStream/index.d.ts index 2e1a32774ca..55cca8b088f 100644 --- a/Sources/IO/Core/ImageStream/index.d.ts +++ b/Sources/IO/Core/ImageStream/index.d.ts @@ -1,67 +1,66 @@ -import { vtkObject } from "../../../interfaces"; -import { Size } from "../../../types"; +import { vtkObject } from '../../../interfaces'; +import { Size } from '../../../types'; import vtkViewStream from './ViewStream'; /** * */ export interface IImageStreamInitialValues { - viewStreams?: any[], - serverAnimationFPS?: number, + viewStreams?: any[]; + serverAnimationFPS?: number; } // Return type of wslink/src/WebsocketConnection, getSession() method. type WebsocketSession = any; export interface vtkImageStream extends vtkObject { + /** + * + */ + connect(session: WebsocketSession): void; - /** - * - */ - connect(session: WebsocketSession): void; + /** + * + * @param {String} [viewId] The ID of the view. + * @param {Size} [size] The size of the view. + */ + createViewStream(viewId?: string, size?: Size): vtkViewStream; - /** - * - * @param {String} [viewId] The ID of the view. - * @param {Size} [size] The size of the view. - */ - createViewStream(viewId?: string, size?: Size): vtkViewStream; + /** + * + */ + delete(): void; - /** - * - */ - delete(): void; + /** + * + */ + disconnect(): void; - /** - * - */ - disconnect(): void; + /** + * + */ + getProtocol(): any; - /** - * - */ - getProtocol(): any; + /** + * + */ + getServerAnimationFPS(): number; - /** - * - */ - getServerAnimationFPS(): number; + /** + * + */ + registerViewStream(): void; - /** - * - */ - registerViewStream(): void; + /** + * + * @param serverAnimationFPS + */ + setServerAnimationFPS(serverAnimationFPS: number): boolean; - /** - * - * @param serverAnimationFPS - */ - setServerAnimationFPS(serverAnimationFPS: number): boolean; - - /** - * - */ - unregisterViewStream(): void; + /** + * + */ + unregisterViewStream(): void; } /** @@ -71,19 +70,25 @@ export interface vtkImageStream extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IImageStreamInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IImageStreamInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IImageStreamInitialValues +): void; /** * Method used to create a new instance of vtkImageStream * @param {IImageStreamInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IImageStreamInitialValues): vtkImageStream; +export function newInstance( + initialValues?: IImageStreamInitialValues +): vtkImageStream; /** * vtkImageStream. */ export declare const vtkImageStream: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkImageStream; diff --git a/Sources/IO/Core/WSLinkClient/index.d.ts b/Sources/IO/Core/WSLinkClient/index.d.ts index 3be264631a3..708ed0c1bd6 100644 --- a/Sources/IO/Core/WSLinkClient/index.d.ts +++ b/Sources/IO/Core/WSLinkClient/index.d.ts @@ -17,7 +17,6 @@ import vtkImageStream from '../ImageStream'; export function setSmartConnectClass(smartConnectClass: object): void; export interface vtkWSLinkClient extends vtkObject { - /** * Virtually increase work load to maybe keep isBusy() on * while executing a synchronous task. @@ -47,7 +46,10 @@ export interface vtkWSLinkClient extends vtkObject { * @param {Object} config * @param {Function} [configDecorator] (default: null) */ - connect(config: object, configDecorator?: (config: object) => object): Promise; + connect( + config: object, + configDecorator?: (config: object) => object + ): Promise; /** * Disconnect from server @@ -166,7 +168,11 @@ export interface vtkWSLinkClient extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {object} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: object): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: object +): void; // ---------------------------------------------------------------------------- @@ -180,10 +186,10 @@ export function newInstance(initialValues?: object): vtkWSLinkClient; * vtkWSLinkClient is a WSLink client for talking to a server over WebSocket */ export declare const vtkWSLinkClient: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; // static - setSmartConnectClass: typeof setSmartConnectClass, + setSmartConnectClass: typeof setSmartConnectClass; }; export default vtkWSLinkClient; diff --git a/Sources/IO/Geometry/DracoReader/index.d.ts b/Sources/IO/Geometry/DracoReader/index.d.ts index 2a36e5c330a..cf63c658be0 100755 --- a/Sources/IO/Geometry/DracoReader/index.d.ts +++ b/Sources/IO/Geometry/DracoReader/index.d.ts @@ -1,88 +1,99 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import HtmlDataAccessHelper from "../../Core/DataAccessHelper/HtmlDataAccessHelper"; -import HttpDataAccessHelper from "../../Core/DataAccessHelper/HttpDataAccessHelper"; -import JSZipDataAccessHelper from "../../Core/DataAccessHelper/JSZipDataAccessHelper"; -import LiteHttpDataAccessHelper from "../../Core/DataAccessHelper/LiteHttpDataAccessHelper"; - +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import HtmlDataAccessHelper from '../../Core/DataAccessHelper/HtmlDataAccessHelper'; +import HttpDataAccessHelper from '../../Core/DataAccessHelper/HttpDataAccessHelper'; +import JSZipDataAccessHelper from '../../Core/DataAccessHelper/JSZipDataAccessHelper'; +import LiteHttpDataAccessHelper from '../../Core/DataAccessHelper/LiteHttpDataAccessHelper'; interface IDracoReaderOptions { - binary?: boolean; - compression?: string; - progressCallback?: any; + binary?: boolean; + compression?: string; + progressCallback?: any; } /** - * + * */ -export interface IDracoReaderInitialValues { } - -type vtkDracoReaderBase = vtkObject & Omit; +export interface IDracoReaderInitialValues {} + +type vtkDracoReaderBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkDracoReader extends vtkDracoReaderBase { - - /** - * - */ - getBaseURL(): string; - - /** - * - */ - getDataAccessHelper(): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper; - - /** - * Get the url of the object to load. - */ - getUrl(): string; - - /** - * Load the object data. - * @param {IDracoReaderOptions} [options] - */ - loadData(options?: IDracoReaderOptions): Promise; - - /** - * Parse data. - * @param {String | ArrayBuffer} content The content to parse. - */ - parse(content: string | ArrayBuffer): void; - - /** - * Parse data as ArrayBuffer. - * @param {ArrayBuffer} content The content to parse. - */ - parseAsArrayBuffer(content: ArrayBuffer): void; - - /** - * Parse data as text. - * @param {String} content The content to parse. - */ - parseAsText(content: string): void; - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * - * @param dataAccessHelper - */ - setDataAccessHelper(dataAccessHelper: HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper): boolean; - - /** - * Set the url of the object to load. - * @param {String} url the url of the object to load. - * @param {IDracoReaderOptions} [option] The Draco reader options. - */ - setUrl(url: string, option?: IDracoReaderOptions): Promise; + /** + * + */ + getBaseURL(): string; + + /** + * + */ + getDataAccessHelper(): + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper; + + /** + * Get the url of the object to load. + */ + getUrl(): string; + + /** + * Load the object data. + * @param {IDracoReaderOptions} [options] + */ + loadData(options?: IDracoReaderOptions): Promise; + + /** + * Parse data. + * @param {String | ArrayBuffer} content The content to parse. + */ + parse(content: string | ArrayBuffer): void; + + /** + * Parse data as ArrayBuffer. + * @param {ArrayBuffer} content The content to parse. + */ + parseAsArrayBuffer(content: ArrayBuffer): void; + + /** + * Parse data as text. + * @param {String} content The content to parse. + */ + parseAsText(content: string): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * + * @param dataAccessHelper + */ + setDataAccessHelper( + dataAccessHelper: + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper + ): boolean; + + /** + * Set the url of the object to load. + * @param {String} url the url of the object to load. + * @param {IDracoReaderOptions} [option] The Draco reader options. + */ + setUrl(url: string, option?: IDracoReaderOptions): Promise; } /** @@ -92,43 +103,50 @@ export interface vtkDracoReader extends vtkDracoReaderBase { * @param model object on which data structure will be bounds (protected) * @param {IDracoReaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IDracoReaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IDracoReaderInitialValues +): void; /** * Method used to create a new instance of vtkDracoReader * @param {IDracoReaderInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IDracoReaderInitialValues): vtkDracoReader; - +export function newInstance( + initialValues?: IDracoReaderInitialValues +): vtkDracoReader; /** - * + * */ export function getDracoDecoder(): any; /** - * - * @param createDracoModule + * + * @param createDracoModule */ export function setDracoDecoder(createDracoModule: any): void; /** * Load the WASM decoder from url and set the decoderModule - * @param url - * @param binaryName + * @param url + * @param binaryName */ -export function setWasmBinary(url: string, binaryName: string): Promise; - +export function setWasmBinary( + url: string, + binaryName: string +): Promise; /** * vtkDracoReader is a source object that reads a geometry compressed with the * Draco library. */ export declare const vtkDracoReader: { - newInstance: typeof newInstance; - extend: typeof extend; - getDracoDecoder: typeof getDracoDecoder; - setDracoDecoder: typeof setDracoDecoder; - setWasmBinary: typeof setWasmBinary; -} + newInstance: typeof newInstance; + extend: typeof extend; + getDracoDecoder: typeof getDracoDecoder; + setDracoDecoder: typeof setDracoDecoder; + setWasmBinary: typeof setWasmBinary; +}; export default vtkDracoReader; diff --git a/Sources/IO/Geometry/PLYReader/index.d.ts b/Sources/IO/Geometry/PLYReader/index.d.ts index 72673f5210a..ca11d5e74fd 100755 --- a/Sources/IO/Geometry/PLYReader/index.d.ts +++ b/Sources/IO/Geometry/PLYReader/index.d.ts @@ -1,87 +1,99 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import HtmlDataAccessHelper from "../../Core/DataAccessHelper/HtmlDataAccessHelper"; -import HttpDataAccessHelper from "../../Core/DataAccessHelper/HttpDataAccessHelper"; -import JSZipDataAccessHelper from "../../Core/DataAccessHelper/JSZipDataAccessHelper"; -import LiteHttpDataAccessHelper from "../../Core/DataAccessHelper/LiteHttpDataAccessHelper"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import HtmlDataAccessHelper from '../../Core/DataAccessHelper/HtmlDataAccessHelper'; +import HttpDataAccessHelper from '../../Core/DataAccessHelper/HttpDataAccessHelper'; +import JSZipDataAccessHelper from '../../Core/DataAccessHelper/JSZipDataAccessHelper'; +import LiteHttpDataAccessHelper from '../../Core/DataAccessHelper/LiteHttpDataAccessHelper'; interface IPLYReaderOptions { - binary?: boolean; - compression?: string; - progressCallback?: any; + binary?: boolean; + compression?: string; + progressCallback?: any; } /** - * + * */ export interface IPLYReaderInitialValues {} -type vtkPLYReaderBase = vtkObject & Omit; +type vtkPLYReaderBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkPLYReader extends vtkPLYReaderBase { - - /** - * - */ - getBaseURL(): string; - - /** - * - */ - getDataAccessHelper(): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper; - - /** - * Get the url of the object to load. - */ - getUrl(): string; - - /** - * Load the object data. - * @param {IPLYReaderOptions} [options] - */ - loadData(options?: IPLYReaderOptions): Promise; - - /** - * Parse data. - * @param {String | ArrayBuffer} content The content to parse. - */ - parse(content: string | ArrayBuffer): void; - - /** - * Parse data as ArrayBuffer. - * @param {ArrayBuffer} content The content to parse. - */ - parseAsArrayBuffer(content: ArrayBuffer): void; - - /** - * Parse data as text. - * @param {String} content The content to parse. - */ - parseAsText(content: string): void; - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * - * @param dataAccessHelper - */ - setDataAccessHelper(dataAccessHelper: HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper): boolean; - - /** - * Set the url of the object to load. - * @param {String} url the url of the object to load. - * @param {IPLYReaderOptions} [option] The PLY reader options. - */ - setUrl(url: string, option?: IPLYReaderOptions): Promise; + /** + * + */ + getBaseURL(): string; + + /** + * + */ + getDataAccessHelper(): + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper; + + /** + * Get the url of the object to load. + */ + getUrl(): string; + + /** + * Load the object data. + * @param {IPLYReaderOptions} [options] + */ + loadData(options?: IPLYReaderOptions): Promise; + + /** + * Parse data. + * @param {String | ArrayBuffer} content The content to parse. + */ + parse(content: string | ArrayBuffer): void; + + /** + * Parse data as ArrayBuffer. + * @param {ArrayBuffer} content The content to parse. + */ + parseAsArrayBuffer(content: ArrayBuffer): void; + + /** + * Parse data as text. + * @param {String} content The content to parse. + */ + parseAsText(content: string): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * + * @param dataAccessHelper + */ + setDataAccessHelper( + dataAccessHelper: + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper + ): boolean; + + /** + * Set the url of the object to load. + * @param {String} url the url of the object to load. + * @param {IPLYReaderOptions} [option] The PLY reader options. + */ + setUrl(url: string, option?: IPLYReaderOptions): Promise; } /** @@ -91,14 +103,19 @@ export interface vtkPLYReader extends vtkPLYReaderBase { * @param model object on which data structure will be bounds (protected) * @param {IPLYReaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPLYReaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPLYReaderInitialValues +): void; /** * Method used to create a new instance of vtkPLYReader * @param {IPLYReaderInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IPLYReaderInitialValues): vtkPLYReader; - +export function newInstance( + initialValues?: IPLYReaderInitialValues +): vtkPLYReader; /** * vtkPLYReader is a source object that reads polygonal data in Stanford @@ -113,7 +130,7 @@ export function newInstance(initialValues?: IPLYReaderInitialValues): vtkPLYRead * coordinates. */ export declare const vtkPLYReader: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkPLYReader; diff --git a/Sources/IO/Geometry/PLYWriter/index.d.ts b/Sources/IO/Geometry/PLYWriter/index.d.ts index 2702ee2efe4..d62f29add62 100644 --- a/Sources/IO/Geometry/PLYWriter/index.d.ts +++ b/Sources/IO/Geometry/PLYWriter/index.d.ts @@ -1,153 +1,154 @@ -import { mat4 } from "gl-matrix"; -import vtkPolyData from "../../../Common/DataModel/PolyData"; -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; +import { mat4 } from 'gl-matrix'; +import vtkPolyData from '../../../Common/DataModel/PolyData'; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; export enum FormatTypes { - ASCII, - BINARY + ASCII, + BINARY, } export enum TextureCoordinatesName { - UV, - TEXTURE_UV + UV, + TEXTURE_UV, } /** - * + * */ export interface IPLYWriterInitialValues { - format?: FormatTypes, - dataByteOrder?: number, - comments?: string[], - textureFileName?: string, - textureCoordinatesName?: TextureCoordinatesName, - transform?: mat4, - withNormals?: boolean, - withUVs?: boolean, - withColors?: boolean, - withIndice?: boolean + format?: FormatTypes; + dataByteOrder?: number; + comments?: string[]; + textureFileName?: string; + textureCoordinatesName?: TextureCoordinatesName; + transform?: mat4; + withNormals?: boolean; + withUVs?: boolean; + withColors?: boolean; + withIndice?: boolean; } type vtkPLYWriterBase = vtkObject & vtkAlgorithm; export interface vtkPLYWriter extends vtkPLYWriterBase { - - /** - * Get byte order value. - */ - getDataByteOrder(): number; - - /** - * Get file format value. - */ - getFormat(): FormatTypes; - - /** - * Get header comments. - */ - getHeaderComments(): string[]; - - /** - * Get textures mapping coordinates format. - */ - getTextureCoordinatesName(): TextureCoordinatesName; - - /** - * Get texture filename. - */ - getTextureFileName(): string; - - /** - * Get transformation matrix. - */ - getTransform(): mat4; - - /** - * Get whether colors values are included. - */ - getWithColors(): boolean; - - /** - * Get whether indices are included. - */ - getWithIndices(): boolean; - - /** - * Get whether normals are included. - */ - getWithNormals(): boolean; - - /** - * Get textures mapping coordinates. - */ - getWithUVs(): boolean; - - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * Set byte order. - * @param {Number} byteOrder Byte order. - */ - setDataByteOrder(byteOrder: number): boolean; - - /** - * Set file format. - * @param {FormatTypes} format File format. - */ - setFormat(format: FormatTypes): boolean; - - /** - * Set header comments. - * @param {String[]} headerComments Header comments. - */ - setHeaderComments(headerComments: string[]): boolean; - - /** - * Set textures coordinates format. - * @param {TextureCoordinatesName} textureCoordinatesName Textures mapping coordinates format. - */ - setTextureCoordinatesName(textureCoordinatesName: TextureCoordinatesName): boolean; - - /** - * Set texture filename. - * @param {String} textureFileName Texture filename. - */ - setTextureFileName(textureFileName: string): boolean; - - /** - * Set tranformation matrix. - * @param {mat4} transform Tranformation matrix. - */ - setTransform(transform: mat4): boolean; - - /** - * Set colors values. - * @param {Boolean} withColors Include colors. - */ - setWithColors(withColors: boolean): boolean; - - /** - * Set indices values. - * @param {Boolean} withIndices Include indices. - */ - setWithIndices(withIndices: boolean): boolean; - - /** - * Set normals values. - * @param {Boolean} withNormals Include normals. - */ - setWithNormals(withNormals: boolean): boolean; - - /** - * Set UVs values. - * @param {Boolean} withUVs Include textures mapping coordinates. - */ - setWithUVs(withUVs: boolean): boolean; + /** + * Get byte order value. + */ + getDataByteOrder(): number; + + /** + * Get file format value. + */ + getFormat(): FormatTypes; + + /** + * Get header comments. + */ + getHeaderComments(): string[]; + + /** + * Get textures mapping coordinates format. + */ + getTextureCoordinatesName(): TextureCoordinatesName; + + /** + * Get texture filename. + */ + getTextureFileName(): string; + + /** + * Get transformation matrix. + */ + getTransform(): mat4; + + /** + * Get whether colors values are included. + */ + getWithColors(): boolean; + + /** + * Get whether indices are included. + */ + getWithIndices(): boolean; + + /** + * Get whether normals are included. + */ + getWithNormals(): boolean; + + /** + * Get textures mapping coordinates. + */ + getWithUVs(): boolean; + + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * Set byte order. + * @param {Number} byteOrder Byte order. + */ + setDataByteOrder(byteOrder: number): boolean; + + /** + * Set file format. + * @param {FormatTypes} format File format. + */ + setFormat(format: FormatTypes): boolean; + + /** + * Set header comments. + * @param {String[]} headerComments Header comments. + */ + setHeaderComments(headerComments: string[]): boolean; + + /** + * Set textures coordinates format. + * @param {TextureCoordinatesName} textureCoordinatesName Textures mapping coordinates format. + */ + setTextureCoordinatesName( + textureCoordinatesName: TextureCoordinatesName + ): boolean; + + /** + * Set texture filename. + * @param {String} textureFileName Texture filename. + */ + setTextureFileName(textureFileName: string): boolean; + + /** + * Set tranformation matrix. + * @param {mat4} transform Tranformation matrix. + */ + setTransform(transform: mat4): boolean; + + /** + * Set colors values. + * @param {Boolean} withColors Include colors. + */ + setWithColors(withColors: boolean): boolean; + + /** + * Set indices values. + * @param {Boolean} withIndices Include indices. + */ + setWithIndices(withIndices: boolean): boolean; + + /** + * Set normals values. + * @param {Boolean} withNormals Include normals. + */ + setWithNormals(withNormals: boolean): boolean; + + /** + * Set UVs values. + * @param {Boolean} withUVs Include textures mapping coordinates. + */ + setWithUVs(withUVs: boolean): boolean; } /** @@ -157,20 +158,25 @@ export interface vtkPLYWriter extends vtkPLYWriterBase { * @param model object on which data structure will be bounds (protected) * @param {IPLYWriterInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPLYWriterInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPLYWriterInitialValues +): void; /** * Method used to create a new instance of vtkPLYWriter * @param {IPLYWriterInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IPLYWriterInitialValues): vtkPLYWriter; - +export function newInstance( + initialValues?: IPLYWriterInitialValues +): vtkPLYWriter; /** - * - * @param {vktPolyData} polyData - * @param {FormatTypes} [format] - * @param {Number} [dataByteOrder] + * + * @param {vktPolyData} polyData + * @param {FormatTypes} [format] + * @param {Number} [dataByteOrder] * @param {String[]} [comments] Header comments. * @param {String} [textureFileName] Texture file n coordinates name. * @param {TextureCoordinatesName} [textureCoordinatesName] Textures mapping coordinates format. @@ -180,10 +186,19 @@ export function newInstance(initialValues?: IPLYWriterInitialValues): vtkPLYWrit * @param {Boolean} [withColors] Include colors. * @param {Boolean} [withIndice] Include indice. */ -export function writePLY(polyData: vtkPolyData, format?: FormatTypes, - dataByteOrder?: number, comments?: string[], textureFileName?: string, - textureCoordinatesName?: TextureCoordinatesName, transform?: mat4, withNormals?: boolean, - withUVs?: boolean, withColors?: boolean, withIndice?: boolean): vtkPolyData; +export function writePLY( + polyData: vtkPolyData, + format?: FormatTypes, + dataByteOrder?: number, + comments?: string[], + textureFileName?: string, + textureCoordinatesName?: TextureCoordinatesName, + transform?: mat4, + withNormals?: boolean, + withUVs?: boolean, + withColors?: boolean, + withIndice?: boolean +): vtkPolyData; /** * vtkPLYWriter writes polygonal data in Stanford University PLY format (see @@ -196,8 +211,8 @@ export function writePLY(polyData: vtkPolyData, format?: FormatTypes, * specify a vtkLookupTable to map the scalars to RGB. */ export declare const vtkPLYWriter: { - newInstance: typeof newInstance; - extend: typeof extend; - writePLY: typeof writePLY; -} + newInstance: typeof newInstance; + extend: typeof extend; + writePLY: typeof writePLY; +}; export default vtkPLYWriter; diff --git a/Sources/IO/Geometry/STLReader/index.d.ts b/Sources/IO/Geometry/STLReader/index.d.ts index 3d3b4ec5dba..0eec1a5c7a1 100755 --- a/Sources/IO/Geometry/STLReader/index.d.ts +++ b/Sources/IO/Geometry/STLReader/index.d.ts @@ -1,89 +1,99 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import HtmlDataAccessHelper from "../../Core/DataAccessHelper/HtmlDataAccessHelper"; -import HttpDataAccessHelper from "../../Core/DataAccessHelper/HttpDataAccessHelper"; -import JSZipDataAccessHelper from "../../Core/DataAccessHelper/JSZipDataAccessHelper"; -import LiteHttpDataAccessHelper from "../../Core/DataAccessHelper/LiteHttpDataAccessHelper"; - +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import HtmlDataAccessHelper from '../../Core/DataAccessHelper/HtmlDataAccessHelper'; +import HttpDataAccessHelper from '../../Core/DataAccessHelper/HttpDataAccessHelper'; +import JSZipDataAccessHelper from '../../Core/DataAccessHelper/JSZipDataAccessHelper'; +import LiteHttpDataAccessHelper from '../../Core/DataAccessHelper/LiteHttpDataAccessHelper'; interface ISTLReaderOptions { - binary?: boolean; - compression?: string; - progressCallback?: any; + binary?: boolean; + compression?: string; + progressCallback?: any; } /** - * + * */ export interface ISTLReaderInitialValues {} -type vtkSTLReaderBase = vtkObject & Omit; +type vtkSTLReaderBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkSTLReader extends vtkSTLReaderBase { - - /** - * - */ - getBaseURL(): string; - - /** - * - */ - getDataAccessHelper(): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper; - - /** - * Get the url of the object to load. - */ - getUrl(): string; - - /** - * Load the object data. - * @param {ISTLReaderOptions} [options] - */ - loadData(options?: ISTLReaderOptions): Promise; - - /** - * Parse data. - * @param {String | ArrayBuffer} content The content to parse. - */ - parse(content: string | ArrayBuffer): void; - - /** - * Parse data as ArrayBuffer. - * @param {ArrayBuffer} content The content to parse. - */ - parseAsArrayBuffer(content: ArrayBuffer): void; - - /** - * Parse data as text. - * @param {String} content The content to parse. - */ - parseAsText(content: string): void; - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * - * @param dataAccessHelper - */ - setDataAccessHelper(dataAccessHelper: HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper): boolean; - - - /** - * Set the url of the object to load. - * @param {String} url the url of the object to load. - * @param {ISTLReaderOptions} [option] The STL reader options. - */ - setUrl(url: string, option?: ISTLReaderOptions): Promise; + /** + * + */ + getBaseURL(): string; + + /** + * + */ + getDataAccessHelper(): + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper; + + /** + * Get the url of the object to load. + */ + getUrl(): string; + + /** + * Load the object data. + * @param {ISTLReaderOptions} [options] + */ + loadData(options?: ISTLReaderOptions): Promise; + + /** + * Parse data. + * @param {String | ArrayBuffer} content The content to parse. + */ + parse(content: string | ArrayBuffer): void; + + /** + * Parse data as ArrayBuffer. + * @param {ArrayBuffer} content The content to parse. + */ + parseAsArrayBuffer(content: ArrayBuffer): void; + + /** + * Parse data as text. + * @param {String} content The content to parse. + */ + parseAsText(content: string): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * + * @param dataAccessHelper + */ + setDataAccessHelper( + dataAccessHelper: + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper + ): boolean; + + /** + * Set the url of the object to load. + * @param {String} url the url of the object to load. + * @param {ISTLReaderOptions} [option] The STL reader options. + */ + setUrl(url: string, option?: ISTLReaderOptions): Promise; } /** @@ -93,14 +103,19 @@ export interface vtkSTLReader extends vtkSTLReaderBase { * @param model object on which data structure will be bounds (protected) * @param {ISTLReaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ISTLReaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ISTLReaderInitialValues +): void; /** * Method used to create a new instance of vtkSTLReader * @param {ISTLReaderInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ISTLReaderInitialValues): vtkSTLReader; - +export function newInstance( + initialValues?: ISTLReaderInitialValues +): vtkSTLReader; /** * vtkSTLReader is a source object that reads ASCII or binary stereo lithography @@ -109,7 +124,7 @@ export function newInstance(initialValues?: ISTLReaderInitialValues): vtkSTLRead * definitions. */ export declare const vtkSTLReader: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkSTLReader; diff --git a/Sources/IO/Geometry/STLWriter/index.d.ts b/Sources/IO/Geometry/STLWriter/index.d.ts index e4a0d5adca7..fbd2dfebf95 100755 --- a/Sources/IO/Geometry/STLWriter/index.d.ts +++ b/Sources/IO/Geometry/STLWriter/index.d.ts @@ -1,49 +1,48 @@ -import { mat4 } from "gl-matrix"; -import vtkPolyData from "../../../Common/DataModel/PolyData"; -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; +import { mat4 } from 'gl-matrix'; +import vtkPolyData from '../../../Common/DataModel/PolyData'; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; export enum FormatTypes { - ASCII, - BINARY + ASCII, + BINARY, } /** - * + * */ -export interface ISTLWriterInitialValues { } +export interface ISTLWriterInitialValues {} type vtkSTLWriterBase = vtkObject & vtkAlgorithm; export interface vtkSTLWriter extends vtkSTLWriterBase { + /** + * + */ + getFormat(): FormatTypes; - /** - * - */ - getFormat(): FormatTypes; - - /** - * - */ - getTransform(): mat4; + /** + * + */ + getTransform(): mat4; - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; - /** - * - * @param {FormatTypes} format - */ - setFormat(format: FormatTypes): boolean; + /** + * + * @param {FormatTypes} format + */ + setFormat(format: FormatTypes): boolean; - /** - * - * @param {mat4} transform Tranformation matrix. - */ - setTransform(transform: mat4): boolean; + /** + * + * @param {mat4} transform Tranformation matrix. + */ + setTransform(transform: mat4): boolean; } /** @@ -53,22 +52,31 @@ export interface vtkSTLWriter extends vtkSTLWriterBase { * @param model object on which data structure will be bounds (protected) * @param {ISTLWriterInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ISTLWriterInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ISTLWriterInitialValues +): void; /** * Method used to create a new instance of vtkSTLWriter * @param {ISTLWriterInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ISTLWriterInitialValues): vtkSTLWriter; +export function newInstance( + initialValues?: ISTLWriterInitialValues +): vtkSTLWriter; /** - * - * @param {vktPolyData} polyData - * @param {FormatTypes} [format] - * @param {mat4} [transform] + * + * @param {vktPolyData} polyData + * @param {FormatTypes} [format] + * @param {mat4} [transform] */ -export function writeSTL(polyData: vtkPolyData, format?: FormatTypes, transform?: mat4): vtkPolyData; - +export function writeSTL( + polyData: vtkPolyData, + format?: FormatTypes, + transform?: mat4 +): vtkPolyData; /** * vtkSTLWriter writes stereo lithography (.stl) files in either ASCII or binary @@ -78,8 +86,8 @@ export function writeSTL(polyData: vtkPolyData, format?: FormatTypes, transform? * contains polygons with more than three vertices. */ export declare const vtkSTLWriter: { - newInstance: typeof newInstance; - extend: typeof extend; - writeSTL: typeof writeSTL; -} + newInstance: typeof newInstance; + extend: typeof extend; + writeSTL: typeof writeSTL; +}; export default vtkSTLWriter; diff --git a/Sources/IO/Misc/ElevationReader/index.d.ts b/Sources/IO/Misc/ElevationReader/index.d.ts index d6e8a9c9b5f..184829cf887 100755 --- a/Sources/IO/Misc/ElevationReader/index.d.ts +++ b/Sources/IO/Misc/ElevationReader/index.d.ts @@ -1,152 +1,163 @@ -import { vtkAlgorithm, vtkObject, vtkSubscription } from "../../../interfaces"; -import HtmlDataAccessHelper from "../../Core/DataAccessHelper/HtmlDataAccessHelper"; -import HttpDataAccessHelper from "../../Core/DataAccessHelper/HttpDataAccessHelper"; -import JSZipDataAccessHelper from "../../Core/DataAccessHelper/JSZipDataAccessHelper"; -import LiteHttpDataAccessHelper from "../../Core/DataAccessHelper/LiteHttpDataAccessHelper"; - +import { vtkAlgorithm, vtkObject, vtkSubscription } from '../../../interfaces'; +import HtmlDataAccessHelper from '../../Core/DataAccessHelper/HtmlDataAccessHelper'; +import HttpDataAccessHelper from '../../Core/DataAccessHelper/HttpDataAccessHelper'; +import JSZipDataAccessHelper from '../../Core/DataAccessHelper/JSZipDataAccessHelper'; +import LiteHttpDataAccessHelper from '../../Core/DataAccessHelper/LiteHttpDataAccessHelper'; interface IElevationReaderOptions { - binary?: boolean; - compression?: string; - progressCallback?: any; + binary?: boolean; + compression?: string; + progressCallback?: any; } /** - * + * */ export interface IElevationReaderInitialValues { - origin?: number[]; - xSpacing?: number; - ySpacing?: number; - zScaling?: number; - xDirection?: number; - yDirection?: number; - requestCount?: number; + origin?: number[]; + xSpacing?: number; + ySpacing?: number; + zScaling?: number; + xDirection?: number; + yDirection?: number; + requestCount?: number; } -type vtkElevationReaderBase = vtkObject & Omit; +type vtkElevationReaderBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkElevationReader extends vtkElevationReaderBase { - - /** - * - */ - getDataAccessHelper(): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper; - - /** - * Get the url of the object to load. - */ - getUrl(): string; - - /** - * - */ - getXDirection(): number; - - /** - * - */ - getXSpacing(): number; - - /** - * - */ - getYDirection(): number; - - /** - * - */ - getYSpacing(): number; - - /** - * - */ - getZScaling(): number; - - /** - * - * @param {Boolean} busy - */ - invokeBusy(busy: boolean): void; - - /** - * - */ - isBusy(): number; - - /** - * Load the object data. - * @param {IElevationReaderOptions} [options] - */ - loadData(options?: IElevationReaderOptions): Promise; - - /** - * - * @param callback - */ - onBusy(callback: (busy: boolean) => any): vtkSubscription; - - /** - * Parse data as text. - * @param {String} content The content to parse. - */ - parseAsText(content: string): void; - - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * - * @param dataAccessHelper - */ - setDataAccessHelper(dataAccessHelper: HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper): boolean; - - /** - * Set the url of the object to load. - * @param {String} url the url of the object to load. - * @param {IElevationReaderOptions} [option] The Elevation reader options. - */ - setUrl(url: string, option?: IElevationReaderOptions): Promise; - - /** - * - * @param {Number} xDirection - */ - setXDirection(xDirection: number): boolean; - - /** - * - * @param {Number} xSpacing - */ - setXSpacing(xSpacing: number): boolean; - - /** - * - * @param {Number} yDirection - */ - setYDirection(yDirection: number): boolean; - - /** - * - * @param {Number} ySpacing - */ - setYSpacing(ySpacing: number): boolean; - - /** - * - * @param {Number} zScaling - */ - setZScaling(zScaling: number): boolean; + /** + * + */ + getDataAccessHelper(): + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper; + + /** + * Get the url of the object to load. + */ + getUrl(): string; + + /** + * + */ + getXDirection(): number; + + /** + * + */ + getXSpacing(): number; + + /** + * + */ + getYDirection(): number; + + /** + * + */ + getYSpacing(): number; + + /** + * + */ + getZScaling(): number; + + /** + * + * @param {Boolean} busy + */ + invokeBusy(busy: boolean): void; + + /** + * + */ + isBusy(): number; + + /** + * Load the object data. + * @param {IElevationReaderOptions} [options] + */ + loadData(options?: IElevationReaderOptions): Promise; + + /** + * + * @param callback + */ + onBusy(callback: (busy: boolean) => any): vtkSubscription; + + /** + * Parse data as text. + * @param {String} content The content to parse. + */ + parseAsText(content: string): void; + + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * + * @param dataAccessHelper + */ + setDataAccessHelper( + dataAccessHelper: + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper + ): boolean; + + /** + * Set the url of the object to load. + * @param {String} url the url of the object to load. + * @param {IElevationReaderOptions} [option] The Elevation reader options. + */ + setUrl(url: string, option?: IElevationReaderOptions): Promise; + + /** + * + * @param {Number} xDirection + */ + setXDirection(xDirection: number): boolean; + + /** + * + * @param {Number} xSpacing + */ + setXSpacing(xSpacing: number): boolean; + + /** + * + * @param {Number} yDirection + */ + setYDirection(yDirection: number): boolean; + + /** + * + * @param {Number} ySpacing + */ + setYSpacing(ySpacing: number): boolean; + + /** + * + * @param {Number} zScaling + */ + setZScaling(zScaling: number): boolean; } /** @@ -156,14 +167,19 @@ export interface vtkElevationReader extends vtkElevationReaderBase { * @param model object on which data structure will be bounds (protected) * @param {IElevationReaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IElevationReaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IElevationReaderInitialValues +): void; /** * Method used to create a new instance of vtkElevationReader * @param {IElevationReaderInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IElevationReaderInitialValues): vtkElevationReader; - +export function newInstance( + initialValues?: IElevationReaderInitialValues +): vtkElevationReader; /** * The vtkElevationReader aims to read a text file formatted as below and create @@ -195,7 +211,7 @@ export function newInstance(initialValues?: IElevationReaderInitialValues): vtkE * are meant to give you control on that end. */ export declare const vtkElevationReader: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkElevationReader; diff --git a/Sources/IO/Misc/ITKImageReader/index.d.ts b/Sources/IO/Misc/ITKImageReader/index.d.ts index 2d839549619..7fbf774ac5f 100755 --- a/Sources/IO/Misc/ITKImageReader/index.d.ts +++ b/Sources/IO/Misc/ITKImageReader/index.d.ts @@ -1,57 +1,59 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; /** - * + * */ export interface IITKImageReaderInitialValues { - fileName?: string; - arrayName?: string; + fileName?: string; + arrayName?: string; } -type vtkITKImageReaderBase = vtkObject & Omit; +type vtkITKImageReaderBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkITKImageReader extends vtkITKImageReaderBase { + /** + * Get the array name. + */ + getArrayName(): string; - /** - * Get the array name. - */ - getArrayName(): string; - - /** - * Get the filename. - */ - getFileName(): string; + /** + * Get the filename. + */ + getFileName(): string; - /** - * Parse data as array buffer. - * @param {ArrayBuffer} arrayBuffer The array buffer to parse. - */ - parseAsArrayBuffer(arrayBuffer: ArrayBuffer): void; + /** + * Parse data as array buffer. + * @param {ArrayBuffer} arrayBuffer The array buffer to parse. + */ + parseAsArrayBuffer(arrayBuffer: ArrayBuffer): void; - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; - /** - * Set the array name. - * @param {String} arrayName The name of the array. - */ - setArrayName(arrayName: string): boolean; + /** + * Set the array name. + * @param {String} arrayName The name of the array. + */ + setArrayName(arrayName: string): boolean; - /** - * Set the filename. - * @param {String} filename - */ - setFileName(filename: string): boolean; + /** + * Set the filename. + * @param {String} filename + */ + setFileName(filename: string): boolean; } /** @@ -61,26 +63,32 @@ export interface vtkITKImageReader extends vtkITKImageReaderBase { * @param model object on which data structure will be bounds (protected) * @param {IITKImageReaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IITKImageReaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IITKImageReaderInitialValues +): void; /** * Method used to create a new instance of vtkITKImageReader * @param {IITKImageReaderInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IITKImageReaderInitialValues): vtkITKImageReader; +export function newInstance( + initialValues?: IITKImageReaderInitialValues +): vtkITKImageReader; /** - * - * @param {*} fn + * + * @param {*} fn */ -export function setReadImageArrayBufferFromITK(fn : any): Promise; - +export function setReadImageArrayBufferFromITK(fn: any): Promise; + /** * The vtkITKImageReader aims to read a ITK file format. */ export declare const vtkITKImageReader: { - newInstance: typeof newInstance; - extend: typeof extend; - setReadImageArrayBufferFromITK: typeof setReadImageArrayBufferFromITK; -} + newInstance: typeof newInstance; + extend: typeof extend; + setReadImageArrayBufferFromITK: typeof setReadImageArrayBufferFromITK; +}; export default vtkITKImageReader; diff --git a/Sources/IO/Misc/ITKPolyDataReader/index.d.ts b/Sources/IO/Misc/ITKPolyDataReader/index.d.ts index b489c9e2896..2d47e8afb65 100755 --- a/Sources/IO/Misc/ITKPolyDataReader/index.d.ts +++ b/Sources/IO/Misc/ITKPolyDataReader/index.d.ts @@ -1,57 +1,59 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; /** - * + * */ export interface IITKPolyDataReaderInitialValues { - fileName?: string; - arrayName?: string; + fileName?: string; + arrayName?: string; } -type vtkITKPolyDataReaderBase = vtkObject & Omit; +type vtkITKPolyDataReaderBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkITKPolyDataReader extends vtkITKPolyDataReaderBase { + /** + * Get the array name. + */ + getArrayName(): string; - /** - * Get the array name. - */ - getArrayName(): string; - - /** - * Get the filename. - */ - getFileName(): string; + /** + * Get the filename. + */ + getFileName(): string; - /** - * Parse data as array buffer. - * @param {ArrayBuffer} arrayBuffer The array buffer to parse. - */ - parseAsArrayBuffer(arrayBuffer: ArrayBuffer): void; + /** + * Parse data as array buffer. + * @param {ArrayBuffer} arrayBuffer The array buffer to parse. + */ + parseAsArrayBuffer(arrayBuffer: ArrayBuffer): void; - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; - /** - * Set the array name. - * @param {String} arrayName The name of the array. - */ - setArrayName(arrayName: string): boolean; + /** + * Set the array name. + * @param {String} arrayName The name of the array. + */ + setArrayName(arrayName: string): boolean; - /** - * Set the filename. - * @param {String} filename - */ - setFileName(filename: string): boolean; + /** + * Set the filename. + * @param {String} filename + */ + setFileName(filename: string): boolean; } /** @@ -61,26 +63,32 @@ export interface vtkITKPolyDataReader extends vtkITKPolyDataReaderBase { * @param model object on which data structure will be bounds (protected) * @param {IITKPolyDataReaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IITKPolyDataReaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IITKPolyDataReaderInitialValues +): void; /** * Method used to create a new instance of vtkITKPolyDataReader * @param {IITKPolyDataReaderInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IITKPolyDataReaderInitialValues): vtkITKPolyDataReader; +export function newInstance( + initialValues?: IITKPolyDataReaderInitialValues +): vtkITKPolyDataReader; /** - * - * @param {*} fn + * + * @param {*} fn */ -export function setReadPolyDataArrayBufferFromITK(fn : any): Promise; - +export function setReadPolyDataArrayBufferFromITK(fn: any): Promise; + /** * The vtkITKPolyDataReader aims to read a ITK file format. */ export declare const vtkITKPolyDataReader: { - newInstance: typeof newInstance; - extend: typeof extend; - setReadPolyDataArrayBufferFromITK: typeof setReadPolyDataArrayBufferFromITK; -} + newInstance: typeof newInstance; + extend: typeof extend; + setReadPolyDataArrayBufferFromITK: typeof setReadPolyDataArrayBufferFromITK; +}; export default vtkITKPolyDataReader; diff --git a/Sources/IO/Misc/JSONNucleoReader/index.d.ts b/Sources/IO/Misc/JSONNucleoReader/index.d.ts index 89677279221..a932486b820 100755 --- a/Sources/IO/Misc/JSONNucleoReader/index.d.ts +++ b/Sources/IO/Misc/JSONNucleoReader/index.d.ts @@ -1,75 +1,87 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import HtmlDataAccessHelper from "../../Core/DataAccessHelper/HtmlDataAccessHelper"; -import HttpDataAccessHelper from "../../Core/DataAccessHelper/HttpDataAccessHelper"; -import JSZipDataAccessHelper from "../../Core/DataAccessHelper/JSZipDataAccessHelper"; -import LiteHttpDataAccessHelper from "../../Core/DataAccessHelper/LiteHttpDataAccessHelper"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import HtmlDataAccessHelper from '../../Core/DataAccessHelper/HtmlDataAccessHelper'; +import HttpDataAccessHelper from '../../Core/DataAccessHelper/HttpDataAccessHelper'; +import JSZipDataAccessHelper from '../../Core/DataAccessHelper/JSZipDataAccessHelper'; +import LiteHttpDataAccessHelper from '../../Core/DataAccessHelper/LiteHttpDataAccessHelper'; interface IJSONNucleoReaderOptions { - binary?: boolean; - compression?: string; - progressCallback?: any; + binary?: boolean; + compression?: string; + progressCallback?: any; } /** - * + * */ export interface IJSONNucleoReaderInitialValues {} -type vtkJSONNucleoReaderBase = vtkObject & Omit; +type vtkJSONNucleoReaderBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkJSONNucleoReader extends vtkJSONNucleoReaderBase { + /** + * + */ + getBaseURL(): string; - /** - * - */ - getBaseURL(): string; - - /** - * - */ - getDataAccessHelper(): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper; + /** + * + */ + getDataAccessHelper(): + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper; - /** - * Get the url of the object to load. - */ - getUrl(): string; + /** + * Get the url of the object to load. + */ + getUrl(): string; - /** - * Load the object data. - * @param {IJSONNucleoReaderOptions} [options] - */ - loadData(options?: IJSONNucleoReaderOptions): Promise; + /** + * Load the object data. + * @param {IJSONNucleoReaderOptions} [options] + */ + loadData(options?: IJSONNucleoReaderOptions): Promise; - /** - * Parse data as text. - * @param {String} jsonAsTxt The content to parse. - */ - parseAsText(jsonAsTxt: string): void; - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; + /** + * Parse data as text. + * @param {String} jsonAsTxt The content to parse. + */ + parseAsText(jsonAsTxt: string): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; - /** - * - * @param dataAccessHelper - */ - setDataAccessHelper(dataAccessHelper: HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper): boolean; + /** + * + * @param dataAccessHelper + */ + setDataAccessHelper( + dataAccessHelper: + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper + ): boolean; - /** - * Set the url of the object to load. - * @param {String} url the url of the object to load. - * @param {IJSONNucleoReaderOptions} [option] The JSONNucleo reader options. - */ - setUrl(url: string, option: IJSONNucleoReaderOptions): Promise; + /** + * Set the url of the object to load. + * @param {String} url the url of the object to load. + * @param {IJSONNucleoReaderOptions} [option] The JSONNucleo reader options. + */ + setUrl(url: string, option: IJSONNucleoReaderOptions): Promise; } /** @@ -79,20 +91,25 @@ export interface vtkJSONNucleoReader extends vtkJSONNucleoReaderBase { * @param model object on which data structure will be bounds (protected) * @param {IJSONNucleoReaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IJSONNucleoReaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IJSONNucleoReaderInitialValues +): void; /** * Method used to create a new instance of vtkJSONNucleoReader * @param {IJSONNucleoReaderInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IJSONNucleoReaderInitialValues): vtkJSONNucleoReader; - +export function newInstance( + initialValues?: IJSONNucleoReaderInitialValues +): vtkJSONNucleoReader; /** * vtkJSONNucleoReader reader. */ export declare const vtkJSONNucleoReader: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkJSONNucleoReader; diff --git a/Sources/IO/Misc/JSONReader/index.d.ts b/Sources/IO/Misc/JSONReader/index.d.ts index 46bc6937b11..0dd9b8079ca 100755 --- a/Sources/IO/Misc/JSONReader/index.d.ts +++ b/Sources/IO/Misc/JSONReader/index.d.ts @@ -1,78 +1,79 @@ -import { vtkAlgorithm, vtkObject, vtkSubscription } from "../../../interfaces"; - +import { vtkAlgorithm, vtkObject, vtkSubscription } from '../../../interfaces'; interface IJSONReaderOptions { - binary?: boolean; - compression?: string; - progressCallback?: any; + binary?: boolean; + compression?: string; + progressCallback?: any; } /** - * + * */ -export interface IJSONReaderInitialValues { } - -type vtkJSONReaderBase = vtkObject & Omit; +export interface IJSONReaderInitialValues {} + +type vtkJSONReaderBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkJSONReader extends vtkJSONReaderBase { - - /** - * - */ - getNumberOfOutputPorts(): number; - - /** - * Get the url of the object to load. - */ - getUrl(): string; - - /** - * - * @param {Boolean} busy - */ - invokeBusy(busy: boolean): void; - - /** - * - */ - isBusy(): number; - - /** - * Load the object data. - * @param {IJSONReaderOptions} [options] - */ - loadData(options?: IJSONReaderOptions): Promise; - - /** - * - * @param callback - */ - onBusy(callback: (busy: boolean) => any): vtkSubscription; - - /** - * Parse data as text. - * @param {String} content The content to parse. - */ - parseAsText(content: string): void; - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * Set the url of the object to load. - * @param {String} url the url of the object to load. - * @param {IJSONReaderOptions} [option] The JSON reader options. - */ - setUrl(url: string, option?: IJSONReaderOptions): Promise; + /** + * + */ + getNumberOfOutputPorts(): number; + + /** + * Get the url of the object to load. + */ + getUrl(): string; + + /** + * + * @param {Boolean} busy + */ + invokeBusy(busy: boolean): void; + + /** + * + */ + isBusy(): number; + + /** + * Load the object data. + * @param {IJSONReaderOptions} [options] + */ + loadData(options?: IJSONReaderOptions): Promise; + + /** + * + * @param callback + */ + onBusy(callback: (busy: boolean) => any): vtkSubscription; + + /** + * Parse data as text. + * @param {String} content The content to parse. + */ + parseAsText(content: string): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * Set the url of the object to load. + * @param {String} url the url of the object to load. + * @param {IJSONReaderOptions} [option] The JSON reader options. + */ + setUrl(url: string, option?: IJSONReaderOptions): Promise; } /** @@ -82,20 +83,25 @@ export interface vtkJSONReader extends vtkJSONReaderBase { * @param model object on which data structure will be bounds (protected) * @param {IJSONReaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IJSONReaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IJSONReaderInitialValues +): void; /** * Method used to create a new instance of vtkJSONReader * @param {IJSONReaderInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IJSONReaderInitialValues): vtkJSONReader; - +export function newInstance( + initialValues?: IJSONReaderInitialValues +): vtkJSONReader; /** * vtkJSONReader is a source object that reads JSON files. */ export declare const vtkJSONReader: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkJSONReader; diff --git a/Sources/IO/Misc/MTLReader/index.d.ts b/Sources/IO/Misc/MTLReader/index.d.ts index a238e025f2c..ed8d08987f1 100755 --- a/Sources/IO/Misc/MTLReader/index.d.ts +++ b/Sources/IO/Misc/MTLReader/index.d.ts @@ -1,144 +1,152 @@ -import { vtkObject, vtkSubscription } from "../../../interfaces"; - -import vtkActor from "../../../Rendering/Core/Actor"; -import HtmlDataAccessHelper from "../../Core/DataAccessHelper/HtmlDataAccessHelper"; -import HttpDataAccessHelper from "../../Core/DataAccessHelper/HttpDataAccessHelper"; -import JSZipDataAccessHelper from "../../Core/DataAccessHelper/JSZipDataAccessHelper"; -import LiteHttpDataAccessHelper from "../../Core/DataAccessHelper/LiteHttpDataAccessHelper"; +import { vtkObject, vtkSubscription } from '../../../interfaces'; +import vtkActor from '../../../Rendering/Core/Actor'; +import HtmlDataAccessHelper from '../../Core/DataAccessHelper/HtmlDataAccessHelper'; +import HttpDataAccessHelper from '../../Core/DataAccessHelper/HttpDataAccessHelper'; +import JSZipDataAccessHelper from '../../Core/DataAccessHelper/JSZipDataAccessHelper'; +import LiteHttpDataAccessHelper from '../../Core/DataAccessHelper/LiteHttpDataAccessHelper'; interface IMTLReaderOptions { - binary?: boolean; - compression?: string; - progressCallback?: any; + binary?: boolean; + compression?: string; + progressCallback?: any; } /** - * + * */ export interface IMTLReaderInitialValues { - numberOfOutputs?: number; - requestCount?: number; - materials?: object; - interpolateTextures?: boolean; + numberOfOutputs?: number; + requestCount?: number; + materials?: object; + interpolateTextures?: boolean; } export interface vtkMTLReader extends vtkObject { - - /** - * - * @param {String} name - * @param {vtkActor} actor - */ - applyMaterialToActor(name: string, actor: vtkActor): void; - - /** - * - */ - getBaseURL(): string; - - /** - * - */ - getDataAccessHelper(): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper; - - /** - * - */ - getInterpolateTextures(): boolean; - - /** - * - * @param {String} name The name of the material. - */ - getMaterial(name: string): object; - - /** - * - */ - getMaterialNames(): object; - - /** - * - */ - getSplitGroup(): boolean; - - /** - * Get the url of the object to load. - */ - getUrl(): string; - - /** - * - * @param {Boolean} busy - */ - invokeBusy(busy: boolean): void; - - /** - * - */ - isBusy(): number; - - /** - * - */ - listImages(): any; - - /** - * Load the object data. - * @param {IMTLReaderOptions} [options] - */ - loadData(options?: IMTLReaderOptions): Promise; - - /** - * - * @param callback - */ - onBusy(callback: (busy: boolean) => any): vtkSubscription; - - /** - * Parse data as text. - * @param {String} content The content to parse. - */ - parseAsText(content: string): void; - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * - * @param dataAccessHelper - */ - setDataAccessHelper(dataAccessHelper: HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper): boolean; - - /** - * - * @param imagePath - * @param src - */ - setImageSrc(imagePath: string, src: string): any; - - /** - * - * @param interpolateTextures - */ - setInterpolateTextures(interpolateTextures: boolean): boolean; - - /** - * - * @param splitGroup - */ - setSplitGroup(splitGroup: boolean): boolean; - - /** - * Set the url of the object to load. - * @param {String} url the url of the object to load. - * @param {IMTLReaderOptions} [option] The MTL reader options. - */ - setUrl(url: string, option?: IMTLReaderOptions): Promise; + /** + * + * @param {String} name + * @param {vtkActor} actor + */ + applyMaterialToActor(name: string, actor: vtkActor): void; + + /** + * + */ + getBaseURL(): string; + + /** + * + */ + getDataAccessHelper(): + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper; + + /** + * + */ + getInterpolateTextures(): boolean; + + /** + * + * @param {String} name The name of the material. + */ + getMaterial(name: string): object; + + /** + * + */ + getMaterialNames(): object; + + /** + * + */ + getSplitGroup(): boolean; + + /** + * Get the url of the object to load. + */ + getUrl(): string; + + /** + * + * @param {Boolean} busy + */ + invokeBusy(busy: boolean): void; + + /** + * + */ + isBusy(): number; + + /** + * + */ + listImages(): any; + + /** + * Load the object data. + * @param {IMTLReaderOptions} [options] + */ + loadData(options?: IMTLReaderOptions): Promise; + + /** + * + * @param callback + */ + onBusy(callback: (busy: boolean) => any): vtkSubscription; + + /** + * Parse data as text. + * @param {String} content The content to parse. + */ + parseAsText(content: string): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * + * @param dataAccessHelper + */ + setDataAccessHelper( + dataAccessHelper: + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper + ): boolean; + + /** + * + * @param imagePath + * @param src + */ + setImageSrc(imagePath: string, src: string): any; + + /** + * + * @param interpolateTextures + */ + setInterpolateTextures(interpolateTextures: boolean): boolean; + + /** + * + * @param splitGroup + */ + setSplitGroup(splitGroup: boolean): boolean; + + /** + * Set the url of the object to load. + * @param {String} url the url of the object to load. + * @param {IMTLReaderOptions} [option] The MTL reader options. + */ + setUrl(url: string, option?: IMTLReaderOptions): Promise; } /** @@ -148,14 +156,19 @@ export interface vtkMTLReader extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IMTLReaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IMTLReaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IMTLReaderInitialValues +): void; /** * Method used to create a new instance of vtkMTLReader * @param {IMTLReaderInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IMTLReaderInitialValues): vtkMTLReader; - +export function newInstance( + initialValues?: IMTLReaderInitialValues +): vtkMTLReader; /** * The vtkMTLReader aims to parse the MTL(Material Template Library file format @@ -163,7 +176,7 @@ export function newInstance(initialValues?: IMTLReaderInitialValues): vtkMTLRead * (material) properties of objects within one or more .OBJ files. */ export declare const vtkMTLReader: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkMTLReader; diff --git a/Sources/IO/Misc/OBJReader/index.d.ts b/Sources/IO/Misc/OBJReader/index.d.ts index ec6ab469c89..95b97263daa 100755 --- a/Sources/IO/Misc/OBJReader/index.d.ts +++ b/Sources/IO/Misc/OBJReader/index.d.ts @@ -1,32 +1,34 @@ -import { vtkAlgorithm, vtkObject, vtkSubscription } from "../../../interfaces"; -import HtmlDataAccessHelper from "../../Core/DataAccessHelper/HtmlDataAccessHelper"; -import HttpDataAccessHelper from "../../Core/DataAccessHelper/HttpDataAccessHelper"; -import JSZipDataAccessHelper from "../../Core/DataAccessHelper/JSZipDataAccessHelper"; -import LiteHttpDataAccessHelper from "../../Core/DataAccessHelper/LiteHttpDataAccessHelper"; - +import { vtkAlgorithm, vtkObject, vtkSubscription } from '../../../interfaces'; +import HtmlDataAccessHelper from '../../Core/DataAccessHelper/HtmlDataAccessHelper'; +import HttpDataAccessHelper from '../../Core/DataAccessHelper/HttpDataAccessHelper'; +import JSZipDataAccessHelper from '../../Core/DataAccessHelper/JSZipDataAccessHelper'; +import LiteHttpDataAccessHelper from '../../Core/DataAccessHelper/LiteHttpDataAccessHelper'; interface IOBJReaderOptions { - binary?: boolean; - compression?: string; - progressCallback?: any; + binary?: boolean; + compression?: string; + progressCallback?: any; } /** - * + * */ export interface IOBJReaderInitialValues { - numberOfOutputs?: number; - requestCount?: number; - splitMode?: string; + numberOfOutputs?: number; + requestCount?: number; + splitMode?: string; } -type vtkOBJReaderBase = vtkObject & Omit; +type vtkOBJReaderBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; /** * Convenient method to get the id of all duplicated points. @@ -44,97 +46,109 @@ type vtkOBJReaderBase = vtkObject & Omit; +export function getPointDuplicateIds( + polydata: any, + pointId: number +): Array; export interface vtkOBJReader extends vtkOBJReaderBase { - - /** - * - */ - getBaseURL(): string; - - /** - * - */ - getDataAccessHelper(): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper; - - /** - * Get the url of the object to load. - */ - getUrl(): string; - - /** - * - */ - getSplitMode(): number; - - /** - * True if duplicates are tracked in output polydata. - */ - getTrackDuplicates(): boolean - - /** - * - * @param {Boolean} busy - */ - invokeBusy(busy: boolean): void; - - /** - * - */ - isBusy(): number; - - /** - * Load the object data. - * @param {IOBJReaderOptions} [options] - */ - loadData(options?: IOBJReaderOptions): Promise; - - /** - * - * @param callback - */ - onBusy(callback: (busy: boolean) => any): vtkSubscription; - - /** - * Parse data as text. - * @param {String} content The content to parse. - */ - parseAsText(content: string): void; - - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * - * @param dataAccessHelper - */ - setDataAccessHelper(dataAccessHelper: HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper): boolean; - - /** - * String in OBJ file used to split in multiple output polydata. - * @param {Null | String} splitMode - */ - setSplitMode(splitMode: string): boolean; - - /** - * Set to true to be able to use getPointDuplicateIds() on output polydata. - * Requires splitMode to not be null. - * @param trackDuplicates true or false (false by default) - * @see getPointDuplicateIds(), setSplitMode() - */ - setTrackDuplicates(trackDuplicates: boolean): boolean; - - /** - * Set the url of the object to load. - * @param {String} url the url of the object to load. - * @param {IOBJReaderOptions} [option] The OBJ reader options. - */ - setUrl(url: string, option?: IOBJReaderOptions): Promise; + /** + * + */ + getBaseURL(): string; + + /** + * + */ + getDataAccessHelper(): + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper; + + /** + * Get the url of the object to load. + */ + getUrl(): string; + + /** + * + */ + getSplitMode(): number; + + /** + * True if duplicates are tracked in output polydata. + */ + getTrackDuplicates(): boolean; + + /** + * + * @param {Boolean} busy + */ + invokeBusy(busy: boolean): void; + + /** + * + */ + isBusy(): number; + + /** + * Load the object data. + * @param {IOBJReaderOptions} [options] + */ + loadData(options?: IOBJReaderOptions): Promise; + + /** + * + * @param callback + */ + onBusy(callback: (busy: boolean) => any): vtkSubscription; + + /** + * Parse data as text. + * @param {String} content The content to parse. + */ + parseAsText(content: string): void; + + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * + * @param dataAccessHelper + */ + setDataAccessHelper( + dataAccessHelper: + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper + ): boolean; + + /** + * String in OBJ file used to split in multiple output polydata. + * @param {Null | String} splitMode + */ + setSplitMode(splitMode: string): boolean; + + /** + * Set to true to be able to use getPointDuplicateIds() on output polydata. + * Requires splitMode to not be null. + * @param trackDuplicates true or false (false by default) + * @see getPointDuplicateIds(), setSplitMode() + */ + setTrackDuplicates(trackDuplicates: boolean): boolean; + + /** + * Set the url of the object to load. + * @param {String} url the url of the object to load. + * @param {IOBJReaderOptions} [option] The OBJ reader options. + */ + setUrl(url: string, option?: IOBJReaderOptions): Promise; } /** @@ -144,14 +158,19 @@ export interface vtkOBJReader extends vtkOBJReaderBase { * @param model object on which data structure will be bounds (protected) * @param {IOBJReaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IOBJReaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IOBJReaderInitialValues +): void; /** * Method used to create a new instance of vtkOBJReader * @param {IOBJReaderInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IOBJReaderInitialValues): vtkOBJReader; - +export function newInstance( + initialValues?: IOBJReaderInitialValues +): vtkOBJReader; /** * The vtkOBJReader aims to read a text file formatted as below and create @@ -183,7 +202,7 @@ export function newInstance(initialValues?: IOBJReaderInitialValues): vtkOBJRead * are meant to give you control on that end. */ export declare const vtkOBJReader: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkOBJReader; diff --git a/Sources/IO/Misc/PDBReader/index.d.ts b/Sources/IO/Misc/PDBReader/index.d.ts index 43828881378..bcd7d435636 100755 --- a/Sources/IO/Misc/PDBReader/index.d.ts +++ b/Sources/IO/Misc/PDBReader/index.d.ts @@ -1,106 +1,117 @@ -import { vtkAlgorithm, vtkObject, vtkSubscription } from "../../../interfaces"; -import HtmlDataAccessHelper from "../../Core/DataAccessHelper/HtmlDataAccessHelper"; -import HttpDataAccessHelper from "../../Core/DataAccessHelper/HttpDataAccessHelper"; -import JSZipDataAccessHelper from "../../Core/DataAccessHelper/JSZipDataAccessHelper"; -import LiteHttpDataAccessHelper from "../../Core/DataAccessHelper/LiteHttpDataAccessHelper"; - +import { vtkAlgorithm, vtkObject, vtkSubscription } from '../../../interfaces'; +import HtmlDataAccessHelper from '../../Core/DataAccessHelper/HtmlDataAccessHelper'; +import HttpDataAccessHelper from '../../Core/DataAccessHelper/HttpDataAccessHelper'; +import JSZipDataAccessHelper from '../../Core/DataAccessHelper/JSZipDataAccessHelper'; +import LiteHttpDataAccessHelper from '../../Core/DataAccessHelper/LiteHttpDataAccessHelper'; interface IPDBReaderOptions { - binary?: boolean; - compression?: string; - progressCallback?: any; + binary?: boolean; + compression?: string; + progressCallback?: any; } /** - * + * */ export interface IPDBReaderInitialValues { - numberOfAtoms?: number; - requestCount?: number; + numberOfAtoms?: number; + requestCount?: number; } -type vtkPDBReaderBase = vtkObject & Omit; +type vtkPDBReaderBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkPDBReader extends vtkPDBReaderBase { - - /** - * - */ - getBaseURL(): string; - - /** - * - */ - getDataAccessHelper(): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper; - - /** - * Get the url of the object to load. - */ - getUrl(): string; - - /** - * - */ - getNumberOfAtoms(): number; - - /** - * - */ - getRequestCount(): number; - - /** - * - * @param {Boolean} busy - */ - invokeBusy(busy: boolean): void; - - /** - * - */ - isBusy(): number; - - /** - * Load the object data. - * @param {IPDBReaderOptions} [options] - */ - loadData(options?: IPDBReaderOptions): Promise; - - /** - * - * @param callback - */ - onBusy(callback: (busy: boolean) => any): vtkSubscription; - - /** - * Parse data as text. - * @param {String} content The content to parse. - */ - parseAsText(content: string): void; - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * - * @param dataAccessHelper - */ - setDataAccessHelper(dataAccessHelper: HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper): boolean; - - /** - * Set the url of the object to load. - * @param {String} url the url of the object to load. - * @param {IPDBReaderOptions} [option] The PDB reader options. - */ - setUrl(url: string, option?: IPDBReaderOptions): Promise; + /** + * + */ + getBaseURL(): string; + + /** + * + */ + getDataAccessHelper(): + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper; + + /** + * Get the url of the object to load. + */ + getUrl(): string; + + /** + * + */ + getNumberOfAtoms(): number; + + /** + * + */ + getRequestCount(): number; + + /** + * + * @param {Boolean} busy + */ + invokeBusy(busy: boolean): void; + + /** + * + */ + isBusy(): number; + + /** + * Load the object data. + * @param {IPDBReaderOptions} [options] + */ + loadData(options?: IPDBReaderOptions): Promise; + + /** + * + * @param callback + */ + onBusy(callback: (busy: boolean) => any): vtkSubscription; + + /** + * Parse data as text. + * @param {String} content The content to parse. + */ + parseAsText(content: string): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * + * @param dataAccessHelper + */ + setDataAccessHelper( + dataAccessHelper: + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper + ): boolean; + + /** + * Set the url of the object to load. + * @param {String} url the url of the object to load. + * @param {IPDBReaderOptions} [option] The PDB reader options. + */ + setUrl(url: string, option?: IPDBReaderOptions): Promise; } /** @@ -110,20 +121,25 @@ export interface vtkPDBReader extends vtkPDBReaderBase { * @param model object on which data structure will be bounds (protected) * @param {IPDBReaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPDBReaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPDBReaderInitialValues +): void; /** * Method used to create a new instance of vtkPDBReader * @param {IPDBReaderInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IPDBReaderInitialValues): vtkPDBReader; - +export function newInstance( + initialValues?: IPDBReaderInitialValues +): vtkPDBReader; /** * vtkPDBReader is a source object that reads Molecule files. */ export declare const vtkPDBReader: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkPDBReader; diff --git a/Sources/IO/XML/XMLImageDataReader/index.d.ts b/Sources/IO/XML/XMLImageDataReader/index.d.ts index 92cd0469f7a..6bfcf79b510 100755 --- a/Sources/IO/XML/XMLImageDataReader/index.d.ts +++ b/Sources/IO/XML/XMLImageDataReader/index.d.ts @@ -1,23 +1,29 @@ -import vtkXMLReader, { IXMLReaderInitialValues } from "../XMLReader"; +import vtkXMLReader, { IXMLReaderInitialValues } from '../XMLReader'; /** - * + * */ -export interface IXMLImageDataReaderInitialValues extends IXMLReaderInitialValues { - dataType?: string; +export interface IXMLImageDataReaderInitialValues + extends IXMLReaderInitialValues { + dataType?: string; } export interface vtkXMLImageDataReader extends vtkXMLReader { - - /** - * Parse data as XML. - * @param rootElem - * @param type - * @param {String} compressor - * @param {String} byteOrder - * @param {String} headerType - */ - parseXML(rootElem: any, type: any, compressor: string, byteOrder: string, headerType: string): void; + /** + * Parse data as XML. + * @param rootElem + * @param type + * @param {String} compressor + * @param {String} byteOrder + * @param {String} headerType + */ + parseXML( + rootElem: any, + type: any, + compressor: string, + byteOrder: string, + headerType: string + ): void; } /** @@ -27,19 +33,25 @@ export interface vtkXMLImageDataReader extends vtkXMLReader { * @param model object on which data structure will be bounds (protected) * @param {IXMLImageDataReaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IXMLImageDataReaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IXMLImageDataReaderInitialValues +): void; /** * Method used to create a new instance of vtkPLYReader * @param {IXMLImageDataReaderInitialValues} [initialValues] for pre-setting some of its content */ - export function newInstance(initialValues?: IXMLImageDataReaderInitialValues): vtkXMLImageDataReader; +export function newInstance( + initialValues?: IXMLImageDataReaderInitialValues +): vtkXMLImageDataReader; /** - * vtkXMLImageDataReader is a source object that parses a VTK XML input file. + * vtkXMLImageDataReader is a source object that parses a VTK XML input file. */ export declare const vtkXMLImageDataReader: { - extend: typeof extend; - newInstance: typeof newInstance; -} + extend: typeof extend; + newInstance: typeof newInstance; +}; export default vtkXMLImageDataReader; diff --git a/Sources/IO/XML/XMLPolyDataReader/index.d.ts b/Sources/IO/XML/XMLPolyDataReader/index.d.ts index 56850d37963..491602e9921 100755 --- a/Sources/IO/XML/XMLPolyDataReader/index.d.ts +++ b/Sources/IO/XML/XMLPolyDataReader/index.d.ts @@ -1,23 +1,29 @@ -import vtkXMLReader, { IXMLReaderInitialValues } from "../XMLReader"; +import vtkXMLReader, { IXMLReaderInitialValues } from '../XMLReader'; /** - * + * */ -export interface IXMLPolyDataReaderInitialValues extends IXMLReaderInitialValues{ - dataType?: string; +export interface IXMLPolyDataReaderInitialValues + extends IXMLReaderInitialValues { + dataType?: string; } export interface vtkXMLPolyDataReader extends vtkXMLReader { - - /** - * Parse data as XML. - * @param rootElem - * @param type - * @param {String} compressor - * @param {String} byteOrder - * @param {String} headerType - */ - parseXML(rootElem: any, type: any, compressor: string, byteOrder: string, headerType: string): void; + /** + * Parse data as XML. + * @param rootElem + * @param type + * @param {String} compressor + * @param {String} byteOrder + * @param {String} headerType + */ + parseXML( + rootElem: any, + type: any, + compressor: string, + byteOrder: string, + headerType: string + ): void; } /** @@ -27,19 +33,25 @@ export interface vtkXMLPolyDataReader extends vtkXMLReader { * @param model object on which data structure will be bounds (protected) * @param {IXMLPolyDataReaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IXMLPolyDataReaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IXMLPolyDataReaderInitialValues +): void; /** * Method used to create a new instance of vtkPLYReader * @param {IXMLPolyDataReaderInitialValues} [initialValues] for pre-setting some of its content */ - export function newInstance(initialValues?: IXMLPolyDataReaderInitialValues): vtkXMLPolyDataReader; +export function newInstance( + initialValues?: IXMLPolyDataReaderInitialValues +): vtkXMLPolyDataReader; /** - * vtkXMLPolyDataReader is a source object that parses a VTK XML input file. + * vtkXMLPolyDataReader is a source object that parses a VTK XML input file. */ export declare const vtkXMLPolyDataReader: { - extend: typeof extend; - newInstance: typeof newInstance; -} + extend: typeof extend; + newInstance: typeof newInstance; +}; export default vtkXMLPolyDataReader; diff --git a/Sources/IO/XML/XMLReader/index.d.ts b/Sources/IO/XML/XMLReader/index.d.ts index 1b6c4b08fb4..1839990c7d7 100755 --- a/Sources/IO/XML/XMLReader/index.d.ts +++ b/Sources/IO/XML/XMLReader/index.d.ts @@ -1,94 +1,105 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import HtmlDataAccessHelper from "../../Core/DataAccessHelper/HtmlDataAccessHelper"; -import HttpDataAccessHelper from "../../Core/DataAccessHelper/HttpDataAccessHelper"; -import JSZipDataAccessHelper from "../../Core/DataAccessHelper/JSZipDataAccessHelper"; -import LiteHttpDataAccessHelper from "../../Core/DataAccessHelper/LiteHttpDataAccessHelper"; - +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import HtmlDataAccessHelper from '../../Core/DataAccessHelper/HtmlDataAccessHelper'; +import HttpDataAccessHelper from '../../Core/DataAccessHelper/HttpDataAccessHelper'; +import JSZipDataAccessHelper from '../../Core/DataAccessHelper/JSZipDataAccessHelper'; +import LiteHttpDataAccessHelper from '../../Core/DataAccessHelper/LiteHttpDataAccessHelper'; interface IXMLReaderOptions { - binary?: boolean; - compression?: string; - progressCallback?: any; + binary?: boolean; + compression?: string; + progressCallback?: any; } interface IRet { - name: string; - numberOfComponents: number; - values: any; + name: string; + numberOfComponents: number; + values: any; } /** - * + * */ -export interface IXMLReaderInitialValues { } - -type vtkXMLReaderBase = vtkObject & Omit; +export interface IXMLReaderInitialValues {} + +type vtkXMLReaderBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkXMLReader extends vtkXMLReaderBase { - - /** - * - */ - getBaseURL(): string; - - /** - * - */ - getDataAccessHelper(): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper; - - /** - * Get the url of the object to load. - */ - getUrl(): string; - - /** - * Load the object data. - * @param {IXMLReaderOptions} [options] - */ - loadData(options?: IXMLReaderOptions): Promise; - - /** - * Parse data. - * @param {String | ArrayBuffer} content The content to parse. - */ - parse(content: string | ArrayBuffer): void; - - /** - * Parse data as ArrayBuffer. - * @param {ArrayBuffer} content The content to parse. - */ - parseAsArrayBuffer(content: ArrayBuffer): void; - - /** - * Parse data as text. - * @param {String} content The content to parse. - */ - parseAsText(content: string): void; - /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; - - /** - * - * @param dataAccessHelper - */ - setDataAccessHelper(dataAccessHelper: HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper): boolean; - - /** - * Set the url of the object to load. - * @param {String} url the url of the object to load. - * @param {IXMLReaderOptions} [option] The XML reader options. - */ - setUrl(url: string, option?: IXMLReaderOptions): Promise; + /** + * + */ + getBaseURL(): string; + + /** + * + */ + getDataAccessHelper(): + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper; + + /** + * Get the url of the object to load. + */ + getUrl(): string; + + /** + * Load the object data. + * @param {IXMLReaderOptions} [options] + */ + loadData(options?: IXMLReaderOptions): Promise; + + /** + * Parse data. + * @param {String | ArrayBuffer} content The content to parse. + */ + parse(content: string | ArrayBuffer): void; + + /** + * Parse data as ArrayBuffer. + * @param {ArrayBuffer} content The content to parse. + */ + parseAsArrayBuffer(content: ArrayBuffer): void; + + /** + * Parse data as text. + * @param {String} content The content to parse. + */ + parseAsText(content: string): void; + /** + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; + + /** + * + * @param dataAccessHelper + */ + setDataAccessHelper( + dataAccessHelper: + | HtmlDataAccessHelper + | HttpDataAccessHelper + | JSZipDataAccessHelper + | LiteHttpDataAccessHelper + ): boolean; + + /** + * Set the url of the object to load. + * @param {String} url the url of the object to load. + * @param {IXMLReaderOptions} [option] The XML reader options. + */ + setUrl(url: string, option?: IXMLReaderOptions): Promise; } /** @@ -98,47 +109,72 @@ export interface vtkXMLReader extends vtkXMLReaderBase { * @param model object on which data structure will be bounds (protected) * @param {IXMLReaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IXMLReaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IXMLReaderInitialValues +): void; /** - * @param {Number} size - * @param {HTMLElement} dataArrayElem - * @param {String} compressor - * @param {String} byteOrder - * @param {String} headerType - * @param {ArrayBuffer} binaryBuffer + * @param {Number} size + * @param {HTMLElement} dataArrayElem + * @param {String} compressor + * @param {String} byteOrder + * @param {String} headerType + * @param {ArrayBuffer} binaryBuffer */ -export function processDataArray(size: number, dataArrayElem: HTMLElement, compressor: string, byteOrder: string, headerType: string, binaryBuffer: ArrayBuffer): IRet; +export function processDataArray( + size: number, + dataArrayElem: HTMLElement, + compressor: string, + byteOrder: string, + headerType: string, + binaryBuffer: ArrayBuffer +): IRet; /** - * @param {Number} size - * @param {HTMLElement} containerElem - * @param {String} compressor - * @param {String} byteOrder - * @param {String} headerType - * @param {ArrayBuffer} binaryBuffer + * @param {Number} size + * @param {HTMLElement} containerElem + * @param {String} compressor + * @param {String} byteOrder + * @param {String} headerType + * @param {ArrayBuffer} binaryBuffer */ -export function processCells(size: number, containerElem: HTMLElement, compressor: string, byteOrder: string, headerType: string, binaryBuffer: ArrayBuffer): Uint32Array; +export function processCells( + size: number, + containerElem: HTMLElement, + compressor: string, + byteOrder: string, + headerType: string, + binaryBuffer: ArrayBuffer +): Uint32Array; /** - * @param {Number} size - * @param {HTMLElement} fieldElem - * @param {HTMLElement} fieldContainer - * @param {String} compressor - * @param {String} byteOrder - * @param {String} headerType - * @param {ArrayBuffer} binaryBuffer + * @param {Number} size + * @param {HTMLElement} fieldElem + * @param {HTMLElement} fieldContainer + * @param {String} compressor + * @param {String} byteOrder + * @param {String} headerType + * @param {ArrayBuffer} binaryBuffer */ -export function processFieldData(size: number, fieldElem: HTMLElement, fieldContainer: HTMLElement, compressor: string, byteOrder: string, headerType: string, binaryBuffer: ArrayBuffer): void; - +export function processFieldData( + size: number, + fieldElem: HTMLElement, + fieldContainer: HTMLElement, + compressor: string, + byteOrder: string, + headerType: string, + binaryBuffer: ArrayBuffer +): void; /** - * vtkXMLReader is a source object that parses a VTK XML input file. + * vtkXMLReader is a source object that parses a VTK XML input file. */ export declare const vtkXMLReader: { - extend: typeof extend; - processDataArray: typeof processDataArray; - processCells: typeof processCells; - processFieldData: typeof processFieldData; -} + extend: typeof extend; + processDataArray: typeof processDataArray; + processCells: typeof processCells; + processFieldData: typeof processFieldData; +}; export default vtkXMLReader; diff --git a/Sources/Imaging/Core/AbstractImageInterpolator/Constants.d.ts b/Sources/Imaging/Core/AbstractImageInterpolator/Constants.d.ts index e9e1eb63c7e..75548b8f9a6 100644 --- a/Sources/Imaging/Core/AbstractImageInterpolator/Constants.d.ts +++ b/Sources/Imaging/Core/AbstractImageInterpolator/Constants.d.ts @@ -11,8 +11,8 @@ export declare enum InterpolationMode { } declare const _default: { - ImageBorderMode: typeof ImageBorderMode; - InterpolationMode: typeof InterpolationMode; + ImageBorderMode: typeof ImageBorderMode; + InterpolationMode: typeof InterpolationMode; }; export default _default; diff --git a/Sources/Imaging/Core/ImageReslice/index.d.ts b/Sources/Imaging/Core/ImageReslice/index.d.ts index b81105f864e..d1226d4ec21 100644 --- a/Sources/Imaging/Core/ImageReslice/index.d.ts +++ b/Sources/Imaging/Core/ImageReslice/index.d.ts @@ -1,57 +1,63 @@ -import { Bounds, Extent, Nullable, RGBAColor, TypedArray } from "../../../types"; -import { InterpolationMode } from "../AbstractImageInterpolator/Constants"; -import { SlabMode } from "./Constants"; -import { vtkAlgorithm, vtkObject, vtkRange } from "../../../interfaces"; -import vtkImageData from "../../../Common/DataModel/ImageData"; -import vtkTransform from "../../../Common/Transform/Transform"; +import { + Bounds, + Extent, + Nullable, + RGBAColor, + TypedArray, +} from '../../../types'; +import { InterpolationMode } from '../AbstractImageInterpolator/Constants'; +import { SlabMode } from './Constants'; +import { vtkAlgorithm, vtkObject, vtkRange } from '../../../interfaces'; +import vtkImageData from '../../../Common/DataModel/ImageData'; +import vtkTransform from '../../../Common/Transform/Transform'; import { mat3, mat4, vec3, vec4 } from 'gl-matrix'; /** - * + * */ export interface IImageResliceInitialValues { - transformInputSampling: boolean, - autoCropOutput: boolean, - outputDimensionality: number, - outputSpacing: Nullable, // automatically computed if null - outputOrigin: Nullable, // automatically computed if null - outputDirection: Nullable, // identity if null - outputExtent: Nullable, // automatically computed if null - outputScalarType: Nullable, - wrap: boolean, // don't wrap - mirror: boolean, // don't mirror - border: boolean, // apply a border - interpolationMode: InterpolationMode, // only NEAREST supported so far - slabMode: SlabMode, - slabTrapezoidIntegration: boolean, - slabNumberOfSlices: number, - slabSliceSpacingFraction: number, - optimization: boolean, // not supported yet - scalarShift: number, // for rescaling the data - scalarScale: number, - backgroundColor: RGBAColor, - resliceAxes: Nullable, - resliceTransform?: vtkTransform, - interpolator: any, // A vtkImageInterpolator (missing typescript header) - usePermuteExecute: boolean, // no supported yet + transformInputSampling: boolean; + autoCropOutput: boolean; + outputDimensionality: number; + outputSpacing: Nullable; // automatically computed if null + outputOrigin: Nullable; // automatically computed if null + outputDirection: Nullable; // identity if null + outputExtent: Nullable; // automatically computed if null + outputScalarType: Nullable; + wrap: boolean; // don't wrap + mirror: boolean; // don't mirror + border: boolean; // apply a border + interpolationMode: InterpolationMode; // only NEAREST supported so far + slabMode: SlabMode; + slabTrapezoidIntegration: boolean; + slabNumberOfSlices: number; + slabSliceSpacingFraction: number; + optimization: boolean; // not supported yet + scalarShift: number; // for rescaling the data + scalarScale: number; + backgroundColor: RGBAColor; + resliceAxes: Nullable; + resliceTransform?: vtkTransform; + interpolator: any; // A vtkImageInterpolator (missing typescript header) + usePermuteExecute: boolean; // no supported yet } type vtkImageResliceBase = Omit & vtkAlgorithm; export interface vtkImageReslice extends vtkImageResliceBase { /** - * - * @param inData - * @param outData - */ - requestData(inData: any, outData: any): void; + * + * @param inData + * @param outData + */ + requestData(inData: any, outData: any): void; /** * Main filter logic - * @param input - * @param output - * @returns + * @param input + * @param output + * @returns */ vtkImageResliceExecute: (input: vtkImageData, output: vtkImageData) => void; @@ -72,137 +78,184 @@ export interface vtkImageReslice extends vtkImageResliceBase { /** * Compute the bounds required to ensure that none of the data will be cropped - * @param input - * @returns + * @param input + * @returns */ getAutoCroppedOutputBounds: (input: vtkImageData) => Bounds; /** * The min and max of each data type * Defaults to a range of 0 to 255 - * @param dataType - * @returns + * @param dataType + * @returns */ getDataTypeMinMax: (dataType: string) => vtkRange; /** * Internal function uses vtkInterpolationMathClamp on `numscalars * n` elements - * @param outPtr - * @param inPtr - * @param numscalars - * @param n - * @param min - * @param max + * @param outPtr + * @param inPtr + * @param numscalars + * @param n + * @param min + * @param max * @returns The number of elements processed */ - clamp: (outPtr: TypedArray, inPtr: TypedArray, numscalars: number, n: number, min: number, max: number) => number; + clamp: ( + outPtr: TypedArray, + inPtr: TypedArray, + numscalars: number, + n: number, + min: number, + max: number + ) => number; /** * Internal function uses Math.round on `numscalars * n` elements - * @param outPtr - * @param inPtr - * @param numscalars - * @param n + * @param outPtr + * @param inPtr + * @param numscalars + * @param n * @returns The number of elements processed */ - convert: (outPtr: TypedArray, inPtr: TypedArray, numscalars: number, n: number) => number; + convert: ( + outPtr: TypedArray, + inPtr: TypedArray, + numscalars: number, + n: number + ) => number; /** * Setup the conversion function and return the right one - * @param inputType - * @param dataType - * @param scalarShift - * @param scalarScale - * @param forceClamping + * @param inputType + * @param dataType + * @param scalarShift + * @param scalarScale + * @param forceClamping * @returns publicAPI.convert or publicAPI.clamp */ - getConversionFunc: (inputType: string, dataType: string, scalarShift: number, scalarScale: number, forceClamping: boolean) => (this["convert"] & this["clamp"]); + getConversionFunc: ( + inputType: string, + dataType: string, + scalarShift: number, + scalarScale: number, + forceClamping: boolean + ) => this['convert'] & this['clamp']; /** * Copy the `numscalars * n` first elements from an array to another - * @param outPtr - * @param inPtr - * @param numscalars - * @param n + * @param outPtr + * @param inPtr + * @param numscalars + * @param n * @returns The number of copied elements */ - set: (outPtr: TypedArray, inPtr: TypedArray, numscalars: number, n: number) => number; + set: ( + outPtr: TypedArray, + inPtr: TypedArray, + numscalars: number, + n: number + ) => number; /** * Fill the `n` first elements of the output array with the very first element of the input array - * @param outPtr - * @param inPtr - * @param numscalars - * @param n + * @param outPtr + * @param inPtr + * @param numscalars + * @param n * @returns The number of elements set in the output array */ - set1: (outPtr: TypedArray, inPtr: TypedArray, numscalars: number, n: number) => number; + set1: ( + outPtr: TypedArray, + inPtr: TypedArray, + numscalars: number, + n: number + ) => number; /** * Returns the right function used to copy the pixels - * @param dataType - * @param dataSize - * @param numscalars - * @param dataPtr + * @param dataType + * @param dataSize + * @param numscalars + * @param dataPtr * @returns publicAPI.set or publicAPI.set1 */ - getSetPixelsFunc: (dataType: any, dataSize: any, numscalars: number, dataPtr: any) => (this["set"] & this["set1"]); + getSetPixelsFunc: ( + dataType: any, + dataSize: any, + numscalars: number, + dataPtr: any + ) => this['set'] & this['set1']; /** * Returns the right composition function - * @param slabMode - * @param slabTrapezoidIntegration - * @returns + * @param slabMode + * @param slabTrapezoidIntegration + * @returns */ - getCompositeFunc: (slabMode: SlabMode, slabTrapezoidIntegration: boolean) => ((tmpPtr: TypedArray, inComponents: number, sampleCount: number) => void); + getCompositeFunc: ( + slabMode: SlabMode, + slabTrapezoidIntegration: boolean + ) => (tmpPtr: TypedArray, inComponents: number, sampleCount: number) => void; /** * Apply `newTrans`, then translate by `-origin`, then scale by `inInvSpacing` - * @param newTrans - * @param inPoint - * @param inOrigin - * @param inInvSpacing - * @returns + * @param newTrans + * @param inPoint + * @param inOrigin + * @param inInvSpacing + * @returns */ - applyTransform: (newTrans: mat4, inPoint: vec4, inOrigin: vec3, inInvSpacing: vec3) => void; + applyTransform: ( + newTrans: mat4, + inPoint: vec4, + inOrigin: vec3, + inInvSpacing: vec3 + ) => void; /** - * - * @param floatData - * @param components - * @param n - * @param scalarShift - * @param scalarScale - * @returns + * + * @param floatData + * @param components + * @param n + * @param scalarShift + * @param scalarScale + * @returns */ - rescaleScalars: (floatData: TypedArray, components: number, n: number, scalarShift: number, scalarScale: number) => void; + rescaleScalars: ( + floatData: TypedArray, + components: number, + n: number, + scalarShift: number, + scalarScale: number + ) => void; /** * A permutation matrix is the identity matrix with the colomn (or rows) shuffled - * @param matrix - * @returns + * @param matrix + * @returns */ isPermutationMatrix: (matrix: mat4) => boolean; /** - * - * @param matrix - * @returns + * + * @param matrix + * @returns */ isIdentityMatrix: (matrix: mat4) => boolean; /** - * - * @param matrix - * @returns + * + * @param matrix + * @returns */ isPerspectiveMatrix: (matrix: mat4) => boolean; /** - * - * @param matrix - * @param outExt - * @returns + * + * @param matrix + * @param outExt + * @returns */ canUseNearestNeighbor: (matrix: mat4, outExt: Extent) => boolean; @@ -213,28 +266,28 @@ export interface vtkImageReslice extends vtkImageResliceBase { * The default is SlabMode.MIN. If SetSlabNumberOfSlices(N) is called with N * greater than one, then each output slice will actually be a composite of N * slices. This method specifies the compositing mode to be used. - * @param slabMode - * @returns + * @param slabMode + * @returns */ setSlabMode: (slabMode: SlabMode) => boolean; /** * @see setSlabMode - * @returns + * @returns */ getSlabMode: () => SlabMode; /** * Set the number of slices that will be combined to create the slab. * Defaults to 1. - * @param numberOfSlices - * @returns + * @param numberOfSlices + * @returns */ setSlabNumberOfSlices: (slabNumberOfSlices: number) => boolean; /** * @see setSlabNumberOfSlices - * @returns + * @returns */ getSlabNumberOfSlices: () => number; @@ -244,14 +297,14 @@ export interface vtkImageReslice extends vtkImageResliceBase { * the ResliceAxes before applying them as the default output spacing, origin * and extent. * Defaults to false. - * @param transformInputSampling - * @returns + * @param transformInputSampling + * @returns */ setTransformInputSampling: (transformInputSampling: boolean) => boolean; /** * @see setTransformInputSampling - * @returns + * @returns */ getTransformInputSampling: () => boolean; @@ -259,14 +312,14 @@ export interface vtkImageReslice extends vtkImageResliceBase { * Turn this on if you want to guarantee that the extent of the output will * be large enough to ensure that none of the data will be cropped. * Defaults to false. - * @param autoCropOutput - * @returns + * @param autoCropOutput + * @returns */ setAutoCropOutput: (autoCropOutput: boolean) => boolean; /** * @see setAutoCropOutput - * @returns + * @returns */ getAutoCropOutput: () => boolean; @@ -278,14 +331,14 @@ export interface vtkImageReslice extends vtkImageResliceBase { * output extent is confined to the x axis. For 0D, the output extent * consists of a single voxel at (0,0,0). * Defaults to 3. - * @param outputDimensionality - * @returns + * @param outputDimensionality + * @returns */ setOutputDimensionality: (outputDimensionality: number) => boolean; /** * @see setOutputDimensionality - * @returns + * @returns */ getOutputDimensionality: () => number; @@ -294,14 +347,14 @@ export interface vtkImageReslice extends vtkImageResliceBase { * The default output spacing is the input spacing permuted through the * ResliceAxes. * Defaults to null (automatically computed). - * @param outputSpacing - * @returns + * @param outputSpacing + * @returns */ setOutputSpacing: (outputSpacing: vec3 | null) => boolean; /** * @see setOutputSpacing - * @returns + * @returns */ getOutputSpacing: () => vec3 | null; @@ -310,14 +363,14 @@ export interface vtkImageReslice extends vtkImageResliceBase { * The default output origin is the input origin permuted through the * ResliceAxes. * Defaults to null (automatically computed). - * @param outputOrigin - * @returns + * @param outputOrigin + * @returns */ setOutputOrigin: (outputOrigin: vec3 | null) => boolean; /** * @see setOutputOrigin - * @returns + * @returns */ getOutputOrigin: () => vec3 | null; @@ -326,14 +379,14 @@ export interface vtkImageReslice extends vtkImageResliceBase { * The default output extent is the input extent permuted through the * ResliceAxes. * Defaults to null (automatically computed). - * @param outputExtent - * @returns + * @param outputExtent + * @returns */ setOutputExtent: (outputExtent: Extent | null) => boolean; /** * @see setOutputExtent - * @returns + * @returns */ getOutputExtent: () => Extent | null; @@ -346,28 +399,28 @@ export interface vtkImageReslice extends vtkImageResliceBase { * changes the orientation of the sampling grid while maintaining the same * physical coordinate system. * Defaults to null (automatically computed). - * @param outputDirection - * @returns + * @param outputDirection + * @returns */ setOutputDirection: (outputDirection: mat3 | null) => boolean; /** * @see setOutputDirection - * @returns + * @returns */ getOutputDirection: () => mat3 | null; /** * Set the background color (for multi-component images). * Defaults to full opaque black. - * @param backgroundColor - * @returns + * @param backgroundColor + * @returns */ setBackgroundColor: (backgroundColor: RGBAColor) => boolean; /** * @see setBackgroundColor - * @returns + * @returns */ getBackgroundColor: () => RGBAColor; @@ -382,14 +435,14 @@ export interface vtkImageReslice extends vtkImageResliceBase { * column specifies the y-axis, and the third column the * z-axis. The fourth column is the origin of the * axes (the fourth element must be set to one). - * @param resliceAxes - * @returns + * @param resliceAxes + * @returns */ setResliceAxes: (resliceAxes: mat4) => boolean; /** * @see setResliceAxes - * @returns + * @returns */ getResliceAxes: () => mat4; @@ -403,17 +456,17 @@ export interface vtkImageReslice extends vtkImageResliceBase { * VtkDataTypes.DOUBLE. Other types are not permitted. If the output type * is an integer type, the output will be rounded and clamped to the limits of * the type. - * + * * See the documentation for [vtkDataArray::getDataType()](../api/Common_Core_DataArray.html#getDataType-String) for additional data type settings. * Defaults to null (automatically computed). - * @param outputScalarType - * @returns + * @param outputScalarType + * @returns */ setOutputScalarType: (outputScalarType: string | null) => boolean; /** * @see setOutputScalarType - * @returns + * @returns */ getOutputScalarType: () => string | null; @@ -424,14 +477,14 @@ export interface vtkImageReslice extends vtkImageResliceBase { * it is written to the output image. The result will always be clamped to * the limits of the output data type. * Defaults to 0. - * @param scalarShift - * @returns + * @param scalarShift + * @returns */ setScalarShift: (scalarShift: number) => boolean; /** * @see setScalarShift - * @returns + * @returns */ getScalarShift: () => number; @@ -442,42 +495,42 @@ export interface vtkImageReslice extends vtkImageResliceBase { * it is written to the output image. The result will always be clamped to * the limits of the output data type. * Defaults to 1. - * @param scalarScale - * @returns + * @param scalarScale + * @returns */ setScalarScale: (scalarScale: number) => boolean; /** * @see setScalarScale - * @returns + * @returns */ getScalarScale: () => number; /** * Turn on wrap-pad feature. * Defaults to false. - * @param wrap - * @returns + * @param wrap + * @returns */ setWrap: (wrap: boolean) => boolean; /** * @see setWrap - * @returns + * @returns */ getWrap: () => boolean; /** * Turn on mirror-pad feature. This will override the wrap-pad. * Defaults to false. - * @param mirror - * @returns + * @param mirror + * @returns */ setMirror: (mirror: boolean) => boolean; /** * @see setMirror - * @returns + * @returns */ getMirror: () => boolean; @@ -491,29 +544,29 @@ export interface vtkImageReslice extends vtkImageResliceBase { * the edges of the input. * This has no effect if Mirror or Wrap are on. * Defaults to true. - * @param border - * @returns + * @param border + * @returns */ setBorder: (border: boolean) => boolean; /** * @see setBorder - * @returns + * @returns */ getBorder: () => boolean; /** - * Set interpolation mode. + * Set interpolation mode. * Only nearest neighbor is supported at the moment. * Defaults to nearest neighbor. - * @param interpolationMode - * @returns + * @param interpolationMode + * @returns */ setInterpolationMode: (interpolationMode: InterpolationMode) => boolean; /** * @see setInterpolationMode - * @returns + * @returns */ getInterpolationMode: () => InterpolationMode; @@ -525,14 +578,14 @@ export interface vtkImageReslice extends vtkImageResliceBase { * that transform to the input volume. Nonlinear transforms such as * vtkGridTransform and vtkThinPlateSplineTransform can be used here. * Defaults to undefined. - * @param resliceTransform - * @returns + * @param resliceTransform + * @returns */ setResliceTransform: (resliceTransform: vtkTransform | undefined) => boolean; /** * @see setResliceTransform - * @returns + * @returns */ getResliceTransform: () => vtkTransform | undefined; @@ -541,14 +594,14 @@ export interface vtkImageReslice extends vtkImageResliceBase { * All this does is weigh the first and last slices by half when doing sum * and mean. It is off by default. * Defaults to false. - * @param slabTrapezoidIntegration - * @returns + * @param slabTrapezoidIntegration + * @returns */ setSlabTrapezoidIntegration: (slabTrapezoidIntegration: boolean) => boolean; /** * @see setSlabTrapezoidIntegration - * @returns + * @returns */ getSlabTrapezoidIntegration: () => boolean; @@ -561,14 +614,14 @@ export interface vtkImageReslice extends vtkImageResliceBase { * method sets the spacing between these temporary slices to be a fraction of * the output spacing. * Defaults to 1. - * @param slabSliceSpacingFraction - * @returns + * @param slabSliceSpacingFraction + * @returns */ setSlabSliceSpacingFraction: (slabSliceSpacingFraction: number) => boolean; /** * @see setSlabSliceSpacingFraction - * @returns + * @returns */ getSlabSliceSpacingFraction: () => number; } @@ -580,18 +633,23 @@ export interface vtkImageReslice extends vtkImageResliceBase { * @param model object on which data structure will be bounds (protected) * @param {IImageResliceInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IImageResliceInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IImageResliceInitialValues +): void; /** * Method used to create a new instance of vtkImageReslice * @param {IImageResliceInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IImageResliceInitialValues): vtkImageReslice; - +export function newInstance( + initialValues?: IImageResliceInitialValues +): vtkImageReslice; /** * vtkImageReslice - Reslices a volume along a new set of axes - * + * * vtkImageReslice is the swiss-army-knife of image geometry filters: * It can permute, rotate, flip, scale, resample, deform, and pad image * data in any combination with reasonably high efficiency. Simple @@ -610,7 +668,7 @@ export function newInstance(initialValues?: IImageResliceInitialValues): vtkImag * volume that you have applied a transformation to. * */ export declare const vtkImageReslice: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkImageReslice; diff --git a/Sources/Interaction/Style/InteractorStyleHMDXR/index.d.ts b/Sources/Interaction/Style/InteractorStyleHMDXR/index.d.ts index 6605756b5ad..06e7a952770 100644 --- a/Sources/Interaction/Style/InteractorStyleHMDXR/index.d.ts +++ b/Sources/Interaction/Style/InteractorStyleHMDXR/index.d.ts @@ -1,8 +1,12 @@ -import vtkInteractorStyleManipulator, { IInteractorStyleManipulatorInitialValues } from '../../../Interaction/Style/InteractorStyleManipulator'; +import vtkInteractorStyleManipulator, { + IInteractorStyleManipulatorInitialValues, +} from '../../../Interaction/Style/InteractorStyleManipulator'; -export interface vtkInteractorStyleHMDXR extends vtkInteractorStyleManipulator {} +export interface vtkInteractorStyleHMDXR + extends vtkInteractorStyleManipulator {} -export interface IInteractorStyleHMDXRInitialValues extends IInteractorStyleManipulatorInitialValues {} +export interface IInteractorStyleHMDXRInitialValues + extends IInteractorStyleManipulatorInitialValues {} export function newInstance( initialValues?: IInteractorStyleHMDXRInitialValues diff --git a/Sources/Interaction/Style/InteractorStyleImage/index.d.ts b/Sources/Interaction/Style/InteractorStyleImage/index.d.ts index 107ccd6b3b1..53de3eb20a2 100644 --- a/Sources/Interaction/Style/InteractorStyleImage/index.d.ts +++ b/Sources/Interaction/Style/InteractorStyleImage/index.d.ts @@ -3,7 +3,8 @@ import vtkRenderer from '../../../Rendering/Core/Renderer'; import vtkImageProperty from '../../../Rendering/Core/ImageProperty'; import vtkInteractorStyleTrackballCamera from '../../../Interaction/Style/InteractorStyleTrackballCamera'; -export interface vtkInteractorStyleImage extends vtkInteractorStyleTrackballCamera { +export interface vtkInteractorStyleImage + extends vtkInteractorStyleTrackballCamera { /** * Handles a mouse move. * @param callData event data @@ -45,18 +46,18 @@ export interface vtkInteractorStyleImage extends vtkInteractorStyleTrackballCame * @param renderer the renderer * @param position the display position */ - windowLevel(renderer: vtkRenderer, position: { x: number, y: number }): void; + windowLevel(renderer: vtkRenderer, position: { x: number; y: number }): void; /** * Set slice from position. * @param renderer the renderer * @param position the display position */ - slice(renderer: vtkRenderer, position: { x: number, y: number }): void; + slice(renderer: vtkRenderer, position: { x: number; y: number }): void; /** * Sets the current image property. - * + * * This is a way of dealing with images as if they were layers. * It looks through the renderer's list of props and sets the * interactor ivars from the Nth image that it finds. You can diff --git a/Sources/Interaction/Style/InteractorStyleTrackballCamera/index.d.ts b/Sources/Interaction/Style/InteractorStyleTrackballCamera/index.d.ts index 15fac55c0f8..0ab371364c1 100644 --- a/Sources/Interaction/Style/InteractorStyleTrackballCamera/index.d.ts +++ b/Sources/Interaction/Style/InteractorStyleTrackballCamera/index.d.ts @@ -109,28 +109,40 @@ export interface vtkInteractorStyleTrackballCamera extends vtkInteractorStyle { * @param renderer the renderer * @param position the display position */ - handleMouseRotate(renderer: vtkRenderer, position: { x: number, y: number }): void; + handleMouseRotate( + renderer: vtkRenderer, + position: { x: number; y: number } + ): void; /** * Handles spin with a mouse. * @param renderer the renderer * @param position the display position */ - handleMouseSpin(renderer: vtkRenderer, position: { x: number, y: number }): void; + handleMouseSpin( + renderer: vtkRenderer, + position: { x: number; y: number } + ): void; /** * Handles pan with a mouse. * @param renderer the renderer * @param position the display position */ - handleMousePan(renderer: vtkRenderer, position: { x: number, y: number }): void; + handleMousePan( + renderer: vtkRenderer, + position: { x: number; y: number } + ): void; /** * Handles dolly with a mouse. * @param renderer the renderer * @param position the display position */ - handleMouseDolly(renderer: vtkRenderer, position: { x: number, y: number }): void; + handleMouseDolly( + renderer: vtkRenderer, + position: { x: number; y: number } + ): void; /** * Handles a wheel event. @@ -155,7 +167,6 @@ export function newInstance( initialValues?: IInteractorStyleTrackballCameraInitialValues ): vtkInteractorStyleTrackballCamera; - export function extend( publicAPI: object, model: object, @@ -165,6 +176,6 @@ export function extend( export const vtkInteractorStyleTrackballCamera: { newInstance: typeof newInstance; extend: typeof extend; -} +}; export default vtkInteractorStyleTrackballCamera; diff --git a/Sources/Interaction/Widgets/OrientationMarkerWidget/Constants.d.ts b/Sources/Interaction/Widgets/OrientationMarkerWidget/Constants.d.ts index d253844d8cb..84843fea39f 100644 --- a/Sources/Interaction/Widgets/OrientationMarkerWidget/Constants.d.ts +++ b/Sources/Interaction/Widgets/OrientationMarkerWidget/Constants.d.ts @@ -1,11 +1,11 @@ export declare enum Corners { - TOP_LEFT = 'TOP_LEFT', - TOP_RIGHT = 'TOP_RIGHT', - BOTTOM_LEFT = 'BOTTOM_LEFT', - BOTTOM_RIGHT = 'BOTTOM_RIGHT', + TOP_LEFT = 'TOP_LEFT', + TOP_RIGHT = 'TOP_RIGHT', + BOTTOM_LEFT = 'BOTTOM_LEFT', + BOTTOM_RIGHT = 'BOTTOM_RIGHT', } declare const _default: { - Corners: typeof Corners; + Corners: typeof Corners; }; export default _default; diff --git a/Sources/Interaction/Widgets/OrientationMarkerWidget/index.d.ts b/Sources/Interaction/Widgets/OrientationMarkerWidget/index.d.ts index c28fe6e0125..7d4658de653 100644 --- a/Sources/Interaction/Widgets/OrientationMarkerWidget/index.d.ts +++ b/Sources/Interaction/Widgets/OrientationMarkerWidget/index.d.ts @@ -1,152 +1,150 @@ -import { vtkObject } from "../../../interfaces"; -import vtkActor from "../../../Rendering/Core/Actor"; -import vtkRenderer from "../../../Rendering/Core/Renderer"; -import vtkRenderWindowInteractor from "../../../Rendering/Core/RenderWindowInteractor"; -import { Nullable } from "../../../types"; -import { Corners } from "./Constants"; - +import { vtkObject } from '../../../interfaces'; +import vtkActor from '../../../Rendering/Core/Actor'; +import vtkRenderer from '../../../Rendering/Core/Renderer'; +import vtkRenderWindowInteractor from '../../../Rendering/Core/RenderWindowInteractor'; +import { Nullable } from '../../../types'; +import { Corners } from './Constants'; /** - * + * */ export interface IOrientationMarkerWidgetInitialValues { - actor?: vtkActor, - interactor?: vtkRenderWindowInteractor, - parentRenderer?: vtkRenderer, - viewportCorner?: Corners, - viewportSize?: number, - minPixelSize?: number, - maxPixelSize?: number + actor?: vtkActor; + interactor?: vtkRenderWindowInteractor; + parentRenderer?: vtkRenderer; + viewportCorner?: Corners; + viewportSize?: number; + minPixelSize?: number; + maxPixelSize?: number; } export interface vtkOrientationMarkerWidget extends vtkObject { - - /** - * Get the computed viewport size. - * The format is `[left, bottom, right, top]`. - */ - computeViewport(): [number, number, number, number]; - - /** - * Dereference any internal object and remove any subscription. - * It gives custom class to properly detach themselves from the DOM - * or any external dependency that could prevent their deletion - * when the GC runs. - */ - delete(): void; - - /** - * - */ - getActor(): vtkActor; - - /** - * Gets the parent renderer, if any. - */ - getParentRenderer(): Nullable; - - /** - * Get wheter the orientation marker is enabled. - */ - getEnabled(): boolean; - - /** - * Get the render window interactor associated with the widget. - */ - getInteractor(): vtkRenderWindowInteractor; - - /** - * Get the maximum side length, in pixels, for the orientation marker widget - * viewport. - */ - getMaxPixelSize(): number; - - /** - * Get the minimum side length, in pixels, for the orientation marker widget - * viewport. - */ - getMinPixelSize(): number; - - /** - * Get the renderer associated with the widget. - */ - getRenderer(): vtkRenderer; - - /** - * Get the viewport corner. - */ - getViewportCorner(): Corners; - - /** - * Get the viewport size. - */ - getViewportSize(): number; - - /** - * Get the actor associated with the widget. - * @param {vtkActor} actor The actor instance. - */ - setActor(actor: vtkActor): void; - - /** - * Sets the parent renderer - * @param {vtkRenderer} ren The parent renderer - */ - setParentRenderer(ren: vtkRenderer): boolean; - - /** - * Set the widget enabled status, i.e. to show the widget or not. - * @param {Boolean} enabled - */ - setEnabled(enabled: boolean): void; - - /** - * Set the render window interactor associated with the widget. - * @param {vtkRenderWindowInteractor} interactor - */ - setInteractor(interactor: vtkRenderWindowInteractor): boolean; - - /** - * Set the maximum side length, in pixels, for the orientation marker widget - * viewport. - * @param {Number} pixelSize - * @default 200 - */ - setMaxPixelSize(pixelSize: number): boolean; - - /** - * Set the minimum side length, in pixels, for the orientation marker widget - * viewport. - * @param {Number} pixelSize - * @default 50 - */ - setMinPixelSize(pixelSize: number): boolean; - - /** - * Set which corner to put the widget's viewport. - * @param {Corners} viewportCorner - * @default BOTTOM_LEFT - */ - setViewportCorner(viewportCorner: Corners): boolean; - - /** - * Set the viewport size. - * The sizeFactor should be between 0.0 and 1.0. - * It says how much of the main render window to color. - * @param {Number} sizeFactor - * @default 0.2 - */ - setViewportSize(sizeFactor: number): void; - - /** - * Manually updates the marker's orientation. - */ - updateMarkerOrientation(): void; - - /** - * Updates the orientation widget viewport size. - */ - updateViewport(): void; + /** + * Get the computed viewport size. + * The format is `[left, bottom, right, top]`. + */ + computeViewport(): [number, number, number, number]; + + /** + * Dereference any internal object and remove any subscription. + * It gives custom class to properly detach themselves from the DOM + * or any external dependency that could prevent their deletion + * when the GC runs. + */ + delete(): void; + + /** + * + */ + getActor(): vtkActor; + + /** + * Gets the parent renderer, if any. + */ + getParentRenderer(): Nullable; + + /** + * Get wheter the orientation marker is enabled. + */ + getEnabled(): boolean; + + /** + * Get the render window interactor associated with the widget. + */ + getInteractor(): vtkRenderWindowInteractor; + + /** + * Get the maximum side length, in pixels, for the orientation marker widget + * viewport. + */ + getMaxPixelSize(): number; + + /** + * Get the minimum side length, in pixels, for the orientation marker widget + * viewport. + */ + getMinPixelSize(): number; + + /** + * Get the renderer associated with the widget. + */ + getRenderer(): vtkRenderer; + + /** + * Get the viewport corner. + */ + getViewportCorner(): Corners; + + /** + * Get the viewport size. + */ + getViewportSize(): number; + + /** + * Get the actor associated with the widget. + * @param {vtkActor} actor The actor instance. + */ + setActor(actor: vtkActor): void; + + /** + * Sets the parent renderer + * @param {vtkRenderer} ren The parent renderer + */ + setParentRenderer(ren: vtkRenderer): boolean; + + /** + * Set the widget enabled status, i.e. to show the widget or not. + * @param {Boolean} enabled + */ + setEnabled(enabled: boolean): void; + + /** + * Set the render window interactor associated with the widget. + * @param {vtkRenderWindowInteractor} interactor + */ + setInteractor(interactor: vtkRenderWindowInteractor): boolean; + + /** + * Set the maximum side length, in pixels, for the orientation marker widget + * viewport. + * @param {Number} pixelSize + * @default 200 + */ + setMaxPixelSize(pixelSize: number): boolean; + + /** + * Set the minimum side length, in pixels, for the orientation marker widget + * viewport. + * @param {Number} pixelSize + * @default 50 + */ + setMinPixelSize(pixelSize: number): boolean; + + /** + * Set which corner to put the widget's viewport. + * @param {Corners} viewportCorner + * @default BOTTOM_LEFT + */ + setViewportCorner(viewportCorner: Corners): boolean; + + /** + * Set the viewport size. + * The sizeFactor should be between 0.0 and 1.0. + * It says how much of the main render window to color. + * @param {Number} sizeFactor + * @default 0.2 + */ + setViewportSize(sizeFactor: number): void; + + /** + * Manually updates the marker's orientation. + */ + updateMarkerOrientation(): void; + + /** + * Updates the orientation widget viewport size. + */ + updateViewport(): void; } /** @@ -156,21 +154,27 @@ export interface vtkOrientationMarkerWidget extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IOrientationMarkerWidgetInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IOrientationMarkerWidgetInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IOrientationMarkerWidgetInitialValues +): void; /** * Method used to create a new instance of vtkOrientationMarkerWidget * @param {IOrientationMarkerWidgetInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IOrientationMarkerWidgetInitialValues): vtkOrientationMarkerWidget; +export function newInstance( + initialValues?: IOrientationMarkerWidgetInitialValues +): vtkOrientationMarkerWidget; /** * vtkOrientationMarkerWidget is a 2D widget for manipulating a marker prop */ export declare const vtkOrientationMarkerWidget: { - newInstance: typeof newInstance; - extend: typeof extend; - Corners: typeof Corners; -} + newInstance: typeof newInstance; + extend: typeof extend; + Corners: typeof Corners; +}; export default vtkOrientationMarkerWidget; diff --git a/Sources/Proxy/Core/ViewProxy/index.d.ts b/Sources/Proxy/Core/ViewProxy/index.d.ts index 204f0a2307c..4fb3aa9ba4b 100644 --- a/Sources/Proxy/Core/ViewProxy/index.d.ts +++ b/Sources/Proxy/Core/ViewProxy/index.d.ts @@ -67,7 +67,7 @@ export interface vtkViewProxy extends VtkProxy { getInteractor(): vtkRenderWindowInteractor; getInteractorStyle2D(): vtkInteractorStyle; getInteractorStyle3D(): vtkInteractorStyle; - getApiSpecificRenderWindow(): vtkOpenGLRenderWindow|vtkWebGPURenderWindow; + getApiSpecificRenderWindow(): vtkOpenGLRenderWindow | vtkWebGPURenderWindow; getOrientationAxesType(): string; getPresetToOrientationAxes(): any; getRenderer(): vtkRenderer; diff --git a/Sources/Proxy/Representations/GeometryRepresentationProxy/index.d.ts b/Sources/Proxy/Representations/GeometryRepresentationProxy/index.d.ts index cccb8961829..aa07264b57e 100644 --- a/Sources/Proxy/Representations/GeometryRepresentationProxy/index.d.ts +++ b/Sources/Proxy/Representations/GeometryRepresentationProxy/index.d.ts @@ -1,35 +1,36 @@ -import { RGBColor } from "../../../types"; +import { RGBColor } from '../../../types'; import vtkAbstractRepresentationProxy from '../../Core/AbstractRepresentationProxy'; export interface vtkGeometryRepresentationProxy - extends vtkAbstractRepresentationProxy { + extends vtkAbstractRepresentationProxy { + /** + * + * @param representation a string that describes what representation to use for the explicit geometry. + * possible values are 'Surface with edges', 'Surface' (default), 'Wireframe', + * and 'Points'. + */ + setRepresentation(representation: string): boolean; + getRepresentation(): string; - /** - * - * @param representation a string that describes what representation to use for the explicit geometry. - * possible values are 'Surface with edges', 'Surface' (default), 'Wireframe', - * and 'Points'. - */ - setRepresentation(representation: string): boolean; - getRepresentation(): string; - - // proxy property mappings - getColor(): RGBColor; - setColor(color: RGBColor): boolean; - getInterpolateScalarsBeforeMapping(): boolean; - setInterpolateScalarsBeforeMapping(interpolateScalarsBeforeMapping: boolean): boolean; - getOpacity(): number; - setOpacity(opacity: number): boolean; - getVisibility(): boolean; - setVisibility(visible: boolean): boolean; - getPointSize(): number; - setPointSize(pointSize: number): boolean; - getUseShadow(): boolean; - setUseShadow(lighting: boolean): boolean; - getUseBounds(): boolean; - setUseBounds(useBounds: boolean): boolean; - getLineWidth(): number; - setLineWidth(width: number): boolean; + // proxy property mappings + getColor(): RGBColor; + setColor(color: RGBColor): boolean; + getInterpolateScalarsBeforeMapping(): boolean; + setInterpolateScalarsBeforeMapping( + interpolateScalarsBeforeMapping: boolean + ): boolean; + getOpacity(): number; + setOpacity(opacity: number): boolean; + getVisibility(): boolean; + setVisibility(visible: boolean): boolean; + getPointSize(): number; + setPointSize(pointSize: number): boolean; + getUseShadow(): boolean; + setUseShadow(lighting: boolean): boolean; + getUseBounds(): boolean; + setUseBounds(useBounds: boolean): boolean; + getLineWidth(): number; + setLineWidth(width: number): boolean; } export default vtkGeometryRepresentationProxy; diff --git a/Sources/Proxy/Representations/ResliceRepresentationProxy/index.d.ts b/Sources/Proxy/Representations/ResliceRepresentationProxy/index.d.ts index 6a8f559d442..fd5b49cd4b9 100644 --- a/Sources/Proxy/Representations/ResliceRepresentationProxy/index.d.ts +++ b/Sources/Proxy/Representations/ResliceRepresentationProxy/index.d.ts @@ -5,7 +5,6 @@ import { RGBColor } from '../../../types'; export interface vtkResliceRepresentationProxy extends vtkAbstractRepresentationProxy { - // proxy property mappings setVisibility(visible: boolean): boolean; diff --git a/Sources/Rendering/Core/AbstractImageMapper/index.d.ts b/Sources/Rendering/Core/AbstractImageMapper/index.d.ts index 7bbf2c0db87..8bd657484ec 100644 --- a/Sources/Rendering/Core/AbstractImageMapper/index.d.ts +++ b/Sources/Rendering/Core/AbstractImageMapper/index.d.ts @@ -1,119 +1,127 @@ -import vtkAbstractMapper3D, { IAbstractMapper3DInitialValues } from "../AbstractMapper3D"; -import vtkImageData from "../../../Common/DataModel/ImageData"; -import { Bounds, Extent, Nullable, RGBAColor } from "../../../types"; - - -export interface IAbstractImageMapperInitialValues extends IAbstractMapper3DInitialValues { - customDisplayExtent?: number[]; - useCustomExtents?: boolean; - slice?: number; +import vtkAbstractMapper3D, { + IAbstractMapper3DInitialValues, +} from '../AbstractMapper3D'; +import vtkImageData from '../../../Common/DataModel/ImageData'; +import { Bounds, Extent, Nullable, RGBAColor } from '../../../types'; + +export interface IAbstractImageMapperInitialValues + extends IAbstractMapper3DInitialValues { + customDisplayExtent?: number[]; + useCustomExtents?: boolean; + slice?: number; } export interface vtkAbstractImageMapper extends vtkAbstractMapper3D { - - /** - * - */ - getIsOpaque(): boolean; - - /** - * Return currently active image for the mapper. Overridden by deriving classes. - */ - getCurrentImage(): Nullable; - - /** - * Get the slice index. - */ - getSlice(): number; - - /** - * - * @param {Number} slice The slice index. - */ - setSlice(slice: number): boolean; - - /** - * Get bounds for a specified slice. - * To be implemented by derived classes. - * @param {Number} slice The slice index. If undefined, the current slice is considered. - * @param {Number} thickness The slice thickness. If undefined, 0 is considered. - */ - getBoundsForSlice(slice?: number, thickness?: number): Bounds; - - /** - * Return the currently set background color. - */ - getBackgroundColor(): RGBAColor; - - /** - * Return the currently set background color. - */ - getBackgroundColorByReference(): RGBAColor; - - /** - * @param r red component of background color - * @param g green component of background color - * @param b blue component of background color - * @param a opacity component of background color - */ - setBackgroundColor(r: number, g: number, b: number, a: number): boolean; - - /** - * - * @param color specify background color as an array of 4 values. - */ - setBackgroundColor(color: RGBAColor): boolean; - - /** - * - * @param {RGBAColor} color specify the background color to use - * in RGBA format as an array of 4 values. Values are copied. - */ - setBackgroundColorFrom(color: RGBAColor): boolean; - - /** - * - */ - getUseCustomExtents(): boolean; - - /** - * - * @param {Boolean} useCustomExtents - */ - setUseCustomExtents(useCustomExtents: boolean): boolean; - - /** - * - */ - getCustomDisplayExtent(): Extent; - - /** - * - */ - getCustomDisplayExtentByReference(): Extent; - - /** - * - * @param {Number} x1 The x coordinate of the first point. - * @param {Number} x2 The x coordinate of the second point. - * @param {Number} y1 The y coordinate of the first point. - * @param {Number} y2 The y coordinate of the second point. - * @param {Number} z1 The z coordinate of the first point. - * @param {Number} z2 The z coordinate of the second point. - */ - setCustomDisplayExtent(x1: number, x2: number, y1: number, y2: number, z1: number, z2: number): boolean; - - /** - * - * @param extents specify extents as an array of 6 values [minx, maxx, ...] - */ - setCustomDisplayExtent(customDisplayExtent: Extent): boolean; - - /** - * - * @param customDisplayExtent - */ - setCustomDisplayExtentFrom(customDisplayExtent: number[]): boolean; + /** + * + */ + getIsOpaque(): boolean; + + /** + * Return currently active image for the mapper. Overridden by deriving classes. + */ + getCurrentImage(): Nullable; + + /** + * Get the slice index. + */ + getSlice(): number; + + /** + * + * @param {Number} slice The slice index. + */ + setSlice(slice: number): boolean; + + /** + * Get bounds for a specified slice. + * To be implemented by derived classes. + * @param {Number} slice The slice index. If undefined, the current slice is considered. + * @param {Number} thickness The slice thickness. If undefined, 0 is considered. + */ + getBoundsForSlice(slice?: number, thickness?: number): Bounds; + + /** + * Return the currently set background color. + */ + getBackgroundColor(): RGBAColor; + + /** + * Return the currently set background color. + */ + getBackgroundColorByReference(): RGBAColor; + + /** + * @param r red component of background color + * @param g green component of background color + * @param b blue component of background color + * @param a opacity component of background color + */ + setBackgroundColor(r: number, g: number, b: number, a: number): boolean; + + /** + * + * @param color specify background color as an array of 4 values. + */ + setBackgroundColor(color: RGBAColor): boolean; + + /** + * + * @param {RGBAColor} color specify the background color to use + * in RGBA format as an array of 4 values. Values are copied. + */ + setBackgroundColorFrom(color: RGBAColor): boolean; + + /** + * + */ + getUseCustomExtents(): boolean; + + /** + * + * @param {Boolean} useCustomExtents + */ + setUseCustomExtents(useCustomExtents: boolean): boolean; + + /** + * + */ + getCustomDisplayExtent(): Extent; + + /** + * + */ + getCustomDisplayExtentByReference(): Extent; + + /** + * + * @param {Number} x1 The x coordinate of the first point. + * @param {Number} x2 The x coordinate of the second point. + * @param {Number} y1 The y coordinate of the first point. + * @param {Number} y2 The y coordinate of the second point. + * @param {Number} z1 The z coordinate of the first point. + * @param {Number} z2 The z coordinate of the second point. + */ + setCustomDisplayExtent( + x1: number, + x2: number, + y1: number, + y2: number, + z1: number, + z2: number + ): boolean; + + /** + * + * @param extents specify extents as an array of 6 values [minx, maxx, ...] + */ + setCustomDisplayExtent(customDisplayExtent: Extent): boolean; + + /** + * + * @param customDisplayExtent + */ + setCustomDisplayExtentFrom(customDisplayExtent: number[]): boolean; } /** @@ -123,7 +131,11 @@ export interface vtkAbstractImageMapper extends vtkAbstractMapper3D { * @param model object on which data structure will be bounds (protected) * @param {IAbstractImageMapperInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IAbstractImageMapperInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IAbstractImageMapperInitialValues +): void; /** * vtkImageMapper provides 2D image display support for vtk. @@ -132,6 +144,6 @@ export function extend(publicAPI: object, model: object, initialValues?: IAbstra * This class resolves coincident topology with the same methods as vtkMapper. */ export declare const vtkAbstractImageMapper: { - extend: typeof extend; -} + extend: typeof extend; +}; export default vtkAbstractImageMapper; diff --git a/Sources/Rendering/Core/AbstractMapper/index.d.ts b/Sources/Rendering/Core/AbstractMapper/index.d.ts index 31a51383eb7..4409213a731 100755 --- a/Sources/Rendering/Core/AbstractMapper/index.d.ts +++ b/Sources/Rendering/Core/AbstractMapper/index.d.ts @@ -1,70 +1,72 @@ -import { vtkAlgorithm, vtkObject } from "../../../interfaces"; -import vtkPlane from "../../../Common/DataModel/Plane"; -import { mat4 } from "gl-matrix"; +import { vtkAlgorithm, vtkObject } from '../../../interfaces'; +import vtkPlane from '../../../Common/DataModel/Plane'; +import { mat4 } from 'gl-matrix'; /** - * + * */ export interface IAbstractMapperInitialValues { - clippingPlanes?: vtkPlane[]; + clippingPlanes?: vtkPlane[]; } -type vtkAbstractMapperBase = vtkObject & Omit ; +type vtkAbstractMapperBase = vtkObject & + Omit; export interface vtkAbstractMapper extends vtkAbstractMapperBase { + /** + * Added plane needs to be a vtkPlane object. + * @param {vtkPlane} plane + */ + addClippingPlane(plane: vtkPlane): boolean; - /** - * Added plane needs to be a vtkPlane object. - * @param {vtkPlane} plane - */ - addClippingPlane(plane: vtkPlane): boolean; - - /** - * Get number of clipping planes. - * @return {Number} The number of clipping planes. - */ - getNumberOfClippingPlanes(): number; + /** + * Get number of clipping planes. + * @return {Number} The number of clipping planes. + */ + getNumberOfClippingPlanes(): number; - /** - * Get all clipping planes. - * @return {vtkPlane[]} An array of the clipping planes objects - */ - getClippingPlanes(): vtkPlane[]; + /** + * Get all clipping planes. + * @return {vtkPlane[]} An array of the clipping planes objects + */ + getClippingPlanes(): vtkPlane[]; - /** - * Remove all clipping planes. - * @return true if there were planes, false otherwise. - */ - removeAllClippingPlanes(): boolean; + /** + * Remove all clipping planes. + * @return true if there were planes, false otherwise. + */ + removeAllClippingPlanes(): boolean; - /** - * Remove clipping plane. - * @param {vtkPlane} plane - * @return true if plane existed and therefore is removed, false otherwise. - */ - removeClippingPlane(plane: vtkPlane): boolean; + /** + * Remove clipping plane. + * @param {vtkPlane} plane + * @return true if plane existed and therefore is removed, false otherwise. + */ + removeClippingPlane(plane: vtkPlane): boolean; - /** - * Set clipping planes. - * @param {vtkPlane[]} planes - */ - setClippingPlanes(planes: vtkPlane[]): void; + /** + * Set clipping planes. + * @param {vtkPlane[]} planes + */ + setClippingPlanes(planes: vtkPlane[]): void; - /** - * Get the ith clipping plane as a homogeneous plane equation. - * Use getNumberOfClippingPlanes() to get the number of planes. - * @param {mat4} propMatrix - * @param {Number} i - * @param {Number[]} hnormal - */ - getClippingPlaneInDataCoords(propMatrix : mat4, i : number, hnormal : number[]): void; + /** + * Get the ith clipping plane as a homogeneous plane equation. + * Use getNumberOfClippingPlanes() to get the number of planes. + * @param {mat4} propMatrix + * @param {Number} i + * @param {Number[]} hnormal + */ + getClippingPlaneInDataCoords( + propMatrix: mat4, + i: number, + hnormal: number[] + ): void; - /** - * - */ - update(): void; + /** + * + */ + update(): void; } /** @@ -74,7 +76,11 @@ export interface vtkAbstractMapper extends vtkAbstractMapperBase { * @param model object on which data structure will be bounds (protected) * @param {IAbstractMapperInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IAbstractMapperInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IAbstractMapperInitialValues +): void; /** * vtkAbstractMapper is an abstract class to specify interface between data and @@ -83,6 +89,6 @@ export function extend(publicAPI: object, model: object, initialValues?: IAbstra * data. */ export declare const vtkAbstractMapper: { - extend: typeof extend, + extend: typeof extend; }; export default vtkAbstractMapper; diff --git a/Sources/Rendering/Core/AbstractMapper3D/index.d.ts b/Sources/Rendering/Core/AbstractMapper3D/index.d.ts index 867488c0b22..1d37f8c7c20 100755 --- a/Sources/Rendering/Core/AbstractMapper3D/index.d.ts +++ b/Sources/Rendering/Core/AbstractMapper3D/index.d.ts @@ -1,33 +1,36 @@ import { Bounds, Vector3 } from '../../../types'; -import vtkAbstractMapper, { IAbstractMapperInitialValues } from '../AbstractMapper'; +import vtkAbstractMapper, { + IAbstractMapperInitialValues, +} from '../AbstractMapper'; /** - * + * */ -export interface IAbstractMapper3DInitialValues extends IAbstractMapperInitialValues { - bounds?: Bounds; - center?: Vector3; +export interface IAbstractMapper3DInitialValues + extends IAbstractMapperInitialValues { + bounds?: Bounds; + center?: Vector3; } export interface vtkAbstractMapper3D extends vtkAbstractMapper { - /** - * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @default 0 - * @return {Bounds} The bounds for the mapper. - */ - getBounds(): Bounds; + /** + * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @default 0 + * @return {Bounds} The bounds for the mapper. + */ + getBounds(): Bounds; + + /** + * Get the center of this mapper’s data. + * @return {Vector3} The center of the mapper's data. + */ + getCenter(): Vector3; - /** - * Get the center of this mapper’s data. - * @return {Vector3} The center of the mapper's data. - */ - getCenter(): Vector3; - - /** - * Get the diagonal length of this mappers bounding box. - * @return {Number} The diagonal length of mapper bounding box. - */ - getLength(): number; + /** + * Get the diagonal length of this mappers bounding box. + * @return {Number} The diagonal length of mapper bounding box. + */ + getLength(): number; } /** @@ -37,19 +40,23 @@ export interface vtkAbstractMapper3D extends vtkAbstractMapper { * @param model object on which data structure will be bounds (protected) * @param {IAbstractMapper3DInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IAbstractMapper3DInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IAbstractMapper3DInitialValues +): void; /** * vtkAbstractMapper3D is an abstract class to specify interface between 3D * data and graphics primitives or software rendering techniques. Subclasses * of vtkAbstractMapper3D can be used for rendering geometry or rendering * volumetric data. - * + * * This class also defines an API to support hardware clipping planes (at most * six planes can be defined). It also provides geometric data about the input * data it maps, such as the bounding box and center. */ export declare const vtkAbstractMapper3D: { - extend: typeof extend, + extend: typeof extend; }; export default vtkAbstractMapper3D; diff --git a/Sources/Rendering/Core/AbstractPicker/index.d.ts b/Sources/Rendering/Core/AbstractPicker/index.d.ts index 0300f62f087..d6164a6f256 100755 --- a/Sources/Rendering/Core/AbstractPicker/index.d.ts +++ b/Sources/Rendering/Core/AbstractPicker/index.d.ts @@ -1,99 +1,98 @@ -import { vtkObject } from "../../../interfaces" ; -import { Vector3 } from "../../../types"; +import { vtkObject } from '../../../interfaces'; +import { Vector3 } from '../../../types'; import vtkActor from '../Actor'; -import vtkRenderer from '../Renderer' +import vtkRenderer from '../Renderer'; /** - * + * */ export interface IAbstractPickerInitialValues { - renderer?: vtkRenderer, - selectionPoint?: Vector3, - pickPosition?: Vector3, - pickFromList?: number, - pickList?: vtkActor[], + renderer?: vtkRenderer; + selectionPoint?: Vector3; + pickPosition?: Vector3; + pickFromList?: number; + pickList?: vtkActor[]; } /** - * + * */ export interface vtkAbstractPicker extends vtkObject { - - /** - * - * @param {vtkActor} actor - */ - addPickList(actor : vtkActor): void; - - /** - * - * @param {vtkActor} actor - */ - deletePickList(actor : vtkActor): void; - - /** - * - */ - getPickFromList(): boolean; - - /** - * - */ - getPickList(): boolean; - - /** - * Get the picked position - * @default [0.0, 0.0, 0.0] - */ - getPickPosition(): Vector3; - - /** - * - * Get the picked position - * @default [0.0, 0.0, 0.0] - */ - getPickPositionByReference(): Vector3; - - /** - * - */ - getRenderer(): vtkRenderer; - - /** - * - * @default [0.0, 0.0, 0.0] - */ - getSelectionPoint(): Vector3; - - /** - * - * @default [0.0, 0.0, 0.0] - */ - getSelectionPointByReference(): Vector3; - - /** - * - */ - initialize(): void; - - /** - * Set pickList to empty array. - */ - initializePickList(): void; - - /** - * - * @param {Number} pickFromList - * @default 0 - */ - setPickFromList(pickFromList: number): boolean; - - /** - * - * @param {vtkActor[]} pickList - * @default [] - */ - setPickList(pickList: vtkActor[]): boolean; + /** + * + * @param {vtkActor} actor + */ + addPickList(actor: vtkActor): void; + + /** + * + * @param {vtkActor} actor + */ + deletePickList(actor: vtkActor): void; + + /** + * + */ + getPickFromList(): boolean; + + /** + * + */ + getPickList(): boolean; + + /** + * Get the picked position + * @default [0.0, 0.0, 0.0] + */ + getPickPosition(): Vector3; + + /** + * + * Get the picked position + * @default [0.0, 0.0, 0.0] + */ + getPickPositionByReference(): Vector3; + + /** + * + */ + getRenderer(): vtkRenderer; + + /** + * + * @default [0.0, 0.0, 0.0] + */ + getSelectionPoint(): Vector3; + + /** + * + * @default [0.0, 0.0, 0.0] + */ + getSelectionPointByReference(): Vector3; + + /** + * + */ + initialize(): void; + + /** + * Set pickList to empty array. + */ + initializePickList(): void; + + /** + * + * @param {Number} pickFromList + * @default 0 + */ + setPickFromList(pickFromList: number): boolean; + + /** + * + * @param {vtkActor[]} pickList + * @default [] + */ + setPickList(pickList: vtkActor[]): boolean; } /** @@ -103,17 +102,21 @@ export interface vtkAbstractPicker extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IAbstractPickerInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: IAbstractPickerInitialValues, model: object, initialValues?: object): void; +export function extend( + publicAPI: IAbstractPickerInitialValues, + model: object, + initialValues?: object +): void; /** * vtkAbstractPicker is an abstract superclass that defines a minimal API for its concrete subclasses. * The minimum functionality of a picker is to return the x-y-z global coordinate position of a pick (the pick itself is defined in display coordinates). - * + * * The API to this class is to invoke the Pick() method with a selection point (in display coordinates - pixels) * and a renderer. Then get the resulting pick position in global coordinates with the GetPickPosition() method. * @see [vtkPointPicker](./Rendering_Core_PointPicker.html) */ export declare const vtkAbstractPicker: { - extend: typeof extend, + extend: typeof extend; }; export default vtkAbstractPicker; diff --git a/Sources/Rendering/Core/Actor/index.d.ts b/Sources/Rendering/Core/Actor/index.d.ts index e1ca611790a..50f529928d1 100755 --- a/Sources/Rendering/Core/Actor/index.d.ts +++ b/Sources/Rendering/Core/Actor/index.d.ts @@ -4,119 +4,118 @@ import vtkProp3D, { IProp3DInitialValues } from '../Prop3D'; import vtkProperty, { IPropertyInitialValues } from '../Property'; /** - * + * */ export interface IActorInitialValues extends IProp3DInitialValues { - mapper?: vtkMapper; - property?: vtkProperty; - backfaceProperty?: vtkProperty; - forceOpaque?: boolean; - forceTranslucent?: boolean; - bounds?: Bounds; + mapper?: vtkMapper; + property?: vtkProperty; + backfaceProperty?: vtkProperty; + forceOpaque?: boolean; + forceTranslucent?: boolean; + bounds?: Bounds; } export interface vtkActor extends vtkProp3D { - - /** - * Return if the prop have some translucent polygonal geometry - */ - hasTranslucentPolygonalGeometry(): boolean; - - /** - * For some exporters and other other operations we must be - * able to collect all the actors or volumes. These methods - * are used in that process. - * @return {vtkActor[]} list of actors - */ - getActors(): vtkActor[]; - - /** - * Get the property object that controls this actors backface surface - * properties. - * @return {vtkProperty} the backface property. - */ - getBackfaceProperty(): vtkProperty; - - /** - * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @return {Bounds} The bounds for the mapper. - */ - getBounds(): Bounds; - - /** - * Check whether the opaque is forced or not. - */ - getForceOpaque(): boolean; - - /** - * Check whether the translucency is forced or not. - */ - getForceTranslucent(): boolean; - - /** - * Check if the actor is opaque or not - * @return true if the actor is opaque - */ - getIsOpaque(): boolean; - - /** - * Get the Mapper that this actor is getting its data from. - */ - getMapper(): Nullable; - - /** - * Get the property object that controls this actors surface - * properties. This should be an instance of a vtkProperty object. Every - * actor must have a property associated with it. If one isn’t specified, - * then one will be generated automatically. Multiple actors can share one - * property object. - * @return {vtkProperty} The property object - */ - getProperty(): vtkProperty; - - /** - * Check whether if the actor supports selection - * @return {Boolean} true if the actor support selection. - */ - getSupportsSelection(): boolean; - - /** - * Create a new property suitable for use with this type of Actor. - * @param {IPropertyInitialValues} [initialValues] (default: {}) - */ - makeProperty(initialValues?: IPropertyInitialValues): vtkProperty; - - /** - * Set the property object that controls this actors backface surface - * properties. - * @param {vtkProperty} backfaceProperty The backfaceProperty instance. - */ - setBackfaceProperty(backfaceProperty: vtkProperty): boolean; - - /** - * Force the actor to be treated as opaque or translucent. - * @param {Boolean} forceOpaque - */ - setForceOpaque(forceOpaque: boolean): boolean; - - /** - * Force the actor to be treated as opaque or translucent. - * @param {Boolean} forceTranslucent - */ - setForceTranslucent(forceTranslucent: boolean): boolean; - - /** - * This is the method that is used to connect an actor to the end of a - * visualization pipeline, i.e. the mapper. - * @param {vtkMapper} mapper The vtkMapper instance. - */ - setMapper(mapper: vtkMapper): boolean; - - /** - * Set the property object that controls this actors surface properties. - * @param {vtkProperty} property The vtkProperty instance. - */ - setProperty(property: vtkProperty): boolean; + /** + * Return if the prop have some translucent polygonal geometry + */ + hasTranslucentPolygonalGeometry(): boolean; + + /** + * For some exporters and other other operations we must be + * able to collect all the actors or volumes. These methods + * are used in that process. + * @return {vtkActor[]} list of actors + */ + getActors(): vtkActor[]; + + /** + * Get the property object that controls this actors backface surface + * properties. + * @return {vtkProperty} the backface property. + */ + getBackfaceProperty(): vtkProperty; + + /** + * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @return {Bounds} The bounds for the mapper. + */ + getBounds(): Bounds; + + /** + * Check whether the opaque is forced or not. + */ + getForceOpaque(): boolean; + + /** + * Check whether the translucency is forced or not. + */ + getForceTranslucent(): boolean; + + /** + * Check if the actor is opaque or not + * @return true if the actor is opaque + */ + getIsOpaque(): boolean; + + /** + * Get the Mapper that this actor is getting its data from. + */ + getMapper(): Nullable; + + /** + * Get the property object that controls this actors surface + * properties. This should be an instance of a vtkProperty object. Every + * actor must have a property associated with it. If one isn’t specified, + * then one will be generated automatically. Multiple actors can share one + * property object. + * @return {vtkProperty} The property object + */ + getProperty(): vtkProperty; + + /** + * Check whether if the actor supports selection + * @return {Boolean} true if the actor support selection. + */ + getSupportsSelection(): boolean; + + /** + * Create a new property suitable for use with this type of Actor. + * @param {IPropertyInitialValues} [initialValues] (default: {}) + */ + makeProperty(initialValues?: IPropertyInitialValues): vtkProperty; + + /** + * Set the property object that controls this actors backface surface + * properties. + * @param {vtkProperty} backfaceProperty The backfaceProperty instance. + */ + setBackfaceProperty(backfaceProperty: vtkProperty): boolean; + + /** + * Force the actor to be treated as opaque or translucent. + * @param {Boolean} forceOpaque + */ + setForceOpaque(forceOpaque: boolean): boolean; + + /** + * Force the actor to be treated as opaque or translucent. + * @param {Boolean} forceTranslucent + */ + setForceTranslucent(forceTranslucent: boolean): boolean; + + /** + * This is the method that is used to connect an actor to the end of a + * visualization pipeline, i.e. the mapper. + * @param {vtkMapper} mapper The vtkMapper instance. + */ + setMapper(mapper: vtkMapper): boolean; + + /** + * Set the property object that controls this actors surface properties. + * @param {vtkProperty} property The vtkProperty instance. + */ + setProperty(property: vtkProperty): boolean; } /** @@ -126,11 +125,15 @@ export interface vtkActor extends vtkProp3D { * @param model object on which data structure will be bounds (protected) * @param {IActorInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IActorInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IActorInitialValues +): void; /** * Method used to create a new instance of vtkActor with the following defaults: - * + * * * origin = [0, 0, 0] * * position = [0, 0, 0] * * scale = [1, 1, 1] @@ -138,7 +141,7 @@ export function extend(publicAPI: object, model: object, initialValues?: IActorI * * pickable = 1 * * dragable = 1 * * orientation = [0, 0, 0] - * + * * No user defined matrix and no texture map. * @param {IActorInitialValues} [initialValues] for pre-setting some of its content */ @@ -153,10 +156,10 @@ export function newInstance(initialValues?: IActorInitialValues): vtkActor; * transformation matrix as follows: [x y z 1] = [x y z 1] Translate(-origin) * Scale(scale) Rot(y) Rot(x) Rot (z) Trans(origin) Trans(position) * @see [vtkMapper](./Rendering_Core_Mapper.html) - * @see [vtkProperty](./Rendering_Core_Property.html) + * @see [vtkProperty](./Rendering_Core_Property.html) */ export declare const vtkActor: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkActor; diff --git a/Sources/Rendering/Core/Actor2D/index.d.ts b/Sources/Rendering/Core/Actor2D/index.d.ts index 121b931a700..d02aaf44724 100755 --- a/Sources/Rendering/Core/Actor2D/index.d.ts +++ b/Sources/Rendering/Core/Actor2D/index.d.ts @@ -6,106 +6,105 @@ import vtkMapper2D from '../Mapper2D'; import { Bounds } from '../../../types'; /** - * + * */ export interface IActor2DInitialValues extends IPropInitialValues { - mapper?: vtkMapper; - property?: vtkProperty2D; - layerNumber?: number; - positionCoordinate?: vtkCoordinate; - positionCoordinate2?: vtkCoordinate; + mapper?: vtkMapper; + property?: vtkProperty2D; + layerNumber?: number; + positionCoordinate?: vtkCoordinate; + positionCoordinate2?: vtkCoordinate; } export interface vtkActor2D extends vtkProp { - /** - * - * @return - */ - getActors2D(): any; - - /** - * - * @return - */ - getIsOpaque(): boolean; - - - /** - * Return the property object that controls this actors surface - * properties. This should be an instance of a vtkProperty2D object. Every - * actor must have a property associated with it. If one isn’t specified, - * then one will be generated automatically. Multiple actors can share one - * property object. - */ - getProperty(): vtkProperty2D; - - /** - * Create a new property suitable for use with this type of Actor. - * @param {IProperty2DInitialValues} [initialValues] (default: {}) - */ - makeProperty(initialValues?: IProperty2DInitialValues): vtkProperty2D; - - /** - * Sets the 2D mapper. - */ - setMapper(mapper: vtkMapper2D): boolean; - - /** - * Gets the 2D mapper. - */ - getMapper(): vtkMapper2D; - - /** - * - */ - hasTranslucentPolygonalGeometry(): boolean; - - /** - * Set the Prop2D's position in display coordinates. - * @param XPos - * @param YPos - */ - setDisplayPosition(XPos: any, YPos: any): void; - - /** - * - * @param w - */ - setWidth(w: number): void; - - /** - * - * @param w - */ - setHeight(h: number): void; - - /** - * - */ - getWidth(): number; - - /** - * - */ - getHeight(): number; - - /** - * Get the bounds as [xmin, xmax, ymin, ymax, zmin, zmax]. - * @return {Bounds} The bounds for the mapper. - */ - getBounds(): Bounds; - - /** - * Return the actual vtkCoordinate reference that the mapper should use - * to position the actor. This is used internally by the mappers and should - * be overridden in specialized subclasses and otherwise ignored. - */ - getActualPositionCoordinate(): vtkCoordinate; - - /** - * - */ - getActualPositionCoordinate2(): vtkCoordinate; + /** + * + * @return + */ + getActors2D(): any; + + /** + * + * @return + */ + getIsOpaque(): boolean; + + /** + * Return the property object that controls this actors surface + * properties. This should be an instance of a vtkProperty2D object. Every + * actor must have a property associated with it. If one isn’t specified, + * then one will be generated automatically. Multiple actors can share one + * property object. + */ + getProperty(): vtkProperty2D; + + /** + * Create a new property suitable for use with this type of Actor. + * @param {IProperty2DInitialValues} [initialValues] (default: {}) + */ + makeProperty(initialValues?: IProperty2DInitialValues): vtkProperty2D; + + /** + * Sets the 2D mapper. + */ + setMapper(mapper: vtkMapper2D): boolean; + + /** + * Gets the 2D mapper. + */ + getMapper(): vtkMapper2D; + + /** + * + */ + hasTranslucentPolygonalGeometry(): boolean; + + /** + * Set the Prop2D's position in display coordinates. + * @param XPos + * @param YPos + */ + setDisplayPosition(XPos: any, YPos: any): void; + + /** + * + * @param w + */ + setWidth(w: number): void; + + /** + * + * @param w + */ + setHeight(h: number): void; + + /** + * + */ + getWidth(): number; + + /** + * + */ + getHeight(): number; + + /** + * Get the bounds as [xmin, xmax, ymin, ymax, zmin, zmax]. + * @return {Bounds} The bounds for the mapper. + */ + getBounds(): Bounds; + + /** + * Return the actual vtkCoordinate reference that the mapper should use + * to position the actor. This is used internally by the mappers and should + * be overridden in specialized subclasses and otherwise ignored. + */ + getActualPositionCoordinate(): vtkCoordinate; + + /** + * + */ + getActualPositionCoordinate2(): vtkCoordinate; } /** @@ -115,7 +114,11 @@ export interface vtkActor2D extends vtkProp { * @param model object on which data structure will be bounds (protected) * @param {IActor2DInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IActor2DInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IActor2DInitialValues +): void; /** * Method use to create a new instance of vtkActor2D @@ -133,7 +136,7 @@ export function newInstance(initialValues?: IActor2DInitialValues): vtkActor2D; * @see [vtkProperty2D](./Rendering_Core_Property2D.html) */ export declare const vtkActor2D: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkActor2D; diff --git a/Sources/Rendering/Core/AnnotatedCubeActor/index.d.ts b/Sources/Rendering/Core/AnnotatedCubeActor/index.d.ts index 529a56181c0..46bc6df19d1 100755 --- a/Sources/Rendering/Core/AnnotatedCubeActor/index.d.ts +++ b/Sources/Rendering/Core/AnnotatedCubeActor/index.d.ts @@ -1,71 +1,70 @@ import vtkActor, { IActorInitialValues } from '../Actor'; export interface IStyle { - text?: string; - faceColor?: string; - faceRotation?: number; - fontFamily?: string; - fontColor?: string; - fontStyle?: string; - fontSizeScale?: (res: number) => number; - edgeThickness?: number; - edgeColor?: string; - resolution?: number; + text?: string; + faceColor?: string; + faceRotation?: number; + fontFamily?: string; + fontColor?: string; + fontStyle?: string; + fontSizeScale?: (res: number) => number; + edgeThickness?: number; + edgeColor?: string; + resolution?: number; } export interface IFaceProperty extends IStyle { - text?: string; - faceRotation?: number; + text?: string; + faceRotation?: number; } /** * */ -export interface IAnnotatedCubeActorInitialValues extends IActorInitialValues { -} +export interface IAnnotatedCubeActorInitialValues extends IActorInitialValues {} export interface vtkAnnotatedCubeActor extends vtkActor { - /** - * Set the default style. - * @param {IStyle} style - */ - setDefaultStyle(style: IStyle): boolean; + /** + * Set the default style. + * @param {IStyle} style + */ + setDefaultStyle(style: IStyle): boolean; - /** - * The +X face property. - * @param {IFaceProperty} prop +X face property - */ - setXPlusFaceProperty(prop: IFaceProperty): boolean; + /** + * The +X face property. + * @param {IFaceProperty} prop +X face property + */ + setXPlusFaceProperty(prop: IFaceProperty): boolean; - /** - * The -X face property. - * @param {IFaceProperty} prop The -X face property. - */ - setXMinusFaceProperty(prop: IFaceProperty): boolean; + /** + * The -X face property. + * @param {IFaceProperty} prop The -X face property. + */ + setXMinusFaceProperty(prop: IFaceProperty): boolean; - /** - * The +Y face property. - * @param {IFaceProperty} prop The +Y face property. - */ - setYPlusFaceProperty(prop: IFaceProperty): boolean; + /** + * The +Y face property. + * @param {IFaceProperty} prop The +Y face property. + */ + setYPlusFaceProperty(prop: IFaceProperty): boolean; - /** - * The -Y face property. - * @param {IFaceProperty} prop The -Y ace property. - */ - setYMinusFaceProperty(prop: IFaceProperty): boolean; + /** + * The -Y face property. + * @param {IFaceProperty} prop The -Y ace property. + */ + setYMinusFaceProperty(prop: IFaceProperty): boolean; - /** - * The +Z face property. - * @param {IFaceProperty} prop The +Z face property. - */ - setZPlusFaceProperty(prop: IFaceProperty): boolean; + /** + * The +Z face property. + * @param {IFaceProperty} prop The +Z face property. + */ + setZPlusFaceProperty(prop: IFaceProperty): boolean; - /** - * The -Z face property. - * @param {IFaceProperty} prop The -Z face property. - */ - setZMinusFaceProperty(prop: IFaceProperty): boolean; + /** + * The -Z face property. + * @param {IFaceProperty} prop The -Z face property. + */ + setZMinusFaceProperty(prop: IFaceProperty): boolean; } /** @@ -75,13 +74,19 @@ export interface vtkAnnotatedCubeActor extends vtkActor { * @param model object on which data structure will be bounds (protected) * @param {IAnnotatedCubeActorInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IAnnotatedCubeActorInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IAnnotatedCubeActorInitialValues +): void; /** * Method use to create a new instance of vtkAnnotatedCubeActor * @param {IAnnotatedCubeActorInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IAnnotatedCubeActorInitialValues): vtkAnnotatedCubeActor; +export function newInstance( + initialValues?: IAnnotatedCubeActorInitialValues +): vtkAnnotatedCubeActor; /** * All propertyObjects may have any of the following keys: @@ -100,7 +105,7 @@ export function newInstance(initialValues?: IAnnotatedCubeActorInitialValues): v * If a key is not specified, then the default value is used. */ export declare const vtkAnnotatedCubeActor: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkAnnotatedCubeActor; diff --git a/Sources/Rendering/Core/AxesActor/index.d.ts b/Sources/Rendering/Core/AxesActor/index.d.ts index 22e11daa010..a30a9c0dd50 100755 --- a/Sources/Rendering/Core/AxesActor/index.d.ts +++ b/Sources/Rendering/Core/AxesActor/index.d.ts @@ -106,13 +106,19 @@ export interface vtkAxesActor extends vtkActor { * @param model object on which data structure will be bounds (protected) * @param {IAxesActorInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IAxesActorInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IAxesActorInitialValues +): void; /** * Method use to create a new instance of vtkAxesActor. * @param {IAxesActorInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IAxesActorInitialValues): vtkAxesActor; +export function newInstance( + initialValues?: IAxesActorInitialValues +): vtkAxesActor; /** * vtkAxesActor is a hybrid 2D/3D actor used to represent 3D axes in a scene. @@ -128,7 +134,7 @@ export function newInstance(initialValues?: IAxesActorInitialValues): vtkAxesAct * @see [vtkOrientationMarkerWidget](./Interaction_Widgets_OrientationMarkerWidget.html) */ export declare const vtkAxesActor: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkAxesActor; diff --git a/Sources/Rendering/Core/Camera/index.d.ts b/Sources/Rendering/Core/Camera/index.d.ts index ed8c8ee637d..e58a2c1d531 100755 --- a/Sources/Rendering/Core/Camera/index.d.ts +++ b/Sources/Rendering/Core/Camera/index.d.ts @@ -1,732 +1,740 @@ import { mat4 } from 'gl-matrix'; -import { vtkObject } from "../../../interfaces" ; +import { vtkObject } from '../../../interfaces'; import { Bounds, Vector3, Range } from '../../../types'; /** - * + * */ export interface ICameraInitialValues { - position?: number[]; - focalPoint?: number[]; - viewUp?: number[]; - directionOfProjection?: number[]; - parallelProjection?: boolean; - useHorizontalViewAngle?: boolean; - viewAngle?: number; - parallelScale?: number; - clippingRange?: number[]; - windowCenter?: number[]; - viewPlaneNormal?: number[]; - useOffAxisProjection?: boolean; - screenBottomLeft?: number[]; - screenBottomRight?: number[]; - screenTopRight?: number[]; - freezeFocalPoint?: boolean; - physicalTranslation?: number[]; - physicalScale?: number; - physicalViewUp?: number[]; - physicalViewNorth?: number[]; + position?: number[]; + focalPoint?: number[]; + viewUp?: number[]; + directionOfProjection?: number[]; + parallelProjection?: boolean; + useHorizontalViewAngle?: boolean; + viewAngle?: number; + parallelScale?: number; + clippingRange?: number[]; + windowCenter?: number[]; + viewPlaneNormal?: number[]; + useOffAxisProjection?: boolean; + screenBottomLeft?: number[]; + screenBottomRight?: number[]; + screenTopRight?: number[]; + freezeFocalPoint?: boolean; + physicalTranslation?: number[]; + physicalScale?: number; + physicalViewUp?: number[]; + physicalViewNorth?: number[]; } export interface vtkCamera extends vtkObject { - - /** - * Apply a transform to the camera. - * The camera position, focal-point, and view-up are re-calculated - * using the transform's matrix to multiply the old points by the new transform. - * @param {mat4} transformMat4 Transform matrix. - */ - applyTransform(transformMat4: mat4): void; - - /** - * Rotate the camera about the view up vector centered at the focal point. - * @param {Number} angle The angle value. - */ - azimuth(angle: number): void; - - /** - * - * @param {Bounds} bounds The bounds value. - */ - computeClippingRange(bounds: Bounds): Range; - - /** - * This method must be called when the focal point or camera position changes - */ - computeDistance(): void; - - /** - * - */ - computeCameraLightTransform(): void; - - /** - * the provided matrix should include translation and orientation only mat - * is physical to view - * @param {mat4} mat The physical matrix. - */ - computeViewParametersFromPhysicalMatrix(mat: mat4): void; - - /** - * - * @param {mat4} vmat The view matrix. - */ - computeViewParametersFromViewMatrix(vmat: mat4): void; - - /** - * Not implemented yet - * @param {vtkCamera} sourceCamera The camera source. - */ - deepCopy(sourceCamera: vtkCamera): void; - - /** - * Move the position of the camera along the view plane normal. Moving - * towards the focal point (e.g., > 1) is a dolly-in, moving away - * from the focal point (e.g., < 1) is a dolly-out. - * @param {Number} amount The amount value. - */ - dolly(amount: number): void; - - /** - * Rotate the camera about the cross product of the negative of the - * direction of projection and the view up vector, using the focal point as - * the center of rotation. - * @param {Number} angle The angle value. - */ - elevation(angle: number): void; - - /** - * Not implemented yet - */ - getCameraLightTransformMatrix(): void; - - /** - * Get the location of the near and far clipping planes along the direction - * of projection. - */ - getClippingRange(): Range; - - /** - * Get the location of the near and far clipping planes along the direction - * of projection. - */ - getClippingRangeByReference(): Range; - - /** - * - * @param {Number} aspect Camera frustum aspect ratio. - * @param {Number} nearz Camera frustum near plane. - * @param {Number} farz Camera frustum far plane. - */ - getCompositeProjectionMatrix(aspect: number, nearz: number, farz: number): mat4; - - /** - * Get the vector in the direction from the camera position to the focal - * point. - */ - getDirectionOfProjection(): Vector3; - - /** - * Get the vector in the direction from the camera position to the focal - * point. - */ - getDirectionOfProjectionByReference(): Vector3; - - /** - * Get the distance from the camera position to the focal point. - */ - getDistance(): number; - - /** - * Get the focal of the camera in world coordinates. - */ - getFocalPoint(): Vector3; - - /** - * Get the focal of the camera in world coordinates. - */ - getFocalPointByReference(): Vector3; - - /** - * Get the value of the FreezeDolly instance variable. - */ - getFreezeFocalPoint(): boolean; - - /** - * Not implemented yet - * Get the plane equations that bound the view frustum. - * @param {Number} aspect Camera frustum aspect ratio. - */ - getFrustumPlanes(aspect: number): void; - - /** - * Not implemented yet - * Get the orientation of the camera. - */ - getOrientation(): void; - - /** - * Not implemented yet - * Get the orientation of the camera. - */ - getOrientationWXYZ(): void; - - /** - * Get the value of the ParallelProjection instance variable. - * This determines if the camera should do a perspective or parallel projection. - */ - getParallelProjection(): boolean; - - /** - * Get the scaling used for a parallel projection. - */ - getParallelScale(): number; - - /** - * - */ - getPhysicalScale(): number; - - /** - * - * @param {mat4} result The world matrix. - */ - getPhysicalToWorldMatrix(result: mat4): void; - - /** - * - */ - getPhysicalTranslation(): number[]; - - /** - * - */ - getPhysicalTranslationByReference(): number[]; - - /** - * - */ - getPhysicalViewNorth(): number[]; - - /** - * - */ - getPhysicalViewNorthByReference(): number[]; - - /** - * - */ - getPhysicalViewUp(): number[]; - - /** - * - */ - getPhysicalViewUpByReference(): number[]; - - /** - * Get the position of the camera in world coordinates. - */ - getPosition(): Vector3; - - /** - * Get the position of the camera in world coordinates. - */ - getPositionByReference(): Vector3; - - /** - * Get the projection matrix. - * @param {Number} aspect Camera frustum aspect ratio. - * @param {Number} nearz Camera frustum near plane. - * @param {Number} farz Camera frustum far plane. - */ - getProjectionMatrix(aspect: number, nearz: number, farz: number): mat4; - - /** - * Not implemented yet - * Get the roll angle of the camera about the direction of projection. - */ - getRoll(): void; - - /** - * Get top left corner point of the screen. - */ - getScreenBottomLeft(): Vector3; - - /** - * - */ - getScreenBottomLeftByReference(): Vector3; - - /** - * Get bottom left corner point of the screen - */ - getScreenBottomRight(): Vector3; - - /** - * - */ - getScreenBottomRightByReference(): Vector3; - - /** - * - */ - getScreenTopRight(): Vector3; - - /** - * - */ - getScreenTopRightByReference(): Vector3; - - /** - * Get the center of the window in viewport coordinates. - */ - getThickness(): number; - - /** - * Get the value of the UseHorizontalViewAngle. - */ - getUseHorizontalViewAngle(): boolean; - - /** - * Get use offaxis frustum. - */ - getUseOffAxisProjection(): boolean; - - /** - * Get the camera view angle. - */ - getViewAngle(): number; - - /** - * - */ - getViewMatrix(): mat4; - - /** - * Get the ViewPlaneNormal. - * This vector will point opposite to the direction of projection, - * unless you have created a sheared output view using SetViewShear/SetObliqueAngles. - */ - getViewPlaneNormal(): Vector3; - - /** - * Get the ViewPlaneNormal by reference. - */ - getViewPlaneNormalByReference(): Vector3; - - /** - * Get ViewUp vector. - */ - getViewUp(): Vector3; - - /** - * Get ViewUp vector by reference. - */ - getViewUpByReference(): Vector3; - - /** - * Get the center of the window in viewport coordinates. - * The viewport coordinate range is ([-1,+1],[-1,+1]). - */ - getWindowCenter(): Range; - - /** - * - */ - getWindowCenterByReference(): Range; - - /** - * - * @param {mat4} result - */ - getWorldToPhysicalMatrix(result: mat4): void; - - /** - * Recompute the ViewUp vector to force it to be perpendicular to - * camera.focalpoint vector. - */ - orthogonalizeViewUp(): void; - - /** - * - * @param {Number[]} ori - */ - physicalOrientationToWorldDirection(ori: number[]): any; - - /** - * Rotate the focal point about the cross product of the view up vector and - * the direction of projection, using the camera's position as the center of - * rotation. - * @param {Number} angle The value of the angle. - */ - pitch(angle: number): void; - - /** - * Rotate the camera about the direction of projection. - * @param {Number} angle The value of the angle. - */ - roll(angle: number): void; - - /** - * Set the location of the near and far clipping planes along the direction - * of projection. - * @param {Number} near The near clipping planes. - * @param {Number} far The far clipping planes. - */ - setClippingRange(near: number, far: number): boolean; - - /** - * Set the location of the near and far clipping planes along the direction - * of projection. - * @param {Range} clippingRange - */ - setClippingRange(clippingRange: Range): boolean; - - /** - * Set the location of the near and far clipping planes along the direction - * of projection. - * @param {Range} clippingRange - */ - setClippingRangeFrom(clippingRange: Range): boolean; - - /** - * Used to handle convert js device orientation angles - * when you use this method the camera will adjust to the - * device orientation such that the physicalViewUp you set - * in world coordinates looks up, and the physicalViewNorth - * you set in world coorindates will (maybe) point north - * - * NOTE WARNING - much of the documentation out there on how - * orientation works is seriously wrong. Even worse the Chrome - * device orientation simulator is completely wrong and should - * never be used. OMG it is so messed up. - * - * how it seems to work on iOS is that the device orientation - * is specified in extrinsic angles with a alpha, beta, gamma - * convention with axes of Z, X, Y (the code below substitutes - * the physical coordinate system for these axes to get the right - * modified coordinate system. - * @param {Number} alpha The value of the alpha. - * @param {Number} beta The value of the beta. - * @param {Number} gamma The value of the gamma. - * @param {Number} screen The value of the screen. - */ - setDeviceAngles(alpha: number, beta: number, gamma: number, screen: number): boolean; - - /** - * Set the direction of projection. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setDirectionOfProjection(x: number, y: number, z: number): boolean; - - /** - * Move the focal point so that it is the specified distance from the camera - * position. - * - * This distance must be positive. - * @param {Number} distance The value of the distance. - */ - setDistance(distance: number): boolean; - - /** - * Set the focal of the camera in world coordinates. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setFocalPoint(x: number, y: number, z: number): boolean; - - /** - * Set the focal of the camera in world coordinates. - * @param {Vector3} focalPoint - */ - setFocalPointFrom(focalPoint: Vector3): boolean; - - /** - * Set the value of the FreezeDolly instance variable. - * @param {Boolean} freezeFocalPoint - */ - setFreezeFocalPoint(freezeFocalPoint: boolean): boolean; - - /** - * Not implement yet - * Set the oblique viewing angles. - * The first angle, alpha, is the angle (measured from the horizontal) that - * rays along the direction of projection will follow once projected onto - * the 2D screen. The second angle, beta, is the angle between the view - * plane and the direction of projection. This creates a shear transform x' - * = x + dz*cos(alpha)/tan(beta), y' = dz*sin(alpha)/tan(beta) where dz is - * the distance of the point from the focal plane. The angles are (45,90) by - * default. Oblique projections commonly use (30,63.435). - * - * @param {Number} alpha The aplha angle value. - * @param {Number} beta The beta angle value. - */ - setObliqueAngles(alpha: number, beta: number): boolean; - - /** - * Set the value of the OrientationWXYZ. - * @param {Number} degrees - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setOrientationWXYZ(degrees: number, x: number, y: number, z: number): boolean; - - /** - * Set the value of the ParallelProjection. - * @param {Boolean} parallelProjection The value of the parallelProjection. - */ - setParallelProjection(parallelProjection: boolean): boolean; - - /** - * Set the value of the parallelScale. - * @param {Number} parallelScale The value of the parallelScale. - */ - setParallelScale(parallelScale: number): boolean; - - /** - * Set the value of the physicalScale. - * @param {Number} physicalScale The value of the the physicalScale. - */ - setPhysicalScale(physicalScale: number): boolean; - - /** - * Set the value of the physicalTranslation. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setPhysicalTranslation(x: number, y: number, z: number): boolean; - - /** - * Set the value of the physicalTranslation. - * @param {Number[]} physicalTranslation The value of the physicalTranslation. - */ - setPhysicalTranslationFrom(physicalTranslation: number[]): boolean; - - /** - * - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setPhysicalViewNorth(x: number, y: number, z: number): boolean; - - /** - * - * @param {Number[]} physicalViewNorth - */ - setPhysicalViewNorthFrom(physicalViewNorth: number[]): boolean; - - /** - * - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setPhysicalViewUp(x: number, y: number, z: number): boolean; - - /** - * - * @param {Number[]} physicalViewUp - */ - setPhysicalViewUpFrom(physicalViewUp: number[]): boolean; - - /** - * Set the position of the camera in world coordinates. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setPosition(x: number, y: number, z: number): boolean; - - /** - * - * @param {mat4} mat - */ - setProjectionMatrix(mat: mat4): boolean; - - /** - * Set the roll angle of the camera about the direction of projection. - * @todo Not implemented yet - * @param {Number} angle The value of the roll angle. - */ - setRoll(angle: number): boolean; - - /** - * Set top left corner point of the screen. - * - * This will be used only for offaxis frustum calculation. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setScreenBottomLeft(x: number, y: number, z: number): boolean; - - /** - * Set top left corner point of the screen. - * - * This will be used only for offaxis frustum calculation. - * @param {Vector3} screenBottomLeft The screenBottomLeft coordiante. - */ - setScreenBottomLeft(screenBottomLeft: Vector3): boolean; - - /** - * Set top left corner point of the screen. - * @param {Vector3} screenBottomLeft The screenBottomLeft coordiante. - */ - setScreenBottomLeftFrom(screenBottomLeft: Vector3): boolean; - - /** - * - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setScreenBottomRight(x: number, y: number, z: number): boolean; - - /** - * Set bottom right corner point of the screen. - * @param {Vector3} screenBottomRight The screenBottomRight coordiante. - */ - setScreenBottomRight(screenBottomRight: Vector3): boolean; - - /** - * Set bottom right corner point of the screen. - * @param {Vector3} screenBottomRight The screenBottomRight coordiante. - */ - setScreenBottomRightFrom(screenBottomRight: Vector3): boolean; - - /** - * Set top right corner point of the screen. - * - * This will be used only for offaxis frustum calculation. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setScreenTopRight(x: number, y: number, z: number): boolean; - - /** - * Set top right corner point of the screen. - * - * This will be used only for offaxis frustum calculation. - * @param {Vector3} screenTopRight The screenTopRight coordiante. - */ - setScreenTopRight(screenTopRight: Vector3): boolean; - - /** - * Set top right corner point of the screen. - * @param {Vector3} screenTopRight The screenTopRight coordiante. - */ - setScreenTopRightFrom(screenTopRight: Vector3): boolean; - - /** - * Set the distance between clipping planes. - * - * This method adjusts the far clipping plane to be set a distance - * 'thickness' beyond the near clipping plane. - * @param {Number} thickness - */ - setThickness(thickness: number): boolean; - - /** - * - * @param {Number} thickness The value of the thickness. - */ - setThicknessFromFocalPoint(thickness: number): boolean; - - /** - * Set the value of the useHorizontalViewAngle. - * @param {Boolean} useHorizontalViewAngle The value of the useHorizontalViewAngle. - */ - setUseHorizontalViewAngle(useHorizontalViewAngle: boolean): boolean; - - /** - * Set use offaxis frustum. - * - * OffAxis frustum is used for off-axis frustum calculations specifically for - * stereo rendering. For reference see "High Resolution Virtual Reality", in - * Proc. SIGGRAPH '92, Computer Graphics, pages 195-202, 1992. - * @param {Boolean} useOffAxisProjection The value of the useOffAxisProjection. - */ - setUseOffAxisProjection(useOffAxisProjection: boolean): boolean; - - /** - * Set the camera view angle, which is the angular height of the camera view - * measured in degrees. - * @param {Number} viewAngle The value of the viewAngle. - */ - setViewAngle(viewAngle: number): boolean; - - /** - * Set the view matrix for the camera. - * @param {mat4} mat The value of the view matrix. - */ - setViewMatrix(mat: mat4): boolean; - - /** - * Set the view up direction for the camera. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setViewUp(x: number, y: number, z: number): boolean; - - /** - * Set the view up direction for the camera. - * @param {Vector3} viewUp The viewUp coordinate. - */ - setViewUp(viewUp: Vector3): boolean; - - /** - * Set the view up direction for the camera. - * @param {Vector3} viewUp The viewUp coordinate. - */ - setViewUpFrom(viewUp: Vector3): boolean; - - /** - * Set the center of the window in viewport coordinates. - * - * The viewport coordinate range is ([-1,+1],[-1,+1]). - * - * This method is for if you have one window which consists of several - * viewports, or if you have several screens which you want to act together - * as one large screen. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - */ - setWindowCenter(x: number, y: number): boolean; - - /** - * Set the center of the window in viewport coordinates from an array. - * @param {Range} windowCenter - */ - setWindowCenterFrom(windowCenter: Range): boolean; - - /** - * - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - translate(x: number, y: number, z: number): void; - - /** - * Rotate the focal point about the view up vector, using the camera's - * position as the center of rotation. - * @param {Number} angle The value of the angle. - */ - yaw(angle: number): void; - - /** - * In perspective mode, decrease the view angle by the specified factor. - * @param {Number} factor The value of the zoom factor. - */ - zoom(factor: number): void; + /** + * Apply a transform to the camera. + * The camera position, focal-point, and view-up are re-calculated + * using the transform's matrix to multiply the old points by the new transform. + * @param {mat4} transformMat4 Transform matrix. + */ + applyTransform(transformMat4: mat4): void; + + /** + * Rotate the camera about the view up vector centered at the focal point. + * @param {Number} angle The angle value. + */ + azimuth(angle: number): void; + + /** + * + * @param {Bounds} bounds The bounds value. + */ + computeClippingRange(bounds: Bounds): Range; + + /** + * This method must be called when the focal point or camera position changes + */ + computeDistance(): void; + + /** + * + */ + computeCameraLightTransform(): void; + + /** + * the provided matrix should include translation and orientation only mat + * is physical to view + * @param {mat4} mat The physical matrix. + */ + computeViewParametersFromPhysicalMatrix(mat: mat4): void; + + /** + * + * @param {mat4} vmat The view matrix. + */ + computeViewParametersFromViewMatrix(vmat: mat4): void; + + /** + * Not implemented yet + * @param {vtkCamera} sourceCamera The camera source. + */ + deepCopy(sourceCamera: vtkCamera): void; + + /** + * Move the position of the camera along the view plane normal. Moving + * towards the focal point (e.g., > 1) is a dolly-in, moving away + * from the focal point (e.g., < 1) is a dolly-out. + * @param {Number} amount The amount value. + */ + dolly(amount: number): void; + + /** + * Rotate the camera about the cross product of the negative of the + * direction of projection and the view up vector, using the focal point as + * the center of rotation. + * @param {Number} angle The angle value. + */ + elevation(angle: number): void; + + /** + * Not implemented yet + */ + getCameraLightTransformMatrix(): void; + + /** + * Get the location of the near and far clipping planes along the direction + * of projection. + */ + getClippingRange(): Range; + + /** + * Get the location of the near and far clipping planes along the direction + * of projection. + */ + getClippingRangeByReference(): Range; + + /** + * + * @param {Number} aspect Camera frustum aspect ratio. + * @param {Number} nearz Camera frustum near plane. + * @param {Number} farz Camera frustum far plane. + */ + getCompositeProjectionMatrix( + aspect: number, + nearz: number, + farz: number + ): mat4; + + /** + * Get the vector in the direction from the camera position to the focal + * point. + */ + getDirectionOfProjection(): Vector3; + + /** + * Get the vector in the direction from the camera position to the focal + * point. + */ + getDirectionOfProjectionByReference(): Vector3; + + /** + * Get the distance from the camera position to the focal point. + */ + getDistance(): number; + + /** + * Get the focal of the camera in world coordinates. + */ + getFocalPoint(): Vector3; + + /** + * Get the focal of the camera in world coordinates. + */ + getFocalPointByReference(): Vector3; + + /** + * Get the value of the FreezeDolly instance variable. + */ + getFreezeFocalPoint(): boolean; + + /** + * Not implemented yet + * Get the plane equations that bound the view frustum. + * @param {Number} aspect Camera frustum aspect ratio. + */ + getFrustumPlanes(aspect: number): void; + + /** + * Not implemented yet + * Get the orientation of the camera. + */ + getOrientation(): void; + + /** + * Not implemented yet + * Get the orientation of the camera. + */ + getOrientationWXYZ(): void; + + /** + * Get the value of the ParallelProjection instance variable. + * This determines if the camera should do a perspective or parallel projection. + */ + getParallelProjection(): boolean; + + /** + * Get the scaling used for a parallel projection. + */ + getParallelScale(): number; + + /** + * + */ + getPhysicalScale(): number; + + /** + * + * @param {mat4} result The world matrix. + */ + getPhysicalToWorldMatrix(result: mat4): void; + + /** + * + */ + getPhysicalTranslation(): number[]; + + /** + * + */ + getPhysicalTranslationByReference(): number[]; + + /** + * + */ + getPhysicalViewNorth(): number[]; + + /** + * + */ + getPhysicalViewNorthByReference(): number[]; + + /** + * + */ + getPhysicalViewUp(): number[]; + + /** + * + */ + getPhysicalViewUpByReference(): number[]; + + /** + * Get the position of the camera in world coordinates. + */ + getPosition(): Vector3; + + /** + * Get the position of the camera in world coordinates. + */ + getPositionByReference(): Vector3; + + /** + * Get the projection matrix. + * @param {Number} aspect Camera frustum aspect ratio. + * @param {Number} nearz Camera frustum near plane. + * @param {Number} farz Camera frustum far plane. + */ + getProjectionMatrix(aspect: number, nearz: number, farz: number): mat4; + + /** + * Not implemented yet + * Get the roll angle of the camera about the direction of projection. + */ + getRoll(): void; + + /** + * Get top left corner point of the screen. + */ + getScreenBottomLeft(): Vector3; + + /** + * + */ + getScreenBottomLeftByReference(): Vector3; + + /** + * Get bottom left corner point of the screen + */ + getScreenBottomRight(): Vector3; + + /** + * + */ + getScreenBottomRightByReference(): Vector3; + + /** + * + */ + getScreenTopRight(): Vector3; + + /** + * + */ + getScreenTopRightByReference(): Vector3; + + /** + * Get the center of the window in viewport coordinates. + */ + getThickness(): number; + + /** + * Get the value of the UseHorizontalViewAngle. + */ + getUseHorizontalViewAngle(): boolean; + + /** + * Get use offaxis frustum. + */ + getUseOffAxisProjection(): boolean; + + /** + * Get the camera view angle. + */ + getViewAngle(): number; + + /** + * + */ + getViewMatrix(): mat4; + + /** + * Get the ViewPlaneNormal. + * This vector will point opposite to the direction of projection, + * unless you have created a sheared output view using SetViewShear/SetObliqueAngles. + */ + getViewPlaneNormal(): Vector3; + + /** + * Get the ViewPlaneNormal by reference. + */ + getViewPlaneNormalByReference(): Vector3; + + /** + * Get ViewUp vector. + */ + getViewUp(): Vector3; + + /** + * Get ViewUp vector by reference. + */ + getViewUpByReference(): Vector3; + + /** + * Get the center of the window in viewport coordinates. + * The viewport coordinate range is ([-1,+1],[-1,+1]). + */ + getWindowCenter(): Range; + + /** + * + */ + getWindowCenterByReference(): Range; + + /** + * + * @param {mat4} result + */ + getWorldToPhysicalMatrix(result: mat4): void; + + /** + * Recompute the ViewUp vector to force it to be perpendicular to + * camera.focalpoint vector. + */ + orthogonalizeViewUp(): void; + + /** + * + * @param {Number[]} ori + */ + physicalOrientationToWorldDirection(ori: number[]): any; + + /** + * Rotate the focal point about the cross product of the view up vector and + * the direction of projection, using the camera's position as the center of + * rotation. + * @param {Number} angle The value of the angle. + */ + pitch(angle: number): void; + + /** + * Rotate the camera about the direction of projection. + * @param {Number} angle The value of the angle. + */ + roll(angle: number): void; + + /** + * Set the location of the near and far clipping planes along the direction + * of projection. + * @param {Number} near The near clipping planes. + * @param {Number} far The far clipping planes. + */ + setClippingRange(near: number, far: number): boolean; + + /** + * Set the location of the near and far clipping planes along the direction + * of projection. + * @param {Range} clippingRange + */ + setClippingRange(clippingRange: Range): boolean; + + /** + * Set the location of the near and far clipping planes along the direction + * of projection. + * @param {Range} clippingRange + */ + setClippingRangeFrom(clippingRange: Range): boolean; + + /** + * Used to handle convert js device orientation angles + * when you use this method the camera will adjust to the + * device orientation such that the physicalViewUp you set + * in world coordinates looks up, and the physicalViewNorth + * you set in world coorindates will (maybe) point north + * + * NOTE WARNING - much of the documentation out there on how + * orientation works is seriously wrong. Even worse the Chrome + * device orientation simulator is completely wrong and should + * never be used. OMG it is so messed up. + * + * how it seems to work on iOS is that the device orientation + * is specified in extrinsic angles with a alpha, beta, gamma + * convention with axes of Z, X, Y (the code below substitutes + * the physical coordinate system for these axes to get the right + * modified coordinate system. + * @param {Number} alpha The value of the alpha. + * @param {Number} beta The value of the beta. + * @param {Number} gamma The value of the gamma. + * @param {Number} screen The value of the screen. + */ + setDeviceAngles( + alpha: number, + beta: number, + gamma: number, + screen: number + ): boolean; + + /** + * Set the direction of projection. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setDirectionOfProjection(x: number, y: number, z: number): boolean; + + /** + * Move the focal point so that it is the specified distance from the camera + * position. + * + * This distance must be positive. + * @param {Number} distance The value of the distance. + */ + setDistance(distance: number): boolean; + + /** + * Set the focal of the camera in world coordinates. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setFocalPoint(x: number, y: number, z: number): boolean; + + /** + * Set the focal of the camera in world coordinates. + * @param {Vector3} focalPoint + */ + setFocalPointFrom(focalPoint: Vector3): boolean; + + /** + * Set the value of the FreezeDolly instance variable. + * @param {Boolean} freezeFocalPoint + */ + setFreezeFocalPoint(freezeFocalPoint: boolean): boolean; + + /** + * Not implement yet + * Set the oblique viewing angles. + * The first angle, alpha, is the angle (measured from the horizontal) that + * rays along the direction of projection will follow once projected onto + * the 2D screen. The second angle, beta, is the angle between the view + * plane and the direction of projection. This creates a shear transform x' + * = x + dz*cos(alpha)/tan(beta), y' = dz*sin(alpha)/tan(beta) where dz is + * the distance of the point from the focal plane. The angles are (45,90) by + * default. Oblique projections commonly use (30,63.435). + * + * @param {Number} alpha The aplha angle value. + * @param {Number} beta The beta angle value. + */ + setObliqueAngles(alpha: number, beta: number): boolean; + + /** + * Set the value of the OrientationWXYZ. + * @param {Number} degrees + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setOrientationWXYZ(degrees: number, x: number, y: number, z: number): boolean; + + /** + * Set the value of the ParallelProjection. + * @param {Boolean} parallelProjection The value of the parallelProjection. + */ + setParallelProjection(parallelProjection: boolean): boolean; + + /** + * Set the value of the parallelScale. + * @param {Number} parallelScale The value of the parallelScale. + */ + setParallelScale(parallelScale: number): boolean; + + /** + * Set the value of the physicalScale. + * @param {Number} physicalScale The value of the the physicalScale. + */ + setPhysicalScale(physicalScale: number): boolean; + + /** + * Set the value of the physicalTranslation. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setPhysicalTranslation(x: number, y: number, z: number): boolean; + + /** + * Set the value of the physicalTranslation. + * @param {Number[]} physicalTranslation The value of the physicalTranslation. + */ + setPhysicalTranslationFrom(physicalTranslation: number[]): boolean; + + /** + * + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setPhysicalViewNorth(x: number, y: number, z: number): boolean; + + /** + * + * @param {Number[]} physicalViewNorth + */ + setPhysicalViewNorthFrom(physicalViewNorth: number[]): boolean; + + /** + * + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setPhysicalViewUp(x: number, y: number, z: number): boolean; + + /** + * + * @param {Number[]} physicalViewUp + */ + setPhysicalViewUpFrom(physicalViewUp: number[]): boolean; + + /** + * Set the position of the camera in world coordinates. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setPosition(x: number, y: number, z: number): boolean; + + /** + * + * @param {mat4} mat + */ + setProjectionMatrix(mat: mat4): boolean; + + /** + * Set the roll angle of the camera about the direction of projection. + * @todo Not implemented yet + * @param {Number} angle The value of the roll angle. + */ + setRoll(angle: number): boolean; + + /** + * Set top left corner point of the screen. + * + * This will be used only for offaxis frustum calculation. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setScreenBottomLeft(x: number, y: number, z: number): boolean; + + /** + * Set top left corner point of the screen. + * + * This will be used only for offaxis frustum calculation. + * @param {Vector3} screenBottomLeft The screenBottomLeft coordiante. + */ + setScreenBottomLeft(screenBottomLeft: Vector3): boolean; + + /** + * Set top left corner point of the screen. + * @param {Vector3} screenBottomLeft The screenBottomLeft coordiante. + */ + setScreenBottomLeftFrom(screenBottomLeft: Vector3): boolean; + + /** + * + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setScreenBottomRight(x: number, y: number, z: number): boolean; + + /** + * Set bottom right corner point of the screen. + * @param {Vector3} screenBottomRight The screenBottomRight coordiante. + */ + setScreenBottomRight(screenBottomRight: Vector3): boolean; + + /** + * Set bottom right corner point of the screen. + * @param {Vector3} screenBottomRight The screenBottomRight coordiante. + */ + setScreenBottomRightFrom(screenBottomRight: Vector3): boolean; + + /** + * Set top right corner point of the screen. + * + * This will be used only for offaxis frustum calculation. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setScreenTopRight(x: number, y: number, z: number): boolean; + + /** + * Set top right corner point of the screen. + * + * This will be used only for offaxis frustum calculation. + * @param {Vector3} screenTopRight The screenTopRight coordiante. + */ + setScreenTopRight(screenTopRight: Vector3): boolean; + + /** + * Set top right corner point of the screen. + * @param {Vector3} screenTopRight The screenTopRight coordiante. + */ + setScreenTopRightFrom(screenTopRight: Vector3): boolean; + + /** + * Set the distance between clipping planes. + * + * This method adjusts the far clipping plane to be set a distance + * 'thickness' beyond the near clipping plane. + * @param {Number} thickness + */ + setThickness(thickness: number): boolean; + + /** + * + * @param {Number} thickness The value of the thickness. + */ + setThicknessFromFocalPoint(thickness: number): boolean; + + /** + * Set the value of the useHorizontalViewAngle. + * @param {Boolean} useHorizontalViewAngle The value of the useHorizontalViewAngle. + */ + setUseHorizontalViewAngle(useHorizontalViewAngle: boolean): boolean; + + /** + * Set use offaxis frustum. + * + * OffAxis frustum is used for off-axis frustum calculations specifically for + * stereo rendering. For reference see "High Resolution Virtual Reality", in + * Proc. SIGGRAPH '92, Computer Graphics, pages 195-202, 1992. + * @param {Boolean} useOffAxisProjection The value of the useOffAxisProjection. + */ + setUseOffAxisProjection(useOffAxisProjection: boolean): boolean; + + /** + * Set the camera view angle, which is the angular height of the camera view + * measured in degrees. + * @param {Number} viewAngle The value of the viewAngle. + */ + setViewAngle(viewAngle: number): boolean; + + /** + * Set the view matrix for the camera. + * @param {mat4} mat The value of the view matrix. + */ + setViewMatrix(mat: mat4): boolean; + + /** + * Set the view up direction for the camera. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setViewUp(x: number, y: number, z: number): boolean; + + /** + * Set the view up direction for the camera. + * @param {Vector3} viewUp The viewUp coordinate. + */ + setViewUp(viewUp: Vector3): boolean; + + /** + * Set the view up direction for the camera. + * @param {Vector3} viewUp The viewUp coordinate. + */ + setViewUpFrom(viewUp: Vector3): boolean; + + /** + * Set the center of the window in viewport coordinates. + * + * The viewport coordinate range is ([-1,+1],[-1,+1]). + * + * This method is for if you have one window which consists of several + * viewports, or if you have several screens which you want to act together + * as one large screen. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + */ + setWindowCenter(x: number, y: number): boolean; + + /** + * Set the center of the window in viewport coordinates from an array. + * @param {Range} windowCenter + */ + setWindowCenterFrom(windowCenter: Range): boolean; + + /** + * + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + translate(x: number, y: number, z: number): void; + + /** + * Rotate the focal point about the view up vector, using the camera's + * position as the center of rotation. + * @param {Number} angle The value of the angle. + */ + yaw(angle: number): void; + + /** + * In perspective mode, decrease the view angle by the specified factor. + * @param {Number} factor The value of the zoom factor. + */ + zoom(factor: number): void; } /** @@ -736,25 +744,29 @@ export interface vtkCamera extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {ICameraInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ICameraInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ICameraInitialValues +): void; /** - * Method use to create a new instance of vtkCamera with its focal point at the origin, - * and position=(0,0,1). The view up is along the y-axis, view angle is 30 degrees, + * Method use to create a new instance of vtkCamera with its focal point at the origin, + * and position=(0,0,1). The view up is along the y-axis, view angle is 30 degrees, * and the clipping range is (.1,1000). * @param {ICameraInitialValues} [initialValues] for pre-setting some of its content */ export function newInstance(initialValues?: ICameraInitialValues): vtkCamera; -/** +/** * vtkCamera is a virtual camera for 3D rendering. It provides methods * to position and orient the view point and focal point. Convenience * methods for moving about the focal point also are provided. More - * complex methods allow the manipulation of the computer graphics model + * complex methods allow the manipulation of the computer graphics model * including view up vector, clipping planes, and camera perspective. */ export declare const vtkCamera: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkCamera; diff --git a/Sources/Rendering/Core/CellPicker/index.d.ts b/Sources/Rendering/Core/CellPicker/index.d.ts index 92fb59eac3b..e7710f1bbad 100755 --- a/Sources/Rendering/Core/CellPicker/index.d.ts +++ b/Sources/Rendering/Core/CellPicker/index.d.ts @@ -4,87 +4,91 @@ import vtkMapper from '../Mapper'; import vtkPicker, { IPickerInitialValues } from '../Picker'; import vtkProp3D from '../Prop3D'; import vtkRenderer from '../Renderer'; -import { Nullable } from "../../../types"; +import { Nullable } from '../../../types'; /** - * + * */ export interface ICellPickerInitialValues extends IPickerInitialValues { - cellId?: number; - pCoords?: Vector3; - cellIJK?: number[]; - pickNormal?: number[]; - mapperNormal?: number[]; - opacityThreshold?:number; + cellId?: number; + pCoords?: Vector3; + cellIJK?: number[]; + pickNormal?: number[]; + mapperNormal?: number[]; + opacityThreshold?: number; } export interface vtkCellPicker extends vtkPicker { - - /** - * Get the structured coordinates of the cell at the PickPosition. - */ - getCellIJK(): number[]; - - /** - * Get the structured coordinates of the cell at the PickPosition. - */ - getCellIJKByReference(): number[]; - - /** - * Get the id of the picked cell. - */ - getCellId(): number; - - /** - * - */ - getMapperNormal(): number[]; - - /** - * - */ - getMapperNormalByReference(): number[]; - - /** - * Get the opacity threshold for volume picking - */ - getOpacityThreshold(): number; - - /** - * Get the opacity threshold for volume picking - */ - setOpacityThreshold(value: number); - - /** - * Get the parametric coordinates of the picked cell. - */ - getPCoords(): number[]; - - /** - * - */ - getPCoordsByReference(): number[]; - - /** - * - */ - initialize(): void; - - /** - * - * @param data - * @param {vtkCell} cell - * @param {Number[]} weights - * @param {Number[]} normal - */ - computeSurfaceNormal(data: any, cell: vtkCell, weights: number[], normal: number[]): boolean; - - /** - * - * @param selection - * @param {vtkRenderer} renderer The vtkRenderer instance. - */ - pick(selection: any, renderer: vtkRenderer): void; + /** + * Get the structured coordinates of the cell at the PickPosition. + */ + getCellIJK(): number[]; + + /** + * Get the structured coordinates of the cell at the PickPosition. + */ + getCellIJKByReference(): number[]; + + /** + * Get the id of the picked cell. + */ + getCellId(): number; + + /** + * + */ + getMapperNormal(): number[]; + + /** + * + */ + getMapperNormalByReference(): number[]; + + /** + * Get the opacity threshold for volume picking + */ + getOpacityThreshold(): number; + + /** + * Get the opacity threshold for volume picking + */ + setOpacityThreshold(value: number); + + /** + * Get the parametric coordinates of the picked cell. + */ + getPCoords(): number[]; + + /** + * + */ + getPCoordsByReference(): number[]; + + /** + * + */ + initialize(): void; + + /** + * + * @param data + * @param {vtkCell} cell + * @param {Number[]} weights + * @param {Number[]} normal + */ + computeSurfaceNormal( + data: any, + cell: vtkCell, + weights: number[], + normal: number[] + ): boolean; + + /** + * + * @param selection + * @param {vtkRenderer} renderer The vtkRenderer instance. + */ + pick(selection: any, renderer: vtkRenderer): void; } /** @@ -94,16 +98,22 @@ export interface vtkCellPicker extends vtkPicker { * @param model object on which data structure will be bounds (protected) * @param {ICellPickerInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ICellPickerInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ICellPickerInitialValues +): void; /** * Method use to create a new instance of vtkCellPicker * @param {ICellPickerInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ICellPickerInitialValues): vtkCellPicker; +export function newInstance( + initialValues?: ICellPickerInitialValues +): vtkCellPicker; export declare const vtkCellPicker: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkCellPicker; diff --git a/Sources/Rendering/Core/ColorTransferFunction/Constants.d.ts b/Sources/Rendering/Core/ColorTransferFunction/Constants.d.ts index 53eb6efeb72..ba0470fb15b 100644 --- a/Sources/Rendering/Core/ColorTransferFunction/Constants.d.ts +++ b/Sources/Rendering/Core/ColorTransferFunction/Constants.d.ts @@ -11,7 +11,7 @@ export declare enum Scale { } declare const _default: { - ColorSpace: typeof ColorSpace; - Scale: typeof Scale; + ColorSpace: typeof ColorSpace; + Scale: typeof Scale; }; export default _default; diff --git a/Sources/Rendering/Core/ColorTransferFunction/CssFilters.d.ts b/Sources/Rendering/Core/ColorTransferFunction/CssFilters.d.ts index 32a4c0e557a..74244f58252 100644 --- a/Sources/Rendering/Core/ColorTransferFunction/CssFilters.d.ts +++ b/Sources/Rendering/Core/ColorTransferFunction/CssFilters.d.ts @@ -15,7 +15,7 @@ * [R, G, B, A, 1] vectors, with each channel between 0 and 1. */ -import { Matrix, Vector3 } from "../../../types"; +import { Matrix, Vector3 } from '../../../types'; export const luminanceWeights: Vector3; export type FilterMatrix = Matrix; @@ -44,7 +44,11 @@ export function createIdentityFilter(outFilter?: FilterMatrix): FilterMatrix; * @param newFilter The second filter that will be applied * @param outFilter An optional filter that will contain the combined filter */ -export function combineFilters(baseFilter: FilterMatrix, newFilter: FilterMatrix, outFilter?: FilterMatrix): FilterMatrix; +export function combineFilters( + baseFilter: FilterMatrix, + newFilter: FilterMatrix, + outFilter?: FilterMatrix +): FilterMatrix; /** * Apply a filter to a rgb(a) point @@ -56,54 +60,76 @@ export function combineFilters(baseFilter: FilterMatrix, newFilter: FilterMatrix * @param a The optional alpha channel (between 0 and 1), defaults to 1 * @returns A vector of size 4 [r, g, b, a] */ -export function applyFilter(filter: FilterMatrix, r: number, g: number, b: number, a?: number): [number, number, number, number]; +export function applyFilter( + filter: FilterMatrix, + r: number, + g: number, + b: number, + a?: number +): [number, number, number, number]; /** * A generic linear filter * See svg equivalent for parameters and a specification * https://www.w3.org/TR/filter-effects-1/#attr-valuedef-type-linear - * @param slope - * @param intercept + * @param slope + * @param intercept * @param outFilter Optional output, a new filter is created if not specified */ -export function createLinearFilter(slope: number, intercept: number, outFilter?: FilterMatrix): FilterMatrix; +export function createLinearFilter( + slope: number, + intercept: number, + outFilter?: FilterMatrix +): FilterMatrix; /** * A contrast filter * See css/svg equivalent for parameters and a specification * https://www.w3.org/TR/filter-effects-1/#contrastEquivalent * https://www.w3.org/TR/filter-effects-1/#attr-valuedef-type-linear - * @param contrast + * @param contrast * @param outFilter Optional output, a new filter is created if not specified */ -export function createContrastFilter(contrast: number, outFilter?: FilterMatrix): FilterMatrix; +export function createContrastFilter( + contrast: number, + outFilter?: FilterMatrix +): FilterMatrix; /** * A saturate filter * See css/svg equivalent for parameters and a specification * https://www.w3.org/TR/filter-effects-1/#saturateEquivalent * https://www.w3.org/TR/filter-effects-1/#ref-for-attr-valuedef-type-saturate - * @param saturate + * @param saturate * @param outFilter Optional output, a new filter is created if not specified */ -export function createSaturateFilter(saturate: number, outFilter?: FilterMatrix): FilterMatrix; +export function createSaturateFilter( + saturate: number, + outFilter?: FilterMatrix +): FilterMatrix; /** * A brightness filter * See css/svg equivalent for parameters and a specification * https://www.w3.org/TR/filter-effects-1/#brightnessEquivalent * https://www.w3.org/TR/filter-effects-1/#attr-valuedef-type-linear - * @param brightness + * @param brightness * @param outFilter Optional output, a new filter is created if not specified */ -export function createBrightnessFilter(brightness: number, outFilter?: FilterMatrix): FilterMatrix; +export function createBrightnessFilter( + brightness: number, + outFilter?: FilterMatrix +): FilterMatrix; /** * An invert filter * See css/svg equivalent for parameters and a specification * https://www.w3.org/TR/filter-effects-1/#invertEquivalent * https://www.w3.org/TR/filter-effects-1/#attr-valuedef-type-table - * @param invert + * @param invert * @param outFilter Optional output, a new filter is created if not specified */ -export function createInvertFilter(invert: number, outFilter?: FilterMatrix): FilterMatrix; +export function createInvertFilter( + invert: number, + outFilter?: FilterMatrix +): FilterMatrix; diff --git a/Sources/Rendering/Core/ColorTransferFunction/index.d.ts b/Sources/Rendering/Core/ColorTransferFunction/index.d.ts index 66818db4a09..afebe900443 100755 --- a/Sources/Rendering/Core/ColorTransferFunction/index.d.ts +++ b/Sources/Rendering/Core/ColorTransferFunction/index.d.ts @@ -1,7 +1,6 @@ import vtkDataArray from '../../../Common/Core/DataArray'; -import vtkScalarsToColors from '../../../Common/Core/ScalarsToColors' -import { ColorSpace, Scale } from "./Constants"; - +import vtkScalarsToColors from '../../../Common/Core/ScalarsToColors'; +import { ColorSpace, Scale } from './Constants'; export interface vtkColorTransferFunction extends vtkScalarsToColors { /** @@ -209,16 +208,14 @@ export interface vtkColorTransferFunction extends vtkScalarsToColors { * 4 -> XRGB * 5 -> RGBMS * 6 -> XRGBMS - * + * * X represents the input value to a function * RGB represents the red, green, and blue value output * M represents the midpoint * S represents sharpness * @param {vtkDataArray} array */ - buildFunctionFromArray( - array: vtkDataArray, - ): void; + buildFunctionFromArray(array: vtkDataArray): void; /** * Construct a color transfer function from a table. diff --git a/Sources/Rendering/Core/Coordinate/Constants.d.ts b/Sources/Rendering/Core/Coordinate/Constants.d.ts index d1cfff88841..8f4b98d8a0a 100644 --- a/Sources/Rendering/Core/Coordinate/Constants.d.ts +++ b/Sources/Rendering/Core/Coordinate/Constants.d.ts @@ -9,6 +9,6 @@ export declare enum Coordinate { } declare const _default: { - Coordinate: typeof Coordinate; + Coordinate: typeof Coordinate; }; export default _default; diff --git a/Sources/Rendering/Core/Coordinate/index.d.ts b/Sources/Rendering/Core/Coordinate/index.d.ts index 410165bad32..4b6b6a933de 100755 --- a/Sources/Rendering/Core/Coordinate/index.d.ts +++ b/Sources/Rendering/Core/Coordinate/index.d.ts @@ -1,158 +1,156 @@ -import { vtkObject, vtkProperty } from "../../../interfaces"; +import { vtkObject, vtkProperty } from '../../../interfaces'; import vtkRenderer from '../Renderer'; -import { Coordinate } from "./Constants"; - +import { Coordinate } from './Constants'; /** * */ export interface ICoordinateInitialValues { - coordinateSystem?: number, - value?: number[], - renderer?: vtkRenderer, - referenceCoordinate?: any, - computing?: number, - computedWorldValue?: number[], - computedDoubleDisplayValue?: number[], + coordinateSystem?: number; + value?: number[]; + renderer?: vtkRenderer; + referenceCoordinate?: any; + computing?: number; + computedWorldValue?: number[]; + computedDoubleDisplayValue?: number[]; } export interface vtkCoordinate extends vtkObject { - - /** - * - * @param {vtkRenderer} ren The vtkRenderer instance. - */ - getComputedWorldValue(ren: vtkRenderer): number[]; - - /** - * - * @param {vtkRenderer} ren The vtkRenderer instance. - */ - getComputedViewportValue(ren: vtkRenderer): number[]; - - /** - * - * @param {vtkRenderer} ren The vtkRenderer instance. - */ - getComputedDisplayValue(ren: vtkRenderer): number[]; - - /** - * - * @param {vtkRenderer} ren The vtkRenderer instance. - */ - getComputedLocalDisplayValue(ren: vtkRenderer): number[]; - - /** - * - * @param {vtkRenderer} ren The vtkRenderer instance. - */ - getComputedValue(ren: vtkRenderer): number[]; - - /** - * - * @param {vtkRenderer} ren The vtkRenderer instance. - */ - getComputedDoubleViewportValue(ren: vtkRenderer): number[]; - - /** - * - * @param {vtkRenderer} ren The vtkRenderer instance. - */ - getComputedDoubleDisplayValue(ren: vtkRenderer): number[]; - - /** - * Get the coordinate system which this coordinate is defined in. The - * options are Display, Normalized Display, Viewport, Normalized Viewport, - * View, and World. - */ - getCoordinateSystem(): Coordinate; - - /** - * Get the coordinate system which this coordinate is defined in as string. - */ - getCoordinateSystemAsString(): string; - - /** - * Get the value of this coordinate. - */ - getValue(): number[]; - - /** - * - */ - getReferenceCoordinate(): vtkCoordinate; - - /** - * Get mapper that was picked (if any) - */ - getRenderer(): vtkRenderer; - - /** - * Set the coordinate system which this coordinate is defined in. The - * options are Display, Normalized Display, Viewport, Normalized Viewport, - * View, and World. - * @param {Coordinate} coordinateSystem - */ - setCoordinateSystem(coordinateSystem: Coordinate): boolean - - /** - * Set the coordinate system to Coordinate.DISPLAY - */ - setCoordinateSystemToDisplay(): void; - - /** - * Set the coordinate system to Coordinate.NORMALIZED_DISPLAY - */ - setCoordinateSystemToNormalizedDisplay(): void; - - /** - * Set the coordinate system to Coordinate.NORMALIZED_VIEWPORT - */ - setCoordinateSystemToNormalizedViewport(): void; - - /** - * Set the coordinate system to Coordinate.PROJECTION - */ - setCoordinateSystemToProjection(): void; - - /** - * Set the coordinate system to Coordinate.VIEW - */ - setCoordinateSystemToView(): void; - - /** - * Set the coordinate system to Coordinate.VIEWPORT - */ - setCoordinateSystemToViewport(): void; - - /** - * Set the coordinate system to Coordinate.WORLD - */ - setCoordinateSystemToWorld(): void; - - /** - * - * @param {vtkProperty} property - */ - setProperty(property: vtkProperty): boolean; - - /** - * - * @param {vtkCoordinate} referenceCoordinate - */ - setReferenceCoordinate(referenceCoordinate: vtkCoordinate): boolean; - - /** - * - * @param {vtkRenderer} renderer - */ - setRenderer(renderer: vtkRenderer): boolean; - - /** - * Set the value of this coordinate. - * @param value - */ - setValue(value: number[]): boolean; + /** + * + * @param {vtkRenderer} ren The vtkRenderer instance. + */ + getComputedWorldValue(ren: vtkRenderer): number[]; + + /** + * + * @param {vtkRenderer} ren The vtkRenderer instance. + */ + getComputedViewportValue(ren: vtkRenderer): number[]; + + /** + * + * @param {vtkRenderer} ren The vtkRenderer instance. + */ + getComputedDisplayValue(ren: vtkRenderer): number[]; + + /** + * + * @param {vtkRenderer} ren The vtkRenderer instance. + */ + getComputedLocalDisplayValue(ren: vtkRenderer): number[]; + + /** + * + * @param {vtkRenderer} ren The vtkRenderer instance. + */ + getComputedValue(ren: vtkRenderer): number[]; + + /** + * + * @param {vtkRenderer} ren The vtkRenderer instance. + */ + getComputedDoubleViewportValue(ren: vtkRenderer): number[]; + + /** + * + * @param {vtkRenderer} ren The vtkRenderer instance. + */ + getComputedDoubleDisplayValue(ren: vtkRenderer): number[]; + + /** + * Get the coordinate system which this coordinate is defined in. The + * options are Display, Normalized Display, Viewport, Normalized Viewport, + * View, and World. + */ + getCoordinateSystem(): Coordinate; + + /** + * Get the coordinate system which this coordinate is defined in as string. + */ + getCoordinateSystemAsString(): string; + + /** + * Get the value of this coordinate. + */ + getValue(): number[]; + + /** + * + */ + getReferenceCoordinate(): vtkCoordinate; + + /** + * Get mapper that was picked (if any) + */ + getRenderer(): vtkRenderer; + + /** + * Set the coordinate system which this coordinate is defined in. The + * options are Display, Normalized Display, Viewport, Normalized Viewport, + * View, and World. + * @param {Coordinate} coordinateSystem + */ + setCoordinateSystem(coordinateSystem: Coordinate): boolean; + + /** + * Set the coordinate system to Coordinate.DISPLAY + */ + setCoordinateSystemToDisplay(): void; + + /** + * Set the coordinate system to Coordinate.NORMALIZED_DISPLAY + */ + setCoordinateSystemToNormalizedDisplay(): void; + + /** + * Set the coordinate system to Coordinate.NORMALIZED_VIEWPORT + */ + setCoordinateSystemToNormalizedViewport(): void; + + /** + * Set the coordinate system to Coordinate.PROJECTION + */ + setCoordinateSystemToProjection(): void; + + /** + * Set the coordinate system to Coordinate.VIEW + */ + setCoordinateSystemToView(): void; + + /** + * Set the coordinate system to Coordinate.VIEWPORT + */ + setCoordinateSystemToViewport(): void; + + /** + * Set the coordinate system to Coordinate.WORLD + */ + setCoordinateSystemToWorld(): void; + + /** + * + * @param {vtkProperty} property + */ + setProperty(property: vtkProperty): boolean; + + /** + * + * @param {vtkCoordinate} referenceCoordinate + */ + setReferenceCoordinate(referenceCoordinate: vtkCoordinate): boolean; + + /** + * + * @param {vtkRenderer} renderer + */ + setRenderer(renderer: vtkRenderer): boolean; + + /** + * Set the value of this coordinate. + * @param value + */ + setValue(value: number[]): boolean; } /** @@ -163,14 +161,20 @@ export interface vtkCoordinate extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {ICoordinateInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ICoordinateInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ICoordinateInitialValues +): void; /** * Method use to create a new instance of vtkCoordinate * @param {ICoordinateInitialValues} [initialValues] for pre-setting some of its * content */ -export function newInstance(initialValues?: ICoordinateInitialValues): vtkCoordinate; +export function newInstance( + initialValues?: ICoordinateInitialValues +): vtkCoordinate; /** * vtkCoordinate represents position in a variety of coordinate systems, and @@ -210,7 +214,7 @@ export function newInstance(initialValues?: ICoordinateInitialValues): vtkCoordi * create composite groups of things like vtkActor2D that are positioned * relative to one another. * - * !!! note + * !!! note * In cascaded sequences, each vtkCoordinate object may be specified in different coordinate systems! * * How the data may go from a dataset through the rendering pipeline in steps @@ -243,8 +247,8 @@ export function newInstance(initialValues?: ICoordinateInitialValues): vtkCoordi * @see [vtkActor](./Rendering_Core_Actor.html)2D */ export declare const vtkCoordinate: { - newInstance: typeof newInstance; - extend: typeof extend; - Coordinate: typeof Coordinate; + newInstance: typeof newInstance; + extend: typeof extend; + Coordinate: typeof Coordinate; }; export default vtkCoordinate; diff --git a/Sources/Rendering/Core/Follower/index.d.ts b/Sources/Rendering/Core/Follower/index.d.ts index d8efeff6cbd..e5bd8846d5c 100755 --- a/Sources/Rendering/Core/Follower/index.d.ts +++ b/Sources/Rendering/Core/Follower/index.d.ts @@ -1,63 +1,62 @@ -import vtkActor, { IActorInitialValues } from "../Actor"; -import vtkCamera from '../Camera'; +import vtkActor, { IActorInitialValues } from '../Actor'; +import vtkCamera from '../Camera'; /** - * + * */ export interface IFollowerInitialValues extends IActorInitialValues { - viewUp?: number[], - useViewUp?: boolean, - camera?: vtkCamera, + viewUp?: number[]; + useViewUp?: boolean; + camera?: vtkCamera; } /** - * + * */ export interface vtkFollower extends vtkActor { + /** + * Generate the matrix based on ivars. + */ + computeMatrix(): void; - /** - * Generate the matrix based on ivars. - */ - computeMatrix(): void; - - /** - * Get the camera to follow. - */ - getCamera(): vtkCamera; + /** + * Get the camera to follow. + */ + getCamera(): vtkCamera; - /** - * Check whether the view up vector is used. - */ - getUseViewUp(): boolean; + /** + * Check whether the view up vector is used. + */ + getUseViewUp(): boolean; - /** - * Get the view up vector. - */ - getViewUp(): number[]; + /** + * Get the view up vector. + */ + getViewUp(): number[]; - /** - * Get a reference to the view up vector. - */ - getViewUpByReference(): number[]; + /** + * Get a reference to the view up vector. + */ + getViewUpByReference(): number[]; - /** - * Set the camera to follow. - * If this is not set, then the follower won't know what to follow. - * @param {vtkCamera} camera - */ - setCamera(camera: vtkCamera): boolean; + /** + * Set the camera to follow. + * If this is not set, then the follower won't know what to follow. + * @param {vtkCamera} camera + */ + setCamera(camera: vtkCamera): boolean; - /** - * Set whether to use the view up vector. - * @param {Boolean} useViewUp - */ - setUseViewUp(useViewUp: boolean): boolean; + /** + * Set whether to use the view up vector. + * @param {Boolean} useViewUp + */ + setUseViewUp(useViewUp: boolean): boolean; - /** - * Set the viewUp vector. - * @param {Number[]} viewUp The view up vector. - */ - setViewUp(viewUp: number[]): boolean; + /** + * Set the viewUp vector. + * @param {Number[]} viewUp The view up vector. + */ + setViewUp(viewUp: number[]): boolean; } /** @@ -67,13 +66,19 @@ export interface vtkFollower extends vtkActor { * @param model object on which data structure will be bounds (protected) * @param {IFollowerInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IFollowerInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IFollowerInitialValues +): void; /** * Method use to create a new instance of vtkFollower * @param {IFollowerInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IFollowerInitialValues): vtkFollower; +export function newInstance( + initialValues?: IFollowerInitialValues +): vtkFollower; /** * vtkFollower is a subclass of Actor that always faces the camera. @@ -91,7 +96,7 @@ export function newInstance(initialValues?: IFollowerInitialValues): vtkFollower * relative to a constant view up vector. */ export declare const vtkFollower: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkFollower; diff --git a/Sources/Rendering/Core/Glyph3DMapper/Constants.d.ts b/Sources/Rendering/Core/Glyph3DMapper/Constants.d.ts index bd65854481a..59369bb1188 100644 --- a/Sources/Rendering/Core/Glyph3DMapper/Constants.d.ts +++ b/Sources/Rendering/Core/Glyph3DMapper/Constants.d.ts @@ -1,17 +1,17 @@ export declare enum OrientationModes { - DIRECTION = 0, - ROTATION = 1, - MATRIX = 2, + DIRECTION = 0, + ROTATION = 1, + MATRIX = 2, } export declare enum ScaleModes { - SCALE_BY_CONSTANT = 0, - SCALE_BY_MAGNITUDE = 1, - SCALE_BY_COMPONENTS = 2, + SCALE_BY_CONSTANT = 0, + SCALE_BY_MAGNITUDE = 1, + SCALE_BY_COMPONENTS = 2, } declare const _default: { - OrientationModes: typeof OrientationModes; - ScaleModes: typeof ScaleModes; + OrientationModes: typeof OrientationModes; + ScaleModes: typeof ScaleModes; }; export default _default; diff --git a/Sources/Rendering/Core/Glyph3DMapper/index.d.ts b/Sources/Rendering/Core/Glyph3DMapper/index.d.ts index 6281beb9fc7..cdc225a1147 100755 --- a/Sources/Rendering/Core/Glyph3DMapper/index.d.ts +++ b/Sources/Rendering/Core/Glyph3DMapper/index.d.ts @@ -1,156 +1,153 @@ -import { Bounds, Nullable, vtkPipelineConnection } from "../../../types"; -import vtkMapper, { IMapperInitialValues } from "../Mapper"; -import { OrientationModes, ScaleModes } from "./Constants"; - +import { Bounds, Nullable, vtkPipelineConnection } from '../../../types'; +import vtkMapper, { IMapperInitialValues } from '../Mapper'; +import { OrientationModes, ScaleModes } from './Constants'; interface IPrimitiveCount { - points: number; - verts: number; - lines: number; - triangles: number; + points: number; + verts: number; + lines: number; + triangles: number; } export interface IGlyph3DMapperInitialValues extends IMapperInitialValues { - orient?: boolean, - orientationMode?: OrientationModes, - orientationArray?: number[], - scaling?: boolean, - scaleFactor?: number, - scaleMode?: ScaleModes, - scaleArray?: number[], - matrixArray?: number[], - normalArray?: number[], - colorArray?: number[], + orient?: boolean; + orientationMode?: OrientationModes; + orientationArray?: number[]; + scaling?: boolean; + scaleFactor?: number; + scaleMode?: ScaleModes; + scaleArray?: number[]; + matrixArray?: number[]; + normalArray?: number[]; + colorArray?: number[]; } export interface vtkGlyph3DMapper extends vtkMapper { - - /** - * An orientation array is a vtkDataArray with 3 components. The first - * component is the angle of rotation along the X axis. The second component - * is the angle of rotation along the Y axis. The third component is the - * angle of rotation along the Z axis. Orientation is specified in X,Y,Z - * order but the rotations are performed in Z,X an Y. - * - * This definition is compliant with SetOrientation method on vtkProp3D. - * - * By using vector or normal there is a degree of freedom or rotation left - * (underconstrained). With the orientation array, there is no degree of - * freedom left. - */ - getOrientationMode(): OrientationModes; - - /** - * Get orientation as string - */ - getOrientationModeAsString(): string; - - /** - * Get orientation as array - */ - getOrientationArrayData(): number[]; - - /** - * Get scale factor to scale object by. - */ - getScaleFactor(): number; - - /** - * Get scale mode - * @default `SCALE_BY_MAGNITUDE` - */ - getScaleMode(): ScaleModes; - - /** - * Get scale mode as string - */ - getScaleModeAsString(): string; - - /** - * Get scale mode as array - */ - getScaleArrayData(): number[]; - - /** - * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @return {Bounds} The bounds for the mapper. - */ - getBounds(): Bounds; - - /** - * - */ - buildArrays(): void; - - /** - * - */ - getPrimitiveCount(): IPrimitiveCount; - - /** - * Sets the name of the array to use as orientation. - * @param {String} arrayName Name of the array - */ - setOrientationArray(arrayName: Nullable): boolean; - - /** - * Orientation mode indicates if the OrientationArray provides the direction - * vector for the orientation or the rotations around each axes. - * @param {OrientationModes} orientationMode The orientation mode. - */ - setOrientationMode(orientationMode: OrientationModes): boolean; - - /** - * Set orientation mode to `DIRECTION` - */ - setOrientationModeToDirection(): boolean; - - /** - * Set orientation mode to `ROTATION` - */ - setOrientationModeToRotation(): boolean; - - /** - * Set orientation mode to `MATRIX` - */ - setOrientationModeToMatrix(): boolean; - - /** - * Specify scale factor to scale object by. - * @param {Number} scaleFactor The value of the scale factor. - */ - setScaleFactor(scaleFactor: number): boolean; - - /** - * Either scale by individual components (`SCALE_BY_COMPONENTS`) or magnitude - * (`SCALE_BY_MAGNITUDE`) of the chosen array to `SCALE` with or disable scaling - * using data array all together (`SCALE_BY_MAGNITUDE`). - * @param {ScaleModes} scaleMode - * @default SCALE_BY_MAGNITUDE - */ - setScaleMode(scaleMode: ScaleModes): boolean; - - /** - * Set scale to `SCALE_BY_MAGNITUDE` - */ - setScaleModeToScaleByMagnitude(): boolean; - - /** - * Set scale to `SCALE_BY_CONSTANT` - */ - setScaleModeToScaleByComponents(): boolean; - - /** - * Set scale to `SCALE_BY_CONSTANT` - */ - setScaleModeToScaleByConstant(): boolean; - - /** - * Convenient method to set the source glyph connection - * @param {vtkPipelineConnection} outputPort The output port of the glyph source. - */ - setSourceConnection(outputPort: vtkPipelineConnection): void; - + /** + * An orientation array is a vtkDataArray with 3 components. The first + * component is the angle of rotation along the X axis. The second component + * is the angle of rotation along the Y axis. The third component is the + * angle of rotation along the Z axis. Orientation is specified in X,Y,Z + * order but the rotations are performed in Z,X an Y. + * + * This definition is compliant with SetOrientation method on vtkProp3D. + * + * By using vector or normal there is a degree of freedom or rotation left + * (underconstrained). With the orientation array, there is no degree of + * freedom left. + */ + getOrientationMode(): OrientationModes; + + /** + * Get orientation as string + */ + getOrientationModeAsString(): string; + + /** + * Get orientation as array + */ + getOrientationArrayData(): number[]; + + /** + * Get scale factor to scale object by. + */ + getScaleFactor(): number; + + /** + * Get scale mode + * @default `SCALE_BY_MAGNITUDE` + */ + getScaleMode(): ScaleModes; + + /** + * Get scale mode as string + */ + getScaleModeAsString(): string; + + /** + * Get scale mode as array + */ + getScaleArrayData(): number[]; + + /** + * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @return {Bounds} The bounds for the mapper. + */ + getBounds(): Bounds; + + /** + * + */ + buildArrays(): void; + + /** + * + */ + getPrimitiveCount(): IPrimitiveCount; + + /** + * Sets the name of the array to use as orientation. + * @param {String} arrayName Name of the array + */ + setOrientationArray(arrayName: Nullable): boolean; + + /** + * Orientation mode indicates if the OrientationArray provides the direction + * vector for the orientation or the rotations around each axes. + * @param {OrientationModes} orientationMode The orientation mode. + */ + setOrientationMode(orientationMode: OrientationModes): boolean; + + /** + * Set orientation mode to `DIRECTION` + */ + setOrientationModeToDirection(): boolean; + + /** + * Set orientation mode to `ROTATION` + */ + setOrientationModeToRotation(): boolean; + + /** + * Set orientation mode to `MATRIX` + */ + setOrientationModeToMatrix(): boolean; + + /** + * Specify scale factor to scale object by. + * @param {Number} scaleFactor The value of the scale factor. + */ + setScaleFactor(scaleFactor: number): boolean; + + /** + * Either scale by individual components (`SCALE_BY_COMPONENTS`) or magnitude + * (`SCALE_BY_MAGNITUDE`) of the chosen array to `SCALE` with or disable scaling + * using data array all together (`SCALE_BY_MAGNITUDE`). + * @param {ScaleModes} scaleMode + * @default SCALE_BY_MAGNITUDE + */ + setScaleMode(scaleMode: ScaleModes): boolean; + + /** + * Set scale to `SCALE_BY_MAGNITUDE` + */ + setScaleModeToScaleByMagnitude(): boolean; + + /** + * Set scale to `SCALE_BY_CONSTANT` + */ + setScaleModeToScaleByComponents(): boolean; + + /** + * Set scale to `SCALE_BY_CONSTANT` + */ + setScaleModeToScaleByConstant(): boolean; + + /** + * Convenient method to set the source glyph connection + * @param {vtkPipelineConnection} outputPort The output port of the glyph source. + */ + setSourceConnection(outputPort: vtkPipelineConnection): void; } /** @@ -160,18 +157,24 @@ export interface vtkGlyph3DMapper extends vtkMapper { * @param model object on which data structure will be bounds (protected) * @param {IGlyph3DMapperInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IGlyph3DMapperInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IGlyph3DMapperInitialValues +): void; /** * Method use to create a new instance of vtkGlyph3DMapper * @param {IGlyph3DMapperInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IGlyph3DMapperInitialValues): vtkGlyph3DMapper; +export function newInstance( + initialValues?: IGlyph3DMapperInitialValues +): vtkGlyph3DMapper; export declare const vtkGlyph3DMapper: { - newInstance: typeof newInstance; - extend: typeof extend; - OrientationModes: typeof OrientationModes; - ScaleModes: typeof ScaleModes; -} + newInstance: typeof newInstance; + extend: typeof extend; + OrientationModes: typeof OrientationModes; + ScaleModes: typeof ScaleModes; +}; export default vtkGlyph3DMapper; diff --git a/Sources/Rendering/Core/ImageArrayMapper/index.d.ts b/Sources/Rendering/Core/ImageArrayMapper/index.d.ts index 5ac3fd3d03e..7c1a6f8dddd 100644 --- a/Sources/Rendering/Core/ImageArrayMapper/index.d.ts +++ b/Sources/Rendering/Core/ImageArrayMapper/index.d.ts @@ -1,225 +1,243 @@ -import vtkAbstractImageMapper, { IAbstractImageMapperInitialValues } from "../AbstractImageMapper"; -import IClosestIJKAxis from "../ImageMapper"; -import { Bounds, Nullable } from "../../../types"; -import { SlicingMode } from "../ImageMapper/Constants"; -import vtkImageData from "../../../Common/DataModel/ImageData"; -import vtkCollection from "../../../Common/DataModel/Collection"; - +import vtkAbstractImageMapper, { + IAbstractImageMapperInitialValues, +} from '../AbstractImageMapper'; +import IClosestIJKAxis from '../ImageMapper'; +import { Bounds, Nullable } from '../../../types'; +import { SlicingMode } from '../ImageMapper/Constants'; +import vtkImageData from '../../../Common/DataModel/ImageData'; +import vtkCollection from '../../../Common/DataModel/Collection'; interface ICoincidentTopology { - factor: number; - offset: number; + factor: number; + offset: number; } interface ISliceToSubSlice { - imageIndex: number; - subSlice: number; + imageIndex: number; + subSlice: number; } -export interface IImageArrayMapperInitialValues extends IAbstractImageMapperInitialValues { - slicingMode: SlicingMode.K, - sliceToSubSliceMap: ISliceToSubSlice[], +export interface IImageArrayMapperInitialValues + extends IAbstractImageMapperInitialValues { + slicingMode: SlicingMode.K; + sliceToSubSliceMap: ISliceToSubSlice[]; } export interface vtkImageArrayMapper extends vtkAbstractImageMapper { - - /** - * - * @param inputData set input as a vtkCollection of vtkImageData objects. - */ - setInputData(inputData: vtkCollection): void; - - /** - * Get vtkImageData corresponding to the provided (global) slice number. - * @param slice (global) slice number. If a slice number is not provided, - * the function uses the current slice number (i.e. the output of getSlice()). - */ - getImage(slice?: number): Nullable; - - /** - * Return currently active image. This depends on the currently active slice number. - */ - getCurrentImage(): Nullable; - - /** - * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @return {Bounds} The bounds for the mapper. - */ - getBounds(): Bounds; - - /** - * Get the bounds for a given slice as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @param {Number} [slice] The slice index. If undefined, the current slice is considered. - * @param {Number} [halfThickness] Half the slice thickness in index space (unit voxel - * spacing). If undefined, 0 is considered. - * @return {Bounds} The bounds for a given slice. - */ - getBoundsForSlice(slice?: number, halfThickness?: number): Bounds; - - /** - * Get the closest IJK axis - * @return {IClosestIJKAxis} The axis object. - */ - getClosestIJKAxis(): IClosestIJKAxis; - - /** - * Calculate the total number of slices in the input collection. - */ - computeTotalSlices(): number; - - /** - * Fetch the pre-calculated total number of slices in the input collection. - */ - getTotalSlices(): number; - - /** - * - * @param {Number} slice The slice index. - */ - setSlice(slice: number): boolean; - - /** - * Calculate the global slice number that corresponds to the provided image and subSlice number. - * The global slice number corresponds to the total number of 2D image frames that a collection has. - * @param imageIndex The image number is the index of the vtkImageData object in the input collection. - * @param subSlice The subSlice number is the k-index of a slice within a vtkImageData object in the input collection. - */ - computeSlice(imageIndex: number, subSlice: number): number; - - /** - * Get the vtkImageData index corresponding to the provided global slice number. - * @param slice global slice number. If a slice number is not provided, - * the function uses the current slice number (i.e. the output of getSlice()). - */ - getImageIndex(slice?: number): number; - - /** - * Given a global slice number, identify the subSlice number (slice k-index within a vtkImageData). - * @param slice global slice number. If a slice number is not provided, - * the function uses the current slice number (i.e. the output of getSlice()). - */ - getSubSlice(slice?: number): number; - - - /** - * - */ - getResolveCoincidentTopology(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyAsString(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyLineOffsetParameters(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyPointOffsetParameters(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyPolygonOffsetFaces(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyPolygonOffsetParameters(): ICoincidentTopology; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setRelativeCoincidentTopologyLineOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setRelativeCoincidentTopologyPointOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setRelativeCoincidentTopologyPolygonOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param resolveCoincidentTopology - * @default false - */ - setResolveCoincidentTopology(resolveCoincidentTopology: boolean): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setResolveCoincidentTopologyLineOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setResolveCoincidentTopologyPointOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param value - */ - setResolveCoincidentTopologyPolygonOffsetFaces(value: number): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setResolveCoincidentTopologyPolygonOffsetParameters(factor: number, offset: number): boolean; - - /** - * - */ - setResolveCoincidentTopologyToDefault(): boolean; - - /** - * - */ - setResolveCoincidentTopologyToOff(): boolean; - - /** - * - */ - setResolveCoincidentTopologyToPolygonOffset(): boolean; - - /** - * Set the slicing mode. - * @param {Number} mode The slicing mode. - */ - setSlicingMode(mode: number): boolean; - - /** - * - * @param {Number[]} p1 The coordinates of the first point. - * @param {Number[]} p2 The coordinates of the second point. - */ - intersectWithLineForPointPicking(p1: number[], p2: number[]): any; - - /** - * - * @param {Number[]} p1 The coordinates of the first point. - * @param {Number[]} p2 The coordinates of the second point. - */ - intersectWithLineForCellPicking(p1: number[], p2: number[]): any; + /** + * + * @param inputData set input as a vtkCollection of vtkImageData objects. + */ + setInputData(inputData: vtkCollection): void; + + /** + * Get vtkImageData corresponding to the provided (global) slice number. + * @param slice (global) slice number. If a slice number is not provided, + * the function uses the current slice number (i.e. the output of getSlice()). + */ + getImage(slice?: number): Nullable; + + /** + * Return currently active image. This depends on the currently active slice number. + */ + getCurrentImage(): Nullable; + + /** + * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @return {Bounds} The bounds for the mapper. + */ + getBounds(): Bounds; + + /** + * Get the bounds for a given slice as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @param {Number} [slice] The slice index. If undefined, the current slice is considered. + * @param {Number} [halfThickness] Half the slice thickness in index space (unit voxel + * spacing). If undefined, 0 is considered. + * @return {Bounds} The bounds for a given slice. + */ + getBoundsForSlice(slice?: number, halfThickness?: number): Bounds; + + /** + * Get the closest IJK axis + * @return {IClosestIJKAxis} The axis object. + */ + getClosestIJKAxis(): IClosestIJKAxis; + + /** + * Calculate the total number of slices in the input collection. + */ + computeTotalSlices(): number; + + /** + * Fetch the pre-calculated total number of slices in the input collection. + */ + getTotalSlices(): number; + + /** + * + * @param {Number} slice The slice index. + */ + setSlice(slice: number): boolean; + + /** + * Calculate the global slice number that corresponds to the provided image and subSlice number. + * The global slice number corresponds to the total number of 2D image frames that a collection has. + * @param imageIndex The image number is the index of the vtkImageData object in the input collection. + * @param subSlice The subSlice number is the k-index of a slice within a vtkImageData object in the input collection. + */ + computeSlice(imageIndex: number, subSlice: number): number; + + /** + * Get the vtkImageData index corresponding to the provided global slice number. + * @param slice global slice number. If a slice number is not provided, + * the function uses the current slice number (i.e. the output of getSlice()). + */ + getImageIndex(slice?: number): number; + + /** + * Given a global slice number, identify the subSlice number (slice k-index within a vtkImageData). + * @param slice global slice number. If a slice number is not provided, + * the function uses the current slice number (i.e. the output of getSlice()). + */ + getSubSlice(slice?: number): number; + + /** + * + */ + getResolveCoincidentTopology(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyAsString(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyLineOffsetParameters(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyPointOffsetParameters(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyPolygonOffsetFaces(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyPolygonOffsetParameters(): ICoincidentTopology; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setRelativeCoincidentTopologyLineOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setRelativeCoincidentTopologyPointOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setRelativeCoincidentTopologyPolygonOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param resolveCoincidentTopology + * @default false + */ + setResolveCoincidentTopology(resolveCoincidentTopology: boolean): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setResolveCoincidentTopologyLineOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setResolveCoincidentTopologyPointOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param value + */ + setResolveCoincidentTopologyPolygonOffsetFaces(value: number): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setResolveCoincidentTopologyPolygonOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + */ + setResolveCoincidentTopologyToDefault(): boolean; + + /** + * + */ + setResolveCoincidentTopologyToOff(): boolean; + + /** + * + */ + setResolveCoincidentTopologyToPolygonOffset(): boolean; + + /** + * Set the slicing mode. + * @param {Number} mode The slicing mode. + */ + setSlicingMode(mode: number): boolean; + + /** + * + * @param {Number[]} p1 The coordinates of the first point. + * @param {Number[]} p2 The coordinates of the second point. + */ + intersectWithLineForPointPicking(p1: number[], p2: number[]): any; + + /** + * + * @param {Number[]} p1 The coordinates of the first point. + * @param {Number[]} p2 The coordinates of the second point. + */ + intersectWithLineForCellPicking(p1: number[], p2: number[]): any; } /** @@ -229,13 +247,19 @@ export interface vtkImageArrayMapper extends vtkAbstractImageMapper { * @param model object on which data structure will be bounds (protected) * @param {IImageArrayMapperInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IImageArrayMapperInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IImageArrayMapperInitialValues +): void; /** * Method use to create a new instance of vtkImageArrayMapper * @param {IImageArrayMapperInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IImageArrayMapperInitialValues): vtkImageArrayMapper; +export function newInstance( + initialValues?: IImageArrayMapperInitialValues +): vtkImageArrayMapper; /** * vtkImageArrayMapper provides display support for a collection of single/multi-frame images. @@ -246,8 +270,8 @@ export function newInstance(initialValues?: IImageArrayMapperInitialValues): vtk * This class resolves coincident topology with the same methods as vtkMapper. */ export declare const vtkImageArrayMapper: { - newInstance: typeof newInstance; - extend: typeof extend; - SlicingMode: typeof SlicingMode; -} + newInstance: typeof newInstance; + extend: typeof extend; + SlicingMode: typeof SlicingMode; +}; export default vtkImageArrayMapper; diff --git a/Sources/Rendering/Core/ImageCPRMapper/Constants.d.ts b/Sources/Rendering/Core/ImageCPRMapper/Constants.d.ts index c6706e8e28f..25619ff0e41 100644 --- a/Sources/Rendering/Core/ImageCPRMapper/Constants.d.ts +++ b/Sources/Rendering/Core/ImageCPRMapper/Constants.d.ts @@ -1,10 +1,10 @@ export declare enum ProjectionMode { - MAX = 0, - MIN = 1, - AVERAGE = 2, + MAX = 0, + MIN = 1, + AVERAGE = 2, } declare const _default: { - ProjectionMode: typeof ProjectionMode; + ProjectionMode: typeof ProjectionMode; }; export default _default; diff --git a/Sources/Rendering/Core/ImageCPRMapper/index.d.ts b/Sources/Rendering/Core/ImageCPRMapper/index.d.ts index 14e5dbd8dce..d97ceac9553 100644 --- a/Sources/Rendering/Core/ImageCPRMapper/index.d.ts +++ b/Sources/Rendering/Core/ImageCPRMapper/index.d.ts @@ -1,404 +1,430 @@ -import { mat3, mat4, quat, vec3 } from "gl-matrix"; -import { Nullable } from "../../../types"; -import { vtkOutputPort } from "../../../interfaces"; -import vtkAbstractMapper3D, { IAbstractMapper3DInitialValues } from "../AbstractMapper3D"; -import vtkDataArray from "../../../Common/Core/DataArray"; -import vtkImageData from "../../../Common/DataModel/ImageData"; -import vtkPolyData from "../../../Common/DataModel/PolyData"; -import vtkPolyLine from "../../../Common/DataModel/PolyLine"; -import { ProjectionMode } from "./Constants"; +import { mat3, mat4, quat, vec3 } from 'gl-matrix'; +import { Nullable } from '../../../types'; +import { vtkOutputPort } from '../../../interfaces'; +import vtkAbstractMapper3D, { + IAbstractMapper3DInitialValues, +} from '../AbstractMapper3D'; +import vtkDataArray from '../../../Common/Core/DataArray'; +import vtkImageData from '../../../Common/DataModel/ImageData'; +import vtkPolyData from '../../../Common/DataModel/PolyData'; +import vtkPolyLine from '../../../Common/DataModel/PolyLine'; +import { ProjectionMode } from './Constants'; interface ICoincidentTopology { - factor: number; - offset: number; + factor: number; + offset: number; } type TOrientation = mat4 | mat3 | quat | vec3; -export interface IImageCPRMapperInitialValues extends IAbstractMapper3DInitialValues{ - width: number; - uniformOrientation: TOrientation; // Don't use vec3 if possible - useUniformOrientation: boolean; - preferSizeOverAccuracy: boolean; // Whether to use halfFloat representation of float, when it is inaccurate - orientationArrayName: Nullable; - tangentDirection: vec3; - bitangentDirection: vec3; - normalDirection: vec3; +export interface IImageCPRMapperInitialValues + extends IAbstractMapper3DInitialValues { + width: number; + uniformOrientation: TOrientation; // Don't use vec3 if possible + useUniformOrientation: boolean; + preferSizeOverAccuracy: boolean; // Whether to use halfFloat representation of float, when it is inaccurate + orientationArrayName: Nullable; + tangentDirection: vec3; + bitangentDirection: vec3; + normalDirection: vec3; } export interface vtkImageCPRMapper extends vtkAbstractMapper3D { - /** - * @returns the width of the image in model coordinates of the input volume - */ - getWidth(): number; - - /** - * @see getWidth - * @param width - */ - setWidth(width: number): boolean; - - /** - * Use @see getUseUniformOrientation to use the uniform orientation instead of the orientation specified by the centerline - * @returns the uniform orientation of the centerline - */ - getUniformOrientation(): TOrientation; - - /** - * @see getUniformOrientation - * @param orientation - */ - setUniformOrientation(orientation: TOrientation): boolean; - - /** - * This flag specifies wether the mapper should use the uniformOrientation ( @see getUniformOrientation ) or the orientation specified in centerline at centerline input ( @see setCenterlineData ) - * Defaults to false. - * @returns the useUniformOrientation flag - */ - getUseUniformOrientation(): boolean; - - /** - * @see getUseUniformOrientation - * @param useUniformOrientation - */ - setUseUniformOrientation(useUniformOrientation: boolean): boolean; - - /** - * A point used to offset each line of pixel in the rendering - * The line of pixel is offseted such as the center of the line is as close as possible to the center point - * This can be used in combination with @see getUseUniformOrientation and a custom distance function for @see getOrientedCenterline to visualize a CPR in projected mode or stretched mode - * Defaults to null. - * @returns the center point - */ - getCenterPoint(): Nullable; - - /** - * @see getCenterPoint - * @param point - */ - setCenterPoint(point: Nullable): boolean; - - /** - * This flag indicates wether the GPU should use half float or not - * When true, will use half float - * When false, may use half float if there is no loss of accuracy (see in Texture: checkUseHalfFloat) - * Defaults to false. - * @returns the preferSizeOverAccuracy flag - */ - getPreferSizeOverAccuracy(): boolean; - - /** - * @see getPreferSizeOverAccuracy - * @param preferSizeOverAccuracy - */ - setPreferSizeOverAccuracy(preferSizeOverAccuracy: boolean): boolean; - - /** - * OrientationArrayName specifies the name of the data array which gives an orientation for each point of the centerline - * The data array has to be in the PointData attribute of the centerline input - * If null, look for the orientation data array in: "Orientation", "Direction", Vectors, Tensors, Normals - * The data array should be an array of mat4, mat3, quat or vec3 but using vec3 makes the CPRInteractor unusable - * Default to null. - */ - getOrientationArrayName(): Nullable; - - /** - * @see getOrientationArrayName - * @param arrayName - */ - setOrientationArrayName(arrayName: Nullable): boolean; - - /** - * For each point on the oriented centerline, the tangent direction is the direction in which the mapper will sample - * Let O (a mat3) be the orientation at a point on a centerline, and N (a vec3) the tangent direction - * Then the mapper will sample along O * N - * Default value: [1, 0, 0] - */ - getTangentDirection(): vec3; - - /** - * @see getTangentDirection - * @param tangent - */ - setTangentDirection(tangent: vec3): boolean; - - /** - * For each point on the oriented centerline, the bitangent direction forms with the normal and the tangent direction a new basis - * Default value: [0, 1, 0] - */ - getBitangentDirection(): vec3; - - /** - * @see getBitangentDirection - * @param bitangent - */ - setBitangentDirection(bitangent: vec3): boolean; - - /** - * For each point on the oriented centerline, the normal direction is the direction along the centerline - * Default value: [0, 0, 1] - */ - getNormalDirection(): vec3; - - /** - * @see getNormalDirection - * @param normal - */ - setNormalDirection(normal: vec3): boolean; - - /** - * The direction matrix is the matrix composed of tangent, bitangent and normal directions - * It is used to orient the camera or the actor - */ - getDirectionMatrix(): mat3; - - /** - * @see getDirectionMatrix - * @param mat - */ - setDirectionMatrix(mat: mat3): boolean; - - /** - * Thickness of the projection slab in image coordinates (NOT in voxels) - * Usually in millimeters if the spacing of the input image is set from a DICOM - */ - getProjectionSlabThickness(): number; - - /** - * @see getProjectionSlabThickness - * @param projectionSlabThickness - */ - setProjectionSlabThickness(ProjectionSlabThickness: number): boolean; - - /** - * Total number of samples of the volume done by the projection mode - * If this number is equal or less than 1, projection is disabled - * Using an odd number is advised - * If this number is even, the center of the slab will not be sampled - */ - getProjectionSlabNumberOfSamples(): number; - - /** - * @see getProjectionSlabNumberOfSamples - * @param projectionSlabNumberOfSamples - */ - setProjectionSlabNumberOfSamples(projectionSlabNumberOfSamples: number): boolean; - - /** - * Returns wether projection is enabled - * It is based on the number of samples - * @see getProjectionSlabNumberOfSamples - */ - isProjectionEnabled(): boolean; - - /** - * The different modes of projection - * Available modes include MIP, MinIP and AverageIP - */ - getProjectionMode(): ProjectionMode; - - /** - * @see getProjectionMode - * @param projectionMode - */ - setProjectionMode(projectionMode: ProjectionMode): boolean; - - /** - * Find the data array to use for orientation in the input polydata ( @see getOrientationArrayName ) - */ - getOrientationDataArray(): Nullable; - - /** - * Recompute the oriented centerline from the input polydata if needed and return the result - * If there is no polydata as input, return the last oriented centerline - * It means that if no polydata is given as input and the centerline is set using @see setOrientedCenterline , the given centerline will be used - */ - getOrientedCenterline(): vtkPolyLine; - - /** - * Set the internal oriented centerline - * WARNING: this centerline will be overwritten if the polydata centerline is specified (input 1 @see setCenterlineData ) - * @param centerline An oriented centerline - */ - setOrientedCenterline(centerline: vtkPolyLine): boolean; - - /** - * @returns The total height of the image in model coordinates. - */ - getHeight(): number; - - /** - * @param distance Distance from the beginning of the centerline, following the centerline, in model coordinates - * @returns The position and orientation which is at the given distance from the beginning of the centerline. - * If the distance is negative or greater than the length of the centerline, position and orientation are not defined. - * If the centerline is not oriented, orientation is not defined. - */ - getCenterlinePositionAndOrientation(distance: number): { position?: vec3, orientation?: quat }; - - /** - * @returns A flat array of vec3 representing the direction at each point of the centerline - * It is computed from the orientations of the centerline and tangentDirection - * Uses caching to avoid recomputing at each frame - */ - getCenterlineTangentDirections(): Float32Array; - - /** - * @returns The direction to sample, in model space, computed using uniform orientation and tangent direction - */ - getUniformDirection(): vec3; - - /** - * @returns A boolean indicating if the mapper is ready to render - */ - preRenderCheck(): boolean; - - /** - * Configure the mapper and the centerline to be in straightened CPR mode - */ - useStraightenedMode(): void; - - /** - * Configure the mapper and the centerline to be in strectched CPR mode - * @param centerPoint The center point, optional, default to the first point of the centerline or [0, 0, 0] - */ - useStretchedMode(centerPoint?: Nullable): void; - - /** - * Set the polydata used as a centerline - * You can also use `publicAPI.setInputData(centerlineData, 1);` - * Use all the segments of all the polylines (the centerline can be in multiple pieces) - * The polydata can contain a PointData DataArray to specify the direction in which the mapper should sample for each point of the centerline ( @see getDirectionArrayName @see getDirectionArrayOffset ) - * If no such point data is specified, a uniform direction can be used instead ( @see getUniformDirection @see getUseUniformOrientation ) - * The points of the centerline are in model coordinates of the volume used as input ( @see setImageDataData ) and not index coordinates (see MCTC matrix of the OpenGL ImageCPRMapper) - * Use `imageData.getWorldToIndex();` or `imageData.getIndexToWorld();` to go from model coordinates to index coordinates or the other way around - * @param centerlineData A polydata containing one or multiple polyline(s) and optionnally a PointData DataArray for direction - */ - setCenterlineData(centerlineData: vtkPolyData): void; - - /** - * Same as setCenterlineData except it uses an output port instead of a polydata - * You can also use `publicAPI.setInputConnection(centerlineConnection, 1);` - * @see setCenterlineData - * @param centerlineConnection - */ - setCenterlineConnection(centerlineConnection: vtkOutputPort): void; - - /** - * Set the volume which should be sampled by the mapper - * You can also use `publicAPI.setInputData(imageData, 0);` - * The model coordinates of this imageData are used by this mapper when specifying points, vectors or width (see MCTC matrix of the OpenGL ImageCPRMapper) - * You can use `imageData.getWorldToIndex();` or `imageData.getIndexToWorld();` to go from this model coordinates to index coordinates or the other way around - * @param imageData - */ - setImageData(imageData: vtkImageData): void; - - /** - * Set the connection for the volume - * You can also use `publicAPI.setInputConnection(imageData, 0);` - * @see setImageData - * @param imageData - */ - setImageConnection(imageData: vtkOutputPort): void; - - /** - * - */ - getResolveCoincidentTopology(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyAsString(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyLineOffsetParameters(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyPointOffsetParameters(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyPolygonOffsetFaces(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyPolygonOffsetParameters(): ICoincidentTopology; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setRelativeCoincidentTopologyLineOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setRelativeCoincidentTopologyPointOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setRelativeCoincidentTopologyPolygonOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param resolveCoincidentTopology - * @default false - */ - setResolveCoincidentTopology(resolveCoincidentTopology: boolean): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setResolveCoincidentTopologyLineOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setResolveCoincidentTopologyPointOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param value - */ - setResolveCoincidentTopologyPolygonOffsetFaces(value: number): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setResolveCoincidentTopologyPolygonOffsetParameters(factor: number, offset: number): boolean; - - /** - * - */ - setResolveCoincidentTopologyToDefault(): boolean; - - /** - * - */ - setResolveCoincidentTopologyToOff(): boolean; - - /** - * - */ - setResolveCoincidentTopologyToPolygonOffset(): boolean; + /** + * @returns the width of the image in model coordinates of the input volume + */ + getWidth(): number; + + /** + * @see getWidth + * @param width + */ + setWidth(width: number): boolean; + + /** + * Use @see getUseUniformOrientation to use the uniform orientation instead of the orientation specified by the centerline + * @returns the uniform orientation of the centerline + */ + getUniformOrientation(): TOrientation; + + /** + * @see getUniformOrientation + * @param orientation + */ + setUniformOrientation(orientation: TOrientation): boolean; + + /** + * This flag specifies wether the mapper should use the uniformOrientation ( @see getUniformOrientation ) or the orientation specified in centerline at centerline input ( @see setCenterlineData ) + * Defaults to false. + * @returns the useUniformOrientation flag + */ + getUseUniformOrientation(): boolean; + + /** + * @see getUseUniformOrientation + * @param useUniformOrientation + */ + setUseUniformOrientation(useUniformOrientation: boolean): boolean; + + /** + * A point used to offset each line of pixel in the rendering + * The line of pixel is offseted such as the center of the line is as close as possible to the center point + * This can be used in combination with @see getUseUniformOrientation and a custom distance function for @see getOrientedCenterline to visualize a CPR in projected mode or stretched mode + * Defaults to null. + * @returns the center point + */ + getCenterPoint(): Nullable; + + /** + * @see getCenterPoint + * @param point + */ + setCenterPoint(point: Nullable): boolean; + + /** + * This flag indicates wether the GPU should use half float or not + * When true, will use half float + * When false, may use half float if there is no loss of accuracy (see in Texture: checkUseHalfFloat) + * Defaults to false. + * @returns the preferSizeOverAccuracy flag + */ + getPreferSizeOverAccuracy(): boolean; + + /** + * @see getPreferSizeOverAccuracy + * @param preferSizeOverAccuracy + */ + setPreferSizeOverAccuracy(preferSizeOverAccuracy: boolean): boolean; + + /** + * OrientationArrayName specifies the name of the data array which gives an orientation for each point of the centerline + * The data array has to be in the PointData attribute of the centerline input + * If null, look for the orientation data array in: "Orientation", "Direction", Vectors, Tensors, Normals + * The data array should be an array of mat4, mat3, quat or vec3 but using vec3 makes the CPRInteractor unusable + * Default to null. + */ + getOrientationArrayName(): Nullable; + + /** + * @see getOrientationArrayName + * @param arrayName + */ + setOrientationArrayName(arrayName: Nullable): boolean; + + /** + * For each point on the oriented centerline, the tangent direction is the direction in which the mapper will sample + * Let O (a mat3) be the orientation at a point on a centerline, and N (a vec3) the tangent direction + * Then the mapper will sample along O * N + * Default value: [1, 0, 0] + */ + getTangentDirection(): vec3; + + /** + * @see getTangentDirection + * @param tangent + */ + setTangentDirection(tangent: vec3): boolean; + + /** + * For each point on the oriented centerline, the bitangent direction forms with the normal and the tangent direction a new basis + * Default value: [0, 1, 0] + */ + getBitangentDirection(): vec3; + + /** + * @see getBitangentDirection + * @param bitangent + */ + setBitangentDirection(bitangent: vec3): boolean; + + /** + * For each point on the oriented centerline, the normal direction is the direction along the centerline + * Default value: [0, 0, 1] + */ + getNormalDirection(): vec3; + + /** + * @see getNormalDirection + * @param normal + */ + setNormalDirection(normal: vec3): boolean; + + /** + * The direction matrix is the matrix composed of tangent, bitangent and normal directions + * It is used to orient the camera or the actor + */ + getDirectionMatrix(): mat3; + + /** + * @see getDirectionMatrix + * @param mat + */ + setDirectionMatrix(mat: mat3): boolean; + + /** + * Thickness of the projection slab in image coordinates (NOT in voxels) + * Usually in millimeters if the spacing of the input image is set from a DICOM + */ + getProjectionSlabThickness(): number; + + /** + * @see getProjectionSlabThickness + * @param projectionSlabThickness + */ + setProjectionSlabThickness(ProjectionSlabThickness: number): boolean; + + /** + * Total number of samples of the volume done by the projection mode + * If this number is equal or less than 1, projection is disabled + * Using an odd number is advised + * If this number is even, the center of the slab will not be sampled + */ + getProjectionSlabNumberOfSamples(): number; + + /** + * @see getProjectionSlabNumberOfSamples + * @param projectionSlabNumberOfSamples + */ + setProjectionSlabNumberOfSamples( + projectionSlabNumberOfSamples: number + ): boolean; + + /** + * Returns wether projection is enabled + * It is based on the number of samples + * @see getProjectionSlabNumberOfSamples + */ + isProjectionEnabled(): boolean; + + /** + * The different modes of projection + * Available modes include MIP, MinIP and AverageIP + */ + getProjectionMode(): ProjectionMode; + + /** + * @see getProjectionMode + * @param projectionMode + */ + setProjectionMode(projectionMode: ProjectionMode): boolean; + + /** + * Find the data array to use for orientation in the input polydata ( @see getOrientationArrayName ) + */ + getOrientationDataArray(): Nullable; + + /** + * Recompute the oriented centerline from the input polydata if needed and return the result + * If there is no polydata as input, return the last oriented centerline + * It means that if no polydata is given as input and the centerline is set using @see setOrientedCenterline , the given centerline will be used + */ + getOrientedCenterline(): vtkPolyLine; + + /** + * Set the internal oriented centerline + * WARNING: this centerline will be overwritten if the polydata centerline is specified (input 1 @see setCenterlineData ) + * @param centerline An oriented centerline + */ + setOrientedCenterline(centerline: vtkPolyLine): boolean; + + /** + * @returns The total height of the image in model coordinates. + */ + getHeight(): number; + + /** + * @param distance Distance from the beginning of the centerline, following the centerline, in model coordinates + * @returns The position and orientation which is at the given distance from the beginning of the centerline. + * If the distance is negative or greater than the length of the centerline, position and orientation are not defined. + * If the centerline is not oriented, orientation is not defined. + */ + getCenterlinePositionAndOrientation(distance: number): { + position?: vec3; + orientation?: quat; + }; + + /** + * @returns A flat array of vec3 representing the direction at each point of the centerline + * It is computed from the orientations of the centerline and tangentDirection + * Uses caching to avoid recomputing at each frame + */ + getCenterlineTangentDirections(): Float32Array; + + /** + * @returns The direction to sample, in model space, computed using uniform orientation and tangent direction + */ + getUniformDirection(): vec3; + + /** + * @returns A boolean indicating if the mapper is ready to render + */ + preRenderCheck(): boolean; + + /** + * Configure the mapper and the centerline to be in straightened CPR mode + */ + useStraightenedMode(): void; + + /** + * Configure the mapper and the centerline to be in strectched CPR mode + * @param centerPoint The center point, optional, default to the first point of the centerline or [0, 0, 0] + */ + useStretchedMode(centerPoint?: Nullable): void; + + /** + * Set the polydata used as a centerline + * You can also use `publicAPI.setInputData(centerlineData, 1);` + * Use all the segments of all the polylines (the centerline can be in multiple pieces) + * The polydata can contain a PointData DataArray to specify the direction in which the mapper should sample for each point of the centerline ( @see getDirectionArrayName @see getDirectionArrayOffset ) + * If no such point data is specified, a uniform direction can be used instead ( @see getUniformDirection @see getUseUniformOrientation ) + * The points of the centerline are in model coordinates of the volume used as input ( @see setImageDataData ) and not index coordinates (see MCTC matrix of the OpenGL ImageCPRMapper) + * Use `imageData.getWorldToIndex();` or `imageData.getIndexToWorld();` to go from model coordinates to index coordinates or the other way around + * @param centerlineData A polydata containing one or multiple polyline(s) and optionnally a PointData DataArray for direction + */ + setCenterlineData(centerlineData: vtkPolyData): void; + + /** + * Same as setCenterlineData except it uses an output port instead of a polydata + * You can also use `publicAPI.setInputConnection(centerlineConnection, 1);` + * @see setCenterlineData + * @param centerlineConnection + */ + setCenterlineConnection(centerlineConnection: vtkOutputPort): void; + + /** + * Set the volume which should be sampled by the mapper + * You can also use `publicAPI.setInputData(imageData, 0);` + * The model coordinates of this imageData are used by this mapper when specifying points, vectors or width (see MCTC matrix of the OpenGL ImageCPRMapper) + * You can use `imageData.getWorldToIndex();` or `imageData.getIndexToWorld();` to go from this model coordinates to index coordinates or the other way around + * @param imageData + */ + setImageData(imageData: vtkImageData): void; + + /** + * Set the connection for the volume + * You can also use `publicAPI.setInputConnection(imageData, 0);` + * @see setImageData + * @param imageData + */ + setImageConnection(imageData: vtkOutputPort): void; + + /** + * + */ + getResolveCoincidentTopology(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyAsString(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyLineOffsetParameters(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyPointOffsetParameters(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyPolygonOffsetFaces(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyPolygonOffsetParameters(): ICoincidentTopology; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setRelativeCoincidentTopologyLineOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setRelativeCoincidentTopologyPointOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setRelativeCoincidentTopologyPolygonOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param resolveCoincidentTopology + * @default false + */ + setResolveCoincidentTopology(resolveCoincidentTopology: boolean): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setResolveCoincidentTopologyLineOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setResolveCoincidentTopologyPointOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param value + */ + setResolveCoincidentTopologyPolygonOffsetFaces(value: number): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setResolveCoincidentTopologyPolygonOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + */ + setResolveCoincidentTopologyToDefault(): boolean; + + /** + * + */ + setResolveCoincidentTopologyToOff(): boolean; + + /** + * + */ + setResolveCoincidentTopologyToPolygonOffset(): boolean; } /** @@ -408,13 +434,19 @@ export interface vtkImageCPRMapper extends vtkAbstractMapper3D { * @param model object on which data structure will be bounds (protected) * @param {IImageCPRMapperInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IImageCPRMapperInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IImageCPRMapperInitialValues +): void; /** * Method used to create a new instance of vtkImageCPRMapper * @param {IImageCPRMapperInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IImageCPRMapperInitialValues): vtkImageCPRMapper; +export function newInstance( + initialValues?: IImageCPRMapperInitialValues +): vtkImageCPRMapper; /** * CPR in vtkImageCPRMapper stands for Curved Planar Reformation. This mapper @@ -422,7 +454,7 @@ export function newInstance(initialValues?: IImageCPRMapperInitialValues): vtkIm * used in projected mode, stretched mode or straightened mode depending on the * settings @see getUseUniformOrientation , @see getCenterPoint and the distance * function of @see getOrientedCenterline . - * + * * This specialised mapper takes as input a vtkImageData representing a volume * ( @see setImageData ) and a vtkPolyData representing a centerline * ( @see setCenterlineData ). The mapper also need to have an orientation per @@ -445,11 +477,11 @@ export function newInstance(initialValues?: IImageCPRMapperInitialValues): vtkIm * * By computing the right centerline positions and orientations, one * can simulate Stretched CPR and Straightened CPR. - * + * * This class resolves coincident topology with the same methods as vtkMapper. */ export declare const vtkImageCPRMapper: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkImageCPRMapper; diff --git a/Sources/Rendering/Core/ImageMapper/Constants.d.ts b/Sources/Rendering/Core/ImageMapper/Constants.d.ts index bd7df5c95ac..e72282f3cc6 100644 --- a/Sources/Rendering/Core/ImageMapper/Constants.d.ts +++ b/Sources/Rendering/Core/ImageMapper/Constants.d.ts @@ -1,14 +1,14 @@ export declare enum SlicingMode { - NONE = -1, - I = 0, - J = 1, - K = 2, - X = 3, - Y = 4, - Z = 5, + NONE = -1, + I = 0, + J = 1, + K = 2, + X = 3, + Y = 4, + Z = 5, } declare const _default: { - SlicingMode: typeof SlicingMode; + SlicingMode: typeof SlicingMode; }; export default _default; diff --git a/Sources/Rendering/Core/ImageMapper/index.d.ts b/Sources/Rendering/Core/ImageMapper/index.d.ts index 13c0796c015..19d146ff9bd 100755 --- a/Sources/Rendering/Core/ImageMapper/index.d.ts +++ b/Sources/Rendering/Core/ImageMapper/index.d.ts @@ -1,283 +1,301 @@ -import vtkCamera from "../Camera"; -import vtkAbstractImageMapper, { IAbstractImageMapperInitialValues } from "../AbstractImageMapper"; -import { Bounds, Nullable, Vector3 } from "../../../types"; -import { SlicingMode } from "./Constants"; -import vtkImageData from "../../../Common/DataModel/ImageData"; - +import vtkCamera from '../Camera'; +import vtkAbstractImageMapper, { + IAbstractImageMapperInitialValues, +} from '../AbstractImageMapper'; +import { Bounds, Nullable, Vector3 } from '../../../types'; +import { SlicingMode } from './Constants'; +import vtkImageData from '../../../Common/DataModel/ImageData'; interface IClosestIJKAxis { - ijkMode: SlicingMode, - flip: boolean + ijkMode: SlicingMode; + flip: boolean; } interface ICoincidentTopology { - factor: number; - offset: number; + factor: number; + offset: number; } -export interface IImageMapperInitialValues extends IAbstractImageMapperInitialValues { - closestIJKAxis?: IClosestIJKAxis; - renderToRectangle?: boolean; - sliceAtFocalPoint?: boolean; +export interface IImageMapperInitialValues + extends IAbstractImageMapperInitialValues { + closestIJKAxis?: IClosestIJKAxis; + renderToRectangle?: boolean; + sliceAtFocalPoint?: boolean; } export interface vtkImageMapper extends vtkAbstractImageMapper { - /** * Returns the IJK slice value from a world position or XYZ slice value * @param {Vector3 | number} [pos] World point or XYZ slice value */ - getSliceAtPosition(pos: Vector3 | number): number; - - /** - * Get the closest IJK axis - * @return {IClosestIJKAxis} The axis object. - */ - getClosestIJKAxis(): IClosestIJKAxis; - - /** - * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @return {Bounds} The bounds for the mapper. - */ - getBounds(): Bounds; - - /** - * Get the bounds for a given slice as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @param {Number} [slice] The slice index. If undefined, the current slice is considered. - * @param {Number} [halfThickness] Half the slice thickness in index space (unit voxel - * spacing). If undefined, 0 is considered. - * @return {Bounds} The bounds for a given slice. - */ - getBoundsForSlice(slice?: number, halfThickness?: number): Bounds; - - /** - * - */ - getIsOpaque(): boolean; - - - /** - * - */ - getRenderToRectangle(): boolean; - - /** - * - */ - getResolveCoincidentTopology(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyAsString(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyLineOffsetParameters(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyPointOffsetParameters(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyPolygonOffsetFaces(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyPolygonOffsetParameters(): ICoincidentTopology; - - /** - * Return currently active image. By default, there can only be one image - * for this mapper, if an input is set. - */ - getCurrentImage(): Nullable; - - /** - * Get the slice number at a focal point. - */ - getSliceAtFocalPoint(): boolean; - - /** - * - * @param {Number[]} p1 The coordinates of the first point. - * @param {Number[]} p2 The coordinates of the second point. - */ - intersectWithLineForPointPicking(p1: number[], p2: number[]): any; - - /** - * - * @param {Number[]} p1 The coordinates of the first point. - * @param {Number[]} p2 The coordinates of the second point. - */ - intersectWithLineForCellPicking(p1: number[], p2: number[]): any; - - /** - * Set the closest IJK axis - * @param {IClosestIJKAxis} closestIJKAxis The axis object. - */ - setClosestIJKAxis(closestIJKAxis: IClosestIJKAxis): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setRelativeCoincidentTopologyLineOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setRelativeCoincidentTopologyPointOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setRelativeCoincidentTopologyPolygonOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param resolveCoincidentTopology - * @default false - */ - setResolveCoincidentTopology(resolveCoincidentTopology: boolean): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setResolveCoincidentTopologyLineOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setResolveCoincidentTopologyPointOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param value - */ - setResolveCoincidentTopologyPolygonOffsetFaces(value: number): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setResolveCoincidentTopologyPolygonOffsetParameters(factor: number, offset: number): boolean; - - /** - * - */ - setResolveCoincidentTopologyToDefault(): boolean; - - /** - * - */ - setResolveCoincidentTopologyToOff(): boolean; - - /** - * - */ - setResolveCoincidentTopologyToPolygonOffset(): boolean; - - /** - * - * @param {Boolean} renderToRectangle - */ - setRenderToRectangle(renderToRectangle: boolean): boolean; - - /** - * - * @param {Number} slice The slice index. - */ - setSlice(slice: number): boolean; - - /** - * Set the slice from a given camera. - * @param {vtkCamera} cam The camera object. - */ - setSliceFromCamera(cam: vtkCamera): boolean; - - /** - * Set the slice from a given focal point. - * @param {Boolean} sliceAtFocalPoint - */ - setSliceAtFocalPoint(sliceAtFocalPoint: boolean): boolean; - - /** - * Set the slice for the X axis. - * @param {Number} id The slice index. - */ - setXSlice(id: number): boolean; - - /** - * Set the slice for the Y axis. - * @param {Number} id The slice index. - */ - setYSlice(id: number): boolean; - - /** - * Set the slice for the Z axis. - * @param {Number} id The slice index. - */ - setZSlice(id: number): boolean; - - /** - * Set the slice for the I axis. - * @param {Number} id The slice index. - */ - setISlice(id: number): boolean; - - /** - * Set the slice for the J axis. - * @param {Number} id The slice index. - */ - setJSlice(id: number): boolean; - - /** - * Set the slice for the K axis. - * @param {Number} id The slice index. - */ - setKSlice(id: number): boolean; - - /** - * - */ - getSlicingModeNormal(): number[]; - - /** - * Get the slicing mode. - */ - getSlicingMode(): SlicingMode; - - /** - * Set the slicing mode. - * @param {SlicingMode} mode The slicing mode. - */ - setSlicingMode(mode: SlicingMode): boolean; - - /** - * Get the preference to use halfFloat representation of float - */ - getPreferSizeOverAccuracy(): boolean; - - /** - * Set the preference to use halfFloat representation of float - * @param {Boolean} preferSizeOverAccuracy - */ - setPreferSizeOverAccuracy(preferSizeOverAccuracy: boolean): boolean; + getSliceAtPosition(pos: Vector3 | number): number; + + /** + * Get the closest IJK axis + * @return {IClosestIJKAxis} The axis object. + */ + getClosestIJKAxis(): IClosestIJKAxis; + + /** + * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @return {Bounds} The bounds for the mapper. + */ + getBounds(): Bounds; + + /** + * Get the bounds for a given slice as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @param {Number} [slice] The slice index. If undefined, the current slice is considered. + * @param {Number} [halfThickness] Half the slice thickness in index space (unit voxel + * spacing). If undefined, 0 is considered. + * @return {Bounds} The bounds for a given slice. + */ + getBoundsForSlice(slice?: number, halfThickness?: number): Bounds; + + /** + * + */ + getIsOpaque(): boolean; + + /** + * + */ + getRenderToRectangle(): boolean; + + /** + * + */ + getResolveCoincidentTopology(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyAsString(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyLineOffsetParameters(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyPointOffsetParameters(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyPolygonOffsetFaces(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyPolygonOffsetParameters(): ICoincidentTopology; + + /** + * Return currently active image. By default, there can only be one image + * for this mapper, if an input is set. + */ + getCurrentImage(): Nullable; + + /** + * Get the slice number at a focal point. + */ + getSliceAtFocalPoint(): boolean; + + /** + * + * @param {Number[]} p1 The coordinates of the first point. + * @param {Number[]} p2 The coordinates of the second point. + */ + intersectWithLineForPointPicking(p1: number[], p2: number[]): any; + + /** + * + * @param {Number[]} p1 The coordinates of the first point. + * @param {Number[]} p2 The coordinates of the second point. + */ + intersectWithLineForCellPicking(p1: number[], p2: number[]): any; + + /** + * Set the closest IJK axis + * @param {IClosestIJKAxis} closestIJKAxis The axis object. + */ + setClosestIJKAxis(closestIJKAxis: IClosestIJKAxis): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setRelativeCoincidentTopologyLineOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setRelativeCoincidentTopologyPointOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setRelativeCoincidentTopologyPolygonOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param resolveCoincidentTopology + * @default false + */ + setResolveCoincidentTopology(resolveCoincidentTopology: boolean): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setResolveCoincidentTopologyLineOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setResolveCoincidentTopologyPointOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param value + */ + setResolveCoincidentTopologyPolygonOffsetFaces(value: number): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setResolveCoincidentTopologyPolygonOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + */ + setResolveCoincidentTopologyToDefault(): boolean; + + /** + * + */ + setResolveCoincidentTopologyToOff(): boolean; + + /** + * + */ + setResolveCoincidentTopologyToPolygonOffset(): boolean; + + /** + * + * @param {Boolean} renderToRectangle + */ + setRenderToRectangle(renderToRectangle: boolean): boolean; + + /** + * + * @param {Number} slice The slice index. + */ + setSlice(slice: number): boolean; + + /** + * Set the slice from a given camera. + * @param {vtkCamera} cam The camera object. + */ + setSliceFromCamera(cam: vtkCamera): boolean; + + /** + * Set the slice from a given focal point. + * @param {Boolean} sliceAtFocalPoint + */ + setSliceAtFocalPoint(sliceAtFocalPoint: boolean): boolean; + + /** + * Set the slice for the X axis. + * @param {Number} id The slice index. + */ + setXSlice(id: number): boolean; + + /** + * Set the slice for the Y axis. + * @param {Number} id The slice index. + */ + setYSlice(id: number): boolean; + + /** + * Set the slice for the Z axis. + * @param {Number} id The slice index. + */ + setZSlice(id: number): boolean; + + /** + * Set the slice for the I axis. + * @param {Number} id The slice index. + */ + setISlice(id: number): boolean; + + /** + * Set the slice for the J axis. + * @param {Number} id The slice index. + */ + setJSlice(id: number): boolean; + + /** + * Set the slice for the K axis. + * @param {Number} id The slice index. + */ + setKSlice(id: number): boolean; + + /** + * + */ + getSlicingModeNormal(): number[]; + + /** + * Get the slicing mode. + */ + getSlicingMode(): SlicingMode; + + /** + * Set the slicing mode. + * @param {SlicingMode} mode The slicing mode. + */ + setSlicingMode(mode: SlicingMode): boolean; + + /** + * Get the preference to use halfFloat representation of float + */ + getPreferSizeOverAccuracy(): boolean; + + /** + * Set the preference to use halfFloat representation of float + * @param {Boolean} preferSizeOverAccuracy + */ + setPreferSizeOverAccuracy(preferSizeOverAccuracy: boolean): boolean; } /** @@ -287,13 +305,19 @@ export interface vtkImageMapper extends vtkAbstractImageMapper { * @param model object on which data structure will be bounds (protected) * @param {IImageMapperInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IImageMapperInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IImageMapperInitialValues +): void; /** * Method use to create a new instance of vtkImageMapper * @param {IImageMapperInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IImageMapperInitialValues): vtkImageMapper; +export function newInstance( + initialValues?: IImageMapperInitialValues +): vtkImageMapper; /** * vtkImageMapper provides 2D image display support for vtk. @@ -302,8 +326,8 @@ export function newInstance(initialValues?: IImageMapperInitialValues): vtkImage * This class resolves coincident topology with the same methods as vtkMapper. */ export declare const vtkImageMapper: { - newInstance: typeof newInstance; - extend: typeof extend; - SlicingMode: typeof SlicingMode; -} + newInstance: typeof newInstance; + extend: typeof extend; + SlicingMode: typeof SlicingMode; +}; export default vtkImageMapper; diff --git a/Sources/Rendering/Core/ImageProperty/Constants.d.ts b/Sources/Rendering/Core/ImageProperty/Constants.d.ts index 668ffdbb0e5..0dcf153d285 100644 --- a/Sources/Rendering/Core/ImageProperty/Constants.d.ts +++ b/Sources/Rendering/Core/ImageProperty/Constants.d.ts @@ -1,9 +1,9 @@ export declare enum InterpolationType { - NEAREST = 0, - LINEAR = 1, + NEAREST = 0, + LINEAR = 1, } declare const _default: { - InterpolationType: typeof InterpolationType; + InterpolationType: typeof InterpolationType; }; export default _default; diff --git a/Sources/Rendering/Core/ImageProperty/index.d.ts b/Sources/Rendering/Core/ImageProperty/index.d.ts index 5835f18e713..f47ba807520 100755 --- a/Sources/Rendering/Core/ImageProperty/index.d.ts +++ b/Sources/Rendering/Core/ImageProperty/index.d.ts @@ -1,206 +1,207 @@ -import { vtkObject } from "../../../interfaces"; -import vtkColorTransferFunction from "../ColorTransferFunction"; -import vtkPiecewiseFunction from "../../../Common/DataModel/PiecewiseFunction"; -import { InterpolationType } from "./Constants"; +import { vtkObject } from '../../../interfaces'; +import vtkColorTransferFunction from '../ColorTransferFunction'; +import vtkPiecewiseFunction from '../../../Common/DataModel/PiecewiseFunction'; +import { InterpolationType } from './Constants'; interface IComponentData { - piecewiseFunction: number; - componentWeight: number; + piecewiseFunction: number; + componentWeight: number; } export interface IImagePropertyInitialValues { - independentComponents?: boolean; - interpolationType?: InterpolationType; - colorWindow?: number; - colorLevel?: number; - ambient?: number; - diffuse?: number; - opacity?: number; - componentData?: IComponentData[]; - useLookupTableScalarRange?: boolean; - useLabelOutline?: boolean; - labelOutlineThickness?: number | number[]; + independentComponents?: boolean; + interpolationType?: InterpolationType; + colorWindow?: number; + colorLevel?: number; + ambient?: number; + diffuse?: number; + opacity?: number; + componentData?: IComponentData[]; + useLookupTableScalarRange?: boolean; + useLabelOutline?: boolean; + labelOutlineThickness?: number | number[]; } export interface vtkImageProperty extends vtkObject { - - /** - * Get the lighting coefficient. - * @default 1.0 - */ - getAmbient(): number; - - /** - * Get the level value for window/level. - * @default 127.5 - */ - getColorLevel(): number; - - /** - * Get the window value for window/level. - * @default 255 - */ - getColorWindow(): number; - - /** - * - * @param {Number} index - */ - getComponentWeight(index: number): number; - - /** - * Get the diffuse lighting coefficient. - * @default 1.0 - */ - getDiffuse(): number; - - /** - * - * @default false - */ - getIndependentComponents(): boolean; - - /** - * Get the interpolation type - */ - getInterpolationType(): InterpolationType; - - /** - * Get the interpolation type as a string - */ - getInterpolationTypeAsString(): string; - - /** - * Get the opacity of the object. - * @default 1.0 - */ - getOpacity(): number; - - /** - * Get the component weighting function. - * @param {Number} [idx] - */ - getPiecewiseFunction(idx?: number): vtkPiecewiseFunction; - - /** - * Get the currently set RGB transfer function. - * @param {Number} [idx] - */ - getRGBTransferFunction(idx?: number): vtkColorTransferFunction; - - /** - * Alias to get the piecewise function (backwards compatibility) - * @param {Number} [idx] - */ - getScalarOpacity(idx?: number): vtkPiecewiseFunction; - - /** - * gets the label outline thickness - */ - getLabelOutlineThickness(): number; - - /** - * It will set the label outline thickness for the labelmaps. It can accept - * a single number or an array of numbers. If a single number is provided, - * it will be used for all the segments. If an array is provided, it indicates - * the thickness for each segment index. For instance if you have a labelmap - * with 3 segments (0: background 1: liver 2: tumor), you can set the thickness - * to [2,4] to have a thicker outline for the tumor (thickness 4). It should be - * noted that the thickness is in pixel and also the first array value will - * control the default thickness for all labels when 0 or not specified. - * - * @param {Number | Number[]} labelOutlineThickness - */ - setLabelOutlineThickness(labelOutlineThickness: number | number[]): boolean; - - - /** - * Set the ambient lighting coefficient. - * @param {Number} ambient The ambient lighting coefficient. - */ - setAmbient(ambient: number): boolean; - - /** - * Set the level value for window/level. - * @param {Number} colorLevel The level value for window/level. - */ - setColorLevel(colorLevel: number): boolean; - - /** - * Set the window value for window/level. - * @param {Number} colorWindow The window value for window/level. - */ - setColorWindow(colorWindow: number): boolean; - - /** - * - * @param {Number} index - * @param {Number} value - */ - setComponentWeight(index: number, value: number): boolean; - - /** - * Set the diffuse lighting coefficient. - * @param {Number} diffuse The diffuse lighting coefficient. - */ - setDiffuse(diffuse: number): boolean; - - /** - * - * @param {Boolean} independentComponents - */ - setIndependentComponents(independentComponents: boolean): boolean; - - /** - * Set the interpolation type. - * @param {InterpolationType} interpolationType The interpolation type. - */ - setInterpolationType(interpolationType: InterpolationType): boolean; - - /** - * Set `interpolationType` to `InterpolationType.LINEAR`. - */ - setInterpolationTypeToLinear(): boolean; - - /** - * Set `interpolationType` to `InterpolationType.NEAREST`. - */ - setInterpolationTypeToNearest(): boolean; - - /** - * Set the opacity of the object - * @param {Number} opacity The opacity value. - */ - setOpacity(opacity: number): boolean; - - /** - * Set the piecewise function - * @param {Number} index - * @param {vtkPiecewiseFunction} func - */ - setPiecewiseFunction(index: number, func: vtkPiecewiseFunction): boolean; - - /** - * Set the color of a volume to an RGB transfer function - * @param {Number} index - * @param {vtkColorTransferFunction} func - */ - setRGBTransferFunction(index: number, func: vtkColorTransferFunction): boolean; - - /** - * Alias to set the piecewise function - * @param {Number} index - * @param {vtkPiecewiseFunction} func - */ - setScalarOpacity(index: number, func: vtkPiecewiseFunction): boolean; - - /** - * Use the range that is set on the lookup table, instead of setting the range from the - * ColorWindow/ColorLevel settings - * @default false - * @param {Boolean} useLookupTableScalarRange - */ - setUseLookupTableScalarRange(useLookupTableScalarRange: boolean): boolean; + /** + * Get the lighting coefficient. + * @default 1.0 + */ + getAmbient(): number; + + /** + * Get the level value for window/level. + * @default 127.5 + */ + getColorLevel(): number; + + /** + * Get the window value for window/level. + * @default 255 + */ + getColorWindow(): number; + + /** + * + * @param {Number} index + */ + getComponentWeight(index: number): number; + + /** + * Get the diffuse lighting coefficient. + * @default 1.0 + */ + getDiffuse(): number; + + /** + * + * @default false + */ + getIndependentComponents(): boolean; + + /** + * Get the interpolation type + */ + getInterpolationType(): InterpolationType; + + /** + * Get the interpolation type as a string + */ + getInterpolationTypeAsString(): string; + + /** + * Get the opacity of the object. + * @default 1.0 + */ + getOpacity(): number; + + /** + * Get the component weighting function. + * @param {Number} [idx] + */ + getPiecewiseFunction(idx?: number): vtkPiecewiseFunction; + + /** + * Get the currently set RGB transfer function. + * @param {Number} [idx] + */ + getRGBTransferFunction(idx?: number): vtkColorTransferFunction; + + /** + * Alias to get the piecewise function (backwards compatibility) + * @param {Number} [idx] + */ + getScalarOpacity(idx?: number): vtkPiecewiseFunction; + + /** + * gets the label outline thickness + */ + getLabelOutlineThickness(): number; + + /** + * It will set the label outline thickness for the labelmaps. It can accept + * a single number or an array of numbers. If a single number is provided, + * it will be used for all the segments. If an array is provided, it indicates + * the thickness for each segment index. For instance if you have a labelmap + * with 3 segments (0: background 1: liver 2: tumor), you can set the thickness + * to [2,4] to have a thicker outline for the tumor (thickness 4). It should be + * noted that the thickness is in pixel and also the first array value will + * control the default thickness for all labels when 0 or not specified. + * + * @param {Number | Number[]} labelOutlineThickness + */ + setLabelOutlineThickness(labelOutlineThickness: number | number[]): boolean; + + /** + * Set the ambient lighting coefficient. + * @param {Number} ambient The ambient lighting coefficient. + */ + setAmbient(ambient: number): boolean; + + /** + * Set the level value for window/level. + * @param {Number} colorLevel The level value for window/level. + */ + setColorLevel(colorLevel: number): boolean; + + /** + * Set the window value for window/level. + * @param {Number} colorWindow The window value for window/level. + */ + setColorWindow(colorWindow: number): boolean; + + /** + * + * @param {Number} index + * @param {Number} value + */ + setComponentWeight(index: number, value: number): boolean; + + /** + * Set the diffuse lighting coefficient. + * @param {Number} diffuse The diffuse lighting coefficient. + */ + setDiffuse(diffuse: number): boolean; + + /** + * + * @param {Boolean} independentComponents + */ + setIndependentComponents(independentComponents: boolean): boolean; + + /** + * Set the interpolation type. + * @param {InterpolationType} interpolationType The interpolation type. + */ + setInterpolationType(interpolationType: InterpolationType): boolean; + + /** + * Set `interpolationType` to `InterpolationType.LINEAR`. + */ + setInterpolationTypeToLinear(): boolean; + + /** + * Set `interpolationType` to `InterpolationType.NEAREST`. + */ + setInterpolationTypeToNearest(): boolean; + + /** + * Set the opacity of the object + * @param {Number} opacity The opacity value. + */ + setOpacity(opacity: number): boolean; + + /** + * Set the piecewise function + * @param {Number} index + * @param {vtkPiecewiseFunction} func + */ + setPiecewiseFunction(index: number, func: vtkPiecewiseFunction): boolean; + + /** + * Set the color of a volume to an RGB transfer function + * @param {Number} index + * @param {vtkColorTransferFunction} func + */ + setRGBTransferFunction( + index: number, + func: vtkColorTransferFunction + ): boolean; + + /** + * Alias to set the piecewise function + * @param {Number} index + * @param {vtkPiecewiseFunction} func + */ + setScalarOpacity(index: number, func: vtkPiecewiseFunction): boolean; + + /** + * Use the range that is set on the lookup table, instead of setting the range from the + * ColorWindow/ColorLevel settings + * @default false + * @param {Boolean} useLookupTableScalarRange + */ + setUseLookupTableScalarRange(useLookupTableScalarRange: boolean): boolean; } /** @@ -210,22 +211,28 @@ export interface vtkImageProperty extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IImagePropertyInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IImagePropertyInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IImagePropertyInitialValues +): void; /** * Method use to create a new instance of vtkImageProperty * @param {IImagePropertyInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IImagePropertyInitialValues): vtkImageProperty; +export function newInstance( + initialValues?: IImagePropertyInitialValues +): vtkImageProperty; /** * vtkImageProperty provides 2D image display support for vtk. * It can be associated with a vtkImageSlice prop and placed within a Renderer. - * + * * This class resolves coincident topology with the same methods as vtkMapper. */ export declare const vtkImageProperty: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkImageProperty; diff --git a/Sources/Rendering/Core/ImageResliceMapper/Constants.d.ts b/Sources/Rendering/Core/ImageResliceMapper/Constants.d.ts index 2022b121d23..a39d945f50b 100644 --- a/Sources/Rendering/Core/ImageResliceMapper/Constants.d.ts +++ b/Sources/Rendering/Core/ImageResliceMapper/Constants.d.ts @@ -1,11 +1,11 @@ export declare enum SlabTypes { - MIN = 0, - MAX = 1, - MEAN = 2, - SUM = 3, + MIN = 0, + MAX = 1, + MEAN = 2, + SUM = 3, } declare const _default: { - SlabTypes: typeof SlabTypes; + SlabTypes: typeof SlabTypes; }; export default _default; diff --git a/Sources/Rendering/Core/ImageResliceMapper/index.d.ts b/Sources/Rendering/Core/ImageResliceMapper/index.d.ts index f9b6e997af2..9eaa73da5eb 100755 --- a/Sources/Rendering/Core/ImageResliceMapper/index.d.ts +++ b/Sources/Rendering/Core/ImageResliceMapper/index.d.ts @@ -1,220 +1,239 @@ -import vtkAbstractImageMapper, { IAbstractImageMapperInitialValues } from "../AbstractImageMapper"; -import vtkImageData from "../../../Common/DataModel/ImageData"; -import vtkPlane from "../../../Common/DataModel/Plane"; -import vtkPolyData from "../../../Common/DataModel/PolyData"; -import { Bounds, Nullable, Vector3 } from "../../../types"; -import { SlabTypes } from "./Constants"; - +import vtkAbstractImageMapper, { + IAbstractImageMapperInitialValues, +} from '../AbstractImageMapper'; +import vtkImageData from '../../../Common/DataModel/ImageData'; +import vtkPlane from '../../../Common/DataModel/Plane'; +import vtkPolyData from '../../../Common/DataModel/PolyData'; +import { Bounds, Nullable, Vector3 } from '../../../types'; +import { SlabTypes } from './Constants'; interface ICoincidentTopology { - factor: number; - offset: number; + factor: number; + offset: number; } -export interface IImageResliceMapperInitialValues extends IAbstractImageMapperInitialValues { - slabThickness?: number; - slabTrapezoidIntegration?: number; - slabType?: SlabTypes; - slicePlane?: vtkPlane; - slicePolyData?: vtkPolyData; +export interface IImageResliceMapperInitialValues + extends IAbstractImageMapperInitialValues { + slabThickness?: number; + slabTrapezoidIntegration?: number; + slabType?: SlabTypes; + slicePlane?: vtkPlane; + slicePolyData?: vtkPolyData; } export interface vtkImageResliceMapper extends vtkAbstractImageMapper { - - /** - * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @return {Bounds} The bounds for the mapper. - */ - getBounds(): Bounds; - - /** - * - */ - getIsOpaque(): boolean; - - /** - * - */ - getResolveCoincidentTopology(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyAsString(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyLineOffsetParameters(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyPointOffsetParameters(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyPolygonOffsetFaces(): ICoincidentTopology - - /** - * - */ - getResolveCoincidentTopologyPolygonOffsetParameters(): ICoincidentTopology; - - /** - * - * Get the slab thickness in world space (mm). - */ - getSlabThickness(): number; - - /** - * - * Get whether slab trapezoid integration is enabled. - */ - getSlabTrapezoidIntegration(): number; - - /** - * - * Get the slab composite function. - */ - getSlabType(): SlabTypes; - - /** - * - * Get the implicit plane used to slice the volume with. - */ - getSlicePlane(): vtkPlane; - - /** - * - * Get the custom polydata used to slice the volume with. - */ - getSlicePolyData(): vtkPolyData; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setRelativeCoincidentTopologyLineOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setRelativeCoincidentTopologyPointOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setRelativeCoincidentTopologyPolygonOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param resolveCoincidentTopology - * @default false - */ - setResolveCoincidentTopology(resolveCoincidentTopology: boolean): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setResolveCoincidentTopologyLineOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setResolveCoincidentTopologyPointOffsetParameters(factor: number, offset: number): boolean; - - /** - * - * @param value - */ - setResolveCoincidentTopologyPolygonOffsetFaces(value: number): boolean; - - /** - * - * @param {Number} factor - * @param {Number} offset - */ - setResolveCoincidentTopologyPolygonOffsetParameters(factor: number, offset: number): boolean; - - /** - * - */ - setResolveCoincidentTopologyToDefault(): boolean; - - /** - * - */ - setResolveCoincidentTopologyToOff(): boolean; - - /** - * - */ - setResolveCoincidentTopologyToPolygonOffset(): boolean; - - /** - * - * Enable slab slicing mode and set the slab thickness in world space (mm). - * @param {Number} slabThickness The slab thickness in world space (mm). Default: 0. - */ - setSlabThickness(slabThickness: number): boolean; - - /** - * - * When a slab thickness larger than 0 is provided, the mapper will composite multile slices - * together using different composite functions based on the slabType. When - * slabTrapezoidIntegration is enabled, the first and the last slices in the slab are weighted at - * half their original intensity for sum and mean slab types. - * @param {Number} slabTrapezoidIntegration Enable/disable trapezoid integration for slab slicing. - * Default: 0 - */ - setSlabTrapezoidIntegration(slabTrapezoidIntegration: number): boolean; - - /** - * - * When a slab thickness larger than 0 is provided, the mapper will composite multile slices - * together using different composite functions based on the slabType. Available options are max, - * min, mean and sum. - * @param {SlabTypes} slabType The blend function used to composite slab slices. - * Default: SlabTypes.MEAN - */ - setSlabType(slabType: SlabTypes): boolean; - - /** - * - * The vtkImageResliceMapper provides flexibility in how the reslice source is provided. The user - * can either provide an implicit vtkPlane (defined with its origin and normal), or a custom - * vtkPolyData. When both sources are provided, the mapper chooses the custom polydata over the - * implicit plane. When providing custom polydata as the source, it is required that the polydata - * has point normals for slab slicing. When neither sources are provided, the mapper creates a - * default implicit plane with normal (0, 0, 1) and origin at the mid-point of the volume's Z - * bounds. - * @param {vtkPlane} slicePlane The implicit plane to slice the volume with. Default: null - */ - setSlicePlane(slicePlane: vtkPlane): boolean; - - /** - * - * The vtkImageResliceMapper provides flexibility in how the reslice source is provided. The user - * can either provide an implicit vtkPlane (defined with its origin and normal), or a custom - * vtkPolyData. When both sources are provided, the mapper chooses the custom polydata over the - * implicit plane. When providing custom polydata as the source, it is required that the polydata - * has point normals for slab slicing. When neither sources are provided, the mapper creates a - * default implicit plane with normal (0, 0, 1) and origin at the mid-point of the volume's Z - * bounds. - * @param {vtkPolyData} slicePolyData The polydata to slice the volume with. Default: null - */ - setSlicePolyData(slicePolyData: vtkPolyData): boolean; + /** + * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @return {Bounds} The bounds for the mapper. + */ + getBounds(): Bounds; + + /** + * + */ + getIsOpaque(): boolean; + + /** + * + */ + getResolveCoincidentTopology(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyAsString(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyLineOffsetParameters(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyPointOffsetParameters(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyPolygonOffsetFaces(): ICoincidentTopology; + + /** + * + */ + getResolveCoincidentTopologyPolygonOffsetParameters(): ICoincidentTopology; + + /** + * + * Get the slab thickness in world space (mm). + */ + getSlabThickness(): number; + + /** + * + * Get whether slab trapezoid integration is enabled. + */ + getSlabTrapezoidIntegration(): number; + + /** + * + * Get the slab composite function. + */ + getSlabType(): SlabTypes; + + /** + * + * Get the implicit plane used to slice the volume with. + */ + getSlicePlane(): vtkPlane; + + /** + * + * Get the custom polydata used to slice the volume with. + */ + getSlicePolyData(): vtkPolyData; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setRelativeCoincidentTopologyLineOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setRelativeCoincidentTopologyPointOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setRelativeCoincidentTopologyPolygonOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param resolveCoincidentTopology + * @default false + */ + setResolveCoincidentTopology(resolveCoincidentTopology: boolean): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setResolveCoincidentTopologyLineOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setResolveCoincidentTopologyPointOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + * @param value + */ + setResolveCoincidentTopologyPolygonOffsetFaces(value: number): boolean; + + /** + * + * @param {Number} factor + * @param {Number} offset + */ + setResolveCoincidentTopologyPolygonOffsetParameters( + factor: number, + offset: number + ): boolean; + + /** + * + */ + setResolveCoincidentTopologyToDefault(): boolean; + + /** + * + */ + setResolveCoincidentTopologyToOff(): boolean; + + /** + * + */ + setResolveCoincidentTopologyToPolygonOffset(): boolean; + + /** + * + * Enable slab slicing mode and set the slab thickness in world space (mm). + * @param {Number} slabThickness The slab thickness in world space (mm). Default: 0. + */ + setSlabThickness(slabThickness: number): boolean; + + /** + * + * When a slab thickness larger than 0 is provided, the mapper will composite multile slices + * together using different composite functions based on the slabType. When + * slabTrapezoidIntegration is enabled, the first and the last slices in the slab are weighted at + * half their original intensity for sum and mean slab types. + * @param {Number} slabTrapezoidIntegration Enable/disable trapezoid integration for slab slicing. + * Default: 0 + */ + setSlabTrapezoidIntegration(slabTrapezoidIntegration: number): boolean; + + /** + * + * When a slab thickness larger than 0 is provided, the mapper will composite multile slices + * together using different composite functions based on the slabType. Available options are max, + * min, mean and sum. + * @param {SlabTypes} slabType The blend function used to composite slab slices. + * Default: SlabTypes.MEAN + */ + setSlabType(slabType: SlabTypes): boolean; + + /** + * + * The vtkImageResliceMapper provides flexibility in how the reslice source is provided. The user + * can either provide an implicit vtkPlane (defined with its origin and normal), or a custom + * vtkPolyData. When both sources are provided, the mapper chooses the custom polydata over the + * implicit plane. When providing custom polydata as the source, it is required that the polydata + * has point normals for slab slicing. When neither sources are provided, the mapper creates a + * default implicit plane with normal (0, 0, 1) and origin at the mid-point of the volume's Z + * bounds. + * @param {vtkPlane} slicePlane The implicit plane to slice the volume with. Default: null + */ + setSlicePlane(slicePlane: vtkPlane): boolean; + + /** + * + * The vtkImageResliceMapper provides flexibility in how the reslice source is provided. The user + * can either provide an implicit vtkPlane (defined with its origin and normal), or a custom + * vtkPolyData. When both sources are provided, the mapper chooses the custom polydata over the + * implicit plane. When providing custom polydata as the source, it is required that the polydata + * has point normals for slab slicing. When neither sources are provided, the mapper creates a + * default implicit plane with normal (0, 0, 1) and origin at the mid-point of the volume's Z + * bounds. + * @param {vtkPolyData} slicePolyData The polydata to slice the volume with. Default: null + */ + setSlicePolyData(slicePolyData: vtkPolyData): boolean; } /** @@ -224,13 +243,19 @@ export interface vtkImageResliceMapper extends vtkAbstractImageMapper { * @param model object on which data structure will be bounds (protected) * @param {IImageResliceMapperInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IImageResliceMapperInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IImageResliceMapperInitialValues +): void; /** * Method use to create a new instance of vtkImageResliceMapper * @param {IImageResliceMapperInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IImageResliceMapperInitialValues): vtkImageResliceMapper; +export function newInstance( + initialValues?: IImageResliceMapperInitialValues +): vtkImageResliceMapper; /** * vtkImageResliceMapper provides hardware accelerated slicing of 3D image data / volumes. @@ -239,7 +264,7 @@ export function newInstance(initialValues?: IImageResliceMapperInitialValues): v * This class resolves coincident topology with the same methods as vtkMapper. */ export declare const vtkImageResliceMapper: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkImageResliceMapper; diff --git a/Sources/Rendering/Core/ImageSlice/index.d.ts b/Sources/Rendering/Core/ImageSlice/index.d.ts index d096e6e151f..914dc3f4a83 100755 --- a/Sources/Rendering/Core/ImageSlice/index.d.ts +++ b/Sources/Rendering/Core/ImageSlice/index.d.ts @@ -1,140 +1,140 @@ -import { Bounds } from "../../../types"; -import vtkImageProperty, { IImagePropertyInitialValues } from "../ImageProperty"; -import vtkAbstractImageMapper from "../AbstractImageMapper"; -import vtkProp3D, { IProp3DInitialValues } from "../Prop3D"; - -export interface IImageSliceInitialValues extends IProp3DInitialValues{ - mapper?: vtkAbstractImageMapper; - property?: vtkImageProperty; - bounds?: Bounds; +import { Bounds } from '../../../types'; +import vtkImageProperty, { + IImagePropertyInitialValues, +} from '../ImageProperty'; +import vtkAbstractImageMapper from '../AbstractImageMapper'; +import vtkProp3D, { IProp3DInitialValues } from '../Prop3D'; + +export interface IImageSliceInitialValues extends IProp3DInitialValues { + mapper?: vtkAbstractImageMapper; + property?: vtkImageProperty; + bounds?: Bounds; } - export interface vtkImageSlice extends vtkProp3D { - - /** - * - */ - getActors(): any; - - /** - * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @return {Bounds} The bounds for the mapper. - */ - getBounds(): Bounds; - - /** - * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @return {Bounds} The bounds for the mapper. - */ - getBoundsByReference(): Bounds; - - /** - * Get the bounds for a given slice as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @param {Number} slice The slice index. If undefined, the current slice is considered. - * @param {Number} [thickness] The slice thickness. If undefined, 0 is considered. - * @return {Bounds} The bounds for a given slice. - */ - getBoundsForSlice(slice?: number, thickness?: number): Bounds; - - /** - * - */ - getImages(): any; - - /** - * - */ - getIsOpaque(): boolean; - - /** - * - */ - getProperty(): vtkImageProperty; - - /** - * - */ - getMapper(): vtkAbstractImageMapper; - - /** - * Get the minimum X bound - */ - getMinXBound(): number; - - /** - * Get the maximum X bound - */ - getMaxXBound(): number; - - /** - * Get the minimum Y bound - */ - getMinYBound(): number; - - /** - * Get the maximum Y bound - */ - getMaxYBound(): number; - - /** - * Get the minimum Z bound - */ - getMinZBound(): number; - - /** - * Get the maximum Z bound - */ - getMaxZBound(): number; - - /** - * Return the `Modified Time` which is a monotonic increasing integer - * global for all vtkObjects. - * - * This allow to solve a question such as: - * - Is that object created/modified after another one? - * - Do I need to re-execute this filter, or not? ... - * - * @return {Number} the global modified time. - */ - getMTime(): number; - - /** - * - */ - getRedrawMTime(): number; - - /** - * - */ - getSupportsSelection(): boolean; - - /** - * Always render during opaque pass, to keep the behavior - * predictable and because depth-peeling kills alpha-blending. - * In the future, the Renderer should render images in layers, - * i.e. where each image will have a layer number assigned to it, - * and the Renderer will do the images in their own pass. - */ - hasTranslucentPolygonalGeometry(): boolean; - - /** - * Create a new property suitable for use with this type of Actor. - * @param {IImageSliceInitialValues} [initialValues] (default: {}) - */ - makeProperty(initialValues?: IImagePropertyInitialValues): vtkImageProperty; - - /** - * - * @param {vtkAbstractImageMapper} mapper An instance that derives from vtkAbstractImageMapper. - */ - setMapper(mapper: vtkAbstractImageMapper): boolean; - - /** - * - * @param {vtkImageProperty} property The vtkImageProperty instance. - */ - setProperty(property: vtkImageProperty): boolean; + /** + * + */ + getActors(): any; + + /** + * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @return {Bounds} The bounds for the mapper. + */ + getBounds(): Bounds; + + /** + * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @return {Bounds} The bounds for the mapper. + */ + getBoundsByReference(): Bounds; + + /** + * Get the bounds for a given slice as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @param {Number} slice The slice index. If undefined, the current slice is considered. + * @param {Number} [thickness] The slice thickness. If undefined, 0 is considered. + * @return {Bounds} The bounds for a given slice. + */ + getBoundsForSlice(slice?: number, thickness?: number): Bounds; + + /** + * + */ + getImages(): any; + + /** + * + */ + getIsOpaque(): boolean; + + /** + * + */ + getProperty(): vtkImageProperty; + + /** + * + */ + getMapper(): vtkAbstractImageMapper; + + /** + * Get the minimum X bound + */ + getMinXBound(): number; + + /** + * Get the maximum X bound + */ + getMaxXBound(): number; + + /** + * Get the minimum Y bound + */ + getMinYBound(): number; + + /** + * Get the maximum Y bound + */ + getMaxYBound(): number; + + /** + * Get the minimum Z bound + */ + getMinZBound(): number; + + /** + * Get the maximum Z bound + */ + getMaxZBound(): number; + + /** + * Return the `Modified Time` which is a monotonic increasing integer + * global for all vtkObjects. + * + * This allow to solve a question such as: + * - Is that object created/modified after another one? + * - Do I need to re-execute this filter, or not? ... + * + * @return {Number} the global modified time. + */ + getMTime(): number; + + /** + * + */ + getRedrawMTime(): number; + + /** + * + */ + getSupportsSelection(): boolean; + + /** + * Always render during opaque pass, to keep the behavior + * predictable and because depth-peeling kills alpha-blending. + * In the future, the Renderer should render images in layers, + * i.e. where each image will have a layer number assigned to it, + * and the Renderer will do the images in their own pass. + */ + hasTranslucentPolygonalGeometry(): boolean; + + /** + * Create a new property suitable for use with this type of Actor. + * @param {IImageSliceInitialValues} [initialValues] (default: {}) + */ + makeProperty(initialValues?: IImagePropertyInitialValues): vtkImageProperty; + + /** + * + * @param {vtkAbstractImageMapper} mapper An instance that derives from vtkAbstractImageMapper. + */ + setMapper(mapper: vtkAbstractImageMapper): boolean; + + /** + * + * @param {vtkImageProperty} property The vtkImageProperty instance. + */ + setProperty(property: vtkImageProperty): boolean; } /** @@ -144,22 +144,28 @@ export interface vtkImageSlice extends vtkProp3D { * @param model object on which data structure will be bounds (protected) * @param {IImageSliceInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IImageSliceInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IImageSliceInitialValues +): void; /** * Method use to create a new instance of vtkImageSlice * @param {IImageSliceInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IImageSliceInitialValues): vtkImageSlice; +export function newInstance( + initialValues?: IImageSliceInitialValues +): vtkImageSlice; /** * vtkImageSlice provides 2D image display support for vtk. * It can be associated with a vtkImageSlice prop and placed within a Renderer. - * + * * This class resolves coincident topology with the same methods as vtkMapper. */ export declare const vtkImageSlice: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkImageSlice; diff --git a/Sources/Rendering/Core/InteractorObserver/index.d.ts b/Sources/Rendering/Core/InteractorObserver/index.d.ts index a6386f6c329..0dd9038ae78 100644 --- a/Sources/Rendering/Core/InteractorObserver/index.d.ts +++ b/Sources/Rendering/Core/InteractorObserver/index.d.ts @@ -6,70 +6,79 @@ import { Vector3 } from '../../../types'; export interface vtkInteractorObserver extends vtkObject { /** * Invoke an interaction event. - * + * * @param args Event payload. */ invokeInteractionEvent(...args: unknown[]): void; /** * Registers a callback to be invoked when an interaction event occurs. - * + * * @param {EventHandler} cb The callback to be called. * @param {Number} [priority] The priority of the event. */ - onInteractionEvent(cb: EventHandler, priority?: number): Readonly; + onInteractionEvent( + cb: EventHandler, + priority?: number + ): Readonly; /** * Invoke a start interaction event. - * - * @param args Event payload. + * + * @param args Event payload. */ invokeStartInteractionEvent(...args: unknown[]): void; /** * Registers a callback to be invoked when a start interaction event occurs. - * - * @param {EventHandler} cb The callback to be called. + * + * @param {EventHandler} cb The callback to be called. * @param {Number} [priority] The callback to be called */ - onStartInteractionEvent(cb: EventHandler, priority?: number): Readonly; + onStartInteractionEvent( + cb: EventHandler, + priority?: number + ): Readonly; /** * Invoke an end interaction event. - * - * @param args Event payload. + * + * @param args Event payload. */ invokeEndInteractionEvent(...args: unknown[]): void; /** * Registers a callback to be invoked when an end interaction event occurs. - * - * @param {EventHandler} cb The callback to be called. + * + * @param {EventHandler} cb The callback to be called. * @param {Number?} [priority] The callback to be called */ - onEndInteractionEvent(cb: EventHandler, priority?: number): Readonly; + onEndInteractionEvent( + cb: EventHandler, + priority?: number + ): Readonly; - /** - * Retrieve the render window interactor instance. + /** + * Retrieve the render window interactor instance. */ getInteractor(): vtkRenderWindowInteractor; - /** - * Get wether or not this InteractorObserver instance is enabled. + /** + * Get wether or not this InteractorObserver instance is enabled. */ getEnabled(): boolean; - + /** * Enable/disable the interactor observer. Note that if you are enabling the interactor observer, an interactor instance must exists on the model. * Typically you can call `setInteractor` - * - * @param {Boolean} enable + * + * @param {Boolean} enable */ setEnabled(enable: boolean): void; /** * Set the priority. - * + * * @param {Number} priority The priority level. */ setPriority(priority: number): void; @@ -81,8 +90,8 @@ export interface vtkInteractorObserver extends vtkObject { /** * Set whether or not the interactor observer instance should process events. - * - * @param {Boolean} processEvents + * + * @param {Boolean} processEvents */ setProcessEvents(processEvents: boolean): boolean; @@ -93,18 +102,18 @@ export interface vtkInteractorObserver extends vtkObject { /** * Set the interactor instance. - * - * @param {vtkRenderWindowInteractor} interactor + * + * @param {vtkRenderWindowInteractor} interactor */ setInteractor(interactor: vtkRenderWindowInteractor): void; /** * Transform from world to display coordinates. - * + * * @param {vtkRenderer} renderer The vtkRenderer instance. - * @param {Number} x - * @param {Number} y - * @param {Number} z + * @param {Number} x + * @param {Number} y + * @param {Number} z */ computeWorldToDisplay( renderer: vtkRenderer, @@ -117,9 +126,9 @@ export interface vtkInteractorObserver extends vtkObject { * Transform from display to world coordinates. * * @param {vtkRenderer} renderer The vtkRenderer instance. - * @param {Number} x - * @param {Number} y - * @param {Number} z + * @param {Number} x + * @param {Number} y + * @param {Number} z */ computeDisplayToWorld( renderer: vtkRenderer, diff --git a/Sources/Rendering/Core/Light/index.d.ts b/Sources/Rendering/Core/Light/index.d.ts index 3e3d1f3d603..26ec5d458cf 100755 --- a/Sources/Rendering/Core/Light/index.d.ts +++ b/Sources/Rendering/Core/Light/index.d.ts @@ -1,324 +1,323 @@ -import { mat4 } from "gl-matrix"; -import { vtkObject } from "../../../interfaces"; -import { RGBColor, Vector3 } from "../../../types"; +import { mat4 } from 'gl-matrix'; +import { vtkObject } from '../../../interfaces'; +import { RGBColor, Vector3 } from '../../../types'; export enum LIGHT_TYPES { - 'HeadLight', - 'CameraLight', - 'SceneLight', + 'HeadLight', + 'CameraLight', + 'SceneLight', } export interface ILightInitialValues { - switch?: boolean; - intensity?: number; - color?: RGBColor; - position?: Vector3; - focalPoint?: Vector3; - positional?: boolean; - exponent?: number; - coneAngle?: number; - coneFalloff?: number; - attenuationValues?: number[]; - lightType?: LIGHT_TYPES; - shadowAttenuation?: number; - direction?: Vector3; - directionMTime?: number; + switch?: boolean; + intensity?: number; + color?: RGBColor; + position?: Vector3; + focalPoint?: Vector3; + positional?: boolean; + exponent?: number; + coneAngle?: number; + coneFalloff?: number; + attenuationValues?: number[]; + lightType?: LIGHT_TYPES; + shadowAttenuation?: number; + direction?: Vector3; + directionMTime?: number; } export interface vtkLight extends vtkObject { - - /** - * - */ - getAttenuationValues(): number[]; - - /** - * - */ - getAttenuationValuesByReference(): number[]; - - /** - * Get the color of the light. - */ - getColor(): RGBColor; - - /** - * Get the color of the light. - */ - getColorByReference(): RGBColor; - - /** - * Get the lighting cone angle of a positional light in degrees. - * This is the angle between the axis of the cone and a ray along the edge - * of the cone. A value of 90 (or more) indicates that you want no spot - * lighting effects just a positional light. - */ - getConeAngle(): number; - - /** - * Get the lighting falloff angle of a positional light in degrees. - * This is the angle that sets how much the cone will be extended to - * smooth the border. A value of 0 indicates that the spot light will - * have a completely sharp edge (this does not mean completely sharp - * lighting, just that the border will be sharp). - */ - getConeFalloff(): number; - - /** - * Set the position and focal point of a light based on elevation and azimuth. - * The light is moved so it is shining from the given angle. Angles are - * given in degrees. If the light is a positional light, it is made - * directional instead. - */ - getDirection(): Vector3; - - /** - * Get the exponent of the cosine used in positional lighting. - */ - getExponent(): number; - - /** - * Get the focal point. - */ - getFocalPoint(): Vector3; - - /** - * Get the focal point. - */ - getFocalPointByReference(): Vector3; - - /** - * Get the brightness of the light - */ - getIntensity(): number - - /** - * Get the type of the light. - */ - getLightType(): string - - /** - * Get the position of the light. - */ - getPosition(): Vector3; - - /** - * Get the position of the light. - */ - getPositionByReference(): Vector3; - - /** - * Get if positional lighting is on or off. - */ - getPositional(): boolean - - /** - * Get the position of the light, modified by the transformation matrix (if - * it exists). - */ - getTransformedPosition(): Vector3; - - /** - * Get the focal point of the light, modified by the transformation matrix - * (if it exists). - */ - getTransformedFocalPoint(): Vector3; - - /** - * Set the quadratic attenuation constants. - * @param {Number} a - * @param {Number} b - * @param {Number} c - */ - setAttenuationValues(a: number, b: number, c: number): boolean; - - /** - * Set the quadratic attenuation constants from an array. - * @param {Number[]} attenuationValues The quadratic attenuation. - */ - setAttenuationValuesFrom(attenuationValues: number[]): boolean; - - /** - * Set the color of the object. Has the side effect of setting the - * ambient diffuse and specular colors as well. This is basically - * a quick overall color setting method. - * @param {Number} r Defines the red component (between 0 and 1). - * @param {Number} g Defines the green component (between 0 and 1). - * @param {Number} b Defines the blue component (between 0 and 1). - */ - setColor(r: number, g: number, b: number): boolean; - - /** - * Set the color of the object. Has the side effect of setting the - * ambient diffuse and specular colors as well. This is basically - * a quick overall color setting method. - * @param {RGBColor} color Defines the RGB color array.. - */ - setColor(color: RGBColor): boolean; - - /** - * Set the color of the object. Has the side effect of setting the - * ambient diffuse and specular colors as well. This is basically - * a quick overall color setting method. - * @param {Number} r Defines the red component (between 0 and 1). - * @param {Number} g Defines the green component (between 0 and 1). - * @param {Number} b Defines the blue component (between 0 and 1). - */ - setColorFrom(r: number, g: number, b: number): boolean; - - /** - * Set the color of the object. Has the side effect of setting the - * ambient diffuse and specular colors as well. This is basically - * a quick overall color setting method. - * @param {RGBColor} color Defines the RGB color array.. - */ - setColorFrom(color: RGBColor): boolean; - - /** - * Set the lighting cone angle of a positional light in degrees. - * This is the angle between the axis of the cone and a ray along the edge - * of the cone. - * A value of 90 (or more) indicates that you want no spot lighting effects - * just a positional light. - * @param {Number} coneAngle The cone angle. - */ - setConeAngle(coneAngle: number): boolean; - - /** - * Set the lighting falloff angle of a positional light in degrees. - * This is the angle that sets how much the cone will be extended to - * smooth the border. A value of 0 indicates that the spot light will - * have a completely sharp edge (this does not mean completely sharp - * lighting, just that the border will be sharp). - * @param {Number} coneFalloff The cone falloff angle. - */ - setConeFalloff(coneFalloff: number): boolean; - - /** - * Set the position and focal point of a light based on elevation and - * azimuth. The light is moved so it is shining from the given angle. Angles - * are given in degrees. If the light is a positional light, it is made - * directional instead. - * @param {Number} elevation - * @param {Number} azimuth - */ - setDirectionAngle(elevation: number, azimuth: number): boolean; - - /** - * Set the direction vector of the light from X, Y, and Z values - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setDirection(x: number, y: number, z: number): boolean; - - /** - * Set the direction vector of the light from X, Y, and Z values - * @param {Vector3} direction - */ - setDirection(direction: Vector3): boolean; - - /** - * Set the exponent of the cosine used in positional lighting. - * @param {Number} exponent The exponent of the cosine. - */ - setExponent(exponent: number): boolean; - - /** - * Set the focal point. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setFocalPoint(x: number, y: number, z: number): boolean; - - /** - * Set the focal point from an array - * @param {Vector3} focalPoint The focal point array. - */ - setFocalPointFrom(focalPoint: Vector3): boolean; - - /** - * Set the brightness of the light (from one to zero). - * @param {Number} intensity - */ - setIntensity(intensity: number): boolean; - - /** - * Set the type of the light to lightType - * @param {LIGHT_TYPES} lightType The light type. - */ - setLightType(lightType: LIGHT_TYPES): boolean; - - /** - * Set the type of the light is CameraLight. - */ - setLightTypeToCameraLight(): boolean; - - /** - * Set the the type of the light is HeadLight. - */ - setLightTypeToHeadLight(): boolean; - - /** - * Set the the type of the light is SceneLight. - */ - setLightTypeToSceneLight(): boolean; - - /** - * Check if the type of the light is CameraLight. - */ - lightTypeIsCameraLight(): boolean; - - /** - * Check if the type of the light is HeadLight. - */ - lightTypeIsHeadLight(): boolean; - - /** - * Check if the type of the light is SceneLight. - */ - lightTypeIsSceneLight(): boolean; - - /** - * Set the position of the light. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setPosition(x: number, y: number, z: number): boolean; - - /** - * Set the position of the light. - * @param {Vector3} position The position coordinate of the light. - */ - setPositionFrom(position: Vector3): boolean; - - /** - * Turn positional lighting on or off. - * @param {Boolean} positional The positional value. - */ - setPositional(positional: boolean): boolean; - - /** - * Set the shadow intensity By default a light will be completely blocked - * when in shadow by setting this value to less than 1.0 you can control how - * much light is attenuated when in shadow. - * @param {Number} shadowAttenuation The shadow attenuation value. - */ - setShadowAttenuation(shadowAttenuation: number): boolean; - - /** - * Turn the light on or off. - * @param {Boolean} switchValue The switch value. - */ - setSwitch(switchValue: boolean): boolean; - - /** - * Set the light's transformation matrix. - * @param {mat4} transformMatrix The transform matrix. - */ - setTransformMatrix(transformMatrix: mat4): boolean; + /** + * + */ + getAttenuationValues(): number[]; + + /** + * + */ + getAttenuationValuesByReference(): number[]; + + /** + * Get the color of the light. + */ + getColor(): RGBColor; + + /** + * Get the color of the light. + */ + getColorByReference(): RGBColor; + + /** + * Get the lighting cone angle of a positional light in degrees. + * This is the angle between the axis of the cone and a ray along the edge + * of the cone. A value of 90 (or more) indicates that you want no spot + * lighting effects just a positional light. + */ + getConeAngle(): number; + + /** + * Get the lighting falloff angle of a positional light in degrees. + * This is the angle that sets how much the cone will be extended to + * smooth the border. A value of 0 indicates that the spot light will + * have a completely sharp edge (this does not mean completely sharp + * lighting, just that the border will be sharp). + */ + getConeFalloff(): number; + + /** + * Set the position and focal point of a light based on elevation and azimuth. + * The light is moved so it is shining from the given angle. Angles are + * given in degrees. If the light is a positional light, it is made + * directional instead. + */ + getDirection(): Vector3; + + /** + * Get the exponent of the cosine used in positional lighting. + */ + getExponent(): number; + + /** + * Get the focal point. + */ + getFocalPoint(): Vector3; + + /** + * Get the focal point. + */ + getFocalPointByReference(): Vector3; + + /** + * Get the brightness of the light + */ + getIntensity(): number; + + /** + * Get the type of the light. + */ + getLightType(): string; + + /** + * Get the position of the light. + */ + getPosition(): Vector3; + + /** + * Get the position of the light. + */ + getPositionByReference(): Vector3; + + /** + * Get if positional lighting is on or off. + */ + getPositional(): boolean; + + /** + * Get the position of the light, modified by the transformation matrix (if + * it exists). + */ + getTransformedPosition(): Vector3; + + /** + * Get the focal point of the light, modified by the transformation matrix + * (if it exists). + */ + getTransformedFocalPoint(): Vector3; + + /** + * Set the quadratic attenuation constants. + * @param {Number} a + * @param {Number} b + * @param {Number} c + */ + setAttenuationValues(a: number, b: number, c: number): boolean; + + /** + * Set the quadratic attenuation constants from an array. + * @param {Number[]} attenuationValues The quadratic attenuation. + */ + setAttenuationValuesFrom(attenuationValues: number[]): boolean; + + /** + * Set the color of the object. Has the side effect of setting the + * ambient diffuse and specular colors as well. This is basically + * a quick overall color setting method. + * @param {Number} r Defines the red component (between 0 and 1). + * @param {Number} g Defines the green component (between 0 and 1). + * @param {Number} b Defines the blue component (between 0 and 1). + */ + setColor(r: number, g: number, b: number): boolean; + + /** + * Set the color of the object. Has the side effect of setting the + * ambient diffuse and specular colors as well. This is basically + * a quick overall color setting method. + * @param {RGBColor} color Defines the RGB color array.. + */ + setColor(color: RGBColor): boolean; + + /** + * Set the color of the object. Has the side effect of setting the + * ambient diffuse and specular colors as well. This is basically + * a quick overall color setting method. + * @param {Number} r Defines the red component (between 0 and 1). + * @param {Number} g Defines the green component (between 0 and 1). + * @param {Number} b Defines the blue component (between 0 and 1). + */ + setColorFrom(r: number, g: number, b: number): boolean; + + /** + * Set the color of the object. Has the side effect of setting the + * ambient diffuse and specular colors as well. This is basically + * a quick overall color setting method. + * @param {RGBColor} color Defines the RGB color array.. + */ + setColorFrom(color: RGBColor): boolean; + + /** + * Set the lighting cone angle of a positional light in degrees. + * This is the angle between the axis of the cone and a ray along the edge + * of the cone. + * A value of 90 (or more) indicates that you want no spot lighting effects + * just a positional light. + * @param {Number} coneAngle The cone angle. + */ + setConeAngle(coneAngle: number): boolean; + + /** + * Set the lighting falloff angle of a positional light in degrees. + * This is the angle that sets how much the cone will be extended to + * smooth the border. A value of 0 indicates that the spot light will + * have a completely sharp edge (this does not mean completely sharp + * lighting, just that the border will be sharp). + * @param {Number} coneFalloff The cone falloff angle. + */ + setConeFalloff(coneFalloff: number): boolean; + + /** + * Set the position and focal point of a light based on elevation and + * azimuth. The light is moved so it is shining from the given angle. Angles + * are given in degrees. If the light is a positional light, it is made + * directional instead. + * @param {Number} elevation + * @param {Number} azimuth + */ + setDirectionAngle(elevation: number, azimuth: number): boolean; + + /** + * Set the direction vector of the light from X, Y, and Z values + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setDirection(x: number, y: number, z: number): boolean; + + /** + * Set the direction vector of the light from X, Y, and Z values + * @param {Vector3} direction + */ + setDirection(direction: Vector3): boolean; + + /** + * Set the exponent of the cosine used in positional lighting. + * @param {Number} exponent The exponent of the cosine. + */ + setExponent(exponent: number): boolean; + + /** + * Set the focal point. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setFocalPoint(x: number, y: number, z: number): boolean; + + /** + * Set the focal point from an array + * @param {Vector3} focalPoint The focal point array. + */ + setFocalPointFrom(focalPoint: Vector3): boolean; + + /** + * Set the brightness of the light (from one to zero). + * @param {Number} intensity + */ + setIntensity(intensity: number): boolean; + + /** + * Set the type of the light to lightType + * @param {LIGHT_TYPES} lightType The light type. + */ + setLightType(lightType: LIGHT_TYPES): boolean; + + /** + * Set the type of the light is CameraLight. + */ + setLightTypeToCameraLight(): boolean; + + /** + * Set the the type of the light is HeadLight. + */ + setLightTypeToHeadLight(): boolean; + + /** + * Set the the type of the light is SceneLight. + */ + setLightTypeToSceneLight(): boolean; + + /** + * Check if the type of the light is CameraLight. + */ + lightTypeIsCameraLight(): boolean; + + /** + * Check if the type of the light is HeadLight. + */ + lightTypeIsHeadLight(): boolean; + + /** + * Check if the type of the light is SceneLight. + */ + lightTypeIsSceneLight(): boolean; + + /** + * Set the position of the light. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setPosition(x: number, y: number, z: number): boolean; + + /** + * Set the position of the light. + * @param {Vector3} position The position coordinate of the light. + */ + setPositionFrom(position: Vector3): boolean; + + /** + * Turn positional lighting on or off. + * @param {Boolean} positional The positional value. + */ + setPositional(positional: boolean): boolean; + + /** + * Set the shadow intensity By default a light will be completely blocked + * when in shadow by setting this value to less than 1.0 you can control how + * much light is attenuated when in shadow. + * @param {Number} shadowAttenuation The shadow attenuation value. + */ + setShadowAttenuation(shadowAttenuation: number): boolean; + + /** + * Turn the light on or off. + * @param {Boolean} switchValue The switch value. + */ + setSwitch(switchValue: boolean): boolean; + + /** + * Set the light's transformation matrix. + * @param {mat4} transformMatrix The transform matrix. + */ + setTransformMatrix(transformMatrix: mat4): boolean; } /** @@ -328,11 +327,15 @@ export interface vtkLight extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {ILightInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ILightInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ILightInitialValues +): void; /** * Method use to create a new instance of vtkLight with the focal point at the origin and its position - * set to [0, 0, 1]. The light is a SceneLight, its color is white, intensity=1, the light is turned on, + * set to [0, 0, 1]. The light is a SceneLight, its color is white, intensity=1, the light is turned on, * positional lighting is off, coneAngle=30, coneFalloff=5, AttenuationValues=[1, 0, 0], exponent=1 and the transformMatrix is null. * @param {ILightInitialValues} [initialValues] for pre-setting some of its content */ @@ -345,7 +348,7 @@ export function newInstance(initialValues?: ILightInitialValues): vtkLight; * you also can specify the light attenuation values and cone angle. * These attributes are only used if the light is a positional light. * The default is a directional light (e.g. infinite point light source). - * + * * Lights have a type that describes how the light should move with respect * to the camera. A Headlight is always located at the current camera position * and shines on the camera’s focal point. A CameraLight also moves with @@ -354,15 +357,15 @@ export function newInstance(initialValues?: ILightInitialValues): vtkLight; * the camera is looking at (0, 0, 0), and up is (0, 1, 0). Finally, a * SceneLight is part of the scene itself and does not move with the camera. * (Renderers are responsible for moving the light based on its type.) - * + * * Lights have a transformation matrix that describes the space in which * they are positioned. A light’s world space position and focal point * are defined by their local position and focal point, transformed by * their transformation matrix (if it exists). */ export declare const vtkLight: { - newInstance: typeof newInstance, - extend: typeof extend, - LIGHT_TYPES: LIGHT_TYPES; + newInstance: typeof newInstance; + extend: typeof extend; + LIGHT_TYPES: LIGHT_TYPES; }; export default vtkLight; diff --git a/Sources/Rendering/Core/Mapper/Constants.d.ts b/Sources/Rendering/Core/Mapper/Constants.d.ts index 9a2cf69d58c..862eb4c8fcf 100644 --- a/Sources/Rendering/Core/Mapper/Constants.d.ts +++ b/Sources/Rendering/Core/Mapper/Constants.d.ts @@ -1,26 +1,26 @@ export declare enum ColorMode { - DEFAULT = 0, - MAP_SCALARS = 1, - DIRECT_SCALARS = 2, + DEFAULT = 0, + MAP_SCALARS = 1, + DIRECT_SCALARS = 2, } export declare enum ScalarMode { - DEFAULT = 0, - USE_POINT_DATA = 1, - USE_CELL_DATA = 2, - USE_POINT_FIELD_DATA = 3, - USE_CELL_FIELD_DATA = 4, - USE_FIELD_DATA = 5, + DEFAULT = 0, + USE_POINT_DATA = 1, + USE_CELL_DATA = 2, + USE_POINT_FIELD_DATA = 3, + USE_CELL_FIELD_DATA = 4, + USE_FIELD_DATA = 5, } export declare enum GetArray { - BY_ID = 0, - BY_NAME = 1, + BY_ID = 0, + BY_NAME = 1, } declare const _default: { - ColorMode: typeof ColorMode; - ScalarMode: typeof ScalarMode; - GetArray: typeof GetArray; + ColorMode: typeof ColorMode; + ScalarMode: typeof ScalarMode; + GetArray: typeof GetArray; }; export default _default; diff --git a/Sources/Rendering/Core/Mapper/index.d.ts b/Sources/Rendering/Core/Mapper/index.d.ts index abd01d23089..3239a0de351 100755 --- a/Sources/Rendering/Core/Mapper/index.d.ts +++ b/Sources/Rendering/Core/Mapper/index.d.ts @@ -1,494 +1,515 @@ -import { Bounds, Nullable, Range } from "../../../types"; -import vtkAbstractMapper3D, { IAbstractMapper3DInitialValues } from "../AbstractMapper3D"; -import { ColorMode, GetArray, ScalarMode } from "./Constants"; +import { Bounds, Nullable, Range } from '../../../types'; +import vtkAbstractMapper3D, { + IAbstractMapper3DInitialValues, +} from '../AbstractMapper3D'; +import { ColorMode, GetArray, ScalarMode } from './Constants'; interface IPrimitiveCount { - points: number; - verts: number; - lines: number; - triangles: number; + points: number; + verts: number; + lines: number; + triangles: number; } interface IAbstractScalars { - cellFlag: boolean; + cellFlag: boolean; } interface ICoincidentTopology { - factor: number; - offset: number; + factor: number; + offset: number; } interface IScalarToTextureCoordinate { - texCoordS: number; - texCoordT: number; + texCoordS: number; + texCoordT: number; } -export interface IMapperInitialValues extends IAbstractMapper3DInitialValues{ - static?: boolean; - scalarVisibility?: boolean; - scalarRange?: Range; - useLookupTableScalarRange?: boolean; - colorMode?: number; - scalarMode?: number; - arrayAccessMode?: number; - renderTime?: number; - fieldDataTupleId?: number; - interpolateScalarsBeforeMapping?: boolean; - forceCompileOnly?: number; - useInvertibleColors?: boolean; - customShaderAttributes?: any; +export interface IMapperInitialValues extends IAbstractMapper3DInitialValues { + static?: boolean; + scalarVisibility?: boolean; + scalarRange?: Range; + useLookupTableScalarRange?: boolean; + colorMode?: number; + scalarMode?: number; + arrayAccessMode?: number; + renderTime?: number; + fieldDataTupleId?: number; + interpolateScalarsBeforeMapping?: boolean; + forceCompileOnly?: number; + useInvertibleColors?: boolean; + customShaderAttributes?: any; } export interface vtkMapper extends vtkAbstractMapper3D { - - /** - * - */ - acquireInvertibleLookupTable(): void; - - /** - * Returns if we can use texture maps for scalar coloring. Note this doesn’t - * say we “will” use scalar coloring. It says, if we do use scalar coloring, - * we will use a texture. - * When rendering multiblock datasets, if any 2 blocks provide different - * lookup tables for the scalars, then also we cannot use textures. This case - * can be handled if required. - * @param input - */ - canUseTextureMapForColoring(input: any): boolean; - - /** - * Call to force a rebuild of color result arrays on next MapScalars. - * Necessary when using arrays in the case of multiblock data. - */ - clearColorArrays(): void; - - /** - * - */ - clearInvertibleColor(): void; - - /** - * - */ - colorToValue(): void; - - /** - * - * @param input - * @param output - * @param numScalars - * @param numComps - * @param component - * @param range - * @param tableRange - * @param tableNumberOfColors - * @param useLogScale - */ - createColorTextureCoordinates(input: any, output: any, numScalars: number, numComps: number, component: number, range: any, tableRange: any, tableNumberOfColors: number, useLogScale: boolean): void; - - /** - * Create default lookup table. Generally used to create one when - * none is available with the scalar data. - */ - createDefaultLookupTable(): void; - - /** - * - * @param input - * @param {ScalarMode} scalarMode - * @param arrayAccessMode - * @param arrayId - * @param arrayName - */ - getAbstractScalars(input: any, scalarMode: ScalarMode, arrayAccessMode: number, arrayId: any, arrayName: any): IAbstractScalars; - - /** - * - */ - getArrayAccessMode(): number; - - /** - * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @return {Bounds} The bounds for the mapper. - */ - getBounds(): Bounds; - - /** - * - */ - getCoincidentTopologyPolygonOffsetParameters(): ICoincidentTopology; - - /** - * - */ - getCoincidentTopologyLineOffsetParameters(): ICoincidentTopology; - - /** - * - */ - getCoincidentTopologyPointOffsetParameter(): ICoincidentTopology; - - /** - * Get the array name to color by. - */ - getColorByArrayName(): Nullable; - - /** - * Provide read access to the color texture coordinate array - */ - getColorCoordinates(): Nullable; - - /** - * Provide read access to the color array. - */ - getColorMapColors(): Nullable; - - /** - * Return the method of coloring scalar data. - */ - getColorMode(): ColorMode; - - /** - * Return the method of coloring scalar data. - */ - getColorModeAsString(): string; - - /** - * Provide read access to the color texture array - * @todo Check the retun type - */ - getColorTextureMap(): any - - /** - * - * @default [] - */ - getCustomShaderAttributes(): any - - /** - * - * @default -1 - */ - getFieldDataTupleId(): any - - /** - * By default, vertex color is used to map colors to a surface. - * Colors are interpolated after being mapped. - * This option avoids color interpolation by using a one dimensional - * texture map for the colors. - * @default false - */ - getInterpolateScalarsBeforeMapping(): boolean; - - /** - * Check if the mapper does not expect to have translucent geometry. This - * may happen when using ColorMode is set to not map scalars i.e. render the - * scalar array directly as colors and the scalar array has opacity i.e. alpha - * component. Default implementation simply returns true. Note that even if - * this method returns true, an actor may treat the geometry as translucent - * since a constant translucency is set on the property, for example. - */ - getIsOpaque(): boolean; - - /** - * Get a lookup table for the mapper to use. - */ - getLookupTable(): any; - - /** - * - */ - getPrimitiveCount(): IPrimitiveCount; - - - - /** - * Return the method for obtaining scalar data. - */ - getScalarMode(): number; - - /** - * Return the method for obtaining scalar data. - */ - getScalarModeAsString(): string; - - /** - * - * @default [0, 1] - */ - getScalarRange(): number[]; - - /** - * - * @default [0, 1] - */ - getScalarRangeByReference(): number[]; - - /** - * Check whether scalar data is used to color objects. - * @default true - */ - getScalarVisibility(): boolean; - - /** - * Check whether the mapper’s data is static. - * @default false - */ - getStatic(): boolean; - - /** - * - * @default false - */ - getUseLookupTableScalarRange(): boolean; - - /** - * - * @default null - */ - getViewSpecificProperties(): object; - - /** - * Map the scalars (if there are any scalars and ScalarVisibility is on) - * through the lookup table, returning an unsigned char RGBA array. This is - * typically done as part of the rendering process. The alpha parameter - * allows the blending of the scalars with an additional alpha (typically - * which comes from a vtkActor, etc.) - * { - * rgba: Uint8Array(), - * location: 0/1/2, // Points/Cells/Fields - * } - * @param input - * @param {Number} alpha - */ - mapScalars(input: any, alpha: number): void; - - /** - * - * @param scalars - * @param {Number} alpha - */ - mapScalarsToTexture(scalars: any, alpha: number): void; - - /** - * - * @param {Number} scalarValue - * @param {Number} rangeMin - * @param {Number} invRangeWidth - */ - scalarToTextureCoordinate(scalarValue: number, rangeMin: number, invRangeWidth: number): IScalarToTextureCoordinate; - - /** - * - * @param {Number} arrayAccessMode - */ - setArrayAccessMode(arrayAccessMode: number): boolean; - - /** - * Set the array name to color by. - * @param {String} colorByArrayName - */ - setColorByArrayName(colorByArrayName: string): boolean; - - /** - * - * @param {Number} colorMode - */ - setColorMode(colorMode: number): boolean; - - /** - * Sets colorMode to `DEFAULT` - */ - setColorModeToDefault(): boolean; - - /** - * Sets colorMode to `MAP_SCALARS` - */ - setColorModeToMapScalars(): boolean; - - /** - * Sets colorMode to `DIRECT_SCALARS` - */ - setColorModeToDirectScalars(): boolean; - - /** - * Sets point data array names that will be transferred to the VBO - * @param {String[]} customShaderAttributes - */ - setCustomShaderAttributes(customShaderAttributes: string[]): boolean - - /** - * When ScalarMode is set to UseFieldData, set the index of the - * tuple by which to color the entire data set. By default, the - * index is -1, which means to treat the field data array selected - * with SelectColorArray as having a scalar value for each cell. - * Indices of 0 or higher mean to use the tuple at the given index - * for coloring the entire data set. - * @param {Number} fieldDataTupleI - * @default -1 - */ - setFieldDataTupleId(fieldDataTupleI: number): boolean - - /** - * - * @param {Number} forceCompileOnly - * @default 0 - */ - setForceCompileOnly(forceCompileOnly: number): boolean; - - /** - * Set a lookup table for the mapper to use. - */ - setLookupTable(lookupTable: any): boolean; - - /** - * Control how the filter works with scalar point data and cell attribute - * data. By default (ScalarModeToDefault), the filter will use point data, - * and if no point data is available, then cell data is used. Alternatively - * you can explicitly set the filter to use point data - * (ScalarModeToUsePointData) or cell data (ScalarModeToUseCellData). - * You can also choose to get the scalars from an array in point field - * data (ScalarModeToUsePointFieldData) or cell field data - * (ScalarModeToUseCellFieldData). If scalars are coming from a field - * data array, you must call SelectColorArray before you call GetColors. - * - * When ScalarMode is set to use Field Data (ScalarModeToFieldData), - * you must call SelectColorArray to choose the field data array to - * be used to color cells. In this mode, the default behavior is to - * treat the field data tuples as being associated with cells. If - * the poly data contains triangle strips, the array is expected to - * contain the cell data for each mini-cell formed by any triangle - * strips in the poly data as opposed to treating them as a single - * tuple that applies to the entire strip. This mode can also be - * used to color the entire poly data by a single color obtained by - * mapping the tuple at a given index in the field data array - * through the color map. Use SetFieldDataTupleId() to specify - * the tuple index. - * - * @param scalarMode - */ - setScalarMode(scalarMode: number): boolean; - - /** - * Sets scalarMode to DEFAULT - */ - setScalarModeToDefault(): boolean; - - /** - * Sets scalarMode to USE_CELL_DATA - */ - setScalarModeToUseCellData(): boolean; - - /** - * Sets scalarMode to USE_CELL_FIELD_DATA - */ - setScalarModeToUseCellFieldData(): boolean; - - /** - * Sets scalarMode to USE_FIELD_DATA - */ - setScalarModeToUseFieldData(): boolean; - - /** - * Sets scalarMode to USE_POINT_DATA - */ - setScalarModeToUsePointData(): boolean; - - /** - * Sets scalarMode to USE_POINT_FIELD_DATA - */ - setScalarModeToUsePointFieldData(): boolean; - - /** - * Specify range in terms of scalar minimum and maximum (smin,smax). These - * values are used to map scalars into lookup table. Has no effect when - * UseLookupTableScalarRange is true. - * - * @param min - * @param max - * @default [0, 1] - */ - setScalarRange(min: number, max: number): boolean; - - /** - * Specify range in terms of scalar minimum and maximum (smin,smax). These - * values are used to map scalars into lookup table. Has no effect when - * UseLookupTableScalarRange is true. - * - * @param scalarRange - * @default [0, 1] - */ - setScalarRange(scalarRange: number[]): boolean; - - /** - * - * @param scalarRange - * @default [0, 1] - */ - setScalarRangeFrom(scalarRange: number[]): boolean; - - /** - * Turn on/off flag to control whether scalar data is used to color objects. - * @param {Boolean} scalarVisibility - * @default true - */ - setScalarVisibility(scalarVisibility: boolean): boolean; - - /** - * Turn on/off flag to control whether the mapper’s data is static. Static data - * means that the mapper does not propagate updates down the pipeline, greatly - * decreasing the time it takes to update many mappers. This should only be - * used if the data never changes. - * - * @param {Boolean} static - * @default false - */ - setStatic(static: boolean): boolean; - - /** - * Control whether the mapper sets the lookuptable range based on its - * own ScalarRange, or whether it will use the LookupTable ScalarRange - * regardless of it’s own setting. By default the Mapper is allowed to set - * the LookupTable range, but users who are sharing LookupTables between - * mappers/actors will probably wish to force the mapper to use the - * LookupTable unchanged. - * - * @param {Boolean} useLookupTableScalarRange - * @default false - */ - setUseLookupTableScalarRange(useLookupTableScalarRange: boolean): boolean; - - /** - * If you want to provide specific properties for rendering engines you can use - * viewSpecificProperties. - * - * You can go and have a look in the rendering backend of your choice for details - * on specific properties. - * For example, for OpenGL/WebGL see OpenGL/PolyDataMapper/api.md - * If there is no details, viewSpecificProperties is not supported. - * @param viewSpecificProperties - */ - setViewSpecificProperties(viewSpecificProperties: object): boolean; - - /** - * - */ - useInvertibleColorFor(): void; - - /** - * - */ - valueToColor(): void; - - /** - * - */ - setInterpolateScalarsBeforeMapping(interpolateScalarsBeforeMapping: boolean): boolean; - - setResolveCoincidentTopologyToPolygonOffset(): boolean; - - setResolveCoincidentTopologyToOff(): boolean; + /** + * + */ + acquireInvertibleLookupTable(): void; + + /** + * Returns if we can use texture maps for scalar coloring. Note this doesn’t + * say we “will” use scalar coloring. It says, if we do use scalar coloring, + * we will use a texture. + * When rendering multiblock datasets, if any 2 blocks provide different + * lookup tables for the scalars, then also we cannot use textures. This case + * can be handled if required. + * @param input + */ + canUseTextureMapForColoring(input: any): boolean; + + /** + * Call to force a rebuild of color result arrays on next MapScalars. + * Necessary when using arrays in the case of multiblock data. + */ + clearColorArrays(): void; + + /** + * + */ + clearInvertibleColor(): void; + + /** + * + */ + colorToValue(): void; + + /** + * + * @param input + * @param output + * @param numScalars + * @param numComps + * @param component + * @param range + * @param tableRange + * @param tableNumberOfColors + * @param useLogScale + */ + createColorTextureCoordinates( + input: any, + output: any, + numScalars: number, + numComps: number, + component: number, + range: any, + tableRange: any, + tableNumberOfColors: number, + useLogScale: boolean + ): void; + + /** + * Create default lookup table. Generally used to create one when + * none is available with the scalar data. + */ + createDefaultLookupTable(): void; + + /** + * + * @param input + * @param {ScalarMode} scalarMode + * @param arrayAccessMode + * @param arrayId + * @param arrayName + */ + getAbstractScalars( + input: any, + scalarMode: ScalarMode, + arrayAccessMode: number, + arrayId: any, + arrayName: any + ): IAbstractScalars; + + /** + * + */ + getArrayAccessMode(): number; + + /** + * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @return {Bounds} The bounds for the mapper. + */ + getBounds(): Bounds; + + /** + * + */ + getCoincidentTopologyPolygonOffsetParameters(): ICoincidentTopology; + + /** + * + */ + getCoincidentTopologyLineOffsetParameters(): ICoincidentTopology; + + /** + * + */ + getCoincidentTopologyPointOffsetParameter(): ICoincidentTopology; + + /** + * Get the array name to color by. + */ + getColorByArrayName(): Nullable; + + /** + * Provide read access to the color texture coordinate array + */ + getColorCoordinates(): Nullable; + + /** + * Provide read access to the color array. + */ + getColorMapColors(): Nullable; + + /** + * Return the method of coloring scalar data. + */ + getColorMode(): ColorMode; + + /** + * Return the method of coloring scalar data. + */ + getColorModeAsString(): string; + + /** + * Provide read access to the color texture array + * @todo Check the retun type + */ + getColorTextureMap(): any; + + /** + * + * @default [] + */ + getCustomShaderAttributes(): any; + + /** + * + * @default -1 + */ + getFieldDataTupleId(): any; + + /** + * By default, vertex color is used to map colors to a surface. + * Colors are interpolated after being mapped. + * This option avoids color interpolation by using a one dimensional + * texture map for the colors. + * @default false + */ + getInterpolateScalarsBeforeMapping(): boolean; + + /** + * Check if the mapper does not expect to have translucent geometry. This + * may happen when using ColorMode is set to not map scalars i.e. render the + * scalar array directly as colors and the scalar array has opacity i.e. alpha + * component. Default implementation simply returns true. Note that even if + * this method returns true, an actor may treat the geometry as translucent + * since a constant translucency is set on the property, for example. + */ + getIsOpaque(): boolean; + + /** + * Get a lookup table for the mapper to use. + */ + getLookupTable(): any; + + /** + * + */ + getPrimitiveCount(): IPrimitiveCount; + + /** + * Return the method for obtaining scalar data. + */ + getScalarMode(): number; + + /** + * Return the method for obtaining scalar data. + */ + getScalarModeAsString(): string; + + /** + * + * @default [0, 1] + */ + getScalarRange(): number[]; + + /** + * + * @default [0, 1] + */ + getScalarRangeByReference(): number[]; + + /** + * Check whether scalar data is used to color objects. + * @default true + */ + getScalarVisibility(): boolean; + + /** + * Check whether the mapper’s data is static. + * @default false + */ + getStatic(): boolean; + + /** + * + * @default false + */ + getUseLookupTableScalarRange(): boolean; + + /** + * + * @default null + */ + getViewSpecificProperties(): object; + + /** + * Map the scalars (if there are any scalars and ScalarVisibility is on) + * through the lookup table, returning an unsigned char RGBA array. This is + * typically done as part of the rendering process. The alpha parameter + * allows the blending of the scalars with an additional alpha (typically + * which comes from a vtkActor, etc.) + * { + * rgba: Uint8Array(), + * location: 0/1/2, // Points/Cells/Fields + * } + * @param input + * @param {Number} alpha + */ + mapScalars(input: any, alpha: number): void; + + /** + * + * @param scalars + * @param {Number} alpha + */ + mapScalarsToTexture(scalars: any, alpha: number): void; + + /** + * + * @param {Number} scalarValue + * @param {Number} rangeMin + * @param {Number} invRangeWidth + */ + scalarToTextureCoordinate( + scalarValue: number, + rangeMin: number, + invRangeWidth: number + ): IScalarToTextureCoordinate; + + /** + * + * @param {Number} arrayAccessMode + */ + setArrayAccessMode(arrayAccessMode: number): boolean; + + /** + * Set the array name to color by. + * @param {String} colorByArrayName + */ + setColorByArrayName(colorByArrayName: string): boolean; + + /** + * + * @param {Number} colorMode + */ + setColorMode(colorMode: number): boolean; + + /** + * Sets colorMode to `DEFAULT` + */ + setColorModeToDefault(): boolean; + + /** + * Sets colorMode to `MAP_SCALARS` + */ + setColorModeToMapScalars(): boolean; + + /** + * Sets colorMode to `DIRECT_SCALARS` + */ + setColorModeToDirectScalars(): boolean; + + /** + * Sets point data array names that will be transferred to the VBO + * @param {String[]} customShaderAttributes + */ + setCustomShaderAttributes(customShaderAttributes: string[]): boolean; + + /** + * When ScalarMode is set to UseFieldData, set the index of the + * tuple by which to color the entire data set. By default, the + * index is -1, which means to treat the field data array selected + * with SelectColorArray as having a scalar value for each cell. + * Indices of 0 or higher mean to use the tuple at the given index + * for coloring the entire data set. + * @param {Number} fieldDataTupleI + * @default -1 + */ + setFieldDataTupleId(fieldDataTupleI: number): boolean; + + /** + * + * @param {Number} forceCompileOnly + * @default 0 + */ + setForceCompileOnly(forceCompileOnly: number): boolean; + + /** + * Set a lookup table for the mapper to use. + */ + setLookupTable(lookupTable: any): boolean; + + /** + * Control how the filter works with scalar point data and cell attribute + * data. By default (ScalarModeToDefault), the filter will use point data, + * and if no point data is available, then cell data is used. Alternatively + * you can explicitly set the filter to use point data + * (ScalarModeToUsePointData) or cell data (ScalarModeToUseCellData). + * You can also choose to get the scalars from an array in point field + * data (ScalarModeToUsePointFieldData) or cell field data + * (ScalarModeToUseCellFieldData). If scalars are coming from a field + * data array, you must call SelectColorArray before you call GetColors. + * + * When ScalarMode is set to use Field Data (ScalarModeToFieldData), + * you must call SelectColorArray to choose the field data array to + * be used to color cells. In this mode, the default behavior is to + * treat the field data tuples as being associated with cells. If + * the poly data contains triangle strips, the array is expected to + * contain the cell data for each mini-cell formed by any triangle + * strips in the poly data as opposed to treating them as a single + * tuple that applies to the entire strip. This mode can also be + * used to color the entire poly data by a single color obtained by + * mapping the tuple at a given index in the field data array + * through the color map. Use SetFieldDataTupleId() to specify + * the tuple index. + * + * @param scalarMode + */ + setScalarMode(scalarMode: number): boolean; + + /** + * Sets scalarMode to DEFAULT + */ + setScalarModeToDefault(): boolean; + + /** + * Sets scalarMode to USE_CELL_DATA + */ + setScalarModeToUseCellData(): boolean; + + /** + * Sets scalarMode to USE_CELL_FIELD_DATA + */ + setScalarModeToUseCellFieldData(): boolean; + + /** + * Sets scalarMode to USE_FIELD_DATA + */ + setScalarModeToUseFieldData(): boolean; + + /** + * Sets scalarMode to USE_POINT_DATA + */ + setScalarModeToUsePointData(): boolean; + + /** + * Sets scalarMode to USE_POINT_FIELD_DATA + */ + setScalarModeToUsePointFieldData(): boolean; + + /** + * Specify range in terms of scalar minimum and maximum (smin,smax). These + * values are used to map scalars into lookup table. Has no effect when + * UseLookupTableScalarRange is true. + * + * @param min + * @param max + * @default [0, 1] + */ + setScalarRange(min: number, max: number): boolean; + + /** + * Specify range in terms of scalar minimum and maximum (smin,smax). These + * values are used to map scalars into lookup table. Has no effect when + * UseLookupTableScalarRange is true. + * + * @param scalarRange + * @default [0, 1] + */ + setScalarRange(scalarRange: number[]): boolean; + + /** + * + * @param scalarRange + * @default [0, 1] + */ + setScalarRangeFrom(scalarRange: number[]): boolean; + + /** + * Turn on/off flag to control whether scalar data is used to color objects. + * @param {Boolean} scalarVisibility + * @default true + */ + setScalarVisibility(scalarVisibility: boolean): boolean; + + /** + * Turn on/off flag to control whether the mapper’s data is static. Static data + * means that the mapper does not propagate updates down the pipeline, greatly + * decreasing the time it takes to update many mappers. This should only be + * used if the data never changes. + * + * @param {Boolean} static + * @default false + */ + setStatic(static: boolean): boolean; + + /** + * Control whether the mapper sets the lookuptable range based on its + * own ScalarRange, or whether it will use the LookupTable ScalarRange + * regardless of it’s own setting. By default the Mapper is allowed to set + * the LookupTable range, but users who are sharing LookupTables between + * mappers/actors will probably wish to force the mapper to use the + * LookupTable unchanged. + * + * @param {Boolean} useLookupTableScalarRange + * @default false + */ + setUseLookupTableScalarRange(useLookupTableScalarRange: boolean): boolean; + + /** + * If you want to provide specific properties for rendering engines you can use + * viewSpecificProperties. + * + * You can go and have a look in the rendering backend of your choice for details + * on specific properties. + * For example, for OpenGL/WebGL see OpenGL/PolyDataMapper/api.md + * If there is no details, viewSpecificProperties is not supported. + * @param viewSpecificProperties + */ + setViewSpecificProperties(viewSpecificProperties: object): boolean; + + /** + * + */ + useInvertibleColorFor(): void; + + /** + * + */ + valueToColor(): void; + + /** + * + */ + setInterpolateScalarsBeforeMapping( + interpolateScalarsBeforeMapping: boolean + ): boolean; + + setResolveCoincidentTopologyToPolygonOffset(): boolean; + + setResolveCoincidentTopologyToOff(): boolean; } /** @@ -498,7 +519,11 @@ export interface vtkMapper extends vtkAbstractMapper3D { * @param model object on which data structure will be bounds (protected) * @param {IMapperInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IMapperInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IMapperInitialValues +): void; /** * Method used to create a new instance of vtkMapper @@ -507,74 +532,76 @@ export function extend(publicAPI: object, model: object, initialValues?: IMapper export function newInstance(initialValues?: IMapperInitialValues): vtkMapper; /** - * + * */ export function getResolveCoincidentTopologyAsString(): string; /** - * + * */ export function getResolveCoincidentTopologyPolygonOffsetFaces(): ICoincidentTopology; /** - * + * */ -export function getResolveCoincidentTopology(): ICoincidentTopology +export function getResolveCoincidentTopology(): ICoincidentTopology; /** - * - * @param {Number} [mode] + * + * @param {Number} [mode] */ export function setResolveCoincidentTopology(mode?: number): boolean; /** - * - * @param value + * + * @param value */ -export function setResolveCoincidentTopologyPolygonOffsetFaces(value: any): boolean; +export function setResolveCoincidentTopologyPolygonOffsetFaces( + value: any +): boolean; /** - * + * */ export function setResolveCoincidentTopologyToDefault(): boolean; /** - * + * */ export function setResolveCoincidentTopologyToOff(): boolean; /** - * + * */ export function setResolveCoincidentTopologyToPolygonOffset(): boolean; /** - * + * */ export function getRelativeCoincidentTopologyLineOffsetParameters(): ICoincidentTopology; /** - * + * */ export function getRelativeCoincidentTopologyPointOffsetParameters(): ICoincidentTopology; /** - * + * */ export function getRelativeCoincidentTopologyPolygonOffsetParameters(): ICoincidentTopology; /** - * + * */ export function getResolveCoincidentTopologyLineOffsetParameters(): ICoincidentTopology; /** - * + * */ export function getResolveCoincidentTopologyPointOffsetParameters(): ICoincidentTopology; /** - * + * */ export function getResolveCoincidentTopologyPolygonOffsetParameters(): ICoincidentTopology; @@ -612,24 +639,24 @@ export function getResolveCoincidentTopologyPolygonOffsetParameters(): ICoincide * ResolveCoincidentTopology-related methods.) */ export declare const vtkMapper: { - newInstance: typeof newInstance; - extend: typeof extend; - getResolveCoincidentTopologyAsString: typeof getResolveCoincidentTopologyAsString; - getResolveCoincidentTopologyPolygonOffsetFaces: typeof getResolveCoincidentTopologyPolygonOffsetFaces; - getResolveCoincidentTopology: typeof getResolveCoincidentTopology; - setResolveCoincidentTopology: typeof setResolveCoincidentTopology; - setResolveCoincidentTopologyPolygonOffsetFaces: typeof setResolveCoincidentTopologyPolygonOffsetFaces; - setResolveCoincidentTopologyToDefault: typeof setResolveCoincidentTopologyToDefault; - setResolveCoincidentTopologyToOff: typeof setResolveCoincidentTopologyToOff; - setResolveCoincidentTopologyToPolygonOffset: typeof setResolveCoincidentTopologyToPolygonOffset; - getRelativeCoincidentTopologyLineOffsetParameters: typeof getRelativeCoincidentTopologyLineOffsetParameters; - getRelativeCoincidentTopologyPointOffsetParameters: typeof getRelativeCoincidentTopologyPointOffsetParameters; - getRelativeCoincidentTopologyPolygonOffsetParameters: typeof getRelativeCoincidentTopologyPolygonOffsetParameters; - getResolveCoincidentTopologyLineOffsetParameters: typeof getResolveCoincidentTopologyLineOffsetParameters; - getResolveCoincidentTopologyPointOffsetParameters: typeof getResolveCoincidentTopologyPointOffsetParameters; - getResolveCoincidentTopologyPolygonOffsetParameters: typeof getResolveCoincidentTopologyPolygonOffsetParameters; - ColorMode: typeof ColorMode; - ScalarMode: typeof ScalarMode; - GetArray: typeof GetArray; -} + newInstance: typeof newInstance; + extend: typeof extend; + getResolveCoincidentTopologyAsString: typeof getResolveCoincidentTopologyAsString; + getResolveCoincidentTopologyPolygonOffsetFaces: typeof getResolveCoincidentTopologyPolygonOffsetFaces; + getResolveCoincidentTopology: typeof getResolveCoincidentTopology; + setResolveCoincidentTopology: typeof setResolveCoincidentTopology; + setResolveCoincidentTopologyPolygonOffsetFaces: typeof setResolveCoincidentTopologyPolygonOffsetFaces; + setResolveCoincidentTopologyToDefault: typeof setResolveCoincidentTopologyToDefault; + setResolveCoincidentTopologyToOff: typeof setResolveCoincidentTopologyToOff; + setResolveCoincidentTopologyToPolygonOffset: typeof setResolveCoincidentTopologyToPolygonOffset; + getRelativeCoincidentTopologyLineOffsetParameters: typeof getRelativeCoincidentTopologyLineOffsetParameters; + getRelativeCoincidentTopologyPointOffsetParameters: typeof getRelativeCoincidentTopologyPointOffsetParameters; + getRelativeCoincidentTopologyPolygonOffsetParameters: typeof getRelativeCoincidentTopologyPolygonOffsetParameters; + getResolveCoincidentTopologyLineOffsetParameters: typeof getResolveCoincidentTopologyLineOffsetParameters; + getResolveCoincidentTopologyPointOffsetParameters: typeof getResolveCoincidentTopologyPointOffsetParameters; + getResolveCoincidentTopologyPolygonOffsetParameters: typeof getResolveCoincidentTopologyPolygonOffsetParameters; + ColorMode: typeof ColorMode; + ScalarMode: typeof ScalarMode; + GetArray: typeof GetArray; +}; export default vtkMapper; diff --git a/Sources/Rendering/Core/Mapper2D/index.d.ts b/Sources/Rendering/Core/Mapper2D/index.d.ts index b30e87080be..978e22549f3 100644 --- a/Sources/Rendering/Core/Mapper2D/index.d.ts +++ b/Sources/Rendering/Core/Mapper2D/index.d.ts @@ -1,351 +1,357 @@ -import { Nullable } from "../../../types"; -import vtkAbstractMapper, { IAbstractMapperInitialValues } from "../AbstractMapper"; +import { Nullable } from '../../../types'; +import vtkAbstractMapper, { + IAbstractMapperInitialValues, +} from '../AbstractMapper'; export enum ColorMode { - DEFAULT, - MAP_SCALARS, - DIRECT_SCALARS, + DEFAULT, + MAP_SCALARS, + DIRECT_SCALARS, } export enum ScalarMode { - DEFAULT, - USE_POINT_DATA, - USE_CELL_DATA, - USE_POINT_FIELD_DATA, - USE_CELL_FIELD_DATA, - USE_FIELD_DATA, + DEFAULT, + USE_POINT_DATA, + USE_CELL_DATA, + USE_POINT_FIELD_DATA, + USE_CELL_FIELD_DATA, + USE_FIELD_DATA, } export enum GetArray { - BY_ID, - BY_NAME, + BY_ID, + BY_NAME, } interface IPrimitiveCount { - points: number; - verts: number; - lines: number; - triangles: number; + points: number; + verts: number; + lines: number; + triangles: number; } interface IAbstractScalars { - cellFlag: boolean; + cellFlag: boolean; } interface IScalarToTextureCoordinate { - texCoordS: number; - texCoordT: number; + texCoordS: number; + texCoordT: number; } -export interface IMapper2DInitialValues extends IAbstractMapperInitialValues{ - arrayAccessMode?: number; - colorMode?: number; - customShaderAttributes?: any; - renderTime?: number; - scalarMode?: number; - scalarRange?: Range; - scalarVisibility?: boolean; - static?: boolean; +export interface IMapper2DInitialValues extends IAbstractMapperInitialValues { + arrayAccessMode?: number; + colorMode?: number; + customShaderAttributes?: any; + renderTime?: number; + scalarMode?: number; + scalarRange?: Range; + scalarVisibility?: boolean; + static?: boolean; } export interface vtkMapper2D extends vtkAbstractMapper { - - /** - * Create default lookup table. Generally used to create one when - * none is available with the scalar data. - */ - createDefaultLookupTable(): void; - - /** - * - * @param input - * @param {ScalarMode} scalarMode - * @param arrayAccessMode - * @param arrayId - * @param arrayName - */ - getAbstractScalars(input: any, scalarMode: ScalarMode, arrayAccessMode: number, arrayId: any, arrayName: any): IAbstractScalars; - - /** - * - */ - getArrayAccessMode(): number; - - /** - * Get the array name to color by. - */ - getColorByArrayName(): Nullable; - - /** - * Provide read access to the color array. - */ - getColorMapColors(): Nullable; - - /** - * Return the method of coloring scalar data. - */ - getColorMode(): number; - - /** - * Return the method of coloring scalar data. - */ - getColorModeAsString(): string; - - /** - * - * @default [] - */ - getCustomShaderAttributes(): any - - /** - * Get a lookup table for the mapper to use. - */ - getLookupTable(): any; - - /** - * Get the transformCoordinate. - */ - getTransformCoordinate(): any; - - /** - * Return the method for obtaining scalar data. - */ - getScalarMode(): number; - - /** - * Return the method for obtaining scalar data. - */ - getScalarModeAsString(): string; - - /** - * - * @default [0, 1] - */ - getScalarRange(): number[]; - - /** - * - * @default [0, 1] - */ - getScalarRangeByReference(): number[]; - - /** - * Check whether scalar data is used to color objects. - * @default true - */ - getScalarVisibility(): boolean; - - /** - * Check whether the mapper’s data is static. - * @default false - */ - getStatic(): boolean; - - /** - * - * @default false - */ - getUseLookupTableScalarRange(): boolean; - - /** - * - * @default null - */ - getViewSpecificProperties(): object; - - /** - * Map the scalars (if there are any scalars and ScalarVisibility is on) - * through the lookup table, returning an unsigned char RGBA array. This is - * typically done as part of the rendering process. The alpha parameter - * allows the blending of the scalars with an additional alpha (typically - * which comes from a vtkActor, etc.) - * { - * rgba: Uint8Array(), - * location: 0/1/2, // Points/Cells/Fields - * } - * @param input - * @param {Number} alpha - */ - mapScalars(input: any, alpha: number): void; - - /** - * - * @param {Number} arrayAccessMode - */ - setArrayAccessMode(arrayAccessMode: number): boolean; - - /** - * Set the array name to color by. - * @param {String} colorByArrayName - */ - setColorByArrayName(colorByArrayName: string): boolean; - - /** - * - * @param {Number} colorMode - */ - setColorMode(colorMode: number): boolean; - - /** - * Sets colorMode to `DEFAULT` - */ - setColorModeToDefault(): boolean; - - /** - * Sets colorMode to `MAP_SCALARS` - */ - setColorModeToMapScalars(): boolean; - - /** - * Sets colorMode to `DIRECT_SCALARS` - */ - setColorModeToDirectScalars(): boolean; - - /** - * Sets point data array names that will be transferred to the VBO - * @param {String[]} customShaderAttributes - */ - setCustomShaderAttributes(customShaderAttributes: string[]): boolean - - /** - * Set a lookup table for the mapper to use. - */ - setLookupTable(lookupTable: any): boolean; - - /** - * Set the transformCoordinate. - */ - setTransformCoordinate(coordinate: any): boolean; - - /** - * Control how the filter works with scalar point data and cell attribute - * data. By default (ScalarModeToDefault), the filter will use point data, - * and if no point data is available, then cell data is used. Alternatively - * you can explicitly set the filter to use point data - * (ScalarModeToUsePointData) or cell data (ScalarModeToUseCellData). - * You can also choose to get the scalars from an array in point field - * data (ScalarModeToUsePointFieldData) or cell field data - * (ScalarModeToUseCellFieldData). If scalars are coming from a field - * data array, you must call SelectColorArray before you call GetColors. - * - * When ScalarMode is set to use Field Data (ScalarModeToFieldData), - * you must call SelectColorArray to choose the field data array to - * be used to color cells. In this mode, the default behavior is to - * treat the field data tuples as being associated with cells. If - * the poly data contains triangle strips, the array is expected to - * contain the cell data for each mini-cell formed by any triangle - * strips in the poly data as opposed to treating them as a single - * tuple that applies to the entire strip. This mode can also be - * used to color the entire poly data by a single color obtained by - * mapping the tuple at a given index in the field data array - * through the color map. Use SetFieldDataTupleId() to specify - * the tuple index. - * - * @param scalarMode - */ - setScalarMode(scalarMode: number): boolean; - - /** - * Sets scalarMode to DEFAULT - */ - setScalarModeToDefault(): boolean; - - /** - * Sets scalarMode to USE_CELL_DATA - */ - setScalarModeToUseCellData(): boolean; - - /** - * Sets scalarMode to USE_CELL_FIELD_DATA - */ - setScalarModeToUseCellFieldData(): boolean; - - /** - * Sets scalarMode to USE_FIELD_DATA - */ - setScalarModeToUseFieldData(): boolean; - - /** - * Sets scalarMode to USE_POINT_DATA - */ - setScalarModeToUsePointData(): boolean; - - /** - * Sets scalarMode to USE_POINT_FIELD_DATA - */ - setScalarModeToUsePointFieldData(): boolean; - - /** - * Specify range in terms of scalar minimum and maximum (smin,smax). These - * values are used to map scalars into lookup table. Has no effect when - * UseLookupTableScalarRange is true. - * - * @param min - * @param max - * @default [0, 1] - */ - setScalarRange(min: number, max: number): boolean; - - /** - * Specify range in terms of scalar minimum and maximum (smin,smax). These - * values are used to map scalars into lookup table. Has no effect when - * UseLookupTableScalarRange is true. - * - * @param scalarRange - * @default [0, 1] - */ - setScalarRange(scalarRange: number[]): boolean; - - /** - * - * @param scalarRange - * @default [0, 1] - */ - setScalarRangeFrom(scalarRange: number[]): boolean; - - /** - * Turn on/off flag to control whether scalar data is used to color objects. - * @param {Boolean} scalarVisibility - * @default true - */ - setScalarVisibility(scalarVisibility: boolean): boolean; - - /** - * Turn on/off flag to control whether the mapper’s data is static. Static data - * means that the mapper does not propagate updates down the pipeline, greatly - * decreasing the time it takes to update many mappers. This should only be - * used if the data never changes. - * - * @param {Boolean} static - * @default false - */ - setStatic(static: boolean): boolean; - - /** - * Control whether the mapper sets the lookuptable range based on its - * own ScalarRange, or whether it will use the LookupTable ScalarRange - * regardless of it’s own setting. By default the Mapper is allowed to set - * the LookupTable range, but users who are sharing LookupTables between - * mappers/actors will probably wish to force the mapper to use the - * LookupTable unchanged. - * - * @param {Boolean} useLookupTableScalarRange - * @default false - */ - setUseLookupTableScalarRange(useLookupTableScalarRange: boolean): boolean; - - /** - * If you want to provide specific properties for rendering engines you can use - * viewSpecificProperties. - * - * You can go and have a look in the rendering backend of your choice for details - * on specific properties. - * For example, for OpenGL/WebGL see OpenGL/PolyDataMapper/api.md - * If there is no details, viewSpecificProperties is not supported. - * @param viewSpecificProperties - */ - setViewSpecificProperties(viewSpecificProperties: object): boolean; - + /** + * Create default lookup table. Generally used to create one when + * none is available with the scalar data. + */ + createDefaultLookupTable(): void; + + /** + * + * @param input + * @param {ScalarMode} scalarMode + * @param arrayAccessMode + * @param arrayId + * @param arrayName + */ + getAbstractScalars( + input: any, + scalarMode: ScalarMode, + arrayAccessMode: number, + arrayId: any, + arrayName: any + ): IAbstractScalars; + + /** + * + */ + getArrayAccessMode(): number; + + /** + * Get the array name to color by. + */ + getColorByArrayName(): Nullable; + + /** + * Provide read access to the color array. + */ + getColorMapColors(): Nullable; + + /** + * Return the method of coloring scalar data. + */ + getColorMode(): number; + + /** + * Return the method of coloring scalar data. + */ + getColorModeAsString(): string; + + /** + * + * @default [] + */ + getCustomShaderAttributes(): any; + + /** + * Get a lookup table for the mapper to use. + */ + getLookupTable(): any; + + /** + * Get the transformCoordinate. + */ + getTransformCoordinate(): any; + + /** + * Return the method for obtaining scalar data. + */ + getScalarMode(): number; + + /** + * Return the method for obtaining scalar data. + */ + getScalarModeAsString(): string; + + /** + * + * @default [0, 1] + */ + getScalarRange(): number[]; + + /** + * + * @default [0, 1] + */ + getScalarRangeByReference(): number[]; + + /** + * Check whether scalar data is used to color objects. + * @default true + */ + getScalarVisibility(): boolean; + + /** + * Check whether the mapper’s data is static. + * @default false + */ + getStatic(): boolean; + + /** + * + * @default false + */ + getUseLookupTableScalarRange(): boolean; + + /** + * + * @default null + */ + getViewSpecificProperties(): object; + + /** + * Map the scalars (if there are any scalars and ScalarVisibility is on) + * through the lookup table, returning an unsigned char RGBA array. This is + * typically done as part of the rendering process. The alpha parameter + * allows the blending of the scalars with an additional alpha (typically + * which comes from a vtkActor, etc.) + * { + * rgba: Uint8Array(), + * location: 0/1/2, // Points/Cells/Fields + * } + * @param input + * @param {Number} alpha + */ + mapScalars(input: any, alpha: number): void; + + /** + * + * @param {Number} arrayAccessMode + */ + setArrayAccessMode(arrayAccessMode: number): boolean; + + /** + * Set the array name to color by. + * @param {String} colorByArrayName + */ + setColorByArrayName(colorByArrayName: string): boolean; + + /** + * + * @param {Number} colorMode + */ + setColorMode(colorMode: number): boolean; + + /** + * Sets colorMode to `DEFAULT` + */ + setColorModeToDefault(): boolean; + + /** + * Sets colorMode to `MAP_SCALARS` + */ + setColorModeToMapScalars(): boolean; + + /** + * Sets colorMode to `DIRECT_SCALARS` + */ + setColorModeToDirectScalars(): boolean; + + /** + * Sets point data array names that will be transferred to the VBO + * @param {String[]} customShaderAttributes + */ + setCustomShaderAttributes(customShaderAttributes: string[]): boolean; + + /** + * Set a lookup table for the mapper to use. + */ + setLookupTable(lookupTable: any): boolean; + + /** + * Set the transformCoordinate. + */ + setTransformCoordinate(coordinate: any): boolean; + + /** + * Control how the filter works with scalar point data and cell attribute + * data. By default (ScalarModeToDefault), the filter will use point data, + * and if no point data is available, then cell data is used. Alternatively + * you can explicitly set the filter to use point data + * (ScalarModeToUsePointData) or cell data (ScalarModeToUseCellData). + * You can also choose to get the scalars from an array in point field + * data (ScalarModeToUsePointFieldData) or cell field data + * (ScalarModeToUseCellFieldData). If scalars are coming from a field + * data array, you must call SelectColorArray before you call GetColors. + * + * When ScalarMode is set to use Field Data (ScalarModeToFieldData), + * you must call SelectColorArray to choose the field data array to + * be used to color cells. In this mode, the default behavior is to + * treat the field data tuples as being associated with cells. If + * the poly data contains triangle strips, the array is expected to + * contain the cell data for each mini-cell formed by any triangle + * strips in the poly data as opposed to treating them as a single + * tuple that applies to the entire strip. This mode can also be + * used to color the entire poly data by a single color obtained by + * mapping the tuple at a given index in the field data array + * through the color map. Use SetFieldDataTupleId() to specify + * the tuple index. + * + * @param scalarMode + */ + setScalarMode(scalarMode: number): boolean; + + /** + * Sets scalarMode to DEFAULT + */ + setScalarModeToDefault(): boolean; + + /** + * Sets scalarMode to USE_CELL_DATA + */ + setScalarModeToUseCellData(): boolean; + + /** + * Sets scalarMode to USE_CELL_FIELD_DATA + */ + setScalarModeToUseCellFieldData(): boolean; + + /** + * Sets scalarMode to USE_FIELD_DATA + */ + setScalarModeToUseFieldData(): boolean; + + /** + * Sets scalarMode to USE_POINT_DATA + */ + setScalarModeToUsePointData(): boolean; + + /** + * Sets scalarMode to USE_POINT_FIELD_DATA + */ + setScalarModeToUsePointFieldData(): boolean; + + /** + * Specify range in terms of scalar minimum and maximum (smin,smax). These + * values are used to map scalars into lookup table. Has no effect when + * UseLookupTableScalarRange is true. + * + * @param min + * @param max + * @default [0, 1] + */ + setScalarRange(min: number, max: number): boolean; + + /** + * Specify range in terms of scalar minimum and maximum (smin,smax). These + * values are used to map scalars into lookup table. Has no effect when + * UseLookupTableScalarRange is true. + * + * @param scalarRange + * @default [0, 1] + */ + setScalarRange(scalarRange: number[]): boolean; + + /** + * + * @param scalarRange + * @default [0, 1] + */ + setScalarRangeFrom(scalarRange: number[]): boolean; + + /** + * Turn on/off flag to control whether scalar data is used to color objects. + * @param {Boolean} scalarVisibility + * @default true + */ + setScalarVisibility(scalarVisibility: boolean): boolean; + + /** + * Turn on/off flag to control whether the mapper’s data is static. Static data + * means that the mapper does not propagate updates down the pipeline, greatly + * decreasing the time it takes to update many mappers. This should only be + * used if the data never changes. + * + * @param {Boolean} static + * @default false + */ + setStatic(static: boolean): boolean; + + /** + * Control whether the mapper sets the lookuptable range based on its + * own ScalarRange, or whether it will use the LookupTable ScalarRange + * regardless of it’s own setting. By default the Mapper is allowed to set + * the LookupTable range, but users who are sharing LookupTables between + * mappers/actors will probably wish to force the mapper to use the + * LookupTable unchanged. + * + * @param {Boolean} useLookupTableScalarRange + * @default false + */ + setUseLookupTableScalarRange(useLookupTableScalarRange: boolean): boolean; + + /** + * If you want to provide specific properties for rendering engines you can use + * viewSpecificProperties. + * + * You can go and have a look in the rendering backend of your choice for details + * on specific properties. + * For example, for OpenGL/WebGL see OpenGL/PolyDataMapper/api.md + * If there is no details, viewSpecificProperties is not supported. + * @param viewSpecificProperties + */ + setViewSpecificProperties(viewSpecificProperties: object): boolean; } /** @@ -355,13 +361,19 @@ export interface vtkMapper2D extends vtkAbstractMapper { * @param model object on which data structure will be bounds (protected) * @param {IMapper2DInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IMapper2DInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IMapper2DInitialValues +): void; /** * Method used to create a new instance of vtkMapper2D * @param {IMapper2DInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IMapper2DInitialValues): vtkMapper2D; +export function newInstance( + initialValues?: IMapper2DInitialValues +): vtkMapper2D; /** * vtkMapper2D is an abstract class to specify interface between data and @@ -397,7 +409,7 @@ export function newInstance(initialValues?: IMapper2DInitialValues): vtkMapper2D * ResolveCoincidentTopology-related methods.) */ export declare const vtkMapper2D: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkMapper2D; diff --git a/Sources/Rendering/Core/Picker/index.d.ts b/Sources/Rendering/Core/Picker/index.d.ts index 30790f5816f..2fdcd46021d 100755 --- a/Sources/Rendering/Core/Picker/index.d.ts +++ b/Sources/Rendering/Core/Picker/index.d.ts @@ -1,110 +1,114 @@ -import { Vector3, Nullable } from "../../../types"; -import vtkAbstractPicker, { IAbstractPickerInitialValues } from "../AbstractPicker"; -import vtkActor from "../Actor"; +import { Vector3, Nullable } from '../../../types'; +import vtkAbstractPicker, { + IAbstractPickerInitialValues, +} from '../AbstractPicker'; +import vtkActor from '../Actor'; import vtkMapper from '../Mapper'; import vtkProp3D from '../Prop3D'; import vtkRenderer from '../Renderer'; -import { vtkSubscription } from "../../../interfaces"; - +import { vtkSubscription } from '../../../interfaces'; export interface IPickerInitialValues extends IAbstractPickerInitialValues { - tolerance?: number; - mapperPosition?: number[]; - actors?: vtkActor[]; - pickedPositions?: Array; - globalTMin?: number; + tolerance?: number; + mapperPosition?: number[]; + actors?: vtkActor[]; + pickedPositions?: Array; + globalTMin?: number; } -type OnPickChangeCallback = (pickedPositions: Vector3[]) => void +type OnPickChangeCallback = (pickedPositions: Vector3[]) => void; export interface vtkPicker extends vtkAbstractPicker { - - /** - * Get a collection of all the actors that were intersected. - */ - getActors(): vtkActor[]; - - /** - * Get the dataset that was picked (if any). - */ - getDataSet(): any; - - /** - * Get mapper that was picked (if any) - */ - getMapper(): Nullable; - - /** - * Get position in mapper (i.e., non-transformed) coordinates of pick point. - */ - getMapperPosition(): Vector3; - - /** - * Get position in mapper (i.e., non-transformed) coordinates of pick point. - */ - getMapperPositionByReference(): Vector3; - - /** - * Get a list of the points the actors returned by getActors were intersected at. - */ - getPickedPositions(): Vector3[]; - - /** - * Get tolerance for performing pick operation. - */ - getTolerance(): number; - - /** - * Invoke a pick change event with the list of picked points. - * This function is called internally by VTK.js and is not intended for public use. - * @param {Vector3[]} pickedPositions - */ - invokePickChange(pickedPositions: Vector3[]): void; - - /** - * Execute the given callback when the pickChange event is fired. - * The callback receives an array of picked point positions. - * @param {OnPickChangeCallback} - */ - onPickChange(callback: OnPickChangeCallback): vtkSubscription; - - /** - * Perform pick operation with selection point provided. - * @param {Vector3} selection First two values should be x-y pixel coordinate, the third is usually zero. - * @param {vtkRenderer} renderer The renderer on which you want to do picking. - */ - pick(selection: Vector3, renderer: vtkRenderer): void; - - /** - * Perform pick operation with the provided selection and focal points. - * Both point are in world coordinates. - * @param {Vector3} selectionPoint - * @param {Vector3} focalPoint - * @param {vtkRenderer} renderer - */ - pick3DPoint(selectionPoint: Vector3, focalPoint: Vector3, renderer: vtkRenderer): void; - - /** - * Set position in mapper coordinates of pick point. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setMapperPosition(x: number, y: number, z: number): boolean; - - /** - * Set position in mapper coordinates of pick point. - * @param {Vector3} mapperPosition The mapper coordinates of pick point. - */ - setMapperPositionFrom(mapperPosition: Vector3): boolean; - - /** - * Specify tolerance for performing pick operation. Tolerance is specified - * as fraction of rendering window size. (Rendering window size is measured - * across diagonal.) - * @param {Number} tolerance The tolerance value. - */ - setTolerance(tolerance: number): boolean; + /** + * Get a collection of all the actors that were intersected. + */ + getActors(): vtkActor[]; + + /** + * Get the dataset that was picked (if any). + */ + getDataSet(): any; + + /** + * Get mapper that was picked (if any) + */ + getMapper(): Nullable; + + /** + * Get position in mapper (i.e., non-transformed) coordinates of pick point. + */ + getMapperPosition(): Vector3; + + /** + * Get position in mapper (i.e., non-transformed) coordinates of pick point. + */ + getMapperPositionByReference(): Vector3; + + /** + * Get a list of the points the actors returned by getActors were intersected at. + */ + getPickedPositions(): Vector3[]; + + /** + * Get tolerance for performing pick operation. + */ + getTolerance(): number; + + /** + * Invoke a pick change event with the list of picked points. + * This function is called internally by VTK.js and is not intended for public use. + * @param {Vector3[]} pickedPositions + */ + invokePickChange(pickedPositions: Vector3[]): void; + + /** + * Execute the given callback when the pickChange event is fired. + * The callback receives an array of picked point positions. + * @param {OnPickChangeCallback} + */ + onPickChange(callback: OnPickChangeCallback): vtkSubscription; + + /** + * Perform pick operation with selection point provided. + * @param {Vector3} selection First two values should be x-y pixel coordinate, the third is usually zero. + * @param {vtkRenderer} renderer The renderer on which you want to do picking. + */ + pick(selection: Vector3, renderer: vtkRenderer): void; + + /** + * Perform pick operation with the provided selection and focal points. + * Both point are in world coordinates. + * @param {Vector3} selectionPoint + * @param {Vector3} focalPoint + * @param {vtkRenderer} renderer + */ + pick3DPoint( + selectionPoint: Vector3, + focalPoint: Vector3, + renderer: vtkRenderer + ): void; + + /** + * Set position in mapper coordinates of pick point. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setMapperPosition(x: number, y: number, z: number): boolean; + + /** + * Set position in mapper coordinates of pick point. + * @param {Vector3} mapperPosition The mapper coordinates of pick point. + */ + setMapperPositionFrom(mapperPosition: Vector3): boolean; + + /** + * Specify tolerance for performing pick operation. Tolerance is specified + * as fraction of rendering window size. (Rendering window size is measured + * across diagonal.) + * @param {Number} tolerance The tolerance value. + */ + setTolerance(tolerance: number): boolean; } /** @@ -112,31 +116,35 @@ export interface vtkPicker extends vtkAbstractPicker { * * @param publicAPI object on which methods will be bounds (public) * @param model object on which data structure will be bounds (protected) - * @param {IPickerInitialValues} [initialValues] + * @param {IPickerInitialValues} [initialValues] */ -export function extend(publicAPI: object, model: object, initialValues?: IPickerInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPickerInitialValues +): void; /** - * Method use to create a new instance of vtkPicker with its focal point at the origin, - * and position=(0,0,1). The view up is along the y-axis, view angle is 30 degrees, + * Method use to create a new instance of vtkPicker with its focal point at the origin, + * and position=(0,0,1). The view up is along the y-axis, view angle is 30 degrees, * and the clipping range is (.1,1000). * @param {IPickerInitialValues} [initialValues] for pre-setting some of its content */ export function newInstance(initialValues?: IPickerInitialValues): vtkPicker; /** - * vtkPicker is used to select instances of vtkProp3D by shooting + * vtkPicker is used to select instances of vtkProp3D by shooting * a ray into a graphics window and intersecting with the actor's bounding box. - * The ray is defined from a point defined in window (or pixel) coordinates, + * The ray is defined from a point defined in window (or pixel) coordinates, * and a point located from the camera's position. - * + * * vtkPicker may return more than one vtkProp3D, since more than one bounding box may be intersected. * vtkPicker returns an unsorted list of props that were hit, and a list of the corresponding world points of the hits. * For the vtkProp3D that is closest to the camera, vtkPicker returns the pick coordinates in world and untransformed mapper space, - * the prop itself, the data set, and the mapper. + * the prop itself, the data set, and the mapper. * For vtkPicker the closest prop is the one whose center point (i.e., center of bounding box) projected on the view ray is closest * to the camera. Subclasses of vtkPicker use other methods for computing the pick point. - * + * * vtkPicker is used for quick geometric picking. If you desire more precise * picking of points or cells based on the geometry of any vtkProp3D, use the * subclasses vtkPointPicker or vtkCellPicker. For hardware-accelerated @@ -145,7 +153,7 @@ export function newInstance(initialValues?: IPickerInitialValues): vtkPicker; * Note that only vtkProp3D's can be picked by vtkPicker. */ export declare const vtkPicker: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkPicker; diff --git a/Sources/Rendering/Core/PixelSpaceCallbackMapper/index.d.ts b/Sources/Rendering/Core/PixelSpaceCallbackMapper/index.d.ts index ed4d8a0c395..26cb52cfc7e 100755 --- a/Sources/Rendering/Core/PixelSpaceCallbackMapper/index.d.ts +++ b/Sources/Rendering/Core/PixelSpaceCallbackMapper/index.d.ts @@ -1,43 +1,49 @@ -import { Vector3 } from "../../../types"; -import vtkCamera from "../Camera"; -import vtkMapper, { IMapperInitialValues } from "../Mapper"; +import { Vector3 } from '../../../types'; +import vtkCamera from '../Camera'; +import vtkMapper, { IMapperInitialValues } from '../Mapper'; /** - * + * */ -export interface IPixelSpaceCallbackMapperInitialValues extends IMapperInitialValues { - callback?: any, - useZValues?: boolean; +export interface IPixelSpaceCallbackMapperInitialValues + extends IMapperInitialValues { + callback?: any; + useZValues?: boolean; } interface IWindowSize { - usize: number; - vsize: number; + usize: number; + vsize: number; } export interface vtkPixelSpaceCallbackMapper extends vtkMapper { + /** + * + */ + getCallback(): any; - /** - * - */ - getCallback(): any; + /** + * + */ + getUseZValues(): boolean; - /** - * - */ - getUseZValues(): boolean - - /** - * - * @param dataset - * @param camera - * @param aspect - * @param windowSize - * @param depthValues - */ - invokeCallback(dataset: any, camera: vtkCamera, aspect: number, windowSize: IWindowSize, depthValues: number[]): void; + /** + * + * @param dataset + * @param camera + * @param aspect + * @param windowSize + * @param depthValues + */ + invokeCallback( + dataset: any, + camera: vtkCamera, + aspect: number, + windowSize: IWindowSize, + depthValues: number[] + ): void; - /** + /** * Set the callback function the mapper will call, during the rendering * process, with the screen coords of the points in dataset. The callback * function will have the following parameters: @@ -89,18 +95,23 @@ export interface vtkPixelSpaceCallbackMapper extends vtkMapper { * * @param callback called with coords, camera, aspect and depthBuffer */ - setCallback(callback: (coords: Vector3[], camera: vtkCamera, aspect: number, depthBuffer: Uint8Array) => any): boolean - + setCallback( + callback: ( + coords: Vector3[], + camera: vtkCamera, + aspect: number, + depthBuffer: Uint8Array + ) => any + ): boolean; - /** - * Set whether or not this mapper should capture the zbuffer during - * rendering. Useful for allowing depth checks in the application code. - * @param useZValues - */ - setUseZValues(useZValues: boolean): boolean + /** + * Set whether or not this mapper should capture the zbuffer during + * rendering. Useful for allowing depth checks in the application code. + * @param useZValues + */ + setUseZValues(useZValues: boolean): boolean; } - /** * Method use to decorate a given object (publicAPI+model) with vtkPixelSpaceCallbackMapper characteristics. * @@ -108,22 +119,27 @@ export interface vtkPixelSpaceCallbackMapper extends vtkMapper { * @param model object on which data structure will be bounds (protected) * @param {IPixelSpaceCallbackMapperInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPixelSpaceCallbackMapperInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPixelSpaceCallbackMapperInitialValues +): void; /** * Method use to create a new instance of vtkPixelSpaceCallbackMapper * @param {IPixelSpaceCallbackMapperInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IPixelSpaceCallbackMapperInitialValues): vtkPixelSpaceCallbackMapper; +export function newInstance( + initialValues?: IPixelSpaceCallbackMapperInitialValues +): vtkPixelSpaceCallbackMapper; - -/** +/** * vtkPixelSpaceCallbackMapper iterates over the points of its input dataset, * using the transforms from the active camera to compute the screen coordinates * of each point. */ export declare const vtkPixelSpaceCallbackMapper: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkPixelSpaceCallbackMapper; diff --git a/Sources/Rendering/Core/PointPicker/index.d.ts b/Sources/Rendering/Core/PointPicker/index.d.ts index d927c549784..08184514cd0 100755 --- a/Sources/Rendering/Core/PointPicker/index.d.ts +++ b/Sources/Rendering/Core/PointPicker/index.d.ts @@ -1,43 +1,42 @@ -import vtkPicker, { IPickerInitialValues } from "../Picker"; -import vtkMapper from "../Mapper"; -import { Vector3 } from "../../../types"; -import vtkProp3D from "../Prop3D"; -import { Nullable } from "../../../types"; +import vtkPicker, { IPickerInitialValues } from '../Picker'; +import vtkMapper from '../Mapper'; +import { Vector3 } from '../../../types'; +import vtkProp3D from '../Prop3D'; +import { Nullable } from '../../../types'; interface IPointPickerInitialValues extends IPickerInitialValues { - pointId?: number; - pointIJK?: number[]; - useCells?: boolean; + pointId?: number; + pointIJK?: number[]; + useCells?: boolean; } export interface vtkPointPicker extends vtkPicker { + /** + * + */ + getPointIJK(): number[]; - /** - * - */ - getPointIJK(): number[]; + /** + * + */ + getPointIJKByReference(): number[]; - /** - * - */ - getPointIJKByReference(): number[]; + /** + * Get the id of the picked point. + * If PointId = -1, nothing was picked. + */ + getPointId(): number; - /** - * Get the id of the picked point. - * If PointId = -1, nothing was picked. - */ - getPointId(): number; + /** + * + */ + getUseCells(): boolean; - /** - * - */ - getUseCells(): boolean; - - /** - * Specify whether the point search should be based on cell points or directly on the point list. - * @param useCells - */ - setUseCells(useCells: boolean): boolean; + /** + * Specify whether the point search should be based on cell points or directly on the point list. + * @param useCells + */ + setUseCells(useCells: boolean): boolean; } /** @@ -47,27 +46,33 @@ export interface vtkPointPicker extends vtkPicker { * @param model object on which data structure will be bounds (protected) * @param {IPointPickerInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPointPickerInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPointPickerInitialValues +): void; /** * Method use to create a new instance of vtkPointPicker * @param {IPointPickerInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IPointPickerInitialValues): vtkPointPicker; +export function newInstance( + initialValues?: IPointPickerInitialValues +): vtkPointPicker; -/** - * vtkPointPicker is used to select a point by shooting a ray into a graphics window - * and intersecting with actor's defining geometry - specifically its points. +/** + * vtkPointPicker is used to select a point by shooting a ray into a graphics window + * and intersecting with actor's defining geometry - specifically its points. * Beside returning coordinates, actor, and mapper, vtkPointPicker returns the id of the point - * projecting closest onto the ray (within the specified tolerance). - * Ties are broken (i.e., multiple points all projecting within the tolerance along + * projecting closest onto the ray (within the specified tolerance). + * Ties are broken (i.e., multiple points all projecting within the tolerance along * the pick ray) by choosing the point closest to the ray origin (i.e., closest to the eye). - * + * * @see [vtkPicker](./Rendering_Core_Picker.html) * @see [vtkCellPicker](./Rendering_Core_CellPicker.html) */ - export declare const vtkPointPicker: { - newInstance: typeof newInstance, - extend: typeof extend, +export declare const vtkPointPicker: { + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkPointPicker; diff --git a/Sources/Rendering/Core/Prop/Constants.d.ts b/Sources/Rendering/Core/Prop/Constants.d.ts index 045146528ed..234fae89d88 100644 --- a/Sources/Rendering/Core/Prop/Constants.d.ts +++ b/Sources/Rendering/Core/Prop/Constants.d.ts @@ -1,9 +1,9 @@ export declare enum CoordinateSystem { - WORLD = 0, - DISPLAY = 1, + WORLD = 0, + DISPLAY = 1, } declare const _default: { - CoordinateSystem: typeof CoordinateSystem; + CoordinateSystem: typeof CoordinateSystem; }; export default _default; diff --git a/Sources/Rendering/Core/Prop/index.d.ts b/Sources/Rendering/Core/Prop/index.d.ts index 4ae1b8b75eb..da9365d7fee 100755 --- a/Sources/Rendering/Core/Prop/index.d.ts +++ b/Sources/Rendering/Core/Prop/index.d.ts @@ -1,286 +1,283 @@ -import { vtkObject } from "../../../interfaces"; -import vtkActor from "../Actor"; -import vtkActor2D from "../Actor2D"; -import vtkTexture from "../Texture"; -import vtkVolume from "../Volume"; -import { CoordinateSystem } from "./Constants"; - +import { vtkObject } from '../../../interfaces'; +import vtkActor from '../Actor'; +import vtkActor2D from '../Actor2D'; +import vtkTexture from '../Texture'; +import vtkVolume from '../Volume'; +import { CoordinateSystem } from './Constants'; export interface IPropInitialValues { - visibility?: boolean; - pickable?: boolean; - dragable?: boolean; - useBounds?: boolean; - allocatedRenderTime?: number; - estimatedRenderTime?: number; - savedEstimatedRenderTime?: number; - renderTimeMultiplier?: number; - textures?: vtkTexture[]; + visibility?: boolean; + pickable?: boolean; + dragable?: boolean; + useBounds?: boolean; + allocatedRenderTime?: number; + estimatedRenderTime?: number; + savedEstimatedRenderTime?: number; + renderTimeMultiplier?: number; + textures?: vtkTexture[]; } export interface vtkProp extends vtkObject { - - /** - * - * @param estimatedRenderTime - */ - addEstimatedRenderTime(estimatedRenderTime: number): void; - - /** - * To be reimplemented by subclasses. - * For some exporters and other other operations we must be able - * to collect all the actors or volumes. - */ - getActors(): vtkActor[]; - - /** - * Not implemented yet - */ - getActors2D(): vtkActor2D[]; - - /** - * Get the coordinate system this prop is defined in. - */ - getCoordinateSystem(): CoordinateSystem; - - /** - * Get the value of the dragable instance variable. - * @see getNestedDragable - * @see getPickable - */ - getDragable(): boolean; - - /** - * Combine dragabe property with optional ancestor props dragable properties. - * It is used to decide whether the prop can be mouse dragged. - * @see getDragable - * @see getParentProp - */ - getNestedDragable(): boolean; - - /** - * Get visibility of this vtkProp. - * @see getNestedVisibility - * @see getPickable - */ - getVisibility(): boolean; - - /** - * Combine visibility property with optional ancestor props visibility properties. - * It is used to decide whether the prop should be rendered. - * @see getVisibility - * @see getParentProp - */ - getNestedVisibility(): boolean; - - /** - * Get the pickable instance variable. - * @see getNestedPickable - * @see getDragable - */ - getPickable(): boolean; - - /** - * Combine pickable property with optional ancestor props pickable properties. - * It is used to decide whether the prop should be rendered during a selection rendering. - * @see getPickable - * @see getParentProp - */ - getNestedPickable(): boolean; - - /** - * Return the mtime of anything that would cause the rendered image to appear differently. - * Usually this involves checking the mtime of the prop plus anything else it depends on such as properties, - * textures etc. - */ - getRedrawMTime(): number - - /** - * - */ - getRendertimemultiplier(): number; - - /** - * The value is returned in seconds. For simple geometry the accuracy may not be great - * due to buffering. For ray casting, which is already multi-resolution, - * the current resolution of the image is factored into the time. We need the viewport - * for viewing parameters that affect timing. The no-arguments version simply returns the value of the variable with no estimation. - */ - getEstimatedRenderTime(): number; - - /** - * - */ - getAllocatedRenderTime(): number; - - /** - * - */ - getNestedProps(): any; - - /** - * Return parent prop set by setParentProp - * @see setParentProp - */ - getParentProp(): vtkProp; - - /** - * - * Not implemented yet - */ - getVolumes(): vtkVolume[]; - - /** - * - */ - getUseBounds(): boolean; - - /** - * - */ - getSupportsSelection(): boolean; - - /** - * - */ - getTextures(): vtkTexture[]; - - /** - * - * @param {vtkTexture} texture The vtkTexture instance. - * - */ - hasTexture(texture: vtkTexture): boolean; - - /** - * - * @param {vtkTexture} texture The vtkTexture instance. - */ - addTexture(texture: vtkTexture): void; - - /** - * - * @param {vtkTexture} texture The vtkTexture instance. - */ - removeTexture(texture: vtkTexture): void; - - /** - * - */ - removeAllTextures(): void; - - /** - * This method is used to restore that old value should the render be aborted. - */ - restoreEstimatedRenderTime(): void; - - /** - * - * @param allocatedRenderTime - */ - setAllocatedRenderTime(allocatedRenderTime: number): void; - - /** - * Set the coordinate system that this prop's data should be in. - * Once the prop has applied any modifiers such as position, orientation - * userMatrix the resulting values will be treated as in the specified - * coordinate system. - * Not all mappers support all coordinate systems. - * @param {CoordinateSystem} coordinateSystem - */ - setCoordinateSystem(coordinateSystem: CoordinateSystem): void; - - /** - * Indicate that this prop's data should be in world coordinates. - * Once the prop has applied any modifiers such as position, orientation - * userMatrix the resulting values will be treated as in world coordinates. - * Not all mappers support all coordinate systems. - */ - setCoordinateSystemToWorld(): void; - - /** - * Indicate that this prop's data should be in display coordinates. - * Once the prop has applied any modifiers such as position, orientation - * userMatrix the resulting values will be treated as in pixel coordinates. - * That is pixel coordinate with 0,0 in the lower left of the viewport - * and a z range of -1 at the near plane and 1 at the far. - * Not all mappers support all coordinate systems. - */ - setCoordinateSystemToDisplay(): void; - - /** - * Set whether prop is dragable. - * Even if true, prop may not be dragable if an ancestor prop is not dragable. - * @param dragable - * @default true - * @see getDragable - * @see combineDragable - */ - setDragable(dragable: boolean): boolean; - - /** - * - * @param estimatedRenderTime - */ - setEstimatedRenderTime(estimatedRenderTime: number): void; - - /** - * Set parent prop used by combineVisibility(), combinePickable(), combineDragable() - * @param parentProp - * @see combineVisibility - * @see combinePickable - * @see combineDragable - * @default null - */ - setParentProp(parentProp: vtkProp): void; - - /** - * Set whether prop is pickable. - * Even if true, prop may not be pickable if an ancestor prop is not pickable. - * @param pickable - * @default true - * @see getPickable - * @see combinePickable - */ - setPickable(pickable: boolean): boolean; - - /** - * Set whether prop is visible. - * Even if true, prop may not be visible if an ancestor prop is not visible. - * @param visibility - * @default true - * @see getVisibility - * @see combineVisibility - */ - setVisibility(visibility: boolean): boolean; - - /** - * In case the Visibility flag is true, tell if the bounds of this prop should be taken into - * account or ignored during the computation of other bounding boxes, like in vtkRenderer::ResetCamera(). - * @param useBounds - * @default true - */ - setUseBounds(useBounds: boolean): boolean; - - /** - * This is used for culling and is a number between 0 and 1. It is used to create the allocated render time value. - * @param {Number} renderTimeMultiplier - */ - setRenderTimeMultiplier(renderTimeMultiplier: number): boolean; - - /** - * Not Implemented yet - * Method fires PickEvent if the prop is picked. - */ - pick(): any; - - /** - * Not Implemented yet - */ - hasKey(): any; + /** + * + * @param estimatedRenderTime + */ + addEstimatedRenderTime(estimatedRenderTime: number): void; + + /** + * To be reimplemented by subclasses. + * For some exporters and other other operations we must be able + * to collect all the actors or volumes. + */ + getActors(): vtkActor[]; + + /** + * Not implemented yet + */ + getActors2D(): vtkActor2D[]; + + /** + * Get the coordinate system this prop is defined in. + */ + getCoordinateSystem(): CoordinateSystem; + + /** + * Get the value of the dragable instance variable. + * @see getNestedDragable + * @see getPickable + */ + getDragable(): boolean; + + /** + * Combine dragabe property with optional ancestor props dragable properties. + * It is used to decide whether the prop can be mouse dragged. + * @see getDragable + * @see getParentProp + */ + getNestedDragable(): boolean; + + /** + * Get visibility of this vtkProp. + * @see getNestedVisibility + * @see getPickable + */ + getVisibility(): boolean; + + /** + * Combine visibility property with optional ancestor props visibility properties. + * It is used to decide whether the prop should be rendered. + * @see getVisibility + * @see getParentProp + */ + getNestedVisibility(): boolean; + + /** + * Get the pickable instance variable. + * @see getNestedPickable + * @see getDragable + */ + getPickable(): boolean; + + /** + * Combine pickable property with optional ancestor props pickable properties. + * It is used to decide whether the prop should be rendered during a selection rendering. + * @see getPickable + * @see getParentProp + */ + getNestedPickable(): boolean; + + /** + * Return the mtime of anything that would cause the rendered image to appear differently. + * Usually this involves checking the mtime of the prop plus anything else it depends on such as properties, + * textures etc. + */ + getRedrawMTime(): number; + + /** + * + */ + getRendertimemultiplier(): number; + + /** + * The value is returned in seconds. For simple geometry the accuracy may not be great + * due to buffering. For ray casting, which is already multi-resolution, + * the current resolution of the image is factored into the time. We need the viewport + * for viewing parameters that affect timing. The no-arguments version simply returns the value of the variable with no estimation. + */ + getEstimatedRenderTime(): number; + + /** + * + */ + getAllocatedRenderTime(): number; + + /** + * + */ + getNestedProps(): any; + + /** + * Return parent prop set by setParentProp + * @see setParentProp + */ + getParentProp(): vtkProp; + + /** + * + * Not implemented yet + */ + getVolumes(): vtkVolume[]; + + /** + * + */ + getUseBounds(): boolean; + + /** + * + */ + getSupportsSelection(): boolean; + + /** + * + */ + getTextures(): vtkTexture[]; + + /** + * + * @param {vtkTexture} texture The vtkTexture instance. + * + */ + hasTexture(texture: vtkTexture): boolean; + + /** + * + * @param {vtkTexture} texture The vtkTexture instance. + */ + addTexture(texture: vtkTexture): void; + + /** + * + * @param {vtkTexture} texture The vtkTexture instance. + */ + removeTexture(texture: vtkTexture): void; + + /** + * + */ + removeAllTextures(): void; + + /** + * This method is used to restore that old value should the render be aborted. + */ + restoreEstimatedRenderTime(): void; + + /** + * + * @param allocatedRenderTime + */ + setAllocatedRenderTime(allocatedRenderTime: number): void; + + /** + * Set the coordinate system that this prop's data should be in. + * Once the prop has applied any modifiers such as position, orientation + * userMatrix the resulting values will be treated as in the specified + * coordinate system. + * Not all mappers support all coordinate systems. + * @param {CoordinateSystem} coordinateSystem + */ + setCoordinateSystem(coordinateSystem: CoordinateSystem): void; + + /** + * Indicate that this prop's data should be in world coordinates. + * Once the prop has applied any modifiers such as position, orientation + * userMatrix the resulting values will be treated as in world coordinates. + * Not all mappers support all coordinate systems. + */ + setCoordinateSystemToWorld(): void; + + /** + * Indicate that this prop's data should be in display coordinates. + * Once the prop has applied any modifiers such as position, orientation + * userMatrix the resulting values will be treated as in pixel coordinates. + * That is pixel coordinate with 0,0 in the lower left of the viewport + * and a z range of -1 at the near plane and 1 at the far. + * Not all mappers support all coordinate systems. + */ + setCoordinateSystemToDisplay(): void; + + /** + * Set whether prop is dragable. + * Even if true, prop may not be dragable if an ancestor prop is not dragable. + * @param dragable + * @default true + * @see getDragable + * @see combineDragable + */ + setDragable(dragable: boolean): boolean; + + /** + * + * @param estimatedRenderTime + */ + setEstimatedRenderTime(estimatedRenderTime: number): void; + + /** + * Set parent prop used by combineVisibility(), combinePickable(), combineDragable() + * @param parentProp + * @see combineVisibility + * @see combinePickable + * @see combineDragable + * @default null + */ + setParentProp(parentProp: vtkProp): void; + + /** + * Set whether prop is pickable. + * Even if true, prop may not be pickable if an ancestor prop is not pickable. + * @param pickable + * @default true + * @see getPickable + * @see combinePickable + */ + setPickable(pickable: boolean): boolean; + + /** + * Set whether prop is visible. + * Even if true, prop may not be visible if an ancestor prop is not visible. + * @param visibility + * @default true + * @see getVisibility + * @see combineVisibility + */ + setVisibility(visibility: boolean): boolean; + + /** + * In case the Visibility flag is true, tell if the bounds of this prop should be taken into + * account or ignored during the computation of other bounding boxes, like in vtkRenderer::ResetCamera(). + * @param useBounds + * @default true + */ + setUseBounds(useBounds: boolean): boolean; + + /** + * This is used for culling and is a number between 0 and 1. It is used to create the allocated render time value. + * @param {Number} renderTimeMultiplier + */ + setRenderTimeMultiplier(renderTimeMultiplier: number): boolean; + + /** + * Not Implemented yet + * Method fires PickEvent if the prop is picked. + */ + pick(): any; + + /** + * Not Implemented yet + */ + hasKey(): any; } - /** * Method use to decorate a given object (publicAPI+model) with vtkProp characteristics. * @@ -288,7 +285,11 @@ export interface vtkProp extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IPropInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPropInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPropInitialValues +): void; /** * Method use to create a new instance of vtkProp @@ -296,7 +297,6 @@ export function extend(publicAPI: object, model: object, initialValues?: IPropIn */ export function newInstance(initialValues?: IPropInitialValues): vtkProp; - /** * vtkProp is an abstract superclass for any objects that can exist in a * rendered scene (either 2D or 3D). Instances of vtkProp may respond to @@ -305,7 +305,7 @@ export function newInstance(initialValues?: IPropInitialValues): vtkProp; * variables that control visibility, picking, and dragging. */ export declare const vtkProp: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkProp; diff --git a/Sources/Rendering/Core/Prop3D/index.d.ts b/Sources/Rendering/Core/Prop3D/index.d.ts index e59f2da8eaf..19e680f6fec 100755 --- a/Sources/Rendering/Core/Prop3D/index.d.ts +++ b/Sources/Rendering/Core/Prop3D/index.d.ts @@ -1,263 +1,261 @@ -import { mat4, quat } from "gl-matrix"; -import { Bounds, Vector3, Range } from "../../../types"; -import vtkProp, { IPropInitialValues } from "../Prop"; +import { mat4, quat } from 'gl-matrix'; +import { Bounds, Vector3, Range } from '../../../types'; +import vtkProp, { IPropInitialValues } from '../Prop'; export interface IProp3DInitialValues extends IPropInitialValues { - origin?: number[]; - position?: Vector3; - orientation?: number[]; - scale?: number[]; - bounds?: Bounds; - isIdentity?: boolean; + origin?: number[]; + position?: Vector3; + orientation?: number[]; + scale?: number[]; + bounds?: Bounds; + isIdentity?: boolean; } export interface vtkProp3D extends vtkProp { - - /** - * Add the position of the Prop3D in world coordinates. - * @param deltaXYZ - */ - addPosition(deltaXYZ: number[]): void; - - /** - * Get the bounds as [xmin, xmax, ymin, ymax, zmin, zmax]. - * @return {Bounds} The bounds for the mapper. - */ - getBounds(): Bounds; - - /** - * Check if there was a modification or transformation. - * @default null - * @return {Boolean} true if no modification/transformation have been set. - */ - getIsIdentity(): boolean; - - /** - * The ordering in which these rotations must be done to generate the same - * matrix is RotateZ, RotateX, and finally RotateY. See also `SetOrientation`. - * @return {Number[]} the orientation of the Prop3D as s vector of X, Y and Z rotation. - */ - getOrientation(): number[]; - - /** - * Get a reference of the orientation of the Prop3D as s vector of X, Y and Z - * rotation. - * @return {Number[]} the orientation of the Prop3D as s vector of X, Y and Z rotation. - */ - getOrientationByReference(): number[]; - - /** - * Get the WXYZ orientation of the Prop3D. - */ - getOrientationWXYZ(): number[]; - - /** - * Get the origin of the Prop3D. This is the point about which all rotations - * take place. - */ - getOrigin(): number[]; - - /** - * Get a reference of the origin of the Prop3D. This is the point about - * which all rotations take place. - */ - getOriginByReference(): number[]; - - /** - * Get the position of the Prop3D in world coordinates. - */ - getPosition(): number[]; - - /** - * Get a refrence of the position of the Prop3D in world coordinates. - */ - getPositionByReference(): number[]; - - /** - * Get the scale of the actor. - */ - getScale(): number[]; - - /** - * Get a refrence of the scale of the actor. - */ - getScaleByReference(): number[]; - - /** - * Get the WXYZ orientation of the Prop3D. - */ - getOrientationWXYZ(): number[]; - - /** - * Get the orientation quaternion of the Prop3D. - * out is optional and will be created if not supplied. - * @param {quat | undefined} out - */ - getOrientationQuaternion(out?: quat): quat; - - /** - * Get a reference to the Prop3D’s 4x4 composite matrix. - * Get the matrix from the position, origin, scale and orientation This - * matrix is cached, so multiple GetMatrix() calls will be efficient. - */ - getMatrix(): mat4; - - /** - * Get the center of the bounding box in world coordinates. - */ - getCenter(): number[]; - - /** - * Get the length of the diagonal of the bounding box. - */ - getLength(): number; - - /** - * Get the Prop3D's x range in world coordinates. - */ - getXRange(): Range; - - /** - * Get the Prop3D's y range in world coordinates. - */ - getYRange(): Range; - - /** - * Get the Prop3D's z range in world coordinates. - */ - getZRange(): Range; - - /** - * Get the transformation matrix set for your own use. - */ - getUserMatrix(): mat4; - - /** - * Rotate the Prop3D in degrees about the X axis using the right hand - * rule. The axis is the Prop3D’s X axis, which can change as other - * rotations are performed. To rotate about the world X axis use - * RotateWXYZ (angle, 1, 0, 0). This rotation is applied before all - * others in the current transformation matrix. - * @param {Number} angle The angle value. - */ - rotateX(angle: number): void; - - /** - * Rotate the Prop3D in degrees about the Y axis using the right hand - * rule. The axis is the Prop3D’s Y axis, which can change as other - * rotations are performed. To rotate about the world Y axis use - * RotateWXYZ (angle, 0, 1, 0). This rotation is applied before all - * others in the current transformation matrix. - * @param {Number} angle The angle value. - */ - rotateY(angle: number): void; - - /** - * Rotate the Prop3D in degrees about the Z axis using the right hand - * rule. The axis is the Prop3D’s Z axis, which can change as other - * rotations are performed. To rotate about the world Z axis use - * RotateWXYZ (angle, 0, 0, 1). This rotation is applied before all - * others in the current transformation matrix. - * @param {Number} angle The angle value. - */ - rotateZ(angle: number): void; - - /** - * Rotate the Prop3D in degrees about an arbitrary axis specified by - * the last three arguments. The axis is specified in world - * coordinates. To rotate an about its model axes, use RotateX, - * RotateY, RotateZ. - * @param {Number} degrees The angle value. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - rotateWXYZ(degrees: number, x: number, y: number, z: number): void; - - /** - * Rotate the Prop3D by the provided orientation quaternion. - * If the provided quaternion is identity (~epsilon), this function does nothing. - * The quaternion should follow the gl-matrix convention: [x,y,z,w] - * @param {quat} orientationQuaternion The quaternion to rotate the prop by. - */ - rotateQuaternion(orientationQuaternion: quat): void; - - /** - * Orientation is specified as X, Y and Z rotations in that order, - * but they are performed as RotateZ, RotateX, and finally RotateY. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setOrientation(x: number, y: number, z: number): boolean; - - /** - * Set the origin of the Prop3D. This is the point about which all rotations take place. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setOrigin(x: number, y: number, z: number): boolean; - - /** - * Set the origin of the Prop3D. This is the point about which all rotations - * take place. - * @param {Number[]} origin - */ - setOrigin(origin: number[]): boolean; - - - /** - * Set the origin of the Prop3D. This is the point about which all rotations - * take place. - * @param {Number[]} origin - */ - setOriginFrom(origin: number[]): boolean; - - /** - * Set the origin of the Prop3D. - * This is the point about which all rotations take place. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setPosition(x: number, y: number, z: number): boolean; - - /** - * Set the origin of the Prop3D. - * @param {Vector3} position - */ - setPositionFrom(position: Vector3): boolean; - - /** - * Set the scale of the actor. - * Scaling in performed independently on the X, Y and Z axis. A scale of zero is illegal and will be replaced with one. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setScale(x: number, y: number, z: number): boolean; - - /** - * - * @param {Number[]} scale - */ - setScaleFrom(scale: number[]): boolean; - - /** - * In addition to the instance variables such as position and orientation, - * you can add an additional transformation matrix for your own use. This - * matrix is concatenated with the actor's internal matrix, which you - * implicitly create through the use of setPosition(), setOrigin() and - * setOrientation(). - * @param {mat4} matrix - */ - setUserMatrix(matrix: mat4): void; - - /** - * Generate the matrix based on internal model. - */ - computeMatrix(): void; + /** + * Add the position of the Prop3D in world coordinates. + * @param deltaXYZ + */ + addPosition(deltaXYZ: number[]): void; + + /** + * Get the bounds as [xmin, xmax, ymin, ymax, zmin, zmax]. + * @return {Bounds} The bounds for the mapper. + */ + getBounds(): Bounds; + + /** + * Check if there was a modification or transformation. + * @default null + * @return {Boolean} true if no modification/transformation have been set. + */ + getIsIdentity(): boolean; + + /** + * The ordering in which these rotations must be done to generate the same + * matrix is RotateZ, RotateX, and finally RotateY. See also `SetOrientation`. + * @return {Number[]} the orientation of the Prop3D as s vector of X, Y and Z rotation. + */ + getOrientation(): number[]; + + /** + * Get a reference of the orientation of the Prop3D as s vector of X, Y and Z + * rotation. + * @return {Number[]} the orientation of the Prop3D as s vector of X, Y and Z rotation. + */ + getOrientationByReference(): number[]; + + /** + * Get the WXYZ orientation of the Prop3D. + */ + getOrientationWXYZ(): number[]; + + /** + * Get the origin of the Prop3D. This is the point about which all rotations + * take place. + */ + getOrigin(): number[]; + + /** + * Get a reference of the origin of the Prop3D. This is the point about + * which all rotations take place. + */ + getOriginByReference(): number[]; + + /** + * Get the position of the Prop3D in world coordinates. + */ + getPosition(): number[]; + + /** + * Get a refrence of the position of the Prop3D in world coordinates. + */ + getPositionByReference(): number[]; + + /** + * Get the scale of the actor. + */ + getScale(): number[]; + + /** + * Get a refrence of the scale of the actor. + */ + getScaleByReference(): number[]; + + /** + * Get the WXYZ orientation of the Prop3D. + */ + getOrientationWXYZ(): number[]; + + /** + * Get the orientation quaternion of the Prop3D. + * out is optional and will be created if not supplied. + * @param {quat | undefined} out + */ + getOrientationQuaternion(out?: quat): quat; + + /** + * Get a reference to the Prop3D’s 4x4 composite matrix. + * Get the matrix from the position, origin, scale and orientation This + * matrix is cached, so multiple GetMatrix() calls will be efficient. + */ + getMatrix(): mat4; + + /** + * Get the center of the bounding box in world coordinates. + */ + getCenter(): number[]; + + /** + * Get the length of the diagonal of the bounding box. + */ + getLength(): number; + + /** + * Get the Prop3D's x range in world coordinates. + */ + getXRange(): Range; + + /** + * Get the Prop3D's y range in world coordinates. + */ + getYRange(): Range; + + /** + * Get the Prop3D's z range in world coordinates. + */ + getZRange(): Range; + + /** + * Get the transformation matrix set for your own use. + */ + getUserMatrix(): mat4; + + /** + * Rotate the Prop3D in degrees about the X axis using the right hand + * rule. The axis is the Prop3D’s X axis, which can change as other + * rotations are performed. To rotate about the world X axis use + * RotateWXYZ (angle, 1, 0, 0). This rotation is applied before all + * others in the current transformation matrix. + * @param {Number} angle The angle value. + */ + rotateX(angle: number): void; + + /** + * Rotate the Prop3D in degrees about the Y axis using the right hand + * rule. The axis is the Prop3D’s Y axis, which can change as other + * rotations are performed. To rotate about the world Y axis use + * RotateWXYZ (angle, 0, 1, 0). This rotation is applied before all + * others in the current transformation matrix. + * @param {Number} angle The angle value. + */ + rotateY(angle: number): void; + + /** + * Rotate the Prop3D in degrees about the Z axis using the right hand + * rule. The axis is the Prop3D’s Z axis, which can change as other + * rotations are performed. To rotate about the world Z axis use + * RotateWXYZ (angle, 0, 0, 1). This rotation is applied before all + * others in the current transformation matrix. + * @param {Number} angle The angle value. + */ + rotateZ(angle: number): void; + + /** + * Rotate the Prop3D in degrees about an arbitrary axis specified by + * the last three arguments. The axis is specified in world + * coordinates. To rotate an about its model axes, use RotateX, + * RotateY, RotateZ. + * @param {Number} degrees The angle value. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + rotateWXYZ(degrees: number, x: number, y: number, z: number): void; + + /** + * Rotate the Prop3D by the provided orientation quaternion. + * If the provided quaternion is identity (~epsilon), this function does nothing. + * The quaternion should follow the gl-matrix convention: [x,y,z,w] + * @param {quat} orientationQuaternion The quaternion to rotate the prop by. + */ + rotateQuaternion(orientationQuaternion: quat): void; + + /** + * Orientation is specified as X, Y and Z rotations in that order, + * but they are performed as RotateZ, RotateX, and finally RotateY. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setOrientation(x: number, y: number, z: number): boolean; + + /** + * Set the origin of the Prop3D. This is the point about which all rotations take place. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setOrigin(x: number, y: number, z: number): boolean; + + /** + * Set the origin of the Prop3D. This is the point about which all rotations + * take place. + * @param {Number[]} origin + */ + setOrigin(origin: number[]): boolean; + + /** + * Set the origin of the Prop3D. This is the point about which all rotations + * take place. + * @param {Number[]} origin + */ + setOriginFrom(origin: number[]): boolean; + + /** + * Set the origin of the Prop3D. + * This is the point about which all rotations take place. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setPosition(x: number, y: number, z: number): boolean; + + /** + * Set the origin of the Prop3D. + * @param {Vector3} position + */ + setPositionFrom(position: Vector3): boolean; + + /** + * Set the scale of the actor. + * Scaling in performed independently on the X, Y and Z axis. A scale of zero is illegal and will be replaced with one. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setScale(x: number, y: number, z: number): boolean; + + /** + * + * @param {Number[]} scale + */ + setScaleFrom(scale: number[]): boolean; + + /** + * In addition to the instance variables such as position and orientation, + * you can add an additional transformation matrix for your own use. This + * matrix is concatenated with the actor's internal matrix, which you + * implicitly create through the use of setPosition(), setOrigin() and + * setOrientation(). + * @param {mat4} matrix + */ + setUserMatrix(matrix: mat4): void; + + /** + * Generate the matrix based on internal model. + */ + computeMatrix(): void; } /** @@ -267,7 +265,11 @@ export interface vtkProp3D extends vtkProp { * @param model object on which data structure will be bounds (protected) * @param {IProp3DInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IProp3DInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IProp3DInitialValues +): void; /** * Method use to create a new instance of vtkProp3D @@ -275,7 +277,7 @@ export function extend(publicAPI: object, model: object, initialValues?: IProp3D */ export function newInstance(initialValues?: IProp3DInitialValues): vtkProp3D; -/** +/** * vtkProp3D is an abstract class used to represent an entity in a rendering * scene (i.e., vtkProp3D is a vtkProp with an associated transformation * matrix). It handles functions related to the position, orientation and @@ -287,7 +289,7 @@ export function newInstance(initialValues?: IProp3DInitialValues): vtkProp3D; * matrix or transform, and no texture map. */ export declare const vtkProp3D: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkProp3D; diff --git a/Sources/Rendering/Core/Property/Constants.d.ts b/Sources/Rendering/Core/Property/Constants.d.ts index 2c3288dc4e6..b28a4909e84 100644 --- a/Sources/Rendering/Core/Property/Constants.d.ts +++ b/Sources/Rendering/Core/Property/Constants.d.ts @@ -1,24 +1,24 @@ export declare enum Shading { - FLAT = 0, - GOURAUD = 1, - PHONG = 2, + FLAT = 0, + GOURAUD = 1, + PHONG = 2, } export declare enum Representation { - POINTS = 0, - WIREFRAME = 1, - SURFACE = 2, + POINTS = 0, + WIREFRAME = 1, + SURFACE = 2, } export declare enum Interpolation { - FLAT = 0, - GOURAUD = 1, - PHONG = 2, + FLAT = 0, + GOURAUD = 1, + PHONG = 2, } declare const _default: { - Shading: typeof Shading; - Representation: typeof Representation; - Interpolation: typeof Interpolation; + Shading: typeof Shading; + Representation: typeof Representation; + Interpolation: typeof Interpolation; }; export default _default; diff --git a/Sources/Rendering/Core/Property/index.d.ts b/Sources/Rendering/Core/Property/index.d.ts index e0d7b56794a..a6f0c4dc7dd 100755 --- a/Sources/Rendering/Core/Property/index.d.ts +++ b/Sources/Rendering/Core/Property/index.d.ts @@ -1,535 +1,533 @@ -import { vtkObject } from "../../../interfaces"; -import { RGBColor } from "../../../types"; -import { Interpolation, Representation, Shading } from "./Constants"; +import { vtkObject } from '../../../interfaces'; +import { RGBColor } from '../../../types'; +import { Interpolation, Representation, Shading } from './Constants'; import { vtkTexture } from '../../Core/Texture'; export interface IPropertyInitialValues { - color?: RGBColor; - ambientColor?: RGBColor; - diffuseColor?: RGBColor; - specularColor?: RGBColor; - diffuseTexture?: vtkTexture; - metallicTexture?: vtkTexture; - roughnessTexture?: vtkTexture; - normalTexture?: vtkTexture; - ambientOcclusionTexture?: vtkTexture; - emissionTexture?: vtkTexture; - edgeColor?: RGBColor; - ambient?: number; - diffuse?: number; - metallic?: number; - roughness?: number; - normalStrength?: number; - emission?: number; - baseIOR?: number; - specular?: number; - specularPower?: number; - opacity?: number; - edgeVisibility?: boolean; - backfaceCulling?: boolean; - frontfaceCulling?: boolean; - pointSize?: number; - lineWidth?: number; - lighting?: boolean; - shading?: boolean; + color?: RGBColor; + ambientColor?: RGBColor; + diffuseColor?: RGBColor; + specularColor?: RGBColor; + diffuseTexture?: vtkTexture; + metallicTexture?: vtkTexture; + roughnessTexture?: vtkTexture; + normalTexture?: vtkTexture; + ambientOcclusionTexture?: vtkTexture; + emissionTexture?: vtkTexture; + edgeColor?: RGBColor; + ambient?: number; + diffuse?: number; + metallic?: number; + roughness?: number; + normalStrength?: number; + emission?: number; + baseIOR?: number; + specular?: number; + specularPower?: number; + opacity?: number; + edgeVisibility?: boolean; + backfaceCulling?: boolean; + frontfaceCulling?: boolean; + pointSize?: number; + lineWidth?: number; + lighting?: boolean; + shading?: boolean; } export interface vtkProperty extends vtkObject { - - - /** - * Not Implemented yet - */ - addShaderVariable(): any; - - /** - * Not Implemented yet - */ - computeCompositeColor(): any; - - /** - * Get the lighting coefficient. - * @default 0 - */ - getAmbient(): number; - - /** - * Get the ambient surface color. Not all renderers support separate ambient - * and diffuse colors. From a physical standpoint it really doesn't make too - * much sense to have both. For the rendering libraries that don't support - * both, the diffuse color is used. - * @return {RGBColor} Array of RGB color. - */ - getAmbientColor(): RGBColor; - - /** - * Get the ambient surface color. - */ - getAmbientColorByReference(): RGBColor; - - /** - * - */ - getBackfaceCulling(): boolean; - - /** - * Get the color of the object.the color of the object - */ - getColor(): RGBColor; - - /** - * Get the diffuse lighting coefficient. - * @default 1 - */ - getDiffuse(): number; - - /** - * Get the diffuse surface color. - * @return {RGBColor} Array of RGB color. - */ - getDiffuseColor(): RGBColor; - /** - * - */ - getDiffuseColorByReference(): RGBColor; - - /** - * - */ - getEdgeColor(): RGBColor; - - /** - * - */ - getEdgeColorByReference(): RGBColor; - - /** - * - */ - getEdgeVisibility(): boolean; - - /** - * Get the fast culling of polygons based on orientation of normal - * with respect to camera. If frontface culling is on, polygons facing - * towards camera are not drawn. - * @default false - */ - getFrontfaceCulling(): boolean; - - /** - * Get the shading interpolation method for an object. - */ - getInterpolation(): Interpolation; - - /** - * Map the interpolation integer to the corresponding ShadingModel. - */ - getInterpolationAsString(): string; - - /** - * Get lighting flag for an object. - * @default true - */ - getLighting(): boolean; - - /** - * Get the width of a Line. The width is expressed in screen units. - * @default 1.0 - */ - getLineWidth(): number; - - /** - * Get the opacity of the object. Set/Get the object's opacity. - * 1.0 is totally opaque and 0.0 is completely transparent. - * @default 1 - */ - getOpacity(): number; - - /** - * Get the diameter of a point. The size is expressed in screen units. - * @default 1.0 - */ - getPointSize(): number; - - /** - * Get the surface geometry representation for the object. - */ - getRepresentation(): Representation; - - /** - * Get the surface geometry representation for the object as string. - * @return {String} Surface geometry representation for the object as string - */ - getRepresentationAsString(): string; - - /** - * Check if the shading is set. - */ - getShading(): boolean; - - /** - * Get the specular lighting coefficient. - * @default 0 - */ - getSpecular(): number; - - /** - * Get the roughness coefficient. - * @default 1 - */ - getRoughness(): number; - - /** - * Get the metallic coefficient. - * @default 0 - */ - getMetallic(): number; - - /** - * Get the index of refraction. - * @default 0 - */ - getBaseIOR(): number; - - /** - * Get the strength of the normal map. - * @default 1 - */ - getNormalStrength(): number; - - /** - * Get the emission coefficient. - * @default 0 - */ - getEmission(): number; - - /** - * Get the specular surface color. - * @return {RGBColor} Array of RGB color. - */ - getSpecularColor(): RGBColor; - - /** - * Get the specular surface color. - */ - getSpecularColorByReference(): RGBColor; - - /** - * Get the specular power. - * @default 1 - */ - getSpecularPower(): number; - - /** - * Get the diffuse texture. - */ - getDiffuseTexture(): vtkTexture; - - /** - * Get the metallic texture. - */ - getMetallicTexture(): vtkTexture; - - /** - * Get the roughness texture. - */ - getRoughnessTexture(): vtkTexture; - - /** - * Get the normal texture. - */ - getNormalTexture(): vtkTexture; - - /** - * Get the ambient occlusion texture. - */ - getAmbientOcclusionTexture(): vtkTexture; - - /** - * Get the emission texture. - */ - getEmissionTexture(): vtkTexture; - - /** - * Set the ambient lighting coefficient. - * @param {Number} ambient The ambient lighting coefficient. - */ - setAmbient(ambient: number): boolean; - - /** - * Set the ambient surface color. Not all renderers support separate - * ambient and diffuse colors. From a physical standpoint it really - * doesn't make too much sense to have both. For the rendering - * libraries that don’t support both, the diffuse color is used. - * - * @param {Number} r Defines the red component (between 0 and 1) - * @param {Number} g Defines the green component (between 0 and 1) - * @param {Number} b Defines the blue component (between 0 and 1) - */ - setAmbientColor(r: number, g: number, b: number): boolean; - - /** - * Set the ambient surface color. Not all renderers support separate - * ambient and diffuse colors. From a physical standpoint it really - * doesn't make too much sense to have both. For the rendering - * libraries that don’t support both, the diffuse color is used. - * @param {RGBColor} ambientColor An Array of the RGB color. - */ - setAmbientColor(ambientColor: RGBColor): boolean; - - /** - * Set the ambient surface color from an RGB array - * @param {RGBColor} ambientColor An Array of the RGB color. - */ - setAmbientColorFrom(ambientColor: RGBColor): boolean; - - /** - * Turn on/off fast culling of polygons based on orientation of normal - * with respect to camera. If backface culling is on, polygons facing - * away from camera are not drawn. - * @param {Boolean} backfaceCulling - */ - setBackfaceCulling(backfaceCulling: boolean): boolean; - - /** - * Set the color of the object. Has the side effect of setting the - * ambient diffuse and specular colors as well. This is basically - * a quick overall color setting method. - * @param {Number} r Defines the red component (between 0 and 1) - * @param {Number} g Defines the green component (between 0 and 1) - * @param {Number} b Defines the blue component (between 0 and 1) - */ - setColor(r: number, g: number, b: number): boolean; - - /** - * Set the color of the object. Has the side effect of setting the - * ambient diffuse and specular colors as well. This is basically - * a quick overall color setting method. - * @param {RGBColor} color An Array of the RGB color. - */ - setColor(color: RGBColor): boolean; - - /** - * Set the diffuse lighting coefficient. - * @param {Number} diffuse The diffuse lighting coefficient. - */ - setDiffuse(diffuse: number): boolean; - - /** - * Set the diffuse surface color. - * @param {Number} r Defines the red component (between 0 and 1) - * @param {Number} g Defines the green component (between 0 and 1) - * @param {Number} b Defines the blue component (between 0 and 1) - */ - setDiffuseColor(r: number, g: number, b: number): boolean; - - /** - * Set the diffuse surface color. - * @param {RGBColor} diffuseColor An Array of the RGB color. - */ - setDiffuseColor(diffuseColor: RGBColor): boolean; - - /** - * Set the diffuse surface color from an RGB array - * @param {RGBColor} diffuseColor An Array of the RGB color. - */ - setDiffuseColorFrom(diffuseColor: RGBColor): boolean; - - /** - * Set the color of primitive edges (if edge visibility is enabled). - * @param {Number} r Defines the red component (between 0 and 1) - * @param {Number} g Defines the green component (between 0 and 1) - * @param {Number} b Defines the blue component (between 0 and 1) - */ - setEdgeColor(r: number, g: number, b: number): boolean; - - /** - * Set the color of primitive edges (if edge visibility is enabled). - * @param {RGBColor} edgeColor An Array of the RGB color. - */ - setEdgeColor(edgeColor: RGBColor): boolean; - - /** - * Set the color of primitive edges from an RGB array. - * @param {RGBColor} edgeColor An Array of the RGB color. - */ - setEdgeColorFrom(edgeColor: RGBColor): boolean; - - /** - * Turn on/off the visibility of edges. On some renderers it is - * possible to render the edges of geometric primitives separately - * from the interior. - * @param {Boolean} edgeVisibility - */ - setEdgeVisibility(edgeVisibility: boolean): boolean; - - /** - * Turn on/off fast culling of polygons based on orientation of normal - * with respect to camera. If frontface culling is on, polygons facing - * towards camera are not drawn. - * @param {Boolean} frontfaceCulling - */ - setFrontfaceCulling(frontfaceCulling: boolean): boolean; - - /** - * Set the shading interpolation method for an object. - * @param {Interpolation} interpolation - */ - setInterpolation(interpolation: Interpolation): boolean; - - /** - * Set interpolation to 0 means `FLAT`. - */ - setInterpolationToFlat(): boolean; - - /** - * Set interpolation to 1 means `GOURAUD`. - */ - setInterpolationToGouraud(): boolean; - - /** - * Set interpolation to 2 means `PHONG`. - */ - setInterpolationToPhong(): boolean; - - /** - * Set lighting flag for an object. - * @param {Boolean} lighting - * @default true - */ - setLighting(lighting: boolean): boolean; - - /** - * Set the width of a Line. The width is expressed in screen units. - * !!! note - * This is only implemented for OpenGL. - * @param {Number} lineWidth - * @default 1.0 - */ - setLineWidth(lineWidth: number): boolean; - - /** - * Set the object's opacity. 1.0 is totally opaque and 0.0 is - * completely transparent. - * @param {Number} opacity The opacity of the object. - */ - setOpacity(opacity: number): boolean; - - /** - * Set the diameter of a point. The size is expressed in screen units. - * !!! note - * This is only implemented for OpenGL. - * @param {Number} pointSize - * @default 1.0 - */ - setPointSize(pointSize: number): boolean; - - /** - * Control the surface geometry representation for the object. - * @param {Representation} representation - */ - setRepresentation(representation: Representation): boolean; - - /** - * Set representation to 0 means `POINT`' - */ - setRepresentationToPoints(): boolean; - - /** - * Set representation to 2 means `SURFAC`' - */ - setRepresentationToSurface(): boolean; - - /** - * Set representation to 1 means `WIREFRAM`' - */ - setRepresentationToWireframe(): boolean; - - /** - * Enable/Disable shading. - * @param {Boolean} shading - */ - setShading(shading: boolean): boolean; - - /** - * Set the specular lighting coefficient. - * @param {Boolean} specular - */ - setSpecular(specular: number): boolean; - - /** - * Set the normal map strength. - * @param {Boolean} normal - */ - setNormalStrength(normalStrength: number): boolean; - - /** - * Set the ambient occlusion map strength. - * @param {Boolean} emission - */ - setEmission(emission: number): boolean; - - /** - * Set the specular surface color. - * @param {Number} r Defines the red component (between 0 and 1) - * @param {Number} g Defines the green component (between 0 and 1) - * @param {Number} b Defines the blue component (between 0 and 1) - */ - setSpecularColor(r: number, g: number, b: number): boolean; - - /** - * Set the specular surface color from an RGB array - * @param {RGBColor} specularColor An Array of the RGB color. - */ - setSpecularColor(specularColor: RGBColor): boolean; - - /** - * Set the specular surface color from an RGB array - * @param {RGBColor} specularColor An Array of the RGB color. - */ - setSpecularColorFrom(specularColor: RGBColor): boolean; - - /** - * Set the specular power. - * @param {Number} specularPower - */ - setSpecularPower(specularPower: number): boolean; - - /** - * Set the diffuse texture. - * @param {vtkTexture} diffuseTexture - */ - setDiffuseTexture(diffuseTexture: vtkTexture): boolean; - - /** - * Set the metallic texture. - * @param {vtkTexture} metallicTexture - */ - setMetallicTexture(metallicTexture: vtkTexture): boolean; - - /** - * Set the roughness texture. - * @param {vtkTexture} roughnessTexture - */ - setRoughnessTexture(roughnessTexture: vtkTexture): boolean; - - /** - * Set the normal texture. - * @param {vtkTexture} normalTexture - */ - setNormalTexture(normalTexture: vtkTexture): boolean; - - /** - * Set the ambient occlusion texture. - * @param {vtkTexture} ambientOcclusionTexture - */ - setAmbientOcclusionTexture(ambientOcclusionTexture: vtkTexture): boolean; - - /** - * Set the emission texture. - * @param {vtkTexture} emissionTexture - */ - setEmissionTexture(emissionTexture: vtkTexture): boolean; + /** + * Not Implemented yet + */ + addShaderVariable(): any; + + /** + * Not Implemented yet + */ + computeCompositeColor(): any; + + /** + * Get the lighting coefficient. + * @default 0 + */ + getAmbient(): number; + + /** + * Get the ambient surface color. Not all renderers support separate ambient + * and diffuse colors. From a physical standpoint it really doesn't make too + * much sense to have both. For the rendering libraries that don't support + * both, the diffuse color is used. + * @return {RGBColor} Array of RGB color. + */ + getAmbientColor(): RGBColor; + + /** + * Get the ambient surface color. + */ + getAmbientColorByReference(): RGBColor; + + /** + * + */ + getBackfaceCulling(): boolean; + + /** + * Get the color of the object.the color of the object + */ + getColor(): RGBColor; + + /** + * Get the diffuse lighting coefficient. + * @default 1 + */ + getDiffuse(): number; + + /** + * Get the diffuse surface color. + * @return {RGBColor} Array of RGB color. + */ + getDiffuseColor(): RGBColor; + /** + * + */ + getDiffuseColorByReference(): RGBColor; + + /** + * + */ + getEdgeColor(): RGBColor; + + /** + * + */ + getEdgeColorByReference(): RGBColor; + + /** + * + */ + getEdgeVisibility(): boolean; + + /** + * Get the fast culling of polygons based on orientation of normal + * with respect to camera. If frontface culling is on, polygons facing + * towards camera are not drawn. + * @default false + */ + getFrontfaceCulling(): boolean; + + /** + * Get the shading interpolation method for an object. + */ + getInterpolation(): Interpolation; + + /** + * Map the interpolation integer to the corresponding ShadingModel. + */ + getInterpolationAsString(): string; + + /** + * Get lighting flag for an object. + * @default true + */ + getLighting(): boolean; + + /** + * Get the width of a Line. The width is expressed in screen units. + * @default 1.0 + */ + getLineWidth(): number; + + /** + * Get the opacity of the object. Set/Get the object's opacity. + * 1.0 is totally opaque and 0.0 is completely transparent. + * @default 1 + */ + getOpacity(): number; + + /** + * Get the diameter of a point. The size is expressed in screen units. + * @default 1.0 + */ + getPointSize(): number; + + /** + * Get the surface geometry representation for the object. + */ + getRepresentation(): Representation; + + /** + * Get the surface geometry representation for the object as string. + * @return {String} Surface geometry representation for the object as string + */ + getRepresentationAsString(): string; + + /** + * Check if the shading is set. + */ + getShading(): boolean; + + /** + * Get the specular lighting coefficient. + * @default 0 + */ + getSpecular(): number; + + /** + * Get the roughness coefficient. + * @default 1 + */ + getRoughness(): number; + + /** + * Get the metallic coefficient. + * @default 0 + */ + getMetallic(): number; + + /** + * Get the index of refraction. + * @default 0 + */ + getBaseIOR(): number; + + /** + * Get the strength of the normal map. + * @default 1 + */ + getNormalStrength(): number; + + /** + * Get the emission coefficient. + * @default 0 + */ + getEmission(): number; + + /** + * Get the specular surface color. + * @return {RGBColor} Array of RGB color. + */ + getSpecularColor(): RGBColor; + + /** + * Get the specular surface color. + */ + getSpecularColorByReference(): RGBColor; + + /** + * Get the specular power. + * @default 1 + */ + getSpecularPower(): number; + + /** + * Get the diffuse texture. + */ + getDiffuseTexture(): vtkTexture; + + /** + * Get the metallic texture. + */ + getMetallicTexture(): vtkTexture; + + /** + * Get the roughness texture. + */ + getRoughnessTexture(): vtkTexture; + + /** + * Get the normal texture. + */ + getNormalTexture(): vtkTexture; + + /** + * Get the ambient occlusion texture. + */ + getAmbientOcclusionTexture(): vtkTexture; + + /** + * Get the emission texture. + */ + getEmissionTexture(): vtkTexture; + + /** + * Set the ambient lighting coefficient. + * @param {Number} ambient The ambient lighting coefficient. + */ + setAmbient(ambient: number): boolean; + + /** + * Set the ambient surface color. Not all renderers support separate + * ambient and diffuse colors. From a physical standpoint it really + * doesn't make too much sense to have both. For the rendering + * libraries that don’t support both, the diffuse color is used. + * + * @param {Number} r Defines the red component (between 0 and 1) + * @param {Number} g Defines the green component (between 0 and 1) + * @param {Number} b Defines the blue component (between 0 and 1) + */ + setAmbientColor(r: number, g: number, b: number): boolean; + + /** + * Set the ambient surface color. Not all renderers support separate + * ambient and diffuse colors. From a physical standpoint it really + * doesn't make too much sense to have both. For the rendering + * libraries that don’t support both, the diffuse color is used. + * @param {RGBColor} ambientColor An Array of the RGB color. + */ + setAmbientColor(ambientColor: RGBColor): boolean; + + /** + * Set the ambient surface color from an RGB array + * @param {RGBColor} ambientColor An Array of the RGB color. + */ + setAmbientColorFrom(ambientColor: RGBColor): boolean; + + /** + * Turn on/off fast culling of polygons based on orientation of normal + * with respect to camera. If backface culling is on, polygons facing + * away from camera are not drawn. + * @param {Boolean} backfaceCulling + */ + setBackfaceCulling(backfaceCulling: boolean): boolean; + + /** + * Set the color of the object. Has the side effect of setting the + * ambient diffuse and specular colors as well. This is basically + * a quick overall color setting method. + * @param {Number} r Defines the red component (between 0 and 1) + * @param {Number} g Defines the green component (between 0 and 1) + * @param {Number} b Defines the blue component (between 0 and 1) + */ + setColor(r: number, g: number, b: number): boolean; + + /** + * Set the color of the object. Has the side effect of setting the + * ambient diffuse and specular colors as well. This is basically + * a quick overall color setting method. + * @param {RGBColor} color An Array of the RGB color. + */ + setColor(color: RGBColor): boolean; + + /** + * Set the diffuse lighting coefficient. + * @param {Number} diffuse The diffuse lighting coefficient. + */ + setDiffuse(diffuse: number): boolean; + + /** + * Set the diffuse surface color. + * @param {Number} r Defines the red component (between 0 and 1) + * @param {Number} g Defines the green component (between 0 and 1) + * @param {Number} b Defines the blue component (between 0 and 1) + */ + setDiffuseColor(r: number, g: number, b: number): boolean; + + /** + * Set the diffuse surface color. + * @param {RGBColor} diffuseColor An Array of the RGB color. + */ + setDiffuseColor(diffuseColor: RGBColor): boolean; + + /** + * Set the diffuse surface color from an RGB array + * @param {RGBColor} diffuseColor An Array of the RGB color. + */ + setDiffuseColorFrom(diffuseColor: RGBColor): boolean; + + /** + * Set the color of primitive edges (if edge visibility is enabled). + * @param {Number} r Defines the red component (between 0 and 1) + * @param {Number} g Defines the green component (between 0 and 1) + * @param {Number} b Defines the blue component (between 0 and 1) + */ + setEdgeColor(r: number, g: number, b: number): boolean; + + /** + * Set the color of primitive edges (if edge visibility is enabled). + * @param {RGBColor} edgeColor An Array of the RGB color. + */ + setEdgeColor(edgeColor: RGBColor): boolean; + + /** + * Set the color of primitive edges from an RGB array. + * @param {RGBColor} edgeColor An Array of the RGB color. + */ + setEdgeColorFrom(edgeColor: RGBColor): boolean; + + /** + * Turn on/off the visibility of edges. On some renderers it is + * possible to render the edges of geometric primitives separately + * from the interior. + * @param {Boolean} edgeVisibility + */ + setEdgeVisibility(edgeVisibility: boolean): boolean; + + /** + * Turn on/off fast culling of polygons based on orientation of normal + * with respect to camera. If frontface culling is on, polygons facing + * towards camera are not drawn. + * @param {Boolean} frontfaceCulling + */ + setFrontfaceCulling(frontfaceCulling: boolean): boolean; + + /** + * Set the shading interpolation method for an object. + * @param {Interpolation} interpolation + */ + setInterpolation(interpolation: Interpolation): boolean; + + /** + * Set interpolation to 0 means `FLAT`. + */ + setInterpolationToFlat(): boolean; + + /** + * Set interpolation to 1 means `GOURAUD`. + */ + setInterpolationToGouraud(): boolean; + + /** + * Set interpolation to 2 means `PHONG`. + */ + setInterpolationToPhong(): boolean; + + /** + * Set lighting flag for an object. + * @param {Boolean} lighting + * @default true + */ + setLighting(lighting: boolean): boolean; + + /** + * Set the width of a Line. The width is expressed in screen units. + * !!! note + * This is only implemented for OpenGL. + * @param {Number} lineWidth + * @default 1.0 + */ + setLineWidth(lineWidth: number): boolean; + + /** + * Set the object's opacity. 1.0 is totally opaque and 0.0 is + * completely transparent. + * @param {Number} opacity The opacity of the object. + */ + setOpacity(opacity: number): boolean; + + /** + * Set the diameter of a point. The size is expressed in screen units. + * !!! note + * This is only implemented for OpenGL. + * @param {Number} pointSize + * @default 1.0 + */ + setPointSize(pointSize: number): boolean; + + /** + * Control the surface geometry representation for the object. + * @param {Representation} representation + */ + setRepresentation(representation: Representation): boolean; + + /** + * Set representation to 0 means `POINT`' + */ + setRepresentationToPoints(): boolean; + + /** + * Set representation to 2 means `SURFAC`' + */ + setRepresentationToSurface(): boolean; + + /** + * Set representation to 1 means `WIREFRAM`' + */ + setRepresentationToWireframe(): boolean; + + /** + * Enable/Disable shading. + * @param {Boolean} shading + */ + setShading(shading: boolean): boolean; + + /** + * Set the specular lighting coefficient. + * @param {Boolean} specular + */ + setSpecular(specular: number): boolean; + + /** + * Set the normal map strength. + * @param {Boolean} normal + */ + setNormalStrength(normalStrength: number): boolean; + + /** + * Set the ambient occlusion map strength. + * @param {Boolean} emission + */ + setEmission(emission: number): boolean; + + /** + * Set the specular surface color. + * @param {Number} r Defines the red component (between 0 and 1) + * @param {Number} g Defines the green component (between 0 and 1) + * @param {Number} b Defines the blue component (between 0 and 1) + */ + setSpecularColor(r: number, g: number, b: number): boolean; + + /** + * Set the specular surface color from an RGB array + * @param {RGBColor} specularColor An Array of the RGB color. + */ + setSpecularColor(specularColor: RGBColor): boolean; + + /** + * Set the specular surface color from an RGB array + * @param {RGBColor} specularColor An Array of the RGB color. + */ + setSpecularColorFrom(specularColor: RGBColor): boolean; + + /** + * Set the specular power. + * @param {Number} specularPower + */ + setSpecularPower(specularPower: number): boolean; + + /** + * Set the diffuse texture. + * @param {vtkTexture} diffuseTexture + */ + setDiffuseTexture(diffuseTexture: vtkTexture): boolean; + + /** + * Set the metallic texture. + * @param {vtkTexture} metallicTexture + */ + setMetallicTexture(metallicTexture: vtkTexture): boolean; + + /** + * Set the roughness texture. + * @param {vtkTexture} roughnessTexture + */ + setRoughnessTexture(roughnessTexture: vtkTexture): boolean; + + /** + * Set the normal texture. + * @param {vtkTexture} normalTexture + */ + setNormalTexture(normalTexture: vtkTexture): boolean; + + /** + * Set the ambient occlusion texture. + * @param {vtkTexture} ambientOcclusionTexture + */ + setAmbientOcclusionTexture(ambientOcclusionTexture: vtkTexture): boolean; + + /** + * Set the emission texture. + * @param {vtkTexture} emissionTexture + */ + setEmissionTexture(emissionTexture: vtkTexture): boolean; } /** @@ -539,7 +537,11 @@ export interface vtkProperty extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IPropertyInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPropertyInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPropertyInitialValues +): void; /** * Method use to create a new instance of vtkProperty with object color, ambient color, diffuse color, @@ -548,9 +550,11 @@ export function extend(publicAPI: object, model: object, initialValues?: IProper * and surface representation. Backface and frontface culling are off. * @param {IPropertyInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IPropertyInitialValues): vtkProperty; +export function newInstance( + initialValues?: IPropertyInitialValues +): vtkProperty; -/** +/** * vtkProperty is an object that represents lighting and other surface * properties of a geometric object. The primary properties that can be set are * colors (overall, ambient, diffuse, specular, and edge color); specular power; @@ -560,10 +564,10 @@ export function newInstance(initialValues?: IPropertyInitialValues): vtkProperty * manipulated with this object. */ export declare const vtkProperty: { - newInstance: typeof newInstance; - extend: typeof extend; - Shading: typeof Shading; - Representation: typeof Representation; - Interpolation: typeof Interpolation; + newInstance: typeof newInstance; + extend: typeof extend; + Shading: typeof Shading; + Representation: typeof Representation; + Interpolation: typeof Interpolation; }; export default vtkProperty; diff --git a/Sources/Rendering/Core/Property2D/Constants.d.ts b/Sources/Rendering/Core/Property2D/Constants.d.ts index 785143a88a9..e46158913aa 100644 --- a/Sources/Rendering/Core/Property2D/Constants.d.ts +++ b/Sources/Rendering/Core/Property2D/Constants.d.ts @@ -4,6 +4,6 @@ export declare enum DisplayLocation { } declare const _default: { - DisplayLocation: typeof DisplayLocation; + DisplayLocation: typeof DisplayLocation; }; export default _default; diff --git a/Sources/Rendering/Core/Property2D/index.d.ts b/Sources/Rendering/Core/Property2D/index.d.ts index 970a276612b..b22941dd6d4 100755 --- a/Sources/Rendering/Core/Property2D/index.d.ts +++ b/Sources/Rendering/Core/Property2D/index.d.ts @@ -1,114 +1,113 @@ -import { vtkObject } from "../../../interfaces"; -import { RGBColor } from "../../../types"; -import { DisplayLocation } from "./Constants"; - -export interface IProperty2DInitialValues{ - color?: RGBColor; - opacity?: number; - pointSize?: number; - lineWidth?: number; - displayLocation?: DisplayLocation; +import { vtkObject } from '../../../interfaces'; +import { RGBColor } from '../../../types'; +import { DisplayLocation } from './Constants'; + +export interface IProperty2DInitialValues { + color?: RGBColor; + opacity?: number; + pointSize?: number; + lineWidth?: number; + displayLocation?: DisplayLocation; } export interface vtkProperty2D extends vtkObject { - - /** - * Get the color of the object. - */ - getColor(): RGBColor; - - /** - * Get the color of the object. - */ - getColorByReference(): RGBColor; - - /** - * Get the display location of the object. - * @default 'Foreground' - */ - getDisplayLocation(): DisplayLocation; - - /** - * Get the width of a Line. - * The width is expressed in screen units. - */ - getLineWidth(): number; - - /** - * Get the opacity of the object. - */ - getOpacity(): number; - - /** - * Get the diameter of a point. - * The size is expressed in screen units. - */ - getPointSize(): number; - - /** - * Set the color of the object. Has the side effect of setting the - * ambient diffuse and specular colors as well. This is basically - * a quick overall color setting method. - * @param {Number} r Defines the red component (between 0 and 1). - * @param {Number} g Defines the green component (between 0 and 1). - * @param {Number} b Defines the blue component (between 0 and 1). - */ - setColor(r: number, g: number, b: number): boolean; - - /** - * Set the color of the object. Has the side effect of setting the - * ambient diffuse and specular colors as well. This is basically - * a quick overall color setting method. - * @param {RGBColor} color Defines the RGB color array.. - */ - setColor(color: RGBColor): boolean; - - /** - * Set the color of the object. Has the side effect of setting the - * ambient diffuse and specular colors as well. This is basically - * a quick overall color setting method. - * @param {Number} r Defines the red component (between 0 and 1). - * @param {Number} g Defines the green component (between 0 and 1). - * @param {Number} b Defines the blue component (between 0 and 1). - */ - setColorFrom(r: number, g: number, b: number): boolean; - - /** - * Set the color of the object. Has the side effect of setting the - * ambient diffuse and specular colors as well. This is basically - * a quick overall color setting method. - * @param {RGBColor} color Defines the RGB color array.. - */ - setColorFrom(color: RGBColor): boolean; - - /** - * Set the display location of the object. - * @param {String} displayLocation - */ - setDisplayLocation(displayLocation: DisplayLocation): boolean; - - /** - * Set the width of a Line. The width is expressed in screen units. - * This is only implemented for OpenGL. - * @param {Number} lineWidth The width of the Line. - * @default 1.0 - */ - setLineWidth(lineWidth: number): boolean; - - /** - * Set the object’s opacity. 1.0 is totally opaque and 0.0 is - * completely transparent. - * @param {Number} opacity The opacity value. - */ - setOpacity(opacity: number): boolean; - - /** - * Set the diameter of a point. The size is expressed in screen units. - * This is only implemented for OpenGL. - * @param {Number} pointSize The diameter of the point. - * @default 1.0 - */ - setPointSize(pointSize: number): boolean; + /** + * Get the color of the object. + */ + getColor(): RGBColor; + + /** + * Get the color of the object. + */ + getColorByReference(): RGBColor; + + /** + * Get the display location of the object. + * @default 'Foreground' + */ + getDisplayLocation(): DisplayLocation; + + /** + * Get the width of a Line. + * The width is expressed in screen units. + */ + getLineWidth(): number; + + /** + * Get the opacity of the object. + */ + getOpacity(): number; + + /** + * Get the diameter of a point. + * The size is expressed in screen units. + */ + getPointSize(): number; + + /** + * Set the color of the object. Has the side effect of setting the + * ambient diffuse and specular colors as well. This is basically + * a quick overall color setting method. + * @param {Number} r Defines the red component (between 0 and 1). + * @param {Number} g Defines the green component (between 0 and 1). + * @param {Number} b Defines the blue component (between 0 and 1). + */ + setColor(r: number, g: number, b: number): boolean; + + /** + * Set the color of the object. Has the side effect of setting the + * ambient diffuse and specular colors as well. This is basically + * a quick overall color setting method. + * @param {RGBColor} color Defines the RGB color array.. + */ + setColor(color: RGBColor): boolean; + + /** + * Set the color of the object. Has the side effect of setting the + * ambient diffuse and specular colors as well. This is basically + * a quick overall color setting method. + * @param {Number} r Defines the red component (between 0 and 1). + * @param {Number} g Defines the green component (between 0 and 1). + * @param {Number} b Defines the blue component (between 0 and 1). + */ + setColorFrom(r: number, g: number, b: number): boolean; + + /** + * Set the color of the object. Has the side effect of setting the + * ambient diffuse and specular colors as well. This is basically + * a quick overall color setting method. + * @param {RGBColor} color Defines the RGB color array.. + */ + setColorFrom(color: RGBColor): boolean; + + /** + * Set the display location of the object. + * @param {String} displayLocation + */ + setDisplayLocation(displayLocation: DisplayLocation): boolean; + + /** + * Set the width of a Line. The width is expressed in screen units. + * This is only implemented for OpenGL. + * @param {Number} lineWidth The width of the Line. + * @default 1.0 + */ + setLineWidth(lineWidth: number): boolean; + + /** + * Set the object’s opacity. 1.0 is totally opaque and 0.0 is + * completely transparent. + * @param {Number} opacity The opacity value. + */ + setOpacity(opacity: number): boolean; + + /** + * Set the diameter of a point. The size is expressed in screen units. + * This is only implemented for OpenGL. + * @param {Number} pointSize The diameter of the point. + * @default 1.0 + */ + setPointSize(pointSize: number): boolean; } /** @@ -118,7 +117,11 @@ export interface vtkProperty2D extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IProperty2DInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IProperty2DInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IProperty2DInitialValues +): void; /** * Method use to create a new instance of vtkProperty2D with object color, ambient color, diffuse color, @@ -127,9 +130,11 @@ export function extend(publicAPI: object, model: object, initialValues?: IProper * and surface representation. Backface and frontface culling are off. * @param {IProperty2DInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IProperty2DInitialValues): vtkProperty2D; +export function newInstance( + initialValues?: IProperty2DInitialValues +): vtkProperty2D; -/** +/** * vtkProperty2D is an object that represents lighting and other surface * properties of a 2D geometric object. The primary properties that can be * set are colors (overall, ambient, diffuse, specular, and edge color); @@ -139,7 +144,7 @@ export function newInstance(initialValues?: IProperty2DInitialValues): vtkProper * like backface properties can be set and manipulated with this object. */ export declare const vtkProperty2D: { - newInstance: typeof newInstance; - extend: typeof extend; + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkProperty2D; diff --git a/Sources/Rendering/Core/RenderWindow/index.d.ts b/Sources/Rendering/Core/RenderWindow/index.d.ts index aa916ccf460..a52ad17ea1b 100755 --- a/Sources/Rendering/Core/RenderWindow/index.d.ts +++ b/Sources/Rendering/Core/RenderWindow/index.d.ts @@ -1,197 +1,194 @@ -import { vtkObject, vtkSubscription } from "../../../interfaces"; -import vtkRenderer from "../Renderer"; -import vtkRenderWindowInteractor from "../RenderWindowInteractor"; +import { vtkObject, vtkSubscription } from '../../../interfaces'; +import vtkRenderer from '../Renderer'; +import vtkRenderWindowInteractor from '../RenderWindowInteractor'; // import vtkOpenGLRenderWindow from "../../../OpenGL/RenderWindow"; -export interface IRenderWindowInitialValues { - renderers?: vtkRenderer[], - views?: vtkRenderWindow[], - interactor?: any, - neverRendered?: boolean, - numberOfLayers?: number - childRenderWindows?: vtkRenderWindow[], +export interface IRenderWindowInitialValues { + renderers?: vtkRenderer[]; + views?: vtkRenderWindow[]; + interactor?: any; + neverRendered?: boolean; + numberOfLayers?: number; + childRenderWindows?: vtkRenderWindow[]; } interface IStatistics { - - /** - * - */ - propCount: number; - - /** - * - */ - invisiblePropCount: number; - - /** - * - */ - str: string; + /** + * + */ + propCount: number; + + /** + * + */ + invisiblePropCount: number; + + /** + * + */ + str: string; } export const enum DEFAULT_VIEW_API { - 'WebGL', - 'WebGPU' + 'WebGL', + 'WebGPU', } export interface vtkRenderWindow extends vtkObject { - - /** - * Add renderer - * @param {vtkRenderer} renderer The vtkRenderer instance. - */ - addRenderer(renderer: vtkRenderer): void; - - /** - * Add a child render window - * @param {vtkRenderWindow} renderWindow The vtkRenderWindow instance. - */ - addRenderWindow(renderWindow: vtkRenderWindow): void; - - /** - * Add renderer - * @param view - */ - addView(view: any): void; - - /** - * - * @param {String} format - * @param {*} opts - */ - captureImages(format?: string, opts?: any): Promise[]; - - /** - * Switch the rendering backend between WebGL and WebGPU. - * By default, the WebGL backend is used. To switch, to WebGPU call - * `renderWindow.setDefaultViewAPI('WebGPU')` before calling `render`. - */ - getDefaultViewAPI(): string; - - /** - * - */ - getInteractor(): vtkRenderWindowInteractor; - - /** - * - */ - getNumberOfLayers(): number; - - /** - * - */ - getNeverRendered(): boolean; - - /** - * - */ - getRenderers(): vtkRenderer[]; - - /** - * - */ - getRenderersByReference(): vtkRenderer[]; - - /** - * - */ - getChildRenderWindows(): vtkRenderWindow[]; - - /** - * - */ - getChildRenderWindowsByReference(): vtkRenderWindow[]; - - /** - * - */ - getStatistics(): IStatistics; - - /** - * - */ - getViews(): any[]; - - // getViews(): vtkOpenGLRenderWindow[]; - - /** - * - * @param {vtkRenderer} ren - * @return {Boolean} true if the windows has a renderer - */ - hasRenderer(ren: vtkRenderer): boolean; - - /** - * - * @param view - */ - hasView(view: any): boolean; - - //hasView(view: vtkOpenGLRenderWindow): boolean; - - /** - * - * @param callback - */ - onCompletion(callback: (instance: vtkObject) => any): vtkSubscription; - - /** - * - * @param {String} name - * @param {} [initialValues] - */ - newAPISpecificView(name: string, initialValues?: object): any; - - /** - * Remove renderer - * @param {vtkRenderer} renderer The vtkRenderer instance. - */ - removeRenderer(renderer: vtkRenderer): void; - - /** - * Remove renderer - * @param view - */ - removeView(view: any): void; - - /** - * - */ - render(): void; - - /** - * Switch the rendering backend between WebGL and WebGPU. - * By default, the WebGL backend is used. To switch, to WebGPU call - * `renderWindow.setDefaultViewAPI('WebGPU')` before calling `render`. - * Must be called before `newAPISpecificView()` is called. - * @param defaultViewAPI (default: 'WebGL') - */ - setDefaultViewAPI(defaultViewAPI: DEFAULT_VIEW_API): boolean; - - /** - * - * @param interactor - */ - setInteractor(interactor: vtkRenderWindowInteractor): boolean; - - /** - * - * @param numberOfLayers - */ - setNumberOfLayers(numberOfLayers: number): boolean; - - /** - * - * @param views - */ - setViews(views: any[]): boolean; - - // setViews(views: vtkOpenGLRenderWindow[]): boolean; + /** + * Add renderer + * @param {vtkRenderer} renderer The vtkRenderer instance. + */ + addRenderer(renderer: vtkRenderer): void; + + /** + * Add a child render window + * @param {vtkRenderWindow} renderWindow The vtkRenderWindow instance. + */ + addRenderWindow(renderWindow: vtkRenderWindow): void; + + /** + * Add renderer + * @param view + */ + addView(view: any): void; + + /** + * + * @param {String} format + * @param {*} opts + */ + captureImages(format?: string, opts?: any): Promise[]; + + /** + * Switch the rendering backend between WebGL and WebGPU. + * By default, the WebGL backend is used. To switch, to WebGPU call + * `renderWindow.setDefaultViewAPI('WebGPU')` before calling `render`. + */ + getDefaultViewAPI(): string; + + /** + * + */ + getInteractor(): vtkRenderWindowInteractor; + + /** + * + */ + getNumberOfLayers(): number; + + /** + * + */ + getNeverRendered(): boolean; + + /** + * + */ + getRenderers(): vtkRenderer[]; + + /** + * + */ + getRenderersByReference(): vtkRenderer[]; + + /** + * + */ + getChildRenderWindows(): vtkRenderWindow[]; + + /** + * + */ + getChildRenderWindowsByReference(): vtkRenderWindow[]; + + /** + * + */ + getStatistics(): IStatistics; + + /** + * + */ + getViews(): any[]; + + // getViews(): vtkOpenGLRenderWindow[]; + + /** + * + * @param {vtkRenderer} ren + * @return {Boolean} true if the windows has a renderer + */ + hasRenderer(ren: vtkRenderer): boolean; + + /** + * + * @param view + */ + hasView(view: any): boolean; + + //hasView(view: vtkOpenGLRenderWindow): boolean; + + /** + * + * @param callback + */ + onCompletion(callback: (instance: vtkObject) => any): vtkSubscription; + + /** + * + * @param {String} name + * @param {} [initialValues] + */ + newAPISpecificView(name: string, initialValues?: object): any; + + /** + * Remove renderer + * @param {vtkRenderer} renderer The vtkRenderer instance. + */ + removeRenderer(renderer: vtkRenderer): void; + + /** + * Remove renderer + * @param view + */ + removeView(view: any): void; + + /** + * + */ + render(): void; + + /** + * Switch the rendering backend between WebGL and WebGPU. + * By default, the WebGL backend is used. To switch, to WebGPU call + * `renderWindow.setDefaultViewAPI('WebGPU')` before calling `render`. + * Must be called before `newAPISpecificView()` is called. + * @param defaultViewAPI (default: 'WebGL') + */ + setDefaultViewAPI(defaultViewAPI: DEFAULT_VIEW_API): boolean; + + /** + * + * @param interactor + */ + setInteractor(interactor: vtkRenderWindowInteractor): boolean; + + /** + * + * @param numberOfLayers + */ + setNumberOfLayers(numberOfLayers: number): boolean; + + /** + * + * @param views + */ + setViews(views: any[]): boolean; + + // setViews(views: vtkOpenGLRenderWindow[]): boolean; } - /** * Method use to decorate a given object (publicAPI+model) with vtkRenderWindow characteristics. * @@ -199,32 +196,37 @@ export interface vtkRenderWindow extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IRenderWindowInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IRenderWindowInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IRenderWindowInitialValues +): void; /** - * Method use to create a new instance of vtkRenderWindow + * Method use to create a new instance of vtkRenderWindow */ -export function newInstance(initialValues?: IRenderWindowInitialValues): vtkRenderWindow; +export function newInstance( + initialValues?: IRenderWindowInitialValues +): vtkRenderWindow; /** - * + * */ export function registerViewConstructor(name: string, constructor: any): void; /** - * + * */ export function listViewAPIs(): string[]; /** - * + * */ export function newAPISpecificView(name: string, initialValues: object): any; - /** * vtkRenderWindow is an abstract object to specify the behavior of a rendering window. - * + * * A rendering window is a window in a graphical user interface where renderers draw their images. * Methods are provided to synchronize the rendering process, set window size, and control double buffering. * The window also allows rendering in stereo. The interlaced render stereo type is for output to a VRex stereo projector. @@ -232,10 +234,10 @@ export function newAPISpecificView(name: string, initialValues: object): any; * The user has to make the render window aligned with the VRex projector, or the eye will be swapped. */ export declare const vtkRenderWindow: { - newInstance: typeof newInstance, - extend: typeof extend, - registerViewConstructor: typeof registerViewConstructor, - listViewAPIs: typeof listViewAPIs, - newAPISpecificView: typeof newAPISpecificView, + newInstance: typeof newInstance; + extend: typeof extend; + registerViewConstructor: typeof registerViewConstructor; + listViewAPIs: typeof listViewAPIs; + newAPISpecificView: typeof newAPISpecificView; }; export default vtkRenderWindow; diff --git a/Sources/Rendering/Core/RenderWindowInteractor/Constants.d.ts b/Sources/Rendering/Core/RenderWindowInteractor/Constants.d.ts index dae6b65896a..6f19929e73e 100644 --- a/Sources/Rendering/Core/RenderWindowInteractor/Constants.d.ts +++ b/Sources/Rendering/Core/RenderWindowInteractor/Constants.d.ts @@ -1,31 +1,31 @@ export declare enum Device { - Unknown = 0, - LeftController = 1, - RightController = 2, + Unknown = 0, + LeftController = 1, + RightController = 2, } export declare enum Input { - Unknown = 0, - Trigger = 1, - TrackPad = 2, - Grip = 3, - Thumbstick = 4, - A = 5, - B = 6, - ApplicationMenu = 7, // Not exposed in WebXR API + Unknown = 0, + Trigger = 1, + TrackPad = 2, + Grip = 3, + Thumbstick = 4, + A = 5, + B = 6, + ApplicationMenu = 7, // Not exposed in WebXR API } export declare enum Axis { - Unknown = 0, - TouchpadX = 1, - TouchpadY = 2, - ThumbstickX = 3, - ThumbstickY = 4, + Unknown = 0, + TouchpadX = 1, + TouchpadY = 2, + ThumbstickX = 3, + ThumbstickY = 4, } declare const _default: { - Device: typeof Device; - Input: typeof Input; - Axis: typeof Axis; + Device: typeof Device; + Input: typeof Input; + Axis: typeof Axis; }; export default _default; diff --git a/Sources/Rendering/Core/RenderWindowInteractor/index.d.ts b/Sources/Rendering/Core/RenderWindowInteractor/index.d.ts index 1cc8bb5a722..7405aec6717 100755 --- a/Sources/Rendering/Core/RenderWindowInteractor/index.d.ts +++ b/Sources/Rendering/Core/RenderWindowInteractor/index.d.ts @@ -1,1244 +1,1354 @@ -import { vtkObject, vtkSubscription } from "../../../interfaces"; -import { Nullable } from "../../../types"; -import vtkRenderer from "../Renderer"; -import { Axis, Device, Input } from "./Constants"; +import { vtkObject, vtkSubscription } from '../../../interfaces'; +import { Nullable } from '../../../types'; +import vtkRenderer from '../Renderer'; +import { Axis, Device, Input } from './Constants'; declare enum handledEvents { - 'StartAnimation', - 'Animation', - 'EndAnimation', - 'MouseEnter', - 'MouseLeave', - 'StartMouseMove', - 'MouseMove', - 'EndMouseMove', - 'LeftButtonPress', - 'LeftButtonRelease', - 'MiddleButtonPress', - 'MiddleButtonRelease', - 'RightButtonPress', - 'RightButtonRelease', - 'KeyPress', - 'KeyDown', - 'KeyUp', - 'StartMouseWheel', - 'MouseWheel', - 'EndMouseWheel', - 'StartPinch', - 'Pinch', - 'EndPinch', - 'StartPan', - 'Pan', - 'EndPan', - 'StartRotate', - 'Rotate', - 'EndRotate', - 'Button3D', - 'Move3D', - 'StartPointerLock', - 'EndPointerLock', - 'StartInteraction', - 'Interaction', - 'EndInteraction', - 'AnimationFrameRateUpdate', + 'StartAnimation', + 'Animation', + 'EndAnimation', + 'MouseEnter', + 'MouseLeave', + 'StartMouseMove', + 'MouseMove', + 'EndMouseMove', + 'LeftButtonPress', + 'LeftButtonRelease', + 'MiddleButtonPress', + 'MiddleButtonRelease', + 'RightButtonPress', + 'RightButtonRelease', + 'KeyPress', + 'KeyDown', + 'KeyUp', + 'StartMouseWheel', + 'MouseWheel', + 'EndMouseWheel', + 'StartPinch', + 'Pinch', + 'EndPinch', + 'StartPan', + 'Pan', + 'EndPan', + 'StartRotate', + 'Rotate', + 'EndRotate', + 'Button3D', + 'Move3D', + 'StartPointerLock', + 'EndPointerLock', + 'StartInteraction', + 'Interaction', + 'EndInteraction', + 'AnimationFrameRateUpdate', } /** * */ export interface IRenderWindowInteractorInitialValues { - initialized?: boolean; - enabled?: boolean; - enableRender?: boolean; - lightFollowCamera?: boolean; - desiredUpdateRate?: number; - stillUpdateRate?: number; - recognizeGestures?: boolean; - currentGesture?: string; - lastFrameTime?: number; - wheelTimeoutID?: number; - moveTimeoutID?: number; - preventDefaultOnPointerDown?: boolean; - preventDefaultOnPointerUp?: boolean; - mouseScrollDebounceByPass?: boolean; + initialized?: boolean; + enabled?: boolean; + enableRender?: boolean; + lightFollowCamera?: boolean; + desiredUpdateRate?: number; + stillUpdateRate?: number; + recognizeGestures?: boolean; + currentGesture?: string; + lastFrameTime?: number; + wheelTimeoutID?: number; + moveTimeoutID?: number; + preventDefaultOnPointerDown?: boolean; + preventDefaultOnPointerUp?: boolean; + mouseScrollDebounceByPass?: boolean; } interface IPosition { - type: string; + type: string; } -export type InteractorEventCallback = (e: IRenderWindowInteractorEvent) => void +export type InteractorEventCallback = (e: IRenderWindowInteractorEvent) => void; -export type InteractorEventType = "StartInteractionEvent" | "InteractionEvent" | "EndInteractionEvent" +export type InteractorEventType = + | 'StartInteractionEvent' + | 'InteractionEvent' + | 'EndInteractionEvent'; export interface IRenderWindowInteractorEvent { - altKey: boolean; - controlKey: boolean; - firstRenderer: vtkRenderer; - pokedRenderer: vtkRenderer; - position: { x: number; y: number; z: number }; - shiftKey: boolean; - type: InteractorEventType; + altKey: boolean; + controlKey: boolean; + firstRenderer: vtkRenderer; + pokedRenderer: vtkRenderer; + position: { x: number; y: number; z: number }; + shiftKey: boolean; + type: InteractorEventType; } export interface I3DEvent { - gamepad: Gamepad; - position: DOMPointReadOnly; - orientation: DOMPointReadOnly; - targetPosition: DOMPointReadOnly; - targetOrientation: DOMPointReadOnly; - device: Device; + gamepad: Gamepad; + position: DOMPointReadOnly; + orientation: DOMPointReadOnly; + targetPosition: DOMPointReadOnly; + targetOrientation: DOMPointReadOnly; + device: Device; } export interface IButton3DEvent extends I3DEvent { - pressed: boolean; - input: Input; + pressed: boolean; + input: Input; } export interface vtkRenderWindowInteractor extends vtkObject { - - /** - * - * @default false - */ - getInitialized(): boolean; - - /** - * - * @default null - */ - getContainer(): Nullable; - - /** - * - * @default false - */ - - getEnabled(): boolean; - - /** - * - * @default true - */ - getEnableRender(): boolean; - - /** - * - * @default null - */ - getInteractorStyle(): any; - - /** - * - * @default 0.1 - */ - getLastFrameTime(): number; - - /** - * - * @default null - */ - getView(): any; - - /** - * - * @default true - */ - getLightFollowCamera(): boolean; - - /** - * - */ - getPicker(): any; - - /** - * - * @default true - */ - getRecognizeGestures(): boolean; - - /** - * - * @default 30.0 - */ - getDesiredUpdateRate(): number; - - /** - * - * @default 2.0 - */ - getStillUpdateRate(): number; - - /** - * @default false - */ - getPreventDefaultOnPointerDown(): boolean; - - /** - * @default false - */ - getPreventDefaultOnPointerUp(): boolean; - - /** - * @default false - */ - getMouseScrollDebounceByPass(): boolean; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeStartAnimation(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeAnimation(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeEndAnimation(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokePointerEnter(callData: IRenderWindowInteractorEvent): void; - - /** - * - */ - invokePointerLeave(callData: IRenderWindowInteractorEvent): void; - - /** - * - */ - invokeMouseEnter(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeMouseLeave(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeStartMouseMove(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeMouseMove(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeEndMouseMove(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeLeftButtonPress(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeLeftButtonRelease(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeMiddleButtonPress(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeMiddleButtonRelease(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeRightButtonPress(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeRightButtonRelease(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeKeyPress(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeKeyDown(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeKeyUp(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeStartMouseWheel(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeMouseWheel(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeEndMouseWheel(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeStartPinch(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokePinch(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeEndPinch(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeStartPan(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokePan(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeEndPan(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeStartRotate(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeRotate(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeEndRotate(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeButton3D(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeMove3D(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeStartPointerLock(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeEndPointerLock(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeStartInteractionEvent(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeInteractionEvent(callData: IRenderWindowInteractorEvent): void; - - /** - * - * @param {IRenderWindowInteractorEvent} callData - */ - invokeEndInteractionEvent(callData: IRenderWindowInteractorEvent): void; - - /** - * - */ - invokeRenderEvent(): void; - - /** - * - * @param cb The callback to be called - */ - onStartAnimation(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onAnimation(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onEndAnimation(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onPointerEnter(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param cb The callback to be called - */ - onPointerLeave(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param cb The callback to be called - */ - onMouseEnter(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onMouseLeave(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onStartMouseMove(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onMouseMove(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onEndMouseMove(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onLeftButtonPress(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onLeftButtonRelease(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onMiddleButtonPress(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onMiddleButtonRelease(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onRightButtonPress(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onRightButtonRelease(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onKeyPress(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onKeyDown(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onKeyUp(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onStartMouseWheel(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onMouseWheel(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onEndMouseWheel(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onStartPinch(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onPinch(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onEndPinch(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onStartPan(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onPan(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onEndPan(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onStartRotate(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onRotate(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onEndRotate(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onButton3D(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onMove3D(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onStartPointerLock(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onEndPointerLock(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onStartInteractionEvent(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onInteractionEvent(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {InteractorEventCallback} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onEndInteractionEvent(cb: InteractorEventCallback, priority?: number): Readonly; - - /** - * - * @param {Function} cb The callback to be called. - * @param {Number} [priority] The priority of the event. - */ - onRenderEvent(cb: () => void, priority?: number): Readonly; - - /** - * - * @param args - */ - animationEvent(args: any): any; - - /** - * Triggers the 'Button3D' event. - * - * @param args - */ - button3DEvent(eventPayload: IButton3DEvent): void; - - /** - * - * @param args - */ - endAnimationEvent(args: any): any; - - /** - * - * @param args - */ - endInteractionEvent(args: any): any; - - /** - * - * @param args - */ - endMouseMoveEvent(args: any): any; - - /** - * - * @param args - */ - endMouseWheelEvent(args: any): any; - - /** - * - * @param args - */ - endPanEvent(args: any): any; - - /** - * - * @param args - */ - endPinchEvent(args: any): any; - - /** - * - * @param args - */ - endPointerLockEvent(args: any): any; - - /** - * - * @param args - */ - endRotateEvent(args: any): any; - - /** - * - * @param args - */ - interactionEvent(args: any): any; - - /** - * - * @param args - */ - keyDownEvent(args: any): any; - - /** - * - * @param args - */ - keyPressEvent(args: any): any; - - /** - * - * @param args - */ - keyUpEvent(args: any): any; - - /** - * - * @param args - */ - leftButtonPressEvent(args: any): any; - - /** - * - * @param args - */ - leftButtonReleaseEvent(args: any): any; - - /** - * - * @param args - */ - middleButtonPressEvent(args: any): any; - - /** - * - * @param args - */ - middleButtonReleaseEvent(args: any): any; - - /** - * - * @param args - */ - mouseEnterEvent(args: any): any; - - /** - * - * @param args - */ - mouseLeaveEvent(args: any): any; - - /** - * - * @param args - */ - mouseMoveEvent(args: any): any; - - /** - * - * @param args - */ - mouseWheelEvent(args: any): any; - - /** - * Triggers the 'Move3D' event. - * - * @param eventPayload - */ - move3DEvent(eventPayload: I3DEvent): void; - - /** - * - * @param args - */ - panEvent(args: any): any; - - /** - * - * @param args - */ - pinchEvent(args: any): any; - - /** - * - * @param args - */ - rightButtonPressEvent(args: any): any; - - /** - * - * @param args - */ - rightButtonReleaseEvent(args: any): any; - - /** - * - * @param args - */ - rotateEvent(args: any): any; - - /** - * Add an HTMLElement as the new container for the interactor. - * All events will be bound to this new container. - * Any old container will be removed along with its listeners. - */ - setContainer(container: Nullable): boolean; - - /** - * Turn on/off the automatic repositioning of lights as the camera moves. - * @param lightFollowCamera - */ - setLightFollowCamera(lightFollowCamera: boolean): boolean; - - /** - * Set the object used to perform pick operations. - * @param picker - */ - setPicker(picker: any): boolean; - - /** - * Set whether preventDefault is called on pointer down. - * @param {Boolean} preventDefault - */ - setPreventDefaultOnPointerDown(preventDefault: boolean): boolean; - - /** - * Set whether preventDefault is called on pointer up. - * - * If pointerup occurs without a preceeding pointerdown, then - * this does nothing. - * - * @param {Boolean} preventDefault - */ - setPreventDefaultOnPointerUp(preventDefault: boolean): boolean; - - /** - * Allow system to bypass scrolling debounce. This function must be called to allow the debounce to be bypassed - * @param mouseScrollDebounceByPass - */ - - setMouseScrollDebounceByPass(mouseScrollDebounceByPass:boolean): boolean; - - /** - * - * @param recognizeGestures - */ - setRecognizeGestures(recognizeGestures: boolean): boolean; - - /** - * Set the desired update rate. - * @param desiredUpdateRate - */ - setDesiredUpdateRate(desiredUpdateRate: number): boolean; - - /** - * Set the desired update rate when movement has stopped. - * @param stillUpdateRate - */ - setStillUpdateRate(stillUpdateRate: number): boolean; - - /** - * Start the event loop. - * This is provided so that you do not have to implement your own event loop. - * You still can use your own event loop if you want. - */ - start(): void; - - /** - * - * @param args - */ - startAnimationEvent(args: any): any; - - - /** - * - * @param args - */ - startInteractionEvent(args: any): any; - - - /** - * - * @param args - */ - startMouseMoveEvent(args: any): any; - - - /** - * - * @param args - */ - startMouseWheelEvent(args: any): any; - - - /** - * - * @param args - */ - startPanEvent(args: any): any; - - - /** - * - * @param args - */ - startPinchEvent(args: any): any; - - - /** - * - * @param args - */ - startPointerLockEvent(args: any): any; - - - /** - * - * @param args - */ - startRotateEvent(args: any): any; - - - /** - * Set/Get the rendering window being controlled by this object. - * @param aren - */ - setRenderWindow(aren: any): void; - - /** - * External switching between joystick/trackball/new? modes. - * @param style - */ - setInteractorStyle(style: any): void; - - /** - * --------------------------------------------------------------------- - */ - initialize(): void; - - /** - * Enable/Disable interactions. - * By default interactors are enabled when initialized. - * Initialize() must be called prior to enabling/disabling interaction. - * These methods are used when a window/widget is being shared by multiple renderers and interactors. - * This allows a "modal" display where one interactor is active when its data is to be displayed and all other interactors associated with the widget are disabled when their data is not displayed. - */ - enable(): void; - - /** - * - */ - disable(): void; - - /** - * - */ - startEventLoop(): void; - - /** - * - */ - getCurrentRenderer(): void; - - /** - * Manually sets the current renderer. - * @param {vtkRenderer} ren - */ - setCurrentRenderer(ren: vtkRenderer): void; - - /** - * - * @param container kept for backward compatibility. - * @deprecated please use vtkRenderWindowInteractor.setContainer(container: HTMLElement) - * which will also bind events. - */ - bindEvents(container: any): void; - - /** - * - * @deprecated please use vtkRenderWindowInteractor.setContainer(null) instead. - */ - unbindEvents(): void; - - /** - * - * @param {KeyboardEvent} event - */ - handleKeyPress(event: KeyboardEvent): void; - - /** - * - * @param {KeyboardEvent} event - */ - handleKeyDown(event: KeyboardEvent): void; - - /** - * - * @param {KeyboardEvent} event - */ - handleKeyUp(event: KeyboardEvent): void; - - /** - * - * @param {PointerEvent} event - */ - handlePointerDown(event: PointerEvent): void; - - /** - * - * @param {PointerEvent} event - */ - handlePointerUp(event: PointerEvent): void; - - /** - * - * @param {PointerEvent} event - */ - handlePointerCancel(event: PointerEvent): void; - - /** - * - * @param {PointerEvent} event - */ - handlePointerMove(event: PointerEvent): void; - - /** - * - * @param {PointerEvent} event - */ - handleMouseDown(event: PointerEvent): void; - - /** - * - */ - requestPointerLock(): void; - - /** - * - */ - exitPointerLock(): void; - - /** - * - */ - isPointerLocked(): boolean; - - /** - * - */ - handlePointerLockChange(): void; - - /** - * - * @param requestor - */ - requestAnimation(requestor: any): void; - - /** - * - */ - isAnimating(): boolean; - - /** - * - * @param requestor - * @param {Boolean} [skipWarning] - */ - cancelAnimation(requestor: any, skipWarning?: boolean): void; - - /** - * - */ - switchToVRAnimation(): void; - - /** - * - */ - returnFromVRAnimation(): void; - - /** - * - * @param {Number} displayId The ID of the display. - */ - updateGamepads(displayId: number): void; - - /** - * - * @param {PointerEvent} event - */ - handleMouseMove(event: PointerEvent): void; - - /** - * - */ - handleAnimation(): void; - - /** - * - * @param {MouseEvent} event - */ - handleWheel(event: MouseEvent): void; - - /** - * - * @param {PointerEvent} event - */ - handlePointerEnter(event: PointerEvent): void; - - /** - * - * @param {PointerEvent} event - */ - handlePointerLeave(event: PointerEvent): void; - - /** - * - * @param {PointerEvent} event - */ - handleMouseUp(event: PointerEvent): void; - - /** - * - * @param {PointerEvent} event - */ - handleTouchStart(event: PointerEvent): void; - - /** - * - * @param {PointerEvent} event - */ - handleTouchMove(event: PointerEvent): void; - - /** - * - * @param {PointerEvent} event - */ - handleTouchEnd(event: PointerEvent): void; - - /** - * - * @param val - */ - setView(val: any): void; - - /** - * @return first renderer to be used for camera manipulation - */ - getFirstRenderer(): vtkRenderer; - - /** - * - * @param {Number} x - * @param {Number} y - */ - findPokedRenderer(x: number, y: number): Nullable; - - /** - * only render if we are not animating. If we are animating - * then renders will happen naturally anyhow and we definitely - * do not want extra renders as the make the apparent interaction - * rate slower. - */ - render(): void; - - /** - * we know we are in multitouch now, so start recognizing - * @param event - * @param positions - */ - recognizeGesture(event: 'TouchStart' | 'TouchMove' | 'TouchEnd', positions: IPosition): void; - - /** - * - */ - handleVisibilityChange(): void; - - /** - * Stop animating if the renderWindowInteractor is deleted. - */ - delete(): void; + /** + * + * @default false + */ + getInitialized(): boolean; + + /** + * + * @default null + */ + getContainer(): Nullable; + + /** + * + * @default false + */ + + getEnabled(): boolean; + + /** + * + * @default true + */ + getEnableRender(): boolean; + + /** + * + * @default null + */ + getInteractorStyle(): any; + + /** + * + * @default 0.1 + */ + getLastFrameTime(): number; + + /** + * + * @default null + */ + getView(): any; + + /** + * + * @default true + */ + getLightFollowCamera(): boolean; + + /** + * + */ + getPicker(): any; + + /** + * + * @default true + */ + getRecognizeGestures(): boolean; + + /** + * + * @default 30.0 + */ + getDesiredUpdateRate(): number; + + /** + * + * @default 2.0 + */ + getStillUpdateRate(): number; + + /** + * @default false + */ + getPreventDefaultOnPointerDown(): boolean; + + /** + * @default false + */ + getPreventDefaultOnPointerUp(): boolean; + + /** + * @default false + */ + getMouseScrollDebounceByPass(): boolean; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeStartAnimation(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeAnimation(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeEndAnimation(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokePointerEnter(callData: IRenderWindowInteractorEvent): void; + + /** + * + */ + invokePointerLeave(callData: IRenderWindowInteractorEvent): void; + + /** + * + */ + invokeMouseEnter(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeMouseLeave(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeStartMouseMove(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeMouseMove(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeEndMouseMove(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeLeftButtonPress(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeLeftButtonRelease(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeMiddleButtonPress(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeMiddleButtonRelease(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeRightButtonPress(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeRightButtonRelease(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeKeyPress(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeKeyDown(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeKeyUp(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeStartMouseWheel(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeMouseWheel(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeEndMouseWheel(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeStartPinch(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokePinch(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeEndPinch(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeStartPan(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokePan(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeEndPan(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeStartRotate(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeRotate(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeEndRotate(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeButton3D(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeMove3D(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeStartPointerLock(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeEndPointerLock(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeStartInteractionEvent(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeInteractionEvent(callData: IRenderWindowInteractorEvent): void; + + /** + * + * @param {IRenderWindowInteractorEvent} callData + */ + invokeEndInteractionEvent(callData: IRenderWindowInteractorEvent): void; + + /** + * + */ + invokeRenderEvent(): void; + + /** + * + * @param cb The callback to be called + */ + onStartAnimation( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onAnimation( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onEndAnimation( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onPointerEnter( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param cb The callback to be called + */ + onPointerLeave( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param cb The callback to be called + */ + onMouseEnter( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onMouseLeave( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onStartMouseMove( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onMouseMove( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onEndMouseMove( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onLeftButtonPress( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onLeftButtonRelease( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onMiddleButtonPress( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onMiddleButtonRelease( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onRightButtonPress( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onRightButtonRelease( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onKeyPress( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onKeyDown( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onKeyUp( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onStartMouseWheel( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onMouseWheel( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onEndMouseWheel( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onStartPinch( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onPinch( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onEndPinch( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onStartPan( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onPan( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onEndPan( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onStartRotate( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onRotate( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onEndRotate( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onButton3D( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onMove3D( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onStartPointerLock( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onEndPointerLock( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onStartInteractionEvent( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onInteractionEvent( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {InteractorEventCallback} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onEndInteractionEvent( + cb: InteractorEventCallback, + priority?: number + ): Readonly; + + /** + * + * @param {Function} cb The callback to be called. + * @param {Number} [priority] The priority of the event. + */ + onRenderEvent(cb: () => void, priority?: number): Readonly; + + /** + * + * @param args + */ + animationEvent(args: any): any; + + /** + * Triggers the 'Button3D' event. + * + * @param args + */ + button3DEvent(eventPayload: IButton3DEvent): void; + + /** + * + * @param args + */ + endAnimationEvent(args: any): any; + + /** + * + * @param args + */ + endInteractionEvent(args: any): any; + + /** + * + * @param args + */ + endMouseMoveEvent(args: any): any; + + /** + * + * @param args + */ + endMouseWheelEvent(args: any): any; + + /** + * + * @param args + */ + endPanEvent(args: any): any; + + /** + * + * @param args + */ + endPinchEvent(args: any): any; + + /** + * + * @param args + */ + endPointerLockEvent(args: any): any; + + /** + * + * @param args + */ + endRotateEvent(args: any): any; + + /** + * + * @param args + */ + interactionEvent(args: any): any; + + /** + * + * @param args + */ + keyDownEvent(args: any): any; + + /** + * + * @param args + */ + keyPressEvent(args: any): any; + + /** + * + * @param args + */ + keyUpEvent(args: any): any; + + /** + * + * @param args + */ + leftButtonPressEvent(args: any): any; + + /** + * + * @param args + */ + leftButtonReleaseEvent(args: any): any; + + /** + * + * @param args + */ + middleButtonPressEvent(args: any): any; + + /** + * + * @param args + */ + middleButtonReleaseEvent(args: any): any; + + /** + * + * @param args + */ + mouseEnterEvent(args: any): any; + + /** + * + * @param args + */ + mouseLeaveEvent(args: any): any; + + /** + * + * @param args + */ + mouseMoveEvent(args: any): any; + + /** + * + * @param args + */ + mouseWheelEvent(args: any): any; + + /** + * Triggers the 'Move3D' event. + * + * @param eventPayload + */ + move3DEvent(eventPayload: I3DEvent): void; + + /** + * + * @param args + */ + panEvent(args: any): any; + + /** + * + * @param args + */ + pinchEvent(args: any): any; + + /** + * + * @param args + */ + rightButtonPressEvent(args: any): any; + + /** + * + * @param args + */ + rightButtonReleaseEvent(args: any): any; + + /** + * + * @param args + */ + rotateEvent(args: any): any; + + /** + * Add an HTMLElement as the new container for the interactor. + * All events will be bound to this new container. + * Any old container will be removed along with its listeners. + */ + setContainer(container: Nullable): boolean; + + /** + * Turn on/off the automatic repositioning of lights as the camera moves. + * @param lightFollowCamera + */ + setLightFollowCamera(lightFollowCamera: boolean): boolean; + + /** + * Set the object used to perform pick operations. + * @param picker + */ + setPicker(picker: any): boolean; + + /** + * Set whether preventDefault is called on pointer down. + * @param {Boolean} preventDefault + */ + setPreventDefaultOnPointerDown(preventDefault: boolean): boolean; + + /** + * Set whether preventDefault is called on pointer up. + * + * If pointerup occurs without a preceeding pointerdown, then + * this does nothing. + * + * @param {Boolean} preventDefault + */ + setPreventDefaultOnPointerUp(preventDefault: boolean): boolean; + + /** + * Allow system to bypass scrolling debounce. This function must be called to allow the debounce to be bypassed + * @param mouseScrollDebounceByPass + */ + + setMouseScrollDebounceByPass(mouseScrollDebounceByPass: boolean): boolean; + + /** + * + * @param recognizeGestures + */ + setRecognizeGestures(recognizeGestures: boolean): boolean; + + /** + * Set the desired update rate. + * @param desiredUpdateRate + */ + setDesiredUpdateRate(desiredUpdateRate: number): boolean; + + /** + * Set the desired update rate when movement has stopped. + * @param stillUpdateRate + */ + setStillUpdateRate(stillUpdateRate: number): boolean; + + /** + * Start the event loop. + * This is provided so that you do not have to implement your own event loop. + * You still can use your own event loop if you want. + */ + start(): void; + + /** + * + * @param args + */ + startAnimationEvent(args: any): any; + + /** + * + * @param args + */ + startInteractionEvent(args: any): any; + + /** + * + * @param args + */ + startMouseMoveEvent(args: any): any; + + /** + * + * @param args + */ + startMouseWheelEvent(args: any): any; + + /** + * + * @param args + */ + startPanEvent(args: any): any; + + /** + * + * @param args + */ + startPinchEvent(args: any): any; + + /** + * + * @param args + */ + startPointerLockEvent(args: any): any; + + /** + * + * @param args + */ + startRotateEvent(args: any): any; + + /** + * Set/Get the rendering window being controlled by this object. + * @param aren + */ + setRenderWindow(aren: any): void; + + /** + * External switching between joystick/trackball/new? modes. + * @param style + */ + setInteractorStyle(style: any): void; + + /** + * --------------------------------------------------------------------- + */ + initialize(): void; + + /** + * Enable/Disable interactions. + * By default interactors are enabled when initialized. + * Initialize() must be called prior to enabling/disabling interaction. + * These methods are used when a window/widget is being shared by multiple renderers and interactors. + * This allows a "modal" display where one interactor is active when its data is to be displayed and all other interactors associated with the widget are disabled when their data is not displayed. + */ + enable(): void; + + /** + * + */ + disable(): void; + + /** + * + */ + startEventLoop(): void; + + /** + * + */ + getCurrentRenderer(): void; + + /** + * Manually sets the current renderer. + * @param {vtkRenderer} ren + */ + setCurrentRenderer(ren: vtkRenderer): void; + + /** + * + * @param container kept for backward compatibility. + * @deprecated please use vtkRenderWindowInteractor.setContainer(container: HTMLElement) + * which will also bind events. + */ + bindEvents(container: any): void; + + /** + * + * @deprecated please use vtkRenderWindowInteractor.setContainer(null) instead. + */ + unbindEvents(): void; + + /** + * + * @param {KeyboardEvent} event + */ + handleKeyPress(event: KeyboardEvent): void; + + /** + * + * @param {KeyboardEvent} event + */ + handleKeyDown(event: KeyboardEvent): void; + + /** + * + * @param {KeyboardEvent} event + */ + handleKeyUp(event: KeyboardEvent): void; + + /** + * + * @param {PointerEvent} event + */ + handlePointerDown(event: PointerEvent): void; + + /** + * + * @param {PointerEvent} event + */ + handlePointerUp(event: PointerEvent): void; + + /** + * + * @param {PointerEvent} event + */ + handlePointerCancel(event: PointerEvent): void; + + /** + * + * @param {PointerEvent} event + */ + handlePointerMove(event: PointerEvent): void; + + /** + * + * @param {PointerEvent} event + */ + handleMouseDown(event: PointerEvent): void; + + /** + * + */ + requestPointerLock(): void; + + /** + * + */ + exitPointerLock(): void; + + /** + * + */ + isPointerLocked(): boolean; + + /** + * + */ + handlePointerLockChange(): void; + + /** + * + * @param requestor + */ + requestAnimation(requestor: any): void; + + /** + * + */ + isAnimating(): boolean; + + /** + * + * @param requestor + * @param {Boolean} [skipWarning] + */ + cancelAnimation(requestor: any, skipWarning?: boolean): void; + + /** + * + */ + switchToVRAnimation(): void; + + /** + * + */ + returnFromVRAnimation(): void; + + /** + * + * @param {Number} displayId The ID of the display. + */ + updateGamepads(displayId: number): void; + + /** + * + * @param {PointerEvent} event + */ + handleMouseMove(event: PointerEvent): void; + + /** + * + */ + handleAnimation(): void; + + /** + * + * @param {MouseEvent} event + */ + handleWheel(event: MouseEvent): void; + + /** + * + * @param {PointerEvent} event + */ + handlePointerEnter(event: PointerEvent): void; + + /** + * + * @param {PointerEvent} event + */ + handlePointerLeave(event: PointerEvent): void; + + /** + * + * @param {PointerEvent} event + */ + handleMouseUp(event: PointerEvent): void; + + /** + * + * @param {PointerEvent} event + */ + handleTouchStart(event: PointerEvent): void; + + /** + * + * @param {PointerEvent} event + */ + handleTouchMove(event: PointerEvent): void; + + /** + * + * @param {PointerEvent} event + */ + handleTouchEnd(event: PointerEvent): void; + + /** + * + * @param val + */ + setView(val: any): void; + + /** + * @return first renderer to be used for camera manipulation + */ + getFirstRenderer(): vtkRenderer; + + /** + * + * @param {Number} x + * @param {Number} y + */ + findPokedRenderer(x: number, y: number): Nullable; + + /** + * only render if we are not animating. If we are animating + * then renders will happen naturally anyhow and we definitely + * do not want extra renders as the make the apparent interaction + * rate slower. + */ + render(): void; + + /** + * we know we are in multitouch now, so start recognizing + * @param event + * @param positions + */ + recognizeGesture( + event: 'TouchStart' | 'TouchMove' | 'TouchEnd', + positions: IPosition + ): void; + + /** + * + */ + handleVisibilityChange(): void; + + /** + * Stop animating if the renderWindowInteractor is deleted. + */ + delete(): void; } - /** * Method use to decorate a given object (publicAPI+model) with vtkRenderWindowInteractor characteristics. * @@ -1246,12 +1356,18 @@ export interface vtkRenderWindowInteractor extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IRenderWindowInteractorInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IRenderWindowInteractorInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IRenderWindowInteractorInitialValues +): void; /** * Method use to create a new instance of vtkRenderWindowInteractor */ -export function newInstance(initialValues?: IRenderWindowInteractorInitialValues): vtkRenderWindowInteractor; +export function newInstance( + initialValues?: IRenderWindowInteractorInitialValues +): vtkRenderWindowInteractor; /** * vtkRenderWindowInteractor provides an interaction mechanism for @@ -1267,7 +1383,7 @@ export function newInstance(initialValues?: IRenderWindowInteractorInitialValues * Initialize/Start/Enable/Disable. * * ## Caveats - * + * * vtkRenderWindowInteractor routes events through VTK’s command/observer design * pattern. That is, when vtkRenderWindowInteractor (actually, one of its * subclasses) sees an event, it translates it into a VTK event using the @@ -1275,11 +1391,11 @@ export function newInstance(initialValues?: IRenderWindowInteractorInitialValues * that event are expected to respond appropriately. */ export declare const vtkRenderWindowInteractor: { - newInstance: typeof newInstance; - extend: typeof extend; - handledEvents: typeof handledEvents; - Device: typeof Device; - Input: typeof Input; - Axis: typeof Axis; + newInstance: typeof newInstance; + extend: typeof extend; + handledEvents: typeof handledEvents; + Device: typeof Device; + Input: typeof Input; + Axis: typeof Axis; }; export default vtkRenderWindowInteractor; diff --git a/Sources/Rendering/Core/Renderer/index.d.ts b/Sources/Rendering/Core/Renderer/index.d.ts index 3cbbf376697..45248ffdb91 100755 --- a/Sources/Rendering/Core/Renderer/index.d.ts +++ b/Sources/Rendering/Core/Renderer/index.d.ts @@ -9,670 +9,678 @@ import vtkVolume from '../Volume'; import vtkTexture from '../Texture'; import { EventHandler, vtkSubscription } from '../../../interfaces'; - export interface IRendererInitialValues extends IViewportInitialValues { - allBounds?: Bounds[]; - ambient?: number[]; - allocatedRenderTime?: number; - timeFactor?: number; - automaticLightCreation?: boolean; - twoSidedLighting?: boolean; - lastRenderTimeInSeconds?: number; - lights?: vtkLight[]; - actors?: vtkProp[]; - volumes?: vtkVolume[]; - lightFollowCamera?: boolean; - numberOfPropsRendered?: number; - layer?: number; - preserveColorBuffer?: boolean; - preserveDepthBuffer?: boolean; - interactive?: boolean; - nearClippingPlaneTolerance?: number; - clippingRangeExpansion?: number; - erase?: boolean; - draw?: boolean; - useShadows?: boolean; - useDepthPeeling?: boolean; - occlusionRatio?: number; - maximumNumberOfPeels?: number; - texturedBackground?: boolean; - environmentTexture?: vtkTexture; - environmentTextureDiffuseStrength?: number; - environmentTextureSpecularStrength?: number; - useEnvironmentTextureAsBackground?: boolean; - pass?: number; + allBounds?: Bounds[]; + ambient?: number[]; + allocatedRenderTime?: number; + timeFactor?: number; + automaticLightCreation?: boolean; + twoSidedLighting?: boolean; + lastRenderTimeInSeconds?: number; + lights?: vtkLight[]; + actors?: vtkProp[]; + volumes?: vtkVolume[]; + lightFollowCamera?: boolean; + numberOfPropsRendered?: number; + layer?: number; + preserveColorBuffer?: boolean; + preserveDepthBuffer?: boolean; + interactive?: boolean; + nearClippingPlaneTolerance?: number; + clippingRangeExpansion?: number; + erase?: boolean; + draw?: boolean; + useShadows?: boolean; + useDepthPeeling?: boolean; + occlusionRatio?: number; + maximumNumberOfPeels?: number; + texturedBackground?: boolean; + environmentTexture?: vtkTexture; + environmentTextureDiffuseStrength?: number; + environmentTextureSpecularStrength?: number; + useEnvironmentTextureAsBackground?: boolean; + pass?: number; } export type VtkRendererEvent = - | { type: 'CreateCameraEvent', camera: vtkCamera } - | { type: 'ActiveCameraEvent', camera: vtkCamera } - | { type: 'ComputeVisiblePropBoundsEvent', renderer: vtkRenderer } - | { type: 'ResetCameraClippingRangeEvent', renderer: vtkRenderer } - | { type: 'ResetCameraEvent', renderer: vtkRenderer }; + | { type: 'CreateCameraEvent'; camera: vtkCamera } + | { type: 'ActiveCameraEvent'; camera: vtkCamera } + | { type: 'ComputeVisiblePropBoundsEvent'; renderer: vtkRenderer } + | { type: 'ResetCameraClippingRangeEvent'; renderer: vtkRenderer } + | { type: 'ResetCameraEvent'; renderer: vtkRenderer }; export interface vtkRenderer extends vtkViewport { - - /** - * - */ - isActiveCameraCreated(): boolean; - - /** - * Add different types of props to the renderer. - * @param {vtkProp} actor The vtkProp instance. - */ - addActor(actor: vtkProp): boolean; - - /** - * Check if the renderer already has the specified light. - * @param {vtkLight} light The vtkLight instance. - */ - hasLight(light: vtkLight): boolean; - - /** - * Add a light to the list of lights. - * @param {vtkLight} light The vtkLight instance. - */ - addLight(light: vtkLight): void; - - /** - * Not Implemented yet - */ - allocateTime(): any; - - /** - * Add a volume to the renderer.. - * @param volume The vtkVolume instance. - */ - addVolume(volume: vtkVolume): boolean; - - /** - * Create and add a light to renderer. - */ - createLight(): void; - - /** - * Compute the bounding box of all the visible props Used in ResetCamera() and ResetCameraClippingRange() - */ - computeVisiblePropBounds(): Bounds; - - /** - * Get the active camera - */ - getActiveCamera(): vtkCamera; - - /** - * - */ - getActiveCameraAndResetIfCreated(): vtkCamera; - - /** - * Return any actors in this renderer. - * - */ - getActors(): vtkProp[]; - - /** - * Return any actors in this renderer. - * - */ - getActorsByReference(): vtkProp[]; - - /** - * - * @default 100 - */ - getAllocatedRenderTime(): number; - - /** - * - */ - getAutomaticLightCreation(): boolean; - - /** - * - * @default null - */ - getEnvironmentTexture(): vtkTexture; - - /** - * Returns the diffuse strength of the set environment texture. - * @default 1 - */ - getEnvironmentTextureDiffuseStrength(): number; - - /** - * Returns the specular strength of the set environment texture. - * @default 1 - */ - getEnvironmentTextureSpecularStrength(): number; - - /** - * Gets whether or not the environment texture is being used as the background for the view. - * @default false - */ - getUseEnvironmentTextureAsBackground(): boolean; - - /** - * - * @default null - */ - getBackingStore(): any; - - /** - * - */ - getClippingRangeExpansion(): number; - - /** - * - * @default null - */ - getDelegate(): any; - - /** - * - * @default true - */ - getDraw(): boolean; - - /** - * - * @default true - */ - getErase(): boolean; - - /** - * - * @default true - */ - getInteractive(): boolean; - - /** - * - * @default -1 - */ - getLastRenderTimeInSeconds(): number; - - /** - * - * @default 0 - */ - getNumberOfPropsRendered(): number; - - /** - * - * @default - */ - getLastRenderingUsedDepthPeeling(): any - - /** - * - * @default 0 - */ - getLayer(): number; - - /** - * - * @default true - */ - getLightFollowCamera(): boolean; - - /** - * - */ - getLights(): vtkLight[]; - - /** - * - */ - getLightsByReference(): vtkLight[]; - - /** - * - * @default 4 - */ - getMaximumNumberOfPeels(): number; - - /** - * Return the `Modified Time` which is a monotonic increasing integer - * global for all vtkObjects. - * - * This allow to solve a question such as: - * - Is that object created/modified after another one? - * - Do I need to re-execute this filter, or not? ... - * - * @return {Number} the global modified time. - */ - getMTime(): number; - - /** - * - * @default 0 - */ - getNearClippingPlaneTolerance(): number; - - /** - * - * @default 0 - */ - getOcclusionRatio(): number; - - /** - * - * @default null - */ - getRenderWindow(): Nullable; - - /** - * - * @default 0 - */ - getPass(): number; - - /** - * - * @default false - */ - getPreserveColorBuffer(): boolean; - - /** - * - * @default false - */ - getPreserveDepthBuffer(): boolean; - - /** - * - * @default null - */ - getSelector(): any; - - /** - * - * @default 1 - */ - getTimeFactor(): number; - - /** - * - * @default true - */ - getTransparent(): boolean; - - /** - * - * @default false - */ - getTexturedbackground(): boolean; - - /** - * - * @default true - */ - getTwosidedlighting(): boolean; - - /** - * - * @default false - */ - getUsedepthpeeling(): boolean; - - /** - * - * @default false - */ - getUseshadows(): boolean; - - /** - * - */ - getVTKWindow(): vtkRenderWindow; - - /** - * Return the collection of volumes. - * - */ - getVolumes(): vtkVolume[]; - - /** - * Return the collection of volumes. - * - */ - getVolumesByReference(): vtkVolume[]; - - /** - * Create a new Camera suitable for use with this type of Renderer. - */ - makeCamera(): vtkCamera; - - /** - * Create a new Light suitable for use with this type of Renderer. - */ - makeLight(): vtkLight; - - /** - * requires the aspect ratio of the viewport as X/Y - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - * @param {Number} aspect - */ - normalizedDisplayToWorld(x: number, y: number, z: number, aspect: number): number[]; - - /** - * - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - * @param {Number} aspect - */ - projectionToView(x: number, y: number, z: number, aspect: number): number[]; - - /** - * Specify the camera to use for this renderer. - * @param {vtkCamera} camera The camera object to use. - */ - setActiveCamera(camera: vtkCamera): boolean; - - /** - * - * @param {Boolean} automaticLightCreation - */ - setAutomaticLightCreation(automaticLightCreation: boolean): boolean; - - /** - * - * @param {vtkTexture} environmentTexture - */ - setEnvironmentTexture(environmentTexture: vtkTexture): boolean; - - /** - * Sets the diffuse strength of the set environment texture. - * @param {number} diffuseStrength the new diffuse strength. - */ - setEnvironmentTextureDiffuseStrength(diffuseStrength: number): boolean; - - /** - * Sets the specular strength of the set environment texture. - * @param {number} specularStrength the new specular strength. - */ - setEnvironmentTextureSpecularStrength(specularStrength: number): boolean; - - /** - * Sets whether or not to use the environment texture as the background for the view. - * @param {number} textureAsBackground - */ - setUseEnvironmentTextureAsBackground(textureAsBackground: boolean): boolean; - - /** - * - * @param {*} backingStore - */ - setBackingStore(backingStore: any): boolean; - - /** - * - * @param {Number} clippingRangeExpansion - */ - setClippingRangeExpansion(clippingRangeExpansion: number): boolean; - - /** - * - * @param delegate - */ - setDelegate(delegate: any): boolean; - - /** - * - * @param {Boolean} draw - */ - setDraw(draw: boolean): boolean; - - /** - * - * @param {Boolean} erase - */ - setErase(erase: boolean): boolean; - - /** - * - * @param {Boolean} interactive - */ - setInteractive(interactive: boolean): boolean; - - /** - * - * @param {Number} layer - */ - setLayer(layer: number): void; - - /** - * Set the collection of lights. - * @param {vtkLight[]} lights - */ - setLightCollection(lights: vtkLight[]): void; - - /** - * - * @param {Boolean} lightFollowCamera - */ - setLightFollowCamera(lightFollowCamera: boolean): boolean; - - /** - * - * @param {Number} maximumNumberOfPeels - */ - setMaximumNumberOfPeels(maximumNumberOfPeels: number): boolean; - - /** - * - * @param {Number} nearClippingPlaneTolerance - */ - setNearClippingPlaneTolerance(nearClippingPlaneTolerance: number): boolean; - - /** - * - * @param {Number} occlusionRatio - */ - setOcclusionRatio(occlusionRatio: number): boolean; - - /** - * - * @param {Number} pass - */ - setPass(pass: number): boolean; - - /** - * - * @param {Boolean} preserveColorBuffer - */ - setPreserveColorBuffer(preserveColorBuffer: boolean): boolean; - - /** - * - * @param {Boolean} preserveDepthBuffer - */ - setPreserveDepthBuffer(preserveDepthBuffer: boolean): boolean; - - /** - * - * @param {Boolean} texturedBackground - */ - setTexturedBackground(texturedBackground: boolean): boolean; - - /** - * - * @param {Boolean} twoSidedLighting - */ - setTwoSidedLighting(twoSidedLighting: boolean): boolean; - - /** - * - * @param {Boolean} useDepthPeeling - */ - setUseDepthPeeling(useDepthPeeling: boolean): boolean; - - /** - * - * @param {Boolean} useShadows - */ - setUseShadows(useShadows: boolean): boolean; - - /** - * Specify the rendering window in which to draw. - * @param {vtkRenderWindow} renderWindow - */ - setRenderWindow(renderWindow: vtkRenderWindow): void; - - /** - * Remove an actor from the list of actors. - * @param {vtkProp} actor - */ - removeActor(actor: vtkProp): void; - - /** - * Remove all actors from the list of actors. - */ - removeAllActors(): void; - - /** - * Remove a volume from the list of volumes. - * @param {vtkVolume} volume The volume object to remove. - */ - removeVolume(volume: vtkVolume): void; - - /** - * Remove all volumes from the list of volumes. - */ - removeAllVolumes(): void; - - /** - * Remove a light from the list of lights. - * @param {vtkLight} light The light object to remove. - */ - removeLight(light: vtkLight): void; - - /** - * Remove all lights from the list of lights. - */ - removeAllLights(): void; - - /** - * requires the aspect ratio of the viewport as X/Y - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - * @param {Number} aspect - */ - worldToNormalizedDisplay(x: number, y: number, z: number, aspect: number): number[]; - - /** - * requires the aspect ratio of the viewport as X/Y - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - viewToWorld(x: number, y: number, z: number): number[]; - - /** - * Convert world point coordinates to view coordinates. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - worldToView(x: number, y: number, z: number): number[]; - - /** - * Convert world point coordinates to view coordinates. - * requires the aspect ratio of the viewport as X/Y - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - * @param {Number} aspect - */ - viewToProjection(x: number, y: number, z: number, aspect: number): number[]; - - /** - * Automatically set up the camera based on the visible actors. - * - * The camera will reposition itself to view the center point of the actors, - * and move along its initial view plane normal (i.e., vector defined from - * camera position to focal point) so that all of the actors can be seen. - * @param {Bounds} [bounds] - */ - resetCamera(bounds?: Bounds): boolean; - - /** - * Reset the camera clipping range based on a bounding box. - * @param {Bounds} [bounds] - */ - resetCameraClippingRange(bounds?: Bounds): boolean; - - /** - * Get the number of visible actors. - */ - visibleActorCount(): number; - - /** - * Not Implemented yet - */ - updateGeometry(): any; - - /** - * Ask the active camera to do whatever it needs to do prior to rendering. - */ - updateCamera(): boolean; - - /** - * Ask the lights in the scene that are not in world space - * (for instance, Headlights or CameraLights that are attached to the - * camera) to update their geometry to match the active camera. - */ - updateLightsGeometryToFollowCamera(): void; - - /** - * Update the geometry of the lights in the scene that are not in world - * space (for instance, Headlights or CameraLights that are attached to the - * camera). - */ - updateLightGeometry(): boolean; - - /** - * Not Implemented yet - */ - visibleVolumeCount(): any; - - /** - * Set the viewport background. - * - * @param {Number} r Defines the red component (between 0 and 1). - * @param {Number} g Defines the green component (between 0 and 1). - * @param {Number} b Defines the blue component (between 0 and 1). - * @param {Number} a Defines the alpha component (between 0 and 1). - */ - setBackground(r: number, g: number, b: number, a: number): boolean; - - /** - * Set the viewport background. - * - * @param {Number} r Defines the red component (between 0 and 1). - * @param {Number} g Defines the green component (between 0 and 1). - * @param {Number} b Defines the blue component (between 0 and 1). - */ - setBackground(r: number, g: number, b: number): boolean; - - /** - * Set the viewport background. - * - * @param {Number[]} background The RGB color array. - */ - setBackground(background: number[]): boolean; - - /** - * Adds an event listener. - */ - onEvent(cb: EventHandler, priority?: number): Readonly; + /** + * + */ + isActiveCameraCreated(): boolean; + + /** + * Add different types of props to the renderer. + * @param {vtkProp} actor The vtkProp instance. + */ + addActor(actor: vtkProp): boolean; + + /** + * Check if the renderer already has the specified light. + * @param {vtkLight} light The vtkLight instance. + */ + hasLight(light: vtkLight): boolean; + + /** + * Add a light to the list of lights. + * @param {vtkLight} light The vtkLight instance. + */ + addLight(light: vtkLight): void; + + /** + * Not Implemented yet + */ + allocateTime(): any; + + /** + * Add a volume to the renderer.. + * @param volume The vtkVolume instance. + */ + addVolume(volume: vtkVolume): boolean; + + /** + * Create and add a light to renderer. + */ + createLight(): void; + + /** + * Compute the bounding box of all the visible props Used in ResetCamera() and ResetCameraClippingRange() + */ + computeVisiblePropBounds(): Bounds; + + /** + * Get the active camera + */ + getActiveCamera(): vtkCamera; + + /** + * + */ + getActiveCameraAndResetIfCreated(): vtkCamera; + + /** + * Return any actors in this renderer. + * + */ + getActors(): vtkProp[]; + + /** + * Return any actors in this renderer. + * + */ + getActorsByReference(): vtkProp[]; + + /** + * + * @default 100 + */ + getAllocatedRenderTime(): number; + + /** + * + */ + getAutomaticLightCreation(): boolean; + + /** + * + * @default null + */ + getEnvironmentTexture(): vtkTexture; + + /** + * Returns the diffuse strength of the set environment texture. + * @default 1 + */ + getEnvironmentTextureDiffuseStrength(): number; + + /** + * Returns the specular strength of the set environment texture. + * @default 1 + */ + getEnvironmentTextureSpecularStrength(): number; + + /** + * Gets whether or not the environment texture is being used as the background for the view. + * @default false + */ + getUseEnvironmentTextureAsBackground(): boolean; + + /** + * + * @default null + */ + getBackingStore(): any; + + /** + * + */ + getClippingRangeExpansion(): number; + + /** + * + * @default null + */ + getDelegate(): any; + + /** + * + * @default true + */ + getDraw(): boolean; + + /** + * + * @default true + */ + getErase(): boolean; + + /** + * + * @default true + */ + getInteractive(): boolean; + + /** + * + * @default -1 + */ + getLastRenderTimeInSeconds(): number; + + /** + * + * @default 0 + */ + getNumberOfPropsRendered(): number; + + /** + * + * @default + */ + getLastRenderingUsedDepthPeeling(): any; + + /** + * + * @default 0 + */ + getLayer(): number; + + /** + * + * @default true + */ + getLightFollowCamera(): boolean; + + /** + * + */ + getLights(): vtkLight[]; + + /** + * + */ + getLightsByReference(): vtkLight[]; + + /** + * + * @default 4 + */ + getMaximumNumberOfPeels(): number; + + /** + * Return the `Modified Time` which is a monotonic increasing integer + * global for all vtkObjects. + * + * This allow to solve a question such as: + * - Is that object created/modified after another one? + * - Do I need to re-execute this filter, or not? ... + * + * @return {Number} the global modified time. + */ + getMTime(): number; + + /** + * + * @default 0 + */ + getNearClippingPlaneTolerance(): number; + + /** + * + * @default 0 + */ + getOcclusionRatio(): number; + + /** + * + * @default null + */ + getRenderWindow(): Nullable; + + /** + * + * @default 0 + */ + getPass(): number; + + /** + * + * @default false + */ + getPreserveColorBuffer(): boolean; + + /** + * + * @default false + */ + getPreserveDepthBuffer(): boolean; + + /** + * + * @default null + */ + getSelector(): any; + + /** + * + * @default 1 + */ + getTimeFactor(): number; + + /** + * + * @default true + */ + getTransparent(): boolean; + + /** + * + * @default false + */ + getTexturedbackground(): boolean; + + /** + * + * @default true + */ + getTwosidedlighting(): boolean; + + /** + * + * @default false + */ + getUsedepthpeeling(): boolean; + + /** + * + * @default false + */ + getUseshadows(): boolean; + + /** + * + */ + getVTKWindow(): vtkRenderWindow; + + /** + * Return the collection of volumes. + * + */ + getVolumes(): vtkVolume[]; + + /** + * Return the collection of volumes. + * + */ + getVolumesByReference(): vtkVolume[]; + + /** + * Create a new Camera suitable for use with this type of Renderer. + */ + makeCamera(): vtkCamera; + + /** + * Create a new Light suitable for use with this type of Renderer. + */ + makeLight(): vtkLight; + + /** + * requires the aspect ratio of the viewport as X/Y + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + * @param {Number} aspect + */ + normalizedDisplayToWorld( + x: number, + y: number, + z: number, + aspect: number + ): number[]; + + /** + * + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + * @param {Number} aspect + */ + projectionToView(x: number, y: number, z: number, aspect: number): number[]; + + /** + * Specify the camera to use for this renderer. + * @param {vtkCamera} camera The camera object to use. + */ + setActiveCamera(camera: vtkCamera): boolean; + + /** + * + * @param {Boolean} automaticLightCreation + */ + setAutomaticLightCreation(automaticLightCreation: boolean): boolean; + + /** + * + * @param {vtkTexture} environmentTexture + */ + setEnvironmentTexture(environmentTexture: vtkTexture): boolean; + + /** + * Sets the diffuse strength of the set environment texture. + * @param {number} diffuseStrength the new diffuse strength. + */ + setEnvironmentTextureDiffuseStrength(diffuseStrength: number): boolean; + + /** + * Sets the specular strength of the set environment texture. + * @param {number} specularStrength the new specular strength. + */ + setEnvironmentTextureSpecularStrength(specularStrength: number): boolean; + + /** + * Sets whether or not to use the environment texture as the background for the view. + * @param {number} textureAsBackground + */ + setUseEnvironmentTextureAsBackground(textureAsBackground: boolean): boolean; + + /** + * + * @param {*} backingStore + */ + setBackingStore(backingStore: any): boolean; + + /** + * + * @param {Number} clippingRangeExpansion + */ + setClippingRangeExpansion(clippingRangeExpansion: number): boolean; + + /** + * + * @param delegate + */ + setDelegate(delegate: any): boolean; + + /** + * + * @param {Boolean} draw + */ + setDraw(draw: boolean): boolean; + + /** + * + * @param {Boolean} erase + */ + setErase(erase: boolean): boolean; + + /** + * + * @param {Boolean} interactive + */ + setInteractive(interactive: boolean): boolean; + + /** + * + * @param {Number} layer + */ + setLayer(layer: number): void; + + /** + * Set the collection of lights. + * @param {vtkLight[]} lights + */ + setLightCollection(lights: vtkLight[]): void; + + /** + * + * @param {Boolean} lightFollowCamera + */ + setLightFollowCamera(lightFollowCamera: boolean): boolean; + + /** + * + * @param {Number} maximumNumberOfPeels + */ + setMaximumNumberOfPeels(maximumNumberOfPeels: number): boolean; + + /** + * + * @param {Number} nearClippingPlaneTolerance + */ + setNearClippingPlaneTolerance(nearClippingPlaneTolerance: number): boolean; + + /** + * + * @param {Number} occlusionRatio + */ + setOcclusionRatio(occlusionRatio: number): boolean; + + /** + * + * @param {Number} pass + */ + setPass(pass: number): boolean; + + /** + * + * @param {Boolean} preserveColorBuffer + */ + setPreserveColorBuffer(preserveColorBuffer: boolean): boolean; + + /** + * + * @param {Boolean} preserveDepthBuffer + */ + setPreserveDepthBuffer(preserveDepthBuffer: boolean): boolean; + + /** + * + * @param {Boolean} texturedBackground + */ + setTexturedBackground(texturedBackground: boolean): boolean; + + /** + * + * @param {Boolean} twoSidedLighting + */ + setTwoSidedLighting(twoSidedLighting: boolean): boolean; + + /** + * + * @param {Boolean} useDepthPeeling + */ + setUseDepthPeeling(useDepthPeeling: boolean): boolean; + + /** + * + * @param {Boolean} useShadows + */ + setUseShadows(useShadows: boolean): boolean; + + /** + * Specify the rendering window in which to draw. + * @param {vtkRenderWindow} renderWindow + */ + setRenderWindow(renderWindow: vtkRenderWindow): void; + + /** + * Remove an actor from the list of actors. + * @param {vtkProp} actor + */ + removeActor(actor: vtkProp): void; + + /** + * Remove all actors from the list of actors. + */ + removeAllActors(): void; + + /** + * Remove a volume from the list of volumes. + * @param {vtkVolume} volume The volume object to remove. + */ + removeVolume(volume: vtkVolume): void; + + /** + * Remove all volumes from the list of volumes. + */ + removeAllVolumes(): void; + + /** + * Remove a light from the list of lights. + * @param {vtkLight} light The light object to remove. + */ + removeLight(light: vtkLight): void; + + /** + * Remove all lights from the list of lights. + */ + removeAllLights(): void; + + /** + * requires the aspect ratio of the viewport as X/Y + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + * @param {Number} aspect + */ + worldToNormalizedDisplay( + x: number, + y: number, + z: number, + aspect: number + ): number[]; + + /** + * requires the aspect ratio of the viewport as X/Y + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + viewToWorld(x: number, y: number, z: number): number[]; + + /** + * Convert world point coordinates to view coordinates. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + worldToView(x: number, y: number, z: number): number[]; + + /** + * Convert world point coordinates to view coordinates. + * requires the aspect ratio of the viewport as X/Y + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + * @param {Number} aspect + */ + viewToProjection(x: number, y: number, z: number, aspect: number): number[]; + + /** + * Automatically set up the camera based on the visible actors. + * + * The camera will reposition itself to view the center point of the actors, + * and move along its initial view plane normal (i.e., vector defined from + * camera position to focal point) so that all of the actors can be seen. + * @param {Bounds} [bounds] + */ + resetCamera(bounds?: Bounds): boolean; + + /** + * Reset the camera clipping range based on a bounding box. + * @param {Bounds} [bounds] + */ + resetCameraClippingRange(bounds?: Bounds): boolean; + + /** + * Get the number of visible actors. + */ + visibleActorCount(): number; + + /** + * Not Implemented yet + */ + updateGeometry(): any; + + /** + * Ask the active camera to do whatever it needs to do prior to rendering. + */ + updateCamera(): boolean; + + /** + * Ask the lights in the scene that are not in world space + * (for instance, Headlights or CameraLights that are attached to the + * camera) to update their geometry to match the active camera. + */ + updateLightsGeometryToFollowCamera(): void; + + /** + * Update the geometry of the lights in the scene that are not in world + * space (for instance, Headlights or CameraLights that are attached to the + * camera). + */ + updateLightGeometry(): boolean; + + /** + * Not Implemented yet + */ + visibleVolumeCount(): any; + + /** + * Set the viewport background. + * + * @param {Number} r Defines the red component (between 0 and 1). + * @param {Number} g Defines the green component (between 0 and 1). + * @param {Number} b Defines the blue component (between 0 and 1). + * @param {Number} a Defines the alpha component (between 0 and 1). + */ + setBackground(r: number, g: number, b: number, a: number): boolean; + + /** + * Set the viewport background. + * + * @param {Number} r Defines the red component (between 0 and 1). + * @param {Number} g Defines the green component (between 0 and 1). + * @param {Number} b Defines the blue component (between 0 and 1). + */ + setBackground(r: number, g: number, b: number): boolean; + + /** + * Set the viewport background. + * + * @param {Number[]} background The RGB color array. + */ + setBackground(background: number[]): boolean; + + /** + * Adds an event listener. + */ + onEvent(cb: EventHandler, priority?: number): Readonly; } /** @@ -682,15 +690,21 @@ export interface vtkRenderer extends vtkViewport { * @param model object on which data structure will be bounds (protected) * @param {IRendererInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IRendererInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IRendererInitialValues +): void; /** * Method use to create a new instance of vtkRenderer. * @param {IRendererInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IRendererInitialValues): vtkRenderer; +export function newInstance( + initialValues?: IRendererInitialValues +): vtkRenderer; -/** +/** * vtkRenderer is a Viewport designed to hold 3D properties. It contains * an instance of vtkCamera, a collection of vtkLights, and vtkActors. It exists * within a RenderWindow. A RenderWindow may have multiple Renderers @@ -698,7 +712,7 @@ export function newInstance(initialValues?: IRendererInitialValues): vtkRenderer * on top of each other as well. */ export declare const vtkRenderer: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkRenderer; diff --git a/Sources/Rendering/Core/ScalarBarActor/index.d.ts b/Sources/Rendering/Core/ScalarBarActor/index.d.ts index d5ed7dee742..628ef2bbd8e 100644 --- a/Sources/Rendering/Core/ScalarBarActor/index.d.ts +++ b/Sources/Rendering/Core/ScalarBarActor/index.d.ts @@ -1,343 +1,348 @@ -import vtkScalarsToColors from "../../../Common/Core/ScalarsToColors"; -import { Size, Vector2, Vector3 } from "../../../types"; -import vtkActor, { IActorInitialValues } from "../Actor"; - +import vtkScalarsToColors from '../../../Common/Core/ScalarsToColors'; +import { Size, Vector2, Vector3 } from '../../../types'; +import vtkActor, { IActorInitialValues } from '../Actor'; export interface ITextSizes { - tickWidth: number; - tickHeight: number; + tickWidth: number; + tickHeight: number; } export interface IResult { - ptIdx: number, - cellIdx: number, - polys: Float64Array, - points: Uint16Array, - tcoords: Float32Array, + ptIdx: number; + cellIdx: number; + polys: Float64Array; + points: Uint16Array; + tcoords: Float32Array; } export interface IStyle { - fontColor?: string; - fontStyle?: string; - fontFamily?: string; - fontSize?: string; + fontColor?: string; + fontStyle?: string; + fontFamily?: string; + fontSize?: string; } /** * */ export interface IScalarBarActorInitialValues extends IActorInitialValues { - automated?: boolean, - autoLayout?: (publicAPI: object, model: object) => void, - axisLabel?: string, - barPosition?: Vector2, - barSize?: Size, - boxPosition?: Vector2, - boxSize?: Size, - scalarToColors?: null, - axisTitlePixelOffset?: number, - axisTextStyle?: IStyle, - tickLabelPixelOffset?: number, - tickTextStyle?: IStyle, - generateTicks?: (helper: any) => void, - drawBelowRangeSwatch?: boolean, - drawAboveRangeSwatch?: boolean, - drawNanAnnotation?: boolean, + automated?: boolean; + autoLayout?: (publicAPI: object, model: object) => void; + axisLabel?: string; + barPosition?: Vector2; + barSize?: Size; + boxPosition?: Vector2; + boxSize?: Size; + scalarToColors?: null; + axisTitlePixelOffset?: number; + axisTextStyle?: IStyle; + tickLabelPixelOffset?: number; + tickTextStyle?: IStyle; + generateTicks?: (helper: any) => void; + drawBelowRangeSwatch?: boolean; + drawAboveRangeSwatch?: boolean; + drawNanAnnotation?: boolean; } export interface vtkScalarBarActor extends vtkActor { - - /** - * - * @param {Boolean} doUpdate - */ - completedImage(doUpdate: boolean): void; - - /** - * based on all the settins compute a barSegments array containing the - * segments opf the scalar bar each segment contains : - * corners[4][2] - * title - e.g. NaN, Above, ticks - * scalars - the normalized scalars values to use for that segment - * - * Note that the bar consumes the space in the box that remains - * after leaving room for the text labels. - * @param {ITextSizes} textSizes - */ - computeBarSize(textSizes: ITextSizes): Size; - - /** - * Called by updatePolyDataForLabels modifies class constants ptv3, tmpv3 - * @param text - * @param pos - * @param xdir - * @param ydir - * @param dir - * @param offset - * @param results - */ - createPolyDataForOneLabel(text: string, pos: Vector3, xdir: Vector3, ydir: Vector3, dir: Vector2, offset: number, results: IResult): void; - - /** - * - */ - getActors(): vtkActor[]; - - /** - * - */ - getAutoLayout(): any; - - /** - * - */ - getGenerateTicks(): any; - - /** - * - */ - getAutomated(): boolean; - - /** - * - */ - getAxisLabel(): string; - - /** - * - */ - getAxisTextStyle(): IStyle; - - /** - * - */ - getAxisTitlePixelOffset(): number; - - /** - * - */ - getBoxPosition(): Vector2; - - /** - * - */ - getBoxPositionByReference(): Vector2; - - /** - * - */ - getBoxSize(): Size; - - /** - * - */ - getBoxSizeByReference(): Size; - - /** - * - */ - getNestedProps(): vtkActor[]; - - /** - * - */ - getScalarsToColors(): vtkScalarsToColors; - - /** - * - */ - getDrawNanAnnotation(): boolean - - /** - * - */ - getDrawBelowRangeSwatch(): boolean - - /** - * - */ - getDrawAboveRangeSwatch(): boolean - - /** - * - */ - getTickTextStyle(): IStyle; - - /** - * - * @param {ITextSizes} textSizes - */ - recomputeBarSegments(textSizes: ITextSizes): void; - - /** - * - */ - resetAutoLayoutToDefault(): void; - - /** - * - * @param autoLayout - */ - setAutoLayout(autoLayout: any): boolean; - - /** - * Sets the function used to generate legend ticks. - * - * This function takes a vtkScalarBarActorHelper and returns true on success. - * To have the desired effect, the function must call: `helper.setTicks(ticks: num[])` and `helper.setTickStrings(tickStrings: string[])`. - * - * After setting the generateTicks function you must regenerate the vtkScalarBarActor for your changes to take effect. - * One way to do that is: - * ``` - * const mapper = scalarBarActor.getMapper() - * if (mapper) { - * mapper.getLookupTable().resetAnnotations() - * } - * ``` - * @param generateTicks - */ - setGenerateTicks(generateTicks: (helper: any) => void): boolean; - - /** - * - * @param {Boolean} automated - */ - setAutomated(automated: boolean): boolean; - - /** - * - * @param {String} axisLabel - */ - setAxisLabel(axisLabel: string): boolean; - - /** - * - * @param {IStyle} axisTextStyle - */ - setAxisTextStyle(axisTextStyle: IStyle): boolean; - - /** - * - * @param {Number} axisTitlePixelOffset - */ - setAxisTitlePixelOffset(axisTitlePixelOffset: number): boolean; - - /** - * - * @param {Vector2} boxPosition - */ - setBoxPosition(boxPosition: Vector2): boolean; - - /** - * - * @param {Vector2} boxPosition - */ - setBoxPositionFrom(boxPosition: Vector2): boolean; - - /** - * - * @param {Size} boxSize - */ - setBoxSize(boxSize: Size): boolean; - - /** - * - * @param {Size} boxSize - */ - setBoxSizeFrom(boxSize: Size): boolean; - - /** - * - * @param {Vector2} barPosition - */ - setBarPosition(barPosition: Vector2): boolean; - - /** - * - * @param {Vector2} barPosition - */ - setBarPositionFrom(barPosition: Vector2): boolean; - - /** - * - * @param {Size} barSize - */ - setBarSize(barSize: Size): boolean; - - /** - * - * @param {Size} barSize - */ - setBarSizeFrom(barSize: Size): boolean; - - /** - * - * @param {vtkScalarsToColors} scalarsToColors - */ - setScalarsToColors(scalarsToColors: vtkScalarsToColors): boolean; - - /** - * Set whether the NaN annotation should be rendered or not. - * @param {Boolean} drawNanAnnotation - */ - setDrawNanAnnotation(drawNanAnnotation: boolean): boolean; - - /** - * Set whether the Below range swatch should be rendered or not - * @param {Boolean} drawBelowRangeSwatch - */ - setDrawBelowRangeSwatch(drawBelowRangeSwatch: boolean): boolean; - - /** - * Set whether the Above range swatch should be rendered or not - * @param {Boolean} drawAboveRangeSwatch - */ - setDrawAboveRangeSwatch(drawAboveRangeSwatch: boolean): boolean; - - /** - * - * @param tickLabelPixelOffset - */ - setTickLabelPixelOffset(tickLabelPixelOffset: number): boolean; - - /** - * - * @param {IStyle} tickStyle - */ - setTickTextStyle(tickStyle: IStyle): void; - - /** - * - */ - setVisibility(visibility: boolean): boolean; - - /** - * main method to rebuild the scalarBar when something has changed tracks - * modified times - */ - update(): void; - - /** - * - */ - updatePolyDataForBarSegments(): void; - - /** - * Udate the polydata associated with drawing the text labels - * specifically the quads used for each label and their associated tcoords - * etc. This changes every time the camera viewpoint changes - */ - updatePolyDataForLabels(): void; - - /** - * create the texture map atlas that contains the rendering of - * all the text strings. Only needs to be called when the text strings - * have changed (labels and ticks) - */ - updateTextureAtlas(): void; + /** + * + * @param {Boolean} doUpdate + */ + completedImage(doUpdate: boolean): void; + + /** + * based on all the settins compute a barSegments array containing the + * segments opf the scalar bar each segment contains : + * corners[4][2] + * title - e.g. NaN, Above, ticks + * scalars - the normalized scalars values to use for that segment + * + * Note that the bar consumes the space in the box that remains + * after leaving room for the text labels. + * @param {ITextSizes} textSizes + */ + computeBarSize(textSizes: ITextSizes): Size; + + /** + * Called by updatePolyDataForLabels modifies class constants ptv3, tmpv3 + * @param text + * @param pos + * @param xdir + * @param ydir + * @param dir + * @param offset + * @param results + */ + createPolyDataForOneLabel( + text: string, + pos: Vector3, + xdir: Vector3, + ydir: Vector3, + dir: Vector2, + offset: number, + results: IResult + ): void; + + /** + * + */ + getActors(): vtkActor[]; + + /** + * + */ + getAutoLayout(): any; + + /** + * + */ + getGenerateTicks(): any; + + /** + * + */ + getAutomated(): boolean; + + /** + * + */ + getAxisLabel(): string; + + /** + * + */ + getAxisTextStyle(): IStyle; + + /** + * + */ + getAxisTitlePixelOffset(): number; + + /** + * + */ + getBoxPosition(): Vector2; + + /** + * + */ + getBoxPositionByReference(): Vector2; + + /** + * + */ + getBoxSize(): Size; + + /** + * + */ + getBoxSizeByReference(): Size; + + /** + * + */ + getNestedProps(): vtkActor[]; + + /** + * + */ + getScalarsToColors(): vtkScalarsToColors; + + /** + * + */ + getDrawNanAnnotation(): boolean; + + /** + * + */ + getDrawBelowRangeSwatch(): boolean; + + /** + * + */ + getDrawAboveRangeSwatch(): boolean; + + /** + * + */ + getTickTextStyle(): IStyle; + + /** + * + * @param {ITextSizes} textSizes + */ + recomputeBarSegments(textSizes: ITextSizes): void; + + /** + * + */ + resetAutoLayoutToDefault(): void; + + /** + * + * @param autoLayout + */ + setAutoLayout(autoLayout: any): boolean; + + /** + * Sets the function used to generate legend ticks. + * + * This function takes a vtkScalarBarActorHelper and returns true on success. + * To have the desired effect, the function must call: `helper.setTicks(ticks: num[])` and `helper.setTickStrings(tickStrings: string[])`. + * + * After setting the generateTicks function you must regenerate the vtkScalarBarActor for your changes to take effect. + * One way to do that is: + * ``` + * const mapper = scalarBarActor.getMapper() + * if (mapper) { + * mapper.getLookupTable().resetAnnotations() + * } + * ``` + * @param generateTicks + */ + setGenerateTicks(generateTicks: (helper: any) => void): boolean; + + /** + * + * @param {Boolean} automated + */ + setAutomated(automated: boolean): boolean; + + /** + * + * @param {String} axisLabel + */ + setAxisLabel(axisLabel: string): boolean; + + /** + * + * @param {IStyle} axisTextStyle + */ + setAxisTextStyle(axisTextStyle: IStyle): boolean; + + /** + * + * @param {Number} axisTitlePixelOffset + */ + setAxisTitlePixelOffset(axisTitlePixelOffset: number): boolean; + + /** + * + * @param {Vector2} boxPosition + */ + setBoxPosition(boxPosition: Vector2): boolean; + + /** + * + * @param {Vector2} boxPosition + */ + setBoxPositionFrom(boxPosition: Vector2): boolean; + + /** + * + * @param {Size} boxSize + */ + setBoxSize(boxSize: Size): boolean; + + /** + * + * @param {Size} boxSize + */ + setBoxSizeFrom(boxSize: Size): boolean; + + /** + * + * @param {Vector2} barPosition + */ + setBarPosition(barPosition: Vector2): boolean; + + /** + * + * @param {Vector2} barPosition + */ + setBarPositionFrom(barPosition: Vector2): boolean; + + /** + * + * @param {Size} barSize + */ + setBarSize(barSize: Size): boolean; + + /** + * + * @param {Size} barSize + */ + setBarSizeFrom(barSize: Size): boolean; + + /** + * + * @param {vtkScalarsToColors} scalarsToColors + */ + setScalarsToColors(scalarsToColors: vtkScalarsToColors): boolean; + + /** + * Set whether the NaN annotation should be rendered or not. + * @param {Boolean} drawNanAnnotation + */ + setDrawNanAnnotation(drawNanAnnotation: boolean): boolean; + + /** + * Set whether the Below range swatch should be rendered or not + * @param {Boolean} drawBelowRangeSwatch + */ + setDrawBelowRangeSwatch(drawBelowRangeSwatch: boolean): boolean; + + /** + * Set whether the Above range swatch should be rendered or not + * @param {Boolean} drawAboveRangeSwatch + */ + setDrawAboveRangeSwatch(drawAboveRangeSwatch: boolean): boolean; + + /** + * + * @param tickLabelPixelOffset + */ + setTickLabelPixelOffset(tickLabelPixelOffset: number): boolean; + + /** + * + * @param {IStyle} tickStyle + */ + setTickTextStyle(tickStyle: IStyle): void; + + /** + * + */ + setVisibility(visibility: boolean): boolean; + + /** + * main method to rebuild the scalarBar when something has changed tracks + * modified times + */ + update(): void; + + /** + * + */ + updatePolyDataForBarSegments(): void; + + /** + * Udate the polydata associated with drawing the text labels + * specifically the quads used for each label and their associated tcoords + * etc. This changes every time the camera viewpoint changes + */ + updatePolyDataForLabels(): void; + + /** + * create the texture map atlas that contains the rendering of + * all the text strings. Only needs to be called when the text strings + * have changed (labels and ticks) + */ + updateTextureAtlas(): void; } - /** * Method use to decorate a given object (publicAPI+model) with vtkScalarBarActor characteristics. * @@ -345,12 +350,18 @@ export interface vtkScalarBarActor extends vtkActor { * @param model object on which data structure will be bounds (protected) * @param {IScalarBarActorInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IScalarBarActorInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IScalarBarActorInitialValues +): void; /** * Method use to create a new instance of vtkScalarBarActor */ -export function newInstance(initialValues?: IScalarBarActorInitialValues): vtkScalarBarActor; +export function newInstance( + initialValues?: IScalarBarActorInitialValues +): vtkScalarBarActor; /** * vtkScalarBarActor creates a scalar bar with tick marks. A @@ -361,7 +372,7 @@ export function newInstance(initialValues?: IScalarBarActorInitialValues): vtkSc * (i.e., in the renderer's viewport) on top of the 3D graphics window. */ export declare const vtkScalarBarActor: { - newInstance: typeof newInstance; - extend: typeof extend; + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkScalarBarActor; diff --git a/Sources/Rendering/Core/Skybox/index.d.ts b/Sources/Rendering/Core/Skybox/index.d.ts index 0ac13560b0d..c1681c49b55 100755 --- a/Sources/Rendering/Core/Skybox/index.d.ts +++ b/Sources/Rendering/Core/Skybox/index.d.ts @@ -1,36 +1,35 @@ -import vtkActor, { IActorInitialValues } from "../Actor"; +import vtkActor, { IActorInitialValues } from '../Actor'; export interface ISkyboxInitialValues extends IActorInitialValues { - format?: string; + format?: string; } export interface vtkSkybox extends vtkActor { - - /** - * - */ - getFromat(): string; - - /** - * - */ - getIsOpaque(): boolean; - - /** - * - */ - getSupportsSelection(): boolean; - - /** - * - */ - hasTranslucentPolygonalGeometry(): boolean; - - /** - * - * @param format - */ - setFromat(format: string): boolean; + /** + * + */ + getFromat(): string; + + /** + * + */ + getIsOpaque(): boolean; + + /** + * + */ + getSupportsSelection(): boolean; + + /** + * + */ + hasTranslucentPolygonalGeometry(): boolean; + + /** + * + * @param format + */ + setFromat(format: string): boolean; } /** @@ -40,18 +39,22 @@ export interface vtkSkybox extends vtkActor { * @param model object on which data structure will be bounds (protected) * @param {ISkyboxInitialValues} [initialValues] (default: {}) */ - export function extend(publicAPI: object, model: object, initialValues?: ISkyboxInitialValues): void; - - /** - * Method use to create a new instance of vtkSkybox - */ - export function newInstance(initialValues?: ISkyboxInitialValues): vtkSkybox; - - /** - * - */ - export declare const vtkSkybox: { - newInstance: typeof newInstance, - extend: typeof extend, - }; - export default vtkSkybox; +export function extend( + publicAPI: object, + model: object, + initialValues?: ISkyboxInitialValues +): void; + +/** + * Method use to create a new instance of vtkSkybox + */ +export function newInstance(initialValues?: ISkyboxInitialValues): vtkSkybox; + +/** + * + */ +export declare const vtkSkybox: { + newInstance: typeof newInstance; + extend: typeof extend; +}; +export default vtkSkybox; diff --git a/Sources/Rendering/Core/SphereMapper/index.d.ts b/Sources/Rendering/Core/SphereMapper/index.d.ts index 62fde2885f1..f0274be9961 100755 --- a/Sources/Rendering/Core/SphereMapper/index.d.ts +++ b/Sources/Rendering/Core/SphereMapper/index.d.ts @@ -1,44 +1,43 @@ -import vtkMapper, { IMapperInitialValues } from "../Mapper"; +import vtkMapper, { IMapperInitialValues } from '../Mapper'; export interface ISphereInitialValues extends IMapperInitialValues { - radius?: number; + radius?: number; } export interface vtkSphereMapper extends vtkMapper { + /** + * + */ + getRadius(): number; - /** - * - */ - getRadius(): number; + /** + * + */ + getScaleArray(): any; - /** - * - */ - getScaleArray(): any; + /** + * + */ + getScaleFactor(): number; - /** - * - */ - getScaleFactor(): number; + /** + * + * @param {Number} radius + */ + setRadius(radius: number): boolean; - /** - * - * @param {Number} radius - */ - setRadius(radius: number): boolean; + /** + * + * @param scaleArray + */ + setScaleArray(scaleArray: any): boolean; - /** - * - * @param scaleArray - */ - setScaleArray(scaleArray: any): boolean; - -/** - * Factor multiplied with scale array elements. Radius is used when no scale array is given. - * @param scaleFactor number to multiply with when a scale array is provided. 1 by default. - * @see getScaleFactor(), setScaleArray(), setRadius() - */ - setScaleFactor(scaleFactor: number): boolean; + /** + * Factor multiplied with scale array elements. Radius is used when no scale array is given. + * @param scaleFactor number to multiply with when a scale array is provided. 1 by default. + * @see getScaleFactor(), setScaleArray(), setRadius() + */ + setScaleFactor(scaleFactor: number): boolean; } /** @@ -48,18 +47,24 @@ export interface vtkSphereMapper extends vtkMapper { * @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; +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; \ No newline at end of file +/** + * 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; diff --git a/Sources/Rendering/Core/StickMapper/index.d.ts b/Sources/Rendering/Core/StickMapper/index.d.ts index 976220e2f46..91e7852460a 100755 --- a/Sources/Rendering/Core/StickMapper/index.d.ts +++ b/Sources/Rendering/Core/StickMapper/index.d.ts @@ -1,35 +1,34 @@ -import vtkMapper, { IMapperInitialValues } from "../Mapper"; +import vtkMapper, { IMapperInitialValues } from '../Mapper'; -interface IStickMappereInitialValues extends IMapperInitialValues{ - radius?: number; - length?: number; - scaleArray?: number[], - orientationArray?: number[], +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; + /** + * + */ + getRadius(): number; + + /** + * + */ + getScaleArray(): number[]; + + /** + * + * @param {Number} radius + */ + setRadius(radius: number): boolean; + + /** + * + * @param scaleArray + */ + setScaleArray(scaleArray: number[]): boolean; } /** @@ -39,20 +38,26 @@ export interface vtkStickMapper extends vtkMapper { * @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; +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; diff --git a/Sources/Rendering/Core/Texture/index.d.ts b/Sources/Rendering/Core/Texture/index.d.ts index b79f55faf5c..79a2c153368 100755 --- a/Sources/Rendering/Core/Texture/index.d.ts +++ b/Sources/Rendering/Core/Texture/index.d.ts @@ -1,83 +1,81 @@ -import { vtkAlgorithm } from "../../../interfaces"; +import { vtkAlgorithm } from '../../../interfaces'; /** - * + * * @param {boolean} [resizable] Must be set to true if texture can be resized at run time (default: false) */ export interface ITextureInitialValues { - repeat?: boolean; - interpolate?: boolean; - edgeClamp?: boolean; - imageLoaded?: boolean; - mipLevel?: number; - resizable?: boolean; + repeat?: boolean; + interpolate?: boolean; + edgeClamp?: boolean; + imageLoaded?: boolean; + mipLevel?: number; + resizable?: boolean; } export interface vtkTexture extends vtkAlgorithm { - - /** - * - */ - getRepeat(): boolean; - - /** - * - */ - getEdgeClamp(): boolean; - - /** - * - */ - getInterpolate(): boolean; - - /** - * - */ - getImage(): any; - - /** - * - */ - getImageLoaded(): boolean; - - /** - * - */ - getMipLevel(): number; - - /** - * - * @param repeat - * @default false - */ - setRepeat(repeat: boolean): boolean; - - /** - * - * @param edgeClamp - * @default false - */ - setEdgeClamp(edgeClamp: boolean): boolean; - - /** - * - * @param interpolate - * @default false - */ - setInterpolate(interpolate: boolean): boolean; - - - /** - * - * @param image - * @default null - */ - setImage(image: any): void; - - /** - * @param level - */ - setMipLevel(level: number): boolean; + /** + * + */ + getRepeat(): boolean; + + /** + * + */ + getEdgeClamp(): boolean; + + /** + * + */ + getInterpolate(): boolean; + + /** + * + */ + getImage(): any; + + /** + * + */ + getImageLoaded(): boolean; + + /** + * + */ + getMipLevel(): number; + + /** + * + * @param repeat + * @default false + */ + setRepeat(repeat: boolean): boolean; + + /** + * + * @param edgeClamp + * @default false + */ + setEdgeClamp(edgeClamp: boolean): boolean; + + /** + * + * @param interpolate + * @default false + */ + setInterpolate(interpolate: boolean): boolean; + + /** + * + * @param image + * @default null + */ + setImage(image: any): void; + + /** + * @param level + */ + setMipLevel(level: number): boolean; } /** @@ -87,7 +85,11 @@ export interface vtkTexture extends vtkAlgorithm { * @param model object on which data structure will be bounds (protected) * @param {ITextureInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ITextureInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ITextureInitialValues +): void; /** * Method use to create a new instance of vtkTexture. @@ -96,24 +98,29 @@ export function extend(publicAPI: object, model: object, initialValues?: ITextur export function newInstance(initialValues?: ITextureInitialValues): vtkTexture; /** - * Method used to create mipmaps from given texture data. Works best with textures that have a + * Method used to create mipmaps from given texture data. Works best with textures that have a * width and a height that are powers of two. - * + * * @param nativeArray the array of data to create mipmaps from. * @param width the width of the data * @param height the height of the data * @param level the level to which additional mipmaps are generated. */ -export function generateMipmaps(nativeArray: any, width: number, height: number, level: number): Array; +export function generateMipmaps( + nativeArray: any, + width: number, + height: number, + level: number +): Array; -/** +/** * vtkTexture is an image algorithm that handles loading and binding of texture maps. - * It obtains its data from an input image data dataset type. - * Thus you can create visualization pipelines to read, process, and construct textures. + * It obtains its data from an input image data dataset type. + * Thus you can create visualization pipelines to read, process, and construct textures. * Note that textures will only work if texture coordinates are also defined, and if the rendering system supports texture. */ export declare const vtkTexture: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkTexture; diff --git a/Sources/Rendering/Core/Viewport/index.d.ts b/Sources/Rendering/Core/Viewport/index.d.ts index f9e7813fa0b..811cf9c3073 100755 --- a/Sources/Rendering/Core/Viewport/index.d.ts +++ b/Sources/Rendering/Core/Viewport/index.d.ts @@ -1,227 +1,228 @@ - -import { vtkObject } from "../../../interfaces"; -import { RGBColor, Size } from "../../../types"; +import { vtkObject } from '../../../interfaces'; +import { RGBColor, Size } from '../../../types'; import vtkActor2D from '../Actor2D'; import vtkProp from '../Prop'; export interface IViewportInitialValues { - background?: RGBColor; - background2?: RGBColor; - gradientBackground?: boolean; - viewport?: number[]; - aspect?: number[]; - pixelAspect?: number[]; - props?: vtkProp[]; - actors2D?: vtkActor2D[]; + background?: RGBColor; + background2?: RGBColor; + gradientBackground?: boolean; + viewport?: number[]; + aspect?: number[]; + pixelAspect?: number[]; + props?: vtkProp[]; + actors2D?: vtkActor2D[]; } export interface vtkViewport extends vtkObject { - - /** - * Adds a 2D actor to the scene. - * @param prop - */ - addActor2D(prop: vtkActor2D): void; - - /** - * Add a prop to the list of props. - * @param prop - */ - addViewProp(prop: vtkProp): void; - - /** - * Convert display coordinates to view coordinates. - */ - displayToView(): any; - - /** - * - */ - getActors2D(): vtkActor2D[]; - - /** - * - */ - getBackground2(): number[]; - - /** - * - */ - getBackground2ByReference(): number[]; - - /** - * - */ - getBackground(): number[]; - - /** - * - */ - getBackgroundByReference(): number[]; - - /** - * - */ - getSize(): Size; - - /** - * - */ - getViewport(): vtkViewport; - - /** - * - */ - getViewportByReference(): vtkViewport; - - /** - * - */ - getViewPropsWithNestedProps(): any; - - /** - * - */ - getViewProps(): vtkProp[]; - - /** - * - * @param prop - */ - hasViewProp(prop: vtkProp): boolean; - - /** - * - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - normalizedDisplayToProjection(x: number, y: number, z: number): number[]; - - /** - * - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - normalizedDisplayToNormalizedViewport(x: number, y: number, z: number): any; - - /** - * - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - normalizedViewportToProjection(x: number, y: number, z: any): number[]; - - /** - * - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - projectionToNormalizedDisplay(x: number, y: number, z: number): number[]; - - /** - * - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - normalizedViewportToNormalizedDisplay(x: number, y: number, z: number): number[]; - - /** - * Set the viewport background. - * @param {Number} r Defines the red component (between 0 and 1). - * @param {Number} g Defines the green component (between 0 and 1). - * @param {Number} b Defines the blue component (between 0 and 1). - */ - setBackground(r: number, g: number, b: number): boolean; - - /** - * Set the viewport background. - * @param {Number[]} background The RGB color array. - */ - setBackground(background: number[]): boolean; - - /** - * - * @param {Number} r Defines the red component (between 0 and 1). - * @param {Number} g Defines the green component (between 0 and 1). - * @param {Number} b Defines the blue component (between 0 and 1). - */ - setBackground2(r: number, g: number, b: number): boolean; - - /** - * - * @param {Number[]} background - */ - setBackground2(background: number[]): boolean; - - /** - * - * @param {Number[]} background - */ - setBackground2From(background: number[]): boolean; - - /** - * - * @param {Number[]} background - */ - setBackgroundFrom(background: number[]): boolean; - - /** - * Specify the viewport for the Viewport to draw in the rendering window. - * Each coordinate is 0 <= coordinate <= 1.0. - * @param {Number} xmin The xmin coordinate. - * @param {Number} ymin The ymin coordinate. - * @param {Number} xmax The xmax coordinate. - * @param {Number} ymax The ymax coordinate. - */ - setViewport(xmin: number, ymin: number, xmax: number, ymax: number): boolean; - - /** - * Specify the viewport for the Viewport to draw in the rendering window. - * Coordinates are expressed as [xmin, ymin, xmax, ymax], where each coordinate is 0 <= coordinate <= 1.0. - * @param {Number[]} viewport - */ - setViewportFrom(viewport: number[]): boolean; - - /** - * - * @param prop - */ - removeViewProp(prop: vtkProp): void; - - /** - * - */ - removeAllViewProps(): void; - - /** - * - * @param prop - */ - removeActor2D(prop: vtkProp): void; - - /** - * - */ - viewToDisplay(): any; - - /** - * - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - projectionToNormalizedViewport(x: number, y: number, z: number): number[]; - - - /** - * Not Implemented yet - */ - PickPropFrom(): any; + /** + * Adds a 2D actor to the scene. + * @param prop + */ + addActor2D(prop: vtkActor2D): void; + + /** + * Add a prop to the list of props. + * @param prop + */ + addViewProp(prop: vtkProp): void; + + /** + * Convert display coordinates to view coordinates. + */ + displayToView(): any; + + /** + * + */ + getActors2D(): vtkActor2D[]; + + /** + * + */ + getBackground2(): number[]; + + /** + * + */ + getBackground2ByReference(): number[]; + + /** + * + */ + getBackground(): number[]; + + /** + * + */ + getBackgroundByReference(): number[]; + + /** + * + */ + getSize(): Size; + + /** + * + */ + getViewport(): vtkViewport; + + /** + * + */ + getViewportByReference(): vtkViewport; + + /** + * + */ + getViewPropsWithNestedProps(): any; + + /** + * + */ + getViewProps(): vtkProp[]; + + /** + * + * @param prop + */ + hasViewProp(prop: vtkProp): boolean; + + /** + * + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + normalizedDisplayToProjection(x: number, y: number, z: number): number[]; + + /** + * + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + normalizedDisplayToNormalizedViewport(x: number, y: number, z: number): any; + + /** + * + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + normalizedViewportToProjection(x: number, y: number, z: any): number[]; + + /** + * + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + projectionToNormalizedDisplay(x: number, y: number, z: number): number[]; + + /** + * + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + normalizedViewportToNormalizedDisplay( + x: number, + y: number, + z: number + ): number[]; + + /** + * Set the viewport background. + * @param {Number} r Defines the red component (between 0 and 1). + * @param {Number} g Defines the green component (between 0 and 1). + * @param {Number} b Defines the blue component (between 0 and 1). + */ + setBackground(r: number, g: number, b: number): boolean; + + /** + * Set the viewport background. + * @param {Number[]} background The RGB color array. + */ + setBackground(background: number[]): boolean; + + /** + * + * @param {Number} r Defines the red component (between 0 and 1). + * @param {Number} g Defines the green component (between 0 and 1). + * @param {Number} b Defines the blue component (between 0 and 1). + */ + setBackground2(r: number, g: number, b: number): boolean; + + /** + * + * @param {Number[]} background + */ + setBackground2(background: number[]): boolean; + + /** + * + * @param {Number[]} background + */ + setBackground2From(background: number[]): boolean; + + /** + * + * @param {Number[]} background + */ + setBackgroundFrom(background: number[]): boolean; + + /** + * Specify the viewport for the Viewport to draw in the rendering window. + * Each coordinate is 0 <= coordinate <= 1.0. + * @param {Number} xmin The xmin coordinate. + * @param {Number} ymin The ymin coordinate. + * @param {Number} xmax The xmax coordinate. + * @param {Number} ymax The ymax coordinate. + */ + setViewport(xmin: number, ymin: number, xmax: number, ymax: number): boolean; + + /** + * Specify the viewport for the Viewport to draw in the rendering window. + * Coordinates are expressed as [xmin, ymin, xmax, ymax], where each coordinate is 0 <= coordinate <= 1.0. + * @param {Number[]} viewport + */ + setViewportFrom(viewport: number[]): boolean; + + /** + * + * @param prop + */ + removeViewProp(prop: vtkProp): void; + + /** + * + */ + removeAllViewProps(): void; + + /** + * + * @param prop + */ + removeActor2D(prop: vtkProp): void; + + /** + * + */ + viewToDisplay(): any; + + /** + * + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + projectionToNormalizedViewport(x: number, y: number, z: number): number[]; + + /** + * Not Implemented yet + */ + PickPropFrom(): any; } /** @@ -231,19 +232,25 @@ export interface vtkViewport extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IViewportInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IViewportInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IViewportInitialValues +): void; /** - * Method use to create a new instance of vtkViewport + * Method use to create a new instance of vtkViewport */ -export function newInstance(initialValues?: IViewportInitialValues): vtkViewport; +export function newInstance( + initialValues?: IViewportInitialValues +): vtkViewport; -/** +/** * vtkViewport represents part or all of a RenderWindow. It holds a * collection of props that will be rendered into the area it represents. * This class also contains methods to convert between coordinate systems * commonly used in rendering. - * + * * @see [vtkActor](./Rendering_Core_Actor.html) * @see [vtkCoordinate](./Rendering_Core_Coordinate.html) * @see [vtkProp](./Rendering_Core_Prop.html) @@ -252,7 +259,7 @@ export function newInstance(initialValues?: IViewportInitialValues): vtkViewport * @see [vtkVolume](./Rendering_Core_Volume.html) */ export declare const vtkViewport: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkViewport; diff --git a/Sources/Rendering/Core/Volume/index.d.ts b/Sources/Rendering/Core/Volume/index.d.ts index 24be4b6cf94..58fc94684e6 100755 --- a/Sources/Rendering/Core/Volume/index.d.ts +++ b/Sources/Rendering/Core/Volume/index.d.ts @@ -1,84 +1,85 @@ -import { Bounds, Nullable } from "../../../types"; -import vtkProp3D, { IProp3DInitialValues } from "../Prop3D"; -import vtkVolumeMapper from "../VolumeMapper"; -import vtkVolumeProperty, { IVolumePropertyInitialValues } from "../VolumeProperty"; +import { Bounds, Nullable } from '../../../types'; +import vtkProp3D, { IProp3DInitialValues } from '../Prop3D'; +import vtkVolumeMapper from '../VolumeMapper'; +import vtkVolumeProperty, { + IVolumePropertyInitialValues, +} from '../VolumeProperty'; /** - * + * */ export interface IVolumeInitialValues extends IProp3DInitialValues { - mapper?: vtkVolumeMapper; - property?: vtkVolumeProperty; - bounds?: Bounds; + mapper?: vtkVolumeMapper; + property?: vtkVolumeProperty; + bounds?: Bounds; } /** - * + * */ export interface vtkVolume extends vtkProp3D { - - /** - * Get the volume mapper - */ - getMapper(): Nullable; - - /** - * For some exporters and other other operations we must be able to collect - * all the actors or volumes. - */ - getVolumes(): vtkVolume[]; - - /** - * Get the volume property - */ - getProperty(): vtkVolumeProperty; - - /** - * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @return {Bounds} The bounds for the mapper. - */ - getBounds(): Bounds; - - /** - * Get the bounds as [xmin, xmax, ymin, ymax, zmin, zmax]. - */ - getBoundsByReference(): Bounds; - - /** - * Get the `Modified Time` which is a monotonic increasing integer - * global for all vtkObjects. - * - * This allow to solve a question such as: - * - Is that object created/modified after another one? - * - Do I need to re-execute this filter, or not? ... - * - * @return {Number} the global modified time. - */ - getMTime(): number; - - /** - * Get the mtime of anything that would cause the rendered image to appear - * differently - */ - getRedrawMTime(): number; - - /** - * Create a new property suitable for use with this type of Actor. - * @param {IVolumePropertyInitialValues} [initialValues] (default: {}) - */ - makeProperty(initialValues?: IVolumePropertyInitialValues): vtkVolumeProperty; - - /** - * Set the volume mapper - * @param {vtkVolumeMapper} mapper - */ - setMapper(mapper: vtkVolumeMapper): boolean; - - /** - * Set the volume property - * @param {vtkVolumeProperty} property - */ - setProperty(property: vtkVolumeProperty): boolean; + /** + * Get the volume mapper + */ + getMapper(): Nullable; + + /** + * For some exporters and other other operations we must be able to collect + * all the actors or volumes. + */ + getVolumes(): vtkVolume[]; + + /** + * Get the volume property + */ + getProperty(): vtkVolumeProperty; + + /** + * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @return {Bounds} The bounds for the mapper. + */ + getBounds(): Bounds; + + /** + * Get the bounds as [xmin, xmax, ymin, ymax, zmin, zmax]. + */ + getBoundsByReference(): Bounds; + + /** + * Get the `Modified Time` which is a monotonic increasing integer + * global for all vtkObjects. + * + * This allow to solve a question such as: + * - Is that object created/modified after another one? + * - Do I need to re-execute this filter, or not? ... + * + * @return {Number} the global modified time. + */ + getMTime(): number; + + /** + * Get the mtime of anything that would cause the rendered image to appear + * differently + */ + getRedrawMTime(): number; + + /** + * Create a new property suitable for use with this type of Actor. + * @param {IVolumePropertyInitialValues} [initialValues] (default: {}) + */ + makeProperty(initialValues?: IVolumePropertyInitialValues): vtkVolumeProperty; + + /** + * Set the volume mapper + * @param {vtkVolumeMapper} mapper + */ + setMapper(mapper: vtkVolumeMapper): boolean; + + /** + * Set the volume property + * @param {vtkVolumeProperty} property + */ + setProperty(property: vtkVolumeProperty): boolean; } /** @@ -88,10 +89,14 @@ export interface vtkVolume extends vtkProp3D { * @param model object on which data structure will be bounds (protected) * @param {IVolumeInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IVolumeInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IVolumeInitialValues +): void; /** - * Method use to create a new instance of vtkVolume + * Method use to create a new instance of vtkVolume */ export function newInstance(initialValues?: IVolumeInitialValues): vtkVolume; @@ -172,7 +177,7 @@ export function newInstance(initialValues?: IVolumeInitialValues): vtkVolume; * @see [vtkVolumeProperty](./Rendering_Core_VolumeProperty.html) */ export declare const vtkVolume: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkVolume; diff --git a/Sources/Rendering/Core/VolumeMapper/Constants.d.ts b/Sources/Rendering/Core/VolumeMapper/Constants.d.ts index a63d9fd59d0..f92bd9e0db7 100644 --- a/Sources/Rendering/Core/VolumeMapper/Constants.d.ts +++ b/Sources/Rendering/Core/VolumeMapper/Constants.d.ts @@ -1,20 +1,20 @@ export declare enum BlendMode { - COMPOSITE_BLEND = 0, - MAXIMUM_INTENSITY_BLEND = 1, - MINIMUM_INTENSITY_BLEND = 2, - AVERAGE_INTENSITY_BLEND = 3, - ADDITIVE_INTENSITY_BLEND = 4, - RADON_TRANSFORM_BLEND = 5, + COMPOSITE_BLEND = 0, + MAXIMUM_INTENSITY_BLEND = 1, + MINIMUM_INTENSITY_BLEND = 2, + AVERAGE_INTENSITY_BLEND = 3, + ADDITIVE_INTENSITY_BLEND = 4, + RADON_TRANSFORM_BLEND = 5, } export declare enum FilterMode { - OFF = 0, - NORMALIZED = 1, - RAW = 2, + OFF = 0, + NORMALIZED = 1, + RAW = 2, } declare const _default: { - BlendMode: typeof BlendMode; - FilterMode: typeof FilterMode; + BlendMode: typeof BlendMode; + FilterMode: typeof FilterMode; }; export default _default; diff --git a/Sources/Rendering/Core/VolumeMapper/index.d.ts b/Sources/Rendering/Core/VolumeMapper/index.d.ts index 2fd9694d939..f527a2f427f 100755 --- a/Sources/Rendering/Core/VolumeMapper/index.d.ts +++ b/Sources/Rendering/Core/VolumeMapper/index.d.ts @@ -1,287 +1,290 @@ -import vtkPiecewiseFunction from "../../../Common/DataModel/PiecewiseFunction"; -import { Bounds, Range } from "../../../types"; -import vtkAbstractMapper3D, { IAbstractMapper3DInitialValues } from "../AbstractMapper3D"; -import { BlendMode, FilterMode } from "./Constants"; +import vtkPiecewiseFunction from '../../../Common/DataModel/PiecewiseFunction'; +import { Bounds, Range } from '../../../types'; +import vtkAbstractMapper3D, { + IAbstractMapper3DInitialValues, +} from '../AbstractMapper3D'; +import { BlendMode, FilterMode } from './Constants'; /** * */ -export interface IVolumeMapperInitialValues extends IAbstractMapper3DInitialValues { - anisotropy?: number; - autoAdjustSampleDistances?: boolean; - averageIPScalarRange?: Range; - blendMode?: BlendMode; - bounds?: Bounds; - computeNormalFromOpacity?: boolean; - getVolumeShadowSamplingDistFactor?: number; - globalIlluminationReach?: number; - imageSampleDistance?: number; - localAmbientOcclusion?: boolean; - maximumSamplesPerRay?: number; - sampleDistance?: number; - LAOKernelRadius?: number; - LAOKernelSize?: number; +export interface IVolumeMapperInitialValues + extends IAbstractMapper3DInitialValues { + anisotropy?: number; + autoAdjustSampleDistances?: boolean; + averageIPScalarRange?: Range; + blendMode?: BlendMode; + bounds?: Bounds; + computeNormalFromOpacity?: boolean; + getVolumeShadowSamplingDistFactor?: number; + globalIlluminationReach?: number; + imageSampleDistance?: number; + localAmbientOcclusion?: boolean; + maximumSamplesPerRay?: number; + sampleDistance?: number; + LAOKernelRadius?: number; + LAOKernelSize?: number; } export interface vtkVolumeMapper extends vtkAbstractMapper3D { - - /** - * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. - * @return {Bounds} The bounds for the mapper. - */ - getBounds(): Bounds; - - /** - * - */ - getBlendMode(): BlendMode; - - /** - * - */ - getBlendModeAsString(): string; - - - /** - * Get the distance between samples used for rendering - * @default 1.0 - */ - getSampleDistance(): number; - - /** - * Sampling distance in the XY image dimensions. - * Default value of 1 meaning 1 ray cast per pixel. If set to 0.5, 4 rays will be cast per pixel. - * If set to 2.0, 1 ray will be cast for every 4 (2 by 2) pixels. T - * @default 1.0 - */ - getImageSampleDistance(): number; - - /** - * - * @default 1000 - */ - getMaximumSamplesPerRay(): number; - - /** - * - * @default true - */ - getAutoAdjustSampleDistances(): boolean; - - /** - * Get at what scale the quality is reduced when interacting for the first time with the volume - * It should should be set before any call to render for this volume - * The higher the scale is, the lower the quality of rendering is during interaction - * @default 1 - */ - getInitialInteractionScale(): number; - - /** - * Get by how much the sample distance should be increased when interacting - * This feature is only implemented in the OpenGL volume mapper - * @default 1 - */ - getInteractionSampleDistanceFactor(): number; - - /** - * - */ - getAverageIPScalarRange(): Range; - - /** - * - */ - getAverageIPScalarRangeByReference(): Range; - - /** - * Get the blending coefficient that interpolates between surface and volume rendering - * @default 0.0 - */ - getVolumetricScatteringBlending(): number; - - /** - * Get the global illumination reach of volume shadow - * @default 0.0 - */ - getGlobalIlluminationReach(): number; - - /** - * Get the multipler for volume shadow sampling distance - * @default 5.0 - */ - getVolumeShadowSamplingDistFactor(): number; - - /** - * Get anisotropy of volume shadow scatter - * @default 0.0 - */ - getAnisotropy(): number; - - /** - * Get local ambient occlusion flag - * @default false - */ - getLocalAmbientOcclusion(): boolean; - - /** - * Get kernel size for local ambient occlusion - * @default 15 - */ - getLAOKernelSize(): number; - - /** - * Get kernel radius for local ambient occlusion - * @default 7 - */ - getLAOKernelRadius(): number; - - /** - * - * @param x - * @param y - */ - setAverageIPScalarRange(x: number, y: number): boolean; - - /** - * - * @param {Range} averageIPScalarRange - */ - setAverageIPScalarRangeFrom(averageIPScalarRange: Range): boolean; - - /** - * Set blend mode to COMPOSITE_BLEND - * @param {BlendMode} blendMode - */ - setBlendMode(blendMode: BlendMode): void; - - /** - * Set blend mode to COMPOSITE_BLEND - */ - setBlendModeToComposite(): void; - - /** - * Set blend mode to MAXIMUM_INTENSITY_BLEND - */ - setBlendModeToMaximumIntensity(): void; - - /** - * Set blend mode to MINIMUM_INTENSITY_BLEND - */ - setBlendModeToMinimumIntensity(): void; - - /** - * Set blend mode to AVERAGE_INTENSITY_BLEND - */ - setBlendModeToAverageIntensity(): void; - - /** - * Set blend mode to RADON_TRANSFORM_BLEND - */ - setBlendModeToRadonTransform(): void; - - /** - * Get the distance between samples used for rendering - * @param sampleDistance - */ - setSampleDistance(sampleDistance: number): boolean; - - /** - * - * @param imageSampleDistance - */ - setImageSampleDistance(imageSampleDistance: number): boolean; - - /** - * - * @param maximumSamplesPerRay - */ - setMaximumSamplesPerRay(maximumSamplesPerRay: number): boolean; - - /** - * - * @param autoAdjustSampleDistances - */ - setAutoAdjustSampleDistances(autoAdjustSampleDistances: boolean): boolean; - - /** - * - * @param initialInteractionScale - */ - setInitialInteractionScale(initialInteractionScale: number): boolean; - - /** - * - * @param interactionSampleDistanceFactor - */ - setInteractionSampleDistanceFactor(interactionSampleDistanceFactor: number): boolean; - - /** - * Set the normal computation to be dependent on the transfer function. - * By default, the mapper relies on the scalar gradient for computing normals at sample locations - * for lighting calculations. This is an approximation and can lead to inaccurate results. - * When enabled, this property makes the mapper compute normals based on the accumulated opacity - * at sample locations. This can generate a more accurate representation of edge structures in the - * data but adds an overhead and drops frame rate. - * @param computeNormalFromOpacity - */ - setComputeNormalFromOpacity(computeNormalFromOpacity: boolean): boolean; - - /** - * Set the blending coefficient that determines the interpolation between surface and volume rendering. - * Default value of 0.0 means shadow effect is computed with phong model. - * Value of 1.0 means shadow is created by volume occlusion. - * @param volumeScatterBlendCoef - */ - setVolumetricScatteringBlending(volumeScatterBlendCoef: number): void; - - /** - * Set the global illumination reach of volume shadow. This function is only effective when volumeScatterBlendCoef is greater than 0. - * Default value of 0.0 means only the neighboring voxel is considered when creating global shadow. - * Value of 1.0 means the shadow ray traverses through the entire volume. - * @param globalIlluminationReach - */ - setGlobalIlluminationReach(globalIlluminationReach: number): void; - - /** - * Set the multipler for volume shadow sampling distance. This function is only effective when volumeScatterBlendCoef is greater than 0. - * For VSSampleDistanceFactor >= 1.0, volume shadow sampling distance = VSSampleDistanceFactor * SampleDistance. - * @param VSSampleDistanceFactor - */ - setVolumeShadowSamplingDistFactor(VSSampleDistanceFactor: number): void; - - /** - * Set anisotropy of volume shadow scatter. This function is only effective when volumeScatterBlendCoef is greater than 0. - * Default value of 0.0 means light scatters uniformly in all directions. - * Value of -1.0 means light scatters backward, value of 1.0 means light scatters forward. - * @param anisotropy - */ - setAnisotropy(anisotropy: number): void; - - /** - * Set whether to turn on local ambient occlusion (LAO). LAO is only effective if shading is on and volumeScatterBlendCoef is set to 0. - * LAO effect is added to ambient lighting, so the ambient component of the actor needs to be great than 0. - * @param localAmbientOcclusion - */ - setLocalAmbientOcclusion(localAmbientOcclusion: boolean): void; - - /** - * Set kernel size for local ambient occlusion. It specifies the number of rays that are randomly sampled in the hemisphere. - * Value is clipped between 1 and 32. - * @param LAOKernelSize - */ - setLAOKernelSize(LAOKernelSize: number): void; - - /** - * Set kernel radius for local ambient occlusion. It specifies the number of samples that are considered on each random ray. - * Value must be greater than or equal to 1. - * @param LAOKernelRadius - */ - setLAOKernelRadius(LAOKernelRadius: number): void; - - /** - * - */ - update(): void; + /** + * Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax]. + * @return {Bounds} The bounds for the mapper. + */ + getBounds(): Bounds; + + /** + * + */ + getBlendMode(): BlendMode; + + /** + * + */ + getBlendModeAsString(): string; + + /** + * Get the distance between samples used for rendering + * @default 1.0 + */ + getSampleDistance(): number; + + /** + * Sampling distance in the XY image dimensions. + * Default value of 1 meaning 1 ray cast per pixel. If set to 0.5, 4 rays will be cast per pixel. + * If set to 2.0, 1 ray will be cast for every 4 (2 by 2) pixels. T + * @default 1.0 + */ + getImageSampleDistance(): number; + + /** + * + * @default 1000 + */ + getMaximumSamplesPerRay(): number; + + /** + * + * @default true + */ + getAutoAdjustSampleDistances(): boolean; + + /** + * Get at what scale the quality is reduced when interacting for the first time with the volume + * It should should be set before any call to render for this volume + * The higher the scale is, the lower the quality of rendering is during interaction + * @default 1 + */ + getInitialInteractionScale(): number; + + /** + * Get by how much the sample distance should be increased when interacting + * This feature is only implemented in the OpenGL volume mapper + * @default 1 + */ + getInteractionSampleDistanceFactor(): number; + + /** + * + */ + getAverageIPScalarRange(): Range; + + /** + * + */ + getAverageIPScalarRangeByReference(): Range; + + /** + * Get the blending coefficient that interpolates between surface and volume rendering + * @default 0.0 + */ + getVolumetricScatteringBlending(): number; + + /** + * Get the global illumination reach of volume shadow + * @default 0.0 + */ + getGlobalIlluminationReach(): number; + + /** + * Get the multipler for volume shadow sampling distance + * @default 5.0 + */ + getVolumeShadowSamplingDistFactor(): number; + + /** + * Get anisotropy of volume shadow scatter + * @default 0.0 + */ + getAnisotropy(): number; + + /** + * Get local ambient occlusion flag + * @default false + */ + getLocalAmbientOcclusion(): boolean; + + /** + * Get kernel size for local ambient occlusion + * @default 15 + */ + getLAOKernelSize(): number; + + /** + * Get kernel radius for local ambient occlusion + * @default 7 + */ + getLAOKernelRadius(): number; + + /** + * + * @param x + * @param y + */ + setAverageIPScalarRange(x: number, y: number): boolean; + + /** + * + * @param {Range} averageIPScalarRange + */ + setAverageIPScalarRangeFrom(averageIPScalarRange: Range): boolean; + + /** + * Set blend mode to COMPOSITE_BLEND + * @param {BlendMode} blendMode + */ + setBlendMode(blendMode: BlendMode): void; + + /** + * Set blend mode to COMPOSITE_BLEND + */ + setBlendModeToComposite(): void; + + /** + * Set blend mode to MAXIMUM_INTENSITY_BLEND + */ + setBlendModeToMaximumIntensity(): void; + + /** + * Set blend mode to MINIMUM_INTENSITY_BLEND + */ + setBlendModeToMinimumIntensity(): void; + + /** + * Set blend mode to AVERAGE_INTENSITY_BLEND + */ + setBlendModeToAverageIntensity(): void; + + /** + * Set blend mode to RADON_TRANSFORM_BLEND + */ + setBlendModeToRadonTransform(): void; + + /** + * Get the distance between samples used for rendering + * @param sampleDistance + */ + setSampleDistance(sampleDistance: number): boolean; + + /** + * + * @param imageSampleDistance + */ + setImageSampleDistance(imageSampleDistance: number): boolean; + + /** + * + * @param maximumSamplesPerRay + */ + setMaximumSamplesPerRay(maximumSamplesPerRay: number): boolean; + + /** + * + * @param autoAdjustSampleDistances + */ + setAutoAdjustSampleDistances(autoAdjustSampleDistances: boolean): boolean; + + /** + * + * @param initialInteractionScale + */ + setInitialInteractionScale(initialInteractionScale: number): boolean; + + /** + * + * @param interactionSampleDistanceFactor + */ + setInteractionSampleDistanceFactor( + interactionSampleDistanceFactor: number + ): boolean; + + /** + * Set the normal computation to be dependent on the transfer function. + * By default, the mapper relies on the scalar gradient for computing normals at sample locations + * for lighting calculations. This is an approximation and can lead to inaccurate results. + * When enabled, this property makes the mapper compute normals based on the accumulated opacity + * at sample locations. This can generate a more accurate representation of edge structures in the + * data but adds an overhead and drops frame rate. + * @param computeNormalFromOpacity + */ + setComputeNormalFromOpacity(computeNormalFromOpacity: boolean): boolean; + + /** + * Set the blending coefficient that determines the interpolation between surface and volume rendering. + * Default value of 0.0 means shadow effect is computed with phong model. + * Value of 1.0 means shadow is created by volume occlusion. + * @param volumeScatterBlendCoef + */ + setVolumetricScatteringBlending(volumeScatterBlendCoef: number): void; + + /** + * Set the global illumination reach of volume shadow. This function is only effective when volumeScatterBlendCoef is greater than 0. + * Default value of 0.0 means only the neighboring voxel is considered when creating global shadow. + * Value of 1.0 means the shadow ray traverses through the entire volume. + * @param globalIlluminationReach + */ + setGlobalIlluminationReach(globalIlluminationReach: number): void; + + /** + * Set the multipler for volume shadow sampling distance. This function is only effective when volumeScatterBlendCoef is greater than 0. + * For VSSampleDistanceFactor >= 1.0, volume shadow sampling distance = VSSampleDistanceFactor * SampleDistance. + * @param VSSampleDistanceFactor + */ + setVolumeShadowSamplingDistFactor(VSSampleDistanceFactor: number): void; + + /** + * Set anisotropy of volume shadow scatter. This function is only effective when volumeScatterBlendCoef is greater than 0. + * Default value of 0.0 means light scatters uniformly in all directions. + * Value of -1.0 means light scatters backward, value of 1.0 means light scatters forward. + * @param anisotropy + */ + setAnisotropy(anisotropy: number): void; + + /** + * Set whether to turn on local ambient occlusion (LAO). LAO is only effective if shading is on and volumeScatterBlendCoef is set to 0. + * LAO effect is added to ambient lighting, so the ambient component of the actor needs to be great than 0. + * @param localAmbientOcclusion + */ + setLocalAmbientOcclusion(localAmbientOcclusion: boolean): void; + + /** + * Set kernel size for local ambient occlusion. It specifies the number of rays that are randomly sampled in the hemisphere. + * Value is clipped between 1 and 32. + * @param LAOKernelSize + */ + setLAOKernelSize(LAOKernelSize: number): void; + + /** + * Set kernel radius for local ambient occlusion. It specifies the number of samples that are considered on each random ray. + * Value must be greater than or equal to 1. + * @param LAOKernelRadius + */ + setLAOKernelRadius(LAOKernelRadius: number): void; + + /** + * + */ + update(): void; } /** @@ -308,11 +311,12 @@ export interface vtkVolumeMapper extends vtkAbstractMapper3D { * @return {vtkPiecewiseFunction} the created absorption transfer function to set on VolumeMapper scalarOpacity. */ export function createRadonTransferFunction( - firstAbsorbentMaterialHounsfieldValue: number, - firstAbsorbentMaterialAbsorption: number, - maxAbsorbentMaterialHounsfieldValue: number, - maxAbsorbentMaterialAbsorption: number, - outputTransferFunction?: vtkPiecewiseFunction): vtkPiecewiseFunction; + firstAbsorbentMaterialHounsfieldValue: number, + firstAbsorbentMaterialAbsorption: number, + maxAbsorbentMaterialHounsfieldValue: number, + maxAbsorbentMaterialAbsorption: number, + outputTransferFunction?: vtkPiecewiseFunction +): vtkPiecewiseFunction; /** * Method use to decorate a given object (publicAPI+model) with vtkVolumeMapper characteristics. @@ -321,21 +325,27 @@ export function createRadonTransferFunction( * @param model object on which data structure will be bounds (protected) * @param {IVolumeMapperInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IVolumeMapperInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IVolumeMapperInitialValues +): void; /** * Method use to create a new instance of vtkVolumeMapper */ -export function newInstance(initialValues?: IVolumeMapperInitialValues): vtkVolumeMapper; +export function newInstance( + initialValues?: IVolumeMapperInitialValues +): vtkVolumeMapper; /** * vtkVolumeMapper inherits from vtkMapper. * A volume mapper that performs ray casting on the GPU using fragment programs. */ export declare const vtkVolumeMapper: { - newInstance: typeof newInstance; - extend: typeof extend; - BlendMode: typeof BlendMode; - FilterMode: typeof FilterMode; + newInstance: typeof newInstance; + extend: typeof extend; + BlendMode: typeof BlendMode; + FilterMode: typeof FilterMode; }; export default vtkVolumeMapper; diff --git a/Sources/Rendering/Core/VolumeProperty/Constants.d.ts b/Sources/Rendering/Core/VolumeProperty/Constants.d.ts index 3c1b7a8bc1b..0465485cb42 100644 --- a/Sources/Rendering/Core/VolumeProperty/Constants.d.ts +++ b/Sources/Rendering/Core/VolumeProperty/Constants.d.ts @@ -1,33 +1,33 @@ export declare enum InterpolationType { - NEAREST = 0, - LINEAR = 1, - FAST_LINEAR = 2 + NEAREST = 0, + LINEAR = 1, + FAST_LINEAR = 2, } export declare enum OpacityMode { - FRACTIONAL = 0, - PROPORTIONAL = 1, + FRACTIONAL = 0, + PROPORTIONAL = 1, } export declare enum ColorMixPreset { - // Add a `//VTK::CustomColorMix` tag to the Fragment shader - // See usage in file `testColorMix` and in function `setColorMixPreset` - CUSTOM = 0, + // Add a `//VTK::CustomColorMix` tag to the Fragment shader + // See usage in file `testColorMix` and in function `setColorMixPreset` + CUSTOM = 0, - // Two components preset - // Out color: sum of colors weighted by opacity - // Out opacity: sum of opacities - ADDITIVE = 1, + // Two components preset + // Out color: sum of colors weighted by opacity + // Out opacity: sum of opacities + ADDITIVE = 1, - // Two components preset - // Out color: color of the first component, colorized by second component with an intensity that is the second component's opacity - // Out opacity: opacity of the first component - COLORIZE = 2, + // Two components preset + // Out color: color of the first component, colorized by second component with an intensity that is the second component's opacity + // Out opacity: opacity of the first component + COLORIZE = 2, } declare const _default: { - InterpolationType: typeof InterpolationType; - OpacityMode: typeof OpacityMode; - ColorMixPreset: typeof ColorMixPreset; + InterpolationType: typeof InterpolationType; + OpacityMode: typeof OpacityMode; + ColorMixPreset: typeof ColorMixPreset; }; export default _default; diff --git a/Sources/Rendering/Core/VolumeProperty/index.d.ts b/Sources/Rendering/Core/VolumeProperty/index.d.ts index fecbef17e8f..12731d92987 100755 --- a/Sources/Rendering/Core/VolumeProperty/index.d.ts +++ b/Sources/Rendering/Core/VolumeProperty/index.d.ts @@ -1,371 +1,375 @@ -import vtkPiecewiseFunction from "../../../Common/DataModel/PiecewiseFunction"; -import { vtkObject } from "../../../interfaces"; -import { Nullable } from "../../../types"; -import vtkColorTransferFunction from "../ColorTransferFunction"; -import { ColorMixPreset, InterpolationType, OpacityMode } from "./Constants"; - -export interface IVolumePropertyInitialValues { - independentComponents?: boolean; - shade?: boolean; - ambient?: number; - diffuse?: number; - specular?: number; - specularPower?: number; - useLabelOutline?: boolean; - labelOutlineThickness?: number | number[]; +import vtkPiecewiseFunction from '../../../Common/DataModel/PiecewiseFunction'; +import { vtkObject } from '../../../interfaces'; +import { Nullable } from '../../../types'; +import vtkColorTransferFunction from '../ColorTransferFunction'; +import { ColorMixPreset, InterpolationType, OpacityMode } from './Constants'; + +export interface IVolumePropertyInitialValues { + independentComponents?: boolean; + shade?: boolean; + ambient?: number; + diffuse?: number; + specular?: number; + specularPower?: number; + useLabelOutline?: boolean; + labelOutlineThickness?: number | number[]; } export interface vtkVolumeProperty extends vtkObject { - - /** - * Get the ambient lighting coefficient. - */ - getAmbient(): number; - - /** - * Return the `Modified Time` which is a monotonic increasing integer - * global for all vtkObjects. - * - * This allow to solve a question such as: - * - Is that object created/modified after another one? - * - Do I need to re-execute this filter, or not? ... - * - * @return {Number} the global modified time. - */ - getMTime(): number; - - /** - * - * @param {Number} index - */ - getColorChannels(index: number): number; - - /** - * Get the diffuse lighting coefficient. - */ - getDiffuse(): number; - - /** - * - * @param {Number} index - */ - getGradientOpacityMaximumOpacity(index: number): number; - - /** - * - * @param {Number} index - */ - getGradientOpacityMaximumValue(index: number): number; - - /** - * - * @param {Number} index - */ - getGradientOpacityMinimumOpacity(index: number): number; - - /** - * - * @param {Number} index - */ - getGradientOpacityMinimumValue(index: number): number; - - /** - * - */ - getColorMixPreset(): Nullable; - - /** - * - */ - getIndependentComponents(): boolean; - - /** - * Get the unit distance on which the scalar opacity transfer function is defined. - * @param {Number} index - */ - getScalarOpacityUnitDistance(index: number): number; - - /** - * Get the currently set gray transfer function. Create one if none set. - * @param {Number} index - */ - getGrayTransferFunction(index: number): vtkPiecewiseFunction; - - /** - * - * @default FRACTIONAL - */ - getOpacityMode(index: number): OpacityMode; - - /** - * gets the label outline thickness - */ - getLabelOutlineThickness(): number; - - /** - * Get the currently set RGB transfer function. Create one if none set. - * @param {Number} index - */ - getRGBTransferFunction(index: number): vtkColorTransferFunction; - - /** - * Get the scalar opacity transfer function. Create one if none set. - * @param {Number} index - */ - getScalarOpacity(index: number): vtkPiecewiseFunction; - - /** - * Get the shading of a volume. - */ - getShade(): boolean; - - /** - * - */ - getSpecular(): number; - - /** - * Get the specular power. - */ - getSpecularPower(): number; - - /** - * - * @param {Number} index - */ - getUseGradientOpacity(index: number): boolean; - - /** - * @see setForceNearestInterpolation - * @param {Number} index - */ - getForceNearestInterpolation(index: number): boolean; - - /** - * - */ - getUseLabelOutline(): boolean; - - /** - * Set the ambient lighting coefficient. - * @param {Number} ambient The ambient lighting coefficient. - */ - setAmbient(ambient: number): boolean; - - /** - * Set the diffuse lighting coefficient. - * @param {Number} diffuse The diffuse lighting coefficient. - */ - setDiffuse(diffuse: number): boolean; - - /** - * - * @param {Number} index - * @param {Number} value - */ - setGradientOpacityMaximumOpacity(index: number, value: number): boolean; - - /** - * - * @param {Number} index - * @param {Number} value - */ - setGradientOpacityMaximumValue(index: number, value: number): boolean; - - /** - * - * @param {Number} index - * @param {Number} value - */ - setGradientOpacityMinimumOpacity(index: number, value: number): boolean; - - /** - * - * @param {Number} index - * @param {Number} value - */ - setGradientOpacityMinimumValue(index: number, value: number): boolean; - - /** - * Set the color of a volume to a gray transfer function - * @param {Number} index - * @param {vtkPiecewiseFunction} func - */ - setGrayTransferFunction(index: number, func: vtkPiecewiseFunction): boolean; - - /** - * Set the color mix code to a preset value - * Set to null to use no preset - * See the test `testColorMix` for an example on how to use this preset. - * - * If set to `CUSTOM`, a tag `//VTK::CustomColorMix` is made available to the - * user who can user shader replacements to put its own code. The given code - * will be used to mix the colors from each component. - * Each component is available as a rgba vec4: `comp0`, `comp1`... - * There are other useful functions or variable available. To find them, - * see `//VTK::CustomComponentsColorMix::Impl` tag in `vtkVolumeFS.glsl`. - */ - setColorMixPreset(preset: Nullable): boolean; - - /** - * Does the data have independent components, or do some define color only? - * If IndependentComponents is On (the default) then each component will be - * independently passed through a lookup table to determine RGBA, shaded. - * - * Some volume Mappers can handle 1 to 4 component unsigned char or unsigned - * short data (see each mapper header file to determine functionality). If - * IndependentComponents is Off, then you must have either 2 or 4 component - * data. For 2 component data, the first is passed through the first color - * transfer function and the second component is passed through the first - * scalar opacity (and gradient opacity) transfer function. Normals will be - * generated off of the second component. When using gradient based opacity - * modulation, the gradients are computed off of the second component. For 4 - * component data, the first three will directly represent RGB (no lookup - * table). The fourth component will be passed through the first scalar - * opacity transfer function for opacity and first gradient opacity transfer - * function for gradient based opacity modulation. Normals will be generated - * from the fourth component. When using gradient based opacity modulation, - * the gradients are computed off of the fourth component. - * @param {Boolean} independentComponents - */ - setIndependentComponents(independentComponents: boolean): boolean; - - /** - * It will set the label outline thickness for the labelmaps. It can accept - * a single number or an array of numbers. If a single number is provided, - * it will be used for all the segments. If an array is provided, it indicates - * the thickness for each segment index. For instance if you have a labelmap - * with 3 segments (0: background 1: liver 2: tumor), you can set the thickness - * to [2,4] to have a thicker outline for the tumor (thickness 4). It should be - * noted that the thickness is in pixel and also the first array value will - * control the default thickness for all labels when 0 or not specified. - * - * @param {Number | Number[]} labelOutlineThickness - */ - setLabelOutlineThickness(labelOutlineThickness: number | number[]): boolean; - - - /** - * - * @param {Number} index - * @param {Number} value - */ - setOpacityMode(index: number, value: number): boolean; - - /** - * Set the unit distance on which the scalar opacity transfer function is - * defined. - * @param {Number} index - * @param {Number} value - */ - setScalarOpacityUnitDistance(index: number, value: number): boolean; - - /** - * Set the shading of a volume. - * - * If shading is turned off, then the mapper for the volume will not perform - * shading calculations. If shading is turned on, the mapper may perform - * shading calculations - in some cases shading does not apply (for example, - * in a maximum intensity projection) and therefore shading will not be - * performed even if this flag is on. For a compositing type of mapper, - * turning shading off is generally the same as setting ambient=1, - * diffuse=0, specular=0. Shading can be independently turned on/off per - * component. - * @param {Boolean} shade - */ - setShade(shade: boolean): boolean; - - /** - * - * @param {Number} specular - */ - setSpecular(specular: number): boolean; - - /** - * Set the specular power. - * @param {Number} specularPower - */ - setSpecularPower(specularPower: number): boolean; - - /** - * - * @param {Number} index - * @param {Boolean} value - */ - setUseGradientOpacity(index: number, value: boolean): boolean; - - /** - * - * @param {Boolean} useLabelOutline - */ - setUseLabelOutline(useLabelOutline: boolean): boolean; - - /** - * Set the color of a volume to an RGB transfer function - * @param {Number} index - * @param {vtkColorTransferFunction} func - */ - setRGBTransferFunction(index: number, func?: Nullable): boolean; - - /** - * Set the scalar opacity of a volume to a transfer function - * @param {Number} index - * @param {vtkPiecewiseFunction} func - */ - setScalarOpacity(index: number, func?: Nullable): boolean; - - /** - * Set the scalar component weights. - * @param {Number} index - * @param {Number} value - */ - setComponentWeight(index: number, value: number): boolean; - - /** - * Force the nearest neighbor interpolation of one or more of the components - * The interpolation for the rest of the volume is set using `setInterpolationType` - * @see setInterpolationType - * @param {Number} index - * @param {Boolean} value - */ - setForceNearestInterpolation(index: number, value: boolean): boolean; - - /** - * Get the scalar component weights. - * @param {Number} index - */ - getComponentWeight(index: number): number; - - /** - * Set the interpolation type for sampling a volume. - * @param {InterpolationType} interpolationType - */ - setInterpolationType(interpolationType: InterpolationType): boolean; - - /** - * Set interpolation type to NEAREST - */ - setInterpolationTypeToNearest(): boolean; - - /** - * Set interpolation type to LINEAR - */ - setInterpolationTypeToLinear(): boolean; - - /** - * Set interpolation type to FAST_LINEAR - */ - setInterpolationTypeToFastLinear(): boolean; - - /** - * Get the interpolation type for sampling a volume. - */ - getInterpolationType(): InterpolationType; - - /** - * Get the interpolation type for sampling a volume as a string. - */ - getInterpolationTypeAsString(): string; + /** + * Get the ambient lighting coefficient. + */ + getAmbient(): number; + + /** + * Return the `Modified Time` which is a monotonic increasing integer + * global for all vtkObjects. + * + * This allow to solve a question such as: + * - Is that object created/modified after another one? + * - Do I need to re-execute this filter, or not? ... + * + * @return {Number} the global modified time. + */ + getMTime(): number; + + /** + * + * @param {Number} index + */ + getColorChannels(index: number): number; + + /** + * Get the diffuse lighting coefficient. + */ + getDiffuse(): number; + + /** + * + * @param {Number} index + */ + getGradientOpacityMaximumOpacity(index: number): number; + + /** + * + * @param {Number} index + */ + getGradientOpacityMaximumValue(index: number): number; + + /** + * + * @param {Number} index + */ + getGradientOpacityMinimumOpacity(index: number): number; + + /** + * + * @param {Number} index + */ + getGradientOpacityMinimumValue(index: number): number; + + /** + * + */ + getColorMixPreset(): Nullable; + + /** + * + */ + getIndependentComponents(): boolean; + + /** + * Get the unit distance on which the scalar opacity transfer function is defined. + * @param {Number} index + */ + getScalarOpacityUnitDistance(index: number): number; + + /** + * Get the currently set gray transfer function. Create one if none set. + * @param {Number} index + */ + getGrayTransferFunction(index: number): vtkPiecewiseFunction; + + /** + * + * @default FRACTIONAL + */ + getOpacityMode(index: number): OpacityMode; + + /** + * gets the label outline thickness + */ + getLabelOutlineThickness(): number; + + /** + * Get the currently set RGB transfer function. Create one if none set. + * @param {Number} index + */ + getRGBTransferFunction(index: number): vtkColorTransferFunction; + + /** + * Get the scalar opacity transfer function. Create one if none set. + * @param {Number} index + */ + getScalarOpacity(index: number): vtkPiecewiseFunction; + + /** + * Get the shading of a volume. + */ + getShade(): boolean; + + /** + * + */ + getSpecular(): number; + + /** + * Get the specular power. + */ + getSpecularPower(): number; + + /** + * + * @param {Number} index + */ + getUseGradientOpacity(index: number): boolean; + + /** + * @see setForceNearestInterpolation + * @param {Number} index + */ + getForceNearestInterpolation(index: number): boolean; + + /** + * + */ + getUseLabelOutline(): boolean; + + /** + * Set the ambient lighting coefficient. + * @param {Number} ambient The ambient lighting coefficient. + */ + setAmbient(ambient: number): boolean; + + /** + * Set the diffuse lighting coefficient. + * @param {Number} diffuse The diffuse lighting coefficient. + */ + setDiffuse(diffuse: number): boolean; + + /** + * + * @param {Number} index + * @param {Number} value + */ + setGradientOpacityMaximumOpacity(index: number, value: number): boolean; + + /** + * + * @param {Number} index + * @param {Number} value + */ + setGradientOpacityMaximumValue(index: number, value: number): boolean; + + /** + * + * @param {Number} index + * @param {Number} value + */ + setGradientOpacityMinimumOpacity(index: number, value: number): boolean; + + /** + * + * @param {Number} index + * @param {Number} value + */ + setGradientOpacityMinimumValue(index: number, value: number): boolean; + + /** + * Set the color of a volume to a gray transfer function + * @param {Number} index + * @param {vtkPiecewiseFunction} func + */ + setGrayTransferFunction(index: number, func: vtkPiecewiseFunction): boolean; + + /** + * Set the color mix code to a preset value + * Set to null to use no preset + * See the test `testColorMix` for an example on how to use this preset. + * + * If set to `CUSTOM`, a tag `//VTK::CustomColorMix` is made available to the + * user who can user shader replacements to put its own code. The given code + * will be used to mix the colors from each component. + * Each component is available as a rgba vec4: `comp0`, `comp1`... + * There are other useful functions or variable available. To find them, + * see `//VTK::CustomComponentsColorMix::Impl` tag in `vtkVolumeFS.glsl`. + */ + setColorMixPreset(preset: Nullable): boolean; + + /** + * Does the data have independent components, or do some define color only? + * If IndependentComponents is On (the default) then each component will be + * independently passed through a lookup table to determine RGBA, shaded. + * + * Some volume Mappers can handle 1 to 4 component unsigned char or unsigned + * short data (see each mapper header file to determine functionality). If + * IndependentComponents is Off, then you must have either 2 or 4 component + * data. For 2 component data, the first is passed through the first color + * transfer function and the second component is passed through the first + * scalar opacity (and gradient opacity) transfer function. Normals will be + * generated off of the second component. When using gradient based opacity + * modulation, the gradients are computed off of the second component. For 4 + * component data, the first three will directly represent RGB (no lookup + * table). The fourth component will be passed through the first scalar + * opacity transfer function for opacity and first gradient opacity transfer + * function for gradient based opacity modulation. Normals will be generated + * from the fourth component. When using gradient based opacity modulation, + * the gradients are computed off of the fourth component. + * @param {Boolean} independentComponents + */ + setIndependentComponents(independentComponents: boolean): boolean; + + /** + * It will set the label outline thickness for the labelmaps. It can accept + * a single number or an array of numbers. If a single number is provided, + * it will be used for all the segments. If an array is provided, it indicates + * the thickness for each segment index. For instance if you have a labelmap + * with 3 segments (0: background 1: liver 2: tumor), you can set the thickness + * to [2,4] to have a thicker outline for the tumor (thickness 4). It should be + * noted that the thickness is in pixel and also the first array value will + * control the default thickness for all labels when 0 or not specified. + * + * @param {Number | Number[]} labelOutlineThickness + */ + setLabelOutlineThickness(labelOutlineThickness: number | number[]): boolean; + + /** + * + * @param {Number} index + * @param {Number} value + */ + setOpacityMode(index: number, value: number): boolean; + + /** + * Set the unit distance on which the scalar opacity transfer function is + * defined. + * @param {Number} index + * @param {Number} value + */ + setScalarOpacityUnitDistance(index: number, value: number): boolean; + + /** + * Set the shading of a volume. + * + * If shading is turned off, then the mapper for the volume will not perform + * shading calculations. If shading is turned on, the mapper may perform + * shading calculations - in some cases shading does not apply (for example, + * in a maximum intensity projection) and therefore shading will not be + * performed even if this flag is on. For a compositing type of mapper, + * turning shading off is generally the same as setting ambient=1, + * diffuse=0, specular=0. Shading can be independently turned on/off per + * component. + * @param {Boolean} shade + */ + setShade(shade: boolean): boolean; + + /** + * + * @param {Number} specular + */ + setSpecular(specular: number): boolean; + + /** + * Set the specular power. + * @param {Number} specularPower + */ + setSpecularPower(specularPower: number): boolean; + + /** + * + * @param {Number} index + * @param {Boolean} value + */ + setUseGradientOpacity(index: number, value: boolean): boolean; + + /** + * + * @param {Boolean} useLabelOutline + */ + setUseLabelOutline(useLabelOutline: boolean): boolean; + + /** + * Set the color of a volume to an RGB transfer function + * @param {Number} index + * @param {vtkColorTransferFunction} func + */ + setRGBTransferFunction( + index: number, + func?: Nullable + ): boolean; + + /** + * Set the scalar opacity of a volume to a transfer function + * @param {Number} index + * @param {vtkPiecewiseFunction} func + */ + setScalarOpacity( + index: number, + func?: Nullable + ): boolean; + + /** + * Set the scalar component weights. + * @param {Number} index + * @param {Number} value + */ + setComponentWeight(index: number, value: number): boolean; + + /** + * Force the nearest neighbor interpolation of one or more of the components + * The interpolation for the rest of the volume is set using `setInterpolationType` + * @see setInterpolationType + * @param {Number} index + * @param {Boolean} value + */ + setForceNearestInterpolation(index: number, value: boolean): boolean; + + /** + * Get the scalar component weights. + * @param {Number} index + */ + getComponentWeight(index: number): number; + + /** + * Set the interpolation type for sampling a volume. + * @param {InterpolationType} interpolationType + */ + setInterpolationType(interpolationType: InterpolationType): boolean; + + /** + * Set interpolation type to NEAREST + */ + setInterpolationTypeToNearest(): boolean; + + /** + * Set interpolation type to LINEAR + */ + setInterpolationTypeToLinear(): boolean; + + /** + * Set interpolation type to FAST_LINEAR + */ + setInterpolationTypeToFastLinear(): boolean; + + /** + * Get the interpolation type for sampling a volume. + */ + getInterpolationType(): InterpolationType; + + /** + * Get the interpolation type for sampling a volume as a string. + */ + getInterpolationTypeAsString(): string; } /** @@ -375,12 +379,18 @@ export interface vtkVolumeProperty extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IVolumePropertyInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IVolumePropertyInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IVolumePropertyInitialValues +): void; /** * Method use to create a new instance of vtkVolumeProperty */ -export function newInstance(initialValues?: IVolumePropertyInitialValues): vtkVolumeProperty; +export function newInstance( + initialValues?: IVolumePropertyInitialValues +): vtkVolumeProperty; /** * vtkVolumeProperty is used to represent common properties associated @@ -448,9 +458,9 @@ export function newInstance(initialValues?: IVolumePropertyInitialValues): vtkVo * ``` */ export declare const vtkVolumeProperty: { - newInstance: typeof newInstance; - extend: typeof extend; - InterpolationType: typeof InterpolationType; - OpacityMode: typeof OpacityMode; + newInstance: typeof newInstance; + extend: typeof extend; + InterpolationType: typeof InterpolationType; + OpacityMode: typeof OpacityMode; }; export default vtkVolumeProperty; diff --git a/Sources/Rendering/Misc/CanvasView/index.d.ts b/Sources/Rendering/Misc/CanvasView/index.d.ts index 03f94c95be8..8694e605b57 100644 --- a/Sources/Rendering/Misc/CanvasView/index.d.ts +++ b/Sources/Rendering/Misc/CanvasView/index.d.ts @@ -1,153 +1,150 @@ -import { vtkObject } from "../../../interfaces"; -import { Size } from "../../../types"; - +import { vtkObject } from '../../../interfaces'; +import { Size } from '../../../types'; /** * */ export interface ICanvasViewInitialValues { - canvas?: HTMLCanvasElement; - size?: Size; - cursorVisibility?: boolean; - cursor?: string; - useOffScreen?: boolean; - useBackgroundImage?: boolean; + canvas?: HTMLCanvasElement; + size?: Size; + cursorVisibility?: boolean; + cursor?: string; + useOffScreen?: boolean; + useBackgroundImage?: boolean; } - export interface vtkCanvasView extends vtkObject { - - /** - * Get the canvas element - */ - getCanvas(): HTMLCanvasElement; - - /** - * Get the used cursor - */ - getCursor(): string; - - /** - * - */ - getInteractive(): boolean; - - /** - * Get the interactor - */ - getInteractor(): any; - - /** - * - */ - getRenderable(): any; - - /** - * - */ - getRenderers(): any[]; - - /** - * - */ - getRenderersByReference(): any[]; - - /** - * Get the size of the canvas view - */ - getSize(): Size; - - /** - * Get the size of the canvas view - */ - getSizeByReference(): boolean; - - /** - * - */ - getUseBackgroundImage(): boolean; - - /** - * - */ - getUseOffScreen(): boolean; - - /** - * - */ - isInViewport(): boolean; - - /** - * - * @param {HTMLImageElement} backgroundImage The background image HTML element. - */ - setBackgroundImage(backgroundImage: HTMLImageElement): boolean; - - /** - * - * @param {HTMLCanvasElement} canvas The canvas HTML element. - */ - setCanvas(canvas: HTMLCanvasElement): boolean; - - /** - * - * @param {HTMLElement} container The container HTML element. - */ - setContainer(container: HTMLElement): boolean; - - /** - * - * @param {String} cursor The used cursor. - */ - setCursor(cursor: string): boolean; - - /** - * - * @param interactor - */ - setInteractor(interactor: any): boolean; - - /** - * Set the size of the canvas view. - * @param {Size} size The size of the canvas view. - */ - setSize(size: Size): boolean; - - /** - * Set the size of the canvas view. - * @param {Number} width The width of the canvas view. - * @param {Number} height The height of the canvas view. - */ - setSize(width: number, height: number): boolean; - - /** - * Set the size of the canvas view. - * @param {Size} size The size of the canvas view. - */ - setSizeFrom(size: Size): boolean; - - /** - * - * @param useBackgroundImage - */ - setUseBackgroundImage(useBackgroundImage: boolean): void; - - /** - * - * @param useOffScreen - */ - setUseOffScreen(useOffScreen: boolean): boolean; - - /** - * - * @param viewStream - */ - setViewStream(viewStream: any): boolean; // viewStream is vtkViewStream - - /** - * - */ - traverseAllPasses(): void; + /** + * Get the canvas element + */ + getCanvas(): HTMLCanvasElement; + + /** + * Get the used cursor + */ + getCursor(): string; + + /** + * + */ + getInteractive(): boolean; + + /** + * Get the interactor + */ + getInteractor(): any; + + /** + * + */ + getRenderable(): any; + + /** + * + */ + getRenderers(): any[]; + + /** + * + */ + getRenderersByReference(): any[]; + + /** + * Get the size of the canvas view + */ + getSize(): Size; + + /** + * Get the size of the canvas view + */ + getSizeByReference(): boolean; + + /** + * + */ + getUseBackgroundImage(): boolean; + + /** + * + */ + getUseOffScreen(): boolean; + + /** + * + */ + isInViewport(): boolean; + + /** + * + * @param {HTMLImageElement} backgroundImage The background image HTML element. + */ + setBackgroundImage(backgroundImage: HTMLImageElement): boolean; + + /** + * + * @param {HTMLCanvasElement} canvas The canvas HTML element. + */ + setCanvas(canvas: HTMLCanvasElement): boolean; + + /** + * + * @param {HTMLElement} container The container HTML element. + */ + setContainer(container: HTMLElement): boolean; + + /** + * + * @param {String} cursor The used cursor. + */ + setCursor(cursor: string): boolean; + + /** + * + * @param interactor + */ + setInteractor(interactor: any): boolean; + + /** + * Set the size of the canvas view. + * @param {Size} size The size of the canvas view. + */ + setSize(size: Size): boolean; + + /** + * Set the size of the canvas view. + * @param {Number} width The width of the canvas view. + * @param {Number} height The height of the canvas view. + */ + setSize(width: number, height: number): boolean; + + /** + * Set the size of the canvas view. + * @param {Size} size The size of the canvas view. + */ + setSizeFrom(size: Size): boolean; + + /** + * + * @param useBackgroundImage + */ + setUseBackgroundImage(useBackgroundImage: boolean): void; + + /** + * + * @param useOffScreen + */ + setUseOffScreen(useOffScreen: boolean): boolean; + + /** + * + * @param viewStream + */ + setViewStream(viewStream: any): boolean; // viewStream is vtkViewStream + + /** + * + */ + traverseAllPasses(): void; } /** @@ -157,19 +154,25 @@ export interface vtkCanvasView extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {ICanvasViewInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ICanvasViewInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ICanvasViewInitialValues +): void; /** * Method used to create a new instance of vtkCanvasView * @param {ICanvasViewInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ICanvasViewInitialValues): vtkCanvasView; +export function newInstance( + initialValues?: ICanvasViewInitialValues +): vtkCanvasView; /** * vtkCanvasView provides a way to create a canvas view. */ export declare const vtkCanvasView: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkCanvasView; diff --git a/Sources/Rendering/Misc/FullScreenRenderWindow/index.d.ts b/Sources/Rendering/Misc/FullScreenRenderWindow/index.d.ts index ef239cac32b..c90271255c6 100644 --- a/Sources/Rendering/Misc/FullScreenRenderWindow/index.d.ts +++ b/Sources/Rendering/Misc/FullScreenRenderWindow/index.d.ts @@ -1,122 +1,119 @@ -import { vtkObject } from "../../../interfaces"; -import { RGBAColor, RGBColor } from "../../../types"; -import vtkRenderer from "../../Core/Renderer"; -import vtkRenderWindow from "../../Core/RenderWindow"; -import vtkRenderWindowInteractor from "../../Core/RenderWindowInteractor"; +import { vtkObject } from '../../../interfaces'; +import { RGBAColor, RGBColor } from '../../../types'; +import vtkRenderer from '../../Core/Renderer'; +import vtkRenderWindow from '../../Core/RenderWindow'; +import vtkRenderWindowInteractor from '../../Core/RenderWindowInteractor'; // import vtkOpenGLRenderWindow from "../../../OpenGL/RenderWindow"; // import vtkWebGPURenderWindow from "../../../WebGPU/RenderWindow"; - /** * */ export interface IFullScreenRenderWindowInitialValues { - background?: RGBColor | RGBAColor; - container?: HTMLElement - containerStyle?: object; - controlPanelStyle?: object; - controllerVisibility?: boolean; - defaultViewAPI?: boolean; - listenWindowResize?: boolean; - resizeCallback?: any; + background?: RGBColor | RGBAColor; + container?: HTMLElement; + containerStyle?: object; + controlPanelStyle?: object; + controllerVisibility?: boolean; + defaultViewAPI?: boolean; + listenWindowResize?: boolean; + resizeCallback?: any; } - export interface vtkFullScreenRenderWindow extends vtkObject { - - /** - * - * @param {HTMLElement} html - */ - addController(html : HTMLElement): void; - - /** - * Representation API - * @param representation - */ - addRepresentation(representation : any): void; - - /** - * Release GL context - */ - delete(): void; - - /** - * Returns vtkWebGPURenderWindow if ?viewAPI='WebGPU' is in URL, or if - * vtkFullScreenRenderWindow has been created with "defaultViewAPI: 'WebGPU", - * otherwise vtkOpenGLRenderWindow is returned. - */ - getApiSpecificRenderWindow(): any; // vtkOpenGLRenderWindow || vtkWebGPURenderWindow - - /** - * Get container element - */ - getContainer(): HTMLElement; - - /** - * Get control container element - */ - getControlContainer(): HTMLElement; - - /** - * Get interactor object - */ - getInteractor(): vtkRenderWindowInteractor; - - /** - * Get Render windows object - */ - getRenderWindow(): vtkRenderWindow; - - /** - * Get Renderer object - */ - getRenderer(): vtkRenderer; - - /** - * Get root container element - */ - getRootContainer(): HTMLElement; - - /** - * Remove controller - */ - removeController(): void; - - /** - * Remove representation - * @param representation - */ - removeRepresentation(representation : any): void; - - /** - * Handle window resize - */ - resize(): void; - - /** - * Set background color - * @param {RGBColor | RGBAColor} background The background color. - */ - setBackground(background: RGBColor | RGBAColor): boolean; - - /** - * Hide or show controller - * @param {Boolean} visible - */ - setControllerVisibility(visible : boolean): void; - - /** - * - * @param cb - */ - setResizeCallback(cb : any): void; - - /** - * Toggle controller visibility - */ - toggleControllerVisibility(): void; + /** + * + * @param {HTMLElement} html + */ + addController(html: HTMLElement): void; + + /** + * Representation API + * @param representation + */ + addRepresentation(representation: any): void; + + /** + * Release GL context + */ + delete(): void; + + /** + * Returns vtkWebGPURenderWindow if ?viewAPI='WebGPU' is in URL, or if + * vtkFullScreenRenderWindow has been created with "defaultViewAPI: 'WebGPU", + * otherwise vtkOpenGLRenderWindow is returned. + */ + getApiSpecificRenderWindow(): any; // vtkOpenGLRenderWindow || vtkWebGPURenderWindow + + /** + * Get container element + */ + getContainer(): HTMLElement; + + /** + * Get control container element + */ + getControlContainer(): HTMLElement; + + /** + * Get interactor object + */ + getInteractor(): vtkRenderWindowInteractor; + + /** + * Get Render windows object + */ + getRenderWindow(): vtkRenderWindow; + + /** + * Get Renderer object + */ + getRenderer(): vtkRenderer; + + /** + * Get root container element + */ + getRootContainer(): HTMLElement; + + /** + * Remove controller + */ + removeController(): void; + + /** + * Remove representation + * @param representation + */ + removeRepresentation(representation: any): void; + + /** + * Handle window resize + */ + resize(): void; + + /** + * Set background color + * @param {RGBColor | RGBAColor} background The background color. + */ + setBackground(background: RGBColor | RGBAColor): boolean; + + /** + * Hide or show controller + * @param {Boolean} visible + */ + setControllerVisibility(visible: boolean): void; + + /** + * + * @param cb + */ + setResizeCallback(cb: any): void; + + /** + * Toggle controller visibility + */ + toggleControllerVisibility(): void; } /** @@ -126,20 +123,26 @@ export interface vtkFullScreenRenderWindow extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IFullScreenRenderWindowInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IFullScreenRenderWindowInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IFullScreenRenderWindowInitialValues +): void; /** * Method used to create a new instance of vtkFullScreenRenderWindow * @param {IFullScreenRenderWindowInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IFullScreenRenderWindowInitialValues): vtkFullScreenRenderWindow; +export function newInstance( + initialValues?: IFullScreenRenderWindowInitialValues +): vtkFullScreenRenderWindow; /** * vtkFullScreenRenderWindow provides a skeleton for implementing a fullscreen * render window. */ export declare const vtkFullScreenRenderWindow: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkFullScreenRenderWindow; diff --git a/Sources/Rendering/Misc/GenericRenderWindow/index.d.ts b/Sources/Rendering/Misc/GenericRenderWindow/index.d.ts index 1521cfab6bd..1d1c8904f5b 100644 --- a/Sources/Rendering/Misc/GenericRenderWindow/index.d.ts +++ b/Sources/Rendering/Misc/GenericRenderWindow/index.d.ts @@ -1,78 +1,76 @@ -import { vtkObject, vtkSubscription } from "../../../interfaces"; -import { RGBAColor, RGBColor } from "../../../types"; -import vtkRenderer from "../../Core/Renderer"; -import vtkRenderWindow from "../../Core/RenderWindow"; -import vtkRenderWindowInteractor from "../../Core/RenderWindowInteractor"; -import vtkOpenGLRenderWindow from "../../OpenGL/RenderWindow"; -import vtkWebGPURenderWindow from "../../WebGPU/RenderWindow"; - +import { vtkObject, vtkSubscription } from '../../../interfaces'; +import { RGBAColor, RGBColor } from '../../../types'; +import vtkRenderer from '../../Core/Renderer'; +import vtkRenderWindow from '../../Core/RenderWindow'; +import vtkRenderWindowInteractor from '../../Core/RenderWindowInteractor'; +import vtkOpenGLRenderWindow from '../../OpenGL/RenderWindow'; +import vtkWebGPURenderWindow from '../../WebGPU/RenderWindow'; /** * */ export interface IGenericRenderWindowInitialValues { - background?: RGBColor|RGBAColor; - listenWindowResize?: boolean; - container?: HTMLElement, + background?: RGBColor | RGBAColor; + listenWindowResize?: boolean; + container?: HTMLElement; } export interface vtkGenericRenderWindow extends vtkObject { - - /** - * Release GL context - */ - delete(): void; - - /** - * Get container element - */ - getContainer(): HTMLElement; - - /** - * Get interactor object - */ - getInteractor(): vtkRenderWindowInteractor; - - /** - * Get the render back-end specific render window. - */ - getApiSpecificRenderWindow(): vtkOpenGLRenderWindow|vtkWebGPURenderWindow; - - /** - * - */ - getRenderWindow(): vtkRenderWindow; - - /** - * - */ - getRenderer(): vtkRenderer; - - /** - * Method to register callback when the object is resize(). - * - * @param callback function - * @returns subscription object so you can easily unsubscribe later on - */ - onResize(callback: (instance: vtkObject) => any): vtkSubscription; - - /** - * Handle window resize - */ - resize(): void; - - /** - * Set background color - * @param {RGBColor|RGBAColor} background The background color. - * @returns true if the background color actually changed, false otherwise - */ - setBackground(background: RGBColor|RGBAColor): boolean; - - /** - * Set thecontainer element - * @param {HTMLElement} el The container element. - */ - setContainer(el: HTMLElement): void; + /** + * Release GL context + */ + delete(): void; + + /** + * Get container element + */ + getContainer(): HTMLElement; + + /** + * Get interactor object + */ + getInteractor(): vtkRenderWindowInteractor; + + /** + * Get the render back-end specific render window. + */ + getApiSpecificRenderWindow(): vtkOpenGLRenderWindow | vtkWebGPURenderWindow; + + /** + * + */ + getRenderWindow(): vtkRenderWindow; + + /** + * + */ + getRenderer(): vtkRenderer; + + /** + * Method to register callback when the object is resize(). + * + * @param callback function + * @returns subscription object so you can easily unsubscribe later on + */ + onResize(callback: (instance: vtkObject) => any): vtkSubscription; + + /** + * Handle window resize + */ + resize(): void; + + /** + * Set background color + * @param {RGBColor|RGBAColor} background The background color. + * @returns true if the background color actually changed, false otherwise + */ + setBackground(background: RGBColor | RGBAColor): boolean; + + /** + * Set thecontainer element + * @param {HTMLElement} el The container element. + */ + setContainer(el: HTMLElement): void; } /** @@ -82,20 +80,26 @@ export interface vtkGenericRenderWindow extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IGenericRenderWindowInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IGenericRenderWindowInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IGenericRenderWindowInitialValues +): void; /** * Method used to create a new instance of vtkGenericRenderWindow * @param {IGenericRenderWindowInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IGenericRenderWindowInitialValues): vtkGenericRenderWindow; +export function newInstance( + initialValues?: IGenericRenderWindowInitialValues +): vtkGenericRenderWindow; /** * vtkGenericRenderWindow provides a skeleton for implementing a render window * using one's own OpenGL context and drawable. */ export declare const vtkGenericRenderWindow: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkGenericRenderWindow; diff --git a/Sources/Rendering/Misc/RenderWindowWithControlBar/index.d.ts b/Sources/Rendering/Misc/RenderWindowWithControlBar/index.d.ts index c58eedf7b38..e2d960ec58f 100644 --- a/Sources/Rendering/Misc/RenderWindowWithControlBar/index.d.ts +++ b/Sources/Rendering/Misc/RenderWindowWithControlBar/index.d.ts @@ -1,50 +1,51 @@ - -import { Placement } from "../../../types"; -import vtkGenericRenderWindow, { IGenericRenderWindowInitialValues } from "../GenericRenderWindow"; +import { Placement } from '../../../types'; +import vtkGenericRenderWindow, { + IGenericRenderWindowInitialValues, +} from '../GenericRenderWindow'; /** * */ -export interface IRenderWindowWithControlBarInitialValues extends IGenericRenderWindowInitialValues{ - rootContainer?: HTMLElement, - controlPosition?: Placement; - controlSize?: number; +export interface IRenderWindowWithControlBarInitialValues + extends IGenericRenderWindowInitialValues { + rootContainer?: HTMLElement; + controlPosition?: Placement; + controlSize?: number; } export interface vtkRenderWindowWithControlBar extends vtkGenericRenderWindow { + /** + * Get control bar container element + */ + getControlContainer(): HTMLElement; - /** - * Get control bar container element - */ - getControlContainer(): HTMLElement; - - /** - * Get RenderWindow container element - */ - getRenderWindowContainer(): HTMLElement; + /** + * Get RenderWindow container element + */ + getRenderWindowContainer(): HTMLElement; - /** - * Get root container element - */ - getRootContainer(): HTMLElement; + /** + * Get root container element + */ + getRootContainer(): HTMLElement; - /** - * Set control container element - * @param {HTMLElement} el - */ - setContainer(el: HTMLElement): void; + /** + * Set control container element + * @param {HTMLElement} el + */ + setContainer(el: HTMLElement): void; - /** - * Set control container element - * @param {Number} size Size of the control bar. - */ - setControlSize(size: number): void; + /** + * Set control container element + * @param {Number} size Size of the control bar. + */ + setControlSize(size: number): void; - /** - * Set control container element - * @param {Placement} position Position of the control bar. - */ - setControlPosition(position: Placement): void; + /** + * Set control container element + * @param {Placement} position Position of the control bar. + */ + setControlPosition(position: Placement): void; } /** @@ -54,20 +55,26 @@ export interface vtkRenderWindowWithControlBar extends vtkGenericRenderWindow { * @param model object on which data structure will be bounds (protected) * @param {IRenderWindowWithControlBarInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IRenderWindowWithControlBarInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IRenderWindowWithControlBarInitialValues +): void; /** * Method used to create a new instance of vtkRenderWindowWithControlBar * @param {IRenderWindowWithControlBarInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IRenderWindowWithControlBarInitialValues): vtkRenderWindowWithControlBar; +export function newInstance( + initialValues?: IRenderWindowWithControlBarInitialValues +): vtkRenderWindowWithControlBar; /** * vtkRenderWindowWithControlBar provides a skeleton for implementing a render window * with a control bar. */ export declare const vtkRenderWindowWithControlBar: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkRenderWindowWithControlBar; diff --git a/Sources/Rendering/Misc/SynchronizableRenderWindow/ObjectManager/index.d.ts b/Sources/Rendering/Misc/SynchronizableRenderWindow/ObjectManager/index.d.ts index 1cb4f540b94..81b86041553 100644 --- a/Sources/Rendering/Misc/SynchronizableRenderWindow/ObjectManager/index.d.ts +++ b/Sources/Rendering/Misc/SynchronizableRenderWindow/ObjectManager/index.d.ts @@ -1,9 +1,16 @@ -import { vtkObject } from "../../../../interfaces" ; -import { Nullable } from "../../../../types" ; -import { ISynchronizerContext, IViewState } from ".."; +import { vtkObject } from '../../../../interfaces'; +import { Nullable } from '../../../../types'; +import { ISynchronizerContext, IViewState } from '..'; -export type BuilderFunction = (type: string, initialProps?: Record) => Nullable; -export type UpdaterFunction = (instance: vtkObject, state: IViewState, context: ISynchronizerContext) => void; +export type BuilderFunction = ( + type: string, + initialProps?: Record +) => Nullable; +export type UpdaterFunction = ( + instance: vtkObject, + state: IViewState, + context: ISynchronizerContext +) => void; export interface IObjectManager { /** @@ -12,65 +19,78 @@ export interface IObjectManager { build: BuilderFunction; /** - * @param {String} type The type to update - * @param {vtkObject} instance The specific instance - * @param {IViewState} props - * @param {ISynchronizerContext} context + * @param {String} type The type to update + * @param {vtkObject} instance The specific instance + * @param {IViewState} props + * @param {ISynchronizerContext} context */ - update(type: string, instance: vtkObject, props: IViewState, context: ISynchronizerContext): Promise; + update( + type: string, + instance: vtkObject, + props: IViewState, + context: ISynchronizerContext + ): Promise; /** * Defines a new type handler with the specified builder and updater functions - * + * * @param {String} type The type you wish to register - * @param {BuilderFunction} [buildFn] The builder function to associate with the type - * @param {UpdaterFunction} [updateFn] The updater function to associate with the type + * @param {BuilderFunction} [buildFn] The builder function to associate with the type + * @param {UpdaterFunction} [updateFn] The updater function to associate with the type */ - setTypeMapping(type: string, buildFn?: BuilderFunction, updateFn?: UpdaterFunction): void; - + setTypeMapping( + type: string, + buildFn?: BuilderFunction, + updateFn?: UpdaterFunction + ): void; + /** * Clear all type mappings */ clearTypeMapping(): void; - + /** * Get a list of all supported types - * + * * @returns {string[]} */ getSupportedTypes(): string[]; - + /** * Clear all one time updaters */ clearOneTimeUpdaters(): void; - + /** * Update the associated render window */ updateRenderWindow(): void; - + /** * Register a new type to exclude - * - * @param {string} type The type to exclude + * + * @param {string} type The type to exclude * @param {string} propertyName The property name to exclude - * @param {unknown} propertyValue The property value to exclude + * @param {unknown} propertyValue The property value to exclude */ - excludeInstance(type: string, propertyName: string, propertyValue: unknown): void; - + excludeInstance( + type: string, + propertyName: string, + propertyValue: unknown + ): void; + /** * Set the default types mapping - * - * @param {boolean} [reset] Clear all existing type mappings, defaults to true + * + * @param {boolean} [reset] Clear all existing type mappings, defaults to true */ setDefaultMapping(reset?: boolean): void; - + /** * Apply the default aliases */ applyDefaultAliases(): void; - + /** * Always update the camera */ diff --git a/Sources/Rendering/Misc/SynchronizableRenderWindow/index.d.ts b/Sources/Rendering/Misc/SynchronizableRenderWindow/index.d.ts index db8f831b293..bdecb9b77bf 100644 --- a/Sources/Rendering/Misc/SynchronizableRenderWindow/index.d.ts +++ b/Sources/Rendering/Misc/SynchronizableRenderWindow/index.d.ts @@ -1,32 +1,41 @@ -import { Nullable } from "../../../types"; -import vtkRenderWindow, { IRenderWindowInitialValues } from "../../Core/RenderWindow"; +import { Nullable } from '../../../types'; +import vtkRenderWindow, { + IRenderWindowInitialValues, +} from '../../Core/RenderWindow'; // Keeps state for client / server scene synchronization. export interface ISynchronizerContext { - // Set a function that fetches the data array for the given object. - setFetchArrayFunction(fetcher: (hash: string, dataType: any) => Promise): void; - // Invokes the fetcher registered by setFetchArrayFunction. - getArray(sha: string, dataType: any, context: ISynchronizerContext): Promise; - emptyCachedArrays(): void; - freeOldArrays(threshold: number, context: ISynchronizerContext): void; - - // instanceMap - getInstance(id: any): any; - getInstanceId(instance: any): any | null; - registerInstance(id: any, instance: any): void; - unregister(id: any): void; - emptyCachedInstances(): void; - - // sceneMtimeHandler - getMtime(): number; - incrementMtime(viewId: string): number; - setActiveViewId(viewId: string): void; - getActiveViewId(): string; - - // TODO: fill progresshandler + // Set a function that fetches the data array for the given object. + setFetchArrayFunction( + fetcher: (hash: string, dataType: any) => Promise + ): void; + // Invokes the fetcher registered by setFetchArrayFunction. + getArray( + sha: string, + dataType: any, + context: ISynchronizerContext + ): Promise; + emptyCachedArrays(): void; + freeOldArrays(threshold: number, context: ISynchronizerContext): void; + + // instanceMap + getInstance(id: any): any; + getInstanceId(instance: any): any | null; + registerInstance(id: any, instance: any): void; + unregister(id: any): void; + emptyCachedInstances(): void; + + // sceneMtimeHandler + getMtime(): number; + incrementMtime(viewId: string): number; + setActiveViewId(viewId: string): void; + getActiveViewId(): string; + + // TODO: fill progresshandler } -export interface ISynchronizableRenderWindowInitialValues extends IRenderWindowInitialValues { +export interface ISynchronizableRenderWindowInitialValues + extends IRenderWindowInitialValues { synchronizerContextName?: string; // default: 'default': synchronizerContext?: Nullable; synchronizedViewId?: Nullable; @@ -41,7 +50,7 @@ export interface IViewState { mtime: number; // ID of the parent. Null for the root. parent?: Nullable; - properties?: {[key: string]: any}; + properties?: { [key: string]: any }; // Child objects. dependencies?: IViewState[]; extra?: any; @@ -52,7 +61,6 @@ export interface IViewState { } export interface vtkSynchronizableRenderWindow extends vtkRenderWindow { - /** * */ @@ -101,13 +109,19 @@ export interface vtkSynchronizableRenderWindow extends vtkRenderWindow { * @param model object on which data structure will be bounds (protected) * @param {ISynchronizableRenderWindowInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ISynchronizableRenderWindowInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ISynchronizableRenderWindowInitialValues +): void; /** * Method used to create a new instance of vtkSynchronizableRenderWindow * @param {ISynchronizableRenderWindowInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ISynchronizableRenderWindowInitialValues): vtkSynchronizableRenderWindow; +export function newInstance( + initialValues?: ISynchronizableRenderWindowInitialValues +): vtkSynchronizableRenderWindow; /** * @@ -120,8 +134,10 @@ export function getSynchronizerContext(name?: string): ISynchronizerContext; * @param {String} name * @param {Nullable} ctx */ -export function setSynchronizerContext(name: string, ctx: Nullable); - +export function setSynchronizerContext( + name: string, + ctx: Nullable +); /** * @@ -164,11 +180,11 @@ export declare const vtkSynchronizableRenderWindow: { getSynchronizerContext: typeof getSynchronizerContext; setSynchronizerContext: typeof setSynchronizerContext; clearSynchronizerContext: typeof clearSynchronizerContext; - decorate: typeof decorate, - createInstanceMap: typeof createInstanceMap, - createArrayHandler: typeof createArrayHandler, - createProgressHandler: typeof createProgressHandler, - createSceneMtimeHandler: typeof createSceneMtimeHandler, - vtkObjectManager: object + decorate: typeof decorate; + createInstanceMap: typeof createInstanceMap; + createArrayHandler: typeof createArrayHandler; + createProgressHandler: typeof createProgressHandler; + createSceneMtimeHandler: typeof createSceneMtimeHandler; + vtkObjectManager: object; }; export default vtkSynchronizableRenderWindow; diff --git a/Sources/Rendering/Misc/TextureLODsDownloader/index.d.ts b/Sources/Rendering/Misc/TextureLODsDownloader/index.d.ts index 252e64e321e..150ec0d3c97 100644 --- a/Sources/Rendering/Misc/TextureLODsDownloader/index.d.ts +++ b/Sources/Rendering/Misc/TextureLODsDownloader/index.d.ts @@ -1,116 +1,114 @@ -import { vtkObject } from "../../../interfaces"; -import { CrossOrigin, Nullable } from "../../../types"; -import vtkTexture from "../../Core/Texture"; +import { vtkObject } from '../../../interfaces'; +import { CrossOrigin, Nullable } from '../../../types'; +import vtkTexture from '../../Core/Texture'; /** * */ export interface ITextureLODsDownloaderInitialValues { - baseUrl?: string; - crossOrigin?: CrossOrigin; - files?: string[]; - maxTextureLODSize?: number; - texture?: vtkTexture; - stepFinishedCallback?: any; - waitTimeToStart?: number; - waitTimeBetweenDownloads?: number; + baseUrl?: string; + crossOrigin?: CrossOrigin; + files?: string[]; + maxTextureLODSize?: number; + texture?: vtkTexture; + stepFinishedCallback?: any; + waitTimeToStart?: number; + waitTimeBetweenDownloads?: number; } - export interface vtkTextureLODsDownloader extends vtkObject { + /** + * Get the base of the url + */ + getBaseUrl(): string; + + /** + * Get the crossorigin attribute + */ + getCrossOrigin(): Nullable; + + /** + * Get the list of files to download + */ + getFiles(): string[]; + + /** + * Get the max texture LOD size + */ + getMaxTextureLODSize(): number; + + /** + * + */ + getStepFinishedCallback(): any; + + /** + * Get the vtkTexture object + */ + getTexture(): vtkTexture; + + /** + * Get the delay between downloads + */ + getWaitTimeBetweenDownloads(): number; + + /** + * Get the delay before the start of download. + */ + getWaitTimeToStart(): number; + + /** + * Set the base of the url + * @param {String} baseUrl The base of the url. + */ + setBaseUrl(baseUrl: string): boolean; - /** - * Get the base of the url - */ - getBaseUrl(): string; - - /** - * Get the crossorigin attribute - */ - getCrossOrigin(): Nullable; - - /** - * Get the list of files to download - */ - getFiles(): string[]; - - /** - * Get the max texture LOD size - */ - getMaxTextureLODSize(): number; - - /** - * - */ - getStepFinishedCallback(): any; - - /** - * Get the vtkTexture object - */ - getTexture(): vtkTexture; - - /** - * Get the delay between downloads - */ - getWaitTimeBetweenDownloads(): number; - - /** - * Get the delay before the start of download. - */ - getWaitTimeToStart(): number; - - /** - * Set the base of the url - * @param {String} baseUrl The base of the url. - */ - setBaseUrl(baseUrl: string): boolean; - - /** - * Set the crossorigin attribute - * @param {CrossOrigin} crossOrigin The crossorigin value. - */ - setCrossOrigin(crossOrigin: CrossOrigin): boolean; - - /** - * Set the list of files to download - * @param {String[]} files The array of files urls. - */ - setFiles(files: string[]): boolean; - - /** - * Set the max texture LOD size - * @param {Number} maxTextureLODSize The max texture LOD size. - */ - setMaxTextureLODSize(maxTextureLODSize: number): boolean; - - /** - * - * @param stepFinishedCallback - */ - setStepFinishedCallback(stepFinishedCallback: any): boolean; - - /** - * Set the vtkTexture object - * @param {vtkTexture} texture The vtkTexture object. - */ - setTexture(texture: vtkTexture): boolean; - - /** - * Set the delay between downloads - * @param {Number} waitTimeBetweenDownloads The delay between downloads. - */ - setWaitTimeBetweenDownloads(waitTimeBetweenDownloads: number): boolean; - - /** - * Set the delay before the start of download - * @param {Number} waitTimeToStart The delay before the start of download. - */ - setWaitTimeToStart(waitTimeToStart: number): boolean; - - /** - * Start the download - */ - startDownloads(): void; + /** + * Set the crossorigin attribute + * @param {CrossOrigin} crossOrigin The crossorigin value. + */ + setCrossOrigin(crossOrigin: CrossOrigin): boolean; + + /** + * Set the list of files to download + * @param {String[]} files The array of files urls. + */ + setFiles(files: string[]): boolean; + + /** + * Set the max texture LOD size + * @param {Number} maxTextureLODSize The max texture LOD size. + */ + setMaxTextureLODSize(maxTextureLODSize: number): boolean; + + /** + * + * @param stepFinishedCallback + */ + setStepFinishedCallback(stepFinishedCallback: any): boolean; + + /** + * Set the vtkTexture object + * @param {vtkTexture} texture The vtkTexture object. + */ + setTexture(texture: vtkTexture): boolean; + + /** + * Set the delay between downloads + * @param {Number} waitTimeBetweenDownloads The delay between downloads. + */ + setWaitTimeBetweenDownloads(waitTimeBetweenDownloads: number): boolean; + + /** + * Set the delay before the start of download + * @param {Number} waitTimeToStart The delay before the start of download. + */ + setWaitTimeToStart(waitTimeToStart: number): boolean; + + /** + * Start the download + */ + startDownloads(): void; } /** @@ -120,19 +118,25 @@ export interface vtkTextureLODsDownloader extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {ITextureLODsDownloaderInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ITextureLODsDownloaderInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ITextureLODsDownloaderInitialValues +): void; /** * Method used to create a new instance of vtkTextureLODsDownloader * @param {ITextureLODsDownloaderInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: ITextureLODsDownloaderInitialValues): vtkTextureLODsDownloader; +export function newInstance( + initialValues?: ITextureLODsDownloaderInitialValues +): vtkTextureLODsDownloader; /** * vtkTextureLODsDownloader provides a way to download textures by bulk. */ export declare const vtkTextureLODsDownloader: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkTextureLODsDownloader; diff --git a/Sources/Rendering/OpenGL/BufferObject/index.d.ts b/Sources/Rendering/OpenGL/BufferObject/index.d.ts index 1ee6c59b5a5..5a09042b4d6 100644 --- a/Sources/Rendering/OpenGL/BufferObject/index.d.ts +++ b/Sources/Rendering/OpenGL/BufferObject/index.d.ts @@ -50,7 +50,6 @@ export interface vtkOpenGLBufferObject extends vtkObject { * @returns {string} The error message. */ getError(): string; - } /** @@ -70,7 +69,9 @@ export function extend( * @param initialValues The initial values to use. * @returns {vtkOpenGLBufferObject} The new instance. */ -export function newInstance(initialValues?: IBufferObjectInitialValues): vtkOpenGLBufferObject; +export function newInstance( + initialValues?: IBufferObjectInitialValues +): vtkOpenGLBufferObject; /** * Object containing the newInstance and extend functions for vtkOpenGLBufferObject. diff --git a/Sources/Rendering/OpenGL/RenderWindow/index.d.ts b/Sources/Rendering/OpenGL/RenderWindow/index.d.ts index 4c4f7859616..55f57c9e511 100644 --- a/Sources/Rendering/OpenGL/RenderWindow/index.d.ts +++ b/Sources/Rendering/OpenGL/RenderWindow/index.d.ts @@ -14,412 +14,457 @@ import vtkViewStream from '../../../IO/Core/ImageStream/ViewStream'; * */ export interface IOpenGLRenderWindowInitialValues { - cullFaceEnabled?: boolean; - shaderCache?: null; - initialized?: boolean; - context?: WebGLRenderingContext | WebGL2RenderingContext; - context2D?: CanvasRenderingContext2D; - canvas?: HTMLCanvasElement; - cursorVisibility?: boolean; - cursor?: string; - textureUnitManager?: null; - textureResourceIds?: null; - containerSize?: Size; - renderPasses?: any[]; - notifyStartCaptureImage?: boolean; - webgl2?: boolean; - defaultToWebgl2?: boolean; - activeFramebuffer?: any; - imageFormat?: 'image/png'; - useOffScreen?: boolean; - useBackgroundImage?: boolean; + cullFaceEnabled?: boolean; + shaderCache?: null; + initialized?: boolean; + context?: WebGLRenderingContext | WebGL2RenderingContext; + context2D?: CanvasRenderingContext2D; + canvas?: HTMLCanvasElement; + cursorVisibility?: boolean; + cursor?: string; + textureUnitManager?: null; + textureResourceIds?: null; + containerSize?: Size; + renderPasses?: any[]; + notifyStartCaptureImage?: boolean; + webgl2?: boolean; + defaultToWebgl2?: boolean; + activeFramebuffer?: any; + imageFormat?: 'image/png'; + useOffScreen?: boolean; + useBackgroundImage?: boolean; } export interface ICaptureOptions { - resetCamera?: boolean; - size?: Size; - scale?: number + resetCamera?: boolean; + size?: Size; + scale?: number; } -type vtkOpenGLRenderWindowBase = vtkObject & Omit; +type vtkOpenGLRenderWindowBase = vtkObject & + Omit< + vtkAlgorithm, + | 'getInputData' + | 'setInputData' + | 'setInputConnection' + | 'getInputConnection' + | 'addInputConnection' + | 'addInputData' + >; export interface vtkOpenGLRenderWindow extends vtkOpenGLRenderWindowBase { - - /** - * Builds myself. - * @param {Boolean} prepass - */ - buildPass(prepass: boolean): void; - - /** - * Initialize the rendering window. This will setup all system-specific - * resources. This method and Finalize() must be symmetric and it should be - * possible to call them multiple times, even changing WindowId in-between. - * This is what WindowRemap does. - */ - initialize(): void; - - /** - * - */ - makeCurrent(): void; - - /** - * - * @param {HTMLElement} el The container element. - */ - setContainer(el: Nullable): void; - - /** - * Get the container element. - */ - getContainer(): Nullable; - - /** - * Get the container size. - */ - getContainerSize(): Vector2; - - /** - * Get the frame buffer size. - */ - getFramebufferSize(): Vector2; - - /** - * Get the webgl canvas. - */ - getCanvas(): Nullable; - - /** - * Check if a point is in the viewport. - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {vtkRenderer} viewport The viewport vtk element. - */ - isInViewport(x: number, y: number, viewport: vtkRenderer): boolean; - - /** - * Get the viewport size. - * @param {vtkRenderer} viewport The viewport vtk element. - */ - getViewportSize(viewport: vtkRenderer): Vector2; - - /** - * Get the center of the viewport. - * @param {vtkRenderer} viewport The viewport vtk element. - */ - getViewportCenter(viewport: vtkRenderer): Vector2; - - /** - * - * @param {Number} x - * @param {Number} y - * @param {Number} z - */ - displayToNormalizedDisplay(x: number, y: number, z: number): Vector3; - - /** - * - * @param {Number} x - * @param {Number} y - * @param {Number} z - */ - normalizedDisplayToDisplay(x: number, y: number, z: number): Vector3; - - /** - * - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @param {vtkRenderer} renderer The vtkRenderer instance. - */ - worldToView(x: number, y: number, z: number, renderer: vtkRenderer): Vector3; - - /** - * - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @param {vtkRenderer} renderer The vtkRenderer instance. - */ - viewToWorld(x: number, y: number, z: number, renderer: vtkRenderer): Vector3; - - /** - * - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @param {vtkRenderer} renderer The vtkRenderer instance. - */ - worldToDisplay(x: number, y: number, z: number, renderer: vtkRenderer): Vector3; - - /** - * - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @param {vtkRenderer} renderer The vtkRenderer instance. - */ - displayToWorld(x: number, y: number, z: number, renderer: vtkRenderer): Vector3; - - /** - * - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @param {vtkRenderer} renderer The vtkRenderer instance. - */ - normalizedDisplayToViewport(x: number, y: number, z: number, renderer: vtkRenderer): Vector3; - - /** - * - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @param {vtkRenderer} renderer The vtkRenderer instance. - */ - viewportToNormalizedViewport(x: number, y: number, z: number, renderer: vtkRenderer): Vector3; - - /** - * - * @param {Number} x - * @param {Number} y - * @param {Number} z - */ - normalizedViewportToViewport(x: number, y: number, z: number): Vector3; - - /** - * - * @param {Number} x - * @param {Number} y - * @param {Number} z - */ - displayToLocalDisplay(x: number, y: number, z: number): Vector3; - - /** - * - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @param {vtkRenderer} renderer The vtkRenderer instance. - */ - viewportToNormalizedDisplay(x: number, y: number, z: number, renderer: vtkRenderer): Vector3; - - /** - * - * @param {Number} x1 - * @param {Number} y1 - * @param {Number} x2 - * @param {Number} y2 - */ - getPixelData(x1: number, y1: number, x2: number, y2: number): Uint8Array; - - /** - * - * @param {WebGLContextAttributes} options - */ - get3DContext(options: WebGLContextAttributes): Nullable; - - /** - * - * @param {CanvasRenderingContext2DSettings} options - */ - get2DContext(options: CanvasRenderingContext2DSettings): Nullable; - - /** - * Copy the content of the root parent, if there is one, to the canvas - */ - copyParentContent(): void; - - /** - * Resize this render window using the size of its children - * The new size of the renderwindow is the size of the bounding box - * containing all the child render windows - */ - resizeFromChildRenderWindows(): void; - - /** - * Returns the last ancestor of type vtkOpenGLRenderWindow if there is one - * If there is no parent vtkOpenGLRenderWindow, returns undefined - */ - getRootOpenGLRenderWindow(): vtkOpenGLRenderWindow | undefined; - - /** - * The context 2D is created during initialization instead of the WebGL context - * when there is a parent render window - */ - getContext2D(): CanvasRenderingContext2D | undefined; - - /** - * - */ - setContext2D(context2D: CanvasRenderingContext2D | undefined): boolean; - - /** - * - */ - restoreContext(): void; - - /** - * - * @param {vtkTexture} texture - */ - activateTexture(texture: vtkTexture): void; - - /** - * - * @param {vtkTexture} texture - */ - deactivateTexture(texture: vtkTexture): void; - - /** - * - * @param {vtkTexture} texture - */ - getTextureUnitForTexture(texture: vtkTexture): number; - - /** - * - * @param {VtkDataTypes} vtktype - * @param {Number} numComps - * @param {Boolean} useFloat - * @param {unknown} oglNorm16Ext The WebGL EXT_texture_norm16 extension context - * @param {Boolean} useHalfFloat - */ - getDefaultTextureInternalFormat(vtktype: VtkDataTypes, numComps: number, oglNorm16Ext?: unknown, useHalfFloat?: boolean): void; - - /** - * - * @param {HTMLImageElement} img The background image. - */ - setBackgroundImage(img: HTMLImageElement): void; - - /** - * - * @param {Boolean} value - */ - setUseBackgroundImage(value: boolean): void; - - /** - * Capture a screenshot of the contents of this renderwindow. The options - * object can include a `size` array (`[w, h]`) or a `scale` floating point - * value, as well as a `resetCamera` boolean. If `size` is provided, the - * captured screenshot will be of the given size (and `resetCamera` could be - * useful in this case if the aspect ratio of `size` does not match the - * current renderwindow size). Otherwise, if `scale` is provided, it will - * be multiplied by the current renderwindow size to compute the screenshot - * size. If no `size` or `scale` are provided, the current renderwindow - * size is assumed. The default format is "image/png". Returns a promise - * that resolves to the captured screenshot. - * @param {String} format - * @param {ICaptureOptions} options - */ - captureNextImage(format: string, options?: ICaptureOptions): Nullable>; - - /** - * - */ - getGLInformations(): object; - - /** - * - */ - traverseAllPasses(): void; - - /** - * - */ - disableCullFace(): void; - - /** - * - */ - enableCullFace(): void; - - /** - * - * @param {vtkViewStream} stream The vtkViewStream instance. - */ - setViewStream(stream: vtkViewStream): boolean; - - /** - * Sets the pixel width and height of the rendered image. - * - * WebGL and WebGPU render windows apply these values to - * the width and height attribute of the canvas element. - * - * To match the device resolution in browser environments, - * multiply the container size by `window.devicePixelRatio` - * `apiSpecificRenderWindow.setSize(Math.floor(containerWidth * devicePixelRatio), Math.floor(containerHeight * devicePixelRatio)); - * See the VTK.js FullscreenRenderWindow class for an example. - * - * @see getComputedDevicePixelRatio() - * - * @param {Vector2} size - */ - setSize(size: Vector2): void; - - /** - * - * @param {Number} x - * @param {Number} y - */ - setSize(x: number, y: number): void; - - /** - * - */ - getSize(): Vector2; - - /** - * Scales the size of a browser CSS pixel to a rendered canvas pixel. - * `const renderedPixelWidth = cssPixelWidth * apiRenderWindow.getComputedDevicePixelRatio()` - * Use to scale rendered objects to a consistent perceived size or DOM pixel position. - * - * Rather than using window.devicePixelRatio directly, the device pixel ratio is inferred - * from the container CSS pixel size and rendered image pixel size. The user directly sets the rendered pixel size. - * - * @see setSize() - * @see getContainerSize() - */ - getComputedDevicePixelRatio(): number; - - /** - * Set graphics resources for vtk objects to be cached at the context level. - * This provides mappers with a convenient API to re-use allocated GPU resources - * without duplication. - * - * @param {Object} vtkObj VTK data object / array with resources on the GPU - * @param {Object} gObj Container object that maintains a handle to the graphics resource on the GPU - * @param {String} hash String hash that can be used by mappers to decide whether to discard or re-allocate - * the cached resource. - */ - setGraphicsResourceForObject(vtkObj: vtkCellArray | vtkDataArray | vtkPoints, gObj: vtkOpenGLTexture | vtkBufferObject, hash: string): void; - - /** - * Get graphics resources for vtk objects cached at the context level. - * This provides mappers with a convenient API to re-use allocated GPU resources - * without duplication. - * - * @param {Object} vtkObj VTK data object / array with resources on the GPU - * the cached resource. - * @return {Object} Dictionary with the graphics resource and string hash - */ - getGraphicsResourceForObject(vtkObj: vtkCellArray | vtkDataArray | vtkPoints): {gObj: vtkOpenGLTexture | vtkBufferObject, hash: string}; - - /** - * Get approximate graphics memory usage, in bytes, for the context. This is a simple computation - * that analyzes how much memory is allocated on the GPU for textures, VBOs, etc. to give an - * application a view of its graphics memory consumption. - * Note that this ignores page resources. - */ - getGraphicsMemoryInfo(): number; + /** + * Builds myself. + * @param {Boolean} prepass + */ + buildPass(prepass: boolean): void; + + /** + * Initialize the rendering window. This will setup all system-specific + * resources. This method and Finalize() must be symmetric and it should be + * possible to call them multiple times, even changing WindowId in-between. + * This is what WindowRemap does. + */ + initialize(): void; + + /** + * + */ + makeCurrent(): void; + + /** + * + * @param {HTMLElement} el The container element. + */ + setContainer(el: Nullable): void; + + /** + * Get the container element. + */ + getContainer(): Nullable; + + /** + * Get the container size. + */ + getContainerSize(): Vector2; + + /** + * Get the frame buffer size. + */ + getFramebufferSize(): Vector2; + + /** + * Get the webgl canvas. + */ + getCanvas(): Nullable; + + /** + * Check if a point is in the viewport. + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {vtkRenderer} viewport The viewport vtk element. + */ + isInViewport(x: number, y: number, viewport: vtkRenderer): boolean; + + /** + * Get the viewport size. + * @param {vtkRenderer} viewport The viewport vtk element. + */ + getViewportSize(viewport: vtkRenderer): Vector2; + + /** + * Get the center of the viewport. + * @param {vtkRenderer} viewport The viewport vtk element. + */ + getViewportCenter(viewport: vtkRenderer): Vector2; + + /** + * + * @param {Number} x + * @param {Number} y + * @param {Number} z + */ + displayToNormalizedDisplay(x: number, y: number, z: number): Vector3; + + /** + * + * @param {Number} x + * @param {Number} y + * @param {Number} z + */ + normalizedDisplayToDisplay(x: number, y: number, z: number): Vector3; + + /** + * + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @param {vtkRenderer} renderer The vtkRenderer instance. + */ + worldToView(x: number, y: number, z: number, renderer: vtkRenderer): Vector3; + + /** + * + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @param {vtkRenderer} renderer The vtkRenderer instance. + */ + viewToWorld(x: number, y: number, z: number, renderer: vtkRenderer): Vector3; + + /** + * + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @param {vtkRenderer} renderer The vtkRenderer instance. + */ + worldToDisplay( + x: number, + y: number, + z: number, + renderer: vtkRenderer + ): Vector3; + + /** + * + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @param {vtkRenderer} renderer The vtkRenderer instance. + */ + displayToWorld( + x: number, + y: number, + z: number, + renderer: vtkRenderer + ): Vector3; + + /** + * + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @param {vtkRenderer} renderer The vtkRenderer instance. + */ + normalizedDisplayToViewport( + x: number, + y: number, + z: number, + renderer: vtkRenderer + ): Vector3; + + /** + * + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @param {vtkRenderer} renderer The vtkRenderer instance. + */ + viewportToNormalizedViewport( + x: number, + y: number, + z: number, + renderer: vtkRenderer + ): Vector3; + + /** + * + * @param {Number} x + * @param {Number} y + * @param {Number} z + */ + normalizedViewportToViewport(x: number, y: number, z: number): Vector3; + + /** + * + * @param {Number} x + * @param {Number} y + * @param {Number} z + */ + displayToLocalDisplay(x: number, y: number, z: number): Vector3; + + /** + * + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @param {vtkRenderer} renderer The vtkRenderer instance. + */ + viewportToNormalizedDisplay( + x: number, + y: number, + z: number, + renderer: vtkRenderer + ): Vector3; + + /** + * + * @param {Number} x1 + * @param {Number} y1 + * @param {Number} x2 + * @param {Number} y2 + */ + getPixelData(x1: number, y1: number, x2: number, y2: number): Uint8Array; + + /** + * + * @param {WebGLContextAttributes} options + */ + get3DContext( + options: WebGLContextAttributes + ): Nullable; + + /** + * + * @param {CanvasRenderingContext2DSettings} options + */ + get2DContext( + options: CanvasRenderingContext2DSettings + ): Nullable; + + /** + * Copy the content of the root parent, if there is one, to the canvas + */ + copyParentContent(): void; + + /** + * Resize this render window using the size of its children + * The new size of the renderwindow is the size of the bounding box + * containing all the child render windows + */ + resizeFromChildRenderWindows(): void; + + /** + * Returns the last ancestor of type vtkOpenGLRenderWindow if there is one + * If there is no parent vtkOpenGLRenderWindow, returns undefined + */ + getRootOpenGLRenderWindow(): vtkOpenGLRenderWindow | undefined; + + /** + * The context 2D is created during initialization instead of the WebGL context + * when there is a parent render window + */ + getContext2D(): CanvasRenderingContext2D | undefined; + + /** + * + */ + setContext2D(context2D: CanvasRenderingContext2D | undefined): boolean; + + /** + * + */ + restoreContext(): void; + + /** + * + * @param {vtkTexture} texture + */ + activateTexture(texture: vtkTexture): void; + + /** + * + * @param {vtkTexture} texture + */ + deactivateTexture(texture: vtkTexture): void; + + /** + * + * @param {vtkTexture} texture + */ + getTextureUnitForTexture(texture: vtkTexture): number; + + /** + * + * @param {VtkDataTypes} vtktype + * @param {Number} numComps + * @param {Boolean} useFloat + * @param {unknown} oglNorm16Ext The WebGL EXT_texture_norm16 extension context + * @param {Boolean} useHalfFloat + */ + getDefaultTextureInternalFormat( + vtktype: VtkDataTypes, + numComps: number, + oglNorm16Ext?: unknown, + useHalfFloat?: boolean + ): void; + + /** + * + * @param {HTMLImageElement} img The background image. + */ + setBackgroundImage(img: HTMLImageElement): void; + + /** + * + * @param {Boolean} value + */ + setUseBackgroundImage(value: boolean): void; + + /** + * Capture a screenshot of the contents of this renderwindow. The options + * object can include a `size` array (`[w, h]`) or a `scale` floating point + * value, as well as a `resetCamera` boolean. If `size` is provided, the + * captured screenshot will be of the given size (and `resetCamera` could be + * useful in this case if the aspect ratio of `size` does not match the + * current renderwindow size). Otherwise, if `scale` is provided, it will + * be multiplied by the current renderwindow size to compute the screenshot + * size. If no `size` or `scale` are provided, the current renderwindow + * size is assumed. The default format is "image/png". Returns a promise + * that resolves to the captured screenshot. + * @param {String} format + * @param {ICaptureOptions} options + */ + captureNextImage( + format: string, + options?: ICaptureOptions + ): Nullable>; + + /** + * + */ + getGLInformations(): object; + + /** + * + */ + traverseAllPasses(): void; + + /** + * + */ + disableCullFace(): void; + + /** + * + */ + enableCullFace(): void; + + /** + * + * @param {vtkViewStream} stream The vtkViewStream instance. + */ + setViewStream(stream: vtkViewStream): boolean; + + /** + * Sets the pixel width and height of the rendered image. + * + * WebGL and WebGPU render windows apply these values to + * the width and height attribute of the canvas element. + * + * To match the device resolution in browser environments, + * multiply the container size by `window.devicePixelRatio` + * `apiSpecificRenderWindow.setSize(Math.floor(containerWidth * devicePixelRatio), Math.floor(containerHeight * devicePixelRatio)); + * See the VTK.js FullscreenRenderWindow class for an example. + * + * @see getComputedDevicePixelRatio() + * + * @param {Vector2} size + */ + setSize(size: Vector2): void; + + /** + * + * @param {Number} x + * @param {Number} y + */ + setSize(x: number, y: number): void; + + /** + * + */ + getSize(): Vector2; + + /** + * Scales the size of a browser CSS pixel to a rendered canvas pixel. + * `const renderedPixelWidth = cssPixelWidth * apiRenderWindow.getComputedDevicePixelRatio()` + * Use to scale rendered objects to a consistent perceived size or DOM pixel position. + * + * Rather than using window.devicePixelRatio directly, the device pixel ratio is inferred + * from the container CSS pixel size and rendered image pixel size. The user directly sets the rendered pixel size. + * + * @see setSize() + * @see getContainerSize() + */ + getComputedDevicePixelRatio(): number; + + /** + * Set graphics resources for vtk objects to be cached at the context level. + * This provides mappers with a convenient API to re-use allocated GPU resources + * without duplication. + * + * @param {Object} vtkObj VTK data object / array with resources on the GPU + * @param {Object} gObj Container object that maintains a handle to the graphics resource on the GPU + * @param {String} hash String hash that can be used by mappers to decide whether to discard or re-allocate + * the cached resource. + */ + setGraphicsResourceForObject( + vtkObj: vtkCellArray | vtkDataArray | vtkPoints, + gObj: vtkOpenGLTexture | vtkBufferObject, + hash: string + ): void; + + /** + * Get graphics resources for vtk objects cached at the context level. + * This provides mappers with a convenient API to re-use allocated GPU resources + * without duplication. + * + * @param {Object} vtkObj VTK data object / array with resources on the GPU + * the cached resource. + * @return {Object} Dictionary with the graphics resource and string hash + */ + getGraphicsResourceForObject( + vtkObj: vtkCellArray | vtkDataArray | vtkPoints + ): { gObj: vtkOpenGLTexture | vtkBufferObject; hash: string }; + + /** + * Get approximate graphics memory usage, in bytes, for the context. This is a simple computation + * that analyzes how much memory is allocated on the GPU for textures, VBOs, etc. to give an + * application a view of its graphics memory consumption. + * Note that this ignores page resources. + */ + getGraphicsMemoryInfo(): number; } /** @@ -429,13 +474,19 @@ export interface vtkOpenGLRenderWindow extends vtkOpenGLRenderWindowBase { * @param model object on which data structure will be bounds (protected) * @param {IOpenGLRenderWindowInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IOpenGLRenderWindowInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IOpenGLRenderWindowInitialValues +): void; /** * Method used to create a new instance of vtkOpenGLRenderWindow. * @param {IOpenGLRenderWindowInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IOpenGLRenderWindowInitialValues): vtkOpenGLRenderWindow; +export function newInstance( + initialValues?: IOpenGLRenderWindowInitialValues +): vtkOpenGLRenderWindow; /** * @@ -455,9 +506,9 @@ export function popMonitorGLContextCount(cb: any): void; * vtkOpenGLRenderWindow is designed to view/render a vtkRenderWindow. */ export declare const vtkOpenGLRenderWindow: { - newInstance: typeof newInstance, - extend: typeof extend, - pushMonitorGLContextCount: typeof pushMonitorGLContextCount, - popMonitorGLContextCount: typeof popMonitorGLContextCount, + newInstance: typeof newInstance; + extend: typeof extend; + pushMonitorGLContextCount: typeof pushMonitorGLContextCount; + popMonitorGLContextCount: typeof popMonitorGLContextCount; }; export default vtkOpenGLRenderWindow; diff --git a/Sources/Rendering/OpenGL/Texture/index.d.ts b/Sources/Rendering/OpenGL/Texture/index.d.ts index b335c0e906e..f550cc53ffd 100644 --- a/Sources/Rendering/OpenGL/Texture/index.d.ts +++ b/Sources/Rendering/OpenGL/Texture/index.d.ts @@ -1,9 +1,9 @@ -import { Wrap, Filter } from "./Constants"; +import { Wrap, Filter } from './Constants'; import vtkOpenGLRenderWindow from '../RenderWindow'; import { Nullable } from '../../../types'; -import { VtkDataTypes } from "../../../Common/Core/DataArray"; +import { VtkDataTypes } from '../../../Common/Core/DataArray'; import { vtkViewNode } from '../../../Rendering/SceneGraph/ViewNode'; -import { vtkObject } from "../../../interfaces" ; +import { vtkObject } from '../../../interfaces'; /** * Initial values for creating a new instance of vtkOpenGLTexture. @@ -185,7 +185,14 @@ export interface vtkOpenGLTexture extends vtkViewNode { * @param flip Whether to flip the texture vertically. * @returns {boolean} True if the texture was successfully created, false otherwise. */ - create2DFromRaw(width: number, height: number, numComps: number, dataType: VtkDataTypes, data: any, flip: boolean): boolean; + create2DFromRaw( + width: number, + height: number, + numComps: number, + dataType: VtkDataTypes, + data: any, + flip: boolean + ): boolean; /** * Creates a cube texture from raw data. @@ -197,7 +204,14 @@ export interface vtkOpenGLTexture extends vtkViewNode { * @param flip Whether to flip the texture vertically. * @returns {boolean} True if the cube texture was successfully created, false otherwise. */ - createCubeFromRaw(width: number, height: number, numComps: number, dataType: VtkDataTypes, data: any, flip: boolean): boolean; + createCubeFromRaw( + width: number, + height: number, + numComps: number, + dataType: VtkDataTypes, + data: any, + flip: boolean + ): boolean; /** * Creates a 2D texture from an image. @@ -216,7 +230,14 @@ export interface vtkOpenGLTexture extends vtkViewNode { * @param preferSizeOverAccuracy Whether to prefer texture size over accuracy. * @returns {boolean} True if the texture was successfully created, false otherwise. */ - create2DFilterableFromRaw(width: number, height: number, numComps: number, dataType: VtkDataTypes, data: any, preferSizeOverAccuracy: boolean): boolean; + create2DFilterableFromRaw( + width: number, + height: number, + numComps: number, + dataType: VtkDataTypes, + data: any, + preferSizeOverAccuracy: boolean + ): boolean; /** * Creates a 2D filterable texture from a data array, with a preference for size over accuracy if necessary. @@ -226,7 +247,12 @@ export interface vtkOpenGLTexture extends vtkViewNode { * @param preferSizeOverAccuracy Whether to prefer texture size over accuracy. * @returns {boolean} True if the texture was successfully created, false otherwise. */ - create2DFilterableFromDataArray(width: number, height: number, dataArray: any, preferSizeOverAccuracy: boolean): boolean; + create2DFilterableFromDataArray( + width: number, + height: number, + dataArray: any, + preferSizeOverAccuracy: boolean + ): boolean; /** * Creates a 3D texture from raw data. @@ -238,7 +264,14 @@ export interface vtkOpenGLTexture extends vtkViewNode { * @param data The raw data for the texture. * @returns {boolean} True if the texture was successfully created, false otherwise. */ - create3DFromRaw(width: number, height: number, depth: number, numComps: number, dataType: VtkDataTypes, data: any): boolean; + create3DFromRaw( + width: number, + height: number, + depth: number, + numComps: number, + dataType: VtkDataTypes, + data: any + ): boolean; /** * Creates a 3D filterable texture from raw data, with a preference for size over accuracy if necessary. @@ -251,7 +284,15 @@ export interface vtkOpenGLTexture extends vtkViewNode { * @param preferSizeOverAccuracy Whether to prefer texture size over accuracy. * @returns {boolean} True if the texture was successfully created, false otherwise. */ - create3DFilterableFromRaw(width: number, height: number, depth: number, numComps: number, dataType: VtkDataTypes, values: any, preferSizeOverAccuracy: boolean): boolean; + create3DFilterableFromRaw( + width: number, + height: number, + depth: number, + numComps: number, + dataType: VtkDataTypes, + values: any, + preferSizeOverAccuracy: boolean + ): boolean; /** * Creates a 3D filterable texture from a data array, with a preference for size over accuracy if necessary. @@ -262,7 +303,13 @@ export interface vtkOpenGLTexture extends vtkViewNode { * @param preferSizeOverAccuracy Whether to prefer texture size over accuracy. * @returns {boolean} True if the texture was successfully created, false otherwise. */ - create3DFilterableFromDataArray(width: number, height: number, depth: number, dataArray: any, preferSizeOverAccuracy: boolean): boolean; + create3DFilterableFromDataArray( + width: number, + height: number, + depth: number, + dataArray: any, + preferSizeOverAccuracy: boolean + ): boolean; /** * Sets the OpenGL render window in which the texture will be used. @@ -276,7 +323,6 @@ export interface vtkOpenGLTexture extends vtkViewNode { * @returns {number} The maximum texture size. */ getMaximumTextureSize(ctx: any): number; - } /** @@ -285,21 +331,27 @@ export interface vtkOpenGLTexture extends vtkViewNode { * @param model The model to use. * @param initialValues The initial values to apply. */ -export function extend(publicAPI: object, model: object, initialValues?: ITextureInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ITextureInitialValues +): void; /** * Creates a new instance of vtkOpenGLTexture with the given initial values. * @param initialValues The initial values to use. * @returns The new instance. */ -export function newInstance(initialValues?: ITextureInitialValues): vtkOpenGLTexture; +export function newInstance( + initialValues?: ITextureInitialValues +): vtkOpenGLTexture; /** * vtkOpenGLTexture static API. */ export declare const vtkOpenGLTexture: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; -export default vtkOpenGLTexture; \ No newline at end of file +export default vtkOpenGLTexture; diff --git a/Sources/Rendering/SceneGraph/RenderPass/index.d.ts b/Sources/Rendering/SceneGraph/RenderPass/index.d.ts index 937dc46d87a..22fcff0b761 100644 --- a/Sources/Rendering/SceneGraph/RenderPass/index.d.ts +++ b/Sources/Rendering/SceneGraph/RenderPass/index.d.ts @@ -1,91 +1,90 @@ -import { vtkObject } from "../../../interfaces"; -import vtkViewNode from "../ViewNode"; +import { vtkObject } from '../../../interfaces'; +import vtkViewNode from '../ViewNode'; /** - * + * */ export interface IRenderPassInitialValues { - delegates: Array; - preDelegateOperations: Array; - postDelegateOperations: Array; + delegates: Array; + preDelegateOperations: Array; + postDelegateOperations: Array; } export interface vtkRenderPass extends vtkObject { - - /** - * - */ - getCurrentOperation(): string; - - /** - * - */ - getCurrentParent(): any; - - /** - * - */ - getDelegates(): any; - - /** - * - */ - getOperation(): void; - - /** - * - */ - getPostDelegateOperations(): any; - - /** - * - */ - getPreDelegateOperations(): any; - - /** - * - */ - getTraverseOperation(): string; - - /** - * - * @param {String} val - */ - setCurrentOperation(val: string): void; - - /** - * - * @param currentParent - */ - setCurrentParent(currentParent: any): boolean; - - /** - * - * @param delegates - */ - setDelegates(delegates: any): boolean; - - /** - * - * @param postDelegateOperations - */ - setPostDelegateOperations(postDelegateOperations: any): boolean; - - /** - * - * @param preDelegateOperations - */ - setPreDelegateOperations(preDelegateOperations: any): boolean; - - /** - * by default this class will traverse all of its - * preDelegateOperations, then call its delegate render passes - * the traverse all of its postDelegateOperations - * any of those three arrays can be empty - * @param viewNode - * @param parent - */ - traverse(viewNode: vtkViewNode, parent: any): void; + /** + * + */ + getCurrentOperation(): string; + + /** + * + */ + getCurrentParent(): any; + + /** + * + */ + getDelegates(): any; + + /** + * + */ + getOperation(): void; + + /** + * + */ + getPostDelegateOperations(): any; + + /** + * + */ + getPreDelegateOperations(): any; + + /** + * + */ + getTraverseOperation(): string; + + /** + * + * @param {String} val + */ + setCurrentOperation(val: string): void; + + /** + * + * @param currentParent + */ + setCurrentParent(currentParent: any): boolean; + + /** + * + * @param delegates + */ + setDelegates(delegates: any): boolean; + + /** + * + * @param postDelegateOperations + */ + setPostDelegateOperations(postDelegateOperations: any): boolean; + + /** + * + * @param preDelegateOperations + */ + setPreDelegateOperations(preDelegateOperations: any): boolean; + + /** + * by default this class will traverse all of its + * preDelegateOperations, then call its delegate render passes + * the traverse all of its postDelegateOperations + * any of those three arrays can be empty + * @param viewNode + * @param parent + */ + traverse(viewNode: vtkViewNode, parent: any): void; } /** @@ -95,19 +94,25 @@ export interface vtkRenderPass extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IRenderPassInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IRenderPassInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IRenderPassInitialValues +): void; /** * Method used to create a new instance of vtkRenderPass. * @param {IRenderPassInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IRenderPassInitialValues): vtkRenderPass; +export function newInstance( + initialValues?: IRenderPassInitialValues +): vtkRenderPass; /** * vtkRenderPass is a deferred class with a simple deferred method Render. */ export declare const vtkRenderPass: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkRenderPass; diff --git a/Sources/Rendering/SceneGraph/ViewNode/index.d.ts b/Sources/Rendering/SceneGraph/ViewNode/index.d.ts index 256a67b4090..c0b6111e839 100644 --- a/Sources/Rendering/SceneGraph/ViewNode/index.d.ts +++ b/Sources/Rendering/SceneGraph/ViewNode/index.d.ts @@ -1,156 +1,154 @@ -import { vtkObject } from "../../../interfaces"; -import vtkRenderPass from "../RenderPass"; +import { vtkObject } from '../../../interfaces'; +import vtkRenderPass from '../RenderPass'; export enum PASS_TYPES { - 'Build', - 'Render' + 'Build', + 'Render', } /** - * + * */ export interface IViewNodeInitialValues { - parent?: null, - renderable?: null, - myFactory?: null, - children?: Array; - visited?: boolean; + parent?: null; + renderable?: null; + myFactory?: null; + children?: Array; + visited?: boolean; } export interface vtkViewNode extends vtkObject { - - /** - * Add a child view node to this node, created from the renderable given as argument - * If the node creation fails or the argument is falsy, returns undefined - * Otherwise, returns the newly created node or the existing node - * @param dobj - */ - addMissingNode(dobj: any): vtkViewNode | undefined; - - /** - * - * @param dataObjs - */ - addMissingNodes(dataObjs: any): void; - - /** - * - * @param {vtkRenderPass} renderPass - * @param prepass - */ - apply(renderPass: vtkRenderPass, prepass: boolean): void; - - /** - * Builds myself. - * @param prepass - */ - build(prepass: any): void; - - /** - * - * @param dataObj - */ - createViewNode(dataObj: any): void; - - /** - * - */ - getChildren(): any; - - /** - * - */ - getChildrenByReference(): any; - - /** - * Find the first parent/grandparent of the desired type - * @param type - */ - getFirstAncestorOfType(type: any): void; - - /** - * Find the last parent/grandparent of the desired type - * @param type - */ - getLastAncestorOfType(type: any): void; - - /** - * - */ - getMyFactory(): any; - - /** - * - */ - getParent(): any; - - /** - * Get The data object (thing to be rendered). - */ - getRenderable(): any; - - /** - * Returns the view node that corresponding to the provided object - * Will return NULL if a match is not found in self or descendents - * @param dataObject - */ - getViewNodeFor(dataObject: any): any; - - /** - * - */ - getVisited(): boolean; - - - //invokeEvent - //onEvent(callback: (instance: vtkObject) => any): vtkSubscription; - - /** - * - */ - prepareNodes(): void; - - /** - * - */ - removeUnusedNodes(): void; - - /** - * Makes calls to make self visible. - * @param prepass - */ - render(prepass: any): void; - - /** - * - * @param myFactory - */ - setMyFactory(myFactory: any): boolean; - - /** - * - * @param parent - */ - setParent(parent: any): boolean; - - /** - * - * @param renderable - */ - setRenderable(renderable: any): boolean; - - /** - * - * @param val - */ - setVisited(val: boolean): void; - - /** - * Traverse this node with the specified pass. If you want to traverse your - * children in a specific order or way override this method - * @param {vtkRenderPass} renderPass - */ - traverse(renderPass: vtkRenderPass): void; + /** + * Add a child view node to this node, created from the renderable given as argument + * If the node creation fails or the argument is falsy, returns undefined + * Otherwise, returns the newly created node or the existing node + * @param dobj + */ + addMissingNode(dobj: any): vtkViewNode | undefined; + + /** + * + * @param dataObjs + */ + addMissingNodes(dataObjs: any): void; + + /** + * + * @param {vtkRenderPass} renderPass + * @param prepass + */ + apply(renderPass: vtkRenderPass, prepass: boolean): void; + + /** + * Builds myself. + * @param prepass + */ + build(prepass: any): void; + + /** + * + * @param dataObj + */ + createViewNode(dataObj: any): void; + + /** + * + */ + getChildren(): any; + + /** + * + */ + getChildrenByReference(): any; + + /** + * Find the first parent/grandparent of the desired type + * @param type + */ + getFirstAncestorOfType(type: any): void; + + /** + * Find the last parent/grandparent of the desired type + * @param type + */ + getLastAncestorOfType(type: any): void; + + /** + * + */ + getMyFactory(): any; + + /** + * + */ + getParent(): any; + + /** + * Get The data object (thing to be rendered). + */ + getRenderable(): any; + + /** + * Returns the view node that corresponding to the provided object + * Will return NULL if a match is not found in self or descendents + * @param dataObject + */ + getViewNodeFor(dataObject: any): any; + + /** + * + */ + getVisited(): boolean; + + //invokeEvent + //onEvent(callback: (instance: vtkObject) => any): vtkSubscription; + + /** + * + */ + prepareNodes(): void; + + /** + * + */ + removeUnusedNodes(): void; + + /** + * Makes calls to make self visible. + * @param prepass + */ + render(prepass: any): void; + + /** + * + * @param myFactory + */ + setMyFactory(myFactory: any): boolean; + + /** + * + * @param parent + */ + setParent(parent: any): boolean; + + /** + * + * @param renderable + */ + setRenderable(renderable: any): boolean; + + /** + * + * @param val + */ + setVisited(val: boolean): void; + + /** + * Traverse this node with the specified pass. If you want to traverse your + * children in a specific order or way override this method + * @param {vtkRenderPass} renderPass + */ + traverse(renderPass: vtkRenderPass): void; } /** @@ -160,17 +158,23 @@ export interface vtkViewNode extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IViewNodeInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IViewNodeInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IViewNodeInitialValues +): void; /** * Method used to create a new instance of vtkViewNode. * @param {IViewNodeInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IViewNodeInitialValues): vtkViewNode; +export function newInstance( + initialValues?: IViewNodeInitialValues +): vtkViewNode; /** * a node within a VTK scene graph - * + * * This is the superclass for all nodes within a VTK scene graph. It contains * the API for a node. It supports the essential operations such as graph * creation, state storage and traversal. Child classes adapt this to VTK's @@ -178,7 +182,7 @@ export function newInstance(initialValues?: IViewNodeInitialValues): vtkViewNode * different rendering libraries. */ export declare const vtkViewNode: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkViewNode; diff --git a/Sources/Rendering/SceneGraph/ViewNodeFactory/index.d.ts b/Sources/Rendering/SceneGraph/ViewNodeFactory/index.d.ts index 242e89994eb..9b2cc9fc541 100644 --- a/Sources/Rendering/SceneGraph/ViewNodeFactory/index.d.ts +++ b/Sources/Rendering/SceneGraph/ViewNodeFactory/index.d.ts @@ -1,17 +1,16 @@ -import { vtkObject } from "../../../interfaces"; +import { vtkObject } from '../../../interfaces'; /** - * + * */ export interface IViewNodeFactoryInitialValues {} export interface vtkViewNodeFactory extends vtkObject { - - /** - * Creates and returns a vtkViewNode for the provided renderable. - * @param dataObject - */ - createNode(dataObject: any): void; + /** + * Creates and returns a vtkViewNode for the provided renderable. + * @param dataObject + */ + createNode(dataObject: any): void; } /** @@ -21,24 +20,30 @@ export interface vtkViewNodeFactory extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IViewNodeFactoryInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IViewNodeFactoryInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IViewNodeFactoryInitialValues +): void; /** * Method used to create a new instance of vtkViewNodeFactory. * @param {IViewNodeFactoryInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IViewNodeFactoryInitialValues): vtkViewNodeFactory; +export function newInstance( + initialValues?: IViewNodeFactoryInitialValues +): vtkViewNodeFactory; /** * factory that chooses vtkViewNodes to create - * + * * Class tells VTK which specific vtkViewNode subclass to make when it is asked * to make a vtkViewNode for a particular renderable. modules for different * rendering backends are expected to use this to customize the set of instances * for their own purposes */ export declare const vtkViewNodeFactory: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkViewNodeFactory; diff --git a/Sources/Rendering/WebXR/RenderWindowHelper/Constants.d.ts b/Sources/Rendering/WebXR/RenderWindowHelper/Constants.d.ts index 0fb9e372110..6008787f0ab 100644 --- a/Sources/Rendering/WebXR/RenderWindowHelper/Constants.d.ts +++ b/Sources/Rendering/WebXR/RenderWindowHelper/Constants.d.ts @@ -1,11 +1,11 @@ export declare enum XrSessionTypes { - HmdVR = 0, - MobileAR = 1, - LookingGlassVR = 2, - HmdAR = 3 + HmdVR = 0, + MobileAR = 1, + LookingGlassVR = 2, + HmdAR = 3, } declare const _default: { - XrSessionTypes: typeof XrSessionTypes; + XrSessionTypes: typeof XrSessionTypes; }; export default _default; diff --git a/Sources/Rendering/WebXR/RenderWindowHelper/index.d.ts b/Sources/Rendering/WebXR/RenderWindowHelper/index.d.ts index 8486a5a3d7f..a578a034e6a 100644 --- a/Sources/Rendering/WebXR/RenderWindowHelper/index.d.ts +++ b/Sources/Rendering/WebXR/RenderWindowHelper/index.d.ts @@ -6,61 +6,60 @@ import vtkOpenGLRenderWindow from '../../OpenGL/RenderWindow'; * */ export interface IWebXRRenderWindowHelperInitialValues { - initialized: boolean, - initCanvasSize?: [number, number], - initBackground?: [number, number, number, number], - renderWindow?: Nullable, - xrSession?: Nullable, - xrSessionType: number, - xrReferenceSpace?: any, + initialized: boolean; + initCanvasSize?: [number, number]; + initBackground?: [number, number, number, number]; + renderWindow?: Nullable; + xrSession?: Nullable; + xrSessionType: number; + xrReferenceSpace?: any; } export interface vtkWebXRRenderWindowHelper extends vtkObject { + /** + * Initialize the instance. + */ + initialize(): void; - /** - * Initialize the instance. - */ - initialize(): void; + /** + * Request an XR session on the user device with WebXR, + * typically in response to a user request such as a button press. + */ + startXR(xrSessionType: Number): void; - /** - * Request an XR session on the user device with WebXR, - * typically in response to a user request such as a button press. - */ - startXR(xrSessionType: Number): void; + /** + * When an XR session is available, set up the XRWebGLLayer + * and request the first animation frame for the device + */ + enterXR(): void; - /** - * When an XR session is available, set up the XRWebGLLayer - * and request the first animation frame for the device - */ - enterXR(): void; + /** + * Adjust world-to-physical parameters for different viewing modalities + * + * @param {Number} inputRescaleFactor + * @param {Number} inputTranslateZ + */ + resetXRScene(inputRescaleFactor: number, inputTranslateZ: number): void; - /** - * Adjust world-to-physical parameters for different viewing modalities - * - * @param {Number} inputRescaleFactor - * @param {Number} inputTranslateZ - */ - resetXRScene(inputRescaleFactor: number, inputTranslateZ: number): void; + /** + * Request to stop the current XR session + */ + stopXR(): void; - /** - * Request to stop the current XR session - */ - stopXR(): void; + /** + * Get the underlying render window to drive XR rendering. + */ + getRenderWindow(): Nullable; - /** - * Get the underlying render window to drive XR rendering. - */ - getRenderWindow(): Nullable; + /** + * Set the underlying render window to drive XR rendering. + */ + setRenderWindow(renderWindow: Nullable); - /** - * Set the underlying render window to drive XR rendering. - */ - setRenderWindow(renderWindow:Nullable); - - /** - * Get the active WebXR session. - */ - getXrSession(): Nullable; + /** + * Get the active WebXR session. + */ + getXrSession(): Nullable; } /** @@ -70,13 +69,19 @@ export interface vtkWebXRRenderWindowHelper extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IWebXRRenderWindowHelperInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IWebXRRenderWindowHelperInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IWebXRRenderWindowHelperInitialValues +): void; /** * Method used to create a new instance of vtkWebXRRenderWindowHelper. * @param {IWebXRRenderWindowHelperInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IWebXRRenderWindowHelperInitialValues): vtkWebXRRenderWindowHelper; +export function newInstance( + initialValues?: IWebXRRenderWindowHelperInitialValues +): vtkWebXRRenderWindowHelper; /** * WebXR rendering helper @@ -84,7 +89,7 @@ export function newInstance(initialValues?: IWebXRRenderWindowHelperInitialValue * vtkWebXRRenderWindowHelper is designed to wrap a vtkRenderWindow for XR rendering. */ export declare const vtkWebXRRenderWindowHelper: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkWebXRRenderWindowHelper; diff --git a/Sources/Widgets/Core/AbstractWidget/index.d.ts b/Sources/Widgets/Core/AbstractWidget/index.d.ts index 1b4b8d9da19..8b189ad122c 100644 --- a/Sources/Widgets/Core/AbstractWidget/index.d.ts +++ b/Sources/Widgets/Core/AbstractWidget/index.d.ts @@ -1,11 +1,11 @@ import vtkInteractorObserver from '../../../Rendering/Core/InteractorObserver'; import vtkProp from '../../../Rendering/Core/Prop'; -import vtkRenderer from "../../../Rendering/Core/Renderer"; +import vtkRenderer from '../../../Rendering/Core/Renderer'; import vtkWidgetManager from '../WidgetManager'; import vtkWidgetRepresentation from '../../Representations/WidgetRepresentation'; import vtkWidgetState from '../WidgetState'; -import { Bounds } from "../../../types"; -import { RenderingTypes } from "../WidgetManager/Constants"; +import { Bounds } from '../../../types'; +import { RenderingTypes } from '../WidgetManager/Constants'; import { EventHandler, vtkSubscription } from '../../../interfaces'; export interface vtkAbstractWidget extends vtkProp, vtkInteractorObserver { @@ -22,12 +22,12 @@ export interface vtkAbstractWidget extends vtkProp, vtkInteractorObserver { /** * Activate a handle, identified by both a state and a representation. * Will also invoke appropriate events. - * + * * @param locator An object describing the handle to activate. */ - activateHandle(locator: { - selectedState: vtkWidgetState; - representation: vtkWidgetRepresentation; + activateHandle(locator: { + selectedState: vtkWidgetState; + representation: vtkWidgetRepresentation; }): void; /** @@ -37,7 +37,7 @@ export interface vtkAbstractWidget extends vtkProp, vtkInteractorObserver { /** * Returns true if the widget instance holds the given actor, false otherwise. - * + * * @param {vtkProp} actor */ hasActor(actor: vtkProp): boolean; @@ -61,7 +61,7 @@ export interface vtkAbstractWidget extends vtkProp, vtkInteractorObserver { /** * Place a widget at the given bounds. - * + * * @param {Bounds} bounds */ placeWidget(bounds: Bounds): void; @@ -73,22 +73,22 @@ export interface vtkAbstractWidget extends vtkProp, vtkInteractorObserver { /** * Set the place factor. - * + * * @param {Number} factor The place factor. */ setPlaceFactor(factor: number): void; /** * Get the `vtkWidgetRepresentation` instance associated with the given `vtkActor` instance. - * - * @param {vtkProp} actor + * + * @param {vtkProp} actor */ getRepresentationFromActor(actor: vtkProp): vtkWidgetRepresentation; /** * Update all the widget representations for render. - * - * @param {RenderingTypes} renderingType Default value if `RenderingTypes.FRONT_BUFFER` + * + * @param {RenderingTypes} renderingType Default value if `RenderingTypes.FRONT_BUFFER` */ updateRepresentationForRender(renderingType: RenderingTypes): void; @@ -97,11 +97,10 @@ export interface vtkAbstractWidget extends vtkProp, vtkInteractorObserver { */ getViewWidgets(): vtkAbstractWidget[]; - /** * Set the context visibility. - * - * @param {Boolean} visible + * + * @param {Boolean} visible */ setContextVisibility(visible: boolean): void; @@ -112,8 +111,8 @@ export interface vtkAbstractWidget extends vtkProp, vtkInteractorObserver { /** * Defines if the handles should be visible or not. - * - * @param {Boolean} visible + * + * @param {Boolean} visible */ setHandleVisibility(visible: boolean): void; @@ -124,7 +123,7 @@ export interface vtkAbstractWidget extends vtkProp, vtkInteractorObserver { /** * Set the widget manager associated with the widget instance. - * + * * @param {vtkWidgetManager} wm The widget manager instance */ setWidgetManager(wm: vtkWidgetManager): void; @@ -146,15 +145,18 @@ export interface vtkAbstractWidget extends vtkProp, vtkInteractorObserver { /** * Register a callback to be invoked when the `ActivateHandle` event occurs. - * + * * @param {EventHandler} cb The callback to register * @param {Number} [priority] Priority of this subscription */ - onActivateHandle(cb: EventHandler, priority?: number): Readonly; + onActivateHandle( + cb: EventHandler, + priority?: number + ): Readonly; /** * Invoke the `ActivateHandle` event with the given payload. - * + * * @param args The event payload */ invokeActivateHandle(...args: unknown[]): void; @@ -167,11 +169,15 @@ export interface vtkAbstractWidget extends vtkProp, vtkInteractorObserver { * @param model object on which data structure will be bounds (protected) * @param initialValues (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues? : object): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: object +): void; /** * Method used to create a new instance of vtkAbstractWidget - * + * * @param initialValues For pre-setting some of its content */ export function newInstance(initialValues?: object): vtkAbstractWidget; @@ -180,8 +186,8 @@ export function newInstance(initialValues?: object): vtkAbstractWidget; * vtkAbstractWidget is an abstract class to construct a widget. */ export declare const vtkAbstractWidget: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkAbstractWidget; diff --git a/Sources/Widgets/Core/AbstractWidgetFactory/index.d.ts b/Sources/Widgets/Core/AbstractWidgetFactory/index.d.ts index 77e90001297..cb1c77d02fb 100644 --- a/Sources/Widgets/Core/AbstractWidgetFactory/index.d.ts +++ b/Sources/Widgets/Core/AbstractWidgetFactory/index.d.ts @@ -1,9 +1,9 @@ -import vtkAbstractWidget from "../AbstractWidget"; -import vtkRenderer from "../../../Rendering/Core/Renderer"; -import vtkWidgetState from "../WidgetState"; -import { ViewTypes } from "../WidgetManager/Constants"; -import { Bounds, Nullable } from "../../../types"; -import { EventHandler, vtkSubscription, vtkObject } from "../../../interfaces"; +import vtkAbstractWidget from '../AbstractWidget'; +import vtkRenderer from '../../../Rendering/Core/Renderer'; +import vtkWidgetState from '../WidgetState'; +import { ViewTypes } from '../WidgetManager/Constants'; +import { Bounds, Nullable } from '../../../types'; +import { EventHandler, vtkSubscription, vtkObject } from '../../../interfaces'; export interface IGetWidgetForViewParams { viewId: number; @@ -12,12 +12,14 @@ export interface IGetWidgetForViewParams { initialValues?: object; } -export interface vtkAbstractWidgetFactory extends vtkObject { +export interface vtkAbstractWidgetFactory< + WidgetInstance extends vtkAbstractWidget +> extends vtkObject { /** - * Will return the widget associated with the view with Id id `locator.viewId`. + * Will return the widget associated with the view with Id id `locator.viewId`. * If there is no widget associated with the view, a new widget will be constructed, provided * that the renderer, viewType, and optionally initialValues are also provided. - * + * * @param {IGetWidgetForViewParams} locator */ getWidgetForView(locator: IGetWidgetForViewParams): Nullable; @@ -34,43 +36,43 @@ export interface vtkAbstractWidgetFactory; + onWidgetChangeEvent( + cb: EventHandler, + priority?: number + ): Readonly; /** * Invoke the WidgetChange event - * + * * @param args The event payload */ invokeWidgetChangeEvent(...args: unknown[]): void; @@ -112,7 +117,7 @@ export interface vtkAbstractWidgetFactory = ((publicAPI: object, model: object) => void) & { [ExtendSymbol]: WidgetInstance }; - -export interface IAbstractWidgetFactoryInitialValues { +export type ExtendWidgetBehavior = (( + publicAPI: object, + model: object +) => void) & { [ExtendSymbol]: WidgetInstance }; + +export interface IAbstractWidgetFactoryInitialValues< + WidgetInstance extends vtkAbstractWidget = vtkAbstractWidget +> { behavior?: ExtendWidgetBehavior; } @@ -136,18 +146,28 @@ export interface IAbstractWidgetFactoryInitialValues(publicAPI: object, model: object, initialValues?: IAbstractWidgetFactoryInitialValues): void; +export function extend< + WidgetInstance extends vtkAbstractWidget = vtkAbstractWidget +>( + publicAPI: object, + model: object, + initialValues?: IAbstractWidgetFactoryInitialValues +): void; /** * Method used to create a new instance of vtkAbstractWidgetFactory - * + * * @param initialValues for pre-setting some of its content */ -export function newInstance(initialValues?: IAbstractWidgetFactoryInitialValues): vtkAbstractWidgetFactory; +export function newInstance< + WidgetInstance extends vtkAbstractWidget = vtkAbstractWidget +>( + initialValues?: IAbstractWidgetFactoryInitialValues +): vtkAbstractWidgetFactory; export declare const vtkAbstractWidgetFactory: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkAbstractWidgetFactory; diff --git a/Sources/Widgets/Core/WidgetManager/Constants.d.ts b/Sources/Widgets/Core/WidgetManager/Constants.d.ts index ed039c7c5c8..1ffc3493ae6 100644 --- a/Sources/Widgets/Core/WidgetManager/Constants.d.ts +++ b/Sources/Widgets/Core/WidgetManager/Constants.d.ts @@ -5,23 +5,23 @@ export declare enum ViewTypes { VOLUME = 3, YZ_PLANE = 4, XZ_PLANE = 5, - XY_PLANE = 6 + XY_PLANE = 6, } export declare enum RenderingTypes { PICKING_BUFFER = 0, - FRONT_BUFFER = 1 + FRONT_BUFFER = 1, } export declare enum CaptureOn { MOUSE_MOVE = 0, - MOUSE_RELEASE = 1 + MOUSE_RELEASE = 1, } declare const _default: { ViewTypes: typeof ViewTypes; RenderingTypes: typeof RenderingTypes; CaptureOn: typeof CaptureOn; -} +}; export default _default; diff --git a/Sources/Widgets/Core/WidgetManager/index.d.ts b/Sources/Widgets/Core/WidgetManager/index.d.ts index 94f9a09bd93..d47aa44430f 100644 --- a/Sources/Widgets/Core/WidgetManager/index.d.ts +++ b/Sources/Widgets/Core/WidgetManager/index.d.ts @@ -32,10 +32,12 @@ export interface IRenderingComponents { /** * Extract the rendering components from the given renderer. - * + * * @param {vtkRenderer} renderer The vtkRenderer instance. */ -export function extractRenderingComponents(renderer: vtkRenderer): IRenderingComponents; +export function extractRenderingComponents( + renderer: vtkRenderer +): IRenderingComponents; /** * This method returns the world distance that corresponds to the height of a @@ -47,10 +49,10 @@ export function getPixelWorldHeightAtCoord(coord: []): Number; export interface vtkWidgetManager extends vtkObject { /** - * The the captureOn value. + * The the captureOn value. * `CaptureOn.MOUSE_MOVE`: captures small region when moving mouse * `CaptureOn.MOUSE_RELEASE`: captures entire region when mouse button is released - * + * * @param {CaptureOn} captureOn */ setCaptureOn(captureOn: CaptureOn): boolean; @@ -62,7 +64,7 @@ export interface vtkWidgetManager extends vtkObject { /** * The the view type. - * + * * @param {ViewTypes} type */ setViewType(type: ViewTypes): boolean; @@ -116,15 +118,15 @@ export interface vtkWidgetManager extends vtkObject { /** * Set the renderer. - * + * * @param {vtkRenderer} renderer */ setRenderer(renderer: vtkRenderer): void; /** - * Register a widget on the widget manager instance. - * Please note that one should link the widget manager to a view before calling this method. - * + * Register a widget on the widget manager instance. + * Please note that one should link the widget manager to a view before calling this method. + * * @param {vtkAbstractWidgetFactory} widget The abstract widget factory. * @param {ViewTypes} [viewType] * @param {Object} [initialValues] @@ -133,7 +135,9 @@ export interface vtkWidgetManager extends vtkObject { widget: WidgetFactory, viewType?: ViewTypes, initialValues?: object - ): WidgetFactory extends vtkAbstractWidgetFactory ? WidgetInstance : never; + ): WidgetFactory extends vtkAbstractWidgetFactory + ? WidgetInstance + : never; /** * Unregister all widgets from the widget manager. @@ -142,14 +146,14 @@ export interface vtkWidgetManager extends vtkObject { /** * Remove a widget from the widget manager. - * + * * @param {vtkAbstractWidget | vtkAbstractWidgetFactory} widget The widget to remove */ removeWidget(widget: vtkAbstractWidget | vtkAbstractWidgetFactory): void; /** * Given x and y parameter, get selected data. - * + * * @param {Number} x * @param {Number} y */ @@ -162,7 +166,7 @@ export interface vtkWidgetManager extends vtkObject { /** * Given the focus to the given widget instance. - * + * * @param {vtkAbstractWidget | vtkAbstractWidgetFactory} widget The widget instance which should get the focus. */ grabFocus(widget: vtkAbstractWidget | vtkAbstractWidgetFactory): void; @@ -211,10 +215,12 @@ export function extend( /** * Method used to create a new instance of vtkCellArray - * + * * @param initialValues for pre-setting some of its content */ -export function newInstance(initialValues?: IWidgetManagerInitialValues): vtkWidgetManager; +export function newInstance( + initialValues?: IWidgetManagerInitialValues +): vtkWidgetManager; export declare const vtkWidgetManager: { newInstance: typeof newInstance; diff --git a/Sources/Widgets/Core/WidgetState/index.d.ts b/Sources/Widgets/Core/WidgetState/index.d.ts index d1dbaeb1265..7d9bf8f2b95 100644 --- a/Sources/Widgets/Core/WidgetState/index.d.ts +++ b/Sources/Widgets/Core/WidgetState/index.d.ts @@ -1,9 +1,9 @@ -import { vtkObject } from "../../../interfaces"; +import { vtkObject } from '../../../interfaces'; export interface vtkWidgetState extends vtkObject { /** * Set the active flag of the widget state instance - * + * * @param active The active flag */ setActive(active: boolean): boolean; @@ -15,7 +15,7 @@ export interface vtkWidgetState extends vtkObject { /** * Bind a state to one or more labels. If no label is provided, the default one will be used. - * + * * @param {vtkWidgetState} subState The state to bound. * @param {String | String[]} [labels] The labels to which the state should be bound. */ @@ -23,7 +23,7 @@ export interface vtkWidgetState extends vtkObject { /** * Unbind a specific state from the widget state instance - * + * * @param {vtkWidgetState} subState The state to be unbound. */ unbindState(subState: vtkWidgetState): void; @@ -40,21 +40,21 @@ export interface vtkWidgetState extends vtkObject { /** * Deactivate thie widget state instance and all its sub states, except the `excludingState` argument. - * + * * @param {vtkWidgetState} [excludingState] A sub-state instance that should not be deactivated. */ deactivate(excludingState?: vtkWidgetState): void; /** * Activate only the passed in sub state. Every other sub states will be deactivated. - * + * * @param {vtkWidgetState} subState The sub-state that should be activated. */ activateOnly(subState: vtkWidgetState): void; /** * Get every states that are associated with the given label. - * + * * @param {String} label The label from which to retrieve the states. */ getStatesWithLabel(label: string): vtkWidgetState[]; @@ -72,7 +72,11 @@ export interface vtkWidgetState extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {object} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: object): vtkWidgetState; +export function extend( + publicAPI: object, + model: object, + initialValues?: object +): vtkWidgetState; export declare const vtkWidgetState: { extend: typeof extend; diff --git a/Sources/Widgets/Manipulators/AbstractManipulator/index.d.ts b/Sources/Widgets/Manipulators/AbstractManipulator/index.d.ts index 5c2d5cfef2a..48a54e4d154 100644 --- a/Sources/Widgets/Manipulators/AbstractManipulator/index.d.ts +++ b/Sources/Widgets/Manipulators/AbstractManipulator/index.d.ts @@ -1,228 +1,229 @@ -import { vtkObject } from "../../../interfaces"; -import { vtkOpenGLRenderWindow } from "../../../Rendering/OpenGL/RenderWindow" -import { Matrix3x3, Nullable, Vector3 } from "../../../types"; +import { vtkObject } from '../../../interfaces'; +import { vtkOpenGLRenderWindow } from '../../../Rendering/OpenGL/RenderWindow'; +import { Matrix3x3, Nullable, Vector3 } from '../../../types'; /** * */ export interface IAbstractManipulatorInitialValues { - userOrigin?: Vector3; - handleOrigin?: Vector3; - widgetOrigin?: Vector3; - userNormal?: Vector3; - handleNormal?: Vector3; - widgetNormal?: Vector3; + userOrigin?: Vector3; + handleOrigin?: Vector3; + widgetOrigin?: Vector3; + userNormal?: Vector3; + handleNormal?: Vector3; + widgetNormal?: Vector3; } export interface vtkAbstractManipulator extends vtkObject { - - /** - * Get the normal of the line - */ - getNormal(callData: any): Vector3; - - /** - * Get the origin of the line - */ - getOrigin(callData: any): Vector3; - - /** - * Get the value of useCameraFocalPoint - */ - getUseCameraFocalPoint(): boolean; - - /** - * Set the value of useCameraFocalPoint - * @param useCameraFocalPoint if true, the focal point of the camera will be used if userOrigin is not set. - */ - setUseCameraFocalPoint(useCameraFocalPoint: boolean): boolean; - - /** - * Get the value of useCameraNormal - */ - getUseCameraNormal(): boolean; - - /** - * Set the value of useCameraNormal - * @param useCameraNormal if true, the normal of the camera will be used if userNormal is not set. - */ - setUseCameraNormal(useCameraNormal: boolean): boolean; - - /** - * Processes a vtkRenderWindowInteractor event into 3D world positional info. - * - * Returns an object containing: - * - worldCoords: a 3D coordinate corresponding to the 2D event. - * - worldDelta: a 3D position delta between the current and the previous call to handleEvent. - * - worldDirection: a 3D directional vector. Only on select manipulators. - * - * worldCoords can be null if the pointer event enters an invalid manipulator region. For example, - * the PickerManipulator returns null when the pointer event is off of the picked geometry. - * - * worldDelta only makes sense between two calls of `handleEvent`. In a queue of `handleEvent` calls, - * the i-th call returns the delta between the i-th worldCoords and the (i-1)-th worldCoords. - * Thus, calling `handleEvent` is necessary for maintaining a valid worldDelta even when the return - * value is ignored. - * - * There are three cases where worldDelta needs to handle null events: - * 1. the first call to `handleEvent`, since there is no previously cached event position. - * worldDelta is set to [0, 0, 0]. - * 2. if the current `handleEvent` call returns a null worldCoords. worldDelta is set to [0, 0, 0]. - * 3. if the previous `handleEvent` call returned a null worldCoords. In this case, worldDelta is the - * delta between the current worldCoords and the previous non-null worldCoords, referring to the - * previous 2 cases when applicable. - * - * @param callData - * @param glRenderWindow - */ - handleEvent(callData: any, glRenderWindow: vtkOpenGLRenderWindow): { - worldCoords: Nullable, - worldDelta: Vector3, - worldDirection?: Matrix3x3, - }; - - /* ------------------------------------------------------------------- */ - - /** - * Set the user normal. - * This normal take precedence on the handleNormal and the widgetNormal. - * This normal should not be set within the widget internal code. - * @param {Vector3} normal The normal coordinate. - */ - setUserNormal(normal: Vector3): boolean; - - /** - * Set the user normal (see setUserNormal). - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setUserNormal(x: number, y: number, z: number): boolean; - - /** - * Set the user normal (see setUserNormal). - * @param {Vector3} normal The normal coordinate. - */ - setUserNormalFrom(normal: Vector3): boolean; - - /** - * Set the user origin. - * This origin take precedence on the handleOrigin and the widgetOrigin. - * This origin should not be set within the widget internal code. - * @param {Vector3} origin The coordinate of the origin point. - */ - setUserOrigin(origin: Vector3): boolean; - - /** - * Set the user origin (see setUserOrigin). - * @param {Number} x The x coordinate of the origin point. - * @param {Number} y The y coordinate of the origin point. - * @param {Number} z The z coordinate of the origin point. - */ - setUserOrigin(x: number, y: number, z: number): boolean; - - /** - * Set the user origin (see setUserOrigin). - * @param {Vector3} origin The coordinate of the origin point. - */ - setUserOriginFrom(origin: Vector3): boolean; - - /* ------------------------------------------------------------------- */ - - /** - * Set the handle normal. - * This normal is used after the userNormal and before the widgetNormal. - * This normal is automatically set by any state having a manipulatorMixin, - * and can be overridden in the widget code. - * @param {Vector3} normal The normal coordinate. - */ - setHandleNormal(normal: Vector3): boolean; - - /** - * Set the handle normal (see setHandleNormal). - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setHandleNormal(x: number, y: number, z: number): boolean; - - /** - * Set the handle normal (see setHandleNormal). - * @param {Vector3} normal The normal coordinate. - */ - setHandleNormalFrom(normal: Vector3): boolean; - - /** - * Set the handle origin. - * This origin is used after the userOrigin and before the widgetOrigin. - * This origin is automatically set by any state having a manipulatorMixin, - * and can be overridden in the widget code. - * @param {Vector3} origin The coordinate of the origin point. - */ - setHandleOrigin(origin: Vector3): boolean; - - /** - * Set the handle origin (see setHandleOrigin). - * @param {Number} x The x coordinate of the origin point. - * @param {Number} y The y coordinate of the origin point. - * @param {Number} z The z coordinate of the origin point. - */ - setHandleOrigin(x: number, y: number, z: number): boolean; - - /** - * Set the handle origin (see setHandleOrigin). - * @param {Vector3} origin The coordinate of the origin point. - */ - setHandleOriginFrom(origin: Vector3): boolean; - - /* ------------------------------------------------------------------- */ - - /** - * Set the widget normal. - * This normal is used if no other normals are set. - * It can be used to define a normal global to the whole widget. - * @param {Vector3} normal The normal coordinate. - */ - setWidgetNormal(normal: Vector3): boolean; - - /** - * Set the widget normal (see setWidgetNormal). - * @param {Number} x The x coordinate. - * @param {Number} y The y coordinate. - * @param {Number} z The z coordinate. - */ - setWidgetNormal(x: number, y: number, z: number): boolean; - - /** - * Set the widget normal (see setWidgetNormal). - * @param {Vector3} normal The normal coordinate. - */ - setWidgetNormalFrom(normal: Vector3): boolean; - - /** - * Set the widget origin. - * This origin is used if no other origins are set. - * It can be used to define an origin global to the whole widget. - * @param {Vector3} origin The coordinate of the origin point. - */ - setWidgetOrigin(origin: Vector3): boolean; - - /** - * Set the widget origin (see setWidgetOrigin). - * @param {Number} x The x coordinate of the origin point. - * @param {Number} y The y coordinate of the origin point. - * @param {Number} z The z coordinate of the origin point. - */ - setWidgetOrigin(x: number, y: number, z: number): boolean; - - /** - * Set the widget origin (see setWidgetOrigin). - * @param {Vector3} origin The coordinate of the origin point. - */ - setWidgetOriginFrom(origin: Vector3): boolean; + /** + * Get the normal of the line + */ + getNormal(callData: any): Vector3; + + /** + * Get the origin of the line + */ + getOrigin(callData: any): Vector3; + + /** + * Get the value of useCameraFocalPoint + */ + getUseCameraFocalPoint(): boolean; + + /** + * Set the value of useCameraFocalPoint + * @param useCameraFocalPoint if true, the focal point of the camera will be used if userOrigin is not set. + */ + setUseCameraFocalPoint(useCameraFocalPoint: boolean): boolean; + + /** + * Get the value of useCameraNormal + */ + getUseCameraNormal(): boolean; + + /** + * Set the value of useCameraNormal + * @param useCameraNormal if true, the normal of the camera will be used if userNormal is not set. + */ + setUseCameraNormal(useCameraNormal: boolean): boolean; + + /** + * Processes a vtkRenderWindowInteractor event into 3D world positional info. + * + * Returns an object containing: + * - worldCoords: a 3D coordinate corresponding to the 2D event. + * - worldDelta: a 3D position delta between the current and the previous call to handleEvent. + * - worldDirection: a 3D directional vector. Only on select manipulators. + * + * worldCoords can be null if the pointer event enters an invalid manipulator region. For example, + * the PickerManipulator returns null when the pointer event is off of the picked geometry. + * + * worldDelta only makes sense between two calls of `handleEvent`. In a queue of `handleEvent` calls, + * the i-th call returns the delta between the i-th worldCoords and the (i-1)-th worldCoords. + * Thus, calling `handleEvent` is necessary for maintaining a valid worldDelta even when the return + * value is ignored. + * + * There are three cases where worldDelta needs to handle null events: + * 1. the first call to `handleEvent`, since there is no previously cached event position. + * worldDelta is set to [0, 0, 0]. + * 2. if the current `handleEvent` call returns a null worldCoords. worldDelta is set to [0, 0, 0]. + * 3. if the previous `handleEvent` call returned a null worldCoords. In this case, worldDelta is the + * delta between the current worldCoords and the previous non-null worldCoords, referring to the + * previous 2 cases when applicable. + * + * @param callData + * @param glRenderWindow + */ + handleEvent( + callData: any, + glRenderWindow: vtkOpenGLRenderWindow + ): { + worldCoords: Nullable; + worldDelta: Vector3; + worldDirection?: Matrix3x3; + }; + + /* ------------------------------------------------------------------- */ + + /** + * Set the user normal. + * This normal take precedence on the handleNormal and the widgetNormal. + * This normal should not be set within the widget internal code. + * @param {Vector3} normal The normal coordinate. + */ + setUserNormal(normal: Vector3): boolean; + + /** + * Set the user normal (see setUserNormal). + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setUserNormal(x: number, y: number, z: number): boolean; + + /** + * Set the user normal (see setUserNormal). + * @param {Vector3} normal The normal coordinate. + */ + setUserNormalFrom(normal: Vector3): boolean; + + /** + * Set the user origin. + * This origin take precedence on the handleOrigin and the widgetOrigin. + * This origin should not be set within the widget internal code. + * @param {Vector3} origin The coordinate of the origin point. + */ + setUserOrigin(origin: Vector3): boolean; + + /** + * Set the user origin (see setUserOrigin). + * @param {Number} x The x coordinate of the origin point. + * @param {Number} y The y coordinate of the origin point. + * @param {Number} z The z coordinate of the origin point. + */ + setUserOrigin(x: number, y: number, z: number): boolean; + + /** + * Set the user origin (see setUserOrigin). + * @param {Vector3} origin The coordinate of the origin point. + */ + setUserOriginFrom(origin: Vector3): boolean; + + /* ------------------------------------------------------------------- */ + + /** + * Set the handle normal. + * This normal is used after the userNormal and before the widgetNormal. + * This normal is automatically set by any state having a manipulatorMixin, + * and can be overridden in the widget code. + * @param {Vector3} normal The normal coordinate. + */ + setHandleNormal(normal: Vector3): boolean; + + /** + * Set the handle normal (see setHandleNormal). + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setHandleNormal(x: number, y: number, z: number): boolean; + + /** + * Set the handle normal (see setHandleNormal). + * @param {Vector3} normal The normal coordinate. + */ + setHandleNormalFrom(normal: Vector3): boolean; + + /** + * Set the handle origin. + * This origin is used after the userOrigin and before the widgetOrigin. + * This origin is automatically set by any state having a manipulatorMixin, + * and can be overridden in the widget code. + * @param {Vector3} origin The coordinate of the origin point. + */ + setHandleOrigin(origin: Vector3): boolean; + + /** + * Set the handle origin (see setHandleOrigin). + * @param {Number} x The x coordinate of the origin point. + * @param {Number} y The y coordinate of the origin point. + * @param {Number} z The z coordinate of the origin point. + */ + setHandleOrigin(x: number, y: number, z: number): boolean; + + /** + * Set the handle origin (see setHandleOrigin). + * @param {Vector3} origin The coordinate of the origin point. + */ + setHandleOriginFrom(origin: Vector3): boolean; + + /* ------------------------------------------------------------------- */ + + /** + * Set the widget normal. + * This normal is used if no other normals are set. + * It can be used to define a normal global to the whole widget. + * @param {Vector3} normal The normal coordinate. + */ + setWidgetNormal(normal: Vector3): boolean; + + /** + * Set the widget normal (see setWidgetNormal). + * @param {Number} x The x coordinate. + * @param {Number} y The y coordinate. + * @param {Number} z The z coordinate. + */ + setWidgetNormal(x: number, y: number, z: number): boolean; + + /** + * Set the widget normal (see setWidgetNormal). + * @param {Vector3} normal The normal coordinate. + */ + setWidgetNormalFrom(normal: Vector3): boolean; + + /** + * Set the widget origin. + * This origin is used if no other origins are set. + * It can be used to define an origin global to the whole widget. + * @param {Vector3} origin The coordinate of the origin point. + */ + setWidgetOrigin(origin: Vector3): boolean; + + /** + * Set the widget origin (see setWidgetOrigin). + * @param {Number} x The x coordinate of the origin point. + * @param {Number} y The y coordinate of the origin point. + * @param {Number} z The z coordinate of the origin point. + */ + setWidgetOrigin(x: number, y: number, z: number): boolean; + + /** + * Set the widget origin (see setWidgetOrigin). + * @param {Vector3} origin The coordinate of the origin point. + */ + setWidgetOriginFrom(origin: Vector3): boolean; } - /** * Method use to decorate a given object (publicAPI+model) with vtkAbstractManipulator characteristics. * @@ -230,18 +231,24 @@ export interface vtkAbstractManipulator extends vtkObject { * @param model object on which data structure will be bounds (protected) * @param {IAbstractManipulatorInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IAbstractManipulatorInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IAbstractManipulatorInitialValues +): void; /** * Method use to create a new instance of vtkAbstractManipulator */ -export function newInstance(initialValues?: IAbstractManipulatorInitialValues): vtkAbstractManipulator; +export function newInstance( + initialValues?: IAbstractManipulatorInitialValues +): vtkAbstractManipulator; /** * vtkAbstractManipulator. */ export declare const vtkAbstractManipulator: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkAbstractManipulator; diff --git a/Sources/Widgets/Manipulators/LineManipulator/index.d.ts b/Sources/Widgets/Manipulators/LineManipulator/index.d.ts index 278efe10d2c..0c91828ac8d 100755 --- a/Sources/Widgets/Manipulators/LineManipulator/index.d.ts +++ b/Sources/Widgets/Manipulators/LineManipulator/index.d.ts @@ -1,17 +1,16 @@ -import { IAbstractManipulatorInitialValues, vtkAbstractManipulator } from "../AbstractManipulator"; -import { Vector3 } from "../../../types"; +import { + IAbstractManipulatorInitialValues, + vtkAbstractManipulator, +} from '../AbstractManipulator'; +import { Vector3 } from '../../../types'; /** * */ -export interface ILineManipulatorInitialValues extends IAbstractManipulatorInitialValues { - -} - -export interface vtkLineManipulator extends vtkAbstractManipulator { - -} +export interface ILineManipulatorInitialValues + extends IAbstractManipulatorInitialValues {} +export interface vtkLineManipulator extends vtkAbstractManipulator {} /** * Method use to decorate a given object (publicAPI+model) with vtkLineManipulator characteristics. @@ -20,30 +19,43 @@ export interface vtkLineManipulator extends vtkAbstractManipulator { * @param model object on which data structure will be bounds (protected) * @param {ILineManipulatorInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ILineManipulatorInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ILineManipulatorInitialValues +): void; /** * Method use to create a new instance of vtkLineManipulator */ -export function newInstance(initialValues?: ILineManipulatorInitialValues): vtkLineManipulator; +export function newInstance( + initialValues?: ILineManipulatorInitialValues +): vtkLineManipulator; /** - * - * @param {Number} x - * @param {Number} y - * @param {Vector3} lineOrigin - * @param {Vector3} lineDirection - * @param renderer - * @param glRenderWindow + * + * @param {Number} x + * @param {Number} y + * @param {Vector3} lineOrigin + * @param {Vector3} lineDirection + * @param renderer + * @param glRenderWindow */ -export function projectDisplayToLine(x: number, y: number, lineOrigin: Vector3, lineDirection: Vector3, renderer: any, glRenderWindow: any): Vector3; +export function projectDisplayToLine( + x: number, + y: number, + lineOrigin: Vector3, + lineDirection: Vector3, + renderer: any, + glRenderWindow: any +): Vector3; /** * vtkLineManipulator. */ export declare const vtkLineManipulator: { - newInstance: typeof newInstance, - extend: typeof extend, - projectDisplayToLine: typeof projectDisplayToLine; + newInstance: typeof newInstance; + extend: typeof extend; + projectDisplayToLine: typeof projectDisplayToLine; }; export default vtkLineManipulator; diff --git a/Sources/Widgets/Manipulators/PickerManipulator/index.d.ts b/Sources/Widgets/Manipulators/PickerManipulator/index.d.ts index db782f31420..5d60472f251 100755 --- a/Sources/Widgets/Manipulators/PickerManipulator/index.d.ts +++ b/Sources/Widgets/Manipulators/PickerManipulator/index.d.ts @@ -1,28 +1,27 @@ -import { IAbstractManipulatorInitialValues, vtkAbstractManipulator } from "../AbstractManipulator"; +import { + IAbstractManipulatorInitialValues, + vtkAbstractManipulator, +} from '../AbstractManipulator'; import vtkPicker from '../../../Rendering/Core/Picker'; /** * */ -export interface IPickerManipulatorInitialValues extends IAbstractManipulatorInitialValues { - -} +export interface IPickerManipulatorInitialValues + extends IAbstractManipulatorInitialValues {} export interface vtkPickerManipulator extends vtkAbstractManipulator { - /** - * - */ - getPicker(): vtkPicker; + * + */ + getPicker(): vtkPicker; /** - * - */ - setPicker(picker: vtkPicker): void; - + * + */ + setPicker(picker: vtkPicker): void; } - /** * Method use to decorate a given object (publicAPI+model) with vtkPickerManipulator characteristics. * @@ -30,19 +29,24 @@ export interface vtkPickerManipulator extends vtkAbstractManipulator { * @param model object on which data structure will be bounds (protected) * @param {IPickerManipulatorInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPickerManipulatorInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPickerManipulatorInitialValues +): void; /** * Method use to create a new instance of vtkPickerManipulator */ -export function newInstance(initialValues?: IPickerManipulatorInitialValues): vtkPickerManipulator; - +export function newInstance( + initialValues?: IPickerManipulatorInitialValues +): vtkPickerManipulator; /** * vtkPickerManipulator. */ export declare const vtkPickerManipulator: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkPickerManipulator; diff --git a/Sources/Widgets/Manipulators/PlaneManipulator/index.d.ts b/Sources/Widgets/Manipulators/PlaneManipulator/index.d.ts index 18c760105d8..e24fc7ee868 100755 --- a/Sources/Widgets/Manipulators/PlaneManipulator/index.d.ts +++ b/Sources/Widgets/Manipulators/PlaneManipulator/index.d.ts @@ -1,17 +1,16 @@ -import { IAbstractManipulatorInitialValues, vtkAbstractManipulator } from "../AbstractManipulator"; -import { Vector3 } from "../../../types"; +import { + IAbstractManipulatorInitialValues, + vtkAbstractManipulator, +} from '../AbstractManipulator'; +import { Vector3 } from '../../../types'; /** * */ -export interface IPlaneManipulatorInitialValues extends IAbstractManipulatorInitialValues { - -} - -export interface vtkPlaneManipulator extends vtkAbstractManipulator { - -} +export interface IPlaneManipulatorInitialValues + extends IAbstractManipulatorInitialValues {} +export interface vtkPlaneManipulator extends vtkAbstractManipulator {} /** * Method use to decorate a given object (publicAPI+model) with vtkPlaneManipulator characteristics. @@ -20,31 +19,43 @@ export interface vtkPlaneManipulator extends vtkAbstractManipulator { * @param model object on which data structure will be bounds (protected) * @param {IPlaneManipulatorInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IPlaneManipulatorInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IPlaneManipulatorInitialValues +): void; /** * Method use to create a new instance of vtkPlaneManipulator */ -export function newInstance(initialValues?: IPlaneManipulatorInitialValues): vtkPlaneManipulator; +export function newInstance( + initialValues?: IPlaneManipulatorInitialValues +): vtkPlaneManipulator; /** - * - * @param {Number} x - * @param {Number} y - * @param {Vector3} planeOrigin - * @param {Vector3} planeNormal - * @param renderer - * @param glRenderWindow + * + * @param {Number} x + * @param {Number} y + * @param {Vector3} planeOrigin + * @param {Vector3} planeNormal + * @param renderer + * @param glRenderWindow */ -export function intersectDisplayWithPlane(x: number, y: number, planeOrigin: Vector3, planeNormal: Vector3, renderer: any, glRenderWindow: any): Vector3; - +export function intersectDisplayWithPlane( + x: number, + y: number, + planeOrigin: Vector3, + planeNormal: Vector3, + renderer: any, + glRenderWindow: any +): Vector3; /** * vtkPlaneManipulator. */ export declare const vtkPlaneManipulator: { - newInstance: typeof newInstance, - extend: typeof extend, - intersectDisplayWithPlane: typeof intersectDisplayWithPlane; + newInstance: typeof newInstance; + extend: typeof extend; + intersectDisplayWithPlane: typeof intersectDisplayWithPlane; }; export default vtkPlaneManipulator; diff --git a/Sources/Widgets/Manipulators/TrackballManipulator/index.d.ts b/Sources/Widgets/Manipulators/TrackballManipulator/index.d.ts index f331691221e..bbe31124c4d 100755 --- a/Sources/Widgets/Manipulators/TrackballManipulator/index.d.ts +++ b/Sources/Widgets/Manipulators/TrackballManipulator/index.d.ts @@ -1,22 +1,22 @@ -import { IAbstractManipulatorInitialValues, vtkAbstractManipulator } from "../AbstractManipulator"; -import { Vector3 } from "../../../types"; +import { + IAbstractManipulatorInitialValues, + vtkAbstractManipulator, +} from '../AbstractManipulator'; +import { Vector3 } from '../../../types'; /** * */ -export interface ITrackballManipulatorInitialValues extends IAbstractManipulatorInitialValues { - -} +export interface ITrackballManipulatorInitialValues + extends IAbstractManipulatorInitialValues {} export interface vtkTrackballManipulator extends vtkAbstractManipulator { - - /** - * - */ - reset(callData: any): void; + /** + * + */ + reset(callData: any): void; } - /** * Method use to decorate a given object (publicAPI+model) with vtkTrackballManipulator characteristics. * @@ -24,33 +24,47 @@ export interface vtkTrackballManipulator extends vtkAbstractManipulator { * @param model object on which data structure will be bounds (protected) * @param {ITrackballManipulatorInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: ITrackballManipulatorInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: ITrackballManipulatorInitialValues +): void; /** * Method use to create a new instance of vtkTrackballManipulator */ -export function newInstance(initialValues?: ITrackballManipulatorInitialValues): vtkTrackballManipulator; +export function newInstance( + initialValues?: ITrackballManipulatorInitialValues +): vtkTrackballManipulator; /** - * - * @param {Number} prevX - * @param {Number} prevY - * @param {Number} curX - * @param {Number} curY - * @param {Vector3} origin - * @param {Vector3} direction - * @param renderer - * @param glRenderWindow + * + * @param {Number} prevX + * @param {Number} prevY + * @param {Number} curX + * @param {Number} curY + * @param {Vector3} origin + * @param {Vector3} direction + * @param renderer + * @param glRenderWindow */ -export function trackballRotate(prevX: number, prevY: number, curX: number, curY: number, origin: Vector3, direction: Vector3, renderer: any, glRenderWindow: any): void; - +export function trackballRotate( + prevX: number, + prevY: number, + curX: number, + curY: number, + origin: Vector3, + direction: Vector3, + renderer: any, + glRenderWindow: any +): void; /** * vtkTrackballManipulator. */ export declare const vtkTrackballManipulator: { - newInstance: typeof newInstance, - extend: typeof extend, - trackballRotate: typeof trackballRotate; + newInstance: typeof newInstance; + extend: typeof extend; + trackballRotate: typeof trackballRotate; }; export default vtkTrackballManipulator; diff --git a/Sources/Widgets/Representations/WidgetRepresentation/index.d.ts b/Sources/Widgets/Representations/WidgetRepresentation/index.d.ts index 0370c30d76a..6f95958f36a 100644 --- a/Sources/Widgets/Representations/WidgetRepresentation/index.d.ts +++ b/Sources/Widgets/Representations/WidgetRepresentation/index.d.ts @@ -1,53 +1,53 @@ -import vtkDataArray from "../../../Common/Core/DataArray"; -import vtkPolyData from "../../../Common/DataModel/PolyData"; -import { vtkObject } from "../../../interfaces"; -import vtkProp from "../../../Rendering/Core/Prop"; +import vtkDataArray from '../../../Common/Core/DataArray'; +import vtkPolyData from '../../../Common/DataModel/PolyData'; +import { vtkObject } from '../../../interfaces'; +import vtkProp from '../../../Rendering/Core/Prop'; export interface IDisplayScaleParams { - dispHeightFactor: number, - cameraPosition: number[], - cameraDir: number[], - isParallel: boolean, - rendererPixelDims: number[], + dispHeightFactor: number; + cameraPosition: number[]; + cameraDir: number[]; + isParallel: boolean; + rendererPixelDims: number[]; } export interface IWidgetRepresentationInitialValues { - labels?: Array, - coincidentTopologyParameters?: object, - displayScaleParams?: IDisplayScaleParams, - scaleInPixels?: boolean + labels?: Array; + coincidentTopologyParameters?: object; + displayScaleParams?: IDisplayScaleParams; + scaleInPixels?: boolean; } export interface vtkWidgetRepresentation extends vtkProp { - getLabels(): Array; - setLabels(labels: Array): void; + getLabels(): Array; + setLabels(labels: Array): void; - /** - * Gets the coincident topology parameters applied on the actor mappers - */ - getCoincidentTopologyParameters(): object; - /** - * Sets the coincident topology parameters applied on the actor mappers - */ - setCoincidentTopologyParameters(parameters: object): boolean; + /** + * Gets the coincident topology parameters applied on the actor mappers + */ + getCoincidentTopologyParameters(): object; + /** + * Sets the coincident topology parameters applied on the actor mappers + */ + setCoincidentTopologyParameters(parameters: object): boolean; - /** - * Sets the current view and camera scale parameters. - * Called by the WidgetManager. - * @see setScaleInPixels() - */ - setDisplayScaleParams(params: object): boolean; + /** + * Sets the current view and camera scale parameters. + * Called by the WidgetManager. + * @see setScaleInPixels() + */ + setDisplayScaleParams(params: object): boolean; - /** - * Gets wether actors should have a fix size in display coordinates. - * @see setScaleInPixels() - */ - getScaleInPixels(): boolean; + /** + * Gets wether actors should have a fix size in display coordinates. + * @see setScaleInPixels() + */ + getScaleInPixels(): boolean; - /** - * Sets wether actors should have a fix size in display coordinates. - * @see getScaleInPixels() - */ - setScaleInPixels(scale: boolean): boolean; + /** + * Sets wether actors should have a fix size in display coordinates. + * @see getScaleInPixels() + */ + setScaleInPixels(scale: boolean): boolean; } /** @@ -57,27 +57,36 @@ export interface vtkWidgetRepresentation extends vtkProp { * @param model object on which data structure will be bounds (protected) * @param {IWidgetRepresentationInitialValues} [initialValues] (default: {}) */ -export function extend(publicAPI: object, model: object, initialValues?: IWidgetRepresentationInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IWidgetRepresentationInitialValues +): void; /** * Method use to create a new instance of vtkWidgetRepresentation * @param {IWidgetRepresentationInitialValues} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues?: IWidgetRepresentationInitialValues): vtkWidgetRepresentation; +export function newInstance( + initialValues?: IWidgetRepresentationInitialValues +): vtkWidgetRepresentation; /** * Static function to get the pixel size of a 3D point. * @param {Number[]} worldCoord 3D point in world coordinates * @param {IDisplayScaleParams} displayScaleParams Display and camera information */ -export function getPixelWorldHeightAtCoord(worldCoord: number[], displayScaleParams: IDisplayScaleParams): number[]; +export function getPixelWorldHeightAtCoord( + worldCoord: number[], + displayScaleParams: IDisplayScaleParams +): number[]; export interface IWidgetPipeline { - source?: object, - filter?: object, - glyph?: object, - mapper: object, - actor: object + source?: object; + filter?: object; + glyph?: object; + mapper: object; + actor: object; } /** * If provided, connects `source` (dataset or filter) to `filter`. @@ -100,14 +109,16 @@ export function connectPipeline(pipeline: IWidgetPipeline): void; * @param {String} dataType The typed array type name. * @param {Number} numberOfComponents The number of components of the array. */ - export function allocateArray(polyData: vtkPolyData, - name: string, - numberOfTuples: number, - dataType?: string, - numberOfComponents?: number): vtkDataArray|null; +export function allocateArray( + polyData: vtkPolyData, + name: string, + numberOfTuples: number, + dataType?: string, + numberOfComponents?: number +): vtkDataArray | null; export declare const vtkWidgetRepresentation: { - newInstance: typeof newInstance; - extend: typeof extend; -} + newInstance: typeof newInstance; + extend: typeof extend; +}; export default vtkWidgetRepresentation; diff --git a/Sources/Widgets/Widgets3D/InteractiveOrientationWidget/index.d.ts b/Sources/Widgets/Widgets3D/InteractiveOrientationWidget/index.d.ts index 52a9bd7d0a0..57798586031 100644 --- a/Sources/Widgets/Widgets3D/InteractiveOrientationWidget/index.d.ts +++ b/Sources/Widgets/Widgets3D/InteractiveOrientationWidget/index.d.ts @@ -1,12 +1,17 @@ -import { vtkAbstractWidgetFactory, IAbstractWidgetFactoryInitialValues } from "../../Core/AbstractWidgetFactory"; -import vtkAbstractWidget from '../../Core/AbstractWidget' -import { Bounds } from "../../../types"; -import { ViewTypes } from "../../Core/WidgetManager/Constants"; +import { + vtkAbstractWidgetFactory, + IAbstractWidgetFactoryInitialValues, +} from '../../Core/AbstractWidgetFactory'; +import vtkAbstractWidget from '../../Core/AbstractWidget'; +import { Bounds } from '../../../types'; +import { ViewTypes } from '../../Core/WidgetManager/Constants'; -export interface vtkInteractiveOrientationWidget extends vtkAbstractWidgetFactory { +export interface vtkInteractiveOrientationWidget< + WidgetInstance extends vtkAbstractWidget = vtkAbstractWidget +> extends vtkAbstractWidgetFactory { /** * Set the widget bounds - * + * * @param {Bounds} bounds The widget bounds */ setBounds(bounds: Bounds): void; @@ -17,7 +22,9 @@ export interface vtkInteractiveOrientationWidget extends IAbstractWidgetFactoryInitialValues {} +export interface IInteractiveOrientationWidgetInitialValues< + WidgetInstance extends vtkAbstractWidget +> extends IAbstractWidgetFactoryInitialValues {} /** * Method use to decorate a given object (publicAPI+model) with vtkInteractiveOrientationWidget characteristics. @@ -26,18 +33,26 @@ export interface IInteractiveOrientationWidgetInitialValues(publicAPI: object, model: object, initialValues? : IInteractiveOrientationWidgetInitialValues): void; +export function extend( + publicAPI: object, + model: object, + initialValues?: IInteractiveOrientationWidgetInitialValues +): void; /** * Creates a new instance of vtkInteractiveOrientationWidget - * + * * @param {object} [initialValues] for pre-setting some of its content */ -export function newInstance(initialValues? : IInteractiveOrientationWidgetInitialValues): vtkInteractiveOrientationWidget; +export function newInstance< + WidgetInstance extends vtkAbstractWidget = vtkAbstractWidget +>( + initialValues?: IInteractiveOrientationWidgetInitialValues +): vtkInteractiveOrientationWidget; export declare const vtkInteractiveOrientationWidget: { - newInstance: typeof newInstance, - extend: typeof extend, + newInstance: typeof newInstance; + extend: typeof extend; }; export default vtkInteractiveOrientationWidget; diff --git a/Sources/Widgets/Widgets3D/ResliceCursorWidget/Constants.d.ts b/Sources/Widgets/Widgets3D/ResliceCursorWidget/Constants.d.ts index 15edf1d1c98..d40c3c8cdf9 100644 --- a/Sources/Widgets/Widgets3D/ResliceCursorWidget/Constants.d.ts +++ b/Sources/Widgets/Widgets3D/ResliceCursorWidget/Constants.d.ts @@ -2,7 +2,10 @@ import { Vector3 } from '../../../types'; import { ViewTypes } from '../../Core/WidgetManager/Constants'; // Different types of plane from ViewTypes: -export type PlaneViewType = ViewTypes.YZ_PLANE | ViewTypes.XZ_PLANE | ViewTypes.XY_PLANE; +export type PlaneViewType = + | ViewTypes.YZ_PLANE + | ViewTypes.XZ_PLANE + | ViewTypes.XY_PLANE; // 0, 1, 2 for X, Y, Z export type AxisIndex = 0 | 1 | 2; @@ -10,7 +13,6 @@ export type AxisIndex = 0 | 1 | 2; // Should be X, Y, Z export type PlaneName = typeof planeNames extends (infer U)[] ? U : never; - export declare enum ScrollingMethods { MIDDLE_MOUSE_BUTTON = 0, LEFT_MOUSE_BUTTON = 1, @@ -26,19 +28,36 @@ export declare enum InteractionMethodsName { TranslateCenterAndUpdatePlanes = 'translateCenterAndUpdatePlanes', } -export declare const defaultViewUpFromViewType: { [plane in PlaneViewType]: Vector3 }; +export declare const defaultViewUpFromViewType: { + [plane in PlaneViewType]: Vector3; +}; -export declare const xyzToViewType: [PlaneViewType, PlaneViewType, PlaneViewType]; +export declare const xyzToViewType: [ + PlaneViewType, + PlaneViewType, + PlaneViewType +]; export declare const viewTypeToXYZ: { [plane in PlaneViewType]: AxisIndex }; export declare const planeNames: ['X', 'Y', 'Z']; -export declare const viewTypeToPlaneName: { [plane in PlaneViewType]: PlaneName }; +export declare const viewTypeToPlaneName: { + [plane in PlaneViewType]: PlaneName; +}; -export declare const planeNameToViewType: { [planeName in PlaneName]: PlaneViewType }; +export declare const planeNameToViewType: { + [planeName in PlaneName]: PlaneViewType; +}; -export declare const lineNames: ['YinX', 'ZinX', 'XinY', 'ZinY', 'XinZ', 'YinZ']; +export declare const lineNames: [ + 'YinX', + 'ZinX', + 'XinY', + 'ZinY', + 'XinZ', + 'YinZ' +]; declare const _default: { ScrollingMethods: typeof ScrollingMethods; diff --git a/Sources/Widgets/Widgets3D/ResliceCursorWidget/behavior.d.ts b/Sources/Widgets/Widgets3D/ResliceCursorWidget/behavior.d.ts index 159c7b01c6a..2ac5a459b37 100644 --- a/Sources/Widgets/Widgets3D/ResliceCursorWidget/behavior.d.ts +++ b/Sources/Widgets/Widgets3D/ResliceCursorWidget/behavior.d.ts @@ -1,26 +1,27 @@ -import { Nullable } from "../../../types"; -import { InteractionMethodsName, lineNames } from "./Constants"; -import vtkAbstractWidget from "../../Core/AbstractWidget"; +import { Nullable } from '../../../types'; +import { InteractionMethodsName, lineNames } from './Constants'; +import vtkAbstractWidget from '../../Core/AbstractWidget'; -type TLineName = (typeof lineNames)[number]; +type TLineName = typeof lineNames[number]; type TCursorStyles = { - [key in InteractionMethodsName]?: string; + [key in InteractionMethodsName]?: string; } & { - default?: string + default?: string; }; -export default interface vtkResliceCursorWidgetDefaultInstance extends vtkAbstractWidget { - getActiveInteraction(): Nullable; +export default interface vtkResliceCursorWidgetDefaultInstance + extends vtkAbstractWidget { + getActiveInteraction(): Nullable; - setKeepOrthogonality(keepOrthogonality: boolean): boolean; - getKeepOrthogonality(): boolean; + setKeepOrthogonality(keepOrthogonality: boolean): boolean; + getKeepOrthogonality(): boolean; - setCursorStyles(cursorStyles: TCursorStyles): boolean; - getCursorStyles(): TCursorStyles; + setCursorStyles(cursorStyles: TCursorStyles): boolean; + getCursorStyles(): TCursorStyles; - setEnableTranslation(enableTranslation: boolean): void; - setEnableRotation(enableRotation: boolean): void; + setEnableTranslation(enableTranslation: boolean): void; + setEnableRotation(enableRotation: boolean): void; - getActiveLineName(): TLineName | undefined; + getActiveLineName(): TLineName | undefined; } diff --git a/Sources/Widgets/Widgets3D/ResliceCursorWidget/index.d.ts b/Sources/Widgets/Widgets3D/ResliceCursorWidget/index.d.ts index 000d0bbcf3e..47b64333a91 100644 --- a/Sources/Widgets/Widgets3D/ResliceCursorWidget/index.d.ts +++ b/Sources/Widgets/Widgets3D/ResliceCursorWidget/index.d.ts @@ -1,7 +1,10 @@ import { mat4 } from 'gl-matrix'; -import { vtkAbstractWidgetFactory, IAbstractWidgetFactoryInitialValues } from '../../Core/AbstractWidgetFactory'; +import { + vtkAbstractWidgetFactory, + IAbstractWidgetFactoryInitialValues, +} from '../../Core/AbstractWidgetFactory'; import vtkResliceCursorWidgetDefaultInstance from './behavior'; -import vtkAbstractWidget from '../../Core/AbstractWidget' +import vtkAbstractWidget from '../../Core/AbstractWidget'; import vtkImageData from '../../../Common/DataModel/ImageData'; import vtkImageReslice from '../../../Imaging/Core/ImageReslice'; import vtkPlaneSource from '../../../Filters/Sources/PlaneSource'; @@ -11,15 +14,16 @@ import { ViewTypes } from '../../../Widgets/Core/WidgetManager/Constants'; import { Vector2, Vector3 } from '../../../types'; export interface IDisplayScaleParams { - dispHeightFactor: number, - cameraPosition: Vector3, - cameraDir: Vector3, - isParallel: false, - rendererPixelDims: Vector2 + dispHeightFactor: number; + cameraPosition: Vector3; + cameraDir: Vector3; + isParallel: false; + rendererPixelDims: Vector2; } -export interface vtkResliceCursorWidget extends vtkAbstractWidgetFactory { - +export interface vtkResliceCursorWidget< + WidgetInstance extends vtkAbstractWidget = vtkResliceCursorWidgetDefaultInstance +> extends vtkAbstractWidgetFactory { /** * @param {ViewTypes} viewType */ @@ -43,12 +47,14 @@ export interface vtkResliceCursorWidget} two Vector3 arrays (first and last points) */ getPlaneExtremities(viewType: ViewTypes): Array; - } -export interface IResliceCursorWidgetInitialValues extends IAbstractWidgetFactoryInitialValues {} +export interface IResliceCursorWidgetInitialValues< + WidgetInstance extends vtkAbstractWidget +> extends IAbstractWidgetFactoryInitialValues {} /** * Method used to decorate a given object (publicAPI+model) with vtkResliceCursorWidget characteristics. @@ -99,10 +106,14 @@ export function extend( /** * Method used to create a new instance of vtkResliceCursorWidget - * + * * @param initialValues for pre-setting some of its content */ -export function newInstance(initialValues?: IResliceCursorWidgetInitialValues): vtkResliceCursorWidget; +export function newInstance< + WidgetInstance extends vtkAbstractWidget = vtkResliceCursorWidgetDefaultInstance +>( + initialValues?: IResliceCursorWidgetInitialValues +): vtkResliceCursorWidget; export declare const vtkResliceCursorWidget: { newInstance: typeof newInstance; diff --git a/Sources/Widgets/Widgets3D/SeedWidget/index.d.ts b/Sources/Widgets/Widgets3D/SeedWidget/index.d.ts index 18ff6039a19..e73ddc017a1 100644 --- a/Sources/Widgets/Widgets3D/SeedWidget/index.d.ts +++ b/Sources/Widgets/Widgets3D/SeedWidget/index.d.ts @@ -5,11 +5,11 @@ export interface ISeedWidgetHandleState { getOrigin(): Vector3; setOrigin(arg: Vector3): void; getColor3(): string; - setColor3(arg: string):void; + setColor3(arg: string): void; getScale1(): number; setScale1(arg: number): void; getVisible(): boolean; - setVisible(arg: boolean):void + setVisible(arg: boolean): void; setShape(arg: string): void; getShape(): string; } diff --git a/Sources/Widgets/Widgets3D/SphereWidget/index.d.ts b/Sources/Widgets/Widgets3D/SphereWidget/index.d.ts index 8a3838c6142..ddb1f46a1fe 100644 --- a/Sources/Widgets/Widgets3D/SphereWidget/index.d.ts +++ b/Sources/Widgets/Widgets3D/SphereWidget/index.d.ts @@ -5,11 +5,11 @@ export interface ISphereWidgetHandleState { getOrigin(): Vector3; setOrigin(arg: Vector3): void; getColor(): string; - setColor(arg: string):void; + setColor(arg: string): void; getScale1(): number; setScale1(arg: number): void; getVisible(): boolean; - setVisible(arg: boolean):void + setVisible(arg: boolean): void; setShape(arg: string): void; getShape(): string; } @@ -41,7 +41,9 @@ export interface vtkSphereWidget { export interface ISphereWidgetInitialValues {} -export function newInstance(props?: ISphereWidgetInitialValues): vtkSphereWidget; +export function newInstance( + props?: ISphereWidgetInitialValues +): vtkSphereWidget; export const vtkSphereWidget: { newInstance: typeof newInstance; diff --git a/Sources/interfaces.d.ts b/Sources/interfaces.d.ts index 2ed30534575..a5d3178b84d 100644 --- a/Sources/interfaces.d.ts +++ b/Sources/interfaces.d.ts @@ -1,283 +1,283 @@ -import vtkDataArray from "./Common/Core/DataArray"; -import { vtkPipelineConnection } from "./types"; +import vtkDataArray from './Common/Core/DataArray'; +import { vtkPipelineConnection } from './types'; import { EVENT_ABORT, VOID } from './macros'; /** * Object returned on any subscription call */ export interface vtkSubscription { - unsubscribe(): void; + unsubscribe(): void; } /** * Basic object representing a data range */ export interface vtkRange { - min: number; - max: number; + min: number; + max: number; } /** * Represents a debounced function. */ export interface vtkDebouncedFunction { - (...args: any) : any; - cancel() : void; + (...args: any): any; + cancel(): void; } export interface vtkOutputPort { - filter: vtkAlgorithm; + filter: vtkAlgorithm; } /** * vtkAlgorithm API */ export interface vtkAlgorithm { - - /** - * Assign a data object as input. - * @param dataset The dataset object. - * @param {Number} [port] The port number (default 0). - */ - setInputData(dataset: any, port?: number): void; - - /** - * @param {Number} [port] The port number (default 0). - */ - getInputData(port?: number): any; - - /** - * @param outputPort - * @param {Number} [port] The port number (default 0). - */ - setInputConnection(outputPort: vtkPipelineConnection, port?: number): void; - - /** - * @param {Number} [port] The port number (default 0). - */ - getInputConnection(port?: number): vtkPipelineConnection; - - /** - * Add a connection to the given input port index. - * @param {vtkPipelineConnection} outputPort - */ - addInputConnection(outputPort: vtkPipelineConnection): void; - - /** - * - * @param dataset - */ - addInputData(dataset: any): void; - - /** - * Get the data object that will contain the algorithm output for the given - * port. - * @param {Number} [port] The port number (default 0). - */ - getOutputData(port?: number): any; - - /** - * - */ - shouldUpdate(): boolean; - - /** - * Get a proxy object corresponding to the given output port of this - * algorithm. - * @param {Number} [port] The port number (default 0). - */ - getOutputPort(port?: number): vtkPipelineConnection; - - /** - * Bring this algorithm's outputs up-to-date. - */ - update(): void; - - /** - * Get the number of input ports used by the algorithm. - */ - getNumberOfInputPorts(): number; - - /** - * Get the number of output ports provided by the algorithm. - */ - getNumberOfOutputPorts(): number; - - /** - * Get the actual data array for the input array sepcified by idx. - * @param {Number} port (default 0) - */ - getInputArrayToProcess(inputPort?: number): vtkDataArray; - - /** - * Set the input data arrays that this algorithm will process. - * @param {Number} inputPort The port number. - * @param {String} arrayName The name of the array. - * @param {String} fieldAssociation The name of the association field. - * @param {String} attributeType (default 'Scalars') - */ - setInputArrayToProcess( - inputPort: number, - arrayName: string, - fieldAssociation: string, - attributeType?: string - ): void; + /** + * Assign a data object as input. + * @param dataset The dataset object. + * @param {Number} [port] The port number (default 0). + */ + setInputData(dataset: any, port?: number): void; + + /** + * @param {Number} [port] The port number (default 0). + */ + getInputData(port?: number): any; + + /** + * @param outputPort + * @param {Number} [port] The port number (default 0). + */ + setInputConnection(outputPort: vtkPipelineConnection, port?: number): void; + + /** + * @param {Number} [port] The port number (default 0). + */ + getInputConnection(port?: number): vtkPipelineConnection; + + /** + * Add a connection to the given input port index. + * @param {vtkPipelineConnection} outputPort + */ + addInputConnection(outputPort: vtkPipelineConnection): void; + + /** + * + * @param dataset + */ + addInputData(dataset: any): void; + + /** + * Get the data object that will contain the algorithm output for the given + * port. + * @param {Number} [port] The port number (default 0). + */ + getOutputData(port?: number): any; + + /** + * + */ + shouldUpdate(): boolean; + + /** + * Get a proxy object corresponding to the given output port of this + * algorithm. + * @param {Number} [port] The port number (default 0). + */ + getOutputPort(port?: number): vtkPipelineConnection; + + /** + * Bring this algorithm's outputs up-to-date. + */ + update(): void; + + /** + * Get the number of input ports used by the algorithm. + */ + getNumberOfInputPorts(): number; + + /** + * Get the number of output ports provided by the algorithm. + */ + getNumberOfOutputPorts(): number; + + /** + * Get the actual data array for the input array sepcified by idx. + * @param {Number} port (default 0) + */ + getInputArrayToProcess(inputPort?: number): vtkDataArray; + + /** + * Set the input data arrays that this algorithm will process. + * @param {Number} inputPort The port number. + * @param {String} arrayName The name of the array. + * @param {String} fieldAssociation The name of the association field. + * @param {String} attributeType (default 'Scalars') + */ + setInputArrayToProcess( + inputPort: number, + arrayName: string, + fieldAssociation: string, + attributeType?: string + ): void; } /** -* Base vtkClass which provides MTime tracking and class infrastructure -*/ + * Base vtkClass which provides MTime tracking and class infrastructure + */ export interface vtkObject { - - /** - * Allow to check if that object was deleted (.delete() was called before). - * @returns true if delete() was previously called - */ - isDeleted(): boolean; - - /** - * Mark the object dirty by increasing its MTime. - * Such action also trigger the onModified() callbacks if any was registered. - * This naturally happens when you call any setXXX(value) with a different value. - */ - modified(): void; - - /** - * Method to register callback when the object is modified(). - * - * @param callback function - * @returns subscription object so you can easily unsubscribe later on - */ - onModified(callback: (instance: vtkObject) => any): vtkSubscription; - - /** - * Return the `Modified Time` which is a monotonic increasing integer - * global for all vtkObjects. - * - * This allow to solve a question such as: - * - Is that object created/modified after another one? - * - Do I need to re-execute this filter, or not? ... - * - * @return {Number} the global modified time. - */ - getMTime(): number; - - /** - * Method to check if an instance is of a given class name. - * For example such method for a vtkCellArray will return true - * for any of the following string: ['vtkObject', 'vtkDataArray', 'vtkCellArray'] - */ - isA(className: string): boolean; - - /** - * Return the instance class name. - */ - getClassName(): string; - - /** - * Generic method to set many fields at one. - * - * For example calling the following function - * ```js - * changeDetected = sphereSourceInstance.set({ - * phiResolution: 10, - * thetaResolution: 20, - * }); - * ``` - * will be equivalent of calling - * ```js - * changeDetected += sphereSourceInstance.setPhiResolution(10); - * changeDetected += sphereSourceInstance.setThetaResolution(20); - * changeDetected = !!changeDetected; - * ``` - * - * In case you provide other field names that do not belong to the instance, - * vtkWarningMacro will be used to warn you. To disable those warning, - * you can set `noWarning` to true. - * - * If `noFunction` is set to true, the field will be set directly on the model - * without calling the `set${FieldName}()` method. - * - * @param [map] (default: {}) Object capturing the set of fieldNames and associated values to set. - * @param [noWarning] (default: false) Boolean to disable any warning. - * @param [noFunctions] (default: false) Boolean to skip any function execution and rely on only setting the fields on the model. - * @return true if a change was actually performed. False otherwise when the value provided were equal to the ones already set inside the instance. - */ - set(map?: object, noWarning?: boolean, noFunction?: boolean): boolean; - - /** - * Extract a set of properties at once from a vtkObject. - * - * This can be convenient to pass a partial state of - * one object to another. - * - * ``` - * cameraB.set(cameraA.get('position', 'viewUp', 'focalPoint')); - * ``` - * - * @param listOfKeys set of field names that you want to retrieve. If not provided, the full model get returned as a new object. - * @returns a new object containing only the values of requested fields - */ - get(...listOfKeys: Array): object; - - /** - * Allow to get a direct reference of a model element - * - * @param name of the field to extract from the instance model - * @returns model[name] - */ - getReferenceByName(name: string): any; - - /** - * Dereference any internal object and remove any subscription. - * It gives custom class to properly detach themselves from the DOM - * or any external dependency that could prevent their deletion - * when the GC runs. - */ - delete(): void; - - /** - * Try to extract a serializable (JSON) object of the given - * instance tree. - * - * Such state can then be reused to clone or rebuild a full - * vtkObject tree using the root vtk() function. - * - * The following example will grab mapper and dataset that are - * beneath the vtkActor instance as well. - * - * ``` - * const actorStr = JSON.stringify(actor.getState()); - * const newActor = vtk(JSON.parse(actorStr)); - * ``` - */ - getState(): object; - - /** - * Used internally by JSON.stringify to get the content to serialize. - * Allow to call directly JSON.stringify on the vtkObject instead of using getState before doing so. - * - * ``` - * const actorStr = JSON.stringify(actor); - * const newActor = vtk(JSON.parse(actorStr)); - * ``` - */ - toJSON(): object; - - /** - * Try to copy the state of the other to ourselves by just using references. - * - * @param {vtkObject} other instance to copy the reference from - * @param {Boolean} [debug] (default: false) if true feedback will be provided when mismatch happen - */ - shallowCopy(other: vtkObject, debug?: boolean): void; + /** + * Allow to check if that object was deleted (.delete() was called before). + * @returns true if delete() was previously called + */ + isDeleted(): boolean; + + /** + * Mark the object dirty by increasing its MTime. + * Such action also trigger the onModified() callbacks if any was registered. + * This naturally happens when you call any setXXX(value) with a different value. + */ + modified(): void; + + /** + * Method to register callback when the object is modified(). + * + * @param callback function + * @returns subscription object so you can easily unsubscribe later on + */ + onModified(callback: (instance: vtkObject) => any): vtkSubscription; + + /** + * Return the `Modified Time` which is a monotonic increasing integer + * global for all vtkObjects. + * + * This allow to solve a question such as: + * - Is that object created/modified after another one? + * - Do I need to re-execute this filter, or not? ... + * + * @return {Number} the global modified time. + */ + getMTime(): number; + + /** + * Method to check if an instance is of a given class name. + * For example such method for a vtkCellArray will return true + * for any of the following string: ['vtkObject', 'vtkDataArray', 'vtkCellArray'] + */ + isA(className: string): boolean; + + /** + * Return the instance class name. + */ + getClassName(): string; + + /** + * Generic method to set many fields at one. + * + * For example calling the following function + * ```js + * changeDetected = sphereSourceInstance.set({ + * phiResolution: 10, + * thetaResolution: 20, + * }); + * ``` + * will be equivalent of calling + * ```js + * changeDetected += sphereSourceInstance.setPhiResolution(10); + * changeDetected += sphereSourceInstance.setThetaResolution(20); + * changeDetected = !!changeDetected; + * ``` + * + * In case you provide other field names that do not belong to the instance, + * vtkWarningMacro will be used to warn you. To disable those warning, + * you can set `noWarning` to true. + * + * If `noFunction` is set to true, the field will be set directly on the model + * without calling the `set${FieldName}()` method. + * + * @param [map] (default: {}) Object capturing the set of fieldNames and associated values to set. + * @param [noWarning] (default: false) Boolean to disable any warning. + * @param [noFunctions] (default: false) Boolean to skip any function execution and rely on only setting the fields on the model. + * @return true if a change was actually performed. False otherwise when the value provided were equal to the ones already set inside the instance. + */ + set(map?: object, noWarning?: boolean, noFunction?: boolean): boolean; + + /** + * Extract a set of properties at once from a vtkObject. + * + * This can be convenient to pass a partial state of + * one object to another. + * + * ``` + * cameraB.set(cameraA.get('position', 'viewUp', 'focalPoint')); + * ``` + * + * @param listOfKeys set of field names that you want to retrieve. If not provided, the full model get returned as a new object. + * @returns a new object containing only the values of requested fields + */ + get(...listOfKeys: Array): object; + + /** + * Allow to get a direct reference of a model element + * + * @param name of the field to extract from the instance model + * @returns model[name] + */ + getReferenceByName(name: string): any; + + /** + * Dereference any internal object and remove any subscription. + * It gives custom class to properly detach themselves from the DOM + * or any external dependency that could prevent their deletion + * when the GC runs. + */ + delete(): void; + + /** + * Try to extract a serializable (JSON) object of the given + * instance tree. + * + * Such state can then be reused to clone or rebuild a full + * vtkObject tree using the root vtk() function. + * + * The following example will grab mapper and dataset that are + * beneath the vtkActor instance as well. + * + * ``` + * const actorStr = JSON.stringify(actor.getState()); + * const newActor = vtk(JSON.parse(actorStr)); + * ``` + */ + getState(): object; + + /** + * Used internally by JSON.stringify to get the content to serialize. + * Allow to call directly JSON.stringify on the vtkObject instead of using getState before doing so. + * + * ``` + * const actorStr = JSON.stringify(actor); + * const newActor = vtk(JSON.parse(actorStr)); + * ``` + */ + toJSON(): object; + + /** + * Try to copy the state of the other to ourselves by just using references. + * + * @param {vtkObject} other instance to copy the reference from + * @param {Boolean} [debug] (default: false) if true feedback will be provided when mismatch happen + */ + shallowCopy(other: vtkObject, debug?: boolean): void; } export interface vtkProperty { - name: string; - children?: vtkProperty[]; + name: string; + children?: vtkProperty[]; } export interface vtkPropertyDomain {} -export type EventHandler = (...args: unknown[]) => typeof EVENT_ABORT | typeof VOID | void; +export type EventHandler = ( + ...args: unknown[] +) => typeof EVENT_ABORT | typeof VOID | void; diff --git a/package.json b/package.json index d4b47772d51..e0c64d96b75 100644 --- a/package.json +++ b/package.json @@ -134,8 +134,8 @@ "wslink": ">=1.1.0 || ^2.0.0" }, "scripts": { - "validate": "prettier --config ./prettier.config.js --list-different \"Sources/**/*.js\" \"Examples/**/*.js\"", - "reformat": "prettier --config ./prettier.config.js --write \"Sources/**/*.js\" \"Examples/**/*.js\"", + "validate": "prettier --config ./prettier.config.js --list-different \"Sources/**/*.[tj]s\" \"Examples/**/*.[tj]s\"", + "reformat": "prettier --config ./prettier.config.js --write \"Sources/**/*.[tj]s\" \"Examples/**/*.[tj]s\"", "reformat-only": "prettier --single-quote --trailing-comma es5 --print-width 80 --arrow-parens always --write", "lint-fix": "eslint --fix Sources Examples", "lint": "eslint Sources Examples",