@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
|
@@ -11,10 +11,7 @@ function vtkVariantArray(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 vtkVariantArray(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 vtkVariantArray(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 vtkVariantArray object without: size > 0, values');
|
|
@@ -20,8 +20,7 @@ function defaultValues(initialValues) {
|
|
|
20
20
|
|
|
21
21
|
// ----------------------------------------------------------------------------
|
|
22
22
|
|
|
23
|
-
function extend(publicAPI, model) {
|
|
24
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
23
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
25
24
|
vtkLocator.extend(publicAPI, model, defaultValues(initialValues));
|
|
26
25
|
|
|
27
26
|
// Make this a VTK object
|
|
@@ -255,8 +255,7 @@ function computeCornerPoints(bounds, point1, point2) {
|
|
|
255
255
|
point2[2] = bounds[5];
|
|
256
256
|
return point1;
|
|
257
257
|
}
|
|
258
|
-
function transformBounds(bounds, transform) {
|
|
259
|
-
let out = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
258
|
+
function transformBounds(bounds, transform, out = []) {
|
|
260
259
|
const corners = getCorners(bounds, []);
|
|
261
260
|
for (let i = 0; i < corners.length; ++i) {
|
|
262
261
|
vec3.transformMat4(corners[i], corners[i], transform);
|
|
@@ -264,8 +263,7 @@ function transformBounds(bounds, transform) {
|
|
|
264
263
|
reset(out);
|
|
265
264
|
return addPoints(out, corners);
|
|
266
265
|
}
|
|
267
|
-
function computeScale3(bounds) {
|
|
268
|
-
let scale3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
266
|
+
function computeScale3(bounds, scale3 = []) {
|
|
269
267
|
scale3[0] = 0.5 * (bounds[1] - bounds[0]);
|
|
270
268
|
scale3[1] = 0.5 * (bounds[3] - bounds[2]);
|
|
271
269
|
scale3[2] = 0.5 * (bounds[5] - bounds[4]);
|
|
@@ -403,7 +401,6 @@ function intersectPlane(bounds, origin, normal) {
|
|
|
403
401
|
}
|
|
404
402
|
return 0; // no intersection
|
|
405
403
|
}
|
|
406
|
-
|
|
407
404
|
function intersect(bounds, bBounds) {
|
|
408
405
|
if (!(isValid(bounds) && isValid(bBounds))) {
|
|
409
406
|
return false;
|
|
@@ -529,7 +526,6 @@ function cutWithPlane(bounds, origin, normal) {
|
|
|
529
526
|
if (size === 0) {
|
|
530
527
|
continue; // shouldn't happen
|
|
531
528
|
}
|
|
532
|
-
|
|
533
529
|
const ti = Math.abs(d[index[dir][i]]) / size;
|
|
534
530
|
if (sign > 0 && ti < t) {
|
|
535
531
|
t = ti;
|
|
@@ -575,8 +571,7 @@ function clampDivisions(targetBins, divs) {
|
|
|
575
571
|
* @param {Array} [adjustedBounds] - Output array to store adjusted bounds if needed
|
|
576
572
|
* @returns {Number} The actual total number of bins
|
|
577
573
|
*/
|
|
578
|
-
function computeDivisions(bounds, totalBins, divs) {
|
|
579
|
-
let adjustedBounds = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
574
|
+
function computeDivisions(bounds, totalBins, divs, adjustedBounds = []) {
|
|
580
575
|
// This will always produce at least one bin
|
|
581
576
|
// eslint-disable-next-line no-param-reassign
|
|
582
577
|
totalBins = totalBins <= 0 ? 1 : totalBins;
|
|
@@ -713,10 +708,7 @@ class BoundingBox {
|
|
|
713
708
|
reset() {
|
|
714
709
|
return reset(this.bounds);
|
|
715
710
|
}
|
|
716
|
-
addPoint() {
|
|
717
|
-
for (var _len = arguments.length, xyz = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
718
|
-
xyz[_key] = arguments[_key];
|
|
719
|
-
}
|
|
711
|
+
addPoint(...xyz) {
|
|
720
712
|
return addPoint(this.bounds, ...xyz);
|
|
721
713
|
}
|
|
722
714
|
addPoints(points) {
|
|
@@ -779,8 +771,7 @@ class BoundingBox {
|
|
|
779
771
|
computeLocalBounds(u, v, w) {
|
|
780
772
|
return computeLocalBounds(this.bounds, u, v, w);
|
|
781
773
|
}
|
|
782
|
-
transformBounds(transform) {
|
|
783
|
-
let out = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
774
|
+
transformBounds(transform, out = []) {
|
|
784
775
|
return transformBounds(this.bounds, transform, out);
|
|
785
776
|
}
|
|
786
777
|
computeScale3(scale3) {
|
|
@@ -807,8 +798,7 @@ class BoundingBox {
|
|
|
807
798
|
contains(otherBounds) {
|
|
808
799
|
return intersects(this.bounds, otherBounds);
|
|
809
800
|
}
|
|
810
|
-
computeDivisions(totalBins, divs) {
|
|
811
|
-
let adjustedBounds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
801
|
+
computeDivisions(totalBins, divs, adjustedBounds = []) {
|
|
812
802
|
return computeDivisions(this.bounds, totalBins, divs, adjustedBounds);
|
|
813
803
|
}
|
|
814
804
|
distance2ToBounds(x) {
|
package/Common/DataModel/Box.js
CHANGED
|
@@ -102,11 +102,8 @@ function vtkBox(publicAPI, model) {
|
|
|
102
102
|
model.classHierarchy.push('vtkBox');
|
|
103
103
|
|
|
104
104
|
// TODO: replace with macro.setArray ?
|
|
105
|
-
publicAPI.setBounds =
|
|
105
|
+
publicAPI.setBounds = (...bounds) => {
|
|
106
106
|
let boundsArray = [];
|
|
107
|
-
for (var _len = arguments.length, bounds = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
108
|
-
bounds[_key] = arguments[_key];
|
|
109
|
-
}
|
|
110
107
|
if (Array.isArray(bounds[0])) {
|
|
111
108
|
boundsArray = bounds[0];
|
|
112
109
|
} else {
|
|
@@ -169,13 +166,13 @@ function vtkBox(publicAPI, model) {
|
|
|
169
166
|
}
|
|
170
167
|
return distance;
|
|
171
168
|
};
|
|
172
|
-
publicAPI.addBounds =
|
|
169
|
+
publicAPI.addBounds = (...bounds) => {
|
|
173
170
|
let boundsArray = [];
|
|
174
|
-
if (Array.isArray(
|
|
175
|
-
boundsArray =
|
|
171
|
+
if (Array.isArray(bounds[0])) {
|
|
172
|
+
boundsArray = bounds[0];
|
|
176
173
|
} else {
|
|
177
|
-
for (let i = 0; i <
|
|
178
|
-
boundsArray.push(
|
|
174
|
+
for (let i = 0; i < bounds.length; i++) {
|
|
175
|
+
boundsArray.push(bounds[i]);
|
|
179
176
|
}
|
|
180
177
|
}
|
|
181
178
|
if (boundsArray.length !== 6) {
|
|
@@ -198,8 +195,7 @@ const DEFAULT_VALUES = {
|
|
|
198
195
|
|
|
199
196
|
// ----------------------------------------------------------------------------
|
|
200
197
|
|
|
201
|
-
function extend(publicAPI, model) {
|
|
202
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
198
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
203
199
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
204
200
|
|
|
205
201
|
// Object methods
|
|
@@ -82,8 +82,7 @@ function vtkCardinalSpline1D(publicAPI, model) {
|
|
|
82
82
|
|
|
83
83
|
// --------------------------------------------------------------------------
|
|
84
84
|
|
|
85
|
-
publicAPI.computeOpenCoefficients =
|
|
86
|
-
let options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
85
|
+
publicAPI.computeOpenCoefficients = (size, work, x, y, options = {}) => {
|
|
87
86
|
if (!model.coefficients || model.coefficients.length !== 4 * size) {
|
|
88
87
|
model.coefficients = new Float32Array(4 * size);
|
|
89
88
|
}
|
|
@@ -216,8 +215,7 @@ const DEFAULT_VALUES = {};
|
|
|
216
215
|
|
|
217
216
|
// ----------------------------------------------------------------------------
|
|
218
217
|
|
|
219
|
-
function extend(publicAPI, model) {
|
|
220
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
218
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
221
219
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
222
220
|
vtkSpline1D.extend(publicAPI, model, initialValues);
|
|
223
221
|
|
package/Common/DataModel/Cell.js
CHANGED
|
@@ -9,8 +9,7 @@ import vtkPoints from '../Core/Points.js';
|
|
|
9
9
|
function vtkCell(publicAPI, model) {
|
|
10
10
|
// Set our className
|
|
11
11
|
model.classHierarchy.push('vtkCell');
|
|
12
|
-
publicAPI.initialize =
|
|
13
|
-
let pointIdsList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
12
|
+
publicAPI.initialize = (points, pointIdsList = null) => {
|
|
14
13
|
if (!pointIdsList) {
|
|
15
14
|
model.points = points;
|
|
16
15
|
model.pointsIds = new Array(points.getNumberOfPoints());
|
|
@@ -81,8 +80,7 @@ const DEFAULT_VALUES = {
|
|
|
81
80
|
|
|
82
81
|
// ----------------------------------------------------------------------------
|
|
83
82
|
|
|
84
|
-
function extend(publicAPI, model) {
|
|
85
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
83
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
86
84
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
87
85
|
macro.obj(publicAPI, model);
|
|
88
86
|
if (!model.points) {
|
|
@@ -95,8 +95,7 @@ function vtkCellLinks(publicAPI, model) {
|
|
|
95
95
|
* Allocate the specified number of links (i.e., number of points) that
|
|
96
96
|
* will be built.
|
|
97
97
|
*/
|
|
98
|
-
publicAPI.allocate =
|
|
99
|
-
let ext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
98
|
+
publicAPI.allocate = (numLinks, ext = 1000) => {
|
|
100
99
|
model.array = Array(numLinks).fill().map(() => ({
|
|
101
100
|
ncells: 0,
|
|
102
101
|
cells: null
|
|
@@ -237,8 +236,7 @@ const DEFAULT_VALUES = {
|
|
|
237
236
|
|
|
238
237
|
// ----------------------------------------------------------------------------
|
|
239
238
|
|
|
240
|
-
function extend(publicAPI, model) {
|
|
241
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
239
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
242
240
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
243
241
|
macro.obj(publicAPI, model);
|
|
244
242
|
vtkCellLinks(publicAPI, model);
|
|
@@ -56,9 +56,7 @@ function vtkCellTypes(publicAPI, model) {
|
|
|
56
56
|
/**
|
|
57
57
|
* Allocate memory for this array. Delete old storage only if necessary.
|
|
58
58
|
*/
|
|
59
|
-
publicAPI.allocate =
|
|
60
|
-
let sz = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 512;
|
|
61
|
-
let ext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
59
|
+
publicAPI.allocate = (sz = 512, ext = 1000) => {
|
|
62
60
|
model.size = sz > 0 ? sz : 1;
|
|
63
61
|
model.extend = ext > 0 ? ext : 1;
|
|
64
62
|
model.maxId = -1;
|
|
@@ -176,8 +174,7 @@ const DEFAULT_VALUES = {
|
|
|
176
174
|
|
|
177
175
|
// ----------------------------------------------------------------------------
|
|
178
176
|
|
|
179
|
-
function extend(publicAPI, model) {
|
|
180
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
177
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
181
178
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
182
179
|
macro.obj(publicAPI, model);
|
|
183
180
|
macro.get(publicAPI, model, ['size', 'maxId', 'extend']);
|
|
@@ -72,8 +72,7 @@ const DEFAULT_VALUES = {
|
|
|
72
72
|
|
|
73
73
|
// ----------------------------------------------------------------------------
|
|
74
74
|
|
|
75
|
-
function extend(publicAPI, model) {
|
|
76
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
75
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
77
76
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
78
77
|
|
|
79
78
|
// Object methods
|
package/Common/DataModel/Cone.js
CHANGED
|
@@ -38,8 +38,7 @@ const DEFAULT_VALUES = {
|
|
|
38
38
|
|
|
39
39
|
// ----------------------------------------------------------------------------
|
|
40
40
|
|
|
41
|
-
function extend(publicAPI, model) {
|
|
42
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
41
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
43
42
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
44
43
|
|
|
45
44
|
// Object methods
|
|
@@ -56,8 +56,7 @@ const DEFAULT_VALUES = {
|
|
|
56
56
|
|
|
57
57
|
// ----------------------------------------------------------------------------
|
|
58
58
|
|
|
59
|
-
function extend(publicAPI, model) {
|
|
60
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
59
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
61
60
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
62
61
|
|
|
63
62
|
// Object methods
|
|
@@ -82,8 +82,7 @@ function vtkDataSet(publicAPI, model) {
|
|
|
82
82
|
publicAPI.getBounds = macro.chain(() => publicAPI.computeBounds, publicAPI.getBounds);
|
|
83
83
|
publicAPI.getBoundsByReference = macro.chain(() => publicAPI.computeBounds, publicAPI.getBoundsByReference);
|
|
84
84
|
const superShallowCopy = publicAPI.shallowCopy;
|
|
85
|
-
publicAPI.shallowCopy =
|
|
86
|
-
let debug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
85
|
+
publicAPI.shallowCopy = (other, debug = false) => {
|
|
87
86
|
superShallowCopy(other, debug);
|
|
88
87
|
DATASET_FIELDS.forEach(fieldName => {
|
|
89
88
|
model[fieldName] = vtkDataSetAttributes.newInstance();
|
|
@@ -110,8 +109,7 @@ const DEFAULT_VALUES = {
|
|
|
110
109
|
|
|
111
110
|
// ----------------------------------------------------------------------------
|
|
112
111
|
|
|
113
|
-
function extend(publicAPI, model) {
|
|
114
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
112
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
115
113
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
116
114
|
|
|
117
115
|
// Object methods
|
|
@@ -27,20 +27,17 @@ const CellGhostTypes = {
|
|
|
27
27
|
// the cell is on the exterior of the data set
|
|
28
28
|
HIDDENCELL: 32 // the cell is needed to maintain connectivity, but the data values should be ignored.
|
|
29
29
|
};
|
|
30
|
-
|
|
31
30
|
const PointGhostTypes = {
|
|
32
31
|
DUPLICATEPOINT: 1,
|
|
33
32
|
// the cell is present on multiple processors
|
|
34
33
|
HIDDENPOINT: 2 // the point is needed to maintain connectivity, but the data values should be ignored.
|
|
35
34
|
};
|
|
36
|
-
|
|
37
35
|
const AttributeCopyOperations = {
|
|
38
36
|
COPYTUPLE: 0,
|
|
39
37
|
INTERPOLATE: 1,
|
|
40
38
|
PASSDATA: 2,
|
|
41
39
|
ALLCOPY: 3 // all of the above
|
|
42
40
|
};
|
|
43
|
-
|
|
44
41
|
const ghostArrayName = 'vtkGhostType';
|
|
45
42
|
const DesiredOutputPrecision = {
|
|
46
43
|
DEFAULT: 0,
|
|
@@ -49,7 +46,6 @@ const DesiredOutputPrecision = {
|
|
|
49
46
|
// use Float32Array
|
|
50
47
|
DOUBLE: 2 // use Float64Array
|
|
51
48
|
};
|
|
52
|
-
|
|
53
49
|
var Constants = {
|
|
54
50
|
AttributeCopyOperations,
|
|
55
51
|
AttributeLimitTypes,
|
|
@@ -39,7 +39,6 @@ function vtkFieldData(publicAPI, model) {
|
|
|
39
39
|
})); // Deep-copy
|
|
40
40
|
// TODO: Copy array information objects (once we support information objects)
|
|
41
41
|
};
|
|
42
|
-
|
|
43
42
|
publicAPI.getNumberOfArrays = () => model.arrays.length;
|
|
44
43
|
publicAPI.getNumberOfActiveArrays = () => model.arrays.length;
|
|
45
44
|
publicAPI.addArray = arr => {
|
|
@@ -92,9 +91,7 @@ function vtkFieldData(publicAPI, model) {
|
|
|
92
91
|
};
|
|
93
92
|
publicAPI.getCopyFieldFlags = () => model.copyFieldFlags;
|
|
94
93
|
publicAPI.getFlag = arrayName => model.copyFieldFlags[arrayName];
|
|
95
|
-
publicAPI.passData =
|
|
96
|
-
let fromId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;
|
|
97
|
-
let toId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
|
|
94
|
+
publicAPI.passData = (other, fromId = -1, toId = -1) => {
|
|
98
95
|
other.getArrays().forEach(arr => {
|
|
99
96
|
const copyFlag = publicAPI.getFlag(arr.getName());
|
|
100
97
|
if (copyFlag !== false && !(model.doCopyAllOff && copyFlag !== true) && arr) {
|
|
@@ -141,11 +138,7 @@ function vtkFieldData(publicAPI, model) {
|
|
|
141
138
|
}
|
|
142
139
|
});
|
|
143
140
|
};
|
|
144
|
-
publicAPI.interpolateData =
|
|
145
|
-
let fromId1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;
|
|
146
|
-
let fromId2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
|
|
147
|
-
let toId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
|
|
148
|
-
let t = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0.5;
|
|
141
|
+
publicAPI.interpolateData = (other, fromId1 = -1, fromId2 = -1, toId = -1, t = 0.5) => {
|
|
149
142
|
other.getArrays().forEach(arr => {
|
|
150
143
|
const copyFlag = publicAPI.getFlag(arr.getName());
|
|
151
144
|
if (copyFlag !== false && !(model.doCopyAllOff && copyFlag !== true) && arr) {
|
|
@@ -252,8 +245,7 @@ const DEFAULT_VALUES = {
|
|
|
252
245
|
doCopyAllOn: true,
|
|
253
246
|
doCopyAllOff: false
|
|
254
247
|
};
|
|
255
|
-
function extend(publicAPI, model) {
|
|
256
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
248
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
257
249
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
258
250
|
macro.obj(publicAPI, model);
|
|
259
251
|
vtkFieldData(publicAPI, model);
|
|
@@ -176,8 +176,7 @@ const DEFAULT_VALUES = {
|
|
|
176
176
|
|
|
177
177
|
// ----------------------------------------------------------------------------
|
|
178
178
|
|
|
179
|
-
function extend(publicAPI, model) {
|
|
180
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
179
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
181
180
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
182
181
|
|
|
183
182
|
// Object methods
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
class EdgeLocator {
|
|
2
|
-
constructor() {
|
|
3
|
-
let oriented = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
2
|
+
constructor(oriented = false) {
|
|
4
3
|
this.oriented = oriented;
|
|
5
4
|
this.edgeMap = new Map();
|
|
6
5
|
}
|
|
@@ -49,8 +48,7 @@ class EdgeLocator {
|
|
|
49
48
|
return [pointId0, pointId1];
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
|
-
function newInstance() {
|
|
53
|
-
let initialValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
51
|
+
function newInstance(initialValues = {}) {
|
|
54
52
|
return new EdgeLocator(initialValues.oriented);
|
|
55
53
|
}
|
|
56
54
|
var vtkEdgeLocator = {
|
|
@@ -54,8 +54,7 @@ const itkComponentTypeToVtkArrayType = new Map([['uint8', 'Uint8Array'], ['int8'
|
|
|
54
54
|
*
|
|
55
55
|
* Requires an itk-wasm Image as input.
|
|
56
56
|
*/
|
|
57
|
-
function convertItkToVtkImage(itkImage) {
|
|
58
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
57
|
+
function convertItkToVtkImage(itkImage, options = {}) {
|
|
59
58
|
const vtkImage = {
|
|
60
59
|
origin: [0, 0, 0],
|
|
61
60
|
spacing: [1, 1, 1]
|
|
@@ -156,8 +155,7 @@ function convertItkToVtkImage(itkImage) {
|
|
|
156
155
|
* Requires a vtk.js vtkImageData as input.
|
|
157
156
|
*
|
|
158
157
|
*/
|
|
159
|
-
function convertVtkToItkImage(vtkImage) {
|
|
160
|
-
let copyData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
158
|
+
function convertVtkToItkImage(vtkImage, copyData = false) {
|
|
161
159
|
const dimension = 3;
|
|
162
160
|
const itkImage = {
|
|
163
161
|
imageType: {
|
|
@@ -206,8 +204,7 @@ function convertVtkToItkImage(vtkImage) {
|
|
|
206
204
|
*
|
|
207
205
|
* Requires an itk-wasm PolyData as input.
|
|
208
206
|
*/
|
|
209
|
-
function convertItkToVtkPolyData(itkPolyData) {
|
|
210
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
207
|
+
function convertItkToVtkPolyData(itkPolyData, options = {}) {
|
|
211
208
|
const pointDataArrays = [];
|
|
212
209
|
if (itkPolyData.pointData.length) {
|
|
213
210
|
pointDataArrays.push({
|
|
@@ -427,8 +424,7 @@ function convertItkToVtkPolyData(itkPolyData) {
|
|
|
427
424
|
* Requires a vtk.js vtkPolyData as input.
|
|
428
425
|
*
|
|
429
426
|
*/
|
|
430
|
-
function convertVtkToItkPolyData(polyData) {
|
|
431
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
427
|
+
function convertVtkToItkPolyData(polyData, options = {}) {
|
|
432
428
|
const itkPolyData = {
|
|
433
429
|
polyDataType: {
|
|
434
430
|
pointPixelComponentType: 'float32',
|
|
@@ -17,14 +17,11 @@ const {
|
|
|
17
17
|
function vtkImageData(publicAPI, model) {
|
|
18
18
|
// Set our className
|
|
19
19
|
model.classHierarchy.push('vtkImageData');
|
|
20
|
-
publicAPI.setExtent =
|
|
20
|
+
publicAPI.setExtent = (...inExtent) => {
|
|
21
21
|
if (model.deleted) {
|
|
22
22
|
vtkErrorMacro('instance deleted - cannot call any method');
|
|
23
23
|
return false;
|
|
24
24
|
}
|
|
25
|
-
for (var _len = arguments.length, inExtent = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
|
-
inExtent[_key] = arguments[_key];
|
|
27
|
-
}
|
|
28
25
|
const extentArray = inExtent.length === 1 ? inExtent[0] : inExtent;
|
|
29
26
|
if (extentArray.length !== 6) {
|
|
30
27
|
return false;
|
|
@@ -37,7 +34,7 @@ function vtkImageData(publicAPI, model) {
|
|
|
37
34
|
}
|
|
38
35
|
return changeDetected;
|
|
39
36
|
};
|
|
40
|
-
publicAPI.setDimensions =
|
|
37
|
+
publicAPI.setDimensions = (...dims) => {
|
|
41
38
|
let i;
|
|
42
39
|
let j;
|
|
43
40
|
let k;
|
|
@@ -45,15 +42,15 @@ function vtkImageData(publicAPI, model) {
|
|
|
45
42
|
vtkErrorMacro('instance deleted - cannot call any method');
|
|
46
43
|
return;
|
|
47
44
|
}
|
|
48
|
-
if (
|
|
49
|
-
const array =
|
|
45
|
+
if (dims.length === 1) {
|
|
46
|
+
const array = dims[0];
|
|
50
47
|
i = array[0];
|
|
51
48
|
j = array[1];
|
|
52
49
|
k = array[2];
|
|
53
|
-
} else if (
|
|
54
|
-
i =
|
|
55
|
-
j =
|
|
56
|
-
k =
|
|
50
|
+
} else if (dims.length === 3) {
|
|
51
|
+
i = dims[0];
|
|
52
|
+
j = dims[1];
|
|
53
|
+
k = dims[2];
|
|
57
54
|
} else {
|
|
58
55
|
vtkErrorMacro('Bad dimension specification');
|
|
59
56
|
return;
|
|
@@ -171,26 +168,18 @@ function vtkImageData(publicAPI, model) {
|
|
|
171
168
|
mat4.scale(model.indexToWorld, model.indexToWorld, model.spacing);
|
|
172
169
|
mat4.invert(model.worldToIndex, model.indexToWorld);
|
|
173
170
|
};
|
|
174
|
-
publicAPI.indexToWorld =
|
|
175
|
-
let aout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
171
|
+
publicAPI.indexToWorld = (ain, aout = []) => {
|
|
176
172
|
vec3.transformMat4(aout, ain, model.indexToWorld);
|
|
177
173
|
return aout;
|
|
178
174
|
};
|
|
179
175
|
publicAPI.indexToWorldVec3 = publicAPI.indexToWorld;
|
|
180
|
-
publicAPI.worldToIndex =
|
|
181
|
-
let aout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
176
|
+
publicAPI.worldToIndex = (ain, aout = []) => {
|
|
182
177
|
vec3.transformMat4(aout, ain, model.worldToIndex);
|
|
183
178
|
return aout;
|
|
184
179
|
};
|
|
185
180
|
publicAPI.worldToIndexVec3 = publicAPI.worldToIndex;
|
|
186
|
-
publicAPI.indexToWorldBounds =
|
|
187
|
-
|
|
188
|
-
return vtkBoundingBox.transformBounds(bin, model.indexToWorld, bout);
|
|
189
|
-
};
|
|
190
|
-
publicAPI.worldToIndexBounds = function (bin) {
|
|
191
|
-
let bout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
192
|
-
return vtkBoundingBox.transformBounds(bin, model.worldToIndex, bout);
|
|
193
|
-
};
|
|
181
|
+
publicAPI.indexToWorldBounds = (bin, bout = []) => vtkBoundingBox.transformBounds(bin, model.indexToWorld, bout);
|
|
182
|
+
publicAPI.worldToIndexBounds = (bin, bout = []) => vtkBoundingBox.transformBounds(bin, model.worldToIndex, bout);
|
|
194
183
|
|
|
195
184
|
// Make sure the transform is correct
|
|
196
185
|
model._onOriginChanged = publicAPI.computeTransforms;
|
|
@@ -198,8 +187,7 @@ function vtkImageData(publicAPI, model) {
|
|
|
198
187
|
model._onSpacingChanged = publicAPI.computeTransforms;
|
|
199
188
|
publicAPI.computeTransforms();
|
|
200
189
|
publicAPI.getCenter = () => vtkBoundingBox.getCenter(publicAPI.getBounds());
|
|
201
|
-
publicAPI.computeHistogram =
|
|
202
|
-
let voxelFunction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
190
|
+
publicAPI.computeHistogram = (worldBounds, voxelFunction = null) => {
|
|
203
191
|
const bounds = [0, 0, 0, 0, 0, 0];
|
|
204
192
|
publicAPI.worldToIndexBounds(worldBounds, bounds);
|
|
205
193
|
const point1 = [0, 0, 0];
|
|
@@ -249,8 +237,7 @@ function vtkImageData(publicAPI, model) {
|
|
|
249
237
|
|
|
250
238
|
// TODO: use the unimplemented `vtkDataSetAttributes` for scalar length, that is currently also a TODO (GetNumberOfComponents).
|
|
251
239
|
// Scalar data could be tuples for color information?
|
|
252
|
-
publicAPI.computeIncrements =
|
|
253
|
-
let numberOfComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
240
|
+
publicAPI.computeIncrements = (extent, numberOfComponents = 1) => {
|
|
254
241
|
const increments = [];
|
|
255
242
|
let incr = numberOfComponents;
|
|
256
243
|
|
|
@@ -267,8 +254,7 @@ function vtkImageData(publicAPI, model) {
|
|
|
267
254
|
* @param {Number[]} index the localized `[i,j,k]` pixel array position. Float values will be rounded.
|
|
268
255
|
* @return {Number} the corresponding flattened index in the scalar array
|
|
269
256
|
*/
|
|
270
|
-
publicAPI.computeOffsetIndex =
|
|
271
|
-
let [i, j, k] = _ref;
|
|
257
|
+
publicAPI.computeOffsetIndex = ([i, j, k]) => {
|
|
272
258
|
const extent = publicAPI.getExtent();
|
|
273
259
|
const numberOfComponents = publicAPI.getPointData().getScalars().getNumberOfComponents();
|
|
274
260
|
const increments = publicAPI.computeIncrements(extent, numberOfComponents);
|
|
@@ -302,8 +288,7 @@ function vtkImageData(publicAPI, model) {
|
|
|
302
288
|
* @param {Number?} comp the scalar component index for multi-component scalars
|
|
303
289
|
* @return {Number|NaN} the corresponding pixel's scalar value
|
|
304
290
|
*/
|
|
305
|
-
publicAPI.getScalarValueFromWorld =
|
|
306
|
-
let comp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
291
|
+
publicAPI.getScalarValueFromWorld = (xyz, comp = 0) => {
|
|
307
292
|
const numberOfComponents = publicAPI.getPointData().getScalars().getNumberOfComponents();
|
|
308
293
|
if (comp < 0 || comp >= numberOfComponents) {
|
|
309
294
|
vtkErrorMacro(`GetScalarPointer: Scalar Component ${comp} is not within bounds. Current Scalar numberOfComponents: ${numberOfComponents}`);
|
|
@@ -348,8 +333,7 @@ const DEFAULT_VALUES = {
|
|
|
348
333
|
|
|
349
334
|
// ----------------------------------------------------------------------------
|
|
350
335
|
|
|
351
|
-
function extend(publicAPI, model) {
|
|
352
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
336
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
353
337
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
354
338
|
|
|
355
339
|
// Inheritance
|
|
@@ -113,8 +113,7 @@ const DEFAULT_VALUES = {
|
|
|
113
113
|
|
|
114
114
|
// ----------------------------------------------------------------------------
|
|
115
115
|
|
|
116
|
-
function extend(publicAPI, model) {
|
|
117
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
116
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
118
117
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
119
118
|
|
|
120
119
|
// Object methods
|
|
@@ -36,8 +36,7 @@ const DEFAULT_VALUES = {
|
|
|
36
36
|
|
|
37
37
|
// ----------------------------------------------------------------------------
|
|
38
38
|
|
|
39
|
-
function extend(publicAPI, model) {
|
|
40
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
39
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
41
40
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
42
41
|
|
|
43
42
|
// Object methods
|
|
@@ -580,8 +580,7 @@ const DEFAULT_VALUES = {
|
|
|
580
580
|
|
|
581
581
|
// ----------------------------------------------------------------------------
|
|
582
582
|
|
|
583
|
-
function extend(publicAPI, model) {
|
|
584
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
583
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
585
584
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
586
585
|
|
|
587
586
|
// Make this a VTK object
|
|
@@ -99,7 +99,7 @@ function vtkIncrementalOctreePointLocator(publicAPI, model) {
|
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
//------------------------------------------------------------------------------
|
|
102
|
-
publicAPI.initPointInsertion =
|
|
102
|
+
publicAPI.initPointInsertion = (points, bounds, estNumPts = 0) => {
|
|
103
103
|
let i = 0;
|
|
104
104
|
let bbIndex = 0;
|
|
105
105
|
if (points == null) {
|
|
@@ -334,8 +334,7 @@ function defaultValues(initialValues) {
|
|
|
334
334
|
|
|
335
335
|
// ----------------------------------------------------------------------------
|
|
336
336
|
|
|
337
|
-
function extend(publicAPI, model) {
|
|
338
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
337
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
339
338
|
vtkAbstractPointLocator.extend(publicAPI, model, defaultValues(initialValues));
|
|
340
339
|
|
|
341
340
|
// Make this a VTK object
|