@realsee/dnalogel 0.1.2 → 0.1.7
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/components/ARVideoFigure/ARVideoFigureMesh.js +56 -32
- package/components/ARVideoFigure/ARVideoFigureScene.js +30 -19
- package/components/ARVideoFigure/ImgBgTransparent.js +22 -6
- package/components/ARVideoFigure/ImgBgTransparentMesh.js +40 -30
- package/components/ARVideoFigure/fragmentShader.js +2 -0
- package/components/ARVideoFigure/index.js +22 -6
- package/components/ARVideoFigure/vertexShader.js +2 -0
- package/components/GLTFView/index.d.ts +72 -0
- package/components/GLTFView/index.js +149 -0
- package/components/GlassFilters/index.js +25 -1
- package/components/ModelView/ModelViewController.js +39 -29
- package/components/ModelView/index.js +4 -2
- package/components/PaintBrush/index.js +15 -1
- package/components/PanoTag/index.js +2 -0
- package/data/1aGKl9JmrlXMXx8d.js +2 -0
- package/data/54djM0oR6ky3Ey8e.d.ts +55 -0
- package/data/54djM0oR6ky3Ey8e.js +350 -0
- package/data/6gyq3v1verxD7JO1.js +2 -0
- package/data/8054djM0oR6ky3Ey8e.d.ts +55 -0
- package/data/8054djM0oR6ky3Ey8e.js +350 -0
- package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.js +2 -0
- package/data/PrXel3aqGbp34JQn.js +2 -0
- package/data/XJ6NMLWnkAY3Rdx8.d.ts +843 -0
- package/data/XJ6NMLWnkAY3Rdx8.js +7989 -0
- package/data/YdoNP9K4rwQDwjJr.js +2 -0
- package/data/ZLvK29zj4L29Jowd.d.ts +55 -0
- package/data/ZLvK29zj4L29Jowd.js +372 -0
- package/data/auto3d-njL5J99VwCmnjtQElOmXQr.js +2 -0
- package/data/extrude-walls/ZLvK29zj4L29Jowd.d.ts +5 -0
- package/data/extrude-walls/ZLvK29zj4L29Jowd.js +14 -0
- package/data/extrude-walls/lo024DEgzanMj5BE.d.ts +5 -0
- package/data/extrude-walls/lo024DEgzanMj5BE.js +14 -0
- package/data/jd6oMOzPxnQ3BvxY_B7yw51J9rXlhYhjhGTOgRVqu6WeEqjNX.d.ts +85 -0
- package/data/jd6oMOzPxnQ3BvxY_B7yw51J9rXlhYhjhGTOgRVqu6WeEqjNX.js +511 -0
- package/data/lo024DEgzanMj5BE.d.ts +55 -0
- package/data/lo024DEgzanMj5BE.js +966 -0
- package/data/oPzy3ApbjjpD8YdR.js +2 -0
- package/data/qjAxMG4XbPn96wKG.js +2 -0
- package/data/rXel3aPQRRBD4JQn.js +2 -0
- package/data/vLykj3NWrllMrG06.d.ts +2 -0
- package/data/vLykj3NWrllMrG06.js +199 -2
- package/data/wz0QV9KA4ugyo9ME.js +2 -0
- package/data/zxMawr9raSg8LYjG.d.ts +53 -0
- package/data/zxMawr9raSg8LYjG.js +590 -0
- package/examples/FiveStateController/index.js +9 -15
- package/examples/VRHouse/Mobile.js +15 -1
- package/examples/VRHouse/PC.js +15 -1
- package/examples/VRHouse/index.js +15 -1
- package/index.js +4 -2
- package/libs/gltf-viewer/Subscribe.d.ts +76 -0
- package/libs/gltf-viewer/Subscribe.js +231 -0
- package/libs/gltf-viewer/coordsMoveByOffset.d.ts +13 -0
- package/libs/gltf-viewer/coordsMoveByOffset.js +22 -0
- package/libs/gltf-viewer/coordsToDirection.d.ts +5 -0
- package/{components/PBRView/index.js → libs/gltf-viewer/coordsToDirection.js} +29 -19
- package/libs/gltf-viewer/formatRad.d.ts +1 -0
- package/libs/gltf-viewer/formatRad.js +13 -0
- package/libs/gltf-viewer/getFrameTime.d.ts +1 -0
- package/libs/gltf-viewer/getFrameTime.js +28 -0
- package/libs/gltf-viewer/index.d.ts +55 -0
- package/libs/gltf-viewer/index.js +650 -0
- package/libs/gltf-viewer/mouseWheel.d.ts +2 -0
- package/libs/gltf-viewer/mouseWheel.js +59 -0
- package/libs/gltf-viewer/requestAnimationFrame.d.ts +1 -0
- package/libs/gltf-viewer/requestAnimationFrame.js +18 -0
- package/libs/gltf-viewer/requestAnimationFrameInterval.d.ts +1 -0
- package/libs/gltf-viewer/requestAnimationFrameInterval.js +31 -0
- package/libs/gltf-viewer/uuid.d.ts +4 -0
- package/libs/gltf-viewer/uuid.js +28 -0
- package/package.json +8 -4
- package/plugins/AutoPreloadPlugin/index.d.ts +23 -0
- package/plugins/AutoPreloadPlugin/index.js +111 -0
- package/plugins/CSS3DRenderPlugin/components/Marker/index.js +24 -16
- package/plugins/CSS3DRenderPlugin/index.d.ts +3 -2
- package/plugins/CSS3DRenderPlugin/index.js +79 -46
- package/plugins/CameraMovementPlugin/index.js +33 -9
- package/plugins/CameraMovementPlugin/typing.js +2 -0
- package/plugins/ModelChassisCompassPlugin/index.d.ts +7 -3
- package/plugins/ModelChassisCompassPlugin/index.js +34 -33
- package/plugins/ModelEntryDoorGuidePlugin/index.d.ts +13 -1
- package/plugins/ModelEntryDoorGuidePlugin/index.js +233 -2
- package/plugins/ModelExtrudeWallsPlugin/index.d.ts +16 -0
- package/plugins/ModelExtrudeWallsPlugin/index.js +252 -0
- package/plugins/ModelRoomLabelPlugin/Controller.d.ts +35 -0
- package/plugins/ModelRoomLabelPlugin/Controller.js +153 -0
- package/plugins/ModelRoomLabelPlugin/RoomLabelItem.d.ts +8 -0
- package/plugins/ModelRoomLabelPlugin/RoomLabelItem.js +66 -0
- package/plugins/ModelRoomLabelPlugin/RoomLabelItems.d.ts +7 -0
- package/plugins/ModelRoomLabelPlugin/RoomLabelItems.js +159 -0
- package/plugins/ModelRoomLabelPlugin/index.d.ts +8 -0
- package/plugins/ModelRoomLabelPlugin/index.js +18 -0
- package/plugins/ModelRoomLabelPlugin/typings.d.ts +35 -0
- package/plugins/ModelRoomLabelPlugin/typings.js +7 -0
- package/plugins/ModelRoomLabelPlugin/utils/parseData.d.ts +3 -0
- package/plugins/ModelRoomLabelPlugin/utils/parseData.js +35 -0
- package/plugins/ModelTVVideoPlugin/index.js +100 -16
- package/plugins/ModelViewPlugin/index.js +25 -1
- package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.js +29 -25
- package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.js +15 -1
- package/plugins/PanoCursorRaycasterPlugin/index.js +13 -6
- package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.js +4 -2
- package/plugins/PanoCursorRaycasterPlugin/utils/createLine.js +15 -1
- package/plugins/PanoDoorLabelPlugin/index.js +2 -0
- package/plugins/PanoIRobotPlugin/index.js +2 -0
- package/plugins/PanoMaskSelectorPlugin/compare.d.ts +1 -0
- package/plugins/PanoMaskSelectorPlugin/compare.js +17 -0
- package/plugins/PanoMaskSelectorPlugin/createBox.d.ts +7 -0
- package/plugins/PanoMaskSelectorPlugin/createBox.js +79 -0
- package/plugins/PanoMaskSelectorPlugin/createTextures.d.ts +3 -0
- package/plugins/PanoMaskSelectorPlugin/createTextures.js +45 -0
- package/plugins/PanoMaskSelectorPlugin/fragmentShader.d.ts +1 -0
- package/plugins/PanoMaskSelectorPlugin/fragmentShader.js +10 -0
- package/plugins/PanoMaskSelectorPlugin/index.d.ts +49 -0
- package/plugins/PanoMaskSelectorPlugin/index.js +348 -0
- package/plugins/PanoMaskSelectorPlugin/vertexShader.d.ts +1 -0
- package/plugins/PanoMaskSelectorPlugin/vertexShader.js +10 -0
- package/plugins/PanoRulerPlugin/data/roomInfo.js +2 -0
- package/plugins/PanoRulerPlugin/data/roomRules.js +2 -0
- package/plugins/PanoRulerPlugin/index.js +68 -20
- package/plugins/PanoRulerPlugin/typings.js +2 -0
- package/plugins/PanoTVVideoPlugin/index.d.ts +2 -0
- package/plugins/PanoTVVideoPlugin/index.js +108 -26
- package/plugins/TreasurePlugin/Controller.js +58 -52
- package/plugins/TreasurePlugin/TreasureFaceAnime.js +36 -21
- package/plugins/TreasurePlugin/TreasureObject.js +60 -56
- package/plugins/TreasurePlugin/TreasureOpenAnime.js +38 -19
- package/plugins/TreasurePlugin/constants.js +2 -0
- package/plugins/TreasurePlugin/index.js +2 -0
- package/plugins/TreasurePlugin/typings.js +2 -0
- package/plugins/floorplan/Assets/floorplanExtraObject.js +2 -0
- package/plugins/floorplan/ModelFloorplanPlugin/Controller.js +71 -88
- package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.js +25 -5
- package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.js +19 -4
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.js +28 -4
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.js +28 -5
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.js +20 -6
- package/plugins/floorplan/ModelFloorplanPlugin/components/index.js +30 -8
- package/plugins/floorplan/ModelFloorplanPlugin/controller.style.js +2 -0
- package/plugins/floorplan/ModelFloorplanPlugin/index.js +4 -2
- package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.js +2 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.js +2 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +14 -22
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.js +25 -3
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.js +6 -2
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.js +19 -3
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.js +28 -4
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.js +22 -6
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.js +29 -19
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.js +2 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.js +44 -47
- package/plugins/floorplan/PanoFloorplanRadarPlugin/index.js +4 -2
- package/plugins/floorplan/TopviewFloorplanPlugin/Controller.js +50 -55
- package/plugins/floorplan/TopviewFloorplanPlugin/index.js +2 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/style.js +2 -0
- package/plugins/floorplan/components/FloorplanImage.js +15 -1
- package/plugins/floorplan/typings/floorplanData.js +2 -0
- package/plugins/floorplan/typings/floorplanServerData.js +2 -0
- package/plugins/floorplan/utils/formatData.js +28 -10
- package/plugins/floorplan/utils/formatPosition.js +10 -8
- package/shared-utils/Preloader.js +6 -0
- package/shared-utils/Subscribe.js +36 -16
- package/shared-utils/animationFrame/BetterTween.js +28 -27
- package/shared-utils/animationFrame/calculateProgress.js +2 -0
- package/shared-utils/animationFrame/formatRad.js +2 -0
- package/shared-utils/animationFrame/index.js +12 -0
- package/shared-utils/animationFrame/tween.js +17 -1
- package/shared-utils/changeModelCanvansOpacity.js +14 -0
- package/shared-utils/createCanvasTextTexture.d.ts +8 -0
- package/shared-utils/createCanvasTextTexture.js +31 -0
- package/shared-utils/createFiveContainer.js +23 -17
- package/shared-utils/createLine/index.js +15 -1
- package/shared-utils/debounce.js +4 -0
- package/shared-utils/equal.js +15 -4
- package/shared-utils/filter.js +36 -2
- package/shared-utils/five/changeMode.js +13 -17
- package/shared-utils/five/useFivePlugin.js +2 -0
- package/shared-utils/formatRad.js +2 -0
- package/shared-utils/getPxmm.js +15 -1
- package/shared-utils/getRandomColor.js +10 -0
- package/shared-utils/isNil.js +2 -0
- package/shared-utils/isTruelyObject.js +4 -0
- package/shared-utils/math/evenNumber.js +2 -0
- package/shared-utils/math/planimetry.js +10 -0
- package/shared-utils/math/rad2Deg.js +2 -0
- package/shared-utils/nearlyEqual.js +2 -0
- package/shared-utils/nextFrame.js +2 -0
- package/shared-utils/noop.js +2 -0
- package/shared-utils/object3d2LocalMatrix.js +20 -14
- package/shared-utils/px2rem.js +10 -0
- package/shared-utils/tap.js +2 -0
- package/shared-utils/three/centerPoint.js +2 -0
- package/shared-utils/three/getExtraModelLoader.js +14 -0
- package/shared-utils/three/getNormal.js +4 -0
- package/shared-utils/three/getTextureLoader.js +16 -0
- package/shared-utils/three/loadFbxObj.js +13 -5
- package/shared-utils/three/loadTexture.js +13 -5
- package/shared-utils/three/transformPositionToVector3.js +2 -0
- package/shared-utils/three/transfromToMeshBasicMaterial.d.ts +2 -0
- package/shared-utils/three/transfromToMeshBasicMaterial.js +33 -0
- package/shared-utils/throttle.js +4 -0
- package/shared-utils/to.js +8 -4
- package/shared-utils/useDebounce.js +6 -0
- package/shared-utils/useThrottle.js +6 -0
- package/shared-utils/uuid.js +8 -0
- package/shared-utils/vectorTocoordinates.js +2 -0
- package/typedoc/components.js +2 -0
- package/typedoc/plugins.d.ts +2 -0
- package/typedoc/plugins.js +41 -1
- package/typedoc/shared-utils.js +2 -0
- package/typedoc/typings.js +2 -0
- package/typings/math.type.js +2 -0
- package/typings/utils.type.js +2 -0
- package/components/PBRView/index.d.ts +0 -14
- package/data/wYnRjQ4KZoV1yPoG.d.ts +0 -114
- package/data/wYnRjQ4KZoV1yPoG.js +0 -512
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Five } from '@realsee/five';
|
|
2
|
+
import { ModelRoomLabelPluginData } from './typings';
|
|
3
|
+
export declare type ModelRoomLabelPluginParameters = undefined;
|
|
4
|
+
export declare class ModelRoomLabelController {
|
|
5
|
+
private five;
|
|
6
|
+
private enabled;
|
|
7
|
+
private fiveModeEnabled;
|
|
8
|
+
private wrapper?;
|
|
9
|
+
private roomLabels;
|
|
10
|
+
private container;
|
|
11
|
+
constructor(five: Five);
|
|
12
|
+
dispose(): void;
|
|
13
|
+
/** 加载数据 */
|
|
14
|
+
load(data: ModelRoomLabelPluginData): void;
|
|
15
|
+
/** 设置插件容器 */
|
|
16
|
+
appendTo(wrapper: Element): this;
|
|
17
|
+
/** 禁用插件功能
|
|
18
|
+
* @description
|
|
19
|
+
* - 如果当前正在展示中,会清除所有展示的 DOM
|
|
20
|
+
* - 如果当前未展示,即使后续 Five 状态满足展示要求,也不会展示
|
|
21
|
+
* */
|
|
22
|
+
disable(): this;
|
|
23
|
+
/** 启用插件功能
|
|
24
|
+
* @description
|
|
25
|
+
* - 如果当前符合展示条件,会立刻展示
|
|
26
|
+
* - 如果不符合展示条件,会等待 Five 状态满足条件后再展示
|
|
27
|
+
*/
|
|
28
|
+
enable(): this;
|
|
29
|
+
/** 监听 Five Mode 变化
|
|
30
|
+
* @description
|
|
31
|
+
* Mode 不符合要求时,立刻消失,满足要求时,需要等待动画结束再展示
|
|
32
|
+
*/
|
|
33
|
+
private onFiveModeChange;
|
|
34
|
+
private render;
|
|
35
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.array.iterator.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.object.to-string.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.string.iterator.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/es.weak-map.js");
|
|
10
|
+
|
|
11
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/es.object.define-property.js");
|
|
14
|
+
|
|
15
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
16
|
+
|
|
17
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
18
|
+
|
|
19
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
20
|
+
|
|
21
|
+
Object.defineProperty(exports, "__esModule", {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
exports.ModelRoomLabelController = void 0;
|
|
25
|
+
|
|
26
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
27
|
+
|
|
28
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
29
|
+
|
|
30
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
31
|
+
|
|
32
|
+
var React = _interopRequireWildcard(require("react"));
|
|
33
|
+
|
|
34
|
+
var ReactDOM = _interopRequireWildcard(require("react-dom"));
|
|
35
|
+
|
|
36
|
+
var _RoomLabelItems = _interopRequireDefault(require("./RoomLabelItems"));
|
|
37
|
+
|
|
38
|
+
var _parseData = require("./utils/parseData");
|
|
39
|
+
|
|
40
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
41
|
+
|
|
42
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
43
|
+
|
|
44
|
+
var ModelRoomLabelController = /*#__PURE__*/function () {
|
|
45
|
+
function ModelRoomLabelController(five) {
|
|
46
|
+
var _this = this;
|
|
47
|
+
|
|
48
|
+
(0, _classCallCheck2["default"])(this, ModelRoomLabelController);
|
|
49
|
+
(0, _defineProperty2["default"])(this, "enabled", true);
|
|
50
|
+
(0, _defineProperty2["default"])(this, "roomLabels", []);
|
|
51
|
+
(0, _defineProperty2["default"])(this, "container", document.createElement('div'));
|
|
52
|
+
(0, _defineProperty2["default"])(this, "onFiveModeChange", function (mode) {
|
|
53
|
+
if (mode !== 'Floorplan') {
|
|
54
|
+
_this.fiveModeEnabled = false;
|
|
55
|
+
|
|
56
|
+
_this.render();
|
|
57
|
+
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
_this.five.once('initAnimationEnded', function () {
|
|
62
|
+
_this.fiveModeEnabled = _this.five.currentMode === 'Floorplan';
|
|
63
|
+
|
|
64
|
+
_this.render();
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
this.five = five;
|
|
68
|
+
this.fiveModeEnabled = this.five.currentMode === 'Floorplan'; // init container style
|
|
69
|
+
|
|
70
|
+
this.container.classList.add('model-room-label-plugin-container');
|
|
71
|
+
this.container.style.width = '100%';
|
|
72
|
+
this.container.style.height = '100%';
|
|
73
|
+
this.container.style.position = 'absolute';
|
|
74
|
+
this.container.style.left = '0';
|
|
75
|
+
this.container.style.top = '0'; // five lisenter
|
|
76
|
+
|
|
77
|
+
this.five.once('dispose', function () {
|
|
78
|
+
return _this.dispose();
|
|
79
|
+
});
|
|
80
|
+
this.five.on('modeChange', this.onFiveModeChange);
|
|
81
|
+
this.render();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
(0, _createClass2["default"])(ModelRoomLabelController, [{
|
|
85
|
+
key: "dispose",
|
|
86
|
+
value: function dispose() {
|
|
87
|
+
this.five.off('modeChange', this.onFiveModeChange);
|
|
88
|
+
ReactDOM.unmountComponentAtNode(this.container);
|
|
89
|
+
this.container.remove();
|
|
90
|
+
}
|
|
91
|
+
/** 加载数据 */
|
|
92
|
+
|
|
93
|
+
}, {
|
|
94
|
+
key: "load",
|
|
95
|
+
value: function load(data) {
|
|
96
|
+
this.roomLabels = (0, _parseData.parseModelRoomLabelPluginData)(data);
|
|
97
|
+
this.render();
|
|
98
|
+
}
|
|
99
|
+
/** 设置插件容器 */
|
|
100
|
+
|
|
101
|
+
}, {
|
|
102
|
+
key: "appendTo",
|
|
103
|
+
value: function appendTo(wrapper) {
|
|
104
|
+
this.wrapper = wrapper;
|
|
105
|
+
wrapper.appendChild(this.container);
|
|
106
|
+
this.render();
|
|
107
|
+
return this;
|
|
108
|
+
}
|
|
109
|
+
/** 禁用插件功能
|
|
110
|
+
* @description
|
|
111
|
+
* - 如果当前正在展示中,会清除所有展示的 DOM
|
|
112
|
+
* - 如果当前未展示,即使后续 Five 状态满足展示要求,也不会展示
|
|
113
|
+
* */
|
|
114
|
+
|
|
115
|
+
}, {
|
|
116
|
+
key: "disable",
|
|
117
|
+
value: function disable() {
|
|
118
|
+
this.enabled = false;
|
|
119
|
+
this.render();
|
|
120
|
+
return this;
|
|
121
|
+
}
|
|
122
|
+
/** 启用插件功能
|
|
123
|
+
* @description
|
|
124
|
+
* - 如果当前符合展示条件,会立刻展示
|
|
125
|
+
* - 如果不符合展示条件,会等待 Five 状态满足条件后再展示
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
}, {
|
|
129
|
+
key: "enable",
|
|
130
|
+
value: function enable() {
|
|
131
|
+
this.enabled = true;
|
|
132
|
+
this.render();
|
|
133
|
+
return this;
|
|
134
|
+
}
|
|
135
|
+
/** 监听 Five Mode 变化
|
|
136
|
+
* @description
|
|
137
|
+
* Mode 不符合要求时,立刻消失,满足要求时,需要等待动画结束再展示
|
|
138
|
+
*/
|
|
139
|
+
|
|
140
|
+
}, {
|
|
141
|
+
key: "render",
|
|
142
|
+
value: function render() {
|
|
143
|
+
if (!this.wrapper) return;
|
|
144
|
+
ReactDOM.render(this.enabled && this.fiveModeEnabled ? /*#__PURE__*/React.createElement(_RoomLabelItems["default"], {
|
|
145
|
+
five: this.five,
|
|
146
|
+
roomLabels: this.roomLabels
|
|
147
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null), this.container);
|
|
148
|
+
}
|
|
149
|
+
}]);
|
|
150
|
+
return ModelRoomLabelController;
|
|
151
|
+
}();
|
|
152
|
+
|
|
153
|
+
exports.ModelRoomLabelController = ModelRoomLabelController;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Five } from '@realsee/five';
|
|
3
|
+
import { RoomLabel } from './typings';
|
|
4
|
+
declare const RefRoomLabelItem: React.ForwardRefExoticComponent<{
|
|
5
|
+
five: Five;
|
|
6
|
+
item: RoomLabel;
|
|
7
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default RefRoomLabelItem;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.array.iterator.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.object.to-string.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.string.iterator.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/es.weak-map.js");
|
|
10
|
+
|
|
11
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/es.object.define-property.js");
|
|
14
|
+
|
|
15
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
16
|
+
|
|
17
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
18
|
+
|
|
19
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
20
|
+
|
|
21
|
+
Object.defineProperty(exports, "__esModule", {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
exports["default"] = void 0;
|
|
25
|
+
|
|
26
|
+
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
27
|
+
|
|
28
|
+
require("core-js/modules/es.function.name.js");
|
|
29
|
+
|
|
30
|
+
require("core-js/modules/es.array.concat.js");
|
|
31
|
+
|
|
32
|
+
var React = _interopRequireWildcard(require("react"));
|
|
33
|
+
|
|
34
|
+
var _px2rem = _interopRequireDefault(require("../../shared-utils/px2rem"));
|
|
35
|
+
|
|
36
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
|
+
|
|
38
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
|
+
|
|
40
|
+
function RoomLabelItem(props, ref) {
|
|
41
|
+
var five = props.five;
|
|
42
|
+
var roomName = props.item.name;
|
|
43
|
+
var handleClick = React.useCallback(function () {
|
|
44
|
+
five.setState({
|
|
45
|
+
panoIndex: props.item.panoIndex,
|
|
46
|
+
mode: 'Panorama',
|
|
47
|
+
longitude: props.item.longitude
|
|
48
|
+
});
|
|
49
|
+
}, [props.five]);
|
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
onClick: handleClick,
|
|
52
|
+
ref: ref,
|
|
53
|
+
className: _style["default"].dynamic([["3619298579", [(0, _px2rem["default"])(roomName.length > 3 ? 8 : 10), (0, _px2rem["default"])(-64), (0, _px2rem["default"])(20), (0, _px2rem["default"])(32), (0, _px2rem["default"])(6), (0, _px2rem["default"])(-44), (0, _px2rem["default"])(48), (0, _px2rem["default"])(1)]]]) + " " + "room-guid-label-plugin__item"
|
|
54
|
+
}, /*#__PURE__*/React.createElement(_style["default"], {
|
|
55
|
+
id: "3619298579",
|
|
56
|
+
dynamic: [(0, _px2rem["default"])(roomName.length > 3 ? 8 : 10), (0, _px2rem["default"])(-64), (0, _px2rem["default"])(20), (0, _px2rem["default"])(32), (0, _px2rem["default"])(6), (0, _px2rem["default"])(-44), (0, _px2rem["default"])(48), (0, _px2rem["default"])(1)]
|
|
57
|
+
}, [".room-guid-label-plugin__item.__jsx-style-dynamic-selector{position:absolute;z-index:0;font-size:".concat((0, _px2rem["default"])(roomName.length > 3 ? 8 : 10), ";-webkit-transform:'';-ms-transform:'';transform:'';cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}"), ".room-guid-label-plugin__item-text.__jsx-style-dynamic-selector{position:absolute;left:0;top:".concat((0, _px2rem["default"])(-64), ";-webkit-transform:translate(-50%,0);-ms-transform:translate(-50%,0);transform:translate(-50%,0);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:").concat((0, _px2rem["default"])(20), ";min-width:").concat((0, _px2rem["default"])(32), ";padding:0 ").concat((0, _px2rem["default"])(6), ";pointer-events:all;background:url('//vrlab-static.ljcdn.com/release/web/room-label-bg.23e9d038.png') no-repeat;background-size:100% 100%;white-space:nowrap;}"), ".room-guid-label-plugin__item-bar.__jsx-style-dynamic-selector{position:absolute;top:".concat((0, _px2rem["default"])(-44), ";height:").concat((0, _px2rem["default"])(48), ";width:").concat((0, _px2rem["default"])(1), ";background-image:linear-gradient(to bottom,rgba(255,255,255,1),rgba(255,255,255,0));}")]), /*#__PURE__*/React.createElement("span", {
|
|
58
|
+
className: _style["default"].dynamic([["3619298579", [(0, _px2rem["default"])(roomName.length > 3 ? 8 : 10), (0, _px2rem["default"])(-64), (0, _px2rem["default"])(20), (0, _px2rem["default"])(32), (0, _px2rem["default"])(6), (0, _px2rem["default"])(-44), (0, _px2rem["default"])(48), (0, _px2rem["default"])(1)]]]) + " " + "room-guid-label-plugin__item-text"
|
|
59
|
+
}, roomName), /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
className: _style["default"].dynamic([["3619298579", [(0, _px2rem["default"])(roomName.length > 3 ? 8 : 10), (0, _px2rem["default"])(-64), (0, _px2rem["default"])(20), (0, _px2rem["default"])(32), (0, _px2rem["default"])(6), (0, _px2rem["default"])(-44), (0, _px2rem["default"])(48), (0, _px2rem["default"])(1)]]]) + " " + "room-guid-label-plugin__item-bar"
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var RefRoomLabelItem = /*#__PURE__*/React.forwardRef(RoomLabelItem);
|
|
65
|
+
var _default = RefRoomLabelItem;
|
|
66
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.array.iterator.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.object.to-string.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.string.iterator.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/es.weak-map.js");
|
|
10
|
+
|
|
11
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/es.object.define-property.js");
|
|
14
|
+
|
|
15
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
16
|
+
|
|
17
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
18
|
+
|
|
19
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
20
|
+
|
|
21
|
+
Object.defineProperty(exports, "__esModule", {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
exports["default"] = RoomLabelItems;
|
|
25
|
+
|
|
26
|
+
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
27
|
+
|
|
28
|
+
var _construct2 = _interopRequireDefault(require("@babel/runtime/helpers/construct"));
|
|
29
|
+
|
|
30
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
31
|
+
|
|
32
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
33
|
+
|
|
34
|
+
require("core-js/modules/es.string.sub.js");
|
|
35
|
+
|
|
36
|
+
require("core-js/modules/es.array.concat.js");
|
|
37
|
+
|
|
38
|
+
require("core-js/modules/es.array.for-each.js");
|
|
39
|
+
|
|
40
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
41
|
+
|
|
42
|
+
require("core-js/modules/es.array.sort.js");
|
|
43
|
+
|
|
44
|
+
require("core-js/modules/es.array.map.js");
|
|
45
|
+
|
|
46
|
+
require("core-js/modules/es.array.filter.js");
|
|
47
|
+
|
|
48
|
+
require("core-js/modules/es.object.values.js");
|
|
49
|
+
|
|
50
|
+
var React = _interopRequireWildcard(require("react"));
|
|
51
|
+
|
|
52
|
+
var _three = require("three");
|
|
53
|
+
|
|
54
|
+
var _RoomLabelItem = _interopRequireDefault(require("./RoomLabelItem"));
|
|
55
|
+
|
|
56
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
57
|
+
|
|
58
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
59
|
+
|
|
60
|
+
function getLabelVisible(five, roomLabelItem) {
|
|
61
|
+
// 先看是不是在当前展示的楼层上
|
|
62
|
+
var isLabelInFloor = five.model.shownFloor === null || roomLabelItem.floorIndex === five.model.shownFloor;
|
|
63
|
+
if (!isLabelInFloor) return false; // 再看是不是被模型遮挡
|
|
64
|
+
|
|
65
|
+
var raycaster = new _three.Raycaster();
|
|
66
|
+
var cameraPosition = five.camera.position.clone();
|
|
67
|
+
var position = new _three.Vector3(roomLabelItem.position.x, roomLabelItem.position.y, roomLabelItem.position.z);
|
|
68
|
+
var vectorDistance = position.distanceTo(cameraPosition);
|
|
69
|
+
raycaster.set(cameraPosition.clone(), position.clone().sub(cameraPosition).normalize());
|
|
70
|
+
|
|
71
|
+
var _five$model$intersect = five.model.intersectRaycaster(raycaster),
|
|
72
|
+
_five$model$intersect2 = (0, _slicedToArray2["default"])(_five$model$intersect, 1),
|
|
73
|
+
intersection = _five$model$intersect2[0];
|
|
74
|
+
|
|
75
|
+
if (intersection && intersection.distance + 1 < vectorDistance) return false;
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function getLabelTransform(five, roomLabelItem, containerWidth, containerHeight) {
|
|
80
|
+
var position = new _three.Vector3(roomLabelItem.position.x, roomLabelItem.position.y, roomLabelItem.position.z);
|
|
81
|
+
var mouse = position.clone().project(five.camera);
|
|
82
|
+
var xOffset = Math.ceil((mouse.x + 1) / 2 * containerWidth);
|
|
83
|
+
var yOffset = Math.ceil((-mouse.y + 1) / 2 * containerHeight);
|
|
84
|
+
return "translate(".concat(xOffset, "px, ").concat(yOffset, "px)");
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function updateFormatData(five, labels, containerWidth, containerHeight) {
|
|
88
|
+
labels.forEach(function (roomLabelItem) {
|
|
89
|
+
// 计算是否可见,入股不可见,不会更新位置
|
|
90
|
+
roomLabelItem.visible = getLabelVisible(five, roomLabelItem);
|
|
91
|
+
if (!roomLabelItem.visible) return roomLabelItem; // 更新位置
|
|
92
|
+
|
|
93
|
+
roomLabelItem.transform = getLabelTransform(five, roomLabelItem, containerWidth, containerHeight);
|
|
94
|
+
return true;
|
|
95
|
+
});
|
|
96
|
+
labels.filter(function (_ref) {
|
|
97
|
+
var visible = _ref.visible;
|
|
98
|
+
return visible;
|
|
99
|
+
}).map(function (roomLabelItem) {
|
|
100
|
+
return {
|
|
101
|
+
roomLabelItem: roomLabelItem,
|
|
102
|
+
distance: (0, _construct2["default"])(_three.Vector3, (0, _toConsumableArray2["default"])(Object.values(roomLabelItem.position))).clone().distanceTo(five.camera.position)
|
|
103
|
+
};
|
|
104
|
+
}).sort(function (a, b) {
|
|
105
|
+
return a.distance - b.distance;
|
|
106
|
+
}).forEach(function (_ref2, index) {
|
|
107
|
+
var roomLabelItem = _ref2.roomLabelItem;
|
|
108
|
+
roomLabelItem.zIndex = index * 10;
|
|
109
|
+
});
|
|
110
|
+
return labels;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function RoomLabelItems(props) {
|
|
114
|
+
var five = props.five;
|
|
115
|
+
var itemRefs = React.useRef([]);
|
|
116
|
+
var contentRef = React.useRef(null);
|
|
117
|
+
var roomLabels = props.roomLabels;
|
|
118
|
+
|
|
119
|
+
function onFiveCameraDirectionUpdate() {
|
|
120
|
+
if (!contentRef.current) return;
|
|
121
|
+
updateFormatData(five, roomLabels, contentRef.current.clientWidth, contentRef.current.clientHeight).forEach(function (item, index) {
|
|
122
|
+
var ref = itemRefs.current[index];
|
|
123
|
+
if (!ref) return;
|
|
124
|
+
|
|
125
|
+
if (!item.visible) {
|
|
126
|
+
ref.style.opacity = '0';
|
|
127
|
+
ref.style.pointerEvents = 'none';
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
ref.style.opacity = '1';
|
|
132
|
+
ref.style.pointerEvents = 'all';
|
|
133
|
+
ref.style.transform = item.transform;
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
React.useEffect(function () {
|
|
138
|
+
five.on('cameraDirectionUpdate', onFiveCameraDirectionUpdate);
|
|
139
|
+
onFiveCameraDirectionUpdate();
|
|
140
|
+
return function () {
|
|
141
|
+
five.off('cameraDirectionUpdate', onFiveCameraDirectionUpdate);
|
|
142
|
+
};
|
|
143
|
+
}, []);
|
|
144
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
145
|
+
ref: contentRef,
|
|
146
|
+
className: "jsx-2859587460" + " " + "room-guid-label-plugin__content"
|
|
147
|
+
}, /*#__PURE__*/React.createElement(_style["default"], {
|
|
148
|
+
id: "2859587460"
|
|
149
|
+
}, [".room-guid-label-plugin__content.jsx-2859587460{width:100%;height:100%;position:relative;color:#fff;}"]), roomLabels.map(function (item) {
|
|
150
|
+
return /*#__PURE__*/React.createElement(_RoomLabelItem["default"], {
|
|
151
|
+
key: item.id,
|
|
152
|
+
item: item,
|
|
153
|
+
five: props.five,
|
|
154
|
+
ref: function ref(_ref3) {
|
|
155
|
+
return itemRefs.current.push(_ref3);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}));
|
|
159
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FivePlugin } from '@realsee/five';
|
|
2
|
+
import { ModelRoomLabelController, ModelRoomLabelPluginParameters } from './Controller';
|
|
3
|
+
export declare const ModelRoomLabelPlugin: FivePlugin<ModelRoomLabelPluginParameters, ModelRoomLabelPluginReturnType>;
|
|
4
|
+
export default ModelRoomLabelPlugin;
|
|
5
|
+
export type { ModelRoomLabelController } from './Controller';
|
|
6
|
+
export type { ModelRoomLabelPluginData, RoomLabel } from './typings';
|
|
7
|
+
export declare type ModelRoomLabelPluginReturnType = ModelRoomLabelController;
|
|
8
|
+
export type { ModelRoomLabelPluginParameters } from './Controller';
|
|
@@ -0,0 +1,18 @@
|
|
|
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["default"] = exports.ModelRoomLabelPlugin = void 0;
|
|
9
|
+
|
|
10
|
+
var _Controller = require("./Controller");
|
|
11
|
+
|
|
12
|
+
var ModelRoomLabelPlugin = function ModelRoomLabelPlugin(five) {
|
|
13
|
+
return new _Controller.ModelRoomLabelController(five);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.ModelRoomLabelPlugin = ModelRoomLabelPlugin;
|
|
17
|
+
var _default = ModelRoomLabelPlugin;
|
|
18
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare type ModelRoomLabelPluginData = {
|
|
2
|
+
model_room_labels: Readonly<{
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
longitude: number;
|
|
6
|
+
pano_index: number;
|
|
7
|
+
floor_index: number;
|
|
8
|
+
position: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
z: number;
|
|
12
|
+
};
|
|
13
|
+
}>[];
|
|
14
|
+
};
|
|
15
|
+
export interface RoomLabel {
|
|
16
|
+
/** 房屋 ID */
|
|
17
|
+
readonly id: string;
|
|
18
|
+
/** 房屋名 */
|
|
19
|
+
readonly name: string;
|
|
20
|
+
/** 走到对应 panoIndex 时 five 的水平角度 */
|
|
21
|
+
readonly longitude: number;
|
|
22
|
+
/** 点击标签会走到的 panoIndex */
|
|
23
|
+
readonly panoIndex: number;
|
|
24
|
+
/** 所处楼层 */
|
|
25
|
+
readonly floorIndex: number;
|
|
26
|
+
/** 引导标签的三维坐标,一般是房屋中心点 */
|
|
27
|
+
readonly position: {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
z: number;
|
|
31
|
+
};
|
|
32
|
+
zIndex: number;
|
|
33
|
+
visible: boolean;
|
|
34
|
+
transform: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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.parseModelRoomLabelPluginData = parseModelRoomLabelPluginData;
|
|
9
|
+
|
|
10
|
+
require("core-js/modules/es.array.map.js");
|
|
11
|
+
|
|
12
|
+
require("core-js/modules/es.function.name.js");
|
|
13
|
+
|
|
14
|
+
/** @description 下划线转驼峰 */
|
|
15
|
+
function parseModelRoomLabelPluginData(data) {
|
|
16
|
+
return data.model_room_labels.map(function (_ref) {
|
|
17
|
+
var id = _ref.id,
|
|
18
|
+
pano_index = _ref.pano_index,
|
|
19
|
+
floor_index = _ref.floor_index,
|
|
20
|
+
name = _ref.name,
|
|
21
|
+
position = _ref.position,
|
|
22
|
+
longitude = _ref.longitude;
|
|
23
|
+
return {
|
|
24
|
+
id: id,
|
|
25
|
+
name: name,
|
|
26
|
+
position: position,
|
|
27
|
+
longitude: longitude,
|
|
28
|
+
panoIndex: pano_index,
|
|
29
|
+
floorIndex: floor_index,
|
|
30
|
+
zIndex: 0,
|
|
31
|
+
visible: false,
|
|
32
|
+
transform: ''
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
}
|