@3cr/viewer-browser 0.0.248 → 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 +108286 -37159
- 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 +70 -48
- 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/asyncTools.ts +0 -3
- 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,110 +1,266 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
2
|
+
<div
|
|
3
|
+
:id="viewId"
|
|
4
|
+
class="scan-view"
|
|
5
|
+
ref="container"
|
|
6
|
+
@mouseenter="onMouseEnter"
|
|
7
|
+
@mousedown="onMouseEnter"
|
|
8
|
+
@mouseleave="onMouseLeave"
|
|
9
|
+
@touchstart="onMouseEnter"
|
|
10
|
+
@touchmove="onMouseEnter"
|
|
11
|
+
@touchend="onMouseLeave"
|
|
12
|
+
>
|
|
13
|
+
<v-hover #default="{ isHovering, props }">
|
|
14
|
+
<div v-bind="props" class="d-flex h-100 w-100">
|
|
15
|
+
<div class="d-flex flex-column flex-fill overflow-hidden">
|
|
16
|
+
<div class="pa-2">
|
|
17
|
+
<span class="text-white">{{ name }}</span>
|
|
18
|
+
<v-tooltip v-if="horizontalFlip" location="bottom">
|
|
19
|
+
<template #activator="{ props }">
|
|
20
|
+
<v-icon v-bind="props" icon="swap_horiz" color="blue-darken-1" class="ml-2" />
|
|
21
|
+
</template>
|
|
22
|
+
<span>{{ t('texts.flippedHorizontally') }}</span>
|
|
23
|
+
</v-tooltip>
|
|
24
|
+
<v-tooltip v-if="verticalFlip" location="bottom">
|
|
25
|
+
<template #activator="{ props }">
|
|
26
|
+
<v-icon v-bind="props" icon="swap_vert" color="blue-darken-1" class="ml-2" />
|
|
27
|
+
</template>
|
|
28
|
+
<span>{{ t('texts.flippedVertically') }}</span>
|
|
29
|
+
</v-tooltip>
|
|
30
|
+
</div>
|
|
31
|
+
<v-spacer />
|
|
32
|
+
<div class="pa-2">
|
|
33
|
+
<Transition>
|
|
34
|
+
<div v-show="isHovering || isUserInteracting">
|
|
35
|
+
<ViewerActionRail :view="view" @modal="onActionModal" />
|
|
36
|
+
</div>
|
|
37
|
+
</Transition>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="d-flex flex-column">
|
|
41
|
+
<VerticalSliderSelector
|
|
42
|
+
v-if="view === ScanView.Transverse"
|
|
43
|
+
class="px-4 my-0"
|
|
44
|
+
v-model:value="scanState.Orientations.Transverse.Slice"
|
|
45
|
+
v-bind="tMinMax"
|
|
46
|
+
/>
|
|
47
|
+
<VerticalSliderSelector
|
|
48
|
+
v-if="view === ScanView.Coronal"
|
|
49
|
+
class="px-4 my-0"
|
|
50
|
+
v-model:value="scanState.Orientations.Coronal.Slice"
|
|
51
|
+
v-bind="cMinMax"
|
|
52
|
+
/>
|
|
53
|
+
<VerticalSliderSelector
|
|
54
|
+
v-if="view === ScanView.Sagittal"
|
|
55
|
+
class="px-4 my-0"
|
|
56
|
+
v-model:value="scanState.Orientations.Sagittal.Slice"
|
|
57
|
+
v-bind="sMinMax"
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
57
61
|
</v-hover>
|
|
58
62
|
</div>
|
|
59
63
|
</template>
|
|
60
64
|
|
|
61
65
|
<script setup lang="ts">
|
|
62
66
|
import {
|
|
63
|
-
getViewName,
|
|
64
67
|
isHorizontalFlip,
|
|
65
68
|
isVerticalFlip,
|
|
66
69
|
cMinMax,
|
|
67
70
|
scanState,
|
|
68
71
|
sMinMax,
|
|
69
|
-
tMinMax
|
|
72
|
+
tMinMax,
|
|
73
|
+
isLayout2x2,
|
|
74
|
+
isLayout1x3,
|
|
75
|
+
isFullscreen
|
|
70
76
|
} from '@/models/scanState';
|
|
71
77
|
import { ScanView } from '@3cr/types-ts';
|
|
72
|
-
import { computed, ref } from 'vue';
|
|
78
|
+
import { computed, onMounted, ref } from 'vue';
|
|
79
|
+
import { storeToRefs } from 'pinia';
|
|
80
|
+
import { useViewerStore } from '@/stores/viewer.store';
|
|
81
|
+
import { useLayout2x2 } from '@/components/modal/layouts/composables/useLayout2x2';
|
|
82
|
+
import { useLayout1x3 } from '@/components/modal/layouts/composables/useLayout1x3';
|
|
83
|
+
import { useLayoutFullscreen } from '@/components/modal/layouts/composables/useLayoutFullscreen';
|
|
84
|
+
import { useI18n } from 'vue-i18n';
|
|
85
|
+
import { useViewName } from '@/composables/useViewName';
|
|
86
|
+
import { forceType } from '@/functions/tsHelper';
|
|
73
87
|
|
|
74
88
|
interface Props {
|
|
75
89
|
view: ScanView;
|
|
90
|
+
canvas: HTMLCanvasElement;
|
|
91
|
+
padding?: number;
|
|
92
|
+
radius?: number;
|
|
76
93
|
}
|
|
77
94
|
|
|
78
|
-
const
|
|
95
|
+
const NONE = { x: 0, y: 0, width: 0, height: 0 };
|
|
79
96
|
|
|
80
|
-
const
|
|
97
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
98
|
+
padding: 8,
|
|
99
|
+
radius: 8
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const { t } = useI18n();
|
|
103
|
+
const { activeView, enableMouse, enableKeyboard } = storeToRefs(useViewerStore());
|
|
104
|
+
const { fullscreen } = useLayoutFullscreen(props.canvas, props.padding);
|
|
105
|
+
const { name } = useViewName(props.view);
|
|
106
|
+
const layout2x2 = useLayout2x2(props.canvas, props.padding);
|
|
107
|
+
const layout1x3 = useLayout1x3(props.canvas, props.padding);
|
|
108
|
+
|
|
109
|
+
const isUserInteracting = ref<boolean>(false);
|
|
81
110
|
const container = ref<HTMLDivElement>();
|
|
82
|
-
|
|
111
|
+
|
|
83
112
|
const horizontalFlip = computed(() => isHorizontalFlip(props.view));
|
|
84
113
|
const verticalFlip = computed(() => isVerticalFlip(props.view));
|
|
85
114
|
|
|
115
|
+
const viewId = computed(() => {
|
|
116
|
+
switch (props.view) {
|
|
117
|
+
case ScanView.Volume:
|
|
118
|
+
return 'volume';
|
|
119
|
+
case ScanView.Sagittal:
|
|
120
|
+
return 'sagittal';
|
|
121
|
+
case ScanView.Coronal:
|
|
122
|
+
return 'coronal';
|
|
123
|
+
case ScanView.Transverse:
|
|
124
|
+
return 'transverse';
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
/* v8 ignore start -- @Preserve */
|
|
128
|
+
const layout = computed(() => {
|
|
129
|
+
if (isFullscreen.value) {
|
|
130
|
+
return { volume: fullscreen, sagittal: fullscreen, transverse: fullscreen, coronal: fullscreen };
|
|
131
|
+
} else if (isLayout2x2.value) {
|
|
132
|
+
return layout2x2;
|
|
133
|
+
} else if (isLayout1x3.value) {
|
|
134
|
+
return layout1x3;
|
|
135
|
+
} else {
|
|
136
|
+
return { volume: NONE, sagittal: NONE, transverse: NONE, coronal: NONE };
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
onMounted(() => {
|
|
140
|
+
container.value!.addEventListener('wheel', (e: WheelEvent) => {
|
|
141
|
+
e.preventDefault();
|
|
142
|
+
props.canvas.dispatchEvent(new WheelEvent(e.type, e));
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
container.value!.addEventListener(
|
|
146
|
+
'touchstart',
|
|
147
|
+
(e: TouchEvent) => {
|
|
148
|
+
props.canvas.dispatchEvent(new TouchEvent(e.type, forceType<TouchEventInit>(e)));
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
passive: true
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
container.value!.addEventListener(
|
|
155
|
+
'touchmove',
|
|
156
|
+
(e: TouchEvent) => {
|
|
157
|
+
props.canvas.dispatchEvent(new TouchEvent(e.type, forceType<TouchEventInit>(e)));
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
passive: true
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
container.value!.addEventListener(
|
|
164
|
+
'touchend',
|
|
165
|
+
(e: TouchEvent) => {
|
|
166
|
+
props.canvas.dispatchEvent(new TouchEvent(e.type, forceType<TouchEventInit>(e)));
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
passive: true
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
container.value!.addEventListener(
|
|
173
|
+
'touchcancel',
|
|
174
|
+
(e: TouchEvent) => {
|
|
175
|
+
props.canvas.dispatchEvent(new TouchEvent(e.type, forceType<TouchEventInit>(e)));
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
passive: true
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
container.value!.addEventListener('mousedown', (e: MouseEvent) => {
|
|
183
|
+
e.preventDefault();
|
|
184
|
+
props.canvas.dispatchEvent(new MouseEvent(e.type, e));
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
container.value!.addEventListener('mouseup', (e: MouseEvent) => {
|
|
188
|
+
e.preventDefault();
|
|
189
|
+
props.canvas.dispatchEvent(new MouseEvent(e.type, e));
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
container.value!.addEventListener('contextmenu', (e: Event) => {
|
|
193
|
+
e.preventDefault();
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
/* v8 ignore stop -- @Preserve */
|
|
197
|
+
|
|
86
198
|
function onActionModal(value: boolean): void {
|
|
87
|
-
|
|
199
|
+
isUserInteracting.value = value;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function onMouseEnter(): void {
|
|
203
|
+
activeView.value = props.view;
|
|
204
|
+
enableMouse.value = true;
|
|
205
|
+
enableKeyboard.value = true;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function onMouseLeave(): void {
|
|
209
|
+
activeView.value = undefined;
|
|
210
|
+
enableMouse.value = false;
|
|
211
|
+
enableKeyboard.value = false;
|
|
88
212
|
}
|
|
89
213
|
</script>
|
|
90
214
|
|
|
91
215
|
<style scoped lang="scss">
|
|
92
|
-
|
|
216
|
+
@use '@/assets/palette' as p;
|
|
217
|
+
|
|
218
|
+
#volume {
|
|
93
219
|
cursor: grab;
|
|
220
|
+
left: calc(v-bind('layout.volume.x') * 1px);
|
|
221
|
+
top: calc(v-bind('layout.volume.y') * 1px);
|
|
222
|
+
width: calc(v-bind('layout.volume.width') * 1px);
|
|
223
|
+
height: calc(v-bind('layout.volume.height') * 1px);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
#transverse {
|
|
227
|
+
left: calc(v-bind('layout.transverse.x') * 1px);
|
|
228
|
+
top: calc(v-bind('layout.transverse.y') * 1px);
|
|
229
|
+
width: calc(v-bind('layout.transverse.width') * 1px);
|
|
230
|
+
height: calc(v-bind('layout.transverse.height') * 1px);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
#sagittal {
|
|
234
|
+
left: calc(v-bind('layout.sagittal.x') * 1px);
|
|
235
|
+
top: calc(v-bind('layout.sagittal.y') * 1px);
|
|
236
|
+
width: calc(v-bind('layout.sagittal.width') * 1px);
|
|
237
|
+
height: calc(v-bind('layout.sagittal.height') * 1px);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
#coronal {
|
|
241
|
+
left: calc(v-bind('layout.coronal.x') * 1px);
|
|
242
|
+
top: calc(v-bind('layout.coronal.y') * 1px);
|
|
243
|
+
width: calc(v-bind('layout.coronal.width') * 1px);
|
|
244
|
+
height: calc(v-bind('layout.coronal.height') * 1px);
|
|
94
245
|
}
|
|
95
246
|
|
|
96
247
|
.scan-view {
|
|
97
|
-
border:
|
|
98
|
-
|
|
248
|
+
border: transparent 2px dashed;
|
|
249
|
+
border-radius: calc(v-bind('radius') * 1px);
|
|
250
|
+
position: absolute;
|
|
251
|
+
transition:
|
|
252
|
+
border 0.5s linear,
|
|
253
|
+
box-shadow 0.5s linear;
|
|
99
254
|
}
|
|
100
255
|
|
|
101
256
|
.scan-view:hover {
|
|
102
|
-
border:
|
|
257
|
+
border: map-get(p.$minsk, 500) 2px dashed;
|
|
258
|
+
box-shadow: 0 0 8px 1px map-get(p.$minsk, 500);
|
|
103
259
|
}
|
|
104
260
|
|
|
105
261
|
.v-enter-active,
|
|
106
262
|
.v-leave-active {
|
|
107
|
-
transition: opacity 0.5s
|
|
263
|
+
transition: opacity 0.5s linear;
|
|
108
264
|
}
|
|
109
265
|
|
|
110
266
|
.v-enter-from,
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { inflateInitialScanState, inflateScanState } from '@/functions/modelHelper';
|
|
2
|
-
import {
|
|
3
|
-
AnchorPoint,
|
|
4
|
-
FrontEndInterfaces,
|
|
5
|
-
LayoutActions,
|
|
6
|
-
PositionData,
|
|
7
|
-
ScanMovementActions,
|
|
8
|
-
SlidersActions
|
|
9
|
-
} from '@3cr/types-ts';
|
|
2
|
+
import { AnchorPoint, FrontEndInterfaces, PositionData, ScanMovementActions, SlidersActions } from '@3cr/types-ts';
|
|
10
3
|
import { flushPromises, mount } from '@vue/test-utils';
|
|
11
4
|
import { spyOn } from '@vitest/spy';
|
|
12
5
|
import {
|
|
@@ -22,36 +15,52 @@ import {
|
|
|
22
15
|
tSlider,
|
|
23
16
|
windowSlider
|
|
24
17
|
} from '@/models/scanState';
|
|
25
|
-
import { defineComponent,
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
29
|
-
import { VBtn, VDialog } from 'vuetify/components';
|
|
18
|
+
import { defineComponent, ref, unref } from 'vue';
|
|
19
|
+
import { Viewer3crServiceImpl } from '@/services/viewer-3cr.service';
|
|
20
|
+
import { VDialog } from 'vuetify/components';
|
|
21
|
+
import Viewer3cr from '@/components/modal/Viewer3cr.vue';
|
|
30
22
|
import SettingsMenu from '@/components/modal/menus/SettingsMenu.vue';
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
import { useDemoStore } from '@/stores/demo.store';
|
|
24
|
+
import { createPinia, setActivePinia, storeToRefs } from 'pinia';
|
|
25
|
+
import { useViewer3cr } from '@/composables/useViewer3cr';
|
|
26
|
+
import { MockInstance } from '@vitest/spy';
|
|
27
|
+
import ViewerNavigationDrawer from '@/components/modal/ViewerNavigationDrawer.vue';
|
|
28
|
+
import ViewerAppBar from '@/components/modal/app-bars/ViewerAppBar.vue';
|
|
29
|
+
import DemoNotificationNavigationDrawer from '@/components/demo/DemoNotificationNavigationDrawer.vue';
|
|
30
|
+
import ViewerIntro from '@/components/intro/ViewerIntro.vue';
|
|
31
|
+
import ViewerTour from '@/components/intro/ViewerTour.vue';
|
|
32
|
+
import WhatsNewModal from '@/components/modal/modal/WhatsNewModal.vue';
|
|
33
|
+
import { ViewerPayload } from '@3cr/viewer-types-ts';
|
|
34
|
+
import { useViewerStore } from '@/stores/viewer.store';
|
|
35
|
+
import { createTestingPinia } from '@pinia/testing';
|
|
36
|
+
|
|
37
|
+
let spy: MockInstance;
|
|
33
38
|
|
|
34
39
|
const app = defineComponent({
|
|
35
|
-
template: '<v-app><
|
|
36
|
-
components: {
|
|
40
|
+
template: '<v-app><Viewer3cr ref="webgl"></Viewer3cr></v-app>',
|
|
41
|
+
components: { Viewer3cr },
|
|
37
42
|
setup() {
|
|
38
|
-
const webgl = ref<typeof
|
|
39
|
-
onMounted(() => webgl.value!.alterValue(true));
|
|
43
|
+
const webgl = ref<typeof Viewer3cr>();
|
|
40
44
|
return { webgl };
|
|
41
45
|
}
|
|
42
46
|
});
|
|
43
47
|
|
|
44
|
-
describe('
|
|
45
|
-
|
|
48
|
+
describe('Viewer3cr tests', () => {
|
|
49
|
+
const viewer3cr = useViewer3cr() as Viewer3crServiceImpl;
|
|
50
|
+
const { isDemo } = storeToRefs(useDemoStore());
|
|
51
|
+
|
|
52
|
+
let wrapper = mount(app, { global: { stubs: ['Viewer3crWebGL'] } });
|
|
53
|
+
spy = spyOn(viewer3cr, 'sendPayload').mockResolvedValue();
|
|
46
54
|
|
|
47
55
|
beforeEach(() => {
|
|
48
56
|
transactionStarted.value = false;
|
|
49
|
-
spy = spyOn(
|
|
50
|
-
wrapper = mount(app, { global: { stubs: ['
|
|
57
|
+
spy = spyOn(viewer3cr, 'sendPayload').mockResolvedValue();
|
|
58
|
+
wrapper = mount(app, { global: { stubs: ['Viewer3crWebGL'] } });
|
|
51
59
|
});
|
|
52
60
|
|
|
53
61
|
afterEach(() => {
|
|
54
62
|
isDemo.value = false;
|
|
63
|
+
vi.clearAllMocks();
|
|
55
64
|
wrapper.unmount();
|
|
56
65
|
});
|
|
57
66
|
|
|
@@ -284,26 +293,102 @@ describe('MftpWebGL3DRModal tests', () => {
|
|
|
284
293
|
expect(unref(currentGreyscalePreset)).toBe(undefined);
|
|
285
294
|
});
|
|
286
295
|
|
|
287
|
-
it('should
|
|
288
|
-
const wrapper = mount(
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
296
|
+
it('should close dialog', async () => {
|
|
297
|
+
const wrapper = mount(Viewer3cr);
|
|
298
|
+
expect(wrapper.vm.m_closeDialog).toBe(false);
|
|
299
|
+
wrapper.findComponent(ViewerNavigationDrawer).vm.$emit('close');
|
|
300
|
+
expect(wrapper.vm.m_closeDialog).toBe(true);
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
it('should close dialog appbar', async () => {
|
|
304
|
+
const wrapper = mount(Viewer3cr);
|
|
305
|
+
expect(wrapper.vm.m_closeDialog).toBe(false);
|
|
306
|
+
wrapper.findComponent(ViewerAppBar).vm.$emit('close');
|
|
307
|
+
expect(wrapper.vm.m_closeDialog).toBe(true);
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
it('should ViewerIntro emit start', async () => {
|
|
311
|
+
const wrapper = mount(Viewer3cr);
|
|
312
|
+
expect(wrapper.vm.tourActive).toBe(false);
|
|
313
|
+
wrapper.findComponent(ViewerIntro).vm.$emit('start');
|
|
314
|
+
await flushPromises();
|
|
315
|
+
expect(wrapper.vm.tourActive).toBe(true);
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
it('should ViewerIntro set value', async () => {
|
|
319
|
+
const wrapper = mount(Viewer3cr);
|
|
320
|
+
expect(wrapper.vm.introActive).toBe(false);
|
|
321
|
+
await wrapper.findComponent(ViewerIntro).setValue(true);
|
|
322
|
+
expect(wrapper.vm.introActive).toBe(true);
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
it('should ViewerTour set value', async () => {
|
|
326
|
+
const wrapper = mount(Viewer3cr);
|
|
327
|
+
expect(wrapper.vm.tourActive).toBe(false);
|
|
328
|
+
await wrapper.findComponent(ViewerTour).setValue(true);
|
|
329
|
+
expect(wrapper.vm.tourActive).toBe(true);
|
|
293
330
|
});
|
|
294
331
|
|
|
295
|
-
it('should set
|
|
296
|
-
|
|
332
|
+
it('should ViewerTour set value', async () => {
|
|
333
|
+
const wrapper = mount(Viewer3cr);
|
|
334
|
+
expect(wrapper.vm.whatsNewActive).toBe(false);
|
|
335
|
+
await wrapper.findComponent(WhatsNewModal).setValue(true);
|
|
336
|
+
expect(wrapper.vm.whatsNewActive).toBe(true);
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
it('should set whatsNewActive through watcher', async () => {
|
|
340
|
+
const { demoOptions } = storeToRefs(useDemoStore());
|
|
341
|
+
const { options } = storeToRefs(useViewerStore());
|
|
342
|
+
const wrapper = mount(Viewer3cr, {
|
|
343
|
+
props: {
|
|
344
|
+
payload: {
|
|
345
|
+
Url: 'https://webgl-3dr.singular.health/not-demo'
|
|
346
|
+
} as ViewerPayload
|
|
347
|
+
}
|
|
348
|
+
});
|
|
297
349
|
await flushPromises();
|
|
298
|
-
|
|
299
|
-
|
|
350
|
+
expect(wrapper.vm.whatsNewActive).toBe(false);
|
|
351
|
+
await wrapper.findComponent(ViewerTour).setValue(true);
|
|
352
|
+
await wrapper.findComponent(ViewerTour).setValue(false);
|
|
353
|
+
expect(wrapper.vm.whatsNewActive).toBe(true);
|
|
354
|
+
|
|
355
|
+
expect(options.value).not.toStrictEqual(demoOptions.value);
|
|
300
356
|
});
|
|
301
357
|
|
|
302
|
-
it('should
|
|
303
|
-
|
|
358
|
+
it('should setValue', async () => {
|
|
359
|
+
setActivePinia(createPinia());
|
|
360
|
+
|
|
361
|
+
const wrapper = mount(Viewer3cr, {
|
|
362
|
+
plugins: [createTestingPinia({ createSpy: vi.fn })]
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
const { notificationDropdown, isDemo } = storeToRefs(useDemoStore());
|
|
366
|
+
isDemo.value = true;
|
|
367
|
+
await wrapper.setProps({
|
|
368
|
+
payload: {
|
|
369
|
+
Url: 'https://webgl-3dr.singular.health/demo-1'
|
|
370
|
+
} as ViewerPayload
|
|
371
|
+
});
|
|
304
372
|
await flushPromises();
|
|
305
|
-
|
|
306
|
-
|
|
373
|
+
expect(notificationDropdown.value).toStrictEqual({
|
|
374
|
+
modal: false,
|
|
375
|
+
x: 0,
|
|
376
|
+
y: 0
|
|
377
|
+
});
|
|
378
|
+
await wrapper.findComponent(DemoNotificationNavigationDrawer).setValue(true);
|
|
379
|
+
expect(notificationDropdown.value).toStrictEqual({
|
|
380
|
+
modal: true,
|
|
381
|
+
x: 0,
|
|
382
|
+
y: 0
|
|
383
|
+
});
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
it('should v-model modals', async () => {
|
|
387
|
+
const wrapper = mount(Viewer3cr);
|
|
388
|
+
const modals = wrapper.findAllComponents(VDialog);
|
|
389
|
+
for (const modal of modals) {
|
|
390
|
+
await modal.setValue(false);
|
|
391
|
+
}
|
|
307
392
|
});
|
|
308
393
|
|
|
309
394
|
it('should set settings-menu model', async () => {
|
|
@@ -320,13 +405,17 @@ async function testWatcherForDisplay(key: string, action: SlidersActions, not: b
|
|
|
320
405
|
|
|
321
406
|
if (not) {
|
|
322
407
|
expect(spy).not.toHaveBeenCalledWith(FrontEndInterfaces.sliders, action, {
|
|
323
|
-
|
|
324
|
-
|
|
408
|
+
message: {
|
|
409
|
+
Version: '0.0.1',
|
|
410
|
+
Value: (scanState.Display as any)[key]
|
|
411
|
+
}
|
|
325
412
|
});
|
|
326
413
|
} else {
|
|
327
414
|
expect(spy).toHaveBeenCalledWith(FrontEndInterfaces.sliders, action, {
|
|
328
|
-
|
|
329
|
-
|
|
415
|
+
message: {
|
|
416
|
+
Version: '0.0.1',
|
|
417
|
+
Value: (scanState.Display as any)[key]
|
|
418
|
+
}
|
|
330
419
|
});
|
|
331
420
|
}
|
|
332
421
|
}
|
|
@@ -341,13 +430,17 @@ async function testWatcherForSlice(key: string, action: SlidersActions, not: boo
|
|
|
341
430
|
|
|
342
431
|
if (not) {
|
|
343
432
|
expect(spy).not.toHaveBeenCalledWith(FrontEndInterfaces.sliders, action, {
|
|
344
|
-
|
|
345
|
-
|
|
433
|
+
message: {
|
|
434
|
+
Version: '0.0.1',
|
|
435
|
+
Value: (scanState.Slice as any)[key]
|
|
436
|
+
}
|
|
346
437
|
});
|
|
347
438
|
} else {
|
|
348
439
|
expect(spy).toHaveBeenCalledWith(FrontEndInterfaces.sliders, action, {
|
|
349
|
-
|
|
350
|
-
|
|
440
|
+
message: {
|
|
441
|
+
Version: '0.0.1',
|
|
442
|
+
Value: (scanState.Slice as any)[key]
|
|
443
|
+
}
|
|
351
444
|
});
|
|
352
445
|
}
|
|
353
446
|
}
|
|
@@ -361,13 +454,17 @@ async function testWatcherForOrientation(key: string, action: SlidersActions, no
|
|
|
361
454
|
await flushPromises();
|
|
362
455
|
if (not) {
|
|
363
456
|
expect(spy).not.toHaveBeenCalledWith(FrontEndInterfaces.sliders, action, {
|
|
364
|
-
|
|
365
|
-
|
|
457
|
+
message: {
|
|
458
|
+
Version: '0.0.1',
|
|
459
|
+
Value: (scanState.Orientations as any)[key].Slice
|
|
460
|
+
}
|
|
366
461
|
});
|
|
367
462
|
} else {
|
|
368
463
|
expect(spy).toHaveBeenCalledWith(FrontEndInterfaces.sliders, action, {
|
|
369
|
-
|
|
370
|
-
|
|
464
|
+
message: {
|
|
465
|
+
Version: '0.0.1',
|
|
466
|
+
Value: (scanState.Orientations as any)[key].Slice
|
|
467
|
+
}
|
|
371
468
|
});
|
|
372
469
|
}
|
|
373
470
|
}
|
|
@@ -381,13 +478,17 @@ async function testWatcherForInteractionSettings(key: string, action: ScanMoveme
|
|
|
381
478
|
await flushPromises();
|
|
382
479
|
if (not) {
|
|
383
480
|
expect(spy).not.toHaveBeenCalledWith(FrontEndInterfaces.scan_movement, action, {
|
|
384
|
-
|
|
385
|
-
|
|
481
|
+
message: {
|
|
482
|
+
Version: '0.0.1',
|
|
483
|
+
Value: (scanState.InteractionSettings as any)[key]
|
|
484
|
+
}
|
|
386
485
|
});
|
|
387
486
|
} else {
|
|
388
487
|
expect(spy).toHaveBeenCalledWith(FrontEndInterfaces.scan_movement, action, {
|
|
389
|
-
|
|
390
|
-
|
|
488
|
+
message: {
|
|
489
|
+
Version: '0.0.1',
|
|
490
|
+
Value: (scanState.InteractionSettings as any)[key]
|
|
491
|
+
}
|
|
391
492
|
});
|
|
392
493
|
}
|
|
393
494
|
}
|