Files
ohif-viewer/extensions/vtk/src/utils/setMPRLayout.js
T
Danny Brown b01b0108b0 refactor: layout manager to viewer (#1026)
* docs: formatting

* Prefer numRows and numColumns to percentage width/height for layout

* fix: LayoutManager --> ViewportGrid (get out of UI component library)

* docs: remove outdated docs

* Don't expose ExampleDropTarget

* Revert thumnail entry drag source removal

* Update screaming tests

* fix drag-n-drop

* fix vtk mpr2d CC: @jamesapetts

* remove setSingleLayoutData

* remove vtk qualifier
2019-10-11 12:03:59 -04:00

45 lines
1.0 KiB
JavaScript

import setLayoutAndViewportData from './setLayoutAndViewportData.js';
export default function setMPRLayout(displaySet) {
return new Promise((resolve, reject) => {
const viewports = [];
const numRows = 1;
const numColumns = 3;
const numViewports = numRows * numColumns;
const viewportSpecificData = {};
for (let i = 0; i < numViewports; i++) {
viewports.push({});
viewportSpecificData[i] = displaySet;
viewportSpecificData[i].plugin = 'vtk';
}
const apis = [];
viewports.forEach((viewport, index) => {
apis[index] = null;
viewports[index] = Object.assign({}, viewports[index], {
// plugin: 'vtk',
vtk: {
mode: 'mpr', // TODO: not used
afterCreation: api => {
apis[index] = api;
if (apis.every(a => !!a)) {
resolve(apis);
}
},
},
});
});
setLayoutAndViewportData(
{
numRows,
numColumns,
viewports,
},
viewportSpecificData
);
});
}