@kitware/vtk.js 23.0.1 → 23.3.0-beta.1
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/Common/Core/CellArray.d.ts +2 -2
- package/Common/Core/DataArray.d.ts +2 -2
- package/Common/Core/Endian.d.ts +3 -1
- package/Common/Core/ImageHelper.d.ts +1 -1
- package/Common/Core/LookupTable.d.ts +2 -2
- package/Common/Core/Math.d.ts +1 -1
- package/Common/Core/MatrixBuilder.d.ts +1 -1
- package/Common/Core/Points.d.ts +2 -2
- package/Common/Core/PriorityQueue.d.ts +1 -1
- package/Common/Core/ProgressHandler.d.ts +1 -1
- package/Common/Core/ScalarsToColors.d.ts +3 -3
- package/Common/Core/StringArray.d.ts +1 -1
- package/Common/Core/VariantArray.d.ts +1 -1
- package/Common/DataModel/Box.d.ts +2 -2
- package/Common/DataModel/CardinalSpline1D.d.ts +2 -2
- package/Common/DataModel/Cell.d.ts +3 -3
- package/Common/DataModel/Cone.d.ts +2 -2
- package/Common/DataModel/Cylinder.d.ts +2 -2
- package/Common/DataModel/DataSet.d.ts +2 -2
- package/Common/DataModel/DataSetAttributes/FieldData.d.ts +1 -1
- package/Common/DataModel/DataSetAttributes.d.ts +3 -3
- package/Common/DataModel/ImageData.d.ts +2 -2
- package/Common/DataModel/KochanekSpline1D.d.ts +1 -1
- package/Common/DataModel/Line.d.ts +2 -2
- package/Common/DataModel/PiecewiseFunction.d.ts +2 -2
- package/Common/DataModel/Plane.d.ts +2 -2
- package/Common/DataModel/PointSet.d.ts +3 -3
- package/Common/DataModel/PolyData.d.ts +3 -3
- package/Common/DataModel/Polygon.d.ts +2 -2
- package/Common/DataModel/SelectionNode.d.ts +2 -2
- package/Common/DataModel/Sphere.d.ts +2 -2
- package/Common/DataModel/Spline1D.d.ts +1 -1
- package/Common/DataModel/Spline3D.d.ts +1 -1
- package/Common/DataModel/Triangle.d.ts +2 -2
- package/Common/Transform/LandmarkTransform.d.ts +2 -2
- package/Filters/General/AppendPolyData.d.ts +1 -1
- package/Filters/General/ImageCropFilter.d.ts +1 -1
- package/Filters/General/ImageOutlineFilter.d.ts +1 -1
- package/Filters/General/ImageSliceFilter.d.ts +1 -1
- package/Filters/General/ImageStreamline.d.ts +3 -3
- package/Filters/General/LineFilter.d.ts +1 -1
- package/Filters/General/OutlineFilter.d.ts +1 -1
- package/Filters/General/TriangleFilter.d.ts +1 -1
- package/Filters/General/TubeFilter.d.ts +2 -2
- package/Filters/Sources/Arrow2DSource.d.ts +2 -2
- package/Filters/Sources/ArrowSource.d.ts +2 -2
- package/Filters/Sources/CircleSource.d.ts +2 -2
- package/Filters/Sources/ConeSource.d.ts +2 -2
- package/Filters/Sources/CubeSource.d.ts +2 -2
- package/Filters/Sources/Cursor3D.d.ts +3 -3
- package/Filters/Sources/CylinderSource.d.ts +2 -2
- package/Filters/Sources/LineSource.d.ts +2 -2
- package/Filters/Sources/PlaneSource.d.ts +2 -2
- package/Filters/Sources/PointSource.d.ts +2 -2
- package/Filters/Sources/SphereSource.d.ts +2 -2
- package/Filters/Texture/TextureMapToPlane.d.ts +1 -1
- package/Filters/Texture/TextureMapToSphere.d.ts +1 -1
- package/IO/Core/DataAccessHelper.d.ts +4 -4
- package/IO/Core/HttpDataSetReader.d.ts +5 -5
- package/IO/Core/HttpSceneLoader.d.ts +5 -5
- package/IO/Core/ImageStream/DefaultProtocol.d.ts +1 -1
- package/IO/Core/ImageStream/ViewStream.d.ts +4 -4
- package/IO/Core/ImageStream.d.ts +3 -3
- package/IO/Core/WSLinkClient.d.ts +1 -1
- package/IO/Geometry/DracoReader.d.ts +5 -5
- package/IO/Geometry/PLYReader.d.ts +5 -5
- package/IO/Geometry/PLYWriter.d.ts +2 -2
- package/IO/Geometry/STLReader.d.ts +5 -5
- package/IO/Geometry/STLWriter.d.ts +2 -2
- package/IO/Misc/ElevationReader.d.ts +5 -5
- package/IO/Misc/ITKImageReader.d.ts +1 -1
- package/IO/Misc/ITKPolyDataReader.d.ts +1 -1
- package/IO/Misc/JSONNucleoReader.d.ts +5 -5
- package/IO/Misc/JSONReader.d.ts +1 -1
- package/IO/Misc/MTLReader.d.ts +6 -6
- package/IO/Misc/OBJReader.d.ts +5 -5
- package/IO/Misc/PDBReader.d.ts +5 -5
- package/IO/XML/XMLImageDataReader.d.ts +1 -1
- package/IO/XML/XMLPolyDataReader.d.ts +1 -1
- package/IO/XML/XMLReader.d.ts +5 -5
- package/Imaging/Core/ImageInterpolator.js +181 -6
- package/Imaging/Core/ImageReslice.js +1 -1
- package/Interaction/Manipulators/MouseRangeManipulator.js +55 -1
- package/Interaction/Widgets/OrientationMarkerWidget.d.ts +12 -10
- package/Rendering/Core/AbstractMapper.d.ts +2 -2
- package/Rendering/Core/AbstractMapper3D.d.ts +2 -2
- package/Rendering/Core/AbstractPicker.d.ts +4 -4
- package/Rendering/Core/Actor.d.ts +4 -4
- package/Rendering/Core/Actor2D.d.ts +5 -5
- package/Rendering/Core/AnnotatedCubeActor.d.ts +1 -1
- package/Rendering/Core/AxesActor.d.ts +1 -1
- package/Rendering/Core/Camera.d.ts +2 -2
- package/Rendering/Core/CellPicker.d.ts +5 -5
- package/Rendering/Core/ColorTransferFunction.d.ts +1 -1
- package/Rendering/Core/Coordinate.d.ts +2 -2
- package/Rendering/Core/Follower.d.ts +2 -2
- package/Rendering/Core/Glyph3DMapper.d.ts +2 -2
- package/Rendering/Core/ImageMapper.d.ts +3 -3
- package/Rendering/Core/ImageProperty.d.ts +2 -2
- package/Rendering/Core/ImageSlice.d.ts +4 -4
- package/Rendering/Core/Light.d.ts +2 -2
- package/Rendering/Core/Mapper.d.ts +5 -5
- package/Rendering/Core/Mapper2D.d.ts +4 -3
- package/Rendering/Core/Picker.d.ts +5 -5
- package/Rendering/Core/PixelSpaceCallbackMapper.d.ts +2 -2
- package/Rendering/Core/PointPicker.d.ts +3 -3
- package/Rendering/Core/Prop.d.ts +5 -5
- package/Rendering/Core/Prop3D.d.ts +2 -2
- package/Rendering/Core/Property.d.ts +2 -2
- package/Rendering/Core/Property2D.d.ts +2 -2
- package/Rendering/Core/RenderWindow.d.ts +4 -4
- package/Rendering/Core/RenderWindowInteractor.d.ts +2 -2
- package/Rendering/Core/Renderer.d.ts +12 -11
- package/Rendering/Core/ScalarBarActor.d.ts +3 -3
- package/Rendering/Core/Skybox.d.ts +1 -1
- package/Rendering/Core/SphereMapper.d.ts +1 -1
- package/Rendering/Core/StickMapper.d.ts +1 -1
- package/Rendering/Core/Texture.d.ts +1 -1
- package/Rendering/Core/Viewport.d.ts +4 -4
- package/Rendering/Core/Volume.d.ts +4 -4
- package/Rendering/Core/VolumeMapper.d.ts +2 -2
- package/Rendering/Core/VolumeProperty.d.ts +1 -1
- package/Rendering/Misc/CanvasView.d.ts +2 -2
- package/Rendering/Misc/FullScreenRenderWindow.d.ts +8 -8
- package/Rendering/Misc/GenericRenderWindow.d.ts +6 -6
- package/Rendering/Misc/RemoteView.d.ts +3 -3
- package/Rendering/Misc/RenderWindowWithControlBar.d.ts +2 -2
- package/Rendering/Misc/SynchronizableRenderWindow.d.ts +4 -3
- package/Rendering/Misc/TextureLODsDownloader.d.ts +4 -4
- package/Rendering/OpenGL/ForwardPass.js +7 -3
- package/Rendering/OpenGL/Framebuffer.js +68 -11
- package/Rendering/OpenGL/ImageMapper.js +23 -4
- package/Rendering/OpenGL/OrderIndependentTranslucentPass.js +293 -0
- package/Rendering/OpenGL/PolyDataMapper.js +20 -2
- package/Rendering/OpenGL/RenderWindow.d.ts +18 -18
- package/Rendering/OpenGL/ShaderCache.js +10 -2
- package/Rendering/OpenGL/Texture.js +32 -16
- package/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl.js +1 -1
- package/Rendering/SceneGraph/RenderPass.d.ts +2 -2
- package/Rendering/SceneGraph/ViewNode.d.ts +2 -2
- package/Rendering/SceneGraph/ViewNodeFactory.d.ts +1 -1
- package/Widgets/Manipulators/LineManipulator.d.ts +1 -1
- package/Widgets/Manipulators/PlaneManipulator.d.ts +1 -1
- package/Widgets/Manipulators/TrackballManipulator.d.ts +1 -1
- package/Widgets/Representations/ResliceCursorContextRepresentation.d.ts +1 -1
- package/Widgets/Representations/WidgetRepresentation.d.ts +1 -1
- package/interfaces.d.ts +4 -4
- package/macros.d.ts +1 -1
- package/package.json +1 -1
- package/types.d.ts +22 -1
- package/vtk.d.ts +7 -2
|
@@ -456,7 +456,11 @@ function vtkOpenGLTexture(publicAPI, model) {
|
|
|
456
456
|
|
|
457
457
|
publicAPI.getOpenGLDataType = function (vtkScalarType) {
|
|
458
458
|
var useHalfFloatType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
459
|
-
|
|
459
|
+
|
|
460
|
+
if (!model.openGLDataType) {
|
|
461
|
+
model.openGLDataType = publicAPI.getDefaultDataType(vtkScalarType, useHalfFloatType);
|
|
462
|
+
}
|
|
463
|
+
|
|
460
464
|
return model.openGLDataType;
|
|
461
465
|
};
|
|
462
466
|
|
|
@@ -561,13 +565,17 @@ function vtkOpenGLTexture(publicAPI, model) {
|
|
|
561
565
|
|
|
562
566
|
if (dataType !== VtkDataTypes.FLOAT && model.openGLDataType === model.context.FLOAT) {
|
|
563
567
|
for (var idx = 0; idx < data.length; idx++) {
|
|
564
|
-
|
|
568
|
+
if (data[idx]) {
|
|
569
|
+
var newArray = new Float32Array(pixCount);
|
|
565
570
|
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
571
|
+
for (var i = 0; i < pixCount; i++) {
|
|
572
|
+
newArray[i] = data[idx][i];
|
|
573
|
+
}
|
|
569
574
|
|
|
570
|
-
|
|
575
|
+
pixData.push(newArray);
|
|
576
|
+
} else {
|
|
577
|
+
pixData.push(null);
|
|
578
|
+
}
|
|
571
579
|
}
|
|
572
580
|
} // if the opengl data type is ubyte
|
|
573
581
|
// then the data array must be u8, we currently simply truncate the data
|
|
@@ -575,13 +583,17 @@ function vtkOpenGLTexture(publicAPI, model) {
|
|
|
575
583
|
|
|
576
584
|
if (dataType !== VtkDataTypes.UNSIGNED_CHAR && model.openGLDataType === model.context.UNSIGNED_BYTE) {
|
|
577
585
|
for (var _idx = 0; _idx < data.length; _idx++) {
|
|
578
|
-
|
|
586
|
+
if (data[_idx]) {
|
|
587
|
+
var _newArray = new Uint8Array(pixCount);
|
|
579
588
|
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
589
|
+
for (var _i = 0; _i < pixCount; _i++) {
|
|
590
|
+
_newArray[_i] = data[_idx][_i];
|
|
591
|
+
}
|
|
583
592
|
|
|
584
|
-
|
|
593
|
+
pixData.push(_newArray);
|
|
594
|
+
} else {
|
|
595
|
+
pixData.push(null);
|
|
596
|
+
}
|
|
585
597
|
}
|
|
586
598
|
} // if the opengl data type is half float
|
|
587
599
|
// then the data array must be u16
|
|
@@ -592,13 +604,17 @@ function vtkOpenGLTexture(publicAPI, model) {
|
|
|
592
604
|
|
|
593
605
|
if (halfFloat) {
|
|
594
606
|
for (var _idx2 = 0; _idx2 < data.length; _idx2++) {
|
|
595
|
-
|
|
607
|
+
if (data[_idx2]) {
|
|
608
|
+
var _newArray2 = new Uint16Array(pixCount);
|
|
596
609
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
610
|
+
for (var _i2 = 0; _i2 < pixCount; _i2++) {
|
|
611
|
+
_newArray2[_i2] = HalfFloat.toHalf(data[_idx2][_i2]);
|
|
612
|
+
}
|
|
600
613
|
|
|
601
|
-
|
|
614
|
+
pixData.push(_newArray2);
|
|
615
|
+
} else {
|
|
616
|
+
pixData.push(null);
|
|
617
|
+
}
|
|
602
618
|
}
|
|
603
619
|
} // The output has to be filled
|
|
604
620
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var vtkPolyDataFS = "//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyDataFS.glsl\n\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n All rights reserved.\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n\n This software is distributed WITHOUT ANY WARRANTY; without even\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE. See the above copyright notice for more information.\n\n=========================================================================*/\n// Template for the polydata mappers fragment shader\n\nuniform int PrimitiveIDOffset;\n\n// VC position of this fragment\n//VTK::PositionVC::Dec\n\n// optional color passed in from the vertex shader, vertexColor\n//VTK::Color::Dec\n\n// optional surface normal declaration\n//VTK::Normal::Dec\n\n// extra lighting parameters\n//VTK::Light::Dec\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// picking support\n//VTK::Picking::Dec\n\n// Depth Peeling Support\n//VTK::DepthPeeling::Dec\n\n// clipping plane vars\n//VTK::Clip::Dec\n\n// the output of this shader\n//VTK::Output::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\n// handle coincident offsets\n//VTK::Coincident::Dec\n\n//VTK::ZBuffer::Dec\n\nvoid main()\n{\n // VC position of this fragment. This should not branch/return/discard.\n //VTK::PositionVC::Impl\n\n // Place any calls that require uniform flow (e.g. dFdx) here.\n //VTK::UniformFlow::Impl\n\n // Set gl_FragDepth here (gl_FragCoord.z by default)\n //VTK::Depth::Impl\n\n // Early depth peeling abort:\n //VTK::DepthPeeling::PreColor\n\n // Apple Bug\n //VTK::PrimID::Impl\n\n //VTK::Clip::Impl\n\n //VTK::Color::Impl\n\n // Generate the normal if we are not passed in one\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Light::Impl\n\n if (gl_FragData[0].a <= 0.0)\n {\n discard;\n }\n\n //VTK::DepthPeeling::Impl\n\n //VTK::Picking::Impl\n\n // handle coincident offsets\n //VTK::Coincident::Impl\n\n //VTK::ZBuffer::Impl\n}\n";
|
|
1
|
+
var vtkPolyDataFS = "//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyDataFS.glsl\n\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n All rights reserved.\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n\n This software is distributed WITHOUT ANY WARRANTY; without even\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE. See the above copyright notice for more information.\n\n=========================================================================*/\n// Template for the polydata mappers fragment shader\n\nuniform int PrimitiveIDOffset;\n\n// VC position of this fragment\n//VTK::PositionVC::Dec\n\n// optional color passed in from the vertex shader, vertexColor\n//VTK::Color::Dec\n\n// optional surface normal declaration\n//VTK::Normal::Dec\n\n// extra lighting parameters\n//VTK::Light::Dec\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// picking support\n//VTK::Picking::Dec\n\n// Depth Peeling Support\n//VTK::DepthPeeling::Dec\n\n// clipping plane vars\n//VTK::Clip::Dec\n\n// the output of this shader\n//VTK::Output::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\n// handle coincident offsets\n//VTK::Coincident::Dec\n\n//VTK::ZBuffer::Dec\n\nvoid main()\n{\n // VC position of this fragment. This should not branch/return/discard.\n //VTK::PositionVC::Impl\n\n // Place any calls that require uniform flow (e.g. dFdx) here.\n //VTK::UniformFlow::Impl\n\n // Set gl_FragDepth here (gl_FragCoord.z by default)\n //VTK::Depth::Impl\n\n // Early depth peeling abort:\n //VTK::DepthPeeling::PreColor\n\n // Apple Bug\n //VTK::PrimID::Impl\n\n //VTK::Clip::Impl\n\n //VTK::Color::Impl\n\n // Generate the normal if we are not passed in one\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Light::Impl\n\n if (gl_FragData[0].a <= 0.0)\n {\n discard;\n }\n\n //VTK::DepthPeeling::Impl\n\n //VTK::Picking::Impl\n\n // handle coincident offsets\n //VTK::Coincident::Impl\n\n //VTK::ZBuffer::Impl\n\n //VTK::RenderPassFragmentShader::Impl\n}\n";
|
|
2
2
|
|
|
3
3
|
export { vtkPolyDataFS as v };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {vtkWidgetRepresentation, IWidgetRepresentationInitialValues} from '
|
|
1
|
+
import {vtkWidgetRepresentation, IWidgetRepresentationInitialValues} from './WidgetRepresentation';
|
|
2
2
|
|
|
3
3
|
export interface IResliceCursorContextRepresentationInitialValues extends IWidgetRepresentationInitialValues {
|
|
4
4
|
axis1Name?: string,
|
package/interfaces.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import vtkDataArray from '
|
|
2
|
-
import vtkImageData from '
|
|
3
|
-
import vtkPolyData from '
|
|
4
|
-
import { vtkPipelineConnection } from '
|
|
1
|
+
import vtkDataArray from '././Common/Core/DataArray';
|
|
2
|
+
import vtkImageData from '././Common/DataModel/ImageData';
|
|
3
|
+
import vtkPolyData from '././Common/DataModel/PolyData';
|
|
4
|
+
import { vtkPipelineConnection } from '././types';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Object returned on any subscription call
|
package/macros.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { vtkSubscription, vtkDebouncedFunction, vtkProperty, vtkPropertyDomain } from '
|
|
1
|
+
import { vtkSubscription, vtkDebouncedFunction, vtkProperty, vtkPropertyDomain } from '././interfaces';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Allow user to redefine vtkXXXMacro method call.
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
|
-
import { vtkOutputPort } from '
|
|
1
|
+
import { vtkOutputPort } from '././interfaces';
|
|
2
|
+
|
|
3
|
+
/** Alias type for value that can be null */
|
|
4
|
+
declare type Nullable<T> = T | null;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Alias type for number that are floats
|
|
8
|
+
* @ignorenaming
|
|
9
|
+
*/
|
|
10
|
+
declare type float = number;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Alias type for number that are doubles.
|
|
14
|
+
* @ignorenaming
|
|
15
|
+
*/
|
|
16
|
+
declare type double = number;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Alias type for number that are integer
|
|
20
|
+
* @ignorenaming
|
|
21
|
+
*/
|
|
22
|
+
declare type int = number;
|
|
2
23
|
|
|
3
24
|
declare type TypedArray =
|
|
4
25
|
| number[]
|
package/vtk.d.ts
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
|
+
interface IvtkObject {
|
|
2
|
+
vtkClass: string;
|
|
3
|
+
[attrName: string]: unknown;
|
|
4
|
+
}
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
*
|
|
3
8
|
* @param obj
|
|
4
9
|
* @return
|
|
5
10
|
*/
|
|
6
|
-
declare function vtk(obj:
|
|
11
|
+
declare function vtk(obj: IvtkObject): unknown;
|
|
7
12
|
|
|
8
13
|
/**
|
|
9
14
|
* Nest register method under the vtk function
|
|
10
15
|
* @param vtkClassName
|
|
11
16
|
* @param constructor
|
|
12
17
|
*/
|
|
13
|
-
declare function register(vtkClassName: string, constructor:
|
|
18
|
+
declare function register(vtkClassName: string, constructor: unknown): void;
|
|
14
19
|
|
|
15
20
|
export default vtk;
|