@realsee/dnalogel 2.0.0-alpha.16 → 2.0.0-alpha.19

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 (180) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/CSS3DRenderPlugin/index.d.ts +2 -2
  3. package/dist/CameraMovementPlugin/index.js +15 -40
  4. package/dist/CameraMovementPlugin/typing.d.ts +1 -1
  5. package/dist/ModelChassisCompassPlugin/index.js +3 -28
  6. package/dist/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  7. package/dist/ModelEntryDoorGuidePlugin/index.js +8 -33
  8. package/dist/ModelItemLabelPlugin/events.type.d.ts +2 -2
  9. package/dist/ModelItemLabelPlugin/index.js +8 -8
  10. package/dist/ModelItemLabelPlugin/typings.d.ts +2 -2
  11. package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  12. package/dist/ModelRoomLabelPlugin/index.js +6 -6
  13. package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  14. package/dist/ModelTVVideoPlugin/index.d.ts +1 -1
  15. package/dist/ModelTVVideoPlugin/index.js +3 -28
  16. package/dist/PanoCompassPlugin/index.js +53 -86
  17. package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  18. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  19. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  20. package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  21. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  22. package/dist/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  23. package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
  24. package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
  25. package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
  26. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  27. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  28. package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  29. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  30. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  31. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  32. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  33. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  34. package/dist/PanoMeasurePlugin/index.d.ts +1 -1
  35. package/dist/PanoMeasurePlugin/index.js +1 -21
  36. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  37. package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  38. package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  39. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  40. package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  41. package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  42. package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  43. package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  44. package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  45. package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
  46. package/dist/PanoRulerPlugin/index.d.ts +1 -1
  47. package/dist/PanoRulerPlugin/index.js +3 -28
  48. package/dist/PanoSpatialTagPlugin/index.js +11 -11
  49. package/dist/PanoSpatialTagPlugin/typings.d.ts +1 -1
  50. package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  51. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  52. package/dist/floorplan/ModelFloorplanPlugin/index.js +1266 -1298
  53. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +81 -204
  54. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  55. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  56. package/dist/floorplan/TopviewFloorplanPlugin/index.js +1257 -1250
  57. package/dist/floorplan/utils/formatPosition.d.ts +1 -1
  58. package/dist/index.es.js +1480 -1507
  59. package/dist/index.js +1477 -1504
  60. package/dist/index.umd.js +1477 -1504
  61. package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  62. package/dist/shared-utils/three/getNormal.d.ts +1 -1
  63. package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
  64. package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
  65. package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
  66. package/docs/assets/search.js +1 -1
  67. package/docs/classes/ModelRoomLabelController.html +6 -6
  68. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  69. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  70. package/docs/interfaces/LineJson.html +1 -1
  71. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  72. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  73. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  74. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  75. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  76. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  77. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  78. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  79. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  80. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  81. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  82. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  83. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  84. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  85. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  86. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  87. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  88. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  89. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  90. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  91. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  92. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  93. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  94. package/docs/interfaces/PointJson.html +1 -1
  95. package/docs/interfaces/RoomLabel.html +7 -7
  96. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +19 -1
  97. package/docs/modules.html +12 -12
  98. package/libs/CSS3DRenderPlugin/index.d.ts +2 -2
  99. package/libs/CameraMovementPlugin/index.js +15 -24
  100. package/libs/CameraMovementPlugin/typing.d.ts +1 -1
  101. package/libs/ModelChassisCompassPlugin/index.js +3 -12
  102. package/libs/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  103. package/libs/ModelEntryDoorGuidePlugin/index.js +8 -17
  104. package/libs/ModelItemLabelPlugin/events.type.d.ts +2 -2
  105. package/libs/ModelItemLabelPlugin/typings.d.ts +2 -2
  106. package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
  107. package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  108. package/libs/ModelTVVideoPlugin/index.d.ts +1 -1
  109. package/libs/ModelTVVideoPlugin/index.js +3 -12
  110. package/libs/ModelTVVideoPlugin/typings.js +1 -0
  111. package/libs/PanoCompassPlugin/index.js +49 -64
  112. package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  113. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
  114. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
  115. package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -1
  116. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
  117. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
  118. package/libs/PanoMeasurePlugin/Controller/index.d.ts +3 -3
  119. package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
  120. package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
  121. package/libs/PanoMeasurePlugin/Model/line.js +1 -1
  122. package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
  123. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
  124. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
  125. package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
  126. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
  127. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
  128. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
  129. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
  130. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
  131. package/libs/PanoMeasurePlugin/index.d.ts +1 -1
  132. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
  133. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
  134. package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
  135. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
  136. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
  137. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
  138. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
  139. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
  140. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
  141. package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
  142. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +1 -0
  143. package/libs/PanoRulerPlugin/index.d.ts +1 -1
  144. package/libs/PanoRulerPlugin/index.js +3 -12
  145. package/libs/PanoSpatialTagPlugin/typings.d.ts +1 -1
  146. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
  147. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.js +0 -0
  148. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Camera.js +2 -2
  149. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Compass.js +0 -0
  150. package/libs/floorplan/{ModelFloorplanPlugin/Components/CurrentFloor → Components}/CurrentFloor.js +73 -80
  151. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Main.js +186 -105
  152. package/libs/floorplan/Components/RoomHighlight/Room.js +5 -7
  153. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +24 -116
  154. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabel.js +0 -0
  155. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabels.js +2 -2
  156. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +26 -22
  157. package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
  158. package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RuleLabels/RuleLabels.js +82 -32
  159. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
  160. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +34 -43
  161. package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +22 -33
  162. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -12
  163. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
  164. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +80 -54
  165. package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  166. package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -1
  167. package/libs/floorplan/utils/formatData.js +28 -43
  168. package/libs/floorplan/utils/formatPosition.d.ts +1 -1
  169. package/libs/floorplan/utils/formatPosition.js +2 -2
  170. package/libs/shared-utils/five/changeMode.js +12 -23
  171. package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  172. package/libs/shared-utils/three/getNormal.d.ts +1 -1
  173. package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
  174. package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
  175. package/libs/shared-utils/three/loadFbxObj.js +9 -20
  176. package/libs/shared-utils/three/loadTexture.js +6 -17
  177. package/libs/shared-utils/to.js +10 -21
  178. package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
  179. package/package.json +3 -1
  180. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +0 -301
@@ -1,12 +1,3 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  import { Five } from '@realsee/five';
11
2
  import * as TWEEN from '@tweenjs/tween.js';
12
3
  import { tweenProgress } from '../shared-utils/animationFrame/tween';
@@ -38,21 +29,21 @@ const getLongitudeParams = (from, to, rotation) => {
38
29
  */
39
30
  export const CameraMovementPlugin = (five) => {
40
31
  const state = {};
41
- const move = (args, duration, opts = { preload: true }) => __awaiter(void 0, void 0, void 0, function* () {
32
+ const move = async (args, duration, opts = { preload: true }) => {
42
33
  if (state.interruptCallback) {
43
34
  state.interruptCallback(false);
44
35
  }
45
36
  if (opts.asyncStartCallback) {
46
- yield opts.asyncStartCallback();
37
+ await opts.asyncStartCallback();
47
38
  }
48
39
  if (args.mode && args.mode !== five.currentMode) {
49
- yield five.changeMode(args.mode);
40
+ await five.changeMode(args.mode);
50
41
  }
51
42
  if (opts.preload && args.panoIndex !== undefined && args.panoIndex !== five.panoIndex) {
52
- yield five.preloadPano(args.panoIndex);
43
+ await five.preloadPano(args.panoIndex);
53
44
  }
54
45
  if (opts.asyncEndCallback) {
55
- yield opts.asyncEndCallback();
46
+ await opts.asyncEndCallback();
56
47
  }
57
48
  if (args.panoIndex === undefined &&
58
49
  args.fov === undefined &&
@@ -60,7 +51,7 @@ export const CameraMovementPlugin = (five) => {
60
51
  args.longitude === undefined) {
61
52
  return true;
62
53
  }
63
- return yield new Promise((resolve, reject) => {
54
+ return await new Promise((resolve, reject) => {
64
55
  const panoIndex = args.panoIndex !== undefined ? args.panoIndex : five.panoIndex;
65
56
  if (panoIndex !== undefined) {
66
57
  five.moveToPano(panoIndex, Object.assign({
@@ -73,7 +64,7 @@ export const CameraMovementPlugin = (five) => {
73
64
  reject(false);
74
65
  }
75
66
  });
76
- });
67
+ };
77
68
  const getAnimeParams = (args) => {
78
69
  const currentFiveState = five.state;
79
70
  // latitude
@@ -89,20 +80,20 @@ export const CameraMovementPlugin = (five) => {
89
80
  to: { latitude: toLatitude, longitude: toLongitude, fov: toFov },
90
81
  };
91
82
  };
92
- const rotate = (args, duration, opts = {}) => __awaiter(void 0, void 0, void 0, function* () {
83
+ const rotate = async (args, duration, opts = {}) => {
93
84
  if (state.interruptCallback) {
94
85
  state.interruptCallback(false);
95
86
  }
96
87
  if (opts.asyncStartCallback) {
97
- yield opts.asyncStartCallback();
88
+ await opts.asyncStartCallback();
98
89
  }
99
90
  if (five.currentMode !== Five.Mode.Panorama) {
100
- yield five.changeMode(Five.Mode.Panorama);
91
+ await five.changeMode(Five.Mode.Panorama);
101
92
  }
102
93
  if (args.panoIndex !== undefined && args.panoIndex !== five.panoIndex) {
103
94
  if (opts.preload)
104
- yield five.preloadPano(args.panoIndex);
105
- yield new Promise((resolve, reject) => {
95
+ await five.preloadPano(args.panoIndex);
96
+ await new Promise((resolve, reject) => {
106
97
  if (!args.panoIndex) {
107
98
  resolve(true);
108
99
  return;
@@ -114,10 +105,10 @@ export const CameraMovementPlugin = (five) => {
114
105
  });
115
106
  }
116
107
  if (opts.asyncEndCallback) {
117
- yield opts.asyncEndCallback();
108
+ await opts.asyncEndCallback();
118
109
  }
119
110
  const { from, to } = getAnimeParams(args);
120
- return yield new Promise((resolve) => {
111
+ return await new Promise((resolve) => {
121
112
  const onUpdate = ({ progress }) => {
122
113
  const state = {};
123
114
  state.longitude = progressNumber(from.longitude, to.longitude, progress);
@@ -159,7 +150,7 @@ export const CameraMovementPlugin = (five) => {
159
150
  state.interruptCallback(true);
160
151
  }, duration);
161
152
  });
162
- });
153
+ };
163
154
  return {
164
155
  move,
165
156
  rotate,
@@ -1,4 +1,4 @@
1
- import { Mode, Pose } from '@realsee/five';
1
+ import type { Mode, Pose } from '@realsee/five';
2
2
  export interface CameraMovementPluginParameterType {
3
3
  }
4
4
  export interface CameraMovementPluginExportType {
@@ -1,12 +1,3 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  import * as THREE from 'three';
11
2
  import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader';
12
3
  import object3d2LocalMatrix from '../shared-utils/object3d2LocalMatrix';
@@ -19,7 +10,7 @@ export const ModelChassisCompassPlugin = (five, params) => {
19
10
  const defaultNorthRad = params.north_rad || undefined;
20
11
  // 局部状态
21
12
  const state = {};
22
- const load = (data) => __awaiter(void 0, void 0, void 0, function* () {
13
+ const load = async (data) => {
23
14
  const fbxUrl = (data === null || data === void 0 ? void 0 : data.fbx_url) || defaultFbxUrl;
24
15
  const northRad = (data === null || data === void 0 ? void 0 : data.north_rad) || defaultNorthRad;
25
16
  if (!northRad) {
@@ -30,7 +21,7 @@ export const ModelChassisCompassPlugin = (five, params) => {
30
21
  const zOffset = bounding.max.z - bounding.min.z;
31
22
  const maxOffset = Math.max(xOffset, zOffset);
32
23
  const fbxLoader = new FBXLoader();
33
- const object = yield fbxLoader.loadAsync(fbxUrl);
24
+ const object = await fbxLoader.loadAsync(fbxUrl);
34
25
  transfromToMeshBasicMaterial(object, {
35
26
  transparent: true,
36
27
  side: THREE.DoubleSide,
@@ -44,7 +35,7 @@ export const ModelChassisCompassPlugin = (five, params) => {
44
35
  object3d2LocalMatrix(object, { position, rotation, scale });
45
36
  state.object = object;
46
37
  return true;
47
- });
38
+ };
48
39
  const onCameraUpdate = ({ latitude }) => {
49
40
  if (!state.object)
50
41
  return;
@@ -1,5 +1,5 @@
1
1
  import type { FivePlugin } from '@realsee/five';
2
- import { Vector3Position } from '../typings/math.type';
2
+ import type { Vector3Position } from '../typings/math.type';
3
3
  export interface ModelEntryDoorGuidePluginData {
4
4
  position?: Vector3Position;
5
5
  rad?: number;
@@ -1,12 +1,3 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  import { AnimationMixer, MeshBasicMaterial } from 'three';
11
2
  import * as THREE from 'three';
12
3
  import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader';
@@ -25,25 +16,25 @@ export const ModelEntryDoorGuidePlugin = (five, params) => {
25
16
  const defaultRad = (_c = params.rad) !== null && _c !== void 0 ? _c : undefined;
26
17
  const defaultFbxUrl = params.fbx_url || '//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx';
27
18
  const mixers = [];
28
- const load = (data) => __awaiter(void 0, void 0, void 0, function* () {
29
- var _d, _e, _f, _g, _h, _j, _k;
30
- const position = (_d = data === null || data === void 0 ? void 0 : data.position) !== null && _d !== void 0 ? _d : defaultModelPosition;
19
+ const load = async (data) => {
20
+ var _a, _b, _c, _d, _e, _f, _g;
21
+ const position = (_a = data === null || data === void 0 ? void 0 : data.position) !== null && _a !== void 0 ? _a : defaultModelPosition;
31
22
  if (!position)
32
23
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): position is undefined`);
33
24
  const modelPosition = transformPositionToVector3(position);
34
- const rad = (_e = data === null || data === void 0 ? void 0 : data.rad) !== null && _e !== void 0 ? _e : defaultRad;
35
- const fbxUrl = (_f = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _f !== void 0 ? _f : defaultFbxUrl;
25
+ const rad = (_b = data === null || data === void 0 ? void 0 : data.rad) !== null && _b !== void 0 ? _b : defaultRad;
26
+ const fbxUrl = (_c = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _c !== void 0 ? _c : defaultFbxUrl;
36
27
  state.rad = rad;
37
28
  if (rad === undefined)
38
29
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): rad is ${rad}`);
39
30
  // 加载模型
40
- const object = yield new FBXLoader().loadAsync(fbxUrl);
31
+ const object = await new FBXLoader().loadAsync(fbxUrl);
41
32
  // 设置位置
42
33
  object.position.copy(modelPosition);
43
34
  object.rotation.z = rad;
44
35
  object.scale.set(0.8, 0.8, 0.8);
45
36
  transfromToMeshBasicMaterial(object, { transparent: true, side: THREE.DoubleSide });
46
- const textMesh = (_k = (_j = (_h = (_g = object.children) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.children) === null || _j === void 0 ? void 0 : _j[3]) === null || _k === void 0 ? void 0 : _k.clone();
37
+ const textMesh = (_g = (_f = (_e = (_d = object.children) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.children) === null || _f === void 0 ? void 0 : _f[3]) === null || _g === void 0 ? void 0 : _g.clone();
47
38
  if (!textMesh)
48
39
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): textMesh is ${textMesh}`);
49
40
  textMesh.material = new MeshBasicMaterial({ transparent: true, map: createCanvasTextTexture('入户门') });
@@ -51,7 +42,7 @@ export const ModelEntryDoorGuidePlugin = (five, params) => {
51
42
  object.children[0].add(textMesh);
52
43
  state.object = object;
53
44
  return true;
54
- });
45
+ };
55
46
  const initAnimation = () => {
56
47
  if (state.animation)
57
48
  return;
@@ -1,5 +1,5 @@
1
- import { SubscribeEventMap } from '@realsee/five';
2
- import { ItemLabel } from "./typings";
1
+ import type { SubscribeEventMap } from '@realsee/five';
2
+ import type { ItemLabel } from "./typings";
3
3
  export interface ItemLabelEvent extends SubscribeEventMap {
4
4
  /**
5
5
  * 点击标签
@@ -1,6 +1,6 @@
1
- import ItemLabelComponent from './ItemLabelComponent';
2
1
  import type { Subscribe } from "@realsee/five";
3
- import { PluginEvent } from "./events.type";
2
+ import type { PluginEvent } from "./events.type";
3
+ import type ItemLabelComponent from './ItemLabelComponent';
4
4
  export declare enum DISPLAY_STRATEGY_TYPE {
5
5
  SMALL = "small",
6
6
  MIDLLE = "middle",
@@ -1,3 +1,3 @@
1
- import { ModelItemLabelPluginData, ItemLabel } from '../typings';
1
+ import type { ModelItemLabelPluginData, ItemLabel } from '../typings';
2
2
  /** @description 转成内部所需数据 */
3
3
  export declare function parseModelItemLabelPluginData(data: ModelItemLabelPluginData): ItemLabel[];
@@ -1,3 +1,3 @@
1
- import { ModelRoomLabelPluginData, RoomLabel } from '../typings';
1
+ import type { ModelRoomLabelPluginData, RoomLabel } from '../typings';
2
2
  /** @description 下划线转驼峰 */
3
3
  export declare function parseModelRoomLabelPluginData(data: ModelRoomLabelPluginData): RoomLabel[];
@@ -1,4 +1,4 @@
1
1
  import type { FivePlugin } from '@realsee/five';
2
- import { ModelTVVideoPluginExportType, ModelTVVideoPluginParameterType } from "./typings";
2
+ import type { ModelTVVideoPluginExportType, ModelTVVideoPluginParameterType } from "./typings";
3
3
  export declare const ModelTVVideoPlugin: FivePlugin<ModelTVVideoPluginParameterType, ModelTVVideoPluginExportType>;
4
4
  export default ModelTVVideoPlugin;
@@ -1,12 +1,3 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  import * as THREE from 'three';
11
2
  import { parseModelTVVideoPoints } from "./utils/parseData";
12
3
  export const ModelTVVideoPlugin = (five, { videoElement }) => {
@@ -161,7 +152,7 @@ export const ModelTVVideoPlugin = (five, { videoElement }) => {
161
152
  xhr.send();
162
153
  });
163
154
  };
164
- const load = (data, videoElement) => __awaiter(void 0, void 0, void 0, function* () {
155
+ const load = async (data, videoElement) => {
165
156
  const { video_src, video_poster_src, points } = data;
166
157
  state.videoSource = video_src;
167
158
  // TODO 存疑,先处理多一次遍历 o(2n)
@@ -171,11 +162,11 @@ export const ModelTVVideoPlugin = (five, { videoElement }) => {
171
162
  if (videoElement) {
172
163
  state.videoElement = videoElement;
173
164
  }
174
- state.videoTexture = yield getVideoTexture(state.videoSource, state.videoElement);
165
+ state.videoTexture = await getVideoTexture(state.videoSource, state.videoElement);
175
166
  state.enabled = !!data.enable;
176
167
  if (state.enabled)
177
168
  enable();
178
- });
169
+ };
179
170
  const dispose = () => {
180
171
  disable();
181
172
  state.videoTexture = undefined;
@@ -1,3 +1,4 @@
1
+ import "three";
1
2
  export var DIRECTION;
2
3
  (function (DIRECTION) {
3
4
  DIRECTION["TOP_LEFT"] = "topLeft";
@@ -1,12 +1,3 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  import * as THREE from 'three';
11
2
  import { getRoomInfoInstance } from './getRoomInfoInstance';
12
3
  import { loadTexture } from '../shared-utils/three/loadTexture';
@@ -195,65 +186,59 @@ class PanoCompassController {
195
186
  if (this.modelLoaded)
196
187
  this.init();
197
188
  }
198
- init() {
199
- return __awaiter(this, void 0, void 0, function* () {
200
- if (!this.data || !this.modelLoaded)
201
- return;
202
- const northRad = this.data.north_rad;
203
- if (northRad != null) {
204
- this.compassMesh = yield this.loadCompassMesh();
205
- this.compassMesh.rotateX(-Math.PI / 2);
206
- this.compassMesh.rotateZ(northRad - Math.PI / 2);
207
- this.group.add(this.compassMesh);
208
- }
209
- if (this.data.entrance != null) {
210
- this.entryDoorMesh = yield this.loadEntryDoorMesh();
211
- this.roomInfoWrapperInstance = this.loadRoomInfo();
212
- this.roomInfoInstance = getRoomInfoInstance();
213
- this.entryDoorMesh.rotateX(-Math.PI / 2);
214
- if (this.roomInfoWrapperInstance)
215
- this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
216
- this.group.add(this.entryDoorMesh);
217
- }
218
- this.onFivePanoArrived(this.five.panoIndex || 0);
219
- this.five.needsRender = true;
220
- });
189
+ async init() {
190
+ if (!this.data || !this.modelLoaded)
191
+ return;
192
+ const northRad = this.data.north_rad;
193
+ if (northRad != null) {
194
+ this.compassMesh = await this.loadCompassMesh();
195
+ this.compassMesh.rotateX(-Math.PI / 2);
196
+ this.compassMesh.rotateZ(northRad - Math.PI / 2);
197
+ this.group.add(this.compassMesh);
198
+ }
199
+ if (this.data.entrance != null) {
200
+ this.entryDoorMesh = await this.loadEntryDoorMesh();
201
+ this.roomInfoWrapperInstance = this.loadRoomInfo();
202
+ this.roomInfoInstance = getRoomInfoInstance();
203
+ this.entryDoorMesh.rotateX(-Math.PI / 2);
204
+ if (this.roomInfoWrapperInstance)
205
+ this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
206
+ this.group.add(this.entryDoorMesh);
207
+ }
208
+ this.onFivePanoArrived(this.five.panoIndex || 0);
209
+ this.five.needsRender = true;
221
210
  }
222
- loadCompassMesh() {
211
+ async loadCompassMesh() {
223
212
  var _a;
224
- return __awaiter(this, void 0, void 0, function* () {
225
- const compassImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.compassImageUrl) ||
226
- '//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png';
227
- const compassTexture = yield loadTexture(compassImageUrl);
228
- const compassGeometry = new THREE.CircleGeometry(0.7, 32);
229
- const compassMaterial = new THREE.MeshBasicMaterial({
230
- map: compassTexture,
231
- transparent: true,
232
- opacity: 0,
233
- depthTest: false,
234
- });
235
- const compassMesh = new THREE.Mesh(compassGeometry, compassMaterial);
236
- compassMesh.name = 'pano-compass-mesh';
237
- return compassMesh;
238
- });
213
+ const compassImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.compassImageUrl) ||
214
+ '//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png';
215
+ const compassTexture = await loadTexture(compassImageUrl);
216
+ const compassGeometry = new THREE.CircleGeometry(0.7, 32);
217
+ const compassMaterial = new THREE.MeshBasicMaterial({
218
+ map: compassTexture,
219
+ transparent: true,
220
+ opacity: 0,
221
+ depthTest: false,
222
+ });
223
+ const compassMesh = new THREE.Mesh(compassGeometry, compassMaterial);
224
+ compassMesh.name = 'pano-compass-mesh';
225
+ return compassMesh;
239
226
  }
240
- loadEntryDoorMesh() {
227
+ async loadEntryDoorMesh() {
241
228
  var _a;
242
- return __awaiter(this, void 0, void 0, function* () {
243
- const entryDoorImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.entryDoorImageUrl) ||
244
- '//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png';
245
- const entryDoorTexture = yield loadTexture(entryDoorImageUrl);
246
- const entryDoorGeometry = new THREE.PlaneGeometry(0.2, 0.16);
247
- const entryDoorMaterial = new THREE.MeshBasicMaterial({
248
- map: entryDoorTexture,
249
- transparent: true,
250
- opacity: 0.8,
251
- depthTest: false,
252
- });
253
- const entryDoorMesh = new THREE.Mesh(entryDoorGeometry, entryDoorMaterial);
254
- entryDoorMesh.name = 'pano-compass-entry-door';
255
- return entryDoorMesh;
256
- });
229
+ const entryDoorImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.entryDoorImageUrl) ||
230
+ '//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png';
231
+ const entryDoorTexture = await loadTexture(entryDoorImageUrl);
232
+ const entryDoorGeometry = new THREE.PlaneGeometry(0.2, 0.16);
233
+ const entryDoorMaterial = new THREE.MeshBasicMaterial({
234
+ map: entryDoorTexture,
235
+ transparent: true,
236
+ opacity: 0.8,
237
+ depthTest: false,
238
+ });
239
+ const entryDoorMesh = new THREE.Mesh(entryDoorGeometry, entryDoorMaterial);
240
+ entryDoorMesh.name = 'pano-compass-entry-door';
241
+ return entryDoorMesh;
257
242
  }
258
243
  loadRoomInfo() {
259
244
  const points = [
@@ -1,5 +1,5 @@
1
- import { Group, Vector3 } from 'three';
2
1
  import type { FivePlugin, Intersection } from '@realsee/five';
2
+ import { Group, Vector3 } from 'three';
3
3
  export interface PanoCursorRaycasterPluginParameterType {
4
4
  }
5
5
  export interface PanoCursorRaycasterPluginExportType {
@@ -1,11 +1,11 @@
1
- import Line from '../Model/line';
2
- import Magnifier from '../Modules/Magnifier';
3
- import FiveHelper from '../Modules/FiveHelper';
4
- import { Group } from 'three';
5
- import { Model } from '../Model';
6
- import { PluginEvent } from '../typings/event.type';
7
- import { Five, Intersection, IntersectMeshInterface, Subscribe } from '@realsee/five';
8
- import { UserDistanceItem } from '../utils/distanceDom';
1
+ import type Line from '../Model/line';
2
+ import type Magnifier from '../Modules/Magnifier';
3
+ import type FiveHelper from '../Modules/FiveHelper';
4
+ import type { Group } from 'three';
5
+ import type { Model } from '../Model';
6
+ import type { PluginEvent } from '../typings/event.type';
7
+ import type { UserDistanceItem } from '../utils/distanceDom';
8
+ import type { Five, Intersection, IntersectMeshInterface, Subscribe } from '@realsee/five';
9
9
  export interface IControllerParams {
10
10
  five: Five;
11
11
  group: Group;
@@ -1,6 +1,6 @@
1
+ import type { LineJson } from '../typings/data';
1
2
  import { Model } from '../Model';
2
3
  import Line from '../Model/line';
3
- import { LineJson } from '../typings/data';
4
4
  import BaseController, { IControllerParams } from './BaseController';
5
5
  export interface EditEvent {
6
6
  editedLineChange: (lines: LineJson[]) => void;
@@ -1,4 +1,4 @@
1
- import * as Hammer from 'hammerjs';
1
+ import Hammer from 'hammerjs';
2
2
  import { Model } from '../Model';
3
3
  import Line from '../Model/line';
4
4
  import Point from '../Model/point';
@@ -1,5 +1,5 @@
1
- import MeasureController from '.';
2
- import { Five } from '@realsee/five';
1
+ import type MeasureController from '.';
2
+ import type { Five } from '@realsee/five';
3
3
  /** 快捷键控制器 */
4
4
  export declare class ShortcutKeyController {
5
5
  five: Five;
@@ -1,4 +1,4 @@
1
- import Line from '../Model/line';
1
+ import type Line from '../Model/line';
2
2
  import BaseController, { IControllerParams } from './BaseController';
3
3
  export default class WatchController extends BaseController {
4
4
  type: string;
@@ -1,7 +1,7 @@
1
- import { PluginData } from '../typings/data';
1
+ import type { PluginData } from '../typings/data';
2
+ import type { PluginEvent } from '../typings/event.type';
3
+ import type { UserDistanceItem } from '../utils/distanceDom';
2
4
  import { Five, Subscribe } from '@realsee/five';
3
- import { PluginEvent } from '../typings/event.type';
4
- import { UserDistanceItem } from '../utils/distanceDom';
5
5
  export declare type Mode = 'Watch' | 'Edit';
6
6
  export interface MeasurePluginParameter {
7
7
  useUIController?: boolean;
@@ -1,9 +1,9 @@
1
+ import type { PluginData } from '../typings/data';
2
+ import type { UserDistanceItem } from '../utils/distanceDom';
1
3
  import Line from './line';
2
4
  import Point from './point';
3
5
  import { Subscribe, SubscribeEventMap } from '@realsee/five';
4
- import { PluginData } from '../typings/data';
5
6
  import { Polyline } from './polyline';
6
- import { UserDistanceItem } from '../utils/distanceDom';
7
7
  interface IModelEvent extends SubscribeEventMap {
8
8
  /** 新增线条
9
9
  * @param line 被创建的线条
@@ -1,9 +1,9 @@
1
- import { Model } from '.';
2
- import Point from './point';
3
- import { LineJson } from '..';
1
+ import type { Model } from '.';
2
+ import type Point from './point';
3
+ import type { LineJson } from '..';
4
+ import type { LineCompletelyJson } from '../typings/data';
5
+ import type { Line as FiveLine } from '@realsee/five/line';
4
6
  import { Polyline } from './polyline';
5
- import { LineCompletelyJson } from '../typings/data';
6
- import { Line as FiveLine } from '@realsee/five/line';
7
7
  import { Subscribe, SubscribeEventMap } from '@realsee/five';
8
8
  import { DistanceItem } from '../utils/distanceDom';
9
9
  export interface ILineHook extends SubscribeEventMap {
@@ -1,5 +1,5 @@
1
- import { Polyline } from './polyline';
2
1
  import uuid from '../../shared-utils/uuid';
2
+ import { Polyline } from './polyline';
3
3
  import { creatLineMesh } from '../utils/line';
4
4
  import { Subscribe } from '@realsee/five';
5
5
  import { creatDistanceItem } from '../utils/distanceDom';
@@ -1,6 +1,6 @@
1
- import Line from './line';
1
+ import type Line from './line';
2
+ import type { PluginData } from '../typings/data';
2
3
  import { Vector3 } from 'three';
3
- import { PluginData } from '../typings/data';
4
4
  declare type IPointData = PluginData['points'][0];
5
5
  export default class Point {
6
6
  id: string;
@@ -1,6 +1,6 @@
1
- import Line from './line';
2
- import Point from './point';
3
- import { PolylineJson, PolylineCompletelyJson } from '../typings/data';
1
+ import type Line from './line';
2
+ import type Point from './point';
3
+ import type { PolylineJson, PolylineCompletelyJson } from '../typings/data';
4
4
  export declare class Polyline {
5
5
  readonly id: string;
6
6
  points: Point[];
@@ -1,5 +1,5 @@
1
- import Line from '../../Model/line';
2
- import { Five } from '@realsee/five';
1
+ import type Line from '../../Model/line';
2
+ import type { Five } from '@realsee/five';
3
3
  export default class DeleteDom {
4
4
  visible: boolean;
5
5
  private five;
@@ -1,5 +1,5 @@
1
+ import type { Five, Intersection } from '@realsee/five';
1
2
  import { Line3, Vector3 } from 'three';
2
- import { Five, Intersection } from '@realsee/five';
3
3
  export default class FiveHelper {
4
4
  edges: Line3[];
5
5
  private five;
@@ -1,4 +1,4 @@
1
- import MeasureController from '../Controller';
1
+ import type MeasureController from '../Controller';
2
2
  export interface GuideControllerParams {
3
3
  container: Element;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { Five } from '@realsee/five';
1
+ import type { Five } from '@realsee/five';
2
2
  import { Vector3 } from 'three';
3
3
  export interface MagnifierOptions {
4
4
  width: number;
@@ -1,4 +1,4 @@
1
- import MeasureController from '../../Controller';
1
+ import type MeasureController from '../../Controller';
2
2
  export declare class MainBtnController {
3
3
  private container;
4
4
  private measureController;
@@ -1,4 +1,5 @@
1
- import MeasureController, { Mode } from '../../../Controller';
1
+ import type { Mode } from '../../../Controller';
2
+ import type MeasureController from '../../../Controller';
2
3
  export default class Revoke {
3
4
  private container;
4
5
  private revokeIcon;
@@ -1,4 +1,4 @@
1
- import MeasureController from '../../Controller';
1
+ import type MeasureController from '../../Controller';
2
2
  export interface UIControllerParams {
3
3
  container: Element;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { FivePlugin } from '@realsee/five';
1
+ import type { FivePlugin } from '@realsee/five';
2
2
  import MeasureController, { MeasurePluginParameter } from './Controller';
3
3
  declare const PanoMeasurePlugin: FivePlugin<MeasurePluginParameter, PluginReturns>;
4
4
  export default PanoMeasurePlugin;