@realsee/dnalogel 2.0.0-alpha.9 → 2.0.0-beta.36
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 +78 -28
- package/components/index.js +1450 -0
- package/dist/CSS3DRenderPlugin/Plugin.d.ts +49 -0
- package/dist/CSS3DRenderPlugin/index.d.ts +3 -48
- package/dist/CSS3DRenderPlugin/index.js +27 -26
- package/dist/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
- package/dist/CameraMovementPlugin/index.d.ts +4 -6
- package/dist/CameraMovementPlugin/index.js +12 -12
- package/dist/CameraMovementPlugin/typing.d.ts +1 -1
- package/dist/ItemLabelPlugin/Plugin.d.ts +4 -0
- package/dist/ItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ItemLabelPlugin/index.d.ts +9 -0
- package/dist/ItemLabelPlugin/index.js +941 -0
- package/dist/ItemLabelPlugin/typings.d.ts +59 -0
- package/dist/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
- package/dist/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
- package/dist/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
- package/dist/ItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
- package/dist/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
- package/dist/ModelChassisCompassPlugin/index.d.ts +3 -18
- package/dist/ModelChassisCompassPlugin/index.js +8 -5
- package/dist/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
- package/dist/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
- package/dist/ModelEntryDoorGuidePlugin/index.js +20 -20
- package/dist/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
- package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.js +674 -0
- package/dist/ModelItemLabelPlugin/typings.d.ts +56 -0
- package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelRoomLabelPlugin/index.js +153 -73
- package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
- package/dist/ModelTVVideoPlugin/Plugin.d.ts +4 -0
- package/dist/ModelTVVideoPlugin/index.d.ts +5 -0
- package/dist/ModelTVVideoPlugin/index.js +301 -0
- package/dist/ModelTVVideoPlugin/typings.d.ts +25 -0
- package/dist/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
- package/dist/ModelViewPlugin/Plugin.d.ts +17 -0
- package/dist/ModelViewPlugin/index.d.ts +3 -16
- package/dist/PanoCompassPlugin/Plugin.d.ts +47 -0
- package/dist/PanoCompassPlugin/index.d.ts +4 -47
- package/dist/PanoCompassPlugin/index.js +242 -129
- package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
- package/dist/PanoCursorRaycasterPlugin/index.js +5 -3
- package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +12 -9
- package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
- package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +2 -1
- package/dist/PanoMeasurePlugin/Controller/index.d.ts +18 -9
- package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
- package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +5 -2
- package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +50 -15
- package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +5 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
- package/dist/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
- package/dist/PanoMeasurePlugin/index.d.ts +9 -6
- package/dist/PanoMeasurePlugin/index.js +2649 -3442
- package/dist/PanoMeasurePlugin/typings/data.d.ts +4 -0
- package/dist/PanoMeasurePlugin/typings/event.type.d.ts +14 -5
- package/dist/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
- package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
- package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
- package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
- package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
- package/dist/PanoRulerPlugin/Plugin.d.ts +31 -0
- package/dist/PanoRulerPlugin/index.d.ts +4 -30
- package/dist/PanoRulerPlugin/index.js +12 -12
- package/dist/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
- package/dist/PanoSpatialTagPlugin/index.d.ts +5 -0
- package/dist/PanoSpatialTagPlugin/index.js +1307 -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/base/BasePlugin.d.ts +100 -0
- package/dist/base/BasePluginWithData.d.ts +34 -0
- package/dist/components/PaintBrush/Controller.d.ts +43 -0
- package/dist/components/PaintBrush/Subscribe.d.ts +76 -0
- package/dist/components/PaintBrush/index.d.ts +27 -0
- package/dist/components/PaintBrush/style.d.ts +2 -0
- package/dist/components/PaintBrush/tween.d.ts +62 -0
- package/dist/components/PaintBrush/typings.d.ts +58 -0
- package/dist/components/PaintBrush/utils.d.ts +26 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -77
- package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
- package/dist/floorplan/ModelFloorplanPlugin/index.js +2319 -1620
- package/dist/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +24 -16
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +601 -266
- package/dist/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +53 -47
- package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +6 -4
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +2198 -1428
- package/dist/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
- package/dist/floorplan/index.d.ts +6 -0
- package/dist/floorplan/utils/constant.d.ts +22 -0
- package/dist/floorplan/utils/correctFiveState.d.ts +15 -0
- package/dist/floorplan/utils/formatPosition.d.ts +1 -1
- package/dist/index.d.ts +15 -24
- package/dist/index.es.js +10694 -7145
- package/dist/index.js +10432 -6869
- package/dist/index.umd.js +10435 -6875
- package/dist/shared-utils/five/changeMode.d.ts +4 -1
- package/dist/shared-utils/getPxmm.d.ts +8 -0
- package/dist/shared-utils/index.d.ts +1 -0
- package/dist/shared-utils/math/Interval.d.ts +13 -0
- package/dist/shared-utils/math/Rectangle.d.ts +27 -0
- package/dist/shared-utils/math/index.d.ts +2 -0
- package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
- package/dist/shared-utils/three/getNormal.d.ts +1 -1
- package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
- package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
- package/dist/shared-utils/tinyEJSrender.d.ts +5 -0
- package/dist/shared-utils/uuid.d.ts +1 -0
- package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Magnifier.html +9 -0
- package/docs/classes/ModelRoomLabelController.html +5 -8
- package/docs/enums/CameraMovementEffect.html +3 -0
- package/docs/enums/DIRECTION.html +1 -0
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -0
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -0
- package/docs/enums/Rotation.html +3 -0
- package/docs/index.html +78 -33
- package/docs/interfaces/CSS3DRenderPluginExportType.html +4 -0
- package/docs/interfaces/CameraMovementPluginExportType.html +17 -0
- package/docs/interfaces/FloorplanBounding.html +10 -0
- package/docs/interfaces/FloorplanData.html +3 -0
- package/docs/interfaces/FloorplanEntrance.html +15 -0
- package/docs/interfaces/FloorplanExtraObject.html +7 -0
- package/docs/interfaces/FloorplanExtraObject3D.html +3 -0
- package/docs/interfaces/FloorplanFloorData.html +3 -0
- package/docs/interfaces/FloorplanImagePosition.html +3 -0
- package/docs/interfaces/FloorplanObserver.html +5 -0
- package/docs/interfaces/FloorplanOutlineItem.html +3 -0
- package/docs/interfaces/FloorplanPosition.html +3 -0
- package/docs/interfaces/FloorplanRoomItem.html +17 -0
- package/docs/interfaces/FloorplanRoomLabelItem.html +7 -0
- package/docs/interfaces/FloorplanServerBounding.html +10 -0
- package/docs/interfaces/FloorplanServerComputedData.html +1 -0
- package/docs/interfaces/FloorplanServerData.html +3 -0
- package/docs/interfaces/FloorplanServerEntrance.html +15 -0
- package/docs/interfaces/FloorplanServerFloorData.html +3 -0
- package/docs/interfaces/FloorplanServerImagePosition.html +3 -0
- package/docs/interfaces/FloorplanServerObserver.html +5 -0
- package/docs/interfaces/FloorplanServerOutlineItem.html +3 -0
- package/docs/interfaces/FloorplanServerPosition.html +3 -0
- package/docs/interfaces/FloorplanServerRoomItem.html +20 -0
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -0
- package/docs/interfaces/ItemLabelPluginData.html +1 -0
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -0
- package/docs/interfaces/ItemLabelPluginParametersType.html +1 -0
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -0
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -0
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -0
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -0
- package/docs/interfaces/ModelViewPluginExportType.html +1 -0
- package/docs/interfaces/OpenParameter.html +3 -0
- package/docs/interfaces/PanoCompassPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -0
- package/docs/interfaces/PanoMeasureParameterType.html +1 -0
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -0
- package/docs/interfaces/Point.html +1 -0
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/Room.html +1 -0
- package/docs/interfaces/RoomInfo.html +1 -0
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/RoomRules.html +1 -0
- package/docs/interfaces/Rooms.html +1 -0
- package/docs/modules.html +26 -18
- package/libs/CSS3DRenderPlugin/Plugin.d.ts +49 -0
- package/libs/CSS3DRenderPlugin/Plugin.js +182 -0
- package/libs/CSS3DRenderPlugin/index.d.ts +3 -48
- package/libs/CSS3DRenderPlugin/index.js +2 -180
- package/libs/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
- package/libs/CameraMovementPlugin/CameraMovementPlugin.js +159 -0
- package/libs/CameraMovementPlugin/index.d.ts +4 -6
- package/libs/CameraMovementPlugin/index.js +3 -158
- package/libs/CameraMovementPlugin/typing.d.ts +1 -1
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +577 -0
- package/libs/ItemLabelPlugin/ItemLabelItem.js +227 -0
- package/libs/ItemLabelPlugin/Plugin.d.ts +4 -0
- package/libs/ItemLabelPlugin/Plugin.js +120 -0
- package/libs/ItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ItemLabelPlugin/events.type.js +1 -0
- package/libs/ItemLabelPlugin/index.d.ts +9 -0
- package/libs/ItemLabelPlugin/index.js +8 -0
- package/libs/ItemLabelPlugin/typings.d.ts +59 -0
- package/libs/ItemLabelPlugin/typings.js +7 -0
- package/libs/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
- package/libs/ItemLabelPlugin/utils/getLabelTransform.js +3 -0
- package/libs/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
- package/libs/ItemLabelPlugin/utils/getStrokeLength.js +16 -0
- package/libs/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
- package/libs/ItemLabelPlugin/utils/isImpacted.js +13 -0
- package/libs/ItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/libs/ItemLabelPlugin/utils/parseData.js +4 -0
- package/libs/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
- package/libs/ItemLabelPlugin/utils/transform2RenderData.js +4 -0
- package/libs/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
- package/libs/ModelChassisCompassPlugin/Plugin.js +77 -0
- package/libs/ModelChassisCompassPlugin/index.d.ts +3 -18
- package/libs/ModelChassisCompassPlugin/index.js +2 -74
- package/libs/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +140 -0
- package/libs/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
- package/libs/ModelEntryDoorGuidePlugin/index.js +2 -136
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +409 -0
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +120 -0
- package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/events.type.js +1 -0
- package/libs/ModelItemLabelPlugin/index.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/index.js +8 -0
- package/libs/ModelItemLabelPlugin/typings.d.ts +56 -0
- package/libs/ModelItemLabelPlugin/typings.js +7 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.js +4 -0
- package/libs/ModelRoomLabelPlugin/Controller.js +65 -23
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +83 -45
- package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
- package/libs/ModelSimulationPlugin/index.d.ts +33 -0
- package/libs/ModelSimulationPlugin/index.js +166 -0
- package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +2 -0
- package/libs/ModelSimulationPlugin/shaders/fragment.js +96 -0
- package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +2 -0
- package/libs/ModelSimulationPlugin/shaders/vertex.js +23 -0
- package/libs/ModelTVVideoPlugin/Plugin.d.ts +4 -0
- package/libs/ModelTVVideoPlugin/Plugin.js +254 -0
- package/libs/ModelTVVideoPlugin/index.d.ts +5 -0
- package/libs/ModelTVVideoPlugin/index.js +4 -0
- package/libs/ModelTVVideoPlugin/typings.d.ts +25 -0
- package/libs/ModelTVVideoPlugin/typings.js +8 -0
- package/libs/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
- package/libs/ModelTVVideoPlugin/utils/parseData.js +13 -0
- package/libs/ModelViewPlugin/Plugin.d.ts +17 -0
- package/libs/ModelViewPlugin/Plugin.js +160 -0
- package/libs/ModelViewPlugin/index.d.ts +3 -16
- package/libs/ModelViewPlugin/index.js +2 -159
- package/libs/PanoCompassPlugin/Plugin.d.ts +47 -0
- package/libs/PanoCompassPlugin/Plugin.js +249 -0
- package/libs/PanoCompassPlugin/index.d.ts +4 -47
- package/libs/PanoCompassPlugin/index.js +3 -167
- package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
- package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +12 -9
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +77 -14
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Controller/EditController.js +268 -155
- package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +337 -0
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
- package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +2 -1
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +246 -153
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +18 -9
- package/libs/PanoMeasurePlugin/Controller/index.js +182 -54
- package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/index.js +30 -5
- package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
- package/libs/PanoMeasurePlugin/Model/line.js +61 -11
- package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/point.js +24 -4
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
- package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +11 -14
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +5 -2
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +107 -25
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
- package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
- package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +50 -15
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +234 -59
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +84 -38
- package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.js +98 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
- package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +5 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +84 -34
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +80 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +11 -1
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +64 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +265 -0
- package/libs/PanoMeasurePlugin/index.d.ts +9 -6
- package/libs/PanoMeasurePlugin/index.js +3 -1
- package/libs/PanoMeasurePlugin/typings/data.d.ts +4 -0
- package/libs/PanoMeasurePlugin/typings/event.type.d.ts +14 -5
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +15 -0
- package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/constants.js +7 -7
- package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +22 -16
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/line.js +8 -7
- package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +5 -5
- package/libs/PanoRulerPlugin/Plugin.d.ts +31 -0
- package/libs/PanoRulerPlugin/Plugin.js +403 -0
- package/libs/PanoRulerPlugin/index.d.ts +4 -30
- package/libs/PanoRulerPlugin/index.js +2 -397
- package/libs/PanoSpatialTagPlugin/Components/origins.js +168 -0
- package/libs/PanoSpatialTagPlugin/Components/tag.js +302 -0
- package/libs/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
- package/libs/PanoSpatialTagPlugin/Plugin.js +426 -0
- package/libs/PanoSpatialTagPlugin/index.d.ts +5 -0
- package/libs/PanoSpatialTagPlugin/index.js +5 -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/base/BasePlugin.d.ts +100 -0
- package/libs/base/BasePlugin.js +31 -0
- package/libs/base/BasePluginWithData.d.ts +34 -0
- package/libs/base/BasePluginWithData.js +4 -0
- package/libs/components/PaintBrush/Controller.d.ts +43 -0
- package/libs/components/PaintBrush/Controller.js +575 -0
- package/libs/components/PaintBrush/Subscribe.d.ts +76 -0
- package/libs/components/PaintBrush/Subscribe.js +121 -0
- package/libs/components/PaintBrush/index.d.ts +27 -0
- package/libs/components/PaintBrush/index.js +57 -0
- package/libs/components/PaintBrush/style.d.ts +2 -0
- package/libs/components/PaintBrush/style.js +102 -0
- package/libs/components/PaintBrush/tween.d.ts +62 -0
- package/libs/components/PaintBrush/tween.js +15 -0
- package/libs/components/PaintBrush/typings.d.ts +58 -0
- package/libs/components/PaintBrush/typings.js +6 -0
- package/libs/components/PaintBrush/utils.d.ts +26 -0
- package/libs/components/PaintBrush/utils.js +51 -0
- package/libs/components/index.d.ts +2 -0
- package/libs/components/index.js +3 -0
- package/libs/floorplan/Assets/compass.d.ts +1 -0
- package/libs/floorplan/Assets/compass.js +1 -0
- package/libs/floorplan/Components/BaseImage.js +10 -5
- package/libs/floorplan/Components/Camera.js +120 -0
- package/libs/floorplan/Components/Compass.js +120 -0
- package/libs/floorplan/Components/CurrentFloor.js +469 -0
- package/libs/floorplan/Components/Main.js +470 -0
- package/libs/floorplan/Components/RoomHighlight/Room.js +45 -8
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +30 -103
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +322 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +309 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +30 -27
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +1 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +11 -9
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
- package/libs/floorplan/Components/RuleLabels/RuleLabels.js +269 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -77
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +661 -325
- package/libs/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
- package/libs/floorplan/ModelFloorplanPlugin/index.js +2 -2
- package/libs/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
- package/libs/floorplan/ModelFloorplanPlugin/typing.js +1 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +49 -33
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +3 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +114 -53
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +24 -16
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +194 -42
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +2 -2
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +1 -0
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +53 -47
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +450 -154
- package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +6 -4
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +2 -2
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
- package/libs/floorplan/TopviewFloorplanPlugin/typing.js +1 -0
- package/libs/floorplan/index.d.ts +6 -0
- package/libs/floorplan/index.js +7 -0
- package/libs/floorplan/utils/constant.d.ts +22 -0
- package/libs/floorplan/utils/constant.js +23 -0
- package/libs/floorplan/utils/correctFiveState.d.ts +15 -0
- package/libs/floorplan/utils/correctFiveState.js +46 -0
- package/libs/floorplan/utils/formatPosition.d.ts +1 -1
- package/libs/floorplan/utils/formatPosition.js +3 -3
- package/libs/index.d.ts +15 -24
- package/libs/index.js +25 -14
- package/libs/shared-utils/Subscribe.js +8 -1
- package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
- package/libs/shared-utils/createCanvasTextTexture.js +6 -5
- package/libs/shared-utils/five/changeMode.d.ts +4 -1
- package/libs/shared-utils/five/changeMode.js +34 -13
- package/libs/shared-utils/getPxmm.d.ts +8 -0
- package/libs/shared-utils/getPxmm.js +25 -20
- package/libs/shared-utils/index.d.ts +1 -0
- package/libs/shared-utils/index.js +1 -0
- package/libs/shared-utils/math/Interval.d.ts +13 -0
- package/libs/shared-utils/math/Interval.js +40 -0
- package/libs/shared-utils/math/Rectangle.d.ts +27 -0
- package/libs/shared-utils/math/Rectangle.js +50 -0
- package/libs/shared-utils/math/evenNumber.js +1 -1
- package/libs/shared-utils/math/index.d.ts +2 -0
- package/libs/shared-utils/math/index.js +2 -0
- package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
- package/libs/shared-utils/three/getNormal.d.ts +1 -1
- package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
- package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
- package/libs/shared-utils/tinyEJSrender.d.ts +5 -0
- package/libs/shared-utils/tinyEJSrender.js +210 -0
- package/libs/shared-utils/uuid.d.ts +1 -0
- package/libs/shared-utils/uuid.js +1 -0
- package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
- package/package.json +13 -6
- package/CHANGELOG.md +0 -30
- package/dist/shared-utils/five/useFivePlugin.d.ts +0 -1
- package/dist/shared-utils/useDebounce.d.ts +0 -8
- package/dist/shared-utils/useThrottle.d.ts +0 -8
- package/docs/enums/ModelFloorplanErrorType.html +0 -1
- package/docs/interfaces/ModelFloorplanParameterType.html +0 -1
- package/docs/interfaces/ModelFloorplanViewEvent.html +0 -5
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +0 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Subscribe } from "@realsee/five";
|
|
2
|
+
import type { PluginEvent } from "./events.type";
|
|
3
|
+
import type ItemLabelComponent from './ItemLabelComponent';
|
|
4
|
+
export declare enum DISPLAY_STRATEGY_TYPE {
|
|
5
|
+
SMALL = "small",
|
|
6
|
+
MIDLLE = "middle",
|
|
7
|
+
LARGE = "large",
|
|
8
|
+
EXTRA_LARGE = "x-large"
|
|
9
|
+
}
|
|
10
|
+
export interface ModelItemLabelPluginParametersType {
|
|
11
|
+
modelOcclusionEnable?: boolean;
|
|
12
|
+
displayStrategyType?: Partial<DISPLAY_STRATEGY_TYPE>;
|
|
13
|
+
}
|
|
14
|
+
export interface ModelItemLabelPluginData {
|
|
15
|
+
model_item_labels: Readonly<{
|
|
16
|
+
id: string;
|
|
17
|
+
library: string;
|
|
18
|
+
name: string;
|
|
19
|
+
size: [number, number, number];
|
|
20
|
+
center: [number, number, number];
|
|
21
|
+
position: [number, number, number];
|
|
22
|
+
type: string[];
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}>[];
|
|
25
|
+
}
|
|
26
|
+
export interface ItemLabel {
|
|
27
|
+
id: string;
|
|
28
|
+
library: string;
|
|
29
|
+
name: string;
|
|
30
|
+
size: [number, number, number];
|
|
31
|
+
center: [number, number, number];
|
|
32
|
+
position: [number, number, number];
|
|
33
|
+
type: string[];
|
|
34
|
+
modelPosition: [number, number, number];
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}
|
|
37
|
+
export interface ModelItemLabelPluginExportReturnsType {
|
|
38
|
+
appendTo: (wrapper: Element) => void;
|
|
39
|
+
load: (data: ModelItemLabelPluginData) => void;
|
|
40
|
+
disable: () => void;
|
|
41
|
+
enable: () => void;
|
|
42
|
+
dispose: () => void;
|
|
43
|
+
hooks: Subscribe<PluginEvent>;
|
|
44
|
+
}
|
|
45
|
+
export interface ModelItemLabelPluginState {
|
|
46
|
+
container: HTMLDivElement;
|
|
47
|
+
data: ModelItemLabelPluginData | null;
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
itemLabels: ItemLabel[];
|
|
50
|
+
wrapper: HTMLElement | null;
|
|
51
|
+
fiveModeEnabled: boolean;
|
|
52
|
+
app?: ItemLabelComponent | undefined;
|
|
53
|
+
hooks: Subscribe<PluginEvent>;
|
|
54
|
+
modelOcclusionEnable: boolean;
|
|
55
|
+
displayStrategyType: Partial<DISPLAY_STRATEGY_TYPE>;
|
|
56
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export var DISPLAY_STRATEGY_TYPE;
|
|
2
|
+
(function (DISPLAY_STRATEGY_TYPE) {
|
|
3
|
+
DISPLAY_STRATEGY_TYPE["SMALL"] = "small";
|
|
4
|
+
DISPLAY_STRATEGY_TYPE["MIDLLE"] = "middle";
|
|
5
|
+
DISPLAY_STRATEGY_TYPE["LARGE"] = "large";
|
|
6
|
+
DISPLAY_STRATEGY_TYPE["EXTRA_LARGE"] = "x-large";
|
|
7
|
+
})(DISPLAY_STRATEGY_TYPE || (DISPLAY_STRATEGY_TYPE = {}));
|
|
@@ -1,14 +1,69 @@
|
|
|
1
1
|
import RoomLabelItems from './RoomLabelItems';
|
|
2
2
|
import { parseModelRoomLabelPluginData } from './utils/parseData';
|
|
3
3
|
export class ModelRoomLabelController {
|
|
4
|
-
five;
|
|
5
|
-
enabled = true;
|
|
6
|
-
fiveModeEnabled;
|
|
7
|
-
app = undefined;
|
|
8
|
-
wrapper;
|
|
9
|
-
roomLabels = [];
|
|
10
|
-
container = document.createElement('div');
|
|
11
4
|
constructor(five) {
|
|
5
|
+
Object.defineProperty(this, "five", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true,
|
|
9
|
+
value: void 0
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(this, "enabled", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true,
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(this, "fiveModeEnabled", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
writable: true,
|
|
21
|
+
value: void 0
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(this, "app", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: undefined
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(this, "wrapper", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: void 0
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(this, "roomLabels", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true,
|
|
39
|
+
value: []
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(this, "container", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
configurable: true,
|
|
44
|
+
writable: true,
|
|
45
|
+
value: document.createElement('div')
|
|
46
|
+
});
|
|
47
|
+
/** 监听 Five Mode 变化
|
|
48
|
+
* @description
|
|
49
|
+
* Mode 不符合要求时,立刻消失,满足要求时,需要等待动画结束再展示
|
|
50
|
+
*/
|
|
51
|
+
Object.defineProperty(this, "onFiveModeChange", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
configurable: true,
|
|
54
|
+
writable: true,
|
|
55
|
+
value: (mode) => {
|
|
56
|
+
if (mode !== 'Floorplan') {
|
|
57
|
+
this.fiveModeEnabled = false;
|
|
58
|
+
this.render();
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
this.five.once('initAnimationEnded', () => {
|
|
62
|
+
this.fiveModeEnabled = this.five.currentMode === 'Floorplan';
|
|
63
|
+
this.render();
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
});
|
|
12
67
|
this.five = five;
|
|
13
68
|
this.fiveModeEnabled = this.five.currentMode === 'Floorplan';
|
|
14
69
|
// init container style
|
|
@@ -19,6 +74,7 @@ export class ModelRoomLabelController {
|
|
|
19
74
|
this.container.style.pointerEvents = 'none';
|
|
20
75
|
this.container.style.left = '0';
|
|
21
76
|
this.container.style.top = '0';
|
|
77
|
+
this.container.style.zIndex = '5';
|
|
22
78
|
// five listener
|
|
23
79
|
this.five.once('dispose', () => this.dispose());
|
|
24
80
|
this.five.on('modeChange', this.onFiveModeChange);
|
|
@@ -61,26 +117,12 @@ export class ModelRoomLabelController {
|
|
|
61
117
|
this.render();
|
|
62
118
|
return this;
|
|
63
119
|
}
|
|
64
|
-
/** 监听 Five Mode 变化
|
|
65
|
-
* @description
|
|
66
|
-
* Mode 不符合要求时,立刻消失,满足要求时,需要等待动画结束再展示
|
|
67
|
-
*/
|
|
68
|
-
onFiveModeChange = (mode) => {
|
|
69
|
-
if (mode !== 'Floorplan') {
|
|
70
|
-
this.fiveModeEnabled = false;
|
|
71
|
-
this.render();
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
this.five.once('initAnimationEnded', () => {
|
|
75
|
-
this.fiveModeEnabled = this.five.currentMode === 'Floorplan';
|
|
76
|
-
this.render();
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
120
|
render() {
|
|
121
|
+
var _a;
|
|
80
122
|
if (!this.wrapper)
|
|
81
123
|
return;
|
|
82
124
|
if (!this.enabled || !this.fiveModeEnabled) {
|
|
83
|
-
this.app
|
|
125
|
+
(_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
|
|
84
126
|
this.app = undefined;
|
|
85
127
|
return;
|
|
86
128
|
}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
detach,
|
|
12
12
|
element,
|
|
13
13
|
empty,
|
|
14
|
+
globals,
|
|
14
15
|
group_outros,
|
|
15
16
|
init,
|
|
16
17
|
insert,
|
|
@@ -22,7 +23,8 @@ import {
|
|
|
22
23
|
update_keyed_each
|
|
23
24
|
} from "svelte/internal";
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
const { Map: Map_1 } = globals;
|
|
27
|
+
import { onDestroy } from 'svelte';
|
|
26
28
|
import { Raycaster, Vector3 } from 'three';
|
|
27
29
|
import RoomLabelItem from './RoomLabelItem';
|
|
28
30
|
|
|
@@ -32,11 +34,11 @@ function add_css(target) {
|
|
|
32
34
|
|
|
33
35
|
function get_each_context(ctx, list, i) {
|
|
34
36
|
const child_ctx = ctx.slice();
|
|
35
|
-
child_ctx[
|
|
37
|
+
child_ctx[12] = list[i];
|
|
36
38
|
return child_ctx;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
// (
|
|
41
|
+
// (82:2) {#each roomLabels as roomLableItem (roomLableItem.id)}
|
|
40
42
|
function create_each_block(key_1, ctx) {
|
|
41
43
|
let first;
|
|
42
44
|
let roomlabelitem;
|
|
@@ -44,7 +46,7 @@ function create_each_block(key_1, ctx) {
|
|
|
44
46
|
|
|
45
47
|
roomlabelitem = new RoomLabelItem({
|
|
46
48
|
props: {
|
|
47
|
-
roomLabel: /*roomLableItem*/ ctx[
|
|
49
|
+
roomLabel: /*roomLableItem*/ ctx[12],
|
|
48
50
|
five: /*five*/ ctx[1]
|
|
49
51
|
}
|
|
50
52
|
});
|
|
@@ -65,7 +67,7 @@ function create_each_block(key_1, ctx) {
|
|
|
65
67
|
p(new_ctx, dirty) {
|
|
66
68
|
ctx = new_ctx;
|
|
67
69
|
const roomlabelitem_changes = {};
|
|
68
|
-
if (dirty & /*roomLabels*/ 1) roomlabelitem_changes.roomLabel = /*roomLableItem*/ ctx[
|
|
70
|
+
if (dirty & /*roomLabels*/ 1) roomlabelitem_changes.roomLabel = /*roomLableItem*/ ctx[12];
|
|
69
71
|
if (dirty & /*five*/ 2) roomlabelitem_changes.five = /*five*/ ctx[1];
|
|
70
72
|
roomlabelitem.$set(roomlabelitem_changes);
|
|
71
73
|
},
|
|
@@ -88,11 +90,11 @@ function create_each_block(key_1, ctx) {
|
|
|
88
90
|
function create_fragment(ctx) {
|
|
89
91
|
let div;
|
|
90
92
|
let each_blocks = [];
|
|
91
|
-
let each_1_lookup = new
|
|
93
|
+
let each_1_lookup = new Map_1();
|
|
92
94
|
let div_resize_listener;
|
|
93
95
|
let current;
|
|
94
96
|
let each_value = /*roomLabels*/ ctx[0];
|
|
95
|
-
const get_key = ctx => /*roomLableItem*/ ctx[
|
|
97
|
+
const get_key = ctx => /*roomLableItem*/ ctx[12].id;
|
|
96
98
|
|
|
97
99
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
98
100
|
let child_ctx = get_each_context(ctx, each_value, i);
|
|
@@ -109,7 +111,7 @@ function create_fragment(ctx) {
|
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
attr(div, "class", "room-labels-container svelte-185yvaa");
|
|
112
|
-
add_render_callback(() => /*div_elementresize_handler*/ ctx[
|
|
114
|
+
add_render_callback(() => /*div_elementresize_handler*/ ctx[6].call(div));
|
|
113
115
|
},
|
|
114
116
|
m(target, anchor) {
|
|
115
117
|
insert(target, div, anchor);
|
|
@@ -118,7 +120,7 @@ function create_fragment(ctx) {
|
|
|
118
120
|
each_blocks[i].m(div, null);
|
|
119
121
|
}
|
|
120
122
|
|
|
121
|
-
div_resize_listener = add_resize_listener(div, /*div_elementresize_handler*/ ctx[
|
|
123
|
+
div_resize_listener = add_resize_listener(div, /*div_elementresize_handler*/ ctx[6].bind(div));
|
|
122
124
|
current = true;
|
|
123
125
|
},
|
|
124
126
|
p(ctx, [dirty]) {
|
|
@@ -158,22 +160,17 @@ function create_fragment(ctx) {
|
|
|
158
160
|
}
|
|
159
161
|
|
|
160
162
|
function instance($$self, $$props, $$invalidate) {
|
|
163
|
+
let rendererSize;
|
|
161
164
|
let { five } = $$props;
|
|
162
165
|
let { roomLabels } = $$props;
|
|
163
166
|
let containerWidth;
|
|
164
167
|
let containerHeight;
|
|
168
|
+
let shownFloor = null;
|
|
165
169
|
|
|
166
|
-
function getLabelVisible(
|
|
167
|
-
// 先看是不是在当前展示的楼层上
|
|
168
|
-
const isLabelInFloor = five.model.shownFloor === null || roomLabelItem.floorIndex === five.model.shownFloor;
|
|
169
|
-
|
|
170
|
-
if (!isLabelInFloor) return false;
|
|
171
|
-
|
|
172
|
-
// 再看是不是被模型遮挡
|
|
170
|
+
function getLabelVisible(item) {
|
|
173
171
|
const raycaster = new Raycaster();
|
|
174
|
-
|
|
175
172
|
const cameraPosition = five.camera.position.clone();
|
|
176
|
-
const position = new Vector3(
|
|
173
|
+
const position = new Vector3(item.position.x, item.position.y, item.position.z);
|
|
177
174
|
const vectorDistance = position.distanceTo(cameraPosition);
|
|
178
175
|
raycaster.set(cameraPosition.clone(), position.clone().sub(cameraPosition).normalize());
|
|
179
176
|
const [intersection] = five.model.intersectRaycaster(raycaster);
|
|
@@ -181,51 +178,60 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
181
178
|
return true;
|
|
182
179
|
}
|
|
183
180
|
|
|
184
|
-
function getLabelTransform(
|
|
185
|
-
const position = new Vector3(
|
|
181
|
+
function getLabelTransform(item, rendererSize) {
|
|
182
|
+
const position = new Vector3(item.position.x, item.position.y, item.position.z);
|
|
186
183
|
const mouse = position.clone().project(five.camera);
|
|
187
|
-
const xOffset = Math.ceil((mouse.x + 1) / 2 *
|
|
188
|
-
const yOffset = Math.ceil((-mouse.y + 1) / 2 *
|
|
184
|
+
const xOffset = Math.ceil((mouse.x + 1) / 2 * rendererSize.x);
|
|
185
|
+
const yOffset = Math.ceil((-mouse.y + 1) / 2 * rendererSize.y);
|
|
189
186
|
return `translate(${xOffset}px, ${yOffset}px)`;
|
|
190
187
|
}
|
|
191
188
|
|
|
192
|
-
function getFormatedRoomLabels(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
189
|
+
function getFormatedRoomLabels(rendererSize) {
|
|
190
|
+
// 因为 item distance 需要重复计算,所以缓存一下
|
|
191
|
+
const distanceMap = new Map();
|
|
192
|
+
|
|
193
|
+
function getItemDistance(item) {
|
|
194
|
+
const cacheDistance = distanceMap.get(item.id);
|
|
195
|
+
if (cacheDistance) return cacheDistance;
|
|
196
|
+
const { x, y, z } = item.position;
|
|
197
|
+
const distance = new Vector3(x, y, z).clone().distanceTo(five.camera.position);
|
|
198
|
+
distanceMap.set(item.id, distance);
|
|
199
|
+
return distance;
|
|
200
|
+
}
|
|
196
201
|
|
|
197
|
-
|
|
202
|
+
const formatedItems = roomLabels.map(item => {
|
|
203
|
+
const visible = getLabelVisible(item);
|
|
198
204
|
|
|
199
|
-
|
|
200
|
-
|
|
205
|
+
const transform = visible
|
|
206
|
+
? getLabelTransform(item, rendererSize)
|
|
207
|
+
: item.transform;
|
|
201
208
|
|
|
202
|
-
|
|
203
|
-
});
|
|
209
|
+
const itemDistance = getItemDistance(item);
|
|
204
210
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
distance: new Vector3(...Object.values(roomLabelItem.position)).clone().distanceTo(five.camera.position)
|
|
208
|
-
})).sort((a, b) => a.distance - b.distance);
|
|
211
|
+
// visible === true 的 item 中,distance 比自己小的 item 个数
|
|
212
|
+
const minItemLen = roomLabels.filter(item => item.visible && getItemDistance(item) < itemDistance).length;
|
|
209
213
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
if (sortIndex !== undefined) return { ...roomLabelItem, zIndex: sortIndex * 10 };
|
|
213
|
-
return roomLabelItem;
|
|
214
|
+
const zIndex = minItemLen * 10;
|
|
215
|
+
return Object.assign(Object.assign({}, item), { visible, transform, zIndex });
|
|
214
216
|
});
|
|
217
|
+
|
|
218
|
+
return formatedItems;
|
|
215
219
|
}
|
|
216
220
|
|
|
217
221
|
function onFiveCameraUpdate() {
|
|
218
|
-
$$invalidate(0, roomLabels = getFormatedRoomLabels(
|
|
222
|
+
$$invalidate(0, roomLabels = getFormatedRoomLabels(rendererSize));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function onFiveModelShownFloorChange(floorIndex) {
|
|
226
|
+
$$invalidate(4, shownFloor = floorIndex);
|
|
219
227
|
}
|
|
220
228
|
|
|
221
229
|
five.on('cameraUpdate', onFiveCameraUpdate);
|
|
230
|
+
five.on('modelShownFloorChange', onFiveModelShownFloorChange);
|
|
222
231
|
|
|
223
232
|
onDestroy(() => {
|
|
224
233
|
five.off('cameraUpdate', onFiveCameraUpdate);
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
onMount(() => {
|
|
228
|
-
onFiveCameraUpdate();
|
|
234
|
+
five.off('modelShownFloorChange', onFiveModelShownFloorChange);
|
|
229
235
|
});
|
|
230
236
|
|
|
231
237
|
function div_elementresize_handler() {
|
|
@@ -240,7 +246,39 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
240
246
|
if ('roomLabels' in $$props) $$invalidate(0, roomLabels = $$props.roomLabels);
|
|
241
247
|
};
|
|
242
248
|
|
|
243
|
-
|
|
249
|
+
$$self.$$.update = () => {
|
|
250
|
+
if ($$self.$$.dirty & /*containerWidth, containerHeight*/ 12) {
|
|
251
|
+
$: $$invalidate(5, rendererSize = { x: containerWidth, y: containerHeight });
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if ($$self.$$.dirty & /*rendererSize*/ 32) {
|
|
255
|
+
$: {
|
|
256
|
+
// rendererSize 变化时,触发 reRender
|
|
257
|
+
$$invalidate(0, roomLabels = getFormatedRoomLabels(rendererSize));
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if ($$self.$$.dirty & /*roomLabels, shownFloor*/ 17) {
|
|
262
|
+
$: {
|
|
263
|
+
// shownFloor 变化时,更新 item visible
|
|
264
|
+
$$invalidate(0, roomLabels = roomLabels.map(item => {
|
|
265
|
+
const isLabelInFloor = shownFloor === null || item.floorIndex === shownFloor;
|
|
266
|
+
const visible = isLabelInFloor ? item.visible : false;
|
|
267
|
+
return Object.assign(Object.assign({}, item), { visible });
|
|
268
|
+
}));
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
return [
|
|
274
|
+
roomLabels,
|
|
275
|
+
five,
|
|
276
|
+
containerWidth,
|
|
277
|
+
containerHeight,
|
|
278
|
+
shownFloor,
|
|
279
|
+
rendererSize,
|
|
280
|
+
div_elementresize_handler
|
|
281
|
+
];
|
|
244
282
|
}
|
|
245
283
|
|
|
246
284
|
class Component extends SvelteComponent {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { FivePlugin } from '@realsee/five';
|
|
2
|
+
export interface ModelSimulationPluginExportType {
|
|
3
|
+
enable: () => void;
|
|
4
|
+
disable: () => void;
|
|
5
|
+
play: () => void;
|
|
6
|
+
dispose: () => void;
|
|
7
|
+
init: () => void;
|
|
8
|
+
}
|
|
9
|
+
export interface ModelSimulationPluginParameterType {
|
|
10
|
+
simulationWorkData: ModelSimulationPluginWorkDataType;
|
|
11
|
+
simulationOptions: ModelSimulationPluginOptionsType;
|
|
12
|
+
}
|
|
13
|
+
export interface ModelSimulationPluginWorkDataType {
|
|
14
|
+
resourceUrl: string;
|
|
15
|
+
colorMapPath: string;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
depth: number;
|
|
19
|
+
origin: number[];
|
|
20
|
+
step: number;
|
|
21
|
+
maxT: number;
|
|
22
|
+
minT: number;
|
|
23
|
+
maxKeyframes: number;
|
|
24
|
+
houseHeight: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ModelSimulationPluginOptionsType {
|
|
27
|
+
globalOpacity: number;
|
|
28
|
+
boundingOpacity: number;
|
|
29
|
+
boundingOffset?: number;
|
|
30
|
+
keyFrameRate?: number;
|
|
31
|
+
}
|
|
32
|
+
declare const ModelSimulationPlugin: FivePlugin<ModelSimulationPluginParameterType, ModelSimulationPluginExportType>;
|
|
33
|
+
export default ModelSimulationPlugin;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import vertexShader from './shaders/vertex';
|
|
3
|
+
import fragmentShader from './shaders/fragment';
|
|
4
|
+
import tap from '../shared-utils/tap';
|
|
5
|
+
const houseOutLinePath = [
|
|
6
|
+
[-3.089, -4.219], [-4.834, -4.219],
|
|
7
|
+
[-8.197, -4.219], [-10.31, -4.219],
|
|
8
|
+
[-10.31, -1.002], [-10.31, 0.835],
|
|
9
|
+
[-10.31, 3.927], [-11.237, 3.927],
|
|
10
|
+
[-11.237, 5.45], [-8.104, 5.45],
|
|
11
|
+
[-8.104, 4.557], [-6.914, 4.557],
|
|
12
|
+
[-6.244, 4.557], [-6.244, 5.436],
|
|
13
|
+
[-3.78, 5.436], [-0.356, 5.436],
|
|
14
|
+
[0.286, 5.436], [0.286, 4.073],
|
|
15
|
+
[0.286, 0.395], [2.31, 0.395],
|
|
16
|
+
[2.31, -1.323], [2.31, -4.199],
|
|
17
|
+
[0.468, -4.199], [0.468, -3.547],
|
|
18
|
+
[-2.969, -3.547], [-3.089, -3.547]
|
|
19
|
+
];
|
|
20
|
+
const defaultKeyframes = 50;
|
|
21
|
+
const defaultBoundingOffset = 0.2;
|
|
22
|
+
let isTexutreReady = false;
|
|
23
|
+
const ModelSimulationPlugin = (five, options) => {
|
|
24
|
+
let heatTexutres = [];
|
|
25
|
+
let geometryTexture = null;
|
|
26
|
+
let simulationMaterial = null;
|
|
27
|
+
let boundingMaterial = null;
|
|
28
|
+
let boundingMesh = null;
|
|
29
|
+
let originMaterial = null;
|
|
30
|
+
const enable = () => {
|
|
31
|
+
};
|
|
32
|
+
const disable = () => {
|
|
33
|
+
five.model.setMaterial(originMaterial);
|
|
34
|
+
};
|
|
35
|
+
const createBounding = (path, material) => {
|
|
36
|
+
const shape = tap(new THREE.Shape(), shape => {
|
|
37
|
+
shape.moveTo(path[path.length - 1][0], path[path.length - 1][1]);
|
|
38
|
+
path.forEach(xz => shape.lineTo(xz[0], xz[1]));
|
|
39
|
+
});
|
|
40
|
+
const settings = {
|
|
41
|
+
depth: options.simulationWorkData.houseHeight + 2 * options.simulationOptions.boundingOffset ?? defaultBoundingOffset,
|
|
42
|
+
bevelEnabled: false,
|
|
43
|
+
};
|
|
44
|
+
const geometry = new THREE.ExtrudeGeometry(shape, settings);
|
|
45
|
+
boundingMesh = new THREE.Mesh(geometry, material);
|
|
46
|
+
boundingMesh.rotateX(Math.PI / 2);
|
|
47
|
+
boundingMesh.translateZ(-options.simulationWorkData.houseHeight - options.simulationOptions.boundingOffset);
|
|
48
|
+
boundingMesh.updateMatrix();
|
|
49
|
+
boundingMesh.updateMatrixWorld();
|
|
50
|
+
return boundingMesh;
|
|
51
|
+
};
|
|
52
|
+
const createSimulationMaterial = (isBounding) => {
|
|
53
|
+
const simulationMaterial = new THREE.RawShaderMaterial({
|
|
54
|
+
uniforms: {
|
|
55
|
+
heatMap: { value: new THREE.Texture() },
|
|
56
|
+
geometryMap: { value: new THREE.Texture() },
|
|
57
|
+
colorMap: { value: new THREE.TextureLoader().load(options.simulationWorkData.colorMapPath) },
|
|
58
|
+
bboxMin: { value: new THREE.Vector3().fromArray(options.simulationWorkData.origin) },
|
|
59
|
+
bboxMax: { value: new THREE.Vector3().fromArray(options.simulationWorkData.origin).add(new THREE.Vector3(options.simulationWorkData.width, options.simulationWorkData.height, options.simulationWorkData.depth).multiplyScalar(options.simulationWorkData.step)) },
|
|
60
|
+
step: { value: options.simulationWorkData.step },
|
|
61
|
+
maxT: { value: options.simulationWorkData.maxT },
|
|
62
|
+
minT: { value: options.simulationWorkData.minT },
|
|
63
|
+
opacity: { value: isBounding ? options.simulationOptions.boundingOpacity : options.simulationOptions.globalOpacity }
|
|
64
|
+
},
|
|
65
|
+
vertexShader,
|
|
66
|
+
fragmentShader,
|
|
67
|
+
});
|
|
68
|
+
if (isBounding)
|
|
69
|
+
simulationMaterial.transparent = true;
|
|
70
|
+
return simulationMaterial;
|
|
71
|
+
};
|
|
72
|
+
const create3DTextureTask = (url) => {
|
|
73
|
+
return fetch(url)
|
|
74
|
+
.then(res => {
|
|
75
|
+
return res.arrayBuffer();
|
|
76
|
+
})
|
|
77
|
+
.then(res => {
|
|
78
|
+
const texture = new THREE.DataTexture3D(new Float32Array(res), options.simulationWorkData.width, options.simulationWorkData.height, options.simulationWorkData.depth);
|
|
79
|
+
texture.type = THREE.FloatType;
|
|
80
|
+
texture.format = THREE.RedFormat;
|
|
81
|
+
texture.minFilter = THREE.LinearMipmapLinearFilter;
|
|
82
|
+
texture.magFilter = THREE.LinearFilter;
|
|
83
|
+
texture.generateMipmaps = true;
|
|
84
|
+
texture.unpackAlignment = 1;
|
|
85
|
+
return texture;
|
|
86
|
+
})
|
|
87
|
+
.catch(err => console.error("拉取三维纹理数据时发生错误"));
|
|
88
|
+
};
|
|
89
|
+
const init = () => {
|
|
90
|
+
simulationMaterial = createSimulationMaterial(false);
|
|
91
|
+
boundingMaterial = createSimulationMaterial(true);
|
|
92
|
+
//加载外bounding
|
|
93
|
+
five.scene.add(createBounding(houseOutLinePath, boundingMaterial));
|
|
94
|
+
//缓存原来的材质
|
|
95
|
+
originMaterial = five.model.getMaterial();
|
|
96
|
+
five.model.traverse(obj => {
|
|
97
|
+
if (!(obj instanceof THREE.Mesh))
|
|
98
|
+
return;
|
|
99
|
+
if (Array.isArray(obj.material)) {
|
|
100
|
+
obj.material = obj.material.map(_mtl => simulationMaterial);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
obj.material = simulationMaterial;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
//温度数据
|
|
107
|
+
// const geometryTaskUrl = options.resourceUrl + 'geometry.vti'
|
|
108
|
+
const heatTextureTasks = [];
|
|
109
|
+
for (let i = 0; i < options.simulationWorkData.maxKeyframes; i++) {
|
|
110
|
+
const fileUrl = options.simulationWorkData.resourceUrl + i + '.vti';
|
|
111
|
+
heatTextureTasks.push(create3DTextureTask(fileUrl));
|
|
112
|
+
}
|
|
113
|
+
// //有效值数据
|
|
114
|
+
// create3DTextureTask(geometryTaskUrl)
|
|
115
|
+
// .then(texture => {
|
|
116
|
+
// simulationMaterial.uniforms.geometryMap.value = texture
|
|
117
|
+
// boundingMaterial.uniforms.geometryMap.value = texture
|
|
118
|
+
// })
|
|
119
|
+
// .catch(err => console.error("geometry texture loading failed"))
|
|
120
|
+
//加载首帧进行初始化
|
|
121
|
+
create3DTextureTask(options.simulationWorkData.resourceUrl + '0.vti')
|
|
122
|
+
.then(texture => {
|
|
123
|
+
simulationMaterial.uniforms.heatMap.value = texture;
|
|
124
|
+
boundingMaterial.uniforms.heatMap.value = texture;
|
|
125
|
+
five.needsRender = true;
|
|
126
|
+
})
|
|
127
|
+
.catch(err => console.error("loading textures failed"));
|
|
128
|
+
//加载全部
|
|
129
|
+
Promise.all(heatTextureTasks)
|
|
130
|
+
.then(textures => {
|
|
131
|
+
//缓存结果
|
|
132
|
+
isTexutreReady = true;
|
|
133
|
+
console.log("ready");
|
|
134
|
+
heatTexutres = textures;
|
|
135
|
+
})
|
|
136
|
+
.catch(err => console.error("loading textures failed"));
|
|
137
|
+
};
|
|
138
|
+
const play = () => {
|
|
139
|
+
if (!isTexutreReady)
|
|
140
|
+
throw new Error("textures are not ready yet,plz try again later");
|
|
141
|
+
let timeCount = 0;
|
|
142
|
+
const stop = setInterval(() => {
|
|
143
|
+
if (timeCount < options.simulationWorkData.maxKeyframes) {
|
|
144
|
+
simulationMaterial.uniforms.heatMap.value = heatTexutres[timeCount];
|
|
145
|
+
boundingMaterial.uniforms.heatMap.value = heatTexutres[timeCount];
|
|
146
|
+
timeCount++;
|
|
147
|
+
five.needsRender = true;
|
|
148
|
+
}
|
|
149
|
+
}, 1000 / options.simulationOptions.keyFrameRate ?? defaultKeyframes);
|
|
150
|
+
};
|
|
151
|
+
const dispose = () => {
|
|
152
|
+
simulationMaterial.dispose();
|
|
153
|
+
boundingMaterial.dispose();
|
|
154
|
+
boundingMesh.geometry.dispose();
|
|
155
|
+
geometryTexture.dispose();
|
|
156
|
+
heatTexutres.forEach(texture => texture.dispose());
|
|
157
|
+
};
|
|
158
|
+
return {
|
|
159
|
+
enable,
|
|
160
|
+
disable,
|
|
161
|
+
play,
|
|
162
|
+
init,
|
|
163
|
+
dispose
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
export default ModelSimulationPlugin;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare var _default: "#version 300 es\n#define MAX_STEPS 50\nprecision highp float;\nprecision highp sampler3D;\n\nuniform sampler3D heatMap;\nuniform sampler3D geometryMap;\nuniform sampler2D colorMap;\n\nuniform vec3 bboxMin;\nuniform vec3 bboxMax;\nuniform float step;\nuniform float minT;\nuniform float maxT;\nuniform float opacity;\n\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 linearToOutputTexel( vec4 value ) { return LinearTosRGB( value ); }\n\n\nfloat getHeatByLegalPos(vec3 pos){\n\tfloat geometryFactor = texture(geometryMap,pos).r;\n\tfloat legalFactor = clamp(geometryFactor,0.0,1.0);\n\treturn texture(heatMap,pos).r * legalFactor;\n}\n\nfloat sampleOc(vec3 pos){\n\t//平滑滤波步长\n\t//todo:可以作为define传入的外部常量还是直接传\n\tfloat step_x = step / (bboxMax.x - bboxMin.x) * 0.5;\n\tfloat step_y = step / (bboxMax.y - bboxMin.y) * 0.5;\n\tfloat step_z = step / (bboxMax.z - bboxMin.z) * 0.5;\n\tvec3 p1 = pos + vec3(step_x,step_y,step_z);\n\tvec3 p2 = pos + vec3(step_x,-step_y,step_z);\n\tvec3 p3 = pos + vec3(step_x,step_y,-step_z);\n\tvec3 p4 = pos + vec3(step_x,-step_y,-step_z);\n\tvec3 p5 = pos + vec3(-step_x,step_y,step_z);\n\tvec3 p6 = pos + vec3(-step_x,-step_y,step_z);\n\tvec3 p7 = pos + vec3(-step_x,step_y,-step_z);\n\tvec3 p8 = pos + vec3(-step_x,-step_y,-step_z);\n\n\treturn (getHeatByLegalPos(p1) + getHeatByLegalPos(p2) + getHeatByLegalPos(p3) + getHeatByLegalPos(p4) + getHeatByLegalPos(p5) + getHeatByLegalPos(p6) + getHeatByLegalPos(p7) + getHeatByLegalPos(p8)) * 0.125;\n\n}\n\n//考虑到有效仿真值连通域在三维空间中是封闭流形,这里直接按照normal方向搜索,牺牲一定精度,以保证展示效果\nfloat sampleByNormal(vec3 normal, vec3 pos){\n\tfloat searchStep = step ;\n\tvec3 currentPos = pos;\n\tfor (int iter=0; iter < MAX_STEPS; iter++) {\n\t\tif(iter >= MAX_STEPS){\n\t\t\treturn texture(heatMap,currentPos).r;\n\t\t}\n\t\tif(texture(geometryMap,currentPos).r < 0.5){\n\t\t\tcurrentPos += normal * searchStep;\n\t\t}else{\n\t\t\treturn texture(heatMap,currentPos).r;\n\t\t}\n\t}\n}\n\nfloat sample1(vec3 normal, vec3 pos){\n\treturn texture(heatMap,pos).r;\n}\n\nin vec2 vUv;\nin vec3 vPosition;\nin vec3 vNormal;\nout highp vec4 pc_fragColor;\n\n\nfloat normalizeHeat(float t){\n\tfloat _t = clamp(t,minT,maxT);\n\treturn (_t - minT)/(maxT - minT);\n}\n\nvec3 posToTexCood(vec3 pos){\n\tfloat x = (pos.x - bboxMin.x) / (bboxMax.x - bboxMin.x);\n\tfloat y = (pos.y - bboxMin.y) / (bboxMax.y - bboxMin.y);\n\tfloat z = (pos.z - bboxMin.z) / (bboxMax.z - bboxMin.z);\n\treturn vec3(x,y,z);\n}\n\n\nvoid main() {\n\tvec3 texCood = posToTexCood(vPosition);\n\t// float color = sampleByNormal(vNormal,texCood);\n\tfloat color = sample1(vNormal,texCood);\n\tfloat normalColor= normalizeHeat(color);\n\tvec4 colorMapColor = texture(colorMap,vec2(normalColor,0.2));\n\tpc_fragColor = vec4(colorMapColor.xyz,opacity);\n\t// pc_fragColor = linearToOutputTexel(vec4(colorMapColor.xyz,opacity));\n\t}\n";
|
|
2
|
+
export default _default;
|