@kitware/vtk.js 33.1.0 → 33.2.0
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/Base64.d.ts +1 -0
- package/Common/Core/URLExtract.d.ts +6 -0
- package/IO/Core/DataAccessHelper/HtmlDataAccessHelper.d.ts +1 -0
- package/IO/Core/DataAccessHelper/HttpDataAccessHelper.d.ts +1 -0
- package/IO/Core/DataAccessHelper/JSZipDataAccessHelper.d.ts +1 -0
- package/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper.d.ts +1 -0
- package/IO/Core/DataAccessHelper.d.ts +4 -4
- package/IO/Core/HttpDataSetReader.d.ts +4 -4
- package/IO/Geometry/DracoReader.d.ts +4 -4
- package/IO/Geometry/GLTFImporter/Reader.js +5 -6
- package/IO/Geometry/GLTFImporter.d.ts +8 -8
- package/IO/Geometry/IFCImporter.d.ts +5 -5
- package/IO/Geometry/PLYReader.d.ts +4 -4
- package/IO/Geometry/STLReader.d.ts +4 -4
- package/IO/Geometry/STLReader.js +20 -20
- package/IO/Image/HDRReader.d.ts +4 -4
- package/IO/Image/TGAReader.d.ts +4 -4
- package/IO/Image/TIFFReader.d.ts +4 -4
- package/IO/Misc/ElevationReader.d.ts +4 -4
- package/IO/Misc/GCodeReader.d.ts +4 -4
- package/IO/Misc/JSONNucleoReader.d.ts +4 -4
- package/IO/Misc/MTLReader.d.ts +5 -5
- package/IO/Misc/OBJReader.d.ts +4 -4
- package/IO/Misc/PDBReader.d.ts +4 -4
- package/IO/XML/XMLReader.d.ts +4 -4
- package/Interaction/Manipulators/CompositeCameraManipulator.d.ts +2 -2
- package/Interaction/Manipulators/CompositeVRManipulator.d.ts +2 -2
- package/Proxy/Core/AbstractRepresentationProxy.d.ts +5 -4
- package/Proxy/Core/ProxyManager.d.ts +5 -5
- package/Proxy/Core/SourceProxy.d.ts +2 -1
- package/Proxy/Core/View2DProxy.d.ts +3 -2
- package/Proxy/Core/ViewProxy.d.ts +11 -10
- package/Proxy/Representations/GeometryRepresentationProxy.d.ts +3 -2
- package/Proxy/Representations/ResliceRepresentationProxy.d.ts +5 -4
- package/Proxy/Representations/SliceRepresentationProxy.d.ts +3 -2
- package/Proxy/Representations/VolumeRepresentationProxy.d.ts +4 -3
- package/Rendering/Core/AbstractImageMapper.d.ts +3 -2
- package/Rendering/Core/ImageArrayMapper.d.ts +7 -5
- package/Rendering/Core/ImageCPRMapper.d.ts +8 -6
- package/Rendering/Core/ImageMapper.d.ts +8 -5
- package/Rendering/Core/ImageResliceMapper.d.ts +6 -4
- package/Rendering/Core/InteractorObserver.d.ts +4 -3
- package/Rendering/Core/InteractorStyle.d.ts +2 -2
- package/Rendering/Core/Mapper/CoincidentTopologyHelper.d.ts +4 -1
- package/Rendering/Core/Mapper.d.ts +5 -3
- package/Rendering/Core/Property.d.ts +31 -7
- package/Rendering/Core/Property.js +4 -2
- package/Rendering/Core/VolumeMapper.d.ts +3 -2
- package/Rendering/Misc/SynchronizableRenderWindow/ObjectManager.d.ts +2 -1
- package/Rendering/WebGPU/Buffer.js +3 -2
- package/Rendering/WebGPU/CellArrayMapper.js +48 -19
- package/Rendering/WebGPU/ForwardPass.js +1 -1
- package/Rendering/WebGPU/OrderIndependentTranslucentPass.js +3 -3
- package/Rendering/WebGPU/PolyDataMapper.js +5 -1
- package/Rendering/WebGPU/RenderEncoder.js +1 -1
- package/Rendering/WebGPU/VolumePass.js +5 -5
- package/Widgets/Core/AbstractWidget.d.ts +5 -6
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.d.ts +5 -2
- package/Widgets/Widgets3D/ResliceCursorWidget.d.ts +7 -7
- package/package.json +3 -1
- package/tsconfig.json +7 -0
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import vtkCamera from './Camera';
|
|
2
|
-
import
|
|
1
|
+
import { vtkCamera } from './Camera';
|
|
2
|
+
import {
|
|
3
|
+
vtkAbstractImageMapper,
|
|
3
4
|
IAbstractImageMapperInitialValues,
|
|
4
5
|
} from './AbstractImageMapper';
|
|
5
6
|
import { Bounds, Nullable, Vector3 } from './../../types';
|
|
6
7
|
import { SlicingMode } from './ImageMapper/Constants';
|
|
7
|
-
import vtkImageData from './../../Common/DataModel/ImageData';
|
|
8
|
-
import
|
|
8
|
+
import { vtkImageData } from './../../Common/DataModel/ImageData';
|
|
9
|
+
import {
|
|
10
|
+
CoincidentTopologyHelper,
|
|
9
11
|
StaticCoincidentTopologyMethods,
|
|
10
12
|
} from './Mapper/CoincidentTopologyHelper';
|
|
11
13
|
|
|
12
|
-
interface IClosestIJKAxis {
|
|
14
|
+
export interface IClosestIJKAxis {
|
|
13
15
|
ijkMode: SlicingMode;
|
|
14
16
|
flip: boolean;
|
|
15
17
|
}
|
|
@@ -212,4 +214,5 @@ export declare const vtkImageMapper: {
|
|
|
212
214
|
extend: typeof extend;
|
|
213
215
|
SlicingMode: typeof SlicingMode;
|
|
214
216
|
} & StaticCoincidentTopologyMethods;
|
|
217
|
+
|
|
215
218
|
export default vtkImageMapper;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
vtkAbstractImageMapper,
|
|
2
3
|
IAbstractImageMapperInitialValues,
|
|
3
4
|
} from './AbstractImageMapper';
|
|
4
|
-
import vtkPlane from './../../Common/DataModel/Plane';
|
|
5
|
-
import vtkPolyData from './../../Common/DataModel/PolyData';
|
|
5
|
+
import { vtkPlane } from './../../Common/DataModel/Plane';
|
|
6
|
+
import { vtkPolyData } from './../../Common/DataModel/PolyData';
|
|
6
7
|
import { Bounds, Extent } from './../../types';
|
|
7
8
|
import { SlabTypes } from './ImageResliceMapper/Constants';
|
|
8
|
-
import
|
|
9
|
+
import {
|
|
10
|
+
CoincidentTopologyHelper,
|
|
9
11
|
StaticCoincidentTopologyMethods,
|
|
10
12
|
} from './Mapper/CoincidentTopologyHelper';
|
|
11
13
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import vtkRenderer from './Renderer';
|
|
2
|
-
import vtkRenderWindowInteractor from './RenderWindowInteractor';
|
|
1
|
+
import { vtkRenderer } from './Renderer';
|
|
2
|
+
import { vtkRenderWindowInteractor } from './RenderWindowInteractor';
|
|
3
3
|
import { vtkObject, EventHandler, vtkSubscription } from './../../interfaces';
|
|
4
4
|
import { Vector3 } from './../../types';
|
|
5
5
|
|
|
@@ -138,4 +138,5 @@ export interface vtkInteractorObserver extends vtkObject {
|
|
|
138
138
|
): Vector3;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
declare const _default: vtkInteractorObserver;
|
|
142
|
+
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventHandler, vtkSubscription } from './../../interfaces';
|
|
2
2
|
import { Nullable } from './../../types';
|
|
3
|
-
import vtkInteractorObserver from './InteractorObserver';
|
|
4
|
-
import vtkRenderer from './Renderer';
|
|
3
|
+
import { vtkInteractorObserver } from './InteractorObserver';
|
|
4
|
+
import { vtkRenderer } from './Renderer';
|
|
5
5
|
|
|
6
6
|
export interface vtkInteractorStyle extends vtkInteractorObserver {
|
|
7
7
|
/**
|
|
@@ -121,7 +121,7 @@ export interface StaticCoincidentTopologyMethods {
|
|
|
121
121
|
getResolveCoincidentTopologyAsString(): string;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
export
|
|
124
|
+
export interface CoincidentTopologyHelper
|
|
125
125
|
extends StaticCoincidentTopologyMethods {
|
|
126
126
|
/**
|
|
127
127
|
*
|
|
@@ -192,3 +192,6 @@ export default interface CoincidentTopologyHelper
|
|
|
192
192
|
*/
|
|
193
193
|
getCoincidentTopologyPointOffsetParameters(): ICoincidentTopology;
|
|
194
194
|
}
|
|
195
|
+
|
|
196
|
+
declare const _default: CoincidentTopologyHelper;
|
|
197
|
+
export default _default;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Bounds, Nullable, Range } from './../../types';
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
vtkAbstractMapper3D,
|
|
3
4
|
IAbstractMapper3DInitialValues,
|
|
4
5
|
} from './AbstractMapper3D';
|
|
5
6
|
import { ColorMode, GetArray, ScalarMode } from './Mapper/Constants';
|
|
6
|
-
import vtkDataArray from './../../Common/Core/DataArray';
|
|
7
|
-
import
|
|
7
|
+
import { vtkDataArray } from './../../Common/Core/DataArray';
|
|
8
|
+
import {
|
|
9
|
+
CoincidentTopologyHelper,
|
|
8
10
|
StaticCoincidentTopologyMethods,
|
|
9
11
|
} from './Mapper/CoincidentTopologyHelper';
|
|
10
12
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { vtkObject } from './../../interfaces';
|
|
2
|
-
import { RGBColor } from './../../types';
|
|
2
|
+
import { Nullable, RGBColor } from './../../types';
|
|
3
3
|
import { Interpolation, Representation, Shading } from './Property/Constants';
|
|
4
4
|
import { vtkTexture } from './Texture';
|
|
5
5
|
|
|
@@ -14,6 +14,8 @@ export interface IPropertyInitialValues {
|
|
|
14
14
|
normalTexture?: vtkTexture;
|
|
15
15
|
ambientOcclusionTexture?: vtkTexture;
|
|
16
16
|
emissionTexture?: vtkTexture;
|
|
17
|
+
RMTexture?: vtkTexture;
|
|
18
|
+
ORMTexture?: vtkTexture;
|
|
17
19
|
edgeColor?: RGBColor;
|
|
18
20
|
ambient?: number;
|
|
19
21
|
diffuse?: number;
|
|
@@ -216,32 +218,42 @@ export interface vtkProperty extends vtkObject {
|
|
|
216
218
|
/**
|
|
217
219
|
* Get the diffuse texture.
|
|
218
220
|
*/
|
|
219
|
-
getDiffuseTexture(): vtkTexture
|
|
221
|
+
getDiffuseTexture(): Nullable<vtkTexture>;
|
|
220
222
|
|
|
221
223
|
/**
|
|
222
224
|
* Get the metallic texture.
|
|
223
225
|
*/
|
|
224
|
-
getMetallicTexture(): vtkTexture
|
|
226
|
+
getMetallicTexture(): Nullable<vtkTexture>;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Get the roughness & metallic texture.
|
|
230
|
+
*/
|
|
231
|
+
getRMTexture(): Nullable<vtkTexture>;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Get the occlusion, roughness & metallic texture.
|
|
235
|
+
*/
|
|
236
|
+
getORMTexture(): Nullable<vtkTexture>;
|
|
225
237
|
|
|
226
238
|
/**
|
|
227
239
|
* Get the roughness texture.
|
|
228
240
|
*/
|
|
229
|
-
getRoughnessTexture(): vtkTexture
|
|
241
|
+
getRoughnessTexture(): Nullable<vtkTexture>;
|
|
230
242
|
|
|
231
243
|
/**
|
|
232
244
|
* Get the normal texture.
|
|
233
245
|
*/
|
|
234
|
-
getNormalTexture(): vtkTexture
|
|
246
|
+
getNormalTexture(): Nullable<vtkTexture>;
|
|
235
247
|
|
|
236
248
|
/**
|
|
237
249
|
* Get the ambient occlusion texture.
|
|
238
250
|
*/
|
|
239
|
-
getAmbientOcclusionTexture(): vtkTexture
|
|
251
|
+
getAmbientOcclusionTexture(): Nullable<vtkTexture>;
|
|
240
252
|
|
|
241
253
|
/**
|
|
242
254
|
* Get the emission texture.
|
|
243
255
|
*/
|
|
244
|
-
getEmissionTexture(): vtkTexture
|
|
256
|
+
getEmissionTexture(): Nullable<vtkTexture>;
|
|
245
257
|
|
|
246
258
|
/**
|
|
247
259
|
* Set the ambient lighting coefficient.
|
|
@@ -500,6 +512,18 @@ export interface vtkProperty extends vtkObject {
|
|
|
500
512
|
*/
|
|
501
513
|
setRoughnessTexture(roughnessTexture: vtkTexture): boolean;
|
|
502
514
|
|
|
515
|
+
/**
|
|
516
|
+
* Set the roughness & metallic texture.
|
|
517
|
+
* @param {vtkTexture} RMTexture
|
|
518
|
+
*/
|
|
519
|
+
setRMTexture(RMTexture: vtkTexture): boolean;
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Set the occlusion, roughness & metallic texture.
|
|
523
|
+
* @param {vtkTexture} ORMTexture
|
|
524
|
+
*/
|
|
525
|
+
setORMTexture(ORMTexture: vtkTexture): boolean;
|
|
526
|
+
|
|
503
527
|
/**
|
|
504
528
|
* Set the normal texture.
|
|
505
529
|
* @param {vtkTexture} normalTexture
|
|
@@ -94,7 +94,9 @@ const DEFAULT_VALUES = {
|
|
|
94
94
|
lineWidth: 1,
|
|
95
95
|
lighting: true,
|
|
96
96
|
shading: false,
|
|
97
|
-
materialName: null
|
|
97
|
+
materialName: null,
|
|
98
|
+
ORMTexture: null,
|
|
99
|
+
RMTexture: null
|
|
98
100
|
};
|
|
99
101
|
|
|
100
102
|
// ----------------------------------------------------------------------------
|
|
@@ -105,7 +107,7 @@ function extend(publicAPI, model) {
|
|
|
105
107
|
|
|
106
108
|
// Build VTK API
|
|
107
109
|
macro.obj(publicAPI, model);
|
|
108
|
-
macro.setGet(publicAPI, model, ['lighting', 'interpolation', 'ambient', 'diffuse', 'metallic', 'roughness', 'normalStrength', 'emission', 'baseIOR', 'specular', 'specularPower', 'opacity', 'edgeVisibility', 'lineWidth', 'pointSize', 'backfaceCulling', 'frontfaceCulling', 'representation', 'diffuseTexture', 'metallicTexture', 'roughnessTexture', 'normalTexture', 'ambientOcclusionTexture', 'emissionTexture']);
|
|
110
|
+
macro.setGet(publicAPI, model, ['lighting', 'interpolation', 'ambient', 'diffuse', 'metallic', 'roughness', 'normalStrength', 'emission', 'baseIOR', 'specular', 'specularPower', 'opacity', 'edgeVisibility', 'lineWidth', 'pointSize', 'backfaceCulling', 'frontfaceCulling', 'representation', 'diffuseTexture', 'metallicTexture', 'roughnessTexture', 'normalTexture', 'ambientOcclusionTexture', 'emissionTexture', 'ORMTexture', 'RMTexture']);
|
|
109
111
|
macro.setGetArray(publicAPI, model, ['ambientColor', 'specularColor', 'diffuseColor', 'edgeColor'], 3);
|
|
110
112
|
|
|
111
113
|
// Object methods
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import vtkPiecewiseFunction from './../../Common/DataModel/PiecewiseFunction';
|
|
1
|
+
import { vtkPiecewiseFunction } from './../../Common/DataModel/PiecewiseFunction';
|
|
2
2
|
import { Bounds, Range, Extent } from './../../types';
|
|
3
|
-
import
|
|
3
|
+
import {
|
|
4
|
+
vtkAbstractMapper3D,
|
|
4
5
|
IAbstractMapper3DInitialValues,
|
|
5
6
|
} from './AbstractMapper3D';
|
|
6
7
|
import { BlendMode, FilterMode } from './VolumeMapper/Constants';
|
|
@@ -42,13 +42,14 @@ function vtkWebGPUBuffer(publicAPI, model) {
|
|
|
42
42
|
bufferSubData(model.device.getHandle(), model.handle, 0, data.buffer);
|
|
43
43
|
};
|
|
44
44
|
publicAPI.createAndWrite = (data, usage) => {
|
|
45
|
+
const paddedSize = Math.ceil(data.byteLength / 4) * 4;
|
|
45
46
|
model.handle = model.device.getHandle().createBuffer({
|
|
46
|
-
size:
|
|
47
|
+
size: paddedSize,
|
|
47
48
|
usage,
|
|
48
49
|
mappedAtCreation: true,
|
|
49
50
|
label: model.label
|
|
50
51
|
});
|
|
51
|
-
model.sizeInBytes =
|
|
52
|
+
model.sizeInBytes = paddedSize;
|
|
52
53
|
model.usage = usage;
|
|
53
54
|
new Uint8Array(model.handle.getMappedRange()).set(new Uint8Array(data.buffer)); // memcpy
|
|
54
55
|
model.handle.unmap();
|
|
@@ -595,44 +595,65 @@ function vtkWebGPUCellArrayMapper(publicAPI, model) {
|
|
|
595
595
|
const fDesc = pipeline.getShaderDescription('fragment');
|
|
596
596
|
code = fDesc.getCode();
|
|
597
597
|
const actor = model.WebGPUActor.getRenderable();
|
|
598
|
+
const property = actor.getProperty();
|
|
598
599
|
const checkDims = texture => {
|
|
599
600
|
if (!texture) return false;
|
|
600
601
|
const dims = texture.getDimensionality();
|
|
601
602
|
return dims === numComp;
|
|
602
603
|
};
|
|
603
604
|
const usedTextures = [];
|
|
604
|
-
|
|
605
|
+
const diffuseTexture = property.getDiffuseTexture?.();
|
|
606
|
+
if (diffuseTexture?.getImageLoaded() || actor.getTextures()[0] || model.colorTexture) {
|
|
605
607
|
if (
|
|
606
608
|
// Chained or statements here are questionable
|
|
607
|
-
checkDims(
|
|
609
|
+
checkDims(diffuseTexture) || checkDims(actor.getTextures()[0]) || checkDims(model.colorTexture)) {
|
|
608
610
|
usedTextures.push('_diffuseMap = textureSample(DiffuseTexture, DiffuseTextureSampler, input.tcoordVS);');
|
|
609
611
|
}
|
|
610
612
|
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
613
|
+
const ormTexture = property.getORMTexture?.();
|
|
614
|
+
const rmTexture = property.getRMTexture?.();
|
|
615
|
+
const roughnessTexture = property.getRoughnessTexture?.();
|
|
616
|
+
const metallicTexture = property.getMetallicTexture?.();
|
|
617
|
+
const ambientOcclusionTexture = property.getAmbientOcclusionTexture?.();
|
|
618
|
+
const emissionTexture = property.getEmissionTexture?.();
|
|
619
|
+
const normalTexture = property.getNormalTexture?.();
|
|
620
|
+
|
|
621
|
+
// ORM texture support: if present, sample R/G/B for AO/Roughness/Metallic
|
|
622
|
+
if (ormTexture?.getImageLoaded()) {
|
|
623
|
+
if (checkDims(ormTexture)) {
|
|
624
|
+
usedTextures.push('_ambientOcclusionMap = textureSample(ORMTexture, ORMTextureSampler, input.tcoordVS).rrra;', '_roughnessMap = textureSample(ORMTexture, ORMTextureSampler, input.tcoordVS).ggga;', '_metallicMap = textureSample(ORMTexture, ORMTextureSampler, input.tcoordVS).bbba;');
|
|
614
625
|
}
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
usedTextures.push('_metallicMap = textureSample(MetallicTexture, MetallicTextureSampler, input.tcoordVS);');
|
|
626
|
+
} else if (rmTexture?.getImageLoaded()) {
|
|
627
|
+
if (checkDims(rmTexture)) {
|
|
628
|
+
usedTextures.push('_roughnessMap = textureSample(RMTexture, RMTextureSampler, input.tcoordVS).ggga;', '_metallicMap = textureSample(RMTexture, RMTextureSampler, input.tcoordVS).bbba;');
|
|
619
629
|
}
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
630
|
+
} else {
|
|
631
|
+
if (roughnessTexture?.getImageLoaded()) {
|
|
632
|
+
if (checkDims(roughnessTexture)) {
|
|
633
|
+
usedTextures.push('_roughnessMap = textureSample(RoughnessTexture, RoughnessTextureSampler, input.tcoordVS);');
|
|
634
|
+
}
|
|
624
635
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
636
|
+
if (metallicTexture?.getImageLoaded()) {
|
|
637
|
+
if (checkDims(metallicTexture)) {
|
|
638
|
+
usedTextures.push('_metallicMap = textureSample(MetallicTexture, MetallicTextureSampler, input.tcoordVS);');
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
if (ambientOcclusionTexture?.getImageLoaded()) {
|
|
642
|
+
if (checkDims(ambientOcclusionTexture)) {
|
|
643
|
+
usedTextures.push('_ambientOcclusionMap = textureSample(AmbientOcclusionTexture, AmbientOcclusionTextureSampler, input.tcoordVS);');
|
|
644
|
+
}
|
|
629
645
|
}
|
|
630
646
|
}
|
|
631
|
-
if (
|
|
632
|
-
if (checkDims(
|
|
647
|
+
if (emissionTexture?.getImageLoaded()) {
|
|
648
|
+
if (checkDims(emissionTexture)) {
|
|
633
649
|
usedTextures.push('_emissionMap = textureSample(EmissionTexture, EmissionTextureSampler, input.tcoordVS);');
|
|
634
650
|
}
|
|
635
651
|
}
|
|
652
|
+
if (normalTexture?.getImageLoaded()) {
|
|
653
|
+
if (checkDims(normalTexture)) {
|
|
654
|
+
usedTextures.push('_normalMap = textureSample(NormalTexture, NormalTextureSampler, input.tcoordVS);');
|
|
655
|
+
}
|
|
656
|
+
}
|
|
636
657
|
code = vtkWebGPUShaderCache.substitute(code, '//VTK::TCoord::Impl', usedTextures).result;
|
|
637
658
|
fDesc.setCode(code);
|
|
638
659
|
};
|
|
@@ -863,6 +884,14 @@ function vtkWebGPUCellArrayMapper(publicAPI, model) {
|
|
|
863
884
|
const pair = ['Diffuse', model.colorTexture];
|
|
864
885
|
textures.push(pair);
|
|
865
886
|
}
|
|
887
|
+
if (actor.getProperty().getORMTexture?.()) {
|
|
888
|
+
const pair = ['ORM', actor.getProperty().getORMTexture()];
|
|
889
|
+
textures.push(pair);
|
|
890
|
+
}
|
|
891
|
+
if (actor.getProperty().getRMTexture?.()) {
|
|
892
|
+
const pair = ['RM', actor.getProperty().getRMTexture()];
|
|
893
|
+
textures.push(pair);
|
|
894
|
+
}
|
|
866
895
|
if (actor.getProperty().getRoughnessTexture?.()) {
|
|
867
896
|
const pair = ['Roughness', actor.getProperty().getRoughnessTexture()];
|
|
868
897
|
textures.push(pair);
|
|
@@ -156,7 +156,7 @@ function vtkWebGPUOrderIndependentTranslucentPass(publicAPI, model) {
|
|
|
156
156
|
dstFactor: 'one'
|
|
157
157
|
},
|
|
158
158
|
alpha: {
|
|
159
|
-
|
|
159
|
+
srcFactor: 'one',
|
|
160
160
|
dstFactor: 'one'
|
|
161
161
|
}
|
|
162
162
|
}
|
|
@@ -168,7 +168,7 @@ function vtkWebGPUOrderIndependentTranslucentPass(publicAPI, model) {
|
|
|
168
168
|
dstFactor: 'one-minus-src'
|
|
169
169
|
},
|
|
170
170
|
alpha: {
|
|
171
|
-
|
|
171
|
+
srcFactor: 'one',
|
|
172
172
|
dstFactor: 'one-minus-src-alpha'
|
|
173
173
|
}
|
|
174
174
|
}
|
|
@@ -209,7 +209,7 @@ function vtkWebGPUOrderIndependentTranslucentPass(publicAPI, model) {
|
|
|
209
209
|
dstFactor: 'one-minus-src-alpha'
|
|
210
210
|
},
|
|
211
211
|
alpha: {
|
|
212
|
-
|
|
212
|
+
srcFactor: 'one',
|
|
213
213
|
dstFactor: 'one-minus-src-alpha'
|
|
214
214
|
}
|
|
215
215
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as newInstance$1 } from '../../macros2.js';
|
|
1
|
+
import { n as newInstance$1, r as vtkErrorMacro } from '../../macros2.js';
|
|
2
2
|
import vtkWebGPUBufferManager from './BufferManager.js';
|
|
3
3
|
import vtkWebGPUCellArrayMapper from './CellArrayMapper.js';
|
|
4
4
|
import vtkViewNode from '../SceneGraph/ViewNode.js';
|
|
@@ -28,6 +28,10 @@ function vtkWebGPUPolyDataMapper(publicAPI, model) {
|
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
publicAPI.updateCellArrayMappers = poly => {
|
|
31
|
+
if (!poly) {
|
|
32
|
+
vtkErrorMacro('No input!');
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
31
35
|
const prims = [poly.getVerts(), poly.getLines(), poly.getPolys(), poly.getStrips()];
|
|
32
36
|
|
|
33
37
|
// we instantiate a cell array mapper for each cellArray that has cells
|
|
@@ -424,7 +424,7 @@ function vtkWebGPUVolumePass(publicAPI, model) {
|
|
|
424
424
|
operation: 'max'
|
|
425
425
|
},
|
|
426
426
|
alpha: {
|
|
427
|
-
|
|
427
|
+
srcFactor: 'one',
|
|
428
428
|
dstFactor: 'one',
|
|
429
429
|
operation: 'max'
|
|
430
430
|
}
|
|
@@ -438,7 +438,7 @@ function vtkWebGPUVolumePass(publicAPI, model) {
|
|
|
438
438
|
operation: 'min'
|
|
439
439
|
},
|
|
440
440
|
alpha: {
|
|
441
|
-
|
|
441
|
+
srcFactor: 'one',
|
|
442
442
|
dstFactor: 'one',
|
|
443
443
|
operation: 'min'
|
|
444
444
|
}
|
|
@@ -516,7 +516,7 @@ function vtkWebGPUVolumePass(publicAPI, model) {
|
|
|
516
516
|
dstFactor: 'one-minus-src-alpha'
|
|
517
517
|
},
|
|
518
518
|
alpha: {
|
|
519
|
-
|
|
519
|
+
srcFactor: 'one',
|
|
520
520
|
dstFactor: 'one-minus-src-alpha'
|
|
521
521
|
}
|
|
522
522
|
}
|
|
@@ -549,7 +549,7 @@ function vtkWebGPUVolumePass(publicAPI, model) {
|
|
|
549
549
|
dstFactor: 'one-minus-src-alpha'
|
|
550
550
|
},
|
|
551
551
|
alpha: {
|
|
552
|
-
|
|
552
|
+
srcFactor: 'one',
|
|
553
553
|
dstFactor: 'one-minus-src-alpha'
|
|
554
554
|
}
|
|
555
555
|
}
|
|
@@ -590,7 +590,7 @@ function vtkWebGPUVolumePass(publicAPI, model) {
|
|
|
590
590
|
dstFactor: 'one-minus-src-alpha'
|
|
591
591
|
},
|
|
592
592
|
alpha: {
|
|
593
|
-
|
|
593
|
+
srcFactor: 'one',
|
|
594
594
|
dstFactor: 'one-minus-src-alpha'
|
|
595
595
|
}
|
|
596
596
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import vtkInteractorObserver from './../../Rendering/Core/InteractorObserver';
|
|
2
|
-
import vtkProp from './../../Rendering/Core/Prop';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import vtkWidgetState from './WidgetState';
|
|
1
|
+
import { vtkInteractorObserver } from './../../Rendering/Core/InteractorObserver';
|
|
2
|
+
import { vtkProp } from './../../Rendering/Core/Prop';
|
|
3
|
+
import { vtkWidgetManager } from './WidgetManager';
|
|
4
|
+
import { vtkWidgetRepresentation } from './../Representations/WidgetRepresentation';
|
|
5
|
+
import { vtkWidgetState } from './WidgetState';
|
|
7
6
|
import { Bounds } from './../../types';
|
|
8
7
|
import { RenderingTypes } from './WidgetManager/Constants';
|
|
9
8
|
import { EventHandler, vtkSubscription } from './../../interfaces';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Nullable } from '../../../types';
|
|
2
2
|
import { InteractionMethodsName, lineNames } from './Constants';
|
|
3
|
-
import vtkAbstractWidget from '../../Core/AbstractWidget';
|
|
3
|
+
import { vtkAbstractWidget } from '../../Core/AbstractWidget';
|
|
4
4
|
|
|
5
5
|
type TLineName = typeof lineNames[number];
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ type TCursorStyles = {
|
|
|
10
10
|
default?: string;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export
|
|
13
|
+
export interface vtkResliceCursorWidgetDefaultInstance
|
|
14
14
|
extends vtkAbstractWidget {
|
|
15
15
|
getActiveInteraction(): Nullable<InteractionMethodsName>;
|
|
16
16
|
|
|
@@ -31,3 +31,6 @@ export default interface vtkResliceCursorWidgetDefaultInstance
|
|
|
31
31
|
|
|
32
32
|
getActiveLineName(): TLineName | undefined;
|
|
33
33
|
}
|
|
34
|
+
|
|
35
|
+
declare const _default: vtkResliceCursorWidgetDefaultInstance;
|
|
36
|
+
export default _default;
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
vtkAbstractWidgetFactory,
|
|
4
4
|
IAbstractWidgetFactoryInitialValues,
|
|
5
5
|
} from './../Core/AbstractWidgetFactory';
|
|
6
|
-
import vtkResliceCursorWidgetDefaultInstance from './ResliceCursorWidget/behavior';
|
|
7
|
-
import vtkAbstractWidget from './../Core/AbstractWidget';
|
|
8
|
-
import vtkImageData from './../../Common/DataModel/ImageData';
|
|
9
|
-
import vtkImageReslice from './../../Imaging/Core/ImageReslice';
|
|
10
|
-
import vtkPlaneSource from './../../Filters/Sources/PlaneSource';
|
|
11
|
-
import vtkRenderer from './../../Rendering/Core/Renderer';
|
|
12
|
-
import vtkPlaneManipulator from './../Manipulators/PlaneManipulator';
|
|
6
|
+
import { vtkResliceCursorWidgetDefaultInstance } from './ResliceCursorWidget/behavior';
|
|
7
|
+
import { vtkAbstractWidget } from './../Core/AbstractWidget';
|
|
8
|
+
import { vtkImageData } from './../../Common/DataModel/ImageData';
|
|
9
|
+
import { vtkImageReslice } from './../../Imaging/Core/ImageReslice';
|
|
10
|
+
import { vtkPlaneSource } from './../../Filters/Sources/PlaneSource';
|
|
11
|
+
import { vtkRenderer } from './../../Rendering/Core/Renderer';
|
|
12
|
+
import { vtkPlaneManipulator } from './../Manipulators/PlaneManipulator';
|
|
13
13
|
import { ViewTypes } from './../Core/WidgetManager/Constants';
|
|
14
14
|
import { Vector2, Vector3 } from './../../types';
|
|
15
15
|
import { IDisplayScaleParams } from './../Core/WidgetManager';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitware/vtk.js",
|
|
3
|
-
"version": "33.
|
|
3
|
+
"version": "33.2.0",
|
|
4
4
|
"description": "Visualization Toolkit for the Web",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"3d",
|
|
@@ -120,6 +120,7 @@
|
|
|
120
120
|
"string-replace-loader": "3.1.0",
|
|
121
121
|
"style-loader": "3.3.1",
|
|
122
122
|
"tape": "5.5.3",
|
|
123
|
+
"typescript": "^5.8.3",
|
|
123
124
|
"webpack": "5.97.1",
|
|
124
125
|
"webpack-bundle-analyzer": "4.5.0",
|
|
125
126
|
"webpack-cli": "4.9.2",
|
|
@@ -141,6 +142,7 @@
|
|
|
141
142
|
"reformat-only": "prettier --single-quote --trailing-comma es5 --print-width 80 --arrow-parens always --write",
|
|
142
143
|
"lint-fix": "eslint --fix Sources Examples",
|
|
143
144
|
"lint": "eslint Sources Examples",
|
|
145
|
+
"typecheck": "tsc --noEmit",
|
|
144
146
|
"doc": "npm run build:pre && kw-doc -c ./Documentation/config.js",
|
|
145
147
|
"doc:www": "npm t -- --single-run && npm run build:pre && kw-doc -c ./Documentation/config.js -s",
|
|
146
148
|
"doc:minified": "npm run build:pre && kw-doc -c ./Documentation/config.js -m",
|