Skip to content

Commit 37c36e4

Browse files
committed
feat(Planes): add vtkPlanes
1 parent a6ffba9 commit 37c36e4

File tree

3 files changed

+425
-0
lines changed

3 files changed

+425
-0
lines changed
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
import { Bounds, Vector3 } from '../../../types';
2+
import vtkDataArray from '../../Core/DataArray';
3+
import vtkImplicitFunction, {
4+
IImplicitFunctionInitialValues,
5+
} from '../ImplicitFunction';
6+
import vtkPlane from '../Plane';
7+
import vtkPoints from '../../Core/Points';
8+
9+
/**
10+
*
11+
*/
12+
export interface IPlanesInitialValues extends IImplicitFunctionInitialValues {
13+
points?: vtkPoints;
14+
normals?: vtkDataArray;
15+
bounds?: Bounds;
16+
planes?: number[];
17+
}
18+
19+
export interface vtkPlanes extends vtkImplicitFunction {
20+
/**
21+
* Evaluate the function at a point x
22+
* @param x The point at which to evaluate the function
23+
* @returns The function value at the point x
24+
*/
25+
evaluateFunction(x: Vector3): number;
26+
27+
/**
28+
* Evaluate the gradient at a point x
29+
* @param x The point at which to evaluate the gradient
30+
* @returns The gradient at the point x
31+
*/
32+
evaluateGradient(x: Vector3): Vector3;
33+
34+
/**
35+
* Get the bounds of the planes.
36+
* @returns {Bounds} The bounds of the planes.
37+
*/
38+
getBounds(): Bounds;
39+
40+
/**
41+
* Get the number of planes in the set of planes.
42+
*/
43+
getNumberOfPlanes(): number;
44+
45+
/**
46+
* Get the normals of the plane.
47+
* @returns {vtkDataArray} The normals of the plane.
48+
*/
49+
getNormals(): vtkDataArray;
50+
51+
/**
52+
* Get the points of the plane.
53+
* @returns {vtkPoints} The points of the plane.
54+
*/
55+
getPoints(): vtkPoints;
56+
57+
/**
58+
* Get the i-th plane
59+
* @param {Number} i The index of the plane to get.
60+
* @param {vtkPlane} [plane] The vtkPlane instance to fill (optional).
61+
* @returns {vtkPlane} The plane instance at the specified index.
62+
* If no plane is provided, a new vtkPlane instance will be created.
63+
*/
64+
getPlane(i: number, plane?: vtkPlane): vtkPlane;
65+
66+
/**
67+
* Set the bounds of the planes.
68+
* @param {Bounds} bounds The bounds to set.
69+
* @returns {Boolean} true if bounds were set, false if they were already set
70+
* @see getBounds
71+
*/
72+
setBounds(bounds: Bounds): boolean;
73+
74+
/**
75+
* Set the Frustum planes.
76+
* @param {Vector3[]} planes The coordinates of the frustum planes.
77+
*/
78+
setFrustumPlanes(planes: Vector3[]): boolean;
79+
80+
/**
81+
* Set the normals of the plane.
82+
* @param {vtkDataArray} normals The normals to set.
83+
*/
84+
setNormals(normals: vtkDataArray): boolean;
85+
86+
/**
87+
* Set the points of the plane.
88+
* @param points The points to set.
89+
*/
90+
setPoints(points: vtkPoints): boolean;
91+
}
92+
93+
/**
94+
* Method used to decorate a given object (publicAPI+model) with vtkPlane characteristics.
95+
*
96+
* @param publicAPI object on which methods will be bounds (public)
97+
* @param model object on which data structure will be bounds (protected)
98+
* @param {IPlanesInitialValues} [initialValues] (default: {})
99+
*/
100+
export function extend(
101+
publicAPI: object,
102+
model: object,
103+
initialValues?: IPlanesInitialValues
104+
): void;
105+
106+
/**
107+
* Method used to create a new instance of vtkPlane.
108+
* @param {IPlanesInitialValues} [initialValues] for pre-setting some of its content
109+
*/
110+
export function newInstance(initialValues?: IPlanesInitialValues): vtkPlanes;
111+
112+
/**
113+
* vtkPlanes computes the implicit function and function gradient for a set of
114+
* planes. The planes must define a convex space.
115+
*/
116+
export declare const vtkPlanes: {
117+
newInstance: typeof newInstance;
118+
extend: typeof extend;
119+
};
120+
export default vtkPlanes;

0 commit comments

Comments
 (0)