@realsee/dnalogel 2.0.0-alpha.1 → 2.0.0-alpha.12
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/CHANGELOG.md +41 -0
- package/README.md +45 -5
- package/TERMS.txt +56 -0
- package/dist/CSS3DRenderPlugin/index.d.ts +49 -0
- package/dist/CSS3DRenderPlugin/index.js +231 -0
- package/dist/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +7 -0
- package/dist/CameraMovementPlugin/index.d.ts +7 -0
- package/dist/CameraMovementPlugin/index.js +302 -0
- package/dist/CameraMovementPlugin/typing.d.ts +68 -0
- package/dist/ModelChassisCompassPlugin/index.d.ts +19 -0
- package/dist/ModelChassisCompassPlugin/index.js +142 -0
- package/dist/ModelEntryDoorGuidePlugin/index.d.ts +26 -0
- package/dist/ModelEntryDoorGuidePlugin/index.js +196 -0
- package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.d.ts +4 -0
- package/dist/ModelItemLabelPlugin/index.js +678 -0
- package/dist/ModelItemLabelPlugin/typings.d.ts +55 -0
- package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelRoomLabelPlugin/Assets/roomLabelBg.d.ts +1 -0
- package/dist/ModelRoomLabelPlugin/Controller.d.ts +36 -0
- package/dist/ModelRoomLabelPlugin/index.d.ts +12 -0
- package/dist/ModelRoomLabelPlugin/index.js +463 -0
- package/dist/ModelRoomLabelPlugin/typings.d.ts +35 -0
- package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelViewPlugin/index.d.ts +17 -0
- package/dist/ModelViewPlugin/index.js +187 -0
- package/dist/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
- package/dist/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
- package/dist/PanoCompassPlugin/index.d.ts +51 -0
- package/dist/PanoCompassPlugin/index.js +521 -0
- package/dist/PanoCursorRaycasterPlugin/index.d.ts +48 -0
- package/dist/PanoCursorRaycasterPlugin/index.js +88 -0
- package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +36 -0
- package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
- package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
- package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +25 -0
- package/dist/PanoMeasurePlugin/Controller/index.d.ts +61 -0
- package/dist/PanoMeasurePlugin/Model/index.d.ts +38 -0
- package/dist/PanoMeasurePlugin/Model/line.d.ts +30 -0
- package/dist/PanoMeasurePlugin/Model/point.d.ts +16 -0
- package/dist/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +22 -0
- package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
- package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
- package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +24 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +12 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +16 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +17 -0
- package/dist/PanoMeasurePlugin/index.d.ts +7 -0
- package/dist/PanoMeasurePlugin/index.js +4789 -0
- package/dist/PanoMeasurePlugin/typings/data.d.ts +28 -0
- package/dist/PanoMeasurePlugin/typings/event.type.d.ts +28 -0
- package/dist/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
- package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/constants.d.ts +4 -0
- package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
- package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
- package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
- package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
- package/dist/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
- package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/line.d.ts +17 -0
- package/dist/PanoMeasurePlugin/utils/math.d.ts +17 -0
- package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
- package/dist/PanoRulerPlugin/index.d.ts +31 -0
- package/dist/PanoRulerPlugin/index.js +610 -0
- package/dist/PanoRulerPlugin/style.d.ts +2 -0
- package/dist/PanoRulerPlugin/typings.d.ts +21 -0
- package/dist/PanoSpatialTagPlugin/index.d.ts +33 -0
- package/dist/PanoSpatialTagPlugin/index.js +1259 -0
- package/dist/PanoSpatialTagPlugin/store.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/style.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/typings.d.ts +40 -0
- package/dist/floorplan/Assets/camera.d.ts +1 -0
- package/dist/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/Assets/compass.d.ts +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +105 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +9 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.js +3842 -0
- package/dist/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +23 -0
- package/dist/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +15 -0
- package/dist/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +14 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +28 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +8 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +1673 -0
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +62 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +3481 -0
- package/dist/floorplan/TopviewFloorplanPlugin/style.d.ts +1 -0
- package/dist/floorplan/constant.d.ts +5 -0
- package/dist/floorplan/typings/floorplanData.d.ts +137 -0
- package/dist/floorplan/typings/floorplanServerData.d.ts +131 -0
- package/dist/floorplan/typings/utility.d.ts +2 -0
- package/dist/floorplan/utils/formatData.d.ts +5 -0
- package/dist/floorplan/utils/formatPosition.d.ts +36 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.es.js +13572 -0
- package/dist/index.js +13613 -0
- package/dist/index.umd.js +13606 -0
- package/dist/shared-utils/Preloader.d.ts +6 -0
- package/dist/shared-utils/Subscribe.d.ts +45 -0
- package/dist/shared-utils/animationFrame/BetterTween.d.ts +11 -0
- package/dist/shared-utils/animationFrame/calculateProgress.d.ts +8 -0
- package/dist/shared-utils/animationFrame/formatRad.d.ts +15 -0
- package/dist/shared-utils/animationFrame/index.d.ts +15 -0
- package/dist/shared-utils/animationFrame/tween.d.ts +75 -0
- package/dist/shared-utils/changeModelCanvasOpacity.d.ts +2 -0
- package/dist/shared-utils/createCanvasTextTexture.d.ts +8 -0
- package/dist/shared-utils/createLine/index.d.ts +3 -0
- package/dist/shared-utils/debounce.d.ts +6 -0
- package/dist/shared-utils/equal.d.ts +11 -0
- package/dist/shared-utils/filter.d.ts +27 -0
- package/dist/shared-utils/five/changeMode.d.ts +2 -0
- package/dist/shared-utils/five/useFivePlugin.d.ts +1 -0
- package/dist/shared-utils/formatRad.d.ts +7 -0
- package/dist/shared-utils/getPxmm.d.ts +11 -0
- package/dist/shared-utils/getRandomColor.d.ts +1 -0
- package/dist/shared-utils/isNil.d.ts +10 -0
- package/dist/shared-utils/isTruelyObject.d.ts +18 -0
- package/dist/shared-utils/math/evenNumber.d.ts +3 -0
- package/dist/shared-utils/math/planimetry.d.ts +116 -0
- package/dist/shared-utils/math/rad2Deg.d.ts +1 -0
- package/dist/shared-utils/nearlyEqual.d.ts +7 -0
- package/dist/shared-utils/nextFrame.d.ts +1 -0
- package/dist/shared-utils/noop.d.ts +5 -0
- package/dist/shared-utils/object3d2LocalMatrix.d.ts +12 -0
- package/dist/shared-utils/px2rem.d.ts +1 -0
- package/dist/shared-utils/removeArrayItem.d.ts +7 -0
- package/dist/shared-utils/tap.d.ts +8 -0
- package/dist/shared-utils/three/centerPoint.d.ts +2 -0
- package/dist/shared-utils/three/getExtraModelLoader.d.ts +6 -0
- package/dist/shared-utils/three/getNormal.d.ts +2 -0
- package/dist/shared-utils/three/getTextureLoader.d.ts +6 -0
- package/dist/shared-utils/three/loadFbxObj.d.ts +2 -0
- package/dist/shared-utils/three/loadTexture.d.ts +2 -0
- package/dist/shared-utils/three/transformPositionToVector3.d.ts +7 -0
- package/dist/shared-utils/three/transfromToMeshBasicMaterial.d.ts +2 -0
- package/dist/shared-utils/throttle.d.ts +7 -0
- package/dist/shared-utils/tinyEJSrender.d.ts +5 -0
- package/dist/shared-utils/to.d.ts +8 -0
- package/dist/shared-utils/useDebounce.d.ts +8 -0
- package/dist/shared-utils/useThrottle.d.ts +8 -0
- package/dist/shared-utils/uuid.d.ts +4 -0
- package/dist/shared-utils/vectorTocoordinates.d.ts +7 -0
- package/dist/typings/math.type.d.ts +44 -0
- package/dist/typings/utils.type.d.ts +2 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +78 -0
- package/docs/assets/icons.css +1043 -0
- package/docs/assets/icons.png +0 -0
- package/docs/assets/icons@2x.png +0 -0
- package/docs/assets/main.js +52 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1413 -0
- package/docs/assets/widgets.png +0 -0
- package/docs/assets/widgets@2x.png +0 -0
- package/docs/classes/ModelRoomLabelController.html +20 -0
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -0
- package/docs/enums/ModelFloorplanErrorType.html +1 -0
- package/docs/index.html +43 -0
- package/docs/interfaces/LineJson.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -0
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -0
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -0
- package/docs/interfaces/ModelFloorplanParameterType.html +1 -0
- package/docs/interfaces/ModelFloorplanViewEvent.html +5 -0
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -0
- package/docs/interfaces/PanoCompassPluginData.html +1 -0
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -0
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +11 -0
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -0
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -0
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -0
- package/docs/interfaces/PointJson.html +1 -0
- package/docs/interfaces/RoomLabel.html +13 -0
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +1 -0
- package/docs/modules.html +28 -0
- package/libs/CSS3DRenderPlugin/index.js +11 -13
- package/libs/ModelEntryDoorGuidePlugin/index.js +1 -0
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +420 -0
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
- package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/events.type.js +1 -0
- package/libs/ModelItemLabelPlugin/index.d.ts +4 -0
- package/libs/ModelItemLabelPlugin/index.js +170 -0
- package/libs/ModelItemLabelPlugin/typings.d.ts +55 -0
- package/libs/ModelItemLabelPlugin/typings.js +6 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.js +7 -0
- package/libs/ModelRoomLabelPlugin/Controller.js +2 -2
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +121 -0
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +255 -0
- package/libs/ModelViewPlugin/index.js +6 -6
- package/libs/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
- package/libs/PanoCompassPlugin/Assets/roomInfoIcon.js +1 -0
- package/libs/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
- package/libs/PanoCompassPlugin/getRoomInfoInstance.js +48 -0
- package/libs/PanoCompassPlugin/index.d.ts +51 -0
- package/libs/PanoCompassPlugin/index.js +171 -0
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +36 -0
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +69 -0
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
- package/libs/PanoMeasurePlugin/Controller/EditController.js +216 -0
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +44 -0
- package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +25 -0
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +223 -0
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +61 -0
- package/libs/PanoMeasurePlugin/Controller/index.js +176 -0
- package/libs/PanoMeasurePlugin/Model/index.d.ts +38 -0
- package/libs/PanoMeasurePlugin/Model/index.js +114 -0
- package/libs/PanoMeasurePlugin/Model/line.d.ts +30 -0
- package/libs/PanoMeasurePlugin/Model/line.js +64 -0
- package/libs/PanoMeasurePlugin/Model/point.d.ts +16 -0
- package/libs/PanoMeasurePlugin/Model/point.js +28 -0
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
- package/libs/PanoMeasurePlugin/Model/polyline.js +48 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +15 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +22 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +108 -0
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +33 -0
- package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +75 -0
- package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +24 -0
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +103 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +117 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +102 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +12 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +35 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +16 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +69 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +17 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +78 -0
- package/libs/PanoMeasurePlugin/index.d.ts +7 -0
- package/libs/PanoMeasurePlugin/index.js +5 -0
- package/libs/PanoMeasurePlugin/typings/data.d.ts +28 -0
- package/libs/PanoMeasurePlugin/typings/data.js +1 -0
- package/libs/PanoMeasurePlugin/typings/event.type.d.ts +28 -0
- package/libs/PanoMeasurePlugin/typings/event.type.js +1 -0
- package/libs/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
- package/libs/PanoMeasurePlugin/typings/utils.type.js +1 -0
- package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
- package/libs/PanoMeasurePlugin/utils/clearGroup.js +3 -0
- package/libs/PanoMeasurePlugin/utils/constants.d.ts +4 -0
- package/libs/PanoMeasurePlugin/utils/constants.js +31 -0
- package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +114 -0
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.js +21 -0
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.js +27 -0
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.js +9 -0
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.js +14 -0
- package/libs/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
- package/libs/PanoMeasurePlugin/utils/ironbox.js +1 -0
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.js +6 -0
- package/libs/PanoMeasurePlugin/utils/line.d.ts +17 -0
- package/libs/PanoMeasurePlugin/utils/line.js +32 -0
- package/libs/PanoMeasurePlugin/utils/math.d.ts +17 -0
- package/libs/PanoMeasurePlugin/utils/math.js +44 -0
- package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +21 -0
- package/libs/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
- package/libs/PanoMeasurePlugin/utils/ndc2Screen.js +6 -0
- package/libs/PanoRulerPlugin/index.d.ts +31 -0
- package/libs/PanoRulerPlugin/index.js +398 -0
- package/libs/PanoRulerPlugin/style.d.ts +2 -0
- package/libs/PanoRulerPlugin/style.js +88 -0
- package/libs/PanoRulerPlugin/typings.d.ts +21 -0
- package/libs/PanoRulerPlugin/typings.js +1 -0
- package/libs/PanoSpatialTagPlugin/Components/origins.js +168 -0
- package/libs/PanoSpatialTagPlugin/Components/tag.js +302 -0
- package/libs/PanoSpatialTagPlugin/index.d.ts +33 -0
- package/libs/PanoSpatialTagPlugin/index.js +411 -0
- package/libs/PanoSpatialTagPlugin/store.d.ts +1 -0
- package/libs/PanoSpatialTagPlugin/store.js +2 -0
- package/libs/PanoSpatialTagPlugin/style.d.ts +1 -0
- package/libs/PanoSpatialTagPlugin/style.js +8 -0
- package/libs/PanoSpatialTagPlugin/typings.d.ts +40 -0
- package/libs/PanoSpatialTagPlugin/typings.js +1 -0
- package/libs/floorplan/Components/BaseImage.js +217 -0
- package/libs/floorplan/Components/Normalmage.js +63 -0
- package/libs/floorplan/Components/RoomHighlight/Room.js +70 -0
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +289 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +328 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +64 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +103 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +140 -0
- package/libs/floorplan/Components/SvgImage.js +83 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +120 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +114 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +463 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +383 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +171 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +265 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +301 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.js +219 -0
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +3 -0
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +6 -4
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +152 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +248 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +154 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +312 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +3 -0
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +7 -5
- package/libs/floorplan/constant.d.ts +5 -0
- package/libs/floorplan/constant.js +6 -0
- package/libs/floorplan/typings/floorplanServerData.d.ts +4 -0
- package/libs/index.d.ts +19 -9
- package/libs/index.js +11 -3
- package/libs/shared-utils/getPxmm.d.ts +6 -1
- package/libs/shared-utils/getPxmm.js +26 -12
- package/libs/shared-utils/tinyEJSrender.d.ts +5 -0
- package/libs/shared-utils/tinyEJSrender.js +180 -0
- package/package.json +23 -13
- package/dist/dnalogel.es.js +0 -37145
- package/dist/dnalogel.umd.js +0 -2
- package/dist/style.css +0 -1
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte +0 -63
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte.map +0 -1
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte +0 -80
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte.map +0 -1
- package/libs/floorplan/Components/BaseImage.svelte +0 -25
- package/libs/floorplan/Components/BaseImage.svelte.map +0 -1
- package/libs/floorplan/Components/Normalmage.svelte +0 -11
- package/libs/floorplan/Components/Normalmage.svelte.map +0 -1
- package/libs/floorplan/Components/RoomHighlight/Room.svelte +0 -21
- package/libs/floorplan/Components/RoomHighlight/Room.svelte.map +0 -1
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte +0 -60
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte +0 -35
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte +0 -7
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte +0 -16
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte +0 -17
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte.map +0 -1
- package/libs/floorplan/Components/SvgImage.svelte +0 -25
- package/libs/floorplan/Components/SvgImage.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte +0 -46
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte +0 -48
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -37
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte +0 -50
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte +0 -41
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte +0 -25
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte +0 -148
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte +0 -15
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte +0 -84
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -18
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte +0 -40
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte +0 -61
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte.map +0 -1
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { Five, Subscribe } from '@realsee/five';
|
|
3
|
+
import CSS3DRenderPlugin from '../CSS3DRenderPlugin';
|
|
4
|
+
import Origins from './Components/origins';
|
|
5
|
+
import Tag from './Components/tag';
|
|
6
|
+
import { pluginStyle } from './style';
|
|
7
|
+
import render from '../shared-utils/tinyEJSrender';
|
|
8
|
+
const MESH_SIZE = 0.001;
|
|
9
|
+
const RAY_ORIGIN_Y = 1.4;
|
|
10
|
+
const RAY_TOLERANT_DISTANCE = 0.01;
|
|
11
|
+
const BLUR_IMAGE_URL = 'https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png';
|
|
12
|
+
const MIN_DISTANCE = 1.2;
|
|
13
|
+
const MAX_DISTANCE = 3.5;
|
|
14
|
+
/**
|
|
15
|
+
* 空间游走标签插件
|
|
16
|
+
*/
|
|
17
|
+
export const PanoSpatialTagPlugin = (five, params) => {
|
|
18
|
+
let wrapper = params?.container;
|
|
19
|
+
const wait = params?.wait ?? 200;
|
|
20
|
+
const maxNumberOnScreen = params?.maxNumberOnScreen ?? 3;
|
|
21
|
+
const minRad = params?.minRad ?? Math.PI / 4;
|
|
22
|
+
const nearTolerance = params?.nearTolerance ?? 100;
|
|
23
|
+
const upsideHeight = params?.upsideHeight ?? 1.6;
|
|
24
|
+
// const foldPercent = params?.foldPercent ?? 20
|
|
25
|
+
const css3DRender = CSS3DRenderPlugin(five);
|
|
26
|
+
const container = document.createElement('div');
|
|
27
|
+
container.classList.add('PanoSpatialTagPlugin');
|
|
28
|
+
Object.assign(container.style, pluginStyle);
|
|
29
|
+
const hooks = new Subscribe();
|
|
30
|
+
let blurImage = new Image();
|
|
31
|
+
blurImage.src = BLUR_IMAGE_URL;
|
|
32
|
+
const state = {
|
|
33
|
+
points: [],
|
|
34
|
+
origins: [],
|
|
35
|
+
tags: [],
|
|
36
|
+
template: '',
|
|
37
|
+
events: {},
|
|
38
|
+
render,
|
|
39
|
+
folded: false,
|
|
40
|
+
enabled: true,
|
|
41
|
+
forbidden: true,
|
|
42
|
+
};
|
|
43
|
+
const origins = new Origins({
|
|
44
|
+
target: container,
|
|
45
|
+
props: { origins: state.origins },
|
|
46
|
+
});
|
|
47
|
+
const onCameraUpdate = (pose, userAction) => {
|
|
48
|
+
updateOrigins();
|
|
49
|
+
if (userAction) {
|
|
50
|
+
updateTags();
|
|
51
|
+
// state.tags.forEach(tag => {
|
|
52
|
+
// const mouse = tag.position.clone().project(five.camera)
|
|
53
|
+
// const top = ( - mouse.y + 1 ) / 2 * 100
|
|
54
|
+
// })
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const onPanoArrived = () => {
|
|
58
|
+
if (state.forbidden) {
|
|
59
|
+
state.forbidden = false;
|
|
60
|
+
updateTags();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const onPanoWillArrive = (pano, pose) => {
|
|
64
|
+
if (state.tags.length === 0)
|
|
65
|
+
return;
|
|
66
|
+
const rotateRad = pose.longitude - five.state.longitude;
|
|
67
|
+
const camera = five.camera.clone();
|
|
68
|
+
camera.position.copy(pose.offset);
|
|
69
|
+
camera.rotateOnWorldAxis(new THREE.Vector3(0, 1, 0), rotateRad);
|
|
70
|
+
camera.updateProjectionMatrix();
|
|
71
|
+
camera.updateMatrixWorld(true);
|
|
72
|
+
const frustum = new THREE.Frustum();
|
|
73
|
+
const projScreenMatrix = new THREE.Matrix4();
|
|
74
|
+
projScreenMatrix.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);
|
|
75
|
+
frustum.setFromProjectionMatrix(projScreenMatrix);
|
|
76
|
+
state.tags.forEach(tag => {
|
|
77
|
+
const distance = camera.position.clone().setY(RAY_ORIGIN_Y).distanceTo(tag.position);
|
|
78
|
+
if (distance < MIN_DISTANCE || distance > MAX_DISTANCE)
|
|
79
|
+
return tag.destroying = true;
|
|
80
|
+
if (!frustum.containsPoint(tag.position))
|
|
81
|
+
return tag.destroying = true;
|
|
82
|
+
const v = tag.position.clone().sub(camera.position).setY(0);
|
|
83
|
+
if (v.angleTo(tag.normal) > Math.PI / 2 - minRad &&
|
|
84
|
+
v.angleTo(tag.normal) < Math.PI / 2 + minRad)
|
|
85
|
+
return tag.destroying = true;
|
|
86
|
+
});
|
|
87
|
+
state.tags.forEach(tag => {
|
|
88
|
+
if (tag.destroying) {
|
|
89
|
+
tag.app.$set({
|
|
90
|
+
contentZoom: 0.1 + camera.position.distanceTo(tag.position) / MAX_DISTANCE,
|
|
91
|
+
lineWidthZoom: 0.38 * (0.01 + camera.position.distanceTo(tag.position) / MAX_DISTANCE),
|
|
92
|
+
destroying: tag.destroying,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
tag.app.$set({
|
|
97
|
+
lineWidthZoom: 0.38 * (0.01 + camera.position.distanceTo(tag.position) / MAX_DISTANCE),
|
|
98
|
+
lineHeightZoom: 0.4 + (camera.position.distanceTo(tag.position) - MIN_DISTANCE) / MAX_DISTANCE * 0.6,
|
|
99
|
+
contentZoom: 0.1 + camera.position.distanceTo(tag.position) / MAX_DISTANCE,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
setTimeout(() => {
|
|
104
|
+
state.tags.forEach(tag => {
|
|
105
|
+
if (tag.destroying) {
|
|
106
|
+
tag.app.$destroy();
|
|
107
|
+
tag = null;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
state.tags = state.tags.filter(tag => !tag.destroying);
|
|
111
|
+
updateOrigins();
|
|
112
|
+
}, 1900);
|
|
113
|
+
};
|
|
114
|
+
const onModeChange = (mode) => {
|
|
115
|
+
if (mode !== Five.Mode.Panorama && !state.forbidden) {
|
|
116
|
+
origins.$set({ origins: [] });
|
|
117
|
+
state.tags.forEach(tag => {
|
|
118
|
+
tag.app.$destroy();
|
|
119
|
+
tag = null;
|
|
120
|
+
});
|
|
121
|
+
state.origins = [];
|
|
122
|
+
state.tags = [];
|
|
123
|
+
state.forbidden = true;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const updateOrigins = () => {
|
|
127
|
+
if (state.forbidden || !state.enabled)
|
|
128
|
+
return;
|
|
129
|
+
const camera = five.camera;
|
|
130
|
+
const direction = camera.getWorldDirection(new THREE.Vector3());
|
|
131
|
+
state.origins = state.tags.map(tag => {
|
|
132
|
+
const mouse = tag.position.clone().project(camera);
|
|
133
|
+
const front = tag.position.clone().sub(camera.position).setY(0)
|
|
134
|
+
.angleTo(direction.setY(0)) < Math.PI / 2;
|
|
135
|
+
return {
|
|
136
|
+
id: tag.id,
|
|
137
|
+
front,
|
|
138
|
+
left: (mouse.x + 1) / 2 * 100,
|
|
139
|
+
top: (-mouse.y + 1) / 2 * 100,
|
|
140
|
+
destroying: tag.destroying,
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
origins.$set({ origins: state.origins });
|
|
144
|
+
};
|
|
145
|
+
const updateTags = () => {
|
|
146
|
+
if (state.forbidden || !state.enabled)
|
|
147
|
+
return;
|
|
148
|
+
if (state.timeoutId)
|
|
149
|
+
clearTimeout(state.timeoutId);
|
|
150
|
+
state.timeoutId = setTimeout(() => {
|
|
151
|
+
state.timeoutId = undefined;
|
|
152
|
+
const newTags = getNewTags();
|
|
153
|
+
if (newTags.length) {
|
|
154
|
+
state.tags = state.tags.concat(newTags);
|
|
155
|
+
updateOrigins();
|
|
156
|
+
}
|
|
157
|
+
}, wait);
|
|
158
|
+
};
|
|
159
|
+
const getNewTags = () => {
|
|
160
|
+
const { clientWidth, clientHeight } = five.getElement();
|
|
161
|
+
const newTags = [];
|
|
162
|
+
const camera = five.camera;
|
|
163
|
+
const frustum = new THREE.Frustum();
|
|
164
|
+
const projScreenMatrix = new THREE.Matrix4();
|
|
165
|
+
const direction = camera.getWorldDirection(new THREE.Vector3());
|
|
166
|
+
projScreenMatrix.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);
|
|
167
|
+
frustum.setFromProjectionMatrix(projScreenMatrix);
|
|
168
|
+
const frontTagLength = state.tags.filter(tag => frustum.containsPoint(tag.position) && !tag.destroying).length;
|
|
169
|
+
const points = state.points.reduce((result, point) => {
|
|
170
|
+
if (state.tags.find(tag => point.id === tag.id && !tag.destroying))
|
|
171
|
+
return result;
|
|
172
|
+
const distance = camera.position.clone().setY(RAY_ORIGIN_Y).distanceTo(point.position);
|
|
173
|
+
if (distance < MIN_DISTANCE || distance > MAX_DISTANCE)
|
|
174
|
+
return result;
|
|
175
|
+
if (!frustum.containsPoint(point.position))
|
|
176
|
+
return result;
|
|
177
|
+
const v = point.position.clone().sub(camera.position).setY(0);
|
|
178
|
+
if (v.angleTo(point.normal) > Math.PI / 2 - minRad &&
|
|
179
|
+
v.angleTo(point.normal) < Math.PI / 2 + minRad)
|
|
180
|
+
return result;
|
|
181
|
+
const mouse = point.position.clone().project(camera);
|
|
182
|
+
if (!state.tags.every(tag => {
|
|
183
|
+
if (tag.position.clone().sub(camera.position).setY(0)
|
|
184
|
+
.angleTo(direction.setY(0)) > Math.PI / 2)
|
|
185
|
+
return true;
|
|
186
|
+
const _mouse = tag.position.clone().project(camera);
|
|
187
|
+
return Math.sqrt(Math.pow((mouse.x - _mouse.x) / 2 * clientWidth, 2) +
|
|
188
|
+
Math.pow((mouse.y - _mouse.y) / 2 * clientHeight, 2)) > nearTolerance;
|
|
189
|
+
}))
|
|
190
|
+
return result;
|
|
191
|
+
const newPoint = {
|
|
192
|
+
id: point.id,
|
|
193
|
+
position: point.position,
|
|
194
|
+
normal: point.normal,
|
|
195
|
+
replacement: point.replacement,
|
|
196
|
+
weight: point.weight,
|
|
197
|
+
distance,
|
|
198
|
+
};
|
|
199
|
+
let index;
|
|
200
|
+
for (let i = 0, l = result.length; i < l; i++) {
|
|
201
|
+
const anotherPoint = result[i];
|
|
202
|
+
if (newPoint.weight > anotherPoint.weight) {
|
|
203
|
+
index = i;
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
if (newPoint.distance < anotherPoint.distance) {
|
|
207
|
+
index = i;
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (index !== undefined)
|
|
212
|
+
result.splice(index, 0, newPoint);
|
|
213
|
+
else
|
|
214
|
+
result.push(newPoint);
|
|
215
|
+
return result;
|
|
216
|
+
}, []);
|
|
217
|
+
for (let i = 0, l = points.length; i < l; i++) {
|
|
218
|
+
if (frontTagLength + newTags.length >= maxNumberOnScreen)
|
|
219
|
+
break;
|
|
220
|
+
const point = points[i];
|
|
221
|
+
if (newTags.find(tag => point.id === tag.id))
|
|
222
|
+
continue;
|
|
223
|
+
const mouse = point.position.clone().project(camera);
|
|
224
|
+
if (!state.tags.concat(newTags).every(tag => {
|
|
225
|
+
if (tag.position.clone().sub(camera.position).setY(0)
|
|
226
|
+
.angleTo(direction.setY(0)) > Math.PI / 2)
|
|
227
|
+
return true;
|
|
228
|
+
const _mouse = tag.position.clone().project(camera);
|
|
229
|
+
return Math.sqrt(Math.pow((mouse.x - _mouse.x) / 2 * clientWidth, 2) +
|
|
230
|
+
Math.pow((mouse.y - _mouse.y) / 2 * clientHeight, 2)) > nearTolerance;
|
|
231
|
+
}))
|
|
232
|
+
continue;
|
|
233
|
+
const raycaster = new THREE.Raycaster(camera.position.clone().setY(RAY_ORIGIN_Y), point.position.clone().sub(camera.position.clone().setY(RAY_ORIGIN_Y)).normalize(), 0, point.distance + RAY_TOLERANT_DISTANCE);
|
|
234
|
+
const [intersect] = five.model.intersectRaycaster(raycaster);
|
|
235
|
+
if (!intersect)
|
|
236
|
+
continue;
|
|
237
|
+
if (point.distance - intersect.distance < RAY_TOLERANT_DISTANCE) {
|
|
238
|
+
const { position, normal, id, replacement } = point;
|
|
239
|
+
const plane = new THREE.Plane().setFromNormalAndCoplanarPoint(normal, position);
|
|
240
|
+
const right = position.clone().sub(camera.position)
|
|
241
|
+
.cross(new THREE.Vector3(0, 1, 0)).setLength(MESH_SIZE);
|
|
242
|
+
const square = [
|
|
243
|
+
position.clone(),
|
|
244
|
+
position.clone().add(right),
|
|
245
|
+
position.clone().add(new THREE.Vector3(0, MESH_SIZE, 0)).add(right),
|
|
246
|
+
position.clone().add(new THREE.Vector3(0, MESH_SIZE, 0)),
|
|
247
|
+
].map(v => plane.projectPoint(v, new THREE.Vector3()));
|
|
248
|
+
const { container, dispose } = css3DRender.create3DDomContainer(square) || {};
|
|
249
|
+
const app = new Tag({
|
|
250
|
+
target: container,
|
|
251
|
+
props: {
|
|
252
|
+
id,
|
|
253
|
+
content: state.render(state.template, replacement),
|
|
254
|
+
lineWidthZoom: 0.38 * (0.01 + camera.position.distanceTo(position) / MAX_DISTANCE),
|
|
255
|
+
lineHeightZoom: 0.4 + (camera.position.distanceTo(position) - MIN_DISTANCE) / MAX_DISTANCE * 0.6,
|
|
256
|
+
contentZoom: 0.1 + camera.position.distanceTo(position) / MAX_DISTANCE,
|
|
257
|
+
upsideDown: position.y > upsideHeight,
|
|
258
|
+
folded: state.folded,
|
|
259
|
+
events: state.events,
|
|
260
|
+
hooks,
|
|
261
|
+
dispose,
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
newTags.push({
|
|
265
|
+
position,
|
|
266
|
+
normal,
|
|
267
|
+
id,
|
|
268
|
+
app,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return newTags;
|
|
273
|
+
};
|
|
274
|
+
/** 标签数据加载
|
|
275
|
+
* @param data.points {Array} 标签数据
|
|
276
|
+
* @param data.enabled {Boolean} 插件是否启用
|
|
277
|
+
* @param data.folded {Boolean} 标签是否默认展开
|
|
278
|
+
*/
|
|
279
|
+
const load = (data) => {
|
|
280
|
+
state.points = data.points.map(point => {
|
|
281
|
+
return {
|
|
282
|
+
id: point.id,
|
|
283
|
+
position: new THREE.Vector3().fromArray(point.position),
|
|
284
|
+
normal: new THREE.Vector3().fromArray(point.normal),
|
|
285
|
+
replacement: point.replacement ?? {},
|
|
286
|
+
weight: point.weight ?? -1,
|
|
287
|
+
};
|
|
288
|
+
});
|
|
289
|
+
if (data.render)
|
|
290
|
+
state.render = data.render;
|
|
291
|
+
if (data.template)
|
|
292
|
+
state.template = data.template;
|
|
293
|
+
if (data.events)
|
|
294
|
+
state.events = data.events;
|
|
295
|
+
if (data.enabled === false)
|
|
296
|
+
state.enabled = data.enabled;
|
|
297
|
+
if (data.folded === true)
|
|
298
|
+
state.folded = data.folded;
|
|
299
|
+
};
|
|
300
|
+
/** 标签启用
|
|
301
|
+
* 启用插件并重新计算展示标签
|
|
302
|
+
*/
|
|
303
|
+
const enable = () => {
|
|
304
|
+
state.enabled = true;
|
|
305
|
+
updateTags();
|
|
306
|
+
};
|
|
307
|
+
/** 插件禁用
|
|
308
|
+
* 1. 禁用同时会清除已展示的标签
|
|
309
|
+
* 2. 再次启用时会重新计算展示标签
|
|
310
|
+
*/
|
|
311
|
+
const disable = () => {
|
|
312
|
+
state.enabled = false;
|
|
313
|
+
origins.$set({ origins: [] });
|
|
314
|
+
state.tags.forEach(tag => {
|
|
315
|
+
tag.app.$destroy();
|
|
316
|
+
tag = null;
|
|
317
|
+
});
|
|
318
|
+
state.origins = [];
|
|
319
|
+
state.tags = [];
|
|
320
|
+
};
|
|
321
|
+
/** 展开所有标签
|
|
322
|
+
* 1. 展开所有收起的标签
|
|
323
|
+
* 2. 新标签会默认展开
|
|
324
|
+
*/
|
|
325
|
+
const unfoldAll = () => {
|
|
326
|
+
state.folded = false;
|
|
327
|
+
state.tags.forEach(tag => {
|
|
328
|
+
tag.app.$set({ folded: state.folded });
|
|
329
|
+
});
|
|
330
|
+
};
|
|
331
|
+
/** 收起所有标签
|
|
332
|
+
* 1. 收起所有展开的标签
|
|
333
|
+
* 2. 新标签会默认收起
|
|
334
|
+
*/
|
|
335
|
+
const foldAll = () => {
|
|
336
|
+
state.folded = true;
|
|
337
|
+
state.tags.forEach(tag => {
|
|
338
|
+
tag.app.$set({ folded: state.folded });
|
|
339
|
+
});
|
|
340
|
+
};
|
|
341
|
+
/** 展开单个标签
|
|
342
|
+
* @param id {Number | String} 标签ID
|
|
343
|
+
*/
|
|
344
|
+
const unfold = (id) => {
|
|
345
|
+
state.tags.forEach(tag => {
|
|
346
|
+
if (tag.id === id)
|
|
347
|
+
tag.app.$set({ folded: false });
|
|
348
|
+
});
|
|
349
|
+
};
|
|
350
|
+
/** 收起单个标签
|
|
351
|
+
* @param id {Number | String} 标签ID
|
|
352
|
+
*/
|
|
353
|
+
const fold = (id) => {
|
|
354
|
+
state.tags.forEach(tag => {
|
|
355
|
+
if (tag.id === id)
|
|
356
|
+
tag.app.$set({ folded: true });
|
|
357
|
+
});
|
|
358
|
+
};
|
|
359
|
+
const dispose = () => {
|
|
360
|
+
blurImage = null;
|
|
361
|
+
css3DRender.disposeAll();
|
|
362
|
+
origins.$destroy();
|
|
363
|
+
state.tags.forEach(tag => {
|
|
364
|
+
tag.app.$destroy();
|
|
365
|
+
tag = null;
|
|
366
|
+
});
|
|
367
|
+
state.origins = [];
|
|
368
|
+
state.tags = [];
|
|
369
|
+
five.off('panoWillArrive', onPanoWillArrive);
|
|
370
|
+
five.off('panoArrived', onPanoArrived);
|
|
371
|
+
five.off('modeChange', onModeChange);
|
|
372
|
+
five.off('cameraUpdate', onCameraUpdate);
|
|
373
|
+
};
|
|
374
|
+
if (five?.model?.loaded) {
|
|
375
|
+
if (!wrapper)
|
|
376
|
+
wrapper = five.getElement().parentElement;
|
|
377
|
+
wrapper.appendChild(container);
|
|
378
|
+
state.forbidden = false;
|
|
379
|
+
updateTags();
|
|
380
|
+
five.on('panoWillArrive', onPanoWillArrive);
|
|
381
|
+
five.on('panoArrived', onPanoArrived);
|
|
382
|
+
five.on('modeChange', onModeChange);
|
|
383
|
+
five.on('cameraUpdate', onCameraUpdate);
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
five.once('modelBvhLoaded', () => {
|
|
387
|
+
if (!wrapper)
|
|
388
|
+
wrapper = five.getElement().parentElement;
|
|
389
|
+
wrapper.appendChild(container);
|
|
390
|
+
state.forbidden = false;
|
|
391
|
+
updateTags();
|
|
392
|
+
five.on('panoWillArrive', onPanoWillArrive);
|
|
393
|
+
five.on('panoArrived', onPanoArrived);
|
|
394
|
+
five.on('modeChange', onModeChange);
|
|
395
|
+
five.on('cameraUpdate', onCameraUpdate);
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
five.on('dispose', dispose);
|
|
399
|
+
return {
|
|
400
|
+
load,
|
|
401
|
+
unfoldAll,
|
|
402
|
+
foldAll,
|
|
403
|
+
unfold,
|
|
404
|
+
fold,
|
|
405
|
+
enable,
|
|
406
|
+
disable,
|
|
407
|
+
hooks,
|
|
408
|
+
dispose,
|
|
409
|
+
};
|
|
410
|
+
};
|
|
411
|
+
export default PanoSpatialTagPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const currentTarget: import("svelte/store").Writable<any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pluginStyle: Partial<CSSStyleDeclaration>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export declare type PanoSpatialTagPluginId = string | number;
|
|
3
|
+
export interface PanoSpatialTagPluginContentReplacement {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
}
|
|
6
|
+
interface PanoSpatialTagPluginAppData {
|
|
7
|
+
replacement: PanoSpatialTagPluginContentReplacement;
|
|
8
|
+
weight?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface PanoSpatialTagPluginDataElement extends PanoSpatialTagPluginAppData {
|
|
11
|
+
id: PanoSpatialTagPluginId;
|
|
12
|
+
position: number[];
|
|
13
|
+
normal: number[];
|
|
14
|
+
}
|
|
15
|
+
export interface PanoSpatialTagPluginTagElement {
|
|
16
|
+
id: PanoSpatialTagPluginId;
|
|
17
|
+
position: THREE.Vector3;
|
|
18
|
+
normal: THREE.Vector3;
|
|
19
|
+
app: any;
|
|
20
|
+
destroying?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface PanoSpatialTagPluginOriginElement {
|
|
23
|
+
id: PanoSpatialTagPluginId;
|
|
24
|
+
front: boolean;
|
|
25
|
+
left: number;
|
|
26
|
+
top: number;
|
|
27
|
+
destroying?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface PanoSpatialTagPluginContentEvent {
|
|
30
|
+
[className: string]: (id: PanoSpatialTagPluginId) => any;
|
|
31
|
+
}
|
|
32
|
+
export interface PanoSpatialTagPluginPointElement {
|
|
33
|
+
id: PanoSpatialTagPluginId;
|
|
34
|
+
position: THREE.Vector3;
|
|
35
|
+
normal: THREE.Vector3;
|
|
36
|
+
replacement: PanoSpatialTagPluginContentReplacement;
|
|
37
|
+
weight: number;
|
|
38
|
+
distance?: number;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/* generated by Svelte v3.47.0 */
|
|
2
|
+
import {
|
|
3
|
+
SvelteComponent,
|
|
4
|
+
append_styles,
|
|
5
|
+
attr,
|
|
6
|
+
check_outros,
|
|
7
|
+
create_component,
|
|
8
|
+
destroy_component,
|
|
9
|
+
detach,
|
|
10
|
+
element,
|
|
11
|
+
group_outros,
|
|
12
|
+
init,
|
|
13
|
+
insert,
|
|
14
|
+
mount_component,
|
|
15
|
+
safe_not_equal,
|
|
16
|
+
transition_in,
|
|
17
|
+
transition_out
|
|
18
|
+
} from "svelte/internal";
|
|
19
|
+
|
|
20
|
+
import NormalImage from './Normalmage';
|
|
21
|
+
import SvgImage from './SvgImage';
|
|
22
|
+
|
|
23
|
+
function add_css(target) {
|
|
24
|
+
append_styles(target, "svelte-126ja8e", ".floorplan-plugin__base-image.svelte-126ja8e{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// (12:22)
|
|
28
|
+
function create_if_block_1(ctx) {
|
|
29
|
+
let normalimage;
|
|
30
|
+
let current;
|
|
31
|
+
normalimage = new NormalImage({ props: { url: /*imageData*/ ctx[1].url } });
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
c() {
|
|
35
|
+
create_component(normalimage.$$.fragment);
|
|
36
|
+
},
|
|
37
|
+
m(target, anchor) {
|
|
38
|
+
mount_component(normalimage, target, anchor);
|
|
39
|
+
current = true;
|
|
40
|
+
},
|
|
41
|
+
p(ctx, dirty) {
|
|
42
|
+
const normalimage_changes = {};
|
|
43
|
+
if (dirty & /*imageData*/ 2) normalimage_changes.url = /*imageData*/ ctx[1].url;
|
|
44
|
+
normalimage.$set(normalimage_changes);
|
|
45
|
+
},
|
|
46
|
+
i(local) {
|
|
47
|
+
if (current) return;
|
|
48
|
+
transition_in(normalimage.$$.fragment, local);
|
|
49
|
+
current = true;
|
|
50
|
+
},
|
|
51
|
+
o(local) {
|
|
52
|
+
transition_out(normalimage.$$.fragment, local);
|
|
53
|
+
current = false;
|
|
54
|
+
},
|
|
55
|
+
d(detaching) {
|
|
56
|
+
destroy_component(normalimage, detaching);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// (10:2) {#if svgContent}
|
|
62
|
+
function create_if_block(ctx) {
|
|
63
|
+
let svgimage;
|
|
64
|
+
let current;
|
|
65
|
+
|
|
66
|
+
svgimage = new SvgImage({
|
|
67
|
+
props: { content: /*svgContent*/ ctx[0] }
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
c() {
|
|
72
|
+
create_component(svgimage.$$.fragment);
|
|
73
|
+
},
|
|
74
|
+
m(target, anchor) {
|
|
75
|
+
mount_component(svgimage, target, anchor);
|
|
76
|
+
current = true;
|
|
77
|
+
},
|
|
78
|
+
p(ctx, dirty) {
|
|
79
|
+
const svgimage_changes = {};
|
|
80
|
+
if (dirty & /*svgContent*/ 1) svgimage_changes.content = /*svgContent*/ ctx[0];
|
|
81
|
+
svgimage.$set(svgimage_changes);
|
|
82
|
+
},
|
|
83
|
+
i(local) {
|
|
84
|
+
if (current) return;
|
|
85
|
+
transition_in(svgimage.$$.fragment, local);
|
|
86
|
+
current = true;
|
|
87
|
+
},
|
|
88
|
+
o(local) {
|
|
89
|
+
transition_out(svgimage.$$.fragment, local);
|
|
90
|
+
current = false;
|
|
91
|
+
},
|
|
92
|
+
d(detaching) {
|
|
93
|
+
destroy_component(svgimage, detaching);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function create_fragment(ctx) {
|
|
99
|
+
let div;
|
|
100
|
+
let current_block_type_index;
|
|
101
|
+
let if_block;
|
|
102
|
+
let current;
|
|
103
|
+
const if_block_creators = [create_if_block, create_if_block_1];
|
|
104
|
+
const if_blocks = [];
|
|
105
|
+
|
|
106
|
+
function select_block_type(ctx, dirty) {
|
|
107
|
+
if (/*svgContent*/ ctx[0]) return 0;
|
|
108
|
+
if (/*imageData*/ ctx[1]) return 1;
|
|
109
|
+
return -1;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (~(current_block_type_index = select_block_type(ctx, -1))) {
|
|
113
|
+
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
c() {
|
|
118
|
+
div = element("div");
|
|
119
|
+
if (if_block) if_block.c();
|
|
120
|
+
attr(div, "class", "floorplan-plugin__base-image svelte-126ja8e");
|
|
121
|
+
},
|
|
122
|
+
m(target, anchor) {
|
|
123
|
+
insert(target, div, anchor);
|
|
124
|
+
|
|
125
|
+
if (~current_block_type_index) {
|
|
126
|
+
if_blocks[current_block_type_index].m(div, null);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
current = true;
|
|
130
|
+
},
|
|
131
|
+
p(ctx, [dirty]) {
|
|
132
|
+
let previous_block_index = current_block_type_index;
|
|
133
|
+
current_block_type_index = select_block_type(ctx, dirty);
|
|
134
|
+
|
|
135
|
+
if (current_block_type_index === previous_block_index) {
|
|
136
|
+
if (~current_block_type_index) {
|
|
137
|
+
if_blocks[current_block_type_index].p(ctx, dirty);
|
|
138
|
+
}
|
|
139
|
+
} else {
|
|
140
|
+
if (if_block) {
|
|
141
|
+
group_outros();
|
|
142
|
+
|
|
143
|
+
transition_out(if_blocks[previous_block_index], 1, 1, () => {
|
|
144
|
+
if_blocks[previous_block_index] = null;
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
check_outros();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (~current_block_type_index) {
|
|
151
|
+
if_block = if_blocks[current_block_type_index];
|
|
152
|
+
|
|
153
|
+
if (!if_block) {
|
|
154
|
+
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
|
155
|
+
if_block.c();
|
|
156
|
+
} else {
|
|
157
|
+
if_block.p(ctx, dirty);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
transition_in(if_block, 1);
|
|
161
|
+
if_block.m(div, null);
|
|
162
|
+
} else {
|
|
163
|
+
if_block = null;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
i(local) {
|
|
168
|
+
if (current) return;
|
|
169
|
+
transition_in(if_block);
|
|
170
|
+
current = true;
|
|
171
|
+
},
|
|
172
|
+
o(local) {
|
|
173
|
+
transition_out(if_block);
|
|
174
|
+
current = false;
|
|
175
|
+
},
|
|
176
|
+
d(detaching) {
|
|
177
|
+
if (detaching) detach(div);
|
|
178
|
+
|
|
179
|
+
if (~current_block_type_index) {
|
|
180
|
+
if_blocks[current_block_type_index].d();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function instance($$self, $$props, $$invalidate) {
|
|
187
|
+
let imageData;
|
|
188
|
+
let svgContent;
|
|
189
|
+
let { floorIndex } = $$props;
|
|
190
|
+
let { floorplanData } = $$props;
|
|
191
|
+
|
|
192
|
+
$$self.$$set = $$props => {
|
|
193
|
+
if ('floorIndex' in $$props) $$invalidate(2, floorIndex = $$props.floorIndex);
|
|
194
|
+
if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
$$self.$$.update = () => {
|
|
198
|
+
if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
|
|
199
|
+
$: $$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if ($$self.$$.dirty & /*floorplanData, floorIndex*/ 12) {
|
|
203
|
+
$: $$invalidate(0, svgContent = floorplanData.outlines?.[floorIndex]?.svgContent);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
return [svgContent, imageData, floorIndex, floorplanData];
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
class Component extends SvelteComponent {
|
|
211
|
+
constructor(options) {
|
|
212
|
+
super();
|
|
213
|
+
init(this, options, instance, create_fragment, safe_not_equal, { floorIndex: 2, floorplanData: 3 }, add_css);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export default Component;
|