@kitware/vtk.js 34.16.3 → 34.16.7

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 +26 -19
@@ -93,8 +93,7 @@ function loadColorTransferFunction(item) {
93
93
  const tf = vtkColorTransferFunction.newInstance(item);
94
94
  if (item.nodes) {
95
95
  tf.removeAllPoints();
96
- item.nodes.forEach(_ref => {
97
- let [x, r, g, b, midpoint, sharpness] = _ref;
96
+ item.nodes.forEach(([x, r, g, b, midpoint, sharpness]) => {
98
97
  tf.addRGBPointLong(x, r, g, b, midpoint, sharpness);
99
98
  });
100
99
  }
@@ -104,10 +103,7 @@ function loadPiecewiseFunction(item) {
104
103
  const pwf = vtkPiecewiseFunction.newInstance(item);
105
104
  if (item.points) {
106
105
  pwf.removeAllPoints();
107
- item.points.forEach(_ref2 => {
108
- let [x, y, midpoint, sharpness] = _ref2;
109
- return pwf.addPointLong(x, y, midpoint, sharpness);
110
- });
106
+ item.points.forEach(([x, y, midpoint, sharpness]) => pwf.addPointLong(x, y, midpoint, sharpness));
111
107
  }
112
108
  return pwf;
113
109
  }
@@ -414,8 +410,7 @@ const DEFAULT_VALUES = {
414
410
 
415
411
  // ----------------------------------------------------------------------------
416
412
 
417
- function extend(publicAPI, model) {
418
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
413
+ function extend(publicAPI, model, initialValues = {}) {
419
414
  Object.assign(model, DEFAULT_VALUES, initialValues);
420
415
 
421
416
  // Build VTK API
@@ -5,50 +5,20 @@ function createMethods(session) {
5
5
  registerView: viewId => session.call('viewport.image.push.observer.add', [viewId]),
6
6
  unregisterView: viewId => session.call('viewport.image.push.observer.remove', [viewId]),
7
7
  enableView: (viewId, enabled) => session.call('viewport.image.push.enabled', [viewId, enabled]),
8
- render: function () {
9
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
10
- size: [400, 400],
11
- view: -1
12
- };
13
- return session.call('viewport.image.push', [options]);
14
- },
15
- resetCamera: function () {
16
- let view = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
17
- return session.call('viewport.camera.reset', [view]);
18
- },
8
+ render: (options = {
9
+ size: [400, 400],
10
+ view: -1
11
+ }) => session.call('viewport.image.push', [options]),
12
+ resetCamera: (view = -1) => session.call('viewport.camera.reset', [view]),
19
13
  invalidateCache: viewId => session.call('viewport.image.push.invalidate.cache', [viewId]),
20
- setQuality: function (viewId, quality) {
21
- let ratio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
22
- return session.call('viewport.image.push.quality', [viewId, quality, ratio]);
23
- },
24
- setSize: function (viewId) {
25
- let width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;
26
- let height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 400;
27
- return session.call('viewport.image.push.original.size', [viewId, width, height]);
28
- },
29
- setServerAnimationFPS: function () {
30
- let fps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 30;
31
- return session.call('viewport.image.animation.fps.max', [fps]);
32
- },
14
+ setQuality: (viewId, quality, ratio = 1) => session.call('viewport.image.push.quality', [viewId, quality, ratio]),
15
+ setSize: (viewId, width = 400, height = 400) => session.call('viewport.image.push.original.size', [viewId, width, height]),
16
+ setServerAnimationFPS: (fps = 30) => session.call('viewport.image.animation.fps.max', [fps]),
33
17
  getServerAnimationFPS: () => session.call('viewport.image.animation.fps.get', []),
34
- startAnimation: function () {
35
- let viewId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
36
- return session.call('viewport.image.animation.start', [viewId]);
37
- },
38
- stopAnimation: function () {
39
- let viewId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
40
- return session.call('viewport.image.animation.stop', [viewId]);
41
- },
42
- updateCamera: function (viewId, focalPoint, viewUp, position) {
43
- let forceUpdate = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
44
- return session.call('viewport.camera.update', [viewId ?? -1, focalPoint, viewUp, position, forceUpdate]);
45
- },
46
- updateCameraParameters: function () {
47
- let viewId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
48
- let parameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
49
- let forceUpdate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
50
- return session.call('viewport.camera.update.params', [viewId, parameters, forceUpdate]);
51
- }
18
+ startAnimation: (viewId = -1) => session.call('viewport.image.animation.start', [viewId]),
19
+ stopAnimation: (viewId = -1) => session.call('viewport.image.animation.stop', [viewId]),
20
+ updateCamera: (viewId, focalPoint, viewUp, position, forceUpdate = true) => session.call('viewport.camera.update', [viewId ?? -1, focalPoint, viewUp, position, forceUpdate]),
21
+ updateCameraParameters: (viewId = -1, parameters = {}, forceUpdate = true) => session.call('viewport.camera.update.params', [viewId, parameters, forceUpdate])
52
22
  };
53
23
  }
54
24
 
@@ -26,8 +26,7 @@ function vtkViewStream(publicAPI, model) {
26
26
 
27
27
  // --------------------------------------------------------------------------
28
28
 
29
- function prepareDecodingPool() {
30
- let size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2;
29
+ function prepareDecodingPool(size = 2) {
31
30
  while (model.imageDecodingPool.length < size) {
32
31
  model.imageDecodingPool.push(new Image());
33
32
  }
@@ -154,10 +153,9 @@ function vtkViewStream(publicAPI, model) {
154
153
  }
155
154
  model.viewId = id;
156
155
  if (model.viewId) {
157
- model.protocol.registerView(model.viewId).then(_ref => {
158
- let {
159
- viewId
160
- } = _ref;
156
+ model.protocol.registerView(model.viewId).then(({
157
+ viewId
158
+ }) => {
161
159
  model.viewId = viewId;
162
160
  });
163
161
  }
@@ -250,8 +248,7 @@ const DEFAULT_VALUES = {
250
248
 
251
249
  // ----------------------------------------------------------------------------
252
250
 
253
- function extend(publicAPI, model) {
254
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
251
+ function extend(publicAPI, model, initialValues = {}) {
255
252
  Object.assign(model, DEFAULT_VALUES, initialValues);
256
253
 
257
254
  // Object methods
@@ -24,8 +24,7 @@ function vtkImageStream(publicAPI, model) {
24
24
  // PublicAPI
25
25
  // --------------------------------------------------------------------------
26
26
 
27
- publicAPI.setServerAnimationFPS = function () {
28
- let maxFPS = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 30;
27
+ publicAPI.setServerAnimationFPS = (maxFPS = 30) => {
29
28
  let changeDetected = false;
30
29
  if (model.serverAnimationFPS !== maxFPS) {
31
30
  model.serverAnimationFPS = maxFPS;
@@ -42,8 +41,7 @@ function vtkImageStream(publicAPI, model) {
42
41
 
43
42
  // --------------------------------------------------------------------------
44
43
 
45
- publicAPI.connect = function (session) {
46
- let protocol = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : createMethods;
44
+ publicAPI.connect = (session, protocol = createMethods) => {
47
45
  if (model.connected || !session || !protocol) {
48
46
  return;
49
47
  }
@@ -82,9 +80,7 @@ function vtkImageStream(publicAPI, model) {
82
80
 
83
81
  // --------------------------------------------------------------------------
84
82
 
85
- publicAPI.createViewStream = function () {
86
- let viewId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '-1';
87
- let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [400, 400];
83
+ publicAPI.createViewStream = (viewId = '-1', size = [400, 400]) => {
88
84
  const {
89
85
  setServerAnimationFPS,
90
86
  getServerAnimationFPS,
@@ -126,8 +122,7 @@ const DEFAULT_VALUES = {
126
122
 
127
123
  // ----------------------------------------------------------------------------
128
124
 
129
- function extend(publicAPI, model) {
130
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
125
+ function extend(publicAPI, model, initialValues = {}) {
131
126
  Object.assign(model, DEFAULT_VALUES, initialValues);
132
127
 
133
128
  // Object methods
@@ -58,8 +58,7 @@ function vtkArraySerializer(publicAPI, model) {
58
58
 
59
59
  // ----------------------------------------------------------------------------
60
60
 
61
- function extend(publicAPI, model) {
62
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
61
+ function extend(publicAPI, model, initialValues = {}) {
63
62
  Object.assign(model, initialValues);
64
63
  macro.obj(publicAPI, model);
65
64
  macro.setGet(publicAPI, model, ['typedArrayHandler']);
@@ -18,27 +18,21 @@ function setSmartConnectClass(klass) {
18
18
  // ----------------------------------------------------------------------------
19
19
 
20
20
  function busy(fn, update) {
21
- return function () {
22
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
23
- args[_key] = arguments[_key];
24
- }
25
- return new Promise((resolve, reject) => {
26
- update(1);
27
- fn(...args).then(response => {
28
- update(-1);
29
- resolve(response);
30
- }, error => {
31
- update(-1);
32
- reject(error);
33
- });
21
+ return (...args) => new Promise((resolve, reject) => {
22
+ update(1);
23
+ fn(...args).then(response => {
24
+ update(-1);
25
+ resolve(response);
26
+ }, error => {
27
+ update(-1);
28
+ reject(error);
34
29
  });
35
- };
30
+ });
36
31
  }
37
32
 
38
33
  // ----------------------------------------------------------------------------
39
34
 
40
- function busyWrap(methodMap, update) {
41
- let skipList = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
35
+ function busyWrap(methodMap, update, skipList = []) {
42
36
  const busyContainer = {};
43
37
  Object.keys(methodMap).forEach(methodName => {
44
38
  if (skipList.indexOf(methodName) === -1) {
@@ -68,8 +62,7 @@ function vtkWSLinkClient(publicAPI, model) {
68
62
 
69
63
  // --------------------------------------------------------------------------
70
64
 
71
- function updateBusy() {
72
- let delta = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
65
+ function updateBusy(delta = 0) {
73
66
  model.busyCount += delta;
74
67
 
75
68
  // Clear any pending timeout
@@ -97,9 +90,7 @@ function vtkWSLinkClient(publicAPI, model) {
97
90
 
98
91
  // --------------------------------------------------------------------------
99
92
 
100
- publicAPI.connect = function () {
101
- let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
102
- let configDecorator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
93
+ publicAPI.connect = (config = {}, configDecorator = null) => {
103
94
  if (!SMART_CONNECT_CLASS) {
104
95
  return Promise.reject(new Error('Need to provide SmartConnect'));
105
96
  }
@@ -157,8 +148,7 @@ function vtkWSLinkClient(publicAPI, model) {
157
148
 
158
149
  // --------------------------------------------------------------------------
159
150
 
160
- publicAPI.disconnect = function () {
161
- let timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 60;
151
+ publicAPI.disconnect = (timeout = 60) => {
162
152
  if (model.connection) {
163
153
  model.connection.destroy(timeout);
164
154
  model.connection = null;
@@ -197,8 +187,7 @@ const DEFAULT_VALUES = {
197
187
 
198
188
  // ----------------------------------------------------------------------------
199
189
 
200
- function extend(publicAPI, model) {
201
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
190
+ function extend(publicAPI, model, initialValues = {}) {
202
191
  Object.assign(model, DEFAULT_VALUES, initialValues);
203
192
 
204
193
  // Object methods
@@ -20,14 +20,12 @@ function vtkZipMultiDataSetReader(publicAPI, model) {
20
20
  }
21
21
 
22
22
  // Internal method to fetch Array
23
- function fetchData(url) {
24
- let option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
23
+ function fetchData(url, option = {}) {
25
24
  return model.dataAccessHelper.fetchBinary(url, option);
26
25
  }
27
26
 
28
27
  // Set DataSet url
29
- publicAPI.setUrl = function (url) {
30
- let option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
28
+ publicAPI.setUrl = (url, option = {}) => {
31
29
  model.url = url;
32
30
 
33
31
  // Remove the file in the URL
@@ -40,10 +38,7 @@ function vtkZipMultiDataSetReader(publicAPI, model) {
40
38
  };
41
39
 
42
40
  // Fetch the actual data arrays
43
- publicAPI.loadData = function () {
44
- let option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
45
- return fetchData(model.url, option).then(publicAPI.parseAsArrayBuffer);
46
- };
41
+ publicAPI.loadData = (option = {}) => fetchData(model.url, option).then(publicAPI.parseAsArrayBuffer);
47
42
  publicAPI.parseAsArrayBuffer = arrayBuffer => {
48
43
  if (!arrayBuffer) {
49
44
  return Promise.reject(new Error('No ArrayBuffer to parse'));
@@ -52,8 +47,7 @@ function vtkZipMultiDataSetReader(publicAPI, model) {
52
47
  model.arrays = [];
53
48
  const decompressedFiles = unzipSync(new Uint8Array(arrayBuffer));
54
49
  try {
55
- Object.entries(decompressedFiles).forEach(_ref => {
56
- let [relativePath, fileData] = _ref;
50
+ Object.entries(decompressedFiles).forEach(([relativePath, fileData]) => {
57
51
  if (relativePath.match(/datasets\.json$/i)) {
58
52
  model.datasets = JSON.parse(strFromU8(fileData));
59
53
  }
@@ -81,8 +75,7 @@ const DEFAULT_VALUES = {};
81
75
 
82
76
  // ----------------------------------------------------------------------------
83
77
 
84
- function extend(publicAPI, model) {
85
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
78
+ function extend(publicAPI, model, initialValues = {}) {
86
79
  Object.assign(model, DEFAULT_VALUES, initialValues);
87
80
 
88
81
  // Make this a VTK object
@@ -62,8 +62,7 @@ const DEFAULT_VALUES = {
62
62
 
63
63
  // ----------------------------------------------------------------------------
64
64
 
65
- function extend(publicAPI, model) {
66
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
65
+ function extend(publicAPI, model, initialValues = {}) {
67
66
  Object.assign(model, DEFAULT_VALUES, initialValues);
68
67
 
69
68
  // Make this a VTK object
@@ -208,8 +208,7 @@ function vtkDracoReader(publicAPI, model) {
208
208
  }
209
209
 
210
210
  // Internal method to fetch Array
211
- function fetchData(url) {
212
- let option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
211
+ function fetchData(url, option = {}) {
213
212
  const {
214
213
  compression,
215
214
  progressCallback
@@ -227,10 +226,9 @@ function vtkDracoReader(publicAPI, model) {
227
226
  }
228
227
 
229
228
  // Set DataSet url
230
- publicAPI.setUrl = function (url) {
231
- let option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
232
- binary: true
233
- };
229
+ publicAPI.setUrl = (url, option = {
230
+ binary: true
231
+ }) => {
234
232
  model.url = url;
235
233
 
236
234
  // Remove the file in the URL
@@ -247,8 +245,7 @@ function vtkDracoReader(publicAPI, model) {
247
245
  };
248
246
 
249
247
  // Fetch the actual data arrays
250
- publicAPI.loadData = function () {
251
- let option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
248
+ publicAPI.loadData = (option = {}) => {
252
249
  const promise = fetchData(model.url, option);
253
250
  promise.then(publicAPI.parse);
254
251
  return promise;
@@ -306,8 +303,7 @@ const DEFAULT_VALUES = {
306
303
 
307
304
  // ----------------------------------------------------------------------------
308
305
 
309
- function extend(publicAPI, model) {
310
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
306
+ function extend(publicAPI, model, initialValues = {}) {
311
307
  Object.assign(model, DEFAULT_VALUES, initialValues);
312
308
 
313
309
  // Build VTK API
@@ -178,8 +178,7 @@ function createAnimationMixer(nodes, accessors) {
178
178
  animations.set(glTFAnimation.id, annimation);
179
179
  vtkDebugMacro(`Animation "${glTFAnimation.id}" added to mixer`);
180
180
  }
181
- function play(name) {
182
- let weight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
181
+ function play(name, weight = 1) {
183
182
  if (!animations.has(name)) {
184
183
  vtkWarningMacro(`Animation "${name}" not found in mixer`);
185
184
  return;
@@ -204,18 +203,14 @@ function createAnimationMixer(nodes, accessors) {
204
203
  }
205
204
  function update(deltaTime) {
206
205
  // Normalize weights
207
- const totalWeight = Array.from(activeAnimations.values()).reduce((sum, _ref) => {
208
- let {
209
- weight
210
- } = _ref;
211
- return sum + weight;
212
- }, 0);
213
- activeAnimations.forEach((_ref2, name) => {
214
- let {
215
- animation,
216
- weight,
217
- time
218
- } = _ref2;
206
+ const totalWeight = Array.from(activeAnimations.values()).reduce((sum, {
207
+ weight
208
+ }) => sum + weight, 0);
209
+ activeAnimations.forEach(({
210
+ animation,
211
+ weight,
212
+ time
213
+ }, name) => {
219
214
  const normalizedWeight = totalWeight > 0 ? weight / totalWeight : 0;
220
215
  const newTime = time + deltaTime;
221
216
  activeAnimations.set(name, {
@@ -29,7 +29,6 @@ const BYTES = {
29
29
  // UNSIGNED_INT
30
30
  5126: 4 // FLOAT
31
31
  };
32
-
33
32
  const MODES = {
34
33
  GL_POINTS: 0,
35
34
  GL_LINES: 1,
@@ -8,8 +8,7 @@ const {
8
8
  vtkWarningMacro
9
9
  } = macro;
10
10
  class GLTFParser {
11
- constructor(glTF) {
12
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
11
+ constructor(glTF, options = {}) {
13
12
  const {
14
13
  json,
15
14
  baseUri = ''
@@ -116,7 +115,6 @@ class GLTFParser {
116
115
  if (primitive.mode === undefined) {
117
116
  primitive.mode = MODES.GL_TRIANGLES; // Default one
118
117
  }
119
-
120
118
  if (primitive.extensions?.KHR_draco_mesh_compression) {
121
119
  vtkDebugMacro('Using Draco mesh compression');
122
120
  const bufferView = this.get('bufferViews', primitive.extensions.KHR_draco_mesh_compression.bufferView);
@@ -46,8 +46,7 @@ async function createPolyDataFromGLTFMesh(primitive) {
46
46
  const cells = vtkCellArray.newInstance();
47
47
  const pointData = polyData.getPointData();
48
48
  const attrs = Object.entries(primitive.attributes);
49
- attrs.forEach(async _ref => {
50
- let [attributeName, accessor] = _ref;
49
+ attrs.forEach(async ([attributeName, accessor]) => {
51
50
  switch (attributeName) {
52
51
  case SEMANTIC_ATTRIBUTE_MAP.POSITION:
53
52
  {
@@ -380,9 +379,7 @@ function getTransformationMatrix(node) {
380
379
  * @param {vtkActor} parentActor The parent actor
381
380
  * @param {mat4} parentMatrix The parent matrix
382
381
  */
383
- async function processNode(node, model) {
384
- let parentActor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
385
- let parentMatrix = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : mat4.create();
382
+ async function processNode(node, model, parentActor = null, parentMatrix = mat4.create()) {
386
383
  node.transform = getTransformationMatrix(node);
387
384
  const worldMatrix = mat4.multiply(mat4.create(), parentMatrix, node.transform);
388
385
 
@@ -26,8 +26,7 @@ function vtkGLTFImporter(publicAPI, model) {
26
26
  }
27
27
 
28
28
  // Internal method to fetch Array
29
- function fetchData(url) {
30
- let option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
29
+ function fetchData(url, option = {}) {
31
30
  const {
32
31
  compression,
33
32
  progressCallback
@@ -45,10 +44,9 @@ function vtkGLTFImporter(publicAPI, model) {
45
44
  }
46
45
 
47
46
  // Set DataSet url
48
- publicAPI.setUrl = function (url) {
49
- let option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
50
- binary: true
51
- };
47
+ publicAPI.setUrl = (url, option = {
48
+ binary: true
49
+ }) => {
52
50
  model.url = url;
53
51
 
54
52
  // Remove the file in the URL
@@ -66,8 +64,7 @@ function vtkGLTFImporter(publicAPI, model) {
66
64
  };
67
65
 
68
66
  // Fetch the actual data arrays
69
- publicAPI.loadData = function () {
70
- let option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
67
+ publicAPI.loadData = (option = {}) => {
71
68
  const promise = fetchData(model.url, option);
72
69
  promise.then(publicAPI.parse);
73
70
  return promise;
@@ -182,8 +179,7 @@ function vtkGLTFImporter(publicAPI, model) {
182
179
  model.renderer.setActiveCamera(camera);
183
180
  };
184
181
  publicAPI.switchToVariant = async variantIndex => {
185
- const promises = Array.from(model.actors).map(async _ref => {
186
- let [nodeId, actor] = _ref;
182
+ const promises = Array.from(model.actors).map(async ([nodeId, actor]) => {
187
183
  vtkDebugMacro('Switching to variant', variantIndex, 'for node', nodeId);
188
184
  const variantMappings = model.variantMappings.get(nodeId);
189
185
  if (variantMappings) {
@@ -210,8 +206,7 @@ const DEFAULT_VALUES = {
210
206
 
211
207
  // ----------------------------------------------------------------------------
212
208
 
213
- function extend(publicAPI, model) {
214
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
209
+ function extend(publicAPI, model, initialValues = {}) {
215
210
  Object.assign(model, DEFAULT_VALUES, initialValues);
216
211
 
217
212
  // Build VTK API
@@ -145,7 +145,7 @@ export function newInstance(
145
145
  * }
146
146
  *
147
147
  * vtkResourceLoader
148
- * .loadScript('https://cdn.jsdelivr.net/npm/web-ifc@0.0.55/web-ifc-api-iife.js')
148
+ * .loadScript('https://esm.sh/web-ifc@0.0.55/web-ifc-api-iife.js')
149
149
  * .then(() => {
150
150
  * // Pass WebIFC api to vtkIFCImporter
151
151
  * vtkIFCImporter.setIFCAPI(window.WebIFC);
@@ -153,7 +153,7 @@ function vtkIFCImporter(publicAPI, model) {
153
153
  if (!model.dataAccessHelper) {
154
154
  model.dataAccessHelper = DataAccessHelper.get('http');
155
155
  }
156
- function fetchData(url) {
156
+ function fetchData(url, options = {}) {
157
157
  const {
158
158
  compression,
159
159
  progressCallback
@@ -163,18 +163,15 @@ function vtkIFCImporter(publicAPI, model) {
163
163
  progressCallback
164
164
  });
165
165
  }
166
- publicAPI.setUrl = function (url) {
167
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
168
- binary: true
169
- };
166
+ publicAPI.setUrl = (url, options = {
167
+ binary: true
168
+ }) => {
170
169
  model.url = url;
171
170
  model.baseURL = url.split('/').slice(0, -1).join('/');
172
171
  model.compression = options.compression;
173
172
  return publicAPI.loadData(options);
174
173
  };
175
- publicAPI.loadData = function () {
176
- return fetchData(model.url).then(publicAPI.parse);
177
- };
174
+ publicAPI.loadData = (options = {}) => fetchData(model.url, options).then(publicAPI.parse);
178
175
  publicAPI.parse = content => {
179
176
  publicAPI.parseAsArrayBuffer(content);
180
177
  };
@@ -244,8 +241,7 @@ function vtkIFCImporter(publicAPI, model) {
244
241
  const DEFAULT_VALUES = {
245
242
  mergeGeometries: false
246
243
  };
247
- function extend(publicAPI, model) {
248
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
244
+ function extend(publicAPI, model, initialValues = {}) {
249
245
  Object.assign(model, DEFAULT_VALUES, initialValues);
250
246
  macro.obj(publicAPI, model);
251
247
  macro.get(publicAPI, model, ['url', 'baseURL']);
@@ -287,7 +287,6 @@ function postProcess(buffer, elements, faceTextureTolerance, duplicatePointsForF
287
287
  verts[i * 2] = 1; // number of points in vertex cell (always 1)
288
288
  verts[i * 2 + 1] = i; // point index
289
289
  }
290
-
291
290
  polydata.getVerts().setData(verts);
292
291
  }
293
292
  if (hasColor) {
@@ -476,8 +475,7 @@ function vtkPLYReader(publicAPI, model) {
476
475
  }
477
476
 
478
477
  // Internal method to fetch Array
479
- function fetchData(url) {
480
- let option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
478
+ function fetchData(url, option = {}) {
481
479
  const {
482
480
  compression,
483
481
  progressCallback
@@ -495,10 +493,9 @@ function vtkPLYReader(publicAPI, model) {
495
493
  }
496
494
 
497
495
  // Set DataSet url
498
- publicAPI.setUrl = function (url) {
499
- let option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
500
- binary: true
501
- };
496
+ publicAPI.setUrl = (url, option = {
497
+ binary: true
498
+ }) => {
502
499
  model.url = url;
503
500
 
504
501
  // Remove the file in the URL
@@ -515,8 +512,7 @@ function vtkPLYReader(publicAPI, model) {
515
512
  };
516
513
 
517
514
  // Fetch the actual data arrays
518
- publicAPI.loadData = function () {
519
- let option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
515
+ publicAPI.loadData = (option = {}) => {
520
516
  const promise = fetchData(model.url, option);
521
517
  promise.then(publicAPI.parse);
522
518
  return promise;
@@ -663,8 +659,7 @@ const DEFAULT_VALUES = {
663
659
 
664
660
  // ----------------------------------------------------------------------------
665
661
 
666
- function extend(publicAPI, model) {
667
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
662
+ function extend(publicAPI, model, initialValues = {}) {
668
663
  Object.assign(model, DEFAULT_VALUES, initialValues);
669
664
 
670
665
  // Build VTK API
@@ -276,8 +276,7 @@ const DEFAULT_VALUES = {
276
276
 
277
277
  // ----------------------------------------------------------------------------
278
278
 
279
- function extend(publicAPI, model) {
280
- let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
279
+ function extend(publicAPI, model, initialValues = {}) {
281
280
  Object.assign(model, DEFAULT_VALUES, initialValues);
282
281
 
283
282
  // Make this a VTK object