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