@kitware/vtk.js 26.1.0 → 26.1.1

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.
@@ -1,3 +1,4 @@
1
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
1
2
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
3
  import { newInstance as newInstance$1, obj, setGet, chain, vtkWarningMacro as vtkWarningMacro$1, vtkErrorMacro as vtkErrorMacro$1 } from '../../macros.js';
3
4
  import { mat4, mat3, vec3 } from 'gl-matrix';
@@ -534,9 +535,28 @@ function vtkOpenGLVolumeMapper(publicAPI, model) {
534
535
  if (actor.getProperty().getUseLabelOutline()) {
535
536
  var image = model.currentInput;
536
537
  var worldToIndex = image.getWorldToIndex();
537
- program.setUniformMatrix('vWCtoIDX', worldToIndex); // Get the projection coordinate to world coordinate transformation matrix.
538
+ program.setUniformMatrix('vWCtoIDX', worldToIndex);
539
+ var camera = ren.getActiveCamera();
538
540
 
539
- mat4.invert(model.projectionToWorld, keyMats.wcpc);
541
+ var _camera$getClippingRa = camera.getClippingRange(),
542
+ _camera$getClippingRa2 = _slicedToArray(_camera$getClippingRa, 2),
543
+ cRange0 = _camera$getClippingRa2[0],
544
+ cRange1 = _camera$getClippingRa2[1];
545
+
546
+ var distance = camera.getDistance(); // set the clipping range to be model.distance and model.distance + 0.1
547
+ // since we use the in the keyMats.wcpc (world to projection) matrix
548
+ // the projection matrix calculation relies on the clipping range to be
549
+ // set correctly. This is done inside the interactorStyleMPRSlice which
550
+ // limits use cases where the interactor style is not used.
551
+
552
+ camera.setClippingRange(distance, distance + 0.1);
553
+ var labelOutlineKeyMats = model.openGLCamera.getKeyMatrices(ren); // Get the projection coordinate to world coordinate transformation matrix.
554
+
555
+ mat4.invert(model.projectionToWorld, labelOutlineKeyMats.wcpc); // reset the clipping range since the keyMats are cached
556
+
557
+ camera.setClippingRange(cRange0, cRange1); // to re compute the matrices for the current camera and cache them
558
+
559
+ model.openGLCamera.getKeyMatrices(ren);
540
560
  program.setUniformMatrix('PCWCMatrix', model.projectionToWorld);
541
561
  var size = publicAPI.getRenderTargetSize();
542
562
  program.setUniformf('vpWidth', size[0]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "26.1.0",
3
+ "version": "26.1.1",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",