@3cr/viewer-browser 0.0.247 → 0.0.292
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +53 -0
- package/README.md +79 -74
- package/components.d.ts +94 -36
- package/dist/Viewer3CR.js +663 -47
- package/dist/Viewer3CR.mjs +108285 -37154
- package/dist/Viewer3CR.umd.js +663 -47
- package/index.html +35 -33
- package/package.json +27 -8
- package/playground/img.png +0 -0
- package/playground/index.html +6 -2
- package/src/App.vue +41 -97
- package/src/__tests__/app.spec.ts +2 -1
- package/src/__tests__/main.spec.ts +14 -14
- package/src/assets/_palette.scss +112 -0
- package/src/assets/_settings.scss +64 -0
- package/src/assets/_typography.scss +187 -0
- package/src/assets/images/cloud-storage.svg +22 -0
- package/src/assets/images/courtney.png +0 -0
- package/src/assets/images/dark/magic-wand.svg +32 -0
- package/src/assets/images/dark-theme.svg +33 -0
- package/src/assets/images/dot.svg +5 -0
- package/src/assets/images/dr-miles.png +0 -0
- package/src/assets/images/illustration.svg +118 -0
- package/src/assets/images/intro.svg +30 -0
- package/src/assets/{magic_wand.svg → images/light/magic-wand.svg} +22 -14
- package/src/assets/images/light-theme.svg +33 -0
- package/src/assets/images/system-theme.svg +51 -0
- package/src/assets/images/totalSegmentator.png +0 -0
- package/src/assets/logos/3dicom/black/black.svg +30 -0
- package/src/assets/logos/3dicom/colour/colour.svg +18 -0
- package/src/assets/logos/3dicom/colour/colour_single.svg +18 -0
- package/src/assets/logos/3dicom/wordmark/patients/patients.svg +29 -0
- package/src/assets/logos/3dicom/wordmark/powered-by/powered-by.svg +41 -0
- package/src/assets/logos/3dicom/wordmark/practitioners/practitioner.svg +34 -0
- package/src/assets/logos/3dicom/wordmark/research/research.svg +29 -0
- package/src/assets/logos/license/black/black.svg +22 -0
- package/src/assets/logos/license/white/white.svg +22 -0
- package/src/assets/styles.scss +435 -12
- package/src/components/ShFlatIconBtn.vue +36 -0
- package/src/components/ShPlainIconBtn.vue +42 -0
- package/src/components/ShSelect.vue +48 -0
- package/src/components/ShTextField.vue +39 -0
- package/src/components/ShTextarea.vue +39 -0
- package/src/components/__tests__/ShFlatIconBtn.spec.ts +32 -0
- package/src/components/__tests__/ShPlainIconBtn.spec.ts +37 -0
- package/src/components/__tests__/ShSelect.spec.ts +30 -0
- package/src/components/__tests__/ShTextField.spec.ts +30 -0
- package/src/components/__tests__/ShTextarea.spec.ts +30 -0
- package/src/components/demo/CloudDropZone.vue +105 -0
- package/src/components/demo/DemoAvatarDropdownMenu.vue +343 -0
- package/src/components/demo/DemoInfoModal.vue +60 -0
- package/src/components/demo/DemoNotificationNavigationDrawer.vue +118 -0
- package/src/components/demo/DemoPurchaseCreditsModal.vue +141 -0
- package/src/components/demo/DemoUpgradeCloudStorageModal.vue +74 -0
- package/src/components/demo/DemoUpgradePlanModal.vue +17 -0
- package/src/components/demo/UploadDicomToCloudModal.vue +225 -0
- package/src/components/demo/__tests__/CloudDropZone.spec.ts +132 -0
- package/src/components/demo/__tests__/DemoAvatarDropdownMenu.spec.ts +16 -0
- package/src/components/demo/{licence/__tests__/DemoLicenceEnableCloudStorageModal.spec.ts → __tests__/DemoEnableCloudStorageModal.spec.ts} +11 -11
- package/src/components/demo/{licence/__tests__/DemoLicenceInfoModal.spec.ts → __tests__/DemoInfoModal.spec.ts} +11 -8
- package/src/components/demo/__tests__/DemoNotificationNavigationDrawer.spec.ts +56 -0
- package/src/components/demo/__tests__/UploadDicomToCloudModal.spec.ts +320 -0
- package/src/components/demo/__tests__/demo-payload.spec.ts +10 -0
- package/src/components/demo/demo-notifications.ts +45 -0
- package/src/components/demo/demo-payload.ts +9 -0
- package/src/components/demo/fileReader.ts +47 -0
- package/src/{composables/useViewerOptions.ts → components/demo/mockDemoViewerStlDecimator.ts} +8 -12
- package/src/components/intro/ViewerIntro.vue +56 -0
- package/src/components/intro/ViewerTour.vue +53 -0
- package/src/components/intro/tour/Tour.vue +205 -0
- package/src/components/intro/tour/step.ts +6 -0
- package/src/components/modal/ActionRail.vue +4 -0
- package/src/components/modal/Viewer3cr.vue +224 -0
- package/src/components/modal/Viewer3crWebGL.vue +65 -0
- package/src/components/modal/ViewerActionRail.vue +10 -27
- package/src/components/modal/ViewerMain.vue +83 -0
- package/src/components/modal/ViewerNavigationDrawer.vue +269 -68
- package/src/components/modal/ViewerScanView.vue +223 -67
- package/src/components/modal/__tests__/{MftpWebGL3DRModal.spec.ts → Viewer3cr.spec.ts} +154 -53
- package/src/components/modal/__tests__/{WebGL3DR.spec.ts → Viewer3crWebGL.spec.ts} +11 -11
- package/src/components/modal/__tests__/ViewerNavigationDrawer.spec.ts +271 -11
- package/src/components/modal/__tests__/ViewerScanView.spec.ts +15 -7
- package/src/components/modal/actions/Action.vue +3 -8
- package/src/components/modal/actions/Flip3dAction.vue +31 -16
- package/src/components/modal/actions/FlipHorizontalAction.vue +14 -5
- package/src/components/modal/actions/FlipVerticalAction.vue +14 -5
- package/src/components/modal/actions/FullscreenAction.vue +9 -5
- package/src/components/modal/actions/PanAction.vue +11 -51
- package/src/components/modal/actions/ResetViewAction.vue +10 -8
- package/src/components/modal/actions/Rotate2dAction.vue +25 -15
- package/src/components/modal/actions/Slice3dAction.vue +22 -10
- package/src/components/modal/actions/ZoomAction.vue +21 -13
- package/src/components/modal/actions/__tests__/Action.spec.ts +2 -2
- package/src/components/modal/actions/__tests__/Flip3dAction.spec.ts +58 -14
- package/src/components/modal/actions/__tests__/FlipHorizontalAction.spec.ts +15 -5
- package/src/components/modal/actions/__tests__/FlipVerticalAction.spec.ts +15 -5
- package/src/components/modal/actions/__tests__/FullscreenAction.spec.ts +7 -5
- package/src/components/modal/actions/__tests__/PanAction.spec.ts +13 -32
- package/src/components/modal/actions/__tests__/ResetViewAction.spec.ts +5 -3
- package/src/components/modal/actions/__tests__/Rotate2dAction.spec.ts +13 -6
- package/src/components/modal/actions/__tests__/Slice3dAction.spec.ts +1 -1
- package/src/components/modal/actions/__tests__/ZoomAction.spec.ts +25 -11
- package/src/components/modal/app-bars/ViewerActionBar.vue +224 -0
- package/src/components/modal/app-bars/ViewerAppBar.vue +126 -0
- package/src/components/modal/app-bars/__tests__/ViewerActionBar.spec.ts +176 -0
- package/src/components/modal/app-bars/__tests__/ViewerAppBar.spec.ts +99 -0
- package/src/components/modal/layouts/Layout1x3ClipPath.vue +35 -0
- package/src/components/modal/layouts/Layout2x2ClipPath.vue +35 -0
- package/src/components/modal/layouts/LayoutFullscreenClipPath.vue +29 -0
- package/src/components/modal/layouts/__tests__/Layout1x3ClipPath.spec.ts +15 -0
- package/src/components/modal/layouts/__tests__/Layout2x2ClipPath.spec.ts +15 -0
- package/src/components/modal/layouts/__tests__/LayoutFullscreenClipPath.spec.ts +15 -0
- package/src/components/modal/layouts/composables/__tests__/useLayout1x3.spec.ts +40 -0
- package/src/components/modal/layouts/composables/__tests__/useLayout2x2.spec.ts +40 -0
- package/src/components/modal/layouts/composables/__tests__/useLayoutFullscreen.spec.ts +40 -0
- package/src/components/modal/layouts/composables/useLayout1x3.ts +46 -0
- package/src/components/modal/layouts/composables/useLayout2x2.ts +46 -0
- package/src/components/modal/layouts/composables/useLayoutFullscreen.ts +24 -0
- package/src/components/modal/menus/AutoAnnotateMenu.vue +67 -0
- package/src/components/modal/menus/AvatarDropdownMenu.vue +66 -0
- package/src/components/modal/menus/HelpMenu.vue +47 -0
- package/src/components/modal/menus/SettingsMenu.vue +242 -92
- package/src/components/modal/menus/ShareMenu.vue +58 -0
- package/src/components/modal/menus/__tests__/AutoAnnotateMenu.spec.ts +80 -0
- package/src/components/modal/menus/__tests__/AvatarDropdownMenu.spec.ts +49 -0
- package/src/components/modal/menus/__tests__/HelpMenu.spec.ts +12 -0
- package/src/components/modal/menus/__tests__/SettingsMenu.spec.ts +163 -57
- package/src/components/modal/modal/AboutModal.vue +61 -0
- package/src/components/modal/modal/AiModelList.vue +70 -0
- package/src/components/modal/{AskAI.vue → modal/AskAiModal.vue} +26 -34
- package/src/components/modal/modal/AutoAnnotateModal.vue +136 -0
- package/src/components/modal/modal/CloseViewerModal.vue +108 -0
- package/src/components/modal/modal/DataOverlayGeneralModal.vue +122 -0
- package/src/components/modal/modal/DataOverlayMeasurementModal.vue +59 -0
- package/src/components/modal/modal/DataOverlayModal.vue +121 -0
- package/src/components/modal/modal/ShareModal.vue +201 -0
- package/src/components/modal/modal/UploadsDrawer.vue +165 -0
- package/src/components/modal/modal/WhatsNewModal.vue +45 -0
- package/src/components/modal/modal/__tests__/AboutModal.spec.ts +60 -0
- package/src/components/modal/modal/__tests__/AiModelList.spec.ts +50 -0
- package/src/components/modal/{__tests__ → modal/__tests__}/AskAI.spec.ts +8 -7
- package/src/components/modal/modal/__tests__/AutoAnnotateModal.spec.ts +29 -0
- package/src/components/modal/modal/__tests__/CloseViewerModal.spec.ts +60 -0
- package/src/components/modal/modal/__tests__/DataOverlayGeneralModal.spec.ts +55 -0
- package/src/components/modal/modal/__tests__/DataOverlayMeasurementModal.spec.ts +82 -0
- package/src/components/modal/modal/__tests__/DataOverlayModal.spec.ts +94 -0
- package/src/components/modal/modal/__tests__/ShareModal.spec.ts +262 -0
- package/src/components/modal/modal/__tests__/UploadsDrawer.spec.ts +174 -0
- package/src/components/modal/modal/__tests__/WhatsNewModal.spec.ts +29 -0
- package/src/components/modal/snackbars/AnnotationGeneratedSnackbar.vue +34 -0
- package/src/components/modal/snackbars/ImagesSharedSnackbar.vue +26 -0
- package/src/components/modal/snackbars/LinkCopiedSnackbar.vue +26 -0
- package/src/components/modal/snackbars/__tests__/AnnotationGeneratedSnackbar.spec.ts +43 -0
- package/src/components/modal/snackbars/__tests__/ImagesSharedSnackbar.spec.ts +22 -0
- package/src/components/modal/snackbars/__tests__/LinkCopiedSnackbar.spec.ts +21 -0
- package/src/components/navigation/annotation/AnnotationCreateModal.vue +114 -0
- package/src/components/navigation/annotation/AnnotationCreateSnackbar.vue +20 -0
- package/src/components/navigation/annotation/AnnotationDataTable.vue +157 -0
- package/src/components/navigation/annotation/AnnotationDeleteModal.vue +48 -0
- package/src/components/navigation/annotation/AnnotationDeleteSnackbar.vue +25 -0
- package/src/components/navigation/annotation/AnnotationForm.vue +277 -0
- package/src/components/navigation/annotation/AnnotationIcon.vue +45 -0
- package/src/components/navigation/annotation/AnnotationInfo.vue +141 -0
- package/src/components/navigation/annotation/AnnotationMenu.vue +99 -0
- package/src/components/navigation/annotation/AnnotationPanel.vue +30 -0
- package/src/components/navigation/annotation/AnnotationTools.vue +104 -0
- package/src/components/navigation/annotation/AnnotationUpdateModal.vue +78 -0
- package/src/components/navigation/annotation/AnnotationVisibilityBtn.vue +52 -0
- package/src/components/navigation/annotation/DrawerTitle.vue +25 -0
- package/src/components/navigation/annotation/__tests__/AnnotationCreateModal.spec.ts +178 -0
- package/src/components/navigation/annotation/__tests__/AnnotationCreateSnackbar.spec.ts +31 -0
- package/src/components/navigation/annotation/__tests__/AnnotationDataTable.spec.ts +79 -0
- package/src/components/navigation/annotation/__tests__/AnnotationDeleteSnackbar.spec.ts +66 -0
- package/src/components/navigation/annotation/__tests__/AnnotationForm.spec.ts +261 -0
- package/src/components/navigation/annotation/__tests__/AnnotationIcon.spec.ts +13 -0
- package/src/components/navigation/annotation/__tests__/AnnotationTools.spec.ts +116 -0
- package/src/components/navigation/display/DisplayPanel.vue +156 -0
- package/src/components/{views/__tests__/DisplaySettings.spec.ts → navigation/display/__tests__/DisplayPanel.spec.ts} +14 -3
- package/src/components/navigation/history/HistoryModal.vue +140 -0
- package/src/components/navigation/mcad/McadAddObjectBtn.vue +41 -0
- package/src/components/navigation/mcad/McadDataTable.vue +78 -0
- package/src/components/navigation/mcad/McadDataTableItems.vue +382 -0
- package/src/components/navigation/mcad/McadDeleteModal.vue +44 -0
- package/src/components/navigation/mcad/McadDropZone.vue +148 -0
- package/src/components/navigation/mcad/McadFloating.vue +193 -0
- package/src/components/navigation/mcad/McadIcon.vue +34 -0
- package/src/components/navigation/mcad/McadInvert.vue +91 -0
- package/src/components/navigation/mcad/McadLockBtn.vue +62 -0
- package/src/components/navigation/mcad/McadMenu.vue +248 -0
- package/src/components/navigation/mcad/McadOpacity.vue +79 -0
- package/src/components/navigation/mcad/McadPanel.vue +31 -0
- package/src/components/navigation/mcad/McadToggleSortBtn.vue +18 -0
- package/src/components/navigation/mcad/McadToggleVisibilityBtn.vue +46 -0
- package/src/components/navigation/mcad/McadUpdateModal.vue +108 -0
- package/src/components/navigation/mcad/McadVisibilityBtn.vue +46 -0
- package/src/components/navigation/mcad/__tests__/McadAddObjectBtn.spec.ts +73 -0
- package/src/components/navigation/mcad/__tests__/McadDataTable.spec.ts +27 -0
- package/src/components/navigation/mcad/__tests__/McadDataTableItems.spec.ts +621 -0
- package/src/components/navigation/mcad/__tests__/McadDeleteModal.spec.ts +67 -0
- package/src/components/navigation/mcad/__tests__/McadDropZone.spec.ts +109 -0
- package/src/components/navigation/mcad/__tests__/McadIcon.spec.ts +13 -0
- package/src/components/navigation/mcad/__tests__/McadInvert.spec.ts +45 -0
- package/src/components/navigation/mcad/__tests__/McadLockBtn.spec.ts +38 -0
- package/src/components/navigation/mcad/__tests__/McadMenu.spec.ts +258 -0
- package/src/components/navigation/mcad/__tests__/McadOpacity.spec.ts +68 -0
- package/src/components/navigation/mcad/__tests__/McadToggleSortBtn.spec.ts +36 -0
- package/src/components/navigation/mcad/__tests__/McadToggleVisibilityBtn.spec.ts +53 -0
- package/src/components/navigation/mcad/__tests__/McadUpdateModal.spec.ts +122 -0
- package/src/components/navigation/mcad/__tests__/McadVisibilityBtn.spec.ts +45 -0
- package/src/components/navigation/measurement/MeasurementAngleSnackbar.vue +18 -0
- package/src/components/navigation/measurement/MeasurementDataTable.vue +162 -0
- package/src/components/navigation/measurement/MeasurementDeleteModal.vue +49 -0
- package/src/components/navigation/measurement/MeasurementDeleteSnackbar.vue +40 -0
- package/src/components/navigation/measurement/MeasurementIcon.vue +41 -0
- package/src/components/navigation/measurement/MeasurementInfo.vue +25 -0
- package/src/components/navigation/measurement/MeasurementInfoAngle.vue +36 -0
- package/src/components/navigation/measurement/MeasurementInfoLength.vue +37 -0
- package/src/components/navigation/measurement/MeasurementInfoPolygon.vue +58 -0
- package/src/components/navigation/measurement/MeasurementLengthSnackbar.vue +18 -0
- package/src/components/navigation/measurement/MeasurementMenu.vue +97 -0
- package/src/components/navigation/measurement/MeasurementPanel.vue +30 -0
- package/src/components/navigation/measurement/MeasurementPolygonSnackbar.vue +18 -0
- package/src/components/navigation/measurement/MeasurementTools.vue +101 -0
- package/src/components/navigation/measurement/MeasurementVisibilityBtn.vue +53 -0
- package/src/components/navigation/measurement/__tests__/MeasurementAngleSnackbar.spec.ts +34 -0
- package/src/components/navigation/measurement/__tests__/MeasurementDataTable.spec.ts +79 -0
- package/src/components/navigation/measurement/__tests__/MeasurementDeleteSnackbar.spec.ts +51 -0
- package/src/components/navigation/measurement/__tests__/MeasurementInfo.spec.ts +77 -0
- package/src/components/navigation/measurement/__tests__/MeasurementLengthSnackbar.spec.ts +35 -0
- package/src/components/navigation/measurement/__tests__/MeasurementPolygonSnackbar.spec.ts +35 -0
- package/src/components/navigation/measurement/__tests__/MeasurementTools.spec.ts +87 -0
- package/src/components/shared/ColourPalette.vue +72 -0
- package/src/components/shared/DoubleSliderSelector.vue +66 -28
- package/src/components/shared/HorizontalSliderSelector.vue +80 -0
- package/src/components/shared/KeyboardShortcuts.vue +184 -0
- package/src/components/shared/LoadingSpinner.vue +508 -144
- package/src/components/shared/MultiLoginError.vue +98 -0
- package/src/components/shared/NotificationToaster.vue +112 -0
- package/src/components/shared/UpdateSnackbar.vue +22 -9
- package/src/components/shared/ValueSelector.vue +10 -10
- package/src/components/shared/VerticalSliderSelector.vue +45 -44
- package/src/components/shared/__tests__/ColourPalette.spec.ts +21 -0
- package/src/components/shared/__tests__/DoubleSliderSelector.spec.ts +58 -46
- package/src/components/shared/__tests__/HorizontalSliderSelector.spec.ts +35 -0
- package/src/components/shared/__tests__/KeyboardShortcuts.spec.ts +50 -0
- package/src/components/shared/__tests__/MultiLoginError.spec.ts +50 -0
- package/src/components/shared/__tests__/NotificationToaster.spec.ts +65 -0
- package/src/components/shared/__tests__/UpdateSnackbar.spec.ts +7 -7
- package/src/components/shared/__tests__/ValueSelector.spec.ts +6 -0
- package/src/composables/__tests__/useDebounce.spec.ts +17 -0
- package/src/composables/__tests__/useMovingAverage.spec.ts +40 -0
- package/src/composables/__tests__/useNavigationCube.spec.ts +79 -0
- package/src/{functions/__tests__/notification.spec.ts → composables/__tests__/useNotificationHandler.spec.ts} +74 -17
- package/src/composables/__tests__/useToolGroup.spec.ts +41 -0
- package/src/composables/__tests__/useViewName.spec.ts +29 -0
- package/src/composables/useBoundingBox.ts +32 -0
- package/src/composables/useEventListener.ts +7 -9
- package/src/composables/useMedia.ts +27 -0
- package/src/composables/useNavigationCube.ts +80 -0
- package/src/composables/useNotificationHandler.ts +82 -0
- package/src/composables/useResizeObserver.ts +31 -0
- package/src/composables/useToolGroup.ts +36 -0
- package/src/composables/useViewName.ts +34 -0
- package/src/composables/useViewer3cr.ts +3 -2
- package/src/config.ts +1 -1
- package/src/constants.ts +8 -0
- package/src/functions/HotkeyScope.ts +87 -0
- package/src/functions/__tests__/HotkeyScope.spec.ts +49 -0
- package/src/functions/__tests__/colours.spec.ts +42 -0
- package/src/functions/__tests__/fileReader.spec.ts +130 -0
- package/src/functions/__tests__/modelHelper.spec.ts +1 -0
- package/src/functions/__tests__/tsHelper.spec.ts +7 -0
- package/src/functions/chunker.ts +21 -0
- package/src/functions/colours.ts +45 -0
- package/src/functions/fileReader.ts +48 -0
- package/src/functions/guards/__tests__/isDataOverlayAngle.spec.ts +21 -0
- package/src/functions/guards/__tests__/isDataOverlayLength.spec.ts +21 -0
- package/src/functions/guards/__tests__/isDataOverlayPolygon.spec.ts +21 -0
- package/src/functions/guards/isDataOverlayAngle.ts +3 -4
- package/src/functions/guards/isDataOverlayLength.ts +3 -4
- package/src/functions/guards/isDataOverlayPolygon.ts +3 -4
- package/src/functions/openUrl.ts +3 -0
- package/src/functions/{__tests__ → parsers/__tests__}/parseAction.spec.ts +1 -1
- package/src/functions/{__tests__ → parsers/__tests__}/parseCallToAction.spec.ts +1 -1
- package/src/functions/{__tests__ → parsers/__tests__}/parseDataOverlay.spec.ts +1 -1
- package/src/functions/{__tests__ → parsers/__tests__}/parseDataOverlayData.spec.ts +1 -1
- package/src/functions/{__tests__ → parsers/__tests__}/parseDataOverlayEvent.spec.ts +3 -3
- package/src/functions/{__tests__ → parsers/__tests__}/parseMcadEvent.spec.ts +3 -3
- package/src/functions/{parseAction.ts → parsers/parseAction.ts} +1 -2
- package/src/functions/{parseCallToAction.ts → parsers/parseCallToAction.ts} +2 -2
- package/src/functions/{parseDataOverlay.ts → parsers/parseDataOverlay.ts} +3 -3
- package/src/functions/parsers/parseDataOverlayData.ts +9 -0
- package/src/functions/parsers/parseDataOverlayEvent.ts +19 -0
- package/src/functions/parsers/parseMcadEvent.ts +9 -0
- package/src/functions/platform.ts +7 -0
- package/src/functions/translateTooltipShortcut.ts +35 -0
- package/src/functions/tsHelper.ts +3 -0
- package/src/main.ts +68 -43
- package/src/models/__tests__/iso-languages.spec.ts +23 -0
- package/src/models/__tests__/scanState.spec.ts +14 -38
- package/src/models/iso-languages.ts +1609 -0
- package/src/models/progress.ts +23 -0
- package/src/models/scanState.ts +56 -100
- package/src/plugins/__tests__/pinia.spec.ts +7 -0
- package/src/plugins/__tests__/vue-i18n.spec.ts +7 -0
- package/src/plugins/__tests__/vuetify.spec.ts +3 -3
- package/src/plugins/locales/en.json +442 -0
- package/src/plugins/material-symbols/aliases.ts +43 -0
- package/src/plugins/material-symbols/material-symbols-filled.ts +11 -0
- package/src/plugins/material-symbols/material-symbols-outlined.ts +9 -0
- package/src/plugins/pinia.ts +3 -0
- package/src/plugins/vue-i18n.ts +9 -0
- package/src/plugins/vuetify.ts +157 -25
- package/src/services/__tests__/features.service.spec.ts +14 -0
- package/src/services/__tests__/gpt.service.spec.ts +64 -3
- package/src/services/__tests__/viewer-3cr.service.spec.ts +616 -192
- package/src/services/features.service.ts +32 -0
- package/src/services/gpt.service.ts +5 -2
- package/src/services/viewer-3cr.service.ts +374 -307
- package/src/stores/__tests__/data-overlay.store.spec.ts +92 -0
- package/src/stores/__tests__/demo.store.spec.ts +196 -0
- package/src/stores/__tests__/drawer.store.spec.ts +27 -0
- package/src/stores/__tests__/intro.store.spec.ts +102 -0
- package/src/stores/__tests__/language.store.spec.ts +83 -0
- package/src/stores/__tests__/mcad-floating.store.spec.ts +339 -0
- package/src/stores/__tests__/mcad.store.spec.ts +88 -0
- package/src/stores/__tests__/save.store.spec.ts +51 -0
- package/src/stores/__tests__/theme.store.spec.ts +18 -0
- package/src/stores/__tests__/tool.store.spec.ts +53 -0
- package/src/stores/__tests__/upload.store.spec.ts +19 -0
- package/src/stores/__tests__/viewer.store.spec.ts +20 -0
- package/src/stores/data-overlay.store.ts +93 -0
- package/src/stores/demo.store.ts +284 -0
- package/src/stores/drawer.store.ts +23 -0
- package/src/stores/intro.store.ts +35 -0
- package/src/stores/language.store.ts +59 -0
- package/src/stores/mcad-floating.store.ts +141 -0
- package/src/stores/mcad.store.ts +53 -0
- package/src/stores/save.store.ts +59 -0
- package/src/stores/theme.store.ts +45 -0
- package/src/stores/tool.store.ts +41 -0
- package/src/stores/upload.store.ts +19 -0
- package/src/stores/viewer.store.ts +34 -0
- package/src/tools/__tests__/annotation-create.tool.spec.ts +90 -0
- package/src/tools/__tests__/annotation-move.tool.spec.ts +107 -0
- package/src/tools/__tests__/data-overlay.tool.spec.ts +127 -0
- package/src/tools/__tests__/mcad-move.tool.spec.ts +106 -0
- package/src/tools/__tests__/mcad-rotate.tool.spec.ts +103 -0
- package/src/tools/__tests__/mcad-scale.tool.spec.ts +8 -0
- package/src/tools/__tests__/mcad-select.tool.spec.ts +63 -0
- package/src/tools/__tests__/measurement-angle.tool.spec.ts +26 -0
- package/src/tools/__tests__/measurement-length.tool.spec.ts +26 -0
- package/src/tools/__tests__/measurement-polygon.tool.spec.ts +26 -0
- package/src/tools/annotation-create.tool.ts +48 -0
- package/src/tools/annotation-move.tool.ts +48 -0
- package/src/tools/data-overlay.tool.ts +45 -48
- package/src/tools/mcad-move.tool.ts +47 -0
- package/src/tools/mcad-rotate.tool.ts +47 -0
- package/src/tools/mcad-scale-tool.ts +10 -0
- package/src/tools/mcad-select-tool.ts +32 -0
- package/src/tools/measurement-angle.tool.ts +20 -0
- package/src/tools/measurement-length.tool.ts +20 -0
- package/src/tools/measurement-polygon.tool.ts +20 -0
- package/src/types/feature.ts +6 -0
- package/src/types/viewer-tool.ts +5 -0
- package/test/MockImportOriginal.ts +7 -0
- package/test/assertions/beTypeOrNull.ts +24 -0
- package/test/fakers/action-data.faker.ts +1 -1
- package/test/fakers/action.faker.ts +1 -1
- package/test/fakers/call-to-action.faker.ts +1 -1
- package/test/fakers/data-overlay-angle.faker.ts +1 -1
- package/test/fakers/data-overlay-annotation.faker.ts +1 -1
- package/test/fakers/data-overlay-data.faker.ts +18 -15
- package/test/fakers/data-overlay-interaction.faker.ts +25 -17
- package/test/fakers/data-overlay-length.faker.ts +1 -1
- package/test/fakers/data-overlay-mcad.faker.ts +4 -3
- package/test/fakers/data-overlay-polygon.faker.ts +1 -1
- package/test/fakers/feature.faker.ts +13 -0
- package/test/fakers/file.faker.ts +11 -0
- package/test/fakers/gpt-question.faker.ts +1 -1
- package/test/fakers/gpt-response.faker.ts +1 -1
- package/test/fakers/mcad-object-interaction.faker.ts +4 -4
- package/test/fakers/orientation.faker.ts +1 -1
- package/test/fakers/segment-angle.faker.ts +1 -1
- package/test/fakers/upload.faker.ts +14 -0
- package/test/getAnimationFrame.ts +3 -0
- package/test/plugins/findByTestId.ts +13 -6
- package/test/plugins/pinia.ts +20 -0
- package/test/plugins/vitest.d.ts +8 -0
- package/test/plugins/vue-i18n.ts +22 -0
- package/test/plugins/vuetify.ts +10 -0
- package/test/setup.ts +37 -12
- package/tsconfig.json +1 -1
- package/vite.config.mts +48 -18
- package/vitest.config.mts +12 -3
- package/src/assets/images/MainBackdrop.svg +0 -48
- package/src/assets/images/dark/Singular-Health-Disc-Mono.svg +0 -9
- package/src/assets/images/dark/demo-icon-small.png +0 -0
- package/src/assets/images/dark/demo-logo-small.svg +0 -27
- package/src/assets/images/dark/demo-logo.svg +0 -1
- package/src/assets/images/light/Singular-Health-Disc-Mono.svg +0 -9
- package/src/assets/logos/3dicom/white-mini.svg +0 -20
- package/src/components/demo/DemoModal.vue +0 -44
- package/src/components/demo/DemoPatientModal.vue +0 -52
- package/src/components/demo/__tests__/DemoModal.spec.ts +0 -26
- package/src/components/demo/__tests__/DemoPatientModal.spec.ts +0 -38
- package/src/components/demo/__tests__/options.spec.ts +0 -25
- package/src/components/demo/licence/DemoLicenceEnableCloudStorageModal.vue +0 -64
- package/src/components/demo/licence/DemoLicenceInfoModal.vue +0 -49
- package/src/components/demo/licence/DemoLicenceSendToPartyModal.vue +0 -178
- package/src/components/demo/licence/DemoLicenceShareToMobileModal.vue +0 -102
- package/src/components/demo/licence/__tests__/DemoLicenceSendToPartyModal.spec.ts +0 -36
- package/src/components/demo/licence/__tests__/DemoLicenceShareToMobileModal.spec.ts +0 -52
- package/src/components/demo/options.ts +0 -170
- package/src/components/demo/patient/DemoPatientEnableCloudStorageModal.vue +0 -64
- package/src/components/demo/patient/DemoPatientInfoModal.vue +0 -49
- package/src/components/demo/patient/DemoPatientSendToPartyModal.vue +0 -177
- package/src/components/demo/patient/DemoPatientShareToMobileModal.vue +0 -102
- package/src/components/demo/patient/__tests__/DemoPatientEnableCloudStorageModal.spec.ts +0 -38
- package/src/components/demo/patient/__tests__/DemoPatientInfoModal.spec.ts +0 -38
- package/src/components/demo/patient/__tests__/DemoPatientSendToPartyModal.spec.ts +0 -36
- package/src/components/demo/patient/__tests__/DemoPatientShareToMobileModal.spec.ts +0 -52
- package/src/components/modal/CloseViewerModal.vue +0 -69
- package/src/components/modal/MftpWebGL3DRModal.vue +0 -336
- package/src/components/modal/ViewerNavigationDrawerContent.vue +0 -168
- package/src/components/modal/ViewerNavigationDrawerFooter.vue +0 -131
- package/src/components/modal/ViewerNavigationDrawerHeader.vue +0 -33
- package/src/components/modal/WebGL3DR.vue +0 -91
- package/src/components/modal/__tests__/CloseViewerModal.spec.ts +0 -70
- package/src/components/modal/__tests__/ViewerNavigationDrawerContent.spec.ts +0 -11
- package/src/components/modal/__tests__/ViewerNavigationDrawerFooter.spec.ts +0 -46
- package/src/components/modal/__tests__/ViewerNavigationDrawerHeader.spec.ts +0 -40
- package/src/components/modal/actions/NavigationCubeAction.vue +0 -26
- package/src/components/modal/actions/__tests__/NavigationCubeAction.spec.ts +0 -25
- package/src/components/modal/buttons/AutoAnnotateBtn.vue +0 -197
- package/src/components/modal/buttons/__tests__/AutoAnnotateBtn.spec.ts +0 -28
- package/src/components/modal/menus/FileMenu.vue +0 -73
- package/src/components/modal/menus/__tests__/FileMenu.spec.ts +0 -110
- package/src/components/navigation/mcad/McadGlobalActions.vue +0 -20
- package/src/components/navigation/mcad/McadGlobalOpacitySlider.vue +0 -103
- package/src/components/navigation/mcad/McadGlobalScanViewBtn.vue +0 -28
- package/src/components/navigation/mcad/McadGlobalVisibilityBtn.vue +0 -38
- package/src/components/views/AnnotationTreeView.vue +0 -236
- package/src/components/views/DisplaySettings.vue +0 -94
- package/src/components/views/MarkupTreeView.vue +0 -201
- package/src/components/views/McadObjectTreeView.vue +0 -129
- package/src/components/views/__tests__/AnnotationTreeView.spec.ts +0 -62
- package/src/components/views/__tests__/MarkupTreeView.spec.ts +0 -41
- package/src/components/views/__tests__/McadObjectTreeView.spec.ts +0 -47
- package/src/components/views/modals/DataOverlayGeneralModal.vue +0 -71
- package/src/components/views/modals/DataOverlayMarkupModal.vue +0 -60
- package/src/components/views/modals/DataOverlayModal.vue +0 -88
- package/src/components/views/shared/MaskIcon.vue +0 -44
- package/src/components/views/shared/ObjectColor.vue +0 -31
- package/src/components/views/shared/ObjectLabel.vue +0 -30
- package/src/components/views/shared/Opacity.vue +0 -65
- package/src/components/views/shared/VisibilityBtn.vue +0 -25
- package/src/components/views/shared/__tests__/MaskIcon.spec.ts +0 -10
- package/src/components/views/shared/__tests__/ObjectColor.spec.ts +0 -10
- package/src/components/views/shared/__tests__/ObjectLabel.spec.ts +0 -10
- package/src/components/views/shared/__tests__/Opacity.spec.ts +0 -24
- package/src/components/views/shared/__tests__/VisibilityBtn.spec.ts +0 -11
- package/src/components/views/types/annotation-tree-view-item-child-action.ts +0 -6
- package/src/components/views/types/annotation-tree-view-item-child.ts +0 -9
- package/src/components/views/types/annotation-tree-view-item.ts +0 -13
- package/src/components/views/types/markup-tree-view-item-child.ts +0 -6
- package/src/components/views/types/markup-tree-view-item.ts +0 -14
- package/src/components/views/types/mcad-object-tree-view-item.ts +0 -13
- package/src/composables/__tests__/useAnnotations.spec.ts +0 -35
- package/src/composables/__tests__/useIntroJs.spec.ts +0 -51
- package/src/composables/__tests__/useMarkups.spec.ts +0 -39
- package/src/composables/__tests__/useMcadObjects.spec.ts +0 -36
- package/src/composables/__tests__/useNavigationCubeObserver.spec.ts +0 -61
- package/src/composables/useAnnotations.ts +0 -37
- package/src/composables/useIntroJs.ts +0 -142
- package/src/composables/useMarkups.ts +0 -41
- package/src/composables/useMcadObjects.ts +0 -32
- package/src/composables/useNavigationCubeObserver.ts +0 -114
- package/src/composables/useVersion3cr.ts +0 -7
- package/src/functions/__tests__/layoutOverlayStyle.spec.ts +0 -325
- package/src/functions/layoutOverlayStyle.ts +0 -84
- package/src/functions/notification.ts +0 -82
- package/src/functions/parseDataOverlayData.ts +0 -10
- package/src/functions/parseDataOverlayEvent.ts +0 -17
- package/src/functions/parseMcadEvent.ts +0 -10
- package/src/functions/rgbaToCss.ts +0 -13
- package/src/models/__tests__/loadViewerOptions.spec.ts +0 -72
- package/src/models/__tests__/loadViewerPayload.spec.ts +0 -10
- package/src/models/callbacks.ts +0 -4
- package/src/models/loadViewerOptions.ts +0 -79
- package/src/models/loadViewerPayload.ts +0 -17
- package/src/plugins/__tests__/usePlugins.spec.ts +0 -12
- package/src/plugins/usePlugins.ts +0 -8
- package/src/types/action-data.ts +0 -4
- package/src/types/action.ts +0 -13
- package/src/types/call-to-action.ts +0 -9
- package/src/types/colour.ts +0 -6
- package/src/types/data-overlay-angle.ts +0 -16
- package/src/types/data-overlay-annotation.ts +0 -18
- package/src/types/data-overlay-data.ts +0 -15
- package/src/types/data-overlay-event.ts +0 -5
- package/src/types/data-overlay-info.ts +0 -18
- package/src/types/data-overlay-interaction.ts +0 -15
- package/src/types/data-overlay-length.ts +0 -16
- package/src/types/data-overlay-markup.ts +0 -7
- package/src/types/data-overlay-mcad.ts +0 -20
- package/src/types/data-overlay-polygon.ts +0 -18
- package/src/types/data-overlay.ts +0 -16
- package/src/types/demo-type.ts +0 -4
- package/src/types/gpt-question.ts +0 -4
- package/src/types/gpt-response-payload.ts +0 -6
- package/src/types/mcad-object-interaction.ts +0 -15
- package/src/types/segment-angle.ts +0 -5
- package/src/types/vector2.ts +0 -4
- package/src/types/vector3.ts +0 -5
- package/test/fakers/data-overlay-info.faker.ts +0 -29
- /package/src/assets/logos/3dicom/{white.svg → white/white.svg} +0 -0
- /package/src/assets/{images/light/Singular-Health-Trademark-mono.svg → logos/singular-health/black/black.svg} +0 -0
- /package/src/assets/{images/dark/Singular-Health-Trademark-mono.svg → logos/singular-health/white/white.svg} +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createInstance, executePayload, registerOnPayloadHandler } from '@3cr/sdk-browser';
|
|
2
2
|
import { unref } from 'vue';
|
|
3
3
|
import {
|
|
4
|
-
AnchorPoint,
|
|
5
4
|
DataOverlaysActions,
|
|
6
5
|
FileManagementActions,
|
|
7
6
|
FrontEndInterfaces,
|
|
@@ -11,7 +10,6 @@ import {
|
|
|
11
10
|
PresetsActions,
|
|
12
11
|
ScanMovementActions,
|
|
13
12
|
ScanOrientationActions,
|
|
14
|
-
ScanView,
|
|
15
13
|
SlidersActions,
|
|
16
14
|
ViewSelectionActions,
|
|
17
15
|
FrontEndPayload,
|
|
@@ -22,29 +20,47 @@ import {
|
|
|
22
20
|
ObjectColour,
|
|
23
21
|
ObjectInvert,
|
|
24
22
|
ObjectVisibility,
|
|
23
|
+
NavigationCubeTransform,
|
|
24
|
+
ColourData,
|
|
25
|
+
MovementData,
|
|
26
|
+
RotationValue,
|
|
27
|
+
FlipValue,
|
|
28
|
+
InvertTransformData,
|
|
29
|
+
DataOverlayData,
|
|
25
30
|
ViewToggleData,
|
|
26
|
-
GraphicType
|
|
31
|
+
GraphicType,
|
|
32
|
+
ColourPresetData,
|
|
33
|
+
GreyscalePresetData,
|
|
34
|
+
LoadFileData,
|
|
35
|
+
LocalLoadDataset,
|
|
36
|
+
LoadSessionState,
|
|
37
|
+
ObjectInfo,
|
|
38
|
+
ObjectId,
|
|
39
|
+
ObjectPosition,
|
|
40
|
+
ObjectSize,
|
|
41
|
+
ObjectIcon,
|
|
42
|
+
ObjectSize2D,
|
|
43
|
+
ParentPayload,
|
|
44
|
+
UnparentPayload
|
|
27
45
|
} from '@3cr/types-ts';
|
|
28
|
-
import {
|
|
46
|
+
import {
|
|
47
|
+
ActionCallback,
|
|
48
|
+
InterfaceCallback,
|
|
49
|
+
Viewer3crPayload,
|
|
50
|
+
Viewer3crService,
|
|
51
|
+
ViewerPayload
|
|
52
|
+
} from '@3cr/viewer-types-ts';
|
|
29
53
|
import { currentColourPreset, previousLayout, transactionStarted } from '@/models/scanState';
|
|
30
54
|
import { EventHandlers } from '@/models/eventHandlers';
|
|
31
|
-
import { clamp } from '@/functions/clamp';
|
|
32
|
-
import { LoadSessionState } from '@3cr/types-ts/types/LoadSessionState';
|
|
33
|
-
|
|
34
|
-
type InterfaceCallback = (
|
|
35
|
-
message: string,
|
|
36
|
-
action: string,
|
|
37
|
-
returnChannel: string,
|
|
38
|
-
returnTo: string
|
|
39
|
-
) => void | Promise<void>;
|
|
40
|
-
|
|
41
|
-
type ActionCallback = (message: string, returnChannel: string, returnTo: string) => void | Promise<void>;
|
|
42
55
|
|
|
43
|
-
|
|
56
|
+
type ObjectDimensionalVisibility = {
|
|
57
|
+
Version: string;
|
|
58
|
+
Id: string;
|
|
59
|
+
Visibility2d: boolean;
|
|
60
|
+
Visibility3d: boolean;
|
|
61
|
+
};
|
|
44
62
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
export class Viewer3crService {
|
|
63
|
+
export class Viewer3crServiceImpl implements Viewer3crService {
|
|
48
64
|
private interfaceCallbacks = new EventHandlers<string, InterfaceCallback>();
|
|
49
65
|
|
|
50
66
|
private actionCallbacks = new EventHandlers<string, ActionCallback>();
|
|
@@ -71,272 +87,366 @@ export class Viewer3crService {
|
|
|
71
87
|
}
|
|
72
88
|
|
|
73
89
|
/**
|
|
74
|
-
* DO-03:
|
|
75
|
-
* @param
|
|
90
|
+
* DO-03: Set 2D annotation visibility.
|
|
91
|
+
* @param payload The object visibility payload.
|
|
92
|
+
*/
|
|
93
|
+
async setAnnotation2dVisibility(payload: Viewer3crPayload<ObjectVisibility>): Promise<void> {
|
|
94
|
+
await this.sendPayload(FrontEndInterfaces.data_overlay, DataOverlaysActions.do03, payload);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* DO-04: Set 2D annotation icon size.
|
|
99
|
+
* @param payload The annotation 2D size payload.
|
|
100
|
+
*/
|
|
101
|
+
async setAnnotation2dSize(payload: Viewer3crPayload<ObjectSize2D>): Promise<void> {
|
|
102
|
+
await this.sendPayload(FrontEndInterfaces.data_overlay, DataOverlaysActions.do04, payload);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* DO-05: Set 2D annotation colour.
|
|
107
|
+
* @param payload The annotation 2D colour payload.
|
|
108
|
+
*/
|
|
109
|
+
async setAnnotation2dColour(payload: Viewer3crPayload<ObjectColour>): Promise<void> {
|
|
110
|
+
await this.sendPayload(FrontEndInterfaces.data_overlay, DataOverlaysActions.do05, payload);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* DO-06: Set annotation icon.
|
|
115
|
+
* @param payload The annotation icon payload.
|
|
116
|
+
*/
|
|
117
|
+
async setAnnotationIcon(payload: Viewer3crPayload<ObjectIcon>): Promise<void> {
|
|
118
|
+
await this.sendPayload(FrontEndInterfaces.data_overlay, DataOverlaysActions.do06, payload);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* DO-08: Set 3D annotation size.
|
|
123
|
+
* @param payload The annotation 3D size payload.
|
|
124
|
+
*/
|
|
125
|
+
async setAnnotation3dSize(payload: Viewer3crPayload<ObjectSize>): Promise<void> {
|
|
126
|
+
await this.sendPayload(FrontEndInterfaces.data_overlay, DataOverlaysActions.do08, payload);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* DO-09: Set 3D annotation colour.
|
|
131
|
+
* @param payload The annotation 3D colour payload.
|
|
76
132
|
*/
|
|
77
|
-
async
|
|
78
|
-
|
|
79
|
-
await this.sendPayload(FrontEndInterfaces.data_overlay, DataOverlaysActions.do03, value);
|
|
133
|
+
async setAnnotation3dColour(payload: Viewer3crPayload<ObjectColour>): Promise<void> {
|
|
134
|
+
await this.sendPayload(FrontEndInterfaces.data_overlay, DataOverlaysActions.do09, payload);
|
|
80
135
|
}
|
|
81
136
|
|
|
82
137
|
/**
|
|
83
|
-
* DO-11:
|
|
84
|
-
* @param
|
|
138
|
+
* DO-11: Set 3D annotation visibility.
|
|
139
|
+
* @param payload The object visibility payload.
|
|
85
140
|
*/
|
|
86
|
-
async
|
|
87
|
-
|
|
88
|
-
await this.sendPayload(FrontEndInterfaces.data_overlay, DataOverlaysActions.do11, value);
|
|
141
|
+
async setAnnotation3dVisibility(payload: Viewer3crPayload<ObjectVisibility>): Promise<void> {
|
|
142
|
+
await this.sendPayload(FrontEndInterfaces.data_overlay, DataOverlaysActions.do11, payload);
|
|
89
143
|
}
|
|
90
144
|
|
|
91
145
|
/**
|
|
92
146
|
* FM-01: Load scan.
|
|
93
|
-
* @param
|
|
147
|
+
* @param payload The load scan payload.
|
|
94
148
|
*/
|
|
95
|
-
async loadScan(
|
|
96
|
-
await this.sendPayload(FrontEndInterfaces.file_management, FileManagementActions.fm01,
|
|
149
|
+
async loadScan(payload: Viewer3crPayload<ViewerPayload>): Promise<void> {
|
|
150
|
+
await this.sendPayload(FrontEndInterfaces.file_management, FileManagementActions.fm01, payload);
|
|
97
151
|
}
|
|
98
152
|
|
|
99
153
|
/**
|
|
100
154
|
* FM-03: Load previous CurrentScanState values.
|
|
101
|
-
* @param
|
|
155
|
+
* @param payload The load session payload.
|
|
102
156
|
*/
|
|
103
|
-
async loadScanSession(
|
|
104
|
-
|
|
105
|
-
await this.sendPayload(FrontEndInterfaces.file_management, FileManagementActions.fm03, value);
|
|
157
|
+
async loadScanSession(payload: Viewer3crPayload<LoadSessionState>): Promise<void> {
|
|
158
|
+
await this.sendPayload(FrontEndInterfaces.file_management, FileManagementActions.fm03, payload);
|
|
106
159
|
}
|
|
107
160
|
|
|
108
161
|
/**
|
|
109
162
|
* FM-05: Sets the data overlay session with the given session file.
|
|
110
163
|
* This will clear all previously loaded data overlay sessions.
|
|
111
|
-
* @param
|
|
164
|
+
* @param payload The load session payload.
|
|
112
165
|
*/
|
|
113
|
-
async setDataOverlaySession(
|
|
114
|
-
|
|
115
|
-
await this.sendPayload(FrontEndInterfaces.file_management, FileManagementActions.fm05, value);
|
|
166
|
+
async setDataOverlaySession(payload: Viewer3crPayload<LoadSessionState>): Promise<void> {
|
|
167
|
+
await this.sendPayload(FrontEndInterfaces.file_management, FileManagementActions.fm05, payload);
|
|
116
168
|
}
|
|
117
169
|
|
|
118
170
|
/**
|
|
119
171
|
* FM-06: Adds a data overlay session to existing sessions.
|
|
120
|
-
* @param
|
|
172
|
+
* @param payload The load session payload.
|
|
121
173
|
*/
|
|
122
|
-
async addDataOverlaySession(
|
|
123
|
-
|
|
124
|
-
|
|
174
|
+
async addDataOverlaySession(payload: Viewer3crPayload<LoadSessionState>): Promise<void> {
|
|
175
|
+
await this.sendPayload(FrontEndInterfaces.file_management, FileManagementActions.fm06, payload);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* FM-07: Receives URL from external UI for MCAD Object and reads meta-data of each object.
|
|
180
|
+
* @param payload The load MCAD payload.
|
|
181
|
+
*/
|
|
182
|
+
async loadExternalMcadObject(payload: Viewer3crPayload<LoadFileData>): Promise<void> {
|
|
183
|
+
await this.sendPayload(FrontEndInterfaces.file_management, FileManagementActions.fm07, payload);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* FM-08: Local File Path for Loading of a MCAD Object.
|
|
188
|
+
* @param payload The load MCAD payload.
|
|
189
|
+
*/
|
|
190
|
+
async loadLocalMcadObject(payload: Viewer3crPayload<LocalLoadDataset>): Promise<void> {
|
|
191
|
+
await this.sendPayload(FrontEndInterfaces.file_management, FileManagementActions.fm08, payload);
|
|
125
192
|
}
|
|
126
193
|
|
|
127
194
|
/**
|
|
128
195
|
* FM-09: Load separate MCAD file from external UI.
|
|
129
|
-
* @param
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
async loadMcadObjects(
|
|
134
|
-
value?: Optional<LoadSessionState, 'Version'>,
|
|
135
|
-
returnChannel?: string[],
|
|
136
|
-
returnTo?: string
|
|
137
|
-
): Promise<void> {
|
|
138
|
-
await this.sendPayload(
|
|
139
|
-
FrontEndInterfaces.file_management,
|
|
140
|
-
FileManagementActions.fm09,
|
|
141
|
-
value,
|
|
142
|
-
returnChannel,
|
|
143
|
-
returnTo
|
|
144
|
-
);
|
|
196
|
+
* @param payload The load session payload.
|
|
197
|
+
*/
|
|
198
|
+
async loadMcadObjects(payload: Viewer3crPayload<LoadSessionState>): Promise<void> {
|
|
199
|
+
await this.sendPayload(FrontEndInterfaces.file_management, FileManagementActions.fm09, payload);
|
|
145
200
|
}
|
|
146
201
|
|
|
147
|
-
|
|
148
|
-
|
|
202
|
+
/**
|
|
203
|
+
* IN-01: Enable or disable the mouse input.
|
|
204
|
+
* @param payload The interactivity state payload.
|
|
205
|
+
*/
|
|
206
|
+
async setMouseInput(payload: Viewer3crPayload<InteractivityState>): Promise<void> {
|
|
207
|
+
await this.sendPayload(FrontEndInterfaces.interactivity, InteractivityActions.in01, payload);
|
|
149
208
|
}
|
|
150
209
|
|
|
151
|
-
|
|
152
|
-
|
|
210
|
+
/**
|
|
211
|
+
* IN-02: Enable or disable the keyboard input.
|
|
212
|
+
* @param payload The interactivity state payload.
|
|
213
|
+
*/
|
|
214
|
+
async setKeyboardInput(payload: Viewer3crPayload<InteractivityState>): Promise<void> {
|
|
215
|
+
await this.sendPayload(FrontEndInterfaces.interactivity, InteractivityActions.in02, payload);
|
|
153
216
|
}
|
|
154
217
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
218
|
+
/**
|
|
219
|
+
* MC-03: Set visibility of MCAD objects.
|
|
220
|
+
* @param payload The object visibility payload.
|
|
221
|
+
*/
|
|
222
|
+
async setMcadObjectVisibility(payload: Viewer3crPayload<ObjectVisibility>): Promise<void> {
|
|
223
|
+
await this.sendPayload(FrontEndInterfaces.mcad, McadActions.mc03, payload);
|
|
158
224
|
}
|
|
159
225
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
226
|
+
/**
|
|
227
|
+
* MC-04: Set colour & opacity of MCAD objects.
|
|
228
|
+
* @param payload The object colour payload.
|
|
229
|
+
*/
|
|
230
|
+
async setMcadObjectColour(payload: Viewer3crPayload<ObjectColour>): Promise<void> {
|
|
231
|
+
await this.sendPayload(FrontEndInterfaces.mcad, McadActions.mc04, payload);
|
|
163
232
|
}
|
|
164
233
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
234
|
+
/**
|
|
235
|
+
* MC-05: Enables movement of MCAD objects.
|
|
236
|
+
* @param payload The object state payload.
|
|
237
|
+
*/
|
|
238
|
+
async moveMcadObject(payload: Viewer3crPayload<ObjectBoolean>): Promise<void> {
|
|
239
|
+
await this.sendPayload(FrontEndInterfaces.mcad, McadActions.mc05, payload);
|
|
168
240
|
}
|
|
169
241
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
242
|
+
/**
|
|
243
|
+
* MC-06: Enables rotation of MCAD objects.
|
|
244
|
+
* @param payload The object state payload.
|
|
245
|
+
*/
|
|
246
|
+
async rotateMcadObject(payload: Viewer3crPayload<ObjectBoolean>): Promise<void> {
|
|
247
|
+
await this.sendPayload(FrontEndInterfaces.mcad, McadActions.mc06, payload);
|
|
175
248
|
}
|
|
176
249
|
|
|
177
250
|
/**
|
|
178
|
-
* MC-
|
|
179
|
-
* @param
|
|
251
|
+
* MC-09: Lock or unlock MCAD objects.
|
|
252
|
+
* @param payload The lock payload.
|
|
180
253
|
*/
|
|
181
|
-
async
|
|
182
|
-
|
|
183
|
-
await this.sendPayload(FrontEndInterfaces.mcad, McadActions.mc03, value);
|
|
254
|
+
async lockMcad(payload: Viewer3crPayload<ObjectBoolean>): Promise<void> {
|
|
255
|
+
await this.sendPayload(FrontEndInterfaces.mcad, McadActions.mc09, payload);
|
|
184
256
|
}
|
|
185
257
|
|
|
186
258
|
/**
|
|
187
|
-
* MC-
|
|
188
|
-
* @param
|
|
259
|
+
* MC-10: Group MCAD objects.
|
|
260
|
+
* @param payload The group MCAD payload.
|
|
189
261
|
*/
|
|
190
|
-
async
|
|
191
|
-
|
|
192
|
-
await this.sendPayload(FrontEndInterfaces.mcad, McadActions.mc04, value);
|
|
262
|
+
async groupMcad(payload: Viewer3crPayload<ParentPayload>): Promise<void> {
|
|
263
|
+
await this.sendPayload(FrontEndInterfaces.mcad, McadActions.mc10, payload);
|
|
193
264
|
}
|
|
194
265
|
|
|
195
266
|
/**
|
|
196
|
-
* MC-
|
|
197
|
-
* @param
|
|
267
|
+
* MC-11: Ungroup MCAD objects.
|
|
268
|
+
* @param payload The ungroup MCAD payload.
|
|
198
269
|
*/
|
|
199
|
-
async
|
|
200
|
-
|
|
201
|
-
await this.sendPayload(FrontEndInterfaces.mcad, McadActions.mc05, value);
|
|
270
|
+
async ungroupMcad(payload: Viewer3crPayload<UnparentPayload>): Promise<void> {
|
|
271
|
+
await this.sendPayload(FrontEndInterfaces.mcad, McadActions.mc11, payload);
|
|
202
272
|
}
|
|
203
273
|
|
|
204
274
|
/**
|
|
205
275
|
* MC-16: Invert MCAD objects.
|
|
206
|
-
* @param
|
|
276
|
+
* @param payload The object invert payload.
|
|
277
|
+
*/
|
|
278
|
+
async invertMcadObject(payload: Viewer3crPayload<ObjectInvert>): Promise<void> {
|
|
279
|
+
await this.sendPayload(FrontEndInterfaces.mcad, McadActions.mc16, payload);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* MC-17: Remove MCAD objects.
|
|
284
|
+
* @param payload The remove MCAD object payload.
|
|
285
|
+
*/
|
|
286
|
+
async removeMcadObject(payload: Viewer3crPayload<ObjectId>): Promise<void> {
|
|
287
|
+
await this.sendPayload(FrontEndInterfaces.mcad, McadActions.mc17, payload);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* MC-18: Set MCAD object title.
|
|
292
|
+
* @param payload The MCAD object title payload.
|
|
207
293
|
*/
|
|
208
|
-
async
|
|
209
|
-
|
|
210
|
-
await this.sendPayload(FrontEndInterfaces.mcad, McadActions.mc16, value);
|
|
294
|
+
async setMcadObjectTitle(payload: Viewer3crPayload<ObjectInfo>): Promise<void> {
|
|
295
|
+
await this.sendPayload(FrontEndInterfaces.mcad, McadActions.mc18, payload);
|
|
211
296
|
}
|
|
212
297
|
|
|
213
298
|
/**
|
|
214
|
-
* MU-
|
|
215
|
-
* @param
|
|
216
|
-
* @param visibility The visibility state.
|
|
299
|
+
* MU-01: Create a 2d annotation.
|
|
300
|
+
* @param payload The 2d annotation interaction payload.
|
|
217
301
|
*/
|
|
218
|
-
async
|
|
219
|
-
|
|
220
|
-
|
|
302
|
+
async createAnnotation2dTool(payload: Viewer3crPayload<InteractivityState>): Promise<void> {
|
|
303
|
+
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu01, payload);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* MU-02: Create a 3d annotation.
|
|
308
|
+
* @param payload The 3d annotation interaction payload.
|
|
309
|
+
*/
|
|
310
|
+
async createAnnotation3dTool(payload: Viewer3crPayload<InteractivityState>): Promise<void> {
|
|
311
|
+
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu02, payload);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* MU-03: Create Annotation(s) in 2D/3D.
|
|
316
|
+
* @param payload The create annotation payload.
|
|
317
|
+
*/
|
|
318
|
+
async createAnnotation(payload: Viewer3crPayload<DataOverlayData[]>): Promise<void> {
|
|
319
|
+
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu03, payload);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* MU-04: Move annotation in 2D view.
|
|
324
|
+
* @param payload The move annotation payload.
|
|
325
|
+
*/
|
|
326
|
+
async moveAnnotation2dTool(payload: Viewer3crPayload<ObjectBoolean>): Promise<void> {
|
|
327
|
+
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu04, payload);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* MU-05: Move annotation in 3D view.
|
|
332
|
+
* @param payload The move annotation payload.
|
|
333
|
+
*/
|
|
334
|
+
async moveAnnotation3dTool(payload: Viewer3crPayload<ObjectBoolean>): Promise<void> {
|
|
335
|
+
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu05, payload);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* MU-06: Move multiple annotations.
|
|
340
|
+
* @param payload The move annotations payload.
|
|
341
|
+
*/
|
|
342
|
+
async moveAnnotation(payload: Viewer3crPayload<ObjectPosition[]>): Promise<void> {
|
|
343
|
+
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu06, payload);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* MU-07: Remove annotation.
|
|
348
|
+
* @param payload The remove annotation payload.
|
|
349
|
+
*/
|
|
350
|
+
async removeAnnotation(payload: Viewer3crPayload<ObjectId>): Promise<void> {
|
|
351
|
+
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu07, payload);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* MU-08: Update annotation title.
|
|
356
|
+
* @param payload The update annotation title payload.
|
|
357
|
+
*/
|
|
358
|
+
async updateAnnotationTitle(payload: Viewer3crPayload<ObjectInfo>): Promise<void> {
|
|
359
|
+
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu08, payload);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* MU-09: Update annotation description.
|
|
364
|
+
* @param payload The update annotation description payload.
|
|
365
|
+
*/
|
|
366
|
+
async updateAnnotationDescription(payload: Viewer3crPayload<ObjectInfo>): Promise<void> {
|
|
367
|
+
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu09, payload);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* MU-10: Update annotation actions.
|
|
372
|
+
* @param payload The update annotation actions payload.
|
|
373
|
+
*/
|
|
374
|
+
async updateAnnotationActions(payload: Viewer3crPayload<ObjectInfo>): Promise<void> {
|
|
375
|
+
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu10, payload);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* MU-16: Set 2D/3D visibility of measurements.
|
|
380
|
+
* @param payload The measurement visibility payload.
|
|
381
|
+
*/
|
|
382
|
+
async setMeasurementVisibility(payload: Viewer3crPayload<ObjectDimensionalVisibility[]>): Promise<void> {
|
|
383
|
+
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu16, payload);
|
|
221
384
|
}
|
|
222
385
|
|
|
223
386
|
/**
|
|
224
387
|
* MU-20: 2D length tool.
|
|
225
|
-
* @param
|
|
388
|
+
* @param payload The tool interactivity payload.
|
|
226
389
|
*/
|
|
227
|
-
async lengthTool(
|
|
228
|
-
|
|
229
|
-
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu20, value);
|
|
390
|
+
async lengthTool(payload: Viewer3crPayload<InteractivityState>): Promise<void> {
|
|
391
|
+
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu20, payload);
|
|
230
392
|
}
|
|
231
393
|
|
|
232
394
|
/**
|
|
233
395
|
* MU-21: 2D polygon tool.
|
|
234
|
-
* @param
|
|
396
|
+
* @param payload The tool interactivity payload.
|
|
235
397
|
*/
|
|
236
|
-
async polygonTool(
|
|
237
|
-
|
|
238
|
-
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu21, value);
|
|
398
|
+
async polygonTool(payload: Viewer3crPayload<InteractivityState>): Promise<void> {
|
|
399
|
+
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu21, payload);
|
|
239
400
|
}
|
|
240
401
|
|
|
241
402
|
/**
|
|
242
403
|
* MU-22: 2D angle tool.
|
|
243
|
-
* @param
|
|
404
|
+
* @param payload The tool interactivity payload.
|
|
244
405
|
*/
|
|
245
|
-
async angleTool(
|
|
246
|
-
|
|
247
|
-
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu22, value);
|
|
406
|
+
async angleTool(payload: Viewer3crPayload<InteractivityState>): Promise<void> {
|
|
407
|
+
await this.sendPayload(FrontEndInterfaces.markups, MarkupsActions.mu22, payload);
|
|
248
408
|
}
|
|
249
409
|
|
|
250
410
|
/**
|
|
251
411
|
* NC-01: Set Navigation Cube Co-ordinates and Size.
|
|
252
|
-
* @param
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
* @param height The navigation cube height.
|
|
257
|
-
*/
|
|
258
|
-
async setNavCubePositionSize(
|
|
259
|
-
anchorPoint: AnchorPoint,
|
|
260
|
-
x: number,
|
|
261
|
-
y: number,
|
|
262
|
-
width: number,
|
|
263
|
-
height: number
|
|
264
|
-
): Promise<void> {
|
|
265
|
-
await this.sendPayload(FrontEndInterfaces.navigation_cube, NavigationCubeActions.nc01, {
|
|
266
|
-
Version: '0.0.1',
|
|
267
|
-
AnchorPoint: anchorPoint,
|
|
268
|
-
Position: { Version: '0.0.1', X: x, Y: y },
|
|
269
|
-
Size: { Version: '0.0.1', X: width, Y: height }
|
|
270
|
-
});
|
|
412
|
+
* @param payload The navigation cube payload.
|
|
413
|
+
*/
|
|
414
|
+
async setNavCubePositionSize(payload: Viewer3crPayload<NavigationCubeTransform>): Promise<void> {
|
|
415
|
+
await this.sendPayload(FrontEndInterfaces.navigation_cube, NavigationCubeActions.nc01, payload);
|
|
271
416
|
}
|
|
272
417
|
|
|
273
418
|
/**
|
|
274
419
|
* NC-02: Set Navigation Cube Visibility.
|
|
275
|
-
* @param
|
|
420
|
+
* @param payload The navigation cube visibility payload.
|
|
276
421
|
*/
|
|
277
|
-
async setNavCubeVisibility(
|
|
278
|
-
await this.sendPayload(FrontEndInterfaces.navigation_cube, NavigationCubeActions.nc02,
|
|
279
|
-
Version: '0.0.1',
|
|
280
|
-
Value: visibility
|
|
281
|
-
});
|
|
422
|
+
async setNavCubeVisibility(payload: Viewer3crPayload<InteractivityState>): Promise<void> {
|
|
423
|
+
await this.sendPayload(FrontEndInterfaces.navigation_cube, NavigationCubeActions.nc02, payload);
|
|
282
424
|
}
|
|
283
425
|
|
|
284
426
|
/**
|
|
285
427
|
* NC-03: Set Navigation Cube Interactivity.
|
|
286
|
-
* @param
|
|
428
|
+
* @param payload The navigation cube interactivity payload.
|
|
287
429
|
*/
|
|
288
|
-
async setNavCubeInteractivity(
|
|
289
|
-
await this.sendPayload(FrontEndInterfaces.navigation_cube, NavigationCubeActions.nc03,
|
|
290
|
-
Version: '0.0.1',
|
|
291
|
-
Value: interactivity
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* NC-04: Set Navigation Cube Perspective
|
|
297
|
-
* @param perspective If perspective shift is removed.
|
|
298
|
-
*/
|
|
299
|
-
async setNavCubePerspective(perspective: boolean): Promise<void> {
|
|
300
|
-
await this.sendPayload(FrontEndInterfaces.navigation_cube, NavigationCubeActions.nc04, {
|
|
301
|
-
Version: '0.0.1',
|
|
302
|
-
Value: perspective
|
|
303
|
-
});
|
|
430
|
+
async setNavCubeInteractivity(payload: Viewer3crPayload<InteractivityState>): Promise<void> {
|
|
431
|
+
await this.sendPayload(FrontEndInterfaces.navigation_cube, NavigationCubeActions.nc03, payload);
|
|
304
432
|
}
|
|
305
433
|
|
|
306
434
|
/**
|
|
307
435
|
* NC-05: Set Navigation Cube Colour and Opacity.
|
|
308
|
-
* All values must be floats between 0 and
|
|
309
|
-
* @param
|
|
310
|
-
* @param g Green channel.
|
|
311
|
-
* @param b Blue channel.
|
|
312
|
-
* @param a Alpha channel.
|
|
436
|
+
* All values must be floats between 0 and 1.
|
|
437
|
+
* @param payload The navigation cube colour payload.
|
|
313
438
|
*/
|
|
314
|
-
async setNavCubeColourOpacity(
|
|
315
|
-
await this.sendPayload(FrontEndInterfaces.navigation_cube, NavigationCubeActions.nc05,
|
|
316
|
-
Version: '0.0.1',
|
|
317
|
-
R: clamp(r / 255, 0, 1),
|
|
318
|
-
G: clamp(g / 255, 0, 1),
|
|
319
|
-
B: clamp(b / 255, 0, 1),
|
|
320
|
-
A: clamp(a / 255, 0, 1)
|
|
321
|
-
});
|
|
439
|
+
async setNavCubeColourOpacity(payload: Viewer3crPayload<ColourData>): Promise<void> {
|
|
440
|
+
await this.sendPayload(FrontEndInterfaces.navigation_cube, NavigationCubeActions.nc05, payload);
|
|
322
441
|
}
|
|
323
442
|
|
|
324
443
|
/**
|
|
325
444
|
* NC-07: Set Navigation Cube Highlight Colour and Opacity.
|
|
326
445
|
* All values must be floats between 0 and 255.
|
|
327
|
-
* @param
|
|
328
|
-
* @param g Green channel.
|
|
329
|
-
* @param b Blue channel.
|
|
330
|
-
* @param a Alpha channel.
|
|
446
|
+
* @param payload The navigation cube highlight colour payload.
|
|
331
447
|
*/
|
|
332
|
-
async setNavCubeHighlightColourOpacity(
|
|
333
|
-
await this.sendPayload(FrontEndInterfaces.navigation_cube, NavigationCubeActions.nc07,
|
|
334
|
-
Version: '0.0.1',
|
|
335
|
-
R: clamp(r / 255, 0, 1),
|
|
336
|
-
G: clamp(g / 255, 0, 1),
|
|
337
|
-
B: clamp(b / 255, 0, 1),
|
|
338
|
-
A: clamp(a / 255, 0, 1)
|
|
339
|
-
});
|
|
448
|
+
async setNavCubeHighlightColourOpacity(payload: Viewer3crPayload<ColourData>): Promise<void> {
|
|
449
|
+
await this.sendPayload(FrontEndInterfaces.navigation_cube, NavigationCubeActions.nc07, payload);
|
|
340
450
|
}
|
|
341
451
|
|
|
342
452
|
/**
|
|
@@ -344,198 +454,155 @@ export class Viewer3crService {
|
|
|
344
454
|
* @param type Face type of cube.
|
|
345
455
|
*/
|
|
346
456
|
async setNavCubeGraphics(type: GraphicType): Promise<void> {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
Value: type
|
|
350
|
-
});
|
|
457
|
+
const message = { Version: '0.0.1', Value: type };
|
|
458
|
+
await this.sendPayload(FrontEndInterfaces.navigation_cube, NavigationCubeActions.nc08, { message });
|
|
351
459
|
}
|
|
352
460
|
|
|
353
461
|
/**
|
|
354
462
|
* SM-13: Pan the selected view to the left.
|
|
355
|
-
* @param
|
|
356
|
-
* @param value The movement in mm.
|
|
463
|
+
* @param payload The scan movement payload.
|
|
357
464
|
*/
|
|
358
|
-
async panLeft(
|
|
359
|
-
await this.sendPayload(FrontEndInterfaces.scan_movement, ScanMovementActions.sm13,
|
|
360
|
-
Version: '0.0.1',
|
|
361
|
-
View: view,
|
|
362
|
-
Movement: value
|
|
363
|
-
});
|
|
465
|
+
async panLeft(payload: Viewer3crPayload<MovementData>): Promise<void> {
|
|
466
|
+
await this.sendPayload(FrontEndInterfaces.scan_movement, ScanMovementActions.sm13, payload);
|
|
364
467
|
}
|
|
365
468
|
|
|
366
469
|
/**
|
|
367
470
|
* SM-14: Pan the selected view to the right.
|
|
368
|
-
* @param
|
|
369
|
-
* @param value The movement in mm.
|
|
471
|
+
* @param payload The scan movement payload.
|
|
370
472
|
*/
|
|
371
|
-
async panRight(
|
|
372
|
-
await this.sendPayload(FrontEndInterfaces.scan_movement, ScanMovementActions.sm14,
|
|
373
|
-
Version: '0.0.1',
|
|
374
|
-
View: view,
|
|
375
|
-
Movement: value
|
|
376
|
-
});
|
|
473
|
+
async panRight(payload: Viewer3crPayload<MovementData>): Promise<void> {
|
|
474
|
+
await this.sendPayload(FrontEndInterfaces.scan_movement, ScanMovementActions.sm14, payload);
|
|
377
475
|
}
|
|
378
476
|
|
|
379
477
|
/**
|
|
380
478
|
* SM-15: Pan the selected view upwards.
|
|
381
|
-
* @param
|
|
382
|
-
* @param value The movement in mm.
|
|
479
|
+
* @param payload The scan movement payload.
|
|
383
480
|
*/
|
|
384
|
-
async panUp(
|
|
385
|
-
await this.sendPayload(FrontEndInterfaces.scan_movement, ScanMovementActions.sm15,
|
|
386
|
-
Version: '0.0.1',
|
|
387
|
-
View: view,
|
|
388
|
-
Movement: value
|
|
389
|
-
});
|
|
481
|
+
async panUp(payload: Viewer3crPayload<MovementData>): Promise<void> {
|
|
482
|
+
await this.sendPayload(FrontEndInterfaces.scan_movement, ScanMovementActions.sm15, payload);
|
|
390
483
|
}
|
|
391
484
|
|
|
392
485
|
/**
|
|
393
486
|
* SM-16: Pan the selected view downwards.
|
|
394
|
-
* @param
|
|
395
|
-
* @param value The movement in mm.
|
|
487
|
+
* @param payload The scan movement payload.
|
|
396
488
|
*/
|
|
397
|
-
async panDown(
|
|
398
|
-
await this.sendPayload(FrontEndInterfaces.scan_movement, ScanMovementActions.sm16,
|
|
399
|
-
Version: '0.0.1',
|
|
400
|
-
View: view,
|
|
401
|
-
Movement: value
|
|
402
|
-
});
|
|
489
|
+
async panDown(payload: Viewer3crPayload<MovementData>): Promise<void> {
|
|
490
|
+
await this.sendPayload(FrontEndInterfaces.scan_movement, ScanMovementActions.sm16, payload);
|
|
403
491
|
}
|
|
404
492
|
|
|
405
493
|
/**
|
|
406
494
|
* SM-17: Zoom In.
|
|
407
|
-
* @param
|
|
408
|
-
* @param value The amount to zoom in.
|
|
495
|
+
* @param payload The scan zoom payload.
|
|
409
496
|
*/
|
|
410
|
-
async zoomIn(
|
|
411
|
-
await this.sendPayload(FrontEndInterfaces.scan_movement, ScanMovementActions.sm17,
|
|
412
|
-
Version: '0.0.1',
|
|
413
|
-
View: view,
|
|
414
|
-
Movement: value
|
|
415
|
-
});
|
|
497
|
+
async zoomIn(payload: Viewer3crPayload<MovementData>): Promise<void> {
|
|
498
|
+
await this.sendPayload(FrontEndInterfaces.scan_movement, ScanMovementActions.sm17, payload);
|
|
416
499
|
}
|
|
417
500
|
|
|
418
501
|
/**
|
|
419
502
|
* SM-18: Zoom out.
|
|
420
|
-
* @param
|
|
421
|
-
* @param value The amount to zoom out.
|
|
503
|
+
* @param payload The scan zoom payload.
|
|
422
504
|
*/
|
|
423
|
-
async zoomOut(
|
|
424
|
-
await this.sendPayload(FrontEndInterfaces.scan_movement, ScanMovementActions.sm18,
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
505
|
+
async zoomOut(payload: Viewer3crPayload<MovementData>): Promise<void> {
|
|
506
|
+
await this.sendPayload(FrontEndInterfaces.scan_movement, ScanMovementActions.sm18, payload);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* SM-26: Pan view.
|
|
511
|
+
* @param payload The pan payload.
|
|
512
|
+
*/
|
|
513
|
+
async pan(payload: Viewer3crPayload<ViewToggleData>): Promise<void> {
|
|
514
|
+
await this.sendPayload(FrontEndInterfaces.scan_movement, ScanMovementActions.sm26, payload);
|
|
429
515
|
}
|
|
430
516
|
|
|
431
517
|
/**
|
|
432
518
|
* SO-01: Rotate 2D view by up to +-XXX degrees.
|
|
433
|
-
* @param
|
|
434
|
-
* @param deg The degrees.
|
|
519
|
+
* @param payload The scan movement payload.
|
|
435
520
|
*/
|
|
436
|
-
async rotateByDeg(
|
|
437
|
-
await this.sendPayload(FrontEndInterfaces.scan_orientation, ScanOrientationActions.so01,
|
|
438
|
-
Version: '0.0.1',
|
|
439
|
-
View: view,
|
|
440
|
-
Angle: deg
|
|
441
|
-
});
|
|
521
|
+
async rotateByDeg(payload: Viewer3crPayload<RotationValue>) {
|
|
522
|
+
await this.sendPayload(FrontEndInterfaces.scan_orientation, ScanOrientationActions.so01, payload);
|
|
442
523
|
}
|
|
443
524
|
|
|
444
525
|
/**
|
|
445
526
|
* SO-02: Flip 2D View Horizontally.
|
|
446
|
-
* @param
|
|
447
|
-
* @param flipped Whether to enable horizontal flip.
|
|
527
|
+
* @param payload The scan flip payload.
|
|
448
528
|
*/
|
|
449
|
-
async flipHorizontally(
|
|
450
|
-
await this.sendPayload(FrontEndInterfaces.scan_orientation, ScanOrientationActions.so02,
|
|
451
|
-
Version: '0.0.1',
|
|
452
|
-
View: view,
|
|
453
|
-
Flipped: flipped
|
|
454
|
-
});
|
|
529
|
+
async flipHorizontally(payload: Viewer3crPayload<FlipValue>): Promise<void> {
|
|
530
|
+
await this.sendPayload(FrontEndInterfaces.scan_orientation, ScanOrientationActions.so02, payload);
|
|
455
531
|
}
|
|
456
532
|
|
|
457
533
|
/**
|
|
458
534
|
* SO-03: Flip 2D View Vertically.
|
|
459
|
-
* @param
|
|
460
|
-
* @param flipped Whether to enable vertical flip.
|
|
535
|
+
* @param payload The scan flip payload.
|
|
461
536
|
*/
|
|
462
|
-
async flipVertically(
|
|
463
|
-
await this.sendPayload(FrontEndInterfaces.scan_orientation, ScanOrientationActions.so03,
|
|
464
|
-
Version: '0.0.1',
|
|
465
|
-
View: view,
|
|
466
|
-
Flipped: flipped
|
|
467
|
-
});
|
|
537
|
+
async flipVertically(payload: Viewer3crPayload<FlipValue>): Promise<void> {
|
|
538
|
+
await this.sendPayload(FrontEndInterfaces.scan_orientation, ScanOrientationActions.so03, payload);
|
|
468
539
|
}
|
|
469
540
|
|
|
470
541
|
/**
|
|
471
542
|
* SO-04: Invert Volume Rendering
|
|
472
|
-
* @param
|
|
473
|
-
* @param coronal If the Coronal axis is inverted.
|
|
474
|
-
* @param transverse If the Transverse axis is inverted.
|
|
543
|
+
* @param payload The invert volume payload.
|
|
475
544
|
*/
|
|
476
|
-
async invertTransform(
|
|
477
|
-
await this.sendPayload(FrontEndInterfaces.scan_orientation, ScanOrientationActions.so04,
|
|
478
|
-
Version: '0.0.1',
|
|
479
|
-
InvertedSagittal: sagittal,
|
|
480
|
-
InvertedCoronal: coronal,
|
|
481
|
-
InvertedTransverse: transverse
|
|
482
|
-
});
|
|
545
|
+
async invertTransform(payload: Viewer3crPayload<InvertTransformData>): Promise<void> {
|
|
546
|
+
await this.sendPayload(FrontEndInterfaces.scan_orientation, ScanOrientationActions.so04, payload);
|
|
483
547
|
}
|
|
484
548
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
549
|
+
async viewSelection(action: ViewSelectionActions) {
|
|
550
|
+
const payload = { message: { Version: '1.0.0' } };
|
|
551
|
+
await this.sendPayload(FrontEndInterfaces.view_selection, action, payload);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
async viewSelectionToggleView(payload: Viewer3crPayload<ViewToggleData>) {
|
|
555
|
+
await this.sendPayload(FrontEndInterfaces.view_selection, ViewSelectionActions.vs07, payload);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
async sliderHandler(action: SlidersActions, value: number) {
|
|
559
|
+
if (unref(transactionStarted)) return;
|
|
560
|
+
await this.slider(action, value);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
async scanMovementHandler(action: ScanMovementActions, value: number) {
|
|
564
|
+
if (unref(transactionStarted)) return;
|
|
565
|
+
await this.scanMovement(action, value);
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
async layouts(action: LayoutActions) {
|
|
569
|
+
if (action !== LayoutActions.lo01) previousLayout.value = action;
|
|
570
|
+
const payload = { message: { Version: '1.0.0' } };
|
|
571
|
+
await this.sendPayload(FrontEndInterfaces.layout, action, payload);
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
async setPreset(action: PresetsActions, preset: ColourPresetData | GreyscalePresetData) {
|
|
575
|
+
const payload = { message: preset };
|
|
576
|
+
await this.sendPayload(FrontEndInterfaces.presets, action, payload);
|
|
577
|
+
if (action === PresetsActions.pr02) {
|
|
578
|
+
currentColourPreset.value = preset as ColourPresetData;
|
|
579
|
+
}
|
|
498
580
|
}
|
|
499
581
|
|
|
500
582
|
private async scanMovement(action: ScanMovementActions, value: number) {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
Value: value
|
|
504
|
-
});
|
|
583
|
+
const payload = { message: { Version: '0.0.1', Value: value } };
|
|
584
|
+
await this.sendPayload(FrontEndInterfaces.scan_movement, action, payload);
|
|
505
585
|
}
|
|
506
586
|
|
|
507
587
|
private async slider(action: SlidersActions, value: number) {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
Value: value
|
|
511
|
-
});
|
|
588
|
+
const payload = { message: { Version: '0.0.1', Value: value } };
|
|
589
|
+
await this.sendPayload(FrontEndInterfaces.sliders, action, payload);
|
|
512
590
|
}
|
|
513
591
|
|
|
514
|
-
async sendPayload(
|
|
515
|
-
iface: string,
|
|
516
|
-
action: string,
|
|
517
|
-
message: any,
|
|
518
|
-
returnChannel?: string[],
|
|
519
|
-
returnTo?: string
|
|
520
|
-
): Promise<void> {
|
|
592
|
+
async sendPayload(iface: string, action: string, payload: Viewer3crPayload<unknown>): Promise<void> {
|
|
521
593
|
await executePayload({
|
|
522
594
|
Version: '0.0.1',
|
|
523
595
|
Interface: iface as any,
|
|
524
596
|
Action: action as any,
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
597
|
+
Message: payload.message ? JSON.stringify(payload.message) : null,
|
|
598
|
+
ReturnChannel: payload.returnChannel ? JSON.stringify(payload.returnChannel) : null,
|
|
599
|
+
ReturnTo: payload.returnTo ?? null
|
|
528
600
|
});
|
|
529
601
|
}
|
|
530
602
|
|
|
531
603
|
async onPayload(payload: FrontEndPayload): Promise<void> {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
payload.Action,
|
|
536
|
-
payload.ReturnChannel,
|
|
537
|
-
payload.ReturnTo
|
|
538
|
-
);
|
|
539
|
-
await this.actionCallbacks.call(payload.Action, payload.Message, payload.ReturnChannel, payload.ReturnTo);
|
|
604
|
+
const { Interface, Message, Action, ReturnChannel, ReturnTo } = payload;
|
|
605
|
+
await this.interfaceCallbacks.call(Interface, Message, Action, ReturnChannel, ReturnTo);
|
|
606
|
+
await this.actionCallbacks.call(Action, Message, ReturnChannel, ReturnTo);
|
|
540
607
|
}
|
|
541
608
|
}
|