@ohif/app 3.13.0-beta.64 → 3.13.0-beta.66
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/dist/{2851.bundle.f4f60fab803d915d29c9.js → 2851.bundle.8757dd07775645121b52.js} +5 -7
- package/dist/{7537.bundle.1726a7f7a4c378296085.js → 7537.bundle.889ba5f2707418c6fd88.js} +1 -1
- package/dist/{9039.bundle.7afa93b103c3b26d4855.js → 9039.bundle.f72736f47fedeff521e2.js} +123 -47
- package/dist/{9205.bundle.315c3b56464a7590235a.js → 9205.bundle.ed7bce8436a7a431955e.js} +122 -47
- package/dist/{9567.bundle.be350438bed4e656f278.js → 9567.bundle.ff782480a4c66e306027.js} +438 -85
- package/dist/{app.bundle.db872e626c172c6ad084.js → app.bundle.7dbea386d6c9c10848ea.js} +3 -3
- package/dist/{compute.bundle.a41ec0ba4f935200ab93.js → compute.bundle.b7c2ea55f1a69f4a736b.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/{polySeg.bundle.be57af5b834dd833a418.js → polySeg.bundle.e1f6f05d81ea1352bef3.js} +1 -1
- package/dist/sw.js +1 -1
- package/package.json +21 -21
- /package/dist/{1459.bundle.075f1c281d008449f184.js → 1459.bundle.97fb6947a59096bd69ba.js} +0 -0
- /package/dist/{1933.bundle.8ab15ac46f3904309eee.js → 1933.bundle.d265a398d717d9a65980.js} +0 -0
- /package/dist/{2018.bundle.45bbc23e30f022f0f051.js → 2018.bundle.75d45a73f6d29f4502eb.js} +0 -0
- /package/dist/{213.bundle.a5eb36962ddcf90bcf1f.js → 213.bundle.ec5f15baa925dfbfa439.js} +0 -0
- /package/dist/{2424.bundle.aebb08690e66ee2d4cb6.js → 2424.bundle.b79e5c986efb65d01a14.js} +0 -0
- /package/dist/{3138.bundle.3bbb1dcd1744680d059b.js → 3138.bundle.45d9fe9f3ec46eabf6e6.js} +0 -0
- /package/dist/{3461.bundle.1f379ffaaa0fa18a557d.js → 3461.bundle.2524724cb7e8b1a20592.js} +0 -0
- /package/dist/{4507.bundle.5ce023184cf2bcaa1670.js → 4507.bundle.8ffd9859aca01712144c.js} +0 -0
- /package/dist/{4819.bundle.758017f50435d201d4b2.js → 4819.bundle.276d17abd4bb0504612a.js} +0 -0
- /package/dist/{5015.bundle.8c007df25792b1e1f7aa.js → 5015.bundle.23373b09d96bd5fccf83.js} +0 -0
- /package/dist/{5028.bundle.03f40e29fdff23f6849a.js → 5028.bundle.00c40ff6fea856c6f090.js} +0 -0
- /package/dist/{5457.bundle.b44b51c1cd66d564910a.js → 5457.bundle.1bebe4c433dd5945aa2b.js} +0 -0
- /package/dist/{5485.bundle.25750f0b942d84d64902.js → 5485.bundle.adc11bc68e91358ea7bf.js} +0 -0
- /package/dist/{6027.bundle.ec904d1b23d3802ff878.js → 6027.bundle.01b5aca8656c7120845c.js} +0 -0
- /package/dist/{7166.bundle.3dbcf50dcc98c5a2dc58.js → 7166.bundle.12ada8e535973df9c8fd.js} +0 -0
- /package/dist/{7639.bundle.80cfc93c666ebaf624e1.js → 7639.bundle.b3db519e0e73c1efc492.js} +0 -0
- /package/dist/{8305.bundle.fb3d726f0b3cc90f1e0a.js → 8305.bundle.76beb137050442689584.js} +0 -0
- /package/dist/{8499.bundle.5456c7de8e58ee651477.js → 8499.bundle.00368cb353ec9096ba82.js} +0 -0
- /package/dist/{85.bundle.cbf41aeda04786647753.js → 85.bundle.bb782db282876c8b886d.js} +0 -0
- /package/dist/{8558.bundle.deca7697a26442ff37ec.js → 8558.bundle.20a44fd8d2aa42371d80.js} +0 -0
- /package/dist/{8583.bundle.a3c87b570c9206a60c5b.js → 8583.bundle.4d01961aa80e4ca39ea9.js} +0 -0
- /package/dist/{9927.bundle.0c91b35dba333bce3a49.js → 9927.bundle.c2acd65fc6ae5ee07148.js} +0 -0
|
@@ -2779,14 +2779,12 @@ function resolveConfigFetchPolicy(rawUrl, policy = {}) {
|
|
|
2779
2779
|
}
|
|
2780
2780
|
async function fetchConfigJson(normalizedPolicy) {
|
|
2781
2781
|
const {
|
|
2782
|
-
normalizedUrl
|
|
2783
|
-
isAuthenticated,
|
|
2784
|
-
isSameOrigin
|
|
2782
|
+
normalizedUrl
|
|
2785
2783
|
} = normalizedPolicy;
|
|
2786
|
-
const response =
|
|
2784
|
+
const response = await fetch(normalizedUrl, {
|
|
2787
2785
|
method: 'GET',
|
|
2788
2786
|
mode: 'cors',
|
|
2789
|
-
credentials: '
|
|
2787
|
+
credentials: 'same-origin',
|
|
2790
2788
|
redirect: 'error',
|
|
2791
2789
|
referrerPolicy: 'no-referrer'
|
|
2792
2790
|
});
|
|
@@ -10614,8 +10612,8 @@ function AboutModalDefault() {
|
|
|
10614
10612
|
name
|
|
10615
10613
|
} = (0,browser_detect_es5/* default */.A)();
|
|
10616
10614
|
const browser = `${name[0].toUpperCase()}${name.substr(1)} ${version}`;
|
|
10617
|
-
const versionNumber = "3.13.0-beta.
|
|
10618
|
-
const commitHash = "
|
|
10615
|
+
const versionNumber = "3.13.0-beta.66";
|
|
10616
|
+
const commitHash = "468e5734a9ab02516430cc0dab5d7f2106dea950";
|
|
10619
10617
|
const [main, beta] = versionNumber.split('-');
|
|
10620
10618
|
return /*#__PURE__*/react.createElement(ui_next_src/* AboutModal */.VTU, {
|
|
10621
10619
|
className: "w-[400px]"
|
|
@@ -36341,7 +36341,7 @@ function uuidv4() {
|
|
|
36341
36341
|
|
|
36342
36342
|
"use strict";
|
|
36343
36343
|
/* unused harmony export version */
|
|
36344
|
-
const version = '4.
|
|
36344
|
+
const version = '4.22.3';
|
|
36345
36345
|
|
|
36346
36346
|
|
|
36347
36347
|
/***/ },
|
|
@@ -7309,7 +7309,7 @@ var COLOR_LUT = __webpack_require__(93952);
|
|
|
7309
7309
|
|
|
7310
7310
|
|
|
7311
7311
|
;// ../../../node_modules/@cornerstonejs/tools/dist/esm/version.js
|
|
7312
|
-
const version = '4.
|
|
7312
|
+
const version = '4.22.3';
|
|
7313
7313
|
|
|
7314
7314
|
;// ../../../node_modules/@cornerstonejs/tools/dist/esm/synchronizers/callbacks/cameraSyncCallback.js
|
|
7315
7315
|
/* unused harmony import specifier */ var cameraSyncCallback_getRenderingEngine;
|
|
@@ -11343,6 +11343,8 @@ var SphereSource = __webpack_require__(73435);
|
|
|
11343
11343
|
var Plane = __webpack_require__(49794);
|
|
11344
11344
|
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/volumeCropping/index.js + 8 modules
|
|
11345
11345
|
var volumeCropping = __webpack_require__(88380);
|
|
11346
|
+
// EXTERNAL MODULE: ../../../node_modules/@cornerstonejs/tools/dist/esm/utilities/interactionDragCoordinator.js
|
|
11347
|
+
var interactionDragCoordinator = __webpack_require__(51970);
|
|
11346
11348
|
;// ../../../node_modules/@cornerstonejs/tools/dist/esm/tools/VolumeCroppingTool.js
|
|
11347
11349
|
|
|
11348
11350
|
|
|
@@ -11357,6 +11359,7 @@ var volumeCropping = __webpack_require__(88380);
|
|
|
11357
11359
|
|
|
11358
11360
|
|
|
11359
11361
|
|
|
11362
|
+
|
|
11360
11363
|
class VolumeCroppingTool extends base/* BaseTool */.oS {
|
|
11361
11364
|
constructor(toolProps = {}, defaultToolProps = {
|
|
11362
11365
|
configuration: {
|
|
@@ -11387,6 +11390,7 @@ class VolumeCroppingTool extends base/* BaseTool */.oS {
|
|
|
11387
11390
|
this.originalClippingPlanes = [];
|
|
11388
11391
|
this.draggingSphereIndex = null;
|
|
11389
11392
|
this.rotatePlanesOnDrag = false;
|
|
11393
|
+
this.suppressPlaneRotationForCurrentDrag = false;
|
|
11390
11394
|
this.cornerDragOffset = null;
|
|
11391
11395
|
this.faceDragOffset = null;
|
|
11392
11396
|
this.volumeDirectionVectors = null;
|
|
@@ -11409,8 +11413,11 @@ class VolumeCroppingTool extends base/* BaseTool */.oS {
|
|
|
11409
11413
|
const { element } = eventDetail;
|
|
11410
11414
|
const enabledElement = (0,esm.getEnabledElement)(element);
|
|
11411
11415
|
const { viewport } = enabledElement;
|
|
11412
|
-
|
|
11413
|
-
const actor =
|
|
11416
|
+
this.suppressPlaneRotationForCurrentDrag = (0,interactionDragCoordinator/* isDragOwnedBy */.lq)(viewport.id, 'orientation-controller');
|
|
11417
|
+
const actor = this._getVolumeActor(viewport);
|
|
11418
|
+
if (!actor) {
|
|
11419
|
+
return false;
|
|
11420
|
+
}
|
|
11414
11421
|
const mapper = actor.getMapper();
|
|
11415
11422
|
const mouseCanvas = [
|
|
11416
11423
|
evt.detail.currentPoints.canvas[0],
|
|
@@ -11481,6 +11488,7 @@ class VolumeCroppingTool extends base/* BaseTool */.oS {
|
|
|
11481
11488
|
this.draggingSphereIndex = null;
|
|
11482
11489
|
this.cornerDragOffset = null;
|
|
11483
11490
|
this.faceDragOffset = null;
|
|
11491
|
+
this.suppressPlaneRotationForCurrentDrag = false;
|
|
11484
11492
|
viewport.render();
|
|
11485
11493
|
this._hasResolutionChanged = false;
|
|
11486
11494
|
};
|
|
@@ -11638,12 +11646,12 @@ class VolumeCroppingTool extends base/* BaseTool */.oS {
|
|
|
11638
11646
|
if (!viewport) {
|
|
11639
11647
|
return;
|
|
11640
11648
|
}
|
|
11641
|
-
const
|
|
11642
|
-
if (!
|
|
11649
|
+
const volumeActor = this._getVolumeActor(viewport);
|
|
11650
|
+
if (!volumeActor) {
|
|
11643
11651
|
console.warn('VolumeCroppingTool: No volume actors found in the viewport.');
|
|
11644
11652
|
return;
|
|
11645
11653
|
}
|
|
11646
|
-
const imageData =
|
|
11654
|
+
const imageData = volumeActor.getMapper().getInputData();
|
|
11647
11655
|
if (!imageData) {
|
|
11648
11656
|
console.warn('VolumeCroppingTool: No image data found for volume actor.');
|
|
11649
11657
|
return;
|
|
@@ -11765,9 +11773,7 @@ class VolumeCroppingTool extends base/* BaseTool */.oS {
|
|
|
11765
11773
|
this.edgeLines[uid] = { actor, source, key1, key2 };
|
|
11766
11774
|
}
|
|
11767
11775
|
});
|
|
11768
|
-
const mapper =
|
|
11769
|
-
.getDefaultActor()
|
|
11770
|
-
.actor.getMapper();
|
|
11776
|
+
const mapper = volumeActor.getMapper();
|
|
11771
11777
|
mapper.addClippingPlane(planeXMin);
|
|
11772
11778
|
mapper.addClippingPlane(planeXMax);
|
|
11773
11779
|
mapper.addClippingPlane(planeYMin);
|
|
@@ -12114,6 +12120,23 @@ class VolumeCroppingTool extends base/* BaseTool */.oS {
|
|
|
12114
12120
|
getHandlesVisible() {
|
|
12115
12121
|
return this.configuration.showHandles;
|
|
12116
12122
|
}
|
|
12123
|
+
setHandleRadius(radius) {
|
|
12124
|
+
this.configuration.sphereRadius = radius;
|
|
12125
|
+
this.sphereStates.forEach((state) => {
|
|
12126
|
+
if (state?.sphereSource?.setRadius) {
|
|
12127
|
+
state.sphereSource.setRadius(radius);
|
|
12128
|
+
state.sphereSource.modified();
|
|
12129
|
+
}
|
|
12130
|
+
});
|
|
12131
|
+
const viewportsInfo = this._getViewportsInfo();
|
|
12132
|
+
const [viewport3D] = viewportsInfo;
|
|
12133
|
+
if (!viewport3D) {
|
|
12134
|
+
return;
|
|
12135
|
+
}
|
|
12136
|
+
const renderingEngine = (0,esm.getRenderingEngine)(viewport3D.renderingEngineId);
|
|
12137
|
+
const viewport = renderingEngine?.getViewport(viewport3D.viewportId);
|
|
12138
|
+
viewport?.render();
|
|
12139
|
+
}
|
|
12117
12140
|
getClippingPlanesVisible() {
|
|
12118
12141
|
return this.configuration.showClippingPlanes;
|
|
12119
12142
|
}
|
|
@@ -12149,7 +12172,8 @@ class VolumeCroppingTool extends base/* BaseTool */.oS {
|
|
|
12149
12172
|
}
|
|
12150
12173
|
else {
|
|
12151
12174
|
const shiftKey = evt.detail.event?.shiftKey ?? false;
|
|
12152
|
-
if (this.rotatePlanesOnDrag === true || shiftKey)
|
|
12175
|
+
if ((this.rotatePlanesOnDrag === true || shiftKey) &&
|
|
12176
|
+
!this.suppressPlaneRotationForCurrentDrag) {
|
|
12153
12177
|
this._rotateClippingPlanes(evt);
|
|
12154
12178
|
return;
|
|
12155
12179
|
}
|
|
@@ -12207,9 +12231,11 @@ class VolumeCroppingTool extends base/* BaseTool */.oS {
|
|
|
12207
12231
|
}
|
|
12208
12232
|
}
|
|
12209
12233
|
_updateClippingPlanes(viewport) {
|
|
12210
|
-
const
|
|
12211
|
-
const
|
|
12212
|
-
|
|
12234
|
+
const actor = this._getVolumeActor(viewport);
|
|
12235
|
+
const mapper = this._getVolumeMapper(viewport);
|
|
12236
|
+
if (!actor || !mapper) {
|
|
12237
|
+
return;
|
|
12238
|
+
}
|
|
12213
12239
|
const matrix = actor.getMatrix();
|
|
12214
12240
|
if (!this.configuration.showClippingPlanes) {
|
|
12215
12241
|
mapper.removeAllClippingPlanes();
|
|
@@ -12346,7 +12372,10 @@ class VolumeCroppingTool extends base/* BaseTool */.oS {
|
|
|
12346
12372
|
}
|
|
12347
12373
|
_getVolumeActor(viewport) {
|
|
12348
12374
|
const vp = viewport || this._getViewport();
|
|
12349
|
-
return vp
|
|
12375
|
+
return vp
|
|
12376
|
+
?.getActors?.()
|
|
12377
|
+
?.find((entry) => entry.actor?.getClassName?.() === 'vtkVolume')
|
|
12378
|
+
?.actor;
|
|
12350
12379
|
}
|
|
12351
12380
|
_getVolumeMapper(viewport) {
|
|
12352
12381
|
const actor = this._getVolumeActor(viewport);
|
|
@@ -12363,7 +12392,10 @@ class VolumeCroppingTool extends base/* BaseTool */.oS {
|
|
|
12363
12392
|
}
|
|
12364
12393
|
}
|
|
12365
12394
|
_updateClippingPlanesFromFaceSpheres(viewport) {
|
|
12366
|
-
const mapper =
|
|
12395
|
+
const mapper = this._getVolumeMapper(viewport);
|
|
12396
|
+
if (!mapper) {
|
|
12397
|
+
return;
|
|
12398
|
+
}
|
|
12367
12399
|
this.originalClippingPlanes[volumeCropping.PLANEINDEX.XMIN].origin = [
|
|
12368
12400
|
...this.sphereStates[volumeCropping.SPHEREINDEX.XMIN].point,
|
|
12369
12401
|
];
|
|
@@ -16081,7 +16113,7 @@ class MagnifyTool extends base/* BaseTool */.oS {
|
|
|
16081
16113
|
const { viewport } = enabledElement;
|
|
16082
16114
|
const { element } = viewport;
|
|
16083
16115
|
const viewportProperties = viewport.getProperties();
|
|
16084
|
-
const { rotation: originalViewportRotation } = viewport.getViewPresentation();
|
|
16116
|
+
const { rotation: originalViewportRotation, flipHorizontal: originalViewportFlipHorizontal, flipVertical: originalViewportFlipVertical, } = viewport.getViewPresentation();
|
|
16085
16117
|
const { canvas: canvasPos, world: worldPos } = currentPoints;
|
|
16086
16118
|
let magnifyToolElement;
|
|
16087
16119
|
magnifyToolElement = element.querySelector('.magnifyTool');
|
|
@@ -16112,6 +16144,8 @@ class MagnifyTool extends base/* BaseTool */.oS {
|
|
|
16112
16144
|
magnifyViewport.setProperties(viewportProperties);
|
|
16113
16145
|
magnifyViewport.setViewPresentation({
|
|
16114
16146
|
rotation: originalViewportRotation,
|
|
16147
|
+
flipHorizontal: originalViewportFlipHorizontal,
|
|
16148
|
+
flipVertical: originalViewportFlipVertical,
|
|
16115
16149
|
});
|
|
16116
16150
|
const { parallelScale } = viewport.getCamera();
|
|
16117
16151
|
const { focalPoint, position, viewPlaneNormal } = magnifyViewport.getCamera();
|
|
@@ -17134,6 +17168,7 @@ class AdvancedMagnifyViewport {
|
|
|
17134
17168
|
_syncViewportsCameras(sourceViewport, magnifyViewport) {
|
|
17135
17169
|
const worldPos = sourceViewport.canvasToWorld(this.position);
|
|
17136
17170
|
const parallelScale = this._convertZoomFactorToParallelScale(sourceViewport, magnifyViewport, this.zoomFactor);
|
|
17171
|
+
const { flipHorizontal, flipVertical } = sourceViewport.getCamera();
|
|
17137
17172
|
const { focalPoint, position, viewPlaneNormal } = magnifyViewport.getCamera();
|
|
17138
17173
|
const distance = Math.sqrt(Math.pow(focalPoint[0] - position[0], 2) +
|
|
17139
17174
|
Math.pow(focalPoint[1] - position[1], 2) +
|
|
@@ -17152,6 +17187,8 @@ class AdvancedMagnifyViewport {
|
|
|
17152
17187
|
parallelScale,
|
|
17153
17188
|
focalPoint: updatedFocalPoint,
|
|
17154
17189
|
position: updatedPosition,
|
|
17190
|
+
flipHorizontal,
|
|
17191
|
+
flipVertical,
|
|
17155
17192
|
});
|
|
17156
17193
|
}
|
|
17157
17194
|
_syncStackViewports(sourceViewport, magnifyViewport) {
|
|
@@ -29447,12 +29484,19 @@ class OrientationControllerTool extends base/* BaseTool */.oS {
|
|
|
29447
29484
|
showEdgeFaces: true,
|
|
29448
29485
|
showCornerFaces: true,
|
|
29449
29486
|
keepOrientationUp: true,
|
|
29487
|
+
highlightColor: [255, 255, 255],
|
|
29488
|
+
edgeColor: [200, 200, 200],
|
|
29489
|
+
cornerColor: [150, 150, 150],
|
|
29490
|
+
restingAmbient: 1.0,
|
|
29491
|
+
hoverAmbient: 1.0,
|
|
29450
29492
|
},
|
|
29451
29493
|
}) {
|
|
29452
29494
|
super(toolProps, defaultToolProps);
|
|
29453
29495
|
this.widget = new OrientationControllerWidget/* vtkOrientationControllerWidget */.C();
|
|
29454
29496
|
this.resizeObservers = new Map();
|
|
29455
29497
|
this.cameraHandlers = new Map();
|
|
29498
|
+
this.animationFrameHandles = new Map();
|
|
29499
|
+
this.animationTokens = new Map();
|
|
29456
29500
|
this._getViewportsInfo = () => {
|
|
29457
29501
|
const viewports = (0,ToolGroupManager.getToolGroup)(this.toolGroupId)?.viewportsInfo;
|
|
29458
29502
|
return viewports || [];
|
|
@@ -29546,6 +29590,7 @@ class OrientationControllerTool extends base/* BaseTool */.oS {
|
|
|
29546
29590
|
}
|
|
29547
29591
|
const volumeViewport = viewport;
|
|
29548
29592
|
this.widget.positionActors(volumeViewport, actors, this.getPositionConfig());
|
|
29593
|
+
this.widget.syncOverlayViewport(viewportId, volumeViewport);
|
|
29549
29594
|
viewport.render();
|
|
29550
29595
|
};
|
|
29551
29596
|
}
|
|
@@ -29611,6 +29656,9 @@ class OrientationControllerTool extends base/* BaseTool */.oS {
|
|
|
29611
29656
|
this.resizeObservers.forEach((observer) => observer.disconnect());
|
|
29612
29657
|
this.resizeObservers.clear();
|
|
29613
29658
|
this.cameraHandlers.clear();
|
|
29659
|
+
this.animationFrameHandles.forEach((handle) => cancelAnimationFrame(handle));
|
|
29660
|
+
this.animationFrameHandles.clear();
|
|
29661
|
+
this.animationTokens.clear();
|
|
29614
29662
|
}
|
|
29615
29663
|
createAnnotatedRhombActor() {
|
|
29616
29664
|
const faceColors = this.getFaceColors();
|
|
@@ -29621,9 +29669,17 @@ class OrientationControllerTool extends base/* BaseTool */.oS {
|
|
|
29621
29669
|
opacity: this.configuration.opacity ?? 1.0,
|
|
29622
29670
|
showEdgeFaces: this.configuration.showEdgeFaces !== false,
|
|
29623
29671
|
showCornerFaces: this.configuration.showCornerFaces !== false,
|
|
29672
|
+
highlightColor: this.configuration.highlightColor ?? [255, 255, 255],
|
|
29673
|
+
edgeColor: this.configuration.edgeColor ?? [200, 200, 200],
|
|
29674
|
+
cornerColor: this.configuration.cornerColor ?? [150, 150, 150],
|
|
29675
|
+
restingAmbient: this.configuration.restingAmbient ?? 1.0,
|
|
29676
|
+
hoverAmbient: this.configuration.hoverAmbient ?? 1.0,
|
|
29624
29677
|
});
|
|
29625
29678
|
}
|
|
29626
29679
|
addMarkerToViewport(viewportId, renderingEngineId) {
|
|
29680
|
+
if (this.widget.getActors(viewportId)) {
|
|
29681
|
+
return;
|
|
29682
|
+
}
|
|
29627
29683
|
const enabledElement = (0,esm.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
29628
29684
|
if (!enabledElement) {
|
|
29629
29685
|
console.warn('OrientationControllerTool: No enabled element found');
|
|
@@ -29664,8 +29720,8 @@ class OrientationControllerTool extends base/* BaseTool */.oS {
|
|
|
29664
29720
|
}
|
|
29665
29721
|
},
|
|
29666
29722
|
onFaceHover: (result) => {
|
|
29667
|
-
if (result
|
|
29668
|
-
this.widget.highlightFace(result.pickedActor, result.cellId, volumeViewport,
|
|
29723
|
+
if (result) {
|
|
29724
|
+
this.widget.highlightFace(result.pickedActor, result.cellId, volumeViewport, result.actorIndex === 0);
|
|
29669
29725
|
}
|
|
29670
29726
|
else {
|
|
29671
29727
|
this.widget.clearHighlight();
|
|
@@ -29704,6 +29760,14 @@ class OrientationControllerTool extends base/* BaseTool */.oS {
|
|
|
29704
29760
|
viewport.render();
|
|
29705
29761
|
}
|
|
29706
29762
|
animateCameraToOrientation(viewport, targetViewPlaneNormal, targetViewUp) {
|
|
29763
|
+
const viewportId = viewport.id;
|
|
29764
|
+
const existingHandle = this.animationFrameHandles.get(viewportId);
|
|
29765
|
+
if (existingHandle !== undefined) {
|
|
29766
|
+
cancelAnimationFrame(existingHandle);
|
|
29767
|
+
this.animationFrameHandles.delete(viewportId);
|
|
29768
|
+
}
|
|
29769
|
+
const nextToken = (this.animationTokens.get(viewportId) ?? 0) + 1;
|
|
29770
|
+
this.animationTokens.set(viewportId, nextToken);
|
|
29707
29771
|
const keepOrientationUp = this.configuration.keepOrientationUp !== false;
|
|
29708
29772
|
const renderer = viewport.getRenderer();
|
|
29709
29773
|
const camera = renderer.getActiveCamera();
|
|
@@ -29715,34 +29779,33 @@ class OrientationControllerTool extends base/* BaseTool */.oS {
|
|
|
29715
29779
|
gl_matrix_esm/* vec3.cross */.eR.cross(startRight, startUp, startForward);
|
|
29716
29780
|
gl_matrix_esm/* vec3.normalize */.eR.normalize(startRight, startRight);
|
|
29717
29781
|
const startMatrix = gl_matrix_esm/* mat4.fromValues */.pB.fromValues(startRight[0], startRight[1], startRight[2], 0, startUp[0], startUp[1], startUp[2], 0, startForward[0], startForward[1], startForward[2], 0, 0, 0, 0, 1);
|
|
29782
|
+
const targetForward = gl_matrix_esm/* vec3.normalize */.eR.normalize(gl_matrix_esm/* vec3.create */.eR.create(), targetViewPlaneNormal);
|
|
29718
29783
|
let targetUp;
|
|
29719
29784
|
if (keepOrientationUp) {
|
|
29720
29785
|
targetUp = gl_matrix_esm/* vec3.fromValues */.eR.fromValues(targetViewUp[0], targetViewUp[1], targetViewUp[2]);
|
|
29721
29786
|
}
|
|
29722
29787
|
else {
|
|
29723
|
-
const
|
|
29724
|
-
const
|
|
29725
|
-
gl_matrix_esm/*
|
|
29726
|
-
const dot = gl_matrix_esm/* vec3.dot */.eR.dot(currentUp, normalizedForward);
|
|
29788
|
+
const currentFwd = gl_matrix_esm/* vec3.normalize */.eR.normalize(gl_matrix_esm/* vec3.create */.eR.create(), startForward);
|
|
29789
|
+
const rotQuat = gl_matrix_esm/* quat.create */.Yu.create();
|
|
29790
|
+
gl_matrix_esm/* quat.rotationTo */.Yu.rotationTo(rotQuat, currentFwd, targetForward);
|
|
29727
29791
|
targetUp = gl_matrix_esm/* vec3.create */.eR.create();
|
|
29728
|
-
gl_matrix_esm/* vec3.
|
|
29792
|
+
gl_matrix_esm/* vec3.transformQuat */.eR.transformQuat(targetUp, startUp, rotQuat);
|
|
29729
29793
|
gl_matrix_esm/* vec3.normalize */.eR.normalize(targetUp, targetUp);
|
|
29730
|
-
if (gl_matrix_esm/* vec3.length */.eR.length(targetUp) < 0.001) {
|
|
29731
|
-
if (Math.abs(normalizedForward[2]) < 0.9) {
|
|
29732
|
-
targetUp = gl_matrix_esm/* vec3.fromValues */.eR.fromValues(0, 0, 1);
|
|
29733
|
-
}
|
|
29734
|
-
else {
|
|
29735
|
-
targetUp = gl_matrix_esm/* vec3.fromValues */.eR.fromValues(0, 1, 0);
|
|
29736
|
-
}
|
|
29737
|
-
const dot2 = gl_matrix_esm/* vec3.dot */.eR.dot(targetUp, normalizedForward);
|
|
29738
|
-
gl_matrix_esm/* vec3.scaleAndAdd */.eR.scaleAndAdd(targetUp, targetUp, normalizedForward, -dot2);
|
|
29739
|
-
gl_matrix_esm/* vec3.normalize */.eR.normalize(targetUp, targetUp);
|
|
29740
|
-
}
|
|
29741
29794
|
}
|
|
29795
|
+
const upDotForward = gl_matrix_esm/* vec3.dot */.eR.dot(targetUp, targetForward);
|
|
29796
|
+
gl_matrix_esm/* vec3.scaleAndAdd */.eR.scaleAndAdd(targetUp, targetUp, targetForward, -upDotForward);
|
|
29797
|
+
if (gl_matrix_esm/* vec3.length */.eR.length(targetUp) < 0.0001) {
|
|
29798
|
+
targetUp = gl_matrix_esm/* vec3.clone */.eR.clone(startUp);
|
|
29799
|
+
const fallbackDot = gl_matrix_esm/* vec3.dot */.eR.dot(targetUp, targetForward);
|
|
29800
|
+
gl_matrix_esm/* vec3.scaleAndAdd */.eR.scaleAndAdd(targetUp, targetUp, targetForward, -fallbackDot);
|
|
29801
|
+
}
|
|
29802
|
+
gl_matrix_esm/* vec3.normalize */.eR.normalize(targetUp, targetUp);
|
|
29742
29803
|
const targetRight = gl_matrix_esm/* vec3.create */.eR.create();
|
|
29743
|
-
gl_matrix_esm/* vec3.cross */.eR.cross(targetRight, targetUp,
|
|
29804
|
+
gl_matrix_esm/* vec3.cross */.eR.cross(targetRight, targetUp, targetForward);
|
|
29744
29805
|
gl_matrix_esm/* vec3.normalize */.eR.normalize(targetRight, targetRight);
|
|
29745
|
-
|
|
29806
|
+
gl_matrix_esm/* vec3.cross */.eR.cross(targetUp, targetForward, targetRight);
|
|
29807
|
+
gl_matrix_esm/* vec3.normalize */.eR.normalize(targetUp, targetUp);
|
|
29808
|
+
const targetMatrix = gl_matrix_esm/* mat4.fromValues */.pB.fromValues(targetRight[0], targetRight[1], targetRight[2], 0, targetUp[0], targetUp[1], targetUp[2], 0, targetForward[0], targetForward[1], targetForward[2], 0, 0, 0, 0, 1);
|
|
29746
29809
|
const startQuat = gl_matrix_esm/* mat4.getRotation */.pB.getRotation(gl_matrix_esm/* quat.create */.Yu.create(), startMatrix);
|
|
29747
29810
|
const targetQuat = gl_matrix_esm/* mat4.getRotation */.pB.getRotation(gl_matrix_esm/* quat.create */.Yu.create(), targetMatrix);
|
|
29748
29811
|
let dotProduct = gl_matrix_esm/* quat.dot */.Yu.dot(startQuat, targetQuat);
|
|
@@ -29754,13 +29817,21 @@ class OrientationControllerTool extends base/* BaseTool */.oS {
|
|
|
29754
29817
|
if (dotProduct > threshold) {
|
|
29755
29818
|
return;
|
|
29756
29819
|
}
|
|
29757
|
-
const steps = 10;
|
|
29758
29820
|
const duration = 150;
|
|
29759
|
-
const
|
|
29760
|
-
|
|
29761
|
-
|
|
29762
|
-
|
|
29763
|
-
|
|
29821
|
+
const animationStart = performance.now();
|
|
29822
|
+
const finalNormal = [
|
|
29823
|
+
targetForward[0],
|
|
29824
|
+
targetForward[1],
|
|
29825
|
+
targetForward[2],
|
|
29826
|
+
];
|
|
29827
|
+
const finalUp = [targetUp[0], targetUp[1], targetUp[2]];
|
|
29828
|
+
const animate = (now) => {
|
|
29829
|
+
if (this.animationTokens.get(viewportId) !== nextToken) {
|
|
29830
|
+
return;
|
|
29831
|
+
}
|
|
29832
|
+
const elapsed = now - animationStart;
|
|
29833
|
+
const t = Math.min(1, elapsed / duration);
|
|
29834
|
+
const isLastStep = t >= 1;
|
|
29764
29835
|
const easedT = t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2;
|
|
29765
29836
|
const interpolatedQuat = gl_matrix_esm/* quat.create */.Yu.create();
|
|
29766
29837
|
gl_matrix_esm/* quat.slerp */.Yu.slerp(interpolatedQuat, startQuat, targetQuat, easedT);
|
|
@@ -29769,16 +29840,21 @@ class OrientationControllerTool extends base/* BaseTool */.oS {
|
|
|
29769
29840
|
const interpolatedForward = interpolatedMatrix.slice(8, 11);
|
|
29770
29841
|
const interpolatedUp = interpolatedMatrix.slice(4, 7);
|
|
29771
29842
|
viewport.setCamera({
|
|
29772
|
-
viewPlaneNormal: interpolatedForward,
|
|
29773
|
-
viewUp: interpolatedUp,
|
|
29843
|
+
viewPlaneNormal: isLastStep ? finalNormal : interpolatedForward,
|
|
29844
|
+
viewUp: isLastStep ? finalUp : interpolatedUp,
|
|
29774
29845
|
});
|
|
29775
29846
|
viewport.resetCamera(ANIMATE_RESET_CAMERA_OPTIONS);
|
|
29776
29847
|
viewport.render();
|
|
29777
|
-
if (
|
|
29778
|
-
|
|
29848
|
+
if (!isLastStep) {
|
|
29849
|
+
const handle = requestAnimationFrame(animate);
|
|
29850
|
+
this.animationFrameHandles.set(viewportId, handle);
|
|
29851
|
+
}
|
|
29852
|
+
else {
|
|
29853
|
+
this.animationFrameHandles.delete(viewportId);
|
|
29779
29854
|
}
|
|
29780
29855
|
};
|
|
29781
|
-
animate
|
|
29856
|
+
const handle = requestAnimationFrame(animate);
|
|
29857
|
+
this.animationFrameHandles.set(viewportId, handle);
|
|
29782
29858
|
}
|
|
29783
29859
|
}
|
|
29784
29860
|
/* harmony default export */ const tools_OrientationControllerTool = ((/* unused pure expression or super */ null && (OrientationControllerTool)));
|