Skip to content

Commit 9d09020

Browse files
committed
docs(ts): update ts declaration for Line and PolyLine
1 parent d0130cf commit 9d09020

File tree

2 files changed

+70
-2
lines changed

2 files changed

+70
-2
lines changed

Sources/Common/DataModel/Line/index.d.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Vector3 } from '../../../types';
1+
import { Vector3, Vector2 } from '../../../types';
22
import vtkCell from '../Cell';
33

44
export enum IntersectionState {
@@ -9,7 +9,7 @@ export enum IntersectionState {
99

1010
interface ILineInitialValues { }
1111

12-
interface IIntersectWithLine {
12+
export interface IIntersectWithLine {
1313
intersect: number;
1414
t: number;
1515
subId: number;
@@ -50,6 +50,11 @@ export interface vtkLine extends vtkCell {
5050
* @param {Vector3} pcoords The parametric coordinates.
5151
*/
5252
intersectWithLine(p1: Vector3, p2: Vector3, tol: number, x: Vector3, pcoords: Vector3): IIntersectWithLine;
53+
54+
/**
55+
* Determine the global coordinates `x' and parametric coordinates `pcoords' in the cell.
56+
*/
57+
evaluateLocation(pcoords: Vector3, x: Vector3, weights: Vector2): void
5358
}
5459

5560
/**
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import { Vector2, Vector3 } from '../../../types';
2+
import vtkCell, { ICellInitialValues } from '../Cell';
3+
import { IIntersectWithLine } from '../Line';
4+
5+
export interface IPolyLineInitialValues extends ICellInitialValues { }
6+
7+
export interface vtkPolyLine extends vtkCell {
8+
9+
/**
10+
* Get the topological dimensional of the cell (0, 1, 2 or 3).
11+
*/
12+
getCellDimension(): number;
13+
14+
/**
15+
* @param {number} t1
16+
* @param {number} t2
17+
* @param {Vector3} p1 The first point coordinate.
18+
* @param {Vector3} p2 The second point coordinate.
19+
* @param {Number} tol The tolerance to use.
20+
* @param {Vector3} x The point which intersect the line.
21+
* @param {Vector3} pcoords The parametric coordinates.
22+
*/
23+
intersectWithLine(t1: number, t2: number, p1: Vector3, p2: Vector3, tol: number, x: Vector3, pcoords: Vector3): IIntersectWithLine;
24+
25+
/**
26+
* Determine global coordinate (x[3]) from subId and parametric coordinates.
27+
* Also returns interpolation weights. (The number of weights is equal to
28+
* the number of points in the cell.)
29+
*
30+
* @param {number} subId
31+
* @param {Vector3} pcoords The parametric coordinates
32+
* @param {Vector3} x The global coordinate
33+
* @param {Vector2} weights The interpolation weights
34+
*/
35+
evaluateLocation(subId: number, pcoords: Vector3, x: Vector3, weights: Vector2): void
36+
}
37+
38+
/**
39+
* Method used to decorate a given object (publicAPI+model) with vtkPolyLine characteristics.
40+
*
41+
* @param publicAPI object on which methods will be bounds (public)
42+
* @param model object on which data structure will be bounds (protected)
43+
* @param {IPolyLineInitialValues} [initialValues] (default: {})
44+
*/
45+
export function extend(publicAPI: object, model: object, initialValues?: IPolyLineInitialValues): void;
46+
47+
/**
48+
* Method used to create a new instance of vtkPolyLine.
49+
* @param {IPolyLineInitialValues} [initialValues] for pre-setting some of its content
50+
*/
51+
export function newInstance(initialValues?: IPolyLineInitialValues): vtkPolyLine;
52+
53+
/**
54+
* vtkPolyLine is a cell which representant a poly line.
55+
*
56+
* @see vtkCell
57+
*/
58+
export declare const vtkPolyLine: {
59+
newInstance: typeof newInstance,
60+
extend: typeof extend;
61+
};
62+
63+
export default vtkPolyLine;

0 commit comments

Comments
 (0)