@kitware/vtk.js 21.2.2 → 21.4.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.
@@ -372,6 +372,7 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
372
372
  switch (_context3.prev = _context3.next) {
373
373
  case 0:
374
374
  xrSession = frame.session;
375
+ model.renderable.getInteractor().updateXRGamepads(xrSession, frame, model.xrReferenceSpace);
375
376
  model.xrSceneFrame = model.xrSession.requestAnimationFrame(publicAPI.xrRender);
376
377
  xrPose = frame.getViewerPose(model.xrReferenceSpace);
377
378
 
@@ -403,7 +404,7 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
403
404
  });
404
405
  }
405
406
 
406
- case 4:
407
+ case 5:
407
408
  case "end":
408
409
  return _context3.stop();
409
410
  }
@@ -0,0 +1,3 @@
1
+ var vtkPolyData2DFS = "//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyData2DFS.glsl\n\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n All rights reserved.\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n\n This software is distributed WITHOUT ANY WARRANTY; without even\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE. See the above copyright notice for more information.\n\n=========================================================================*/\n\nuniform int PrimitiveIDOffset;\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// Scalar coloring\n//VTK::Color::Dec\n\n// Depth Peeling\n//VTK::DepthPeeling::Dec\n\n// picking support\n//VTK::Picking::Dec\n\n// the output of this shader\n//VTK::Output::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\nvoid main()\n{\n // Apple Bug\n //VTK::PrimID::Impl\n\n //VTK::Color::Impl\n //VTK::TCoord::Impl\n\n //VTK::DepthPeeling::Impl\n //VTK::Picking::Impl\n\n if (gl_FragData[0].a <= 0.0)\n {\n discard;\n }\n}\n";
2
+
3
+ export { vtkPolyData2DFS as v };
@@ -0,0 +1,3 @@
1
+ var vtkPolyData2DVS = "//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyData2DVS.glsl\n\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n All rights reserved.\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n\n This software is distributed WITHOUT ANY WARRANTY; without even\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE. See the above copyright notice for more information.\n\n=========================================================================*/\n\n// all variables that represent positions or directions have a suffix\n// indicating the coordinate system they are in. The possible values are\n// MC - Model Coordinates\n// WC - WC world coordinates\n// VC - View Coordinates\n// DC - Display Coordinates\n\nin vec4 vertexWC;\n\n// frag position in VC\n//VTK::PositionVC::Dec\n\n// material property values\n//VTK::Color::Dec\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\nuniform mat4 WCVCMatrix; // World to view matrix\n\nvoid main()\n{\n // Apple Bug\n //VTK::PrimID::Impl\n\n gl_Position = WCVCMatrix*vertexWC;\n\n //VTK::TCoord::Impl\n\n //VTK::Color::Impl\n\n //VTK::PositionVC::Impl\n}\n";
2
+
3
+ export { vtkPolyData2DVS as v };
@@ -13,6 +13,7 @@ import vtkImageMapper from './OpenGL/ImageMapper.js';
13
13
  import vtkImageSlice from './OpenGL/ImageSlice.js';
14
14
  import vtkPixelSpaceCallbackMapper from './OpenGL/PixelSpaceCallbackMapper.js';
15
15
  import vtkOpenGLPolyDataMapper from './OpenGL/PolyDataMapper.js';
16
+ import vtkPolyDataMapper2D from './OpenGL/PolyDataMapper2D.js';
16
17
  import vtkRenderer from './OpenGL/Renderer.js';
17
18
  import vtkRenderWindow from './OpenGL/RenderWindow.js';
18
19
  import vtkShader from './OpenGL/Shader.js';
@@ -44,6 +45,7 @@ var OpenGL = {
44
45
  vtkImageSlice: vtkImageSlice,
45
46
  vtkPixelSpaceCallbackMapper: vtkPixelSpaceCallbackMapper,
46
47
  vtkPolyDataMapper: vtkOpenGLPolyDataMapper,
48
+ vtkPolyDataMapper2D: vtkPolyDataMapper2D,
47
49
  vtkRenderer: vtkRenderer,
48
50
  vtkRenderWindow: vtkRenderWindow,
49
51
  vtkShader: vtkShader,
@@ -3,6 +3,7 @@ import '../OpenGL/Renderer.js';
3
3
  import '../OpenGL/Actor.js';
4
4
  import '../OpenGL/Actor2D.js';
5
5
  import '../OpenGL/PolyDataMapper.js';
6
+ import '../OpenGL/PolyDataMapper2D.js';
6
7
  import '../OpenGL/Skybox.js';
7
8
  import '../OpenGL/Texture.js';
8
9
  import '../OpenGL/Glyph3DMapper.js';
@@ -3,6 +3,7 @@ import '../OpenGL/Renderer.js';
3
3
  import '../OpenGL/Actor.js';
4
4
  import '../OpenGL/Actor2D.js';
5
5
  import '../OpenGL/PolyDataMapper.js';
6
+ import '../OpenGL/PolyDataMapper2D.js';
6
7
  import '../OpenGL/Skybox.js';
7
8
  import '../OpenGL/Texture.js';
8
9
  import '../OpenGL/PixelSpaceCallbackMapper.js';
package/macros.js CHANGED
@@ -553,12 +553,15 @@ function setArray(publicAPI, model, fieldNames, size) {
553
553
  }
554
554
 
555
555
  var array = args;
556
- var changeDetected; // allow null or an array to be passed as a single arg.
556
+ var changeDetected;
557
+ var needCopy = false; // allow null or an array to be passed as a single arg.
557
558
 
558
559
  if (array.length === 1 && (array[0] == null || array[0].length >= 0)) {
559
560
  /* eslint-disable prefer-destructuring */
560
561
  array = array[0];
561
562
  /* eslint-enable prefer-destructuring */
563
+
564
+ needCopy = true;
562
565
  }
563
566
 
564
567
  if (array == null) {
@@ -567,6 +570,7 @@ function setArray(publicAPI, model, fieldNames, size) {
567
570
  if (size && array.length !== size) {
568
571
  if (array.length < size && defaultVal !== undefined) {
569
572
  array = Array.from(array);
573
+ needCopy = false;
570
574
 
571
575
  while (array.length < size) {
572
576
  array.push(defaultVal);
@@ -580,7 +584,7 @@ function setArray(publicAPI, model, fieldNames, size) {
580
584
  return item !== array[index];
581
585
  }) || model[field].length !== array.length;
582
586
 
583
- if (changeDetected && !Array.isArray(array)) {
587
+ if (changeDetected && needCopy) {
584
588
  array = Array.from(array);
585
589
  }
586
590
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "21.2.2",
3
+ "version": "21.4.1",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",
package/types.d.ts CHANGED
@@ -19,6 +19,11 @@ declare type Size = [number, number];
19
19
  declare type Range = [number, number];
20
20
  declare type Vector2 = [number, number];
21
21
  declare type Vector3 = [number, number, number];
22
+ declare type Vector4 = [number, number, number, number];
23
+
24
+ declare type Matrix = number[][];
25
+ declare type Matrix2x2 = [Vector2, Vector2];
26
+ declare type Matrix3x3 = [Vector3, Vector3, Vector3];
22
27
  /**
23
28
  * @deprecated The `Point` type is depracted, please use `Vector3` instead.
24
29
  */