@kitware/vtk.js 33.0.0-beta.2 → 33.0.0-beta.4
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/DataArray.d.ts +21 -0
- package/Common/Core/DataArray.js +39 -0
- package/Common/Core/Math/index.js +1 -1
- package/Common/Core/Math.js +1 -1
- package/Common/Core/URLExtract.js +2 -6
- package/Common/DataModel/Line.js +1 -0
- package/Common/DataModel/PolyLine.js +4 -0
- package/Filters/Core/ThresholdPoints.d.ts +72 -0
- package/Filters/Core/ThresholdPoints.js +219 -0
- package/Filters/General/ContourTriangulator/helper.js +1 -1
- package/IO/Core/DataAccessHelper/JSZipDataAccessHelper.js +1 -1
- package/IO/Geometry/DracoReader.d.ts +4 -4
- package/IO/Geometry/DracoReader.js +154 -105
- package/IO/Geometry/GLTFImporter/Animations.js +239 -0
- package/IO/Geometry/GLTFImporter/Constants.js +87 -0
- package/IO/Geometry/GLTFImporter/Decoder.js +69 -0
- package/IO/Geometry/GLTFImporter/Extensions.js +110 -0
- package/IO/Geometry/GLTFImporter/ORMTexture.worker.js +42 -0
- package/IO/Geometry/GLTFImporter/Parser.js +359 -0
- package/IO/Geometry/GLTFImporter/Reader.js +518 -0
- package/IO/Geometry/GLTFImporter/Utils.js +165 -0
- package/IO/Geometry/GLTFImporter.d.ts +266 -0
- package/IO/Geometry/GLTFImporter.js +245 -0
- package/IO/Geometry/IFCImporter.d.ts +163 -0
- package/IO/Geometry/IFCImporter.js +270 -0
- package/IO/Geometry/STLReader.d.ts +14 -0
- package/IO/Geometry/STLReader.js +57 -1
- package/IO/Geometry.js +5 -1
- package/IO/Image/HDRReader/Utils.js +1 -1
- package/IO/Image/HDRReader.js +1 -1
- package/IO/Image/TGAReader/Constants.js +28 -0
- package/IO/Image/TGAReader.d.ts +121 -0
- package/IO/Image/TGAReader.js +418 -0
- package/IO/Image/TIFFReader.d.ts +133 -0
- package/IO/Image/TIFFReader.js +144 -0
- package/IO/Image.js +5 -1
- package/IO/XML/XMLPolyDataWriter.js +1 -0
- package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.js +1 -1
- package/Interaction/Style/InteractorStyleTrackballCamera.js +1 -1
- package/Rendering/Core/AbstractImageMapper.d.ts +81 -0
- package/Rendering/Core/AbstractImageMapper.js +5 -2
- package/Rendering/Core/AbstractPicker.d.ts +13 -13
- package/Rendering/Core/AbstractPicker.js +1 -1
- package/Rendering/Core/Actor2D.d.ts +22 -0
- package/Rendering/Core/Actor2D.js +1 -1
- package/Rendering/Core/CellPicker.js +4 -1
- package/Rendering/Core/Glyph3DMapper.d.ts +45 -29
- package/Rendering/Core/ImageCPRMapper.js +6 -5
- package/Rendering/Core/ImageProperty.d.ts +42 -1
- package/Rendering/Core/ImageProperty.js +7 -5
- package/Rendering/Core/ImageResliceMapper.d.ts +1 -2
- package/Rendering/Core/ImageResliceMapper.js +5 -4
- package/Rendering/Core/PointPicker.js +10 -1
- package/Rendering/Core/Prop3D.js +1 -1
- package/Rendering/Core/RenderWindowInteractor.d.ts +1 -1
- package/Rendering/Core/RenderWindowInteractor.js +1 -1
- package/Rendering/Core/Viewport.js +13 -3
- package/Rendering/Core/VolumeMapper.d.ts +70 -0
- package/Rendering/Core/VolumeMapper.js +10 -5
- package/Rendering/Core/VolumeProperty.d.ts +20 -1
- package/Rendering/Core/VolumeProperty.js +7 -5
- package/Rendering/Misc/CanvasView.js +4 -2
- package/Rendering/Misc/RemoteView.d.ts +9 -3
- package/Rendering/Misc/RemoteView.js +7 -3
- package/Rendering/Misc/SynchronizableRenderWindow/BehaviorManager/CameraSynchronizer.js +2 -2
- package/Rendering/Misc/SynchronizableRenderWindow/ObjectManager.d.ts +1 -1
- package/Rendering/OpenGL/ImageCPRMapper.js +18 -2
- package/Rendering/OpenGL/ImageMapper.js +42 -11
- package/Rendering/OpenGL/ImageResliceMapper.js +20 -4
- package/Rendering/OpenGL/Renderer.js +1 -1
- package/Rendering/OpenGL/Texture/supportsNorm16Linear.js +97 -0
- package/Rendering/OpenGL/Texture.d.ts +29 -8
- package/Rendering/OpenGL/Texture.js +172 -34
- package/Rendering/OpenGL/VolumeMapper.js +22 -4
- package/Rendering/SceneGraph/ViewNode.js +12 -2
- package/Rendering/WebXR/RenderWindowHelper.js +9 -0
- package/Widgets/Core/WidgetManager.d.ts +12 -1
- package/Widgets/Representations/WidgetRepresentation.d.ts +1 -7
- package/Widgets/Widgets3D/AngleWidget/behavior.js +2 -0
- package/Widgets/Widgets3D/InteractiveOrientationWidget.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +17 -0
- package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -0
- package/Widgets/Widgets3D/ResliceCursorWidget.d.ts +1 -8
- package/Widgets/Widgets3D/ShapeWidget/behavior.js +3 -0
- package/_virtual/rollup-plugin-worker-loader__module_Sources/IO/Geometry/GLTFImporter/ORMTexture.worker.js +296 -0
- package/index.d.ts +5 -0
- package/package.json +19 -17
|
@@ -36,6 +36,7 @@ function vtkXMLPolyDataWriter(publicAPI, model) {
|
|
|
36
36
|
});
|
|
37
37
|
publicAPI.processDataSetAttributes(piece, 'PointData', dataObject.getPointData());
|
|
38
38
|
publicAPI.processDataSetAttributes(piece, 'CellData', dataObject.getCellData());
|
|
39
|
+
publicAPI.processDataSetAttributes(piece, 'FieldData', dataObject.getFieldData());
|
|
39
40
|
publicAPI.processDataArray(piece.ele('Points'), dataObject.getPoints());
|
|
40
41
|
POLYDATA_FIELDS.forEach(cellType => {
|
|
41
42
|
const cellTypeName = camelize(cellType);
|
|
@@ -2,7 +2,7 @@ import { mat4, vec3 } from 'gl-matrix';
|
|
|
2
2
|
import { m as macro } from '../../macros2.js';
|
|
3
3
|
import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
|
|
4
4
|
import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
|
|
5
|
-
import { r as radiansFromDegrees,
|
|
5
|
+
import { r as radiansFromDegrees, A as degreesFromRadians } from '../../Common/Core/Math/index.js';
|
|
6
6
|
|
|
7
7
|
// ----------------------------------------------------------------------------
|
|
8
8
|
// vtkMouseCameraTrackballRollManipulator methods
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtkInteractorStyle from '../../Rendering/Core/InteractorStyle.js';
|
|
3
3
|
import vtkInteractorStyleConstants from '../../Rendering/Core/InteractorStyle/Constants.js';
|
|
4
|
-
import {
|
|
4
|
+
import { A as degreesFromRadians } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import { Device, Input } from '../../Rendering/Core/RenderWindowInteractor/Constants.js';
|
|
6
6
|
|
|
7
7
|
const {
|
|
@@ -122,6 +122,87 @@ export interface vtkAbstractImageMapper extends vtkAbstractMapper3D {
|
|
|
122
122
|
* @param customDisplayExtent
|
|
123
123
|
*/
|
|
124
124
|
setCustomDisplayExtentFrom(customDisplayExtent: number[]): boolean;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Set the opacity texture width.
|
|
128
|
+
*
|
|
129
|
+
* The default width (1024) should be fine in most instances.
|
|
130
|
+
* Only set this property if your opacity function range width is
|
|
131
|
+
* larger than 1024.
|
|
132
|
+
*
|
|
133
|
+
* A reasonable max texture size would be either 2048 or 4096, as those
|
|
134
|
+
* widths are supported by the vast majority of devices. Any width larger
|
|
135
|
+
* than that will have issues with device support.
|
|
136
|
+
*
|
|
137
|
+
* Specifying a width that is less than or equal to 0 will use the largest
|
|
138
|
+
* possible texture width on the device. Use this with caution! The max texture
|
|
139
|
+
* width of one device may not be the same for another device.
|
|
140
|
+
*
|
|
141
|
+
* You can find more information about supported texture widths at the following link:
|
|
142
|
+
* https://web3dsurvey.com/webgl/parameters/MAX_TEXTURE_SIZE
|
|
143
|
+
*
|
|
144
|
+
* @param {Number} width the texture width (defaults to 1024)
|
|
145
|
+
*/
|
|
146
|
+
setOpacityTextureWidth(width: number): boolean;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Get the opacity texture width.
|
|
150
|
+
*/
|
|
151
|
+
getOpacityTextureWidth(): number;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Set the color texture width.
|
|
155
|
+
*
|
|
156
|
+
* The default width (1024) should be fine in most instances.
|
|
157
|
+
* Only set this property if your color transfer function range width is
|
|
158
|
+
* larger than 1024.
|
|
159
|
+
*
|
|
160
|
+
* A reasonable max texture size would be either 2048 or 4096, as those
|
|
161
|
+
* widths are supported by the vast majority of devices. Any width larger
|
|
162
|
+
* than that will have issues with device support.
|
|
163
|
+
*
|
|
164
|
+
* Specifying a width that is less than or equal to 0 will use the largest
|
|
165
|
+
* possible texture width on the device. Use this with caution! The max texture
|
|
166
|
+
* width of one device may not be the same for another device.
|
|
167
|
+
*
|
|
168
|
+
* You can find more information about supported texture widths at the following link:
|
|
169
|
+
* https://web3dsurvey.com/webgl/parameters/MAX_TEXTURE_SIZE
|
|
170
|
+
*
|
|
171
|
+
* @param {Number} width the texture width (defaults to 1024)
|
|
172
|
+
*/
|
|
173
|
+
setColorTextureWidth(width: number): boolean;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Get the color texture width.
|
|
177
|
+
*/
|
|
178
|
+
getColorTextureWidth(): number;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Set the label outline texture width.
|
|
182
|
+
*
|
|
183
|
+
* The default width (1024) should be fine in most instances.
|
|
184
|
+
* Only set this property if you have more than 1024 labels
|
|
185
|
+
* that you want to render with thickness.
|
|
186
|
+
*
|
|
187
|
+
* A reasonable max texture size would be either 2048 or 4096, as those
|
|
188
|
+
* widths are supported by the vast majority of devices. Any width larger
|
|
189
|
+
* than that will have issues with device support.
|
|
190
|
+
*
|
|
191
|
+
* Specifying a width that is less than or equal to 0 will use the largest
|
|
192
|
+
* possible texture width on the device. Use this with caution! The max texture
|
|
193
|
+
* width of one device may not be the same for another device.
|
|
194
|
+
*
|
|
195
|
+
* You can find more information about supported texture widths at the following link:
|
|
196
|
+
* https://web3dsurvey.com/webgl/parameters/MAX_TEXTURE_SIZE
|
|
197
|
+
*
|
|
198
|
+
* @param {Number} width the texture width (defaults to 1024)
|
|
199
|
+
*/
|
|
200
|
+
setLabelOutlineTextureWidth(width: number): boolean;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Get the label outline texture width.
|
|
204
|
+
*/
|
|
205
|
+
getLabelOutlineTextureWidth(): number;
|
|
125
206
|
}
|
|
126
207
|
|
|
127
208
|
/**
|
|
@@ -24,7 +24,10 @@ const DEFAULT_VALUES = {
|
|
|
24
24
|
slice: 0,
|
|
25
25
|
customDisplayExtent: [0, 0, 0, 0, 0, 0],
|
|
26
26
|
useCustomExtents: false,
|
|
27
|
-
backgroundColor: [0, 0, 0, 1]
|
|
27
|
+
backgroundColor: [0, 0, 0, 1],
|
|
28
|
+
colorTextureWidth: 1024,
|
|
29
|
+
opacityTextureWidth: 1024,
|
|
30
|
+
labelOutlineTextureWidth: 1024
|
|
28
31
|
};
|
|
29
32
|
|
|
30
33
|
// ----------------------------------------------------------------------------
|
|
@@ -35,7 +38,7 @@ function extend(publicAPI, model) {
|
|
|
35
38
|
|
|
36
39
|
// Build VTK API
|
|
37
40
|
vtkAbstractMapper3D.extend(publicAPI, model, initialValues);
|
|
38
|
-
macro.setGet(publicAPI, model, ['slice', 'useCustomExtents']);
|
|
41
|
+
macro.setGet(publicAPI, model, ['slice', 'useCustomExtents', 'colorTextureWidth', 'opacityTextureWidth', 'labelOutlineTextureWidth']);
|
|
39
42
|
macro.setGetArray(publicAPI, model, ['customDisplayExtent'], 6);
|
|
40
43
|
macro.setGetArray(publicAPI, model, ['backgroundColor'], 4);
|
|
41
44
|
vtkAbstractImageMapper(publicAPI, model);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { vtkObject } from './../../interfaces';
|
|
2
2
|
import { Vector3 } from './../../types';
|
|
3
|
-
import
|
|
3
|
+
import vtkProp3D from './Prop3D';
|
|
4
4
|
import vtkRenderer from './Renderer';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -10,8 +10,8 @@ export interface IAbstractPickerInitialValues {
|
|
|
10
10
|
renderer?: vtkRenderer;
|
|
11
11
|
selectionPoint?: Vector3;
|
|
12
12
|
pickPosition?: Vector3;
|
|
13
|
-
pickFromList?:
|
|
14
|
-
pickList?:
|
|
13
|
+
pickFromList?: boolean;
|
|
14
|
+
pickList?: vtkProp3D[];
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -20,15 +20,15 @@ export interface IAbstractPickerInitialValues {
|
|
|
20
20
|
export interface vtkAbstractPicker extends vtkObject {
|
|
21
21
|
/**
|
|
22
22
|
*
|
|
23
|
-
* @param {
|
|
23
|
+
* @param {vtkProp3D} prop
|
|
24
24
|
*/
|
|
25
|
-
addPickList(
|
|
25
|
+
addPickList(prop: vtkProp3D): void;
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
*
|
|
29
|
-
* @param {
|
|
29
|
+
* @param {vtkProp3D} prop
|
|
30
30
|
*/
|
|
31
|
-
deletePickList(
|
|
31
|
+
deletePickList(prop: vtkProp3D): void;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
*
|
|
@@ -38,7 +38,7 @@ export interface vtkAbstractPicker extends vtkObject {
|
|
|
38
38
|
/**
|
|
39
39
|
*
|
|
40
40
|
*/
|
|
41
|
-
getPickList():
|
|
41
|
+
getPickList(): vtkProp3D[];
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* Get the picked position
|
|
@@ -82,17 +82,17 @@ export interface vtkAbstractPicker extends vtkObject {
|
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
*
|
|
85
|
-
* @param {
|
|
86
|
-
* @default
|
|
85
|
+
* @param {Boolean} pickFromList
|
|
86
|
+
* @default false
|
|
87
87
|
*/
|
|
88
|
-
setPickFromList(pickFromList:
|
|
88
|
+
setPickFromList(pickFromList: boolean): boolean;
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
*
|
|
92
|
-
* @param {
|
|
92
|
+
* @param {vtkProp3D[]} pickList
|
|
93
93
|
* @default []
|
|
94
94
|
*/
|
|
95
|
-
setPickList(pickList:
|
|
95
|
+
setPickList(pickList: vtkProp3D[]): boolean;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
/**
|
|
@@ -54,6 +54,28 @@ export interface vtkActor2D extends vtkProp {
|
|
|
54
54
|
*/
|
|
55
55
|
getMapper(): vtkMapper2D;
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Set the layer number for this 2D actor.
|
|
59
|
+
* The scenegraph uses this layer number to sort actor 2D overlays/underlays on top of each other.
|
|
60
|
+
* The actor2D with the highest layer number is going to be rendered at the very front i.e. it is
|
|
61
|
+
* the top-most layer.
|
|
62
|
+
* If two actor2D instances share the same layer number, they are rendered in the order in which
|
|
63
|
+
* they were added to the renderer via `addActor` or `addActor2D`.
|
|
64
|
+
* By default, each actor2D has a layer number of 0.
|
|
65
|
+
*/
|
|
66
|
+
setLayerNumber(layer: number): void;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Get the layer number for this 2D actor.
|
|
70
|
+
* The scenegraph uses this layer number to sort actor 2D overlays/underlays on top of each other.
|
|
71
|
+
* The actor2D with the highest layer number is going to be rendered at the very front i.e. it is
|
|
72
|
+
* the top-most layer.
|
|
73
|
+
* If two actor2D instances share the same layer number, they are rendered in the order in which
|
|
74
|
+
* they were added to the renderer via `addActor` or `addActor2D`.
|
|
75
|
+
* By default, each actor2D has a layer number of 0.
|
|
76
|
+
*/
|
|
77
|
+
getLayerNumber(): number;
|
|
78
|
+
|
|
57
79
|
/**
|
|
58
80
|
*
|
|
59
81
|
*/
|
|
@@ -145,7 +145,7 @@ function extend(publicAPI, model) {
|
|
|
145
145
|
|
|
146
146
|
// Build VTK API
|
|
147
147
|
macro.set(publicAPI, model, ['property']);
|
|
148
|
-
macro.setGet(publicAPI, model, ['mapper']);
|
|
148
|
+
macro.setGet(publicAPI, model, ['mapper', 'layerNumber']);
|
|
149
149
|
|
|
150
150
|
// Object methods
|
|
151
151
|
vtkActor2D(publicAPI, model);
|
|
@@ -219,7 +219,10 @@ function vtkCellPicker(publicAPI, model) {
|
|
|
219
219
|
|
|
220
220
|
// calculate opacity table
|
|
221
221
|
const numIComps = 1;
|
|
222
|
-
|
|
222
|
+
let oWidth = mapper.getOpacityTextureWidth();
|
|
223
|
+
if (oWidth <= 0) {
|
|
224
|
+
oWidth = 1024;
|
|
225
|
+
}
|
|
223
226
|
const tmpTable = new Float32Array(oWidth);
|
|
224
227
|
const opacityArray = new Float32Array(oWidth);
|
|
225
228
|
let ofun;
|
|
@@ -12,11 +12,11 @@ interface IPrimitiveCount {
|
|
|
12
12
|
export interface IGlyph3DMapperInitialValues extends IMapperInitialValues {
|
|
13
13
|
orient?: boolean;
|
|
14
14
|
orientationMode?: OrientationModes;
|
|
15
|
-
orientationArray?:
|
|
15
|
+
orientationArray?: string;
|
|
16
16
|
scaling?: boolean;
|
|
17
17
|
scaleFactor?: number;
|
|
18
18
|
scaleMode?: ScaleModes;
|
|
19
|
-
scaleArray?:
|
|
19
|
+
scaleArray?: string;
|
|
20
20
|
matrixArray?: number[];
|
|
21
21
|
normalArray?: number[];
|
|
22
22
|
colorArray?: number[];
|
|
@@ -24,29 +24,26 @@ export interface IGlyph3DMapperInitialValues extends IMapperInitialValues {
|
|
|
24
24
|
|
|
25
25
|
export interface vtkGlyph3DMapper extends vtkMapper {
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* This definition is compliant with SetOrientation method on vtkProp3D.
|
|
27
|
+
* Get the bounds for this mapper as [xmin, xmax, ymin, ymax,zmin, zmax].
|
|
28
|
+
* @return {Bounds} The bounds for the mapper.
|
|
29
|
+
*/
|
|
30
|
+
getBounds(): Bounds;
|
|
31
|
+
|
|
32
|
+
/**
|
|
34
33
|
*
|
|
35
|
-
* By using vector or normal there is a degree of freedom or rotation left
|
|
36
|
-
* (underconstrained). With the orientation array, there is no degree of
|
|
37
|
-
* freedom left.
|
|
38
34
|
*/
|
|
39
|
-
|
|
35
|
+
buildArrays(): void;
|
|
40
36
|
|
|
41
37
|
/**
|
|
42
|
-
*
|
|
38
|
+
*
|
|
43
39
|
*/
|
|
44
|
-
|
|
40
|
+
getPrimitiveCount(): IPrimitiveCount;
|
|
45
41
|
|
|
46
42
|
/**
|
|
47
|
-
* Get
|
|
43
|
+
* Get scale mode
|
|
44
|
+
* @default `SCALE_BY_MAGNITUDE`
|
|
48
45
|
*/
|
|
49
|
-
|
|
46
|
+
getScaleMode(): ScaleModes;
|
|
50
47
|
|
|
51
48
|
/**
|
|
52
49
|
* Get scale factor to scale object by.
|
|
@@ -54,15 +51,20 @@ export interface vtkGlyph3DMapper extends vtkMapper {
|
|
|
54
51
|
getScaleFactor(): number;
|
|
55
52
|
|
|
56
53
|
/**
|
|
57
|
-
* Get scale mode
|
|
58
|
-
* @default `SCALE_BY_MAGNITUDE`
|
|
54
|
+
* Get scale mode as string
|
|
59
55
|
*/
|
|
60
|
-
|
|
56
|
+
getScaleModeAsString(): string;
|
|
61
57
|
|
|
62
58
|
/**
|
|
63
|
-
*
|
|
59
|
+
* Sets the name of the array to use as scale values.
|
|
60
|
+
* @param {String} arrayName Name of the array
|
|
64
61
|
*/
|
|
65
|
-
|
|
62
|
+
setScaleArray(arrayName: Nullable<string>): boolean;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Gets the name of the array used as scale values.
|
|
66
|
+
*/
|
|
67
|
+
getScaleArray(): string;
|
|
66
68
|
|
|
67
69
|
/**
|
|
68
70
|
* Get scale mode as array
|
|
@@ -70,20 +72,29 @@ export interface vtkGlyph3DMapper extends vtkMapper {
|
|
|
70
72
|
getScaleArrayData(): number[];
|
|
71
73
|
|
|
72
74
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
+
* An orientation array is a vtkDataArray with 3 components. The first
|
|
76
|
+
* component is the angle of rotation along the X axis. The second component
|
|
77
|
+
* is the angle of rotation along the Y axis. The third component is the
|
|
78
|
+
* angle of rotation along the Z axis. Orientation is specified in X,Y,Z
|
|
79
|
+
* order but the rotations are performed in Z,X an Y.
|
|
80
|
+
*
|
|
81
|
+
* This definition is compliant with SetOrientation method on vtkProp3D.
|
|
82
|
+
*
|
|
83
|
+
* By using vector or normal there is a degree of freedom or rotation left
|
|
84
|
+
* (underconstrained). With the orientation array, there is no degree of
|
|
85
|
+
* freedom left.
|
|
75
86
|
*/
|
|
76
|
-
|
|
87
|
+
getOrientationMode(): OrientationModes;
|
|
77
88
|
|
|
78
89
|
/**
|
|
79
|
-
*
|
|
90
|
+
* Get orientation as string
|
|
80
91
|
*/
|
|
81
|
-
|
|
92
|
+
getOrientationModeAsString(): string;
|
|
82
93
|
|
|
83
94
|
/**
|
|
84
|
-
*
|
|
95
|
+
* Get orientation as array
|
|
85
96
|
*/
|
|
86
|
-
|
|
97
|
+
getOrientationArrayData(): number[];
|
|
87
98
|
|
|
88
99
|
/**
|
|
89
100
|
* Sets the name of the array to use as orientation.
|
|
@@ -91,6 +102,11 @@ export interface vtkGlyph3DMapper extends vtkMapper {
|
|
|
91
102
|
*/
|
|
92
103
|
setOrientationArray(arrayName: Nullable<string>): boolean;
|
|
93
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Gets the name of the array used as orientation values.
|
|
107
|
+
*/
|
|
108
|
+
getOrientationArray(): string;
|
|
109
|
+
|
|
94
110
|
/**
|
|
95
111
|
* Orientation mode indicates if the OrientationArray provides the direction
|
|
96
112
|
* vector for the orientation or the rotations around each axes.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { vec3, mat4
|
|
1
|
+
import { quat, vec3, mat4 } from 'gl-matrix';
|
|
2
2
|
import CoincidentTopologyHelper from './Mapper/CoincidentTopologyHelper.js';
|
|
3
3
|
import vtkAbstractImageMapper from './AbstractImageMapper.js';
|
|
4
4
|
import { m as macro } from '../../macros2.js';
|
|
@@ -270,7 +270,7 @@ function vtkImageCPRMapper(publicAPI, model) {
|
|
|
270
270
|
// Object factory
|
|
271
271
|
// ----------------------------------------------------------------------------
|
|
272
272
|
|
|
273
|
-
const
|
|
273
|
+
const defaultValues = initialValues => ({
|
|
274
274
|
width: 10,
|
|
275
275
|
uniformOrientation: [0, 0, 0, 1],
|
|
276
276
|
useUniformOrientation: false,
|
|
@@ -282,14 +282,15 @@ const DEFAULT_VALUES = {
|
|
|
282
282
|
normalDirection: [0, 0, 1],
|
|
283
283
|
projectionSlabThickness: 1,
|
|
284
284
|
projectionSlabNumberOfSamples: 1,
|
|
285
|
-
projectionMode: ProjectionMode.MAX
|
|
286
|
-
|
|
285
|
+
projectionMode: ProjectionMode.MAX,
|
|
286
|
+
...initialValues
|
|
287
|
+
});
|
|
287
288
|
|
|
288
289
|
// ----------------------------------------------------------------------------
|
|
289
290
|
|
|
290
291
|
function extend(publicAPI, model) {
|
|
291
292
|
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
292
|
-
Object.assign(model,
|
|
293
|
+
Object.assign(model, defaultValues(initialValues));
|
|
293
294
|
|
|
294
295
|
// Inheritance
|
|
295
296
|
vtkAbstractImageMapper.extend(publicAPI, model, initialValues);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { vtkObject } from './../../interfaces';
|
|
2
|
-
import { Nullable } from './../../types';
|
|
2
|
+
import { Extent, Nullable } from './../../types';
|
|
3
3
|
import vtkColorTransferFunction from './ColorTransferFunction';
|
|
4
4
|
import vtkPiecewiseFunction from './../../Common/DataModel/PiecewiseFunction';
|
|
5
5
|
import { InterpolationType } from './ImageProperty/Constants';
|
|
@@ -94,6 +94,28 @@ export interface vtkImageProperty extends vtkObject {
|
|
|
94
94
|
*/
|
|
95
95
|
getScalarOpacity(idx?: number): vtkPiecewiseFunction;
|
|
96
96
|
|
|
97
|
+
/**
|
|
98
|
+
* Enable label outline rendering.
|
|
99
|
+
* @param {Boolean} useLabelOutline
|
|
100
|
+
*/
|
|
101
|
+
setUseLabelOutline(useLabelOutline: boolean): boolean;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Check if label outline rendering.
|
|
105
|
+
*/
|
|
106
|
+
getUseLabelOutline(): boolean;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Set the 0 to 1 opacity of the label outline.
|
|
110
|
+
* @param {Number} opacity
|
|
111
|
+
*/
|
|
112
|
+
setLabelOutlineOpacity(opacity: number): boolean;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Get the 0 to 1 opacity of the label outline.
|
|
116
|
+
*/
|
|
117
|
+
getLabelOutlineOpacity(): number;
|
|
118
|
+
|
|
97
119
|
/**
|
|
98
120
|
* gets the label outline thickness
|
|
99
121
|
*/
|
|
@@ -209,6 +231,25 @@ export interface vtkImageProperty extends vtkObject {
|
|
|
209
231
|
* @param {Boolean} useLookupTableScalarRange
|
|
210
232
|
*/
|
|
211
233
|
setUseLookupTableScalarRange(useLookupTableScalarRange: boolean): boolean;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Informs the mapper to only update the specified extents at the next render.
|
|
237
|
+
*
|
|
238
|
+
* If there are zero extents, the mapper updates the entire volume texture.
|
|
239
|
+
* Otherwise, the mapper will only update the texture by the specified extents
|
|
240
|
+
* during the next render call.
|
|
241
|
+
*
|
|
242
|
+
* This array is cleared after a successful render.
|
|
243
|
+
* @param extents
|
|
244
|
+
*/
|
|
245
|
+
setUpdatedExtents(extents: Extent[]): boolean;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Retrieves the updated extents.
|
|
249
|
+
*
|
|
250
|
+
* This array is cleared after every successful render.
|
|
251
|
+
*/
|
|
252
|
+
getUpdatedExtents(): Extent[];
|
|
212
253
|
}
|
|
213
254
|
|
|
214
255
|
/**
|
|
@@ -136,7 +136,7 @@ function vtkImageProperty(publicAPI, model) {
|
|
|
136
136
|
// ----------------------------------------------------------------------------
|
|
137
137
|
// Object factory
|
|
138
138
|
// ----------------------------------------------------------------------------
|
|
139
|
-
const
|
|
139
|
+
const defaultValues = initialValues => ({
|
|
140
140
|
independentComponents: false,
|
|
141
141
|
interpolationType: InterpolationType.LINEAR,
|
|
142
142
|
colorWindow: 255,
|
|
@@ -147,14 +147,16 @@ const DEFAULT_VALUES = {
|
|
|
147
147
|
useLookupTableScalarRange: false,
|
|
148
148
|
useLabelOutline: false,
|
|
149
149
|
labelOutlineThickness: [1],
|
|
150
|
-
labelOutlineOpacity: 1.0
|
|
151
|
-
|
|
150
|
+
labelOutlineOpacity: 1.0,
|
|
151
|
+
updatedExtents: [],
|
|
152
|
+
...initialValues
|
|
153
|
+
});
|
|
152
154
|
|
|
153
155
|
// ----------------------------------------------------------------------------
|
|
154
156
|
|
|
155
157
|
function extend(publicAPI, model) {
|
|
156
158
|
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
157
|
-
Object.assign(model,
|
|
159
|
+
Object.assign(model, defaultValues(initialValues));
|
|
158
160
|
|
|
159
161
|
// Build VTK API
|
|
160
162
|
macro.obj(publicAPI, model);
|
|
@@ -168,7 +170,7 @@ function extend(publicAPI, model) {
|
|
|
168
170
|
});
|
|
169
171
|
}
|
|
170
172
|
}
|
|
171
|
-
macro.setGet(publicAPI, model, ['independentComponents', 'interpolationType', 'colorWindow', 'colorLevel', 'ambient', 'diffuse', 'opacity', 'useLookupTableScalarRange', 'useLabelOutline', 'labelOutlineOpacity']);
|
|
173
|
+
macro.setGet(publicAPI, model, ['independentComponents', 'interpolationType', 'colorWindow', 'colorLevel', 'ambient', 'diffuse', 'opacity', 'useLookupTableScalarRange', 'useLabelOutline', 'labelOutlineOpacity', 'updatedExtents']);
|
|
172
174
|
macro.setGetArray(publicAPI, model, ['labelOutlineThickness']);
|
|
173
175
|
|
|
174
176
|
// Object methods
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import vtkAbstractImageMapper, {
|
|
2
2
|
IAbstractImageMapperInitialValues,
|
|
3
3
|
} from './AbstractImageMapper';
|
|
4
|
-
import vtkImageData from './../../Common/DataModel/ImageData';
|
|
5
4
|
import vtkPlane from './../../Common/DataModel/Plane';
|
|
6
5
|
import vtkPolyData from './../../Common/DataModel/PolyData';
|
|
7
|
-
import { Bounds
|
|
6
|
+
import { Bounds } from './../../types';
|
|
8
7
|
import { SlabTypes } from './ImageResliceMapper/Constants';
|
|
9
8
|
import CoincidentTopologyHelper, {
|
|
10
9
|
StaticCoincidentTopologyMethods,
|
|
@@ -38,19 +38,20 @@ function vtkImageResliceMapper(publicAPI, model) {
|
|
|
38
38
|
// Object factory
|
|
39
39
|
// ----------------------------------------------------------------------------
|
|
40
40
|
|
|
41
|
-
const
|
|
41
|
+
const defaultValues = initialValues => ({
|
|
42
42
|
slabThickness: 0.0,
|
|
43
43
|
slabTrapezoidIntegration: 0,
|
|
44
44
|
slabType: SlabTypes.MEAN,
|
|
45
45
|
slicePlane: null,
|
|
46
|
-
slicePolyData: null
|
|
47
|
-
|
|
46
|
+
slicePolyData: null,
|
|
47
|
+
...initialValues
|
|
48
|
+
});
|
|
48
49
|
|
|
49
50
|
// ----------------------------------------------------------------------------
|
|
50
51
|
|
|
51
52
|
function extend(publicAPI, model) {
|
|
52
53
|
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
53
|
-
Object.assign(model,
|
|
54
|
+
Object.assign(model, defaultValues(initialValues));
|
|
54
55
|
|
|
55
56
|
// Build VTK API
|
|
56
57
|
vtkAbstractImageMapper.extend(publicAPI, model, initialValues);
|
|
@@ -80,6 +80,9 @@ function vtkPointPicker(publicAPI, model) {
|
|
|
80
80
|
if (maxDist <= tolerance && maxDist < minPtDist) {
|
|
81
81
|
// within tolerance
|
|
82
82
|
minPtId = ptId;
|
|
83
|
+
x[0];
|
|
84
|
+
x[1];
|
|
85
|
+
x[2];
|
|
83
86
|
minPtDist = maxDist;
|
|
84
87
|
tMin = t;
|
|
85
88
|
}
|
|
@@ -108,13 +111,19 @@ function vtkPointPicker(publicAPI, model) {
|
|
|
108
111
|
if (maxDist <= tolerance && maxDist < minPtDist) {
|
|
109
112
|
// within tolerance
|
|
110
113
|
minPtId = ptId;
|
|
114
|
+
x[0];
|
|
115
|
+
x[1];
|
|
116
|
+
x[2];
|
|
111
117
|
minPtDist = maxDist;
|
|
112
118
|
tMin = t;
|
|
113
119
|
}
|
|
114
120
|
}
|
|
115
121
|
}
|
|
116
122
|
}
|
|
117
|
-
model.
|
|
123
|
+
if (minPtId > -1 && tMin < model.globalTMin) {
|
|
124
|
+
model.globalTMin = tMin;
|
|
125
|
+
model.pointId = minPtId;
|
|
126
|
+
}
|
|
118
127
|
return tMin;
|
|
119
128
|
};
|
|
120
129
|
}
|
package/Rendering/Core/Prop3D.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mat4, quat } from 'gl-matrix';
|
|
2
2
|
import { m as macro } from '../../macros2.js';
|
|
3
3
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
4
|
-
import {
|
|
4
|
+
import { A as degreesFromRadians, r as radiansFromDegrees, a as areMatricesEqual } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import vtkProp from './Prop.js';
|
|
6
6
|
|
|
7
7
|
const VTK_EPSILON = 1e-6;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
|
-
import {
|
|
2
|
+
import { A as degreesFromRadians } from '../../Common/Core/Math/index.js';
|
|
3
3
|
import Constants from './RenderWindowInteractor/Constants.js';
|
|
4
4
|
|
|
5
5
|
const {
|
|
@@ -46,10 +46,20 @@ function vtkViewport(publicAPI, model) {
|
|
|
46
46
|
return allProps;
|
|
47
47
|
}
|
|
48
48
|
publicAPI.getViewPropsWithNestedProps = () => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
let allPropsArray = [];
|
|
50
|
+
// Handle actor2D instances separately so that they can be overlayed and layered
|
|
51
|
+
const actors2D = publicAPI.getActors2D();
|
|
52
|
+
// Sort the actor2D list using its layer number
|
|
53
|
+
actors2D.sort((a, b) => a.getLayerNumber() - b.getLayerNumber());
|
|
54
|
+
// Filter out all the actor2D instances
|
|
55
|
+
const newPropList = model.props.filter(item => !actors2D.includes(item));
|
|
56
|
+
for (let i = 0; i < newPropList.length; i++) {
|
|
57
|
+
gatherProps(newPropList[i], allPropsArray);
|
|
52
58
|
}
|
|
59
|
+
// Finally, add the actor2D props at the end of the list
|
|
60
|
+
// This works because, when traversing the render pass in vtkOpenGLRenderer, the children are
|
|
61
|
+
// traversed in the order that they are added to the list
|
|
62
|
+
allPropsArray = allPropsArray.concat(actors2D);
|
|
53
63
|
return allPropsArray;
|
|
54
64
|
};
|
|
55
65
|
publicAPI.addActor2D = publicAPI.addViewProp;
|