@kitware/vtk.js 25.5.0 → 25.7.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 +20 -8
- package/Common/Core/CellArray.js +25 -6
- package/Common/Core/DataArray.d.ts +159 -15
- package/Common/Core/DataArray.js +181 -26
- package/Common/Core/Math/index.js +1 -1
- package/Common/Core/Math.js +1 -1
- package/Common/Core/Points.d.ts +6 -5
- package/Common/Core/Points.js +8 -4
- package/Common/DataModel/AbstractPointLocator.d.ts +54 -0
- package/Common/DataModel/AbstractPointLocator.js +40 -0
- package/Common/DataModel/DataSetAttributes/FieldData.d.ts +33 -22
- package/Common/DataModel/DataSetAttributes/FieldData.js +91 -9
- package/Common/DataModel/DataSetAttributes.d.ts +44 -0
- package/Common/DataModel/DataSetAttributes.js +11 -0
- package/Common/DataModel/IncrementalOctreeNode.d.ts +282 -0
- package/Common/DataModel/IncrementalOctreeNode.js +621 -0
- package/Common/DataModel/IncrementalOctreePointLocator.d.ts +61 -0
- package/Common/DataModel/IncrementalOctreePointLocator.js +342 -0
- package/Common/DataModel/Line.js +1 -1
- package/Common/DataModel/Locator.d.ts +43 -0
- package/Common/DataModel/Locator.js +37 -0
- package/Common/DataModel/Plane.js +1 -1
- package/Common/DataModel/Polygon/Constants.js +12 -0
- package/Common/DataModel/Polygon.d.ts +38 -4
- package/Common/DataModel/Polygon.js +210 -6
- package/Common/DataModel/Quad/Constants.js +9 -0
- package/Common/DataModel/Quad.d.ts +91 -0
- package/Common/DataModel/Quad.js +235 -0
- package/Common/DataModel/Triangle.d.ts +106 -81
- package/Common/DataModel/Triangle.js +1 -1
- package/Common/Transform/LandmarkTransform.js +1 -1
- package/Filters/Core/PolyDataNormals.js +1 -1
- package/Filters/General/ClipClosedSurface/Constants.js +10 -0
- package/Filters/General/ClipClosedSurface/ccsEdgeLocator.js +40 -0
- package/Filters/General/ClipClosedSurface.d.ts +95 -0
- package/Filters/General/ClipClosedSurface.js +971 -0
- package/Filters/General/ContourTriangulator/Constants.js +6 -0
- package/Filters/General/ContourTriangulator/helper.js +1951 -0
- package/Filters/General/ContourTriangulator.d.ts +122 -0
- package/Filters/General/ContourTriangulator.js +200 -0
- package/Filters/General/ImageMarchingCubes.js +1 -1
- package/Filters/General/MoleculeToRepresentation.js +1 -1
- package/Filters/General/OBBTree.js +1 -1
- package/Filters/General/TubeFilter.js +1 -1
- package/Filters/General/WindowedSincPolyDataFilter.js +1 -1
- package/Filters/Sources/PlaneSource.js +1 -1
- package/Filters/Texture/TextureMapToPlane.js +1 -1
- package/Interaction/Manipulators/KeyboardCameraManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraAxisRotateManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
- package/Interaction/Style/InteractorStyleMPRSlice.js +1 -1
- package/Proxy/Core/View2DProxy.js +1 -1
- package/Rendering/Core/Actor2D.d.ts +12 -6
- package/Rendering/Core/Camera.js +1 -1
- package/Rendering/Core/CellPicker.js +3 -2
- package/Rendering/Core/ColorTransferFunction/ColorMaps.d.ts +24 -0
- package/Rendering/Core/Light.js +1 -1
- package/Rendering/Core/Picker.js +1 -1
- package/Rendering/Core/Property2D.d.ts +1 -1
- package/Rendering/Core/VolumeProperty.d.ts +4 -4
- package/Rendering/Core/VolumeProperty.js +1 -1
- package/Rendering/OpenGL/PolyDataMapper.js +1 -1
- package/Rendering/WebGPU/BufferManager.js +1 -1
- package/Rendering/WebGPU/ForwardPass.js +93 -15
- package/Rendering/WebGPU/OpaquePass.js +1 -1
- package/Rendering/WebGPU/OrderIndependentTranslucentPass.js +1 -1
- package/Rendering/WebGPU/RenderEncoder.js +9 -5
- package/Rendering/WebGPU/RenderWindow.js +15 -13
- package/Rendering/WebGPU/TextureView.js +15 -2
- package/Rendering/WebGPU/VolumePass.js +1 -1
- package/Widgets/Core/StateBuilder/orientationMixin.js +1 -1
- package/Widgets/Manipulators/LineManipulator.js +1 -1
- package/Widgets/Manipulators/TrackballManipulator.js +1 -1
- package/Widgets/Representations/ResliceCursorContextRepresentation.js +1 -1
- package/Widgets/Widgets3D/LineWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/LineWidget/helpers.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -1
- package/Widgets/Widgets3D/ShapeWidget/behavior.js +1 -1
- package/index.d.ts +8 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { mat3, mat4, vec3 } from 'gl-matrix';
|
|
|
3
3
|
import { newInstance as newInstance$1, setGet, obj, vtkErrorMacro as vtkErrorMacro$1 } from '../../macros.js';
|
|
4
4
|
import vtkHelper from './Helper.js';
|
|
5
5
|
import vtkMapper from '../Core/Mapper.js';
|
|
6
|
-
import {
|
|
6
|
+
import { m as normalize, u as uninitializeBounds } from '../../Common/Core/Math/index.js';
|
|
7
7
|
import vtkOpenGLTexture from './Texture.js';
|
|
8
8
|
import vtkProp from '../Core/Prop.js';
|
|
9
9
|
import vtkProperty from '../Core/Property.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import { newInstance as newInstance$1, obj, setGet, vtkErrorMacro as vtkErrorMacro$1, newTypedArray } from '../../macros.js';
|
|
3
|
-
import {
|
|
3
|
+
import { k as cross, m as normalize } from '../../Common/Core/Math/index.js';
|
|
4
4
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
5
5
|
import vtkWebGPUBuffer from './Buffer.js';
|
|
6
6
|
import vtkWebGPUIndexBuffer from './IndexBuffer.js';
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
|
+
import vtkWebGPUFullScreenQuad from './FullScreenQuad.js';
|
|
2
3
|
import vtkWebGPUOpaquePass from './OpaquePass.js';
|
|
3
4
|
import vtkWebGPUOrderIndepenentTranslucentPass from './OrderIndependentTranslucentPass.js';
|
|
5
|
+
import vtkWebGPURenderEncoder from './RenderEncoder.js';
|
|
4
6
|
import vtkWebGPUVolumePass from './VolumePass.js';
|
|
5
7
|
import vtkRenderPass from '../SceneGraph/RenderPass.js';
|
|
8
|
+
import vtkWebGPUSampler from './Sampler.js';
|
|
9
|
+
import vtkWebGPUTextureView from './TextureView.js';
|
|
10
|
+
|
|
11
|
+
var finalBlitFragTemplate = "\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n@fragment\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n var computedColor: vec4<f32> = clamp(textureSampleLevel(opaquePassColorTexture, finalPassSampler, input.tcoordVS, 0),vec4<f32>(0.0),vec4<f32>(1.0));\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n"; // ----------------------------------------------------------------------------
|
|
6
12
|
|
|
7
13
|
function vtkForwardPass(publicAPI, model) {
|
|
8
14
|
// Set our className
|
|
@@ -69,24 +75,96 @@ function vtkForwardPass(publicAPI, model) {
|
|
|
69
75
|
model.volumePass.setDepthTextureView(model.opaquePass.getDepthTextureView());
|
|
70
76
|
model.volumePass.setVolumes(model.volumes);
|
|
71
77
|
model.volumePass.traverse(renNode, viewNode);
|
|
72
|
-
}
|
|
78
|
+
} // blit the result into the swap chain
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
publicAPI.finalPass(viewNode, renNode);
|
|
73
82
|
}
|
|
74
83
|
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
publicAPI.finalPass = function (viewNode, renNode) {
|
|
88
|
+
if (!model._finalBlitEncoder) {
|
|
89
|
+
publicAPI.createFinalBlitEncoder(viewNode);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
model._finalBlitOutputTextureView.createFromTextureHandle(viewNode.getCurrentTexture(), {
|
|
93
|
+
depth: 1,
|
|
94
|
+
format: viewNode.getPresentationFormat()
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
model._finalBlitEncoder.attachTextureViews();
|
|
98
|
+
|
|
99
|
+
model._finalBlitEncoder.begin(viewNode.getCommandEncoder());
|
|
100
|
+
|
|
101
|
+
renNode.scissorAndViewport(model._finalBlitEncoder);
|
|
102
|
+
|
|
103
|
+
model._fullScreenQuad.prepareAndDraw(model._finalBlitEncoder);
|
|
104
|
+
|
|
105
|
+
model._finalBlitEncoder.end();
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
publicAPI.createFinalBlitEncoder = function (viewNode) {
|
|
109
|
+
model._finalBlitEncoder = vtkWebGPURenderEncoder.newInstance({
|
|
110
|
+
label: 'forwardPassBlit'
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
model._finalBlitEncoder.setDescription({
|
|
114
|
+
colorAttachments: [{
|
|
115
|
+
view: null,
|
|
116
|
+
loadOp: 'load',
|
|
117
|
+
storeOp: 'store'
|
|
118
|
+
}]
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
model._finalBlitEncoder.setPipelineHash('fpf');
|
|
122
|
+
|
|
123
|
+
model._finalBlitEncoder.setPipelineSettings({
|
|
124
|
+
primitive: {
|
|
125
|
+
cullMode: 'none'
|
|
126
|
+
},
|
|
127
|
+
fragment: {
|
|
128
|
+
targets: [{
|
|
129
|
+
format: viewNode.getPresentationFormat(),
|
|
130
|
+
blend: {
|
|
131
|
+
color: {
|
|
132
|
+
srcFactor: 'src-alpha',
|
|
133
|
+
dstFactor: 'one-minus-src-alpha'
|
|
134
|
+
},
|
|
135
|
+
alpha: {
|
|
136
|
+
srcfactor: 'one',
|
|
137
|
+
dstFactor: 'one-minus-src-alpha'
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}]
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
model._fsqSampler = vtkWebGPUSampler.newInstance({
|
|
145
|
+
label: 'finalPassSampler'
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
model._fsqSampler.create(viewNode.getDevice(), {
|
|
149
|
+
minFilter: 'linear',
|
|
150
|
+
magFilter: 'linear'
|
|
89
151
|
});
|
|
152
|
+
|
|
153
|
+
model._fullScreenQuad = vtkWebGPUFullScreenQuad.newInstance();
|
|
154
|
+
|
|
155
|
+
model._fullScreenQuad.setDevice(viewNode.getDevice());
|
|
156
|
+
|
|
157
|
+
model._fullScreenQuad.setPipelineHash('fpfsq');
|
|
158
|
+
|
|
159
|
+
model._fullScreenQuad.setTextureViews([model.opaquePass.getColorTextureView()]);
|
|
160
|
+
|
|
161
|
+
model._fullScreenQuad.setAdditionalBindables([model._fsqSampler]);
|
|
162
|
+
|
|
163
|
+
model._fullScreenQuad.setFragmentShaderTemplate(finalBlitFragTemplate);
|
|
164
|
+
|
|
165
|
+
model._finalBlitOutputTextureView = vtkWebGPUTextureView.newInstance();
|
|
166
|
+
|
|
167
|
+
model._finalBlitEncoder.setColorTextureView(0, model._finalBlitOutputTextureView);
|
|
90
168
|
};
|
|
91
169
|
|
|
92
170
|
publicAPI.incrementOpaqueActorCount = function () {
|
|
@@ -51,9 +51,11 @@ function vtkWebGPURenderEncoder(publicAPI, model) {
|
|
|
51
51
|
console.trace();
|
|
52
52
|
} else {
|
|
53
53
|
for (var i = 0; i < model.colorTextureViews.length; i++) {
|
|
54
|
-
var
|
|
54
|
+
var _model$colorTextureVi;
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
var fmt = (_model$colorTextureVi = model.colorTextureViews[i].getTexture()) === null || _model$colorTextureVi === void 0 ? void 0 : _model$colorTextureVi.getFormat();
|
|
57
|
+
|
|
58
|
+
if (fmt && fmt !== pd.fragment.targets[i].format) {
|
|
57
59
|
console.log("mismatched attachments for attachment ".concat(i, " on pipeline ").concat(pd.fragment.targets[i].format, " while encoder has ").concat(fmt));
|
|
58
60
|
console.trace();
|
|
59
61
|
}
|
|
@@ -65,9 +67,11 @@ function vtkWebGPURenderEncoder(publicAPI, model) {
|
|
|
65
67
|
console.log('mismatched depth attachments');
|
|
66
68
|
console.trace();
|
|
67
69
|
} else if (model.depthTextureView) {
|
|
68
|
-
var
|
|
70
|
+
var _model$depthTextureVi;
|
|
71
|
+
|
|
72
|
+
var dfmt = (_model$depthTextureVi = model.depthTextureView.getTexture()) === null || _model$depthTextureVi === void 0 ? void 0 : _model$depthTextureVi.getFormat();
|
|
69
73
|
|
|
70
|
-
if (dfmt !== pd.depthStencil.format) {
|
|
74
|
+
if (dfmt && dfmt !== pd.depthStencil.format) {
|
|
71
75
|
console.log("mismatched depth attachments on pipeline ".concat(pd.depthStencil.format, " while encoder has ").concat(dfmt));
|
|
72
76
|
console.trace();
|
|
73
77
|
}
|
|
@@ -202,7 +206,7 @@ function extend(publicAPI, model) {
|
|
|
202
206
|
},
|
|
203
207
|
fragment: {
|
|
204
208
|
targets: [{
|
|
205
|
-
format: '
|
|
209
|
+
format: 'rgba16float',
|
|
206
210
|
blend: {
|
|
207
211
|
color: {
|
|
208
212
|
srcFactor: 'src-alpha',
|
|
@@ -9,6 +9,7 @@ import vtkWebGPUHardwareSelector from './HardwareSelector.js';
|
|
|
9
9
|
import vtkWebGPUViewNodeFactory from './ViewNodeFactory.js';
|
|
10
10
|
import vtkRenderPass from '../SceneGraph/RenderPass.js';
|
|
11
11
|
import vtkRenderWindowViewNode from '../SceneGraph/RenderWindowViewNode.js';
|
|
12
|
+
import HalfFloat from '../../Common/Core/HalfFloat.js';
|
|
12
13
|
|
|
13
14
|
var vtkErrorMacro = macro.vtkErrorMacro; // const IS_CHROME = navigator.userAgent.indexOf('Chrome') !== -1;
|
|
14
15
|
|
|
@@ -67,14 +68,14 @@ function vtkWebGPURenderWindow(publicAPI, model) {
|
|
|
67
68
|
publicAPI.recreateSwapChain = function () {
|
|
68
69
|
if (model.context) {
|
|
69
70
|
model.context.unconfigure();
|
|
70
|
-
|
|
71
|
+
model.presentationFormat = navigator.gpu.getPreferredCanvasFormat(model.adapter);
|
|
71
72
|
/* eslint-disable no-undef */
|
|
72
73
|
|
|
73
74
|
/* eslint-disable no-bitwise */
|
|
74
75
|
|
|
75
76
|
model.context.configure({
|
|
76
77
|
device: model.device.getHandle(),
|
|
77
|
-
format: presentationFormat,
|
|
78
|
+
format: model.presentationFormat,
|
|
78
79
|
alphaMode: 'premultiplied',
|
|
79
80
|
usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_DST,
|
|
80
81
|
width: model.size[0],
|
|
@@ -545,10 +546,10 @@ function vtkWebGPURenderWindow(publicAPI, model) {
|
|
|
545
546
|
result = {
|
|
546
547
|
width: texture.getWidth(),
|
|
547
548
|
height: texture.getHeight()
|
|
548
|
-
}; // must be a multiple of 256 bytes, so
|
|
549
|
+
}; // must be a multiple of 256 bytes, so 32 texels with rgba16
|
|
549
550
|
|
|
550
|
-
result.colorBufferWidth =
|
|
551
|
-
result.colorBufferSizeInBytes = result.colorBufferWidth * result.height *
|
|
551
|
+
result.colorBufferWidth = 32 * Math.floor((result.width + 31) / 32);
|
|
552
|
+
result.colorBufferSizeInBytes = result.colorBufferWidth * result.height * 8;
|
|
552
553
|
colorBuffer = vtkWebGPUBuffer.newInstance();
|
|
553
554
|
colorBuffer.setDevice(device);
|
|
554
555
|
/* eslint-disable no-bitwise */
|
|
@@ -565,7 +566,7 @@ function vtkWebGPURenderWindow(publicAPI, model) {
|
|
|
565
566
|
texture: texture.getHandle()
|
|
566
567
|
}, {
|
|
567
568
|
buffer: colorBuffer.getHandle(),
|
|
568
|
-
bytesPerRow:
|
|
569
|
+
bytesPerRow: 8 * result.colorBufferWidth,
|
|
569
570
|
rowsPerImage: result.height
|
|
570
571
|
}, {
|
|
571
572
|
width: result.width,
|
|
@@ -581,7 +582,7 @@ function vtkWebGPURenderWindow(publicAPI, model) {
|
|
|
581
582
|
|
|
582
583
|
case 14:
|
|
583
584
|
/* eslint-enable no-undef */
|
|
584
|
-
result.colorValues = new
|
|
585
|
+
result.colorValues = new Uint16Array(colorBuffer.getMappedRange().slice());
|
|
585
586
|
colorBuffer.unmap(); // repack the array
|
|
586
587
|
|
|
587
588
|
tmparray = new Uint8ClampedArray(result.height * result.width * 4);
|
|
@@ -590,10 +591,10 @@ function vtkWebGPURenderWindow(publicAPI, model) {
|
|
|
590
591
|
for (x = 0; x < result.width; x++) {
|
|
591
592
|
doffset = (y * result.width + x) * 4;
|
|
592
593
|
soffset = (y * result.colorBufferWidth + x) * 4;
|
|
593
|
-
tmparray[doffset] = result.colorValues[soffset
|
|
594
|
-
tmparray[doffset + 1] = result.colorValues[soffset + 1];
|
|
595
|
-
tmparray[doffset + 2] = result.colorValues[soffset];
|
|
596
|
-
tmparray[doffset + 3] = result.colorValues[soffset + 3];
|
|
594
|
+
tmparray[doffset] = 255.0 * HalfFloat.fromHalf(result.colorValues[soffset]);
|
|
595
|
+
tmparray[doffset + 1] = 255.0 * HalfFloat.fromHalf(result.colorValues[soffset + 1]);
|
|
596
|
+
tmparray[doffset + 2] = 255.0 * HalfFloat.fromHalf(result.colorValues[soffset + 2]);
|
|
597
|
+
tmparray[doffset + 3] = 255.0 * HalfFloat.fromHalf(result.colorValues[soffset + 3]);
|
|
597
598
|
}
|
|
598
599
|
}
|
|
599
600
|
|
|
@@ -635,7 +636,8 @@ var DEFAULT_VALUES = {
|
|
|
635
636
|
useOffScreen: false,
|
|
636
637
|
useBackgroundImage: false,
|
|
637
638
|
nextPropID: 1,
|
|
638
|
-
xrSupported: false
|
|
639
|
+
xrSupported: false,
|
|
640
|
+
presentationFormat: null
|
|
639
641
|
}; // ----------------------------------------------------------------------------
|
|
640
642
|
|
|
641
643
|
function extend(publicAPI, model) {
|
|
@@ -671,7 +673,7 @@ function extend(publicAPI, model) {
|
|
|
671
673
|
macro.event(publicAPI, model, 'imageReady');
|
|
672
674
|
macro.event(publicAPI, model, 'initialized'); // Build VTK API
|
|
673
675
|
|
|
674
|
-
macro.get(publicAPI, model, ['commandEncoder', 'device', 'useBackgroundImage', 'xrSupported']);
|
|
676
|
+
macro.get(publicAPI, model, ['commandEncoder', 'device', 'presentationFormat', 'useBackgroundImage', 'xrSupported']);
|
|
675
677
|
macro.setGet(publicAPI, model, ['initialized', 'context', 'canvas', 'device', 'renderPasses', 'notifyStartCaptureImage', 'cursor', 'useOffScreen']);
|
|
676
678
|
macro.setGetArray(publicAPI, model, ['size'], 2); // Object methods
|
|
677
679
|
|
|
@@ -23,6 +23,19 @@ function vtkWebGPUTextureView(publicAPI, model) {
|
|
|
23
23
|
model.bindGroupLayoutEntry.texture.sampleType = tDetails.sampleType;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
+
publicAPI.createFromTextureHandle = function (textureHandle, options) {
|
|
27
|
+
model.texture = null;
|
|
28
|
+
model.options = options;
|
|
29
|
+
model.options.dimension = model.options.dimension || '2d';
|
|
30
|
+
model.options.label = model.label;
|
|
31
|
+
model.textureHandle = textureHandle;
|
|
32
|
+
model.handle = model.textureHandle.createView(model.options);
|
|
33
|
+
model.bindGroupLayoutEntry.texture.viewDimension = model.options.dimension;
|
|
34
|
+
var tDetails = vtkWebGPUTypes.getDetailsFromTextureFormat(options.format);
|
|
35
|
+
model.bindGroupLayoutEntry.texture.sampleType = tDetails.sampleType;
|
|
36
|
+
model.bindGroupTime.modified();
|
|
37
|
+
};
|
|
38
|
+
|
|
26
39
|
publicAPI.getBindGroupEntry = function () {
|
|
27
40
|
var foo = {
|
|
28
41
|
resource: publicAPI.getHandle()
|
|
@@ -58,7 +71,7 @@ function vtkWebGPUTextureView(publicAPI, model) {
|
|
|
58
71
|
|
|
59
72
|
publicAPI.getBindGroupTime = function () {
|
|
60
73
|
// check if the handle changed
|
|
61
|
-
if (model.texture.getHandle() !== model.textureHandle) {
|
|
74
|
+
if (model.texture && model.texture.getHandle() !== model.textureHandle) {
|
|
62
75
|
model.textureHandle = model.texture.getHandle();
|
|
63
76
|
model.handle = model.textureHandle.createView(model.options);
|
|
64
77
|
model.bindGroupTime.modified();
|
|
@@ -69,7 +82,7 @@ function vtkWebGPUTextureView(publicAPI, model) {
|
|
|
69
82
|
|
|
70
83
|
|
|
71
84
|
publicAPI.getHandle = function () {
|
|
72
|
-
if (model.texture.getHandle() !== model.textureHandle) {
|
|
85
|
+
if (model.texture && model.texture.getHandle() !== model.textureHandle) {
|
|
73
86
|
model.textureHandle = model.texture.getHandle();
|
|
74
87
|
model.handle = model.textureHandle.createView(model.options);
|
|
75
88
|
model.bindGroupTime.modified();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import macro from '../../../macros.js';
|
|
2
|
-
import {
|
|
2
|
+
import { m as normalize, k as cross } from '../../../Common/Core/Math/index.js';
|
|
3
3
|
|
|
4
4
|
function eq(v1, v2) {
|
|
5
5
|
return v1.length === 3 && v2.length === 3 && v1[0] === v2[0] && v1[1] === v2[1] && v1[2] === v2[2];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
|
-
import { s as subtract,
|
|
3
|
+
import { s as subtract, k as cross, d as dot, x as multiplyScalar, l as add } from '../../Common/Core/Math/index.js';
|
|
4
4
|
import vtkAbstractManipulator from './AbstractManipulator.js';
|
|
5
5
|
|
|
6
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import { mat4, vec3 } from 'gl-matrix';
|
|
3
3
|
import macro from '../../macros.js';
|
|
4
|
-
import {
|
|
4
|
+
import { k as cross, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import vtkAbstractManipulator from './AbstractManipulator.js';
|
|
6
6
|
|
|
7
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
3
3
|
import macro from '../../macros.js';
|
|
4
|
-
import { s as subtract,
|
|
4
|
+
import { s as subtract, o as multiplyAccumulate, m as normalize, k as cross } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import vtkActor from '../../Rendering/Core/Actor.js';
|
|
6
6
|
import vtkCylinderSource from '../../Filters/Sources/CylinderSource.js';
|
|
7
7
|
import vtkMapper from '../../Rendering/Core/Mapper.js';
|
|
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
3
3
|
import Constants from './Constants.js';
|
|
4
4
|
import macro from '../../../macros.js';
|
|
5
|
-
import { s as subtract,
|
|
5
|
+
import { s as subtract, l as add, m as normalize } from '../../../Common/Core/Math/index.js';
|
|
6
6
|
import { getNumberOfPlacedHandles, isHandlePlaced, calculateTextPosition, updateTextPosition, getPoint } from './helpers.js';
|
|
7
7
|
|
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as subtract, x as multiplyScalar,
|
|
1
|
+
import { s as subtract, x as multiplyScalar, l as add, C as areEquals } from '../../../Common/Core/Math/index.js';
|
|
2
2
|
|
|
3
3
|
function calculateTextPosition(model) {
|
|
4
4
|
var vector = [0, 0, 0];
|
|
@@ -3,7 +3,7 @@ import macro from '../../../macros.js';
|
|
|
3
3
|
import vtkBoundingBox from '../../../Common/DataModel/BoundingBox.js';
|
|
4
4
|
import vtkLine from '../../../Common/DataModel/Line.js';
|
|
5
5
|
import vtkPlanePointManipulator from '../../Manipulators/PlaneManipulator.js';
|
|
6
|
-
import { s as subtract,
|
|
6
|
+
import { s as subtract, m as normalize, d as dot, k as cross, o as multiplyAccumulate, x as multiplyScalar, T as signedAngleBetweenVectors } from '../../../Common/Core/Math/index.js';
|
|
7
7
|
import { updateState, getAssociatedLinesName, boundPointOnPlane, rotateVector } from './helpers.js';
|
|
8
8
|
import { InteractionMethodsName, ScrollingMethods } from './Constants.js';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import vtkBoundingBox, { STATIC } from '../../../Common/DataModel/BoundingBox.js
|
|
|
3
3
|
import vtkCubeSource from '../../../Filters/Sources/CubeSource.js';
|
|
4
4
|
import vtkCutter from '../../../Filters/Core/Cutter.js';
|
|
5
5
|
import vtkPlane from '../../../Common/DataModel/Plane.js';
|
|
6
|
-
import { s as subtract,
|
|
6
|
+
import { s as subtract, m as normalize, k as cross, x as multiplyScalar, o as multiplyAccumulate, T as signedAngleBetweenVectors } from '../../../Common/Core/Math/index.js';
|
|
7
7
|
import vtkMatrixBuilder from '../../../Common/Core/MatrixBuilder.js';
|
|
8
8
|
import { ViewTypes } from '../../Core/WidgetManager/Constants.js';
|
|
9
9
|
|
|
@@ -5,7 +5,7 @@ import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
|
5
5
|
import vtkPlane from '../../Common/DataModel/Plane.js';
|
|
6
6
|
import vtkPlaneSource from '../../Filters/Sources/PlaneSource.js';
|
|
7
7
|
import vtkResliceCursorContextRepresentation from '../Representations/ResliceCursorContextRepresentation.js';
|
|
8
|
-
import { f as distance2BetweenPoints,
|
|
8
|
+
import { f as distance2BetweenPoints, o as multiplyAccumulate, s as subtract, m as normalize, x as multiplyScalar, l as add } from '../../Common/Core/Math/index.js';
|
|
9
9
|
import widgetBehavior from './ResliceCursorWidget/behavior.js';
|
|
10
10
|
import generateState from './ResliceCursorWidget/state.js';
|
|
11
11
|
import { updateState, transformPlane, boundPlane } from './ResliceCursorWidget/helpers.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import macro from '../../../macros.js';
|
|
4
|
-
import {
|
|
4
|
+
import { g as vtkMath } from '../../../Common/Core/Math/index.js';
|
|
5
5
|
import vtkBoundingBox from '../../../Common/DataModel/BoundingBox.js';
|
|
6
6
|
import vtkPlane from '../../../Common/DataModel/Plane.js';
|
|
7
7
|
import { ShapeBehavior, BehaviorCategory, TextPosition } from './Constants.js';
|
package/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
/// <reference path="./Common/Core/StringArray.d.ts" />
|
|
17
17
|
/// <reference path="./Common/Core/URLExtract.d.ts" />
|
|
18
18
|
/// <reference path="./Common/Core/VariantArray.d.ts" />
|
|
19
|
+
/// <reference path="./Common/DataModel/AbstractPointLocator.d.ts" />
|
|
19
20
|
/// <reference path="./Common/DataModel/Box.d.ts" />
|
|
20
21
|
/// <reference path="./Common/DataModel/CardinalSpline1D.d.ts" />
|
|
21
22
|
/// <reference path="./Common/DataModel/Cell.d.ts" />
|
|
@@ -27,8 +28,11 @@
|
|
|
27
28
|
/// <reference path="./Common/DataModel/DataSetAttributes.d.ts" />
|
|
28
29
|
/// <reference path="./Common/DataModel/ITKHelper.d.ts" />
|
|
29
30
|
/// <reference path="./Common/DataModel/ImageData.d.ts" />
|
|
31
|
+
/// <reference path="./Common/DataModel/IncrementalOctreeNode.d.ts" />
|
|
32
|
+
/// <reference path="./Common/DataModel/IncrementalOctreePointLocator.d.ts" />
|
|
30
33
|
/// <reference path="./Common/DataModel/KochanekSpline1D.d.ts" />
|
|
31
34
|
/// <reference path="./Common/DataModel/Line.d.ts" />
|
|
35
|
+
/// <reference path="./Common/DataModel/Locator.d.ts" />
|
|
32
36
|
/// <reference path="./Common/DataModel/PiecewiseFunction.d.ts" />
|
|
33
37
|
/// <reference path="./Common/DataModel/Plane.d.ts" />
|
|
34
38
|
/// <reference path="./Common/DataModel/PointSet.d.ts" />
|
|
@@ -36,6 +40,7 @@
|
|
|
36
40
|
/// <reference path="./Common/DataModel/PolyData.d.ts" />
|
|
37
41
|
/// <reference path="./Common/DataModel/PolyLine.d.ts" />
|
|
38
42
|
/// <reference path="./Common/DataModel/Polygon.d.ts" />
|
|
43
|
+
/// <reference path="./Common/DataModel/Quad.d.ts" />
|
|
39
44
|
/// <reference path="./Common/DataModel/SelectionNode.d.ts" />
|
|
40
45
|
/// <reference path="./Common/DataModel/Sphere.d.ts" />
|
|
41
46
|
/// <reference path="./Common/DataModel/Spline1D.d.ts" />
|
|
@@ -44,6 +49,8 @@
|
|
|
44
49
|
/// <reference path="./Common/DataModel/Triangle.d.ts" />
|
|
45
50
|
/// <reference path="./Common/Transform/LandmarkTransform.d.ts" />
|
|
46
51
|
/// <reference path="./Filters/General/AppendPolyData.d.ts" />
|
|
52
|
+
/// <reference path="./Filters/General/ClipClosedSurface.d.ts" />
|
|
53
|
+
/// <reference path="./Filters/General/ContourTriangulator.d.ts" />
|
|
47
54
|
/// <reference path="./Filters/General/ImageCropFilter.d.ts" />
|
|
48
55
|
/// <reference path="./Filters/General/ImageOutlineFilter.d.ts" />
|
|
49
56
|
/// <reference path="./Filters/General/ImageSliceFilter.d.ts" />
|
|
@@ -103,6 +110,7 @@
|
|
|
103
110
|
/// <reference path="./Rendering/Core/AxesActor.d.ts" />
|
|
104
111
|
/// <reference path="./Rendering/Core/Camera.d.ts" />
|
|
105
112
|
/// <reference path="./Rendering/Core/CellPicker.d.ts" />
|
|
113
|
+
/// <reference path="./Rendering/Core/ColorTransferFunction/ColorMaps.d.ts" />
|
|
106
114
|
/// <reference path="./Rendering/Core/ColorTransferFunction/Constants.d.ts" />
|
|
107
115
|
/// <reference path="./Rendering/Core/ColorTransferFunction.d.ts" />
|
|
108
116
|
/// <reference path="./Rendering/Core/Coordinate/Constants.d.ts" />
|