@kitware/vtk.js 22.5.8 → 22.6.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.
|
@@ -224,7 +224,11 @@ function vtkColorTransferFunction(publicAPI, model) {
|
|
|
224
224
|
var before = JSON.stringify(model.nodes);
|
|
225
225
|
model.nodes = nodes;
|
|
226
226
|
var after = JSON.stringify(model.nodes);
|
|
227
|
-
|
|
227
|
+
|
|
228
|
+
if (publicAPI.sortAndUpdateRange() || before !== after) {
|
|
229
|
+
publicAPI.modified();
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
228
232
|
}
|
|
229
233
|
|
|
230
234
|
return false;
|
|
@@ -383,7 +383,17 @@ function vtkOpenGLImageMapper(publicAPI, model) {
|
|
|
383
383
|
|
|
384
384
|
var image = model.currentInput;
|
|
385
385
|
var w2imat4 = image.getWorldToIndex();
|
|
386
|
-
|
|
386
|
+
var shiftScaleEnabled = cellBO.getCABO().getCoordShiftAndScaleEnabled();
|
|
387
|
+
var inverseShiftScaleMatrix = shiftScaleEnabled ? cellBO.getCABO().getInverseShiftAndScaleMatrix() : null;
|
|
388
|
+
var mat = inverseShiftScaleMatrix ? mat4.copy(model.imagematinv, actor.getMatrix()) : actor.getMatrix();
|
|
389
|
+
|
|
390
|
+
if (inverseShiftScaleMatrix) {
|
|
391
|
+
mat4.transpose(mat, mat);
|
|
392
|
+
mat4.multiply(mat, mat, inverseShiftScaleMatrix);
|
|
393
|
+
mat4.transpose(mat, mat);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
mat4.multiply(model.imagematinv, mat, w2imat4);
|
|
387
397
|
var planeEquations = [];
|
|
388
398
|
|
|
389
399
|
for (var _i3 = 0; _i3 < numClipPlanes; _i3++) {
|
|
@@ -710,10 +710,19 @@ function vtkOpenGLPolyDataMapper(publicAPI, model) {
|
|
|
710
710
|
// add all the clipping planes
|
|
711
711
|
var numClipPlanes = model.renderable.getNumberOfClippingPlanes();
|
|
712
712
|
var planeEquations = [];
|
|
713
|
+
var shiftScaleEnabled = cellBO.getCABO().getCoordShiftAndScaleEnabled();
|
|
714
|
+
var inverseShiftScaleMatrix = shiftScaleEnabled ? cellBO.getCABO().getInverseShiftAndScaleMatrix() : null;
|
|
715
|
+
var mat = inverseShiftScaleMatrix ? mat4.copy(model.tmpMat4, actor.getMatrix()) : actor.getMatrix();
|
|
716
|
+
|
|
717
|
+
if (inverseShiftScaleMatrix) {
|
|
718
|
+
mat4.transpose(mat, mat);
|
|
719
|
+
mat4.multiply(mat, mat, inverseShiftScaleMatrix);
|
|
720
|
+
mat4.transpose(mat, mat);
|
|
721
|
+
}
|
|
713
722
|
|
|
714
723
|
for (var i = 0; i < numClipPlanes; i++) {
|
|
715
724
|
var planeEquation = [];
|
|
716
|
-
model.renderable.getClippingPlaneInDataCoords(
|
|
725
|
+
model.renderable.getClippingPlaneInDataCoords(mat, i, planeEquation);
|
|
717
726
|
|
|
718
727
|
for (var j = 0; j < 4; j++) {
|
|
719
728
|
planeEquations.push(planeEquation[j]);
|
|
@@ -175,9 +175,15 @@ function vtkImplicitPlaneRepresentation(publicAPI, model) {
|
|
|
175
175
|
// Update normal parameters
|
|
176
176
|
// --------------------------------
|
|
177
177
|
|
|
178
|
+
var pixelScale = 1;
|
|
179
|
+
|
|
180
|
+
if (model.scaleInPixels) {
|
|
181
|
+
pixelScale = publicAPI.getPixelWorldHeightAtCoord(origin);
|
|
182
|
+
}
|
|
183
|
+
|
|
178
184
|
model.pipelines.normal.source.set({
|
|
179
185
|
height: Math.max(xRange, yRange, zRange),
|
|
180
|
-
radius: model.handleSizeRatio * Math.min(xRange, yRange, zRange) * model.axisScale,
|
|
186
|
+
radius: model.handleSizeRatio * Math.min(xRange, yRange, zRange) * model.axisScale * pixelScale,
|
|
181
187
|
resolution: model.sphereResolution
|
|
182
188
|
});
|
|
183
189
|
var yAxis = model.pipelines.normal.source.getOutputData();
|
|
@@ -191,7 +197,7 @@ function vtkImplicitPlaneRepresentation(publicAPI, model) {
|
|
|
191
197
|
// --------------------------------
|
|
192
198
|
|
|
193
199
|
model.pipelines.origin.actor.setPosition(origin);
|
|
194
|
-
var handleScale = model.handleSizeRatio * Math.min(xRange, yRange, zRange);
|
|
200
|
+
var handleScale = model.handleSizeRatio * Math.min(xRange, yRange, zRange) * pixelScale;
|
|
195
201
|
model.pipelines.origin.actor.setScale(handleScale, handleScale, handleScale); // --------------------------------
|
|
196
202
|
// Update style since state changed
|
|
197
203
|
// --------------------------------
|