@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
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<canvas id="canvas" ref="canvas" width="100%" height="100%"></canvas>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup lang="ts">
|
|
6
|
+
import { onMounted, ref, watch } from 'vue';
|
|
7
|
+
import { useViewer3cr } from '@/composables/useViewer3cr';
|
|
8
|
+
import { InteractivityState } from '@3cr/types-ts';
|
|
9
|
+
import { storeToRefs } from 'pinia';
|
|
10
|
+
import { useViewerStore } from '@/stores/viewer.store';
|
|
11
|
+
import { useNavigationCube } from '@/composables/useNavigationCube';
|
|
12
|
+
|
|
13
|
+
type Emits = {
|
|
14
|
+
loaded: [void];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const emit = defineEmits<Emits>();
|
|
18
|
+
|
|
19
|
+
const viewer3cr = useViewer3cr();
|
|
20
|
+
const { enableMouse, enableKeyboard, options } = storeToRefs(useViewerStore());
|
|
21
|
+
|
|
22
|
+
const canvas = ref<HTMLCanvasElement>();
|
|
23
|
+
useNavigationCube(canvas);
|
|
24
|
+
|
|
25
|
+
/* v8 ignore start -- @preserve */
|
|
26
|
+
watch(enableMouse, async (value: boolean) => {
|
|
27
|
+
const message: InteractivityState = { Version: '0.0.0', Value: value };
|
|
28
|
+
await viewer3cr.setMouseInput({ message });
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
watch(enableKeyboard, async (value: boolean) => {
|
|
32
|
+
const message: InteractivityState = { Version: '0.0.0', Value: value };
|
|
33
|
+
await viewer3cr.setKeyboardInput({ message });
|
|
34
|
+
});
|
|
35
|
+
/* v8 ignore stop -- @preserve */
|
|
36
|
+
|
|
37
|
+
onMounted(async () => {
|
|
38
|
+
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
|
|
39
|
+
// Mobile device style: fill the whole browser client area with the game canvas:
|
|
40
|
+
const meta = document.createElement('meta');
|
|
41
|
+
meta.name = 'viewport';
|
|
42
|
+
meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
|
|
43
|
+
document.head.appendChild(meta);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (navigator.storage && navigator.storage.estimate) {
|
|
47
|
+
const quota = await navigator.storage.estimate();
|
|
48
|
+
const percentageUsed = (quota.usage! / quota.quota!) * 100;
|
|
49
|
+
console.log(`You've used ${percentageUsed}% of the available storage.`);
|
|
50
|
+
const remaining = quota.quota! - quota.usage!;
|
|
51
|
+
console.log(`You can write up to ${remaining} more bytes.`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
await viewer3cr.register(canvas.value!);
|
|
55
|
+
/* v8 ignore start -- @preserve */
|
|
56
|
+
if (options.value.onViewerLoaded) {
|
|
57
|
+
await options.value.onViewerLoaded(viewer3cr);
|
|
58
|
+
}
|
|
59
|
+
/* v8 ignore stop -- @preserve */
|
|
60
|
+
|
|
61
|
+
emit('loaded');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
defineExpose({ canvas });
|
|
65
|
+
</script>
|
|
@@ -6,22 +6,10 @@
|
|
|
6
6
|
:menu-activator-props="menuActivatorProps"
|
|
7
7
|
>
|
|
8
8
|
<template #visible="{ action }">
|
|
9
|
-
<Component
|
|
10
|
-
:is="action.component"
|
|
11
|
-
:view="view"
|
|
12
|
-
:element="element"
|
|
13
|
-
variant="button"
|
|
14
|
-
@update:modal="onActionModal"
|
|
15
|
-
/>
|
|
9
|
+
<Component :is="action.component" :view="view" variant="button" @update:modal="onActionModal" />
|
|
16
10
|
</template>
|
|
17
11
|
<template #hidden="{ action }">
|
|
18
|
-
<Component
|
|
19
|
-
:is="action.component"
|
|
20
|
-
:view="view"
|
|
21
|
-
:element="element"
|
|
22
|
-
variant="menu-item"
|
|
23
|
-
@update:modal="onActionModal"
|
|
24
|
-
/>
|
|
12
|
+
<Component :is="action.component" :view="view" variant="menu-item" @update:modal="onActionModal" />
|
|
25
13
|
</template>
|
|
26
14
|
</ActionRail>
|
|
27
15
|
</template>
|
|
@@ -37,11 +25,9 @@ import ResetViewAction from '@/components/modal/actions/ResetViewAction.vue';
|
|
|
37
25
|
import Rotate2dAction from '@/components/modal/actions/Rotate2dAction.vue';
|
|
38
26
|
import Slice3dAction from '@/components/modal/actions/Slice3dAction.vue';
|
|
39
27
|
import ZoomAction from '@/components/modal/actions/ZoomAction.vue';
|
|
40
|
-
import { useViewer3cr } from '@/composables/useViewer3cr';
|
|
41
28
|
|
|
42
29
|
interface Props {
|
|
43
30
|
view: ScanView;
|
|
44
|
-
element: EventTarget;
|
|
45
31
|
}
|
|
46
32
|
|
|
47
33
|
type Emits = {
|
|
@@ -58,8 +44,6 @@ const props = defineProps<Props>();
|
|
|
58
44
|
|
|
59
45
|
const emit = defineEmits<Emits>();
|
|
60
46
|
|
|
61
|
-
const viewer3cr = useViewer3cr();
|
|
62
|
-
|
|
63
47
|
const menuProps = computed(() => ({
|
|
64
48
|
closeOnContentClick: false
|
|
65
49
|
}));
|
|
@@ -81,48 +65,47 @@ const viewActions = computed(() => {
|
|
|
81
65
|
const actions = computed<ActionItem[]>(() => [
|
|
82
66
|
{
|
|
83
67
|
component: FullscreenAction,
|
|
84
|
-
width:
|
|
68
|
+
width: 52,
|
|
85
69
|
condition: true
|
|
86
70
|
},
|
|
87
71
|
{
|
|
88
72
|
component: ResetViewAction,
|
|
89
|
-
width:
|
|
73
|
+
width: 52,
|
|
90
74
|
condition: true
|
|
91
75
|
},
|
|
92
76
|
{
|
|
93
77
|
component: PanAction,
|
|
94
|
-
width:
|
|
78
|
+
width: 52,
|
|
95
79
|
condition: true
|
|
96
80
|
},
|
|
97
81
|
{
|
|
98
82
|
component: ZoomAction,
|
|
99
|
-
width:
|
|
83
|
+
width: 52,
|
|
100
84
|
condition: true
|
|
101
85
|
},
|
|
102
86
|
{
|
|
103
87
|
component: Slice3dAction,
|
|
104
|
-
width:
|
|
88
|
+
width: 52,
|
|
105
89
|
condition: props.view === ScanView.Volume
|
|
106
90
|
},
|
|
107
91
|
{
|
|
108
92
|
component: Rotate2dAction,
|
|
109
|
-
width:
|
|
93
|
+
width: 52,
|
|
110
94
|
condition: props.view !== ScanView.Volume
|
|
111
95
|
},
|
|
112
96
|
{
|
|
113
97
|
component: FlipHorizontalAction,
|
|
114
|
-
width:
|
|
98
|
+
width: 52,
|
|
115
99
|
condition: props.view !== ScanView.Volume
|
|
116
100
|
},
|
|
117
101
|
{
|
|
118
102
|
component: FlipVerticalAction,
|
|
119
|
-
width:
|
|
103
|
+
width: 52,
|
|
120
104
|
condition: props.view !== ScanView.Volume
|
|
121
105
|
}
|
|
122
106
|
]);
|
|
123
107
|
|
|
124
108
|
async function onActionModal(value: boolean): Promise<void> {
|
|
125
|
-
await viewer3cr.hoverOverCanvas(!value); // disable unity inputs when interacting with modals
|
|
126
109
|
emit('modal', value);
|
|
127
110
|
}
|
|
128
111
|
</script>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="h-100">
|
|
3
|
+
<v-row class="h-100" no-gutters>
|
|
4
|
+
<v-col>
|
|
5
|
+
<div class="wrapper">
|
|
6
|
+
<Viewer3crWebGL ref="webgl" class="webgl" :class="[isMobile && 'mobile-view']" @loaded="onLoaded" />
|
|
7
|
+
<LayoutFullscreenClipPath v-if="isReady && isFullscreen" :canvas="webgl!.canvas!" />
|
|
8
|
+
<Layout2x2ClipPath v-else-if="isReady && isLayout2x2" :canvas="webgl!.canvas!" />
|
|
9
|
+
<Layout1x3ClipPath v-else-if="isReady && isLayout1x3" :canvas="webgl!.canvas!" />
|
|
10
|
+
<template v-if="isReady">
|
|
11
|
+
<template v-for="layout in scanState.Layout.PositionData" :key="getCurrentView(layout)">
|
|
12
|
+
<ViewerScanView :canvas="webgl!.canvas!" :view="getCurrentView(layout)" />
|
|
13
|
+
</template>
|
|
14
|
+
</template>
|
|
15
|
+
<mcad-floating v-if="activeDrawer === 'design'" />
|
|
16
|
+
</div>
|
|
17
|
+
</v-col>
|
|
18
|
+
</v-row>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script setup lang="ts">
|
|
23
|
+
import { computed, ref } from 'vue';
|
|
24
|
+
import { getCurrentView, isFullscreen, isLayout1x3, isLayout2x2, scanState } from '@/models/scanState';
|
|
25
|
+
import Viewer3crWebGL from '@/components/modal/Viewer3crWebGL.vue';
|
|
26
|
+
import McadFloating from '@/components/navigation/mcad/McadFloating.vue';
|
|
27
|
+
import { storeToRefs } from 'pinia';
|
|
28
|
+
import { useDrawerStore } from '@/stores/drawer.store';
|
|
29
|
+
|
|
30
|
+
type Emits = {
|
|
31
|
+
loaded: [void];
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const emit = defineEmits<Emits>();
|
|
35
|
+
const { activeDrawer } = storeToRefs(useDrawerStore());
|
|
36
|
+
|
|
37
|
+
const loaded = ref<boolean>(false);
|
|
38
|
+
const webgl = ref<InstanceType<typeof Viewer3crWebGL>>();
|
|
39
|
+
|
|
40
|
+
const isReady = computed(() => {
|
|
41
|
+
return loaded.value && !!webgl.value?.canvas;
|
|
42
|
+
});
|
|
43
|
+
const isMobile = computed(() => {
|
|
44
|
+
return window.mobileCheck();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const layout = computed(() => {
|
|
48
|
+
if (isFullscreen.value) {
|
|
49
|
+
return 'url(#layout-fullscreen)';
|
|
50
|
+
} else if (isLayout2x2.value) {
|
|
51
|
+
return 'url(#layout-2x2)';
|
|
52
|
+
} else if (isLayout1x3.value) {
|
|
53
|
+
return 'url(#layout-1x3)';
|
|
54
|
+
} else {
|
|
55
|
+
return 'none';
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
function onLoaded(): void {
|
|
60
|
+
loaded.value = true;
|
|
61
|
+
emit('loaded');
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<style scoped lang="scss">
|
|
66
|
+
.webgl {
|
|
67
|
+
position: absolute;
|
|
68
|
+
inset: 0;
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: 100%;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.webgl:not(.mobile-view) {
|
|
74
|
+
clip-path: v-bind('layout');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.wrapper {
|
|
78
|
+
background-color: rgb(var(--v-theme-surface));
|
|
79
|
+
position: relative;
|
|
80
|
+
width: 100%;
|
|
81
|
+
height: 100%;
|
|
82
|
+
}
|
|
83
|
+
</style>
|
|
@@ -1,92 +1,293 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-navigation-drawer
|
|
3
|
-
class="motif-background"
|
|
4
|
-
theme="dark"
|
|
5
|
-
:model-value="true"
|
|
6
|
-
:rail="!drawer"
|
|
7
|
-
rail-width="72"
|
|
8
|
-
width="350"
|
|
9
|
-
permanent
|
|
10
|
-
touchless
|
|
11
|
-
>
|
|
2
|
+
<v-navigation-drawer :border="drawer ? 1 : 0" color="background" permanent rail rail-width="80">
|
|
12
3
|
<template #prepend>
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
<div class="d-flex justify-center">
|
|
5
|
+
<v-hover>
|
|
6
|
+
<template #default="{ isHovering, props: hover }">
|
|
7
|
+
<v-tooltip open-delay="1000" location="right">
|
|
8
|
+
<template #activator="{ props: tooltip }">
|
|
9
|
+
<v-btn
|
|
10
|
+
data-testid="nav-btn"
|
|
11
|
+
v-bind="mergeProps(hover, tooltip)"
|
|
12
|
+
:icon="true"
|
|
13
|
+
variant="text"
|
|
14
|
+
color="minsk_500"
|
|
15
|
+
size="large"
|
|
16
|
+
@click="close"
|
|
17
|
+
>
|
|
18
|
+
<v-img
|
|
19
|
+
v-if="!isHovering"
|
|
20
|
+
src="@/assets/logos/3dicom/colour/colour_single.svg"
|
|
21
|
+
width="40"
|
|
22
|
+
height="40"
|
|
23
|
+
/>
|
|
24
|
+
<v-icon v-else icon="west" />
|
|
25
|
+
</v-btn>
|
|
26
|
+
</template>
|
|
27
|
+
<span>{{ t('labels.backToPortal') }}</span>
|
|
28
|
+
</v-tooltip>
|
|
29
|
+
</template>
|
|
30
|
+
</v-hover>
|
|
31
|
+
</div>
|
|
21
32
|
</template>
|
|
33
|
+
<v-list
|
|
34
|
+
data-testid="nav-list"
|
|
35
|
+
:selected="[activeDrawer]"
|
|
36
|
+
class="d-flex flex-column h-100"
|
|
37
|
+
density="compact"
|
|
38
|
+
nav
|
|
39
|
+
@update:selected="activeDrawer = $event[0]"
|
|
40
|
+
>
|
|
41
|
+
<template v-for="item in items" :key="item.value">
|
|
42
|
+
<template v-if="item.visible">
|
|
43
|
+
<v-tooltip open-delay="1000" location="right">
|
|
44
|
+
<template #activator="{ props }">
|
|
45
|
+
<v-list-item
|
|
46
|
+
v-bind="props"
|
|
47
|
+
class="mx-auto py-0"
|
|
48
|
+
width="42px"
|
|
49
|
+
:data-testid="`listitem-${item.value}`"
|
|
50
|
+
min-height="30px"
|
|
51
|
+
color="primary"
|
|
52
|
+
:prepend-icon="item.icon"
|
|
53
|
+
:value="item.value"
|
|
54
|
+
@click="item.listItemProps.onClick"
|
|
55
|
+
/>
|
|
56
|
+
<div class="text-center text-xs-semibold mb-4" :data-testid="`title-${item.value}`">{{ item.title }}</div>
|
|
57
|
+
</template>
|
|
58
|
+
<span>{{ item.tooltip }}</span
|
|
59
|
+
><span class="pl-2">{{ item.tooltipShortcut }}</span>
|
|
60
|
+
</v-tooltip>
|
|
61
|
+
</template>
|
|
62
|
+
</template>
|
|
63
|
+
<v-spacer />
|
|
64
|
+
<HelpMenu />
|
|
65
|
+
</v-list>
|
|
22
66
|
</v-navigation-drawer>
|
|
23
|
-
<v-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
min-width
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
@click="drawer = !drawer"
|
|
67
|
+
<v-navigation-drawer
|
|
68
|
+
:border="0"
|
|
69
|
+
color="background"
|
|
70
|
+
:model-value="drawer"
|
|
71
|
+
:width="width"
|
|
72
|
+
:elevation="canDrag ? 4 : 0"
|
|
73
|
+
style="min-width: 264px; max-width: 512px"
|
|
74
|
+
permanent
|
|
75
|
+
class="resizable-drawer"
|
|
33
76
|
>
|
|
34
|
-
<v-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
77
|
+
<v-fade-transition hide-on-leave>
|
|
78
|
+
<template v-for="item in items" :key="item.value">
|
|
79
|
+
<template v-if="activeDrawer == item.value">
|
|
80
|
+
<Component v-bind="item.props" :is="item.component" />
|
|
81
|
+
</template>
|
|
82
|
+
</template>
|
|
83
|
+
</v-fade-transition>
|
|
84
|
+
</v-navigation-drawer>
|
|
85
|
+
<history-modal v-model="recentDropdown.modal" />
|
|
38
86
|
</template>
|
|
39
87
|
|
|
40
88
|
<script setup lang="ts">
|
|
41
|
-
import { computed, ref, watch } from 'vue';
|
|
89
|
+
import { ComponentInstance, computed, mergeProps, onMounted, ref, watch } from 'vue';
|
|
90
|
+
import DisplayPanel from '@/components/navigation/display/DisplayPanel.vue';
|
|
91
|
+
import AnnotationPanel from '@/components/navigation/annotation/AnnotationPanel.vue';
|
|
92
|
+
import MeasurementPanel from '@/components/navigation/measurement/MeasurementPanel.vue';
|
|
93
|
+
import McadPanel from '@/components/navigation/mcad/McadPanel.vue';
|
|
94
|
+
import { useDataOverlayStore } from '@/stores/data-overlay.store';
|
|
95
|
+
import { useMcadStore } from '@/stores/mcad.store';
|
|
96
|
+
import { useViewerStore } from '@/stores/viewer.store';
|
|
97
|
+
import { storeToRefs } from 'pinia';
|
|
98
|
+
import { defaultHotkeys, defineHotkeys, Hotkeys, HotkeyScope, resetScope } from '@/functions/HotkeyScope';
|
|
99
|
+
import interact from 'interactjs';
|
|
100
|
+
import { useDemoStore } from '@/stores/demo.store';
|
|
101
|
+
import { useI18n } from 'vue-i18n';
|
|
102
|
+
import { useDrawerStore } from '@/stores/drawer.store';
|
|
103
|
+
import { SHORTCUT_TEXT, translateTooltipShortcut } from '@/functions/translateTooltipShortcut';
|
|
104
|
+
|
|
105
|
+
onMounted(() => {
|
|
106
|
+
defaultHotkeys({
|
|
107
|
+
[Hotkeys.ALT_D]: async () => {
|
|
108
|
+
activeDrawer.value = 'display';
|
|
109
|
+
},
|
|
110
|
+
[Hotkeys.ALT_H]: async () => {
|
|
111
|
+
activeDrawer.value = 'home';
|
|
112
|
+
},
|
|
113
|
+
[Hotkeys.ALT_A]: async () => {
|
|
114
|
+
activeDrawer.value = 'annotation';
|
|
115
|
+
},
|
|
116
|
+
[Hotkeys.ALT_M]: async () => {
|
|
117
|
+
activeDrawer.value = 'measure';
|
|
118
|
+
},
|
|
119
|
+
[Hotkeys.ALT_E]: async () => {
|
|
120
|
+
activeDrawer.value = 'design';
|
|
121
|
+
},
|
|
122
|
+
[Hotkeys.ALT_F]: async () => {
|
|
123
|
+
activeDrawer.value = 'history';
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
42
127
|
|
|
43
|
-
interface
|
|
44
|
-
|
|
128
|
+
interface NavigationDrawerItem {
|
|
129
|
+
icon: string;
|
|
130
|
+
title: string;
|
|
131
|
+
tooltip: string;
|
|
132
|
+
tooltipShortcut: string;
|
|
133
|
+
value: string;
|
|
134
|
+
visible: boolean;
|
|
135
|
+
component: ComponentInstance<any>;
|
|
136
|
+
props: Record<string, any>;
|
|
137
|
+
listItemProps: Record<string, any>;
|
|
45
138
|
}
|
|
46
139
|
|
|
47
140
|
type Emits = {
|
|
48
|
-
|
|
49
|
-
'update:expanded': [number | undefined];
|
|
141
|
+
close: [void];
|
|
50
142
|
};
|
|
51
143
|
|
|
52
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
53
|
-
drawer: false
|
|
54
|
-
});
|
|
55
|
-
|
|
56
144
|
const emit = defineEmits<Emits>();
|
|
57
145
|
|
|
58
|
-
const
|
|
146
|
+
const { t } = useI18n();
|
|
147
|
+
const { annotations, measurements } = storeToRefs(useDataOverlayStore());
|
|
148
|
+
const { recentDropdown } = storeToRefs(useDemoStore());
|
|
149
|
+
const { activeDrawer } = storeToRefs(useDrawerStore());
|
|
150
|
+
const { mcads } = storeToRefs(useMcadStore());
|
|
151
|
+
const { options } = storeToRefs(useViewerStore());
|
|
152
|
+
|
|
153
|
+
const width = ref<number>(264);
|
|
154
|
+
|
|
155
|
+
const drawer = computed(() => {
|
|
156
|
+
return !!activeDrawer.value && !!items.value.find((x) => activeDrawer.value === x.value)?.component;
|
|
157
|
+
});
|
|
59
158
|
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
159
|
+
const items = computed<NavigationDrawerItem[]>(() => [
|
|
160
|
+
{
|
|
161
|
+
value: 'home',
|
|
162
|
+
icon: options.value.home?.icon ?? 'home',
|
|
163
|
+
tooltip: options.value.home?.title ?? t('labels.home'),
|
|
164
|
+
tooltipShortcut: translateTooltipShortcut(SHORTCUT_TEXT.altH),
|
|
165
|
+
title: options.value.home?.title ?? t('labels.home'),
|
|
166
|
+
visible: true,
|
|
167
|
+
component: undefined,
|
|
168
|
+
props: {},
|
|
169
|
+
listItemProps: {}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
value: 'display',
|
|
173
|
+
icon: options.value.display?.icon ?? 'visibility',
|
|
174
|
+
tooltip: options.value.display?.title ?? t('labels.display'),
|
|
175
|
+
tooltipShortcut: translateTooltipShortcut(SHORTCUT_TEXT.altD),
|
|
176
|
+
title: options.value.display?.title ?? t('labels.display'),
|
|
177
|
+
visible: options.value.display?.visible ?? true,
|
|
178
|
+
component: DisplayPanel,
|
|
179
|
+
props: {},
|
|
180
|
+
listItemProps: {}
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
value: 'annotation',
|
|
184
|
+
icon: options.value.annotations?.icon ?? 'stylus_note',
|
|
185
|
+
tooltip: options.value.annotations?.title ?? t('labels.annotation'),
|
|
186
|
+
tooltipShortcut: translateTooltipShortcut(SHORTCUT_TEXT.altA),
|
|
187
|
+
title: options.value.annotations?.title ?? t('labels.annotation'),
|
|
188
|
+
visible: options.value.annotations?.visible ?? true,
|
|
189
|
+
component: AnnotationPanel,
|
|
190
|
+
props: {
|
|
191
|
+
items: annotations.value
|
|
192
|
+
},
|
|
193
|
+
listItemProps: {}
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
value: 'measure',
|
|
197
|
+
icon: options.value.measure?.icon ?? 'design_services',
|
|
198
|
+
tooltip: options.value.measure?.title ?? t('labels.measure'),
|
|
199
|
+
tooltipShortcut: translateTooltipShortcut(SHORTCUT_TEXT.altM),
|
|
200
|
+
title: options.value.measure?.title ?? t('labels.measure'),
|
|
201
|
+
visible: options.value.measure?.visible ?? true,
|
|
202
|
+
component: MeasurementPanel,
|
|
203
|
+
props: {
|
|
204
|
+
items: measurements.value
|
|
205
|
+
},
|
|
206
|
+
listItemProps: {}
|
|
63
207
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
208
|
+
{
|
|
209
|
+
value: 'design',
|
|
210
|
+
icon: options.value.design?.icon ?? 'view_in_ar',
|
|
211
|
+
tooltip: options.value.design?.title ?? t('labels.design'),
|
|
212
|
+
tooltipShortcut: translateTooltipShortcut(SHORTCUT_TEXT.altE),
|
|
213
|
+
title: options.value.design?.title ?? t('labels.design'),
|
|
214
|
+
visible: options.value.design?.visible ?? true,
|
|
215
|
+
component: McadPanel,
|
|
216
|
+
listItemProps: {},
|
|
217
|
+
props: {
|
|
218
|
+
items: mcads.value
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
value: 'history',
|
|
223
|
+
icon: options.value.history?.icon ?? 'history',
|
|
224
|
+
tooltip: options.value.history?.title ?? t('labels.history'),
|
|
225
|
+
tooltipShortcut: translateTooltipShortcut(SHORTCUT_TEXT.altF),
|
|
226
|
+
title: options.value.history?.title ?? t('labels.history'),
|
|
227
|
+
visible: (options.value.history?.visible ?? true) && !!options.value.onRecentDropdown,
|
|
228
|
+
component: undefined,
|
|
229
|
+
props: {},
|
|
230
|
+
listItemProps: {
|
|
231
|
+
onClick: () => {
|
|
232
|
+
options.value.onRecentDropdown!(0, 0);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
]);
|
|
237
|
+
|
|
238
|
+
const canDrag = computed(() => activeDrawer.value === 'mcad');
|
|
239
|
+
|
|
240
|
+
watch(activeDrawer, () => {
|
|
241
|
+
width.value = 264;
|
|
242
|
+
interact('.resizable-drawer').resizable({
|
|
243
|
+
edges: { top: false, left: false, bottom: false, right: canDrag.value },
|
|
244
|
+
listeners: {
|
|
245
|
+
/* v8 ignore next 3 */
|
|
246
|
+
move: function (event) {
|
|
247
|
+
width.value = Math.min(Math.max(event.rect.width, 264), 512);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
// Some issue with coverage not recognising the watch for drawer.
|
|
254
|
+
/* v8 ignore start */
|
|
255
|
+
watch(drawer, (isOpen: boolean) => {
|
|
256
|
+
if (isOpen) {
|
|
257
|
+
defineHotkeys(HotkeyScope.PRIMARY, {
|
|
258
|
+
[Hotkeys.ALT_D]: async () => {
|
|
259
|
+
activeDrawer.value = 'display';
|
|
260
|
+
},
|
|
261
|
+
[Hotkeys.ALT_H]: async () => {
|
|
262
|
+
activeDrawer.value = 'home';
|
|
263
|
+
},
|
|
264
|
+
[Hotkeys.ALT_A]: async () => {
|
|
265
|
+
activeDrawer.value = 'annotations';
|
|
266
|
+
},
|
|
267
|
+
[Hotkeys.ALT_M]: async () => {
|
|
268
|
+
activeDrawer.value = 'measure';
|
|
269
|
+
},
|
|
270
|
+
[Hotkeys.ALT_E]: async () => {
|
|
271
|
+
activeDrawer.value = 'design';
|
|
272
|
+
},
|
|
273
|
+
[Hotkeys.ALT_F]: async () => {
|
|
274
|
+
activeDrawer.value = 'history';
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
} else {
|
|
278
|
+
resetScope(HotkeyScope.PRIMARY);
|
|
67
279
|
}
|
|
68
280
|
});
|
|
281
|
+
/* v8 ignore start */
|
|
69
282
|
|
|
70
|
-
|
|
71
|
-
()
|
|
72
|
-
|
|
73
|
-
drawer.value = value;
|
|
283
|
+
async function close(): Promise<void> {
|
|
284
|
+
if (options.value.onExit) {
|
|
285
|
+
await options.value.onExit();
|
|
74
286
|
}
|
|
75
|
-
);
|
|
287
|
+
emit('close');
|
|
288
|
+
}
|
|
76
289
|
|
|
77
|
-
defineExpose({
|
|
290
|
+
defineExpose({
|
|
291
|
+
drawer
|
|
292
|
+
});
|
|
78
293
|
</script>
|
|
79
|
-
|
|
80
|
-
<style scoped>
|
|
81
|
-
.toggle {
|
|
82
|
-
border-bottom-left-radius: 0 !important;
|
|
83
|
-
border-top-left-radius: 0 !important;
|
|
84
|
-
padding: 0;
|
|
85
|
-
position: absolute;
|
|
86
|
-
top: 50%;
|
|
87
|
-
opacity: 0.7;
|
|
88
|
-
z-index: 1;
|
|
89
|
-
transform: translateY(-50%);
|
|
90
|
-
transition: 0.25s left;
|
|
91
|
-
}
|
|
92
|
-
</style>
|