@kitware/vtk.js 21.1.5 → 21.3.0

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 (48) hide show
  1. package/Common/Transform/LandmarkTransform.d.ts +1 -1
  2. package/Filters/General/ImageCropFilter.js +3 -4
  3. package/Filters/Sources/Arrow2DSource.d.ts +14 -13
  4. package/Filters/Sources/ArrowSource.d.ts +9 -8
  5. package/Filters/Sources/CircleSource.d.ts +15 -14
  6. package/Filters/Sources/ConeSource.d.ts +18 -17
  7. package/Filters/Sources/CubeSource.d.ts +19 -19
  8. package/Filters/Sources/Cursor3D.d.ts +19 -16
  9. package/Filters/Sources/CylinderSource.d.ts +15 -14
  10. package/Filters/Sources/LineSource.d.ts +1 -1
  11. package/Filters/Sources/PlaneSource.d.ts +29 -28
  12. package/Filters/Sources/PointSource.d.ts +9 -8
  13. package/Filters/Sources/SphereSource.d.ts +9 -8
  14. package/IO/Geometry/STLReader.js +2 -2
  15. package/Rendering/Core/AbstractMapper.js +1 -0
  16. package/Rendering/Core/Actor2D.js +1 -3
  17. package/Rendering/Core/Light.d.ts +277 -234
  18. package/Rendering/Core/Mapper2D.d.ts +402 -0
  19. package/Rendering/Core/Mapper2D.js +213 -0
  20. package/Rendering/Core/Property.d.ts +43 -43
  21. package/Rendering/Core/Property2D/Constants.js +9 -0
  22. package/Rendering/Core/Property2D.d.ts +21 -5
  23. package/Rendering/Core/Property2D.js +30 -2
  24. package/Rendering/Core/RenderWindowInteractor.js +7 -7
  25. package/Rendering/Core/Volume.d.ts +9 -0
  26. package/Rendering/Core.js +2 -0
  27. package/Rendering/OpenGL/Actor2D.js +74 -30
  28. package/Rendering/OpenGL/ForwardPass.js +11 -0
  29. package/Rendering/OpenGL/ImageMapper.js +1 -1
  30. package/Rendering/OpenGL/PolyDataMapper.js +8 -19
  31. package/Rendering/OpenGL/PolyDataMapper2D.js +667 -0
  32. package/Rendering/OpenGL/Profiles/All.js +1 -0
  33. package/Rendering/OpenGL/Profiles/Geometry.js +1 -0
  34. package/Rendering/OpenGL/RenderWindow.js +190 -106
  35. package/Rendering/OpenGL/ShaderProgram.js +0 -12
  36. package/Rendering/OpenGL/glsl/vtkPolyData2DFS.glsl.js +3 -0
  37. package/Rendering/OpenGL/glsl/vtkPolyData2DVS.glsl.js +3 -0
  38. package/Rendering/OpenGL.js +2 -0
  39. package/Rendering/Profiles/All.js +1 -0
  40. package/Rendering/Profiles/Geometry.js +1 -0
  41. package/_virtual/rollup-plugin-web-worker-loader__helper__browser__createInlineWorkerFactory.js +17 -0
  42. package/_virtual/rollup-plugin-web-worker-loader__helper__funcToSource.js +18 -0
  43. package/_virtual/rollup-plugin-worker-loader__module_Sources/Filters/General/PaintFilter/PaintFilter.worker.js +698 -2
  44. package/_virtual/rollup-plugin-worker-loader__module_Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js +274 -2
  45. package/interfaces.d.ts +66 -24
  46. package/package.json +1 -1
  47. package/types.d.ts +4 -1
  48. package/_virtual/rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +0 -31
@@ -467,16 +467,10 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
467
467
 
468
468
  if (model.renderable.getNumberOfClippingPlanes()) {
469
469
  var numClipPlanes = model.renderable.getNumberOfClippingPlanes();
470
-
471
- if (numClipPlanes > 6) {
472
- vtkErrorMacro$1('OpenGL has a limit of 6 clipping planes');
473
- numClipPlanes = 6;
474
- }
475
-
476
- VSSource = vtkShaderProgram.substitute(VSSource, '//VTK::Clip::Dec', ['uniform int numClipPlanes;', 'uniform vec4 clipPlanes[6];', 'varying float clipDistancesVSOutput[6];']).result;
477
- VSSource = vtkShaderProgram.substitute(VSSource, '//VTK::Clip::Impl', ['for (int planeNum = 0; planeNum < 6; planeNum++)', ' {', ' if (planeNum >= numClipPlanes)', ' {', ' break;', ' }', ' clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);', ' }']).result;
478
- FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::Clip::Dec', ['uniform int numClipPlanes;', 'varying float clipDistancesVSOutput[6];']).result;
479
- FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::Clip::Impl', ['for (int planeNum = 0; planeNum < 6; planeNum++)', ' {', ' if (planeNum >= numClipPlanes)', ' {', ' break;', ' }', ' if (clipDistancesVSOutput[planeNum] < 0.0) discard;', ' }']).result;
470
+ VSSource = vtkShaderProgram.substitute(VSSource, '//VTK::Clip::Dec', ['uniform int numClipPlanes;', "uniform vec4 clipPlanes[".concat(numClipPlanes, "];"), "varying float clipDistancesVSOutput[".concat(numClipPlanes, "];")]).result;
471
+ VSSource = vtkShaderProgram.substitute(VSSource, '//VTK::Clip::Impl', ["for (int planeNum = 0; planeNum < ".concat(numClipPlanes, "; planeNum++)"), ' {', ' if (planeNum >= numClipPlanes)', ' {', ' break;', ' }', ' clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);', ' }']).result;
472
+ FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::Clip::Dec', ['uniform int numClipPlanes;', "varying float clipDistancesVSOutput[".concat(numClipPlanes, "];")]).result;
473
+ FSSource = vtkShaderProgram.substitute(FSSource, '//VTK::Clip::Impl', ["for (int planeNum = 0; planeNum < ".concat(numClipPlanes, "; planeNum++)"), ' {', ' if (planeNum >= numClipPlanes)', ' {', ' break;', ' }', ' if (clipDistancesVSOutput[planeNum] < 0.0) discard;', ' }']).result;
480
474
  }
481
475
 
482
476
  shaders.Vertex = VSSource;
@@ -715,12 +709,6 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
715
709
  if (model.renderable.getNumberOfClippingPlanes()) {
716
710
  // add all the clipping planes
717
711
  var numClipPlanes = model.renderable.getNumberOfClippingPlanes();
718
-
719
- if (numClipPlanes > 6) {
720
- vtkErrorMacro$1('OpenGL has a limit of 6 clipping planes');
721
- numClipPlanes = 6;
722
- }
723
-
724
712
  var planeEquations = [];
725
713
 
726
714
  for (var i = 0; i < numClipPlanes; i++) {
@@ -733,7 +721,7 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
733
721
  }
734
722
 
735
723
  cellBO.getProgram().setUniformi('numClipPlanes', numClipPlanes);
736
- cellBO.getProgram().setUniform4fv('clipPlanes', 6, planeEquations);
724
+ cellBO.getProgram().setUniform4fv('clipPlanes', planeEquations);
737
725
  }
738
726
 
739
727
  if (model.internalColorTexture && cellBO.getProgram().isUniformUsed('texture1')) {
@@ -1281,9 +1269,10 @@ var newInstance = newInstance$1(extend, 'vtkOpenGLPolyDataMapper'); // ---------
1281
1269
 
1282
1270
  var vtkOpenGLPolyDataMapper$1 = {
1283
1271
  newInstance: newInstance,
1284
- extend: extend
1272
+ extend: extend,
1273
+ primTypes: primTypes
1285
1274
  }; // Register ourself to OpenGL backend if imported
1286
1275
 
1287
1276
  registerOverride('vtkMapper', newInstance);
1288
1277
 
1289
- export { vtkOpenGLPolyDataMapper$1 as default, extend, newInstance };
1278
+ export { vtkOpenGLPolyDataMapper$1 as default, extend, newInstance, primTypes };