@realsee/dnalogel 0.1.7-alpha.1 → 0.1.7-alpha.10

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.
Files changed (144) hide show
  1. package/components/GLTFView/index.d.ts +30 -1
  2. package/components/GLTFView/index.js +35 -3
  3. package/data/81zxMaeVKLQU93OZMG.d.ts +49 -0
  4. package/data/81zxMaeVKLQU93OZMG.js +633 -0
  5. package/data/PrXel3aqGbp34JQn.js +139 -1
  6. package/data/_vLykj3NWrllMrG06.d.ts +95 -0
  7. package/data/_vLykj3NWrllMrG06.js +1 -0
  8. package/data/vLykj3NWrllMrG06.js +335 -71
  9. package/libs/gltf-viewer/coordsToDirection.d.ts +1 -1
  10. package/libs/gltf-viewer/index.d.ts +25 -3
  11. package/libs/gltf-viewer/index.js +169 -52
  12. package/package.json +3 -3
  13. package/plugins/CSS3DRenderPlugin/index.js +15 -10
  14. package/plugins/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +7 -0
  15. package/plugins/CSS3DRenderPlugin/utils/createResizeObserver.js +34 -0
  16. package/plugins/ModelChassisCompassPlugin/index.d.ts +1 -1
  17. package/plugins/ModelChassisCompassPlugin/index.js +2 -1
  18. package/plugins/ModelEntryDoorGuidePlugin/index.d.ts +4 -0
  19. package/plugins/ModelEntryDoorGuidePlugin/index.js +13 -7
  20. package/plugins/ModelRoomLabelPlugin/Controller.js +1 -0
  21. package/plugins/ModelRoomLabelPlugin/RoomLabelItem.js +5 -5
  22. package/plugins/ModelRoomLabelPlugin/index.d.ts +4 -0
  23. package/plugins/ModelRoomLabelPlugin/index.js +7 -2
  24. package/plugins/PanoMaskSelectorPlugin/fragmentShader.d.ts +1 -1
  25. package/plugins/PanoMaskSelectorPlugin/fragmentShader.js +1 -1
  26. package/plugins/PanoMeasurePlugin/Controller/BaseController.d.ts +36 -0
  27. package/plugins/PanoMeasurePlugin/Controller/BaseController.js +103 -0
  28. package/plugins/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
  29. package/plugins/PanoMeasurePlugin/Controller/EditController.js +341 -0
  30. package/plugins/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
  31. package/plugins/PanoMeasurePlugin/Controller/ShortcutKeyController.js +69 -0
  32. package/plugins/PanoMeasurePlugin/Controller/WatchController.d.ts +25 -0
  33. package/plugins/PanoMeasurePlugin/Controller/WatchController.js +371 -0
  34. package/plugins/PanoMeasurePlugin/Controller/index.d.ts +61 -0
  35. package/plugins/PanoMeasurePlugin/Controller/index.js +230 -0
  36. package/plugins/PanoMeasurePlugin/Model/index.d.ts +38 -0
  37. package/plugins/PanoMeasurePlugin/Model/index.js +235 -0
  38. package/plugins/PanoMeasurePlugin/Model/line.d.ts +30 -0
  39. package/plugins/PanoMeasurePlugin/Model/line.js +121 -0
  40. package/plugins/PanoMeasurePlugin/Model/point.d.ts +16 -0
  41. package/plugins/PanoMeasurePlugin/Model/point.js +68 -0
  42. package/plugins/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
  43. package/plugins/PanoMeasurePlugin/Model/polyline.js +109 -0
  44. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
  45. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +11 -0
  46. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
  47. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +11 -0
  48. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
  49. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +11 -0
  50. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +22 -0
  51. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/index.js +182 -0
  52. package/plugins/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
  53. package/plugins/PanoMeasurePlugin/Modules/FiveHelper.js +66 -0
  54. package/plugins/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
  55. package/plugins/PanoMeasurePlugin/Modules/GuideController.js +107 -0
  56. package/plugins/PanoMeasurePlugin/Modules/Magnifier.d.ts +24 -0
  57. package/plugins/PanoMeasurePlugin/Modules/Magnifier.js +139 -0
  58. package/plugins/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
  59. package/plugins/PanoMeasurePlugin/Modules/UIController/HTML.js +26 -0
  60. package/plugins/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
  61. package/plugins/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +169 -0
  62. package/plugins/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +12 -0
  63. package/plugins/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +59 -0
  64. package/plugins/PanoMeasurePlugin/Modules/UIController/index.d.ts +16 -0
  65. package/plugins/PanoMeasurePlugin/Modules/UIController/index.js +123 -0
  66. package/plugins/PanoMeasurePlugin/Modules/UIController/style.d.ts +17 -0
  67. package/plugins/PanoMeasurePlugin/Modules/UIController/style.js +103 -0
  68. package/plugins/PanoMeasurePlugin/index.d.ts +7 -0
  69. package/plugins/PanoMeasurePlugin/index.js +20 -0
  70. package/plugins/PanoMeasurePlugin/typings/data.d.ts +28 -0
  71. package/plugins/PanoMeasurePlugin/typings/data.js +7 -0
  72. package/plugins/PanoMeasurePlugin/typings/event.type.d.ts +28 -0
  73. package/plugins/PanoMeasurePlugin/typings/event.type.js +7 -0
  74. package/plugins/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
  75. package/plugins/PanoMeasurePlugin/typings/utils.type.js +7 -0
  76. package/plugins/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
  77. package/plugins/PanoMeasurePlugin/utils/clearGroup.js +16 -0
  78. package/plugins/PanoMeasurePlugin/utils/constants.d.ts +4 -0
  79. package/plugins/PanoMeasurePlugin/utils/constants.js +47 -0
  80. package/plugins/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
  81. package/plugins/PanoMeasurePlugin/utils/distanceDom.js +147 -0
  82. package/plugins/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
  83. package/plugins/PanoMeasurePlugin/utils/findAssociatedLines.js +37 -0
  84. package/plugins/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
  85. package/plugins/PanoMeasurePlugin/utils/findClosestPoint.js +49 -0
  86. package/plugins/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
  87. package/plugins/PanoMeasurePlugin/utils/getIntersectionFromEvent.js +20 -0
  88. package/plugins/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
  89. package/plugins/PanoMeasurePlugin/utils/getPointFromHammerEvent.js +33 -0
  90. package/plugins/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
  91. package/plugins/PanoMeasurePlugin/utils/ironbox.js +14 -0
  92. package/plugins/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
  93. package/plugins/PanoMeasurePlugin/utils/isNDCPointInScreen.js +16 -0
  94. package/plugins/PanoMeasurePlugin/utils/line.d.ts +17 -0
  95. package/plugins/PanoMeasurePlugin/utils/line.js +61 -0
  96. package/plugins/PanoMeasurePlugin/utils/math.d.ts +17 -0
  97. package/plugins/PanoMeasurePlugin/utils/math.js +57 -0
  98. package/plugins/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
  99. package/plugins/PanoMeasurePlugin/utils/mouseGroup.js +42 -0
  100. package/plugins/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
  101. package/plugins/PanoMeasurePlugin/utils/ndc2Screen.js +16 -0
  102. package/plugins/PanoRulerPlugin/index.d.ts +4 -0
  103. package/plugins/PanoRulerPlugin/index.js +6 -1
  104. package/plugins/floorplan/Assets/floorplanExtraObject.d.ts +1 -1
  105. package/plugins/floorplan/Assets/floorplanExtraObject.js +3 -3
  106. package/plugins/floorplan/ModelFloorplanPlugin/Controller.d.ts +5 -2
  107. package/plugins/floorplan/ModelFloorplanPlugin/Controller.js +22 -11
  108. package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.js +4 -4
  109. package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.js +5 -5
  110. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.js +2 -2
  111. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomMaterial.d.ts +11 -0
  112. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomMaterial.js +174 -0
  113. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RuleLabels.d.ts +8 -0
  114. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RuleLabels.js +178 -0
  115. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.d.ts +2 -0
  116. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.js +14 -2
  117. package/plugins/floorplan/ModelFloorplanPlugin/components/index.d.ts +3 -0
  118. package/plugins/floorplan/ModelFloorplanPlugin/components/index.js +1 -1
  119. package/plugins/floorplan/ModelFloorplanPlugin/typings/utility.d.ts +2 -0
  120. package/plugins/floorplan/ModelFloorplanPlugin/typings/utility.js +7 -0
  121. package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +1 -1
  122. package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.js +1 -1
  123. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.js +1 -0
  124. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.js +4 -4
  125. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.js +2 -2
  126. package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +1 -1
  127. package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -3
  128. package/plugins/floorplan/TopviewFloorplanPlugin/Controller.d.ts +3 -0
  129. package/plugins/floorplan/TopviewFloorplanPlugin/Controller.js +16 -6
  130. package/plugins/floorplan/index.d.ts +4 -0
  131. package/plugins/floorplan/index.js +13 -0
  132. package/plugins/floorplan/typings/floorplanData.d.ts +2 -0
  133. package/plugins/floorplan/typings/floorplanServerData.d.ts +3 -1
  134. package/plugins/floorplan/typings/floorplanServerData.js +3 -3
  135. package/plugins/floorplan/utils/formatData.js +3 -2
  136. package/shared-utils/changeModelCanvasOpacity.d.ts +2 -0
  137. package/shared-utils/{changeModelCanvansOpacity.js → changeModelCanvasOpacity.js} +2 -2
  138. package/shared-utils/math/evenNumber.d.ts +3 -1
  139. package/shared-utils/math/evenNumber.js +4 -2
  140. package/shared-utils/removeArrayItem.d.ts +7 -0
  141. package/shared-utils/removeArrayItem.js +22 -0
  142. package/shared-utils/three/loadTexture.d.ts +2 -2
  143. package/shared-utils/three/loadTexture.js +21 -2
  144. package/shared-utils/changeModelCanvansOpacity.d.ts +0 -2
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.UIController = void 0;
11
+
12
+ require("core-js/modules/es.object.assign.js");
13
+
14
+ require("core-js/modules/es.array.for-each.js");
15
+
16
+ require("core-js/modules/web.dom-collections.for-each.js");
17
+
18
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
19
+
20
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
21
+
22
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
+
24
+ var _HTML = _interopRequireDefault(require("./HTML"));
25
+
26
+ var _style = require("./style");
27
+
28
+ var _MainBtnController = require("./MainBtnController");
29
+
30
+ var _Revoke = _interopRequireDefault(require("./Revoke"));
31
+
32
+ var UIController = /*#__PURE__*/function () {
33
+ function UIController(measureController, params) {
34
+ var _this = this;
35
+
36
+ (0, _classCallCheck2["default"])(this, UIController);
37
+ (0, _defineProperty2["default"])(this, "disposers", []);
38
+ (0, _defineProperty2["default"])(this, "handleExit", function () {
39
+ var exitIcon = _this.container.querySelector('.fpm__exit-icon');
40
+
41
+ var exitItem = _this.container.querySelector('.fpm__exit');
42
+
43
+ if (!exitItem || !exitIcon) throw new Error('cannot find dom');
44
+ Object.assign(exitItem.style, _style.exitItemStyle);
45
+ Object.assign(exitIcon === null || exitIcon === void 0 ? void 0 : exitIcon.style, _style.exitIconStyle);
46
+
47
+ var onMouseEnter = function onMouseEnter() {
48
+ return exitItem.style.opacity = '1';
49
+ };
50
+
51
+ var onMouseLeave = function onMouseLeave() {
52
+ return exitItem.style.opacity = '0.7';
53
+ };
54
+
55
+ var handleClick = function handleClick() {
56
+ _this.measureController.close();
57
+ };
58
+
59
+ exitIcon.addEventListener('click', handleClick);
60
+ exitIcon.addEventListener('mouseenter', onMouseEnter);
61
+ exitIcon.addEventListener('mouseleave', onMouseLeave);
62
+ return function () {
63
+ exitIcon.removeEventListener('click', handleClick);
64
+ exitIcon.removeEventListener('mouseenter', onMouseEnter);
65
+ exitIcon.removeEventListener('mouseleave', onMouseLeave);
66
+ };
67
+ });
68
+ this.measureController = measureController;
69
+ this.container = document.createElement('div');
70
+ this.container.innerHTML = _HTML["default"];
71
+ this.container.classList.add('fpm__ui-controller');
72
+ params.container.appendChild(this.container);
73
+ var textDoms = this.container.querySelectorAll('.fpm__text');
74
+ var UIItems = this.container.querySelectorAll('.fpm__ui-item');
75
+ var bgDom = this.container.querySelector('.fpm_ui-bg');
76
+ var operatingSpaceDom = this.container.querySelector('.fpm_operating-space');
77
+ Object.assign(bgDom === null || bgDom === void 0 ? void 0 : bgDom.style, _style.controllerBackgroundStyle);
78
+ Object.assign(operatingSpaceDom === null || operatingSpaceDom === void 0 ? void 0 : operatingSpaceDom.style, _style.operatingSpaceStyle);
79
+ Object.assign(this.container.style, _style.uiWrapperStyle);
80
+ UIItems.forEach(function (item) {
81
+ return Object.assign(item.style, _style.buttonGroupStyle);
82
+ });
83
+ textDoms.forEach(function (item) {
84
+ return Object.assign(item.style, _style.textStyle);
85
+ });
86
+ }
87
+
88
+ (0, _createClass2["default"])(UIController, [{
89
+ key: "dispose",
90
+ value: function dispose() {
91
+ this.hide();
92
+ this.container.remove();
93
+ }
94
+ }, {
95
+ key: "show",
96
+ value: function show() {
97
+ this.container.style.opacity = '1';
98
+ this.container.style.transform = 'translate(0, 0)';
99
+ this.revoke = new _Revoke["default"](this.measureController, this.container);
100
+ this.mainController = new _MainBtnController.MainBtnController(this.measureController, this.container);
101
+ this.disposers.push(this.handleExit());
102
+ return this;
103
+ }
104
+ }, {
105
+ key: "hide",
106
+ value: function hide() {
107
+ var _this$revoke, _this$mainController;
108
+
109
+ this.container.style.opacity = '0';
110
+ this.container.style.transform = 'translate(0, 10px)';
111
+ (_this$revoke = this.revoke) === null || _this$revoke === void 0 ? void 0 : _this$revoke.dispose();
112
+ (_this$mainController = this.mainController) === null || _this$mainController === void 0 ? void 0 : _this$mainController.dispose();
113
+ this.disposers.forEach(function (disposer) {
114
+ return disposer();
115
+ });
116
+ this.disposers = [];
117
+ return this;
118
+ }
119
+ }]);
120
+ return UIController;
121
+ }();
122
+
123
+ exports.UIController = UIController;
@@ -0,0 +1,17 @@
1
+ export declare const addHoverImage = "//vrlab-static.ljcdn.com/release/web/measure/add-hover.944fffad.png";
2
+ export declare const addNormalImage = "//vrlab-static.ljcdn.com/release/web/measure/add-normal.39e967e9.png";
3
+ export declare const cancelHoverImage = "//vrlab-static.ljcdn.com/release/web/measure/canale-hover.74b37e24.png";
4
+ export declare const cancelNormalImage = "//vrlab-static.ljcdn.com/release/web/measure/cancle-normal.77bb326c.png";
5
+ export declare const doneHoverImage = "//vrlab-static.ljcdn.com/release/web/measure/done-hover.9e09438b.png";
6
+ export declare const doneNormalImage = "//vrlab-static.ljcdn.com/release/web/measure/done-normal.4fcddd73.png";
7
+ export declare const exitImage = "//vrlab-static.ljcdn.com/release/web/measure/exit.6693ad51.png";
8
+ export declare const revokeImage = "//vrlab-static.ljcdn.com/release/web/measure/revoke.3e424843.png";
9
+ export declare const uiWrapperStyle: Partial<CSSStyleDeclaration>;
10
+ export declare const operatingSpaceStyle: Partial<CSSStyleDeclaration>;
11
+ export declare const buttonGroupStyle: Partial<CSSStyleDeclaration>;
12
+ export declare const controllerBackgroundStyle: Partial<CSSStyleDeclaration>;
13
+ export declare const mainItemStyle: Partial<CSSStyleDeclaration>;
14
+ export declare const exitItemStyle: Partial<CSSStyleDeclaration>;
15
+ export declare const mainIconStyle: Partial<CSSStyleDeclaration>;
16
+ export declare const exitIconStyle: Partial<CSSStyleDeclaration>;
17
+ export declare const textStyle: Partial<CSSStyleDeclaration>;
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.uiWrapperStyle = exports.textStyle = exports.revokeImage = exports.operatingSpaceStyle = exports.mainItemStyle = exports.mainIconStyle = exports.exitItemStyle = exports.exitImage = exports.exitIconStyle = exports.doneNormalImage = exports.doneHoverImage = exports.controllerBackgroundStyle = exports.cancelNormalImage = exports.cancelHoverImage = exports.buttonGroupStyle = exports.addNormalImage = exports.addHoverImage = void 0;
9
+ var addHoverImage = '//vrlab-static.ljcdn.com/release/web/measure/add-hover.944fffad.png';
10
+ exports.addHoverImage = addHoverImage;
11
+ var addNormalImage = '//vrlab-static.ljcdn.com/release/web/measure/add-normal.39e967e9.png';
12
+ exports.addNormalImage = addNormalImage;
13
+ var cancelHoverImage = '//vrlab-static.ljcdn.com/release/web/measure/canale-hover.74b37e24.png';
14
+ exports.cancelHoverImage = cancelHoverImage;
15
+ var cancelNormalImage = '//vrlab-static.ljcdn.com/release/web/measure/cancle-normal.77bb326c.png';
16
+ exports.cancelNormalImage = cancelNormalImage;
17
+ var doneHoverImage = '//vrlab-static.ljcdn.com/release/web/measure/done-hover.9e09438b.png';
18
+ exports.doneHoverImage = doneHoverImage;
19
+ var doneNormalImage = '//vrlab-static.ljcdn.com/release/web/measure/done-normal.4fcddd73.png';
20
+ exports.doneNormalImage = doneNormalImage;
21
+ var exitImage = '//vrlab-static.ljcdn.com/release/web/measure/exit.6693ad51.png';
22
+ exports.exitImage = exitImage;
23
+ var revokeImage = '//vrlab-static.ljcdn.com/release/web/measure/revoke.3e424843.png';
24
+ exports.revokeImage = revokeImage;
25
+ var uiWrapperStyle = {
26
+ position: 'absolute',
27
+ top: '0',
28
+ left: '0',
29
+ width: '100%',
30
+ height: '100%',
31
+ opacity: '0',
32
+ transform: 'translate(0, 10px)',
33
+ transition: 'opacity 500ms ease-in-out, transform 500ms ease-in-out'
34
+ };
35
+ exports.uiWrapperStyle = uiWrapperStyle;
36
+ var operatingSpaceStyle = {
37
+ position: 'absolute',
38
+ left: '50%',
39
+ bottom: '32px',
40
+ transform: 'translateX(-50%)',
41
+ width: '300px',
42
+ height: '89px',
43
+ display: 'flex',
44
+ justifyContent: 'space-between',
45
+ fontSize: '16px',
46
+ pointerEvents: 'all',
47
+ color: '#fff',
48
+ zIndex: '10'
49
+ };
50
+ exports.operatingSpaceStyle = operatingSpaceStyle;
51
+ var buttonGroupStyle = {
52
+ height: '100%',
53
+ width: 'max-content',
54
+ display: 'flex',
55
+ flexDirection: 'column',
56
+ justifyContent: 'space-between',
57
+ alignItems: 'center'
58
+ }; // 操作区下方的背景
59
+
60
+ exports.buttonGroupStyle = buttonGroupStyle;
61
+ var controllerBackgroundStyle = {
62
+ position: 'absolute',
63
+ bottom: '0',
64
+ left: '0',
65
+ opacity: '0.5',
66
+ width: '100%',
67
+ height: '184px',
68
+ background: "linear-gradient(180deg, rgba(0,0,0,0.00) 0%, #000000 100%)",
69
+ zIndex: '0'
70
+ }; // item
71
+
72
+ exports.controllerBackgroundStyle = controllerBackgroundStyle;
73
+ var mainItemStyle = {
74
+ margin: '0 80px',
75
+ opacity: '0.7'
76
+ };
77
+ exports.mainItemStyle = mainItemStyle;
78
+ var exitItemStyle = {
79
+ opacity: '0.7'
80
+ }; // icon
81
+
82
+ exports.exitItemStyle = exitItemStyle;
83
+ var mainIconStyle = {
84
+ width: '60px',
85
+ height: '60px',
86
+ backgroundSize: '100%',
87
+ cursor: 'pointer'
88
+ };
89
+ exports.mainIconStyle = mainIconStyle;
90
+ var exitIconStyle = {
91
+ width: '40px',
92
+ height: '40px',
93
+ marginTop: '10px',
94
+ backgroundSize: '100%',
95
+ cursor: 'pointer'
96
+ }; // text
97
+
98
+ exports.exitIconStyle = exitIconStyle;
99
+ var textStyle = {
100
+ cursor: 'default',
101
+ userSelect: 'none'
102
+ };
103
+ exports.textStyle = textStyle;
@@ -0,0 +1,7 @@
1
+ import { FivePlugin } from '@realsee/five';
2
+ import MeasureController, { MeasurePluginParameter } from './Controller';
3
+ declare const MeasurePlugin: FivePlugin<MeasurePluginParameter, PluginReturns>;
4
+ export default MeasurePlugin;
5
+ export declare type PluginReturns = MeasureController;
6
+ export type { PluginEvent } from './typings/event.type';
7
+ export type { LineJson, PointJson } from './typings/data';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports["default"] = void 0;
11
+
12
+ var _Controller = _interopRequireDefault(require("./Controller"));
13
+
14
+ var MeasurePlugin = function MeasurePlugin(five, params) {
15
+ return new _Controller["default"](five, params);
16
+ };
17
+
18
+ var _default = MeasurePlugin; // 类型导出
19
+
20
+ exports["default"] = _default;
@@ -0,0 +1,28 @@
1
+ export interface LineCompletelyJson {
2
+ id: string;
3
+ points: PointJson[];
4
+ }
5
+ export interface PolylineCompletelyJson {
6
+ id: string;
7
+ points: PointJson[];
8
+ lines: LineCompletelyJson[];
9
+ }
10
+ export interface LineJson {
11
+ id: string;
12
+ points: string[];
13
+ }
14
+ export interface PolylineJson {
15
+ id: string;
16
+ points: string[];
17
+ lines: string[];
18
+ }
19
+ export interface PointJson {
20
+ id: string;
21
+ lines: string[];
22
+ position: number[];
23
+ }
24
+ export interface PluginData {
25
+ lines: LineJson[];
26
+ points: PointJson[];
27
+ polylines: PolylineJson[];
28
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
@@ -0,0 +1,28 @@
1
+ import { SubscribeEventMap } from '@realsee/five';
2
+ import { Vector3 } from 'three';
3
+ import { Mode } from '../Controller';
4
+ import { LineCompletelyJson } from './data';
5
+ interface ControllerEvent extends SubscribeEventMap {
6
+ /**
7
+ * Mode 变更
8
+ */
9
+ modeChange: (mode: Mode) => void;
10
+ }
11
+ interface WatchEvent extends SubscribeEventMap {
12
+ selectedChange: (lines: LineCompletelyJson[]) => void;
13
+ }
14
+ interface EditEvent {
15
+ /**
16
+ * 编辑线条变更
17
+ */
18
+ editedLineChange: (lines: LineCompletelyJson[]) => void;
19
+ anchorChange: (anchor: Vector3 | null) => void;
20
+ }
21
+ interface DragEvent extends SubscribeEventMap {
22
+ wantsDragLine: (event: {
23
+ point: string;
24
+ lines: string[];
25
+ }) => boolean;
26
+ }
27
+ export declare type PluginEvent = ControllerEvent & EditEvent & WatchEvent & DragEvent;
28
+ export {};
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
@@ -0,0 +1 @@
1
+ export declare type ValueOf<T> = T[keyof T];
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
@@ -0,0 +1,2 @@
1
+ import { Group } from 'three';
2
+ export default function clearGroup(group: Group): void;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports["default"] = clearGroup;
11
+
12
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
+
14
+ function clearGroup(group) {
15
+ group.children.length > 0 && group.remove.apply(group, (0, _toConsumableArray2["default"])(group.children));
16
+ }
@@ -0,0 +1,4 @@
1
+ import { ICreatLineOpts } from './line';
2
+ export declare const normalLineOpts: ICreatLineOpts;
3
+ export declare const dashLineOpts: ICreatLineOpts;
4
+ export declare const lightLineOpts: ICreatLineOpts;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.normalLineOpts = exports.lightLineOpts = exports.dashLineOpts = void 0;
9
+
10
+ require("core-js/modules/es.object.assign.js");
11
+
12
+ var _three = require("three");
13
+
14
+ var lineWidth = 2;
15
+ var lightLineWidth = 4;
16
+ var lineColor = new _three.Color(0xffffff);
17
+ var lightLineColor = new _three.Color(0x2d7cff);
18
+ var pointColor = new _three.Color(0xffffff);
19
+ var lightPointColor = new _three.Color(0x2d7cff);
20
+ var pointSize = 8;
21
+ var lightPointSize = 16;
22
+ var pointImage = 'data:image/png;base64,' + 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==';
23
+ var pointTexture = new _three.TextureLoader().load(pointImage);
24
+ var normalLineOpts = {
25
+ pointTexture: pointTexture,
26
+ pointSize: pointSize,
27
+ lineWidth: lineWidth,
28
+ lineColor: lineColor,
29
+ pointColor: pointColor,
30
+ lineRenderOrder: 20,
31
+ pointsRenderOrder: 20
32
+ };
33
+ exports.normalLineOpts = normalLineOpts;
34
+ var dashLineOpts = Object.assign({}, normalLineOpts, {
35
+ dashed: true
36
+ });
37
+ exports.dashLineOpts = dashLineOpts;
38
+ var lightLineOpts = {
39
+ pointTexture: pointTexture,
40
+ pointSize: lightPointSize,
41
+ lineWidth: lightLineWidth,
42
+ lineColor: lightLineColor,
43
+ pointColor: lightPointColor,
44
+ lineRenderOrder: 10,
45
+ pointsRenderOrder: 10
46
+ };
47
+ exports.lightLineOpts = lightLineOpts;
@@ -0,0 +1,28 @@
1
+ import Line from '../Model/line';
2
+ import { Five } from '@realsee/five';
3
+ import { Vector3 } from 'three';
4
+ import { LineCompletelyJson, PolylineCompletelyJson } from '../typings/data';
5
+ export declare type DistanceItem = ReturnType<typeof creatDistanceItem>;
6
+ export interface UserDistanceItem {
7
+ element: Element;
8
+ highlight: () => void;
9
+ unHighlight: () => void;
10
+ update: (params: {
11
+ line: LineCompletelyJson;
12
+ polyline: PolylineCompletelyJson;
13
+ }) => void;
14
+ }
15
+ export interface IDistanceItemProps {
16
+ line: Line;
17
+ userDistanceItem?: UserDistanceItem;
18
+ clickCallback?: (item: DistanceItem) => unknown;
19
+ }
20
+ export declare function creatDistanceItem(props: IDistanceItemProps): {
21
+ lineID: string;
22
+ ndcPosition: Vector3;
23
+ update: (five: Five) => void;
24
+ appendTo: (container: Element) => void;
25
+ remove: () => void;
26
+ highlight: () => void;
27
+ unHighlight: () => void;
28
+ };
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.creatDistanceItem = creatDistanceItem;
11
+
12
+ require("core-js/modules/es.array.concat.js");
13
+
14
+ require("core-js/modules/es.number.to-fixed.js");
15
+
16
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
17
+
18
+ var _three = require("three");
19
+
20
+ var _isNDCPointInScreen = _interopRequireDefault(require("./isNDCPointInScreen"));
21
+
22
+ function creatContentDom() {
23
+ var contentDom = document.createElement('div');
24
+ contentDom.style.height = '24px';
25
+ contentDom.style.width = '62px';
26
+ contentDom.style.lineHeight = '24px';
27
+ contentDom.style.textAlign = 'center';
28
+ contentDom.style.transform = 'translate(-50%, -50%)';
29
+ contentDom.style.borderRadius = '12px';
30
+ contentDom.style.fontSize = '14px';
31
+ contentDom.style.color = '#000000';
32
+ contentDom.style.background = '#fff';
33
+ contentDom.style.pointerEvents = 'all';
34
+ contentDom.style.cursor = 'pointer';
35
+ return contentDom;
36
+ }
37
+
38
+ function createContainerDom(line) {
39
+ var containerDom = document.createElement('div');
40
+ containerDom.id = 'distance_' + line.id;
41
+ containerDom.classList.add('five-plugin-measure__distance');
42
+ containerDom.style.opacity = '0';
43
+ containerDom.style.position = 'absolute';
44
+ containerDom.style.left = '0';
45
+ containerDom.style.top = '0';
46
+ containerDom.style.transform = 'translate3d(0, 0, 0)';
47
+ return containerDom;
48
+ }
49
+
50
+ function creatDistanceItem(props) {
51
+ function handleClick() {
52
+ var _props$clickCallback;
53
+
54
+ highlight();
55
+ (_props$clickCallback = props.clickCallback) === null || _props$clickCallback === void 0 ? void 0 : _props$clickCallback.call(props, distanceItem);
56
+ }
57
+
58
+ function highlight() {
59
+ if (userDistanceItem) return userDistanceItem.highlight();
60
+ contentDom.style.border = '1px solid #538FFF';
61
+ contentDom.style.color = '#538FFF';
62
+ }
63
+
64
+ function unHighlight() {
65
+ if (userDistanceItem) return userDistanceItem.unHighlight();
66
+ contentDom.style.border = 'none';
67
+ contentDom.style.color = '#000';
68
+ }
69
+
70
+ function update(five) {
71
+ var fiveElement = five.getElement();
72
+ if (!fiveElement) return;
73
+ var screenWidth = fiveElement.clientWidth;
74
+ var screenHeight = fiveElement.clientHeight;
75
+ if (line.points.length < 2) return;
76
+
77
+ var _line$points = (0, _slicedToArray2["default"])(line.points, 2),
78
+ startPoint = _line$points[0],
79
+ endPoint = _line$points[1];
80
+
81
+ var ndcStartPosition = startPoint.position.clone().project(five.camera);
82
+ var ndcEndPosition = endPoint.position.clone().project(five.camera);
83
+ var ndcDomPosition = ndcStartPosition.clone().lerp(ndcEndPosition, 0.5);
84
+
85
+ var visible = function () {
86
+ // 对于超过近平面和远平面的点,计算会有问题
87
+ if (Math.abs(ndcStartPosition.z) > 1 || Math.abs(ndcEndPosition.z) > 1) return false;
88
+ if (!(0, _isNDCPointInScreen["default"])(ndcStartPosition) && !(0, _isNDCPointInScreen["default"])(ndcEndPosition)) return false;
89
+ if (!(0, _isNDCPointInScreen["default"])(ndcDomPosition)) return false;
90
+ var screenStartPosition = new _three.Vector2(ndcStartPosition.x * screenWidth, ndcStartPosition.y * screenHeight);
91
+ var screenEndPosition = new _three.Vector2(ndcEndPosition.x * screenWidth, ndcEndPosition.y * screenHeight);
92
+ if (screenStartPosition.distanceTo(screenEndPosition) < 20) return false;
93
+ return true;
94
+ }();
95
+
96
+ if (visible === false) {
97
+ containerDom.style.opacity = '0';
98
+ containerDom.style.pointerEvents = 'none';
99
+ return;
100
+ } // 更新 UI
101
+
102
+
103
+ var left = (ndcDomPosition.x + 1) / 2 * screenWidth;
104
+ var top = -(ndcDomPosition.y - 1) / 2 * screenHeight;
105
+ containerDom.style.transform = "translate3d(".concat(left, "px, ").concat(top, "px, 10px)");
106
+ containerDom.style.opacity = '1';
107
+ containerDom.style.pointerEvents = 'all';
108
+
109
+ if (userDistanceItem) {
110
+ userDistanceItem.update({
111
+ line: line.toCompletelyJson(),
112
+ polyline: line.getPolyline().toCompletelyJson()
113
+ });
114
+ }
115
+
116
+ var distanceString = startPoint.position.clone().distanceTo(endPoint.position).toFixed(2) + 'm';
117
+ contentDom.innerText !== distanceString && (contentDom.innerText = distanceString);
118
+ }
119
+
120
+ function appendTo(container) {
121
+ container.appendChild(containerDom);
122
+ containerDom.addEventListener('click', handleClick);
123
+ }
124
+
125
+ function remove() {
126
+ contentDom.removeEventListener('click', handleClick);
127
+ containerDom.remove();
128
+ }
129
+
130
+ var line = props.line;
131
+ var lineID = line.id;
132
+ var contentDom = creatContentDom();
133
+ var containerDom = createContainerDom(line);
134
+ var userDistanceItem = props.userDistanceItem;
135
+ var ndcPosition = new _three.Vector3(0, 0, 0);
136
+ var distanceItem = {
137
+ lineID: lineID,
138
+ ndcPosition: ndcPosition,
139
+ update: update,
140
+ appendTo: appendTo,
141
+ remove: remove,
142
+ highlight: highlight,
143
+ unHighlight: unHighlight
144
+ };
145
+ userDistanceItem !== null && userDistanceItem !== void 0 && userDistanceItem.element ? containerDom.appendChild(userDistanceItem.element) : containerDom.appendChild(contentDom);
146
+ return distanceItem;
147
+ }
@@ -0,0 +1,2 @@
1
+ import Line from '../Model/line';
2
+ export declare function findAssociatedLines(line: Line): Line[];
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.findAssociatedLines = findAssociatedLines;
9
+
10
+ require("core-js/modules/es.array.find.js");
11
+
12
+ require("core-js/modules/es.array.find-index.js");
13
+
14
+ require("core-js/modules/es.array.concat.js");
15
+
16
+ function findAssociatedLines(line) {
17
+ // 找跟这个线段相邻的线
18
+ var mergeNextLine = function mergeNextLine(point, nextIndex, target) {
19
+ var nextLine = point.lines.find(function (line) {
20
+ var pointIndex = line.points.findIndex(function (_ref) {
21
+ var id = _ref.id;
22
+ return id === point.id;
23
+ });
24
+ if (pointIndex === nextIndex) return false;
25
+ return true;
26
+ });
27
+ if (!nextLine) return target;
28
+ var nextPoint = nextLine.points[nextIndex];
29
+ if (!nextPoint) return target;
30
+ return mergeNextLine(nextPoint, nextIndex, target.concat(nextLine));
31
+ };
32
+
33
+ var rightLines = mergeNextLine(line.points[0], 1, []);
34
+ var leftLines = mergeNextLine(line.points[0], 0, []);
35
+ var lines = rightLines.concat(leftLines);
36
+ return lines;
37
+ }
@@ -0,0 +1,10 @@
1
+ import { Vector2 } from 'three';
2
+ import Point from '../Model/point';
3
+ import { Five } from '@realsee/five';
4
+ /**
5
+ * @param tapPoint 注意这里的坐标是相对于 FiveElement 的
6
+ */
7
+ export declare function findClosestPoint(five: Five, points: Point[], tapPoint: Vector2, maxDistance?: number): {
8
+ distance: number;
9
+ point: Point;
10
+ } | null;