@kitware/vtk.js 34.11.3 → 34.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/Core/CellArray.d.ts +5 -0
- package/Common/Core/CellArray.js +1 -0
- package/Common/Core/Math/index.js +1 -1
- package/Common/Core/Math.d.ts +2 -1
- package/Common/Core/Math.js +1 -1
- package/Common/Core/MatrixBuilder.d.ts +1 -0
- package/Common/DataModel/BoundingBox.js +1 -0
- package/Common/DataModel/DataSet.js +57 -32
- package/Common/DataModel/DataSetAttributes/FieldData.js +2 -2
- package/Common/DataModel/ImageData.js +1 -1
- package/Common/DataModel/IncrementalOctreeNode.js +1 -1
- package/Common/DataModel/IncrementalOctreePointLocator.js +1 -1
- package/Common/DataModel/Line.js +1 -1
- package/Common/DataModel/MergePoints.js +2 -2
- package/Common/DataModel/Planes.js +1 -1
- package/Common/DataModel/PointLocator.js +1 -1
- package/Common/DataModel/PolyData.d.ts +9 -3
- package/Common/DataModel/PolyData.js +10 -1
- package/Common/DataModel/Polygon.js +1 -1
- package/Common/DataModel/Quad.js +1 -1
- package/Common/DataModel/Triangle.js +1 -1
- package/Common/Transform/Transform.d.ts +1 -0
- package/Common/Transform/Transform.js +1 -1
- package/Filters/Core/CleanPolyData.d.ts +208 -0
- package/Filters/Core/CleanPolyData.js +399 -0
- package/Filters/Core/PolyDataNormals.js +1 -1
- package/Filters/Core/ThresholdPoints.js +2 -2
- package/Filters/Core.js +5 -1
- package/Filters/General/ClipClosedSurface.js +1 -1
- package/Filters/General/ContourTriangulator/helper.js +1 -1
- package/Filters/General/TubeFilter.js +1 -1
- package/Filters/General/WindowedSincPolyDataFilter.js +1 -1
- package/Filters/Sources/ArcSource.js +1 -1
- package/Filters/Sources/EllipseArcSource.js +1 -1
- package/Filters/Sources/FrustumSource.js +1 -1
- package/Filters/Sources/TorusSource.js +107 -0
- package/Filters/Sources.js +3 -1
- package/Filters/Texture/TextureMapToPlane.js +1 -1
- package/Filters/Texture/TextureMapToSphere.js +1 -1
- package/Imaging/Core/ImageReslice.d.ts +2 -1
- package/Imaging/Core/ImageReslice.js +1 -1
- package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
- package/Interaction/Style/InteractorStyleMPRSlice.js +1 -1
- package/Interaction/Style/InteractorStyleManipulator.js +1 -0
- package/Proxy/Representations/GlyphRepresentationProxy.js +1 -0
- package/Rendering/Core/CellPicker.js +1 -1
- package/Rendering/Core/Picker.js +1 -1
- package/Rendering/Core/Prop3D.js +10 -0
- package/Rendering/Core/Renderer.js +13 -11
- package/Rendering/OpenGL/ImageResliceMapper.js +1 -1
- package/Rendering/WebGPU/VolumePass.js +1 -1
- package/Widgets/Core/StateBuilder/originMixin.js +1 -1
- package/Widgets/Core/WidgetManager.js +1 -1
- package/Widgets/Manipulators/PlaneManipulator.js +2 -2
- package/Widgets/Manipulators.js +2 -2
- package/Widgets/Representations/RotateTransformHandleRepresentation.js +46 -0
- package/Widgets/Representations/ScaleTransformHandleRepresentation.js +57 -0
- package/Widgets/Representations/TranslateTransformHandleRepresentation/TransformHandleSource.js +85 -0
- package/Widgets/Representations/TranslateTransformHandleRepresentation.js +57 -0
- package/Widgets/Representations.js +6 -0
- package/Widgets/Widgets3D/AngleWidget.js +2 -2
- package/Widgets/Widgets3D/EllipseWidget.js +2 -2
- package/Widgets/Widgets3D/ImageCroppingWidget.js +3 -3
- package/Widgets/Widgets3D/ImplicitPlaneWidget.js +2 -2
- package/Widgets/Widgets3D/LabelWidget.js +2 -2
- package/Widgets/Widgets3D/LineWidget.js +3 -3
- package/Widgets/Widgets3D/PaintWidget.js +2 -2
- package/Widgets/Widgets3D/PolyLineWidget.js +2 -2
- package/Widgets/Widgets3D/RectangleWidget.js +2 -2
- package/Widgets/Widgets3D/ResliceCursorWidget.js +3 -3
- package/Widgets/Widgets3D/ShapeWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/SphereWidget.js +3 -3
- package/Widgets/Widgets3D/SplineWidget.js +2 -2
- package/Widgets/Widgets3D/TransformControlsWidget/behavior.js +180 -0
- package/Widgets/Widgets3D/TransformControlsWidget/constants.js +15 -0
- package/Widgets/Widgets3D/TransformControlsWidget/state.js +157 -0
- package/Widgets/Widgets3D/TransformControlsWidget.js +147 -0
- package/Widgets/Widgets3D.js +3 -1
- package/index.d.ts +1 -0
- package/package.json +4 -4
|
@@ -46,6 +46,11 @@ export interface vtkCellArray extends vtkDataArray {
|
|
|
46
46
|
* @returns {Number} Idx of where the cell was inserted
|
|
47
47
|
*/
|
|
48
48
|
insertNextCell(cellPointIds: number[]): number;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Get the maximum cell size.
|
|
52
|
+
*/
|
|
53
|
+
getMaxCellSize(): number;
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
/**
|
package/Common/Core/CellArray.js
CHANGED
|
@@ -113,6 +113,7 @@ function vtkCellArray(publicAPI, model) {
|
|
|
113
113
|
}
|
|
114
114
|
return cellId;
|
|
115
115
|
};
|
|
116
|
+
publicAPI.getMaxCellSize = () => publicAPI.getCellSizes().reduce((a, b) => Math.max(a, b), 0);
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
// ----------------------------------------------------------------------------
|
|
@@ -2267,4 +2267,4 @@ var vtkMath$1 = /*#__PURE__*/Object.freeze({
|
|
|
2267
2267
|
'default': vtkMath
|
|
2268
2268
|
});
|
|
2269
2269
|
|
|
2270
|
-
export { createArray as $, rowsToMat3 as A, degreesFromRadians as B, ldexp as C, xyz2rgb as D, areEquals as E, clampValue as F, arrayRange as G, getMajorAxisIndex as H, createUninitializedBounds as I, normalize4D as J, identity as K, multiplyMatrix as L, floor as M, isInf as N, rgb2hsv as O, rgb2lab as P, lab2rgb as Q, round as R, normalize2D as S, nearestPowerOfTwo as T, multiply3x3_vect3 as U, getSparseOrthogonalMatrix as V, areBoundsInitialized as W, floatRGB2HexCode as X, isPowerOfTwo as Y, angleBetweenVectors as Z, signedAngleBetweenVectors as _, areMatricesEqual as a, isNaN as a$, Pi as a0, ceil as a1, min as a2, max as a3, arrayMin as a4, arrayMax as a5, ceilLog2 as a6, factorial as a7, binomial as a8, beginCombination as a9, quaternionToMatrix3x3 as aA, roundNumber as aB, matrix3x3ToQuaternion as aC, multiplyQuaternion as aD, orthogonalize3x3 as aE, diagonalize3x3 as aF, singularValueDecomposition3x3 as aG, luFactorLinearSystem as aH, luSolveLinearSystem as aI, estimateMatrixCondition as aJ, solveHomogeneousLeastSquares as aK, solveLeastSquares as aL, hex2float as aM, lab2xyz as aN, xyz2lab as aO, rgb2xyz as aP, computeBoundsFromPoints as aQ, clampAndNormalizeValue as aR, getScalarTypeFittingRange as aS, getAdjustedScalarRange as aT, extentIsWithinOtherExtent as aU, boundsIsWithinOtherBounds as aV, pointIsWithinBounds as aW, solve3PointCircle as aX, inf as aY, negInf as aZ, isFinite as a_, nextCombination as aa, randomSeed as ab, getSeed as ac, gaussian as ad, multiplyScalar2D as ae, multiplyAccumulate2D as af, outer as ag, projectVector as ah, dot2D as ai, projectVector2D as aj, gaussianAmplitude as ak, gaussianWeight as al, outer2D as am, norm2D as an, rowsToMat4 as ao, columnsToMat4 as ap, columnsToMat3 as aq, LUFactor3x3 as ar, LUSolve3x3 as as, linearSolve3x3 as at, multiply3x3_mat3 as au, transpose3x3 as av, invert3x3 as aw, identity3x3 as ax, isIdentity as ay, isIdentity3x3 as az,
|
|
2270
|
+
export { createArray as $, rowsToMat3 as A, degreesFromRadians as B, ldexp as C, xyz2rgb as D, areEquals as E, clampValue as F, arrayRange as G, getMajorAxisIndex as H, createUninitializedBounds as I, normalize4D as J, identity as K, multiplyMatrix as L, floor as M, isInf as N, rgb2hsv as O, rgb2lab as P, lab2rgb as Q, round as R, normalize2D as S, nearestPowerOfTwo as T, multiply3x3_vect3 as U, getSparseOrthogonalMatrix as V, areBoundsInitialized as W, floatRGB2HexCode as X, isPowerOfTwo as Y, angleBetweenVectors as Z, signedAngleBetweenVectors as _, areMatricesEqual as a, isNaN as a$, Pi as a0, ceil as a1, min as a2, max as a3, arrayMin as a4, arrayMax as a5, ceilLog2 as a6, factorial as a7, binomial as a8, beginCombination as a9, quaternionToMatrix3x3 as aA, roundNumber as aB, matrix3x3ToQuaternion as aC, multiplyQuaternion as aD, orthogonalize3x3 as aE, diagonalize3x3 as aF, singularValueDecomposition3x3 as aG, luFactorLinearSystem as aH, luSolveLinearSystem as aI, estimateMatrixCondition as aJ, solveHomogeneousLeastSquares as aK, solveLeastSquares as aL, hex2float as aM, lab2xyz as aN, xyz2lab as aO, rgb2xyz as aP, computeBoundsFromPoints as aQ, clampAndNormalizeValue as aR, getScalarTypeFittingRange as aS, getAdjustedScalarRange as aT, extentIsWithinOtherExtent as aU, boundsIsWithinOtherBounds as aV, pointIsWithinBounds as aW, solve3PointCircle as aX, inf as aY, negInf as aZ, isFinite as a_, nextCombination as aa, randomSeed as ab, getSeed as ac, gaussian as ad, multiplyScalar2D as ae, multiplyAccumulate2D as af, outer as ag, projectVector as ah, dot2D as ai, projectVector2D as aj, gaussianAmplitude as ak, gaussianWeight as al, outer2D as am, norm2D as an, rowsToMat4 as ao, columnsToMat4 as ap, columnsToMat3 as aq, LUFactor3x3 as ar, LUSolve3x3 as as, linearSolve3x3 as at, multiply3x3_mat3 as au, transpose3x3 as av, invert3x3 as aw, identity3x3 as ax, isIdentity as ay, isIdentity3x3 as az, vtkMath as b, floatToHex2 as b0, float2CssRGBA as b1, roundVector as c, dot as d, clampVector as e, distance2BetweenPoints as f, solveLinearSystem as g, hsv2rgb as h, isNan as i, cross as j, add as k, normalize as l, multiplyAccumulate as m, norm as n, determinant2x2 as o, invertMatrix as p, jacobiN as q, radiansFromDegrees as r, subtract as s, perpendiculars as t, uninitializeBounds as u, vtkMath$1 as v, jacobi as w, multiplyScalar as x, random as y, determinant3x3 as z };
|
package/Common/Core/Math.d.ts
CHANGED
|
@@ -788,7 +788,7 @@ export function solveLinearSystem(A: Matrix, x: number[], size: number): number;
|
|
|
788
788
|
* @param {Number} [size] The square size of the matrix to invert : 4 for a 4x4
|
|
789
789
|
* @param {Number[]} [index]
|
|
790
790
|
* @param {Number[]} [column]
|
|
791
|
-
* @
|
|
791
|
+
* @returns AI on success, null otherwise
|
|
792
792
|
*/
|
|
793
793
|
export function invertMatrix(
|
|
794
794
|
A: Matrix,
|
|
@@ -1136,6 +1136,7 @@ export function isFinite(value: any): boolean;
|
|
|
1136
1136
|
* operations such as dot and cross products and vector norm; matrix determinant
|
|
1137
1137
|
* for 2x2 and 3x3 matrices; univariate polynomial solvers; and for random
|
|
1138
1138
|
* number generation (for backward compatibility only).
|
|
1139
|
+
* **Contrary to the rest of vtk.js, vtkMath is in row-major format (similar to VTK C++).**
|
|
1139
1140
|
*/
|
|
1140
1141
|
export declare const vtkMath: {
|
|
1141
1142
|
createArray: typeof createArray;
|
package/Common/Core/Math.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'seedrandom';
|
|
2
2
|
import '../../macros2.js';
|
|
3
3
|
import './Math/Constants.js';
|
|
4
|
-
export { ar as LUFactor3x3, as as LUSolve3x3, a0 as Pi, k as add, Z as angleBetweenVectors, W as areBoundsInitialized, E as areEquals, a as areMatricesEqual, a5 as arrayMax, a4 as arrayMin, G as arrayRange, a9 as beginCombination, a8 as binomial, aV as boundsIsWithinOtherBounds, a1 as ceil, a6 as ceilLog2, aR as clampAndNormalizeValue, F as clampValue,
|
|
4
|
+
export { ar as LUFactor3x3, as as LUSolve3x3, a0 as Pi, k as add, Z as angleBetweenVectors, W as areBoundsInitialized, E as areEquals, a as areMatricesEqual, a5 as arrayMax, a4 as arrayMin, G as arrayRange, a9 as beginCombination, a8 as binomial, aV as boundsIsWithinOtherBounds, a1 as ceil, a6 as ceilLog2, aR as clampAndNormalizeValue, F as clampValue, e as clampVector, aq as columnsToMat3, ap as columnsToMat4, aQ as computeBoundsFromPoints, $ as createArray, I as createUninitializedBounds, j as cross, b as default, B as degreesFromRadians, o as determinant2x2, z as determinant3x3, aF as diagonalize3x3, f as distance2BetweenPoints, d as dot, ai as dot2D, aJ as estimateMatrixCondition, aU as extentIsWithinOtherExtent, a7 as factorial, b1 as float2CssRGBA, X as floatRGB2HexCode, b0 as floatToHex2, M as floor, ad as gaussian, ak as gaussianAmplitude, al as gaussianWeight, aT as getAdjustedScalarRange, H as getMajorAxisIndex, aS as getScalarTypeFittingRange, ac as getSeed, V as getSparseOrthogonalMatrix, aM as hex2float, h as hsv2rgb, K as identity, ax as identity3x3, aY as inf, aw as invert3x3, p as invertMatrix, a_ as isFinite, ay as isIdentity, az as isIdentity3x3, N as isInf, a$ as isNaN, i as isNan, Y as isPowerOfTwo, w as jacobi, q as jacobiN, Q as lab2rgb, aN as lab2xyz, C as ldexp, at as linearSolve3x3, aH as luFactorLinearSystem, aI as luSolveLinearSystem, aC as matrix3x3ToQuaternion, a3 as max, a2 as min, au as multiply3x3_mat3, U as multiply3x3_vect3, m as multiplyAccumulate, af as multiplyAccumulate2D, L as multiplyMatrix, aD as multiplyQuaternion, x as multiplyScalar, ae as multiplyScalar2D, T as nearestPowerOfTwo, aZ as negInf, aa as nextCombination, n as norm, an as norm2D, l as normalize, S as normalize2D, J as normalize4D, aE as orthogonalize3x3, ag as outer, am as outer2D, t as perpendiculars, aW as pointIsWithinBounds, ah as projectVector, aj as projectVector2D, aA as quaternionToMatrix3x3, r as radiansFromDegrees, y as random, ab as randomSeed, O as rgb2hsv, P as rgb2lab, aP as rgb2xyz, R as round, aB as roundNumber, c as roundVector, A as rowsToMat3, ao as rowsToMat4, _ as signedAngleBetweenVectors, aG as singularValueDecomposition3x3, aX as solve3PointCircle, aK as solveHomogeneousLeastSquares, aL as solveLeastSquares, g as solveLinearSystem, s as subtract, av as transpose3x3, u as uninitializeBounds, aO as xyz2lab, D as xyz2rgb } from './Math/index.js';
|
|
@@ -131,6 +131,7 @@ declare function buildFromRadian(): Transform;
|
|
|
131
131
|
* The `vtkMatrixBuilder` class provides a system to create a mat4
|
|
132
132
|
* transformation matrix. All functions return the MatrixBuilder Object
|
|
133
133
|
* instance, allowing transformations to be chained.
|
|
134
|
+
* **Note**: Contrary to vtkMath, vtkMatrixBuilder uses column-major format.
|
|
134
135
|
*
|
|
135
136
|
* @example
|
|
136
137
|
* ```js
|
|
@@ -1,39 +1,10 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtk from '../../vtk.js';
|
|
3
|
+
import vtkBoundingBox from './BoundingBox.js';
|
|
3
4
|
import vtkDataSetAttributes from './DataSetAttributes.js';
|
|
5
|
+
import { b as vtkMath } from '../Core/Math/index.js';
|
|
4
6
|
import Constants from './DataSet/Constants.js';
|
|
5
7
|
|
|
6
|
-
// import vtkBoundingBox from '../BoundingBox';
|
|
7
|
-
// import * as vtkMath from '../../Core/Math';
|
|
8
|
-
//
|
|
9
|
-
// function getBounds(dataset) {
|
|
10
|
-
// if (dataset.bounds) {
|
|
11
|
-
// return dataset.bounds;
|
|
12
|
-
// }
|
|
13
|
-
// if (dataset.type && dataset[dataset.type]) {
|
|
14
|
-
// const ds = dataset[dataset.type];
|
|
15
|
-
// if (ds.bounds) {
|
|
16
|
-
// return ds.bounds;
|
|
17
|
-
// }
|
|
18
|
-
// if (ds.Points && ds.Points.bounds) {
|
|
19
|
-
// return ds.Points.bounds;
|
|
20
|
-
// }
|
|
21
|
-
|
|
22
|
-
// if (ds.Points && ds.Points.values) {
|
|
23
|
-
// const array = ds.Points.values;
|
|
24
|
-
// const bbox = [...vtkBoundingBox.INIT_BOUNDS];
|
|
25
|
-
// const size = array.length;
|
|
26
|
-
// const delta = ds.Points.numberOfComponents ? ds.Points.numberOfComponents : 3;
|
|
27
|
-
// for (let idx = 0; idx < size; idx += delta) {
|
|
28
|
-
// vtkBoundingBox.addPoint(bbox, array[idx * delta], array[(idx * delta) + 1], array[(idx * delta) + 2]);
|
|
29
|
-
// }
|
|
30
|
-
// ds.Points.bounds = bbox;
|
|
31
|
-
// return ds.Points.bounds;
|
|
32
|
-
// }
|
|
33
|
-
// }
|
|
34
|
-
// return vtkMath.createUninitializedBounds();
|
|
35
|
-
// }
|
|
36
|
-
|
|
37
8
|
// ----------------------------------------------------------------------------
|
|
38
9
|
// Global methods
|
|
39
10
|
// ----------------------------------------------------------------------------
|
|
@@ -56,6 +27,60 @@ function vtkDataSet(publicAPI, model) {
|
|
|
56
27
|
model[fieldName] = vtk(model[fieldName]);
|
|
57
28
|
}
|
|
58
29
|
});
|
|
30
|
+
|
|
31
|
+
//------------------------------------------------------------------------------
|
|
32
|
+
// Compute the data bounding box from data points.
|
|
33
|
+
publicAPI.computeBounds = () => {
|
|
34
|
+
if (model.modifiedTime && model.computeTime && model.modifiedTime > model.computeTime || !model.computeTime) {
|
|
35
|
+
const points = publicAPI.getPoints();
|
|
36
|
+
if (points?.getNumberOfPoints()) {
|
|
37
|
+
// Compute bounds from points
|
|
38
|
+
vtkBoundingBox.setBounds(model.bounds, points.getBoundsByReference());
|
|
39
|
+
} else {
|
|
40
|
+
model.bounds = vtkMath.createUninitializedBounds();
|
|
41
|
+
}
|
|
42
|
+
// Update computeTime
|
|
43
|
+
model.computeTime = macro.getCurrentGlobalMTime();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Returns the squared length of the diagonal of the bounding box
|
|
49
|
+
*/
|
|
50
|
+
publicAPI.getLength2 = () => {
|
|
51
|
+
const bounds = publicAPI.getBoundsByReference();
|
|
52
|
+
if (!bounds || bounds.length !== 6) return 0;
|
|
53
|
+
return vtkBoundingBox.getDiagonalLength2(bounds);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Returns the length of the diagonal of the bounding box
|
|
58
|
+
*/
|
|
59
|
+
publicAPI.getLength = () => Math.sqrt(publicAPI.getLength2());
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Returns the center of the bounding box as [x, y, z]
|
|
63
|
+
*/
|
|
64
|
+
publicAPI.getCenter = () => {
|
|
65
|
+
const bounds = publicAPI.getBoundsByReference();
|
|
66
|
+
if (!bounds || bounds.length !== 6) return [0, 0, 0];
|
|
67
|
+
return vtkBoundingBox.getCenter(bounds);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Get the bounding box of a cell with the given cellId
|
|
72
|
+
* @param {Number} cellId - The id of the cell
|
|
73
|
+
* @returns {Number[]} - The bounds as [xmin, xmax, ymin, ymax, zmin, zmax]
|
|
74
|
+
*/
|
|
75
|
+
publicAPI.getCellBounds = cellId => {
|
|
76
|
+
const cell = publicAPI.getCell(cellId);
|
|
77
|
+
if (cell) {
|
|
78
|
+
return cell.getBounds();
|
|
79
|
+
}
|
|
80
|
+
return vtkMath.createUninitializedBounds();
|
|
81
|
+
};
|
|
82
|
+
publicAPI.getBounds = macro.chain(() => publicAPI.computeBounds, publicAPI.getBounds);
|
|
83
|
+
publicAPI.getBoundsByReference = macro.chain(() => publicAPI.computeBounds, publicAPI.getBoundsByReference);
|
|
59
84
|
const superShallowCopy = publicAPI.shallowCopy;
|
|
60
85
|
publicAPI.shallowCopy = function (other) {
|
|
61
86
|
let debug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -92,7 +117,7 @@ function extend(publicAPI, model) {
|
|
|
92
117
|
// Object methods
|
|
93
118
|
macro.obj(publicAPI, model);
|
|
94
119
|
macro.setGet(publicAPI, model, DATASET_FIELDS);
|
|
95
|
-
|
|
120
|
+
macro.getArray(publicAPI, model, ['bounds'], 6);
|
|
96
121
|
// Object specific methods
|
|
97
122
|
vtkDataSet(publicAPI, model);
|
|
98
123
|
}
|
|
@@ -34,8 +34,8 @@ function vtkFieldData(publicAPI, model) {
|
|
|
34
34
|
publicAPI.copyStructure = other => {
|
|
35
35
|
publicAPI.initializeFields();
|
|
36
36
|
model.copyFieldFlags = other.getCopyFieldFlags().map(x => x); // Deep-copy
|
|
37
|
-
model.arrays = other.
|
|
38
|
-
|
|
37
|
+
model.arrays = other.getArrays().map(x => ({
|
|
38
|
+
data: x
|
|
39
39
|
})); // Deep-copy
|
|
40
40
|
// TODO: Copy array information objects (once we support information objects)
|
|
41
41
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
|
-
import {
|
|
2
|
+
import { c as roundVector, e as clampVector } from '../Core/Math/index.js';
|
|
3
3
|
import vtkBoundingBox from './BoundingBox.js';
|
|
4
4
|
import vtkDataSet from './DataSet.js';
|
|
5
5
|
import vtkStructuredData from './StructuredData.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
|
-
import {
|
|
2
|
+
import { b as vtkMath } from '../Core/Math/index.js';
|
|
3
3
|
import vtkBoundingBox from './BoundingBox.js';
|
|
4
4
|
import vtkIncrementalOctreeNode from './IncrementalOctreeNode.js';
|
|
5
5
|
import vtkAbstractPointLocator from './AbstractPointLocator.js';
|
package/Common/DataModel/Line.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import Constants from './Line/Constants.js';
|
|
3
3
|
import vtkCell from './Cell.js';
|
|
4
|
-
import { d as dot,
|
|
4
|
+
import { d as dot, f as distance2BetweenPoints, s as subtract, g as solveLinearSystem } from '../Core/Math/index.js';
|
|
5
5
|
import { quat } from 'gl-matrix';
|
|
6
6
|
|
|
7
7
|
const {
|
|
@@ -122,9 +122,9 @@ const newInstance = macro.newInstance(extend, 'vtkMergePoints');
|
|
|
122
122
|
|
|
123
123
|
// ----------------------------------------------------------------------------
|
|
124
124
|
|
|
125
|
-
var
|
|
125
|
+
var vtkMergePoints$1 = {
|
|
126
126
|
newInstance,
|
|
127
127
|
extend
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
-
export {
|
|
130
|
+
export { vtkMergePoints$1 as default, extend, newInstance };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as macro, T as TYPED_ARRAYS } from '../../macros2.js';
|
|
2
2
|
import vtkDataArray from '../Core/DataArray.js';
|
|
3
3
|
import vtkImplicitFunction from './ImplicitFunction.js';
|
|
4
|
-
import {
|
|
4
|
+
import { b as vtkMath } from '../Core/Math/index.js';
|
|
5
5
|
import vtkPlane from './Plane.js';
|
|
6
6
|
import vtkPoints from '../Core/Points.js';
|
|
7
7
|
import { VtkDataTypes } from '../Core/DataArray/Constants.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtkCellArray from '../Core/CellArray.js';
|
|
3
|
-
import {
|
|
3
|
+
import { b as vtkMath } from '../Core/Math/index.js';
|
|
4
4
|
import vtkPoints from '../Core/Points.js';
|
|
5
5
|
import vtkAbstractPointLocator from './AbstractPointLocator.js';
|
|
6
6
|
import vtkBoundingBox from './BoundingBox.js';
|
|
@@ -66,9 +66,15 @@ export interface vtkPolyData extends vtkPointSet {
|
|
|
66
66
|
getLines(): vtkCellArray;
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
69
|
+
* Get the links between points and cells.
|
|
70
70
|
*/
|
|
71
|
-
getLinks(): any;
|
|
71
|
+
getLinks(): any; // vtkCellLinks
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Get the maximum cell size.
|
|
75
|
+
* Returns 0 if there is no cell.
|
|
76
|
+
*/
|
|
77
|
+
getMaxCellSize(): number;
|
|
72
78
|
|
|
73
79
|
/**
|
|
74
80
|
* Determine the number of cells composing the polydata.
|
|
@@ -104,7 +110,7 @@ export interface vtkPolyData extends vtkPointSet {
|
|
|
104
110
|
* Topological inquiry to get cells using point.
|
|
105
111
|
* @param ptId
|
|
106
112
|
*/
|
|
107
|
-
getPointCells(ptId:
|
|
113
|
+
getPointCells(ptId: number): void;
|
|
108
114
|
|
|
109
115
|
/**
|
|
110
116
|
* Get the cell array defining polys.
|
|
@@ -5,7 +5,11 @@ import vtkCellLinks from './CellLinks.js';
|
|
|
5
5
|
import vtkCellTypes from './CellTypes.js';
|
|
6
6
|
import vtkLine from './Line.js';
|
|
7
7
|
import vtkPointSet from './PointSet.js';
|
|
8
|
+
import vtkPolyLine from './PolyLine.js';
|
|
9
|
+
import vtkPolygon from './Polygon.js';
|
|
10
|
+
import vtkQuad from './Quad.js';
|
|
8
11
|
import vtkTriangle from './Triangle.js';
|
|
12
|
+
import vtkTriangleStrip from './TriangleStrip.js';
|
|
9
13
|
import { CellType } from './CellTypes/Constants.js';
|
|
10
14
|
import { POLYDATA_FIELDS } from './PolyData/Constants.js';
|
|
11
15
|
|
|
@@ -14,8 +18,12 @@ const {
|
|
|
14
18
|
} = macro;
|
|
15
19
|
const CELL_FACTORY = {
|
|
16
20
|
[CellType.VTK_LINE]: vtkLine,
|
|
21
|
+
[CellType.VTK_QUAD]: vtkQuad,
|
|
17
22
|
[CellType.VTK_POLY_LINE]: vtkLine,
|
|
18
|
-
[CellType.VTK_TRIANGLE]: vtkTriangle
|
|
23
|
+
[CellType.VTK_TRIANGLE]: vtkTriangle,
|
|
24
|
+
[CellType.VTK_TRIANGLE_STRIP]: vtkTriangleStrip,
|
|
25
|
+
[CellType.VTK_POLY_LINE]: vtkPolyLine,
|
|
26
|
+
[CellType.VTK_POLYGON]: vtkPolygon
|
|
19
27
|
};
|
|
20
28
|
|
|
21
29
|
// ----------------------------------------------------------------------------
|
|
@@ -206,6 +214,7 @@ function vtkPolyData(publicAPI, model) {
|
|
|
206
214
|
cell.initialize(publicAPI.getPoints(), cellInfo.cellPointIds);
|
|
207
215
|
return cell;
|
|
208
216
|
};
|
|
217
|
+
publicAPI.getMaxCellSize = () => POLYDATA_FIELDS.reduce((max, type) => Math.max(max, model[type]?.getMaxCellSize?.() ?? 0), 0);
|
|
209
218
|
}
|
|
210
219
|
|
|
211
220
|
// ----------------------------------------------------------------------------
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
|
-
import { d as dot, s as subtract, j as cross, k as add, l as normalize,
|
|
2
|
+
import { d as dot, s as subtract, j as cross, k as add, l as normalize, f as distance2BetweenPoints, n as norm } from '../Core/Math/index.js';
|
|
3
3
|
import vtkLine from './Line.js';
|
|
4
4
|
import vtkPlane from './Plane.js';
|
|
5
5
|
import vtkPriorityQueue from '../Core/PriorityQueue.js';
|
package/Common/DataModel/Quad.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtkCell from './Cell.js';
|
|
3
|
-
import {
|
|
3
|
+
import { f as distance2BetweenPoints } from '../Core/Math/index.js';
|
|
4
4
|
import { CellType } from './CellTypes/Constants.js';
|
|
5
5
|
import vtkTriangle from './Triangle.js';
|
|
6
6
|
import vtkPoints from '../Core/Points.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as macro, T as TYPED_ARRAYS } from '../../macros2.js';
|
|
2
2
|
import vtkCell from './Cell.js';
|
|
3
|
-
import { d as dot, j as cross, l as normalize, m as multiplyAccumulate,
|
|
3
|
+
import { d as dot, j as cross, l as normalize, m as multiplyAccumulate, f as distance2BetweenPoints, o as determinant2x2, s as subtract, p as invertMatrix } from '../Core/Math/index.js';
|
|
4
4
|
import vtkLine from './Line.js';
|
|
5
5
|
import vtkPlane from './Plane.js';
|
|
6
6
|
|
|
@@ -286,6 +286,7 @@ export function newInstance(
|
|
|
286
286
|
* Most of the methods for manipulating this transformation (e.g. transformMatrices, transformMatrix) (TODO: Translate, Rotate, Concatenate...) can operate in either PreMultiply (the default) or PostMultiply mode. In PreMultiply mode, the translation, concatenation, etc. will occur before any transformations which are represented by the current matrix. In PostMultiply mode, the additional transformation will occur after any transformations represented by the current matrix.
|
|
287
287
|
*
|
|
288
288
|
* This class performs all of its operations in a right handed coordinate system with right handed rotations. Some other graphics libraries use left handed coordinate systems and rotations.
|
|
289
|
+
* **Note**: vtkTransform uses column-major format.
|
|
289
290
|
*
|
|
290
291
|
* @example
|
|
291
292
|
* ```js
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
|
-
import {
|
|
2
|
+
import { b as vtkMath } from '../Core/Math/index.js';
|
|
3
3
|
import { IDENTITY } from '../Core/Math/Constants.js';
|
|
4
4
|
import { vec3, mat4, quat, mat3 } from 'gl-matrix';
|
|
5
5
|
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { DesiredOutputPrecision } from './../../Common/DataModel/DataSetAttributes';
|
|
2
|
+
import { vtkAlgorithm, vtkObject } from './../../interfaces';
|
|
3
|
+
import { Bounds, Vector3 } from './../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Initial values for vtkCleanPolyData.
|
|
7
|
+
*/
|
|
8
|
+
export interface ICleanPolyDataInitialValues {
|
|
9
|
+
/**
|
|
10
|
+
* The tolerance used for point merging.
|
|
11
|
+
*/
|
|
12
|
+
tolerance?: number;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Whether the tolerance is absolute or relative.
|
|
16
|
+
*/
|
|
17
|
+
toleranceIsAbsolute?: boolean;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The absolute tolerance value.
|
|
21
|
+
*/
|
|
22
|
+
absoluteTolerance?: number;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The desired output precision for points.
|
|
26
|
+
*/
|
|
27
|
+
outputPointsPrecision?: DesiredOutputPrecision;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Whether to merge points.
|
|
31
|
+
*/
|
|
32
|
+
pointMerging?: boolean;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Whether to convert lines to points.
|
|
36
|
+
*/
|
|
37
|
+
convertLinesToPoints?: boolean;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Whether to convert polygons to lines.
|
|
41
|
+
*/
|
|
42
|
+
convertPolysToLines?: boolean;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Whether to convert strips to polygons.
|
|
46
|
+
*/
|
|
47
|
+
convertStripsToPolys?: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
type vtkCleanPolyDataBase = vtkObject & vtkAlgorithm;
|
|
51
|
+
|
|
52
|
+
export interface vtkCleanPolyData extends vtkCleanPolyDataBase {
|
|
53
|
+
/**
|
|
54
|
+
* Create default locator.
|
|
55
|
+
*/
|
|
56
|
+
createDefaultLocator(): void;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Get the absolute tolerance value.
|
|
60
|
+
*/
|
|
61
|
+
getAbsoluteTolerance(): number;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Get whether to convert lines to points.
|
|
65
|
+
*/
|
|
66
|
+
getConvertLinesToPoints(): boolean;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Get whether to convert polygons to lines.
|
|
70
|
+
*/
|
|
71
|
+
getConvertPolysToLines(): boolean;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Get whether to convert strips to polygons.
|
|
75
|
+
*/
|
|
76
|
+
getConvertStripsToPolys(): boolean;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Get the output points precision.
|
|
80
|
+
*/
|
|
81
|
+
getOutputPointsPrecision(): DesiredOutputPrecision;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Get whether to merge points.
|
|
85
|
+
*/
|
|
86
|
+
getPointMerging(): boolean;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Get the tolerance used for point merging.
|
|
90
|
+
*/
|
|
91
|
+
getTolerance(): number;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Get whether the tolerance is absolute or relative.
|
|
95
|
+
*/
|
|
96
|
+
getToleranceIsAbsolute(): boolean;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Operate on a bounding box by applying a transformation.
|
|
100
|
+
*
|
|
101
|
+
* @param {Bounds} inBounds The input bounding box.
|
|
102
|
+
* @param {Bounds} outBounds The output bounding box.
|
|
103
|
+
*/
|
|
104
|
+
operateOnBounds(inBounds: Bounds, outBounds: Bounds): void;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Operate on a point by applying a transformation.
|
|
108
|
+
*
|
|
109
|
+
* @param {Vector3} point The point to operate on.
|
|
110
|
+
*/
|
|
111
|
+
operateOnPoint(point: Vector3): void;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
* @param inData
|
|
116
|
+
* @param outData
|
|
117
|
+
*/
|
|
118
|
+
requestData(inData: any, outData: any): void;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Set the absolute tolerance value.
|
|
122
|
+
* This is only used if ToleranceIsAbsolute is true.
|
|
123
|
+
* Initial value is 0.0
|
|
124
|
+
* @param {Number} absoluteTolerance The absolute tolerance value.
|
|
125
|
+
*/
|
|
126
|
+
setAbsoluteTolerance(absoluteTolerance: number): boolean;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Set whether to convert lines to points.
|
|
130
|
+
* @param {Boolean} convertLinesToPoints
|
|
131
|
+
*/
|
|
132
|
+
setConvertLinesToPoints(convertLinesToPoints: boolean): boolean;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Set whether to convert polygons to lines.
|
|
136
|
+
* @param {Boolean} convertPolysToLines
|
|
137
|
+
*/
|
|
138
|
+
setConvertPolysToLines(convertPolysToLines: boolean): boolean;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Set whether to convert strips to polygons.
|
|
142
|
+
* @param {Boolean} convertStripsToPolys
|
|
143
|
+
*/
|
|
144
|
+
setConvertStripsToPolys(convertStripsToPolys: boolean): boolean;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Set the desired output precision for points.
|
|
148
|
+
* Initial value is DEFAULT_PRECISION.
|
|
149
|
+
* @param {DesiredOutputPrecision} outputPointsPrecision The outputPointsPrecision value.
|
|
150
|
+
*/
|
|
151
|
+
setOutputPointsPrecision(
|
|
152
|
+
outputPointsPrecision: DesiredOutputPrecision
|
|
153
|
+
): boolean;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Set whether to merge points.
|
|
157
|
+
* Initial value is false.
|
|
158
|
+
* @param {Boolean} pointMerging The pointMerging value.
|
|
159
|
+
*/
|
|
160
|
+
setPointMerging(pointMerging: boolean): boolean;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Set the tolerance used for point merging.
|
|
164
|
+
* This is ignored if ToleranceIsAbsolute is true.
|
|
165
|
+
* Initial value is 0.0
|
|
166
|
+
* @param {Number} tolerance The tolerance value.
|
|
167
|
+
*/
|
|
168
|
+
setTolerance(tolerance: number): boolean;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Set whether the tolerance is absolute or relative.
|
|
172
|
+
* Initial value is false (relative).
|
|
173
|
+
* @param {Boolean} toleranceIsAbsolute The toleranceIsAbsolute value.
|
|
174
|
+
*/
|
|
175
|
+
setToleranceIsAbsolute(toleranceIsAbsolute: boolean): boolean;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Method used to decorate a given object (publicAPI+model) with vtkCleanPolyData characteristics.
|
|
180
|
+
*
|
|
181
|
+
* @param publicAPI object on which methods will be bounds (public)
|
|
182
|
+
* @param model object on which data structure will be bounds (protected)
|
|
183
|
+
* @param {ICleanPolyDataInitialValues} [initialValues] (default: {})
|
|
184
|
+
*/
|
|
185
|
+
export function extend(
|
|
186
|
+
publicAPI: object,
|
|
187
|
+
model: object,
|
|
188
|
+
initialValues?: ICleanPolyDataInitialValues
|
|
189
|
+
): void;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Method used to create a new instance of vtkCleanPolyData.
|
|
193
|
+
* @param {ICleanPolyDataInitialValues} [initialValues] for pre-setting some of its content
|
|
194
|
+
*/
|
|
195
|
+
export function newInstance(
|
|
196
|
+
initialValues?: ICleanPolyDataInitialValues
|
|
197
|
+
): vtkCleanPolyData;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* vtkCleanPolyData merge exactly coincident points.
|
|
201
|
+
*
|
|
202
|
+
* vtkCleanPolyData is a locator object to quickly locate points in 3D.
|
|
203
|
+
*/
|
|
204
|
+
export declare const vtkCleanPolyData: {
|
|
205
|
+
newInstance: typeof newInstance;
|
|
206
|
+
extend: typeof extend;
|
|
207
|
+
};
|
|
208
|
+
export default vtkCleanPolyData;
|