@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
|
@@ -181,13 +181,13 @@ function vtkCubeSource(publicAPI, model) {
|
|
|
181
181
|
}
|
|
182
182
|
polyData.modified();
|
|
183
183
|
};
|
|
184
|
-
publicAPI.setBounds =
|
|
184
|
+
publicAPI.setBounds = (...bounds) => {
|
|
185
185
|
let boundsArray = [];
|
|
186
|
-
if (Array.isArray(
|
|
187
|
-
boundsArray =
|
|
186
|
+
if (Array.isArray(bounds[0])) {
|
|
187
|
+
boundsArray = bounds[0];
|
|
188
188
|
} else {
|
|
189
|
-
for (let i = 0; i <
|
|
190
|
-
boundsArray.push(
|
|
189
|
+
for (let i = 0; i < bounds.length; i++) {
|
|
190
|
+
boundsArray.push(bounds[i]);
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
if (boundsArray.length !== 6) {
|
|
@@ -216,8 +216,7 @@ const DEFAULT_VALUES = {
|
|
|
216
216
|
|
|
217
217
|
// ----------------------------------------------------------------------------
|
|
218
218
|
|
|
219
|
-
function extend(publicAPI, model) {
|
|
220
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
219
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
221
220
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
222
221
|
|
|
223
222
|
// Build VTK API
|
|
@@ -373,8 +373,7 @@ const DEFAULT_VALUES = {
|
|
|
373
373
|
|
|
374
374
|
// ----------------------------------------------------------------------------
|
|
375
375
|
|
|
376
|
-
function extend(publicAPI, model) {
|
|
377
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
376
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
378
377
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
379
378
|
|
|
380
379
|
// Build VTK API
|
|
@@ -171,8 +171,7 @@ const DEFAULT_VALUES = {
|
|
|
171
171
|
|
|
172
172
|
// ----------------------------------------------------------------------------
|
|
173
173
|
|
|
174
|
-
function extend(publicAPI, model) {
|
|
175
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
174
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
176
175
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
177
176
|
|
|
178
177
|
// Build VTK API
|
|
@@ -107,8 +107,7 @@ function defaultValues(initialValues) {
|
|
|
107
107
|
|
|
108
108
|
// ----------------------------------------------------------------------------
|
|
109
109
|
|
|
110
|
-
function extend(publicAPI, model) {
|
|
111
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
110
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
112
111
|
Object.assign(model, defaultValues(initialValues));
|
|
113
112
|
|
|
114
113
|
// Build VTK API
|
|
@@ -128,8 +128,7 @@ const DEFAULT_VALUES = {
|
|
|
128
128
|
|
|
129
129
|
// ----------------------------------------------------------------------------
|
|
130
130
|
|
|
131
|
-
function extend(publicAPI, model) {
|
|
132
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
131
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
133
132
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
134
133
|
|
|
135
134
|
// Ensure resolution is at least 1
|
|
@@ -221,8 +221,7 @@ const DEFAULT_VALUES = {
|
|
|
221
221
|
|
|
222
222
|
// ----------------------------------------------------------------------------
|
|
223
223
|
|
|
224
|
-
function extend(publicAPI, model) {
|
|
225
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
224
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
226
225
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
227
226
|
|
|
228
227
|
// Build VTK API
|
|
@@ -89,8 +89,7 @@ const DEFAULT_VALUES = {
|
|
|
89
89
|
|
|
90
90
|
// ----------------------------------------------------------------------------
|
|
91
91
|
|
|
92
|
-
function extend(publicAPI, model) {
|
|
93
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
92
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
94
93
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
95
94
|
|
|
96
95
|
// Build VTK API
|
|
@@ -73,8 +73,7 @@ const DEFAULT_VALUES = {
|
|
|
73
73
|
|
|
74
74
|
// ----------------------------------------------------------------------------
|
|
75
75
|
|
|
76
|
-
function extend(publicAPI, model) {
|
|
77
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
76
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
78
77
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
79
78
|
|
|
80
79
|
// Build VTK API
|
|
@@ -98,12 +98,12 @@ function vtkPlaneSource(publicAPI, model) {
|
|
|
98
98
|
// Update output
|
|
99
99
|
outData[0] = pd;
|
|
100
100
|
};
|
|
101
|
-
publicAPI.setNormal =
|
|
101
|
+
publicAPI.setNormal = (...normal) => {
|
|
102
102
|
let n = [];
|
|
103
|
-
if (
|
|
104
|
-
n = [...
|
|
105
|
-
} else if (
|
|
106
|
-
n = [
|
|
103
|
+
if (normal.length === 1 || Array.isArray(normal[0])) {
|
|
104
|
+
n = [...normal[0]];
|
|
105
|
+
} else if (normal.length === 3) {
|
|
106
|
+
n = [normal[0], normal[1], normal[2]];
|
|
107
107
|
}
|
|
108
108
|
if (normalize(n) !== 0) {
|
|
109
109
|
const dp = dot(model.normal, n);
|
|
@@ -144,12 +144,12 @@ function vtkPlaneSource(publicAPI, model) {
|
|
|
144
144
|
vtkMatrixBuilder.buildFromRadian().rotate(angle, rotationAxis).apply(model.normal);
|
|
145
145
|
publicAPI.modified();
|
|
146
146
|
};
|
|
147
|
-
publicAPI.setCenter =
|
|
147
|
+
publicAPI.setCenter = (...center) => {
|
|
148
148
|
let c = [];
|
|
149
|
-
if (
|
|
150
|
-
c = [...
|
|
151
|
-
} else if (
|
|
152
|
-
c = [
|
|
149
|
+
if (center.length === 1 || Array.isArray(center[0])) {
|
|
150
|
+
c = [...center[0]];
|
|
151
|
+
} else if (center.length === 3) {
|
|
152
|
+
c = [center[0], center[1], center[2]];
|
|
153
153
|
}
|
|
154
154
|
if (!vec3.exactEquals(c, model.center)) {
|
|
155
155
|
const v1 = [];
|
|
@@ -165,12 +165,12 @@ function vtkPlaneSource(publicAPI, model) {
|
|
|
165
165
|
publicAPI.modified();
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
|
-
publicAPI.setPoint1 =
|
|
168
|
+
publicAPI.setPoint1 = (...point) => {
|
|
169
169
|
let point1 = [];
|
|
170
|
-
if (
|
|
171
|
-
point1 = [...
|
|
172
|
-
} else if (
|
|
173
|
-
point1 = [
|
|
170
|
+
if (point.length === 1 || Array.isArray(point[0])) {
|
|
171
|
+
point1 = [...point[0]];
|
|
172
|
+
} else if (point.length === 3) {
|
|
173
|
+
point1 = [point[0], point[1], point[2]];
|
|
174
174
|
}
|
|
175
175
|
if (!vec3.exactEquals(point1, model.point1)) {
|
|
176
176
|
const v1 = [];
|
|
@@ -184,12 +184,12 @@ function vtkPlaneSource(publicAPI, model) {
|
|
|
184
184
|
publicAPI.modified();
|
|
185
185
|
}
|
|
186
186
|
};
|
|
187
|
-
publicAPI.setPoint2 =
|
|
187
|
+
publicAPI.setPoint2 = (...point) => {
|
|
188
188
|
let point2 = [];
|
|
189
|
-
if (
|
|
190
|
-
point2 = [...
|
|
191
|
-
} else if (
|
|
192
|
-
point2 = [
|
|
189
|
+
if (point.length === 1 || Array.isArray(point[0])) {
|
|
190
|
+
point2 = [...point[0]];
|
|
191
|
+
} else if (point.length === 3) {
|
|
192
|
+
point2 = [point[0], point[1], point[2]];
|
|
193
193
|
}
|
|
194
194
|
if (!vec3.exactEquals(point2, model.point2)) {
|
|
195
195
|
const v1 = [];
|
|
@@ -230,8 +230,7 @@ const DEFAULT_VALUES = {
|
|
|
230
230
|
|
|
231
231
|
// ----------------------------------------------------------------------------
|
|
232
232
|
|
|
233
|
-
function extend(publicAPI, model) {
|
|
234
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
233
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
235
234
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
236
235
|
model.normal = [0, 0, 1];
|
|
237
236
|
model.center = [0, 0, 0];
|
|
@@ -121,8 +121,7 @@ const DEFAULT_VALUES = {
|
|
|
121
121
|
|
|
122
122
|
// ----------------------------------------------------------------------------
|
|
123
123
|
|
|
124
|
-
function extend(publicAPI, model) {
|
|
125
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
124
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
126
125
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
127
126
|
|
|
128
127
|
// Build VTK API
|
|
@@ -67,8 +67,7 @@ const DEFAULT_VALUES = {
|
|
|
67
67
|
|
|
68
68
|
// ----------------------------------------------------------------------------
|
|
69
69
|
|
|
70
|
-
function extend(publicAPI, model) {
|
|
71
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
70
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
72
71
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
73
72
|
|
|
74
73
|
// Build VTK API
|
|
@@ -83,8 +83,7 @@ const DEFAULT_VALUES = {
|
|
|
83
83
|
|
|
84
84
|
// ----------------------------------------------------------------------------
|
|
85
85
|
|
|
86
|
-
function extend(publicAPI, model) {
|
|
87
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
86
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
88
87
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
89
88
|
|
|
90
89
|
// Build VTK API
|
|
@@ -122,8 +122,7 @@ const DEFAULT_VALUES = {
|
|
|
122
122
|
|
|
123
123
|
// ----------------------------------------------------------------------------
|
|
124
124
|
|
|
125
|
-
function extend(publicAPI, model) {
|
|
126
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
125
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
127
126
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
128
127
|
|
|
129
128
|
// Build VTK API
|
|
@@ -185,8 +185,7 @@ const DEFAULT_VALUES = {
|
|
|
185
185
|
|
|
186
186
|
// ----------------------------------------------------------------------------
|
|
187
187
|
|
|
188
|
-
function extend(publicAPI, model) {
|
|
189
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
188
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
190
189
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
191
190
|
|
|
192
191
|
// Build VTK API
|
|
@@ -81,8 +81,7 @@ const DEFAULT_VALUES = {
|
|
|
81
81
|
|
|
82
82
|
// ----------------------------------------------------------------------------
|
|
83
83
|
|
|
84
|
-
function extend(publicAPI, model) {
|
|
85
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
84
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
86
85
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
87
86
|
|
|
88
87
|
// Build VTK API
|
|
@@ -76,8 +76,7 @@ const DEFAULT_VALUES = {
|
|
|
76
76
|
|
|
77
77
|
// ----------------------------------------------------------------------------
|
|
78
78
|
|
|
79
|
-
function extend(publicAPI, model) {
|
|
80
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
79
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
81
80
|
model.center = [0, 0, 0];
|
|
82
81
|
model.orientation = [1, 0, 0];
|
|
83
82
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
@@ -232,8 +232,7 @@ const DEFAULT_VALUES = {
|
|
|
232
232
|
|
|
233
233
|
// ----------------------------------------------------------------------------
|
|
234
234
|
|
|
235
|
-
function extend(publicAPI, model) {
|
|
236
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
235
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
237
236
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
238
237
|
|
|
239
238
|
// Build VTK API
|
|
@@ -127,8 +127,7 @@ const DEFAULT_VALUES = {
|
|
|
127
127
|
|
|
128
128
|
// ----------------------------------------------------------------------------
|
|
129
129
|
|
|
130
|
-
function extend(publicAPI, model) {
|
|
131
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
130
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
132
131
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
133
132
|
|
|
134
133
|
// Build VTK API
|
package/IO/Core/BinaryHelper.js
CHANGED
|
@@ -12,8 +12,7 @@ function arrayBufferToString(arrayBuffer) {
|
|
|
12
12
|
/**
|
|
13
13
|
* Extracts binary data out of a file ArrayBuffer given a prefix/suffix.
|
|
14
14
|
*/
|
|
15
|
-
function extractBinary(arrayBuffer, prefixRegex) {
|
|
16
|
-
let suffixRegex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
15
|
+
function extractBinary(arrayBuffer, prefixRegex, suffixRegex = null) {
|
|
17
16
|
const str = arrayBufferToString(arrayBuffer);
|
|
18
17
|
const prefixMatch = prefixRegex.exec(str);
|
|
19
18
|
if (!prefixMatch) {
|
|
@@ -20,7 +20,7 @@ function getElement(url) {
|
|
|
20
20
|
function removeLeadingSlash(str) {
|
|
21
21
|
return str[0] === '/' ? str.substr(1) : str;
|
|
22
22
|
}
|
|
23
|
-
function fetchText(instance, url) {
|
|
23
|
+
function fetchText(instance, url, options = {}) {
|
|
24
24
|
return new Promise((resolve, reject) => {
|
|
25
25
|
const txt = getContent(url);
|
|
26
26
|
if (txt === null) {
|
|
@@ -30,7 +30,7 @@ function fetchText(instance, url) {
|
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
function fetchJSON(instance, url) {
|
|
33
|
+
function fetchJSON(instance, url, options = {}) {
|
|
34
34
|
return new Promise((resolve, reject) => {
|
|
35
35
|
const txt = getContent(removeLeadingSlash(url));
|
|
36
36
|
if (txt === null) {
|
|
@@ -40,8 +40,7 @@ function fetchJSON(instance, url) {
|
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
function fetchArray(instance, baseURL, array) {
|
|
44
|
-
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
43
|
+
function fetchArray(instance, baseURL, array, options = {}) {
|
|
45
44
|
return new Promise((resolve, reject) => {
|
|
46
45
|
const url = removeLeadingSlash([baseURL, array.ref.basepath, options.compression ? `${array.ref.id}.gz` : array.ref.id].join('/'));
|
|
47
46
|
const txt = getContent(url);
|
|
@@ -98,7 +97,7 @@ function fetchArray(instance, baseURL, array) {
|
|
|
98
97
|
|
|
99
98
|
// ----------------------------------------------------------------------------
|
|
100
99
|
|
|
101
|
-
function fetchImage(instance, url) {
|
|
100
|
+
function fetchImage(instance, url, options = {}) {
|
|
102
101
|
return new Promise((resolve, reject) => {
|
|
103
102
|
const img = getElement(url);
|
|
104
103
|
if (img) {
|
|
@@ -12,23 +12,18 @@ const {
|
|
|
12
12
|
/* eslint-disable prefer-promise-reject-errors */
|
|
13
13
|
|
|
14
14
|
let requestCount = 0;
|
|
15
|
-
function openAsyncXHR(method, url) {
|
|
16
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
15
|
+
function openAsyncXHR(method, url, options = {}) {
|
|
17
16
|
const xhr = new XMLHttpRequest();
|
|
18
17
|
xhr.open(method, url, true);
|
|
19
18
|
if (options.headers) {
|
|
20
|
-
Object.entries(options.headers).forEach(
|
|
21
|
-
let [key, value] = _ref;
|
|
22
|
-
return xhr.setRequestHeader(key, value);
|
|
23
|
-
});
|
|
19
|
+
Object.entries(options.headers).forEach(([key, value]) => xhr.setRequestHeader(key, value));
|
|
24
20
|
}
|
|
25
21
|
if (options.progressCallback) {
|
|
26
22
|
xhr.addEventListener('progress', options.progressCallback);
|
|
27
23
|
}
|
|
28
24
|
return xhr;
|
|
29
25
|
}
|
|
30
|
-
function fetchBinary(url) {
|
|
31
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
26
|
+
function fetchBinary(url, options = {}) {
|
|
32
27
|
if (options && options.compression && options.compression !== 'gz') {
|
|
33
28
|
vtkErrorMacro('Supported algorithms are: [gz]');
|
|
34
29
|
vtkErrorMacro(`Unkown compression algorithm: ${options.compression}`);
|
|
@@ -57,8 +52,7 @@ function fetchBinary(url) {
|
|
|
57
52
|
xhr.send();
|
|
58
53
|
});
|
|
59
54
|
}
|
|
60
|
-
function fetchArray(instance, baseURL, array) {
|
|
61
|
-
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
55
|
+
function fetchArray(instance, baseURL, array, options = {}) {
|
|
62
56
|
if (array.ref && !array.ref.pending) {
|
|
63
57
|
return new Promise((resolve, reject) => {
|
|
64
58
|
let url = null;
|
|
@@ -128,8 +122,7 @@ function fetchArray(instance, baseURL, array) {
|
|
|
128
122
|
|
|
129
123
|
// ----------------------------------------------------------------------------
|
|
130
124
|
|
|
131
|
-
function fetchJSON(instance, url) {
|
|
132
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
125
|
+
function fetchJSON(instance, url, options = {}) {
|
|
133
126
|
return new Promise((resolve, reject) => {
|
|
134
127
|
const xhr = openAsyncXHR('GET', url, options);
|
|
135
128
|
xhr.onreadystatechange = e => {
|
|
@@ -165,8 +158,7 @@ function fetchJSON(instance, url) {
|
|
|
165
158
|
|
|
166
159
|
// ----------------------------------------------------------------------------
|
|
167
160
|
|
|
168
|
-
function fetchText(instance, url) {
|
|
169
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
161
|
+
function fetchText(instance, url, options = {}) {
|
|
170
162
|
if (options && options.compression && options.compression !== 'gz') {
|
|
171
163
|
vtkErrorMacro('Supported algorithms are: [gz]');
|
|
172
164
|
vtkErrorMacro(`Unkown compression algorithm: ${options.compression}`);
|
|
@@ -206,8 +198,7 @@ function fetchText(instance, url) {
|
|
|
206
198
|
|
|
207
199
|
// ----------------------------------------------------------------------------
|
|
208
200
|
|
|
209
|
-
function fetchImage(instance, url) {
|
|
210
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
201
|
+
function fetchImage(instance, url, options = {}) {
|
|
211
202
|
return new Promise((resolve, reject) => {
|
|
212
203
|
const img = new Image();
|
|
213
204
|
if (options.crossOrigin) {
|
|
@@ -104,8 +104,7 @@ function create(createOptions) {
|
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
return {
|
|
107
|
-
fetchArray(instance, baseURL, array) {
|
|
108
|
-
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
107
|
+
fetchArray(instance, baseURL, array, options = {}) {
|
|
109
108
|
return new Promise((resolve, reject) => {
|
|
110
109
|
if (!ready) {
|
|
111
110
|
vtkErrorMacro('ERROR!!! zip not ready...');
|
|
@@ -137,8 +136,7 @@ function create(createOptions) {
|
|
|
137
136
|
}
|
|
138
137
|
});
|
|
139
138
|
},
|
|
140
|
-
fetchJSON(instance, url) {
|
|
141
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
139
|
+
fetchJSON(instance, url, options = {}) {
|
|
142
140
|
const path = cleanUpPath(url);
|
|
143
141
|
if (!ready) {
|
|
144
142
|
vtkErrorMacro('ERROR!!! zip not ready...');
|
|
@@ -153,8 +151,7 @@ function create(createOptions) {
|
|
|
153
151
|
}
|
|
154
152
|
return Promise.resolve(JSON.parse(strFromU8(fileData)));
|
|
155
153
|
},
|
|
156
|
-
fetchText(instance, url) {
|
|
157
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
154
|
+
fetchText(instance, url, options = {}) {
|
|
158
155
|
const path = cleanUpPath(url);
|
|
159
156
|
if (!ready) {
|
|
160
157
|
vtkErrorMacro('ERROR!!! zip not ready...');
|
|
@@ -168,7 +165,7 @@ function create(createOptions) {
|
|
|
168
165
|
}
|
|
169
166
|
return Promise.resolve(strFromU8(fileData));
|
|
170
167
|
},
|
|
171
|
-
fetchImage(instance, url) {
|
|
168
|
+
fetchImage(instance, url, options = {}) {
|
|
172
169
|
const path = cleanUpPath(url);
|
|
173
170
|
if (!ready) {
|
|
174
171
|
vtkErrorMacro('ERROR!!! zip not ready...');
|
|
@@ -182,8 +179,7 @@ function create(createOptions) {
|
|
|
182
179
|
img.src = `data:image/${toMimeType(path)};base64,${str}`;
|
|
183
180
|
});
|
|
184
181
|
},
|
|
185
|
-
fetchBinary(instance, url) {
|
|
186
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
182
|
+
fetchBinary(instance, url, options = {}) {
|
|
187
183
|
const path = cleanUpPath(url);
|
|
188
184
|
if (!ready) {
|
|
189
185
|
vtkErrorMacro('ERROR!!! zip not ready...');
|
|
@@ -14,23 +14,18 @@ const REJECT_COMPRESSION = () => {
|
|
|
14
14
|
|
|
15
15
|
/* eslint-disable prefer-promise-reject-errors */
|
|
16
16
|
let requestCount = 0;
|
|
17
|
-
function openAsyncXHR(method, url) {
|
|
18
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
17
|
+
function openAsyncXHR(method, url, options = {}) {
|
|
19
18
|
const xhr = new XMLHttpRequest();
|
|
20
19
|
xhr.open(method, url, true);
|
|
21
20
|
if (options.headers) {
|
|
22
|
-
Object.entries(options.headers).forEach(
|
|
23
|
-
let [key, value] = _ref;
|
|
24
|
-
return xhr.setRequestHeader(key, value);
|
|
25
|
-
});
|
|
21
|
+
Object.entries(options.headers).forEach(([key, value]) => xhr.setRequestHeader(key, value));
|
|
26
22
|
}
|
|
27
23
|
if (options.progressCallback) {
|
|
28
24
|
xhr.addEventListener('progress', options.progressCallback);
|
|
29
25
|
}
|
|
30
26
|
return xhr;
|
|
31
27
|
}
|
|
32
|
-
function fetchBinary(url) {
|
|
33
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
28
|
+
function fetchBinary(url, options = {}) {
|
|
34
29
|
return new Promise((resolve, reject) => {
|
|
35
30
|
const xhr = openAsyncXHR('GET', url, options);
|
|
36
31
|
xhr.onreadystatechange = e => {
|
|
@@ -51,8 +46,7 @@ function fetchBinary(url) {
|
|
|
51
46
|
xhr.send();
|
|
52
47
|
});
|
|
53
48
|
}
|
|
54
|
-
function fetchArray(instance, baseURL, array) {
|
|
55
|
-
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
49
|
+
function fetchArray(instance, baseURL, array, options = {}) {
|
|
56
50
|
if (options && options.compression) {
|
|
57
51
|
return REJECT_COMPRESSION();
|
|
58
52
|
}
|
|
@@ -113,8 +107,7 @@ function fetchArray(instance, baseURL, array) {
|
|
|
113
107
|
|
|
114
108
|
// ----------------------------------------------------------------------------
|
|
115
109
|
|
|
116
|
-
function fetchJSON(instance, url) {
|
|
117
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
110
|
+
function fetchJSON(instance, url, options = {}) {
|
|
118
111
|
if (options && options.compression) {
|
|
119
112
|
return REJECT_COMPRESSION();
|
|
120
113
|
}
|
|
@@ -149,8 +142,7 @@ function fetchJSON(instance, url) {
|
|
|
149
142
|
|
|
150
143
|
// ----------------------------------------------------------------------------
|
|
151
144
|
|
|
152
|
-
function fetchText(instance, url) {
|
|
153
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
145
|
+
function fetchText(instance, url, options = {}) {
|
|
154
146
|
if (options && options.compression) {
|
|
155
147
|
return REJECT_COMPRESSION();
|
|
156
148
|
}
|
|
@@ -185,8 +177,7 @@ function fetchText(instance, url) {
|
|
|
185
177
|
|
|
186
178
|
// ----------------------------------------------------------------------------
|
|
187
179
|
|
|
188
|
-
function fetchImage(instance, url) {
|
|
189
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
180
|
+
function fetchImage(instance, url, options = {}) {
|
|
190
181
|
return new Promise((resolve, reject) => {
|
|
191
182
|
const img = new Image();
|
|
192
183
|
if (options.crossOrigin) {
|
|
@@ -2,9 +2,7 @@ const TYPE_MAPPING = {};
|
|
|
2
2
|
function has(type) {
|
|
3
3
|
return !!TYPE_MAPPING[type];
|
|
4
4
|
}
|
|
5
|
-
function get() {
|
|
6
|
-
let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'http';
|
|
7
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
5
|
+
function get(type = 'http', options = {}) {
|
|
8
6
|
return TYPE_MAPPING[type](options);
|
|
9
7
|
}
|
|
10
8
|
function registerType(type, fn) {
|
|
@@ -130,8 +130,7 @@ function vtkHttpDataSetReader(publicAPI, model) {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
// Internal method to fetch Array
|
|
133
|
-
function fetchArray(array) {
|
|
134
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
133
|
+
function fetchArray(array, options = {}) {
|
|
135
134
|
const arrayId = `${array.ref.id}|${array.vtkClass}`;
|
|
136
135
|
if (!cachedArraysAndPromises[arrayId]) {
|
|
137
136
|
// Cache the promise while fetching
|
|
@@ -200,8 +199,7 @@ function vtkHttpDataSetReader(publicAPI, model) {
|
|
|
200
199
|
}
|
|
201
200
|
|
|
202
201
|
// Fetch dataset (metadata)
|
|
203
|
-
publicAPI.updateMetadata =
|
|
204
|
-
let loadData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
202
|
+
publicAPI.updateMetadata = (loadData = false) => {
|
|
205
203
|
if (model.compression === 'zip') {
|
|
206
204
|
return new Promise((resolve, reject) => {
|
|
207
205
|
DataAccessHelper.get('http').fetchBinary(model.url).then(zipContent => {
|
|
@@ -237,8 +235,7 @@ function vtkHttpDataSetReader(publicAPI, model) {
|
|
|
237
235
|
};
|
|
238
236
|
|
|
239
237
|
// Set DataSet url
|
|
240
|
-
publicAPI.setUrl =
|
|
241
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
238
|
+
publicAPI.setUrl = (url, options = {}) => {
|
|
242
239
|
if (url.indexOf('index.json') === -1 && !options.fullpath) {
|
|
243
240
|
model.baseURL = url;
|
|
244
241
|
model.url = `${url}/index.json`;
|
|
@@ -255,12 +252,11 @@ function vtkHttpDataSetReader(publicAPI, model) {
|
|
|
255
252
|
// Fetch metadata
|
|
256
253
|
return publicAPI.updateMetadata(!!options.loadData);
|
|
257
254
|
};
|
|
258
|
-
publicAPI.parseObject = (manifest,
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
} = _ref;
|
|
255
|
+
publicAPI.parseObject = (manifest, {
|
|
256
|
+
loadData,
|
|
257
|
+
baseUrl,
|
|
258
|
+
deepCopy = true
|
|
259
|
+
}) => {
|
|
264
260
|
if (baseUrl) {
|
|
265
261
|
model.baseURL = baseUrl;
|
|
266
262
|
}
|
|
@@ -309,8 +305,7 @@ function vtkHttpDataSetReader(publicAPI, model) {
|
|
|
309
305
|
};
|
|
310
306
|
|
|
311
307
|
// Toggle arrays to load
|
|
312
|
-
publicAPI.enableArray =
|
|
313
|
-
let enable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
308
|
+
publicAPI.enableArray = (location, name, enable = true) => {
|
|
314
309
|
const activeArray = model.arrays.filter(array => array.name === name && array.location === location);
|
|
315
310
|
if (activeArray.length === 1) {
|
|
316
311
|
activeArray[0].enable = enable;
|
|
@@ -348,8 +343,7 @@ const DEFAULT_VALUES = {
|
|
|
348
343
|
|
|
349
344
|
// ----------------------------------------------------------------------------
|
|
350
345
|
|
|
351
|
-
function extend(publicAPI, model) {
|
|
352
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
346
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
353
347
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
354
348
|
|
|
355
349
|
// Build VTK API
|
|
@@ -62,8 +62,7 @@ function vtkHttpDataSetSeriesReader(publicAPI, model) {
|
|
|
62
62
|
model.dataAccessHelper = HTTP_DATA_ACCESS;
|
|
63
63
|
}
|
|
64
64
|
model.currentReader = null;
|
|
65
|
-
publicAPI.updateMetaData =
|
|
66
|
-
let loadData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
65
|
+
publicAPI.updateMetaData = (loadData = false) => {
|
|
67
66
|
if (model.compression === 'zip') {
|
|
68
67
|
return new Promise((resolve, reject) => {
|
|
69
68
|
HTTP_DATA_ACCESS.fetchBinary(model.baseURL).then(zipContent => {
|
|
@@ -87,8 +86,7 @@ function vtkHttpDataSetSeriesReader(publicAPI, model) {
|
|
|
87
86
|
});
|
|
88
87
|
});
|
|
89
88
|
};
|
|
90
|
-
publicAPI.setUrl =
|
|
91
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
89
|
+
publicAPI.setUrl = (url, options = {}) => {
|
|
92
90
|
if (!url.endsWith('index.json') && !options.fullpath) {
|
|
93
91
|
model.baseURL = url;
|
|
94
92
|
model.url = `${url}/index.json`;
|
|
@@ -134,8 +132,7 @@ function vtkHttpDataSetSeriesReader(publicAPI, model) {
|
|
|
134
132
|
};
|
|
135
133
|
|
|
136
134
|
// Toggle arrays to load
|
|
137
|
-
publicAPI.enableArray =
|
|
138
|
-
let enable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
135
|
+
publicAPI.enableArray = (location, name, enable = true) => {
|
|
139
136
|
if (model.currentReader) {
|
|
140
137
|
model.currentReader.reader.enableArray(location, name, enable);
|
|
141
138
|
}
|
|
@@ -160,8 +157,7 @@ const DEFAULT_VALUES = {
|
|
|
160
157
|
|
|
161
158
|
// ----------------------------------------------------------------------------
|
|
162
159
|
|
|
163
|
-
function extend(publicAPI, model) {
|
|
164
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
160
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
165
161
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
166
162
|
|
|
167
163
|
// Build VTK API
|