fix(Volume3DViewport): Added pan and zoom (#3283)

This commit is contained in:
Joe Boccanfuso authored and GitHub committed 2023-03-27 12:17:38 -04:00
1 parent 8e9d7bd2bb
commit d3200a6383
2 files changed
+30 -18

No files matched your search

+8
View File
@@ -228,6 +228,14 @@ function initVolume3DToolGroup(extensionManager, toolGroupService) {
toolName: toolNames.TrackballRotateTool,
bindings: [{ mouseButton: Enums.MouseBindings.Primary }],
},
{
toolName: toolNames.Zoom,
bindings: [{ mouseButton: Enums.MouseBindings.Secondary }],
},
{
toolName: toolNames.Pan,
bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }],
},
],
};
+22 -18
View File
@@ -55,6 +55,26 @@ function _createWwwcPreset(preset, title, subtitle) {
};
}
const toolGroupIds = ['default', 'mpr', 'SRToolGroup'];
/**
* Creates an array of 'setToolActive' commands for the given toolName - one for
* each toolGroupId specified in toolGroupIds.
* @param {string} toolName
* @returns {Array} an array of 'setToolActive' commands
*/
function _createSetToolActiveCommands(toolName) {
const temp = toolGroupIds.map(toolGroupId => ({
commandName: 'setToolActive',
commandOptions: {
toolGroupId,
toolName,
},
context: 'CORNERSTONE',
}));
return temp;
}
const toolbarButtons = [
// Measurement
{
@@ -199,15 +219,7 @@ const toolbarButtons = [
type: 'tool',
icon: 'tool-zoom',
label: 'Zoom',
commands: [
{
commandName: 'setToolActive',
commandOptions: {
toolName: 'Zoom',
},
context: 'CORNERSTONE',
},
],
commands: _createSetToolActiveCommands('Zoom'),
},
},
// Window Level + Presets...
@@ -256,15 +268,7 @@ const toolbarButtons = [
type: 'tool',
icon: 'tool-move',
label: 'Pan',
commands: [
{
commandName: 'setToolActive',
commandOptions: {
toolName: 'Pan',
},
context: 'CORNERSTONE',
},
],
commands: _createSetToolActiveCommands('Pan'),
},
},
{