@kitware/vtk.js 32.6.2 → 33.0.0-beta.2

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 (37) hide show
  1. package/BREAKING_CHANGES.md +3 -0
  2. package/IO/Image.js +1 -3
  3. package/Interaction/Manipulators/KeyboardCameraManipulator.d.ts +113 -0
  4. package/Rendering/Core/Actor.d.ts +5 -20
  5. package/Rendering/Core/Actor.js +5 -68
  6. package/Rendering/Core/ImageProperty.d.ts +0 -22
  7. package/Rendering/Core/ImageSlice.d.ts +7 -23
  8. package/Rendering/Core/ImageSlice.js +9 -68
  9. package/Rendering/Core/PointPicker.js +1 -4
  10. package/Rendering/Core/Prop3D.d.ts +39 -2
  11. package/Rendering/Core/Prop3D.js +81 -2
  12. package/Rendering/Core/RenderWindowInteractor.d.ts +1 -1
  13. package/Rendering/Core/Volume.d.ts +5 -20
  14. package/Rendering/Core/Volume.js +2 -70
  15. package/Rendering/Core/VolumeMapper/Constants.d.ts +0 -7
  16. package/Rendering/Core/VolumeMapper/Constants.js +2 -8
  17. package/Rendering/Core/VolumeMapper.d.ts +16 -140
  18. package/Rendering/Core/VolumeMapper.js +17 -52
  19. package/Rendering/Core/VolumeProperty/Constants.d.ts +12 -3
  20. package/Rendering/Core/VolumeProperty/Constants.js +11 -4
  21. package/Rendering/Core/VolumeProperty.d.ts +120 -4
  22. package/Rendering/Core/VolumeProperty.js +49 -4
  23. package/Rendering/OpenGL/ImageCPRMapper.js +27 -19
  24. package/Rendering/OpenGL/ImageMapper.js +34 -41
  25. package/Rendering/OpenGL/ImageResliceMapper.js +261 -172
  26. package/Rendering/OpenGL/PolyDataMapper.js +1 -8
  27. package/Rendering/OpenGL/RenderWindow/resourceSharingHelper.d.ts +3 -3
  28. package/Rendering/OpenGL/RenderWindow/resourceSharingHelper.js +8 -5
  29. package/Rendering/OpenGL/VolumeMapper.js +710 -772
  30. package/Rendering/OpenGL/glsl/vtkVolumeFS.glsl.js +1 -1
  31. package/Rendering/WebGPU/VolumePassFSQ.js +2 -2
  32. package/index.d.ts +1 -1
  33. package/macros2.js +1 -1
  34. package/package.json +1 -1
  35. package/IO/Image/TGAReader/Constants.js +0 -28
  36. package/IO/Image/TGAReader.d.ts +0 -121
  37. package/IO/Image/TGAReader.js +0 -418
@@ -2,7 +2,7 @@ import { mat3, mat4, vec3 } from 'gl-matrix';
2
2
  import { n as newInstance$1, e as setGet, o as obj, c as macro } from '../../macros2.js';
3
3
  import vtkHelper from './Helper.js';
4
4
  import vtkMapper from '../Core/Mapper.js';
5
- import { l as normalize, u as uninitializeBounds } from '../../Common/Core/Math/index.js';
5
+ import { l as normalize } from '../../Common/Core/Math/index.js';
6
6
  import vtkOpenGLTexture from './Texture.js';
7
7
  import vtkProp from '../Core/Prop.js';
8
8
  import vtkProperty from '../Core/Property.js';
@@ -941,13 +941,6 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
941
941
  publicAPI.renderPieceDraw(ren, actor);
942
942
  publicAPI.renderPieceFinish(ren, actor);
943
943
  };
944
- publicAPI.computeBounds = (ren, actor) => {
945
- if (!publicAPI.getInput()) {
946
- uninitializeBounds(model.bounds);
947
- return;
948
- }
949
- model.bounds = publicAPI.getInput().getBounds();
950
- };
951
944
  publicAPI.updateBufferObjects = (ren, actor) => {
952
945
  // Rebuild buffers if needed
953
946
  if (publicAPI.getNeedToRebuildBufferObjects(ren, actor)) {
@@ -9,8 +9,8 @@ import { vtkObject } from '../../../interfaces';
9
9
  * @param useIndependentComponents A boolean taken from the image or volume property, using getIndependentComponents()
10
10
  * @param numberOfComponents Taken from the data array, using getNumberOfComponents()
11
11
  */
12
- export function getTransferFunctionHash(
13
- transferFunction: vtkObject | undefined,
12
+ export function getTransferFunctionsHash(
13
+ transferFunctions: (vtkObject | null | undefined)[],
14
14
  useIndependentComponents: boolean,
15
15
  numberOfComponents: number
16
16
  ): string;
@@ -27,7 +27,7 @@ export function getImageDataHash(
27
27
  ): string;
28
28
 
29
29
  declare const defaultExport: {
30
- getTransferFunctionHash: typeof getTransferFunctionHash;
30
+ getTransferFunctionsHash: typeof getTransferFunctionsHash;
31
31
  getImageDataHash: typeof getImageDataHash;
32
32
  };
33
33
 
@@ -1,14 +1,17 @@
1
1
  // See typescript header for documentation
2
2
 
3
- function getTransferFunctionHash(transferFunction, useIndependentComponents, numberOfComponents) {
4
- return transferFunction ? `${transferFunction.getMTime()}-${useIndependentComponents}-${numberOfComponents}` : '0';
3
+ function getTransferFunctionsHash(transferFunctions, useIndependentComponents, numberOfComponents) {
4
+ return transferFunctions.length > 0 ? `${transferFunctions.map(tf => tf?.getMTime() ?? 'x').join('/')}-${useIndependentComponents}-${numberOfComponents}` : '0';
5
5
  }
6
6
  function getImageDataHash(image, scalars) {
7
- return `${image.getMTime()}A${scalars.getMTime()}`;
7
+ // Don't use the image data, as the scalars will define the texture
8
+ // If using the image data in the hash, it will cause issues when two image data
9
+ // using the same scalars are in the same mapper (for example the VolumeMapper)
10
+ return `${scalars.getMTime()}`;
8
11
  }
9
12
  var resourceSharingHelper = {
10
- getTransferFunctionHash,
13
+ getTransferFunctionsHash,
11
14
  getImageDataHash
12
15
  };
13
16
 
14
- export { resourceSharingHelper as default, getImageDataHash, getTransferFunctionHash };
17
+ export { resourceSharingHelper as default, getImageDataHash, getTransferFunctionsHash };