@kitware/vtk.js 34.16.3 → 34.16.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +8 -8
- package/Common/Core/CellArray.d.ts +5 -1
- package/Common/Core/CellArray.js +6 -10
- package/Common/Core/DataArray.js +9 -23
- package/Common/Core/ImageHelper.d.ts +2 -2
- package/Common/Core/ImageHelper.js +6 -8
- package/Common/Core/LookupTable.js +1 -3
- package/Common/Core/Math/index.js +19 -47
- package/Common/Core/MatrixBuilder.js +2 -5
- package/Common/Core/Points.js +3 -8
- package/Common/Core/PriorityQueue.js +4 -8
- package/Common/Core/ProgressHandler.js +4 -7
- package/Common/Core/ScalarsToColors.js +1 -2
- package/Common/Core/StringArray.js +4 -12
- package/Common/Core/URLExtract.js +1 -3
- package/Common/Core/VariantArray.js +4 -12
- package/Common/DataModel/AbstractPointLocator.js +1 -2
- package/Common/DataModel/BoundingBox.js +6 -16
- package/Common/DataModel/Box.js +7 -11
- package/Common/DataModel/CardinalSpline1D.js +2 -4
- package/Common/DataModel/Cell.js +2 -4
- package/Common/DataModel/CellLinks.js +2 -4
- package/Common/DataModel/CellTypes.js +2 -5
- package/Common/DataModel/Collection.js +1 -2
- package/Common/DataModel/Cone.js +1 -2
- package/Common/DataModel/Cylinder.js +1 -2
- package/Common/DataModel/DataSet/Constants.js +0 -1
- package/Common/DataModel/DataSet.js +2 -4
- package/Common/DataModel/DataSetAttributes/Constants.js +0 -4
- package/Common/DataModel/DataSetAttributes/FieldData.js +3 -11
- package/Common/DataModel/DataSetAttributes.js +1 -2
- package/Common/DataModel/EdgeLocator.js +2 -4
- package/Common/DataModel/ITKHelper.js +4 -8
- package/Common/DataModel/ImageData.js +17 -33
- package/Common/DataModel/ImplicitBoolean.js +1 -2
- package/Common/DataModel/ImplicitFunction.js +1 -2
- package/Common/DataModel/IncrementalOctreeNode.js +1 -2
- package/Common/DataModel/IncrementalOctreePointLocator.js +2 -3
- package/Common/DataModel/KochanekSpline1D.js +2 -4
- package/Common/DataModel/Line.js +2 -4
- package/Common/DataModel/Locator.js +1 -2
- package/Common/DataModel/MergePoints.js +1 -2
- package/Common/DataModel/Molecule.js +1 -2
- package/Common/DataModel/PiecewiseFunction.js +2 -4
- package/Common/DataModel/Plane.js +1 -2
- package/Common/DataModel/Planes.js +2 -4
- package/Common/DataModel/PointLocator.js +3 -7
- package/Common/DataModel/PointSet.js +2 -4
- package/Common/DataModel/PolyData.js +4 -8
- package/Common/DataModel/PolyLine.js +1 -2
- package/Common/DataModel/Polygon.js +2 -4
- package/Common/DataModel/Quad.js +1 -2
- package/Common/DataModel/SelectionNode.js +1 -2
- package/Common/DataModel/Sphere.js +1 -2
- package/Common/DataModel/Spline1D.js +2 -3
- package/Common/DataModel/Spline3D.js +1 -2
- package/Common/DataModel/Triangle.js +2 -6
- package/Common/DataModel/TriangleStrip.js +1 -2
- package/Common/Transform/LandmarkTransform.js +1 -2
- package/Common/Transform/Transform.js +4 -10
- package/Filters/Core/CleanPolyData.js +1 -2
- package/Filters/Core/Cutter.js +1 -3
- package/Filters/Core/PolyDataNormals.js +1 -3
- package/Filters/Core/ThresholdPoints.js +2 -4
- package/Filters/Cornerstone/ImageDataToCornerstoneImage.js +1 -2
- package/Filters/General/AppendPolyData.js +1 -2
- package/Filters/General/Calculator.js +40 -47
- package/Filters/General/ClipClosedSurface.js +1 -4
- package/Filters/General/ClosedPolyLineToSurfaceFilter.js +1 -2
- package/Filters/General/ContourLoopExtraction.js +1 -2
- package/Filters/General/ContourTriangulator/helper.js +1 -5
- package/Filters/General/ContourTriangulator.js +2 -4
- package/Filters/General/ImageCropFilter.js +1 -2
- package/Filters/General/ImageDataOutlineFilter.js +1 -2
- package/Filters/General/ImageMarchingCubes/caseTable.js +0 -1
- package/Filters/General/ImageMarchingCubes.js +1 -4
- package/Filters/General/ImageMarchingSquares/caseTable.js +0 -1
- package/Filters/General/ImageMarchingSquares.js +1 -4
- package/Filters/General/ImageOutlineFilter.js +1 -2
- package/Filters/General/ImageSliceFilter.js +1 -2
- package/Filters/General/ImageStreamline.js +1 -3
- package/Filters/General/LineFilter.js +1 -2
- package/Filters/General/MoleculeToRepresentation.js +2 -5
- package/Filters/General/OBBTree/OBBNode.js +1 -2
- package/Filters/General/OBBTree.js +2 -6
- package/Filters/General/OutlineFilter.js +1 -2
- package/Filters/General/PaintFilter/PaintFilter.worker.js +20 -25
- package/Filters/General/PaintFilter.js +1 -2
- package/Filters/General/ScalarToRGBA.js +1 -2
- package/Filters/General/ShrinkPolyData.js +2 -4
- package/Filters/General/TransformPolyDataFilter.js +1 -2
- package/Filters/General/TriangleFilter.js +1 -2
- package/Filters/General/TubeFilter.js +2 -6
- package/Filters/General/WarpScalar.js +1 -2
- package/Filters/General/WindowedSincPolyDataFilter.js +1 -2
- package/Filters/Sources/ArcSource.js +1 -2
- package/Filters/Sources/Arrow2DSource.js +1 -2
- package/Filters/Sources/ArrowSource.js +1 -2
- package/Filters/Sources/CircleSource.d.ts +2 -3
- package/Filters/Sources/CircleSource.js +1 -2
- package/Filters/Sources/ConcentricCylinderSource.js +2 -6
- package/Filters/Sources/ConeSource.js +1 -2
- package/Filters/Sources/CubeSource.js +6 -7
- package/Filters/Sources/Cursor3D.js +1 -2
- package/Filters/Sources/CylinderSource.js +1 -2
- package/Filters/Sources/DiskSource.js +1 -2
- package/Filters/Sources/EllipseArcSource.js +1 -2
- package/Filters/Sources/FrustumSource.js +1 -2
- package/Filters/Sources/ImageGridSource.js +1 -2
- package/Filters/Sources/LineSource.js +1 -2
- package/Filters/Sources/PlaneSource.js +21 -22
- package/Filters/Sources/PlatonicSolidSource.js +1 -2
- package/Filters/Sources/PointSource.js +1 -2
- package/Filters/Sources/RTAnalyticSource.js +1 -2
- package/Filters/Sources/SLICSource.js +1 -2
- package/Filters/Sources/SphereSource.js +1 -2
- package/Filters/Sources/TorusSource.js +1 -2
- package/Filters/Sources/ViewFinderSource.js +1 -2
- package/Filters/Texture/TextureMapToPlane.js +1 -2
- package/Filters/Texture/TextureMapToSphere.js +1 -2
- package/IO/Core/BinaryHelper.js +1 -2
- package/IO/Core/DataAccessHelper/HtmlDataAccessHelper.js +4 -5
- package/IO/Core/DataAccessHelper/HttpDataAccessHelper.js +7 -16
- package/IO/Core/DataAccessHelper/JSZipDataAccessHelper.js +5 -9
- package/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper.js +7 -16
- package/IO/Core/DataAccessHelper.js +1 -3
- package/IO/Core/HttpDataSetReader.js +10 -16
- package/IO/Core/HttpDataSetSeriesReader.js +4 -8
- package/IO/Core/HttpSceneLoader.js +3 -8
- package/IO/Core/ImageStream/DefaultProtocol.js +12 -42
- package/IO/Core/ImageStream/ViewStream.js +5 -8
- package/IO/Core/ImageStream.js +4 -9
- package/IO/Core/Serializer/ArraySerializer.js +1 -2
- package/IO/Core/WSLinkClient.js +14 -25
- package/IO/Core/ZipMultiDataSetReader.js +5 -12
- package/IO/Core/ZipMultiDataSetWriter.js +1 -2
- package/IO/Geometry/DracoReader.js +6 -10
- package/IO/Geometry/GLTFImporter/Animations.js +9 -14
- package/IO/Geometry/GLTFImporter/Constants.js +0 -1
- package/IO/Geometry/GLTFImporter/Parser.js +1 -3
- package/IO/Geometry/GLTFImporter/Reader.js +2 -5
- package/IO/Geometry/GLTFImporter.js +7 -12
- package/IO/Geometry/IFCImporter.d.ts +1 -1
- package/IO/Geometry/IFCImporter.js +6 -10
- package/IO/Geometry/PLYReader.js +6 -11
- package/IO/Geometry/PLYWriter.js +1 -2
- package/IO/Geometry/STLReader.js +6 -11
- package/IO/Geometry/STLWriter.js +2 -6
- package/IO/Image/HDRReader/Utils.js +1 -2
- package/IO/Image/HDRReader.js +7 -10
- package/IO/Image/TGAReader.js +7 -9
- package/IO/Image/TIFFReader.js +7 -10
- package/IO/Legacy/LegacyAsciiParser.js +1 -2
- package/IO/Legacy/PolyDataReader.js +5 -7
- package/IO/Misc/ElevationReader.js +1 -2
- package/IO/Misc/GCodeReader.js +6 -11
- package/IO/Misc/HttpDataSetLODsLoader.js +1 -2
- package/IO/Misc/ITKImageReader.js +6 -13
- package/IO/Misc/ITKPolyDataReader.js +6 -13
- package/IO/Misc/JSONNucleoReader.js +1 -2
- package/IO/Misc/JSONReader.js +4 -10
- package/IO/Misc/MTLReader.js +2 -4
- package/IO/Misc/OBJReader.js +4 -10
- package/IO/Misc/OBJWriter.js +1 -2
- package/IO/Misc/PDBReader.js +1 -2
- package/IO/Misc/SkyboxReader.js +5 -10
- package/IO/XML/XMLImageDataReader.js +1 -2
- package/IO/XML/XMLImageDataWriter.js +1 -2
- package/IO/XML/XMLPolyDataReader.js +1 -2
- package/IO/XML/XMLPolyDataWriter.js +1 -2
- package/IO/XML/XMLReader.js +4 -10
- package/IO/XML/XMLWriter.js +2 -4
- package/Imaging/Core/AbstractImageInterpolator.js +1 -3
- package/Imaging/Core/ImageInterpolator.js +1 -3
- package/Imaging/Core/ImagePointDataIterator.js +2 -6
- package/Imaging/Core/ImageReslice.js +1 -3
- package/Imaging/Hybrid/SampleFunction.js +1 -2
- package/Interaction/Animations/TimeStepBasedAnimationHandler.js +1 -2
- package/Interaction/Manipulators/3DControllerModelSelectorManipulator/index.js +1 -2
- package/Interaction/Manipulators/CompositeCameraManipulator.js +1 -2
- package/Interaction/Manipulators/CompositeGestureManipulator.js +1 -2
- package/Interaction/Manipulators/CompositeKeyboardManipulator.js +1 -2
- package/Interaction/Manipulators/CompositeMouseManipulator.js +1 -2
- package/Interaction/Manipulators/CompositeVRManipulator.js +1 -2
- package/Interaction/Manipulators/GestureCameraManipulator.js +1 -2
- package/Interaction/Manipulators/KeyboardCameraManipulator.js +1 -2
- package/Interaction/Manipulators/MouseBoxSelectorManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraAxisRotateManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraSliceManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraTrackballFirstPersonManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraTrackballMultiRotateManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraTrackballPanManipulatorAutoCenter.js +1 -2
- package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraTrackballZoomManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraTrackballZoomToMouseManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -2
- package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -2
- package/Interaction/Manipulators/MouseRangeManipulator.js +4 -11
- package/Interaction/Manipulators/VRButtonPanManipulator.js +1 -2
- package/Interaction/Misc/DeviceOrientationToCamera.js +1 -2
- package/Interaction/Style/InteractorStyleHMDXR.js +1 -2
- package/Interaction/Style/InteractorStyleImage.js +1 -2
- package/Interaction/Style/InteractorStyleMPRSlice.js +2 -6
- package/Interaction/Style/InteractorStyleManipulator.js +1 -2
- package/Interaction/Style/InteractorStyleRemoteMouse.js +1 -2
- package/Interaction/Style/InteractorStyleTrackballCamera.js +1 -3
- package/Interaction/Style/InteractorStyleUnicam.js +1 -2
- package/Interaction/UI/CornerAnnotation.js +2 -4
- package/Interaction/UI/FPSMonitor.js +3 -9
- package/Interaction/UI/Slider.js +1 -3
- package/Interaction/UI/VolumeController.js +2 -5
- package/Interaction/Widgets/OrientationMarkerWidget.js +1 -2
- package/Interaction/Widgets/PiecewiseGaussianWidget.js +42 -59
- package/Proxy/Animation/AbstractAnimationProxy.js +1 -2
- package/Proxy/Animation/AnimationProxyManager.js +1 -2
- package/Proxy/Animation/TimeStepBasedAnimationHandlerProxy.js +1 -2
- package/Proxy/Core/AbstractRepresentationProxy.js +3 -6
- package/Proxy/Core/LookupTableProxy.js +1 -3
- package/Proxy/Core/PiecewiseFunctionProxy.js +3 -11
- package/Proxy/Core/ProxyManager/state.js +171 -182
- package/Proxy/Core/ProxyManager/view.js +3 -6
- package/Proxy/Core/ProxyManager.js +1 -2
- package/Proxy/Core/SourceProxy.js +2 -6
- package/Proxy/Core/View2DProxy.js +2 -4
- package/Proxy/Core/ViewProxy.js +20 -37
- package/Proxy/Representations/GeometryRepresentationProxy.js +1 -2
- package/Proxy/Representations/GlyphRepresentationProxy.js +1 -2
- package/Proxy/Representations/MoleculeRepresentationProxy.js +1 -2
- package/Proxy/Representations/ResliceRepresentationProxy.js +3 -8
- package/Proxy/Representations/SkyboxRepresentationProxy.js +1 -2
- package/Proxy/Representations/SliceRepresentationProxy.js +3 -8
- package/Proxy/Representations/SlicedGeometryRepresentationProxy.js +3 -6
- package/Proxy/Representations/VolumeRepresentationProxy.js +9 -17
- package/Rendering/Core/AbstractImageMapper.js +1 -2
- package/Rendering/Core/AbstractMapper.js +1 -2
- package/Rendering/Core/AbstractMapper3D.js +1 -2
- package/Rendering/Core/AbstractPicker.js +1 -2
- package/Rendering/Core/Actor.js +1 -2
- package/Rendering/Core/Actor2D.js +1 -2
- package/Rendering/Core/AnnotatedCubeActor.js +2 -4
- package/Rendering/Core/AxesActor.js +2 -4
- package/Rendering/Core/Camera.js +2 -6
- package/Rendering/Core/CellPicker.js +1 -3
- package/Rendering/Core/ColorTransferFunction/CssFilters.js +8 -16
- package/Rendering/Core/ColorTransferFunction.js +4 -10
- package/Rendering/Core/Coordinate.js +2 -6
- package/Rendering/Core/CubeAxesActor.js +4 -6
- package/Rendering/Core/Follower.js +1 -2
- package/Rendering/Core/Glyph3DMapper.js +1 -2
- package/Rendering/Core/HardwareSelector.js +1 -2
- package/Rendering/Core/ImageArrayMapper.js +6 -13
- package/Rendering/Core/ImageCPRMapper.js +1 -2
- package/Rendering/Core/ImageMapper.js +2 -5
- package/Rendering/Core/ImageProperty.js +9 -28
- package/Rendering/Core/ImageResliceMapper.js +1 -2
- package/Rendering/Core/ImageSlice.js +1 -2
- package/Rendering/Core/InteractorObserver.js +1 -2
- package/Rendering/Core/InteractorStyle.js +1 -2
- package/Rendering/Core/Light.js +1 -2
- package/Rendering/Core/Mapper/Static.js +1 -2
- package/Rendering/Core/Mapper.js +1 -6
- package/Rendering/Core/Mapper2D.js +1 -3
- package/Rendering/Core/Picker.js +1 -2
- package/Rendering/Core/PixelSpaceCallbackMapper.js +1 -2
- package/Rendering/Core/PointPicker.js +1 -2
- package/Rendering/Core/Prop.js +1 -2
- package/Rendering/Core/Prop3D.js +3 -8
- package/Rendering/Core/Property.js +1 -2
- package/Rendering/Core/Property2D.js +1 -2
- package/Rendering/Core/RenderWindow.js +4 -11
- package/Rendering/Core/RenderWindowInteractor/Constants.js +0 -1
- package/Rendering/Core/RenderWindowInteractor.js +7 -12
- package/Rendering/Core/Renderer.js +3 -6
- package/Rendering/Core/ScalarBarActor.js +4 -6
- package/Rendering/Core/Skybox.js +1 -2
- package/Rendering/Core/SphereMapper.js +1 -2
- package/Rendering/Core/StickMapper.js +1 -2
- package/Rendering/Core/SurfaceLICInterface.js +1 -2
- package/Rendering/Core/SurfaceLICMapper.js +1 -2
- package/Rendering/Core/TextActor.js +1 -2
- package/Rendering/Core/TextProperty.js +1 -2
- package/Rendering/Core/Texture.js +1 -2
- package/Rendering/Core/VectorText/Utils.js +4 -8
- package/Rendering/Core/VectorText.js +1 -3
- package/Rendering/Core/Viewport.js +2 -4
- package/Rendering/Core/Volume.js +1 -2
- package/Rendering/Core/VolumeMapper.js +1 -2
- package/Rendering/Core/VolumeProperty.js +9 -22
- package/Rendering/Misc/CanvasView.js +1 -2
- package/Rendering/Misc/FullScreenRenderWindow.js +1 -2
- package/Rendering/Misc/GenericRenderWindow.js +1 -2
- package/Rendering/Misc/RemoteView.js +1 -2
- package/Rendering/Misc/RenderWindowWithControlBar.js +1 -2
- package/Rendering/Misc/SynchronizableRenderWindow/BehaviorManager/CameraSynchronizer.js +1 -3
- package/Rendering/Misc/SynchronizableRenderWindow/BehaviorManager.js +5 -6
- package/Rendering/Misc/SynchronizableRenderWindow/ObjectManager.js +24 -43
- package/Rendering/Misc/SynchronizableRenderWindow.js +3 -6
- package/Rendering/Misc/TextureLODsDownloader.js +1 -2
- package/Rendering/OpenGL/Actor.js +1 -2
- package/Rendering/OpenGL/Actor2D.js +1 -2
- package/Rendering/OpenGL/BufferObject.js +1 -3
- package/Rendering/OpenGL/Camera.js +1 -2
- package/Rendering/OpenGL/CellArrayBufferObject.js +2 -4
- package/Rendering/OpenGL/Convolution2DPass.js +2 -3
- package/Rendering/OpenGL/CubeAxesActor.js +1 -2
- package/Rendering/OpenGL/ForwardPass.js +2 -4
- package/Rendering/OpenGL/Framebuffer.js +4 -8
- package/Rendering/OpenGL/Glyph3DMapper.js +1 -2
- package/Rendering/OpenGL/HardwareSelector.js +21 -27
- package/Rendering/OpenGL/Helper.js +1 -2
- package/Rendering/OpenGL/ImageCPRMapper.js +1 -2
- package/Rendering/OpenGL/ImageMapper.js +1 -2
- package/Rendering/OpenGL/ImageResliceMapper.js +10 -16
- package/Rendering/OpenGL/ImageSlice.js +1 -2
- package/Rendering/OpenGL/OrderIndependentTranslucentPass.js +1 -2
- package/Rendering/OpenGL/PixelSpaceCallbackMapper.js +1 -2
- package/Rendering/OpenGL/PolyDataMapper.js +1 -2
- package/Rendering/OpenGL/PolyDataMapper2D.js +1 -2
- package/Rendering/OpenGL/RadialDistortionPass.js +2 -3
- package/Rendering/OpenGL/RenderWindow.js +33 -53
- package/Rendering/OpenGL/Renderer.js +1 -3
- package/Rendering/OpenGL/ReplacementShaderMapper.js +2 -2
- package/Rendering/OpenGL/ScalarBarActor.js +1 -2
- package/Rendering/OpenGL/Shader.js +1 -2
- package/Rendering/OpenGL/ShaderCache.js +1 -2
- package/Rendering/OpenGL/ShaderProgram.js +4 -14
- package/Rendering/OpenGL/Skybox.js +1 -2
- package/Rendering/OpenGL/SphereMapper.js +1 -2
- package/Rendering/OpenGL/StickMapper.js +1 -2
- package/Rendering/OpenGL/SurfaceLIC/LineIntegralConvolution2D/pingpong.js +6 -12
- package/Rendering/OpenGL/SurfaceLIC/LineIntegralConvolution2D.js +4 -12
- package/Rendering/OpenGL/SurfaceLIC/SurfaceLICInterface.js +2 -4
- package/Rendering/OpenGL/SurfaceLIC/SurfaceLICMapper.js +1 -2
- package/Rendering/OpenGL/Texture.js +91 -113
- package/Rendering/OpenGL/TextureUnitManager.js +1 -2
- package/Rendering/OpenGL/VertexArrayObject.js +1 -2
- package/Rendering/OpenGL/ViewNodeFactory.js +1 -2
- package/Rendering/OpenGL/Volume.js +1 -2
- package/Rendering/OpenGL/VolumeMapper.js +11 -17
- package/Rendering/SceneGraph/RenderPass.js +2 -4
- package/Rendering/SceneGraph/RenderWindowViewNode.js +1 -2
- package/Rendering/SceneGraph/ViewNode.js +3 -6
- package/Rendering/SceneGraph/ViewNodeFactory.js +1 -2
- package/Rendering/WebGPU/Actor.js +1 -2
- package/Rendering/WebGPU/Actor2D.js +1 -2
- package/Rendering/WebGPU/BindGroup.js +1 -2
- package/Rendering/WebGPU/Buffer.js +2 -5
- package/Rendering/WebGPU/BufferManager.js +1 -2
- package/Rendering/WebGPU/Camera.js +1 -2
- package/Rendering/WebGPU/CellArrayMapper.js +3 -6
- package/Rendering/WebGPU/CubeAxesActor.js +1 -2
- package/Rendering/WebGPU/Device.js +2 -6
- package/Rendering/WebGPU/ForwardPass.js +2 -4
- package/Rendering/WebGPU/FullScreenQuad.js +1 -2
- package/Rendering/WebGPU/Glyph3DMapper.js +2 -4
- package/Rendering/WebGPU/HardwareSelectionPass.js +1 -2
- package/Rendering/WebGPU/HardwareSelector.js +1 -2
- package/Rendering/WebGPU/ImageMapper.js +1 -2
- package/Rendering/WebGPU/ImageSlice.js +1 -2
- package/Rendering/WebGPU/IndexBuffer.js +1 -2
- package/Rendering/WebGPU/OpaquePass.js +1 -2
- package/Rendering/WebGPU/OrderIndependentTranslucentPass.js +1 -2
- package/Rendering/WebGPU/Pipeline.js +1 -2
- package/Rendering/WebGPU/PixelSpaceCallbackMapper.js +1 -2
- package/Rendering/WebGPU/PolyDataMapper.js +1 -2
- package/Rendering/WebGPU/PolyDataMapper2D.js +1 -2
- package/Rendering/WebGPU/RenderEncoder.js +2 -5
- package/Rendering/WebGPU/RenderWindow.js +15 -25
- package/Rendering/WebGPU/Renderer.js +1 -2
- package/Rendering/WebGPU/Sampler.js +2 -4
- package/Rendering/WebGPU/ScalarBarActor.js +1 -2
- package/Rendering/WebGPU/ShaderCache.js +2 -4
- package/Rendering/WebGPU/ShaderDescription.js +2 -4
- package/Rendering/WebGPU/ShaderModule.js +1 -2
- package/Rendering/WebGPU/SimpleMapper.js +1 -3
- package/Rendering/WebGPU/SphereMapper.js +1 -2
- package/Rendering/WebGPU/StickMapper.js +1 -2
- package/Rendering/WebGPU/StorageBuffer.js +1 -2
- package/Rendering/WebGPU/Texture.js +3 -7
- package/Rendering/WebGPU/TextureManager.js +2 -6
- package/Rendering/WebGPU/TextureView.js +1 -3
- package/Rendering/WebGPU/UniformBuffer.js +1 -2
- package/Rendering/WebGPU/VertexInput.js +2 -4
- package/Rendering/WebGPU/ViewNodeFactory.js +1 -2
- package/Rendering/WebGPU/Volume.js +1 -2
- package/Rendering/WebGPU/VolumePass.js +1 -2
- package/Rendering/WebGPU/VolumePassFSQ.js +1 -2
- package/Rendering/WebXR/RenderWindowHelper.js +2 -6
- package/Widgets/Core/AbstractWidget.js +6 -10
- package/Widgets/Core/AbstractWidgetFactory.js +17 -22
- package/Widgets/Core/StateBuilder/boundsMixin.js +1 -2
- package/Widgets/Core/StateBuilder/color3Mixin.js +1 -2
- package/Widgets/Core/StateBuilder/colorMixin.js +1 -2
- package/Widgets/Core/StateBuilder/cornerMixin.js +1 -2
- package/Widgets/Core/StateBuilder/directionMixin.js +1 -2
- package/Widgets/Core/StateBuilder/manipulatorMixin.js +1 -2
- package/Widgets/Core/StateBuilder/nameMixin.js +1 -2
- package/Widgets/Core/StateBuilder/orientationMixin.js +1 -2
- package/Widgets/Core/StateBuilder/originMixin.js +1 -2
- package/Widgets/Core/StateBuilder/scale1Mixin.js +1 -2
- package/Widgets/Core/StateBuilder/scale3Mixin.js +1 -2
- package/Widgets/Core/StateBuilder/shapeMixin.js +1 -2
- package/Widgets/Core/StateBuilder/textMixin.js +1 -2
- package/Widgets/Core/StateBuilder/visibleMixin.js +1 -2
- package/Widgets/Core/StateBuilder.js +23 -33
- package/Widgets/Core/WidgetManager/Constants.js +0 -1
- package/Widgets/Core/WidgetManager.js +25 -30
- package/Widgets/Core/WidgetState.js +2 -4
- package/Widgets/Manipulators/AbstractManipulator.js +1 -2
- package/Widgets/Manipulators/CPRManipulator.js +1 -2
- package/Widgets/Manipulators/LineManipulator.js +1 -2
- package/Widgets/Manipulators/PickerManipulator.js +1 -2
- package/Widgets/Manipulators/PlaneManipulator.js +1 -2
- package/Widgets/Manipulators/TrackballManipulator.js +1 -2
- package/Widgets/Representations/ArrowHandleRepresentation.js +2 -6
- package/Widgets/Representations/CircleContextRepresentation.js +1 -2
- package/Widgets/Representations/ContextRepresentation.js +1 -2
- package/Widgets/Representations/ConvexFaceContextRepresentation.js +2 -6
- package/Widgets/Representations/CroppingOutlineRepresentation.js +1 -2
- package/Widgets/Representations/CubeHandleRepresentation.js +1 -2
- package/Widgets/Representations/GlyphRepresentation.js +3 -11
- package/Widgets/Representations/HandleRepresentation.js +1 -2
- package/Widgets/Representations/ImplicitPlaneRepresentation.js +1 -2
- package/Widgets/Representations/LineHandleRepresentation.js +1 -2
- package/Widgets/Representations/OutlineContextRepresentation.js +1 -2
- package/Widgets/Representations/PolyLineRepresentation.js +2 -4
- package/Widgets/Representations/RectangleContextRepresentation.js +1 -2
- package/Widgets/Representations/RotateTransformHandleRepresentation.js +1 -2
- package/Widgets/Representations/ScaleTransformHandleRepresentation.js +1 -2
- package/Widgets/Representations/SphereContextRepresentation.js +1 -2
- package/Widgets/Representations/SphereHandleRepresentation.js +1 -2
- package/Widgets/Representations/SplineContextRepresentation.js +2 -6
- package/Widgets/Representations/TranslateTransformHandleRepresentation/TransformHandleSource.js +1 -2
- package/Widgets/Representations/TranslateTransformHandleRepresentation.js +1 -2
- package/Widgets/Representations/WidgetRepresentation.js +6 -20
- package/Widgets/Widgets3D/AngleWidget.js +1 -2
- package/Widgets/Widgets3D/EllipseWidget.js +1 -2
- package/Widgets/Widgets3D/ImageCroppingWidget.js +1 -2
- package/Widgets/Widgets3D/ImplicitPlaneWidget.js +1 -3
- package/Widgets/Widgets3D/InteractiveOrientationWidget/helpers.js +6 -7
- package/Widgets/Widgets3D/InteractiveOrientationWidget/state.js +0 -1
- package/Widgets/Widgets3D/InteractiveOrientationWidget.js +1 -2
- package/Widgets/Widgets3D/LabelWidget.js +1 -2
- package/Widgets/Widgets3D/LineWidget/behavior.js +1 -2
- package/Widgets/Widgets3D/LineWidget/helpers.js +1 -2
- package/Widgets/Widgets3D/LineWidget.js +1 -2
- package/Widgets/Widgets3D/PaintWidget.js +1 -2
- package/Widgets/Widgets3D/PolyLineWidget/behavior.js +3 -4
- package/Widgets/Widgets3D/PolyLineWidget.js +1 -2
- package/Widgets/Widgets3D/RectangleWidget.js +1 -2
- package/Widgets/Widgets3D/ResliceCursorWidget/Constants.js +0 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +0 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +2 -3
- package/Widgets/Widgets3D/ResliceCursorWidget/state.js +1 -3
- package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -3
- package/Widgets/Widgets3D/SeedWidget.js +1 -2
- package/Widgets/Widgets3D/ShapeWidget/behavior.js +7 -10
- package/Widgets/Widgets3D/ShapeWidget.js +1 -2
- package/Widgets/Widgets3D/SphereWidget.js +1 -2
- package/Widgets/Widgets3D/SplineWidget/behavior.js +13 -13
- package/Widgets/Widgets3D/SplineWidget.js +1 -2
- package/Widgets/Widgets3D/TransformControlsWidget.js +1 -2
- package/_virtual/rollup-plugin-worker-loader__module_Sources/Filters/General/PaintFilter/PaintFilter.worker.js +20 -25
- package/macros2.js +46 -114
- package/package.json +26 -19
|
@@ -16,7 +16,8 @@ const {
|
|
|
16
16
|
FieldAssociations
|
|
17
17
|
} = vtkDataSet;
|
|
18
18
|
const {
|
|
19
|
-
vtkErrorMacro
|
|
19
|
+
vtkErrorMacro,
|
|
20
|
+
vtkDebugMacro
|
|
20
21
|
} = macro;
|
|
21
22
|
const idOffset = 1;
|
|
22
23
|
function getInfoHash(info) {
|
|
@@ -29,7 +30,7 @@ function getAlpha(xx, yy, pb, area) {
|
|
|
29
30
|
const offset = (yy * (area[2] - area[0] + 1) + xx) * 4;
|
|
30
31
|
return pb[offset + 3];
|
|
31
32
|
}
|
|
32
|
-
function convert(xx, yy, pb, area) {
|
|
33
|
+
function convert(xx, yy, pb, area, caller = null) {
|
|
33
34
|
if (!pb) {
|
|
34
35
|
return 0;
|
|
35
36
|
}
|
|
@@ -51,7 +52,6 @@ function getID(low24, high8) {
|
|
|
51
52
|
return val;
|
|
52
53
|
/* eslint-enable no-bitwise */
|
|
53
54
|
}
|
|
54
|
-
|
|
55
55
|
function getPixelInformationWithData(buffdata, inDisplayPosition, maxDistance, outSelectedPosition) {
|
|
56
56
|
// Base case
|
|
57
57
|
const maxDist = maxDistance < 0 ? 0 : maxDistance;
|
|
@@ -64,7 +64,7 @@ function getPixelInformationWithData(buffdata, inDisplayPosition, maxDistance, o
|
|
|
64
64
|
|
|
65
65
|
// offset inDisplayPosition based on the lower-left-corner of the Area.
|
|
66
66
|
const displayPosition = [inDisplayPosition[0] - buffdata.area[0], inDisplayPosition[1] - buffdata.area[1]];
|
|
67
|
-
const actorid = convert(displayPosition[0], displayPosition[1], buffdata.pixBuffer[PassTypes.ACTOR_PASS], buffdata.area);
|
|
67
|
+
const actorid = convert(displayPosition[0], displayPosition[1], buffdata.pixBuffer[PassTypes.ACTOR_PASS], buffdata.area, 'getPixelInformationWithData1');
|
|
68
68
|
if (actorid <= 0 || actorid - idOffset >= buffdata.props.length) {
|
|
69
69
|
// the pixel did not hit any actor.
|
|
70
70
|
return null;
|
|
@@ -73,7 +73,7 @@ function getPixelInformationWithData(buffdata, inDisplayPosition, maxDistance, o
|
|
|
73
73
|
info.valid = true;
|
|
74
74
|
info.propID = actorid - idOffset;
|
|
75
75
|
info.prop = buffdata.props[info.propID];
|
|
76
|
-
let compositeID = convert(displayPosition[0], displayPosition[1], buffdata.pixBuffer[PassTypes.COMPOSITE_INDEX_PASS], buffdata.area);
|
|
76
|
+
let compositeID = convert(displayPosition[0], displayPosition[1], buffdata.pixBuffer[PassTypes.COMPOSITE_INDEX_PASS], buffdata.area, 'getPixelInformationWithData2');
|
|
77
77
|
if (compositeID < 0 || compositeID > 0xffffff) {
|
|
78
78
|
compositeID = 0;
|
|
79
79
|
}
|
|
@@ -88,8 +88,8 @@ function getPixelInformationWithData(buffdata, inDisplayPosition, maxDistance, o
|
|
|
88
88
|
return info;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
const low24 = convert(displayPosition[0], displayPosition[1], buffdata.pixBuffer[PassTypes.ID_LOW24], buffdata.area);
|
|
92
|
-
const high24 = convert(displayPosition[0], displayPosition[1], buffdata.pixBuffer[PassTypes.ID_HIGH24], buffdata.area);
|
|
91
|
+
const low24 = convert(displayPosition[0], displayPosition[1], buffdata.pixBuffer[PassTypes.ID_LOW24], buffdata.area, 'getPixelInformationWithData3');
|
|
92
|
+
const high24 = convert(displayPosition[0], displayPosition[1], buffdata.pixBuffer[PassTypes.ID_HIGH24], buffdata.area, 'getPixelInformationWithData4');
|
|
93
93
|
info.attributeID = getID(low24, high24);
|
|
94
94
|
return info;
|
|
95
95
|
}
|
|
@@ -324,12 +324,7 @@ function vtkOpenGLHardwareSelector(publicAPI, model) {
|
|
|
324
324
|
renderer,
|
|
325
325
|
openGLRenderWindow: model._openGLRenderWindow
|
|
326
326
|
};
|
|
327
|
-
result.generateSelection =
|
|
328
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
329
|
-
args[_key] = arguments[_key];
|
|
330
|
-
}
|
|
331
|
-
return generateSelectionWithData(result, ...args);
|
|
332
|
-
};
|
|
327
|
+
result.generateSelection = (...args) => generateSelectionWithData(result, ...args);
|
|
333
328
|
return result;
|
|
334
329
|
};
|
|
335
330
|
|
|
@@ -445,7 +440,7 @@ function vtkOpenGLHardwareSelector(publicAPI, model) {
|
|
|
445
440
|
let offset = 0;
|
|
446
441
|
for (let yy = 0; yy <= model.area[3] - model.area[1]; yy++) {
|
|
447
442
|
for (let xx = 0; xx <= model.area[2] - model.area[0]; xx++) {
|
|
448
|
-
let val = convert(xx, yy, pixelbuffer, model.area);
|
|
443
|
+
let val = convert(xx, yy, pixelbuffer, model.area, 'buildPropHitList');
|
|
449
444
|
if (val > 0) {
|
|
450
445
|
val--;
|
|
451
446
|
if (!(val in model.hitProps)) {
|
|
@@ -511,20 +506,20 @@ function vtkOpenGLHardwareSelector(publicAPI, model) {
|
|
|
511
506
|
publicAPI.getPixelInformation = (inDisplayPosition, maxDistance, outSelectedPosition) => {
|
|
512
507
|
// Base case
|
|
513
508
|
const maxDist = maxDistance < 0 ? 0 : maxDistance;
|
|
514
|
-
|
|
509
|
+
vtkDebugMacro('getPixelInformation called', maxDist);
|
|
515
510
|
if (maxDist === 0) {
|
|
516
511
|
outSelectedPosition[0] = inDisplayPosition[0];
|
|
517
512
|
outSelectedPosition[1] = inDisplayPosition[1];
|
|
518
513
|
if (inDisplayPosition[0] < model.area[0] || inDisplayPosition[0] > model.area[2] || inDisplayPosition[1] < model.area[1] || inDisplayPosition[1] > model.area[3]) {
|
|
519
514
|
return null;
|
|
520
515
|
}
|
|
521
|
-
|
|
522
|
-
|
|
516
|
+
vtkDebugMacro(inDisplayPosition);
|
|
517
|
+
vtkDebugMacro(model.area);
|
|
523
518
|
// offset inDisplayPosition based on the lower-left-corner of the Area.
|
|
524
519
|
const displayPosition = [inDisplayPosition[0] - model.area[0], inDisplayPosition[1] - model.area[1]];
|
|
525
|
-
|
|
526
|
-
const actorid = convert(displayPosition[0], displayPosition[1], model.pixBuffer[PassTypes.ACTOR_PASS], model.area);
|
|
527
|
-
|
|
520
|
+
vtkDebugMacro('adjusted displayPosition', displayPosition);
|
|
521
|
+
const actorid = convert(displayPosition[0], displayPosition[1], model.pixBuffer[PassTypes.ACTOR_PASS], model.area, 'getPixelInformation');
|
|
522
|
+
vtkDebugMacro('actorid', actorid);
|
|
528
523
|
if (actorid <= 0 || actorid - idOffset >= model.props.length) {
|
|
529
524
|
// the pixel did not hit any actor.
|
|
530
525
|
return null;
|
|
@@ -533,7 +528,7 @@ function vtkOpenGLHardwareSelector(publicAPI, model) {
|
|
|
533
528
|
info.valid = true;
|
|
534
529
|
info.propID = actorid - idOffset;
|
|
535
530
|
info.prop = model.props[info.propID];
|
|
536
|
-
let compositeID = convert(displayPosition[0], displayPosition[1], model.pixBuffer[PassTypes.COMPOSITE_INDEX_PASS], model.area);
|
|
531
|
+
let compositeID = convert(displayPosition[0], displayPosition[1], model.pixBuffer[PassTypes.COMPOSITE_INDEX_PASS], model.area, 'getPixelInformation2');
|
|
537
532
|
if (compositeID < 0 || compositeID > 0xffffff) {
|
|
538
533
|
compositeID = 0;
|
|
539
534
|
}
|
|
@@ -550,8 +545,8 @@ function vtkOpenGLHardwareSelector(publicAPI, model) {
|
|
|
550
545
|
return info;
|
|
551
546
|
}
|
|
552
547
|
}
|
|
553
|
-
const low24 = convert(displayPosition[0], displayPosition[1], model.pixBuffer[PassTypes.ID_LOW24], model.area);
|
|
554
|
-
const high24 = convert(displayPosition[0], displayPosition[1], model.pixBuffer[PassTypes.ID_HIGH24], model.area);
|
|
548
|
+
const low24 = convert(displayPosition[0], displayPosition[1], model.pixBuffer[PassTypes.ID_LOW24], model.area, 'getPixelInformation3');
|
|
549
|
+
const high24 = convert(displayPosition[0], displayPosition[1], model.pixBuffer[PassTypes.ID_HIGH24], model.area, 'getPixelInformation4');
|
|
555
550
|
info.attributeID = getID(low24, high24);
|
|
556
551
|
return info;
|
|
557
552
|
}
|
|
@@ -654,8 +649,8 @@ function vtkOpenGLHardwareSelector(publicAPI, model) {
|
|
|
654
649
|
|
|
655
650
|
// override
|
|
656
651
|
const superSetArea = publicAPI.setArea;
|
|
657
|
-
publicAPI.setArea =
|
|
658
|
-
if (superSetArea(...
|
|
652
|
+
publicAPI.setArea = (...args) => {
|
|
653
|
+
if (superSetArea(...args)) {
|
|
659
654
|
model.area[0] = Math.floor(model.area[0]);
|
|
660
655
|
model.area[1] = Math.floor(model.area[1]);
|
|
661
656
|
model.area[2] = Math.floor(model.area[2]);
|
|
@@ -685,8 +680,7 @@ const DEFAULT_VALUES = {
|
|
|
685
680
|
|
|
686
681
|
// ----------------------------------------------------------------------------
|
|
687
682
|
|
|
688
|
-
function extend(publicAPI, model) {
|
|
689
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
683
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
690
684
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
691
685
|
|
|
692
686
|
// Build VTK API
|
|
@@ -188,8 +188,7 @@ const DEFAULT_VALUES = {
|
|
|
188
188
|
|
|
189
189
|
// ----------------------------------------------------------------------------
|
|
190
190
|
|
|
191
|
-
function extend(publicAPI, model) {
|
|
192
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
191
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
193
192
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
194
193
|
|
|
195
194
|
// Build VTK API
|
|
@@ -982,8 +982,7 @@ const DEFAULT_VALUES = {
|
|
|
982
982
|
|
|
983
983
|
// ----------------------------------------------------------------------------
|
|
984
984
|
|
|
985
|
-
function extend(publicAPI, model) {
|
|
986
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
985
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
987
986
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
988
987
|
|
|
989
988
|
// Inheritance
|
|
@@ -1128,8 +1128,7 @@ const DEFAULT_VALUES = {
|
|
|
1128
1128
|
|
|
1129
1129
|
// ----------------------------------------------------------------------------
|
|
1130
1130
|
|
|
1131
|
-
function extend(publicAPI, model) {
|
|
1132
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1131
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
1133
1132
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
1134
1133
|
|
|
1135
1134
|
// Inheritance
|
|
@@ -181,10 +181,9 @@ function vtkOpenGLImageResliceMapper(publicAPI, model) {
|
|
|
181
181
|
|
|
182
182
|
// Update filters for scalar textures
|
|
183
183
|
const actorProperties = actor.getProperties();
|
|
184
|
-
model.currentValidInputs.forEach(
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
} = _ref;
|
|
184
|
+
model.currentValidInputs.forEach(({
|
|
185
|
+
inputIndex
|
|
186
|
+
}) => {
|
|
188
187
|
const actorProperty = actorProperties[inputIndex];
|
|
189
188
|
const interpolationType = actorProperty.getInterpolationType();
|
|
190
189
|
const scalarTexture = model.scalarTextures[inputIndex];
|
|
@@ -238,18 +237,14 @@ function vtkOpenGLImageResliceMapper(publicAPI, model) {
|
|
|
238
237
|
publicAPI.buildBufferObjects(ren, actor);
|
|
239
238
|
}
|
|
240
239
|
};
|
|
241
|
-
publicAPI.getNeedToRebuildBufferObjects = (ren, actor) => model.VBOBuildTime.getMTime() < publicAPI.getMTime() || model.VBOBuildTime.getMTime() < actor.getMTime() || model.VBOBuildTime.getMTime() < model.renderable.getMTime() || model.VBOBuildTime.getMTime() < actor.getProperty(model.currentValidInputs[0].inputIndex)?.getMTime() || model.currentValidInputs.some(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
} = _ref2;
|
|
245
|
-
return model.VBOBuildTime.getMTime() < imageData.getMTime();
|
|
246
|
-
}) || model.VBOBuildTime.getMTime() < model.resliceGeom.getMTime() || model.scalarTextures.length !== model.currentValidInputs.length || !model.scalarTextures.every(texture => !!texture?.getHandle()) || !model.colorTexture?.getHandle() || !model.pwfTexture?.getHandle();
|
|
240
|
+
publicAPI.getNeedToRebuildBufferObjects = (ren, actor) => model.VBOBuildTime.getMTime() < publicAPI.getMTime() || model.VBOBuildTime.getMTime() < actor.getMTime() || model.VBOBuildTime.getMTime() < model.renderable.getMTime() || model.VBOBuildTime.getMTime() < actor.getProperty(model.currentValidInputs[0].inputIndex)?.getMTime() || model.currentValidInputs.some(({
|
|
241
|
+
imageData
|
|
242
|
+
}) => model.VBOBuildTime.getMTime() < imageData.getMTime()) || model.VBOBuildTime.getMTime() < model.resliceGeom.getMTime() || model.scalarTextures.length !== model.currentValidInputs.length || !model.scalarTextures.every(texture => !!texture?.getHandle()) || !model.colorTexture?.getHandle() || !model.pwfTexture?.getHandle();
|
|
247
243
|
publicAPI.buildBufferObjects = (ren, actor) => {
|
|
248
244
|
const actorProperties = actor.getProperties();
|
|
249
|
-
model.currentValidInputs.forEach((
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
} = _ref3;
|
|
245
|
+
model.currentValidInputs.forEach(({
|
|
246
|
+
imageData
|
|
247
|
+
}, component) => {
|
|
253
248
|
// rebuild the scalarTexture if the data has changed
|
|
254
249
|
const scalars = imageData.getPointData().getScalars();
|
|
255
250
|
const tex = model._openGLRenderWindow.getGraphicsResourceForObject(scalars);
|
|
@@ -1038,8 +1033,7 @@ const DEFAULT_VALUES = {
|
|
|
1038
1033
|
|
|
1039
1034
|
// ----------------------------------------------------------------------------
|
|
1040
1035
|
|
|
1041
|
-
function extend(publicAPI, model) {
|
|
1042
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1036
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
1043
1037
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
1044
1038
|
|
|
1045
1039
|
// Inheritance
|
|
@@ -112,8 +112,7 @@ const DEFAULT_VALUES = {
|
|
|
112
112
|
|
|
113
113
|
// ----------------------------------------------------------------------------
|
|
114
114
|
|
|
115
|
-
function extend(publicAPI, model) {
|
|
116
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
115
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
117
116
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
118
117
|
|
|
119
118
|
// Inheritance
|
|
@@ -303,8 +303,7 @@ const DEFAULT_VALUES = {
|
|
|
303
303
|
|
|
304
304
|
// ----------------------------------------------------------------------------
|
|
305
305
|
|
|
306
|
-
function extend(publicAPI, model) {
|
|
307
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
306
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
308
307
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
309
308
|
|
|
310
309
|
// Build VTK API
|
|
@@ -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
|
// Inheritance
|
|
@@ -1142,8 +1142,7 @@ const DEFAULT_VALUES = {
|
|
|
1142
1142
|
|
|
1143
1143
|
// ----------------------------------------------------------------------------
|
|
1144
1144
|
|
|
1145
|
-
function extend(publicAPI, model) {
|
|
1146
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1145
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
1147
1146
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
1148
1147
|
|
|
1149
1148
|
// Inheritance
|
|
@@ -490,8 +490,7 @@ const DEFAULT_VALUES = {
|
|
|
490
490
|
|
|
491
491
|
// ----------------------------------------------------------------------------
|
|
492
492
|
|
|
493
|
-
function extend(publicAPI, model) {
|
|
494
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
493
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
495
494
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
496
495
|
|
|
497
496
|
// Inheritance
|
|
@@ -17,7 +17,7 @@ function vtkRadialDistortionPass(publicAPI, model) {
|
|
|
17
17
|
model.classHierarchy.push('vtkRadialDistortionPass');
|
|
18
18
|
|
|
19
19
|
// handles radial distortion and calll delegate
|
|
20
|
-
publicAPI.traverse =
|
|
20
|
+
publicAPI.traverse = (viewNode, parent = null) => {
|
|
21
21
|
if (model.deleted) {
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
@@ -177,8 +177,7 @@ const DEFAULT_VALUES = {
|
|
|
177
177
|
|
|
178
178
|
// ----------------------------------------------------------------------------
|
|
179
179
|
|
|
180
|
-
function extend(publicAPI, model) {
|
|
181
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
180
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
182
181
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
183
182
|
|
|
184
183
|
// Build VTK API
|
|
@@ -217,13 +217,12 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
|
|
|
217
217
|
model.context.readPixels(x1, y1, x2 - x1 + 1, y2 - y1 + 1, model.context.RGBA, model.context.UNSIGNED_BYTE, pixels);
|
|
218
218
|
return pixels;
|
|
219
219
|
};
|
|
220
|
-
publicAPI.get3DContext =
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
};
|
|
220
|
+
publicAPI.get3DContext = (options = {
|
|
221
|
+
preserveDrawingBuffer: false,
|
|
222
|
+
depth: true,
|
|
223
|
+
alpha: true,
|
|
224
|
+
powerPreference: 'high-performance'
|
|
225
|
+
}) => {
|
|
227
226
|
let result = null;
|
|
228
227
|
const webgl2Supported = typeof WebGL2RenderingContext !== 'undefined';
|
|
229
228
|
model.webgl2 = false;
|
|
@@ -243,10 +242,7 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
|
|
|
243
242
|
}
|
|
244
243
|
return new Proxy(result, getCachingContextHandler());
|
|
245
244
|
};
|
|
246
|
-
publicAPI.get2DContext =
|
|
247
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
248
|
-
return model.canvas.getContext('2d', options);
|
|
249
|
-
};
|
|
245
|
+
publicAPI.get2DContext = (options = {}) => model.canvas.getContext('2d', options);
|
|
250
246
|
publicAPI.restoreContext = () => {
|
|
251
247
|
const rp = vtkRenderPass.newInstance();
|
|
252
248
|
rp.setCurrentOperation('Release');
|
|
@@ -282,9 +278,7 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
|
|
|
282
278
|
}
|
|
283
279
|
return -1;
|
|
284
280
|
};
|
|
285
|
-
publicAPI.getDefaultTextureByteSize =
|
|
286
|
-
let oglNorm16Ext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
287
|
-
let useHalfFloat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
281
|
+
publicAPI.getDefaultTextureByteSize = (vtkType, oglNorm16Ext = null, useHalfFloat = false) => {
|
|
288
282
|
if (model.webgl2) {
|
|
289
283
|
switch (vtkType) {
|
|
290
284
|
case VtkDataTypes.CHAR:
|
|
@@ -307,9 +301,7 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
|
|
|
307
301
|
// webgl1 type support is limited to 1 byte
|
|
308
302
|
return 1;
|
|
309
303
|
};
|
|
310
|
-
publicAPI.getDefaultTextureInternalFormat =
|
|
311
|
-
let oglNorm16Ext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
312
|
-
let useHalfFloat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
304
|
+
publicAPI.getDefaultTextureInternalFormat = (vtktype, numComps, oglNorm16Ext = null, useHalfFloat = false) => {
|
|
313
305
|
if (model.webgl2) {
|
|
314
306
|
switch (vtktype) {
|
|
315
307
|
case VtkDataTypes.UNSIGNED_CHAR:
|
|
@@ -396,8 +388,7 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
|
|
|
396
388
|
model.el.removeChild(model.bgImage);
|
|
397
389
|
}
|
|
398
390
|
};
|
|
399
|
-
function getCanvasDataURL() {
|
|
400
|
-
let format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : model.imageFormat;
|
|
391
|
+
function getCanvasDataURL(format = model.imageFormat) {
|
|
401
392
|
// Copy current canvas to not modify the original
|
|
402
393
|
const temporaryCanvas = document.createElement('canvas');
|
|
403
394
|
const temporaryContext = temporaryCanvas.getContext('2d');
|
|
@@ -431,13 +422,11 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
|
|
|
431
422
|
temporaryCanvas.remove();
|
|
432
423
|
publicAPI.invokeImageReady(screenshot);
|
|
433
424
|
}
|
|
434
|
-
publicAPI.captureNextImage =
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
scale = 1
|
|
440
|
-
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
425
|
+
publicAPI.captureNextImage = (format = 'image/png', {
|
|
426
|
+
resetCamera = false,
|
|
427
|
+
size = null,
|
|
428
|
+
scale = 1
|
|
429
|
+
} = {}) => {
|
|
441
430
|
if (model.deleted) {
|
|
442
431
|
return null;
|
|
443
432
|
}
|
|
@@ -461,13 +450,10 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
|
|
|
461
450
|
|
|
462
451
|
// restore the saved camera parameters, if applicable
|
|
463
452
|
if (model._screenshot.cameras) {
|
|
464
|
-
model._screenshot.cameras.forEach(
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
} = _ref;
|
|
469
|
-
return restoreParamsFn(arg);
|
|
470
|
-
});
|
|
453
|
+
model._screenshot.cameras.forEach(({
|
|
454
|
+
restoreParamsFn,
|
|
455
|
+
arg
|
|
456
|
+
}) => restoreParamsFn(arg));
|
|
471
457
|
}
|
|
472
458
|
|
|
473
459
|
// Trigger a render at the original size
|
|
@@ -519,13 +505,10 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
|
|
|
519
505
|
// Perform the resetCamera() on each renderer only after capturing
|
|
520
506
|
// the params from all active cameras, in case there happen to be
|
|
521
507
|
// linked cameras among the renderers.
|
|
522
|
-
model._screenshot.cameras.forEach(
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
} = _ref2;
|
|
527
|
-
return resetCameraFn(resetCameraArgs);
|
|
528
|
-
});
|
|
508
|
+
model._screenshot.cameras.forEach(({
|
|
509
|
+
resetCameraFn,
|
|
510
|
+
resetCameraArgs
|
|
511
|
+
}) => resetCameraFn(resetCameraArgs));
|
|
529
512
|
}
|
|
530
513
|
|
|
531
514
|
// Trigger a render at the custom size
|
|
@@ -719,10 +702,9 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
|
|
|
719
702
|
};
|
|
720
703
|
publicAPI.getGraphicsMemoryInfo = () => {
|
|
721
704
|
let memUsed = 0;
|
|
722
|
-
model._graphicsResources.forEach(
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
} = _ref3;
|
|
705
|
+
model._graphicsResources.forEach(({
|
|
706
|
+
oglObject
|
|
707
|
+
}) => {
|
|
726
708
|
memUsed += oglObject.getAllocatedGPUMemoryInBytes();
|
|
727
709
|
});
|
|
728
710
|
return memUsed;
|
|
@@ -733,10 +715,9 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
|
|
|
733
715
|
model.shaderCache.releaseGraphicsResources(publicAPI);
|
|
734
716
|
}
|
|
735
717
|
// Free cached graphics resources at the context level
|
|
736
|
-
model._graphicsResources.forEach(
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
} = _ref4;
|
|
718
|
+
model._graphicsResources.forEach(({
|
|
719
|
+
oglObject
|
|
720
|
+
}) => {
|
|
740
721
|
oglObject.releaseGraphicsResources(publicAPI);
|
|
741
722
|
});
|
|
742
723
|
model._graphicsResources.clear();
|
|
@@ -755,12 +736,12 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
|
|
|
755
736
|
...publicAPI
|
|
756
737
|
};
|
|
757
738
|
parentMethodsToProxy.forEach(methodName => {
|
|
758
|
-
publicAPI[methodName] =
|
|
739
|
+
publicAPI[methodName] = (...args) => {
|
|
759
740
|
if (model.rootOpenGLRenderWindow) {
|
|
760
741
|
// Proxy only methods when the render window has a parent
|
|
761
|
-
return model.rootOpenGLRenderWindow[methodName](...
|
|
742
|
+
return model.rootOpenGLRenderWindow[methodName](...args);
|
|
762
743
|
}
|
|
763
|
-
return publicAPIBeforeProxy[methodName](...
|
|
744
|
+
return publicAPIBeforeProxy[methodName](...args);
|
|
764
745
|
};
|
|
765
746
|
});
|
|
766
747
|
}
|
|
@@ -794,8 +775,7 @@ const DEFAULT_VALUES = {
|
|
|
794
775
|
|
|
795
776
|
// ----------------------------------------------------------------------------
|
|
796
777
|
|
|
797
|
-
function extend(publicAPI, model) {
|
|
798
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
778
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
799
779
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
800
780
|
|
|
801
781
|
// Inheritance
|
|
@@ -143,7 +143,6 @@ function vtkOpenGLRenderer(publicAPI, model) {
|
|
|
143
143
|
gl.enable(gl.DEPTH_TEST);
|
|
144
144
|
/* eslint-enable no-bitwise */
|
|
145
145
|
};
|
|
146
|
-
|
|
147
146
|
publicAPI.releaseGraphicsResources = () => {
|
|
148
147
|
if (model.selector !== null) {
|
|
149
148
|
model.selector.releaseGraphicsResources();
|
|
@@ -180,8 +179,7 @@ const DEFAULT_VALUES = {
|
|
|
180
179
|
|
|
181
180
|
// ----------------------------------------------------------------------------
|
|
182
181
|
|
|
183
|
-
function extend(publicAPI, model) {
|
|
184
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
182
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
185
183
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
186
184
|
|
|
187
185
|
// Inheritance
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import vtkShaderProgram from './ShaderProgram.js';
|
|
2
2
|
|
|
3
|
-
function implementReplaceShaderCoincidentOffset(publicAPI, model) {
|
|
3
|
+
function implementReplaceShaderCoincidentOffset(publicAPI, model, initialValues = {}) {
|
|
4
4
|
publicAPI.replaceShaderCoincidentOffset = (shaders, ren, actor) => {
|
|
5
5
|
const cp = publicAPI.getCoincidentParameters(ren, actor);
|
|
6
6
|
|
|
@@ -32,7 +32,7 @@ function implementReplaceShaderCoincidentOffset(publicAPI, model) {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
function implementBuildShadersWithReplacements(publicAPI, model) {
|
|
35
|
+
function implementBuildShadersWithReplacements(publicAPI, model, initialValues = {}) {
|
|
36
36
|
publicAPI.applyShaderReplacements = (shaders, viewSpec, pre) => {
|
|
37
37
|
let shaderReplacements = null;
|
|
38
38
|
if (viewSpec) {
|
|
@@ -41,8 +41,7 @@ const DEFAULT_VALUES = {};
|
|
|
41
41
|
|
|
42
42
|
// ----------------------------------------------------------------------------
|
|
43
43
|
|
|
44
|
-
function extend(publicAPI, model) {
|
|
45
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
44
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
46
45
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
47
46
|
|
|
48
47
|
// Inheritance
|
|
@@ -76,8 +76,7 @@ const DEFAULT_VALUES = {
|
|
|
76
76
|
|
|
77
77
|
// ----------------------------------------------------------------------------
|
|
78
78
|
|
|
79
|
-
function extend(publicAPI, model) {
|
|
80
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
79
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
81
80
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
82
81
|
|
|
83
82
|
// Build VTK API
|
|
@@ -155,8 +155,7 @@ const DEFAULT_VALUES = {
|
|
|
155
155
|
|
|
156
156
|
// ----------------------------------------------------------------------------
|
|
157
157
|
|
|
158
|
-
function extend(publicAPI, model) {
|
|
159
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
158
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
160
159
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
161
160
|
|
|
162
161
|
// Internal objects
|
|
@@ -249,15 +249,12 @@ function vtkShaderProgram(publicAPI, model) {
|
|
|
249
249
|
model.context.uniform3fv(location, v);
|
|
250
250
|
return true;
|
|
251
251
|
};
|
|
252
|
-
publicAPI.setUniform3i =
|
|
252
|
+
publicAPI.setUniform3i = (name, ...args) => {
|
|
253
253
|
const location = publicAPI.findUniform(name);
|
|
254
254
|
if (location === -1) {
|
|
255
255
|
model.error = `Could not set uniform ${name} . No such uniform.`;
|
|
256
256
|
return false;
|
|
257
257
|
}
|
|
258
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
259
|
-
args[_key - 1] = arguments[_key];
|
|
260
|
-
}
|
|
261
258
|
let array = args;
|
|
262
259
|
// allow an array passed as a single argument
|
|
263
260
|
if (array.length === 1 && Array.isArray(array[0])) {
|
|
@@ -278,15 +275,12 @@ function vtkShaderProgram(publicAPI, model) {
|
|
|
278
275
|
model.context.uniform3iv(location, v);
|
|
279
276
|
return true;
|
|
280
277
|
};
|
|
281
|
-
publicAPI.setUniform4f =
|
|
278
|
+
publicAPI.setUniform4f = (name, ...args) => {
|
|
282
279
|
const location = publicAPI.findUniform(name);
|
|
283
280
|
if (location === -1) {
|
|
284
281
|
model.error = `Could not set uniform ${name} . No such uniform.`;
|
|
285
282
|
return false;
|
|
286
283
|
}
|
|
287
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
288
|
-
args[_key2 - 1] = arguments[_key2];
|
|
289
|
-
}
|
|
290
284
|
let array = args;
|
|
291
285
|
// allow an array passed as a single argument
|
|
292
286
|
if (array.length === 1 && Array.isArray(array[0])) {
|
|
@@ -307,15 +301,12 @@ function vtkShaderProgram(publicAPI, model) {
|
|
|
307
301
|
model.context.uniform4fv(location, v);
|
|
308
302
|
return true;
|
|
309
303
|
};
|
|
310
|
-
publicAPI.setUniform4i =
|
|
304
|
+
publicAPI.setUniform4i = (name, ...args) => {
|
|
311
305
|
const location = publicAPI.findUniform(name);
|
|
312
306
|
if (location === -1) {
|
|
313
307
|
model.error = `Could not set uniform ${name} . No such uniform.`;
|
|
314
308
|
return false;
|
|
315
309
|
}
|
|
316
|
-
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
317
|
-
args[_key3 - 1] = arguments[_key3];
|
|
318
|
-
}
|
|
319
310
|
let array = args;
|
|
320
311
|
// allow an array passed as a single argument
|
|
321
312
|
if (array.length === 1 && Array.isArray(array[0])) {
|
|
@@ -522,8 +513,7 @@ const DEFAULT_VALUES = {
|
|
|
522
513
|
|
|
523
514
|
// ----------------------------------------------------------------------------
|
|
524
515
|
|
|
525
|
-
function extend(publicAPI, model) {
|
|
526
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
516
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
527
517
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
528
518
|
|
|
529
519
|
// Instantiate internal objects
|
|
@@ -189,8 +189,7 @@ const DEFAULT_VALUES = {
|
|
|
189
189
|
|
|
190
190
|
// ----------------------------------------------------------------------------
|
|
191
191
|
|
|
192
|
-
function extend(publicAPI, model) {
|
|
193
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
192
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
194
193
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
195
194
|
|
|
196
195
|
// Inheritance
|
|
@@ -252,8 +252,7 @@ const DEFAULT_VALUES = {};
|
|
|
252
252
|
|
|
253
253
|
// ----------------------------------------------------------------------------
|
|
254
254
|
|
|
255
|
-
function extend(publicAPI, model) {
|
|
256
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
255
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
257
256
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
258
257
|
|
|
259
258
|
// Inheritance
|
|
@@ -263,8 +263,7 @@ const DEFAULT_VALUES = {};
|
|
|
263
263
|
|
|
264
264
|
// ----------------------------------------------------------------------------
|
|
265
265
|
|
|
266
|
-
function extend(publicAPI, model) {
|
|
267
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
266
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
268
267
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
269
268
|
|
|
270
269
|
// Inheritance
|