@realsee/dnalogel 2.3.6 → 2.3.7-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 +6 -9
- package/dist/PanoMeasurePlugin/Controller/ViewController.d.ts +6 -3
- 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/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 +4 -3
- package/dist/index.cjs.js +96 -96
- package/dist/index.js +2535 -2459
- 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 +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/PanoMeasurePluginLine.html +301 -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 +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 +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/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/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/PanoMeasurePluginLineJson.html +78 -0
- package/docs/interfaces/{OpenParameter.html → PanoMeasurePluginOpenParameter.html} +15 -15
- package/docs/interfaces/{LineJson.html → PanoMeasurePluginPointJson.html} +18 -18
- package/docs/interfaces/{PointJson.html → PanoMeasurePluginPolylineJson.html} +24 -22
- 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/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 +20 -10
- package/docs/types/ArrayPosition.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/ContentTypeConfigKeyArray.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/MapviewFloorplanPluginParameterType.html +13 -8
- package/docs/types/MapviewFloorplanPluginReturnType.html +13 -8
- package/docs/types/MediaData.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/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/PointTag.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/Tag.html +13 -8
- package/docs/types/Tag2D.html +13 -8
- package/docs/types/Tag3D.html +13 -8
- package/docs/types/TagId.html +13 -8
- package/docs/types/TopviewFloorplanPluginParameterType.html +13 -8
- package/docs/types/TopviewFloorplanPluginReturnType.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 +8 -8
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +5 -6
- package/libs/PanoMeasurePlugin/Controller/EditController.js +56 -57
- package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +6 -9
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +38 -37
- package/libs/PanoMeasurePlugin/Controller/ViewController.d.ts +6 -3
- package/libs/PanoMeasurePlugin/Controller/ViewController.js +68 -52
- package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +3 -3
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +39 -41
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +27 -9
- package/libs/PanoMeasurePlugin/Controller/index.js +117 -92
- 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 +29 -25
- package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -4
- package/libs/PanoMeasurePlugin/Model/point.js +3 -3
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +37 -12
- package/libs/PanoMeasurePlugin/Model/polyline.js +90 -37
- package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +16 -11
- 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 +22 -22
- 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 +10 -10
- package/libs/PanoMeasurePlugin/index.d.ts +6 -2
- package/libs/PanoMeasurePlugin/index.js +31 -27
- package/libs/PanoMeasurePlugin/typings/data.d.ts +6 -16
- package/libs/PanoMeasurePlugin/typings/event.type.d.ts +18 -14
- package/libs/PanoMeasurePlugin/typings/index.d.ts +4 -2
- package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +4 -3
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +57 -41
- package/libs/index.js +109 -105
- package/package.json +1 -1
|
@@ -1,99 +1,80 @@
|
|
|
1
|
-
var
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
2
|
var p = Object.getOwnPropertySymbols;
|
|
3
|
-
var
|
|
4
|
-
var c = (
|
|
3
|
+
var M = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var c = (s, e, t) => e in s ? y(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, n = (s, e) => {
|
|
5
5
|
for (var t in e || (e = {}))
|
|
6
|
-
|
|
6
|
+
M.call(e, t) && c(s, t, e[t]);
|
|
7
7
|
if (p)
|
|
8
8
|
for (var t of p(e))
|
|
9
|
-
|
|
10
|
-
return
|
|
9
|
+
b.call(e, t) && c(s, t, e[t]);
|
|
10
|
+
return s;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
import { Magnifier as
|
|
14
|
-
import { FiveHelper as
|
|
12
|
+
var i = (s, e, t) => (c(s, typeof e != "symbol" ? e + "" : e, t), t);
|
|
13
|
+
import { Magnifier as P } from "../Modules/Magnifier.js";
|
|
14
|
+
import { FiveHelper as v } from "../Modules/FiveHelper.js";
|
|
15
15
|
import { EditController as h } from "./EditController.js";
|
|
16
|
-
import { ViewController as
|
|
17
|
-
import { WatchController as
|
|
18
|
-
import { MixedController as
|
|
19
|
-
import { omit as
|
|
20
|
-
import { Group as
|
|
21
|
-
import { Model as
|
|
22
|
-
import { Subscribe as
|
|
23
|
-
import { getMouseGroup as
|
|
24
|
-
import { UIController as
|
|
25
|
-
import { GuideController as
|
|
26
|
-
import { ShortcutKeyController as
|
|
27
|
-
import
|
|
28
|
-
|
|
16
|
+
import { ViewController as f } from "./ViewController.js";
|
|
17
|
+
import { WatchController as g } from "./WatchController.js";
|
|
18
|
+
import { MixedController as l } from "./MixedController.js";
|
|
19
|
+
import { omit as w } from "../../shared-utils/filter.js";
|
|
20
|
+
import { Group as I } from "three";
|
|
21
|
+
import { Model as U } from "../Model/index.js";
|
|
22
|
+
import { Subscribe as E } from "@realsee/five";
|
|
23
|
+
import { getMouseGroup as D } from "../utils/mouseGroup.js";
|
|
24
|
+
import { UIController as C } from "../Modules/UIController/index.js";
|
|
25
|
+
import { GuideController as k } from "../Modules/GuideController.js";
|
|
26
|
+
import { ShortcutKeyController as B } from "./ShortcutKeyController.js";
|
|
27
|
+
import "@realsee/five/line";
|
|
28
|
+
import "../utils/constants.js";
|
|
29
|
+
class N {
|
|
29
30
|
constructor(e, t) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
r(this, "changeMode", (e) => {
|
|
31
|
+
i(this, "hasOpen", !1);
|
|
32
|
+
i(this, "hook", new E());
|
|
33
|
+
i(this, "magnifier");
|
|
34
|
+
i(this, "five");
|
|
35
|
+
i(this, "model");
|
|
36
|
+
i(this, "group");
|
|
37
|
+
i(this, "config");
|
|
38
|
+
i(this, "isMobile");
|
|
39
|
+
i(this, "fiveHelper");
|
|
40
|
+
i(this, "useUIController");
|
|
41
|
+
i(this, "params");
|
|
42
|
+
i(this, "useGuideController");
|
|
43
|
+
i(this, "container", document.createElement("div"));
|
|
44
|
+
i(this, "shortcutKeyController");
|
|
45
|
+
i(this, "controller", null);
|
|
46
|
+
i(this, "getCurrentMode", () => this.controller instanceof h ? "Edit" : this.controller instanceof g ? "Watch" : this.controller instanceof l ? "Mixed" : this.controller instanceof f ? "View" : null);
|
|
47
|
+
i(this, "changeMode", (e) => {
|
|
48
48
|
var o;
|
|
49
49
|
if (!this.hasOpen || this.getCurrentMode() === e)
|
|
50
50
|
return;
|
|
51
|
-
if (this.getCurrentMode() === "Mixed" || e === "Mixed")
|
|
52
|
-
return new Error("\u4E0D\u652F\u6301\u5207\u6362\u7684Mode");
|
|
53
51
|
(o = this.controller) == null || o.dispose();
|
|
54
52
|
const t = {
|
|
55
|
-
View:
|
|
56
|
-
Watch:
|
|
57
|
-
Edit: h
|
|
53
|
+
View: f,
|
|
54
|
+
Watch: g,
|
|
55
|
+
Edit: h,
|
|
56
|
+
Mixed: l
|
|
58
57
|
};
|
|
59
58
|
if (!t[e])
|
|
60
59
|
throw new Error("\u4E0D\u5B58\u5728\u7684 Mode");
|
|
61
|
-
|
|
60
|
+
const r = this.createControllerParams();
|
|
61
|
+
this.controller = new t[e](r), this.hook.emit("modeChange", e);
|
|
62
62
|
});
|
|
63
|
-
var
|
|
64
|
-
this.five = e, this.params = t;
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
getDistanceText(a) {
|
|
68
|
-
return a.toFixed(2) + "m";
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
this.config = n(n({}, o), I(t, ["openParams", "magnifierParams"])), this.model = new b(this.config), this.fiveHelper = new y(e), this.magnifier = new v(e, (l = t.magnifierParams) != null ? l : { width: 190, height: 190, scale: 2 }), this.group = new M(), 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 = (m = this.params.openParams) != null ? m : {};
|
|
73
|
-
if (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: U(n({}, s.crossHairParameter)),
|
|
84
|
-
userDistanceItemCreator: this.params.userDistanceItemCreator
|
|
85
|
-
}, this.params.useUIController !== !1) {
|
|
63
|
+
var o, u, m, d;
|
|
64
|
+
this.five = e, this.params = t, this.config = w(t, ["openParams", "magnifierParams"]), this.model = new U(this.config), this.fiveHelper = new v(e), this.isMobile = (u = (o = t == null ? void 0 : t.openParams) == null ? void 0 : o.isMobile) != null ? u : !1, this.magnifier = new P(e, (m = t.magnifierParams) != null ? m : { 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)";
|
|
65
|
+
const r = (d = this.params.openParams) != null ? d : {};
|
|
66
|
+
if (this.params.useUIController !== !1) {
|
|
86
67
|
const a = n({
|
|
87
68
|
container: this.container,
|
|
88
|
-
openParams:
|
|
69
|
+
openParams: r
|
|
89
70
|
}, typeof this.params.useUIController == "object" ? this.params.useUIController : {});
|
|
90
|
-
this.useUIController = new
|
|
71
|
+
this.useUIController = new C(this, a);
|
|
91
72
|
}
|
|
92
73
|
if (this.params.useGuideController !== !1) {
|
|
93
74
|
const a = n({
|
|
94
75
|
container: this.container
|
|
95
76
|
}, typeof this.params.useGuideController == "object" ? this.params.useGuideController : {});
|
|
96
|
-
this.useGuideController = new
|
|
77
|
+
this.useGuideController = new k(this, a);
|
|
97
78
|
}
|
|
98
79
|
}
|
|
99
80
|
appendTo(e) {
|
|
@@ -106,19 +87,32 @@ class A {
|
|
|
106
87
|
load(e) {
|
|
107
88
|
this.model.parse(e), this.save();
|
|
108
89
|
}
|
|
109
|
-
enable() {
|
|
110
|
-
var
|
|
111
|
-
this.hasOpen || (this.hasOpen = !0, this.five.scene.add(this.group), this.container.style.opacity = "1",
|
|
90
|
+
enable(e) {
|
|
91
|
+
var t;
|
|
92
|
+
this.hasOpen || (this.hasOpen = !0, this.five.scene.add(this.group), this.container.style.opacity = "1", e != null && e.mode ? this.changeMode(e.mode) : this.isMobile ? this.changeMode("Mixed") : this.changeMode("Watch"), (t = this.useUIController) == null || t.show(), this.shortcutKeyController = new B(this, this.five), this.hook.emit("enable", !0));
|
|
112
93
|
}
|
|
113
94
|
disable() {
|
|
114
|
-
var e, t,
|
|
115
|
-
this.hasOpen = !1, this.container.style.opacity = "0", (e = this.controller) == null || e.dispose(), (t = this.
|
|
95
|
+
var e, t, r, o;
|
|
96
|
+
this.hasOpen = !1, this.container.style.opacity = "0", (e = this.controller) == null || e.dispose(), (t = this.useUIController) == null || t.hide(), (r = this.useGuideController) == null || r.hide(), (o = this.shortcutKeyController) == null || o.dispose(), this.controller = null, this.five.helperVisible = !0, this.five.scene.remove(this.group), this.five.needsRender = !0, this.hook.emit("disable", !0);
|
|
97
|
+
}
|
|
98
|
+
edit() {
|
|
99
|
+
const e = this.isMobile ? "Mixed" : "Edit";
|
|
100
|
+
this.changeMode(e);
|
|
116
101
|
}
|
|
117
102
|
revoke() {
|
|
118
103
|
this.controller instanceof h && this.controller.revoke();
|
|
119
104
|
}
|
|
120
|
-
|
|
121
|
-
this.model.
|
|
105
|
+
removePolyline(e) {
|
|
106
|
+
this.model.removePolyline(e);
|
|
107
|
+
}
|
|
108
|
+
removePolylineByID(e) {
|
|
109
|
+
const t = this.model.getPolylineByID(e);
|
|
110
|
+
t && this.model.removePolyline(t);
|
|
111
|
+
}
|
|
112
|
+
getPolylineByID(e) {
|
|
113
|
+
return this.model.getPolylineByID(e);
|
|
114
|
+
}
|
|
115
|
+
getEditedPolyline() {
|
|
122
116
|
}
|
|
123
117
|
highlightLine(e) {
|
|
124
118
|
if (this.getCurrentMode() !== "Watch")
|
|
@@ -129,31 +123,62 @@ class A {
|
|
|
129
123
|
clearHighlightLines() {
|
|
130
124
|
return this.getCurrentMode() !== "Watch" ? !1 : (this.controller.clearHighlightLines(), !0);
|
|
131
125
|
}
|
|
132
|
-
save() {
|
|
133
|
-
|
|
126
|
+
save(e) {
|
|
127
|
+
var o;
|
|
128
|
+
if (!(this.controller instanceof h) && !(this.controller instanceof l))
|
|
129
|
+
return this;
|
|
130
|
+
const t = (o = e == null ? void 0 : e.mode) != null ? o : "View", r = this.controller.polyline;
|
|
131
|
+
return this.model.addPolyline(r), this.changeMode(t), this;
|
|
132
|
+
}
|
|
133
|
+
addStartPoint() {
|
|
134
|
+
this.controller instanceof l && this.hook.emit("willChangeState", "watching", "editing");
|
|
135
|
+
}
|
|
136
|
+
addEndPoint() {
|
|
137
|
+
this.controller instanceof l && this.hook.emit("willChangeState", "editing", "watching");
|
|
134
138
|
}
|
|
135
139
|
toJson() {
|
|
136
140
|
return this.model.toJson();
|
|
137
141
|
}
|
|
138
142
|
changeIsMobile(e) {
|
|
139
|
-
var t
|
|
140
|
-
if (
|
|
141
|
-
(
|
|
142
|
-
const
|
|
143
|
+
var t;
|
|
144
|
+
if (this.isMobile = e, this.params.useUIController !== !1) {
|
|
145
|
+
(t = this.useUIController) == null || t.dispose();
|
|
146
|
+
const r = n({
|
|
143
147
|
container: this.container,
|
|
144
|
-
|
|
148
|
+
mode: this.isMobile ? "mobile" : "pc"
|
|
145
149
|
}, typeof this.params.useUIController == "object" ? this.params.useUIController : {});
|
|
146
|
-
this.useUIController = new
|
|
150
|
+
this.useUIController = new C(this, r);
|
|
147
151
|
}
|
|
148
152
|
}
|
|
149
153
|
changeConfigs(e) {
|
|
150
154
|
var t;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
+
Object.assign(this.config, e), (t = this.controller) == null || t.updateDistanceUI();
|
|
156
|
+
}
|
|
157
|
+
setCustomText(e, t) {
|
|
158
|
+
var o;
|
|
159
|
+
const r = this.model.getLineByID(e);
|
|
160
|
+
if (!r)
|
|
161
|
+
throw new Error("\u4E0D\u5B58\u5728\u7684\u7EBF\u6BB5");
|
|
162
|
+
r.setText(t), (o = this.controller) == null || o.updateDistanceUI();
|
|
163
|
+
}
|
|
164
|
+
createControllerParams() {
|
|
165
|
+
var t;
|
|
166
|
+
const e = (t = this.params.openParams) != null ? t : {};
|
|
167
|
+
return e.isMobile = this.isMobile, {
|
|
168
|
+
five: this.five,
|
|
169
|
+
hook: this.hook,
|
|
170
|
+
group: this.group,
|
|
171
|
+
model: this.model,
|
|
172
|
+
config: this.config,
|
|
173
|
+
magnifier: this.magnifier,
|
|
174
|
+
container: this.container,
|
|
175
|
+
fiveHelper: this.fiveHelper,
|
|
176
|
+
openParams: e,
|
|
177
|
+
mouseGroup: D(n({}, e.crossHairParameter)),
|
|
178
|
+
userDistanceItemCreator: this.params.userDistanceItemCreator
|
|
179
|
+
};
|
|
155
180
|
}
|
|
156
181
|
}
|
|
157
182
|
export {
|
|
158
|
-
|
|
183
|
+
N as MeasureController
|
|
159
184
|
};
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import type { Config } from '../typings';
|
|
2
2
|
import type { PluginData } from '../typings/data';
|
|
3
3
|
import Line from './line';
|
|
4
|
-
import Point from './point';
|
|
5
|
-
import { Subscribe, SubscribeEventMap } from '@realsee/five';
|
|
6
4
|
import { Polyline } from './polyline';
|
|
7
|
-
|
|
5
|
+
import { Subscribe } from '@realsee/five';
|
|
6
|
+
declare type IModelEvent = {
|
|
8
7
|
/** 新增线条
|
|
9
8
|
* @param line 被创建的线条
|
|
10
9
|
*/
|
|
11
|
-
|
|
10
|
+
polylineAdded: (line: Polyline) => void;
|
|
12
11
|
/** 删除线条
|
|
13
12
|
* @param lines 被删除的线条数组
|
|
14
13
|
*/
|
|
15
|
-
|
|
16
|
-
}
|
|
14
|
+
polylineRemoved: (lines: Polyline) => void;
|
|
15
|
+
};
|
|
17
16
|
export declare class Model {
|
|
18
|
-
readonly
|
|
19
|
-
readonly points: Point[];
|
|
20
|
-
readonly params: Config;
|
|
17
|
+
readonly config?: Config;
|
|
21
18
|
readonly polylines: Polyline[];
|
|
22
19
|
readonly hook: Subscribe<IModelEvent>;
|
|
23
|
-
constructor(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
getPointByID(id: string): Point;
|
|
20
|
+
constructor(config?: Config);
|
|
21
|
+
addPolyline(polyline: Polyline): void;
|
|
22
|
+
replacePolylineByID(id: string, polyline: Polyline): void;
|
|
23
|
+
removePolyline(polyline: Polyline): void;
|
|
24
|
+
getPolylineByID(id: string): Polyline;
|
|
25
|
+
getPolylineByLine(line: Line): Polyline;
|
|
30
26
|
getLineByID(id: string): Line;
|
|
27
|
+
getAllLines(): Line[];
|
|
28
|
+
getAllPoints(): import("./point").default[];
|
|
29
|
+
includes(item: Polyline): boolean;
|
|
30
|
+
clear(): void;
|
|
31
31
|
getClosestPoint(): void;
|
|
32
|
-
parse(data: PluginData):
|
|
32
|
+
parse(data: PluginData): void;
|
|
33
33
|
toJson(): PluginData;
|
|
34
34
|
}
|
|
35
35
|
export {};
|
|
@@ -1,92 +1,69 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
class
|
|
10
|
-
constructor(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
r(this, "hook", new B());
|
|
16
|
-
this.params = i;
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var t = (l, e, i) => e in l ? s(l, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : l[e] = i;
|
|
3
|
+
var n = (l, e, i) => (t(l, typeof e != "symbol" ? e + "" : e, i), i);
|
|
4
|
+
import "three";
|
|
5
|
+
import { Polyline as r } from "./polyline.js";
|
|
6
|
+
import "@realsee/five/line";
|
|
7
|
+
import "../utils/constants.js";
|
|
8
|
+
import { Subscribe as p } from "@realsee/five";
|
|
9
|
+
class f {
|
|
10
|
+
constructor(e) {
|
|
11
|
+
n(this, "config");
|
|
12
|
+
n(this, "polylines", []);
|
|
13
|
+
n(this, "hook", new p());
|
|
14
|
+
this.config = e;
|
|
17
15
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return
|
|
22
|
-
this.includes(n) || this.points.push(n), this.includes(t) || this.points.push(t), this.lines.push(i);
|
|
23
|
-
const e = this.polylines.find((s) => !!s.getNext(i));
|
|
24
|
-
if (e)
|
|
25
|
-
e.push(i);
|
|
26
|
-
else {
|
|
27
|
-
const s = new f();
|
|
28
|
-
s.push(i), this.polylines.push(s);
|
|
16
|
+
addPolyline(e) {
|
|
17
|
+
if (this.includes(e)) {
|
|
18
|
+
console.error(new Error("\u4E0D\u80FD\u91CD\u590D\u6DFB\u52A0 polyline"));
|
|
19
|
+
return;
|
|
29
20
|
}
|
|
30
|
-
this.hook.emit("
|
|
21
|
+
this.polylines.push(e), this.hook.emit("polylineAdded", e);
|
|
31
22
|
}
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
23
|
+
replacePolylineByID(e, i) {
|
|
24
|
+
const o = this.getPolylineByID(e);
|
|
25
|
+
o == null || o.replace(i);
|
|
35
26
|
}
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
n.pop(), n.lines.length === 0 && c(n, this.polylines);
|
|
27
|
+
removePolyline(e) {
|
|
28
|
+
const i = this.polylines.findIndex(({ id: o }) => o === e.id);
|
|
29
|
+
if (i === -1) {
|
|
30
|
+
console.error(new Error("polyline \u4E0D\u5B58\u5728"));
|
|
31
|
+
return;
|
|
42
32
|
}
|
|
43
|
-
|
|
44
|
-
return t.lines.length === 0 && c(t, this.points), e.lines.length === 0 && c(e, this.points), c(i, this.lines), i.clear(), this.hook.emit("lineRemoved", i), this;
|
|
33
|
+
this.polylines.splice(i, 1), this.hook.emit("polylineRemoved", e);
|
|
45
34
|
}
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
getPolylineByID(e) {
|
|
36
|
+
return this.polylines.find((i) => i.id === e);
|
|
48
37
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return this.points.find(({ id: n }) => n === i.id) !== void 0;
|
|
52
|
-
if (i.type === "line")
|
|
53
|
-
return this.lines.find(({ id: n }) => n === i.id) !== void 0;
|
|
38
|
+
getPolylineByLine(e) {
|
|
39
|
+
return this.polylines.find((i) => i.includes(e));
|
|
54
40
|
}
|
|
55
|
-
|
|
56
|
-
return this.
|
|
41
|
+
getLineByID(e) {
|
|
42
|
+
return this.getAllLines().find((i) => i.id === e);
|
|
57
43
|
}
|
|
58
|
-
|
|
59
|
-
return this.
|
|
44
|
+
getAllLines() {
|
|
45
|
+
return this.polylines.map((e) => e.lines).flat(1);
|
|
46
|
+
}
|
|
47
|
+
getAllPoints() {
|
|
48
|
+
return this.polylines.map((e) => e.points).flat(1);
|
|
49
|
+
}
|
|
50
|
+
includes(e) {
|
|
51
|
+
return this.polylines.find(({ id: i }) => i === e.id) !== void 0;
|
|
52
|
+
}
|
|
53
|
+
clear() {
|
|
54
|
+
this.polylines.forEach((e) => this.hook.emit("polylineRemoved", e)), this.polylines.splice(0, this.polylines.length);
|
|
60
55
|
}
|
|
61
56
|
getClosestPoint() {
|
|
62
57
|
}
|
|
63
|
-
parse(
|
|
64
|
-
|
|
65
|
-
const p = new g(l);
|
|
66
|
-
return p.id = s, p;
|
|
67
|
-
}), t = i.lines.map((s) => {
|
|
68
|
-
const [l, p] = s.points, h = this.getPointByID.call({ points: n }, l), u = this.getPointByID.call({ points: n }, p);
|
|
69
|
-
if (!h || !u)
|
|
70
|
-
throw new Error("\u7EBF\u4E0A\u7684\u70B9\u4E0D\u5B58\u5728");
|
|
71
|
-
const d = new a(h, u, this);
|
|
72
|
-
return d.id = s.id, d;
|
|
73
|
-
}), e = i.polylines.map((s) => {
|
|
74
|
-
const l = new f();
|
|
75
|
-
return s.lines.forEach((p) => {
|
|
76
|
-
const h = t.find(({ id: u }) => u === p);
|
|
77
|
-
h && l.push(h);
|
|
78
|
-
}), l;
|
|
79
|
-
});
|
|
80
|
-
return this.points.splice(0, this.points.length, ...n), this.lines.splice(0, this.lines.length, ...t), this.polylines.splice(0, this.polylines.length, ...e), this;
|
|
58
|
+
parse(e) {
|
|
59
|
+
this.clear(), this.polylines.push(...e.polylines.map((i) => new r({ model: this }).fromJson(i))), this.polylines.forEach((i) => this.hook.emit("polylineAdded", i));
|
|
81
60
|
}
|
|
82
61
|
toJson() {
|
|
83
62
|
return {
|
|
84
|
-
|
|
85
|
-
lines: this.lines.map((i) => i.toJson()),
|
|
86
|
-
polylines: this.polylines.map((i) => i.toJson()).filter((i) => i.lines.length > 0)
|
|
63
|
+
polylines: this.polylines.map((e) => e.toJson()).filter((e) => e.lines.length > 0)
|
|
87
64
|
};
|
|
88
65
|
}
|
|
89
66
|
}
|
|
90
67
|
export {
|
|
91
|
-
|
|
68
|
+
f as Model
|
|
92
69
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import type { Model } from '.';
|
|
2
|
-
import
|
|
3
|
-
import type { LineJson } from '
|
|
4
|
-
import type { LineCompletelyJson } from '../typings/data';
|
|
2
|
+
import Point from './point';
|
|
3
|
+
import type { LineJson } from '../typings/data';
|
|
5
4
|
import type { Line as FiveLine } from '@realsee/five/line';
|
|
6
5
|
import { Polyline } from './polyline';
|
|
7
6
|
import { Subscribe, SubscribeEventMap } from '@realsee/five';
|
|
8
7
|
import { DistanceItem } from '../utils/distanceDom';
|
|
9
8
|
export interface ILineHook extends SubscribeEventMap {
|
|
10
9
|
selected: (line: Line) => void;
|
|
10
|
+
textChanged: (text: string | undefined) => void;
|
|
11
11
|
}
|
|
12
12
|
export default class Line {
|
|
13
13
|
id: string;
|
|
14
14
|
selected: boolean;
|
|
15
|
+
text?: string;
|
|
15
16
|
readonly type = "line";
|
|
16
17
|
readonly model: Model;
|
|
17
18
|
readonly mesh: FiveLine;
|
|
@@ -22,9 +23,10 @@ export default class Line {
|
|
|
22
23
|
private polyline?;
|
|
23
24
|
constructor(point: Point, anotherPoint: Point, model: Model);
|
|
24
25
|
clear(): void;
|
|
26
|
+
isEmpty(): boolean;
|
|
25
27
|
getPolyline(): Polyline;
|
|
26
28
|
findAnotherPoint(point: Point): Point;
|
|
29
|
+
setText(text: string | null): void;
|
|
27
30
|
toJson(): LineJson;
|
|
28
|
-
toCompletelyJson(): LineCompletelyJson;
|
|
29
31
|
clone(): Line;
|
|
30
32
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var e = (s,
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { createLineMesh as
|
|
7
|
-
import { Subscribe as
|
|
8
|
-
import { createDistanceItem as
|
|
1
|
+
var r = Object.defineProperty;
|
|
2
|
+
var u = (s, t, i) => t in s ? r(s, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[t] = i;
|
|
3
|
+
var e = (s, t, i) => (u(s, typeof t != "symbol" ? t + "" : t, i), i);
|
|
4
|
+
import "three";
|
|
5
|
+
import { uuid as c } from "../../shared-utils/uuid.js";
|
|
6
|
+
import { createLineMesh as h } from "../utils/line.js";
|
|
7
|
+
import { Subscribe as d } from "@realsee/five";
|
|
8
|
+
import { createDistanceItem as m } from "../utils/distanceDom.js";
|
|
9
9
|
class l {
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(t, i, o) {
|
|
11
11
|
e(this, "id");
|
|
12
12
|
e(this, "selected", !1);
|
|
13
|
+
e(this, "text");
|
|
13
14
|
e(this, "type", "line");
|
|
14
15
|
e(this, "model");
|
|
15
16
|
e(this, "mesh");
|
|
@@ -18,37 +19,40 @@ class l {
|
|
|
18
19
|
e(this, "hook");
|
|
19
20
|
e(this, "distanceItem");
|
|
20
21
|
e(this, "polyline");
|
|
21
|
-
|
|
22
|
+
var n;
|
|
23
|
+
if (this.id = c(), this.model = o, t.id === i.id)
|
|
22
24
|
throw new Error("\u65E0\u6548\u7684\u7EBF\u6BB5, \u4E00\u4E2A\u70B9\u65E0\u6CD5\u6784\u6210\u7EBF\u6BB5");
|
|
23
|
-
this.hook = new
|
|
25
|
+
typeof o.config.defaultText == "string" && (this.text = o.config.defaultText), this.hook = new d(), this.points = [t, i], this.mesh = h(this, "normal"), this.lightMesh = h(this, "light"), this.distanceItem = m({
|
|
24
26
|
line: this,
|
|
25
27
|
clickCallback: () => this.hook.emit("selected", this),
|
|
26
|
-
userDistanceItem: this.model.
|
|
27
|
-
}),
|
|
28
|
+
userDistanceItem: (n = this.model.config) != null && n.userDistanceItemCreator ? this.model.config.userDistanceItemCreator() : void 0
|
|
29
|
+
}), t.lines.push(this), i.lines.push(this);
|
|
28
30
|
}
|
|
29
31
|
clear() {
|
|
30
32
|
this.selected = !1, this.polyline = void 0;
|
|
31
33
|
}
|
|
34
|
+
isEmpty() {
|
|
35
|
+
return this.points.length === 0;
|
|
36
|
+
}
|
|
32
37
|
getPolyline() {
|
|
33
38
|
if (this.polyline)
|
|
34
39
|
return this.polyline;
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
return
|
|
38
|
-
const t = new u();
|
|
39
|
-
return t.push(this), t;
|
|
40
|
+
const t = this.model.polylines.find((i) => i.lines.includes(this));
|
|
41
|
+
if (t)
|
|
42
|
+
return this.polyline = t, t;
|
|
40
43
|
}
|
|
41
|
-
findAnotherPoint(
|
|
42
|
-
return this.points.find(({ id:
|
|
44
|
+
findAnotherPoint(t) {
|
|
45
|
+
return this.points.find(({ id: i }) => i !== t.id);
|
|
43
46
|
}
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
setText(t) {
|
|
48
|
+
this.text = t, this.hook.emit("textChanged", t);
|
|
46
49
|
}
|
|
47
|
-
|
|
48
|
-
return { id: this.id, points: this.points.map((
|
|
50
|
+
toJson() {
|
|
51
|
+
return { id: this.id, points: this.points.map((t) => t.toJson()), text: this.text };
|
|
49
52
|
}
|
|
50
53
|
clone() {
|
|
51
|
-
|
|
54
|
+
const t = new l(this.points[0].clone(), this.points[1].clone(), this.model);
|
|
55
|
+
return t.text = this.text, t;
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
export {
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import type Line from './line';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PointJson } from '../typings/data';
|
|
3
3
|
import { Vector3 } from 'three';
|
|
4
|
-
declare type IPointData = PluginData['points'][0];
|
|
5
4
|
export default class Point {
|
|
6
5
|
id: string;
|
|
7
6
|
lines: Line[];
|
|
8
7
|
position: Vector3;
|
|
9
8
|
readonly type = "point";
|
|
10
9
|
constructor(position: Vector3 | number[]);
|
|
11
|
-
toJson():
|
|
10
|
+
toJson(): PointJson;
|
|
12
11
|
addLine(line: Line): void;
|
|
13
12
|
removeLine(line: Line): void;
|
|
14
13
|
clone(): Point;
|
|
15
14
|
}
|
|
16
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var e = Object.defineProperty;
|
|
2
|
-
var p = (
|
|
3
|
-
var s = (
|
|
2
|
+
var p = (o, i, t) => i in o ? e(o, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[i] = t;
|
|
3
|
+
var s = (o, i, t) => (p(o, typeof i != "symbol" ? i + "" : i, t), t);
|
|
4
4
|
import { Vector3 as n } from "three";
|
|
5
5
|
import { uuid as h } from "../../shared-utils/uuid.js";
|
|
6
6
|
import { removeArrayItem as m } from "../../shared-utils/removeArrayItem.js";
|
|
@@ -13,7 +13,7 @@ class r {
|
|
|
13
13
|
this.id = h(), this.lines = [], this.position = new n(), i instanceof n ? this.position.copy(i) : this.position.fromArray(i);
|
|
14
14
|
}
|
|
15
15
|
toJson() {
|
|
16
|
-
return { id: this.id,
|
|
16
|
+
return { id: this.id, position: this.position.toArray() };
|
|
17
17
|
}
|
|
18
18
|
addLine(i) {
|
|
19
19
|
this.lines.push(i);
|