Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions packages/core/src/RenderingEngine/BaseVolumeViewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ abstract class BaseVolumeViewport extends Viewport {

protected applyViewOrientation(
orientation: OrientationAxis | OrientationVectors,
resetCamera = true
resetCamera = true,
suppressEvents = false
) {
const { viewPlaneNormal, viewUp } =
this._getOrientationVectors(orientation) || {};
Expand All @@ -178,7 +179,11 @@ abstract class BaseVolumeViewport extends Viewport {

if (resetCamera) {
const t = this as unknown as IVolumeViewport;
t.resetCamera({ resetOrientation: false, resetRotation: false });
t.resetCamera({
resetOrientation: false,
resetRotation: false,
suppressEvents,
});
}
}

Expand Down Expand Up @@ -870,7 +875,11 @@ abstract class BaseVolumeViewport extends Viewport {
if (refViewPlaneNormal && !isNegativeNormal && !isSameNormal) {
// Need to update the orientation vectors correctly for this case
// this.setCameraNoEvent({ viewPlaneNormal: refViewPlaneNormal, viewUp });
this.setOrientation({ viewPlaneNormal: refViewPlaneNormal, viewUp });
this.setOrientation(
{ viewPlaneNormal: refViewPlaneNormal, viewUp },
true,
true
);
this.setViewReference(viewRef);
return;
}
Expand Down Expand Up @@ -1510,7 +1519,8 @@ abstract class BaseVolumeViewport extends Viewport {
*/
public setOrientation(
_orientation: OrientationAxis | OrientationVectors,
_immediate = true
_immediate = true,
_suppressEvents = false
): void {
console.warn('Method "setOrientation" needs implementation');
}
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/RenderingEngine/VolumeViewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ class VolumeViewport extends BaseVolumeViewport {
*/
public setOrientation(
orientation: OrientationAxis | OrientationVectors,
immediate = true
immediate = true,
suppressEvents = false
): void {
let viewPlaneNormal, viewUp;

Expand Down Expand Up @@ -223,7 +224,7 @@ class VolumeViewport extends BaseVolumeViewport {
this.resetCamera();
} else {
({ viewPlaneNormal, viewUp } = orientation);
this.applyViewOrientation(orientation);
this.applyViewOrientation(orientation, true, suppressEvents);
}

if (immediate) {
Expand Down
Loading