@realsee/dnalogel 2.0.0-alpha.10 → 2.0.0-alpha.13
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/CSS3DRenderPlugin/index.js +17 -14
- package/dist/CameraMovementPlugin/index.js +40 -15
- package/dist/ModelChassisCompassPlugin/index.js +32 -6
- package/dist/ModelEntryDoorGuidePlugin/index.js +48 -18
- package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.d.ts +4 -0
- package/dist/ModelItemLabelPlugin/index.js +679 -0
- package/dist/ModelItemLabelPlugin/typings.d.ts +55 -0
- package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelRoomLabelPlugin/index.js +71 -28
- package/dist/PanoCompassPlugin/index.js +311 -164
- package/dist/PanoCursorRaycasterPlugin/index.js +5 -3
- package/dist/PanoMeasurePlugin/index.js +1337 -583
- package/dist/PanoRulerPlugin/index.js +32 -5
- package/dist/PanoSpatialTagPlugin/index.js +73 -38
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.js +678 -439
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +164 -72
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +1 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +403 -230
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +3596 -1612
- package/dist/index.js +3602 -1616
- package/dist/index.umd.js +3605 -1620
- package/docs/assets/main.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/ModelRoomLabelController.html +6 -6
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ModelFloorplanErrorType.html +1 -1
- package/docs/index.html +1 -1
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
- package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +1 -1
- package/docs/modules.html +12 -12
- package/libs/CSS3DRenderPlugin/index.js +16 -13
- package/libs/CameraMovementPlugin/index.js +24 -15
- package/libs/ModelChassisCompassPlugin/index.js +14 -5
- package/libs/ModelEntryDoorGuidePlugin/index.js +24 -12
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +422 -0
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
- package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/events.type.js +1 -0
- package/libs/ModelItemLabelPlugin/index.d.ts +4 -0
- package/libs/ModelItemLabelPlugin/index.js +172 -0
- package/libs/ModelItemLabelPlugin/typings.d.ts +55 -0
- package/libs/ModelItemLabelPlugin/typings.js +6 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.js +4 -0
- package/libs/ModelRoomLabelPlugin/Controller.js +64 -23
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +7 -5
- package/libs/PanoCompassPlugin/index.js +225 -128
- package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +68 -13
- package/libs/PanoMeasurePlugin/Controller/EditController.js +267 -154
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +234 -152
- package/libs/PanoMeasurePlugin/Controller/index.js +131 -47
- package/libs/PanoMeasurePlugin/Model/index.js +30 -5
- package/libs/PanoMeasurePlugin/Model/line.js +60 -10
- package/libs/PanoMeasurePlugin/Model/point.js +24 -4
- package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +59 -14
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +60 -10
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +83 -37
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +61 -30
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +3 -2
- package/libs/PanoMeasurePlugin/utils/line.js +8 -7
- package/libs/PanoRulerPlugin/index.js +16 -5
- package/libs/PanoSpatialTagPlugin/Components/tag.js +9 -9
- package/libs/PanoSpatialTagPlugin/index.js +11 -9
- package/libs/floorplan/Components/BaseImage.js +10 -5
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +3 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +5 -6
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +24 -11
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +77 -69
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +3 -1
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +457 -273
- package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +33 -22
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +3 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +97 -36
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +1 -0
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +232 -108
- package/libs/floorplan/utils/formatData.js +43 -28
- package/libs/floorplan/utils/formatPosition.js +1 -1
- package/libs/index.d.ts +1 -0
- package/libs/index.js +2 -0
- package/libs/shared-utils/Subscribe.js +8 -1
- package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
- package/libs/shared-utils/createCanvasTextTexture.js +6 -5
- package/libs/shared-utils/five/changeMode.js +23 -12
- package/libs/shared-utils/getPxmm.js +1 -1
- package/libs/shared-utils/math/evenNumber.js +1 -1
- package/libs/shared-utils/three/loadFbxObj.js +20 -9
- package/libs/shared-utils/three/loadTexture.js +17 -6
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
- package/libs/shared-utils/tinyEJSrender.js +36 -6
- package/libs/shared-utils/to.js +21 -10
- package/libs/shared-utils/useDebounce.js +1 -1
- package/libs/shared-utils/useThrottle.js +2 -1
- package/package.json +2 -2
- package/CHANGELOG.md +0 -34
|
@@ -1,21 +1,34 @@
|
|
|
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
|
+
};
|
|
1
10
|
import { FLOORPLAN_EXTRA_OBJECT_IMAGE } from '../Assets/floorplanExtraObject';
|
|
2
11
|
import { floorplanPosition2ImagePosition, getFloorIndexFromModelPosition, modelPosition2FloorplanPosition, } from './formatPosition';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
function formatOutlines(outlines) {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
const headers = new Headers({ 'Content-Type': 'text/plain' });
|
|
15
|
+
const getOutlineItem = function (item) {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
const outlineItem = {
|
|
18
|
+
index: item.index,
|
|
19
|
+
url: item.url,
|
|
20
|
+
svgUrl: item.svg_url,
|
|
21
|
+
};
|
|
22
|
+
if (item.svg_url) {
|
|
23
|
+
const svgContent = yield fetch(item.svg_url, { headers }).then((res) => res.text());
|
|
24
|
+
outlineItem.svgContent = svgContent;
|
|
25
|
+
}
|
|
26
|
+
return outlineItem;
|
|
27
|
+
});
|
|
10
28
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
return outlineItem;
|
|
16
|
-
};
|
|
17
|
-
const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
|
|
18
|
-
return svgOutlineItems;
|
|
29
|
+
const svgOutlineItems = yield Promise.all(outlines.map(getOutlineItem));
|
|
30
|
+
return svgOutlineItems;
|
|
31
|
+
});
|
|
19
32
|
}
|
|
20
33
|
function formatRoom(data) {
|
|
21
34
|
const floorplanRoomItem = {
|
|
@@ -61,19 +74,21 @@ function formatFloorplanEntrance(data) {
|
|
|
61
74
|
};
|
|
62
75
|
return floorplanEntrance;
|
|
63
76
|
}
|
|
64
|
-
export default
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
export default function formatData(data) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
const outlines = yield formatOutlines(data.outlines);
|
|
80
|
+
const bounding = data.computed_data.bounding;
|
|
81
|
+
const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
|
|
82
|
+
const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
|
|
83
|
+
const floorplanData = {
|
|
84
|
+
outlines,
|
|
85
|
+
entrance,
|
|
86
|
+
bounding,
|
|
87
|
+
floorDatas,
|
|
88
|
+
observers: data.computed_data.observers.map(formateFloorplanObserver),
|
|
89
|
+
};
|
|
90
|
+
return floorplanData;
|
|
91
|
+
});
|
|
77
92
|
}
|
|
78
93
|
export function formatExtraObjects(data, five, floorplanData) {
|
|
79
94
|
const extraObjects = data.map((object) => {
|
package/libs/index.d.ts
CHANGED
|
@@ -24,3 +24,4 @@ export type { PluginReturns, PluginEvent, LineJson, PointJson } from './PanoMeas
|
|
|
24
24
|
export { default as PanoMeasurePlugin } from './PanoMeasurePlugin';
|
|
25
25
|
export type { PanoSpatialTagPluginParameterType, PanoSpatialTagPluginData, PanoSpatialTagPluginExportType } from './PanoSpatialTagPlugin';
|
|
26
26
|
export { default as PanoSpatialTagPlugin } from './PanoSpatialTagPlugin';
|
|
27
|
+
export { default as ModelItemLabelPlugin } from './ModelItemLabelPlugin';
|
package/libs/index.js
CHANGED
|
@@ -14,3 +14,5 @@ export { default as PanoRulerPlugin } from './PanoRulerPlugin';
|
|
|
14
14
|
export { default as PanoCompassPlugin } from './PanoCompassPlugin';
|
|
15
15
|
export { default as PanoMeasurePlugin } from './PanoMeasurePlugin';
|
|
16
16
|
export { default as PanoSpatialTagPlugin } from './PanoSpatialTagPlugin';
|
|
17
|
+
// 模型物品标签插件
|
|
18
|
+
export { default as ModelItemLabelPlugin } from './ModelItemLabelPlugin';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
var _a;
|
|
1
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
3
|
const __EVENT__ = '__events__';
|
|
3
4
|
/**
|
|
@@ -5,8 +6,13 @@ const __EVENT__ = '__events__';
|
|
|
5
6
|
* 观察者模式(供前端使用),Node端推荐<a href="https://nodejs.org/api/events.html#events_class_eventemitter">EventEmitter</a>。
|
|
6
7
|
*/
|
|
7
8
|
export default class Subscribe {
|
|
8
|
-
[__EVENT__];
|
|
9
9
|
constructor() {
|
|
10
|
+
Object.defineProperty(this, _a, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
configurable: true,
|
|
13
|
+
writable: true,
|
|
14
|
+
value: void 0
|
|
15
|
+
});
|
|
10
16
|
this[__EVENT__] = {};
|
|
11
17
|
}
|
|
12
18
|
/**
|
|
@@ -99,3 +105,4 @@ export default class Subscribe {
|
|
|
99
105
|
return canceled;
|
|
100
106
|
}
|
|
101
107
|
}
|
|
108
|
+
_a = __EVENT__;
|
|
@@ -1,24 +1,53 @@
|
|
|
1
1
|
import TWEEN from '@tweenjs/tween.js';
|
|
2
2
|
import { requestAnimationFrameInterval } from './index';
|
|
3
3
|
export class BetterTween extends TWEEN.Tween {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
6
|
+
Object.defineProperty(this, "disposeMethods", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true,
|
|
10
|
+
value: []
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(this, "animationFrameDisposer", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true,
|
|
16
|
+
value: void 0
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(this, "onDispose", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value: (callback) => {
|
|
23
|
+
this.disposeMethods.push(callback);
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(this, "play", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true,
|
|
31
|
+
value: () => {
|
|
32
|
+
this.start(0);
|
|
33
|
+
this.animationFrameDisposer = requestAnimationFrameInterval((time) => this.update(time));
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(this, "dispose", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: () => {
|
|
42
|
+
var _a;
|
|
43
|
+
this.stop();
|
|
44
|
+
(_a = this.animationFrameDisposer) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
45
|
+
this.disposeMethods.forEach((fn) => fn());
|
|
46
|
+
this.disposeMethods = [];
|
|
47
|
+
TWEEN.remove(this);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
22
51
|
}
|
|
23
52
|
export function tweenProgress(duration, easing = TWEEN.Easing.Linear.None) {
|
|
24
53
|
const tween = new BetterTween({ progress: 0 }).to({ progress: 1 });
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { CanvasTexture } from 'three';
|
|
2
2
|
export default function createCanvasTextTexture(text, config) {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
3
|
+
var _a, _b, _c, _d, _e;
|
|
4
|
+
const size = (_a = config === null || config === void 0 ? void 0 : config.size) !== null && _a !== void 0 ? _a : 512;
|
|
5
|
+
const fontSize = (_b = config === null || config === void 0 ? void 0 : config.fontSize) !== null && _b !== void 0 ? _b : size * (35 / 256) * 1.2;
|
|
6
|
+
const backgroundColor = (_c = config === null || config === void 0 ? void 0 : config.backgroundColor) !== null && _c !== void 0 ? _c : 'rgba(0,0,0,0)';
|
|
7
|
+
const fontColor = (_d = config === null || config === void 0 ? void 0 : config.fontColor) !== null && _d !== void 0 ? _d : '#fff';
|
|
8
|
+
const textAlign = (_e = config === null || config === void 0 ? void 0 : config.textAlign) !== null && _e !== void 0 ? _e : 'center';
|
|
8
9
|
const canvas = document.createElement('canvas');
|
|
9
10
|
canvas.setAttribute('width', size + '');
|
|
10
11
|
canvas.setAttribute('height', size + '');
|
|
@@ -1,15 +1,26 @@
|
|
|
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
|
+
};
|
|
1
10
|
import to from '../to';
|
|
2
|
-
export default
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
export default function changeMode(five, ...changeModeParams) {
|
|
12
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
13
|
+
const [changeModeError] = yield to(five.changeMode(...changeModeParams));
|
|
14
|
+
if (changeModeError)
|
|
15
|
+
throw changeModeError;
|
|
16
|
+
yield new Promise((reslove, reject) => {
|
|
17
|
+
five.once('initAnimationEnded', reslove);
|
|
18
|
+
const handleModeChange = (mode) => {
|
|
19
|
+
if (mode !== changeModeParams[0])
|
|
20
|
+
reject('changeMode 被中断');
|
|
21
|
+
five.off('modeChange', handleModeChange);
|
|
22
|
+
};
|
|
23
|
+
five.on('modeChange', handleModeChange);
|
|
24
|
+
});
|
|
14
25
|
});
|
|
15
26
|
}
|
|
@@ -16,7 +16,7 @@ export default function getPxmm(five, container, floorIndex, options) {
|
|
|
16
16
|
function getY() {
|
|
17
17
|
const currentFloorY = getFloorY(floorIndex);
|
|
18
18
|
const nextFloorY = getFloorY(floorIndex + 1);
|
|
19
|
-
const attachedTo = options
|
|
19
|
+
const attachedTo = (options === null || options === void 0 ? void 0 : options.attachedTo) || FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER;
|
|
20
20
|
if (attachedTo === FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER)
|
|
21
21
|
return (five.model.bounding.max.y + five.model.bounding.min.y) / 2;
|
|
22
22
|
else if (attachedTo === FLOOR_PLAN_ATTACHED_TO.CEILING)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export default function evenNumber(num, config) {
|
|
2
2
|
const roundNum = Math.round(num);
|
|
3
|
-
return roundNum % 2 === 0 ? roundNum : roundNum + Number(config
|
|
3
|
+
return roundNum % 2 === 0 ? roundNum : roundNum + Number((config === null || config === void 0 ? void 0 : config.smaller) ? -1 : 1);
|
|
4
4
|
}
|
|
@@ -1,13 +1,24 @@
|
|
|
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
|
+
};
|
|
1
10
|
import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader';
|
|
2
11
|
const loader = new FBXLoader();
|
|
3
|
-
export
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
export function loadFbxObj(url) {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
return new Promise((resolve, reject) => {
|
|
15
|
+
function onLoad(object) {
|
|
16
|
+
resolve(object);
|
|
17
|
+
}
|
|
18
|
+
function onError(error) {
|
|
19
|
+
reject(error);
|
|
20
|
+
}
|
|
21
|
+
loader.load(url, onLoad, undefined, onError);
|
|
22
|
+
});
|
|
12
23
|
});
|
|
13
24
|
}
|
|
@@ -1,10 +1,21 @@
|
|
|
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
|
+
};
|
|
1
10
|
import * as THREE from 'three';
|
|
2
11
|
const textureLoader = new THREE.TextureLoader();
|
|
3
|
-
export
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
texture
|
|
8
|
-
|
|
12
|
+
export function loadTexture(url) {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
return new Promise((resolve, reject) => {
|
|
15
|
+
textureLoader.load(url, resolve, undefined, reject);
|
|
16
|
+
}).then((texture) => {
|
|
17
|
+
texture.encoding = THREE.sRGBEncoding;
|
|
18
|
+
return texture;
|
|
19
|
+
});
|
|
9
20
|
});
|
|
10
21
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { MeshBasicMaterial } from 'three';
|
|
2
2
|
export default function transfromToMeshBasicMaterial(object, options) {
|
|
3
3
|
object.traverse((ele) => {
|
|
4
|
+
var _a;
|
|
4
5
|
if (ele.type === 'Mesh') {
|
|
5
6
|
const mesh = ele;
|
|
6
7
|
const materialConf = Object.assign({ map: mesh.material.map || {} }, options);
|
|
7
8
|
mesh.material = new MeshBasicMaterial(materialConf);
|
|
8
9
|
mesh.renderOrder = 1;
|
|
9
|
-
if (ele.parent
|
|
10
|
+
if (((_a = ele.parent) === null || _a === void 0 ? void 0 : _a.type) === 'Mesh') {
|
|
10
11
|
ele.renderOrder = ele.parent.renderOrder + 1;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
@@ -25,13 +25,43 @@ export default function render(template, data) {
|
|
|
25
25
|
return templ.compileFunction()(data);
|
|
26
26
|
}
|
|
27
27
|
class Template {
|
|
28
|
-
templateText;
|
|
29
|
-
mode = null;
|
|
30
|
-
truncate = false;
|
|
31
|
-
currentLine = 1;
|
|
32
|
-
source = '';
|
|
33
|
-
regex = new RegExp(REGEX_STRING);
|
|
34
28
|
constructor(text) {
|
|
29
|
+
Object.defineProperty(this, "templateText", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: void 0
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(this, "mode", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true,
|
|
39
|
+
value: null
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(this, "truncate", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
configurable: true,
|
|
44
|
+
writable: true,
|
|
45
|
+
value: false
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(this, "currentLine", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
configurable: true,
|
|
50
|
+
writable: true,
|
|
51
|
+
value: 1
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(this, "source", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
configurable: true,
|
|
56
|
+
writable: true,
|
|
57
|
+
value: ''
|
|
58
|
+
});
|
|
59
|
+
Object.defineProperty(this, "regex", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true,
|
|
62
|
+
writable: true,
|
|
63
|
+
value: new RegExp(REGEX_STRING)
|
|
64
|
+
});
|
|
35
65
|
this.templateText = text;
|
|
36
66
|
}
|
|
37
67
|
compileFunction() {
|
package/libs/shared-utils/to.js
CHANGED
|
@@ -1,18 +1,29 @@
|
|
|
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
|
+
};
|
|
1
10
|
/**
|
|
2
11
|
* 传入一个 Promise
|
|
3
12
|
* 无异常,返回 [null, data]
|
|
4
13
|
* 有异常,则返回 [Error, undefined]
|
|
5
14
|
* 用于替代 try&catch 处理 await 异常的方案
|
|
6
15
|
*/
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
export function to(promise) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
try {
|
|
19
|
+
const data = yield promise;
|
|
20
|
+
return [null, data];
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
if (error instanceof Error)
|
|
24
|
+
return [error, null];
|
|
25
|
+
return [new Error(''), null];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
17
28
|
}
|
|
18
29
|
export default to;
|
|
@@ -16,7 +16,7 @@ export const useDebounce = (callback, waitFor = 200) => {
|
|
|
16
16
|
clearTimeout(timer.current);
|
|
17
17
|
timer.current = null;
|
|
18
18
|
}
|
|
19
|
-
timer.current = setTimeout(() => savedFunc.current
|
|
19
|
+
timer.current = setTimeout(() => { var _a; return (_a = savedFunc.current) === null || _a === void 0 ? void 0 : _a.call(savedFunc, ...args); }, waitFor);
|
|
20
20
|
}, []);
|
|
21
21
|
};
|
|
22
22
|
export default useDebounce;
|
|
@@ -12,9 +12,10 @@ export const useThrottle = (callback, waitFor) => {
|
|
|
12
12
|
savedFunc.current = callback;
|
|
13
13
|
}, [waitFor]);
|
|
14
14
|
return useCallback((...args) => {
|
|
15
|
+
var _a;
|
|
15
16
|
if (timer.current)
|
|
16
17
|
return;
|
|
17
|
-
savedFunc.current
|
|
18
|
+
(_a = savedFunc.current) === null || _a === void 0 ? void 0 : _a.call(savedFunc, ...args);
|
|
18
19
|
timer.current = setTimeout(() => {
|
|
19
20
|
if (timer.current)
|
|
20
21
|
clearTimeout(timer.current);
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"author": "REALSEE-DEVELOPER",
|
|
7
7
|
"repository": "https://github.com/realsee-developer/dnalogel.git",
|
|
8
8
|
"private": false,
|
|
9
|
-
"version": "2.0.0-alpha.
|
|
9
|
+
"version": "2.0.0-alpha.13",
|
|
10
10
|
"license": "SEE LICENSE IN TERMS.txt",
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "yarn run tsb && yarn run build:rollup && yarn build:docs",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/core": "^7.17.5",
|
|
29
|
-
"@realsee/five": "^5.0.0-alpha.
|
|
29
|
+
"@realsee/five": "^5.0.0-alpha.120",
|
|
30
30
|
"@rollup/plugin-alias": "^3.1.9",
|
|
31
31
|
"@rollup/plugin-commonjs": "^21.1.0",
|
|
32
32
|
"@rollup/plugin-typescript": "^8.3.2",
|
package/CHANGELOG.md
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# CHANGELOG
|
|
2
|
-
|
|
3
|
-
## 2.0.0-alpha.10
|
|
4
|
-
- 1.feat: 新增空间三维标签插件 PanoSpatialTagPlugin
|
|
5
|
-
- 2.feat: 新增轻量 ejs 渲染模板函数 shared-utils/tinyEJSrender.js
|
|
6
|
-
|
|
7
|
-
## 2.0.0-alpha.9
|
|
8
|
-
- 1.refactor: 增加插件独立 js 输出及对 svelte 的编译。
|
|
9
|
-
|
|
10
|
-
## 2.0.0-alpha.8
|
|
11
|
-
- 1.fix: 修复 ModelViewPlugin 实景 VR 模型不居中问题;
|
|
12
|
-
- 2.fix: 修复 ModelRoomLabelPlugin fov 更新未 rerender 问题;
|
|
13
|
-
- 2.fix: 修复 ModelRoomLabelPlugin enable 判断问题;
|
|
14
|
-
- 4.fix: 修改 ModelFloorplanPlugin 在全景态满足户型图的俯仰角时会自动切换户型图问题。
|
|
15
|
-
|
|
16
|
-
## 2.0.0-alpha.7
|
|
17
|
-
- 1.fix: PanoCompassPlugin 向下兼容;
|
|
18
|
-
- 2.feat: 新增 PC 全景测量插件:PanoMeasurePlugin;
|
|
19
|
-
- 3.docs: 修改 README.md;
|
|
20
|
-
|
|
21
|
-
## 2.0.0-alpha.6
|
|
22
|
-
- 1.fix: 标尺插件 PanoRulerPlugin 所有标尺仅展示一次问题;
|
|
23
|
-
- 2.fix: TopviewFloorplanPlugin && ModelFloorplanPlugin 插件小雷达位置显示不正确问题;
|
|
24
|
-
- 3.feat: 为 TopviewFloorplanPlugin && ModelFloorplanPlugin 插件新增线框图吸附位置配置选项。
|
|
25
|
-
- 可选地板、天花板、模型中心,默认吸附选项为模型中心。
|
|
26
|
-
|
|
27
|
-
## 2.0.0-alpha.5
|
|
28
|
-
1.修复全景指南针插件 PanoCompassPlugin 默认导出 name
|
|
29
|
-
|
|
30
|
-
## 2.0.0-alpha.4
|
|
31
|
-
1.新增全景标尺插件 PanoRulerPlugin
|
|
32
|
-
|
|
33
|
-
## 2.0.0-alpha.3
|
|
34
|
-
1.新增全景指南针插件 PanoCompassPlugin
|