@realsee/dnalogel 2.1.2-alpha.0 → 2.1.2-alpha.2
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 +3 -12
- package/docs/classes/CruisePluginController.html +24 -24
- package/docs/classes/Magnifier.html +16 -16
- package/docs/classes/ModelRoomLabelController.html +11 -11
- package/docs/classes/Object3DHelperController.html +24 -24
- package/docs/classes/PaintBrush.html +15 -15
- package/docs/classes/PanoTagPluginController.html +39 -39
- package/docs/classes/Util.BetterTween.html +8 -8
- package/docs/classes/Util.FivePointSelector.html +12 -12
- package/docs/classes/Util.Interval.html +12 -12
- package/docs/classes/Util.Magnifier.html +17 -17
- package/docs/classes/Util.PointDomHelper.html +11 -11
- package/docs/classes/Util.PointHelper.html +11 -11
- package/docs/classes/Util.Rectangle.html +13 -13
- package/docs/enums/CameraMovementEffect.html +7 -7
- package/docs/enums/ContentType.html +12 -12
- package/docs/enums/DIRECTION.html +9 -9
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/DimensionType.html +7 -7
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/LinkType.html +7 -7
- package/docs/enums/PaintBrushTypeEnum.html +8 -8
- package/docs/enums/PointType.html +7 -7
- package/docs/enums/Rotation.html +8 -8
- package/docs/functions/CSS3DRenderPlugin.html +4 -4
- package/docs/functions/CameraMovementPlugin.html +4 -4
- package/docs/functions/CruisePlugin.html +4 -4
- package/docs/functions/GuideLinePlugin.html +5 -5
- package/docs/functions/ItemLabelPlugin.html +4 -4
- package/docs/functions/MapviewFloorplanPlugin.html +4 -4
- package/docs/functions/ModelChassisCompassPlugin.html +4 -4
- package/docs/functions/ModelEntryDoorGuidePlugin.html +4 -4
- package/docs/functions/ModelFloorplanPlugin.html +4 -4
- package/docs/functions/ModelItemLabelPlugin.html +4 -4
- package/docs/functions/ModelRoomLabelPlugin.html +4 -4
- package/docs/functions/ModelTVVideoPlugin.html +4 -4
- package/docs/functions/ModelViewPlugin.html +4 -4
- package/docs/functions/Object3DHelperPlugin.html +4 -4
- package/docs/functions/PanoCompassPlugin.html +4 -4
- package/docs/functions/PanoCursorRaycasterPlugin.html +4 -4
- package/docs/functions/PanoDoorLabelPlugin.html +4 -4
- package/docs/functions/PanoFloorplanRadarPlugin.html +4 -4
- package/docs/functions/PanoMeasurePlugin.html +4 -4
- package/docs/functions/PanoRulerPlugin.html +4 -4
- package/docs/functions/PanoRulerProPlugin.html +4 -4
- package/docs/functions/PanoSpatialTagPlugin.html +4 -4
- package/docs/functions/PanoTagPlugin.html +4 -4
- package/docs/functions/TopviewFloorplanPlugin.html +4 -4
- package/docs/functions/Util.getCoordsFromClient.html +5 -5
- package/docs/functions/Util.getCoordsFromElement.html +5 -5
- package/docs/functions/Util.getFrameTime.html +5 -5
- package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
- package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
- package/docs/functions/Util.isNil.html +5 -5
- package/docs/functions/Util.nextFrame.html +5 -5
- package/docs/functions/Util.notNil.html +5 -5
- package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
- package/docs/functions/Util.tweenProgress.html +5 -5
- package/docs/functions/pluginFlag.html +5 -5
- package/docs/index.html +6 -11
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
- package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
- package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
- package/docs/interfaces/ContentTypeMap.html +12 -12
- package/docs/interfaces/FloorplanBounding.html +8 -8
- package/docs/interfaces/FloorplanData.html +10 -10
- package/docs/interfaces/FloorplanEntrance.html +11 -11
- package/docs/interfaces/FloorplanExtraObject.html +10 -10
- package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
- package/docs/interfaces/FloorplanFloorData.html +9 -9
- package/docs/interfaces/FloorplanImagePosition.html +7 -7
- package/docs/interfaces/FloorplanObserver.html +9 -9
- package/docs/interfaces/FloorplanOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanPosition.html +7 -7
- package/docs/interfaces/FloorplanRoomItem.html +13 -13
- package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
- package/docs/interfaces/FloorplanServerBounding.html +8 -8
- package/docs/interfaces/FloorplanServerComputedData.html +10 -10
- package/docs/interfaces/FloorplanServerData.html +7 -7
- package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
- package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
- package/docs/interfaces/FloorplanServerEntrance.html +11 -11
- package/docs/interfaces/FloorplanServerFloorData.html +9 -9
- package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
- package/docs/interfaces/FloorplanServerObserver.html +9 -9
- package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanServerPosition.html +7 -7
- package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
- package/docs/interfaces/ItemLabelPluginData.html +6 -6
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
- package/docs/interfaces/LineJson.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
- package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
- package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
- package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
- package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
- package/docs/interfaces/ModelViewPluginExportType.html +8 -8
- package/docs/interfaces/Object3DHelperState.html +8 -8
- package/docs/interfaces/OpenParameter.html +7 -7
- package/docs/interfaces/PaintBrushAction.html +12 -12
- package/docs/interfaces/PaintBrushConfigs.html +12 -12
- package/docs/interfaces/PaintBrushState.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +5 -5
- package/docs/interfaces/PanoMeasureParameterType.html +11 -11
- package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
- package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
- package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
- package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
- package/docs/interfaces/PanoRulerProPluginState.html +8 -8
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +5 -5
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +5 -5
- package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
- package/docs/interfaces/Point.html +8 -8
- package/docs/interfaces/PointJson.html +8 -8
- package/docs/interfaces/Room.html +9 -9
- package/docs/interfaces/RoomInfo.html +7 -7
- package/docs/interfaces/RoomLabel.html +14 -14
- package/docs/interfaces/RoomRules.html +5 -5
- package/docs/interfaces/Rooms.html +5 -5
- package/docs/interfaces/Scissor.html +9 -9
- package/docs/interfaces/TagConfig.html +10 -10
- package/docs/interfaces/Tags.html +9 -9
- package/docs/interfaces/Util.MagnifierParameter.html +11 -11
- package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
- package/docs/modules/Util.html +5 -5
- package/docs/modules.html +4 -4
- package/docs/types/ArrayPosition.html +5 -5
- package/docs/types/CSS3DRenderExportType.html +5 -5
- package/docs/types/CSS3DRenderPluginExportType.html +5 -5
- package/docs/types/CSS3DRenderPluginParameterType.html +5 -5
- package/docs/types/Color.html +5 -5
- package/docs/types/ContentTypeConfigKey.html +5 -5
- package/docs/types/ContentTypeConfigKeyArray.html +5 -5
- package/docs/types/Create3DDomContainerReturnType.html +5 -5
- package/docs/types/Create3DElementReturnType.html +5 -5
- package/docs/types/CruisePluginExportType.html +5 -5
- package/docs/types/Direction-1.html +5 -5
- package/docs/types/Direction4.html +5 -5
- package/docs/types/FloorplanRuleLabels.html +5 -5
- package/docs/types/FloorplanServerRuleLabels.html +5 -5
- package/docs/types/GuideLinePluginExportType.html +5 -5
- package/docs/types/HelperEventMap.html +5 -5
- package/docs/types/MapviewFloorplanPluginParameterType.html +5 -5
- package/docs/types/MapviewFloorplanPluginReturnType.html +5 -5
- package/docs/types/MediaData.html +5 -5
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +5 -5
- package/docs/types/ModelFloorplanPluginParameterType.html +5 -5
- package/docs/types/ModelFloorplanPluginReturnType.html +5 -5
- package/docs/types/ModelRoomLabelPluginParameters.html +5 -5
- package/docs/types/ModelRoomLabelPluginReturnType.html +5 -5
- package/docs/types/MoveArgs.html +5 -5
- package/docs/types/MoveOpts.html +5 -5
- package/docs/types/Object3DHelperEventMap.html +5 -5
- package/docs/types/ObjectFit.html +5 -5
- package/docs/types/PaintBrushEventMap.html +5 -5
- package/docs/types/PanoCompassPluginData.html +5 -5
- package/docs/types/PanoCompassPluginExportType.html +5 -5
- package/docs/types/PanoCompassPluginParameterType.html +5 -5
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +5 -5
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +5 -5
- package/docs/types/PanoMeasurePluginEvent.html +5 -5
- package/docs/types/PanoMeasureReturnType.html +5 -5
- package/docs/types/PanoSpatialTagPluginId.html +5 -5
- package/docs/types/PanoTagPluginExportInterface.html +5 -5
- package/docs/types/PanoTagPluginParamsInterface.html +5 -5
- package/docs/types/PlaneTag.html +5 -5
- package/docs/types/PointTag.html +5 -5
- package/docs/types/Position.html +5 -5
- package/docs/types/RotateArgs.html +5 -5
- package/docs/types/RotateOpts.html +5 -5
- package/docs/types/RuleLabelsKey.html +5 -5
- package/docs/types/RuleLabelsValue.html +5 -5
- package/docs/types/Tag.html +5 -5
- package/docs/types/Tag2D.html +5 -5
- package/docs/types/Tag3D.html +5 -5
- package/docs/types/TagId.html +5 -5
- package/docs/types/TopviewFloorplanPluginParameterType.html +5 -5
- package/docs/types/TopviewFloorplanPluginReturnType.html +5 -5
- package/docs/variables/FLOOR_TYPE_MAP.html +5 -5
- package/docs/variables/PLUGIN.html +5 -5
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +5 -5
- package/docs/variables/ROOM_TYPE_MAP.html +5 -5
- package/docs/variables/VERSION.html +5 -5
- package/docs/variables/itemLabelPluginServerParams.html +5 -5
- package/docs/variables/modelItemLabelPluginServerParams.html +5 -5
- package/docs/variables/modelRoomLabelPluginServerParams.html +5 -5
- package/libs/CSS3DRenderPlugin/CSS3DRender.js +1 -331
- package/libs/CSS3DRenderPlugin/Controller.js +1 -84
- package/libs/CSS3DRenderPlugin/index.js +1 -6
- package/libs/CSS3DRenderPlugin/typing.js +1 -0
- package/libs/CSS3DRenderPlugin/utils/CSS3DObjectPlus.js +1 -67
- package/libs/CSS3DRenderPlugin/utils/centerPoint.js +1 -10
- package/libs/CSS3DRenderPlugin/utils/evenNumber.js +1 -7
- package/libs/CSS3DRenderPlugin/utils/index.js +1 -0
- package/libs/CSS3DRenderPlugin/utils/positionToVector3.js +1 -7
- package/libs/CSS3DRenderPlugin/utils/random.js +1 -0
- package/libs/CameraMovementPlugin/CameraMovementPlugin.js +1 -88
- package/libs/CameraMovementPlugin/index.js +1 -0
- package/libs/CameraMovementPlugin/typing.js +1 -5
- package/libs/CruisePlugin/Controller.js +1 -484
- package/libs/CruisePlugin/index.js +1 -8
- package/libs/CruisePlugin/utils/coordinatesAngle.js +1 -8
- package/libs/CruisePlugin/utils/coordinatesToVector.js +1 -12
- package/libs/CruisePlugin/utils/formatRad.js +1 -7
- package/libs/CruisePlugin/utils/linerValue.js +1 -7
- package/libs/CruisePlugin/utils/safeCall.js +1 -28
- package/libs/CruisePlugin/utils/sleep.js +1 -10
- package/libs/CruisePlugin/utils/vectorToCoordinates.js +1 -10
- package/libs/GuideLinePlugin/Controller.js +1 -144
- package/libs/GuideLinePlugin/index.js +1 -6
- package/libs/GuideLinePlugin/utils/getArrowMaterial.js +1 -13
- package/libs/GuideLinePlugin/utils/getLineGeometries.js +1 -64
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +1 -271
- package/libs/ItemLabelPlugin/ItemLabelItem.js +2 -133
- package/libs/ItemLabelPlugin/Plugin.js +2 -76
- package/libs/ItemLabelPlugin/index.js +1 -12
- package/libs/ItemLabelPlugin/typings.js +1 -4
- package/libs/ItemLabelPlugin/utils/getLabelTransform.js +1 -4
- package/libs/ItemLabelPlugin/utils/getStrokeLength.js +1 -16
- package/libs/ItemLabelPlugin/utils/isImpacted.js +1 -10
- package/libs/ItemLabelPlugin/utils/parseData.js +1 -21
- package/libs/ItemLabelPlugin/utils/transform2RenderData.js +1 -21
- package/libs/ModelChassisCompassPlugin/Plugin.js +1 -71
- package/libs/ModelChassisCompassPlugin/index.js +1 -0
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +1 -78
- package/libs/ModelEntryDoorGuidePlugin/index.js +1 -0
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +1 -212
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +2 -42
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +2 -74
- package/libs/ModelItemLabelPlugin/events.type.js +1 -0
- package/libs/ModelItemLabelPlugin/index.js +1 -12
- package/libs/ModelItemLabelPlugin/typings.js +1 -4
- package/libs/ModelItemLabelPlugin/utils/parseData.js +1 -19
- package/libs/ModelRoomLabelPlugin/Assets/roomLabelBg.js +1 -4
- package/libs/ModelRoomLabelPlugin/Controller.js +1 -60
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +1 -45
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +1 -162
- package/libs/ModelRoomLabelPlugin/index.js +1 -10
- package/libs/ModelRoomLabelPlugin/utils/parseData.js +1 -16
- package/libs/ModelTVVideoPlugin/Plugin.js +1 -164
- package/libs/ModelTVVideoPlugin/index.js +1 -0
- package/libs/ModelTVVideoPlugin/typings.js +1 -4
- package/libs/ModelTVVideoPlugin/utils/parseData.js +1 -20
- package/libs/ModelViewPlugin/Plugin.js +1 -107
- package/libs/ModelViewPlugin/index.js +1 -0
- package/libs/Object3DHelperPlugin/Controller.js +1 -145
- package/libs/Object3DHelperPlugin/FiveControllerWrapper.js +1 -32
- package/libs/Object3DHelperPlugin/index.js +1 -10
- package/libs/PanoCompassPlugin/Assets/roomInfoIcon.js +1 -4
- package/libs/PanoCompassPlugin/Controller.js +1 -224
- package/libs/PanoCompassPlugin/getRoomInfoInstance.js +1 -24
- package/libs/PanoCompassPlugin/index.js +1 -6
- package/libs/PanoCursorRaycasterPlugin/index.js +1 -59
- package/libs/PanoDoorLabelPlugin/BaseController.js +1 -59
- package/libs/PanoDoorLabelPlugin/Controller.js +1 -219
- package/libs/PanoDoorLabelPlugin/DoorLabelItem.js +1 -65
- package/libs/PanoDoorLabelPlugin/index.js +1 -6
- package/libs/PanoDoorLabelPlugin/utils.js +1 -23
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +1 -53
- package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -102
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +1 -125
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +1 -33
- package/libs/PanoMeasurePlugin/Controller/ViewController.js +1 -90
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +1 -154
- package/libs/PanoMeasurePlugin/Controller/index.js +1 -140
- package/libs/PanoMeasurePlugin/Model/index.js +1 -92
- package/libs/PanoMeasurePlugin/Model/line.js +1 -56
- package/libs/PanoMeasurePlugin/Model/point.js +1 -30
- package/libs/PanoMeasurePlugin/Model/polyline.js +1 -47
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +2 -5
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -4
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +1 -4
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +3 -67
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +1 -28
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +1 -41
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +1 -103
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +8 -12
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +1 -50
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +1 -36
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +1 -48
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +3 -8
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileMainBtnController.js +1 -39
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +1 -62
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +2 -7
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +1 -130
- package/libs/PanoMeasurePlugin/index.js +1 -11
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +1 -12
- package/libs/PanoMeasurePlugin/utils/constants.js +1 -36
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +1 -62
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.js +1 -13
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.js +1 -15
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.js +1 -9
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.js +1 -8
- package/libs/PanoMeasurePlugin/utils/ironbox.js +1 -4
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.js +1 -7
- package/libs/PanoMeasurePlugin/utils/line.js +1 -18
- package/libs/PanoMeasurePlugin/utils/math.js +1 -13
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +3 -33
- package/libs/PanoMeasurePlugin/utils/ndc2Screen.js +1 -8
- package/libs/PanoRulerPlugin/Plugin.js +2 -263
- package/libs/PanoRulerPlugin/index.js +1 -0
- package/libs/PanoRulerPlugin/style.js +2 -5
- package/libs/PanoRulerProPlugin/Controller.js +1 -93
- package/libs/PanoRulerProPlugin/RulerItem.js +1 -128
- package/libs/PanoRulerProPlugin/RulerItems.js +1 -180
- package/libs/PanoRulerProPlugin/index.js +1 -6
- package/libs/PanoSpatialTagPlugin/Components/origins.js +1 -81
- package/libs/PanoSpatialTagPlugin/Components/tag.js +1 -124
- package/libs/PanoSpatialTagPlugin/Plugin.js +1 -247
- package/libs/PanoSpatialTagPlugin/index.js +1 -0
- package/libs/PanoSpatialTagPlugin/store.js +1 -5
- package/libs/PanoSpatialTagPlugin/style.js +1 -11
- package/libs/PanoSpatialTagPlugin/typings.js +1 -0
- package/libs/PanoTagPlugin/Assets/Icon.js +1 -6
- package/libs/PanoTagPlugin/Components/Common/Arrow.js +1 -103
- package/libs/PanoTagPlugin/Components/Common/Audio.js +1 -166
- package/libs/PanoTagPlugin/Components/Common/Line/Polyline.js +1 -93
- package/libs/PanoTagPlugin/Components/Common/Line/Straight.js +1 -90
- package/libs/PanoTagPlugin/Components/Common/Media.js +1 -393
- package/libs/PanoTagPlugin/Components/Common/MediaItem.js +1 -139
- package/libs/PanoTagPlugin/Components/Common/MultiLineText.js +1 -170
- package/libs/PanoTagPlugin/Components/Common/Point/CustomPoint.js +1 -51
- package/libs/PanoTagPlugin/Components/Common/Point/DefaultPoint.js +1 -51
- package/libs/PanoTagPlugin/Components/Common/Point/PointSwitch.js +1 -166
- package/libs/PanoTagPlugin/Components/Common/Shadow.js +15 -124
- package/libs/PanoTagPlugin/Components/Common/Text.js +1 -131
- package/libs/PanoTagPlugin/Components/Tag/AudioTag.js +1 -134
- package/libs/PanoTagPlugin/Components/Tag/CustomTag.js +1 -73
- package/libs/PanoTagPlugin/Components/Tag/ImageTextTag.js +1 -192
- package/libs/PanoTagPlugin/Components/Tag/LinkTag.js +1 -126
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +1 -258
- package/libs/PanoTagPlugin/Components/Tag/MediaPlane.js +1 -87
- package/libs/PanoTagPlugin/Components/Tag/TextTag.js +1 -122
- package/libs/PanoTagPlugin/Components/Tag/index.js +2 -289
- package/libs/PanoTagPlugin/Components/TagContainer.js +1 -156
- package/libs/PanoTagPlugin/Components/TagWrapper.js +1 -153
- package/libs/PanoTagPlugin/controller/TagCacheController.js +1 -31
- package/libs/PanoTagPlugin/controller/TagComputer.js +1 -264
- package/libs/PanoTagPlugin/controller/index.js +1 -377
- package/libs/PanoTagPlugin/index.js +1 -9
- package/libs/PanoTagPlugin/tag.config.js +1 -44
- package/libs/PanoTagPlugin/typings/controller.js +1 -0
- package/libs/PanoTagPlugin/typings/index.js +1 -0
- package/libs/PanoTagPlugin/typings/tag.js +1 -7
- package/libs/PanoTagPlugin/utils/actionAfterFiveModelLoad.js +1 -6
- package/libs/PanoTagPlugin/utils/addDebugPoints.js +1 -27
- package/libs/PanoTagPlugin/utils/checkRange.js +1 -10
- package/libs/PanoTagPlugin/utils/constants.js +1 -8
- package/libs/PanoTagPlugin/utils/debounce.js +1 -12
- package/libs/PanoTagPlugin/utils/doUtil.js +1 -12
- package/libs/PanoTagPlugin/utils/index.js +1 -0
- package/libs/PanoTagPlugin/utils/noTypecheck.js +1 -4
- package/libs/PanoTagPlugin/utils/normalPositionToPositions.js +1 -13
- package/libs/PanoTagPlugin/utils/planeNormal.js +1 -11
- package/libs/PanoTagPlugin/utils/resizeObserver.js +1 -17
- package/libs/PanoTagPlugin/utils/search.js +1 -15
- package/libs/PanoTagPlugin/utils/tagPosition.js +1 -13
- package/libs/PanoTagPlugin/utils/throttle.js +1 -11
- package/libs/base/BasePlugin.js +1 -18
- package/libs/base/BasePluginWithData.js +1 -6
- package/libs/components/PaintBrush/Controller.js +1 -308
- package/libs/components/PaintBrush/Subscribe.js +1 -47
- package/libs/components/PaintBrush/index.js +1 -45
- package/libs/components/PaintBrush/style.js +2 -5
- package/libs/components/PaintBrush/tween.js +1 -11
- package/libs/components/PaintBrush/typings.js +1 -4
- package/libs/components/PaintBrush/utils.js +1 -45
- package/libs/components/index.js +1 -0
- package/libs/floorplan/Assets/camera.js +1 -4
- package/libs/floorplan/Assets/compass.js +1 -4
- package/libs/floorplan/Assets/floorplanExtraObject.js +1 -4
- package/libs/floorplan/Components/BaseImage.js +1 -103
- package/libs/floorplan/Components/Camera.js +1 -62
- package/libs/floorplan/Components/Compass.js +1 -60
- package/libs/floorplan/Components/CurrentFloor.js +1 -246
- package/libs/floorplan/Components/Main.js +1 -264
- package/libs/floorplan/Components/Normalmage.js +1 -37
- package/libs/floorplan/Components/RoomHighlight/Room.js +1 -61
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +1 -121
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +1 -153
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +1 -174
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +1 -196
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +1 -37
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +1 -39
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +1 -37
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +1 -134
- package/libs/floorplan/Components/RuleLabels/RuleLabels.js +1 -139
- package/libs/floorplan/Components/SvgImage.js +2 -39
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +1 -321
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +1 -6
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +1 -316
- package/libs/floorplan/ModelFloorplanPlugin/index.js +1 -6
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +1 -85
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +1 -129
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +1 -72
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +1 -183
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +1 -164
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +1 -6
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +1 -273
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +1 -6
- package/libs/floorplan/constant.js +1 -4
- package/libs/floorplan/index.js +1 -0
- package/libs/floorplan/typings/floorplanData.js +1 -0
- package/libs/floorplan/typings/floorplanServerData.js +1 -101
- package/libs/floorplan/utils/constant.js +1 -7
- package/libs/floorplan/utils/correctFiveState.js +1 -54
- package/libs/floorplan/utils/formatData.js +1 -104
- package/libs/floorplan/utils/formatPosition.js +1 -35
- package/libs/index.js +1 -92
- package/libs/shared-utils/Object3DHelper/Base/BaseController.js +1 -152
- package/libs/shared-utils/Object3DHelper/Base/BaseHelper.js +1 -53
- package/libs/shared-utils/Object3DHelper/Constants/color.js +1 -21
- package/libs/shared-utils/Object3DHelper/Controller/CSS3DScaleController.js +1 -18
- package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +1 -66
- package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.js +1 -109
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +1 -134
- package/libs/shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js +1 -79
- package/libs/shared-utils/Object3DHelper/Helper/HTML/tipsDom.js +1 -41
- package/libs/shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js +1 -14
- package/libs/shared-utils/Object3DHelper/Helper/MoveHelper.js +1 -30
- package/libs/shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js +1 -35
- package/libs/shared-utils/Object3DHelper/Helper/OutlineHelper.js +1 -2
- package/libs/shared-utils/Object3DHelper/Helper/RectangleScaleHelper.js +1 -137
- package/libs/shared-utils/Object3DHelper/Helper/RotateHelper.js +1 -136
- package/libs/shared-utils/Object3DHelper/Helper/index.js +1 -0
- package/libs/shared-utils/Object3DHelper/index.js +1 -169
- package/libs/shared-utils/Object3DHelper/typings/Direction.js +1 -0
- package/libs/shared-utils/Object3DHelper/typings/Hooks.js +1 -0
- package/libs/shared-utils/Object3DHelper/typings/Scissor.js +1 -0
- package/libs/shared-utils/Object3DHelper/typings/index.js +1 -0
- package/libs/shared-utils/Object3DHelper/utils/calculateThreeMouse.js +1 -11
- package/libs/shared-utils/Object3DHelper/utils/direction.js +1 -22
- package/libs/shared-utils/Object3DHelper/utils/filterNotColinearPoints.js +1 -0
- package/libs/shared-utils/Object3DHelper/utils/getMouseRaycaster.js +1 -14
- package/libs/shared-utils/Object3DHelper/utils/getPoint.js +1 -0
- package/libs/shared-utils/Object3DHelper/utils/index.js +1 -0
- package/libs/shared-utils/Object3DHelper/utils/normalPositionToPositions.js +1 -0
- package/libs/shared-utils/Object3DHelper/utils/object3DBoundingPosition.js +1 -0
- package/libs/shared-utils/Object3DHelper/utils/threex/domevents/index.js +1 -191
- package/libs/shared-utils/Object3DHelper/utils/vectorIsEqual.js +1 -6
- package/libs/shared-utils/Subscribe.js +1 -50
- package/libs/shared-utils/animationFrame/BetterTween.js +1 -26
- package/libs/shared-utils/animationFrame/calculateProgress.js +1 -6
- package/libs/shared-utils/animationFrame/formatRad.js +1 -11
- package/libs/shared-utils/animationFrame/index.js +1 -31
- package/libs/shared-utils/animationFrame/tween.js +1 -30
- package/libs/shared-utils/changeModelCanvasOpacity.js +1 -12
- package/libs/shared-utils/createCanvasTextTexture.js +1 -11
- package/libs/shared-utils/createLine/index.js +1 -9
- package/libs/shared-utils/debounce.js +1 -11
- package/libs/shared-utils/equal.js +1 -54
- package/libs/shared-utils/filter.js +1 -10
- package/libs/shared-utils/five/changeMode.js +1 -39
- package/libs/shared-utils/getPxmm.js +1 -21
- package/libs/shared-utils/index.js +1 -31
- package/libs/shared-utils/isNil.js +1 -10
- package/libs/shared-utils/isTruelyObject.js +1 -6
- package/libs/shared-utils/math/Interval.js +1 -23
- package/libs/shared-utils/math/Rectangle.js +1 -23
- package/libs/shared-utils/math/index.js +1 -0
- package/libs/shared-utils/math/planimetry.js +1 -48
- package/libs/shared-utils/math/rad2Deg.js +1 -6
- package/libs/shared-utils/nearlyEqual.js +1 -6
- package/libs/shared-utils/nextFrame.js +1 -6
- package/libs/shared-utils/noop.js +1 -5
- package/libs/shared-utils/object3d2LocalMatrix.js +1 -19
- package/libs/shared-utils/removeArrayItem.js +1 -8
- package/libs/shared-utils/tap.js +1 -6
- package/libs/shared-utils/three/Assets/index.js +1 -4
- package/libs/shared-utils/three/FivePointSelector.js +1 -49
- package/libs/shared-utils/three/Magnifier.js +1 -104
- package/libs/shared-utils/three/PointDomHelper.js +1 -60
- package/libs/shared-utils/three/PointHelper.js +3 -60
- package/libs/shared-utils/three/getCoords.js +1 -13
- package/libs/shared-utils/three/getIntersect.js +1 -8
- package/libs/shared-utils/three/getRaycaster.js +1 -12
- package/libs/shared-utils/three/index.js +1 -0
- package/libs/shared-utils/three/loadTexture.js +1 -28
- package/libs/shared-utils/three/transformPositionToVector3.js +1 -5
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +1 -24
- package/libs/shared-utils/throttle.js +1 -11
- package/libs/shared-utils/tinyEJSrender.js +14 -138
- package/libs/shared-utils/to.js +1 -29
- package/libs/shared-utils/uuid.js +1 -10
- package/libs/vendor/swiper/components-shared/get-changed-params.js +1 -0
- package/libs/vendor/swiper/components-shared/get-params.js +1 -0
- package/libs/vendor/swiper/components-shared/mount-swiper.js +1 -0
- package/libs/vendor/swiper/components-shared/params-list.js +1 -0
- package/libs/vendor/swiper/components-shared/update-swiper.js +1 -0
- package/libs/vendor/swiper/components-shared/utils.js +1 -0
- package/libs/vendor/swiper/svelte/swiper-slide.js +1 -0
- package/libs/vendor/swiper/svelte/swiper-svelte.js +1 -0
- package/libs/vendor/swiper/svelte/swiper.js +1 -0
- package/package.json +187 -17
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/get-changed-params.js +0 -29
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/get-params.js +0 -23
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/mount-swiper.js +0 -14
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/params-list.js +0 -120
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/update-swiper.js +0 -36
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/components-shared/utils.js +0 -32
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/svelte/swiper-slide.js +0 -182
- package/libs/node_modules/.pnpm/swiper@8.4.4/node_modules/swiper/svelte/swiper.js +0 -254
|
@@ -1,125 +1 @@
|
|
|
1
|
-
var b =
|
|
2
|
-
var k = (h, n, e) => n in h ? b(h, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[n] = e;
|
|
3
|
-
var t = (h, n, e) => (k(h, typeof n != "symbol" ? n + "" : n, e), e);
|
|
4
|
-
import { Model as S } from "../Model/index.js";
|
|
5
|
-
import T from "../Model/line.js";
|
|
6
|
-
import D from "./BaseController.js";
|
|
7
|
-
import M from "../Modules/DeleteDom/index.js";
|
|
8
|
-
import { findAssociatedLines as G } from "../utils/findAssociatedLines.js";
|
|
9
|
-
import { Vector2 as m } from "three";
|
|
10
|
-
import v from "../utils/isNDCPointInScreen.js";
|
|
11
|
-
import { closestPointOnLine as N } from "../utils/math.js";
|
|
12
|
-
class V extends D {
|
|
13
|
-
constructor(e) {
|
|
14
|
-
super(e);
|
|
15
|
-
t(this, "state", "watching");
|
|
16
|
-
t(this, "model", new S(this.config));
|
|
17
|
-
t(this, "hasAppendDashed", !1);
|
|
18
|
-
t(this, "fiveElement");
|
|
19
|
-
t(this, "mobileStartPoint", null);
|
|
20
|
-
t(this, "mobileNowPoint", null);
|
|
21
|
-
t(this, "highlightedLines", []);
|
|
22
|
-
t(this, "deleteDom");
|
|
23
|
-
t(this, "onLineChanged", () => {
|
|
24
|
-
this.hook.emit(
|
|
25
|
-
"editedLineChange",
|
|
26
|
-
this.model.lines.map((e) => e.toCompletelyJson())
|
|
27
|
-
);
|
|
28
|
-
});
|
|
29
|
-
t(this, "onWantsTapGesture", (e) => {
|
|
30
|
-
if (this.state === "editing")
|
|
31
|
-
return !1;
|
|
32
|
-
const [i] = this.five.model.intersectRaycaster(e);
|
|
33
|
-
if (!i)
|
|
34
|
-
return;
|
|
35
|
-
const s = this.five.camera, f = i.point.clone().project(s), d = this.container.clientWidth, r = this.container.clientHeight, p = new m(f.x * d, f.y * r), g = this.model.lines.map((o) => {
|
|
36
|
-
const [a, L] = o.points, l = a.position.clone().project(s), c = L.position.clone().project(s);
|
|
37
|
-
if (!v(l) && !v(c))
|
|
38
|
-
return null;
|
|
39
|
-
const C = new m(l.x * d, l.y * r), w = new m(c.x * d, c.y * r);
|
|
40
|
-
return { id: o.id, points: [C, w] };
|
|
41
|
-
}).filter((o) => !!o);
|
|
42
|
-
if (g.length === 0)
|
|
43
|
-
return;
|
|
44
|
-
const u = g.map((o) => {
|
|
45
|
-
const a = N(p, o.points);
|
|
46
|
-
return { id: o.id, distance: a.distanceTo(p) };
|
|
47
|
-
}).sort((o, a) => o.distance - a.distance)[0];
|
|
48
|
-
if (u.distance > 20)
|
|
49
|
-
return;
|
|
50
|
-
const P = this.model.lines.find(({ id: o }) => o === u.id);
|
|
51
|
-
if (!!P)
|
|
52
|
-
return this.chooseLine(P), !1;
|
|
53
|
-
});
|
|
54
|
-
t(this, "onWantsToMoveToPano", () => this.state === "watching");
|
|
55
|
-
t(this, "onCameraUpdate", () => {
|
|
56
|
-
this.updateDistanceUI(), this.dashed.distanceItem.update(this.five);
|
|
57
|
-
});
|
|
58
|
-
t(this, "updateMobileDashed", () => {
|
|
59
|
-
!this.mobileStartPoint || !this.mobileNowPoint || (this.dashed.points[0].position.copy(this.mobileStartPoint.position), this.dashed.points[1].position.copy(this.mobileNowPoint.position), this.dashed.mesh.setPoints(this.mobileStartPoint.position, this.mobileNowPoint.position), this.dashed.distanceItem.update(this.five));
|
|
60
|
-
});
|
|
61
|
-
t(this, "updateMagnifier", (e) => {
|
|
62
|
-
this.magnifier.visible === !1 && this.magnifier.appendTo(this.container), requestAnimationFrame(() => this.magnifier.renderWithPoint(e.position)), this.five.needsRender = !0;
|
|
63
|
-
});
|
|
64
|
-
t(this, "onGetStartPoint", (e) => {
|
|
65
|
-
this.mobileStartPoint = e;
|
|
66
|
-
});
|
|
67
|
-
t(this, "onGetEndPoint", (e) => {
|
|
68
|
-
const i = this.mobileNowPoint;
|
|
69
|
-
if (this.removeLine(this.dashed), this.hasAppendDashed = !1, this.mobileStartPoint && i) {
|
|
70
|
-
const s = new T(this.mobileStartPoint, i, this.model);
|
|
71
|
-
s.distanceItem.appendTo(this.container), s.distanceItem.update(this.five), s.hook.on("selected", this.chooseLine), this.group.add(s.mesh), this.model.addLine(s);
|
|
72
|
-
}
|
|
73
|
-
this.mobileStartPoint = null, this.mobileNowPoint = null, this.five.needsRender = !0;
|
|
74
|
-
});
|
|
75
|
-
t(this, "onNowPointChange", (e) => {
|
|
76
|
-
if (this.state === "watching") {
|
|
77
|
-
this.mobileNowPoint = e, this.updateMagnifier(e);
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
this.hasAppendDashed || (this.dashed.distanceItem.appendTo(this.container), this.group.add(this.dashed.mesh), this.hasAppendDashed = !0), this.five.needsRender = !0, this.mobileNowPoint = e, this.updateMobileDashed(), this.updateMagnifier(e), this.five.needsRender = !0;
|
|
81
|
-
});
|
|
82
|
-
t(this, "onWillChangeState", (e, i) => {
|
|
83
|
-
this.state = i, this.state === "watching" ? this.five.helperVisible = !0 : this.five.helperVisible = !1;
|
|
84
|
-
});
|
|
85
|
-
t(this, "chooseLine", (e) => {
|
|
86
|
-
const i = G(e);
|
|
87
|
-
this.highlightLines(i), this.five.needsRender = !0, this.hook.emit(
|
|
88
|
-
"selectedChange",
|
|
89
|
-
i.map((s) => s.toCompletelyJson())
|
|
90
|
-
);
|
|
91
|
-
});
|
|
92
|
-
t(this, "deleteDomClickCallback", () => {
|
|
93
|
-
this.highlightedLines.forEach((e) => {
|
|
94
|
-
this.removeLine(e), this.model.removeLine(e);
|
|
95
|
-
}), this.highlightedLines = [], this.deleteDom.setLines([]).hide();
|
|
96
|
-
});
|
|
97
|
-
t(this, "cancelDeleteClickCallback", () => {
|
|
98
|
-
this.clearHighlightLines();
|
|
99
|
-
});
|
|
100
|
-
this.deleteDom = new M(this.five, {
|
|
101
|
-
onClick: this.deleteDomClickCallback,
|
|
102
|
-
cancelDelete: this.cancelDeleteClickCallback
|
|
103
|
-
}).appendTo(this.container), this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("wantsTapGesture", this.onWantsTapGesture), this.five.on("wantsToMoveToPano", this.onWantsToMoveToPano), this.model.hook.on("lineAdded", this.onLineChanged), this.model.hook.on("lineRemoved", this.onLineChanged), this.hook.on("getStartPoint", this.onGetStartPoint), this.hook.on("getEndPoint", this.onGetEndPoint), this.hook.on("nowPointChange", this.onNowPointChange), this.hook.on("willChangeState", this.onWillChangeState), this.five.refresh();
|
|
104
|
-
}
|
|
105
|
-
dispose() {
|
|
106
|
-
super.dispose(), this.group.remove(this.mouseGroup, this.dashed.mesh), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("wantsTapGesture", this.onWantsTapGesture), this.five.off("wantsToMoveToPano", this.onWantsToMoveToPano), this.model.hook.off("lineAdded", this.onLineChanged), this.model.hook.off("lineRemoved", this.onLineChanged), this.hook.off("getStartPoint", this.onGetStartPoint), this.hook.off("getEndPoint", this.onGetEndPoint), this.hook.off("nowPointChange", this.onNowPointChange), this.hook.off("willChangeState", this.onWillChangeState), this.hook.emit("selectedChange", []), this.dashed.distanceItem.remove(), this.five.needsRender = !0;
|
|
107
|
-
}
|
|
108
|
-
highlightLine(e) {
|
|
109
|
-
e.selected || (e.selected = !0, this.group.add(e.lightMesh), e.distanceItem.highlight(), this.five.needsRender = !0);
|
|
110
|
-
}
|
|
111
|
-
clearHighlightLines() {
|
|
112
|
-
this.group.children.length !== 0 && (this.deleteDom.setLines([]).hide(), this.model.lines.forEach((e) => {
|
|
113
|
-
e.selected = !1, e.distanceItem.unHighlight(), this.group.remove(e.lightMesh);
|
|
114
|
-
}), this.highlightedLines = [], this.five.needsRender = !0);
|
|
115
|
-
}
|
|
116
|
-
getEditingLines() {
|
|
117
|
-
return this.model.lines;
|
|
118
|
-
}
|
|
119
|
-
highlightLines(e) {
|
|
120
|
-
this.clearHighlightLines(), this.highlightedLines = e, this.deleteDom.setLines(e).updatePosition().show(), e.forEach((i) => this.highlightLine(i));
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
export {
|
|
124
|
-
V as default
|
|
125
|
-
};
|
|
1
|
+
"use strict";var M=Object.defineProperty;var D=(h,o,e)=>o in h?M(h,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):h[o]=e;var t=(h,o,e)=>(D(h,typeof o!="symbol"?o+"":o,e),e);const S=require("../Model/index.js"),b=require("../Model/line.js"),k=require("./BaseController.js"),T=require("../Modules/DeleteDom/index.js"),N=require("../utils/findAssociatedLines.js"),u=require("three"),C=require("../utils/isNDCPointInScreen.js"),_=require("../utils/math.js");class E extends k.BaseController{constructor(e){super(e);t(this,"state","watching");t(this,"model",new S.Model(this.config));t(this,"hasAppendDashed",!1);t(this,"fiveElement");t(this,"mobileStartPoint",null);t(this,"mobileNowPoint",null);t(this,"highlightedLines",[]);t(this,"deleteDom");t(this,"onLineChanged",()=>{this.hook.emit("editedLineChange",this.model.lines.map(e=>e.toCompletelyJson()))});t(this,"onWantsTapGesture",e=>{if(this.state==="editing")return!1;const[i]=this.five.model.intersectRaycaster(e);if(!i)return;const s=this.five.camera,g=i.point.clone().project(s),d=this.container.clientWidth,r=this.container.clientHeight,m=new u.Vector2(g.x*d,g.y*r),f=this.model.lines.map(n=>{const[a,L]=n.points,l=a.position.clone().project(s),c=L.position.clone().project(s);if(!C.isNDCPointInScreen(l)&&!C.isNDCPointInScreen(c))return null;const v=new u.Vector2(l.x*d,l.y*r),w=new u.Vector2(c.x*d,c.y*r);return{id:n.id,points:[v,w]}}).filter(n=>!!n);if(f.length===0)return;const p=f.map(n=>{const a=_.closestPointOnLine(m,n.points);return{id:n.id,distance:a.distanceTo(m)}}).sort((n,a)=>n.distance-a.distance)[0];if(p.distance>20)return;const P=this.model.lines.find(({id:n})=>n===p.id);if(!!P)return this.chooseLine(P),!1});t(this,"onWantsToMoveToPano",()=>this.state==="watching");t(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});t(this,"updateMobileDashed",()=>{!this.mobileStartPoint||!this.mobileNowPoint||(this.dashed.points[0].position.copy(this.mobileStartPoint.position),this.dashed.points[1].position.copy(this.mobileNowPoint.position),this.dashed.mesh.setPoints(this.mobileStartPoint.position,this.mobileNowPoint.position),this.dashed.distanceItem.update(this.five))});t(this,"updateMagnifier",e=>{this.magnifier.visible===!1&&this.magnifier.appendTo(this.container),requestAnimationFrame(()=>this.magnifier.renderWithPoint(e.position)),this.five.needsRender=!0});t(this,"onGetStartPoint",e=>{this.mobileStartPoint=e});t(this,"onGetEndPoint",e=>{const i=this.mobileNowPoint;if(this.removeLine(this.dashed),this.hasAppendDashed=!1,this.mobileStartPoint&&i){const s=new b.Line(this.mobileStartPoint,i,this.model);s.distanceItem.appendTo(this.container),s.distanceItem.update(this.five),s.hook.on("selected",this.chooseLine),this.group.add(s.mesh),this.model.addLine(s)}this.mobileStartPoint=null,this.mobileNowPoint=null,this.five.needsRender=!0});t(this,"onNowPointChange",e=>{if(this.state==="watching"){this.mobileNowPoint=e,this.updateMagnifier(e);return}this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh),this.hasAppendDashed=!0),this.five.needsRender=!0,this.mobileNowPoint=e,this.updateMobileDashed(),this.updateMagnifier(e),this.five.needsRender=!0});t(this,"onWillChangeState",(e,i)=>{this.state=i,this.state==="watching"?this.five.helperVisible=!0:this.five.helperVisible=!1});t(this,"chooseLine",e=>{const i=N.findAssociatedLines(e);this.highlightLines(i),this.five.needsRender=!0,this.hook.emit("selectedChange",i.map(s=>s.toCompletelyJson()))});t(this,"deleteDomClickCallback",()=>{this.highlightedLines.forEach(e=>{this.removeLine(e),this.model.removeLine(e)}),this.highlightedLines=[],this.deleteDom.setLines([]).hide()});t(this,"cancelDeleteClickCallback",()=>{this.clearHighlightLines()});this.deleteDom=new T.DeleteDom(this.five,{onClick:this.deleteDomClickCallback,cancelDelete:this.cancelDeleteClickCallback}).appendTo(this.container),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsTapGesture",this.onWantsTapGesture),this.five.on("wantsToMoveToPano",this.onWantsToMoveToPano),this.model.hook.on("lineAdded",this.onLineChanged),this.model.hook.on("lineRemoved",this.onLineChanged),this.hook.on("getStartPoint",this.onGetStartPoint),this.hook.on("getEndPoint",this.onGetEndPoint),this.hook.on("nowPointChange",this.onNowPointChange),this.hook.on("willChangeState",this.onWillChangeState),this.five.refresh()}dispose(){super.dispose(),this.group.remove(this.mouseGroup,this.dashed.mesh),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsTapGesture",this.onWantsTapGesture),this.five.off("wantsToMoveToPano",this.onWantsToMoveToPano),this.model.hook.off("lineAdded",this.onLineChanged),this.model.hook.off("lineRemoved",this.onLineChanged),this.hook.off("getStartPoint",this.onGetStartPoint),this.hook.off("getEndPoint",this.onGetEndPoint),this.hook.off("nowPointChange",this.onNowPointChange),this.hook.off("willChangeState",this.onWillChangeState),this.hook.emit("selectedChange",[]),this.dashed.distanceItem.remove(),this.five.needsRender=!0}highlightLine(e){e.selected||(e.selected=!0,this.group.add(e.lightMesh),e.distanceItem.highlight(),this.five.needsRender=!0)}clearHighlightLines(){this.group.children.length!==0&&(this.deleteDom.setLines([]).hide(),this.model.lines.forEach(e=>{e.selected=!1,e.distanceItem.unHighlight(),this.group.remove(e.lightMesh)}),this.highlightedLines=[],this.five.needsRender=!0)}getEditingLines(){return this.model.lines}highlightLines(e){this.clearHighlightLines(),this.highlightedLines=e,this.deleteDom.setLines(e).updatePosition().show(),e.forEach(i=>this.highlightLine(i))}}exports.MixedController=E;
|
|
@@ -1,33 +1 @@
|
|
|
1
|
-
var s
|
|
2
|
-
var i = (o, e, t) => e in o ? s(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
-
var n = (o, e, t) => (i(o, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
-
class a {
|
|
5
|
-
constructor(e, t) {
|
|
6
|
-
n(this, "five");
|
|
7
|
-
n(this, "measureController");
|
|
8
|
-
n(this, "onKeyDown", (e) => {
|
|
9
|
-
if (e.metaKey && e.code === "KeyS") {
|
|
10
|
-
this.measureController.save().changeMode("Watch"), e.preventDefault();
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
if (e.code === "Escape")
|
|
14
|
-
return this.escape();
|
|
15
|
-
});
|
|
16
|
-
n(this, "onMouseDown", (e) => {
|
|
17
|
-
e.button === 2 && (e.preventDefault(), this.escape());
|
|
18
|
-
});
|
|
19
|
-
this.five = t, this.measureController = e;
|
|
20
|
-
const r = this.five.getElement();
|
|
21
|
-
!r || (document.body.addEventListener("keydown", this.onKeyDown), r.addEventListener("mousedown", this.onMouseDown));
|
|
22
|
-
}
|
|
23
|
-
dispose() {
|
|
24
|
-
const e = this.five.getElement();
|
|
25
|
-
!e || (document.body.removeEventListener("keydown", this.onKeyDown), e.removeEventListener("mousedown", this.onMouseDown));
|
|
26
|
-
}
|
|
27
|
-
escape() {
|
|
28
|
-
return this.measureController.getCurrentMode() === "Watch" ? this.measureController.disable() : this.measureController.changeMode("Watch");
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
export {
|
|
32
|
-
a as ShortcutKeyController
|
|
33
|
-
};
|
|
1
|
+
"use strict";var s=Object.defineProperty;var i=(o,e,t)=>e in o?s(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var n=(o,e,t)=>(i(o,typeof e!="symbol"?e+"":e,t),t);class u{constructor(e,t){n(this,"five");n(this,"measureController");n(this,"onKeyDown",e=>{if(e.metaKey&&e.code==="KeyS"){this.measureController.save().changeMode("Watch"),e.preventDefault();return}if(e.code==="Escape")return this.escape()});n(this,"onMouseDown",e=>{e.button===2&&(e.preventDefault(),this.escape())});this.five=t,this.measureController=e;const r=this.five.getElement();!r||(document.body.addEventListener("keydown",this.onKeyDown),r.addEventListener("mousedown",this.onMouseDown))}dispose(){const e=this.five.getElement();!e||(document.body.removeEventListener("keydown",this.onKeyDown),e.removeEventListener("mousedown",this.onMouseDown))}escape(){return this.measureController.getCurrentMode()==="Watch"?this.measureController.disable():this.measureController.changeMode("Watch")}}exports.ShortcutKeyController=u;
|
|
@@ -1,90 +1 @@
|
|
|
1
|
-
var P =
|
|
2
|
-
var y = (h, n, e) => n in h ? P(h, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[n] = e;
|
|
3
|
-
var o = (h, n, e) => (y(h, typeof n != "symbol" ? n + "" : n, e), e);
|
|
4
|
-
import T from "hammerjs";
|
|
5
|
-
import { Vector2 as g } from "three";
|
|
6
|
-
import { closestPointOnLine as H } from "../utils/math.js";
|
|
7
|
-
import L from "../utils/isNDCPointInScreen.js";
|
|
8
|
-
import { findAssociatedLines as k } from "../utils/findAssociatedLines.js";
|
|
9
|
-
import E from "./BaseController.js";
|
|
10
|
-
class M extends E {
|
|
11
|
-
constructor(e) {
|
|
12
|
-
super(e);
|
|
13
|
-
o(this, "type", "view");
|
|
14
|
-
o(this, "highlightedLines", []);
|
|
15
|
-
o(this, "hammer");
|
|
16
|
-
o(this, "wantsTapGesture", (e) => {
|
|
17
|
-
if (this.model.lines.length === 0)
|
|
18
|
-
return;
|
|
19
|
-
const [t] = this.five.model.intersectRaycaster(e);
|
|
20
|
-
if (!t)
|
|
21
|
-
return;
|
|
22
|
-
const i = this.five.camera, f = t.point.clone().project(i), c = this.container.clientWidth, a = this.container.clientHeight, p = new g(f.x * c, f.y * a), u = this.model.lines.map((s) => {
|
|
23
|
-
const [r, w] = s.points, l = r.position.clone().project(i), m = w.position.clone().project(i);
|
|
24
|
-
if (!L(l) && !L(m))
|
|
25
|
-
return null;
|
|
26
|
-
const C = new g(
|
|
27
|
-
l.x * c,
|
|
28
|
-
l.y * a
|
|
29
|
-
), R = new g(
|
|
30
|
-
m.x * c,
|
|
31
|
-
m.y * a
|
|
32
|
-
);
|
|
33
|
-
return { id: s.id, points: [C, R] };
|
|
34
|
-
}).filter((s) => !!s);
|
|
35
|
-
if (u.length === 0)
|
|
36
|
-
return;
|
|
37
|
-
const v = u.map((s) => {
|
|
38
|
-
const r = H(p, s.points);
|
|
39
|
-
return { id: s.id, distance: r.distanceTo(p) };
|
|
40
|
-
}).sort((s, r) => s.distance - r.distance)[0], d = v.distance > 20 ? void 0 : this.model.lines.find(({ id: s }) => s === v.id);
|
|
41
|
-
if (this.highlightedLines.length > 0 && !d)
|
|
42
|
-
return this.clearHighlightLines(), !1;
|
|
43
|
-
if (d)
|
|
44
|
-
return this.chooseLine(d), !1;
|
|
45
|
-
});
|
|
46
|
-
o(this, "chooseLine", (e) => {
|
|
47
|
-
const t = k(e);
|
|
48
|
-
this.highlightLines(t), this.five.needsRender = !0, this.hook.emit(
|
|
49
|
-
"selectedChange",
|
|
50
|
-
t.map((i) => i.toCompletelyJson())
|
|
51
|
-
);
|
|
52
|
-
});
|
|
53
|
-
o(this, "lineRemoved", (e) => {
|
|
54
|
-
this.removeLine(e), this.hook.emit(
|
|
55
|
-
"selectedChange",
|
|
56
|
-
this.model.lines.filter((t) => t.selected).map((t) => t.toCompletelyJson())
|
|
57
|
-
);
|
|
58
|
-
});
|
|
59
|
-
o(this, "onCameraUpdate", () => {
|
|
60
|
-
this.updateDistanceUI();
|
|
61
|
-
});
|
|
62
|
-
this.model.lines.forEach((i) => {
|
|
63
|
-
i.distanceItem.appendTo(this.container), i.distanceItem.update(this.five), i.hook.on("selected", this.chooseLine), this.group.add(i.mesh);
|
|
64
|
-
});
|
|
65
|
-
const t = this.five.getElement();
|
|
66
|
-
if (t) {
|
|
67
|
-
const i = new T(t);
|
|
68
|
-
this.hammer = i;
|
|
69
|
-
}
|
|
70
|
-
this.model.hook.on("lineRemoved", this.lineRemoved), this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("wantsTapGesture", this.wantsTapGesture), this.five.needsRender = !0;
|
|
71
|
-
}
|
|
72
|
-
dispose() {
|
|
73
|
-
var e;
|
|
74
|
-
super.dispose(), this.model.hook.off("lineRemoved", this.lineRemoved), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("wantsTapGesture", this.wantsTapGesture), this.five.needsRender = !0, this.hook.emit("selectedChange", []), (e = this.hammer) == null || e.destroy();
|
|
75
|
-
}
|
|
76
|
-
highlightLine(e) {
|
|
77
|
-
e.selected || (e.selected = !0, this.group.add(e.lightMesh), e.distanceItem.highlight(), this.five.needsRender = !0);
|
|
78
|
-
}
|
|
79
|
-
clearHighlightLines() {
|
|
80
|
-
this.group.children.length !== 0 && (this.model.lines.forEach((e) => {
|
|
81
|
-
e.selected = !1, e.distanceItem.unHighlight(), this.group.remove(e.lightMesh);
|
|
82
|
-
}), this.highlightedLines = [], this.five.needsRender = !0);
|
|
83
|
-
}
|
|
84
|
-
highlightLines(e) {
|
|
85
|
-
this.clearHighlightLines(), this.highlightedLines = e, e.forEach((t) => this.highlightLine(t));
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
export {
|
|
89
|
-
M as default
|
|
90
|
-
};
|
|
1
|
+
"use strict";var R=Object.defineProperty;var _=(i,o,e)=>o in i?R(i,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[o]=e;var r=(i,o,e)=>(_(i,typeof o!="symbol"?o+"":o,e),e);const y=require("hammerjs"),m=require("three"),j=require("../utils/math.js"),v=require("../utils/isNDCPointInScreen.js"),H=require("../utils/findAssociatedLines.js"),I=require("./BaseController.js"),S=i=>i&&typeof i=="object"&&"default"in i?i:{default:i},T=S(y);class E extends I.BaseController{constructor(e){super(e);r(this,"type","view");r(this,"highlightedLines",[]);r(this,"hammer");r(this,"wantsTapGesture",e=>{if(this.model.lines.length===0)return;const[t]=this.five.model.intersectRaycaster(e);if(!t)return;const s=this.five.camera,g=t.point.clone().project(s),c=this.container.clientWidth,a=this.container.clientHeight,f=new m.Vector2(g.x*c,g.y*a),p=this.model.lines.map(n=>{const[h,P]=n.points,d=h.position.clone().project(s),u=P.position.clone().project(s);if(!v.isNDCPointInScreen(d)&&!v.isNDCPointInScreen(u))return null;const C=new m.Vector2(d.x*c,d.y*a),w=new m.Vector2(u.x*c,u.y*a);return{id:n.id,points:[C,w]}}).filter(n=>!!n);if(p.length===0)return;const L=p.map(n=>{const h=j.closestPointOnLine(f,n.points);return{id:n.id,distance:h.distanceTo(f)}}).sort((n,h)=>n.distance-h.distance)[0],l=L.distance>20?void 0:this.model.lines.find(({id:n})=>n===L.id);if(this.highlightedLines.length>0&&!l)return this.clearHighlightLines(),!1;if(l)return this.chooseLine(l),!1});r(this,"chooseLine",e=>{const t=H.findAssociatedLines(e);this.highlightLines(t),this.five.needsRender=!0,this.hook.emit("selectedChange",t.map(s=>s.toCompletelyJson()))});r(this,"lineRemoved",e=>{this.removeLine(e),this.hook.emit("selectedChange",this.model.lines.filter(t=>t.selected).map(t=>t.toCompletelyJson()))});r(this,"onCameraUpdate",()=>{this.updateDistanceUI()});this.model.lines.forEach(s=>{s.distanceItem.appendTo(this.container),s.distanceItem.update(this.five),s.hook.on("selected",this.chooseLine),this.group.add(s.mesh)});const t=this.five.getElement();if(t){const s=new T.default(t);this.hammer=s}this.model.hook.on("lineRemoved",this.lineRemoved),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsTapGesture",this.wantsTapGesture),this.five.needsRender=!0}dispose(){var e;super.dispose(),this.model.hook.off("lineRemoved",this.lineRemoved),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsTapGesture",this.wantsTapGesture),this.five.needsRender=!0,this.hook.emit("selectedChange",[]),(e=this.hammer)==null||e.destroy()}highlightLine(e){e.selected||(e.selected=!0,this.group.add(e.lightMesh),e.distanceItem.highlight(),this.five.needsRender=!0)}clearHighlightLines(){this.group.children.length!==0&&(this.model.lines.forEach(e=>{e.selected=!1,e.distanceItem.unHighlight(),this.group.remove(e.lightMesh)}),this.highlightedLines=[],this.five.needsRender=!0)}highlightLines(e){this.clearHighlightLines(),this.highlightedLines=e,e.forEach(t=>this.highlightLine(t))}}exports.ViewController=E;
|
|
@@ -1,154 +1 @@
|
|
|
1
|
-
var w =
|
|
2
|
-
var y = (r, h, e) => h in r ? w(r, h, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[h] = e;
|
|
3
|
-
var s = (r, h, e) => (y(r, typeof h != "symbol" ? h + "" : h, e), e);
|
|
4
|
-
import E from "hammerjs";
|
|
5
|
-
import G from "../Modules/DeleteDom/index.js";
|
|
6
|
-
import L from "../utils/isNDCPointInScreen.js";
|
|
7
|
-
import R from "./BaseController.js";
|
|
8
|
-
import { Raycaster as T, Vector2 as f } from "three";
|
|
9
|
-
import { closestPointOnLine as H } from "../utils/math.js";
|
|
10
|
-
import { findClosestPoint as I } from "../utils/findClosestPoint.js";
|
|
11
|
-
import { findAssociatedLines as v } from "../utils/findAssociatedLines.js";
|
|
12
|
-
import { getPointFromHammerEvent as C } from "../utils/getPointFromHammerEvent.js";
|
|
13
|
-
class B extends R {
|
|
14
|
-
constructor(e) {
|
|
15
|
-
super(e);
|
|
16
|
-
s(this, "type", "watch");
|
|
17
|
-
s(this, "deleteDom");
|
|
18
|
-
s(this, "highlightedLines", []);
|
|
19
|
-
s(this, "fiveElement");
|
|
20
|
-
s(this, "editPointState");
|
|
21
|
-
s(this, "hammer");
|
|
22
|
-
s(this, "onPanStart", (e) => {
|
|
23
|
-
var a;
|
|
24
|
-
if (this.model.points.length === 0 || !this.fiveElement)
|
|
25
|
-
return;
|
|
26
|
-
const i = C(e).point, t = (a = I(this.five, this.model.points, i, 20)) == null ? void 0 : a.point;
|
|
27
|
-
if (!t) {
|
|
28
|
-
this.editPointState = void 0;
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const n = {
|
|
32
|
-
point: t,
|
|
33
|
-
associatedLines: v(t.lines[0])
|
|
34
|
-
};
|
|
35
|
-
this.hook.emit("wantsDragLine", {
|
|
36
|
-
point: t.id,
|
|
37
|
-
lines: n.associatedLines.map(({ id: l }) => l)
|
|
38
|
-
}) || (this.editPointState = n, this.magnifier.appendTo(this.container), this.group.add(this.mouseGroup));
|
|
39
|
-
});
|
|
40
|
-
s(this, "onPanEnd", () => {
|
|
41
|
-
!this.editPointState || (this.editPointState.point.lines.forEach((e) => e.mesh.setMaterial({ dashed: !1 })), this.highlightLines(this.editPointState.associatedLines), this.editPointState = void 0, this.magnifier.remove(), this.group.remove(this.mouseGroup));
|
|
42
|
-
});
|
|
43
|
-
s(this, "onPan", (e) => {
|
|
44
|
-
if (!this.editPointState || !this.fiveElement)
|
|
45
|
-
return;
|
|
46
|
-
const i = C(e).ndcPoint, t = new T();
|
|
47
|
-
t.setFromCamera(i, this.five.camera);
|
|
48
|
-
const [n] = this.five.model.intersectRaycaster(t);
|
|
49
|
-
!n || this.onIntersectionUpdate(n);
|
|
50
|
-
});
|
|
51
|
-
s(this, "onIntersectionUpdate", (e, i) => {
|
|
52
|
-
if (!!this.editPointState) {
|
|
53
|
-
if (this.clearHighlightLines(), this.editPointState.point.position.copy(e.point), this.editPointState.point.lines.forEach((t) => {
|
|
54
|
-
t.mesh.setPoints(t.points[0].position.clone(), t.points[1].position.clone()), t.lightMesh.setPoints(t.points[0].position.clone(), t.points[1].position.clone()), t.mesh.setMaterial({ dashed: !0 });
|
|
55
|
-
}), this.updateDistanceUI(), this.magnifier.renderWithPoint(e.point), this.mouseGroup.position.copy(e.point), i)
|
|
56
|
-
this.mouseGroup.quaternion.copy(i.quaternion);
|
|
57
|
-
else if (e.face) {
|
|
58
|
-
const n = e.face.normal.clone().multiplyScalar(0.05), a = e.point.clone().add(n).clone().add(n);
|
|
59
|
-
this.mouseGroup.lookAt(a);
|
|
60
|
-
}
|
|
61
|
-
this.five.needsRender = !0, this.hook.emit(
|
|
62
|
-
"selectedChange",
|
|
63
|
-
this.editPointState.associatedLines.map((t) => t.toCompletelyJson())
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
s(this, "wantsPanGesture", () => {
|
|
68
|
-
if (this.editPointState)
|
|
69
|
-
return !1;
|
|
70
|
-
});
|
|
71
|
-
s(this, "wantsTapGesture", (e) => {
|
|
72
|
-
const [i] = this.five.model.intersectRaycaster(e);
|
|
73
|
-
if (!i)
|
|
74
|
-
return;
|
|
75
|
-
const t = this.five.camera, n = i.point.clone().project(t), c = this.container.clientWidth, a = this.container.clientHeight, l = new f(n.x * c, n.y * a), u = this.model.lines.map((o) => {
|
|
76
|
-
const [d, S] = o.points, m = d.position.clone().project(t), p = S.position.clone().project(t);
|
|
77
|
-
if (!L(m) && !L(p))
|
|
78
|
-
return null;
|
|
79
|
-
const k = new f(
|
|
80
|
-
m.x * c,
|
|
81
|
-
m.y * a
|
|
82
|
-
), D = new f(
|
|
83
|
-
p.x * c,
|
|
84
|
-
p.y * a
|
|
85
|
-
);
|
|
86
|
-
return { id: o.id, points: [k, D] };
|
|
87
|
-
}).filter((o) => !!o);
|
|
88
|
-
if (u.length === 0)
|
|
89
|
-
return;
|
|
90
|
-
const g = u.map((o) => {
|
|
91
|
-
const d = H(l, o.points);
|
|
92
|
-
return { id: o.id, distance: d.distanceTo(l) };
|
|
93
|
-
}).sort((o, d) => o.distance - d.distance)[0];
|
|
94
|
-
if (g.distance > 20)
|
|
95
|
-
return;
|
|
96
|
-
const P = this.model.lines.find(({ id: o }) => o === g.id);
|
|
97
|
-
if (!!P)
|
|
98
|
-
return this.chooseLine(P), !1;
|
|
99
|
-
});
|
|
100
|
-
s(this, "chooseLine", (e) => {
|
|
101
|
-
const i = v(e);
|
|
102
|
-
this.highlightLines(i), this.five.needsRender = !0, this.hook.emit(
|
|
103
|
-
"selectedChange",
|
|
104
|
-
i.map((t) => t.toCompletelyJson())
|
|
105
|
-
);
|
|
106
|
-
});
|
|
107
|
-
s(this, "lineRemoved", (e) => {
|
|
108
|
-
this.removeLine(e), this.hook.emit(
|
|
109
|
-
"selectedChange",
|
|
110
|
-
this.model.lines.filter((i) => i.selected).map((i) => i.toCompletelyJson())
|
|
111
|
-
);
|
|
112
|
-
});
|
|
113
|
-
s(this, "onCameraUpdate", () => {
|
|
114
|
-
this.updateDistanceUI(), this.highlightedLines.length > 0 && this.deleteDom.updatePosition();
|
|
115
|
-
});
|
|
116
|
-
s(this, "deleteDomClickCallback", () => {
|
|
117
|
-
this.highlightedLines[0].getPolyline().lines.slice().reverse().forEach((i) => this.model.removeLine(i)), this.highlightedLines = [], this.deleteDom.setLines([]).hide();
|
|
118
|
-
});
|
|
119
|
-
s(this, "cancelDeleteClickCallback", () => {
|
|
120
|
-
this.clearHighlightLines();
|
|
121
|
-
});
|
|
122
|
-
this.deleteDom = new G(this.five, {
|
|
123
|
-
onClick: this.deleteDomClickCallback,
|
|
124
|
-
cancelDelete: this.cancelDeleteClickCallback
|
|
125
|
-
}).appendTo(this.container), this.model.lines.forEach((t) => {
|
|
126
|
-
t.distanceItem.appendTo(this.container), t.distanceItem.update(this.five), t.hook.on("selected", this.chooseLine), this.group.add(t.mesh);
|
|
127
|
-
});
|
|
128
|
-
const i = this.five.getElement();
|
|
129
|
-
if (i) {
|
|
130
|
-
this.fiveElement = i;
|
|
131
|
-
const t = new E(i);
|
|
132
|
-
this.hammer = t, t.on("pan", this.onPan), t.on("panstart", this.onPanStart), t.on("panend", this.onPanEnd);
|
|
133
|
-
}
|
|
134
|
-
this.model.hook.on("lineRemoved", this.lineRemoved), this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("wantsTapGesture", this.wantsTapGesture), this.five.on("wantsPanGesture", this.wantsPanGesture), this.five.needsRender = !0;
|
|
135
|
-
}
|
|
136
|
-
dispose() {
|
|
137
|
-
var e;
|
|
138
|
-
super.dispose(), this.deleteDom.dispose(), this.model.hook.off("lineRemoved", this.lineRemoved), this.model.lines.forEach((i) => i.hook.off("selected", this.chooseLine)), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("wantsPanGesture", this.wantsPanGesture), this.five.off("wantsTapGesture", this.wantsTapGesture), this.five.needsRender = !0, this.hook.emit("selectedChange", []), (e = this.hammer) == null || e.destroy();
|
|
139
|
-
}
|
|
140
|
-
highlightLine(e) {
|
|
141
|
-
e.selected || (e.selected = !0, this.group.add(e.lightMesh), e.distanceItem.highlight(), this.five.needsRender = !0);
|
|
142
|
-
}
|
|
143
|
-
clearHighlightLines() {
|
|
144
|
-
this.group.children.length !== 0 && (this.deleteDom.setLines([]).hide(), this.model.lines.forEach((e) => {
|
|
145
|
-
e.selected = !1, e.distanceItem.unHighlight(), this.group.remove(e.lightMesh);
|
|
146
|
-
}), this.highlightedLines = [], this.five.needsRender = !0);
|
|
147
|
-
}
|
|
148
|
-
highlightLines(e) {
|
|
149
|
-
this.clearHighlightLines(), this.highlightedLines = e, this.deleteDom.setLines(e).updatePosition().show(), e.forEach((i) => this.highlightLine(i));
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
export {
|
|
153
|
-
B as default
|
|
154
|
-
};
|
|
1
|
+
"use strict";var k=Object.defineProperty;var w=(n,h,e)=>h in n?k(n,h,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[h]=e;var s=(n,h,e)=>(w(n,typeof h!="symbol"?h+"":h,e),e);const y=require("hammerjs"),_=require("../Modules/DeleteDom/index.js"),L=require("../utils/isNDCPointInScreen.js"),G=require("./BaseController.js"),m=require("three"),R=require("../utils/math.js"),H=require("../utils/findClosestPoint.js"),v=require("../utils/findAssociatedLines.js"),C=require("../utils/getPointFromHammerEvent.js"),M=n=>n&&typeof n=="object"&&"default"in n?n:{default:n},j=M(y);class I extends G.BaseController{constructor(e){super(e);s(this,"type","watch");s(this,"deleteDom");s(this,"highlightedLines",[]);s(this,"fiveElement");s(this,"editPointState");s(this,"hammer");s(this,"onPanStart",e=>{var r;if(this.model.points.length===0||!this.fiveElement)return;const i=C.getPointFromHammerEvent(e).point,t=(r=H.findClosestPoint(this.five,this.model.points,i,20))==null?void 0:r.point;if(!t){this.editPointState=void 0;return}const o={point:t,associatedLines:v.findAssociatedLines(t.lines[0])};this.hook.emit("wantsDragLine",{point:t.id,lines:o.associatedLines.map(({id:d})=>d)})||(this.editPointState=o,this.magnifier.appendTo(this.container),this.group.add(this.mouseGroup))});s(this,"onPanEnd",()=>{!this.editPointState||(this.editPointState.point.lines.forEach(e=>e.mesh.setMaterial({dashed:!1})),this.highlightLines(this.editPointState.associatedLines),this.editPointState=void 0,this.magnifier.remove(),this.group.remove(this.mouseGroup))});s(this,"onPan",e=>{if(!this.editPointState||!this.fiveElement)return;const i=C.getPointFromHammerEvent(e).ndcPoint,t=new m.Raycaster;t.setFromCamera(i,this.five.camera);const[o]=this.five.model.intersectRaycaster(t);!o||this.onIntersectionUpdate(o)});s(this,"onIntersectionUpdate",(e,i)=>{if(!!this.editPointState){if(this.clearHighlightLines(),this.editPointState.point.position.copy(e.point),this.editPointState.point.lines.forEach(t=>{t.mesh.setPoints(t.points[0].position.clone(),t.points[1].position.clone()),t.lightMesh.setPoints(t.points[0].position.clone(),t.points[1].position.clone()),t.mesh.setMaterial({dashed:!0})}),this.updateDistanceUI(),this.magnifier.renderWithPoint(e.point),this.mouseGroup.position.copy(e.point),i)this.mouseGroup.quaternion.copy(i.quaternion);else if(e.face){const o=e.face.normal.clone().multiplyScalar(.05),r=e.point.clone().add(o).clone().add(o);this.mouseGroup.lookAt(r)}this.five.needsRender=!0,this.hook.emit("selectedChange",this.editPointState.associatedLines.map(t=>t.toCompletelyJson()))}});s(this,"wantsPanGesture",()=>{if(this.editPointState)return!1});s(this,"wantsTapGesture",e=>{const[i]=this.five.model.intersectRaycaster(e);if(!i)return;const t=this.five.camera,o=i.point.clone().project(t),c=this.container.clientWidth,r=this.container.clientHeight,d=new m.Vector2(o.x*c,o.y*r),f=this.model.lines.map(a=>{const[l,D]=a.points,u=l.position.clone().project(t),p=D.position.clone().project(t);if(!L.isNDCPointInScreen(u)&&!L.isNDCPointInScreen(p))return null;const S=new m.Vector2(u.x*c,u.y*r),E=new m.Vector2(p.x*c,p.y*r);return{id:a.id,points:[S,E]}}).filter(a=>!!a);if(f.length===0)return;const g=f.map(a=>{const l=R.closestPointOnLine(d,a.points);return{id:a.id,distance:l.distanceTo(d)}}).sort((a,l)=>a.distance-l.distance)[0];if(g.distance>20)return;const P=this.model.lines.find(({id:a})=>a===g.id);if(!!P)return this.chooseLine(P),!1});s(this,"chooseLine",e=>{const i=v.findAssociatedLines(e);this.highlightLines(i),this.five.needsRender=!0,this.hook.emit("selectedChange",i.map(t=>t.toCompletelyJson()))});s(this,"lineRemoved",e=>{this.removeLine(e),this.hook.emit("selectedChange",this.model.lines.filter(i=>i.selected).map(i=>i.toCompletelyJson()))});s(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.highlightedLines.length>0&&this.deleteDom.updatePosition()});s(this,"deleteDomClickCallback",()=>{this.highlightedLines[0].getPolyline().lines.slice().reverse().forEach(i=>this.model.removeLine(i)),this.highlightedLines=[],this.deleteDom.setLines([]).hide()});s(this,"cancelDeleteClickCallback",()=>{this.clearHighlightLines()});this.deleteDom=new _.DeleteDom(this.five,{onClick:this.deleteDomClickCallback,cancelDelete:this.cancelDeleteClickCallback}).appendTo(this.container),this.model.lines.forEach(t=>{t.distanceItem.appendTo(this.container),t.distanceItem.update(this.five),t.hook.on("selected",this.chooseLine),this.group.add(t.mesh)});const i=this.five.getElement();if(i){this.fiveElement=i;const t=new j.default(i);this.hammer=t,t.on("pan",this.onPan),t.on("panstart",this.onPanStart),t.on("panend",this.onPanEnd)}this.model.hook.on("lineRemoved",this.lineRemoved),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsTapGesture",this.wantsTapGesture),this.five.on("wantsPanGesture",this.wantsPanGesture),this.five.needsRender=!0}dispose(){var e;super.dispose(),this.deleteDom.dispose(),this.model.hook.off("lineRemoved",this.lineRemoved),this.model.lines.forEach(i=>i.hook.off("selected",this.chooseLine)),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsPanGesture",this.wantsPanGesture),this.five.off("wantsTapGesture",this.wantsTapGesture),this.five.needsRender=!0,this.hook.emit("selectedChange",[]),(e=this.hammer)==null||e.destroy()}highlightLine(e){e.selected||(e.selected=!0,this.group.add(e.lightMesh),e.distanceItem.highlight(),this.five.needsRender=!0)}clearHighlightLines(){this.group.children.length!==0&&(this.deleteDom.setLines([]).hide(),this.model.lines.forEach(e=>{e.selected=!1,e.distanceItem.unHighlight(),this.group.remove(e.lightMesh)}),this.highlightedLines=[],this.five.needsRender=!0)}highlightLines(e){this.clearHighlightLines(),this.highlightedLines=e,this.deleteDom.setLines(e).updatePosition().show(),e.forEach(i=>this.highlightLine(i))}}exports.WatchController=I;
|
|
@@ -1,140 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
var m = Object.getOwnPropertySymbols;
|
|
3
|
-
var C = Object.prototype.hasOwnProperty, P = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var h = (o, e, t) => e in o ? g(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, l = (o, e) => {
|
|
5
|
-
for (var t in e || (e = {}))
|
|
6
|
-
C.call(e, t) && h(o, t, e[t]);
|
|
7
|
-
if (m)
|
|
8
|
-
for (var t of m(e))
|
|
9
|
-
P.call(e, t) && h(o, t, e[t]);
|
|
10
|
-
return o;
|
|
11
|
-
};
|
|
12
|
-
var r = (o, e, t) => (h(o, typeof e != "symbol" ? e + "" : e, t), t);
|
|
13
|
-
import v from "../Modules/Magnifier.js";
|
|
14
|
-
import w from "../Modules/FiveHelper.js";
|
|
15
|
-
import a from "./EditController.js";
|
|
16
|
-
import M from "./ViewController.js";
|
|
17
|
-
import c from "./WatchController.js";
|
|
18
|
-
import f from "./MixedController.js";
|
|
19
|
-
import { omit as y } from "../../shared-utils/filter.js";
|
|
20
|
-
import { Group as I } from "three";
|
|
21
|
-
import { Model as b } from "../Model/index.js";
|
|
22
|
-
import { Subscribe as D } from "@realsee/five";
|
|
23
|
-
import { getMouseGroup as x } from "../utils/mouseGroup.js";
|
|
24
|
-
import { UIController as p } from "../Modules/UIController/index.js";
|
|
25
|
-
import { GuideController as U } from "../Modules/GuideController.js";
|
|
26
|
-
import { ShortcutKeyController as k } from "./ShortcutKeyController.js";
|
|
27
|
-
import E from "../Modules/rangePiece/index.js";
|
|
28
|
-
class A {
|
|
29
|
-
constructor(e, t) {
|
|
30
|
-
r(this, "hasOpen", !1);
|
|
31
|
-
r(this, "hook", new D());
|
|
32
|
-
r(this, "magnifier");
|
|
33
|
-
r(this, "five");
|
|
34
|
-
r(this, "model");
|
|
35
|
-
r(this, "group");
|
|
36
|
-
r(this, "config");
|
|
37
|
-
r(this, "fiveHelper");
|
|
38
|
-
r(this, "useUIController");
|
|
39
|
-
r(this, "params");
|
|
40
|
-
r(this, "useGuideController");
|
|
41
|
-
r(this, "rangePieceController");
|
|
42
|
-
r(this, "container", document.createElement("div"));
|
|
43
|
-
r(this, "shortcutKeyController");
|
|
44
|
-
r(this, "controller", null);
|
|
45
|
-
r(this, "controllerParams");
|
|
46
|
-
r(this, "getCurrentMode", () => this.controller instanceof a ? "Edit" : this.controller instanceof c ? "Watch" : this.controller instanceof f ? "Mixed" : null);
|
|
47
|
-
r(this, "changeMode", (e) => {
|
|
48
|
-
var i;
|
|
49
|
-
if (!this.hasOpen || this.getCurrentMode() === e)
|
|
50
|
-
return;
|
|
51
|
-
if (this.getCurrentMode() === "Mixed" || e === "Mixed")
|
|
52
|
-
return new Error("\u4E0D\u652F\u6301\u5207\u6362\u7684Mode");
|
|
53
|
-
(i = this.controller) == null || i.dispose();
|
|
54
|
-
const t = {
|
|
55
|
-
View: M,
|
|
56
|
-
Watch: c,
|
|
57
|
-
Edit: a
|
|
58
|
-
};
|
|
59
|
-
if (!t[e])
|
|
60
|
-
throw new Error("\u4E0D\u5B58\u5728\u7684 Mode");
|
|
61
|
-
this.controller = new t[e](this.controllerParams), this.hook.emit("modeChange", e);
|
|
62
|
-
});
|
|
63
|
-
var n, u;
|
|
64
|
-
this.five = e, this.params = t;
|
|
65
|
-
const i = {
|
|
66
|
-
userDistanceItemCreator: void 0,
|
|
67
|
-
getDistanceText(d) {
|
|
68
|
-
return d.toFixed(2) + "m";
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
this.config = l(l({}, i), y(t, ["openParams", "magnifierParams"])), this.model = new b(this.config), this.fiveHelper = new w(e), this.magnifier = new v(e, (n = t.magnifierParams) != null ? n : { width: 190, height: 190, scale: 2 }), this.group = new I(), this.group.name = "plugin-measure-group", this.container.classList.add("five-plugin-measure-container"), this.container.style.position = "absolute", this.container.style.left = "0", this.container.style.top = "0", this.container.style.pointerEvents = "none", this.container.style.width = "100%", this.container.style.height = "100%", this.container.style.opacity = "0", this.container.style.background = "rgba(0, 0, 0, 0.15)";
|
|
72
|
-
const s = (u = this.params.openParams) != null ? u : {};
|
|
73
|
-
this.controllerParams = {
|
|
74
|
-
five: this.five,
|
|
75
|
-
hook: this.hook,
|
|
76
|
-
group: this.group,
|
|
77
|
-
model: this.model,
|
|
78
|
-
config: this.config,
|
|
79
|
-
magnifier: this.magnifier,
|
|
80
|
-
container: this.container,
|
|
81
|
-
fiveHelper: this.fiveHelper,
|
|
82
|
-
openParams: s,
|
|
83
|
-
mouseGroup: x(l({}, s.crossHairParameter)),
|
|
84
|
-
userDistanceItemCreator: this.params.userDistanceItemCreator
|
|
85
|
-
}, this.params.useUIController !== !1 && (this.useUIController = new p(this, this.controllerParams)), this.params.useGuideController !== !1 && (this.useGuideController = new U(this, this.controllerParams));
|
|
86
|
-
}
|
|
87
|
-
appendTo(e) {
|
|
88
|
-
e.append(this.container);
|
|
89
|
-
}
|
|
90
|
-
dispose() {
|
|
91
|
-
var e, t;
|
|
92
|
-
this.disable(), (e = this.useUIController) == null || e.dispose(), (t = this.magnifier) == null || t.dispose(), this.five.needsRender = !0;
|
|
93
|
-
}
|
|
94
|
-
load(e) {
|
|
95
|
-
this.model.parse(e), this.save();
|
|
96
|
-
}
|
|
97
|
-
enable() {
|
|
98
|
-
var e, t, i;
|
|
99
|
-
this.hasOpen || (this.hasOpen = !0, this.five.scene.add(this.group), this.container.style.opacity = "1", (e = this.params.openParams) != null && e.isMobile ? (this.controller = new f(this.controllerParams), this.rangePieceController = new E(this.controllerParams)) : (this.five.helperVisible = !1, this.controller = new c(this.controllerParams)), (t = this.useUIController) == null || t.show(), (i = this.useGuideController) == null || i.show(), this.shortcutKeyController = new k(this, this.five), this.hook.emit("enable", !0));
|
|
100
|
-
}
|
|
101
|
-
disable() {
|
|
102
|
-
var e, t, i, s, n;
|
|
103
|
-
this.hasOpen = !1, this.container.style.opacity = "0", (e = this.controller) == null || e.dispose(), (t = this.rangePieceController) == null || t.dispose(), (i = this.useUIController) == null || i.hide(), (s = this.useGuideController) == null || s.hide(), (n = this.shortcutKeyController) == null || n.dispose(), this.controller = null, this.five.helperVisible = !0, this.five.scene.remove(this.group), this.five.needsRender = !0, this.hook.emit("disable", !0);
|
|
104
|
-
}
|
|
105
|
-
revoke() {
|
|
106
|
-
this.controller instanceof a && this.controller.revoke();
|
|
107
|
-
}
|
|
108
|
-
removeLineByID(e) {
|
|
109
|
-
this.model.removeLineByID(e);
|
|
110
|
-
}
|
|
111
|
-
highlightLine(e) {
|
|
112
|
-
if (this.getCurrentMode() !== "Watch")
|
|
113
|
-
return !1;
|
|
114
|
-
const t = this.model.getLineByID(e);
|
|
115
|
-
return t ? (this.controller.highlightLine(t), !0) : !1;
|
|
116
|
-
}
|
|
117
|
-
clearHighlightLines() {
|
|
118
|
-
return this.getCurrentMode() !== "Watch" ? !1 : (this.controller.clearHighlightLines(), !0);
|
|
119
|
-
}
|
|
120
|
-
save() {
|
|
121
|
-
return this.controller instanceof a ? (this.model.mergeModel(this.controller.model), this) : this;
|
|
122
|
-
}
|
|
123
|
-
toJson() {
|
|
124
|
-
return this.model.toJson();
|
|
125
|
-
}
|
|
126
|
-
changeIsMobile(e) {
|
|
127
|
-
var t, i;
|
|
128
|
-
((t = this.controllerParams.openParams) == null ? void 0 : t.isMobile) === void 0 && (this.controllerParams.openParams.isMobile = e), this.controllerParams.openParams.isMobile !== e && (this.controllerParams.openParams.isMobile = e, this.params.useUIController !== !1 && ((i = this.useUIController) == null || i.dispose()), this.useUIController = new p(this, this.controllerParams));
|
|
129
|
-
}
|
|
130
|
-
changeConfigs(e) {
|
|
131
|
-
var t;
|
|
132
|
-
if (e.getDistanceText && e.getDistanceText !== this.config.getDistanceText) {
|
|
133
|
-
const i = e.getDistanceText;
|
|
134
|
-
this.config.getDistanceText = i, (t = this.controller) == null || t.updateDistanceUI();
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
export {
|
|
139
|
-
A as default
|
|
140
|
-
};
|
|
1
|
+
"use strict";var m=Object.defineProperty;var d=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var h=(i,e,r)=>e in i?m(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,l=(i,e)=>{for(var r in e||(e={}))p.call(e,r)&&h(i,r,e[r]);if(d)for(var r of d(e))P.call(e,r)&&h(i,r,e[r]);return i};var t=(i,e,r)=>(h(i,typeof e!="symbol"?e+"":e,r),r);const M=require("../Modules/Magnifier.js"),v=require("../Modules/FiveHelper.js"),a=require("./EditController.js"),_=require("./ViewController.js"),u=require("./WatchController.js"),g=require("./MixedController.js"),w=require("../../shared-utils/filter.js"),y=require("three"),x=require("../Model/index.js"),I=require("@realsee/five"),b=require("../utils/mouseGroup.js"),f=require("../Modules/UIController/index.js"),D=require("../Modules/GuideController.js"),E=require("./ShortcutKeyController.js"),q=require("../Modules/rangePiece/index.js");class U{constructor(e,r){t(this,"hasOpen",!1);t(this,"hook",new I.Subscribe);t(this,"magnifier");t(this,"five");t(this,"model");t(this,"group");t(this,"config");t(this,"fiveHelper");t(this,"useUIController");t(this,"params");t(this,"useGuideController");t(this,"rangePieceController");t(this,"container",document.createElement("div"));t(this,"shortcutKeyController");t(this,"controller",null);t(this,"controllerParams");t(this,"getCurrentMode",()=>this.controller instanceof a.EditController?"Edit":this.controller instanceof u.WatchController?"Watch":this.controller instanceof g.MixedController?"Mixed":null);t(this,"changeMode",e=>{var o;if(!this.hasOpen||this.getCurrentMode()===e)return;if(this.getCurrentMode()==="Mixed"||e==="Mixed")return new Error("\u4E0D\u652F\u6301\u5207\u6362\u7684Mode");(o=this.controller)==null||o.dispose();const r={View:_.ViewController,Watch:u.WatchController,Edit:a.EditController};if(!r[e])throw new Error("\u4E0D\u5B58\u5728\u7684 Mode");this.controller=new r[e](this.controllerParams),this.hook.emit("modeChange",e)});var n,c;this.five=e,this.params=r;const o={userDistanceItemCreator:void 0,getDistanceText(C){return C.toFixed(2)+"m"}};this.config=l(l({},o),w.omit(r,["openParams","magnifierParams"])),this.model=new x.Model(this.config),this.fiveHelper=new v.FiveHelper(e),this.magnifier=new M.Magnifier(e,(n=r.magnifierParams)!=null?n:{width:190,height:190,scale:2}),this.group=new y.Group,this.group.name="plugin-measure-group",this.container.classList.add("five-plugin-measure-container"),this.container.style.position="absolute",this.container.style.left="0",this.container.style.top="0",this.container.style.pointerEvents="none",this.container.style.width="100%",this.container.style.height="100%",this.container.style.opacity="0",this.container.style.background="rgba(0, 0, 0, 0.15)";const s=(c=this.params.openParams)!=null?c:{};this.controllerParams={five:this.five,hook:this.hook,group:this.group,model:this.model,config:this.config,magnifier:this.magnifier,container:this.container,fiveHelper:this.fiveHelper,openParams:s,mouseGroup:b.getMouseGroup(l({},s.crossHairParameter)),userDistanceItemCreator:this.params.userDistanceItemCreator},this.params.useUIController!==!1&&(this.useUIController=new f.UIController(this,this.controllerParams)),this.params.useGuideController!==!1&&(this.useGuideController=new D.GuideController(this,this.controllerParams))}appendTo(e){e.append(this.container)}dispose(){var e,r;this.disable(),(e=this.useUIController)==null||e.dispose(),(r=this.magnifier)==null||r.dispose(),this.five.needsRender=!0}load(e){this.model.parse(e),this.save()}enable(){var e,r,o;this.hasOpen||(this.hasOpen=!0,this.five.scene.add(this.group),this.container.style.opacity="1",(e=this.params.openParams)!=null&&e.isMobile?(this.controller=new g.MixedController(this.controllerParams),this.rangePieceController=new q.RangePieceController(this.controllerParams)):(this.five.helperVisible=!1,this.controller=new u.WatchController(this.controllerParams)),(r=this.useUIController)==null||r.show(),(o=this.useGuideController)==null||o.show(),this.shortcutKeyController=new E.ShortcutKeyController(this,this.five),this.hook.emit("enable",!0))}disable(){var e,r,o,s,n;this.hasOpen=!1,this.container.style.opacity="0",(e=this.controller)==null||e.dispose(),(r=this.rangePieceController)==null||r.dispose(),(o=this.useUIController)==null||o.hide(),(s=this.useGuideController)==null||s.hide(),(n=this.shortcutKeyController)==null||n.dispose(),this.controller=null,this.five.helperVisible=!0,this.five.scene.remove(this.group),this.five.needsRender=!0,this.hook.emit("disable",!0)}revoke(){this.controller instanceof a.EditController&&this.controller.revoke()}removeLineByID(e){this.model.removeLineByID(e)}highlightLine(e){if(this.getCurrentMode()!=="Watch")return!1;const r=this.model.getLineByID(e);return r?(this.controller.highlightLine(r),!0):!1}clearHighlightLines(){return this.getCurrentMode()!=="Watch"?!1:(this.controller.clearHighlightLines(),!0)}save(){return this.controller instanceof a.EditController?(this.model.mergeModel(this.controller.model),this):this}toJson(){return this.model.toJson()}changeIsMobile(e){var r,o;((r=this.controllerParams.openParams)==null?void 0:r.isMobile)===void 0&&(this.controllerParams.openParams.isMobile=e),this.controllerParams.openParams.isMobile!==e&&(this.controllerParams.openParams.isMobile=e,this.params.useUIController!==!1&&((o=this.useUIController)==null||o.dispose()),this.useUIController=new f.UIController(this,this.controllerParams))}changeConfigs(e){var r;if(e.getDistanceText&&e.getDistanceText!==this.config.getDistanceText){const o=e.getDistanceText;this.config.getDistanceText=o,(r=this.controller)==null||r.updateDistanceUI()}}}exports.MeasureController=U;
|