@kitware/vtk.js 34.17.0 → 35.0.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/BREAKING_CHANGES.md +5 -0
- package/CONTRIBUTING.md +1 -1
- package/Common/Core/Math/index.js +15 -1
- package/Common/Core/Math.d.ts +8 -0
- package/Common/Core/Math.js +1 -1
- package/Common/DataModel/BoundingBox.d.ts +8 -3
- package/Common/DataModel/BoundingBox.js +16 -7
- package/Common/DataModel/Box.js +1 -1
- package/Common/DataModel/PointSet.js +2 -2
- package/Filters/General/WindowedSincPolyDataFilter.js +2 -4
- package/Proxy/Core/ViewProxy.js +5 -1
- package/Rendering/Core/AbstractImageMapper.d.ts +4 -0
- package/Rendering/Core/AbstractMapper3D.d.ts +21 -2
- package/Rendering/Core/AbstractMapper3D.js +14 -5
- package/Rendering/Core/CubeAxesActor.js +7 -4
- package/Rendering/Core/Glyph3DMapper.js +8 -40
- package/Rendering/Core/ImageArrayMapper.js +9 -4
- package/Rendering/Core/ImageCPRMapper.js +4 -3
- package/Rendering/Core/ImageMapper.js +7 -4
- package/Rendering/Core/ImageProperty.d.ts +7 -0
- package/Rendering/Core/ImageResliceMapper.js +6 -6
- package/Rendering/Core/ImageSlice.js +6 -6
- package/Rendering/Core/Mapper.js +5 -5
- package/Rendering/Core/Prop3D.js +22 -25
- package/Rendering/Core/VolumeMapper.js +7 -3
- package/Rendering/OpenGL/ImageResliceMapper.js +477 -81
- package/Widgets/Representations/ArrowHandleRepresentation.js +7 -1
- package/Widgets/Representations/CircleContextRepresentation.js +18 -3
- package/Widgets/Representations/SplineContextRepresentation.js +12 -5
- package/Widgets/Widgets3D/ResliceCursorWidget.js +5 -2
- package/package.json +1 -1
package/Rendering/Core/Prop3D.js
CHANGED
|
@@ -128,24 +128,20 @@ function vtkProp3D(publicAPI, model) {
|
|
|
128
128
|
model.matrixMTime.modified();
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
|
-
publicAPI.
|
|
131
|
+
publicAPI.computeBounds = () => {
|
|
132
132
|
if (model.mapper === null) {
|
|
133
|
-
|
|
133
|
+
vtkBoundingBox.reset(model.bounds);
|
|
134
|
+
return;
|
|
134
135
|
}
|
|
135
136
|
|
|
136
|
-
// Check for the special case when the mapper's bounds are
|
|
137
|
+
// Check for the special case when the mapper's bounds are invalid
|
|
137
138
|
const bds = model.mapper.getBounds();
|
|
138
|
-
if (!bds || bds.length !== 6) {
|
|
139
|
-
return bds;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Check for the special case when the actor is empty.
|
|
143
|
-
if (bds[0] > bds[1]) {
|
|
139
|
+
if (!bds || bds.length !== 6 || !vtkBoundingBox.isValid(bds)) {
|
|
144
140
|
// No need to copy bds, a new array is created when calling getBounds()
|
|
145
141
|
model.mapperBounds = bds;
|
|
146
|
-
model.bounds
|
|
142
|
+
vtkBoundingBox.reset(model.bounds);
|
|
147
143
|
model.boundsMTime.modified();
|
|
148
|
-
return
|
|
144
|
+
return;
|
|
149
145
|
}
|
|
150
146
|
|
|
151
147
|
// Check if we have cached values for these bounds - we cache the
|
|
@@ -165,22 +161,22 @@ function vtkProp3D(publicAPI, model) {
|
|
|
165
161
|
vtkBoundingBox.transformBounds(bds, transposedMatrix, model.bounds);
|
|
166
162
|
model.boundsMTime.modified();
|
|
167
163
|
}
|
|
168
|
-
return model.bounds;
|
|
169
164
|
};
|
|
165
|
+
const superGetBounds = publicAPI.getBounds;
|
|
170
166
|
publicAPI.getBounds = () => {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
167
|
+
publicAPI.computeBounds();
|
|
168
|
+
return superGetBounds();
|
|
169
|
+
};
|
|
170
|
+
const superGetBoundsByReference = publicAPI.getBoundsByReference;
|
|
171
|
+
publicAPI.getBoundsByReference = () => {
|
|
172
|
+
publicAPI.computeBounds();
|
|
173
|
+
return superGetBoundsByReference();
|
|
178
174
|
};
|
|
179
|
-
publicAPI.getCenter = () => vtkBoundingBox.getCenter(
|
|
180
|
-
publicAPI.getLength = () => vtkBoundingBox.getLength(
|
|
181
|
-
publicAPI.getXRange = () => vtkBoundingBox.getXRange(
|
|
182
|
-
publicAPI.getYRange = () => vtkBoundingBox.getYRange(
|
|
183
|
-
publicAPI.getZRange = () => vtkBoundingBox.getZRange(
|
|
175
|
+
publicAPI.getCenter = () => vtkBoundingBox.getCenter(publicAPI.getBoundsByReference());
|
|
176
|
+
publicAPI.getLength = () => vtkBoundingBox.getLength(publicAPI.getBoundsByReference());
|
|
177
|
+
publicAPI.getXRange = () => vtkBoundingBox.getXRange(publicAPI.getBoundsByReference());
|
|
178
|
+
publicAPI.getYRange = () => vtkBoundingBox.getYRange(publicAPI.getBoundsByReference());
|
|
179
|
+
publicAPI.getZRange = () => vtkBoundingBox.getZRange(publicAPI.getBoundsByReference());
|
|
184
180
|
publicAPI.getUserMatrix = () => model.userMatrix;
|
|
185
181
|
function updateIdentityFlag() {
|
|
186
182
|
publicAPI.computeMatrix();
|
|
@@ -227,12 +223,12 @@ function vtkProp3D(publicAPI, model) {
|
|
|
227
223
|
// ----------------------------------------------------------------------------
|
|
228
224
|
|
|
229
225
|
const DEFAULT_VALUES = {
|
|
226
|
+
bounds: [...vtkBoundingBox.INIT_BOUNDS],
|
|
230
227
|
origin: [0, 0, 0],
|
|
231
228
|
position: [0, 0, 0],
|
|
232
229
|
orientation: [0, 0, 0],
|
|
233
230
|
rotation: null,
|
|
234
231
|
scale: [1, 1, 1],
|
|
235
|
-
bounds: [...vtkBoundingBox.INIT_BOUNDS],
|
|
236
232
|
properties: [],
|
|
237
233
|
userMatrix: null,
|
|
238
234
|
userMatrixMTime: null,
|
|
@@ -256,6 +252,7 @@ function extend(publicAPI, model, initialValues = {}) {
|
|
|
256
252
|
macro.getArray(publicAPI, model, ['orientation']);
|
|
257
253
|
macro.setGetArray(publicAPI, model, ['origin', 'position', 'scale'], 3);
|
|
258
254
|
macro.setGet(publicAPI, model, ['properties']);
|
|
255
|
+
macro.getArray(publicAPI, model, ['bounds'], 6);
|
|
259
256
|
|
|
260
257
|
// Object internal instance
|
|
261
258
|
model.matrix = mat4.identity(new Float64Array(16));
|
|
@@ -40,12 +40,16 @@ function vtkVolumeMapper(publicAPI, model) {
|
|
|
40
40
|
const superClass = {
|
|
41
41
|
...publicAPI
|
|
42
42
|
};
|
|
43
|
-
publicAPI.
|
|
43
|
+
publicAPI.computeBounds = () => {
|
|
44
|
+
const input = publicAPI.getInputData();
|
|
45
|
+
if (!input) {
|
|
46
|
+
vtkBoundingBox.reset(model.bounds);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
44
49
|
if (!model.static) {
|
|
45
50
|
publicAPI.update();
|
|
46
51
|
}
|
|
47
|
-
model.bounds
|
|
48
|
-
return model.bounds;
|
|
52
|
+
vtkBoundingBox.setBounds(model.bounds, input.getBounds());
|
|
49
53
|
};
|
|
50
54
|
publicAPI.setBlendModeToComposite = () => {
|
|
51
55
|
publicAPI.setBlendMode(BlendMode.COMPOSITE_BLEND);
|