@kitware/vtk.js 21.0.0 → 21.1.3

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.
@@ -8,6 +8,10 @@ In ShapeWidget:
8
8
 
9
9
  RectangleWidget and EllipseWidget handles now scale up automatically.
10
10
 
11
+ ## From 19.2 to 19.3
12
+
13
+ Node >=12 is required
14
+
11
15
  ## From 18.x to 19
12
16
 
13
17
  vtkWidgetRepresentation.updateActorVisibility(...) lost the widgetVisibility parameter.
@@ -22,7 +22,7 @@ interface IComputeHistogram {
22
22
  export interface vtkImageData extends vtkDataSet {
23
23
 
24
24
  /**
25
- * Returns an object with `{ minimum, maximum, average, variance, sigma }`
25
+ * Returns an object with `{ minimum, maximum, average, variance, sigma, count }`
26
26
  * of the imageData points found within the provided `worldBounds`.
27
27
  *
28
28
  * `voxelFunc(index, bounds)` is an optional function that is called with
@@ -395,14 +395,15 @@ function vtkImageData(publicAPI, model) {
395
395
  }
396
396
 
397
397
  var average = inum > 0 ? isum / inum : 0;
398
- var variance = sumOfSquares - average * average;
398
+ var variance = inum ? Math.abs(sumOfSquares / inum - average * average) : 0;
399
399
  var sigma = Math.sqrt(variance);
400
400
  return {
401
401
  minimum: minimum,
402
402
  maximum: maximum,
403
403
  average: average,
404
404
  variance: variance,
405
- sigma: sigma
405
+ sigma: sigma,
406
+ count: inum
406
407
  };
407
408
  }; // TODO: use the unimplemented `vtkDataSetAttributes` for scalar length, that is currently also a TODO (GetNumberOfComponents).
408
409
  // Scalar data could be tuples for color information?
@@ -698,11 +698,6 @@ function vtkTubeFilter(publicAPI, model) {
698
698
  numberOfComponents: 3
699
699
  });
700
700
  var numNormals = 3 * numNewPts;
701
-
702
- if (model.capping) {
703
- numNormals = 3 * (numNewPts + 2 * model.numberOfSides);
704
- }
705
-
706
701
  var newNormalsData = new Float32Array(numNormals);
707
702
  var newNormals = vtkDataArray.newInstance({
708
703
  numberOfComponents: 3,
@@ -30,7 +30,7 @@ function vtkVRButtonPanManipulator(publicAPI, model) {
30
30
 
31
31
  var speed = data.gamepad.axes[1]; // 0.05 meters / frame movement
32
32
 
33
- var pscale = speed * 0.05 / camera.getPhysicalScale(); // convert orientation to world coordinate direction
33
+ var pscale = speed * 0.05 * camera.getPhysicalScale(); // convert orientation to world coordinate direction
34
34
 
35
35
  var dir = camera.physicalOrientationToWorldDirection(data.orientation);
36
36
  camera.setPhysicalTranslation(oldTrans[0] + dir[0] * pscale, oldTrans[1] + dir[1] * pscale, oldTrans[2] + dir[2] * pscale);
@@ -79,7 +79,7 @@ function vtkInteractorStyleTrackballCamera(publicAPI, model) {
79
79
 
80
80
  var speed = ed.gamepad.axes[1]; // 0.05 meters / frame movement
81
81
 
82
- var pscale = speed * 0.05 / camera.getPhysicalScale(); // convert orientation to world coordinate direction
82
+ var pscale = speed * 0.05 * camera.getPhysicalScale(); // convert orientation to world coordinate direction
83
83
 
84
84
  var dir = camera.physicalOrientationToWorldDirection(ed.orientation);
85
85
  camera.setPhysicalTranslation(oldTrans[0] + dir[0] * pscale, oldTrans[1] + dir[1] * pscale, oldTrans[2] + dir[2] * pscale);
@@ -4,6 +4,7 @@ import vtkBufferObject from './OpenGL/BufferObject.js';
4
4
  import vtkCamera from './OpenGL/Camera.js';
5
5
  import vtkCellArrayBufferObject from './OpenGL/CellArrayBufferObject.js';
6
6
  import vtkConvolution2DPass from './OpenGL/Convolution2DPass.js';
7
+ import vtkForwardPass from './OpenGL/ForwardPass.js';
7
8
  import vtkOpenGLFramebuffer from './OpenGL/Framebuffer.js';
8
9
  import vtkGlyph3DMapper from './OpenGL/Glyph3DMapper.js';
9
10
  import vtkHardwareSelector from './OpenGL/HardwareSelector.js';
@@ -34,6 +35,7 @@ var OpenGL = {
34
35
  vtkCamera: vtkCamera,
35
36
  vtkCellArrayBufferObject: vtkCellArrayBufferObject,
36
37
  vtkConvolution2DPass: vtkConvolution2DPass,
38
+ vtkForwardPass: vtkForwardPass,
37
39
  vtkFramebuffer: vtkOpenGLFramebuffer,
38
40
  vtkGlyph3DMapper: vtkGlyph3DMapper,
39
41
  vtkHardwareSelector: vtkHardwareSelector,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "21.0.0",
3
+ "version": "21.1.3",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",
@@ -49,6 +49,7 @@
49
49
  },
50
50
  "devDependencies": {
51
51
  "@babel/core": "7.15.5",
52
+ "@babel/eslint-parser": "7.16.0",
52
53
  "@babel/plugin-transform-runtime": "7.15.0",
53
54
  "@babel/preset-env": "7.15.6",
54
55
  "@commitlint/cli": "13.1.0",
@@ -82,6 +83,7 @@
82
83
  "eslint-webpack-plugin": "3.0.1",
83
84
  "expose-loader": "3.0.0",
84
85
  "glob": "7.1.7",
86
+ "handlebars": "4.7.7",
85
87
  "hson-loader": "2.0.0",
86
88
  "html-loader": "2.1.2",
87
89
  "html-webpack-plugin": "5.3.2",
@@ -92,8 +94,6 @@
92
94
  "karma-coverage": "2.0.3",
93
95
  "karma-firefox-launcher": "2.1.1",
94
96
  "karma-junit-reporter": "2.0.1",
95
- "karma-tap": "4.2.0",
96
- "karma-tap-pretty-reporter": "4.2.0",
97
97
  "karma-webpack": "5.0.0",
98
98
  "kw-doc": "3.1.2",
99
99
  "lodash": "4.17.21",
@@ -103,6 +103,7 @@
103
103
  "postcss-loader": "6.1.1",
104
104
  "prettier": "2.4.0",
105
105
  "process": "0.11.10",
106
+ "regenerator-runtime": "0.13.9",
106
107
  "rollup": "2.56.3",
107
108
  "rollup-plugin-auto-external": "2.0.0",
108
109
  "rollup-plugin-copy": "3.4.0",