@kitware/vtk.js
Version:
Visualization Toolkit for the Web
55 lines (50 loc) • 1.54 kB
JavaScript
import { ViewTypes } from '../../Core/WidgetManager/Constants.js';
const ScrollingMethods = {
MIDDLE_MOUSE_BUTTON: 0,
LEFT_MOUSE_BUTTON: 1,
RIGHT_MOUSE_BUTTON: 2
};
// Note: These strings are used in ResliceCursorWidget/behavior.js
// as method's names
const InteractionMethodsName = {
TranslateAxis: 'translateAxis',
RotateLine: 'rotateLine',
TranslateCenter: 'translateCenter',
TranslateCenterAndUpdatePlanes: 'translateCenterAndUpdatePlanes'
};
const defaultViewUpFromViewType = {
[]: [0, 0, 1],
// Sagittal
[]: [0, 0, 1],
// Coronal
[]: [0, -1, 0] // Axial
};
const xyzToViewType = [ViewTypes.YZ_PLANE, ViewTypes.XZ_PLANE, ViewTypes.XY_PLANE];
const viewTypeToXYZ = {
[]: 0,
[]: 1,
[]: 2
};
const planeNames = ['X', 'Y', 'Z'];
const viewTypeToPlaneName = {
[]: 'X',
[]: 'Y',
[]: 'Z'
};
const planeNameToViewType = {
X: ViewTypes.YZ_PLANE,
Y: ViewTypes.XZ_PLANE,
Z: ViewTypes.XY_PLANE
};
const lineNames = ['YinX', 'ZinX', 'XinY', 'ZinY', 'XinZ', 'YinZ'];
var Constants = {
ScrollingMethods,
InteractionMethodsName,
xyzToViewType,
viewTypeToXYZ,
planeNames,
viewTypeToPlaneName,
planeNameToViewType,
lineNames
};
export { InteractionMethodsName, ScrollingMethods, Constants as default, defaultViewUpFromViewType, lineNames, planeNameToViewType, planeNames, viewTypeToPlaneName, viewTypeToXYZ, xyzToViewType };