Skip to content

Commit 4d832d7

Browse files
committed
docs(ts): Add typescript definitions for box
1 parent 6b08c8f commit 4d832d7

File tree

2 files changed

+80
-6
lines changed

2 files changed

+80
-6
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import { vtkObject } from "../../../interfaces" ;
2+
import { Bounds, Point } from "../../../types";
3+
4+
5+
export interface IBoxInitialValues {
6+
bbox?: Bounds;
7+
}
8+
9+
export interface vtkBox extends vtkObject {
10+
11+
/**
12+
* Add the bounds for the box.
13+
* @param {Bounds} bounds
14+
*/
15+
addBounds(bounds: Bounds): void;
16+
17+
/**
18+
*
19+
* @param other
20+
*/
21+
addBox(other: any): void;
22+
23+
/**
24+
*
25+
* @param {Point} x The point coordinate.
26+
*/
27+
evaluateFunction(x: Point): number;
28+
29+
/**
30+
*
31+
* @param {Number} x The x coordinate.
32+
* @param {Number} y The y coordinate.
33+
* @param {Number} z The z coordinate.
34+
*/
35+
evaluateFunction(x: number, y: number, z: number ): number;
36+
37+
/**
38+
* Get the bounds for the box.
39+
*/
40+
getBounds(): Bounds;
41+
42+
/**
43+
* Set the bounds for the box.
44+
* @param {Bounds} bounds The bounds for the box.
45+
*/
46+
setBounds(bounds: Bounds): void;
47+
}
48+
49+
/**
50+
* Method used to decorate a given object (publicAPI+model) with vtkBox characteristics.
51+
*
52+
* @param publicAPI object on which methods will be bounds (public)
53+
* @param model object on which data structure will be bounds (protected)
54+
* @param {IBoxInitialValues} [initialValues] (default: {})
55+
*/
56+
export function extend(publicAPI: object, model: object, initialValues?: IBoxInitialValues): void;
57+
58+
/**
59+
* Method used to create a new instance of vtkBox.
60+
* @param {IBoxInitialValues} [initialValues] for pre-setting some of its content
61+
*/
62+
export function newInstance(initialValues?: IBoxInitialValues): vtkBox;
63+
64+
/**
65+
* vtkBox provides methods for creating a 1D cubic spline object from given
66+
* parameters, and allows for the calculation of the spline value and derivative
67+
* at any given point inside the spline intervals.
68+
*/
69+
export declare const vtkBox: {
70+
newInstance: typeof newInstance,
71+
extend: typeof extend
72+
};
73+
export default vtkBox;

Sources/Filters/Sources/CubeSource/index.d.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { vtkAlgorithm, vtkObject } from "../../../interfaces";
2+
import { Bounds, Point } from "../../../types";
23

34
/**
45
*
@@ -7,7 +8,7 @@ export interface ICircleSourceInitialValues {
78
xLength?: number;
89
yLength?: number;
910
zLength?: number;
10-
center?: number[];
11+
center?: Point;
1112
rotations?: number[];
1213
pointType?: string;
1314
generate3DTextureCoordinates?: boolean;
@@ -27,12 +28,12 @@ export interface vtkCubeSource extends vtkCubeSourceBase {
2728
* Get the center of the cube.
2829
* @default [0.0, 0.0, 0.0]
2930
*/
30-
getCenter(): number[];
31+
getCenter(): Point;
3132

3233
/**
3334
* Get the center of the cube.
3435
*/
35-
getCenterByReference(): number[];
36+
getCenterByReference(): Point;
3637

3738
/**
3839
*
@@ -90,9 +91,9 @@ export interface vtkCubeSource extends vtkCubeSourceBase {
9091

9192
/**
9293
* Convenience methods allows creation of cube by specifying bounding box.
93-
* @param bounds
94+
* @param {Bounds} bounds The bounds for the cube.
9495
*/
95-
setBounds(bounds: number[]): boolean;
96+
setBounds(bounds: Bounds): boolean;
9697

9798
/**
9899
* Set the center of the cube.
@@ -108,7 +109,7 @@ export interface vtkCubeSource extends vtkCubeSourceBase {
108109
* @param center
109110
* @default [0, 0, 0]
110111
*/
111-
setCenterFrom(center: number[]): boolean;
112+
setCenterFrom(center: Point): boolean;
112113

113114
/**
114115
*

0 commit comments

Comments
 (0)