@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.
- package/CONTRIBUTING.md +8 -8
- package/Common/Core/CellArray.d.ts +5 -1
- package/Common/Core/CellArray.js +6 -10
- package/Common/Core/DataArray.js +9 -23
- package/Common/Core/ImageHelper.d.ts +2 -2
- package/Common/Core/ImageHelper.js +6 -8
- package/Common/Core/LookupTable.js +1 -3
- package/Common/Core/Math/index.js +19 -47
- package/Common/Core/MatrixBuilder.js +2 -5
- package/Common/Core/Points.js +3 -8
- package/Common/Core/PriorityQueue.js +4 -8
- package/Common/Core/ProgressHandler.js +4 -7
- package/Common/Core/ScalarsToColors.js +1 -2
- package/Common/Core/StringArray.js +4 -12
- package/Common/Core/URLExtract.js +1 -3
- package/Common/Core/VariantArray.js +4 -12
- package/Common/DataModel/AbstractPointLocator.js +1 -2
- package/Common/DataModel/BoundingBox.js +6 -16
- package/Common/DataModel/Box.js +7 -11
- package/Common/DataModel/CardinalSpline1D.js +2 -4
- package/Common/DataModel/Cell.js +2 -4
- package/Common/DataModel/CellLinks.js +2 -4
- package/Common/DataModel/CellTypes.js +2 -5
- package/Common/DataModel/Collection.js +1 -2
- package/Common/DataModel/Cone.js +1 -2
- package/Common/DataModel/Cylinder.js +1 -2
- package/Common/DataModel/DataSet/Constants.js +0 -1
- package/Common/DataModel/DataSet.js +2 -4
- package/Common/DataModel/DataSetAttributes/Constants.js +0 -4
- package/Common/DataModel/DataSetAttributes/FieldData.js +3 -11
- package/Common/DataModel/DataSetAttributes.js +1 -2
- package/Common/DataModel/EdgeLocator.js +2 -4
- package/Common/DataModel/ITKHelper.js +4 -8
- package/Common/DataModel/ImageData.js +17 -33
- package/Common/DataModel/ImplicitBoolean.js +1 -2
- package/Common/DataModel/ImplicitFunction.js +1 -2
- package/Common/DataModel/IncrementalOctreeNode.js +1 -2
- package/Common/DataModel/IncrementalOctreePointLocator.js +2 -3
- package/Common/DataModel/KochanekSpline1D.js +2 -4
- package/Common/DataModel/Line.js +2 -4
- package/Common/DataModel/Locator.js +1 -2
- package/Common/DataModel/MergePoints.js +1 -2
- package/Common/DataModel/Molecule.js +1 -2
- package/Common/DataModel/PiecewiseFunction.js +2 -4
- package/Common/DataModel/Plane.js +1 -2
- package/Common/DataModel/Planes.js +2 -4
- package/Common/DataModel/PointLocator.js +3 -7
- package/Common/DataModel/PointSet.js +2 -4
- package/Common/DataModel/PolyData.js +4 -8
- package/Common/DataModel/PolyLine.js +1 -2
- package/Common/DataModel/Polygon.js +2 -4
- package/Common/DataModel/Quad.js +1 -2
- package/Common/DataModel/SelectionNode.js +1 -2
- package/Common/DataModel/Sphere.js +1 -2
- package/Common/DataModel/Spline1D.js +2 -3
- package/Common/DataModel/Spline3D.js +1 -2
- package/Common/DataModel/Triangle.js +2 -6
- package/Common/DataModel/TriangleStrip.js +1 -2
- package/Common/Transform/LandmarkTransform.js +1 -2
- package/Common/Transform/Transform.js +4 -10
- package/Filters/Core/CleanPolyData.js +1 -2
- package/Filters/Core/Cutter.js +1 -3
- package/Filters/Core/PolyDataNormals.js +1 -3
- package/Filters/Core/ThresholdPoints.js +2 -4
- package/Filters/Cornerstone/ImageDataToCornerstoneImage.js +1 -2
- package/Filters/General/AppendPolyData.js +1 -2
- package/Filters/General/Calculator.js +40 -47
- package/Filters/General/ClipClosedSurface.js +1 -4
- package/Filters/General/ClosedPolyLineToSurfaceFilter.js +1 -2
- package/Filters/General/ContourLoopExtraction.js +1 -2
- package/Filters/General/ContourTriangulator/helper.js +1 -5
- package/Filters/General/ContourTriangulator.js +2 -4
- package/Filters/General/ImageCropFilter.js +1 -2
- package/Filters/General/ImageDataOutlineFilter.js +1 -2
- package/Filters/General/ImageMarchingCubes/caseTable.js +0 -1
- package/Filters/General/ImageMarchingCubes.js +1 -4
- package/Filters/General/ImageMarchingSquares/caseTable.js +0 -1
- package/Filters/General/ImageMarchingSquares.js +1 -4
- package/Filters/General/ImageOutlineFilter.js +1 -2
- package/Filters/General/ImageSliceFilter.js +1 -2
- package/Filters/General/ImageStreamline.js +1 -3
- package/Filters/General/LineFilter.js +1 -2
- package/Filters/General/MoleculeToRepresentation.js +2 -5
- package/Filters/General/OBBTree/OBBNode.js +1 -2
- package/Filters/General/OBBTree.js +2 -6
- package/Filters/General/OutlineFilter.js +1 -2
- package/Filters/General/PaintFilter/PaintFilter.worker.js +20 -25
- package/Filters/General/PaintFilter.js +1 -2
- package/Filters/General/ScalarToRGBA.js +1 -2
- package/Filters/General/ShrinkPolyData.js +2 -4
- package/Filters/General/TransformPolyDataFilter.js +1 -2
- package/Filters/General/TriangleFilter.js +1 -2
- package/Filters/General/TubeFilter.js +2 -6
- package/Filters/General/WarpScalar.js +1 -2
- package/Filters/General/WindowedSincPolyDataFilter.js +1 -2
- package/Filters/Sources/ArcSource.js +1 -2
- package/Filters/Sources/Arrow2DSource.js +1 -2
- package/Filters/Sources/ArrowSource.js +1 -2
- package/Filters/Sources/CircleSource.d.ts +2 -3
- package/Filters/Sources/CircleSource.js +1 -2
- package/Filters/Sources/ConcentricCylinderSource.js +2 -6
- package/Filters/Sources/ConeSource.js +1 -2
- package/Filters/Sources/CubeSource.js +6 -7
- package/Filters/Sources/Cursor3D.js +1 -2
- package/Filters/Sources/CylinderSource.js +1 -2
- package/Filters/Sources/DiskSource.js +1 -2
- package/Filters/Sources/EllipseArcSource.js +1 -2
- package/Filters/Sources/FrustumSource.js +1 -2
- package/Filters/Sources/ImageGridSource.js +1 -2
- package/Filters/Sources/LineSource.js +1 -2
- package/Filters/Sources/PlaneSource.js +21 -22
- package/Filters/Sources/PlatonicSolidSource.js +1 -2
- package/Filters/Sources/PointSource.js +1 -2
- package/Filters/Sources/RTAnalyticSource.js +1 -2
- package/Filters/Sources/SLICSource.js +1 -2
- package/Filters/Sources/SphereSource.js +1 -2
- package/Filters/Sources/TorusSource.js +1 -2
- package/Filters/Sources/ViewFinderSource.js +1 -2
- package/Filters/Texture/TextureMapToPlane.js +1 -2
- package/Filters/Texture/TextureMapToSphere.js +1 -2
- package/IO/Core/BinaryHelper.js +1 -2
- package/IO/Core/DataAccessHelper/HtmlDataAccessHelper.js +4 -5
- package/IO/Core/DataAccessHelper/HttpDataAccessHelper.js +7 -16
- package/IO/Core/DataAccessHelper/JSZipDataAccessHelper.js +5 -9
- package/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper.js +7 -16
- package/IO/Core/DataAccessHelper.js +1 -3
- package/IO/Core/HttpDataSetReader.js +10 -16
- package/IO/Core/HttpDataSetSeriesReader.js +4 -8
- package/IO/Core/HttpSceneLoader.js +3 -8
- package/IO/Core/ImageStream/DefaultProtocol.js +12 -42
- package/IO/Core/ImageStream/ViewStream.js +5 -8
- package/IO/Core/ImageStream.js +4 -9
- package/IO/Core/Serializer/ArraySerializer.js +1 -2
- package/IO/Core/WSLinkClient.js +14 -25
- package/IO/Core/ZipMultiDataSetReader.js +5 -12
- package/IO/Core/ZipMultiDataSetWriter.js +1 -2
- package/IO/Geometry/DracoReader.js +6 -10
- package/IO/Geometry/GLTFImporter/Animations.js +9 -14
- package/IO/Geometry/GLTFImporter/Constants.js +0 -1
- package/IO/Geometry/GLTFImporter/Parser.js +1 -3
- package/IO/Geometry/GLTFImporter/Reader.js +2 -5
- package/IO/Geometry/GLTFImporter.js +7 -12
- package/IO/Geometry/IFCImporter.d.ts +1 -1
- package/IO/Geometry/IFCImporter.js +6 -10
- package/IO/Geometry/PLYReader.js +6 -11
- package/IO/Geometry/PLYWriter.js +1 -2
- package/IO/Geometry/STLReader.js +6 -11
- package/IO/Geometry/STLWriter.js +2 -6
- package/IO/Image/HDRReader/Utils.js +1 -2
- package/IO/Image/HDRReader.js +7 -10
- package/IO/Image/TGAReader.js +7 -9
- package/IO/Image/TIFFReader.js +7 -10
- package/IO/Legacy/LegacyAsciiParser.js +1 -2
- package/IO/Legacy/PolyDataReader.js +5 -7
- package/IO/Misc/ElevationReader.js +1 -2
- package/IO/Misc/GCodeReader.js +6 -11
- package/IO/Misc/HttpDataSetLODsLoader.js +1 -2
- package/IO/Misc/ITKImageReader.js +6 -13
- package/IO/Misc/ITKPolyDataReader.js +6 -13
- package/IO/Misc/JSONNucleoReader.js +1 -2
- package/IO/Misc/JSONReader.js +4 -10
- package/IO/Misc/MTLReader.js +2 -4
- package/IO/Misc/OBJReader.js +4 -10
- package/IO/Misc/OBJWriter.js +1 -2
- package/IO/Misc/PDBReader.js +1 -2
- package/IO/Misc/SkyboxReader.js +5 -10
- package/IO/XML/XMLImageDataReader.js +1 -2
- package/IO/XML/XMLImageDataWriter.js +1 -2
- package/IO/XML/XMLPolyDataReader.js +1 -2
- package/IO/XML/XMLPolyDataWriter.js +1 -2
- package/IO/XML/XMLReader.js +4 -10
- package/IO/XML/XMLWriter.js +2 -4
- package/Imaging/Core/AbstractImageInterpolator.js +1 -3
- package/Imaging/Core/ImageInterpolator.js +1 -3
- package/Imaging/Core/ImagePointDataIterator.js +2 -6
- package/Imaging/Core/ImageReslice.js +1 -3
- package/Imaging/Hybrid/SampleFunction.js +1 -2
- package/Interaction/Animations/TimeStepBasedAnimationHandler.js +1 -2
- package/Interaction/Manipulators/3DControllerModelSelectorManipulator/index.js +1 -2
- package/Interaction/Manipulators/CompositeCameraManipulator.js +1 -2
- package/Interaction/Manipulators/CompositeGestureManipulator.js +1 -2
- package/Interaction/Manipulators/CompositeKeyboardManipulator.js +1 -2
- package/Interaction/Manipulators/CompositeMouseManipulator.js +1 -2
- package/Interaction/Manipulators/CompositeVRManipulator.js +1 -2
- package/Interaction/Manipulators/GestureCameraManipulator.js +1 -2
- package/Interaction/Manipulators/KeyboardCameraManipulator.js +1 -2
- package/Interaction/Manipulators/MouseBoxSelectorManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraAxisRotateManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraSliceManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraTrackballFirstPersonManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraTrackballMultiRotateManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraTrackballPanManipulatorAutoCenter.js +1 -2
- package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraTrackballZoomManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraTrackballZoomToMouseManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -2
- package/Interaction/Manipulators/MouseRangeManipulator.js +4 -11
- package/Interaction/Manipulators/VRButtonPanManipulator.js +1 -2
- package/Interaction/Misc/DeviceOrientationToCamera.js +1 -2
- package/Interaction/Style/InteractorStyleHMDXR.js +1 -2
- package/Interaction/Style/InteractorStyleImage.js +1 -2
- package/Interaction/Style/InteractorStyleMPRSlice.js +2 -6
- package/Interaction/Style/InteractorStyleManipulator.js +1 -2
- package/Interaction/Style/InteractorStyleRemoteMouse.js +1 -2
- package/Interaction/Style/InteractorStyleTrackballCamera.js +1 -3
- package/Interaction/Style/InteractorStyleUnicam.js +1 -2
- package/Interaction/UI/CornerAnnotation.js +2 -4
- package/Interaction/UI/FPSMonitor.js +3 -9
- package/Interaction/UI/Slider.js +1 -3
- package/Interaction/UI/VolumeController.js +2 -5
- package/Interaction/Widgets/OrientationMarkerWidget.js +1 -2
- package/Interaction/Widgets/PiecewiseGaussianWidget.js +42 -59
- package/Proxy/Animation/AbstractAnimationProxy.js +1 -2
- package/Proxy/Animation/AnimationProxyManager.js +1 -2
- package/Proxy/Animation/TimeStepBasedAnimationHandlerProxy.js +1 -2
- package/Proxy/Core/AbstractRepresentationProxy.js +3 -6
- package/Proxy/Core/LookupTableProxy.js +1 -3
- package/Proxy/Core/PiecewiseFunctionProxy.js +3 -11
- package/Proxy/Core/ProxyManager/state.js +171 -182
- package/Proxy/Core/ProxyManager/view.js +3 -6
- package/Proxy/Core/ProxyManager.js +1 -2
- package/Proxy/Core/SourceProxy.js +2 -6
- package/Proxy/Core/View2DProxy.js +2 -4
- package/Proxy/Core/ViewProxy.js +20 -37
- package/Proxy/Representations/GeometryRepresentationProxy.js +1 -2
- package/Proxy/Representations/GlyphRepresentationProxy.js +1 -2
- package/Proxy/Representations/MoleculeRepresentationProxy.js +1 -2
- package/Proxy/Representations/ResliceRepresentationProxy.js +3 -8
- package/Proxy/Representations/SkyboxRepresentationProxy.js +1 -2
- package/Proxy/Representations/SliceRepresentationProxy.js +3 -8
- package/Proxy/Representations/SlicedGeometryRepresentationProxy.js +3 -6
- package/Proxy/Representations/VolumeRepresentationProxy.js +9 -17
- package/Rendering/Core/AbstractImageMapper.js +1 -2
- package/Rendering/Core/AbstractMapper.js +1 -2
- package/Rendering/Core/AbstractMapper3D.js +1 -2
- package/Rendering/Core/AbstractPicker.js +1 -2
- package/Rendering/Core/Actor.js +1 -2
- package/Rendering/Core/Actor2D.js +1 -2
- package/Rendering/Core/AnnotatedCubeActor.js +2 -4
- package/Rendering/Core/AxesActor.js +2 -4
- package/Rendering/Core/Camera.js +2 -6
- package/Rendering/Core/CellPicker.js +1 -3
- package/Rendering/Core/ColorTransferFunction/CssFilters.js +8 -16
- package/Rendering/Core/ColorTransferFunction.js +4 -10
- package/Rendering/Core/Coordinate.js +2 -6
- package/Rendering/Core/CubeAxesActor.js +4 -6
- package/Rendering/Core/Follower.js +1 -2
- package/Rendering/Core/Glyph3DMapper.js +1 -2
- package/Rendering/Core/HardwareSelector.js +1 -2
- package/Rendering/Core/ImageArrayMapper.js +6 -13
- package/Rendering/Core/ImageCPRMapper.js +1 -2
- package/Rendering/Core/ImageMapper.js +2 -5
- package/Rendering/Core/ImageProperty.js +9 -28
- package/Rendering/Core/ImageResliceMapper.js +1 -2
- package/Rendering/Core/ImageSlice.js +1 -2
- package/Rendering/Core/InteractorObserver.js +1 -2
- package/Rendering/Core/InteractorStyle.js +1 -2
- package/Rendering/Core/Light.js +1 -2
- package/Rendering/Core/Mapper/Static.js +1 -2
- package/Rendering/Core/Mapper.js +1 -6
- package/Rendering/Core/Mapper2D.js +1 -3
- package/Rendering/Core/Picker.js +1 -2
- package/Rendering/Core/PixelSpaceCallbackMapper.js +1 -2
- package/Rendering/Core/PointPicker.js +1 -2
- package/Rendering/Core/Prop.js +1 -2
- package/Rendering/Core/Prop3D.js +3 -8
- package/Rendering/Core/Property.js +1 -2
- package/Rendering/Core/Property2D.js +1 -2
- package/Rendering/Core/RenderWindow.js +4 -11
- package/Rendering/Core/RenderWindowInteractor/Constants.js +0 -1
- package/Rendering/Core/RenderWindowInteractor.js +7 -12
- package/Rendering/Core/Renderer.js +3 -6
- package/Rendering/Core/ScalarBarActor.js +4 -6
- package/Rendering/Core/Skybox.js +1 -2
- package/Rendering/Core/SphereMapper.js +1 -2
- package/Rendering/Core/StickMapper.js +1 -2
- package/Rendering/Core/SurfaceLICInterface.js +1 -2
- package/Rendering/Core/SurfaceLICMapper.js +1 -2
- package/Rendering/Core/TextActor.js +1 -2
- package/Rendering/Core/TextProperty.js +1 -2
- package/Rendering/Core/Texture.js +1 -2
- package/Rendering/Core/VectorText/Utils.js +4 -8
- package/Rendering/Core/VectorText.js +1 -3
- package/Rendering/Core/Viewport.js +2 -4
- package/Rendering/Core/Volume.js +1 -2
- package/Rendering/Core/VolumeMapper.js +1 -2
- package/Rendering/Core/VolumeProperty.js +9 -22
- package/Rendering/Misc/CanvasView.js +1 -2
- package/Rendering/Misc/FullScreenRenderWindow.js +1 -2
- package/Rendering/Misc/GenericRenderWindow.js +1 -2
- package/Rendering/Misc/RemoteView.js +1 -2
- package/Rendering/Misc/RenderWindowWithControlBar.js +1 -2
- package/Rendering/Misc/SynchronizableRenderWindow/BehaviorManager/CameraSynchronizer.js +1 -3
- package/Rendering/Misc/SynchronizableRenderWindow/BehaviorManager.js +5 -6
- package/Rendering/Misc/SynchronizableRenderWindow/ObjectManager.js +24 -43
- package/Rendering/Misc/SynchronizableRenderWindow.js +3 -6
- package/Rendering/Misc/TextureLODsDownloader.js +1 -2
- package/Rendering/OpenGL/Actor.js +1 -2
- package/Rendering/OpenGL/Actor2D.js +1 -2
- package/Rendering/OpenGL/BufferObject.js +1 -3
- package/Rendering/OpenGL/Camera.js +1 -2
- package/Rendering/OpenGL/CellArrayBufferObject.js +2 -4
- package/Rendering/OpenGL/Convolution2DPass.js +2 -3
- package/Rendering/OpenGL/CubeAxesActor.js +1 -2
- package/Rendering/OpenGL/ForwardPass.js +2 -4
- package/Rendering/OpenGL/Framebuffer.js +4 -8
- package/Rendering/OpenGL/Glyph3DMapper.js +1 -2
- package/Rendering/OpenGL/HardwareSelector.js +21 -27
- package/Rendering/OpenGL/Helper.js +1 -2
- package/Rendering/OpenGL/ImageCPRMapper.js +1 -2
- package/Rendering/OpenGL/ImageMapper.js +1 -2
- package/Rendering/OpenGL/ImageResliceMapper.js +10 -16
- package/Rendering/OpenGL/ImageSlice.js +1 -2
- package/Rendering/OpenGL/OrderIndependentTranslucentPass.js +1 -2
- package/Rendering/OpenGL/PixelSpaceCallbackMapper.js +1 -2
- package/Rendering/OpenGL/PolyDataMapper.js +1 -2
- package/Rendering/OpenGL/PolyDataMapper2D.js +1 -2
- package/Rendering/OpenGL/RadialDistortionPass.js +2 -3
- package/Rendering/OpenGL/RenderWindow.js +33 -53
- package/Rendering/OpenGL/Renderer.js +1 -3
- package/Rendering/OpenGL/ReplacementShaderMapper.js +2 -2
- package/Rendering/OpenGL/ScalarBarActor.js +1 -2
- package/Rendering/OpenGL/Shader.js +1 -2
- package/Rendering/OpenGL/ShaderCache.js +1 -2
- package/Rendering/OpenGL/ShaderProgram.js +4 -14
- package/Rendering/OpenGL/Skybox.js +1 -2
- package/Rendering/OpenGL/SphereMapper.js +1 -2
- package/Rendering/OpenGL/StickMapper.js +1 -2
- package/Rendering/OpenGL/SurfaceLIC/LineIntegralConvolution2D/pingpong.js +6 -12
- package/Rendering/OpenGL/SurfaceLIC/LineIntegralConvolution2D.js +4 -12
- package/Rendering/OpenGL/SurfaceLIC/SurfaceLICInterface.js +2 -4
- package/Rendering/OpenGL/SurfaceLIC/SurfaceLICMapper.js +1 -2
- package/Rendering/OpenGL/Texture.js +91 -113
- package/Rendering/OpenGL/TextureUnitManager.js +1 -2
- package/Rendering/OpenGL/VertexArrayObject.js +1 -2
- package/Rendering/OpenGL/ViewNodeFactory.js +1 -2
- package/Rendering/OpenGL/Volume.js +1 -2
- package/Rendering/OpenGL/VolumeMapper.js +11 -17
- package/Rendering/SceneGraph/RenderPass.js +2 -4
- package/Rendering/SceneGraph/RenderWindowViewNode.js +1 -2
- package/Rendering/SceneGraph/ViewNode.js +3 -6
- package/Rendering/SceneGraph/ViewNodeFactory.js +1 -2
- package/Rendering/WebGPU/Actor.js +1 -2
- package/Rendering/WebGPU/Actor2D.js +1 -2
- package/Rendering/WebGPU/BindGroup.js +1 -2
- package/Rendering/WebGPU/Buffer.js +2 -5
- package/Rendering/WebGPU/BufferManager.js +1 -2
- package/Rendering/WebGPU/Camera.js +1 -2
- package/Rendering/WebGPU/CellArrayMapper.js +3 -6
- package/Rendering/WebGPU/CubeAxesActor.js +1 -2
- package/Rendering/WebGPU/Device.js +2 -6
- package/Rendering/WebGPU/ForwardPass.js +2 -4
- package/Rendering/WebGPU/FullScreenQuad.js +1 -2
- package/Rendering/WebGPU/Glyph3DMapper.js +2 -4
- package/Rendering/WebGPU/HardwareSelectionPass.js +1 -2
- package/Rendering/WebGPU/HardwareSelector.js +1 -2
- package/Rendering/WebGPU/ImageMapper.js +1 -2
- package/Rendering/WebGPU/ImageSlice.js +1 -2
- package/Rendering/WebGPU/IndexBuffer.js +1 -2
- package/Rendering/WebGPU/OpaquePass.js +1 -2
- package/Rendering/WebGPU/OrderIndependentTranslucentPass.js +1 -2
- package/Rendering/WebGPU/Pipeline.js +1 -2
- package/Rendering/WebGPU/PixelSpaceCallbackMapper.js +1 -2
- package/Rendering/WebGPU/PolyDataMapper.js +1 -2
- package/Rendering/WebGPU/PolyDataMapper2D.js +1 -2
- package/Rendering/WebGPU/RenderEncoder.js +2 -5
- package/Rendering/WebGPU/RenderWindow.js +15 -25
- package/Rendering/WebGPU/Renderer.js +1 -2
- package/Rendering/WebGPU/Sampler.js +2 -4
- package/Rendering/WebGPU/ScalarBarActor.js +1 -2
- package/Rendering/WebGPU/ShaderCache.js +2 -4
- package/Rendering/WebGPU/ShaderDescription.js +2 -4
- package/Rendering/WebGPU/ShaderModule.js +1 -2
- package/Rendering/WebGPU/SimpleMapper.js +1 -3
- package/Rendering/WebGPU/SphereMapper.js +1 -2
- package/Rendering/WebGPU/StickMapper.js +1 -2
- package/Rendering/WebGPU/StorageBuffer.js +1 -2
- package/Rendering/WebGPU/Texture.js +3 -7
- package/Rendering/WebGPU/TextureManager.js +2 -6
- package/Rendering/WebGPU/TextureView.js +1 -3
- package/Rendering/WebGPU/UniformBuffer.js +1 -2
- package/Rendering/WebGPU/VertexInput.js +2 -4
- package/Rendering/WebGPU/ViewNodeFactory.js +1 -2
- package/Rendering/WebGPU/Volume.js +1 -2
- package/Rendering/WebGPU/VolumePass.js +1 -2
- package/Rendering/WebGPU/VolumePassFSQ.js +1 -2
- package/Rendering/WebXR/RenderWindowHelper.js +2 -6
- package/Widgets/Core/AbstractWidget.js +6 -10
- package/Widgets/Core/AbstractWidgetFactory.js +17 -22
- package/Widgets/Core/StateBuilder/boundsMixin.js +1 -2
- package/Widgets/Core/StateBuilder/color3Mixin.js +1 -2
- package/Widgets/Core/StateBuilder/colorMixin.js +1 -2
- package/Widgets/Core/StateBuilder/cornerMixin.js +1 -2
- package/Widgets/Core/StateBuilder/directionMixin.js +1 -2
- package/Widgets/Core/StateBuilder/manipulatorMixin.js +1 -2
- package/Widgets/Core/StateBuilder/nameMixin.js +1 -2
- package/Widgets/Core/StateBuilder/orientationMixin.js +1 -2
- package/Widgets/Core/StateBuilder/originMixin.js +1 -2
- package/Widgets/Core/StateBuilder/scale1Mixin.js +1 -2
- package/Widgets/Core/StateBuilder/scale3Mixin.js +1 -2
- package/Widgets/Core/StateBuilder/shapeMixin.js +1 -2
- package/Widgets/Core/StateBuilder/textMixin.js +1 -2
- package/Widgets/Core/StateBuilder/visibleMixin.js +1 -2
- package/Widgets/Core/StateBuilder.js +23 -33
- package/Widgets/Core/WidgetManager/Constants.js +0 -1
- package/Widgets/Core/WidgetManager.js +25 -30
- package/Widgets/Core/WidgetState.js +2 -4
- package/Widgets/Manipulators/AbstractManipulator.js +1 -2
- package/Widgets/Manipulators/CPRManipulator.js +1 -2
- package/Widgets/Manipulators/LineManipulator.js +1 -2
- package/Widgets/Manipulators/PickerManipulator.js +1 -2
- package/Widgets/Manipulators/PlaneManipulator.js +1 -2
- package/Widgets/Manipulators/TrackballManipulator.js +1 -2
- package/Widgets/Representations/ArrowHandleRepresentation.js +2 -6
- package/Widgets/Representations/CircleContextRepresentation.js +1 -2
- package/Widgets/Representations/ContextRepresentation.js +1 -2
- package/Widgets/Representations/ConvexFaceContextRepresentation.js +2 -6
- package/Widgets/Representations/CroppingOutlineRepresentation.js +1 -2
- package/Widgets/Representations/CubeHandleRepresentation.js +1 -2
- package/Widgets/Representations/GlyphRepresentation.js +3 -11
- package/Widgets/Representations/HandleRepresentation.js +1 -2
- package/Widgets/Representations/ImplicitPlaneRepresentation.js +1 -2
- package/Widgets/Representations/LineHandleRepresentation.js +1 -2
- package/Widgets/Representations/OutlineContextRepresentation.js +1 -2
- package/Widgets/Representations/PolyLineRepresentation.js +2 -4
- package/Widgets/Representations/RectangleContextRepresentation.js +1 -2
- package/Widgets/Representations/RotateTransformHandleRepresentation.js +1 -2
- package/Widgets/Representations/ScaleTransformHandleRepresentation.js +1 -2
- package/Widgets/Representations/SphereContextRepresentation.js +1 -2
- package/Widgets/Representations/SphereHandleRepresentation.js +1 -2
- package/Widgets/Representations/SplineContextRepresentation.js +2 -6
- package/Widgets/Representations/TranslateTransformHandleRepresentation/TransformHandleSource.js +1 -2
- package/Widgets/Representations/TranslateTransformHandleRepresentation.js +1 -2
- package/Widgets/Representations/WidgetRepresentation.js +6 -20
- package/Widgets/Widgets3D/AngleWidget.js +1 -2
- package/Widgets/Widgets3D/EllipseWidget.js +1 -2
- package/Widgets/Widgets3D/ImageCroppingWidget.js +1 -2
- package/Widgets/Widgets3D/ImplicitPlaneWidget.js +1 -3
- package/Widgets/Widgets3D/InteractiveOrientationWidget/helpers.js +6 -7
- package/Widgets/Widgets3D/InteractiveOrientationWidget/state.js +0 -1
- package/Widgets/Widgets3D/InteractiveOrientationWidget.js +1 -2
- package/Widgets/Widgets3D/LabelWidget.js +1 -2
- package/Widgets/Widgets3D/LineWidget/behavior.js +1 -2
- package/Widgets/Widgets3D/LineWidget/helpers.js +1 -2
- package/Widgets/Widgets3D/LineWidget.js +1 -2
- package/Widgets/Widgets3D/PaintWidget.js +1 -2
- package/Widgets/Widgets3D/PolyLineWidget/behavior.js +3 -4
- package/Widgets/Widgets3D/PolyLineWidget.js +1 -2
- package/Widgets/Widgets3D/RectangleWidget.js +1 -2
- package/Widgets/Widgets3D/ResliceCursorWidget/Constants.js +0 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +0 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +2 -3
- package/Widgets/Widgets3D/ResliceCursorWidget/state.js +1 -3
- package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -3
- package/Widgets/Widgets3D/SeedWidget.js +1 -2
- package/Widgets/Widgets3D/ShapeWidget/behavior.js +7 -10
- package/Widgets/Widgets3D/ShapeWidget.js +1 -2
- package/Widgets/Widgets3D/SphereWidget.js +1 -2
- package/Widgets/Widgets3D/SplineWidget/behavior.js +13 -13
- package/Widgets/Widgets3D/SplineWidget.js +1 -2
- package/Widgets/Widgets3D/TransformControlsWidget.js +1 -2
- package/_virtual/rollup-plugin-worker-loader__module_Sources/Filters/General/PaintFilter/PaintFilter.worker.js +20 -25
- package/macros2.js +46 -114
- package/package.json +26 -19
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/
|
|
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):
|
|
85
|
+
export function extractCellSizes(cellArray: any): number[];
|
|
82
86
|
|
|
83
87
|
/**
|
|
84
88
|
* @static
|
package/Common/Core/CellArray.js
CHANGED
|
@@ -10,14 +10,11 @@ const {
|
|
|
10
10
|
// ----------------------------------------------------------------------------
|
|
11
11
|
|
|
12
12
|
function extractCellSizes(cellArray) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
}
|
package/Common/Core/DataArray.js
CHANGED
|
@@ -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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
|
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]
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
|
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;
|
package/Common/Core/Points.js
CHANGED
|
@@ -19,8 +19,7 @@ function vtkPoints(publicAPI, model) {
|
|
|
19
19
|
|
|
20
20
|
// Forwarding methods
|
|
21
21
|
publicAPI.getNumberOfPoints = publicAPI.getNumberOfTuples;
|
|
22
|
-
publicAPI.setNumberOfPoints =
|
|
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 =
|
|
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(
|
|
26
|
-
|
|
27
|
-
|
|
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(
|
|
26
|
+
promise.then((...resolveArgs) => {
|
|
27
27
|
publicAPI.stopWork();
|
|
28
|
-
resolve(...
|
|
28
|
+
resolve(...resolveArgs);
|
|
29
29
|
}, rejectError => {
|
|
30
30
|
publicAPI.stopWork();
|
|
31
31
|
reject(rejectError);
|
|
32
32
|
});
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
|
-
publicAPI.wrapPromiseFunction = fn =>
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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);
|