@kitware/vtk.js 34.4.0 → 34.6.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.
Files changed (66) hide show
  1. package/Common/Core/CellArray.d.ts +3 -0
  2. package/Common/Core/CellArray.js +12 -1
  3. package/Common/Core/DataArray.d.ts +15 -0
  4. package/Common/Core/DataArray.js +8 -4
  5. package/Common/Core/Math/index.js +1 -1
  6. package/Common/Core/Math.js +1 -1
  7. package/Common/DataModel/Triangle.d.ts +68 -19
  8. package/Common/DataModel/Triangle.js +140 -1
  9. package/Common/DataModel/TriangleStrip.d.ts +180 -0
  10. package/Common/DataModel/TriangleStrip.js +396 -0
  11. package/Common/DataModel.js +3 -1
  12. package/Common/Transform/LandmarkTransform.js +1 -1
  13. package/Common/Transform/Transform.d.ts +112 -1
  14. package/Common/Transform/Transform.js +301 -2
  15. package/Filters/Core/Cutter.js +41 -0
  16. package/Filters/General/OBBTree.js +1 -1
  17. package/Filters/General/TransformPolyDataFilter.d.ts +75 -0
  18. package/Filters/General/TransformPolyDataFilter.js +194 -0
  19. package/Filters/General.js +2 -0
  20. package/Filters/Sources/CircleSource.js +1 -1
  21. package/Filters/Sources/PointSource.js +1 -1
  22. package/Filters/Texture/TextureMapToPlane.js +1 -1
  23. package/IO/Geometry/DracoReader.js +1 -1
  24. package/IO/Geometry/GLTFImporter/Animations.js +1 -1
  25. package/IO/Geometry/GLTFImporter/Reader.js +2 -2
  26. package/IO/Image/HDRReader/Utils.js +1 -1
  27. package/IO/Image/HDRReader.js +1 -1
  28. package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.js +1 -1
  29. package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -1
  30. package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -1
  31. package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
  32. package/Interaction/Style/InteractorStyleTrackballCamera.js +1 -1
  33. package/Interaction/Widgets/PiecewiseGaussianWidget.js +1 -1
  34. package/Proxy/Core/View2DProxy.js +1 -1
  35. package/Rendering/Core/AbstractImageMapper.js +1 -1
  36. package/Rendering/Core/AbstractMapper3D.js +1 -1
  37. package/Rendering/Core/ColorTransferFunction/CssFilters.js +1 -1
  38. package/Rendering/Core/ColorTransferFunction.js +1 -1
  39. package/Rendering/Core/Coordinate.js +1 -1
  40. package/Rendering/Core/CubeAxesActor.js +1 -1
  41. package/Rendering/Core/Glyph3DMapper.js +1 -1
  42. package/Rendering/Core/ImageArrayMapper.js +1 -1
  43. package/Rendering/Core/ImageMapper.js +1 -1
  44. package/Rendering/Core/ImageProperty.d.ts +10 -4
  45. package/Rendering/Core/Mapper.js +1 -1
  46. package/Rendering/Core/Mapper2D.js +362 -8
  47. package/Rendering/Core/Prop3D.js +1 -1
  48. package/Rendering/Core/RenderWindowInteractor.js +3 -3
  49. package/Rendering/Core/Renderer.js +1 -1
  50. package/Rendering/Core/ScalarBarActor.js +1 -1
  51. package/Rendering/Core/TextActor.js +1 -1
  52. package/Rendering/Core/VectorText/Utils.js +1 -1
  53. package/Rendering/Core/VolumeProperty.js +1 -1
  54. package/Rendering/OpenGL/ImageMapper.js +90 -20
  55. package/Rendering/OpenGL/PolyDataMapper2D.js +89 -30
  56. package/Rendering/OpenGL/Texture.js +1 -1
  57. package/Rendering/OpenGL/VolumeMapper.js +21 -19
  58. package/Widgets/Manipulators/LineManipulator.js +1 -1
  59. package/Widgets/Representations/PolyLineRepresentation.js +1 -1
  60. package/Widgets/Widgets3D/AngleWidget.js +1 -1
  61. package/Widgets/Widgets3D/LineWidget/helpers.js +1 -1
  62. package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
  63. package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
  64. package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -1
  65. package/index.d.ts +2 -0
  66. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { m as macro } from '../../macros2.js';
2
2
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
3
3
  import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
4
- import { w as multiplyScalar } from '../../Common/Core/Math/index.js';
4
+ import { x as multiplyScalar } from '../../Common/Core/Math/index.js';
5
5
 
6
6
  // ----------------------------------------------------------------------------
7
7
  // vtkCircleSource methods
@@ -1,5 +1,5 @@
1
1
  import { m as macro } from '../../macros2.js';
2
- import { x as random } from '../../Common/Core/Math/index.js';
2
+ import { y as random } from '../../Common/Core/Math/index.js';
3
3
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
4
4
 
5
5
  // ----------------------------------------------------------------------------
@@ -1,6 +1,6 @@
1
1
  import { m as macro } from '../../macros2.js';
2
2
  import vtkDataArray from '../../Common/Core/DataArray.js';
3
- import { l as normalize, d as dot, j as cross, e as distance2BetweenPoints, y as determinant3x3, z as rowsToMat3 } from '../../Common/Core/Math/index.js';
3
+ import { l as normalize, d as dot, j as cross, e as distance2BetweenPoints, z as determinant3x3, A as rowsToMat3 } from '../../Common/Core/Math/index.js';
4
4
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
5
5
 
6
6
  const {
@@ -137,7 +137,7 @@ function getPolyDataFromDracoGeometry(decoder, dracoGeometry) {
137
137
  const indices = decodeIndices(decoder, dracoGeometry);
138
138
  const nCells = indices.length - 2;
139
139
  const cells = vtkCellArray.newInstance();
140
- cells.resize(4 * indices.length / 3);
140
+ cells.allocate(4 * indices.length / 3);
141
141
  for (let cellId = 0; cellId < nCells; cellId += 3) {
142
142
  const cell = indices.slice(cellId, cellId + 3);
143
143
  cells.insertNextCell(cell);
@@ -1,5 +1,5 @@
1
1
  import { m as macro } from '../../../macros2.js';
2
- import { A as degreesFromRadians } from '../../../Common/Core/Math/index.js';
2
+ import { B as degreesFromRadians } from '../../../Common/Core/Math/index.js';
3
3
  import { quat, vec3 } from 'gl-matrix';
4
4
 
5
5
  const {
@@ -1,5 +1,5 @@
1
1
  import { m as macro } from '../../../macros2.js';
2
- import { A as degreesFromRadians } from '../../../Common/Core/Math/index.js';
2
+ import { B as degreesFromRadians } from '../../../Common/Core/Math/index.js';
3
3
  import vtkActor from '../../../Rendering/Core/Actor.js';
4
4
  import vtkCamera from '../../../Rendering/Core/Camera.js';
5
5
  import vtkDataArray from '../../../Common/Core/DataArray.js';
@@ -125,7 +125,7 @@ async function createPolyDataFromGLTFMesh(primitive) {
125
125
  vtkWarningMacro('GL_LINE_LOOP not implemented');
126
126
  break;
127
127
  default:
128
- cells.resize(4 * indices.length / 3);
128
+ cells.allocate(4 * indices.length / 3);
129
129
  for (let cellId = 0; cellId < nCells; cellId += 3) {
130
130
  const cell = indices.slice(cellId, cellId + 3);
131
131
  cells.insertNextCell(cell);
@@ -1,4 +1,4 @@
1
- import { B as ldexp } from '../../../Common/Core/Math/index.js';
1
+ import { C as ldexp } from '../../../Common/Core/Math/index.js';
2
2
 
3
3
  /**
4
4
  * Read a line from a Uint8Array
@@ -1,7 +1,7 @@
1
1
  import '../Core/DataAccessHelper/LiteHttpDataAccessHelper.js';
2
2
  import { m as macro } from '../../macros2.js';
3
3
  import DataAccessHelper from '../Core/DataAccessHelper.js';
4
- import { C as xyz2rgb } from '../../Common/Core/Math/index.js';
4
+ import { D as xyz2rgb } from '../../Common/Core/Math/index.js';
5
5
  import vtkImageData from '../../Common/DataModel/ImageData.js';
6
6
  import vtkDataArray from '../../Common/Core/DataArray.js';
7
7
  import { readLine, rgbe2float } from './HDRReader/Utils.js';
@@ -2,7 +2,7 @@ import { mat4, vec3 } from 'gl-matrix';
2
2
  import { m as macro } from '../../macros2.js';
3
3
  import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
4
4
  import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
5
- import { r as radiansFromDegrees, A as degreesFromRadians } from '../../Common/Core/Math/index.js';
5
+ import { r as radiansFromDegrees, B as degreesFromRadians } from '../../Common/Core/Math/index.js';
6
6
 
7
7
  // ----------------------------------------------------------------------------
8
8
  // vtkMouseCameraTrackballRollManipulator methods
@@ -2,7 +2,7 @@ import { mat4, vec3 } from 'gl-matrix';
2
2
  import { m as macro } from '../../macros2.js';
3
3
  import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
4
4
  import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
5
- import { w as multiplyScalar, d as dot, k as add, r as radiansFromDegrees, j as cross } from '../../Common/Core/Math/index.js';
5
+ import { x as multiplyScalar, d as dot, k as add, r as radiansFromDegrees, j as cross } from '../../Common/Core/Math/index.js';
6
6
 
7
7
  // ----------------------------------------------------------------------------
8
8
  // vtkMouseCameraTrackballRotateManipulator methods
@@ -3,7 +3,7 @@ import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
3
3
  import vtkInteractorStyleConstants from '../../Rendering/Core/InteractorStyle/Constants.js';
4
4
  import vtkMouseCameraUnicamRotateManipulator from './MouseCameraUnicamRotateManipulator.js';
5
5
  import { m as macro } from '../../macros2.js';
6
- import { s as subtract, w as multiplyScalar, l as normalize, d as dot, r as radiansFromDegrees, j as cross } from '../../Common/Core/Math/index.js';
6
+ import { s as subtract, x as multiplyScalar, l as normalize, d as dot, r as radiansFromDegrees, j as cross } from '../../Common/Core/Math/index.js';
7
7
 
8
8
  const {
9
9
  States
@@ -8,7 +8,7 @@ import vtkSphereSource from '../../Filters/Sources/SphereSource.js';
8
8
  import { FieldAssociations } from '../../Common/DataModel/DataSet/Constants.js';
9
9
  import { mat4, vec3 } from 'gl-matrix';
10
10
  import { m as macro } from '../../macros2.js';
11
- import { D as areEquals, l as normalize, d as dot, E as clampValue, s as subtract, j as cross, w as multiplyScalar, e as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
11
+ import { E as areEquals, l as normalize, d as dot, F as clampValue, s as subtract, j as cross, x as multiplyScalar, e as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
12
12
 
13
13
  const {
14
14
  States
@@ -1,7 +1,7 @@
1
1
  import { m as macro } from '../../macros2.js';
2
2
  import vtkInteractorStyle from '../../Rendering/Core/InteractorStyle.js';
3
3
  import vtkInteractorStyleConstants from '../../Rendering/Core/InteractorStyle/Constants.js';
4
- import { A as degreesFromRadians } from '../../Common/Core/Math/index.js';
4
+ import { B as degreesFromRadians } from '../../Common/Core/Math/index.js';
5
5
  import { Device, Input } from '../../Rendering/Core/RenderWindowInteractor/Constants.js';
6
6
 
7
7
  const {
@@ -1,5 +1,5 @@
1
1
  import { m as macro } from '../../macros2.js';
2
- import { F as arrayRange } from '../../Common/Core/Math/index.js';
2
+ import { G as arrayRange } from '../../Common/Core/Math/index.js';
3
3
  import WebworkerPromise from 'webworker-promise';
4
4
  import { W as WorkerFactory } from '../../_virtual/rollup-plugin-worker-loader__module_Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js';
5
5
 
@@ -1,7 +1,7 @@
1
1
  import { m as macro } from '../../macros2.js';
2
2
  import vtkMouseRangeManipulator from '../../Interaction/Manipulators/MouseRangeManipulator.js';
3
3
  import vtkViewProxy from './ViewProxy.js';
4
- import { j as cross, G as getMajorAxisIndex, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
4
+ import { j as cross, H as getMajorAxisIndex, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
5
5
  import { mat4, vec3 } from 'gl-matrix';
6
6
  import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
7
7
 
@@ -1,6 +1,6 @@
1
1
  import { m as macro } from '../../macros2.js';
2
2
  import vtkAbstractMapper3D from './AbstractMapper3D.js';
3
- import { H as createUninitializedBounds } from '../../Common/Core/Math/index.js';
3
+ import { I as createUninitializedBounds } from '../../Common/Core/Math/index.js';
4
4
 
5
5
  // ----------------------------------------------------------------------------
6
6
  // vtkAbstractImageMapper methods
@@ -1,7 +1,7 @@
1
1
  import { m as macro } from '../../macros2.js';
2
2
  import vtkAbstractMapper from './AbstractMapper.js';
3
3
  import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
4
- import { H as createUninitializedBounds } from '../../Common/Core/Math/index.js';
4
+ import { I as createUninitializedBounds } from '../../Common/Core/Math/index.js';
5
5
 
6
6
  // ----------------------------------------------------------------------------
7
7
  // vtkAbstractMapper methods
@@ -1,4 +1,4 @@
1
- import { I as identity, J as multiplyMatrix } from '../../../Common/Core/Math/index.js';
1
+ import { J as identity, K as multiplyMatrix } from '../../../Common/Core/Math/index.js';
2
2
 
3
3
  /**
4
4
  * A helper file to transform RGBA points using CSS filters equivalent
@@ -1,5 +1,5 @@
1
1
  import { m as macro } from '../../macros2.js';
2
- import { h as hsv2rgb, i as isNan, K as floor, L as isInf, M as rgb2hsv, N as rgb2lab, O as lab2rgb } from '../../Common/Core/Math/index.js';
2
+ import { h as hsv2rgb, i as isNan, L as floor, M as isInf, N as rgb2hsv, O as rgb2lab, P as lab2rgb } from '../../Common/Core/Math/index.js';
3
3
  import vtkScalarsToColors from '../../Common/Core/ScalarsToColors.js';
4
4
  import Constants from './ColorTransferFunction/Constants.js';
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { m as macro } from '../../macros2.js';
2
2
  import Constants from './Coordinate/Constants.js';
3
- import { P as round, K as floor } from '../../Common/Core/Math/index.js';
3
+ import { Q as round, L as floor } from '../../Common/Core/Math/index.js';
4
4
 
5
5
  const {
6
6
  Coordinate
@@ -1,6 +1,6 @@
1
1
  import { vec3, mat4 } from 'gl-matrix';
2
2
  import * as d3 from 'd3-scale';
3
- import { Q as normalize2D, R as nearestPowerOfTwo } from '../../Common/Core/Math/index.js';
3
+ import { R as normalize2D, S as nearestPowerOfTwo } from '../../Common/Core/Math/index.js';
4
4
  import { m as macro } from '../../macros2.js';
5
5
  import vtkActor from './Actor.js';
6
6
  import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
@@ -2,7 +2,7 @@ import { mat4, vec3, mat3 } from 'gl-matrix';
2
2
  import Constants from './Glyph3DMapper/Constants.js';
3
3
  import { m as macro } from '../../macros2.js';
4
4
  import vtkMapper from './Mapper.js';
5
- import { H as createUninitializedBounds, n as norm } from '../../Common/Core/Math/index.js';
5
+ import { I as createUninitializedBounds, n as norm } from '../../Common/Core/Math/index.js';
6
6
  import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
7
7
 
8
8
  const {
@@ -1,7 +1,7 @@
1
1
  import { m as macro } from '../../macros2.js';
2
2
  import vtkAbstractImageMapper from './AbstractImageMapper.js';
3
3
  import vtkImageMapper from './ImageMapper.js';
4
- import { H as createUninitializedBounds } from '../../Common/Core/Math/index.js';
4
+ import { I as createUninitializedBounds } from '../../Common/Core/Math/index.js';
5
5
  import { intersectWithLineForPointPicking, intersectWithLineForCellPicking } from './AbstractImageMapper/helper.js';
6
6
  import CoincidentTopologyHelper from './Mapper/CoincidentTopologyHelper.js';
7
7
 
@@ -2,7 +2,7 @@ import Constants from './ImageMapper/Constants.js';
2
2
  import { m as macro } from '../../macros2.js';
3
3
  import vtkAbstractImageMapper from './AbstractImageMapper.js';
4
4
  import { intersectWithLineForPointPicking, intersectWithLineForCellPicking } from './AbstractImageMapper/helper.js';
5
- import { E as clampValue, S as multiply3x3_vect3, H as createUninitializedBounds, T as getSparseOrthogonalMatrix } from '../../Common/Core/Math/index.js';
5
+ import { F as clampValue, T as multiply3x3_vect3, I as createUninitializedBounds, U as getSparseOrthogonalMatrix } from '../../Common/Core/Math/index.js';
6
6
  import CoincidentTopologyHelper from './Mapper/CoincidentTopologyHelper.js';
7
7
 
8
8
  const {
@@ -106,15 +106,21 @@ export interface vtkImageProperty extends vtkObject {
106
106
  getUseLabelOutline(): boolean;
107
107
 
108
108
  /**
109
- * Set the 0 to 1 opacity of the label outline.
110
- * @param {Number} opacity
109
+ * Set opacity of the label outline.
110
+ *
111
+ * Opacity must be between 0 and 1.
112
+ * If the given opacity is a number, the opacity will apply to all outline segments.
113
+ * If the given opacity is an array of numbers, each opacity value will apply to the
114
+ * label equal to the opacity value's index + 1. (This is the same behavior as setLabelOutlineThickness).
115
+ *
116
+ * @param {Number | Number[]} opacity
111
117
  */
112
- setLabelOutlineOpacity(opacity: number): boolean;
118
+ setLabelOutlineOpacity(opacity: number | number[]): boolean;
113
119
 
114
120
  /**
115
121
  * Get the 0 to 1 opacity of the label outline.
116
122
  */
117
- getLabelOutlineOpacity(): number;
123
+ getLabelOutlineOpacity(): number | number[];
118
124
 
119
125
  /**
120
126
  * gets the label outline thickness
@@ -3,7 +3,7 @@ import vtkAbstractMapper3D from './AbstractMapper3D.js';
3
3
  import vtkDataArray from '../../Common/Core/DataArray.js';
4
4
  import vtkImageData from '../../Common/DataModel/ImageData.js';
5
5
  import vtkLookupTable from '../../Common/Core/LookupTable.js';
6
- import { H as createUninitializedBounds, i as isNan } from '../../Common/Core/Math/index.js';
6
+ import { I as createUninitializedBounds, i as isNan } from '../../Common/Core/Math/index.js';
7
7
  import vtkScalarsToColors from '../../Common/Core/ScalarsToColors/Constants.js';
8
8
  import CoincidentTopologyHelper from './Mapper/CoincidentTopologyHelper.js';
9
9
  import Constants from './Mapper/Constants.js';