@kitware/vtk.js 34.16.3 → 34.16.6

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 (467) hide show
  1. package/CONTRIBUTING.md +8 -8
  2. package/Common/Core/CellArray.d.ts +5 -1
  3. package/Common/Core/CellArray.js +6 -10
  4. package/Common/Core/DataArray.js +9 -23
  5. package/Common/Core/ImageHelper.d.ts +2 -2
  6. package/Common/Core/ImageHelper.js +6 -8
  7. package/Common/Core/LookupTable.js +1 -3
  8. package/Common/Core/Math/index.js +19 -47
  9. package/Common/Core/MatrixBuilder.js +2 -5
  10. package/Common/Core/Points.js +3 -8
  11. package/Common/Core/PriorityQueue.js +4 -8
  12. package/Common/Core/ProgressHandler.js +4 -7
  13. package/Common/Core/ScalarsToColors.js +1 -2
  14. package/Common/Core/StringArray.js +4 -12
  15. package/Common/Core/URLExtract.js +1 -3
  16. package/Common/Core/VariantArray.js +4 -12
  17. package/Common/DataModel/AbstractPointLocator.js +1 -2
  18. package/Common/DataModel/BoundingBox.js +6 -16
  19. package/Common/DataModel/Box.js +7 -11
  20. package/Common/DataModel/CardinalSpline1D.js +2 -4
  21. package/Common/DataModel/Cell.js +2 -4
  22. package/Common/DataModel/CellLinks.js +2 -4
  23. package/Common/DataModel/CellTypes.js +2 -5
  24. package/Common/DataModel/Collection.js +1 -2
  25. package/Common/DataModel/Cone.js +1 -2
  26. package/Common/DataModel/Cylinder.js +1 -2
  27. package/Common/DataModel/DataSet/Constants.js +0 -1
  28. package/Common/DataModel/DataSet.js +2 -4
  29. package/Common/DataModel/DataSetAttributes/Constants.js +0 -4
  30. package/Common/DataModel/DataSetAttributes/FieldData.js +3 -11
  31. package/Common/DataModel/DataSetAttributes.js +1 -2
  32. package/Common/DataModel/EdgeLocator.js +2 -4
  33. package/Common/DataModel/ITKHelper.js +4 -8
  34. package/Common/DataModel/ImageData.js +17 -33
  35. package/Common/DataModel/ImplicitBoolean.js +1 -2
  36. package/Common/DataModel/ImplicitFunction.js +1 -2
  37. package/Common/DataModel/IncrementalOctreeNode.js +1 -2
  38. package/Common/DataModel/IncrementalOctreePointLocator.js +2 -3
  39. package/Common/DataModel/KochanekSpline1D.js +2 -4
  40. package/Common/DataModel/Line.js +2 -4
  41. package/Common/DataModel/Locator.js +1 -2
  42. package/Common/DataModel/MergePoints.js +1 -2
  43. package/Common/DataModel/Molecule.js +1 -2
  44. package/Common/DataModel/PiecewiseFunction.js +2 -4
  45. package/Common/DataModel/Plane.js +1 -2
  46. package/Common/DataModel/Planes.js +2 -4
  47. package/Common/DataModel/PointLocator.js +3 -7
  48. package/Common/DataModel/PointSet.js +2 -4
  49. package/Common/DataModel/PolyData.js +4 -8
  50. package/Common/DataModel/PolyLine.js +1 -2
  51. package/Common/DataModel/Polygon.js +2 -4
  52. package/Common/DataModel/Quad.js +1 -2
  53. package/Common/DataModel/SelectionNode.js +1 -2
  54. package/Common/DataModel/Sphere.js +1 -2
  55. package/Common/DataModel/Spline1D.js +2 -3
  56. package/Common/DataModel/Spline3D.js +1 -2
  57. package/Common/DataModel/Triangle.js +2 -6
  58. package/Common/DataModel/TriangleStrip.js +1 -2
  59. package/Common/Transform/LandmarkTransform.js +1 -2
  60. package/Common/Transform/Transform.js +4 -10
  61. package/Filters/Core/CleanPolyData.js +1 -2
  62. package/Filters/Core/Cutter.js +1 -3
  63. package/Filters/Core/PolyDataNormals.js +1 -3
  64. package/Filters/Core/ThresholdPoints.js +2 -4
  65. package/Filters/Cornerstone/ImageDataToCornerstoneImage.js +1 -2
  66. package/Filters/General/AppendPolyData.js +1 -2
  67. package/Filters/General/Calculator.js +40 -47
  68. package/Filters/General/ClipClosedSurface.js +1 -4
  69. package/Filters/General/ClosedPolyLineToSurfaceFilter.js +1 -2
  70. package/Filters/General/ContourLoopExtraction.js +1 -2
  71. package/Filters/General/ContourTriangulator/helper.js +1 -5
  72. package/Filters/General/ContourTriangulator.js +2 -4
  73. package/Filters/General/ImageCropFilter.js +1 -2
  74. package/Filters/General/ImageDataOutlineFilter.js +1 -2
  75. package/Filters/General/ImageMarchingCubes/caseTable.js +0 -1
  76. package/Filters/General/ImageMarchingCubes.js +1 -4
  77. package/Filters/General/ImageMarchingSquares/caseTable.js +0 -1
  78. package/Filters/General/ImageMarchingSquares.js +1 -4
  79. package/Filters/General/ImageOutlineFilter.js +1 -2
  80. package/Filters/General/ImageSliceFilter.js +1 -2
  81. package/Filters/General/ImageStreamline.js +1 -3
  82. package/Filters/General/LineFilter.js +1 -2
  83. package/Filters/General/MoleculeToRepresentation.js +2 -5
  84. package/Filters/General/OBBTree/OBBNode.js +1 -2
  85. package/Filters/General/OBBTree.js +2 -6
  86. package/Filters/General/OutlineFilter.js +1 -2
  87. package/Filters/General/PaintFilter/PaintFilter.worker.js +20 -25
  88. package/Filters/General/PaintFilter.js +1 -2
  89. package/Filters/General/ScalarToRGBA.js +1 -2
  90. package/Filters/General/ShrinkPolyData.js +2 -4
  91. package/Filters/General/TransformPolyDataFilter.js +1 -2
  92. package/Filters/General/TriangleFilter.js +1 -2
  93. package/Filters/General/TubeFilter.js +2 -6
  94. package/Filters/General/WarpScalar.js +1 -2
  95. package/Filters/General/WindowedSincPolyDataFilter.js +1 -2
  96. package/Filters/Sources/ArcSource.js +1 -2
  97. package/Filters/Sources/Arrow2DSource.js +1 -2
  98. package/Filters/Sources/ArrowSource.js +1 -2
  99. package/Filters/Sources/CircleSource.d.ts +2 -3
  100. package/Filters/Sources/CircleSource.js +1 -2
  101. package/Filters/Sources/ConcentricCylinderSource.js +2 -6
  102. package/Filters/Sources/ConeSource.js +1 -2
  103. package/Filters/Sources/CubeSource.js +6 -7
  104. package/Filters/Sources/Cursor3D.js +1 -2
  105. package/Filters/Sources/CylinderSource.js +1 -2
  106. package/Filters/Sources/DiskSource.js +1 -2
  107. package/Filters/Sources/EllipseArcSource.js +1 -2
  108. package/Filters/Sources/FrustumSource.js +1 -2
  109. package/Filters/Sources/ImageGridSource.js +1 -2
  110. package/Filters/Sources/LineSource.js +1 -2
  111. package/Filters/Sources/PlaneSource.js +21 -22
  112. package/Filters/Sources/PlatonicSolidSource.js +1 -2
  113. package/Filters/Sources/PointSource.js +1 -2
  114. package/Filters/Sources/RTAnalyticSource.js +1 -2
  115. package/Filters/Sources/SLICSource.js +1 -2
  116. package/Filters/Sources/SphereSource.js +1 -2
  117. package/Filters/Sources/TorusSource.js +1 -2
  118. package/Filters/Sources/ViewFinderSource.js +1 -2
  119. package/Filters/Texture/TextureMapToPlane.js +1 -2
  120. package/Filters/Texture/TextureMapToSphere.js +1 -2
  121. package/IO/Core/BinaryHelper.js +1 -2
  122. package/IO/Core/DataAccessHelper/HtmlDataAccessHelper.js +4 -5
  123. package/IO/Core/DataAccessHelper/HttpDataAccessHelper.js +7 -16
  124. package/IO/Core/DataAccessHelper/JSZipDataAccessHelper.js +5 -9
  125. package/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper.js +7 -16
  126. package/IO/Core/DataAccessHelper.js +1 -3
  127. package/IO/Core/HttpDataSetReader.js +10 -16
  128. package/IO/Core/HttpDataSetSeriesReader.js +4 -8
  129. package/IO/Core/HttpSceneLoader.js +3 -8
  130. package/IO/Core/ImageStream/DefaultProtocol.js +12 -42
  131. package/IO/Core/ImageStream/ViewStream.js +5 -8
  132. package/IO/Core/ImageStream.js +4 -9
  133. package/IO/Core/Serializer/ArraySerializer.js +1 -2
  134. package/IO/Core/WSLinkClient.js +14 -25
  135. package/IO/Core/ZipMultiDataSetReader.js +5 -12
  136. package/IO/Core/ZipMultiDataSetWriter.js +1 -2
  137. package/IO/Geometry/DracoReader.js +6 -10
  138. package/IO/Geometry/GLTFImporter/Animations.js +9 -14
  139. package/IO/Geometry/GLTFImporter/Constants.js +0 -1
  140. package/IO/Geometry/GLTFImporter/Parser.js +1 -3
  141. package/IO/Geometry/GLTFImporter/Reader.js +2 -5
  142. package/IO/Geometry/GLTFImporter.js +7 -12
  143. package/IO/Geometry/IFCImporter.d.ts +1 -1
  144. package/IO/Geometry/IFCImporter.js +6 -10
  145. package/IO/Geometry/PLYReader.js +6 -11
  146. package/IO/Geometry/PLYWriter.js +1 -2
  147. package/IO/Geometry/STLReader.js +6 -11
  148. package/IO/Geometry/STLWriter.js +2 -6
  149. package/IO/Image/HDRReader/Utils.js +1 -2
  150. package/IO/Image/HDRReader.js +7 -10
  151. package/IO/Image/TGAReader.js +7 -9
  152. package/IO/Image/TIFFReader.js +7 -10
  153. package/IO/Legacy/LegacyAsciiParser.js +1 -2
  154. package/IO/Legacy/PolyDataReader.js +5 -7
  155. package/IO/Misc/ElevationReader.js +1 -2
  156. package/IO/Misc/GCodeReader.js +6 -11
  157. package/IO/Misc/HttpDataSetLODsLoader.js +1 -2
  158. package/IO/Misc/ITKImageReader.js +6 -13
  159. package/IO/Misc/ITKPolyDataReader.js +6 -13
  160. package/IO/Misc/JSONNucleoReader.js +1 -2
  161. package/IO/Misc/JSONReader.js +4 -10
  162. package/IO/Misc/MTLReader.js +2 -4
  163. package/IO/Misc/OBJReader.js +4 -10
  164. package/IO/Misc/OBJWriter.js +1 -2
  165. package/IO/Misc/PDBReader.js +1 -2
  166. package/IO/Misc/SkyboxReader.js +5 -10
  167. package/IO/XML/XMLImageDataReader.js +1 -2
  168. package/IO/XML/XMLImageDataWriter.js +1 -2
  169. package/IO/XML/XMLPolyDataReader.js +1 -2
  170. package/IO/XML/XMLPolyDataWriter.js +1 -2
  171. package/IO/XML/XMLReader.js +4 -10
  172. package/IO/XML/XMLWriter.js +2 -4
  173. package/Imaging/Core/AbstractImageInterpolator.js +1 -3
  174. package/Imaging/Core/ImageInterpolator.js +1 -3
  175. package/Imaging/Core/ImagePointDataIterator.js +2 -6
  176. package/Imaging/Core/ImageReslice.js +1 -3
  177. package/Imaging/Hybrid/SampleFunction.js +1 -2
  178. package/Interaction/Animations/TimeStepBasedAnimationHandler.js +1 -2
  179. package/Interaction/Manipulators/3DControllerModelSelectorManipulator/index.js +1 -2
  180. package/Interaction/Manipulators/CompositeCameraManipulator.js +1 -2
  181. package/Interaction/Manipulators/CompositeGestureManipulator.js +1 -2
  182. package/Interaction/Manipulators/CompositeKeyboardManipulator.js +1 -2
  183. package/Interaction/Manipulators/CompositeMouseManipulator.js +1 -2
  184. package/Interaction/Manipulators/CompositeVRManipulator.js +1 -2
  185. package/Interaction/Manipulators/GestureCameraManipulator.js +1 -2
  186. package/Interaction/Manipulators/KeyboardCameraManipulator.js +1 -2
  187. package/Interaction/Manipulators/MouseBoxSelectorManipulator.js +1 -2
  188. package/Interaction/Manipulators/MouseCameraAxisRotateManipulator.js +1 -2
  189. package/Interaction/Manipulators/MouseCameraSliceManipulator.js +1 -2
  190. package/Interaction/Manipulators/MouseCameraTrackballFirstPersonManipulator.js +1 -2
  191. package/Interaction/Manipulators/MouseCameraTrackballMultiRotateManipulator.js +1 -2
  192. package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.js +1 -2
  193. package/Interaction/Manipulators/MouseCameraTrackballPanManipulatorAutoCenter.js +1 -2
  194. package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.js +1 -2
  195. package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -2
  196. package/Interaction/Manipulators/MouseCameraTrackballZoomManipulator.js +1 -2
  197. package/Interaction/Manipulators/MouseCameraTrackballZoomToMouseManipulator.js +1 -2
  198. package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -2
  199. package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -2
  200. package/Interaction/Manipulators/MouseRangeManipulator.js +4 -11
  201. package/Interaction/Manipulators/VRButtonPanManipulator.js +1 -2
  202. package/Interaction/Misc/DeviceOrientationToCamera.js +1 -2
  203. package/Interaction/Style/InteractorStyleHMDXR.js +1 -2
  204. package/Interaction/Style/InteractorStyleImage.js +1 -2
  205. package/Interaction/Style/InteractorStyleMPRSlice.js +2 -6
  206. package/Interaction/Style/InteractorStyleManipulator.js +1 -2
  207. package/Interaction/Style/InteractorStyleRemoteMouse.js +1 -2
  208. package/Interaction/Style/InteractorStyleTrackballCamera.js +1 -3
  209. package/Interaction/Style/InteractorStyleUnicam.js +1 -2
  210. package/Interaction/UI/CornerAnnotation.js +2 -4
  211. package/Interaction/UI/FPSMonitor.js +3 -9
  212. package/Interaction/UI/Slider.js +1 -3
  213. package/Interaction/UI/VolumeController.js +2 -5
  214. package/Interaction/Widgets/OrientationMarkerWidget.js +1 -2
  215. package/Interaction/Widgets/PiecewiseGaussianWidget.js +42 -59
  216. package/Proxy/Animation/AbstractAnimationProxy.js +1 -2
  217. package/Proxy/Animation/AnimationProxyManager.js +1 -2
  218. package/Proxy/Animation/TimeStepBasedAnimationHandlerProxy.js +1 -2
  219. package/Proxy/Core/AbstractRepresentationProxy.js +3 -6
  220. package/Proxy/Core/LookupTableProxy.js +1 -3
  221. package/Proxy/Core/PiecewiseFunctionProxy.js +3 -11
  222. package/Proxy/Core/ProxyManager/state.js +171 -182
  223. package/Proxy/Core/ProxyManager/view.js +3 -6
  224. package/Proxy/Core/ProxyManager.js +1 -2
  225. package/Proxy/Core/SourceProxy.js +2 -6
  226. package/Proxy/Core/View2DProxy.js +2 -4
  227. package/Proxy/Core/ViewProxy.js +20 -37
  228. package/Proxy/Representations/GeometryRepresentationProxy.js +1 -2
  229. package/Proxy/Representations/GlyphRepresentationProxy.js +1 -2
  230. package/Proxy/Representations/MoleculeRepresentationProxy.js +1 -2
  231. package/Proxy/Representations/ResliceRepresentationProxy.js +3 -8
  232. package/Proxy/Representations/SkyboxRepresentationProxy.js +1 -2
  233. package/Proxy/Representations/SliceRepresentationProxy.js +3 -8
  234. package/Proxy/Representations/SlicedGeometryRepresentationProxy.js +3 -6
  235. package/Proxy/Representations/VolumeRepresentationProxy.js +9 -17
  236. package/Rendering/Core/AbstractImageMapper.js +1 -2
  237. package/Rendering/Core/AbstractMapper.js +1 -2
  238. package/Rendering/Core/AbstractMapper3D.js +1 -2
  239. package/Rendering/Core/AbstractPicker.js +1 -2
  240. package/Rendering/Core/Actor.js +1 -2
  241. package/Rendering/Core/Actor2D.js +1 -2
  242. package/Rendering/Core/AnnotatedCubeActor.js +2 -4
  243. package/Rendering/Core/AxesActor.js +2 -4
  244. package/Rendering/Core/Camera.js +2 -6
  245. package/Rendering/Core/CellPicker.js +1 -3
  246. package/Rendering/Core/ColorTransferFunction/CssFilters.js +8 -16
  247. package/Rendering/Core/ColorTransferFunction.js +4 -10
  248. package/Rendering/Core/Coordinate.js +2 -6
  249. package/Rendering/Core/CubeAxesActor.js +4 -6
  250. package/Rendering/Core/Follower.js +1 -2
  251. package/Rendering/Core/Glyph3DMapper.js +1 -2
  252. package/Rendering/Core/HardwareSelector.js +1 -2
  253. package/Rendering/Core/ImageArrayMapper.js +6 -13
  254. package/Rendering/Core/ImageCPRMapper.js +1 -2
  255. package/Rendering/Core/ImageMapper.js +2 -5
  256. package/Rendering/Core/ImageProperty.js +9 -28
  257. package/Rendering/Core/ImageResliceMapper.js +1 -2
  258. package/Rendering/Core/ImageSlice.js +1 -2
  259. package/Rendering/Core/InteractorObserver.js +1 -2
  260. package/Rendering/Core/InteractorStyle.js +1 -2
  261. package/Rendering/Core/Light.js +1 -2
  262. package/Rendering/Core/Mapper/Static.js +1 -2
  263. package/Rendering/Core/Mapper.js +1 -6
  264. package/Rendering/Core/Mapper2D.js +1 -3
  265. package/Rendering/Core/Picker.js +1 -2
  266. package/Rendering/Core/PixelSpaceCallbackMapper.js +1 -2
  267. package/Rendering/Core/PointPicker.js +1 -2
  268. package/Rendering/Core/Prop.js +1 -2
  269. package/Rendering/Core/Prop3D.js +3 -8
  270. package/Rendering/Core/Property.js +1 -2
  271. package/Rendering/Core/Property2D.js +1 -2
  272. package/Rendering/Core/RenderWindow.js +4 -11
  273. package/Rendering/Core/RenderWindowInteractor/Constants.js +0 -1
  274. package/Rendering/Core/RenderWindowInteractor.js +7 -12
  275. package/Rendering/Core/Renderer.js +3 -6
  276. package/Rendering/Core/ScalarBarActor.js +4 -6
  277. package/Rendering/Core/Skybox.js +1 -2
  278. package/Rendering/Core/SphereMapper.js +1 -2
  279. package/Rendering/Core/StickMapper.js +1 -2
  280. package/Rendering/Core/SurfaceLICInterface.js +1 -2
  281. package/Rendering/Core/SurfaceLICMapper.js +1 -2
  282. package/Rendering/Core/TextActor.js +1 -2
  283. package/Rendering/Core/TextProperty.js +1 -2
  284. package/Rendering/Core/Texture.js +1 -2
  285. package/Rendering/Core/VectorText/Utils.js +4 -8
  286. package/Rendering/Core/VectorText.js +1 -3
  287. package/Rendering/Core/Viewport.js +2 -4
  288. package/Rendering/Core/Volume.js +1 -2
  289. package/Rendering/Core/VolumeMapper.js +1 -2
  290. package/Rendering/Core/VolumeProperty.js +9 -22
  291. package/Rendering/Misc/CanvasView.js +1 -2
  292. package/Rendering/Misc/FullScreenRenderWindow.js +1 -2
  293. package/Rendering/Misc/GenericRenderWindow.js +1 -2
  294. package/Rendering/Misc/RemoteView.js +1 -2
  295. package/Rendering/Misc/RenderWindowWithControlBar.js +1 -2
  296. package/Rendering/Misc/SynchronizableRenderWindow/BehaviorManager/CameraSynchronizer.js +1 -3
  297. package/Rendering/Misc/SynchronizableRenderWindow/BehaviorManager.js +5 -6
  298. package/Rendering/Misc/SynchronizableRenderWindow/ObjectManager.js +24 -43
  299. package/Rendering/Misc/SynchronizableRenderWindow.js +3 -6
  300. package/Rendering/Misc/TextureLODsDownloader.js +1 -2
  301. package/Rendering/OpenGL/Actor.js +1 -2
  302. package/Rendering/OpenGL/Actor2D.js +1 -2
  303. package/Rendering/OpenGL/BufferObject.js +1 -3
  304. package/Rendering/OpenGL/Camera.js +1 -2
  305. package/Rendering/OpenGL/CellArrayBufferObject.js +2 -4
  306. package/Rendering/OpenGL/Convolution2DPass.js +2 -3
  307. package/Rendering/OpenGL/CubeAxesActor.js +1 -2
  308. package/Rendering/OpenGL/ForwardPass.js +2 -4
  309. package/Rendering/OpenGL/Framebuffer.js +4 -8
  310. package/Rendering/OpenGL/Glyph3DMapper.js +1 -2
  311. package/Rendering/OpenGL/HardwareSelector.js +21 -27
  312. package/Rendering/OpenGL/Helper.js +1 -2
  313. package/Rendering/OpenGL/ImageCPRMapper.js +1 -2
  314. package/Rendering/OpenGL/ImageMapper.js +1 -2
  315. package/Rendering/OpenGL/ImageResliceMapper.js +10 -16
  316. package/Rendering/OpenGL/ImageSlice.js +1 -2
  317. package/Rendering/OpenGL/OrderIndependentTranslucentPass.js +1 -2
  318. package/Rendering/OpenGL/PixelSpaceCallbackMapper.js +1 -2
  319. package/Rendering/OpenGL/PolyDataMapper.js +1 -2
  320. package/Rendering/OpenGL/PolyDataMapper2D.js +1 -2
  321. package/Rendering/OpenGL/RadialDistortionPass.js +2 -3
  322. package/Rendering/OpenGL/RenderWindow.js +33 -53
  323. package/Rendering/OpenGL/Renderer.js +1 -3
  324. package/Rendering/OpenGL/ReplacementShaderMapper.js +2 -2
  325. package/Rendering/OpenGL/ScalarBarActor.js +1 -2
  326. package/Rendering/OpenGL/Shader.js +1 -2
  327. package/Rendering/OpenGL/ShaderCache.js +1 -2
  328. package/Rendering/OpenGL/ShaderProgram.js +4 -14
  329. package/Rendering/OpenGL/Skybox.js +1 -2
  330. package/Rendering/OpenGL/SphereMapper.js +1 -2
  331. package/Rendering/OpenGL/StickMapper.js +1 -2
  332. package/Rendering/OpenGL/SurfaceLIC/LineIntegralConvolution2D/pingpong.js +6 -12
  333. package/Rendering/OpenGL/SurfaceLIC/LineIntegralConvolution2D.js +4 -12
  334. package/Rendering/OpenGL/SurfaceLIC/SurfaceLICInterface.js +2 -4
  335. package/Rendering/OpenGL/SurfaceLIC/SurfaceLICMapper.js +1 -2
  336. package/Rendering/OpenGL/Texture.js +91 -113
  337. package/Rendering/OpenGL/TextureUnitManager.js +1 -2
  338. package/Rendering/OpenGL/VertexArrayObject.js +1 -2
  339. package/Rendering/OpenGL/ViewNodeFactory.js +1 -2
  340. package/Rendering/OpenGL/Volume.js +1 -2
  341. package/Rendering/OpenGL/VolumeMapper.js +11 -17
  342. package/Rendering/SceneGraph/RenderPass.js +2 -4
  343. package/Rendering/SceneGraph/RenderWindowViewNode.js +1 -2
  344. package/Rendering/SceneGraph/ViewNode.js +3 -6
  345. package/Rendering/SceneGraph/ViewNodeFactory.js +1 -2
  346. package/Rendering/WebGPU/Actor.js +1 -2
  347. package/Rendering/WebGPU/Actor2D.js +1 -2
  348. package/Rendering/WebGPU/BindGroup.js +1 -2
  349. package/Rendering/WebGPU/Buffer.js +2 -5
  350. package/Rendering/WebGPU/BufferManager.js +1 -2
  351. package/Rendering/WebGPU/Camera.js +1 -2
  352. package/Rendering/WebGPU/CellArrayMapper.js +3 -6
  353. package/Rendering/WebGPU/CubeAxesActor.js +1 -2
  354. package/Rendering/WebGPU/Device.js +2 -6
  355. package/Rendering/WebGPU/ForwardPass.js +2 -4
  356. package/Rendering/WebGPU/FullScreenQuad.js +1 -2
  357. package/Rendering/WebGPU/Glyph3DMapper.js +2 -4
  358. package/Rendering/WebGPU/HardwareSelectionPass.js +1 -2
  359. package/Rendering/WebGPU/HardwareSelector.js +1 -2
  360. package/Rendering/WebGPU/ImageMapper.js +1 -2
  361. package/Rendering/WebGPU/ImageSlice.js +1 -2
  362. package/Rendering/WebGPU/IndexBuffer.js +1 -2
  363. package/Rendering/WebGPU/OpaquePass.js +1 -2
  364. package/Rendering/WebGPU/OrderIndependentTranslucentPass.js +1 -2
  365. package/Rendering/WebGPU/Pipeline.js +1 -2
  366. package/Rendering/WebGPU/PixelSpaceCallbackMapper.js +1 -2
  367. package/Rendering/WebGPU/PolyDataMapper.js +1 -2
  368. package/Rendering/WebGPU/PolyDataMapper2D.js +1 -2
  369. package/Rendering/WebGPU/RenderEncoder.js +2 -5
  370. package/Rendering/WebGPU/RenderWindow.js +15 -25
  371. package/Rendering/WebGPU/Renderer.js +1 -2
  372. package/Rendering/WebGPU/Sampler.js +2 -4
  373. package/Rendering/WebGPU/ScalarBarActor.js +1 -2
  374. package/Rendering/WebGPU/ShaderCache.js +2 -4
  375. package/Rendering/WebGPU/ShaderDescription.js +2 -4
  376. package/Rendering/WebGPU/ShaderModule.js +1 -2
  377. package/Rendering/WebGPU/SimpleMapper.js +1 -3
  378. package/Rendering/WebGPU/SphereMapper.js +1 -2
  379. package/Rendering/WebGPU/StickMapper.js +1 -2
  380. package/Rendering/WebGPU/StorageBuffer.js +1 -2
  381. package/Rendering/WebGPU/Texture.js +3 -7
  382. package/Rendering/WebGPU/TextureManager.js +2 -6
  383. package/Rendering/WebGPU/TextureView.js +1 -3
  384. package/Rendering/WebGPU/UniformBuffer.js +1 -2
  385. package/Rendering/WebGPU/VertexInput.js +2 -4
  386. package/Rendering/WebGPU/ViewNodeFactory.js +1 -2
  387. package/Rendering/WebGPU/Volume.js +1 -2
  388. package/Rendering/WebGPU/VolumePass.js +1 -2
  389. package/Rendering/WebGPU/VolumePassFSQ.js +1 -2
  390. package/Rendering/WebXR/RenderWindowHelper.js +2 -6
  391. package/Widgets/Core/AbstractWidget.js +6 -10
  392. package/Widgets/Core/AbstractWidgetFactory.js +17 -22
  393. package/Widgets/Core/StateBuilder/boundsMixin.js +1 -2
  394. package/Widgets/Core/StateBuilder/color3Mixin.js +1 -2
  395. package/Widgets/Core/StateBuilder/colorMixin.js +1 -2
  396. package/Widgets/Core/StateBuilder/cornerMixin.js +1 -2
  397. package/Widgets/Core/StateBuilder/directionMixin.js +1 -2
  398. package/Widgets/Core/StateBuilder/manipulatorMixin.js +1 -2
  399. package/Widgets/Core/StateBuilder/nameMixin.js +1 -2
  400. package/Widgets/Core/StateBuilder/orientationMixin.js +1 -2
  401. package/Widgets/Core/StateBuilder/originMixin.js +1 -2
  402. package/Widgets/Core/StateBuilder/scale1Mixin.js +1 -2
  403. package/Widgets/Core/StateBuilder/scale3Mixin.js +1 -2
  404. package/Widgets/Core/StateBuilder/shapeMixin.js +1 -2
  405. package/Widgets/Core/StateBuilder/textMixin.js +1 -2
  406. package/Widgets/Core/StateBuilder/visibleMixin.js +1 -2
  407. package/Widgets/Core/StateBuilder.js +23 -33
  408. package/Widgets/Core/WidgetManager/Constants.js +0 -1
  409. package/Widgets/Core/WidgetManager.js +25 -30
  410. package/Widgets/Core/WidgetState.js +2 -4
  411. package/Widgets/Manipulators/AbstractManipulator.js +1 -2
  412. package/Widgets/Manipulators/CPRManipulator.js +1 -2
  413. package/Widgets/Manipulators/LineManipulator.js +1 -2
  414. package/Widgets/Manipulators/PickerManipulator.js +1 -2
  415. package/Widgets/Manipulators/PlaneManipulator.js +1 -2
  416. package/Widgets/Manipulators/TrackballManipulator.js +1 -2
  417. package/Widgets/Representations/ArrowHandleRepresentation.js +2 -6
  418. package/Widgets/Representations/CircleContextRepresentation.js +1 -2
  419. package/Widgets/Representations/ContextRepresentation.js +1 -2
  420. package/Widgets/Representations/ConvexFaceContextRepresentation.js +2 -6
  421. package/Widgets/Representations/CroppingOutlineRepresentation.js +1 -2
  422. package/Widgets/Representations/CubeHandleRepresentation.js +1 -2
  423. package/Widgets/Representations/GlyphRepresentation.js +3 -11
  424. package/Widgets/Representations/HandleRepresentation.js +1 -2
  425. package/Widgets/Representations/ImplicitPlaneRepresentation.js +1 -2
  426. package/Widgets/Representations/LineHandleRepresentation.js +1 -2
  427. package/Widgets/Representations/OutlineContextRepresentation.js +1 -2
  428. package/Widgets/Representations/PolyLineRepresentation.js +2 -4
  429. package/Widgets/Representations/RectangleContextRepresentation.js +1 -2
  430. package/Widgets/Representations/RotateTransformHandleRepresentation.js +1 -2
  431. package/Widgets/Representations/ScaleTransformHandleRepresentation.js +1 -2
  432. package/Widgets/Representations/SphereContextRepresentation.js +1 -2
  433. package/Widgets/Representations/SphereHandleRepresentation.js +1 -2
  434. package/Widgets/Representations/SplineContextRepresentation.js +2 -6
  435. package/Widgets/Representations/TranslateTransformHandleRepresentation/TransformHandleSource.js +1 -2
  436. package/Widgets/Representations/TranslateTransformHandleRepresentation.js +1 -2
  437. package/Widgets/Representations/WidgetRepresentation.js +6 -20
  438. package/Widgets/Widgets3D/AngleWidget.js +1 -2
  439. package/Widgets/Widgets3D/EllipseWidget.js +1 -2
  440. package/Widgets/Widgets3D/ImageCroppingWidget.js +1 -2
  441. package/Widgets/Widgets3D/ImplicitPlaneWidget.js +1 -3
  442. package/Widgets/Widgets3D/InteractiveOrientationWidget/helpers.js +6 -7
  443. package/Widgets/Widgets3D/InteractiveOrientationWidget/state.js +0 -1
  444. package/Widgets/Widgets3D/InteractiveOrientationWidget.js +1 -2
  445. package/Widgets/Widgets3D/LabelWidget.js +1 -2
  446. package/Widgets/Widgets3D/LineWidget/behavior.js +1 -2
  447. package/Widgets/Widgets3D/LineWidget/helpers.js +1 -2
  448. package/Widgets/Widgets3D/LineWidget.js +1 -2
  449. package/Widgets/Widgets3D/PaintWidget.js +1 -2
  450. package/Widgets/Widgets3D/PolyLineWidget/behavior.js +3 -4
  451. package/Widgets/Widgets3D/PolyLineWidget.js +1 -2
  452. package/Widgets/Widgets3D/RectangleWidget.js +1 -2
  453. package/Widgets/Widgets3D/ResliceCursorWidget/Constants.js +0 -1
  454. package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +0 -1
  455. package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +2 -3
  456. package/Widgets/Widgets3D/ResliceCursorWidget/state.js +1 -3
  457. package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -3
  458. package/Widgets/Widgets3D/SeedWidget.js +1 -2
  459. package/Widgets/Widgets3D/ShapeWidget/behavior.js +7 -10
  460. package/Widgets/Widgets3D/ShapeWidget.js +1 -2
  461. package/Widgets/Widgets3D/SphereWidget.js +1 -2
  462. package/Widgets/Widgets3D/SplineWidget/behavior.js +13 -13
  463. package/Widgets/Widgets3D/SplineWidget.js +1 -2
  464. package/Widgets/Widgets3D/TransformControlsWidget.js +1 -2
  465. package/_virtual/rollup-plugin-worker-loader__module_Sources/Filters/General/PaintFilter/PaintFilter.worker.js +20 -25
  466. package/macros2.js +46 -114
  467. package/package.json +22 -15
package/CONTRIBUTING.md CHANGED
@@ -60,10 +60,10 @@ Please follow the coding style:
60
60
  $ git push origin new_feature
61
61
  ```
62
62
 
63
- 10. Visit your fork in Github, browse to the "**Pull Requests**" link on the left, and use the
63
+ 10. Visit your fork in Github, browse to the "**Pull Requests**" link on the left, and use the
64
64
  "**New Pull Request**" button in the upper right to create a Pull Request.
65
65
 
66
- For more information see:
66
+ For more information see:
67
67
  [Create a Pull Request](https://help.github.com/articles/creating-a-pull-request/)
68
68
 
69
69
  If committing changes to `vtk.js@next` or `vtk.js@next-major`, then set your base branch to be `next`
@@ -106,7 +106,7 @@ you are satisfied with the staging branch changes, you can then merge into eithe
106
106
  ## Notice
107
107
 
108
108
  - Don't modify the version number in `package.json`.
109
- - Your pull request will only get merged when tests passed. Don't forget to run tests before
109
+ - Your pull request will only get merged when tests passed. Don't forget to run tests before
110
110
  submission.
111
111
 
112
112
  ```
@@ -123,18 +123,18 @@ To create and debug a test:
123
123
 
124
124
  ## Updating Documentation
125
125
 
126
- The vtk.js documentation is part of the code repository and is entirely written in
126
+ The vtk.js documentation is part of the code repository and is entirely written in
127
127
  [markdown](https://daringfireball.net/projects/markdown/).
128
128
 
129
129
  If you create an example, please list it in the [examples landing page](Documentation/content/examples/index.md).
130
130
 
131
- Images and GIF videos added to the [gallery](Documentation/content/docs/gallery) must be compressed as much as possible (e.g. 432px by 300px with 50% JPEG compression). You may want to use [ezgif.com](https://ezgif.com/).
131
+ Images and GIF videos added to the [gallery](Documentation/public/gallery) must be compressed as much as possible (e.g. 432px by 300px with 50% JPEG compression). You may want to use [ezgif.com](https://ezgif.com/).
132
132
 
133
133
  ## Reporting Issues
134
134
 
135
135
  If you encounter problems using vtk.js you may be able to find the solutions in the
136
- [troubleshooting docs](https://kitware.github.io/vtk-js/docs/misc_troubleshooting.html), in an
137
- existing [GitHub issue](https://github.com/kitware/vtk-js/issues), or via the
136
+ [troubleshooting docs](https://kitware.github.io/vtk-js/docs/misc_troubleshooting.html), in an
137
+ existing [GitHub issue](https://github.com/kitware/vtk-js/issues), or via the
138
138
  [mailing list](http://www.vtk.org/VTK/help/mailing.html).
139
- If you can't find the answer, please
139
+ If you can't find the answer, please
140
140
  [report a new issue on GitHub](https://github.com/Kitware/vtk-js/issues/new).
@@ -75,10 +75,14 @@ export function newInstance(
75
75
  ): vtkCellArray;
76
76
 
77
77
  /**
78
+ * Extracts cell sizes from a flattened cell array.
79
+ * The input cellArray follows the format: [size1, id11, id12, ..., size2, id21, id22, ...].
80
+ * This function iterates through the array to collect only the size values, which is [size1, size2, ...].
78
81
  * @static
79
82
  * @param cellArray
83
+ * @returns {number[]} An array of cell sizes.
80
84
  */
81
- export function extractCellSizes(cellArray: any): any;
85
+ export function extractCellSizes(cellArray: any): number[];
82
86
 
83
87
  /**
84
88
  * @static
@@ -10,14 +10,11 @@ const {
10
10
  // ----------------------------------------------------------------------------
11
11
 
12
12
  function extractCellSizes(cellArray) {
13
- let currentIdx = 0;
14
- return cellArray.filter((value, index) => {
15
- if (index === currentIdx) {
16
- currentIdx += value + 1;
17
- return true;
18
- }
19
- return false;
20
- });
13
+ const cellSizes = [];
14
+ for (let i = 0; i < cellArray.length; i += cellArray[i] + 1) {
15
+ cellSizes.push(cellArray[i]);
16
+ }
17
+ return cellSizes;
21
18
  }
22
19
  function getNumberOfCells(cellArray) {
23
20
  let cellId = 0;
@@ -131,8 +128,7 @@ function defaultValues(initialValues) {
131
128
 
132
129
  // ----------------------------------------------------------------------------
133
130
 
134
- function extend(publicAPI, model) {
135
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
131
+ function extend(publicAPI, model, initialValues = {}) {
136
132
  vtkDataArray.extend(publicAPI, model, defaultValues(initialValues));
137
133
  vtkCellArray(publicAPI, model);
138
134
  }
@@ -81,9 +81,7 @@ function createRangeHelper() {
81
81
  }
82
82
  };
83
83
  }
84
- function computeRange(values) {
85
- let component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
86
- let numberOfComponents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
84
+ function computeRange(values, component = 0, numberOfComponents = 1) {
87
85
  if (component < 0 && numberOfComponents > 1) {
88
86
  // Compute magnitude
89
87
  const size = values.length;
@@ -99,8 +97,7 @@ function computeRange(values) {
99
97
  }
100
98
  return fastComputeRange(values, component < 0 ? 0 : component, numberOfComponents);
101
99
  }
102
- function ensureRangeSize(rangeArray) {
103
- let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
100
+ function ensureRangeSize(rangeArray, size = 0) {
104
101
  const ranges = rangeArray || [];
105
102
  // Pad ranges with null value to get the
106
103
  while (ranges.length <= size) {
@@ -206,10 +203,7 @@ function vtkDataArray(publicAPI, model) {
206
203
  // Description:
207
204
  // Return the data component at the location specified by tupleIdx and
208
205
  // compIdx.
209
- publicAPI.getComponent = function (tupleIdx) {
210
- let compIdx = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
211
- return model.values[tupleIdx * model.numberOfComponents + compIdx];
212
- };
206
+ publicAPI.getComponent = (tupleIdx, compIdx = 0) => model.values[tupleIdx * model.numberOfComponents + compIdx];
213
207
 
214
208
  // Description:
215
209
  // Set the data component at the location specified by tupleIdx and compIdx
@@ -234,8 +228,7 @@ function vtkDataArray(publicAPI, model) {
234
228
  publicAPI.setComponent(idx, comp, value);
235
229
  };
236
230
  publicAPI.getData = () => model.size === model.values.length ? model.values : model.values.subarray(0, model.size);
237
- publicAPI.getRange = function () {
238
- let componentIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
231
+ publicAPI.getRange = (componentIndex = -1) => {
239
232
  let rangeIdx = componentIndex;
240
233
  if (rangeIdx < 0) {
241
234
  // If scalar data, then store in slot 0 (same as componentIndex = 0).
@@ -273,8 +266,7 @@ function vtkDataArray(publicAPI, model) {
273
266
  model.rangeTuple[1] = range.max;
274
267
  return model.rangeTuple;
275
268
  };
276
- publicAPI.getRanges = function () {
277
- let computeRanges = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
269
+ publicAPI.getRanges = (computeRanges = true) => {
278
270
  if (!computeRanges) {
279
271
  return structuredClone(model.ranges);
280
272
  }
@@ -340,8 +332,7 @@ function vtkDataArray(publicAPI, model) {
340
332
  const idx = model.size / model.numberOfComponents;
341
333
  return publicAPI.insertTuples(idx, tuples);
342
334
  };
343
- publicAPI.findTuple = function (tuple) {
344
- let precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : EPSILON;
335
+ publicAPI.findTuple = (tuple, precision = EPSILON) => {
345
336
  for (let i = 0; i < model.size; i += model.numberOfComponents) {
346
337
  if (Math.abs(tuple[0] - model.values[i]) <= precision) {
347
338
  let match = true;
@@ -358,8 +349,7 @@ function vtkDataArray(publicAPI, model) {
358
349
  }
359
350
  return -1;
360
351
  };
361
- publicAPI.getTuple = function (idx) {
362
- let tupleToFill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
352
+ publicAPI.getTuple = (idx, tupleToFill = []) => {
363
353
  const numberOfComponents = model.numberOfComponents || 1;
364
354
  const offset = idx * numberOfComponents;
365
355
  // Check most common component sizes first
@@ -390,10 +380,7 @@ function vtkDataArray(publicAPI, model) {
390
380
  const arr = publicAPI.getData().subarray(from, to);
391
381
  return arr.length > 0 ? arr : null;
392
382
  };
393
- publicAPI.getTupleLocation = function () {
394
- let idx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
395
- return idx * model.numberOfComponents;
396
- };
383
+ publicAPI.getTupleLocation = (idx = 1) => idx * model.numberOfComponents;
397
384
  publicAPI.getNumberOfComponents = () => model.numberOfComponents;
398
385
  publicAPI.getNumberOfValues = () => model.size;
399
386
  publicAPI.getNumberOfTuples = () => model.size / model.numberOfComponents;
@@ -535,8 +522,7 @@ const DEFAULT_VALUES = {
535
522
 
536
523
  // ----------------------------------------------------------------------------
537
524
 
538
- function extend(publicAPI, model) {
539
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
525
+ function extend(publicAPI, model, initialValues = {}) {
540
526
  Object.assign(model, DEFAULT_VALUES, initialValues);
541
527
  if (Array.isArray(initialValues.values) && initialValues.dataType === undefined) {
542
528
  console.warn('vtkDataArray.newInstance: no dataType provided, converting to Float32Array');
@@ -12,7 +12,7 @@ interface ITransform {
12
12
  * Optionally supply a bounding box to get a particular subset of the canvas.
13
13
  *
14
14
  * @param {HTMLCanvasElement} canvas The HTML canvas to convert.
15
- * @param {Number[]} [boundingBox] A bounding box of type [top, left, width, height]
15
+ * @param {Number[]} [boundingBox] A bounding box array.
16
16
  */
17
17
  export function canvasToImageData(
18
18
  canvas: HTMLCanvasElement,
@@ -22,7 +22,7 @@ export function canvasToImageData(
22
22
  /**
23
23
  * Converts an Image object to a vtkImageData.
24
24
  * @param {HTMLImageElement} image The HTML image to convert.
25
- * @param {ITransform} [transform] default={flipX: false, flipY: false, rotate: 0}
25
+ * @param {ITransform} [transform] The transform object to apply to the image.
26
26
  */
27
27
  export function imageToImageData(
28
28
  image: HTMLImageElement,
@@ -9,8 +9,7 @@ import vtkDataArray from './DataArray.js';
9
9
  * @param canvas The HTML canvas to convert
10
10
  * @param boundingBox A bounding box of type [top, left, width, height]
11
11
  */
12
- function canvasToImageData(canvas) {
13
- let boundingBox = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0, 0];
12
+ function canvasToImageData(canvas, boundingBox = [0, 0, 0, 0]) {
14
13
  const [top, left, width, height] = boundingBox;
15
14
  const ctxt = canvas.getContext('2d');
16
15
  const idata = ctxt.getImageData(top, left, width || canvas.width, height || canvas.height);
@@ -32,12 +31,11 @@ function canvasToImageData(canvas) {
32
31
  /**
33
32
  * Converts an Image object to a vtkImageData.
34
33
  */
35
- function imageToImageData(image) {
36
- let transform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
37
- flipX: false,
38
- flipY: false,
39
- rotate: 0
40
- };
34
+ function imageToImageData(image, transform = {
35
+ flipX: false,
36
+ flipY: false,
37
+ rotate: 0
38
+ }) {
41
39
  const canvas = document.createElement('canvas');
42
40
  canvas.width = image.width;
43
41
  canvas.height = image.height;
@@ -152,7 +152,6 @@ function vtkLookupTable(publicAPI, model) {
152
152
  }
153
153
  } // alpha blending
154
154
  };
155
-
156
155
  publicAPI.forceBuild = () => {
157
156
  let hinc = 0.0;
158
157
  let sinc = 0.0;
@@ -314,8 +313,7 @@ const DEFAULT_VALUES = {
314
313
 
315
314
  // ----------------------------------------------------------------------------
316
315
 
317
- function extend(publicAPI, model) {
318
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
316
+ function extend(publicAPI, model, initialValues = {}) {
319
317
  Object.assign(model, DEFAULT_VALUES, initialValues);
320
318
 
321
319
  // Inheritance
@@ -1,6 +1,6 @@
1
1
  import seedrandom from 'seedrandom';
2
2
  import { m as macro } from '../../../macros2.js';
3
- import { IDENTITY, IDENTITY_3X3, VTK_SMALL_NUMBER, EPSILON } from './Constants.js';
3
+ import { EPSILON, IDENTITY, IDENTITY_3X3, VTK_SMALL_NUMBER } from './Constants.js';
4
4
 
5
5
  const {
6
6
  vtkErrorMacro,
@@ -43,8 +43,7 @@ function swapColumnsMatrix_nxn(matrix, n, column1, column2) {
43
43
  // Global methods
44
44
  // ----------------------------------------------------------------------------
45
45
 
46
- function createArray() {
47
- let size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 3;
46
+ function createArray(size = 3) {
48
47
  // faster than Array.from and/or while loop
49
48
  const res = Array(size);
50
49
  for (let i = 0; i < size; ++i) {
@@ -75,9 +74,7 @@ const {
75
74
  min,
76
75
  max
77
76
  } = Math;
78
- function arrayMin(arr) {
79
- let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
80
- let stride = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
77
+ function arrayMin(arr, offset = 0, stride = 1) {
81
78
  let minValue = Infinity;
82
79
  for (let i = offset, len = arr.length; i < len; i += stride) {
83
80
  if (arr[i] < minValue) {
@@ -86,9 +83,7 @@ function arrayMin(arr) {
86
83
  }
87
84
  return minValue;
88
85
  }
89
- function arrayMax(arr) {
90
- let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
91
- let stride = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
86
+ function arrayMax(arr, offset = 0, stride = 1) {
92
87
  let maxValue = -Infinity;
93
88
  for (let i = offset, len = arr.length; i < len; i += stride) {
94
89
  if (maxValue < arr[i]) {
@@ -97,9 +92,7 @@ function arrayMax(arr) {
97
92
  }
98
93
  return maxValue;
99
94
  }
100
- function arrayRange(arr) {
101
- let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
102
- let stride = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
95
+ function arrayRange(arr, offset = 0, stride = 1) {
103
96
  let minValue = Infinity;
104
97
  let maxValue = -Infinity;
105
98
  for (let i = offset, len = arr.length; i < len; i += stride) {
@@ -164,9 +157,7 @@ function randomSeed(seed) {
164
157
  function getSeed() {
165
158
  return randomSeedValue;
166
159
  }
167
- function random() {
168
- let minValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
169
- let maxValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
160
+ function random(minValue = 0, maxValue = 1) {
170
161
  const delta = maxValue - minValue;
171
162
  return minValue + delta * Math.random();
172
163
  }
@@ -230,8 +221,7 @@ function cross(x, y, out) {
230
221
  out[2] = Zz;
231
222
  return out;
232
223
  }
233
- function norm(x) {
234
- let n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
224
+ function norm(x, n = 3) {
235
225
  switch (n) {
236
226
  case 1:
237
227
  return Math.abs(x);
@@ -426,10 +416,7 @@ function columnsToMat3(column0, column1, column2, mat) {
426
416
  }
427
417
  return mat;
428
418
  }
429
- function determinant2x2() {
430
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
431
- args[_key] = arguments[_key];
432
- }
419
+ function determinant2x2(...args) {
433
420
  if (args.length === 2) {
434
421
  return args[0][0] * args[1][1] - args[1][0] * args[0][1];
435
422
  }
@@ -651,8 +638,7 @@ function determinant3x3(mat_3x3) {
651
638
  * @param {Array} b an array of numbers (vector, point, matrix...)
652
639
  * @param {Number} eps tolerance
653
640
  */
654
- function areEquals(a, b) {
655
- let eps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EPSILON;
641
+ function areEquals(a, b, eps = EPSILON) {
656
642
  if (a.length !== b.length) {
657
643
  return false;
658
644
  }
@@ -678,12 +664,10 @@ function identity(n, mat) {
678
664
  }
679
665
  return mat;
680
666
  }
681
- function isIdentity(mat) {
682
- let eps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : EPSILON;
667
+ function isIdentity(mat, eps = EPSILON) {
683
668
  return areMatricesEqual(mat, IDENTITY, eps);
684
669
  }
685
- function isIdentity3x3(mat) {
686
- let eps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : EPSILON;
670
+ function isIdentity3x3(mat, eps = EPSILON) {
687
671
  return areMatricesEqual(mat, IDENTITY_3X3, eps);
688
672
  }
689
673
  function quaternionToMatrix3x3(quat_4, mat_3x3) {
@@ -712,8 +696,7 @@ function quaternionToMatrix3x3(quat_4, mat_3x3) {
712
696
  mat_3x3[5] = (yz - wx) * f;
713
697
  mat_3x3[8] = zz * f + s;
714
698
  }
715
- function roundNumber(num) {
716
- let digits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
699
+ function roundNumber(num, digits = 0) {
717
700
  if (!`${num}`.includes('e')) {
718
701
  return +`${Math.round(`${num}e+${digits}`)}e-${digits}`;
719
702
  }
@@ -724,9 +707,7 @@ function roundNumber(num) {
724
707
  }
725
708
  return +`${Math.round(`${+arr[0]}e${sig}${+arr[1] + digits}`)}e-${digits}`;
726
709
  }
727
- function roundVector(vector) {
728
- let out = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0];
729
- let digits = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
710
+ function roundVector(vector, out = [0, 0, 0], digits = 0) {
730
711
  out[0] = roundNumber(vector[0], digits);
731
712
  out[1] = roundNumber(vector[1], digits);
732
713
  out[2] = roundNumber(vector[2], digits);
@@ -1329,9 +1310,7 @@ function solveLinearSystem(A, x, size) {
1329
1310
  }
1330
1311
 
1331
1312
  // Note that A is modified during the inversion !
1332
- function invertMatrix(A, AI, size) {
1333
- let index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
1334
- let column = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
1313
+ function invertMatrix(A, AI, size, index = null, column = null) {
1335
1314
  const tmp1Size = index || createArray(size);
1336
1315
  const tmp2Size = column || createArray(size);
1337
1316
 
@@ -1423,8 +1402,7 @@ function solveHomogeneousLeastSquares(numberOfSamples, xt, xOrder, mt) {
1423
1402
  }
1424
1403
  return 1;
1425
1404
  }
1426
- function solveLeastSquares(numberOfSamples, xt, xOrder, yt, yOrder, mt) {
1427
- let checkHomogeneous = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true;
1405
+ function solveLeastSquares(numberOfSamples, xt, xOrder, yt, yOrder, mt, checkHomogeneous = true) {
1428
1406
  // check dimensional consistency
1429
1407
  if (numberOfSamples < xOrder || numberOfSamples < yOrder) {
1430
1408
  vtkWarningMacro('Insufficient number of samples. Underdetermined.');
@@ -1548,8 +1526,7 @@ function solveLeastSquares(numberOfSamples, xt, xOrder, yt, yOrder, mt) {
1548
1526
  }
1549
1527
  return successFlag;
1550
1528
  }
1551
- function hex2float(hexStr) {
1552
- let outFloatArray = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0.5, 1];
1529
+ function hex2float(hexStr, outFloatArray = [0, 0.5, 1]) {
1553
1530
  switch (hexStr.length) {
1554
1531
  case 3:
1555
1532
  // abc => #aabbcc
@@ -1715,7 +1692,6 @@ function lab2xyz(lab, xyz) {
1715
1692
  xyz[1] = ref_Y * var_Y; // ref_Y = 1.000
1716
1693
  xyz[2] = ref_Z * var_Z; // ref_Z = 1.089
1717
1694
  }
1718
-
1719
1695
  function xyz2lab(xyz, lab) {
1720
1696
  const [x, y, z] = xyz;
1721
1697
  const ref_X = 0.9505;
@@ -1833,8 +1809,7 @@ function clampValue(value, minValue, maxValue) {
1833
1809
  }
1834
1810
  return value;
1835
1811
  }
1836
- function clampVector(vector, minVector, maxVector) {
1837
- let out = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [0, 0, 0];
1812
+ function clampVector(vector, minVector, maxVector, out = [0, 0, 0]) {
1838
1813
  out[0] = clampValue(vector[0], minVector[0], maxVector[0]);
1839
1814
  out[1] = clampValue(vector[1], minVector[1], maxVector[1]);
1840
1815
  out[2] = clampValue(vector[2], minVector[2], maxVector[2]);
@@ -1941,7 +1916,6 @@ function createUninitializedBounds() {
1941
1916
  Number.MAX_VALUE, -Number.MAX_VALUE // Z
1942
1917
  ]);
1943
1918
  }
1944
-
1945
1919
  function getMajorAxisIndex(vector) {
1946
1920
  let maxValue = -1;
1947
1921
  let axisIndex = -1;
@@ -1961,8 +1935,7 @@ function getMajorAxisIndex(vector) {
1961
1935
  // the greatest absolute value from the remaining row and columns
1962
1936
  // For each association, a -1 or a 1 is set in the output, depending on
1963
1937
  // the sign of the value in the original matrix
1964
- function getSparseOrthogonalMatrix(matrix) {
1965
- let n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
1938
+ function getSparseOrthogonalMatrix(matrix, n = 3) {
1966
1939
  // Initialize rows and columns to available indices
1967
1940
  const rows = new Array(n);
1968
1941
  const cols = new Array(n);
@@ -2011,8 +1984,7 @@ function floatToHex2(value) {
2011
1984
  }
2012
1985
  return `0${integer.toString(16)}`;
2013
1986
  }
2014
- function floatRGB2HexCode(rgbArray) {
2015
- let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '#';
1987
+ function floatRGB2HexCode(rgbArray, prefix = '#') {
2016
1988
  return `${prefix}${rgbArray.map(floatToHex2).join('')}`;
2017
1989
  }
2018
1990
  function floatToChar(f) {
@@ -5,8 +5,7 @@ import { IDENTITY } from './Math/Constants.js';
5
5
  const NoOp = v => v;
6
6
  const EPSILON = 1e-6;
7
7
  class Transform {
8
- constructor() {
9
- let useDegree = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
8
+ constructor(useDegree = false) {
10
9
  this.matrix = mat4.identity(new Float64Array(16));
11
10
  this.tmp = new Float64Array(3);
12
11
  this.angleConv = useDegree ? glMatrix.toRadian : NoOp;
@@ -83,9 +82,7 @@ class Transform {
83
82
 
84
83
  //-----------
85
84
 
86
- apply(typedArray) {
87
- let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
88
- let nbIterations = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
85
+ apply(typedArray, offset = 0, nbIterations = -1) {
89
86
  if (areMatricesEqual(IDENTITY, this.matrix)) {
90
87
  // Make sure we can chain apply...
91
88
  return this;
@@ -19,8 +19,7 @@ function vtkPoints(publicAPI, model) {
19
19
 
20
20
  // Forwarding methods
21
21
  publicAPI.getNumberOfPoints = publicAPI.getNumberOfTuples;
22
- publicAPI.setNumberOfPoints = function (nbPoints) {
23
- let dimension = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
22
+ publicAPI.setNumberOfPoints = (nbPoints, dimension = 3) => {
24
23
  if (publicAPI.getNumberOfPoints() !== nbPoints) {
25
24
  model.size = nbPoints * dimension;
26
25
  model.values = macro.newTypedArray(model.dataType, model.size);
@@ -28,10 +27,7 @@ function vtkPoints(publicAPI, model) {
28
27
  publicAPI.modified();
29
28
  }
30
29
  };
31
- publicAPI.setPoint = function (idx) {
32
- for (var _len = arguments.length, xyz = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
33
- xyz[_key - 1] = arguments[_key];
34
- }
30
+ publicAPI.setPoint = (idx, ...xyz) => {
35
31
  publicAPI.setTuple(idx, xyz);
36
32
  };
37
33
  publicAPI.getPoint = publicAPI.getTuple;
@@ -98,8 +94,7 @@ const DEFAULT_VALUES = {
98
94
 
99
95
  // ----------------------------------------------------------------------------
100
96
 
101
- function extend(publicAPI, model) {
102
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
97
+ function extend(publicAPI, model, initialValues = {}) {
103
98
  Object.assign(model, DEFAULT_VALUES, initialValues);
104
99
  vtkDataArray.extend(publicAPI, model, initialValues);
105
100
  macro.getArray(publicAPI, model, ['bounds'], 6);
@@ -22,12 +22,9 @@ function vtkPriorityQueue(publicAPI, model) {
22
22
  return null;
23
23
  };
24
24
  publicAPI.deleteById = id => {
25
- model.elements = model.elements.filter(_ref => {
26
- let {
27
- element
28
- } = _ref;
29
- return element.id !== id;
30
- });
25
+ model.elements = model.elements.filter(({
26
+ element
27
+ }) => element.id !== id);
31
28
  };
32
29
  publicAPI.length = () => model.elements.length;
33
30
  }
@@ -42,8 +39,7 @@ const DEFAULT_VALUES = {
42
39
 
43
40
  // ----------------------------------------------------------------------------
44
41
 
45
- function extend(publicAPI, model) {
46
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
42
+ function extend(publicAPI, model, initialValues = {}) {
47
43
  Object.assign(model, DEFAULT_VALUES, initialValues);
48
44
 
49
45
  // Build VTK API
@@ -23,18 +23,16 @@ function vtkProgressHandler(publicAPI, model) {
23
23
  publicAPI.wrapPromise = promise => {
24
24
  publicAPI.startWork();
25
25
  return new Promise((resolve, reject) => {
26
- promise.then(function () {
26
+ promise.then((...resolveArgs) => {
27
27
  publicAPI.stopWork();
28
- resolve(...arguments);
28
+ resolve(...resolveArgs);
29
29
  }, rejectError => {
30
30
  publicAPI.stopWork();
31
31
  reject(rejectError);
32
32
  });
33
33
  });
34
34
  };
35
- publicAPI.wrapPromiseFunction = fn => function () {
36
- return publicAPI.wrapPromise(fn(...arguments));
37
- };
35
+ publicAPI.wrapPromiseFunction = fn => (...args) => publicAPI.wrapPromise(fn(...args));
38
36
  }
39
37
 
40
38
  // ----------------------------------------------------------------------------
@@ -47,8 +45,7 @@ const DEFAULT_VALUES = {
47
45
 
48
46
  // ----------------------------------------------------------------------------
49
47
 
50
- function extend(publicAPI, model) {
51
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
48
+ function extend(publicAPI, model, initialValues = {}) {
52
49
  Object.assign(model, DEFAULT_VALUES, initialValues);
53
50
 
54
51
  // Object methods
@@ -476,8 +476,7 @@ const DEFAULT_VALUES = {
476
476
 
477
477
  // ----------------------------------------------------------------------------
478
478
 
479
- function extend(publicAPI, model) {
480
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
479
+ function extend(publicAPI, model, initialValues = {}) {
481
480
  Object.assign(model, DEFAULT_VALUES, initialValues);
482
481
 
483
482
  // Object methods
@@ -11,10 +11,7 @@ function vtkStringArray(publicAPI, model) {
11
11
  // Description:
12
12
  // Return the data component at the location specified by tupleIdx and
13
13
  // compIdx.
14
- publicAPI.getComponent = function (tupleIdx) {
15
- let compIdx = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
16
- return model.values[tupleIdx * model.numberOfComponents + compIdx];
17
- };
14
+ publicAPI.getComponent = (tupleIdx, compIdx = 0) => model.values[tupleIdx * model.numberOfComponents + compIdx];
18
15
 
19
16
  // Description:
20
17
  // Set the data component at the location specified by tupleIdx and compIdx
@@ -29,8 +26,7 @@ function vtkStringArray(publicAPI, model) {
29
26
  }
30
27
  };
31
28
  publicAPI.getData = () => model.values;
32
- publicAPI.getTuple = function (idx) {
33
- let tupleToFill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
29
+ publicAPI.getTuple = (idx, tupleToFill = []) => {
34
30
  const numberOfComponents = model.numberOfComponents || 1;
35
31
  if (tupleToFill.length) {
36
32
  tupleToFill.length = numberOfComponents;
@@ -41,10 +37,7 @@ function vtkStringArray(publicAPI, model) {
41
37
  }
42
38
  return tupleToFill;
43
39
  };
44
- publicAPI.getTupleLocation = function () {
45
- let idx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
46
- return idx * model.numberOfComponents;
47
- };
40
+ publicAPI.getTupleLocation = (idx = 1) => idx * model.numberOfComponents;
48
41
  publicAPI.getNumberOfComponents = () => model.numberOfComponents;
49
42
  publicAPI.getNumberOfValues = () => model.values.length;
50
43
  publicAPI.getNumberOfTuples = () => model.values.length / model.numberOfComponents;
@@ -90,8 +83,7 @@ const DEFAULT_VALUES = {
90
83
 
91
84
  // ----------------------------------------------------------------------------
92
85
 
93
- function extend(publicAPI, model) {
94
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
86
+ function extend(publicAPI, model, initialValues = {}) {
95
87
  Object.assign(model, DEFAULT_VALUES, initialValues);
96
88
  if (!model.empty && !model.values && !model.size) {
97
89
  throw new TypeError('Cannot create vtkStringArray object without: size > 0, values');
@@ -22,9 +22,7 @@ function toNativeType(str) {
22
22
  }
23
23
  return Number(str);
24
24
  }
25
- function extractURLParameters() {
26
- let castToNativeType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
27
- let query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.search;
25
+ function extractURLParameters(castToNativeType = true, query = window.location.search) {
28
26
  const summary = {};
29
27
  const convert = castToNativeType ? toNativeType : identity;
30
28
  const params = new URLSearchParams(query);