@realsee/dnalogel 0.1.7 → 2.0.0-alpha.1
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/README.md +6 -90
- package/dist/dnalogel.es.js +37145 -0
- package/dist/dnalogel.umd.js +2 -0
- package/dist/style.css +1 -0
- package/{plugins → libs}/CSS3DRenderPlugin/index.d.ts +1 -1
- package/libs/CSS3DRenderPlugin/index.js +181 -0
- package/libs/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +7 -0
- package/libs/CSS3DRenderPlugin/utils/createResizeObserver.js +18 -0
- package/{plugins → libs}/CameraMovementPlugin/index.d.ts +0 -0
- package/libs/CameraMovementPlugin/index.js +159 -0
- package/{plugins → libs}/CameraMovementPlugin/typing.d.ts +0 -0
- package/libs/CameraMovementPlugin/typing.js +17 -0
- package/{plugins → libs}/ModelChassisCompassPlugin/index.d.ts +1 -1
- package/libs/ModelChassisCompassPlugin/index.js +75 -0
- package/{plugins → libs}/ModelEntryDoorGuidePlugin/index.d.ts +6 -2
- package/libs/ModelEntryDoorGuidePlugin/index.js +136 -0
- package/libs/ModelRoomLabelPlugin/Assets/roomLabelBg.d.ts +1 -0
- package/libs/ModelRoomLabelPlugin/Assets/roomLabelBg.js +1 -0
- package/{plugins → libs}/ModelRoomLabelPlugin/Controller.d.ts +3 -2
- package/libs/ModelRoomLabelPlugin/Controller.js +100 -0
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte +63 -0
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte.map +1 -0
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte +80 -0
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte.map +1 -0
- package/libs/ModelRoomLabelPlugin/index.d.ts +12 -0
- package/libs/ModelRoomLabelPlugin/index.js +9 -0
- package/{plugins → libs}/ModelRoomLabelPlugin/typings.d.ts +2 -2
- package/libs/ModelRoomLabelPlugin/typings.js +1 -0
- package/{plugins → libs}/ModelRoomLabelPlugin/utils/parseData.d.ts +0 -0
- package/libs/ModelRoomLabelPlugin/utils/parseData.js +14 -0
- package/{plugins → libs}/ModelViewPlugin/index.d.ts +0 -0
- package/libs/ModelViewPlugin/index.js +160 -0
- package/{plugins → libs}/PanoCursorRaycasterPlugin/index.d.ts +2 -3
- package/libs/PanoCursorRaycasterPlugin/index.js +74 -0
- package/libs/floorplan/Assets/camera.d.ts +1 -0
- package/libs/floorplan/Assets/camera.js +1 -0
- package/libs/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
- package/libs/floorplan/Assets/floorplanExtraObject.js +1 -0
- package/libs/floorplan/Components/BaseImage.svelte +25 -0
- package/libs/floorplan/Components/BaseImage.svelte.map +1 -0
- package/libs/floorplan/Components/Normalmage.svelte +11 -0
- package/libs/floorplan/Components/Normalmage.svelte.map +1 -0
- package/libs/floorplan/Components/RoomHighlight/Room.svelte +21 -0
- package/libs/floorplan/Components/RoomHighlight/Room.svelte.map +1 -0
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte +60 -0
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte.map +1 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte +35 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte.map +1 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte +7 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte.map +1 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte +16 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte.map +1 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte +17 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte.map +1 -0
- package/libs/floorplan/Components/SvgImage.svelte +25 -0
- package/libs/floorplan/Components/SvgImage.svelte.map +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.d.ts +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.js +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte +46 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte.map +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte +48 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte.map +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte +37 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte +50 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte.map +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte +41 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte.map +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte +25 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte.map +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte +148 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte.map +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte +15 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte.map +1 -0
- package/{plugins → libs}/floorplan/ModelFloorplanPlugin/Controller.d.ts +16 -14
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +357 -0
- package/{plugins → libs}/floorplan/ModelFloorplanPlugin/index.d.ts +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/index.js +5 -0
- package/{plugins → libs}/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +0 -0
- package/libs/floorplan/ModelFloorplanPlugin/typings/events.type.js +1 -0
- package/{plugins → libs}/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/utils/constant.js +16 -0
- package/{plugins → libs}/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +0 -0
- package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +46 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte +84 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte.map +1 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte +18 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +1 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte +40 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte.map +1 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte +61 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte.map +1 -0
- package/{plugins → libs}/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +6 -11
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +88 -0
- package/{plugins → libs}/floorplan/PanoFloorplanRadarPlugin/index.d.ts +0 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +5 -0
- package/{plugins → libs}/floorplan/TopviewFloorplanPlugin/Controller.d.ts +15 -11
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +189 -0
- package/{plugins → libs}/floorplan/TopviewFloorplanPlugin/index.d.ts +0 -0
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +5 -0
- package/{plugins → libs}/floorplan/TopviewFloorplanPlugin/style.d.ts +0 -0
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +8 -0
- package/{plugins → libs}/floorplan/typings/floorplanData.d.ts +6 -0
- package/libs/floorplan/typings/floorplanData.js +6 -0
- package/{plugins → libs}/floorplan/typings/floorplanServerData.d.ts +4 -2
- package/libs/floorplan/typings/floorplanServerData.js +101 -0
- package/libs/floorplan/typings/utility.d.ts +2 -0
- package/libs/floorplan/typings/utility.js +1 -0
- package/{plugins → libs}/floorplan/utils/formatData.d.ts +3 -3
- package/libs/floorplan/utils/formatData.js +94 -0
- package/{plugins → libs}/floorplan/utils/formatPosition.d.ts +3 -4
- package/libs/floorplan/utils/formatPosition.js +50 -0
- package/libs/index.d.ts +17 -0
- package/libs/index.js +10 -0
- package/{shared-utils → libs/shared-utils}/Preloader.d.ts +0 -0
- package/libs/shared-utils/Preloader.js +38 -0
- package/{shared-utils → libs/shared-utils}/Subscribe.d.ts +3 -3
- package/libs/shared-utils/Subscribe.js +101 -0
- package/{shared-utils → libs/shared-utils}/animationFrame/BetterTween.d.ts +0 -0
- package/libs/shared-utils/animationFrame/BetterTween.js +30 -0
- package/{shared-utils → libs/shared-utils}/animationFrame/calculateProgress.d.ts +0 -0
- package/libs/shared-utils/animationFrame/calculateProgress.js +23 -0
- package/{shared-utils → libs/shared-utils}/animationFrame/formatRad.d.ts +0 -0
- package/libs/shared-utils/animationFrame/formatRad.js +20 -0
- package/{shared-utils → libs/shared-utils}/animationFrame/index.d.ts +0 -0
- package/libs/shared-utils/animationFrame/index.js +48 -0
- package/{shared-utils → libs/shared-utils}/animationFrame/tween.d.ts +0 -0
- package/libs/shared-utils/animationFrame/tween.js +44 -0
- package/libs/shared-utils/changeModelCanvasOpacity.d.ts +2 -0
- package/libs/shared-utils/changeModelCanvasOpacity.js +15 -0
- package/{shared-utils → libs/shared-utils}/createCanvasTextTexture.d.ts +0 -0
- package/libs/shared-utils/createCanvasTextTexture.js +19 -0
- package/{shared-utils → libs/shared-utils}/createLine/index.d.ts +1 -1
- package/libs/shared-utils/createLine/index.js +8 -0
- package/{shared-utils → libs/shared-utils}/debounce.d.ts +1 -1
- package/libs/shared-utils/debounce.js +14 -0
- package/{shared-utils → libs/shared-utils}/equal.d.ts +0 -0
- package/libs/shared-utils/equal.js +84 -0
- package/{shared-utils → libs/shared-utils}/filter.d.ts +0 -0
- package/libs/shared-utils/filter.js +53 -0
- package/{shared-utils → libs/shared-utils}/five/changeMode.d.ts +0 -0
- package/libs/shared-utils/five/changeMode.js +15 -0
- package/{shared-utils → libs/shared-utils}/five/useFivePlugin.d.ts +0 -0
- package/libs/shared-utils/five/useFivePlugin.js +8 -0
- package/{shared-utils → libs/shared-utils}/formatRad.d.ts +0 -0
- package/libs/shared-utils/formatRad.js +10 -0
- package/{shared-utils → libs/shared-utils}/getPxmm.d.ts +0 -0
- package/libs/shared-utils/getPxmm.js +20 -0
- package/{shared-utils → libs/shared-utils}/getRandomColor.d.ts +0 -0
- package/libs/shared-utils/getRandomColor.js +10 -0
- package/{shared-utils → libs/shared-utils}/isNil.d.ts +0 -0
- package/libs/shared-utils/isNil.js +14 -0
- package/{shared-utils → libs/shared-utils}/isTruelyObject.d.ts +0 -0
- package/libs/shared-utils/isTruelyObject.js +20 -0
- package/libs/shared-utils/math/evenNumber.d.ts +3 -0
- package/libs/shared-utils/math/evenNumber.js +4 -0
- package/{shared-utils → libs/shared-utils}/math/planimetry.d.ts +4 -4
- package/libs/shared-utils/math/planimetry.js +288 -0
- package/{shared-utils → libs/shared-utils}/math/rad2Deg.d.ts +0 -0
- package/libs/shared-utils/math/rad2Deg.js +3 -0
- package/{shared-utils → libs/shared-utils}/nearlyEqual.d.ts +0 -0
- package/libs/shared-utils/nearlyEqual.js +9 -0
- package/{shared-utils → libs/shared-utils}/nextFrame.d.ts +0 -0
- package/libs/shared-utils/nextFrame.js +6 -0
- package/{shared-utils → libs/shared-utils}/noop.d.ts +0 -0
- package/libs/shared-utils/noop.js +7 -0
- package/{shared-utils → libs/shared-utils}/object3d2LocalMatrix.d.ts +0 -0
- package/libs/shared-utils/object3d2LocalMatrix.js +29 -0
- package/{shared-utils → libs/shared-utils}/px2rem.d.ts +0 -0
- package/libs/shared-utils/px2rem.js +4 -0
- package/libs/shared-utils/removeArrayItem.d.ts +7 -0
- package/libs/shared-utils/removeArrayItem.js +12 -0
- package/{shared-utils → libs/shared-utils}/tap.d.ts +0 -0
- package/{shared-utils → libs/shared-utils}/tap.js +4 -13
- package/{shared-utils → libs/shared-utils}/three/centerPoint.d.ts +0 -0
- package/libs/shared-utils/three/centerPoint.js +4 -0
- package/{shared-utils → libs/shared-utils}/three/getExtraModelLoader.d.ts +0 -0
- package/libs/shared-utils/three/getExtraModelLoader.js +18 -0
- package/{shared-utils → libs/shared-utils}/three/getNormal.d.ts +0 -0
- package/libs/shared-utils/three/getNormal.js +6 -0
- package/{shared-utils → libs/shared-utils}/three/getTextureLoader.d.ts +0 -0
- package/libs/shared-utils/three/getTextureLoader.js +17 -0
- package/{shared-utils → libs/shared-utils}/three/loadFbxObj.d.ts +0 -0
- package/libs/shared-utils/three/loadFbxObj.js +13 -0
- package/libs/shared-utils/three/loadTexture.d.ts +2 -0
- package/libs/shared-utils/three/loadTexture.js +10 -0
- package/{shared-utils → libs/shared-utils}/three/transformPositionToVector3.d.ts +0 -0
- package/libs/shared-utils/three/transformPositionToVector3.js +3 -0
- package/{shared-utils → libs/shared-utils}/three/transfromToMeshBasicMaterial.d.ts +0 -0
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +14 -0
- package/{shared-utils → libs/shared-utils}/throttle.d.ts +1 -1
- package/libs/shared-utils/throttle.js +18 -0
- package/{shared-utils → libs/shared-utils}/to.d.ts +0 -0
- package/libs/shared-utils/to.js +18 -0
- package/{shared-utils → libs/shared-utils}/useDebounce.d.ts +0 -0
- package/libs/shared-utils/useDebounce.js +22 -0
- package/{shared-utils → libs/shared-utils}/useThrottle.d.ts +0 -0
- package/libs/shared-utils/useThrottle.js +25 -0
- package/libs/{gltf-viewer → shared-utils}/uuid.d.ts +0 -0
- package/libs/shared-utils/uuid.js +11 -0
- package/{shared-utils → libs/shared-utils}/vectorTocoordinates.d.ts +0 -0
- package/libs/shared-utils/vectorTocoordinates.js +9 -0
- package/{typings → libs/typings}/math.type.d.ts +0 -0
- package/libs/typings/math.type.js +1 -0
- package/{typings → libs/typings}/utils.type.d.ts +0 -0
- package/libs/typings/utils.type.js +1 -0
- package/package.json +45 -17
- package/TERMS.txt +0 -56
- package/components/ARVideoFigure/ARVideoFigureMesh.d.ts +0 -44
- package/components/ARVideoFigure/ARVideoFigureMesh.js +0 -371
- package/components/ARVideoFigure/ARVideoFigureScene.d.ts +0 -11
- package/components/ARVideoFigure/ARVideoFigureScene.js +0 -85
- package/components/ARVideoFigure/ImgBgTransparent.d.ts +0 -16
- package/components/ARVideoFigure/ImgBgTransparent.js +0 -65
- package/components/ARVideoFigure/ImgBgTransparentMesh.d.ts +0 -30
- package/components/ARVideoFigure/ImgBgTransparentMesh.js +0 -183
- package/components/ARVideoFigure/fragmentShader.d.ts +0 -5
- package/components/ARVideoFigure/fragmentShader.js +0 -18
- package/components/ARVideoFigure/index.d.ts +0 -15
- package/components/ARVideoFigure/index.js +0 -80
- package/components/ARVideoFigure/vertexShader.d.ts +0 -1
- package/components/ARVideoFigure/vertexShader.js +0 -10
- package/components/GLTFView/index.d.ts +0 -72
- package/components/GLTFView/index.js +0 -149
- package/components/GlassFilters/index.d.ts +0 -32
- package/components/GlassFilters/index.js +0 -78
- package/components/ModelView/ModelViewController.d.ts +0 -18
- package/components/ModelView/ModelViewController.js +0 -157
- package/components/ModelView/index.d.ts +0 -10
- package/components/ModelView/index.js +0 -24
- package/components/PaintBrush/index.d.ts +0 -16
- package/components/PaintBrush/index.js +0 -47
- package/components/PanoTag/index.d.ts +0 -4
- package/components/PanoTag/index.js +0 -13
- package/custom.d.js +0 -3
- package/data/1aGKl9JmrlXMXx8d.d.ts +0 -104
- package/data/1aGKl9JmrlXMXx8d.js +0 -537
- package/data/54djM0oR6ky3Ey8e.d.ts +0 -55
- package/data/54djM0oR6ky3Ey8e.js +0 -350
- package/data/6gyq3v1verxD7JO1.d.ts +0 -104
- package/data/6gyq3v1verxD7JO1.js +0 -462
- package/data/8054djM0oR6ky3Ey8e.d.ts +0 -55
- package/data/8054djM0oR6ky3Ey8e.js +0 -350
- package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.d.ts +0 -84
- package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.js +0 -600
- package/data/PrXel3aqGbp34JQn.d.ts +0 -389
- package/data/PrXel3aqGbp34JQn.js +0 -4649
- package/data/XJ6NMLWnkAY3Rdx8.d.ts +0 -843
- package/data/XJ6NMLWnkAY3Rdx8.js +0 -7989
- package/data/YdoNP9K4rwQDwjJr.d.ts +0 -83
- package/data/YdoNP9K4rwQDwjJr.js +0 -1453
- package/data/ZLvK29zj4L29Jowd.d.ts +0 -55
- package/data/ZLvK29zj4L29Jowd.js +0 -372
- package/data/auto3d-njL5J99VwCmnjtQElOmXQr.d.ts +0 -86
- package/data/auto3d-njL5J99VwCmnjtQElOmXQr.js +0 -711
- package/data/extrude-walls/ZLvK29zj4L29Jowd.d.ts +0 -5
- package/data/extrude-walls/ZLvK29zj4L29Jowd.js +0 -14
- package/data/extrude-walls/lo024DEgzanMj5BE.d.ts +0 -5
- package/data/extrude-walls/lo024DEgzanMj5BE.js +0 -14
- package/data/jd6oMOzPxnQ3BvxY_B7yw51J9rXlhYhjhGTOgRVqu6WeEqjNX.d.ts +0 -85
- package/data/jd6oMOzPxnQ3BvxY_B7yw51J9rXlhYhjhGTOgRVqu6WeEqjNX.js +0 -511
- package/data/lo024DEgzanMj5BE.d.ts +0 -55
- package/data/lo024DEgzanMj5BE.js +0 -966
- package/data/oPzy3ApbjjpD8YdR.d.ts +0 -83
- package/data/oPzy3ApbjjpD8YdR.js +0 -283
- package/data/qjAxMG4XbPn96wKG.d.ts +0 -104
- package/data/qjAxMG4XbPn96wKG.js +0 -637
- package/data/rXel3aPQRRBD4JQn.d.ts +0 -86
- package/data/rXel3aPQRRBD4JQn.js +0 -622
- package/data/vLykj3NWrllMrG06.d.ts +0 -91
- package/data/vLykj3NWrllMrG06.js +0 -2729
- package/data/wz0QV9KA4ugyo9ME.d.ts +0 -39
- package/data/wz0QV9KA4ugyo9ME.js +0 -136
- package/data/zxMawr9raSg8LYjG.d.ts +0 -53
- package/data/zxMawr9raSg8LYjG.js +0 -590
- package/examples/FiveStateController/index.js +0 -134
- package/examples/VRHouse/Mobile.js +0 -36
- package/examples/VRHouse/PC.js +0 -36
- package/examples/VRHouse/index.js +0 -36
- package/index.d.ts +0 -15
- package/index.js +0 -45
- package/libs/gltf-viewer/Subscribe.d.ts +0 -76
- package/libs/gltf-viewer/Subscribe.js +0 -231
- package/libs/gltf-viewer/coordsMoveByOffset.d.ts +0 -13
- package/libs/gltf-viewer/coordsMoveByOffset.js +0 -22
- package/libs/gltf-viewer/coordsToDirection.d.ts +0 -5
- package/libs/gltf-viewer/coordsToDirection.js +0 -41
- package/libs/gltf-viewer/formatRad.d.ts +0 -1
- package/libs/gltf-viewer/formatRad.js +0 -13
- package/libs/gltf-viewer/getFrameTime.d.ts +0 -1
- package/libs/gltf-viewer/getFrameTime.js +0 -28
- package/libs/gltf-viewer/index.d.ts +0 -55
- package/libs/gltf-viewer/index.js +0 -650
- package/libs/gltf-viewer/mouseWheel.d.ts +0 -2
- package/libs/gltf-viewer/mouseWheel.js +0 -59
- package/libs/gltf-viewer/requestAnimationFrame.d.ts +0 -1
- package/libs/gltf-viewer/requestAnimationFrame.js +0 -18
- package/libs/gltf-viewer/requestAnimationFrameInterval.d.ts +0 -1
- package/libs/gltf-viewer/requestAnimationFrameInterval.js +0 -31
- package/libs/gltf-viewer/uuid.js +0 -28
- package/plugins/AutoPreloadPlugin/index.d.ts +0 -23
- package/plugins/AutoPreloadPlugin/index.js +0 -111
- package/plugins/CSS3DRenderPlugin/components/Marker/index.d.ts +0 -12
- package/plugins/CSS3DRenderPlugin/components/Marker/index.js +0 -121
- package/plugins/CSS3DRenderPlugin/index.js +0 -298
- package/plugins/CameraMovementPlugin/index.js +0 -362
- package/plugins/CameraMovementPlugin/typing.js +0 -37
- package/plugins/ModelChassisCompassPlugin/index.js +0 -157
- package/plugins/ModelEntryDoorGuidePlugin/index.js +0 -247
- package/plugins/ModelExtrudeWallsPlugin/index.d.ts +0 -16
- package/plugins/ModelExtrudeWallsPlugin/index.js +0 -252
- package/plugins/ModelRoomLabelPlugin/Controller.js +0 -153
- package/plugins/ModelRoomLabelPlugin/RoomLabelItem.d.ts +0 -8
- package/plugins/ModelRoomLabelPlugin/RoomLabelItem.js +0 -66
- package/plugins/ModelRoomLabelPlugin/RoomLabelItems.d.ts +0 -7
- package/plugins/ModelRoomLabelPlugin/RoomLabelItems.js +0 -159
- package/plugins/ModelRoomLabelPlugin/index.d.ts +0 -8
- package/plugins/ModelRoomLabelPlugin/index.js +0 -18
- package/plugins/ModelRoomLabelPlugin/typings.js +0 -7
- package/plugins/ModelRoomLabelPlugin/utils/parseData.js +0 -35
- package/plugins/ModelTVVideoPlugin/index.d.ts +0 -21
- package/plugins/ModelTVVideoPlugin/index.js +0 -397
- package/plugins/ModelViewPlugin/index.js +0 -223
- package/plugins/PanoCursorRaycasterPlugin/PanoCursorRaycasterPluginUsage.d.ts +0 -48
- package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.d.ts +0 -9
- package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.js +0 -117
- package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.d.ts +0 -11
- package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.js +0 -39
- package/plugins/PanoCursorRaycasterPlugin/index.js +0 -126
- package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.d.ts +0 -5
- package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.js +0 -27
- package/plugins/PanoCursorRaycasterPlugin/utils/createLine.d.ts +0 -3
- package/plugins/PanoCursorRaycasterPlugin/utils/createLine.js +0 -48
- package/plugins/PanoDoorLabelPlugin/index.d.ts +0 -4
- package/plugins/PanoDoorLabelPlugin/index.js +0 -14
- package/plugins/PanoIRobotPlugin/index.d.ts +0 -10
- package/plugins/PanoIRobotPlugin/index.js +0 -18
- package/plugins/PanoMaskSelectorPlugin/compare.d.ts +0 -1
- package/plugins/PanoMaskSelectorPlugin/compare.js +0 -17
- package/plugins/PanoMaskSelectorPlugin/createBox.d.ts +0 -7
- package/plugins/PanoMaskSelectorPlugin/createBox.js +0 -79
- package/plugins/PanoMaskSelectorPlugin/createTextures.d.ts +0 -3
- package/plugins/PanoMaskSelectorPlugin/createTextures.js +0 -45
- package/plugins/PanoMaskSelectorPlugin/fragmentShader.d.ts +0 -1
- package/plugins/PanoMaskSelectorPlugin/fragmentShader.js +0 -10
- package/plugins/PanoMaskSelectorPlugin/index.d.ts +0 -49
- package/plugins/PanoMaskSelectorPlugin/index.js +0 -348
- package/plugins/PanoMaskSelectorPlugin/vertexShader.d.ts +0 -1
- package/plugins/PanoMaskSelectorPlugin/vertexShader.js +0 -10
- package/plugins/PanoRulerPlugin/data/roomInfo.d.ts +0 -3
- package/plugins/PanoRulerPlugin/data/roomInfo.js +0 -51
- package/plugins/PanoRulerPlugin/data/roomRules.d.ts +0 -3
- package/plugins/PanoRulerPlugin/data/roomRules.js +0 -235
- package/plugins/PanoRulerPlugin/index.d.ts +0 -27
- package/plugins/PanoRulerPlugin/index.js +0 -637
- package/plugins/PanoRulerPlugin/typings.d.ts +0 -21
- package/plugins/PanoRulerPlugin/typings.js +0 -7
- package/plugins/PanoTVVideoPlugin/index.d.ts +0 -26
- package/plugins/PanoTVVideoPlugin/index.js +0 -433
- package/plugins/TreasurePlugin/Controller.d.ts +0 -73
- package/plugins/TreasurePlugin/Controller.js +0 -250
- package/plugins/TreasurePlugin/TreasureFaceAnime.d.ts +0 -25
- package/plugins/TreasurePlugin/TreasureFaceAnime.js +0 -143
- package/plugins/TreasurePlugin/TreasureObject.d.ts +0 -53
- package/plugins/TreasurePlugin/TreasureObject.js +0 -406
- package/plugins/TreasurePlugin/TreasureOpenAnime.d.ts +0 -25
- package/plugins/TreasurePlugin/TreasureOpenAnime.js +0 -127
- package/plugins/TreasurePlugin/constants.d.ts +0 -33
- package/plugins/TreasurePlugin/constants.js +0 -67
- package/plugins/TreasurePlugin/index.d.ts +0 -11
- package/plugins/TreasurePlugin/index.js +0 -26
- package/plugins/TreasurePlugin/typings.d.ts +0 -2
- package/plugins/TreasurePlugin/typings.js +0 -7
- package/plugins/floorplan/Assets/floorplanExtraObject.d.ts +0 -1
- package/plugins/floorplan/Assets/floorplanExtraObject.js +0 -10
- package/plugins/floorplan/ModelFloorplanPlugin/Controller.js +0 -626
- package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.d.ts +0 -13
- package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.js +0 -78
- package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.d.ts +0 -5
- package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.js +0 -84
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.d.ts +0 -10
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.js +0 -129
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.d.ts +0 -13
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.js +0 -118
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.d.ts +0 -13
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.js +0 -62
- package/plugins/floorplan/ModelFloorplanPlugin/components/index.d.ts +0 -20
- package/plugins/floorplan/ModelFloorplanPlugin/components/index.js +0 -88
- package/plugins/floorplan/ModelFloorplanPlugin/controller.style.d.ts +0 -1
- package/plugins/floorplan/ModelFloorplanPlugin/controller.style.js +0 -16
- package/plugins/floorplan/ModelFloorplanPlugin/index.js +0 -20
- package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.js +0 -7
- package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.js +0 -33
- package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +0 -154
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.d.ts +0 -13
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.js +0 -113
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.d.ts +0 -3
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.js +0 -39
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.d.ts +0 -5
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.js +0 -66
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.d.ts +0 -9
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.js +0 -126
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.d.ts +0 -11
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.js +0 -58
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.d.ts +0 -17
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.js +0 -85
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.d.ts +0 -2
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.js +0 -15
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.js +0 -211
- package/plugins/floorplan/PanoFloorplanRadarPlugin/index.js +0 -20
- package/plugins/floorplan/TopviewFloorplanPlugin/Controller.js +0 -262
- package/plugins/floorplan/TopviewFloorplanPlugin/index.js +0 -18
- package/plugins/floorplan/TopviewFloorplanPlugin/style.js +0 -16
- package/plugins/floorplan/components/FloorplanImage.d.ts +0 -7
- package/plugins/floorplan/components/FloorplanImage.js +0 -90
- package/plugins/floorplan/typings/floorplanData.js +0 -7
- package/plugins/floorplan/typings/floorplanServerData.js +0 -382
- package/plugins/floorplan/utils/formatData.js +0 -217
- package/plugins/floorplan/utils/formatPosition.js +0 -89
- package/shared-utils/Preloader.js +0 -57
- package/shared-utils/Subscribe.js +0 -230
- package/shared-utils/animationFrame/BetterTween.js +0 -103
- package/shared-utils/animationFrame/calculateProgress.js +0 -40
- package/shared-utils/animationFrame/formatRad.js +0 -36
- package/shared-utils/animationFrame/index.js +0 -81
- package/shared-utils/animationFrame/tween.js +0 -92
- package/shared-utils/changeModelCanvansOpacity.d.ts +0 -2
- package/shared-utils/changeModelCanvansOpacity.js +0 -38
- package/shared-utils/createCanvasTextTexture.js +0 -31
- package/shared-utils/createFiveContainer.d.ts +0 -10
- package/shared-utils/createFiveContainer.js +0 -171
- package/shared-utils/createLine/index.js +0 -43
- package/shared-utils/debounce.js +0 -30
- package/shared-utils/equal.js +0 -107
- package/shared-utils/filter.js +0 -127
- package/shared-utils/five/changeMode.js +0 -82
- package/shared-utils/five/useFivePlugin.js +0 -17
- package/shared-utils/formatRad.js +0 -18
- package/shared-utils/getPxmm.js +0 -51
- package/shared-utils/getRandomColor.js +0 -23
- package/shared-utils/isNil.js +0 -26
- package/shared-utils/isTruelyObject.js +0 -31
- package/shared-utils/math/evenNumber.d.ts +0 -1
- package/shared-utils/math/evenNumber.js +0 -13
- package/shared-utils/math/planimetry.js +0 -352
- package/shared-utils/math/rad2Deg.js +0 -12
- package/shared-utils/nearlyEqual.js +0 -19
- package/shared-utils/nextFrame.js +0 -15
- package/shared-utils/noop.js +0 -19
- package/shared-utils/object3d2LocalMatrix.js +0 -79
- package/shared-utils/px2rem.js +0 -22
- package/shared-utils/three/centerPoint.js +0 -14
- package/shared-utils/three/getExtraModelLoader.js +0 -45
- package/shared-utils/three/getNormal.js +0 -17
- package/shared-utils/three/getTextureLoader.js +0 -50
- package/shared-utils/three/loadFbxObj.js +0 -54
- package/shared-utils/three/loadTexture.d.ts +0 -2
- package/shared-utils/three/loadTexture.js +0 -46
- package/shared-utils/three/transformPositionToVector3.js +0 -20
- package/shared-utils/three/transfromToMeshBasicMaterial.js +0 -33
- package/shared-utils/throttle.js +0 -29
- package/shared-utils/to.js +0 -67
- package/shared-utils/useDebounce.js +0 -49
- package/shared-utils/useThrottle.js +0 -47
- package/shared-utils/uuid.d.ts +0 -4
- package/shared-utils/uuid.js +0 -28
- package/shared-utils/vectorTocoordinates.js +0 -18
- package/typedoc/components.d.ts +0 -6
- package/typedoc/components.js +0 -7
- package/typedoc/plugins.d.ts +0 -19
- package/typedoc/plugins.js +0 -165
- package/typedoc/shared-utils.d.ts +0 -3
- package/typedoc/shared-utils.js +0 -7
- package/typedoc/typings.d.ts +0 -3
- package/typedoc/typings.js +0 -7
- package/typings/math.type.js +0 -7
- package/typings/utils.type.js +0 -7
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<script>import { notNil } from '../../../../shared-utils/isNil';
|
|
2
|
+
export let pxmm;
|
|
3
|
+
export let type;
|
|
4
|
+
export let data;
|
|
5
|
+
export let bounding;
|
|
6
|
+
const padding = 1000;
|
|
7
|
+
const isTop = type === 'top';
|
|
8
|
+
const isBottom = type === 'bottom';
|
|
9
|
+
const isLeft = type === 'left';
|
|
10
|
+
const isRight = type === 'right';
|
|
11
|
+
const isRow = isTop || isBottom;
|
|
12
|
+
// 计算每一段墙的长度,以及墙两侧点距离标尺初始点的像素值
|
|
13
|
+
const positionArray = data
|
|
14
|
+
.map(([start, end]) => (isRow ? [start.x, end.x] : [start.y, end.y]))
|
|
15
|
+
.flat()
|
|
16
|
+
.sort()
|
|
17
|
+
.filter((x, index, arr) => {
|
|
18
|
+
if (index === 0)
|
|
19
|
+
return true;
|
|
20
|
+
return x !== arr[index - 1];
|
|
21
|
+
});
|
|
22
|
+
const minPosition = positionArray[0];
|
|
23
|
+
const maxPosition = positionArray.slice(-1)[0];
|
|
24
|
+
const length = maxPosition - minPosition;
|
|
25
|
+
const minBounding = isRow ? bounding.min.x : bounding.min.y;
|
|
26
|
+
const lengthPx = length * pxmm;
|
|
27
|
+
const positionPxArray = positionArray.map((x) => ((x - minPosition) / length) * lengthPx);
|
|
28
|
+
// 在主要方向上的偏移量,上下的标尺是距离图片左侧的长度,左右的标尺是距离图片底部的距离
|
|
29
|
+
const translateMain = (minPosition - minBounding) * pxmm;
|
|
30
|
+
// 在次要方向的偏移量,希望达到的效果是标尺轴距离户型图边界 27px,但是图片自身是带有 1000mm 的边界,所以在计算时需要减去这个边界
|
|
31
|
+
const translateSecond = 27 - padding * pxmm;
|
|
32
|
+
const translate = (() => {
|
|
33
|
+
if (isTop)
|
|
34
|
+
return `translate(${translateMain}px, ${-translateSecond}px)`;
|
|
35
|
+
if (isBottom)
|
|
36
|
+
return `translate(${translateMain}px, ${translateSecond}px)`;
|
|
37
|
+
if (isLeft)
|
|
38
|
+
return `translate(${-translateSecond}px, ${-translateMain}px)`;
|
|
39
|
+
if (isRight)
|
|
40
|
+
return `translate(${translateSecond}px, ${-translateMain - lengthPx}px)`;
|
|
41
|
+
})();
|
|
42
|
+
const rotate = isRow ? 'rotate(0)' : 'rotate(-90deg)';
|
|
43
|
+
const transform = `${translate} ${rotate}`;
|
|
44
|
+
const transformOrigin = `${isRight ? 'right' : 'left'} ${isTop ? 'top' : 'bottom'}`;
|
|
45
|
+
const width = lengthPx + 'px';
|
|
46
|
+
// 把点位的户型图坐标转成距离起始位置的像素值
|
|
47
|
+
const textArray = positionArray
|
|
48
|
+
.map((position, index, array) => {
|
|
49
|
+
if (index === 0)
|
|
50
|
+
return null;
|
|
51
|
+
const distance = position - array[index - 1];
|
|
52
|
+
const positionPx = ((array[index - 1] + distance / 2 - minPosition) / length) * lengthPx;
|
|
53
|
+
return { distance, positionPx };
|
|
54
|
+
})
|
|
55
|
+
.filter(notNil)
|
|
56
|
+
.filter((item) => item.distance / length > 0.12);
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<div
|
|
60
|
+
class="floorplan-plugin__rule-labels floorplan-plugin__rule-labels-{type}"
|
|
61
|
+
style:width
|
|
62
|
+
style:transform
|
|
63
|
+
style:transform-origin="{transformOrigin}"
|
|
64
|
+
>
|
|
65
|
+
<div class="floorplan-plugin__rule-line"></div>
|
|
66
|
+
{#each positionPxArray as position, positionIndex (positionIndex)}
|
|
67
|
+
<div class="floorplan-plugin__rule-scale" style:left="{position}px"></div>
|
|
68
|
+
{/each}
|
|
69
|
+
{#each textArray as textItem, textItemIndex (textItemIndex)}
|
|
70
|
+
<div
|
|
71
|
+
class="floorplan-plugin__text-wrapper"
|
|
72
|
+
class:floorplan-plugin__text-wrapper--is-left-or-top="{isLeft || isTop}"
|
|
73
|
+
class:floorplan-plugin__text-wrapper-is-right-or-bottom="{isRight || isBottom}"
|
|
74
|
+
style:left="{textItem.positionPx}px"
|
|
75
|
+
>
|
|
76
|
+
<span class="floorplan-plugin__rule-text" class:is-row="{isRow}">
|
|
77
|
+
{textItem.distance}
|
|
78
|
+
</span>
|
|
79
|
+
</div>
|
|
80
|
+
{/each}
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<style>
|
|
84
|
+
.floorplan-plugin__rule-labels {
|
|
85
|
+
position: absolute;
|
|
86
|
+
height: 5px;
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
}
|
|
90
|
+
.floorplan-plugin__rule-labels-top {
|
|
91
|
+
left: 0;
|
|
92
|
+
top: 0;
|
|
93
|
+
}
|
|
94
|
+
.floorplan-plugin__rule-labels-bottom {
|
|
95
|
+
left: 0;
|
|
96
|
+
bottom: 0;
|
|
97
|
+
}
|
|
98
|
+
.floorplan-plugin__rule-labels-left {
|
|
99
|
+
bottom: 0;
|
|
100
|
+
left: 0;
|
|
101
|
+
}
|
|
102
|
+
.floorplan-plugin__rule-labels-right {
|
|
103
|
+
bottom: 0;
|
|
104
|
+
right: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.floorplan-plugin__rule-line {
|
|
108
|
+
background: #fff;
|
|
109
|
+
opacity: 0.05;
|
|
110
|
+
width: 100%;
|
|
111
|
+
height: 1px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.floorplan-plugin__rule-scale {
|
|
115
|
+
position: absolute;
|
|
116
|
+
background: #fff;
|
|
117
|
+
opacity: 0.05;
|
|
118
|
+
transform-origin: center;
|
|
119
|
+
width: 1px;
|
|
120
|
+
height: 5px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.floorplan-plugin__text-wrapper {
|
|
124
|
+
width: 0;
|
|
125
|
+
height: 0;
|
|
126
|
+
position: absolute;
|
|
127
|
+
}
|
|
128
|
+
.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper--is-left-or-top {
|
|
129
|
+
top: 10px;
|
|
130
|
+
}
|
|
131
|
+
.floorplan-plugin__text-wrapper.floorplan-plugin__text-wrapper-is-right-or-bottom {
|
|
132
|
+
bottom: 10px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.floorplan-plugin__rule-text {
|
|
136
|
+
position: absolute;
|
|
137
|
+
width: max-content;
|
|
138
|
+
display: block;
|
|
139
|
+
transform: translate(-50%, -50%) rotate(180deg);
|
|
140
|
+
font-size: 10px;
|
|
141
|
+
color: #fff;
|
|
142
|
+
opacity: 0.2;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.floorplan-plugin__rule-text.is-row {
|
|
146
|
+
transform: translate(-50%, -50%);
|
|
147
|
+
}
|
|
148
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":"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","names":[],"sources":["RuleItem.svelte"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script>import RuleItem from './RuleItem.svelte';
|
|
2
|
+
export let pxmm;
|
|
3
|
+
export let floorIndex;
|
|
4
|
+
export let floorplanData;
|
|
5
|
+
$: bounding = floorplanData.bounding;
|
|
6
|
+
$: ruleLabelData = floorplanData.floorDatas[floorIndex].rules;
|
|
7
|
+
$: ruleLabelDataKeys = Object.keys(ruleLabelData);
|
|
8
|
+
$: ruleLabelArray = ruleLabelDataKeys.map((key) => [key, ruleLabelData[key]]);
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div class="floorplan-plugin__rulelabels">
|
|
12
|
+
{#each ruleLabelArray as [type, data] (type)}
|
|
13
|
+
<RuleItem {...{ type, data, pxmm, bounding }} />
|
|
14
|
+
{/each}
|
|
15
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":"AAAA,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;;;;;;;;AAYjB,CAAC,CAAC,MAAM;;AAER,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,kBAAkB,CAAC;AACzC,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9C,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACnD,EAAE,CAAC,CAAC,IAAI;AACR,CAAC,CAAC,GAAG;","names":[],"sources":["RuleLabels.svelte"]}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { Five, Subscribe } from '@realsee/five';
|
|
3
|
-
import { FloorplanEventHandlers } from './typings/events.type';
|
|
4
|
-
import { FloorplanServerData } from '../typings/floorplanServerData';
|
|
5
|
-
import { FloorplanRoomItem } from '../typings/floorplanData';
|
|
2
|
+
import type { FloorplanEventHandlers } from './typings/events.type';
|
|
3
|
+
import type { FloorplanServerData } from '../typings/floorplanServerData';
|
|
4
|
+
import type { FloorplanRoomItem } from '../typings/floorplanData';
|
|
6
5
|
export interface ModelFloorplanParameterType {
|
|
7
6
|
selector?: string | Element;
|
|
8
7
|
scale?: number;
|
|
8
|
+
modelOpacity?: number;
|
|
9
9
|
autoShowEnable?: boolean;
|
|
10
10
|
hoverEnable?: boolean;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
compassEnable?: boolean;
|
|
12
|
+
ruleLabelsEnable?: boolean;
|
|
13
|
+
roomLabelsEnable?: boolean;
|
|
14
|
+
cameraImageUrl?: string;
|
|
14
15
|
getLabelElement?: (room: FloorplanRoomItem) => Element | null;
|
|
15
16
|
}
|
|
16
17
|
export declare type ModelFloorplanPluginsConfigs = Omit<ModelFloorplanParameterType, 'selector' | 'scale'>;
|
|
@@ -18,7 +19,7 @@ export interface ModelFloorplanPluginsShowOpts {
|
|
|
18
19
|
floorIndex?: number;
|
|
19
20
|
isAutoShow?: boolean;
|
|
20
21
|
modelOpacity?: number;
|
|
21
|
-
|
|
22
|
+
immediately?: boolean;
|
|
22
23
|
userAction?: boolean;
|
|
23
24
|
}
|
|
24
25
|
export declare const MODEL_FLOORPLAN_PLUGIN_NAME = "modelFloorplanPlugin";
|
|
@@ -33,6 +34,7 @@ export default class ModelFloorplanPluginController {
|
|
|
33
34
|
width: number;
|
|
34
35
|
height: number;
|
|
35
36
|
};
|
|
37
|
+
private app?;
|
|
36
38
|
private pxmm;
|
|
37
39
|
private five;
|
|
38
40
|
private panoIndex;
|
|
@@ -64,15 +66,15 @@ export default class ModelFloorplanPluginController {
|
|
|
64
66
|
* 5. 如果多次调用 show 方法,参数与上次参数不一致时,上次 show Promise 会被 reject
|
|
65
67
|
* @param opts.floorIndex 楼层
|
|
66
68
|
* @param opts.modelOpacity 模型透明度
|
|
67
|
-
* @param opts.
|
|
69
|
+
* @param opts.immediately 是否立即展示
|
|
68
70
|
* @param opts.isAutoShow 是否是自动展示
|
|
69
71
|
*/
|
|
70
|
-
show: (opts?: ModelFloorplanPluginsShowOpts
|
|
72
|
+
show: (opts?: ModelFloorplanPluginsShowOpts) => Promise<boolean>;
|
|
71
73
|
/** 隐藏户型图 */
|
|
72
74
|
hide: (options?: {
|
|
73
|
-
isAutoHide?: boolean
|
|
74
|
-
userAction?: boolean
|
|
75
|
-
}
|
|
75
|
+
isAutoHide?: boolean;
|
|
76
|
+
userAction?: boolean;
|
|
77
|
+
}) => boolean;
|
|
76
78
|
/** 更改户型图楼层 */
|
|
77
79
|
changeFloor(floorIndex: number): void;
|
|
78
80
|
changeConfigs(params: ModelFloorplanPluginsConfigs): void;
|
|
@@ -81,7 +83,7 @@ export default class ModelFloorplanPluginController {
|
|
|
81
83
|
private handleModelLoaded;
|
|
82
84
|
private handleClick;
|
|
83
85
|
private handleWantsTapGesture;
|
|
84
|
-
/** 从 Panorama
|
|
86
|
+
/** 从 Panorama 切换到其他模态时,记录当前的相机水平视角 */
|
|
85
87
|
private handleWantsChangeMode;
|
|
86
88
|
/** 监听模型态变化,只有在模型态才进行手势动作监听 */
|
|
87
89
|
private handleModeChange;
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import Main from './Components/Main.svelte';
|
|
2
|
+
import to from '../../shared-utils/to';
|
|
3
|
+
import formatData from '../utils/formatData';
|
|
4
|
+
import equal from '../../shared-utils/equal';
|
|
5
|
+
import getPxmm from '../../shared-utils/getPxmm';
|
|
6
|
+
import correctFiveState, { checkShowState } from './utils/correctFiveState';
|
|
7
|
+
import changeModelCanvasOpacity from '../../shared-utils/changeModelCanvasOpacity';
|
|
8
|
+
import { omit } from '../../shared-utils/filter';
|
|
9
|
+
import { Subscribe } from '@realsee/five';
|
|
10
|
+
import { FloorplanErrorType, FIVE_CAMERA_DEFAULT_FOV, SHOW_ANIME_DURATION } from './utils/constant';
|
|
11
|
+
export const MODEL_FLOORPLAN_PLUGIN_NAME = 'modelFloorplanPlugin';
|
|
12
|
+
export default class ModelFloorplanPluginController {
|
|
13
|
+
name = MODEL_FLOORPLAN_PLUGIN_NAME;
|
|
14
|
+
/** 用于绑定事件钩子 */
|
|
15
|
+
hooks;
|
|
16
|
+
/** 展示状态 */
|
|
17
|
+
visible = false;
|
|
18
|
+
/** 户型图大小 */
|
|
19
|
+
size = { width: 0, height: 0 };
|
|
20
|
+
app = undefined;
|
|
21
|
+
pxmm = 0;
|
|
22
|
+
five;
|
|
23
|
+
panoIndex = 0;
|
|
24
|
+
floorIndex = 0;
|
|
25
|
+
configs = {};
|
|
26
|
+
lastPanoramaLongitude = 0;
|
|
27
|
+
selector;
|
|
28
|
+
floorplanData;
|
|
29
|
+
wrapper;
|
|
30
|
+
container = document.createElement('div');
|
|
31
|
+
showState;
|
|
32
|
+
/** 记录上次 show 的参数,如果不一致,需要 reject 掉正在进行的 showPromise */
|
|
33
|
+
ModelFloorplanPluginsShowOpts;
|
|
34
|
+
showPromise;
|
|
35
|
+
showRejection;
|
|
36
|
+
constructor(five, params) {
|
|
37
|
+
this.five = five;
|
|
38
|
+
this.hooks = new Subscribe();
|
|
39
|
+
this.selector = params.selector;
|
|
40
|
+
this.configs = omit(params, ['selector']);
|
|
41
|
+
this.showState = { longitude: 0, latitude: Math.PI / 2, fov: FIVE_CAMERA_DEFAULT_FOV / (params?.scale ?? 1) };
|
|
42
|
+
// 设置 container 样式
|
|
43
|
+
this.container.classList.add('floorplan-plugin');
|
|
44
|
+
Object.assign(this.container.style, {
|
|
45
|
+
position: 'absolute',
|
|
46
|
+
left: '50%',
|
|
47
|
+
top: '50%',
|
|
48
|
+
transform: 'translate(-50%, -50%)',
|
|
49
|
+
pointerEvents: 'none',
|
|
50
|
+
zIndex: 10,
|
|
51
|
+
});
|
|
52
|
+
// 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
|
|
53
|
+
this.five.model.loaded ? this.handleModelLoaded() : five.once('modelLoaded', this.handleModelLoaded);
|
|
54
|
+
five.once('dispose', this.dispose);
|
|
55
|
+
five.on('modeChange', this.handleModeChange);
|
|
56
|
+
five.on('panGesture', this.handlePanGesture);
|
|
57
|
+
five.on('panoArrived', this.handlePanoArrived);
|
|
58
|
+
five.on('wantsChangeMode', this.handleWantsChangeMode);
|
|
59
|
+
five.on('wantsInteriaPan', this.handleWantsInteriaPan);
|
|
60
|
+
five.on('modelShownFloorChange', this.onModelShownFloorChange);
|
|
61
|
+
}
|
|
62
|
+
dispose = () => {
|
|
63
|
+
const five = this.five;
|
|
64
|
+
this.hide();
|
|
65
|
+
this.app?.$destroy();
|
|
66
|
+
this.container?.remove();
|
|
67
|
+
five.off('modelLoaded', this.handleModelLoaded);
|
|
68
|
+
five.off('modeChange', this.handleModeChange);
|
|
69
|
+
five.off('panGesture', this.handlePanGesture);
|
|
70
|
+
five.off('panoArrived', this.handlePanoArrived);
|
|
71
|
+
five.off('wantsChangeMode', this.handleWantsChangeMode);
|
|
72
|
+
five.off('wantsInteriaPan', this.handleWantsInteriaPan);
|
|
73
|
+
five.off('wantsTapGesture', this.handleWantsTapGesture);
|
|
74
|
+
five.off('modelShownFloorChange', this.onModelShownFloorChange);
|
|
75
|
+
};
|
|
76
|
+
/** 加载户型图数据 */
|
|
77
|
+
async load(data) {
|
|
78
|
+
const copyData = JSON.parse(JSON.stringify(data));
|
|
79
|
+
this.floorplanData = await formatData(copyData);
|
|
80
|
+
this.render();
|
|
81
|
+
}
|
|
82
|
+
/** 把插件的渲染DOM插入到对应的容器中去 */
|
|
83
|
+
appendTo(wrapper) {
|
|
84
|
+
this.wrapper = wrapper;
|
|
85
|
+
wrapper.appendChild(this.container);
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
/** 更新户型图大小 */
|
|
89
|
+
updateSize = () => {
|
|
90
|
+
if (!this.floorplanData)
|
|
91
|
+
return;
|
|
92
|
+
if (!checkShowState(this.five, this.showState))
|
|
93
|
+
return;
|
|
94
|
+
if (!this.container || !this.wrapper)
|
|
95
|
+
return;
|
|
96
|
+
// 计算户型图展示大小
|
|
97
|
+
const { min, max } = this.floorplanData.bounding;
|
|
98
|
+
const width = max.x - min.x;
|
|
99
|
+
const height = max.y - min.y;
|
|
100
|
+
// 每毫米对应的 px 值
|
|
101
|
+
const pxmm = getPxmm(this.five, this.wrapper);
|
|
102
|
+
const _width = Math.ceil(width * pxmm);
|
|
103
|
+
const _height = Math.ceil(height * pxmm);
|
|
104
|
+
if (this.size.width === _width && this.size.height === _height)
|
|
105
|
+
return;
|
|
106
|
+
this.pxmm = pxmm;
|
|
107
|
+
this.size = { width: _width, height: _height };
|
|
108
|
+
this.container.style.width = _width + 'px';
|
|
109
|
+
this.container.style.height = _height + 'px';
|
|
110
|
+
};
|
|
111
|
+
/** 展示户型图
|
|
112
|
+
* 1. show 函数大部分情况下需要耗时
|
|
113
|
+
* 2. 如果当前已经在展示中,将不会触发任何事件
|
|
114
|
+
* 3. 如果展示过程被中断,将抛出错误
|
|
115
|
+
* 4. 多次调用 show 方法,只会触发一次 showAnimationEnded 事件,但是展示结果会取决于最后一次调用参数
|
|
116
|
+
* 5. 如果多次调用 show 方法,参数与上次参数不一致时,上次 show Promise 会被 reject
|
|
117
|
+
* @param opts.floorIndex 楼层
|
|
118
|
+
* @param opts.modelOpacity 模型透明度
|
|
119
|
+
* @param opts.immediately 是否立即展示
|
|
120
|
+
* @param opts.isAutoShow 是否是自动展示
|
|
121
|
+
*/
|
|
122
|
+
show = async (opts) => {
|
|
123
|
+
// 已经在展示中了
|
|
124
|
+
if (!this.showPromise && this.visible)
|
|
125
|
+
return true;
|
|
126
|
+
if (!this.five.model?.loaded)
|
|
127
|
+
throw new Error(FloorplanErrorType.ModelNotLoaded);
|
|
128
|
+
if (!this.floorplanData)
|
|
129
|
+
throw new Error(FloorplanErrorType.DataNotLoaded);
|
|
130
|
+
this.visible = true;
|
|
131
|
+
if (this.showPromise) {
|
|
132
|
+
const sameWithLastOpts = equal(opts, this.ModelFloorplanPluginsShowOpts, { deep: false });
|
|
133
|
+
if (!!this.showPromise && sameWithLastOpts)
|
|
134
|
+
return this.showPromise;
|
|
135
|
+
if (!!this.showPromise && !sameWithLastOpts)
|
|
136
|
+
this.showRejection?.(FloorplanErrorType.DifferentShowParams);
|
|
137
|
+
}
|
|
138
|
+
this.ModelFloorplanPluginsShowOpts = opts;
|
|
139
|
+
const getShowPromise = async () => {
|
|
140
|
+
let hasRejected = false;
|
|
141
|
+
let externalErrorMsg;
|
|
142
|
+
this.showRejection = (errorMsg) => {
|
|
143
|
+
hasRejected = true;
|
|
144
|
+
externalErrorMsg = errorMsg;
|
|
145
|
+
};
|
|
146
|
+
const [correctError] = await to(correctFiveState(this.five, this.showState, opts?.userAction));
|
|
147
|
+
if (correctError)
|
|
148
|
+
throw correctError;
|
|
149
|
+
// 异步结束要判断当前是不是被中断了,是不是调用了隐藏
|
|
150
|
+
if (hasRejected)
|
|
151
|
+
throw externalErrorMsg ? new Error(externalErrorMsg) : new Error(FloorplanErrorType.UnknownError);
|
|
152
|
+
if (!this.visible)
|
|
153
|
+
throw new Error(FloorplanErrorType.UnknownError);
|
|
154
|
+
// 更新户型图状态
|
|
155
|
+
this.visible = true;
|
|
156
|
+
// 更新户型图大小
|
|
157
|
+
this.updateSize();
|
|
158
|
+
// 高亮当前楼层,有两个目的
|
|
159
|
+
// 1. 点击模型时,可以跳转到当前楼层的点位上
|
|
160
|
+
// 2. 当前楼层比较小时,户型图也比较小,如果展示全部楼层,会展示户型图外有一圈模型
|
|
161
|
+
if (opts?.floorIndex)
|
|
162
|
+
this.floorIndex = opts.floorIndex;
|
|
163
|
+
this.five.model.show(this.floorIndex);
|
|
164
|
+
// 模型消失, 渲染户型图
|
|
165
|
+
const modelOpacity = opts?.modelOpacity ?? this.configs.modelOpacity ?? 1;
|
|
166
|
+
const renderDuration = opts?.immediately ? 0 : SHOW_ANIME_DURATION;
|
|
167
|
+
changeModelCanvasOpacity(this.five, modelOpacity, renderDuration);
|
|
168
|
+
this.render(renderDuration);
|
|
169
|
+
// 展示之后的事件监听
|
|
170
|
+
this.five.on('wantsGesture', this.handleWantsGesture);
|
|
171
|
+
this.five.on('wantsTapGesture', this.handleWantsTapGesture);
|
|
172
|
+
return true;
|
|
173
|
+
};
|
|
174
|
+
const showPromise = getShowPromise()
|
|
175
|
+
.then(() => {
|
|
176
|
+
this.hooks.emit('showAnimationEnded', { auto: !!opts?.isAutoShow, userAction: opts?.userAction ?? true });
|
|
177
|
+
return true;
|
|
178
|
+
})
|
|
179
|
+
.catch((error) => {
|
|
180
|
+
// 自动展示的报错内部处理
|
|
181
|
+
if (opts?.isAutoShow)
|
|
182
|
+
return false;
|
|
183
|
+
if (!(error instanceof Error))
|
|
184
|
+
return false;
|
|
185
|
+
// 非自动展示的报错继续向外抛出
|
|
186
|
+
throw error;
|
|
187
|
+
})
|
|
188
|
+
.finally(() => {
|
|
189
|
+
this.showPromise = undefined;
|
|
190
|
+
this.showRejection = undefined;
|
|
191
|
+
});
|
|
192
|
+
this.showPromise = showPromise;
|
|
193
|
+
return showPromise;
|
|
194
|
+
};
|
|
195
|
+
/** 隐藏户型图 */
|
|
196
|
+
hide = (options) => {
|
|
197
|
+
if (this.size.width === 0)
|
|
198
|
+
return true;
|
|
199
|
+
if (this.visible === false)
|
|
200
|
+
return true;
|
|
201
|
+
const isAutoHide = !!options?.isAutoHide;
|
|
202
|
+
this.five.off('wantsGesture', this.handleWantsGesture);
|
|
203
|
+
this.five.off('wantsTapGesture', this.handleWantsTapGesture);
|
|
204
|
+
this.visible = false;
|
|
205
|
+
this.showRejection?.(FloorplanErrorType.BreakOffByHide);
|
|
206
|
+
changeModelCanvasOpacity(this.five, 1, 0);
|
|
207
|
+
this.render();
|
|
208
|
+
this.hooks.emit('hide', { auto: isAutoHide, userAction: options?.userAction ?? true });
|
|
209
|
+
return true;
|
|
210
|
+
};
|
|
211
|
+
/** 更改户型图楼层 */
|
|
212
|
+
changeFloor(floorIndex) {
|
|
213
|
+
this.five.model.show(floorIndex);
|
|
214
|
+
this.floorIndex = floorIndex;
|
|
215
|
+
this.render();
|
|
216
|
+
}
|
|
217
|
+
changeConfigs(params) {
|
|
218
|
+
Object.assign(this.configs, params);
|
|
219
|
+
if (!this.container)
|
|
220
|
+
return;
|
|
221
|
+
this.render();
|
|
222
|
+
}
|
|
223
|
+
/** 模型楼层高亮改变时,自动进行楼层切换 */
|
|
224
|
+
onModelShownFloorChange = (shownFloor) => {
|
|
225
|
+
if (shownFloor === null)
|
|
226
|
+
return;
|
|
227
|
+
this.floorIndex = shownFloor;
|
|
228
|
+
this.render();
|
|
229
|
+
};
|
|
230
|
+
handleModelLoaded = () => {
|
|
231
|
+
if (this.wrapper)
|
|
232
|
+
return;
|
|
233
|
+
if (!this.selector)
|
|
234
|
+
return;
|
|
235
|
+
const wrapper = this.selector instanceof Element ? this.selector : document.querySelector(this.selector);
|
|
236
|
+
if (!wrapper)
|
|
237
|
+
throw new Error('不正确的父容器选择器');
|
|
238
|
+
this.wrapper = wrapper;
|
|
239
|
+
wrapper.append(this.container);
|
|
240
|
+
};
|
|
241
|
+
handleClick = () => {
|
|
242
|
+
if (!this.visible)
|
|
243
|
+
return;
|
|
244
|
+
const prevented = this.hooks.emit('click');
|
|
245
|
+
if (prevented)
|
|
246
|
+
return false;
|
|
247
|
+
};
|
|
248
|
+
handleWantsTapGesture = () => this.handleClick();
|
|
249
|
+
/** 从 Panorama 切换到其他模态时,记录当前的相机水平视角 */
|
|
250
|
+
handleWantsChangeMode = (mode) => {
|
|
251
|
+
if (mode !== 'Panorama') {
|
|
252
|
+
this.lastPanoramaLongitude = this.five.getCurrentState().longitude;
|
|
253
|
+
}
|
|
254
|
+
if (mode !== 'Floorplan')
|
|
255
|
+
this.hide();
|
|
256
|
+
};
|
|
257
|
+
/** 监听模型态变化,只有在模型态才进行手势动作监听 */
|
|
258
|
+
handleModeChange = (mode) => {
|
|
259
|
+
if (mode === 'Floorplan') {
|
|
260
|
+
this.five.on('panGesture', this.handlePanGesture);
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
this.hide();
|
|
264
|
+
this.five.off('panGesture', this.handlePanGesture);
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
/** panoIndex 改变时,更新 floorIndex */
|
|
268
|
+
handlePanoArrived = (index) => {
|
|
269
|
+
if (!this.five?.work)
|
|
270
|
+
return;
|
|
271
|
+
this.panoIndex = index;
|
|
272
|
+
this.floorIndex = this.five.work.observers[index].floorIndex;
|
|
273
|
+
};
|
|
274
|
+
/** 当户型图正在展示中的时候禁用惯性 */
|
|
275
|
+
handleWantsInteriaPan = () => {
|
|
276
|
+
if (this.visible)
|
|
277
|
+
return false;
|
|
278
|
+
};
|
|
279
|
+
/** 在户型图展示时阻止多指操作, 阻止鼠标放大 */
|
|
280
|
+
handleWantsGesture = (type, pointers) => {
|
|
281
|
+
if (!this.visible)
|
|
282
|
+
return;
|
|
283
|
+
if (pointers.length > 1)
|
|
284
|
+
return false;
|
|
285
|
+
if (type === 'mouseWheel')
|
|
286
|
+
return false;
|
|
287
|
+
};
|
|
288
|
+
/** 监听三维模型滑动
|
|
289
|
+
* 1. 在三维模型转动结束时,如果达到设置的阈值,会自动切换到户型图
|
|
290
|
+
* 2. 如何户型图已经展示,滑动时关闭户型图
|
|
291
|
+
*/
|
|
292
|
+
handlePanGesture = async ({ latitude, longitude }, isFinal) => {
|
|
293
|
+
if (this.configs.autoShowEnable === false)
|
|
294
|
+
return;
|
|
295
|
+
// 如果操作结束后,户型图还在展示中,初始化模型状态
|
|
296
|
+
if (isFinal && this.visible)
|
|
297
|
+
return this.five.setState(this.showState, true);
|
|
298
|
+
// 满足消失的条件:
|
|
299
|
+
// 水平旋转角大于正负 5 度 || 俯仰角度大于 5 度
|
|
300
|
+
const latitudeHide = Math.abs(latitude - Math.PI / 2) > (5 * Math.PI) / 180;
|
|
301
|
+
const longitudeHide = longitude > 5 * (Math.PI / 180) && longitude < 355 * (Math.PI / 180);
|
|
302
|
+
const canHide = latitudeHide || longitudeHide;
|
|
303
|
+
if (this.visible && canHide)
|
|
304
|
+
return this.hide({ isAutoHide: true });
|
|
305
|
+
if (this.five.camera.fov / FIVE_CAMERA_DEFAULT_FOV < 0.8)
|
|
306
|
+
return;
|
|
307
|
+
// 户型图展示条件:
|
|
308
|
+
// 水平旋转角正负 30 度 && 俯仰角度小于 10 度
|
|
309
|
+
const latitudeVisible = Math.abs(latitude - Math.PI / 2) < (10 * Math.PI) / 180;
|
|
310
|
+
const longitudeVisible = longitude < 30 * (Math.PI / 180) || longitude > 330 * (Math.PI / 180);
|
|
311
|
+
if (isFinal && !this.visible && latitudeVisible && longitudeVisible) {
|
|
312
|
+
// 当手指离开时需要等惯性结束之后在进行判断
|
|
313
|
+
const handleInteriaPan = async (any, isFinal) => {
|
|
314
|
+
if (!isFinal)
|
|
315
|
+
return;
|
|
316
|
+
this.five.off('interiaPan', handleInteriaPan);
|
|
317
|
+
await this.show({ isAutoShow: true });
|
|
318
|
+
};
|
|
319
|
+
this.five.on('interiaPan', handleInteriaPan);
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
render(duration) {
|
|
324
|
+
if (!this.container || !this.floorplanData)
|
|
325
|
+
return;
|
|
326
|
+
if (this.size.width === 0)
|
|
327
|
+
return;
|
|
328
|
+
const { hoverEnable, cameraImageUrl, getLabelElement, roomLabelsEnable, compassEnable, ruleLabelsEnable } = this.configs;
|
|
329
|
+
const props = {
|
|
330
|
+
five: this.five,
|
|
331
|
+
pxmm: this.pxmm,
|
|
332
|
+
cameraImageUrl,
|
|
333
|
+
visible: this.visible,
|
|
334
|
+
duration: duration ?? 0,
|
|
335
|
+
panoIndex: this.panoIndex,
|
|
336
|
+
floorIndex: this.floorIndex,
|
|
337
|
+
floorplanData: this.floorplanData,
|
|
338
|
+
hoverEnable: hoverEnable ?? false,
|
|
339
|
+
compassEnable: compassEnable ?? true,
|
|
340
|
+
ruleLabelsEnable: ruleLabelsEnable ?? true,
|
|
341
|
+
roomLabelsEnable: roomLabelsEnable ?? true,
|
|
342
|
+
lastPanoramaLongitude: this.lastPanoramaLongitude,
|
|
343
|
+
getLabelElement,
|
|
344
|
+
onRoomHeightClick: this.handleClick,
|
|
345
|
+
};
|
|
346
|
+
if (!this.app) {
|
|
347
|
+
this.app = new Main({
|
|
348
|
+
target: this.container,
|
|
349
|
+
intro: true,
|
|
350
|
+
props,
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
this.app.$set(props);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FivePlugin } from '@realsee/five';
|
|
1
|
+
import type { FivePlugin } from '@realsee/five';
|
|
2
2
|
import FloorplanPluginController, { ModelFloorplanParameterType } from './Controller';
|
|
3
3
|
export declare const ModelFloorplanPlugin: FivePlugin<ModelFloorplanParameterType, ModelFloorplanPluginReturnType>;
|
|
4
4
|
export default ModelFloorplanPlugin;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export var FloorplanErrorType;
|
|
2
|
+
(function (FloorplanErrorType) {
|
|
3
|
+
FloorplanErrorType["UnknownError"] = "UnknowError";
|
|
4
|
+
FloorplanErrorType["DataNotLoaded"] = "DataNotLoaded";
|
|
5
|
+
FloorplanErrorType["BreakOffByHide"] = "BreakOffByHide";
|
|
6
|
+
FloorplanErrorType["ModelNotLoaded"] = "ModelNotLoaded";
|
|
7
|
+
FloorplanErrorType["ChangeModeError"] = "ChangeModeError";
|
|
8
|
+
FloorplanErrorType["UpdateCameraError"] = "UpdateCameraError";
|
|
9
|
+
FloorplanErrorType["DifferentShowParams"] = "DifferentShowParams";
|
|
10
|
+
})(FloorplanErrorType || (FloorplanErrorType = {}));
|
|
11
|
+
/** 户型图展示 & 模型消失的默认时间 */
|
|
12
|
+
export const SHOW_ANIME_DURATION = 500;
|
|
13
|
+
/** Five camera 默认 fov */
|
|
14
|
+
export const FIVE_CAMERA_DEFAULT_FOV = 80;
|
|
15
|
+
/** 展示户型图时,默认模型的透明度 */
|
|
16
|
+
export const DEFAULT_SHOW_MODEL_OPACITY = 0.01;
|
|
File without changes
|