@kitware/vtk.js 24.5.1 → 24.5.4

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 (192) hide show
  1. package/Common/Core/Base64.d.ts +4 -2
  2. package/Common/Core/CellArray.d.ts +2 -2
  3. package/Common/Core/DataArray.d.ts +2 -2
  4. package/Common/Core/Endian.d.ts +1 -1
  5. package/Common/Core/ImageHelper.d.ts +1 -1
  6. package/Common/Core/LookupTable.d.ts +1 -1
  7. package/Common/Core/Math/index.js +1 -1
  8. package/Common/Core/Math.d.ts +1 -1
  9. package/Common/Core/Math.js +1 -1
  10. package/Common/Core/MatrixBuilder.d.ts +1 -1
  11. package/Common/Core/Points.d.ts +2 -2
  12. package/Common/Core/PriorityQueue.d.ts +1 -1
  13. package/Common/Core/ProgressHandler.d.ts +1 -1
  14. package/Common/Core/ScalarsToColors.d.ts +3 -3
  15. package/Common/Core/StringArray.d.ts +1 -1
  16. package/Common/Core/VariantArray.d.ts +1 -1
  17. package/Common/DataModel/Box.d.ts +2 -2
  18. package/Common/DataModel/CardinalSpline1D.d.ts +1 -1
  19. package/Common/DataModel/Cell.d.ts +3 -3
  20. package/Common/DataModel/Cone.d.ts +2 -2
  21. package/Common/DataModel/Cylinder.d.ts +2 -2
  22. package/Common/DataModel/DataSet.d.ts +1 -1
  23. package/Common/DataModel/DataSetAttributes/FieldData.d.ts +4 -2
  24. package/Common/DataModel/DataSetAttributes.d.ts +3 -3
  25. package/Common/DataModel/ImageData.d.ts +1 -1
  26. package/Common/DataModel/Line.d.ts +1 -1
  27. package/Common/DataModel/PiecewiseFunction.d.ts +2 -2
  28. package/Common/DataModel/Plane.d.ts +2 -2
  29. package/Common/DataModel/PointSet.d.ts +2 -2
  30. package/Common/DataModel/PolyData.d.ts +2 -2
  31. package/Common/DataModel/Polygon.d.ts +2 -2
  32. package/Common/DataModel/SelectionNode.d.ts +2 -2
  33. package/Common/DataModel/Sphere.d.ts +2 -2
  34. package/Common/DataModel/Spline1D.d.ts +1 -1
  35. package/Common/DataModel/Spline3D.d.ts +1 -1
  36. package/Common/DataModel/Triangle.d.ts +1 -1
  37. package/Common/DataModel/Triangle.js +1 -1
  38. package/Common/Transform/LandmarkTransform.d.ts +2 -2
  39. package/Common/Transform/LandmarkTransform.js +1 -1
  40. package/Filters/Core/PolyDataNormals.js +1 -1
  41. package/Filters/General/AppendPolyData.d.ts +1 -1
  42. package/Filters/General/ImageCropFilter.d.ts +1 -1
  43. package/Filters/General/ImageOutlineFilter.d.ts +1 -1
  44. package/Filters/General/ImageSliceFilter.d.ts +1 -1
  45. package/Filters/General/ImageStreamline.d.ts +3 -3
  46. package/Filters/General/LineFilter.d.ts +1 -1
  47. package/Filters/General/OBBTree.js +1 -1
  48. package/Filters/General/OutlineFilter.d.ts +1 -1
  49. package/Filters/General/TriangleFilter.d.ts +1 -1
  50. package/Filters/General/TubeFilter.d.ts +2 -2
  51. package/Filters/General/WindowedSincPolyDataFilter.js +1 -1
  52. package/Filters/Sources/Arrow2DSource.d.ts +2 -2
  53. package/Filters/Sources/ArrowSource.d.ts +2 -2
  54. package/Filters/Sources/CircleSource.d.ts +2 -2
  55. package/Filters/Sources/CircleSource.js +1 -1
  56. package/Filters/Sources/ConeSource.d.ts +2 -2
  57. package/Filters/Sources/CubeSource.d.ts +2 -2
  58. package/Filters/Sources/Cursor3D.d.ts +3 -3
  59. package/Filters/Sources/CylinderSource.d.ts +2 -2
  60. package/Filters/Sources/LineSource.d.ts +2 -2
  61. package/Filters/Sources/PlaneSource.d.ts +2 -2
  62. package/Filters/Sources/PointSource.d.ts +2 -2
  63. package/Filters/Sources/PointSource.js +1 -1
  64. package/Filters/Sources/SphereSource.d.ts +2 -2
  65. package/Filters/Texture/TextureMapToPlane.d.ts +1 -1
  66. package/Filters/Texture/TextureMapToPlane.js +1 -1
  67. package/Filters/Texture/TextureMapToSphere.d.ts +1 -1
  68. package/IO/Core/DataAccessHelper.d.ts +4 -4
  69. package/IO/Core/HttpDataSetReader.d.ts +1 -1
  70. package/IO/Core/HttpSceneLoader.d.ts +5 -5
  71. package/IO/Core/ImageStream/DefaultProtocol.d.ts +1 -1
  72. package/IO/Core/ImageStream/ViewStream.d.ts +4 -4
  73. package/IO/Core/ImageStream.d.ts +3 -3
  74. package/IO/Core/WSLinkClient.d.ts +1 -1
  75. package/IO/Geometry/DracoReader.d.ts +5 -5
  76. package/IO/Geometry/PLYReader.d.ts +5 -5
  77. package/IO/Geometry/PLYWriter.d.ts +2 -2
  78. package/IO/Geometry/STLReader.d.ts +5 -5
  79. package/IO/Geometry/STLWriter.d.ts +2 -2
  80. package/IO/Misc/ElevationReader.d.ts +5 -5
  81. package/IO/Misc/ITKImageReader.d.ts +1 -1
  82. package/IO/Misc/ITKPolyDataReader.d.ts +1 -1
  83. package/IO/Misc/JSONNucleoReader.d.ts +5 -5
  84. package/IO/Misc/JSONReader.d.ts +1 -1
  85. package/IO/Misc/MTLReader.d.ts +6 -6
  86. package/IO/Misc/OBJReader.d.ts +5 -5
  87. package/IO/Misc/PDBReader.d.ts +5 -5
  88. package/IO/XML/XMLReader.d.ts +5 -5
  89. package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.js +1 -1
  90. package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -1
  91. package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -1
  92. package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
  93. package/Interaction/Style/InteractorStyleTrackballCamera.js +1 -1
  94. package/Interaction/Widgets/OrientationMarkerWidget.d.ts +6 -6
  95. package/Interaction/Widgets/PiecewiseGaussianWidget.js +1 -1
  96. package/Proxy/Core/View2DProxy.js +1 -1
  97. package/Rendering/Core/AbstractMapper.d.ts +2 -2
  98. package/Rendering/Core/AbstractMapper3D.d.ts +1 -1
  99. package/Rendering/Core/AbstractPicker.d.ts +2 -2
  100. package/Rendering/Core/Actor.d.ts +1 -1
  101. package/Rendering/Core/Actor2D.d.ts +1 -1
  102. package/Rendering/Core/Camera.d.ts +2 -2
  103. package/Rendering/Core/CellPicker.d.ts +2 -2
  104. package/Rendering/Core/ColorTransferFunction.d.ts +1 -1
  105. package/Rendering/Core/ColorTransferFunction.js +1 -1
  106. package/Rendering/Core/Coordinate.d.ts +1 -1
  107. package/Rendering/Core/Coordinate.js +1 -1
  108. package/Rendering/Core/CubeAxesActor.js +1 -1
  109. package/Rendering/Core/Glyph3DMapper.d.ts +1 -1
  110. package/Rendering/Core/Glyph3DMapper.js +1 -1
  111. package/Rendering/Core/ImageMapper.d.ts +1 -1
  112. package/Rendering/Core/ImageMapper.js +1 -1
  113. package/Rendering/Core/ImageProperty.d.ts +1 -1
  114. package/Rendering/Core/ImageSlice.d.ts +1 -1
  115. package/Rendering/Core/Light.d.ts +2 -2
  116. package/Rendering/Core/Mapper.d.ts +1 -1
  117. package/Rendering/Core/Mapper.js +1 -1
  118. package/Rendering/Core/Mapper2D.d.ts +1 -1
  119. package/Rendering/Core/Picker.d.ts +1 -1
  120. package/Rendering/Core/PointPicker.d.ts +1 -1
  121. package/Rendering/Core/Prop.d.ts +1 -1
  122. package/Rendering/Core/Prop3D.d.ts +1 -1
  123. package/Rendering/Core/Prop3D.js +1 -1
  124. package/Rendering/Core/Property.d.ts +2 -2
  125. package/Rendering/Core/Property2D.d.ts +2 -2
  126. package/Rendering/Core/RenderWindow.d.ts +2 -2
  127. package/Rendering/Core/RenderWindowInteractor.d.ts +123 -109
  128. package/Rendering/Core/RenderWindowInteractor.js +1 -1
  129. package/Rendering/Core/Renderer.d.ts +1 -1
  130. package/Rendering/Core/Renderer.js +1 -1
  131. package/Rendering/Core/ScalarBarActor.d.ts +2 -2
  132. package/Rendering/Core/ScalarBarActor.js +3 -3
  133. package/Rendering/Core/Texture.d.ts +1 -1
  134. package/Rendering/Core/Viewport.d.ts +2 -2
  135. package/Rendering/Core/Volume.d.ts +1 -1
  136. package/Rendering/Core/VolumeMapper.d.ts +1 -1
  137. package/Rendering/Core/VolumeMapper.js +1 -1
  138. package/Rendering/Core/VolumeProperty.d.ts +1 -1
  139. package/Rendering/Misc/CanvasView.d.ts +2 -2
  140. package/Rendering/Misc/FullScreenRenderWindow.d.ts +8 -8
  141. package/Rendering/Misc/GenericRenderWindow.d.ts +6 -6
  142. package/Rendering/Misc/RemoteView.d.ts +2 -2
  143. package/Rendering/Misc/RenderWindowWithControlBar.d.ts +1 -1
  144. package/Rendering/Misc/SynchronizableRenderWindow.d.ts +2 -2
  145. package/Rendering/Misc/TextureLODsDownloader.d.ts +3 -3
  146. package/Rendering/OpenGL/OrderIndependentTranslucentPass.js +5 -1
  147. package/Rendering/OpenGL/PolyDataMapper2D.js +1 -1
  148. package/Rendering/OpenGL/RenderWindow.d.ts +7 -7
  149. package/Rendering/OpenGL/Texture.js +1 -1
  150. package/Rendering/OpenGL/VolumeMapper.js +1 -1
  151. package/Rendering/SceneGraph/RenderPass.d.ts +1 -1
  152. package/Rendering/SceneGraph/ViewNode.d.ts +1 -1
  153. package/Rendering/SceneGraph/ViewNode.js +28 -2
  154. package/Rendering/SceneGraph/ViewNodeFactory.d.ts +1 -1
  155. package/Rendering/WebGPU/CellArrayMapper.js +629 -0
  156. package/Rendering/WebGPU/FullScreenQuad.js +4 -6
  157. package/Rendering/WebGPU/Glyph3DMapper.js +60 -27
  158. package/Rendering/WebGPU/ImageMapper.js +23 -60
  159. package/Rendering/WebGPU/OrderIndependentTranslucentPass.js +4 -6
  160. package/Rendering/WebGPU/Pipeline.js +12 -0
  161. package/Rendering/WebGPU/PolyDataMapper.js +49 -623
  162. package/Rendering/WebGPU/RenderEncoder.js +34 -0
  163. package/Rendering/WebGPU/Renderer.js +4 -62
  164. package/Rendering/WebGPU/ShaderDescription.js +6 -6
  165. package/Rendering/WebGPU/{MapperHelper.js → SimpleMapper.js} +64 -38
  166. package/Rendering/WebGPU/SphereMapper.js +41 -37
  167. package/Rendering/WebGPU/StickMapper.js +35 -30
  168. package/Rendering/WebGPU/StorageBuffer.js +2 -2
  169. package/Rendering/WebGPU/UniformBuffer.js +1 -1
  170. package/Rendering/WebGPU/Volume.js +1 -14
  171. package/Rendering/WebGPU/VolumePass.js +15 -19
  172. package/Rendering/WebGPU/VolumePassFSQ.js +19 -25
  173. package/Widgets/Manipulators/LineManipulator.d.ts +1 -1
  174. package/Widgets/Manipulators/LineManipulator.js +1 -1
  175. package/Widgets/Manipulators/PlaneManipulator.d.ts +1 -1
  176. package/Widgets/Manipulators/TrackballManipulator.d.ts +1 -1
  177. package/Widgets/Representations/PolyLineRepresentation.js +1 -1
  178. package/Widgets/Representations/ResliceCursorContextRepresentation.js +1 -1
  179. package/Widgets/Representations/WidgetRepresentation.d.ts +1 -1
  180. package/Widgets/Widgets3D/AngleWidget.js +1 -1
  181. package/Widgets/Widgets3D/LineWidget/helpers.js +1 -1
  182. package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
  183. package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
  184. package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -1
  185. package/Widgets/Widgets3D/ShapeWidget/behavior.js +1 -1
  186. package/Widgets/Widgets3D/SphereWidget.d.ts +2 -2
  187. package/index.d.ts +2 -2
  188. package/interfaces.d.ts +2 -2
  189. package/macros.d.ts +1 -1
  190. package/package.json +1 -1
  191. package/types.d.ts +1 -1
  192. package/tsconfig.json +0 -8
@@ -1,11 +1,10 @@
1
1
  import { newInstance as newInstance$1, vtkErrorMacro as vtkErrorMacro$1 } from '../../macros.js';
2
- import vtkWebGPUPolyDataMapper from './PolyDataMapper.js';
2
+ import vtkWebGPUCellArrayMapper from './CellArrayMapper.js';
3
3
  import vtkWebGPUBufferManager from './BufferManager.js';
4
4
  import vtkWebGPUShaderCache from './ShaderCache.js';
5
5
  import { registerOverride } from './ViewNodeFactory.js';
6
6
 
7
- var BufferUsage = vtkWebGPUBufferManager.BufferUsage,
8
- PrimitiveTypes = vtkWebGPUBufferManager.PrimitiveTypes;
7
+ var BufferUsage = vtkWebGPUBufferManager.BufferUsage;
9
8
  var vtkErrorMacro = vtkErrorMacro$1; // Vertices
10
9
  // 013 - 032 - 324 - 453
11
10
  //
@@ -34,6 +33,21 @@ var vtkWebGPUStickMapperVS = "\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//
34
33
  function vtkWebGPUStickMapper(publicAPI, model) {
35
34
  // Set our className
36
35
  model.classHierarchy.push('vtkWebGPUStickMapper');
36
+ var cellMapperBuildPass = publicAPI.buildPass;
37
+
38
+ publicAPI.buildPass = function (prepass) {
39
+ if (prepass) {
40
+ if (!model.renderable.getStatic()) {
41
+ model.renderable.update();
42
+ }
43
+
44
+ var poly = model.renderable.getInputData();
45
+ publicAPI.setCellArray(poly.getVerts());
46
+ publicAPI.setCurrentInput(poly);
47
+ }
48
+
49
+ cellMapperBuildPass(prepass);
50
+ };
37
51
 
38
52
  publicAPI.replaceShaderNormal = function (hash, pipeline, vertexInput) {
39
53
  var vDesc = pipeline.getShaderDescription('vertex');
@@ -62,32 +76,27 @@ function vtkWebGPUStickMapper(publicAPI, model) {
62
76
  // or vertex input changes/ bind groups/ etc
63
77
 
64
78
 
65
- publicAPI.computePipelineHash = function (vertexInput) {
66
- var pipelineHash = 'stm';
79
+ publicAPI.computePipelineHash = function () {
80
+ model.pipelineHash = 'stm';
67
81
 
68
- if (vertexInput.hasAttribute("colorVI")) {
69
- pipelineHash += "c";
82
+ if (model.vertexInput.hasAttribute("colorVI")) {
83
+ model.pipelineHash += "c";
70
84
  }
71
85
 
72
- pipelineHash += model.renderEncoder.getPipelineHash();
73
- return pipelineHash;
74
- }; // was originally buildIBOs() but not using IBOs right now
75
-
86
+ model.pipelineHash += model.renderEncoder.getPipelineHash();
87
+ };
76
88
 
77
- publicAPI.buildPrimitives = function () {
89
+ publicAPI.updateBuffers = function () {
78
90
  var poly = model.currentInput;
79
- var device = model.WebGPURenderWindow.getDevice();
80
- model.renderable.mapScalars(poly, 1.0); // handle triangles
81
-
82
- var i = PrimitiveTypes.Triangles;
91
+ model.renderable.mapScalars(poly, 1.0);
92
+ var device = model.device;
83
93
  var points = poly.getPoints();
84
94
  var pointData = poly.getPointData();
85
95
  var numPoints = points.getNumberOfPoints();
86
96
  var pointArray = points.getData();
87
- var primHelper = model.primitives[i];
88
- primHelper.setNumberOfInstances(numPoints);
89
- primHelper.setNumberOfVertices(12);
90
- var vertexInput = model.primitives[i].getVertexInput();
97
+ publicAPI.setNumberOfInstances(numPoints);
98
+ publicAPI.setNumberOfVertices(12);
99
+ var vertexInput = model.vertexInput;
91
100
  var buffRequest = {
92
101
  owner: points,
93
102
  hash: 'stm',
@@ -198,9 +207,8 @@ function vtkWebGPUStickMapper(publicAPI, model) {
198
207
  var _buff2 = device.getBufferManager().getBuffer(buffRequest);
199
208
 
200
209
  vertexInput.addBuffer(_buff2, ['orientMC'], 'instance');
201
- }
210
+ } // deal with colors but only if modified
202
211
 
203
- model.renderable.mapScalars(poly, 1.0); // deal with colors but only if modified
204
212
 
205
213
  var haveColors = false;
206
214
 
@@ -251,11 +259,8 @@ function vtkWebGPUStickMapper(publicAPI, model) {
251
259
  vertexInput.removeBufferIfPresent('colorVI');
252
260
  }
253
261
 
254
- primHelper.setPipelineHash(publicAPI.computePipelineHash(vertexInput));
255
- primHelper.setWebGPURenderer(model.WebGPURenderer);
256
- primHelper.setTopology('triangle-list');
257
- primHelper.build(model.renderEncoder, device);
258
- primHelper.registerToDraw();
262
+ publicAPI.setTopology('triangle-list');
263
+ publicAPI.updateUBO();
259
264
  };
260
265
  } // ----------------------------------------------------------------------------
261
266
  // Object factory
@@ -268,11 +273,11 @@ function extend(publicAPI, model) {
268
273
  var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
269
274
  Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance
270
275
 
271
- vtkWebGPUPolyDataMapper.extend(publicAPI, model, initialValues);
272
- model.primitives[PrimitiveTypes.Triangles].setVertexShaderTemplate(vtkWebGPUStickMapperVS); // Object methods
276
+ vtkWebGPUCellArrayMapper.extend(publicAPI, model, initialValues);
277
+ publicAPI.setVertexShaderTemplate(vtkWebGPUStickMapperVS); // Object methods
273
278
 
274
279
  vtkWebGPUStickMapper(publicAPI, model);
275
- var sr = model.primitives[PrimitiveTypes.Triangles].getShaderReplacements();
280
+ var sr = model.shaderReplacements;
276
281
  sr.set('replaceShaderPosition', publicAPI.replaceShaderPosition);
277
282
  sr.set('replaceShaderNormal', publicAPI.replaceShaderNormal);
278
283
  } // ----------------------------------------------------------------------------
@@ -176,10 +176,10 @@ function vtkWebGPUStorageBuffer(publicAPI, model) {
176
176
 
177
177
  for (var i = 0; i < model.bufferEntries.length; i++) {
178
178
  var entry = model.bufferEntries[i];
179
- lines.push(" ".concat(entry.name, ": ").concat(entry.type, ";"));
179
+ lines.push(" ".concat(entry.name, ": ").concat(entry.type, ","));
180
180
  }
181
181
 
182
- lines.push("\n};\nstruct ".concat(model.label, "Struct\n{\n values: array<").concat(model.label, "StructEntry>;\n};\n@binding(").concat(binding, ") @group(").concat(group, ") var<storage, read> ").concat(model.label, ": ").concat(model.label, "Struct;\n"));
182
+ lines.push("\n};\nstruct ".concat(model.label, "Struct\n{\n values: array<").concat(model.label, "StructEntry>,\n};\n@binding(").concat(binding, ") @group(").concat(group, ") var<storage, read> ").concat(model.label, ": ").concat(model.label, "Struct;\n"));
183
183
  return lines.join('\n');
184
184
  };
185
185
 
@@ -306,7 +306,7 @@ function vtkWebGPUUniformBuffer(publicAPI, model) {
306
306
 
307
307
  for (var i = 0; i < model.bufferEntries.length; i++) {
308
308
  var entry = model.bufferEntries[i];
309
- lines.push(" ".concat(entry.name, ": ").concat(entry.type, ";"));
309
+ lines.push(" ".concat(entry.name, ": ").concat(entry.type, ","));
310
310
  }
311
311
 
312
312
  lines.push("};\n@binding(".concat(binding, ") @group(").concat(group, ") var<uniform> ").concat(model.label, ": ").concat(model.label, "Struct;"));
@@ -23,10 +23,7 @@ function vtkWebGPUVolume(publicAPI, model) {
23
23
  model.propID = model.WebGPURenderWindow.getUniquePropID();
24
24
  }
25
25
 
26
- publicAPI.prepareNodes();
27
- model.renderable.getMapper().update(); // publicAPI.addMissingNode(model.renderable.getMapper());
28
-
29
- publicAPI.removeUnusedNodes();
26
+ model.renderable.getMapper().update();
30
27
  }
31
28
  };
32
29
 
@@ -81,16 +78,6 @@ function vtkWebGPUVolume(publicAPI, model) {
81
78
  }
82
79
  };
83
80
 
84
- publicAPI.traverseVolumePass = function (renderPass) {
85
- if (!model.renderable || !model.renderable.getNestedVisibility() || model.WebGPURenderer.getSelector() && !model.renderable.getNestedPickable()) {
86
- return;
87
- }
88
-
89
- publicAPI.apply(renderPass, true);
90
- model.children[0].traverse(renderPass);
91
- publicAPI.apply(renderPass, false);
92
- };
93
-
94
81
  publicAPI.getKeyMatrices = function (wgpuRen) {
95
82
  // has the actor or stabilization center changed?
96
83
  if (Math.max(model.renderable.getMTime(), wgpuRen.getStabilizedTime()) > model.keyMatricesTime.getMTime()) {
@@ -4,7 +4,7 @@ import vtkPolyData from '../../Common/DataModel/PolyData.js';
4
4
  import vtkProperty from '../Core/Property.js';
5
5
  import vtkRenderPass from '../SceneGraph/RenderPass.js';
6
6
  import vtkWebGPUBufferManager from './BufferManager.js';
7
- import vtkWebGPUMapperHelper from './MapperHelper.js';
7
+ import vtkWebGPUSimpleMapper from './SimpleMapper.js';
8
8
  import vtkWebGPURenderEncoder from './RenderEncoder.js';
9
9
  import vtkWebGPUShaderCache from './ShaderCache.js';
10
10
  import vtkWebGPUTexture from './Texture.js';
@@ -150,16 +150,6 @@ function vtkWebGPUVolumePass(publicAPI, model) {
150
150
  // final composite
151
151
 
152
152
 
153
- model._copyEncoder.setColorTextureView(0, model.colorTextureView);
154
-
155
- model._copyEncoder.attachTextureViews();
156
-
157
- renNode.setRenderEncoder(model._copyEncoder);
158
-
159
- model._copyEncoder.begin(viewNode.getCommandEncoder());
160
-
161
- renNode.scissorAndViewport(model._copyEncoder);
162
-
163
153
  model._volumeCopyQuad.setWebGPURenderer(renNode);
164
154
 
165
155
  if (model._useSmallViewport) {
@@ -174,7 +164,15 @@ function vtkWebGPUVolumePass(publicAPI, model) {
174
164
 
175
165
  model._copyUBO.sendIfNeeded(device);
176
166
 
177
- model._volumeCopyQuad.render(model._copyEncoder, viewNode.getDevice());
167
+ model._copyEncoder.setColorTextureView(0, model.colorTextureView);
168
+
169
+ model._copyEncoder.attachTextureViews();
170
+
171
+ model._copyEncoder.begin(viewNode.getCommandEncoder());
172
+
173
+ renNode.scissorAndViewport(model._copyEncoder);
174
+
175
+ model._volumeCopyQuad.prepareAndDraw(model._copyEncoder);
178
176
 
179
177
  model._copyEncoder.end();
180
178
  }; // unsubscribe from our listeners
@@ -235,7 +233,6 @@ function vtkWebGPUVolumePass(publicAPI, model) {
235
233
  publicAPI.rayCastPass = function (viewNode, renNode, volumes) {
236
234
  var encoder = model._firstGroup ? model._clearEncoder : model._mergeEncoder;
237
235
  encoder.attachTextureViews();
238
- renNode.setRenderEncoder(encoder);
239
236
  encoder.begin(viewNode.getCommandEncoder());
240
237
 
241
238
  var width = model._colorTextureView.getTexture().getWidth();
@@ -252,7 +249,7 @@ function vtkWebGPUVolumePass(publicAPI, model) {
252
249
  encoder.getHandle().setScissorRect(0, 0, width, height);
253
250
  model.fullScreenQuad.setWebGPURenderer(renNode);
254
251
  model.fullScreenQuad.setVolumes(volumes);
255
- model.fullScreenQuad.render(encoder, viewNode.getDevice());
252
+ model.fullScreenQuad.prepareAndDraw(encoder);
256
253
  encoder.end();
257
254
  };
258
255
 
@@ -348,8 +345,7 @@ function vtkWebGPUVolumePass(publicAPI, model) {
348
345
  };
349
346
 
350
347
  publicAPI.drawDepthRange = function (renNode, viewNode) {
351
- var device = viewNode.getDevice(); // copy current depth buffer to
352
-
348
+ // copy current depth buffer to
353
349
  model._depthRangeTexture.resizeToMatch(model.colorTextureView.getTexture());
354
350
 
355
351
  model._depthRangeTexture2.resizeToMatch(model.colorTextureView.getTexture());
@@ -362,9 +358,9 @@ function vtkWebGPUVolumePass(publicAPI, model) {
362
358
 
363
359
  model._mapper.setWebGPURenderer(renNode);
364
360
 
365
- model._mapper.build(model._depthRangeEncoder, device);
361
+ model._mapper.prepareToDraw(model._depthRangeEncoder);
366
362
 
367
- model._mapper.registerToDraw();
363
+ model._mapper.registerDrawCallback(model._depthRangeEncoder);
368
364
 
369
365
  renNode.volumeDepthRangePass(false);
370
366
  };
@@ -652,7 +648,7 @@ function extend(publicAPI, model) {
652
648
 
653
649
  vtkRenderPass.extend(publicAPI, model, initialValues);
654
650
  model._lastScale = 2.0;
655
- model._mapper = vtkWebGPUMapperHelper.newInstance();
651
+ model._mapper = vtkWebGPUSimpleMapper.newInstance();
656
652
 
657
653
  model._mapper.setFragmentShaderTemplate(DepthBoundsFS);
658
654
 
@@ -423,8 +423,11 @@ function vtkWebGPUVolumePassFSQ(publicAPI, model) {
423
423
  model.componentSSBO.send(device);
424
424
  };
425
425
 
426
- publicAPI.updateBuffers = function (device) {
427
- // compute the min step size
426
+ var superClassUpdateBuffers = publicAPI.updateBuffers;
427
+
428
+ publicAPI.updateBuffers = function () {
429
+ superClassUpdateBuffers(); // compute the min step size
430
+
428
431
  var sampleDist = model.volumes[0].getRenderable().getMapper().getSampleDistance();
429
432
 
430
433
  for (var i = 0; i < model.volumes.length; i++) {
@@ -440,7 +443,7 @@ function vtkWebGPUVolumePassFSQ(publicAPI, model) {
440
443
  if (model.sampleDist !== sampleDist) {
441
444
  model.sampleDist = sampleDist;
442
445
  model.UBO.setValue('SampleDistance', sampleDist);
443
- model.UBO.sendIfNeeded(device);
446
+ model.UBO.sendIfNeeded(model.device);
444
447
  } // add in 3d volume textures
445
448
 
446
449
 
@@ -456,7 +459,7 @@ function vtkWebGPUVolumePassFSQ(publicAPI, model) {
456
459
  imageData: image,
457
460
  owner: image.getPointData().getScalars()
458
461
  };
459
- var newTex = device.getTextureManager().getTexture(treq);
462
+ var newTex = model.device.getTextureManager().getTexture(treq);
460
463
 
461
464
  if (!model.textureViews[vidx + 4] || model.textureViews[vidx + 4].getTexture() !== newTex) {
462
465
  var tview = newTex.createView("volTexture".concat(vidx));
@@ -473,8 +476,18 @@ function vtkWebGPUVolumePassFSQ(publicAPI, model) {
473
476
  }
474
477
 
475
478
  model.lastVolumeLength = model.volumes.length;
476
- publicAPI.updateLUTImage(device);
477
- publicAPI.updateSSBO(device);
479
+ publicAPI.updateLUTImage(model.device);
480
+ publicAPI.updateSSBO(model.device);
481
+
482
+ if (!model.clampSampler) {
483
+ model.clampSampler = vtkWebGPUSampler.newInstance({
484
+ label: 'clampSampler'
485
+ });
486
+ model.clampSampler.create(model.device, {
487
+ minFilter: 'linear',
488
+ magFilter: 'linear'
489
+ });
490
+ }
478
491
  };
479
492
 
480
493
  publicAPI.computePipelineHash = function () {
@@ -503,25 +516,6 @@ function vtkWebGPUVolumePassFSQ(publicAPI, model) {
503
516
  }
504
517
  };
505
518
 
506
- var superclassBuild = publicAPI.build;
507
-
508
- publicAPI.build = function (renderEncoder, device) {
509
- publicAPI.computePipelineHash();
510
- publicAPI.updateBuffers(device);
511
-
512
- if (!model.clampSampler) {
513
- model.clampSampler = vtkWebGPUSampler.newInstance({
514
- label: 'clampSampler'
515
- });
516
- model.clampSampler.create(device, {
517
- minFilter: 'linear',
518
- magFilter: 'linear'
519
- });
520
- }
521
-
522
- superclassBuild(renderEncoder, device);
523
- };
524
-
525
519
  var superclassGetBindables = publicAPI.getBindables;
526
520
 
527
521
  publicAPI.getBindables = function () {
@@ -1,4 +1,4 @@
1
- import { vtkObject } from '../../interfaces';
1
+ import { vtkObject } from './../../interfaces';
2
2
 
3
3
  /**
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import macro from '../../macros.js';
2
- import { g as subtract, j as cross, d as dot, x as multiplyScalar, k 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,4 +1,4 @@
1
- import { vtkObject } from '../../interfaces';
1
+ import { vtkObject } from './../../interfaces';
2
2
 
3
3
  /**
4
4
  *
@@ -1,4 +1,4 @@
1
- import { vtkObject } from '../../interfaces';
1
+ import { vtkObject } from './../../interfaces';
2
2
 
3
3
  /**
4
4
  *
@@ -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 { B as areEquals, f 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 { g as subtract, m as multiplyAccumulate, l as normalize, j as cross } from '../../Common/Core/Math/index.js';
4
+ import { g as subtract, P 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,4 +1,4 @@
1
- import vtkProp from '../../Rendering/Core/Prop';
1
+ import vtkProp from './../../Rendering/Core/Prop';
2
2
 
3
3
  export interface IWidgetRepresentationInitialValues {
4
4
  labels?: Array<any>,
@@ -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 { g as subtract, R as angleBetweenVectors } from '../../Common/Core/Math/index.js';
6
+ import { g as subtract, Q 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';
@@ -1,4 +1,4 @@
1
- import { g as subtract, x as multiplyScalar, k as add, B 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];
@@ -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 { x as multiplyScalar, g as subtract, l as normalize, d as dot, j as cross, m 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, P as multiplyAccumulate, R 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,7 +3,7 @@ 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 { g as subtract, l as normalize, j as cross, x as multiplyScalar, m 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, P as multiplyAccumulate, R 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
 
@@ -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 { f as distance2BetweenPoints, m as multiplyAccumulate, g as subtract, l as normalize, x as multiplyScalar, k as add } from '../../Common/Core/Math/index.js';
7
+ import { f as distance2BetweenPoints, P 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 { t as vtkMath } from '../../../Common/Core/Math/index.js';
4
+ import { o 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';
@@ -1,5 +1,5 @@
1
- import vtkAbstractWidget from '../Core/AbstractWidget';
2
- import { Vector3, Bounds } from '../../types';
1
+ import vtkAbstractWidget from './../Core/AbstractWidget';
2
+ import { Vector3, Bounds } from './../../types';
3
3
 
4
4
  export interface ISphereWidgetHandleState {
5
5
  getOrigin(): Vector3;
package/index.d.ts CHANGED
@@ -37,7 +37,6 @@
37
37
  /// <reference path="./Common/DataModel/Sphere.d.ts" />
38
38
  /// <reference path="./Common/DataModel/Spline1D.d.ts" />
39
39
  /// <reference path="./Common/DataModel/Spline3D.d.ts" />
40
- /// <reference path="./Common/DataModel/Triangle.d.ts" />
41
40
  /// <reference path="./Common/Transform/LandmarkTransform.d.ts" />
42
41
  /// <reference path="./Filters/General/AppendPolyData.d.ts" />
43
42
  /// <reference path="./Filters/General/ImageCropFilter.d.ts" />
@@ -62,8 +61,8 @@
62
61
  /// <reference path="./Filters/Texture/TextureMapToPlane.d.ts" />
63
62
  /// <reference path="./Filters/Texture/TextureMapToSphere.d.ts" />
64
63
  /// <reference path="./Interaction/Widgets/OrientationMarkerWidget.d.ts" />
65
- /// <reference path="./IO/Core/DataAccessHelper/HtmlDataAccessHelper.d.ts" />
66
64
  /// <reference path="./IO/Core/DataAccessHelper/HttpDataAccessHelper.d.ts" />
65
+ /// <reference path="./IO/Core/DataAccessHelper/HtmlDataAccessHelper.d.ts" />
67
66
  /// <reference path="./IO/Core/DataAccessHelper.d.ts" />
68
67
  /// <reference path="./IO/Core/DataAccessHelper/JSZipDataAccessHelper.d.ts" />
69
68
  /// <reference path="./IO/Core/DataAccessHelper/LiteHttpDataAccessHelper.d.ts" />
@@ -144,4 +143,5 @@
144
143
  /// <reference path="./Widgets/Representations/ResliceCursorContextRepresentation.d.ts" />
145
144
  /// <reference path="./Widgets/Representations/WidgetRepresentation.d.ts" />
146
145
  /// <reference path="./Widgets/Widgets3D/SphereWidget.d.ts" />
146
+ /// <reference path="./Common/DataModel/Triangle.d.ts" />
147
147
  /// <reference path="./Common/Core/Math.d.ts" />
package/interfaces.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import vtkDataArray from '././Common/Core/DataArray';
2
- import { vtkPipelineConnection } from '././types';
1
+ import vtkDataArray from './Common/Core/DataArray';
2
+ import { vtkPipelineConnection } from './types';
3
3
 
4
4
  /**
5
5
  * Object returned on any subscription call
package/macros.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { vtkSubscription, vtkDebouncedFunction, vtkProperty, vtkPropertyDomain } from '././interfaces';
1
+ import { vtkSubscription, vtkDebouncedFunction, vtkProperty, vtkPropertyDomain } from './interfaces';
2
2
 
3
3
  /**
4
4
  * Allow user to redefine vtkXXXMacro method call.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "24.5.1",
3
+ "version": "24.5.4",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",
package/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { vtkOutputPort } from '././interfaces';
1
+ import { vtkOutputPort } from './interfaces';
2
2
 
3
3
  /** Alias type for value that can be null */
4
4
  declare type Nullable<T> = T | null;
package/tsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "include": ["Sources/**/*"],
3
- "compilerOptions": {
4
- "allowJs": true,
5
- "declaration": true,
6
- "emitDeclarationOnly": true
7
- }
8
- }