@kitware/vtk.js 34.16.3 → 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.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 +22 -15
|
@@ -14,202 +14,191 @@ function getProperties(proxy) {
|
|
|
14
14
|
// ----------------------------------------------------------------------------
|
|
15
15
|
|
|
16
16
|
function addStateAPI(publicAPI, model) {
|
|
17
|
-
publicAPI.loadState =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const proxy = publicAPI.createProxy(group, name);
|
|
35
|
-
proxy.setName(props.name);
|
|
36
|
-
proxy.setInputData(dataset, props.type);
|
|
37
|
-
proxyMapping[id] = proxy;
|
|
38
|
-
return proxy;
|
|
39
|
-
}
|
|
40
|
-
return null;
|
|
41
|
-
}));
|
|
42
|
-
});
|
|
43
|
-
Promise.all(sourcePromises).then(() => {
|
|
44
|
-
const views = publicAPI.getViews();
|
|
45
|
-
state.views.forEach(_ref2 => {
|
|
46
|
-
let {
|
|
47
|
-
id,
|
|
48
|
-
group,
|
|
49
|
-
name,
|
|
50
|
-
props,
|
|
51
|
-
camera
|
|
52
|
-
} = _ref2;
|
|
53
|
-
let proxy = null;
|
|
54
|
-
if (state.options.recycleViews) {
|
|
55
|
-
proxy = views.find(v => v.getProxyGroup() === group && v.getProxyName() === name && v.getName() === props.name);
|
|
56
|
-
}
|
|
57
|
-
if (!proxy) {
|
|
58
|
-
proxy = publicAPI.createProxy(group, name, {
|
|
59
|
-
disableAnimation: true
|
|
60
|
-
});
|
|
61
|
-
} else {
|
|
62
|
-
proxy.setDisableAnimation(true);
|
|
63
|
-
}
|
|
64
|
-
proxy.set(props, true);
|
|
17
|
+
publicAPI.loadState = (state, options = {}) => new Promise((resolve, reject) => {
|
|
18
|
+
const proxyMapping = {};
|
|
19
|
+
const $oldToNewIdMapping = {};
|
|
20
|
+
const cameras = {};
|
|
21
|
+
const datasetHandler = options.datasetHandler || vtk;
|
|
22
|
+
const sourcePromises = [];
|
|
23
|
+
state.sources.forEach(({
|
|
24
|
+
id,
|
|
25
|
+
group,
|
|
26
|
+
name,
|
|
27
|
+
props
|
|
28
|
+
}) => {
|
|
29
|
+
sourcePromises.push(Promise.resolve(datasetHandler(props.dataset)).then(dataset => {
|
|
30
|
+
if (dataset) {
|
|
31
|
+
const proxy = publicAPI.createProxy(group, name);
|
|
32
|
+
proxy.setName(props.name);
|
|
33
|
+
proxy.setInputData(dataset, props.type);
|
|
65
34
|
proxyMapping[id] = proxy;
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
35
|
+
return proxy;
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}));
|
|
39
|
+
});
|
|
40
|
+
Promise.all(sourcePromises).then(() => {
|
|
41
|
+
const views = publicAPI.getViews();
|
|
42
|
+
state.views.forEach(({
|
|
43
|
+
id,
|
|
44
|
+
group,
|
|
45
|
+
name,
|
|
46
|
+
props,
|
|
47
|
+
camera
|
|
48
|
+
}) => {
|
|
49
|
+
let proxy = null;
|
|
50
|
+
if (state.options.recycleViews) {
|
|
51
|
+
proxy = views.find(v => v.getProxyGroup() === group && v.getProxyName() === name && v.getName() === props.name);
|
|
52
|
+
}
|
|
53
|
+
if (!proxy) {
|
|
54
|
+
proxy = publicAPI.createProxy(group, name, {
|
|
55
|
+
disableAnimation: true
|
|
76
56
|
});
|
|
57
|
+
} else {
|
|
58
|
+
proxy.setDisableAnimation(true);
|
|
77
59
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
// rep initialization from resetting restored luts/pwfs
|
|
91
|
-
Object.keys(state.fields).forEach(fieldName => {
|
|
92
|
-
const {
|
|
93
|
-
lookupTable,
|
|
94
|
-
piecewiseFunction
|
|
95
|
-
} = state.fields[fieldName];
|
|
96
|
-
const lutProxy = publicAPI.getLookupTable(fieldName, lookupTable);
|
|
97
|
-
lutProxy.setPresetName(lookupTable.presetName);
|
|
98
|
-
lutProxy.setDataRange(...lookupTable.dataRange);
|
|
99
|
-
const pwfProxy = publicAPI.getPiecewiseFunction(fieldName, piecewiseFunction);
|
|
100
|
-
switch (piecewiseFunction.mode) {
|
|
101
|
-
case vtkPiecewiseFunctionProxy.Mode.Gaussians:
|
|
102
|
-
pwfProxy.setGaussians(piecewiseFunction.gaussians);
|
|
103
|
-
break;
|
|
104
|
-
case vtkPiecewiseFunctionProxy.Mode.Points:
|
|
105
|
-
pwfProxy.setPoints(piecewiseFunction.points);
|
|
106
|
-
break;
|
|
107
|
-
case vtkPiecewiseFunctionProxy.Mode.Nodes:
|
|
108
|
-
pwfProxy.setNodes(piecewiseFunction.nodes);
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
pwfProxy.setMode(piecewiseFunction.mode);
|
|
112
|
-
pwfProxy.setDataRange(...piecewiseFunction.dataRange);
|
|
60
|
+
proxy.set(props, true);
|
|
61
|
+
proxyMapping[id] = proxy;
|
|
62
|
+
cameras[id] = camera;
|
|
63
|
+
});
|
|
64
|
+
function updateView(view) {
|
|
65
|
+
if (!proxyMapping[view] || !cameras[view]) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
proxyMapping[view].resetOrientation().then(() => {
|
|
69
|
+
proxyMapping[view].getCamera().set(cameras[view]);
|
|
70
|
+
proxyMapping[view].getRenderer().updateLightsGeometryToFollowCamera();
|
|
71
|
+
proxyMapping[view].renderLater();
|
|
113
72
|
});
|
|
73
|
+
}
|
|
74
|
+
state.representations.forEach(({
|
|
75
|
+
source,
|
|
76
|
+
view,
|
|
77
|
+
props
|
|
78
|
+
}) => {
|
|
79
|
+
const proxy = publicAPI.getRepresentation(proxyMapping[source], proxyMapping[view]);
|
|
80
|
+
proxy.set(props, true);
|
|
81
|
+
updateView(view);
|
|
82
|
+
});
|
|
114
83
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
84
|
+
// restore luts and pwfs after restoring reps to avoid
|
|
85
|
+
// rep initialization from resetting restored luts/pwfs
|
|
86
|
+
Object.keys(state.fields).forEach(fieldName => {
|
|
87
|
+
const {
|
|
88
|
+
lookupTable,
|
|
89
|
+
piecewiseFunction
|
|
90
|
+
} = state.fields[fieldName];
|
|
91
|
+
const lutProxy = publicAPI.getLookupTable(fieldName, lookupTable);
|
|
92
|
+
lutProxy.setPresetName(lookupTable.presetName);
|
|
93
|
+
lutProxy.setDataRange(...lookupTable.dataRange);
|
|
94
|
+
const pwfProxy = publicAPI.getPiecewiseFunction(fieldName, piecewiseFunction);
|
|
95
|
+
switch (piecewiseFunction.mode) {
|
|
96
|
+
case vtkPiecewiseFunctionProxy.Mode.Gaussians:
|
|
97
|
+
pwfProxy.setGaussians(piecewiseFunction.gaussians);
|
|
98
|
+
break;
|
|
99
|
+
case vtkPiecewiseFunctionProxy.Mode.Points:
|
|
100
|
+
pwfProxy.setPoints(piecewiseFunction.points);
|
|
101
|
+
break;
|
|
102
|
+
case vtkPiecewiseFunctionProxy.Mode.Nodes:
|
|
103
|
+
pwfProxy.setNodes(piecewiseFunction.nodes);
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
pwfProxy.setMode(piecewiseFunction.mode);
|
|
107
|
+
pwfProxy.setDataRange(...piecewiseFunction.dataRange);
|
|
108
|
+
});
|
|
123
109
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
let {
|
|
127
|
-
id
|
|
128
|
-
} = _ref4;
|
|
129
|
-
proxyMapping[id].setDisableAnimation(false);
|
|
130
|
-
});
|
|
131
|
-
resolve({
|
|
132
|
-
...state.userData,
|
|
133
|
-
$oldToNewIdMapping
|
|
134
|
-
});
|
|
135
|
-
}).catch(reject);
|
|
136
|
-
});
|
|
137
|
-
};
|
|
138
|
-
publicAPI.saveState = function () {
|
|
139
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
140
|
-
let userData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
141
|
-
return new Promise((resolve, reject) => {
|
|
142
|
-
const sources = publicAPI.getSources();
|
|
143
|
-
// const representations = publicAPI.getRepresentations();
|
|
144
|
-
const views = publicAPI.getViews();
|
|
110
|
+
// Apply camera no matter what
|
|
111
|
+
Object.keys(cameras).forEach(updateView);
|
|
145
112
|
|
|
146
|
-
//
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
const fieldNames = new Set();
|
|
151
|
-
const state = {
|
|
152
|
-
userData,
|
|
153
|
-
options,
|
|
154
|
-
sources: [],
|
|
155
|
-
views: [],
|
|
156
|
-
representations: [],
|
|
157
|
-
fields: {}
|
|
158
|
-
};
|
|
159
|
-
sources.forEach(source => {
|
|
160
|
-
const dataset = Promise.resolve(datasetHandler(source.getDataset(), source));
|
|
161
|
-
datasets.push(dataset);
|
|
162
|
-
state.sources.push({
|
|
163
|
-
id: source.getProxyId(),
|
|
164
|
-
group: source.getProxyGroup(),
|
|
165
|
-
name: source.getProxyName(),
|
|
166
|
-
props: {
|
|
167
|
-
name: source.getName(),
|
|
168
|
-
type: source.getType(),
|
|
169
|
-
dataset
|
|
170
|
-
}
|
|
171
|
-
});
|
|
113
|
+
// Create id mapping
|
|
114
|
+
Object.keys(proxyMapping).forEach(originalId => {
|
|
115
|
+
const newId = proxyMapping[originalId].getProxyId();
|
|
116
|
+
$oldToNewIdMapping[originalId] = newId;
|
|
172
117
|
});
|
|
173
|
-
views.forEach(view => {
|
|
174
|
-
const camera = view.getCamera().get('position', 'viewUp', 'focalPoint');
|
|
175
|
-
state.views.push({
|
|
176
|
-
id: view.getProxyId(),
|
|
177
|
-
group: view.getProxyGroup(),
|
|
178
|
-
name: view.getProxyName(),
|
|
179
|
-
props: Object.assign(getProperties(view), view.get('axis', 'orientation', 'viewUp')),
|
|
180
|
-
camera
|
|
181
|
-
});
|
|
182
118
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
view: view.getProxyId(),
|
|
189
|
-
props: getProperties(representation)
|
|
190
|
-
});
|
|
191
|
-
fieldNames.add(representation.getColorBy()[0]);
|
|
192
|
-
});
|
|
119
|
+
// Re-enable animation on views
|
|
120
|
+
state.views.forEach(({
|
|
121
|
+
id
|
|
122
|
+
}) => {
|
|
123
|
+
proxyMapping[id].setDisableAnimation(false);
|
|
193
124
|
});
|
|
194
|
-
|
|
195
|
-
state.
|
|
196
|
-
|
|
197
|
-
piecewiseFunction: publicAPI.getPiecewiseFunction(fieldName).get('mode', 'gaussians', 'points', 'nodes', 'arrayName', 'arrayLocation', 'dataRange')
|
|
198
|
-
};
|
|
125
|
+
resolve({
|
|
126
|
+
...state.userData,
|
|
127
|
+
$oldToNewIdMapping
|
|
199
128
|
});
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
129
|
+
}).catch(reject);
|
|
130
|
+
});
|
|
131
|
+
publicAPI.saveState = (options = {}, userData = {}) => new Promise((resolve, reject) => {
|
|
132
|
+
const sources = publicAPI.getSources();
|
|
133
|
+
// const representations = publicAPI.getRepresentations();
|
|
134
|
+
const views = publicAPI.getViews();
|
|
135
|
+
|
|
136
|
+
// Extract handlers
|
|
137
|
+
const datasetHandler = options.datasetHandler || (d => d.getState());
|
|
138
|
+
delete options.datasetHandler;
|
|
139
|
+
const datasets = [];
|
|
140
|
+
const fieldNames = new Set();
|
|
141
|
+
const state = {
|
|
142
|
+
userData,
|
|
143
|
+
options,
|
|
144
|
+
sources: [],
|
|
145
|
+
views: [],
|
|
146
|
+
representations: [],
|
|
147
|
+
fields: {}
|
|
148
|
+
};
|
|
149
|
+
sources.forEach(source => {
|
|
150
|
+
const dataset = Promise.resolve(datasetHandler(source.getDataset(), source));
|
|
151
|
+
datasets.push(dataset);
|
|
152
|
+
state.sources.push({
|
|
153
|
+
id: source.getProxyId(),
|
|
154
|
+
group: source.getProxyGroup(),
|
|
155
|
+
name: source.getProxyName(),
|
|
156
|
+
props: {
|
|
157
|
+
name: source.getName(),
|
|
158
|
+
type: source.getType(),
|
|
159
|
+
dataset
|
|
206
160
|
}
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
views.forEach(view => {
|
|
164
|
+
const camera = view.getCamera().get('position', 'viewUp', 'focalPoint');
|
|
165
|
+
state.views.push({
|
|
166
|
+
id: view.getProxyId(),
|
|
167
|
+
group: view.getProxyGroup(),
|
|
168
|
+
name: view.getProxyName(),
|
|
169
|
+
props: Object.assign(getProperties(view), view.get('axis', 'orientation', 'viewUp')),
|
|
170
|
+
camera
|
|
171
|
+
});
|
|
207
172
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
173
|
+
// Loop over view representations
|
|
174
|
+
const representations = view.getRepresentations();
|
|
175
|
+
representations.forEach(representation => {
|
|
176
|
+
state.representations.push({
|
|
177
|
+
source: representation.getInput().getProxyId(),
|
|
178
|
+
view: view.getProxyId(),
|
|
179
|
+
props: getProperties(representation)
|
|
180
|
+
});
|
|
181
|
+
fieldNames.add(representation.getColorBy()[0]);
|
|
182
|
+
});
|
|
211
183
|
});
|
|
212
|
-
|
|
184
|
+
fieldNames.forEach(fieldName => {
|
|
185
|
+
state.fields[fieldName] = {
|
|
186
|
+
lookupTable: publicAPI.getLookupTable(fieldName).get('mode', 'presetName', 'rgbPoints', 'hsvPoints', 'nodes', 'arrayName', 'arrayLocation', 'dataRange'),
|
|
187
|
+
piecewiseFunction: publicAPI.getPiecewiseFunction(fieldName).get('mode', 'gaussians', 'points', 'nodes', 'arrayName', 'arrayLocation', 'dataRange')
|
|
188
|
+
};
|
|
189
|
+
});
|
|
190
|
+
Promise.all(datasets).then(() => {
|
|
191
|
+
// Patch datasets in state to the result of the promises
|
|
192
|
+
for (let i = 0; i < state.sources.length; i++) {
|
|
193
|
+
state.sources[i].props.dataset.then(value => {
|
|
194
|
+
state.sources[i].props.dataset = value;
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// provide valide state
|
|
199
|
+
resolve(state);
|
|
200
|
+
}).catch(reject);
|
|
201
|
+
});
|
|
213
202
|
}
|
|
214
203
|
|
|
215
204
|
export { addStateAPI as default };
|
|
@@ -18,8 +18,7 @@ function addViewHandlingAPI(publicAPI, model) {
|
|
|
18
18
|
|
|
19
19
|
// --------------------------------------------------------------------------
|
|
20
20
|
|
|
21
|
-
publicAPI.renderAllViews =
|
|
22
|
-
let blocking = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
21
|
+
publicAPI.renderAllViews = (blocking = false) => {
|
|
23
22
|
const allViews = publicAPI.getViews();
|
|
24
23
|
for (let i = 0; i < allViews.length; i++) {
|
|
25
24
|
allViews[i].render(blocking);
|
|
@@ -28,8 +27,7 @@ function addViewHandlingAPI(publicAPI, model) {
|
|
|
28
27
|
|
|
29
28
|
// --------------------------------------------------------------------------
|
|
30
29
|
|
|
31
|
-
publicAPI.setAnimationOnAllViews =
|
|
32
|
-
let enable = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
30
|
+
publicAPI.setAnimationOnAllViews = (enable = false) => {
|
|
33
31
|
const allViews = publicAPI.getViews().filter(v => !enable || v.getContainer());
|
|
34
32
|
for (let i = 0; i < allViews.length; i++) {
|
|
35
33
|
allViews[i].setAnimation(enable, publicAPI);
|
|
@@ -48,8 +46,7 @@ function addViewHandlingAPI(publicAPI, model) {
|
|
|
48
46
|
|
|
49
47
|
// --------------------------------------------------------------------------
|
|
50
48
|
|
|
51
|
-
publicAPI.autoAnimateViews =
|
|
52
|
-
let debouceTimout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 250;
|
|
49
|
+
publicAPI.autoAnimateViews = (debouceTimout = 250) => {
|
|
53
50
|
if (!model.animating) {
|
|
54
51
|
model.animating = true;
|
|
55
52
|
const allViews = publicAPI.getViews().filter(v => v.getContainer());
|
|
@@ -6,8 +6,7 @@ import addVPropertyHandlingAPI from './ProxyManager/properties.js';
|
|
|
6
6
|
|
|
7
7
|
// ----------------------------------------------------------------------------
|
|
8
8
|
|
|
9
|
-
function extend(publicAPI, model) {
|
|
10
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
9
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
11
10
|
Object.assign(model, {
|
|
12
11
|
proxyIdMapping: {},
|
|
13
12
|
proxyByGroup: {},
|
|
@@ -19,7 +19,6 @@ function vtkSourceProxy(publicAPI, model) {
|
|
|
19
19
|
if (model.inputProxy) {
|
|
20
20
|
model.inputSubscription = source.onModified(publicAPI.update, -1).unsubscribe; // Trigger at next cycle
|
|
21
21
|
}
|
|
22
|
-
|
|
23
22
|
publicAPI.update();
|
|
24
23
|
};
|
|
25
24
|
|
|
@@ -36,8 +35,7 @@ function vtkSourceProxy(publicAPI, model) {
|
|
|
36
35
|
|
|
37
36
|
// --------------------------------------------------------------------------
|
|
38
37
|
|
|
39
|
-
publicAPI.setInputAlgorithm =
|
|
40
|
-
let autoUpdate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
38
|
+
publicAPI.setInputAlgorithm = (algo, type, autoUpdate = true) => {
|
|
41
39
|
model.type = type;
|
|
42
40
|
if (model.algo !== algo) {
|
|
43
41
|
model.algo = algo;
|
|
@@ -91,7 +89,6 @@ function vtkSourceProxy(publicAPI, model) {
|
|
|
91
89
|
publicAPI.update();
|
|
92
90
|
}, -1).unsubscribe; // Trigger at next cycle
|
|
93
91
|
}
|
|
94
|
-
|
|
95
92
|
if (model.algoFactory) {
|
|
96
93
|
publicAPI.setInputAlgorithm(model.algoFactory.newInstance(), null, model.autoUpdate);
|
|
97
94
|
}
|
|
@@ -108,8 +105,7 @@ const DEFAULT_VALUES = {
|
|
|
108
105
|
|
|
109
106
|
// ----------------------------------------------------------------------------
|
|
110
107
|
|
|
111
|
-
function extend(publicAPI, model) {
|
|
112
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
108
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
113
109
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
114
110
|
macro.obj(publicAPI, model);
|
|
115
111
|
macro.get(publicAPI, model, ['name', 'type', 'dataset', 'algo', 'inputProxy']);
|
|
@@ -143,8 +143,7 @@ function vtkView2DProxy(publicAPI, model) {
|
|
|
143
143
|
* Exact fitting requires useParallelRendering, and an active camera
|
|
144
144
|
* Otherwise, the default renderer.resetCamera is used and it uses a larger bounding box
|
|
145
145
|
*/
|
|
146
|
-
model._resetCamera =
|
|
147
|
-
let bounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
146
|
+
model._resetCamera = (bounds = null) => {
|
|
148
147
|
// Always reset camera first to set physicalScale, physicalTranslation and trigger events
|
|
149
148
|
const initialReset = superInternalResetCamera(bounds);
|
|
150
149
|
if (!model.fitProps || !model.useParallelRendering || !initialReset) {
|
|
@@ -331,8 +330,7 @@ const DEFAULT_VALUES = {
|
|
|
331
330
|
|
|
332
331
|
// ----------------------------------------------------------------------------
|
|
333
332
|
|
|
334
|
-
function extend(publicAPI, model) {
|
|
335
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
333
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
336
334
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
337
335
|
vtkViewProxy.extend(publicAPI, model, initialValues);
|
|
338
336
|
macro.get(publicAPI, model, ['axis']);
|
package/Proxy/Core/ViewProxy.js
CHANGED
|
@@ -46,10 +46,7 @@ function vtkViewProxy(publicAPI, model) {
|
|
|
46
46
|
/**
|
|
47
47
|
* Internal function used by publicAPI.resetCamera()
|
|
48
48
|
*/
|
|
49
|
-
model._resetCamera =
|
|
50
|
-
let bounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
51
|
-
return model.renderer.resetCamera(bounds);
|
|
52
|
-
};
|
|
49
|
+
model._resetCamera = (bounds = null) => model.renderer.resetCamera(bounds);
|
|
53
50
|
|
|
54
51
|
// Apply default interaction styles
|
|
55
52
|
InteractionPresets.applyPreset('3D', model.interactorStyle3D);
|
|
@@ -190,8 +187,7 @@ function vtkViewProxy(publicAPI, model) {
|
|
|
190
187
|
|
|
191
188
|
// --------------------------------------------------------------------------
|
|
192
189
|
|
|
193
|
-
publicAPI.render =
|
|
194
|
-
let blocking = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
190
|
+
publicAPI.render = (blocking = true) => {
|
|
195
191
|
if (model.representations.length > 0 && model.resetCameraOnFirstRender) {
|
|
196
192
|
model.resetCameraOnFirstRender = false;
|
|
197
193
|
publicAPI.resetCamera();
|
|
@@ -234,14 +230,13 @@ function vtkViewProxy(publicAPI, model) {
|
|
|
234
230
|
|
|
235
231
|
// --------------------------------------------------------------------------
|
|
236
232
|
|
|
237
|
-
publicAPI.setCameraParameters =
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
} = _ref;
|
|
233
|
+
publicAPI.setCameraParameters = ({
|
|
234
|
+
position,
|
|
235
|
+
focalPoint,
|
|
236
|
+
bounds,
|
|
237
|
+
parallelScale,
|
|
238
|
+
viewAngle
|
|
239
|
+
}) => {
|
|
245
240
|
if (position != null) {
|
|
246
241
|
model.camera.setPosition(...position);
|
|
247
242
|
}
|
|
@@ -272,18 +267,14 @@ function vtkViewProxy(publicAPI, model) {
|
|
|
272
267
|
|
|
273
268
|
// --------------------------------------------------------------------------
|
|
274
269
|
|
|
275
|
-
publicAPI.captureImage =
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
280
|
-
return model.renderWindow.captureImages(format, opts)[0];
|
|
281
|
-
};
|
|
270
|
+
publicAPI.captureImage = ({
|
|
271
|
+
format = 'image/png',
|
|
272
|
+
...opts
|
|
273
|
+
} = {}) => model.renderWindow.captureImages(format, opts)[0];
|
|
282
274
|
|
|
283
275
|
// --------------------------------------------------------------------------
|
|
284
276
|
|
|
285
|
-
publicAPI.openCaptureImage =
|
|
286
|
-
let target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '_blank';
|
|
277
|
+
publicAPI.openCaptureImage = (target = '_blank') => {
|
|
287
278
|
const image = new Image();
|
|
288
279
|
return publicAPI.captureImage().then(imageURL => {
|
|
289
280
|
image.src = imageURL;
|
|
@@ -304,8 +295,7 @@ function vtkViewProxy(publicAPI, model) {
|
|
|
304
295
|
|
|
305
296
|
// --------------------------------------------------------------------------
|
|
306
297
|
|
|
307
|
-
publicAPI.setCornerAnnotations =
|
|
308
|
-
let useTemplateString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
298
|
+
publicAPI.setCornerAnnotations = (annotations, useTemplateString = false) => {
|
|
309
299
|
if (useTemplateString) {
|
|
310
300
|
Object.keys(annotations).forEach(key => {
|
|
311
301
|
publicAPI.setCornerAnnotation(key, annotations[key]);
|
|
@@ -339,8 +329,7 @@ function vtkViewProxy(publicAPI, model) {
|
|
|
339
329
|
|
|
340
330
|
// --------------------------------------------------------------------------
|
|
341
331
|
|
|
342
|
-
publicAPI.setAnimation =
|
|
343
|
-
let requester = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : publicAPI;
|
|
332
|
+
publicAPI.setAnimation = (enable, requester = publicAPI) => {
|
|
344
333
|
if (model.disableAnimation && enable) {
|
|
345
334
|
return;
|
|
346
335
|
}
|
|
@@ -354,8 +343,7 @@ function vtkViewProxy(publicAPI, model) {
|
|
|
354
343
|
|
|
355
344
|
// --------------------------------------------------------------------------
|
|
356
345
|
|
|
357
|
-
publicAPI.updateOrientation =
|
|
358
|
-
let animateSteps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
346
|
+
publicAPI.updateOrientation = (axisIndex, orientation, viewUp, animateSteps = 0) => {
|
|
359
347
|
if (axisIndex === undefined) {
|
|
360
348
|
return Promise.resolve();
|
|
361
349
|
}
|
|
@@ -383,8 +371,7 @@ function vtkViewProxy(publicAPI, model) {
|
|
|
383
371
|
|
|
384
372
|
// --------------------------------------------------------------------------
|
|
385
373
|
|
|
386
|
-
publicAPI.moveCamera =
|
|
387
|
-
let animateSteps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
374
|
+
publicAPI.moveCamera = (focalPoint, position, viewUp, animateSteps = 0) => {
|
|
388
375
|
const originalFocalPoint = model.camera.getFocalPoint();
|
|
389
376
|
const originalPosition = model.camera.getPosition();
|
|
390
377
|
const originalViewUp = model.camera.getViewUp();
|
|
@@ -466,10 +453,7 @@ function vtkViewProxy(publicAPI, model) {
|
|
|
466
453
|
|
|
467
454
|
// --------------------------------------------------------------------------
|
|
468
455
|
|
|
469
|
-
publicAPI.resetOrientation =
|
|
470
|
-
let animateSteps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
471
|
-
return publicAPI.updateOrientation(model.axis, model.orientation, model.viewUp, animateSteps);
|
|
472
|
-
};
|
|
456
|
+
publicAPI.resetOrientation = (animateSteps = 0) => publicAPI.updateOrientation(model.axis, model.orientation, model.viewUp, animateSteps);
|
|
473
457
|
|
|
474
458
|
// --------------------------------------------------------------------------
|
|
475
459
|
|
|
@@ -536,8 +520,7 @@ const DEFAULT_VALUES = {
|
|
|
536
520
|
|
|
537
521
|
// ----------------------------------------------------------------------------
|
|
538
522
|
|
|
539
|
-
function extend(publicAPI, model) {
|
|
540
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
523
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
541
524
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
542
525
|
obj(publicAPI, model);
|
|
543
526
|
setGet(publicAPI, model, ['name', 'disableAnimation', 'resetCameraOnFirstRender']);
|
|
@@ -69,8 +69,7 @@ const DEFAULT_VALUES = {
|
|
|
69
69
|
|
|
70
70
|
// ----------------------------------------------------------------------------
|
|
71
71
|
|
|
72
|
-
function extend(publicAPI, model) {
|
|
73
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
72
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
74
73
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
75
74
|
|
|
76
75
|
// Object methods
|
|
@@ -107,8 +107,7 @@ const DEFAULT_VALUES = {};
|
|
|
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, DEFAULT_VALUES, initialValues);
|
|
113
112
|
|
|
114
113
|
// Object methods
|
|
@@ -51,8 +51,7 @@ const DEFAULT_VALUES = {};
|
|
|
51
51
|
|
|
52
52
|
// ----------------------------------------------------------------------------
|
|
53
53
|
|
|
54
|
-
function extend(publicAPI, model) {
|
|
55
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
54
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
56
55
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
57
56
|
|
|
58
57
|
// Object methods
|
|
@@ -17,10 +17,7 @@ function sum(a, b) {
|
|
|
17
17
|
|
|
18
18
|
// ----------------------------------------------------------------------------
|
|
19
19
|
|
|
20
|
-
function mean() {
|
|
21
|
-
for (var _len = arguments.length, array = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22
|
-
array[_key] = arguments[_key];
|
|
23
|
-
}
|
|
20
|
+
function mean(...array) {
|
|
24
21
|
return array.reduce(sum, 0) / array.length;
|
|
25
22
|
}
|
|
26
23
|
|
|
@@ -104,8 +101,7 @@ function vtkResliceRepresentationProxy(publicAPI, model) {
|
|
|
104
101
|
// API ----------------------------------------------------------------------
|
|
105
102
|
|
|
106
103
|
const parentSetColorBy = publicAPI.setColorBy;
|
|
107
|
-
publicAPI.setColorBy =
|
|
108
|
-
let componentIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
|
|
104
|
+
publicAPI.setColorBy = (arrayName, arrayLocation, componentIndex = -1) => {
|
|
109
105
|
if (arrayName === null) {
|
|
110
106
|
model.property.setRGBTransferFunction(null);
|
|
111
107
|
model.property.setPiecewiseFunction(null);
|
|
@@ -127,8 +123,7 @@ const DEFAULT_VALUES = {};
|
|
|
127
123
|
|
|
128
124
|
// ----------------------------------------------------------------------------
|
|
129
125
|
|
|
130
|
-
function extend(publicAPI, model) {
|
|
131
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
126
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
132
127
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
133
128
|
|
|
134
129
|
// Object methods
|