@realsee/dnalogel 2.3.9-alpha.8 → 2.5.0
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/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +5 -5
- package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +5 -6
- package/dist/PanoMeasurePlugin/Controller/MixedController.d.ts +7 -9
- package/dist/PanoMeasurePlugin/Controller/ViewController.d.ts +6 -10
- package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +3 -3
- package/dist/PanoMeasurePlugin/Controller/index.d.ts +27 -9
- package/dist/PanoMeasurePlugin/Model/index.d.ts +17 -17
- package/dist/PanoMeasurePlugin/Model/line.d.ts +6 -4
- package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -4
- package/dist/PanoMeasurePlugin/Model/polyline.d.ts +37 -12
- package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +29 -16
- package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +3 -4
- package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -2
- package/dist/PanoMeasurePlugin/index.d.ts +6 -2
- package/dist/PanoMeasurePlugin/typings/data.d.ts +6 -16
- package/dist/PanoMeasurePlugin/typings/event.type.d.ts +18 -14
- package/dist/PanoMeasurePlugin/typings/index.d.ts +4 -2
- package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +5 -3
- package/dist/index.cjs.js +102 -102
- package/dist/index.js +3715 -3594
- package/dist/index.umd.js +91 -91
- package/docs/assets/search.js +1 -1
- package/docs/classes/CSS3DRender.html +31 -31
- package/docs/classes/CruisePluginController.html +24 -24
- package/docs/classes/Magnifier.html +90 -40
- package/docs/classes/ModelRoomLabelController.html +11 -11
- package/docs/classes/Object3DHelperController.html +24 -24
- package/docs/classes/PaintBrush.html +15 -15
- package/docs/classes/PanoMeasurePluginLine.html +318 -0
- package/docs/classes/PanoMeasurePluginModel.html +275 -0
- package/docs/classes/PanoMeasurePluginPoint.html +160 -0
- package/docs/classes/PanoMeasurePluginPolyline.html +306 -0
- package/docs/classes/PanoTagPluginController.html +41 -41
- 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 +16 -16
- 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/PaintBrushTypeEnum.html +8 -8
- package/docs/enums/PointType.html +7 -7
- package/docs/enums/Rotation.html +8 -8
- package/docs/functions/CSS3DRenderPlugin.html +12 -7
- package/docs/functions/CameraMovementPlugin.html +12 -7
- package/docs/functions/CruisePlugin.html +12 -7
- package/docs/functions/GuideLinePlugin.html +13 -8
- package/docs/functions/ItemLabelPlugin.html +12 -7
- package/docs/functions/MapviewFloorplanPlugin.html +12 -7
- package/docs/functions/ModelChassisCompassPlugin.html +12 -7
- package/docs/functions/ModelEntryDoorGuidePlugin.html +12 -7
- package/docs/functions/ModelFloorplanPlugin.html +12 -7
- package/docs/functions/ModelItemLabelPlugin.html +12 -7
- package/docs/functions/ModelRoomLabelPlugin.html +12 -7
- package/docs/functions/ModelTVVideoPlugin.html +12 -7
- package/docs/functions/ModelViewPlugin.html +12 -7
- package/docs/functions/Object3DHelperPlugin.html +12 -7
- package/docs/functions/PanoCompassPlugin.html +12 -7
- package/docs/functions/PanoCursorRaycasterPlugin.html +12 -7
- package/docs/functions/PanoDoorLabelPlugin.html +12 -7
- package/docs/functions/PanoFloorplanRadarPlugin.html +12 -7
- package/docs/functions/PanoMeasurePlugin.html +12 -7
- package/docs/functions/PanoRulerPlugin.html +12 -7
- package/docs/functions/PanoRulerProPlugin.html +12 -7
- package/docs/functions/PanoSpatialTagPlugin.html +12 -7
- package/docs/functions/PanoTagPlugin.html +12 -7
- package/docs/functions/TopviewFloorplanPlugin.html +12 -7
- 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 +13 -8
- package/docs/index.html +12 -7
- package/docs/interfaces/AddTagConfig.html +6 -6
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
- package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
- package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
- package/docs/interfaces/EventMap.html +15 -15
- 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/MinMax.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 +11 -11
- package/docs/interfaces/Object3DHelperState.html +8 -8
- 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 +13 -8
- package/docs/interfaces/PanoMeasureParameterType.html +24 -14
- package/docs/interfaces/{PointJson.html → PanoMeasurePluginLineJson.html} +24 -24
- package/docs/interfaces/{OpenParameter.html → PanoMeasurePluginOpenParameter.html} +15 -15
- package/docs/interfaces/{LineJson.html → PanoMeasurePluginPointJson.html} +18 -18
- package/docs/interfaces/PanoMeasurePluginPolylineJson.html +80 -0
- 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 +13 -8
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +13 -8
- 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/Room.html +9 -9
- package/docs/interfaces/RoomInfo.html +7 -7
- package/docs/interfaces/RoomLabel.html +14 -14
- package/docs/interfaces/RoomRules.html +13 -8
- package/docs/interfaces/Rooms.html +13 -8
- package/docs/interfaces/Scissor.html +9 -9
- package/docs/interfaces/State.html +8 -8
- package/docs/interfaces/TagCache.html +10 -10
- package/docs/interfaces/TagConfig.html +10 -10
- package/docs/interfaces/TagIconUrl.html +9 -9
- package/docs/interfaces/Tags.html +9 -9
- package/docs/interfaces/TemporaryState.html +6 -6
- 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 +20 -10
- package/docs/types/ArrayPosition.html +13 -8
- package/docs/types/AudioAppearance.html +13 -8
- package/docs/types/AudioTagTypeConfigKey.html +13 -8
- package/docs/types/CSS3DRenderExportType.html +13 -8
- package/docs/types/CSS3DRenderPluginExportType.html +13 -8
- package/docs/types/CSS3DRenderPluginParameterType.html +13 -8
- package/docs/types/Color.html +13 -8
- package/docs/types/ContentTypeConfigKey.html +13 -8
- package/docs/types/ContentTypeConfigKeySplit.html +13 -8
- package/docs/types/ContentTypeMap.html +13 -8
- package/docs/types/Create3DDomContainerReturnType.html +13 -8
- package/docs/types/Create3DElementReturnType.html +13 -8
- package/docs/types/CruisePluginExportType.html +13 -8
- package/docs/types/Direction-1.html +13 -8
- package/docs/types/Direction4.html +13 -8
- package/docs/types/FloorplanRuleLabels.html +13 -8
- package/docs/types/FloorplanServerRuleLabels.html +13 -8
- package/docs/types/GuideLinePluginExportType.html +13 -8
- package/docs/types/HelperEventMap.html +13 -8
- package/docs/types/LoadTagConfig.html +13 -8
- package/docs/types/MapviewFloorplanPluginParameterType.html +13 -8
- package/docs/types/MapviewFloorplanPluginReturnType.html +13 -8
- package/docs/types/MediaData.html +13 -8
- package/docs/types/MediaStore.html +13 -8
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +13 -8
- package/docs/types/ModelFloorplanPluginParameterType.html +13 -8
- package/docs/types/ModelFloorplanPluginReturnType.html +13 -8
- package/docs/types/ModelRoomLabelPluginParameters.html +13 -8
- package/docs/types/ModelRoomLabelPluginReturnType.html +13 -8
- package/docs/types/MoveArgs.html +13 -8
- package/docs/types/MoveOpts.html +13 -8
- package/docs/types/Object3DHelperEventMap.html +13 -8
- package/docs/types/ObjectFit.html +13 -8
- package/docs/types/PaintBrushEventMap.html +13 -8
- package/docs/types/PanoCompassPluginData.html +13 -8
- package/docs/types/PanoCompassPluginExportType.html +13 -8
- package/docs/types/PanoCompassPluginParameterType.html +13 -8
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +13 -8
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +13 -8
- package/docs/types/PanoIndex.html +13 -8
- package/docs/types/PanoMeasurePluginEvent.html +13 -8
- package/docs/types/PanoMeasureReturnType.html +13 -8
- package/docs/types/PanoSpatialTagPluginId.html +13 -8
- package/docs/types/PanoTagPluginExportInterface.html +13 -8
- package/docs/types/PanoTagPluginParamsInterface.html +13 -8
- package/docs/types/PlaneTag.html +13 -8
- package/docs/types/PlaneTagElement.html +13 -8
- package/docs/types/Point2DElement.html +13 -8
- package/docs/types/Point2DTag.html +13 -8
- package/docs/types/Point3DElement.html +13 -8
- package/docs/types/Point3DTag.html +13 -8
- package/docs/types/PointTag.html +13 -8
- package/docs/types/PointTagElement.html +13 -8
- package/docs/types/Position.html +13 -8
- package/docs/types/RotateArgs.html +13 -8
- package/docs/types/RotateOpts.html +13 -8
- package/docs/types/RuleLabelsKey.html +13 -8
- package/docs/types/RuleLabelsValue.html +13 -8
- package/docs/types/StickType.html +13 -8
- package/docs/types/Tag.html +13 -8
- package/docs/types/Tag2D.html +13 -8
- package/docs/types/Tag3D.html +13 -8
- package/docs/types/TagContentType.html +13 -8
- package/docs/types/TagDimensionType.html +13 -8
- package/docs/types/TagElement.html +13 -8
- package/docs/types/TagEvents.html +13 -8
- package/docs/types/TagHooks.html +13 -8
- package/docs/types/TagIconSize.html +13 -8
- package/docs/types/TagId.html +13 -8
- package/docs/types/TagPointType.html +13 -8
- package/docs/types/TopviewFloorplanPluginParameterType.html +13 -8
- package/docs/types/TopviewFloorplanPluginReturnType.html +13 -8
- package/docs/types/WorkCode.html +13 -8
- package/docs/variables/FLOOR_TYPE_MAP.html +13 -8
- package/docs/variables/PLUGIN.html +13 -8
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +13 -8
- package/docs/variables/ROOM_TYPE_MAP.html +13 -8
- package/docs/variables/VERSION.html +13 -8
- package/docs/variables/itemLabelPluginServerParams.html +13 -8
- package/docs/variables/modelItemLabelPluginServerParams.html +13 -8
- package/docs/variables/modelRoomLabelPluginServerParams.html +13 -8
- package/libs/PanoCompassPlugin/Controller.js +3 -8
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +5 -5
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +17 -18
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +5 -6
- package/libs/PanoMeasurePlugin/Controller/EditController.js +59 -61
- package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +7 -9
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +54 -46
- package/libs/PanoMeasurePlugin/Controller/ViewController.d.ts +6 -10
- package/libs/PanoMeasurePlugin/Controller/ViewController.js +47 -80
- package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +3 -3
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +48 -54
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +27 -9
- package/libs/PanoMeasurePlugin/Controller/index.js +126 -102
- package/libs/PanoMeasurePlugin/Model/index.d.ts +17 -17
- package/libs/PanoMeasurePlugin/Model/index.js +49 -72
- package/libs/PanoMeasurePlugin/Model/line.d.ts +6 -4
- package/libs/PanoMeasurePlugin/Model/line.js +28 -25
- package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -4
- package/libs/PanoMeasurePlugin/Model/point.js +6 -6
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +37 -12
- package/libs/PanoMeasurePlugin/Model/polyline.js +97 -37
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +16 -11
- package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +29 -16
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +113 -62
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +5 -4
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +3 -4
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +21 -21
- package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -2
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +15 -14
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileMainBtnController.js +5 -4
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +5 -5
- package/libs/PanoMeasurePlugin/index.d.ts +6 -2
- package/libs/PanoMeasurePlugin/index.js +28 -24
- package/libs/PanoMeasurePlugin/typings/data.d.ts +6 -16
- package/libs/PanoMeasurePlugin/typings/event.type.d.ts +18 -14
- package/libs/PanoMeasurePlugin/typings/event.type.js +4 -1
- package/libs/PanoMeasurePlugin/typings/index.d.ts +4 -2
- package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +5 -3
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +65 -41
- package/libs/PanoTagPlugin/Components/Tag/TextTag/TextPlaneTag.js +83 -55
- package/libs/index.js +108 -104
- package/package.json +1 -1
|
@@ -1,114 +1,112 @@
|
|
|
1
1
|
var d = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import { Model as
|
|
6
|
-
import
|
|
2
|
+
var l = (h, n, e) => n in h ? d(h, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[n] = e;
|
|
3
|
+
var i = (h, n, e) => (l(h, typeof n != "symbol" ? n + "" : n, e), e);
|
|
4
|
+
import m from "hammerjs";
|
|
5
|
+
import { Model as u } from "../Model/index.js";
|
|
6
|
+
import f from "../Model/line.js";
|
|
7
7
|
import p from "../Model/point.js";
|
|
8
8
|
import { throttle as v } from "../../shared-utils/throttle.js";
|
|
9
9
|
import c from "./BaseController.js";
|
|
10
10
|
import { getIntersectionFromEvent as r } from "../utils/getIntersectionFromEvent.js";
|
|
11
|
+
import { Polyline as P } from "../Model/polyline.js";
|
|
12
|
+
import "three";
|
|
13
|
+
import "@realsee/five/line";
|
|
14
|
+
import "../utils/constants.js";
|
|
11
15
|
import "@realsee/five";
|
|
12
|
-
import "../../shared-utils/removeArrayItem.js";
|
|
13
|
-
import "../Model/polyline.js";
|
|
14
16
|
import "../../shared-utils/uuid.js";
|
|
15
17
|
import "../utils/line.js";
|
|
16
|
-
import "@realsee/five/line";
|
|
17
|
-
import "../utils/constants.js";
|
|
18
|
-
import "three";
|
|
19
18
|
import "../utils/distanceDom.js";
|
|
20
19
|
import "../utils/isNDCPointInScreen.js";
|
|
20
|
+
import "../../shared-utils/removeArrayItem.js";
|
|
21
21
|
import "../utils/ironbox.js";
|
|
22
22
|
import "../utils/getPointFromHammerEvent.js";
|
|
23
|
-
class
|
|
23
|
+
class V extends c {
|
|
24
24
|
constructor(e) {
|
|
25
|
-
var
|
|
25
|
+
var s;
|
|
26
26
|
super(e);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
i(this, "type", "edit");
|
|
28
|
+
i(this, "polyline");
|
|
29
|
+
i(this, "pressPoint");
|
|
30
|
+
i(this, "hasAppendDashed", !1);
|
|
31
|
+
i(this, "hasAppendMouseGroup", !1);
|
|
32
|
+
i(this, "fiveElement");
|
|
33
|
+
i(this, "lastPoint", null);
|
|
34
|
+
i(this, "hammer");
|
|
35
|
+
i(this, "onIntersectionUpdate", v((e, t) => {
|
|
35
36
|
var o;
|
|
36
|
-
this.hasAppendMouseGroup === !1 && (this.group.add(this.mouseGroup), this.magnifier.appendTo(this.container), this.hasAppendMouseGroup = !0);
|
|
37
|
-
const
|
|
38
|
-
(o = this.pressPoint) == null || o.position.copy(
|
|
37
|
+
this.hasAppendMouseGroup === !1 && (this.group.add(this.mouseGroup), this.magnifier.appendTo(this.container), this.magnifier.enable(), this.hasAppendMouseGroup = !0);
|
|
38
|
+
const s = this.updateMouseGroup(e, t).position;
|
|
39
|
+
(o = this.pressPoint) == null || o.position.copy(s), this.updateDashed(), requestAnimationFrame(() => this.magnifier.renderWithPoint(this.mouseGroup.position)), this.five.needsRender = !0;
|
|
39
40
|
}, 20));
|
|
40
|
-
|
|
41
|
-
if (this.
|
|
42
|
-
this.lastPoint = null, this.hasAppendDashed = !1, this.dashed.distanceItem.remove(), this.group.remove(this.dashed.mesh), this.hook.emit("anchorChange", null), this.five.needsRender = !0;
|
|
41
|
+
i(this, "revoke", () => {
|
|
42
|
+
if (this.polyline.lines.length === 0 && this.lastPoint) {
|
|
43
|
+
this.lastPoint = null, this.hasAppendDashed = !1, this.dashed.distanceItem.remove(), this.group.remove(this.dashed.mesh), this.hook.emit("anchorChange", null), this.hook.emit("editedDashedLineChange", null), this.five.needsRender = !0;
|
|
43
44
|
return;
|
|
44
45
|
}
|
|
45
|
-
if (this.
|
|
46
|
+
if (this.polyline.lines.length === 0 && !this.lastPoint || !this.lastPoint)
|
|
46
47
|
return;
|
|
47
|
-
const e = this.
|
|
48
|
-
!t || (this.lastPoint = t, this.hook.emit("anchorChange", t.position), this.group.remove(e.mesh), this.
|
|
48
|
+
const e = this.polyline.lines[this.polyline.lines.length - 1], t = e.findAnotherPoint(this.lastPoint);
|
|
49
|
+
!t || (this.lastPoint = t, this.hook.emit("anchorChange", t.position), this.group.remove(e.mesh), this.polyline.removeLine(e), this.hasAppendMouseGroup = !1, this.mouseGroup.position.copy(this.lastPoint.position), this.group.remove(this.mouseGroup), e.distanceItem.remove(), this.updateDashed(), this.magnifier.disable(), this.five.needsRender = !0);
|
|
49
50
|
});
|
|
50
|
-
|
|
51
|
-
this.magnifier.
|
|
51
|
+
i(this, "onMouseLeave", () => {
|
|
52
|
+
this.magnifier.disable(), this.group.remove(this.mouseGroup), this.hasAppendMouseGroup = !1, this.lastPoint && (this.mouseGroup.position.copy(this.lastPoint.position), this.updateDashed());
|
|
52
53
|
});
|
|
53
|
-
|
|
54
|
-
this.hook.emit(
|
|
55
|
-
"editedLineChange",
|
|
56
|
-
this.model.lines.map((e) => e.toCompletelyJson())
|
|
57
|
-
);
|
|
54
|
+
i(this, "onLineChanged", () => {
|
|
55
|
+
this.hook.emit("editedPolylineChange", this.polyline);
|
|
58
56
|
});
|
|
59
|
-
|
|
57
|
+
i(this, "onPress", (e) => {
|
|
60
58
|
const [t] = r(this.five, e);
|
|
61
|
-
if (!t
|
|
59
|
+
if (!(t != null && t.face))
|
|
62
60
|
return;
|
|
63
|
-
const
|
|
64
|
-
this.pressPoint =
|
|
61
|
+
const s = new p(t.point);
|
|
62
|
+
this.pressPoint = s, this.onIntersectionUpdate(t);
|
|
65
63
|
});
|
|
66
|
-
|
|
64
|
+
i(this, "onPan", (e) => {
|
|
67
65
|
if (!this.pressPoint)
|
|
68
66
|
return;
|
|
69
67
|
const [t] = r(this.five, e);
|
|
70
|
-
!t
|
|
68
|
+
!(t != null && t.face) || this.onIntersectionUpdate(t);
|
|
71
69
|
});
|
|
72
|
-
|
|
70
|
+
i(this, "onPanEnd", (e) => {
|
|
73
71
|
!this.pressPoint || this.onTap(e);
|
|
74
72
|
});
|
|
75
|
-
|
|
73
|
+
i(this, "onTap", (e) => {
|
|
76
74
|
this.hasAppendDashed || (this.dashed.distanceItem.appendTo(this.container), this.group.add(this.dashed.mesh)), this.hasAppendDashed = !0;
|
|
77
75
|
const [t] = r(this.five, e);
|
|
78
76
|
this.updateMouseGroup(t);
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
81
|
-
const a = new
|
|
82
|
-
a.distanceItem.appendTo(this.container), this.
|
|
77
|
+
const s = new p(this.mouseGroup.position), o = this.lastPoint;
|
|
78
|
+
if (s && (this.lastPoint = s), s && o) {
|
|
79
|
+
const a = new f(o, s, this.model);
|
|
80
|
+
a.distanceItem.setItemSelectable(!1), a.distanceItem.appendTo(this.container), this.polyline.addLine(a), this.group.add(a.mesh), a.distanceItem.update(this.five);
|
|
83
81
|
}
|
|
84
|
-
this.pressPoint = void 0, this.hasAppendMouseGroup = !1, this.magnifier.
|
|
82
|
+
this.pressPoint = void 0, this.hasAppendMouseGroup = !1, this.magnifier.disable(), this.group.remove(this.mouseGroup), this.updateDashed(), this.five.needsRender = !0, this.hook.emit("anchorChange", s.position);
|
|
85
83
|
});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
i(this, "onWantsTapGesture", () => !1);
|
|
85
|
+
i(this, "onWantsToMoveToPano", () => !1);
|
|
86
|
+
i(this, "onWantsPanGesture", () => this.pressPoint ? !1 : void 0);
|
|
87
|
+
i(this, "onCameraUpdate", () => {
|
|
90
88
|
this.updateDistanceUI(), this.dashed.distanceItem.update(this.five);
|
|
91
89
|
});
|
|
92
|
-
|
|
93
|
-
!this.lastPoint || (this.dashed.points[0].position.copy(this.lastPoint.position), this.dashed.points[1].position.copy(this.mouseGroup.position), this.dashed.mesh.setPoints(this.lastPoint.position, this.mouseGroup.position), this.dashed.distanceItem.update(this.five));
|
|
90
|
+
i(this, "updateDashed", () => {
|
|
91
|
+
!this.lastPoint || (this.dashed.points[0].position.copy(this.lastPoint.position), this.dashed.points[1].position.copy(this.mouseGroup.position), this.dashed.mesh.setPoints(this.lastPoint.position, this.mouseGroup.position), this.dashed.distanceItem.update(this.five), this.hook.emit("editedDashedLineChange", this.dashed));
|
|
94
92
|
});
|
|
95
|
-
this.model = new
|
|
93
|
+
this.model = new u(this.config), this.polyline = new P({ model: this.model }), this.model.addPolyline(this.polyline), this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("wantsPanGesture", this.onWantsPanGesture), this.five.on("wantsTapGesture", this.onWantsTapGesture), this.five.on("wantsToMoveToPano", this.onWantsToMoveToPano), this.five.on("intersectionOnModelUpdate", this.onIntersectionUpdate), this.polyline.hook.on("lineAdded", this.onLineChanged), this.polyline.hook.on("lineRemoved", this.onLineChanged);
|
|
96
94
|
const t = this.five.getElement();
|
|
97
95
|
if (t) {
|
|
98
96
|
this.fiveElement = t;
|
|
99
|
-
const o = new
|
|
97
|
+
const o = new m(t);
|
|
100
98
|
this.hammer = o, o.on("tap", this.onTap), o.on("pan", this.onPan), o.on("press", this.onPress), o.on("panend", this.onPanEnd);
|
|
101
99
|
}
|
|
102
|
-
(
|
|
100
|
+
this.five.helperVisible = !1, (s = this.fiveElement) == null || s.addEventListener("mouseleave", this.onMouseLeave), this.hook.emit("anchorChange", null), this.hook.emit("editedDashedLineChange", null), this.five.refresh();
|
|
103
101
|
}
|
|
104
102
|
dispose() {
|
|
105
103
|
var e, t;
|
|
106
|
-
super.dispose(), this.group.remove(this.mouseGroup, this.dashed.mesh), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("wantsPanGesture", this.onWantsPanGesture), this.five.off("wantsTapGesture", this.onWantsTapGesture), this.five.off("wantsToMoveToPano", this.onWantsToMoveToPano), this.five.off("intersectionOnModelUpdate", this.onIntersectionUpdate), this.
|
|
104
|
+
super.dispose(), this.five.helperVisible = !0, this.group.remove(this.mouseGroup, this.dashed.mesh), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("wantsPanGesture", this.onWantsPanGesture), this.five.off("wantsTapGesture", this.onWantsTapGesture), this.five.off("wantsToMoveToPano", this.onWantsToMoveToPano), this.five.off("intersectionOnModelUpdate", this.onIntersectionUpdate), this.polyline.hook.off("lineAdded", this.onLineChanged), this.polyline.hook.off("lineRemoved", this.onLineChanged), (e = this.hammer) == null || e.destroy(), (t = this.fiveElement) == null || t.removeEventListener("mouseleave", this.onMouseLeave), this.magnifier.dispose(), this.dashed.distanceItem.remove(), this.five.needsRender = !0;
|
|
107
105
|
}
|
|
108
106
|
getEditingLines() {
|
|
109
|
-
return this.
|
|
107
|
+
return this.polyline.lines;
|
|
110
108
|
}
|
|
111
109
|
}
|
|
112
110
|
export {
|
|
113
|
-
|
|
111
|
+
V as default
|
|
114
112
|
};
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import type { LineJson } from '../typings/data';
|
|
2
|
-
import { Model } from '../Model';
|
|
3
1
|
import Line from '../Model/line';
|
|
4
|
-
import BaseController, {
|
|
2
|
+
import BaseController, { ControllerParams } from './BaseController';
|
|
3
|
+
import { Polyline } from '../Model/polyline';
|
|
5
4
|
export declare type State = 'watching' | 'editing';
|
|
6
|
-
export interface EditEvent {
|
|
7
|
-
editedLineChange: (lines: LineJson[]) => void;
|
|
8
|
-
}
|
|
9
5
|
export default class MixedController extends BaseController {
|
|
10
6
|
state: State;
|
|
11
|
-
|
|
7
|
+
polyline: Polyline;
|
|
12
8
|
private hasAppendDashed;
|
|
13
|
-
private fiveElement?;
|
|
14
9
|
private mobileStartPoint;
|
|
15
10
|
private mobileNowPoint;
|
|
16
11
|
private highlightedLines;
|
|
17
12
|
private deleteDom;
|
|
18
|
-
|
|
13
|
+
private rangePieceController;
|
|
14
|
+
private disposers;
|
|
15
|
+
constructor(params: ControllerParams);
|
|
19
16
|
dispose(): void;
|
|
20
17
|
highlightLine(line: Line): void;
|
|
21
18
|
clearHighlightLines(): void;
|
|
22
19
|
getEditingLines(): Line[];
|
|
20
|
+
addStartPoint(): void;
|
|
23
21
|
/** 编辑线条发生改变时通知外部 */
|
|
24
22
|
private onLineChanged;
|
|
25
23
|
private onWantsTapGesture;
|
|
@@ -1,66 +1,72 @@
|
|
|
1
1
|
var b = Object.defineProperty;
|
|
2
|
-
var k = (h,
|
|
3
|
-
var t = (h,
|
|
2
|
+
var k = (h, s, e) => s in h ? b(h, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[s] = e;
|
|
3
|
+
var t = (h, s, e) => (k(h, typeof s != "symbol" ? s + "" : s, e), e);
|
|
4
4
|
import { Model as S } from "../Model/index.js";
|
|
5
|
-
import
|
|
5
|
+
import y from "../Model/line.js";
|
|
6
6
|
import D from "./BaseController.js";
|
|
7
|
-
import
|
|
8
|
-
import { findAssociatedLines as
|
|
9
|
-
import { Vector2 as
|
|
10
|
-
import
|
|
11
|
-
import { closestPointOnLine as
|
|
12
|
-
import "../Model/
|
|
13
|
-
import "
|
|
14
|
-
import "../../shared-utils/removeArrayItem.js";
|
|
15
|
-
import "@realsee/five";
|
|
16
|
-
import "../Model/polyline.js";
|
|
17
|
-
import "../utils/line.js";
|
|
7
|
+
import T from "../Modules/DeleteDom/index.js";
|
|
8
|
+
import { findAssociatedLines as M } from "../utils/findAssociatedLines.js";
|
|
9
|
+
import { Vector2 as p } from "three";
|
|
10
|
+
import C from "../utils/isNDCPointInScreen.js";
|
|
11
|
+
import { closestPointOnLine as G } from "../utils/math.js";
|
|
12
|
+
import { Polyline as W } from "../Model/polyline.js";
|
|
13
|
+
import N from "../Modules/rangePiece/index.js";
|
|
18
14
|
import "@realsee/five/line";
|
|
19
15
|
import "../utils/constants.js";
|
|
16
|
+
import "@realsee/five";
|
|
17
|
+
import "../../shared-utils/uuid.js";
|
|
18
|
+
import "../utils/line.js";
|
|
20
19
|
import "../utils/distanceDom.js";
|
|
20
|
+
import "../Model/point.js";
|
|
21
|
+
import "../../shared-utils/removeArrayItem.js";
|
|
21
22
|
import "../utils/ironbox.js";
|
|
22
23
|
import "../Modules/DeleteDom/_Assets/delete.svg.js";
|
|
23
24
|
import "../Modules/DeleteDom/_Assets/delete_bg.png.js";
|
|
24
25
|
import "../Modules/DeleteDom/_Assets/delete_hover_bg.png.js";
|
|
25
|
-
|
|
26
|
+
import "@tweenjs/tween.js";
|
|
27
|
+
import "../Modules/rangePiece/html.js";
|
|
28
|
+
import "../../shared-utils/animationFrame/index.js";
|
|
29
|
+
import "../../shared-utils/animationFrame/BetterTween.js";
|
|
30
|
+
import "../../shared-utils/noop.js";
|
|
31
|
+
import "../utils/calculateThreeMouse.js";
|
|
32
|
+
import "../utils/mouseGroup.js";
|
|
33
|
+
class le extends D {
|
|
26
34
|
constructor(e) {
|
|
27
35
|
super(e);
|
|
28
36
|
t(this, "state", "watching");
|
|
29
|
-
t(this, "
|
|
37
|
+
t(this, "polyline");
|
|
30
38
|
t(this, "hasAppendDashed", !1);
|
|
31
|
-
t(this, "fiveElement");
|
|
32
39
|
t(this, "mobileStartPoint", null);
|
|
33
40
|
t(this, "mobileNowPoint", null);
|
|
34
41
|
t(this, "highlightedLines", []);
|
|
35
42
|
t(this, "deleteDom");
|
|
43
|
+
t(this, "rangePieceController");
|
|
44
|
+
t(this, "disposers", []);
|
|
36
45
|
t(this, "onLineChanged", () => {
|
|
37
|
-
this.hook.emit(
|
|
38
|
-
"editedLineChange",
|
|
39
|
-
this.model.lines.map((e) => e.toCompletelyJson())
|
|
40
|
-
);
|
|
46
|
+
this.hook.emit("editedPolylineChange", this.polyline);
|
|
41
47
|
});
|
|
42
48
|
t(this, "onWantsTapGesture", (e) => {
|
|
43
|
-
if (this.state === "editing")
|
|
49
|
+
if (console.log("\u{1F436} ~ onWantsTapGesture"), this.state === "editing")
|
|
44
50
|
return !1;
|
|
45
51
|
const [i] = this.five.model.intersectRaycaster(e);
|
|
46
52
|
if (!i)
|
|
47
53
|
return;
|
|
48
|
-
const o = this.five.camera,
|
|
49
|
-
const [a, L] =
|
|
50
|
-
if (!
|
|
54
|
+
const o = this.five.camera, m = i.point.clone().project(o), r = this.container.clientWidth, l = this.container.clientHeight, f = new p(m.x * r, m.y * l), g = this.polyline.lines.map((n) => {
|
|
55
|
+
const [a, L] = n.points, d = a.position.clone().project(o), c = L.position.clone().project(o);
|
|
56
|
+
if (!C(d) && !C(c))
|
|
51
57
|
return null;
|
|
52
|
-
const
|
|
53
|
-
return { id:
|
|
54
|
-
}).filter((
|
|
58
|
+
const v = new p(d.x * r, d.y * l), w = new p(c.x * r, c.y * l);
|
|
59
|
+
return { id: n.id, points: [v, w] };
|
|
60
|
+
}).filter((n) => !!n);
|
|
55
61
|
if (g.length === 0)
|
|
56
62
|
return;
|
|
57
|
-
const u = g.map((
|
|
58
|
-
const a =
|
|
59
|
-
return { id:
|
|
60
|
-
}).sort((
|
|
63
|
+
const u = g.map((n) => {
|
|
64
|
+
const a = G(f, n.points);
|
|
65
|
+
return { id: n.id, distance: a.distanceTo(f) };
|
|
66
|
+
}).sort((n, a) => n.distance - a.distance)[0];
|
|
61
67
|
if (u.distance > 20)
|
|
62
68
|
return;
|
|
63
|
-
const P = this.
|
|
69
|
+
const P = this.polyline.lines.find(({ id: n }) => n === u.id);
|
|
64
70
|
if (!!P)
|
|
65
71
|
return this.chooseLine(P), !1;
|
|
66
72
|
});
|
|
@@ -69,10 +75,10 @@ class $ extends D {
|
|
|
69
75
|
this.updateDistanceUI(), this.dashed.distanceItem.update(this.five);
|
|
70
76
|
});
|
|
71
77
|
t(this, "updateMobileDashed", () => {
|
|
72
|
-
!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));
|
|
78
|
+
!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), this.hook.emit("editedDashedLineChange", this.dashed));
|
|
73
79
|
});
|
|
74
80
|
t(this, "updateMagnifier", (e) => {
|
|
75
|
-
this.magnifier.
|
|
81
|
+
this.magnifier.containerDom !== this.container && this.magnifier.appendTo(this.container), this.magnifier.getCurrentState().enabled || this.magnifier.enable(), requestAnimationFrame(() => this.magnifier.renderWithPoint(e.position)), this.five.needsRender = !0;
|
|
76
82
|
});
|
|
77
83
|
t(this, "onGetStartPoint", (e) => {
|
|
78
84
|
this.mobileStartPoint = e;
|
|
@@ -80,8 +86,8 @@ class $ extends D {
|
|
|
80
86
|
t(this, "onGetEndPoint", (e) => {
|
|
81
87
|
const i = this.mobileNowPoint;
|
|
82
88
|
if (this.removeLine(this.dashed), this.hasAppendDashed = !1, this.mobileStartPoint && i) {
|
|
83
|
-
const o = new
|
|
84
|
-
o.distanceItem.appendTo(this.container), o.distanceItem.update(this.five), o.hook.on("selected", this.chooseLine), this.group.add(o.mesh), this.
|
|
89
|
+
const o = new y(this.mobileStartPoint, i, this.model);
|
|
90
|
+
o.distanceItem.appendTo(this.container), o.distanceItem.update(this.five), o.hook.on("selected", this.chooseLine), this.disposers.push(() => o.hook.off("selected", this.chooseLine)), this.group.add(o.mesh), this.polyline.addLine(o);
|
|
85
91
|
}
|
|
86
92
|
this.mobileStartPoint = null, this.mobileNowPoint = null, this.five.needsRender = !0;
|
|
87
93
|
});
|
|
@@ -96,43 +102,45 @@ class $ extends D {
|
|
|
96
102
|
this.state = i, this.state === "watching" ? this.five.helperVisible = !0 : this.five.helperVisible = !1;
|
|
97
103
|
});
|
|
98
104
|
t(this, "chooseLine", (e) => {
|
|
99
|
-
const i =
|
|
105
|
+
const i = M(e);
|
|
100
106
|
this.highlightLines(i), this.five.needsRender = !0, this.hook.emit(
|
|
101
107
|
"selectedChange",
|
|
102
|
-
i.map((o) => o
|
|
108
|
+
i.map((o) => o)
|
|
103
109
|
);
|
|
104
110
|
});
|
|
105
111
|
t(this, "deleteDomClickCallback", () => {
|
|
106
112
|
this.highlightedLines.forEach((e) => {
|
|
107
|
-
this.removeLine(e), this.
|
|
113
|
+
this.removeLine(e), this.polyline.removeLine(e);
|
|
108
114
|
}), this.highlightedLines = [], this.deleteDom.setLines([]).hide();
|
|
109
115
|
});
|
|
110
116
|
t(this, "cancelDeleteClickCallback", () => {
|
|
111
117
|
this.clearHighlightLines();
|
|
112
118
|
});
|
|
113
|
-
this.deleteDom = new
|
|
119
|
+
this.model = new S(this.config), this.polyline = new W({ model: this.model }), this.model.addPolyline(this.polyline), this.rangePieceController = new N(e), this.deleteDom = new T(this.five, {
|
|
114
120
|
onClick: this.deleteDomClickCallback,
|
|
115
121
|
cancelDelete: this.cancelDeleteClickCallback
|
|
116
|
-
}).appendTo(this.container), this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("wantsTapGesture", this.onWantsTapGesture), this.five.on("wantsToMoveToPano", this.onWantsToMoveToPano), this.
|
|
122
|
+
}).appendTo(this.container), this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("wantsTapGesture", this.onWantsTapGesture), this.five.on("wantsToMoveToPano", this.onWantsToMoveToPano), this.polyline.hook.on("lineAdded", this.onLineChanged), this.polyline.hook.on("lineRemoved", this.onLineChanged), this.five.helperVisible = !1, this.hook.emit("editedDashedLineChange", null), 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();
|
|
117
123
|
}
|
|
118
124
|
dispose() {
|
|
119
|
-
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.
|
|
125
|
+
super.dispose(), this.disposers.forEach((e) => e()), this.five.helperVisible = !0, this.rangePieceController.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.polyline.hook.off("lineAdded", this.onLineChanged), this.polyline.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;
|
|
120
126
|
}
|
|
121
127
|
highlightLine(e) {
|
|
122
128
|
e.selected || (e.selected = !0, this.group.add(e.lightMesh), e.distanceItem.highlight(), this.five.needsRender = !0);
|
|
123
129
|
}
|
|
124
130
|
clearHighlightLines() {
|
|
125
|
-
this.group.children.length !== 0 && (this.deleteDom.setLines([]).hide(), this.
|
|
131
|
+
this.group.children.length !== 0 && (this.deleteDom.setLines([]).hide(), this.polyline.lines.forEach((e) => {
|
|
126
132
|
e.selected = !1, e.distanceItem.unHighlight(), this.group.remove(e.lightMesh);
|
|
127
133
|
}), this.highlightedLines = [], this.five.needsRender = !0);
|
|
128
134
|
}
|
|
129
135
|
getEditingLines() {
|
|
130
|
-
return this.
|
|
136
|
+
return this.polyline.lines;
|
|
137
|
+
}
|
|
138
|
+
addStartPoint() {
|
|
131
139
|
}
|
|
132
140
|
highlightLines(e) {
|
|
133
141
|
this.clearHighlightLines(), this.highlightedLines = e, this.deleteDom.setLines(e).updatePosition().show(), e.forEach((i) => this.highlightLine(i));
|
|
134
142
|
}
|
|
135
143
|
}
|
|
136
144
|
export {
|
|
137
|
-
|
|
145
|
+
le as default
|
|
138
146
|
};
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import BaseController, { IControllerParams } from './BaseController';
|
|
1
|
+
import BaseController, { ControllerParams } from './BaseController';
|
|
3
2
|
export default class ViewController extends BaseController {
|
|
4
3
|
type: string;
|
|
5
|
-
private highlightedLines;
|
|
6
4
|
private hammer?;
|
|
7
|
-
constructor(params:
|
|
5
|
+
constructor(params: ControllerParams);
|
|
8
6
|
dispose(): void;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
private wantsTapGesture;
|
|
12
|
-
private chooseLine;
|
|
13
|
-
private highlightLines;
|
|
14
|
-
private lineRemoved;
|
|
7
|
+
private polylineRemoved;
|
|
8
|
+
private polylineAdded;
|
|
15
9
|
private onCameraUpdate;
|
|
10
|
+
private onFivePanoWillArrive;
|
|
11
|
+
private onFivePanoArrived;
|
|
16
12
|
}
|
|
@@ -1,101 +1,68 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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
|
-
import "../Model/line.js";
|
|
11
|
-
import "../../shared-utils/uuid.js";
|
|
12
|
-
import "../Model/polyline.js";
|
|
13
|
-
import "../utils/line.js";
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var n = (r, o, i) => o in r ? d(r, o, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[o] = i;
|
|
3
|
+
var s = (r, o, i) => (n(r, typeof o != "symbol" ? o + "" : o, i), i);
|
|
4
|
+
import a from "hammerjs";
|
|
5
|
+
import "three";
|
|
14
6
|
import "@realsee/five/line";
|
|
15
7
|
import "../utils/constants.js";
|
|
16
8
|
import "@realsee/five";
|
|
9
|
+
import h from "./BaseController.js";
|
|
10
|
+
import "../Model/line.js";
|
|
11
|
+
import "../../shared-utils/uuid.js";
|
|
12
|
+
import "../utils/line.js";
|
|
17
13
|
import "../utils/distanceDom.js";
|
|
14
|
+
import "../utils/isNDCPointInScreen.js";
|
|
18
15
|
import "../Model/point.js";
|
|
19
16
|
import "../../shared-utils/removeArrayItem.js";
|
|
20
17
|
import "../utils/ironbox.js";
|
|
21
|
-
class
|
|
22
|
-
constructor(
|
|
23
|
-
super(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (this.model.lines.length === 0)
|
|
29
|
-
return;
|
|
30
|
-
const [t] = this.five.model.intersectRaycaster(e);
|
|
31
|
-
if (!t)
|
|
32
|
-
return;
|
|
33
|
-
const i = this.five.camera, g = t.point.clone().project(i), c = this.container.clientWidth, a = this.container.clientHeight, f = new p(g.x * c, g.y * a), u = this.model.lines.map((s) => {
|
|
34
|
-
const [r, w] = s.points, m = r.position.clone().project(i), l = w.position.clone().project(i);
|
|
35
|
-
if (!L(m) && !L(l))
|
|
36
|
-
return null;
|
|
37
|
-
const C = new p(
|
|
38
|
-
m.x * c,
|
|
39
|
-
m.y * a
|
|
40
|
-
), R = new p(
|
|
41
|
-
l.x * c,
|
|
42
|
-
l.y * a
|
|
43
|
-
);
|
|
44
|
-
return { id: s.id, points: [C, R] };
|
|
45
|
-
}).filter((s) => !!s);
|
|
46
|
-
if (u.length === 0)
|
|
47
|
-
return;
|
|
48
|
-
const v = u.map((s) => {
|
|
49
|
-
const r = H(f, s.points);
|
|
50
|
-
return { id: s.id, distance: r.distanceTo(f) };
|
|
51
|
-
}).sort((s, r) => s.distance - r.distance)[0], d = v.distance > 20 ? void 0 : this.model.lines.find(({ id: s }) => s === v.id);
|
|
52
|
-
if (this.highlightedLines.length > 0 && !d)
|
|
53
|
-
return this.clearHighlightLines(), !1;
|
|
54
|
-
if (d)
|
|
55
|
-
return this.chooseLine(d), !1;
|
|
56
|
-
});
|
|
57
|
-
o(this, "chooseLine", (e) => {
|
|
58
|
-
const t = k(e);
|
|
59
|
-
this.highlightLines(t), this.five.needsRender = !0, this.hook.emit(
|
|
18
|
+
class U extends h {
|
|
19
|
+
constructor(i) {
|
|
20
|
+
super(i);
|
|
21
|
+
s(this, "type", "view");
|
|
22
|
+
s(this, "hammer");
|
|
23
|
+
s(this, "polylineRemoved", (i) => {
|
|
24
|
+
i.lines.forEach((e) => this.removeLine(e)), this.hook.emit(
|
|
60
25
|
"selectedChange",
|
|
61
|
-
|
|
26
|
+
this.model.getAllLines().filter((e) => e.selected).map((e) => e)
|
|
62
27
|
);
|
|
63
28
|
});
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
);
|
|
29
|
+
s(this, "polylineAdded", (i) => {
|
|
30
|
+
i.lines.forEach((e) => {
|
|
31
|
+
e.distanceItem.appendTo(this.container), e.distanceItem.update(this.five), this.group.add(e.mesh);
|
|
32
|
+
});
|
|
69
33
|
});
|
|
70
|
-
|
|
34
|
+
s(this, "onCameraUpdate", () => {
|
|
71
35
|
this.updateDistanceUI();
|
|
72
36
|
});
|
|
73
|
-
this
|
|
74
|
-
|
|
37
|
+
s(this, "onFivePanoWillArrive", (i) => {
|
|
38
|
+
this.model.polylines.forEach((e) => {
|
|
39
|
+
!e.visiblePanoIndexes || e.visiblePanoIndexes.includes(i) || e.lines.forEach((t) => {
|
|
40
|
+
t.mesh.visible = !1, t.distanceItem.update(this.five);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
s(this, "onFivePanoArrived", (i) => {
|
|
45
|
+
this.model.polylines.forEach((e) => {
|
|
46
|
+
!e.visiblePanoIndexes || e.visiblePanoIndexes.includes(i) && e.lines.forEach((t) => {
|
|
47
|
+
t.mesh.visible = !0, t.distanceItem.update(this.five);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
this.model.getAllLines().forEach((t) => {
|
|
52
|
+
t.distanceItem.appendTo(this.container), t.distanceItem.update(this.five), this.group.add(t.mesh);
|
|
75
53
|
});
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
this.hammer =
|
|
54
|
+
const e = this.five.getElement();
|
|
55
|
+
if (e) {
|
|
56
|
+
const t = new a(e);
|
|
57
|
+
this.hammer = t;
|
|
80
58
|
}
|
|
81
|
-
this.model.hook.on("
|
|
59
|
+
this.updateDistanceUI(), this.five.needsRender = !0, this.model.hook.on("polylineAdded", this.polylineAdded), this.model.hook.on("polylineRemoved", this.polylineRemoved), this.five.on("cameraUpdate", this.onCameraUpdate), this.five.on("panoArrived", this.onFivePanoArrived), this.five.on("panoWillArrive", this.onFivePanoWillArrive);
|
|
82
60
|
}
|
|
83
61
|
dispose() {
|
|
84
|
-
var
|
|
85
|
-
super.dispose(), this.model.hook.off("
|
|
86
|
-
}
|
|
87
|
-
highlightLine(e) {
|
|
88
|
-
e.selected || (e.selected = !0, this.group.add(e.lightMesh), e.distanceItem.highlight(), this.five.needsRender = !0);
|
|
89
|
-
}
|
|
90
|
-
clearHighlightLines() {
|
|
91
|
-
this.group.children.length !== 0 && (this.model.lines.forEach((e) => {
|
|
92
|
-
e.selected = !1, e.distanceItem.unHighlight(), this.group.remove(e.lightMesh);
|
|
93
|
-
}), this.highlightedLines = [], this.five.needsRender = !0);
|
|
94
|
-
}
|
|
95
|
-
highlightLines(e) {
|
|
96
|
-
this.clearHighlightLines(), this.highlightedLines = e, e.forEach((t) => this.highlightLine(t));
|
|
62
|
+
var i;
|
|
63
|
+
super.dispose(), this.model.hook.off("polylineAdded", this.polylineAdded), this.model.hook.off("polylineRemoved", this.polylineRemoved), this.five.off("cameraUpdate", this.onCameraUpdate), this.five.off("panoArrived", this.onFivePanoArrived), this.five.off("panoWillArrive", this.onFivePanoWillArrive), this.five.needsRender = !0, this.hook.emit("selectedChange", []), (i = this.hammer) == null || i.destroy();
|
|
97
64
|
}
|
|
98
65
|
}
|
|
99
66
|
export {
|
|
100
|
-
|
|
67
|
+
U as default
|
|
101
68
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type Line from '../Model/line';
|
|
2
|
-
import BaseController, {
|
|
2
|
+
import BaseController, { ControllerParams } from './BaseController';
|
|
3
3
|
export default class WatchController extends BaseController {
|
|
4
4
|
type: string;
|
|
5
5
|
private deleteDom;
|
|
@@ -7,7 +7,7 @@ export default class WatchController extends BaseController {
|
|
|
7
7
|
private fiveElement?;
|
|
8
8
|
private editPointState?;
|
|
9
9
|
private hammer?;
|
|
10
|
-
constructor(params:
|
|
10
|
+
constructor(params: ControllerParams);
|
|
11
11
|
dispose(): void;
|
|
12
12
|
highlightLine(line: Line): void;
|
|
13
13
|
clearHighlightLines(): void;
|
|
@@ -19,7 +19,7 @@ export default class WatchController extends BaseController {
|
|
|
19
19
|
private wantsTapGesture;
|
|
20
20
|
private chooseLine;
|
|
21
21
|
private highlightLines;
|
|
22
|
-
private
|
|
22
|
+
private polylineRemoved;
|
|
23
23
|
private onCameraUpdate;
|
|
24
24
|
private deleteDomClickCallback;
|
|
25
25
|
private cancelDeleteClickCallback;
|