@kitware/vtk.js 22.1.2 → 22.1.6

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.
Files changed (67) hide show
  1. package/Common/Core/Math/index.js +1 -1
  2. package/Common/Core/Math.js +1 -1
  3. package/Common/DataModel/ImageData.js +1 -1
  4. package/Common/DataModel/Line.js +1 -1
  5. package/Common/DataModel/Plane.js +1 -1
  6. package/Common/DataModel/Polygon.js +1 -1
  7. package/Common/DataModel/Triangle.js +1 -1
  8. package/Common/Transform/LandmarkTransform.js +1 -1
  9. package/Filters/General/ImageMarchingCubes.js +1 -1
  10. package/Filters/General/MoleculeToRepresentation.js +1 -1
  11. package/Filters/General/TubeFilter.js +1 -1
  12. package/Filters/General/WindowedSincPolyDataFilter.js +1 -1
  13. package/Filters/Sources/Arrow2DSource.js +1 -1
  14. package/Filters/Sources/ArrowSource.js +1 -1
  15. package/Filters/Sources/CircleSource.js +2 -2
  16. package/Filters/Sources/ConcentricCylinderSource.js +1 -1
  17. package/Filters/Sources/ConeSource.js +1 -1
  18. package/Filters/Sources/CubeSource.js +2 -2
  19. package/Filters/Sources/CylinderSource.js +1 -1
  20. package/Filters/Sources/LineSource.js +4 -4
  21. package/Filters/Sources/PlaneSource.js +5 -5
  22. package/Filters/Sources/PointSource.js +3 -3
  23. package/Filters/Sources/SLICSource.js +3 -3
  24. package/Filters/Sources/SphereSource.js +2 -2
  25. package/Filters/Sources/ViewFinderSource.js +1 -1
  26. package/Filters/Texture/TextureMapToPlane.js +1 -1
  27. package/Filters/Texture/TextureMapToSphere.js +1 -1
  28. package/Interaction/Manipulators/KeyboardCameraManipulator.js +1 -1
  29. package/Interaction/Manipulators/MouseBoxSelectorManipulator.js +9 -2
  30. package/Interaction/Manipulators/MouseCameraAxisRotateManipulator.js +1 -1
  31. package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.js +1 -1
  32. package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -1
  33. package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -1
  34. package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
  35. package/Interaction/Style/InteractorStyleMPRSlice.js +1 -1
  36. package/Interaction/Widgets/DistanceRepresentation.js +1 -1
  37. package/Interaction/Widgets/ImageCroppingRegionsRepresentation.js +1 -1
  38. package/Interaction/Widgets/ImageCroppingRegionsWidget.js +1 -1
  39. package/Interaction/Widgets/LabelRepresentation.js +1 -1
  40. package/Interaction/Widgets/ResliceCursor/ResliceCursor.js +1 -1
  41. package/Interaction/Widgets/ResliceCursor/ResliceCursorLineRepresentation.js +1 -1
  42. package/Interaction/Widgets/ResliceCursor/ResliceCursorRepresentation.js +1 -1
  43. package/Interaction/Widgets/SphereHandleRepresentation.js +1 -1
  44. package/Proxy/Core/View2DProxy.js +1 -1
  45. package/Rendering/Core/Camera.js +1 -1
  46. package/Rendering/Core/CellPicker.js +1 -1
  47. package/Rendering/Core/Light.js +1 -1
  48. package/Rendering/Core/Picker.js +1 -1
  49. package/Rendering/OpenGL/PolyDataMapper.js +1 -1
  50. package/Rendering/WebGPU/BufferManager.js +1 -1
  51. package/Rendering/WebGPU/VolumePass.js +66 -76
  52. package/Widgets/Core/StateBuilder/orientationMixin.js +1 -1
  53. package/Widgets/Manipulators/LineManipulator.js +1 -1
  54. package/Widgets/Manipulators/TrackballManipulator.js +1 -1
  55. package/Widgets/Representations/PolyLineRepresentation.js +1 -1
  56. package/Widgets/Representations/ResliceCursorContextRepresentation.js +1 -1
  57. package/Widgets/Representations/WidgetRepresentation.js +1 -1
  58. package/Widgets/Widgets3D/AngleWidget.js +1 -1
  59. package/Widgets/Widgets3D/DistanceWidget.js +1 -1
  60. package/Widgets/Widgets3D/LineWidget/behavior.js +1 -1
  61. package/Widgets/Widgets3D/LineWidget/helpers.js +1 -1
  62. package/Widgets/Widgets3D/LineWidget.js +1 -1
  63. package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
  64. package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +15 -5
  65. package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -1
  66. package/Widgets/Widgets3D/ShapeWidget/behavior.js +1 -1
  67. package/package.json +1 -1
@@ -2329,4 +2329,4 @@ var vtkMath$1 = /*#__PURE__*/Object.freeze({
2329
2329
  'default': vtkMath
2330
2330
  });
2331
2331
 
2332
- export { binomial as $, clampValue as A, projectVector as B, arrayRange as C, getMajorAxisIndex as D, isInf as E, rgb2hsv as F, rgb2lab as G, lab2rgb as H, floor as I, round as J, nearestPowerOfTwo as K, normalize2D as L, createUninitializedBounds as M, multiply3x3_vect3 as N, areBoundsInitialized as O, isPowerOfTwo as P, multiplyAccumulate as Q, angleBetweenVectors as R, signedAngleBetweenVectors as S, Pi as T, ceil as U, min as V, max as W, arrayMin as X, arrayMax as Y, ceilLog2 as Z, factorial as _, areMatricesEqual as a, beginCombination as a0, nextCombination as a1, randomSeed as a2, getSeed as a3, gaussian as a4, multiplyScalar2D as a5, multiplyAccumulate2D as a6, outer as a7, dot2D as a8, projectVector2D as a9, hex2float as aA, lab2xyz as aB, xyz2lab as aC, xyz2rgb as aD, rgb2xyz as aE, clampAndNormalizeValue as aF, getScalarTypeFittingRange as aG, getAdjustedScalarRange as aH, extentIsWithinOtherExtent as aI, boundsIsWithinOtherBounds as aJ, pointIsWithinBounds as aK, solve3PointCircle as aL, inf as aM, negInf as aN, isFinite as aO, isNaN as aP, floatToHex2 as aQ, floatRGB2HexCode as aR, float2CssRGBA as aS, gaussianAmplitude as aa, gaussianWeight as ab, outer2D as ac, norm2D as ad, LUFactor3x3 as ae, LUSolve3x3 as af, linearSolve3x3 as ag, multiply3x3_mat3 as ah, multiplyMatrix as ai, transpose3x3 as aj, invert3x3 as ak, identity3x3 as al, quaternionToMatrix3x3 as am, roundNumber as an, matrix3x3ToQuaternion as ao, multiplyQuaternion as ap, orthogonalize3x3 as aq, diagonalize3x3 as ar, singularValueDecomposition3x3 as as, luFactorLinearSystem as at, luSolveLinearSystem as au, invertMatrix as av, estimateMatrixCondition as aw, jacobi as ax, solveHomogeneousLeastSquares as ay, solveLeastSquares as az, distance2BetweenPoints as b, subtract as c, dot as d, cross as e, add as f, normalize as g, hsv2rgb as h, isNan as i, determinant2x2 as j, jacobiN as k, vtkMath as l, multiplyScalar as m, norm as n, random as o, perpendiculars as p, determinant3x3 as q, radiansFromDegrees as r, solveLinearSystem as s, computeBoundsFromPoints as t, uninitializeBounds as u, vtkMath$1 as v, roundVector as w, clampVector as x, degreesFromRadians as y, areEquals as z };
2332
+ export { binomial as $, clampValue as A, projectVector as B, arrayRange as C, getMajorAxisIndex as D, isInf as E, rgb2hsv as F, rgb2lab as G, lab2rgb as H, floor as I, round as J, nearestPowerOfTwo as K, normalize2D as L, createUninitializedBounds as M, multiply3x3_vect3 as N, areBoundsInitialized as O, isPowerOfTwo as P, multiplyAccumulate as Q, angleBetweenVectors as R, signedAngleBetweenVectors as S, Pi as T, ceil as U, min as V, max as W, arrayMin as X, arrayMax as Y, ceilLog2 as Z, factorial as _, areMatricesEqual as a, beginCombination as a0, nextCombination as a1, randomSeed as a2, getSeed as a3, gaussian as a4, multiplyScalar2D as a5, multiplyAccumulate2D as a6, outer as a7, dot2D as a8, projectVector2D as a9, hex2float as aA, lab2xyz as aB, xyz2lab as aC, xyz2rgb as aD, rgb2xyz as aE, clampAndNormalizeValue as aF, getScalarTypeFittingRange as aG, getAdjustedScalarRange as aH, extentIsWithinOtherExtent as aI, boundsIsWithinOtherBounds as aJ, pointIsWithinBounds as aK, solve3PointCircle as aL, inf as aM, negInf as aN, isFinite as aO, isNaN as aP, floatToHex2 as aQ, floatRGB2HexCode as aR, float2CssRGBA as aS, gaussianAmplitude as aa, gaussianWeight as ab, outer2D as ac, norm2D as ad, LUFactor3x3 as ae, LUSolve3x3 as af, linearSolve3x3 as ag, multiply3x3_mat3 as ah, multiplyMatrix as ai, transpose3x3 as aj, invert3x3 as ak, identity3x3 as al, quaternionToMatrix3x3 as am, roundNumber as an, matrix3x3ToQuaternion as ao, multiplyQuaternion as ap, orthogonalize3x3 as aq, diagonalize3x3 as ar, singularValueDecomposition3x3 as as, luFactorLinearSystem as at, luSolveLinearSystem as au, invertMatrix as av, estimateMatrixCondition as aw, jacobi as ax, solveHomogeneousLeastSquares as ay, solveLeastSquares as az, roundVector as b, computeBoundsFromPoints as c, dot as d, clampVector as e, distance2BetweenPoints as f, subtract as g, hsv2rgb as h, isNan as i, cross as j, add as k, normalize as l, determinant2x2 as m, norm as n, jacobiN as o, perpendiculars as p, vtkMath as q, radiansFromDegrees as r, solveLinearSystem as s, multiplyScalar as t, uninitializeBounds as u, vtkMath$1 as v, random as w, determinant3x3 as x, degreesFromRadians as y, areEquals as z };
@@ -1,4 +1,4 @@
1
1
  import '@babel/runtime/helpers/slicedToArray';
2
2
  import 'seedrandom';
3
3
  import '../../macros.js';
4
- export { ae as LUFactor3x3, af as LUSolve3x3, T as Pi, f as add, R as angleBetweenVectors, O as areBoundsInitialized, z as areEquals, a as areMatricesEqual, Y as arrayMax, X as arrayMin, C as arrayRange, a0 as beginCombination, $ as binomial, aJ as boundsIsWithinOtherBounds, U as ceil, Z as ceilLog2, aF as clampAndNormalizeValue, A as clampValue, x as clampVector, t as computeBoundsFromPoints, M as createUninitializedBounds, e as cross, l as default, y as degreesFromRadians, j as determinant2x2, q as determinant3x3, ar as diagonalize3x3, b as distance2BetweenPoints, d as dot, a8 as dot2D, aw as estimateMatrixCondition, aI as extentIsWithinOtherExtent, _ as factorial, aS as float2CssRGBA, aR as floatRGB2HexCode, aQ as floatToHex2, I as floor, a4 as gaussian, aa as gaussianAmplitude, ab as gaussianWeight, aH as getAdjustedScalarRange, D as getMajorAxisIndex, aG as getScalarTypeFittingRange, a3 as getSeed, aA as hex2float, h as hsv2rgb, al as identity3x3, aM as inf, ak as invert3x3, av as invertMatrix, aO as isFinite, E as isInf, aP as isNaN, i as isNan, P as isPowerOfTwo, ax as jacobi, k as jacobiN, H as lab2rgb, aB as lab2xyz, ag as linearSolve3x3, at as luFactorLinearSystem, au as luSolveLinearSystem, ao as matrix3x3ToQuaternion, W as max, V as min, ah as multiply3x3_mat3, N as multiply3x3_vect3, Q as multiplyAccumulate, a6 as multiplyAccumulate2D, ai as multiplyMatrix, ap as multiplyQuaternion, m as multiplyScalar, a5 as multiplyScalar2D, K as nearestPowerOfTwo, aN as negInf, a1 as nextCombination, n as norm, ad as norm2D, g as normalize, L as normalize2D, aq as orthogonalize3x3, a7 as outer, ac as outer2D, p as perpendiculars, aK as pointIsWithinBounds, B as projectVector, a9 as projectVector2D, am as quaternionToMatrix3x3, r as radiansFromDegrees, o as random, a2 as randomSeed, F as rgb2hsv, G as rgb2lab, aE as rgb2xyz, J as round, an as roundNumber, w as roundVector, S as signedAngleBetweenVectors, as as singularValueDecomposition3x3, aL as solve3PointCircle, ay as solveHomogeneousLeastSquares, az as solveLeastSquares, s as solveLinearSystem, c as subtract, aj as transpose3x3, u as uninitializeBounds, aC as xyz2lab, aD as xyz2rgb } from './Math/index.js';
4
+ export { ae as LUFactor3x3, af as LUSolve3x3, T as Pi, k as add, R as angleBetweenVectors, O as areBoundsInitialized, z as areEquals, a as areMatricesEqual, Y as arrayMax, X as arrayMin, C as arrayRange, a0 as beginCombination, $ as binomial, aJ as boundsIsWithinOtherBounds, U as ceil, Z as ceilLog2, aF as clampAndNormalizeValue, A as clampValue, e as clampVector, c as computeBoundsFromPoints, M as createUninitializedBounds, j as cross, q as default, y as degreesFromRadians, m as determinant2x2, x as determinant3x3, ar as diagonalize3x3, f as distance2BetweenPoints, d as dot, a8 as dot2D, aw as estimateMatrixCondition, aI as extentIsWithinOtherExtent, _ as factorial, aS as float2CssRGBA, aR as floatRGB2HexCode, aQ as floatToHex2, I as floor, a4 as gaussian, aa as gaussianAmplitude, ab as gaussianWeight, aH as getAdjustedScalarRange, D as getMajorAxisIndex, aG as getScalarTypeFittingRange, a3 as getSeed, aA as hex2float, h as hsv2rgb, al as identity3x3, aM as inf, ak as invert3x3, av as invertMatrix, aO as isFinite, E as isInf, aP as isNaN, i as isNan, P as isPowerOfTwo, ax as jacobi, o as jacobiN, H as lab2rgb, aB as lab2xyz, ag as linearSolve3x3, at as luFactorLinearSystem, au as luSolveLinearSystem, ao as matrix3x3ToQuaternion, W as max, V as min, ah as multiply3x3_mat3, N as multiply3x3_vect3, Q as multiplyAccumulate, a6 as multiplyAccumulate2D, ai as multiplyMatrix, ap as multiplyQuaternion, t as multiplyScalar, a5 as multiplyScalar2D, K as nearestPowerOfTwo, aN as negInf, a1 as nextCombination, n as norm, ad as norm2D, l as normalize, L as normalize2D, aq as orthogonalize3x3, a7 as outer, ac as outer2D, p as perpendiculars, aK as pointIsWithinBounds, B as projectVector, a9 as projectVector2D, am as quaternionToMatrix3x3, r as radiansFromDegrees, w as random, a2 as randomSeed, F as rgb2hsv, G as rgb2lab, aE as rgb2xyz, J as round, an as roundNumber, b as roundVector, S as signedAngleBetweenVectors, as as singularValueDecomposition3x3, aL as solve3PointCircle, ay as solveHomogeneousLeastSquares, az as solveLeastSquares, s as solveLinearSystem, g as subtract, aj as transpose3x3, u as uninitializeBounds, aC as xyz2lab, aD as xyz2rgb } from './Math/index.js';
@@ -1,6 +1,6 @@
1
1
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
2
  import macro from '../../macros.js';
3
- import { t as computeBoundsFromPoints, w as roundVector, x as clampVector } from '../Core/Math/index.js';
3
+ import { c as computeBoundsFromPoints, b as roundVector, e as clampVector } from '../Core/Math/index.js';
4
4
  import vtkBoundingBox from './BoundingBox.js';
5
5
  import vtkDataSet from './DataSet.js';
6
6
  import vtkStructuredData from './StructuredData.js';
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import macro from '../../macros.js';
3
3
  import Constants from './Line/Constants.js';
4
4
  import vtkCell from './Cell.js';
5
- import { d as dot, b as distance2BetweenPoints, s as solveLinearSystem } from '../Core/Math/index.js';
5
+ import { d as dot, f as distance2BetweenPoints, s as solveLinearSystem } from '../Core/Math/index.js';
6
6
 
7
7
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8
8
 
@@ -1,5 +1,5 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
- import { c as subtract, d as dot, e as cross, f as add } from '../Core/Math/index.js';
2
+ import { g as subtract, d as dot, j as cross, k as add } from '../Core/Math/index.js';
3
3
  import macro from '../../macros.js';
4
4
 
5
5
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -1,6 +1,6 @@
1
1
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
2
  import macro from '../../macros.js';
3
- import { g as normalize, c as subtract, e as cross, f as add, d as dot, n as norm } from '../Core/Math/index.js';
3
+ import { l as normalize, g as subtract, j as cross, k as add, d as dot, n as norm } from '../Core/Math/index.js';
4
4
  import vtkLine from './Line.js';
5
5
  import vtkPlane from './Plane.js';
6
6
  import vtkPriorityQueue from '../Core/PriorityQueue.js';
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import macro from '../../macros.js';
3
3
  import vtkCell from './Cell.js';
4
- import { b as distance2BetweenPoints, d as dot, j as determinant2x2 } from '../Core/Math/index.js';
4
+ import { f as distance2BetweenPoints, d as dot, m as determinant2x2 } from '../Core/Math/index.js';
5
5
  import vtkLine from './Line.js';
6
6
  import vtkPlane from './Plane.js';
7
7
 
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import { mat4, mat3 } from 'gl-matrix';
3
3
  import Constants from './LandmarkTransform/Constants.js';
4
4
  import macro from '../../macros.js';
5
- import { k as jacobiN, p as perpendiculars } from '../Core/Math/index.js';
5
+ import { o as jacobiN, p as perpendiculars } from '../Core/Math/index.js';
6
6
 
7
7
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8
8
 
@@ -1,7 +1,7 @@
1
1
  import macro from '../../macros.js';
2
2
  import vtkDataArray from '../../Common/Core/DataArray.js';
3
3
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
4
- import { g as normalize } from '../../Common/Core/Math/index.js';
4
+ import { l as normalize } from '../../Common/Core/Math/index.js';
5
5
  import vtkCaseTable from './ImageMarchingCubes/caseTable.js';
6
6
 
7
7
  var vtkErrorMacro = macro.vtkErrorMacro,
@@ -1,7 +1,7 @@
1
1
  import macro from '../../macros.js';
2
2
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
3
3
  import vtkDataArray from '../../Common/Core/DataArray.js';
4
- import { g as normalize } from '../../Common/Core/Math/index.js';
4
+ import { l as normalize } from '../../Common/Core/Math/index.js';
5
5
  import { a as atomElem } from '../../Utilities/XMLConverter/chemistry/elements.json.js';
6
6
 
7
7
  var vtkErrorMacro = macro.vtkErrorMacro,
@@ -1,7 +1,7 @@
1
1
  import macro from '../../macros.js';
2
2
  import vtkCellArray from '../../Common/Core/CellArray.js';
3
3
  import vtkDataArray from '../../Common/Core/DataArray.js';
4
- import { g as normalize, e as cross, n as norm, d as dot, b as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
4
+ import { l as normalize, j as cross, n as norm, d as dot, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
5
5
  import vtkPoints from '../../Common/Core/Points.js';
6
6
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
7
7
  import { DesiredOutputPrecision } from '../../Common/DataModel/DataSetAttributes/Constants.js';
@@ -2,7 +2,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
2
  import macro from '../../macros.js';
3
3
  import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
4
4
  import vtkDataArray from '../../Common/Core/DataArray.js';
5
- import { l as vtkMath } from '../../Common/Core/Math/index.js';
5
+ import { q as vtkMath } from '../../Common/Core/Math/index.js';
6
6
  import { AttributeTypes } from '../../Common/DataModel/DataSetAttributes/Constants.js';
7
7
  import vtkPoints from '../../Common/Core/Points.js';
8
8
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
@@ -139,7 +139,7 @@ function defaultValues(initialValues) {
139
139
  center: [0, 0, 0],
140
140
  height: 1.0,
141
141
  direction: [1, 0, 0],
142
- pointType: 'Float32Array',
142
+ pointType: 'Float64Array',
143
143
  thickness: 0,
144
144
  width: 1.0
145
145
  }, initialValues);
@@ -72,7 +72,7 @@ var DEFAULT_VALUES = {
72
72
  shaftRadius: 0.03,
73
73
  invert: false,
74
74
  direction: [1.0, 0.0, 0.0],
75
- pointType: 'Float32Array'
75
+ pointType: 'Float64Array'
76
76
  }; // ----------------------------------------------------------------------------
77
77
 
78
78
  function extend(publicAPI, model) {
@@ -3,7 +3,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
3
3
  import macro from '../../macros.js';
4
4
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
5
5
  import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
6
- import { m as multiplyScalar } from '../../Common/Core/Math/index.js';
6
+ import { t as multiplyScalar } from '../../Common/Core/Math/index.js';
7
7
 
8
8
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
9
 
@@ -73,7 +73,7 @@ function defaultValues(initialValues) {
73
73
  center: [0, 0, 0],
74
74
  lines: false,
75
75
  direction: [1, 0, 0],
76
- pointType: 'Float32Array',
76
+ pointType: 'Float64Array',
77
77
  radius: 1.0,
78
78
  resolution: 6
79
79
  }, initialValues);
@@ -386,7 +386,7 @@ var DEFAULT_VALUES = {
386
386
  skipInnerFaces: true,
387
387
  mask: null,
388
388
  // If present, array to know if a layer should be skipped(=true)
389
- pointType: 'Float32Array'
389
+ pointType: 'Float64Array'
390
390
  }; // ----------------------------------------------------------------------------
391
391
 
392
392
  function extend(publicAPI, model) {
@@ -81,7 +81,7 @@ var DEFAULT_VALUES = {
81
81
  center: [0, 0, 0],
82
82
  direction: [1.0, 0.0, 0.0],
83
83
  capping: true,
84
- pointType: 'Float32Array'
84
+ pointType: 'Float64Array'
85
85
  }; // ----------------------------------------------------------------------------
86
86
 
87
87
  function extend(publicAPI, model) {
@@ -178,7 +178,7 @@ function vtkCubeSource(publicAPI, model) {
178
178
  (_vtkMatrixBuilder$bui = vtkMatrixBuilder.buildFromRadian()).translate.apply(_vtkMatrixBuilder$bui, _toConsumableArray(model.center)).apply(points); // Define quads
179
179
 
180
180
 
181
- var polys = macro.newTypedArray(model.pointType, numberOfPolys * 5);
181
+ var polys = new Uint16Array(numberOfPolys * 5);
182
182
  polyData.getPolys().setData(polys, 1);
183
183
  var polyIndex = 0;
184
184
  polys[polyIndex++] = 4;
@@ -247,7 +247,7 @@ var DEFAULT_VALUES = {
247
247
  zLength: 1.0,
248
248
  center: [0.0, 0.0, 0.0],
249
249
  rotations: [0.0, 0.0, 0.0],
250
- pointType: 'Float32Array',
250
+ pointType: 'Float64Array',
251
251
  generate3DTextureCoordinates: false
252
252
  }; // ----------------------------------------------------------------------------
253
253
 
@@ -180,7 +180,7 @@ var DEFAULT_VALUES = {
180
180
  center: [0, 0, 0],
181
181
  direction: [0.0, 1.0, 0.0],
182
182
  capping: true,
183
- pointType: 'Float32Array'
183
+ pointType: 'Float64Array'
184
184
  }; // ----------------------------------------------------------------------------
185
185
 
186
186
  function extend(publicAPI, model) {
@@ -1,6 +1,6 @@
1
1
  import macro from '../../macros.js';
2
2
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
3
- import { c as subtract, n as norm } from '../../Common/Core/Math/index.js';
3
+ import { g as subtract, n as norm } from '../../Common/Core/Math/index.js';
4
4
 
5
5
  var vtkWarningMacro = macro.vtkWarningMacro; // ----------------------------------------------------------------------------
6
6
  // vtkLineSource methods
@@ -17,9 +17,9 @@ function vtkLineSource(publicAPI, model) {
17
17
 
18
18
  var dataset = outData[0]; // Check input
19
19
 
20
- var pointDataType = dataset ? dataset.getPoints().getDataType() : 'Float32Array';
20
+ var pointDataType = dataset ? dataset.getPoints().getDataType() : model.pointType;
21
21
  var pd = vtkPolyData.newInstance();
22
- var v21 = new Float32Array(3);
22
+ var v21 = [];
23
23
  subtract(model.point2, model.point1, v21);
24
24
 
25
25
  if (norm(v21) <= 0.0) {
@@ -68,7 +68,7 @@ var DEFAULT_VALUES = {
68
68
  resolution: 10,
69
69
  point1: [-1, 0, 0],
70
70
  point2: [1, 0, 0],
71
- pointType: 'Float32Array'
71
+ pointType: 'Float64Array'
72
72
  }; // ----------------------------------------------------------------------------
73
73
 
74
74
  function extend(publicAPI, model) {
@@ -2,7 +2,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
2
  import { mat4, vec3 } from 'gl-matrix';
3
3
  import macro from '../../macros.js';
4
4
  import vtkDataArray from '../../Common/Core/DataArray.js';
5
- import { c as subtract, g as normalize, d as dot, e as cross, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
5
+ import { g as subtract, l as normalize, d as dot, j as cross, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
6
6
  import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
7
7
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
8
8
 
@@ -22,10 +22,10 @@ function vtkPlaneSource(publicAPI, model) {
22
22
 
23
23
  var dataset = outData[0]; // Check input
24
24
 
25
- var pointDataType = dataset ? dataset.getPoints().getDataType() : 'Float32Array';
25
+ var pointDataType = dataset ? dataset.getPoints().getDataType() : model.pointType;
26
26
  var pd = vtkPolyData.newInstance();
27
- var v10 = new Float32Array(3);
28
- var v20 = new Float32Array(3);
27
+ var v10 = [];
28
+ var v20 = [];
29
29
  subtract(model.point1, model.origin, v10);
30
30
  subtract(model.point2, model.origin, v20);
31
31
 
@@ -242,7 +242,7 @@ var DEFAULT_VALUES = {
242
242
  origin: [0, 0, 0],
243
243
  point1: [1, 0, 0],
244
244
  point2: [0, 1, 0],
245
- pointType: 'Float32Array'
245
+ pointType: 'Float64Array'
246
246
  }; // ----------------------------------------------------------------------------
247
247
 
248
248
  function extend(publicAPI, model) {
@@ -1,5 +1,5 @@
1
1
  import macro from '../../macros.js';
2
- import { o as random } from '../../Common/Core/Math/index.js';
2
+ import { w as random } from '../../Common/Core/Math/index.js';
3
3
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
4
4
 
5
5
  // vtkPointSource methods
@@ -16,7 +16,7 @@ function vtkPointSource(publicAPI, model) {
16
16
 
17
17
  var dataset = outData[0]; // Check input
18
18
 
19
- var pointDataType = dataset ? dataset.getPoints().getDataType() : 'Float32Array';
19
+ var pointDataType = dataset ? dataset.getPoints().getDataType() : model.pointType;
20
20
  var pd = vtkPolyData.newInstance(); // hand create a point cloud
21
21
 
22
22
  var numPts = model.numberOfPoints; // Points
@@ -63,7 +63,7 @@ var DEFAULT_VALUES = {
63
63
  numberOfPoints: 10,
64
64
  center: [0, 0, 0],
65
65
  radius: 0.5,
66
- pointType: 'Float32Array'
66
+ pointType: 'Float64Array'
67
67
  }; // ----------------------------------------------------------------------------
68
68
 
69
69
  function extend(publicAPI, model) {
@@ -7,7 +7,7 @@ import vtkDataArray from '../../Common/Core/DataArray.js';
7
7
  // ----------------------------------------------------------------------------
8
8
 
9
9
  function generateCoordinates(origin, dimensions, spacing) {
10
- var coordinates = new Float32Array(dimensions[0] * dimensions[1] * dimensions[2] * 3);
10
+ var coordinates = new Float64Array(dimensions[0] * dimensions[1] * dimensions[2] * 3);
11
11
  var offset = 0;
12
12
 
13
13
  for (var k = 0; k < dimensions[2]; k++) {
@@ -37,7 +37,7 @@ function vtkSLICSource(publicAPI, model) {
37
37
 
38
38
  publicAPI.addCluster = function (centerX, centerY, centerZ, fnConst, fnDfDx, fnDfDy, fnDfDz) {
39
39
  var id = model.clusters.length;
40
- model.clusters.push(new Float32Array([centerX, centerY, centerZ, fnConst, fnDfDx, fnDfDy, fnDfDz]));
40
+ model.clusters.push(new Float64Array([centerX, centerY, centerZ, fnConst, fnDfDx, fnDfDy, fnDfDz]));
41
41
  publicAPI.modified();
42
42
  return id;
43
43
  };
@@ -54,7 +54,7 @@ function vtkSLICSource(publicAPI, model) {
54
54
 
55
55
  publicAPI.updateCluster = function (id, centerX, centerY, centerZ, fnConst, fnDfDx, fnDfDy, fnDfDz) {
56
56
  if (!model.clusters[id]) {
57
- model.clusters[id] = new Float32Array(7);
57
+ model.clusters[id] = new Float64Array(7);
58
58
  }
59
59
 
60
60
  model.clusters[id][0] = centerX;
@@ -15,7 +15,7 @@ function vtkSphereSource(publicAPI, model) {
15
15
  }
16
16
 
17
17
  var dataset = outData[0];
18
- var pointDataType = dataset ? dataset.getPoints().getDataType() : 'Float32Array';
18
+ var pointDataType = dataset ? dataset.getPoints().getDataType() : model.pointType;
19
19
  dataset = vtkPolyData.newInstance(); // ----------------------------------------------------------------------
20
20
 
21
21
  var numPoles = 0; // Check data, determine increments, and convert to radians
@@ -180,7 +180,7 @@ var DEFAULT_VALUES = {
180
180
  startPhi: 0.0,
181
181
  endPhi: 180.0,
182
182
  center: [0, 0, 0],
183
- pointType: 'Float32Array'
183
+ pointType: 'Float64Array'
184
184
  }; // ----------------------------------------------------------------------------
185
185
 
186
186
  function extend(publicAPI, model) {
@@ -75,7 +75,7 @@ var DEFAULT_VALUES = {
75
75
  radius: 1,
76
76
  spacing: 2,
77
77
  width: 4,
78
- pointType: 'Float32Array'
78
+ pointType: 'Float64Array'
79
79
  }; // ----------------------------------------------------------------------------
80
80
 
81
81
  function extend(publicAPI, model) {
@@ -1,6 +1,6 @@
1
1
  import macro from '../../macros.js';
2
2
  import vtkDataArray from '../../Common/Core/DataArray.js';
3
- import { g as normalize, d as dot, e as cross, b as distance2BetweenPoints, q as determinant3x3 } from '../../Common/Core/Math/index.js';
3
+ import { l as normalize, d as dot, j as cross, f as distance2BetweenPoints, x as determinant3x3 } from '../../Common/Core/Math/index.js';
4
4
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
5
5
 
6
6
  var vtkErrorMacro = macro.vtkErrorMacro; // ----------------------------------------------------------------------------
@@ -1,6 +1,6 @@
1
1
  import macro from '../../macros.js';
2
2
  import vtkDataArray from '../../Common/Core/DataArray.js';
3
- import { b as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
3
+ import { f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
4
4
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
5
5
 
6
6
  var vtkErrorMacro = macro.vtkErrorMacro; // ----------------------------------------------------------------------------
@@ -1,7 +1,7 @@
1
1
  import macro from '../../macros.js';
2
2
  import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
3
3
  import vtkCompositeKeyboardManipulator from './CompositeKeyboardManipulator.js';
4
- import { f as add, g as normalize, e as cross } from '../../Common/Core/Math/index.js';
4
+ import { k as add, l as normalize, j as cross } from '../../Common/Core/Math/index.js';
5
5
 
6
6
  var vtkErrorMacro = macro.vtkErrorMacro;
7
7
  var ANIMATION_REQUESTER = 'vtkKeyboardCameraManipulator'; // ----------------------------------------------------------------------------
@@ -80,15 +80,21 @@ function vtkMouseBoxSelectionManipulator(publicAPI, model) {
80
80
  previousPosition = position;
81
81
 
82
82
  if (model.renderSelection) {
83
+ var _view;
84
+
83
85
  // Need window size and location to convert to style
84
86
  if (!view) {
85
87
  view = interactor.getView();
86
88
  }
87
89
 
88
- if (!container && view) {
90
+ if (!container && (_view = view) !== null && _view !== void 0 && _view.getContainer) {
89
91
  container = view.getContainer();
90
92
  }
91
93
 
94
+ if (!container) {
95
+ container = model.container;
96
+ }
97
+
92
98
  if (!div) {
93
99
  div = document.createElement('div');
94
100
  applyStyle(div, model.selectionStyle);
@@ -155,6 +161,7 @@ function vtkMouseBoxSelectionManipulator(publicAPI, model) {
155
161
 
156
162
  function DEFAULT_VALUES(initialValues) {
157
163
  return _objectSpread(_objectSpread({
164
+ // container: null,
158
165
  renderSelection: true
159
166
  }, initialValues), {}, {
160
167
  selectionStyle: _objectSpread(_objectSpread({}, DEFAULT_STYLE), initialValues.selectionStyle)
@@ -172,7 +179,7 @@ function extend(publicAPI, model) {
172
179
 
173
180
  event(publicAPI, model, 'BoxSelectInput'); // Trigger while dragging
174
181
 
175
- setGet(publicAPI, model, ['renderSelection', 'selectionStyle']); // Object specific methods
182
+ setGet(publicAPI, model, ['renderSelection', 'selectionStyle', 'container']); // Object specific methods
176
183
 
177
184
  vtkMouseBoxSelectionManipulator(publicAPI, model);
178
185
  } // ----------------------------------------------------------------------------
@@ -3,7 +3,7 @@ import { mat4, vec3 } from 'gl-matrix';
3
3
  import macro from '../../macros.js';
4
4
  import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
5
5
  import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
6
- import { r as radiansFromDegrees, e as cross } from '../../Common/Core/Math/index.js';
6
+ import { r as radiansFromDegrees, j as cross } from '../../Common/Core/Math/index.js';
7
7
  import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
8
8
 
9
9
  // vtkMouseCameraAxisRotateManipulator methods
@@ -1,7 +1,7 @@
1
1
  import macro from '../../macros.js';
2
2
  import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
3
3
  import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
4
- import { e as cross } from '../../Common/Core/Math/index.js';
4
+ import { j as cross } from '../../Common/Core/Math/index.js';
5
5
 
6
6
  // vtkMouseCameraTrackballPanManipulator methods
7
7
  // ----------------------------------------------------------------------------
@@ -2,7 +2,7 @@ import { mat4, vec3 } from 'gl-matrix';
2
2
  import macro from '../../macros.js';
3
3
  import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
4
4
  import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
5
- import { m as multiplyScalar, d as dot, f as add, r as radiansFromDegrees, e as cross } from '../../Common/Core/Math/index.js';
5
+ import { t as multiplyScalar, d as dot, k as add, r as radiansFromDegrees, j as cross } from '../../Common/Core/Math/index.js';
6
6
 
7
7
  // vtkMouseCameraTrackballRotateManipulator methods
8
8
  // ----------------------------------------------------------------------------
@@ -5,7 +5,7 @@ import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
5
5
  import vtkInteractorStyleConstants from '../../Rendering/Core/InteractorStyle/Constants.js';
6
6
  import vtkMouseCameraUnicamRotateManipulator from './MouseCameraUnicamRotateManipulator.js';
7
7
  import macro from '../../macros.js';
8
- import { c as subtract, m as multiplyScalar, g as normalize, d as dot, r as radiansFromDegrees, e as cross } from '../../Common/Core/Math/index.js';
8
+ import { g as subtract, t as multiplyScalar, l as normalize, d as dot, r as radiansFromDegrees, j as cross } from '../../Common/Core/Math/index.js';
9
9
 
10
10
  var States = vtkInteractorStyleConstants.States; // ----------------------------------------------------------------------------
11
11
  // vtkMouseCameraUnicamManipulator methods
@@ -10,7 +10,7 @@ import vtkSphereSource from '../../Filters/Sources/SphereSource.js';
10
10
  import { FieldAssociations } from '../../Common/DataModel/DataSet/Constants.js';
11
11
  import { mat4, vec3 } from 'gl-matrix';
12
12
  import macro from '../../macros.js';
13
- import { z as areEquals, g as normalize, d as dot, A as clampValue, c as subtract, e as cross, m as multiplyScalar, b as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
13
+ import { z as areEquals, l as normalize, d as dot, A as clampValue, g as subtract, j as cross, t as multiplyScalar, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
14
14
 
15
15
  var States = vtkInteractorStyleConstants.States; // ----------------------------------------------------------------------------
16
16
  // vtkMouseCameraUnicamRotateManipulator methods
@@ -1,6 +1,6 @@
1
1
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
2
  import macro from '../../macros.js';
3
- import { g as normalize, b as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
3
+ import { l as normalize, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
4
4
  import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
5
5
  import vtkInteractorStyleManipulator from './InteractorStyleManipulator.js';
6
6
  import vtkMouseCameraTrackballRotateManipulator from '../Manipulators/MouseCameraTrackballRotateManipulator.js';
@@ -3,7 +3,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
3
  import macro from '../../macros.js';
4
4
  import vtkLabelRepresentation from './LabelRepresentation.js';
5
5
  import vtkLineRepresentation from './LineRepresentation.js';
6
- import { b as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
6
+ import { f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
7
7
 
8
8
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
9
 
@@ -1,6 +1,6 @@
1
1
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
2
  import macro from '../../macros.js';
3
- import { b as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
3
+ import { f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
4
4
  import vtkCellPicker from '../../Rendering/Core/CellPicker.js';
5
5
  import vtkActor from '../../Rendering/Core/Actor.js';
6
6
  import vtkWidgetRepresentation from './WidgetRepresentation.js';
@@ -1,7 +1,7 @@
1
1
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
2
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
3
  import macro from '../../macros.js';
4
- import { g as normalize, d as dot, c as subtract, B as projectVector, f as add } from '../../Common/Core/Math/index.js';
4
+ import { l as normalize, d as dot, g as subtract, B as projectVector, k as add } from '../../Common/Core/Math/index.js';
5
5
  import vtkPlane from '../../Common/DataModel/Plane.js';
6
6
  import vtkAbstractWidget from './AbstractWidget.js';
7
7
  import vtkImageCroppingRegionsRepresentation from './ImageCroppingRegionsRepresentation.js';
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import macro from '../../macros.js';
3
3
  import vtkActor from '../../Rendering/Core/Actor.js';
4
4
  import vtkInteractorObserver from '../../Rendering/Core/InteractorObserver.js';
5
- import { c as subtract, f as add } from '../../Common/Core/Math/index.js';
5
+ import { g as subtract, k as add } from '../../Common/Core/Math/index.js';
6
6
  import vtkPixelSpaceCallbackMapper from '../../Rendering/Core/PixelSpaceCallbackMapper.js';
7
7
  import vtkPointSource from '../../Filters/Sources/PointSource.js';
8
8
  import vtkHandleRepresentation from './HandleRepresentation.js';
@@ -1,7 +1,7 @@
1
1
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
2
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
3
  import macro from '../../../macros.js';
4
- import { e as cross, g as normalize, A as clampValue } from '../../../Common/Core/Math/index.js';
4
+ import { j as cross, l as normalize, A as clampValue } from '../../../Common/Core/Math/index.js';
5
5
  import vtkPolyData from '../../../Common/DataModel/PolyData.js';
6
6
  import vtkPlane from '../../../Common/DataModel/Plane.js';
7
7
  import vtkCellArray from '../../../Common/Core/CellArray.js';
@@ -2,7 +2,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
2
  import macro from '../../../macros.js';
3
3
  import vtkInteractorObserver from '../../../Rendering/Core/InteractorObserver.js';
4
4
  import vtkLine from '../../../Common/DataModel/Line.js';
5
- import { b as distance2BetweenPoints, g as normalize, d as dot, e as cross, u as uninitializeBounds } from '../../../Common/Core/Math/index.js';
5
+ import { f as distance2BetweenPoints, l as normalize, d as dot, j as cross, u as uninitializeBounds } from '../../../Common/Core/Math/index.js';
6
6
  import vtkMatrixBuilder from '../../../Common/Core/MatrixBuilder.js';
7
7
  import vtkPlane from '../../../Common/DataModel/Plane.js';
8
8
  import vtkResliceCursorActor from './ResliceCursorActor.js';
@@ -4,7 +4,7 @@ import { mat4, vec4 } from 'gl-matrix';
4
4
  import vtkImageMapper from '../../../Rendering/Core/ImageMapper.js';
5
5
  import vtkImageReslice from '../../../Imaging/Core/ImageReslice.js';
6
6
  import vtkImageSlice from '../../../Rendering/Core/ImageSlice.js';
7
- import { f as add, c as subtract, g as normalize } from '../../../Common/Core/Math/index.js';
7
+ import { k as add, g as subtract, l as normalize } from '../../../Common/Core/Math/index.js';
8
8
  import vtkPlaneSource from '../../../Filters/Sources/PlaneSource.js';
9
9
  import vtkWidgetRepresentation from '../WidgetRepresentation.js';
10
10
  import { transformPlane, boundPlane } from '../../../Widgets/Widgets3D/ResliceCursorWidget/helpers.js';
@@ -5,7 +5,7 @@ import vtkCellPicker from '../../Rendering/Core/CellPicker.js';
5
5
  import vtkHandleRepresentation from './HandleRepresentation.js';
6
6
  import vtkInteractorObserver from '../../Rendering/Core/InteractorObserver.js';
7
7
  import vtkMapper from '../../Rendering/Core/Mapper.js';
8
- import { b as distance2BetweenPoints, n as norm } from '../../Common/Core/Math/index.js';
8
+ import { f as distance2BetweenPoints, n as norm } from '../../Common/Core/Math/index.js';
9
9
  import vtkProperty from '../../Rendering/Core/Property.js';
10
10
  import vtkSphereSource from '../../Filters/Sources/SphereSource.js';
11
11
  import { InteractionState } from './HandleRepresentation/Constants.js';
@@ -1,7 +1,7 @@
1
1
  import macro from '../../macros.js';
2
2
  import vtkMouseRangeManipulator from '../../Interaction/Manipulators/MouseRangeManipulator.js';
3
3
  import vtkViewProxy from './ViewProxy.js';
4
- import { e as cross, D as getMajorAxisIndex } from '../../Common/Core/Math/index.js';
4
+ import { j as cross, D as getMajorAxisIndex } from '../../Common/Core/Math/index.js';
5
5
 
6
6
  var DEFAULT_STEP_WIDTH = 512;
7
7
 
@@ -1,7 +1,7 @@
1
1
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
2
  import { mat4, vec4, vec3, quat } from 'gl-matrix';
3
3
  import macro from '../../macros.js';
4
- import { r as radiansFromDegrees, f as add, e as cross } from '../../Common/Core/Math/index.js';
4
+ import { r as radiansFromDegrees, k as add, j as cross } from '../../Common/Core/Math/index.js';
5
5
 
6
6
  var vtkDebugMacro = macro.vtkDebugMacro;
7
7
  /* eslint-disable new-cap */
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import macro from '../../macros.js';
3
- import { g as normalize } from '../../Common/Core/Math/index.js';
3
+ import { l as normalize } from '../../Common/Core/Math/index.js';
4
4
  import vtkPicker from './Picker.js';
5
5
  import vtkPoints from '../../Common/Core/Points.js';
6
6
  import vtkTriangle from '../../Common/DataModel/Triangle.js';
@@ -1,5 +1,5 @@
1
1
  import macro from '../../macros.js';
2
- import { g as normalize, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
2
+ import { l as normalize, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
3
3
 
4
4
  var LIGHT_TYPES = ['HeadLight', 'CameraLight', 'SceneLight']; // ----------------------------------------------------------------------------
5
5
  // vtkLight methods
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import macro from '../../macros.js';
3
3
  import vtkAbstractPicker from './AbstractPicker.js';
4
4
  import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
5
- import { d as dot, g as normalize, n as norm, b as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
5
+ import { d as dot, l as normalize, n as norm, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
6
6
  import { mat4, vec4 } from 'gl-matrix';
7
7
 
8
8
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -3,7 +3,7 @@ import { mat3, mat4, vec3 } from 'gl-matrix';
3
3
  import { newInstance as newInstance$1, setGet, obj, vtkErrorMacro as vtkErrorMacro$1 } from '../../macros.js';
4
4
  import vtkHelper from './Helper.js';
5
5
  import vtkMapper from '../Core/Mapper.js';
6
- import { g as normalize, u as uninitializeBounds } from '../../Common/Core/Math/index.js';
6
+ import { l as normalize, u as uninitializeBounds } from '../../Common/Core/Math/index.js';
7
7
  import vtkOpenGLTexture from './Texture.js';
8
8
  import vtkProperty from '../Core/Property.js';
9
9
  import vtkShaderProgram from './ShaderProgram.js';
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import { newInstance as newInstance$1, obj, setGet, newTypedArray, vtkDebugMacro as vtkDebugMacro$1 } from '../../macros.js';
3
- import { e as cross, g as normalize } from '../../Common/Core/Math/index.js';
3
+ import { j as cross, l as normalize } from '../../Common/Core/Math/index.js';
4
4
  import vtkWebGPUBuffer from './Buffer.js';
5
5
  import vtkWebGPUTypes from './Types.js';
6
6
  import vtkProperty from '../Core/Property.js';
@@ -8,9 +8,10 @@ import vtkWebGPUMapperHelper from './MapperHelper.js';
8
8
  import vtkWebGPURenderEncoder from './RenderEncoder.js';
9
9
  import vtkWebGPUShaderCache from './ShaderCache.js';
10
10
  import vtkWebGPUTexture from './Texture.js';
11
+ import vtkWebGPUUniformBuffer from './UniformBuffer.js';
11
12
  import vtkWebGPUFullScreenQuad from './FullScreenQuad.js';
12
13
  import vtkWebGPUVolumePassFSQ from './VolumePassFSQ.js';
13
- import { b as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
14
+ import { f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
14
15
 
15
16
  var Representation = vtkProperty.Representation;
16
17
  var BufferUsage = vtkWebGPUBufferManager.BufferUsage,
@@ -33,7 +34,7 @@ var BufferUsage = vtkWebGPUBufferManager.BufferUsage,
33
34
 
34
35
  var cubeFaceTriangles = [[0, 4, 6], [0, 6, 2], [1, 3, 7], [1, 7, 5], [0, 5, 4], [0, 1, 5], [2, 6, 7], [2, 7, 3], [0, 3, 1], [0, 2, 3], [4, 5, 7], [4, 7, 6]];
35
36
  var DepthBoundsFS = "\n//VTK::Renderer::Dec\n\n//VTK::Select::Dec\n\n//VTK::VolumePass::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n[[stage(fragment)]]\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n //VTK::Select::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::VolumePass::Impl\n\n // use the maximum (closest) of the current value and the zbuffer\n // the blend func will then take the min to find the farthest stop value\n var stopval: f32 = max(input.fragPos.z, textureLoad(opaquePassDepthTexture, vec2<i32>(i32(input.fragPos.x), i32(input.fragPos.y)), 0));\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";
36
- var volumeCopyFragTemplate = "\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n[[stage(fragment)]]\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n var computedColor: vec4<f32> = textureSample(volumePassSmallColorTexture,\n volumePassSmallColorTextureSampler, input.tcoordVS);\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";
37
+ var volumeCopyFragTemplate = "\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n[[stage(fragment)]]\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n var computedColor: vec4<f32> = textureSample(volumePassSmallColorTexture,\n volumePassSmallColorTextureSampler, mapperUBO.tscale*input.tcoordVS);\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";
37
38
  /* eslint-disable no-undef */
38
39
 
39
40
  /* eslint-disable no-bitwise */
@@ -44,14 +45,14 @@ function vtkWebGPUVolumePass(publicAPI, model) {
44
45
  model.classHierarchy.push('vtkWebGPUVolumePass'); // create the required textures, encoders, FSQ etc
45
46
 
46
47
  publicAPI.initialize = function (viewNode) {
47
- if (!model._mergeEncoder) {
48
- publicAPI.createMergeEncoder(viewNode);
49
- }
50
-
51
48
  if (!model._clearEncoder) {
52
49
  publicAPI.createClearEncoder(viewNode);
53
50
  }
54
51
 
52
+ if (!model._mergeEncoder) {
53
+ publicAPI.createMergeEncoder(viewNode);
54
+ }
55
+
55
56
  if (!model._copyEncoder) {
56
57
  publicAPI.createCopyEncoder(viewNode);
57
58
  }
@@ -74,6 +75,16 @@ function vtkWebGPUVolumePass(publicAPI, model) {
74
75
  model._volumeCopyQuad.setDevice(viewNode.getDevice());
75
76
 
76
77
  model._volumeCopyQuad.setFragmentShaderTemplate(volumeCopyFragTemplate);
78
+
79
+ model._copyUBO = vtkWebGPUUniformBuffer.newInstance();
80
+
81
+ model._copyUBO.setName('mapperUBO');
82
+
83
+ model._copyUBO.addEntry('tscale', 'vec2<f32>');
84
+
85
+ model._volumeCopyQuad.setUBO(model._copyUBO);
86
+
87
+ model._volumeCopyQuad.setTextureViews([model._colorTextureView]);
77
88
  }
78
89
  };
79
90
 
@@ -136,13 +147,7 @@ function vtkWebGPUVolumePass(publicAPI, model) {
136
147
  // if not rendering in chunks then just draw all of them at once
137
148
  publicAPI.rayCastPass(viewNode, renNode, model.volumes);
138
149
  } // copy back to the original color buffer
139
-
140
-
141
- if (model.small) {
142
- model._volumeCopyQuad.setTextureViews([model._smallColorTextureView]);
143
- } else {
144
- model._volumeCopyQuad.setTextureViews([model._largeColorTextureView]);
145
- } // final composite
150
+ // final composite
146
151
 
147
152
 
148
153
  model._copyEncoder.setColorTextureView(0, model.colorTextureView);
@@ -157,6 +162,18 @@ function vtkWebGPUVolumePass(publicAPI, model) {
157
162
 
158
163
  model._volumeCopyQuad.setWebGPURenderer(renNode);
159
164
 
165
+ if (model._useSmallViewport) {
166
+ var width = model._colorTextureView.getTexture().getWidth();
167
+
168
+ var height = model._colorTextureView.getTexture().getHeight();
169
+
170
+ model._copyUBO.setArray('tscale', [model._smallViewportWidth / width, model._smallViewportHeight / height]);
171
+ } else {
172
+ model._copyUBO.setArray('tscale', [1.0, 1.0]);
173
+ }
174
+
175
+ model._copyUBO.sendIfNeeded(device);
176
+
160
177
  model._volumeCopyQuad.render(model._copyEncoder, viewNode.getDevice());
161
178
 
162
179
  model._copyEncoder.end();
@@ -172,47 +189,38 @@ function vtkWebGPUVolumePass(publicAPI, model) {
172
189
  }, publicAPI.delete);
173
190
 
174
191
  publicAPI.computeTiming = function (viewNode) {
175
- model.small = false;
192
+ model._useSmallViewport = false;
176
193
  var rwi = viewNode.getRenderable().getInteractor();
177
194
 
178
195
  if (rwi.isAnimating() && model._lastScale > 1.5) {
179
- model.small = true;
180
- }
181
-
182
- if (model.small) {
183
- model._activeColorTextureView = model._smallColorTextureView;
184
- } else {
185
- model._largeColorTexture.resize(viewNode.getCanvas().width, viewNode.getCanvas().height);
196
+ if (!model._smallViewportHeight) {
197
+ model._smallViewportWidth = Math.ceil(viewNode.getCanvas().width / Math.sqrt(model._lastScale));
198
+ model._smallViewportHeight = Math.ceil(viewNode.getCanvas().height / Math.sqrt(model._lastScale));
199
+ }
186
200
 
187
- model._activeColorTextureView = model._largeColorTextureView;
201
+ model._useSmallViewport = true;
188
202
  }
189
203
 
204
+ model._colorTexture.resize(viewNode.getCanvas().width, viewNode.getCanvas().height);
205
+
190
206
  if (!model._animationRateSubscription) {
191
207
  // when the animation frame rate changes recompute the scale factor
192
208
  model._animationRateSubscription = rwi.onAnimationFrameRateUpdate(function () {
193
209
  var frate = rwi.getRecentAnimationFrameRate();
194
- var targetScale = model._lastScale * rwi.getDesiredUpdateRate() / frate; // Do we need a resize? The values below are to provide some stickyness
195
- // so that we are not changing texture size every second. Instead the targhet scale
196
- // has to be a certain amount larger or smaller than the current value to force a
197
- // change in texture size
198
-
199
- if (targetScale > 1.4 * model._lastScale || targetScale < 0.7 * model._lastScale) {
200
- model._lastScale = targetScale; // clamp scale to some reasonable values.
201
- // Below 1.5 we will just be using full resolution as that is close enough
202
- // Above 400 seems like a lot so we limit to that 1/20th per axis
203
-
204
- if (model._lastScale > 400) {
205
- model._lastScale = 400;
206
- }
210
+ var targetScale = model._lastScale * rwi.getDesiredUpdateRate() / frate;
211
+ model._lastScale = targetScale; // clamp scale to some reasonable values.
212
+ // Below 1.5 we will just be using full resolution as that is close enough
213
+ // Above 400 seems like a lot so we limit to that 1/20th per axis
207
214
 
208
- if (model._lastScale < 1.5) {
209
- model._lastScale = 1.5;
210
- } else {
211
- var targetSmallWidth = 64 * Math.ceil(viewNode.getCanvas().width / (Math.sqrt(model._lastScale) * 64));
212
- var targetSmallHeight = Math.ceil(targetSmallWidth * viewNode.getCanvas().height / viewNode.getCanvas().width);
215
+ if (model._lastScale > 400) {
216
+ model._lastScale = 400;
217
+ }
213
218
 
214
- model._smallColorTexture.resize(targetSmallWidth, targetSmallHeight);
215
- }
219
+ if (model._lastScale < 1.5) {
220
+ model._lastScale = 1.5;
221
+ } else {
222
+ model._smallViewportWidth = Math.ceil(viewNode.getCanvas().width / Math.sqrt(model._lastScale));
223
+ model._smallViewportHeight = Math.ceil(viewNode.getCanvas().height / Math.sqrt(model._lastScale));
216
224
  }
217
225
  });
218
226
  }
@@ -220,14 +228,18 @@ function vtkWebGPUVolumePass(publicAPI, model) {
220
228
 
221
229
  publicAPI.rayCastPass = function (viewNode, renNode, volumes) {
222
230
  var encoder = model._firstGroup ? model._clearEncoder : model._mergeEncoder;
223
- encoder.setColorTextureView(0, model._activeColorTextureView);
224
231
  encoder.attachTextureViews();
225
232
  renNode.setRenderEncoder(encoder);
226
233
  encoder.begin(viewNode.getCommandEncoder());
227
234
 
228
- var width = model._activeColorTextureView.getTexture().getWidth();
235
+ var width = model._colorTextureView.getTexture().getWidth();
236
+
237
+ var height = model._colorTextureView.getTexture().getHeight();
229
238
 
230
- var height = model._activeColorTextureView.getTexture().getHeight();
239
+ if (model._useSmallViewport) {
240
+ width = model._smallViewportWidth;
241
+ height = model._smallViewportHeight;
242
+ }
231
243
 
232
244
  encoder.getHandle().setViewport(0, 0, width, height, 0.0, 1.0); // set scissor
233
245
 
@@ -453,35 +465,9 @@ function vtkWebGPUVolumePass(publicAPI, model) {
453
465
  };
454
466
 
455
467
  publicAPI.createClearEncoder = function (viewNode) {
456
- model._smallColorTexture = vtkWebGPUTexture.newInstance(); // multiple of 64 pixels to help with texture alignment/size issues
457
- // as webgpu textures have to be multiples of 256 bytes wide
458
- // for data transfers (just in case)
468
+ model._colorTexture = vtkWebGPUTexture.newInstance();
459
469
 
460
- var targetSmallWidth = 64 * Math.ceil(0.7 * viewNode.getCanvas().width / 64);
461
-
462
- model._smallColorTexture.create(viewNode.getDevice(), {
463
- width: targetSmallWidth,
464
- height: Math.ceil(targetSmallWidth * viewNode.getCanvas().height / viewNode.getCanvas().width),
465
- format: 'bgra8unorm',
466
-
467
- /* eslint-disable no-undef */
468
-
469
- /* eslint-disable no-bitwise */
470
- usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_SRC
471
- });
472
-
473
- model._smallColorTextureView = model._smallColorTexture.createView();
474
-
475
- model._smallColorTextureView.setName('volumePassSmallColorTexture');
476
-
477
- model._smallColorTextureView.addSampler(viewNode.getDevice(), {
478
- minFilter: 'linear',
479
- magFilter: 'linear'
480
- });
481
-
482
- model._largeColorTexture = vtkWebGPUTexture.newInstance();
483
-
484
- model._largeColorTexture.create(viewNode.getDevice(), {
470
+ model._colorTexture.create(viewNode.getDevice(), {
485
471
  width: viewNode.getCanvas().width,
486
472
  height: viewNode.getCanvas().height,
487
473
  format: 'bgra8unorm',
@@ -492,17 +478,19 @@ function vtkWebGPUVolumePass(publicAPI, model) {
492
478
  usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_SRC
493
479
  });
494
480
 
495
- model._largeColorTextureView = model._largeColorTexture.createView();
481
+ model._colorTextureView = model._colorTexture.createView();
496
482
 
497
- model._largeColorTextureView.setName('volumePassSmallColorTexture');
483
+ model._colorTextureView.setName('volumePassSmallColorTexture');
498
484
 
499
- model._largeColorTextureView.addSampler(viewNode.getDevice(), {
485
+ model._colorTextureView.addSampler(viewNode.getDevice(), {
500
486
  minFilter: 'linear',
501
487
  magFilter: 'linear'
502
488
  });
503
489
 
504
490
  model._clearEncoder = vtkWebGPURenderEncoder.newInstance();
505
491
 
492
+ model._clearEncoder.setColorTextureView(0, model._colorTextureView);
493
+
506
494
  model._clearEncoder.setDescription({
507
495
  colorAttachments: [{
508
496
  view: null,
@@ -573,6 +561,8 @@ function vtkWebGPUVolumePass(publicAPI, model) {
573
561
  publicAPI.createMergeEncoder = function (viewNode) {
574
562
  model._mergeEncoder = vtkWebGPURenderEncoder.newInstance();
575
563
 
564
+ model._mergeEncoder.setColorTextureView(0, model._colorTextureView);
565
+
576
566
  model._mergeEncoder.setDescription({
577
567
  colorAttachments: [{
578
568
  view: null,
@@ -1,5 +1,5 @@
1
1
  import macro from '../../../macros.js';
2
- import { g as normalize, e as cross } from '../../../Common/Core/Math/index.js';
2
+ import { l as normalize, j as cross } from '../../../Common/Core/Math/index.js';
3
3
 
4
4
  function eq(v1, v2) {
5
5
  return v1.length === 3 && v2.length === 3 && v1[0] === v2[0] && v1[1] === v2[1] && v1[2] === v2[2];
@@ -1,5 +1,5 @@
1
1
  import macro from '../../macros.js';
2
- import { c as subtract, e as cross, d as dot, m as multiplyScalar, f as add } from '../../Common/Core/Math/index.js';
2
+ import { g as subtract, j as cross, d as dot, t as multiplyScalar, k as add } from '../../Common/Core/Math/index.js';
3
3
 
4
4
  function projectDisplayToLine(x, y, lineOrigin, lineDirection, renderer, glRenderWindow) {
5
5
  var near = glRenderWindow.displayToWorld(x, y, 0, renderer);
@@ -1,6 +1,6 @@
1
1
  import { mat4, vec3 } from 'gl-matrix';
2
2
  import macro from '../../macros.js';
3
- import { e as cross, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
3
+ import { j as cross, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
4
4
 
5
5
  function trackballRotate(prevX, prevY, curX, curY, origin, direction, renderer, glRenderWindow) {
6
6
  var dx = curX - prevX;
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import macro from '../../macros.js';
3
3
  import vtkActor from '../../Rendering/Core/Actor.js';
4
4
  import vtkMapper from '../../Rendering/Core/Mapper.js';
5
- import { z as areEquals, b as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
5
+ import { z as areEquals, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
6
6
  import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
7
7
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
8
8
  import vtkTubeFilter from '../../Filters/General/TubeFilter.js';
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
3
3
  import macro from '../../macros.js';
4
- import { c as subtract, Q as multiplyAccumulate, g as normalize, e as cross } from '../../Common/Core/Math/index.js';
4
+ import { g as subtract, Q as multiplyAccumulate, l as normalize, j as cross } from '../../Common/Core/Math/index.js';
5
5
  import vtkActor from '../../Rendering/Core/Actor.js';
6
6
  import vtkCylinderSource from '../../Filters/Sources/CylinderSource.js';
7
7
  import vtkMapper from '../../Rendering/Core/Mapper.js';
@@ -1,7 +1,7 @@
1
1
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
2
  import macro from '../../macros.js';
3
3
  import vtkProp from '../../Rendering/Core/Prop.js';
4
- import { c as subtract, d as dot } from '../../Common/Core/Math/index.js';
4
+ import { g as subtract, d as dot } from '../../Common/Core/Math/index.js';
5
5
  import { Behavior } from './WidgetRepresentation/Constants.js';
6
6
  import { RenderingTypes } from '../Core/WidgetManager/Constants.js';
7
7
  import { CATEGORIES } from '../../Rendering/Core/Mapper/CoincidentTopologyHelper.js';
@@ -3,7 +3,7 @@ import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
3
3
  import vtkPlanePointManipulator from '../Manipulators/PlaneManipulator.js';
4
4
  import vtkPolyLineRepresentation from '../Representations/PolyLineRepresentation.js';
5
5
  import vtkSphereHandleRepresentation from '../Representations/SphereHandleRepresentation.js';
6
- import { c as subtract, R as angleBetweenVectors } from '../../Common/Core/Math/index.js';
6
+ import { g as subtract, R as angleBetweenVectors } from '../../Common/Core/Math/index.js';
7
7
  import widgetBehavior from './AngleWidget/behavior.js';
8
8
  import generateState from './AngleWidget/state.js';
9
9
  import { ViewTypes } from '../Core/WidgetManager/Constants.js';
@@ -3,7 +3,7 @@ import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
3
3
  import vtkPlanePointManipulator from '../Manipulators/PlaneManipulator.js';
4
4
  import vtkPolyLineRepresentation from '../Representations/PolyLineRepresentation.js';
5
5
  import vtkSphereHandleRepresentation from '../Representations/SphereHandleRepresentation.js';
6
- import { b as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
6
+ import { f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
7
7
  import widgetBehavior from './DistanceWidget/behavior.js';
8
8
  import generateState from './DistanceWidget/state.js';
9
9
  import { ViewTypes } from '../Core/WidgetManager/Constants.js';
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
3
3
  import Constants from './Constants.js';
4
4
  import macro from '../../../macros.js';
5
- import { c as subtract, f as add, g as normalize } from '../../../Common/Core/Math/index.js';
5
+ import { g as subtract, k as add, l as normalize } from '../../../Common/Core/Math/index.js';
6
6
  import { getNumberOfPlacedHandles, isHandlePlaced, calculateTextPosition, updateTextPosition, getPoint } from './helpers.js';
7
7
 
8
8
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -1,4 +1,4 @@
1
- import { c as subtract, m as multiplyScalar, f as add, z as areEquals } from '../../../Common/Core/Math/index.js';
1
+ import { g as subtract, t as multiplyScalar, k as add, z as areEquals } from '../../../Common/Core/Math/index.js';
2
2
 
3
3
  function calculateTextPosition(model) {
4
4
  var vector = [0, 0, 0];
@@ -1,4 +1,4 @@
1
- import { b as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
1
+ import { f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
2
2
  import macro from '../../macros.js';
3
3
  import generateState from './LineWidget/state.js';
4
4
  import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
@@ -3,7 +3,7 @@ import macro from '../../../macros.js';
3
3
  import vtkBoundingBox from '../../../Common/DataModel/BoundingBox.js';
4
4
  import vtkLine from '../../../Common/DataModel/Line.js';
5
5
  import vtkPlanePointManipulator from '../../Manipulators/PlaneManipulator.js';
6
- import { m as multiplyScalar, c as subtract, g as normalize, d as dot, e as cross, Q as multiplyAccumulate, S as signedAngleBetweenVectors } from '../../../Common/Core/Math/index.js';
6
+ import { t as multiplyScalar, g as subtract, l as normalize, d as dot, j as cross, Q as multiplyAccumulate, S as signedAngleBetweenVectors } from '../../../Common/Core/Math/index.js';
7
7
  import { updateState, getAssociatedLinesName, boundPointOnPlane, rotateVector } from './helpers.js';
8
8
  import { InteractionMethodsName, ScrollingMethods } from './Constants.js';
9
9
 
@@ -3,11 +3,11 @@ import vtkBoundingBox, { STATIC } from '../../../Common/DataModel/BoundingBox.js
3
3
  import vtkCubeSource from '../../../Filters/Sources/CubeSource.js';
4
4
  import vtkCutter from '../../../Filters/Core/Cutter.js';
5
5
  import vtkPlane from '../../../Common/DataModel/Plane.js';
6
- import { c as subtract, g as normalize, e as cross, Q as multiplyAccumulate, S as signedAngleBetweenVectors } from '../../../Common/Core/Math/index.js';
6
+ import { g as subtract, l as normalize, j as cross, t as multiplyScalar, Q as multiplyAccumulate, S as signedAngleBetweenVectors } from '../../../Common/Core/Math/index.js';
7
7
  import vtkMatrixBuilder from '../../../Common/Core/MatrixBuilder.js';
8
8
  import { ViewTypes } from '../../Core/WidgetManager/Constants.js';
9
9
 
10
- var EPSILON = 0.00001;
10
+ var EPSILON = 10e-7;
11
11
  /**
12
12
  * Fit the plane defined by origin, p1, p2 onto the bounds.
13
13
  * Plane is untouched if does not intersect bounds.
@@ -15,6 +15,7 @@ var EPSILON = 0.00001;
15
15
  * @param {Array} origin
16
16
  * @param {Array} p1
17
17
  * @param {Array} p2
18
+ * @return {Boolean} false if no bounds have been found, else true
18
19
  */
19
20
 
20
21
  function boundPlane(bounds, origin, p1, p2) {
@@ -26,19 +27,26 @@ function boundPlane(bounds, origin, p1, p2) {
26
27
  normalize(v2);
27
28
  var n = [0, 0, 1];
28
29
  cross(v1, v2, n);
29
- normalize(n);
30
+ normalize(n); // Inflate bounds in order to avoid precision error when cutting cubesource
31
+
32
+ var inflatedBounds = _toConsumableArray(bounds);
33
+
34
+ var eps = [].concat(n);
35
+ multiplyScalar(eps, EPSILON);
36
+ vtkBoundingBox.addBounds(inflatedBounds, bounds[0] + eps[0], bounds[1] + eps[0], bounds[2] + eps[1], bounds[3] + eps[1], bounds[4] + eps[2], bounds[5] + eps[2]);
37
+ vtkBoundingBox.addBounds(inflatedBounds, bounds[0] - eps[0], bounds[1] - eps[0], bounds[2] - eps[1], bounds[3] - eps[1], bounds[4] - eps[2], bounds[5] - eps[2]);
30
38
  var plane = vtkPlane.newInstance();
31
39
  plane.setOrigin.apply(plane, _toConsumableArray(origin));
32
40
  plane.setNormal.apply(plane, n);
33
41
  var cubeSource = vtkCubeSource.newInstance();
34
- cubeSource.setBounds(bounds);
42
+ cubeSource.setBounds(inflatedBounds);
35
43
  var cutter = vtkCutter.newInstance();
36
44
  cutter.setCutFunction(plane);
37
45
  cutter.setInputConnection(cubeSource.getOutputPort());
38
46
  var cutBounds = cutter.getOutputData();
39
47
 
40
48
  if (cutBounds.getNumberOfPoints() === 0) {
41
- return;
49
+ return false;
42
50
  }
43
51
 
44
52
  var localBounds = STATIC.computeLocalBounds(cutBounds.getPoints(), v1, v2, n);
@@ -48,6 +56,8 @@ function boundPlane(bounds, origin, p1, p2) {
48
56
  p1[i] = localBounds[1] * v1[i] + localBounds[2] * v2[i] + localBounds[4] * n[i];
49
57
  p2[i] = localBounds[0] * v1[i] + localBounds[3] * v2[i] + localBounds[4] * n[i];
50
58
  }
59
+
60
+ return true;
51
61
  } // Project point (inPoint) to the bounds of the image according to a plane
52
62
  // defined by two vectors (v1, v2)
53
63
 
@@ -4,7 +4,7 @@ import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
4
4
  import vtkPlane from '../../Common/DataModel/Plane.js';
5
5
  import vtkPlaneSource from '../../Filters/Sources/PlaneSource.js';
6
6
  import vtkResliceCursorContextRepresentation from '../Representations/ResliceCursorContextRepresentation.js';
7
- import { b as distance2BetweenPoints, Q as multiplyAccumulate, c as subtract, g as normalize, m as multiplyScalar, f as add } from '../../Common/Core/Math/index.js';
7
+ import { f as distance2BetweenPoints, Q as multiplyAccumulate, g as subtract, l as normalize, t as multiplyScalar, k as add } from '../../Common/Core/Math/index.js';
8
8
  import widgetBehavior from './ResliceCursorWidget/behavior.js';
9
9
  import generateState from './ResliceCursorWidget/state.js';
10
10
  import { updateState, transformPlane, boundPlane } from './ResliceCursorWidget/helpers.js';
@@ -1,7 +1,7 @@
1
1
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
2
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
3
  import macro from '../../../macros.js';
4
- import { l as vtkMath } from '../../../Common/Core/Math/index.js';
4
+ import { q as vtkMath } from '../../../Common/Core/Math/index.js';
5
5
  import vtkBoundingBox from '../../../Common/DataModel/BoundingBox.js';
6
6
  import vtkPlane from '../../../Common/DataModel/Plane.js';
7
7
  import { ShapeBehavior, BehaviorCategory, TextPosition } from './Constants.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "22.1.2",
3
+ "version": "22.1.6",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",