fix(Volume3DViewport): Added pan and zoom (#3283)
This commit is contained in:
parent
8e9d7bd2bb
commit
d3200a6383
@ -228,6 +228,14 @@ function initVolume3DToolGroup(extensionManager, toolGroupService) {
|
|||||||
toolName: toolNames.TrackballRotateTool,
|
toolName: toolNames.TrackballRotateTool,
|
||||||
bindings: [{ mouseButton: Enums.MouseBindings.Primary }],
|
bindings: [{ mouseButton: Enums.MouseBindings.Primary }],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
toolName: toolNames.Zoom,
|
||||||
|
bindings: [{ mouseButton: Enums.MouseBindings.Secondary }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
toolName: toolNames.Pan,
|
||||||
|
bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -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 = [
|
const toolbarButtons = [
|
||||||
// Measurement
|
// Measurement
|
||||||
{
|
{
|
||||||
@ -199,15 +219,7 @@ const toolbarButtons = [
|
|||||||
type: 'tool',
|
type: 'tool',
|
||||||
icon: 'tool-zoom',
|
icon: 'tool-zoom',
|
||||||
label: 'Zoom',
|
label: 'Zoom',
|
||||||
commands: [
|
commands: _createSetToolActiveCommands('Zoom'),
|
||||||
{
|
|
||||||
commandName: 'setToolActive',
|
|
||||||
commandOptions: {
|
|
||||||
toolName: 'Zoom',
|
|
||||||
},
|
|
||||||
context: 'CORNERSTONE',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Window Level + Presets...
|
// Window Level + Presets...
|
||||||
@ -256,15 +268,7 @@ const toolbarButtons = [
|
|||||||
type: 'tool',
|
type: 'tool',
|
||||||
icon: 'tool-move',
|
icon: 'tool-move',
|
||||||
label: 'Pan',
|
label: 'Pan',
|
||||||
commands: [
|
commands: _createSetToolActiveCommands('Pan'),
|
||||||
{
|
|
||||||
commandName: 'setToolActive',
|
|
||||||
commandOptions: {
|
|
||||||
toolName: 'Pan',
|
|
||||||
},
|
|
||||||
context: 'CORNERSTONE',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user