@realsee/dnalogel 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -0
- package/TERMS.txt +56 -0
- package/components/ARVideoFigure/ARVideoFigureMesh.d.ts +44 -0
- package/components/ARVideoFigure/ARVideoFigureMesh.js +347 -0
- package/components/ARVideoFigure/ARVideoFigureScene.d.ts +11 -0
- package/components/ARVideoFigure/ARVideoFigureScene.js +74 -0
- package/components/ARVideoFigure/ImgBgTransparent.d.ts +16 -0
- package/components/ARVideoFigure/ImgBgTransparent.js +49 -0
- package/components/ARVideoFigure/ImgBgTransparentMesh.d.ts +30 -0
- package/components/ARVideoFigure/ImgBgTransparentMesh.js +173 -0
- package/components/ARVideoFigure/fragmentShader.d.ts +5 -0
- package/components/ARVideoFigure/fragmentShader.js +16 -0
- package/components/ARVideoFigure/index.d.ts +15 -0
- package/components/ARVideoFigure/index.js +64 -0
- package/components/ARVideoFigure/vertexShader.d.ts +1 -0
- package/components/ARVideoFigure/vertexShader.js +8 -0
- package/components/GlassFilters/index.d.ts +32 -0
- package/components/GlassFilters/index.js +54 -0
- package/components/ModelView/ModelViewController.d.ts +18 -0
- package/components/ModelView/ModelViewController.js +147 -0
- package/components/ModelView/index.d.ts +10 -0
- package/components/ModelView/index.js +22 -0
- package/components/PBRView/index.d.ts +14 -0
- package/components/PBRView/index.js +31 -0
- package/components/PaintBrush/index.d.ts +16 -0
- package/components/PaintBrush/index.js +33 -0
- package/components/PanoTag/index.d.ts +4 -0
- package/components/PanoTag/index.js +11 -0
- package/custom.d.js +3 -0
- package/data/1aGKl9JmrlXMXx8d.d.ts +104 -0
- package/data/1aGKl9JmrlXMXx8d.js +535 -0
- package/data/6gyq3v1verxD7JO1.d.ts +104 -0
- package/data/6gyq3v1verxD7JO1.js +460 -0
- package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.d.ts +84 -0
- package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.js +598 -0
- package/data/PrXel3aqGbp34JQn.d.ts +389 -0
- package/data/PrXel3aqGbp34JQn.js +4639 -0
- package/data/YdoNP9K4rwQDwjJr.d.ts +83 -0
- package/data/YdoNP9K4rwQDwjJr.js +1451 -0
- package/data/auto3d-njL5J99VwCmnjtQElOmXQr.d.ts +86 -0
- package/data/auto3d-njL5J99VwCmnjtQElOmXQr.js +709 -0
- package/data/oPzy3ApbjjpD8YdR.d.ts +83 -0
- package/data/oPzy3ApbjjpD8YdR.js +281 -0
- package/data/qjAxMG4XbPn96wKG.d.ts +104 -0
- package/data/qjAxMG4XbPn96wKG.js +635 -0
- package/data/rXel3aPQRRBD4JQn.d.ts +86 -0
- package/data/rXel3aPQRRBD4JQn.js +620 -0
- package/data/vLykj3NWrllMrG06.d.ts +89 -0
- package/data/vLykj3NWrllMrG06.js +2532 -0
- package/data/wYnRjQ4KZoV1yPoG.d.ts +114 -0
- package/data/wYnRjQ4KZoV1yPoG.js +512 -0
- package/data/wz0QV9KA4ugyo9ME.d.ts +39 -0
- package/data/wz0QV9KA4ugyo9ME.js +134 -0
- package/examples/FiveStateController/index.js +140 -0
- package/examples/VRHouse/Mobile.js +22 -0
- package/examples/VRHouse/PC.js +22 -0
- package/examples/VRHouse/index.js +22 -0
- package/index.d.ts +15 -0
- package/index.js +43 -0
- package/package.json +19 -0
- package/plugins/CSS3DRenderPlugin/components/Marker/index.d.ts +12 -0
- package/plugins/CSS3DRenderPlugin/components/Marker/index.js +113 -0
- package/plugins/CSS3DRenderPlugin/index.d.ts +49 -0
- package/plugins/CSS3DRenderPlugin/index.js +220 -0
- package/plugins/CameraMovementPlugin/index.d.ts +7 -0
- package/plugins/CameraMovementPlugin/index.js +338 -0
- package/plugins/CameraMovementPlugin/typing.d.ts +68 -0
- package/plugins/CameraMovementPlugin/typing.js +35 -0
- package/plugins/ModelChassisCompassPlugin/index.d.ts +15 -0
- package/plugins/ModelChassisCompassPlugin/index.js +156 -0
- package/plugins/ModelEntryDoorGuidePlugin/index.d.ts +10 -0
- package/plugins/ModelEntryDoorGuidePlugin/index.js +16 -0
- package/plugins/ModelTVVideoPlugin/index.d.ts +21 -0
- package/plugins/ModelTVVideoPlugin/index.js +313 -0
- package/plugins/ModelViewPlugin/index.d.ts +17 -0
- package/plugins/ModelViewPlugin/index.js +199 -0
- package/plugins/PanoCursorRaycasterPlugin/PanoCursorRaycasterPluginUsage.d.ts +48 -0
- package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.d.ts +9 -0
- package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.js +113 -0
- package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.d.ts +11 -0
- package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.js +25 -0
- package/plugins/PanoCursorRaycasterPlugin/index.d.ts +49 -0
- package/plugins/PanoCursorRaycasterPlugin/index.js +119 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.d.ts +5 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.js +25 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/createLine.d.ts +3 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/createLine.js +34 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/vecror3.d.ts +7 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/vecror3.js +18 -0
- package/plugins/PanoDoorLabelPlugin/index.d.ts +4 -0
- package/plugins/PanoDoorLabelPlugin/index.js +12 -0
- package/plugins/PanoIRobotPlugin/index.d.ts +10 -0
- package/plugins/PanoIRobotPlugin/index.js +16 -0
- package/plugins/PanoRulerPlugin/data/roomInfo.d.ts +3 -0
- package/plugins/PanoRulerPlugin/data/roomInfo.js +49 -0
- package/plugins/PanoRulerPlugin/data/roomRules.d.ts +3 -0
- package/plugins/PanoRulerPlugin/data/roomRules.js +233 -0
- package/plugins/PanoRulerPlugin/index.d.ts +27 -0
- package/plugins/PanoRulerPlugin/index.js +589 -0
- package/plugins/PanoRulerPlugin/typings.d.ts +21 -0
- package/plugins/PanoRulerPlugin/typings.js +5 -0
- package/plugins/PanoTVVideoPlugin/index.d.ts +24 -0
- package/plugins/PanoTVVideoPlugin/index.js +351 -0
- package/plugins/TreasurePlugin/Controller.d.ts +32 -0
- package/plugins/TreasurePlugin/Controller.js +175 -0
- package/plugins/TreasurePlugin/TreasureFaceAnime.d.ts +23 -0
- package/plugins/TreasurePlugin/TreasureFaceAnime.js +128 -0
- package/plugins/TreasurePlugin/TreasureObject.d.ts +35 -0
- package/plugins/TreasurePlugin/TreasureObject.js +186 -0
- package/plugins/TreasurePlugin/TreasureOpenAnime.d.ts +23 -0
- package/plugins/TreasurePlugin/TreasureOpenAnime.js +103 -0
- package/plugins/TreasurePlugin/constants.d.ts +12 -0
- package/plugins/TreasurePlugin/constants.js +30 -0
- package/plugins/TreasurePlugin/index.d.ts +11 -0
- package/plugins/TreasurePlugin/index.js +16 -0
- package/plugins/TreasurePlugin/treasureDataMap.d.ts +7 -0
- package/plugins/TreasurePlugin/treasureDataMap.js +20 -0
- package/plugins/TreasurePlugin/typings.d.ts +2 -0
- package/plugins/TreasurePlugin/typings.js +5 -0
- package/plugins/TreasurePlugin/utils/loadTreasureTextures.d.ts +7 -0
- package/plugins/TreasurePlugin/utils/loadTreasureTextures.js +115 -0
- package/plugins/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
- package/plugins/floorplan/Assets/floorplanExtraObject.js +8 -0
- package/plugins/floorplan/ModelFloorplanPlugin/Controller.d.ts +100 -0
- package/plugins/floorplan/ModelFloorplanPlugin/Controller.js +643 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.d.ts +13 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.js +58 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.d.ts +5 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.js +69 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.d.ts +10 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.js +105 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.d.ts +13 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.js +95 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.d.ts +13 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.js +48 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/index.d.ts +20 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/index.js +66 -0
- package/plugins/floorplan/ModelFloorplanPlugin/controller.style.d.ts +1 -0
- package/plugins/floorplan/ModelFloorplanPlugin/controller.style.js +14 -0
- package/plugins/floorplan/ModelFloorplanPlugin/index.d.ts +9 -0
- package/plugins/floorplan/ModelFloorplanPlugin/index.js +18 -0
- package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +23 -0
- package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.js +5 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +15 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.js +31 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +14 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +162 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.d.ts +13 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.js +91 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.d.ts +3 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.js +35 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.d.ts +5 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.js +50 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.d.ts +9 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.js +102 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.d.ts +11 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.js +42 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.d.ts +17 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.js +75 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.d.ts +2 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.js +13 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +33 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.js +214 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/index.d.ts +8 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/index.js +18 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/Controller.d.ts +55 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/Controller.js +267 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/index.js +16 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/style.d.ts +1 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/style.js +14 -0
- package/plugins/floorplan/components/FloorplanImage.d.ts +7 -0
- package/plugins/floorplan/components/FloorplanImage.js +76 -0
- package/plugins/floorplan/typings/floorplanData.d.ts +127 -0
- package/plugins/floorplan/typings/floorplanData.js +5 -0
- package/plugins/floorplan/typings/floorplanServerData.d.ts +125 -0
- package/plugins/floorplan/typings/floorplanServerData.js +380 -0
- package/plugins/floorplan/utils/formatData.d.ts +5 -0
- package/plugins/floorplan/utils/formatData.js +220 -0
- package/plugins/floorplan/utils/formatPosition.d.ts +37 -0
- package/plugins/floorplan/utils/formatPosition.js +87 -0
- package/shared-utils/Preloader.d.ts +6 -0
- package/shared-utils/Preloader.js +51 -0
- package/shared-utils/Subscribe.d.ts +45 -0
- package/shared-utils/Subscribe.js +210 -0
- package/shared-utils/animationFrame/BetterTween.d.ts +11 -0
- package/shared-utils/animationFrame/BetterTween.js +102 -0
- package/shared-utils/animationFrame/calculateProgress.d.ts +8 -0
- package/shared-utils/animationFrame/calculateProgress.js +38 -0
- package/shared-utils/animationFrame/formatRad.d.ts +15 -0
- package/shared-utils/animationFrame/formatRad.js +34 -0
- package/shared-utils/animationFrame/index.d.ts +15 -0
- package/shared-utils/animationFrame/index.js +69 -0
- package/shared-utils/animationFrame/tween.d.ts +75 -0
- package/shared-utils/animationFrame/tween.js +76 -0
- package/shared-utils/changeModelCanvansOpacity.d.ts +2 -0
- package/shared-utils/changeModelCanvansOpacity.js +24 -0
- package/shared-utils/createFiveContainer.d.ts +10 -0
- package/shared-utils/createFiveContainer.js +165 -0
- package/shared-utils/createLine/index.d.ts +3 -0
- package/shared-utils/createLine/index.js +29 -0
- package/shared-utils/debounce.d.ts +6 -0
- package/shared-utils/debounce.js +26 -0
- package/shared-utils/equal.d.ts +11 -0
- package/shared-utils/equal.js +96 -0
- package/shared-utils/filter.d.ts +27 -0
- package/shared-utils/filter.js +93 -0
- package/shared-utils/five/changeMode.d.ts +2 -0
- package/shared-utils/five/changeMode.js +86 -0
- package/shared-utils/five/useFivePlugin.d.ts +1 -0
- package/shared-utils/five/useFivePlugin.js +15 -0
- package/shared-utils/formatRad.d.ts +7 -0
- package/shared-utils/formatRad.js +16 -0
- package/shared-utils/getPxmm.d.ts +6 -0
- package/shared-utils/getPxmm.js +37 -0
- package/shared-utils/getRandomColor.d.ts +1 -0
- package/shared-utils/getRandomColor.js +13 -0
- package/shared-utils/isTruelyObject.d.ts +18 -0
- package/shared-utils/isTruelyObject.js +27 -0
- package/shared-utils/math/evenNumber.d.ts +1 -0
- package/shared-utils/math/evenNumber.js +11 -0
- package/shared-utils/math/planimetry.d.ts +116 -0
- package/shared-utils/math/planimetry.js +342 -0
- package/shared-utils/math/rad2Deg.d.ts +1 -0
- package/shared-utils/math/rad2Deg.js +10 -0
- package/shared-utils/nearlyEqual.d.ts +7 -0
- package/shared-utils/nearlyEqual.js +17 -0
- package/shared-utils/nextFrame.d.ts +1 -0
- package/shared-utils/nextFrame.js +13 -0
- package/shared-utils/noop.d.ts +5 -0
- package/shared-utils/noop.js +17 -0
- package/shared-utils/object3d2LocalMatrix.d.ts +12 -0
- package/shared-utils/object3d2LocalMatrix.js +73 -0
- package/shared-utils/px2rem.d.ts +1 -0
- package/shared-utils/px2rem.js +12 -0
- package/shared-utils/tap.d.ts +8 -0
- package/shared-utils/tap.js +19 -0
- package/shared-utils/three/centerPoint.d.ts +2 -0
- package/shared-utils/three/centerPoint.js +12 -0
- package/shared-utils/three/getNormal.d.ts +2 -0
- package/shared-utils/three/getNormal.js +13 -0
- package/shared-utils/three/loadFbxObj.d.ts +3 -0
- package/shared-utils/three/loadFbxObj.js +42 -0
- package/shared-utils/three/loadTexture.d.ts +2 -0
- package/shared-utils/three/loadTexture.js +38 -0
- package/shared-utils/three/vecror3.d.ts +7 -0
- package/shared-utils/three/vecror3.js +18 -0
- package/shared-utils/throttle.d.ts +7 -0
- package/shared-utils/throttle.js +25 -0
- package/shared-utils/to.d.ts +9 -0
- package/shared-utils/to.js +25 -0
- package/shared-utils/useDebounce.d.ts +8 -0
- package/shared-utils/useDebounce.js +43 -0
- package/shared-utils/useThrottle.d.ts +8 -0
- package/shared-utils/useThrottle.js +41 -0
- package/shared-utils/uuid.d.ts +4 -0
- package/shared-utils/uuid.js +20 -0
- package/shared-utils/vectorTocoordinates.d.ts +7 -0
- package/shared-utils/vectorTocoordinates.js +16 -0
- package/typedoc/components.d.ts +6 -0
- package/typedoc/components.js +5 -0
- package/typedoc/plugins.d.ts +17 -0
- package/typedoc/plugins.js +113 -0
- package/typedoc/shared-utils.d.ts +3 -0
- package/typedoc/shared-utils.js +5 -0
- package/typedoc/typings.d.ts +3 -0
- package/typedoc/typings.js +5 -0
- package/typings/math.type.d.ts +44 -0
- package/typings/math.type.js +5 -0
- package/typings/utils.type.d.ts +2 -0
- package/typings/utils.type.js +5 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.contentStyle = void 0;
|
|
7
|
+
var contentStyle = {
|
|
8
|
+
position: 'absolute',
|
|
9
|
+
left: '50%',
|
|
10
|
+
top: '50%',
|
|
11
|
+
transform: 'translate(-50%, -50%)'
|
|
12
|
+
};
|
|
13
|
+
exports.contentStyle = contentStyle;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Five } from '@realsee/five';
|
|
3
|
+
import { FloorplanServerData } from '../typings/floorplanServerData';
|
|
4
|
+
import { FloorplanExtraObject3D } from '../typings/floorplanData';
|
|
5
|
+
export interface PanoFloorplanRadarPluginControllerParameter {
|
|
6
|
+
wrapper?: string | Element;
|
|
7
|
+
configs?: {
|
|
8
|
+
hoverEnable?: boolean;
|
|
9
|
+
cameraImage?: {
|
|
10
|
+
style: React.CSSProperties;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export default class PanoFloorplanRadarPluginController {
|
|
15
|
+
private five;
|
|
16
|
+
private pxmm;
|
|
17
|
+
private wrapperSelector;
|
|
18
|
+
private data?;
|
|
19
|
+
private wrapper;
|
|
20
|
+
private size;
|
|
21
|
+
private extraObjects?;
|
|
22
|
+
private orginExtraObjects?;
|
|
23
|
+
private configs;
|
|
24
|
+
constructor(five: Five, params?: PanoFloorplanRadarPluginControllerParameter);
|
|
25
|
+
dispose: () => void;
|
|
26
|
+
load: (data: FloorplanServerData) => Promise<void>;
|
|
27
|
+
/** 把插件的渲染DOM插入到对应的容器中去 */
|
|
28
|
+
appendTo(wrapper: Element): void;
|
|
29
|
+
changeConfigs(configs: PanoFloorplanRadarPluginController['configs']): void;
|
|
30
|
+
setExtraObjectsWith3DPositions(data: FloorplanExtraObject3D[]): void;
|
|
31
|
+
private updateSize;
|
|
32
|
+
private render;
|
|
33
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _Content = _interopRequireDefault(require("./Content"));
|
|
13
|
+
|
|
14
|
+
var ReactDOM = _interopRequireWildcard(require("react-dom"));
|
|
15
|
+
|
|
16
|
+
var _formatData = _interopRequireWildcard(require("../utils/formatData"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
25
|
+
|
|
26
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
+
|
|
28
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
+
|
|
30
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
31
|
+
|
|
32
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
33
|
+
|
|
34
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
|
+
|
|
36
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
+
|
|
38
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
39
|
+
|
|
40
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
41
|
+
|
|
42
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
43
|
+
|
|
44
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
45
|
+
|
|
46
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
47
|
+
|
|
48
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
49
|
+
|
|
50
|
+
var PanoFloorplanRadarPluginController = /*#__PURE__*/function () {
|
|
51
|
+
function PanoFloorplanRadarPluginController(five, params) {
|
|
52
|
+
var _this = this;
|
|
53
|
+
|
|
54
|
+
_classCallCheck(this, PanoFloorplanRadarPluginController);
|
|
55
|
+
|
|
56
|
+
_defineProperty(this, "pxmm", 0);
|
|
57
|
+
|
|
58
|
+
_defineProperty(this, "wrapperSelector", '');
|
|
59
|
+
|
|
60
|
+
_defineProperty(this, "wrapper", null);
|
|
61
|
+
|
|
62
|
+
_defineProperty(this, "size", {
|
|
63
|
+
width: 0,
|
|
64
|
+
height: 0
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
_defineProperty(this, "configs", {});
|
|
68
|
+
|
|
69
|
+
_defineProperty(this, "dispose", function () {
|
|
70
|
+
_this.wrapper && ReactDOM.unmountComponentAtNode(_this.wrapper);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
_defineProperty(this, "load", /*#__PURE__*/function () {
|
|
74
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(data) {
|
|
75
|
+
var _wrapper, copyData, floorplanData;
|
|
76
|
+
|
|
77
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
78
|
+
while (1) {
|
|
79
|
+
switch (_context.prev = _context.next) {
|
|
80
|
+
case 0:
|
|
81
|
+
// 处理 wrapper
|
|
82
|
+
if (!_this.wrapper) {
|
|
83
|
+
_wrapper = document.querySelector(_this.wrapperSelector);
|
|
84
|
+
if (!_wrapper) console.warn('插件容器不存在,可能得到与预期不符的效果,是不是忘记初始化容器了?');
|
|
85
|
+
_this.wrapper = _wrapper;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
copyData = JSON.parse(JSON.stringify(data));
|
|
89
|
+
_context.next = 4;
|
|
90
|
+
return (0, _formatData["default"])(copyData);
|
|
91
|
+
|
|
92
|
+
case 4:
|
|
93
|
+
floorplanData = _context.sent;
|
|
94
|
+
_this.data = floorplanData;
|
|
95
|
+
_context.next = 8;
|
|
96
|
+
return new Promise(function (resolve) {
|
|
97
|
+
var _floorplanData$outlin, _floorplanData$outlin2;
|
|
98
|
+
|
|
99
|
+
var floorIndex = _this.five.work.observers[_this.five.getCurrentState().panoIndex].floorIndex; // 当有 svgString 时,没有加载过程
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
// 当有 svgString 时,没有加载过程
|
|
103
|
+
if ((_floorplanData$outlin = floorplanData.outlines[floorIndex]) !== null && _floorplanData$outlin !== void 0 && _floorplanData$outlin.svgContent) return resolve();
|
|
104
|
+
var nowFloorImage = new Image();
|
|
105
|
+
var nowFloorImageSrc = (_floorplanData$outlin2 = floorplanData.outlines[floorIndex]) === null || _floorplanData$outlin2 === void 0 ? void 0 : _floorplanData$outlin2.url; // 如果当前楼层图片不存在,不存在加载过程
|
|
106
|
+
|
|
107
|
+
// 如果当前楼层图片不存在,不存在加载过程
|
|
108
|
+
if (!nowFloorImageSrc) return resolve(); // 图片加载完成时再 render
|
|
109
|
+
|
|
110
|
+
// 图片加载完成时再 render
|
|
111
|
+
nowFloorImage.onload = function () {
|
|
112
|
+
return resolve();
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
nowFloorImage.src = nowFloorImageSrc;
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
case 8:
|
|
119
|
+
_this.updateSize();
|
|
120
|
+
|
|
121
|
+
_this.render();
|
|
122
|
+
|
|
123
|
+
case 10:
|
|
124
|
+
case "end":
|
|
125
|
+
return _context.stop();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}, _callee);
|
|
129
|
+
}));
|
|
130
|
+
|
|
131
|
+
return function (_x) {
|
|
132
|
+
return _ref.apply(this, arguments);
|
|
133
|
+
};
|
|
134
|
+
}());
|
|
135
|
+
|
|
136
|
+
this.five = five;
|
|
137
|
+
(params === null || params === void 0 ? void 0 : params.configs) && Object.assign(this.configs, params.configs);
|
|
138
|
+
if (typeof (params === null || params === void 0 ? void 0 : params.wrapper) === 'string') this.wrapperSelector = params.wrapper;else if ((params === null || params === void 0 ? void 0 : params.wrapper) instanceof Element) this.wrapper = params.wrapper;
|
|
139
|
+
five.once('dispose', this.dispose);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
_createClass(PanoFloorplanRadarPluginController, [{
|
|
143
|
+
key: "appendTo",
|
|
144
|
+
value:
|
|
145
|
+
/** 把插件的渲染DOM插入到对应的容器中去 */
|
|
146
|
+
function appendTo(wrapper) {
|
|
147
|
+
this.wrapper = wrapper;
|
|
148
|
+
}
|
|
149
|
+
}, {
|
|
150
|
+
key: "changeConfigs",
|
|
151
|
+
value: function changeConfigs(configs) {
|
|
152
|
+
Object.assign(this.configs, configs);
|
|
153
|
+
this.render();
|
|
154
|
+
}
|
|
155
|
+
}, {
|
|
156
|
+
key: "setExtraObjectsWith3DPositions",
|
|
157
|
+
value: function setExtraObjectsWith3DPositions(data) {
|
|
158
|
+
this.orginExtraObjects = data;
|
|
159
|
+
if (!this.data) return;
|
|
160
|
+
this.extraObjects = (0, _formatData.formatExtraObjects)(data, this.five, this.data);
|
|
161
|
+
this.render();
|
|
162
|
+
}
|
|
163
|
+
}, {
|
|
164
|
+
key: "updateSize",
|
|
165
|
+
value: function updateSize() {
|
|
166
|
+
if (!this.data || !this.wrapper) return;
|
|
167
|
+
var size = Math.min(this.wrapper.clientWidth, this.wrapper.clientHeight);
|
|
168
|
+
var _this$data$bounding = this.data.bounding,
|
|
169
|
+
max = _this$data$bounding.max,
|
|
170
|
+
min = _this$data$bounding.min;
|
|
171
|
+
var boundingWidth = max.x - min.x;
|
|
172
|
+
var boundingHeight = max.y - min.y;
|
|
173
|
+
|
|
174
|
+
var _getSize = function getSize() {
|
|
175
|
+
if (boundingWidth > boundingHeight) return [size, size / boundingWidth * boundingHeight];
|
|
176
|
+
return [size / boundingHeight * boundingWidth, size];
|
|
177
|
+
}(),
|
|
178
|
+
_getSize2 = _slicedToArray(_getSize, 2),
|
|
179
|
+
width = _getSize2[0],
|
|
180
|
+
height = _getSize2[1];
|
|
181
|
+
|
|
182
|
+
this.size = {
|
|
183
|
+
width: width,
|
|
184
|
+
height: height
|
|
185
|
+
};
|
|
186
|
+
this.pxmm = width / boundingWidth;
|
|
187
|
+
}
|
|
188
|
+
}, {
|
|
189
|
+
key: "render",
|
|
190
|
+
value: function render() {
|
|
191
|
+
if (!this.data || !this.pxmm || !this.wrapper) return;
|
|
192
|
+
|
|
193
|
+
if (!this.extraObjects && this.orginExtraObjects) {
|
|
194
|
+
this.extraObjects = (0, _formatData.formatExtraObjects)(this.orginExtraObjects, this.five, this.data);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
var props = {
|
|
198
|
+
pxmm: this.pxmm,
|
|
199
|
+
five: this.five,
|
|
200
|
+
width: this.size.width,
|
|
201
|
+
height: this.size.height,
|
|
202
|
+
floorplanData: this.data,
|
|
203
|
+
extraObjects: this.extraObjects,
|
|
204
|
+
hoverEnable: this.configs.hoverEnable,
|
|
205
|
+
cameraImage: this.configs.cameraImage
|
|
206
|
+
};
|
|
207
|
+
ReactDOM.render( /*#__PURE__*/React.createElement(_Content["default"], _extends({}, props, this.configs)), this.wrapper);
|
|
208
|
+
}
|
|
209
|
+
}]);
|
|
210
|
+
|
|
211
|
+
return PanoFloorplanRadarPluginController;
|
|
212
|
+
}();
|
|
213
|
+
|
|
214
|
+
exports["default"] = PanoFloorplanRadarPluginController;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FivePlugin } from '@realsee/five';
|
|
2
|
+
import PanoFloorplanRadarPluginController from './Controller';
|
|
3
|
+
export declare const PanoFloorplanRadarPlugin: FivePlugin<PanoFloorplanRadarPluginParameterType, PanoFloorplanRadarPluginReturnType>;
|
|
4
|
+
export default PanoFloorplanRadarPlugin;
|
|
5
|
+
export type { PanoFloorplanRadarPluginController };
|
|
6
|
+
export type { PanoFloorplanRadarPluginControllerParameter } from './Controller';
|
|
7
|
+
export declare type PanoFloorplanRadarPluginReturnType = PanoFloorplanRadarPluginController;
|
|
8
|
+
export declare type PanoFloorplanRadarPluginParameterType = ConstructorParameters<typeof PanoFloorplanRadarPluginController>[1];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.PanoFloorplanRadarPlugin = void 0;
|
|
7
|
+
|
|
8
|
+
var _Controller = _interopRequireDefault(require("./Controller"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
|
|
12
|
+
var PanoFloorplanRadarPlugin = function PanoFloorplanRadarPlugin(five, params) {
|
|
13
|
+
return new _Controller["default"](five, params);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.PanoFloorplanRadarPlugin = PanoFloorplanRadarPlugin;
|
|
17
|
+
var _default = PanoFloorplanRadarPlugin;
|
|
18
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Five } from '@realsee/five';
|
|
3
|
+
import { FloorplanServerData } from '../typings/floorplanServerData';
|
|
4
|
+
import { FloorplanRoomItem } from '../typings/floorplanData';
|
|
5
|
+
export interface TopviewFloorplanPluginParameterType {
|
|
6
|
+
selector?: string | Element;
|
|
7
|
+
scale?: number;
|
|
8
|
+
hoverEnable?: boolean;
|
|
9
|
+
autoShowEnable?: boolean;
|
|
10
|
+
cameraImage?: {
|
|
11
|
+
style: React.CSSProperties;
|
|
12
|
+
};
|
|
13
|
+
getLabelElement?: (room: FloorplanRoomItem) => Element | null;
|
|
14
|
+
}
|
|
15
|
+
export declare type TopviewFloorplanPluginReturnType = TopviewFloorplanPluginController;
|
|
16
|
+
export declare class TopviewFloorplanPluginController {
|
|
17
|
+
size: {
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
};
|
|
21
|
+
visible: boolean;
|
|
22
|
+
private five;
|
|
23
|
+
protected pxmm: number;
|
|
24
|
+
private panoIndex;
|
|
25
|
+
private floorIndex;
|
|
26
|
+
private configs;
|
|
27
|
+
private lastPanoramaLongitude;
|
|
28
|
+
private handleClick;
|
|
29
|
+
private selector?;
|
|
30
|
+
private floorplanData?;
|
|
31
|
+
private wrapper?;
|
|
32
|
+
private container;
|
|
33
|
+
constructor(five: Five, params: TopviewFloorplanPluginParameterType);
|
|
34
|
+
/** 加载户型图数据 */
|
|
35
|
+
load(data: FloorplanServerData): Promise<void>;
|
|
36
|
+
/** 把插件的渲染DOM插入到对应的容器中去 */
|
|
37
|
+
appendTo(wrapper: Element): this;
|
|
38
|
+
dispose: () => void;
|
|
39
|
+
/** 模型楼层高亮改变时,自动进行楼层切换 */
|
|
40
|
+
private onModelShownFloorChange;
|
|
41
|
+
/** panoIndex 改变时,更新 floorIndex */
|
|
42
|
+
private handlePanoArrived;
|
|
43
|
+
/** 在户型图展示时阻止 Five 的所有行为 */
|
|
44
|
+
private handleWantsGesture;
|
|
45
|
+
private handleModelLoaded;
|
|
46
|
+
/** 非 Topview 态隐藏户型图 */
|
|
47
|
+
private handleModeChange;
|
|
48
|
+
/** 动画结束后是 Topview 态就展示户型图 */
|
|
49
|
+
private handleInitAnimationEnded;
|
|
50
|
+
private show;
|
|
51
|
+
private hide;
|
|
52
|
+
/** 更新户型图大小 */
|
|
53
|
+
private updateSize;
|
|
54
|
+
private render;
|
|
55
|
+
}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.TopviewFloorplanPluginController = void 0;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
13
|
+
|
|
14
|
+
var _getPxmm = _interopRequireDefault(require("../../../shared-utils/getPxmm"));
|
|
15
|
+
|
|
16
|
+
var _components = _interopRequireDefault(require("../ModelFloorplanPlugin/components"));
|
|
17
|
+
|
|
18
|
+
var _changeModelCanvansOpacity = _interopRequireDefault(require("../../../shared-utils/changeModelCanvansOpacity"));
|
|
19
|
+
|
|
20
|
+
var _style = require("./style");
|
|
21
|
+
|
|
22
|
+
var _filter = require("../../../shared-utils/filter");
|
|
23
|
+
|
|
24
|
+
var _formatData = _interopRequireDefault(require("../utils/formatData"));
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
+
|
|
28
|
+
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); }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
33
|
+
|
|
34
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
35
|
+
|
|
36
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
37
|
+
|
|
38
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
39
|
+
|
|
40
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
41
|
+
|
|
42
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
43
|
+
|
|
44
|
+
var TopviewFloorplanPluginController = /*#__PURE__*/function () {
|
|
45
|
+
function TopviewFloorplanPluginController(five, params) {
|
|
46
|
+
var _this = this;
|
|
47
|
+
|
|
48
|
+
_classCallCheck(this, TopviewFloorplanPluginController);
|
|
49
|
+
|
|
50
|
+
_defineProperty(this, "size", {
|
|
51
|
+
width: 0,
|
|
52
|
+
height: 0
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
_defineProperty(this, "visible", false);
|
|
56
|
+
|
|
57
|
+
_defineProperty(this, "pxmm", 0);
|
|
58
|
+
|
|
59
|
+
_defineProperty(this, "panoIndex", 0);
|
|
60
|
+
|
|
61
|
+
_defineProperty(this, "floorIndex", 0);
|
|
62
|
+
|
|
63
|
+
_defineProperty(this, "configs", {});
|
|
64
|
+
|
|
65
|
+
_defineProperty(this, "lastPanoramaLongitude", 0);
|
|
66
|
+
|
|
67
|
+
_defineProperty(this, "handleClick", function () {
|
|
68
|
+
return false;
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
_defineProperty(this, "container", document.createElement('div'));
|
|
72
|
+
|
|
73
|
+
_defineProperty(this, "dispose", function () {
|
|
74
|
+
var _this$container;
|
|
75
|
+
|
|
76
|
+
_this.hide();
|
|
77
|
+
|
|
78
|
+
_this.container && _reactDom["default"].unmountComponentAtNode(_this.container);
|
|
79
|
+
(_this$container = _this.container) === null || _this$container === void 0 ? void 0 : _this$container.remove();
|
|
80
|
+
|
|
81
|
+
_this.five.off('modeChange', _this.handleModeChange);
|
|
82
|
+
|
|
83
|
+
_this.five.off('panoArrived', _this.handlePanoArrived);
|
|
84
|
+
|
|
85
|
+
_this.five.off('modelLoaded', _this.handleModelLoaded);
|
|
86
|
+
|
|
87
|
+
_this.five.off('wantsGesture', _this.handleWantsGesture);
|
|
88
|
+
|
|
89
|
+
_this.five.off('initAnimationEnded', _this.handleInitAnimationEnded);
|
|
90
|
+
|
|
91
|
+
_this.five.off('modelShownFloorChange', _this.onModelShownFloorChange);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
_defineProperty(this, "onModelShownFloorChange", function (shownFloor) {
|
|
95
|
+
if (shownFloor === null) return;
|
|
96
|
+
_this.floorIndex = shownFloor;
|
|
97
|
+
|
|
98
|
+
_this.render();
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
_defineProperty(this, "handlePanoArrived", function (index) {
|
|
102
|
+
var _this$five;
|
|
103
|
+
|
|
104
|
+
if (!((_this$five = _this.five) !== null && _this$five !== void 0 && _this$five.work)) return;
|
|
105
|
+
_this.panoIndex = index;
|
|
106
|
+
_this.floorIndex = _this.five.work.observers[index].floorIndex;
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
_defineProperty(this, "handleWantsGesture", function () {
|
|
110
|
+
if (!_this.visible) return;
|
|
111
|
+
return false;
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
_defineProperty(this, "handleModelLoaded", function () {
|
|
115
|
+
if (_this.wrapper) return;
|
|
116
|
+
if (!_this.selector) return;
|
|
117
|
+
var wrapper = _this.selector instanceof Element ? _this.selector : document.querySelector(_this.selector);
|
|
118
|
+
if (!wrapper) throw new Error('不正确的父容器选择器');
|
|
119
|
+
_this.wrapper = wrapper;
|
|
120
|
+
wrapper.append(_this.container);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
_defineProperty(this, "handleModeChange", function (mode) {
|
|
124
|
+
if (mode !== 'Topview') return _this.hide();
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
_defineProperty(this, "handleInitAnimationEnded", function () {
|
|
128
|
+
var _this$five$getCurrent = _this.five.getCurrentState(),
|
|
129
|
+
mode = _this$five$getCurrent.mode;
|
|
130
|
+
|
|
131
|
+
if (mode === 'Topview') _this.show();
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
_defineProperty(this, "updateSize", function () {
|
|
135
|
+
if (!_this.floorplanData) return;
|
|
136
|
+
if (!_this.container || !_this.wrapper) return;
|
|
137
|
+
if (_this.five.getCurrentState().mode !== 'Topview') return; // 计算户型图展示大小
|
|
138
|
+
|
|
139
|
+
var _this$floorplanData$b = _this.floorplanData.bounding,
|
|
140
|
+
min = _this$floorplanData$b.min,
|
|
141
|
+
max = _this$floorplanData$b.max;
|
|
142
|
+
var width = max.x - min.x;
|
|
143
|
+
var height = max.y - min.y; // 每毫米对应的 px 值
|
|
144
|
+
|
|
145
|
+
var pxmm = (0, _getPxmm["default"])(_this.five, _this.wrapper);
|
|
146
|
+
|
|
147
|
+
var _width = Math.ceil(width * pxmm);
|
|
148
|
+
|
|
149
|
+
var _height = Math.ceil(height * pxmm);
|
|
150
|
+
|
|
151
|
+
_this.pxmm = pxmm;
|
|
152
|
+
_this.size = {
|
|
153
|
+
width: _width,
|
|
154
|
+
height: _height
|
|
155
|
+
};
|
|
156
|
+
_this.container.style.width = _width + 'px';
|
|
157
|
+
_this.container.style.height = _height + 'px';
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
this.five = five;
|
|
161
|
+
this.selector = params.selector;
|
|
162
|
+
this.configs = (0, _filter.omit)(params, ['selector']); // 设置 container 样式
|
|
163
|
+
|
|
164
|
+
this.container.classList.add('floorplan-plugin');
|
|
165
|
+
Object.assign(this.container.style, _style.pluginStyle); // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
|
|
166
|
+
|
|
167
|
+
this.five.model.loaded ? this.handleModelLoaded() : five.once('modelLoaded', this.handleModelLoaded);
|
|
168
|
+
this.five.once('dispose', this.dispose);
|
|
169
|
+
this.five.on('modeChange', this.handleModeChange);
|
|
170
|
+
this.five.on('panoArrived', this.handlePanoArrived);
|
|
171
|
+
this.five.on('initAnimationEnded', this.handleInitAnimationEnded);
|
|
172
|
+
this.five.on('modelShownFloorChange', this.onModelShownFloorChange);
|
|
173
|
+
}
|
|
174
|
+
/** 加载户型图数据 */
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
_createClass(TopviewFloorplanPluginController, [{
|
|
178
|
+
key: "load",
|
|
179
|
+
value: function () {
|
|
180
|
+
var _load = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(data) {
|
|
181
|
+
var copyData;
|
|
182
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
183
|
+
while (1) {
|
|
184
|
+
switch (_context.prev = _context.next) {
|
|
185
|
+
case 0:
|
|
186
|
+
copyData = JSON.parse(JSON.stringify(data));
|
|
187
|
+
_context.next = 3;
|
|
188
|
+
return (0, _formatData["default"])(copyData);
|
|
189
|
+
|
|
190
|
+
case 3:
|
|
191
|
+
this.floorplanData = _context.sent;
|
|
192
|
+
this.render();
|
|
193
|
+
|
|
194
|
+
case 5:
|
|
195
|
+
case "end":
|
|
196
|
+
return _context.stop();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}, _callee, this);
|
|
200
|
+
}));
|
|
201
|
+
|
|
202
|
+
function load(_x) {
|
|
203
|
+
return _load.apply(this, arguments);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return load;
|
|
207
|
+
}()
|
|
208
|
+
/** 把插件的渲染DOM插入到对应的容器中去 */
|
|
209
|
+
|
|
210
|
+
}, {
|
|
211
|
+
key: "appendTo",
|
|
212
|
+
value: function appendTo(wrapper) {
|
|
213
|
+
this.wrapper = wrapper;
|
|
214
|
+
wrapper.appendChild(this.container);
|
|
215
|
+
return this;
|
|
216
|
+
}
|
|
217
|
+
}, {
|
|
218
|
+
key: "show",
|
|
219
|
+
value: function show() {
|
|
220
|
+
var modelOpacity = 0.01;
|
|
221
|
+
var renderDuration = 500;
|
|
222
|
+
this.visible = true;
|
|
223
|
+
this.updateSize();
|
|
224
|
+
this.render(renderDuration);
|
|
225
|
+
(0, _changeModelCanvansOpacity["default"])(this.five, modelOpacity, renderDuration);
|
|
226
|
+
this.five.on('wantsGesture', this.handleWantsGesture);
|
|
227
|
+
}
|
|
228
|
+
}, {
|
|
229
|
+
key: "hide",
|
|
230
|
+
value: function hide() {
|
|
231
|
+
var modelOpacity = 1;
|
|
232
|
+
var renderDuration = 0;
|
|
233
|
+
this.visible = false;
|
|
234
|
+
(0, _changeModelCanvansOpacity["default"])(this.five, modelOpacity, renderDuration);
|
|
235
|
+
this.render();
|
|
236
|
+
this.five.off('wantsGesture', this.handleWantsGesture);
|
|
237
|
+
}
|
|
238
|
+
/** 更新户型图大小 */
|
|
239
|
+
|
|
240
|
+
}, {
|
|
241
|
+
key: "render",
|
|
242
|
+
value: function render(duration) {
|
|
243
|
+
if (!this.container) return;
|
|
244
|
+
if (this.size.width === 0) return;
|
|
245
|
+
var props = {
|
|
246
|
+
five: this.five,
|
|
247
|
+
pxmm: this.pxmm,
|
|
248
|
+
visible: this.visible,
|
|
249
|
+
duration: duration || 0,
|
|
250
|
+
panoIndex: this.panoIndex,
|
|
251
|
+
floorIndex: this.floorIndex,
|
|
252
|
+
floorplanData: this.floorplanData,
|
|
253
|
+
onRoomHeightClick: this.handleClick,
|
|
254
|
+
cameraImage: this.configs.cameraImage,
|
|
255
|
+
hoverEnable: this.configs.hoverEnable,
|
|
256
|
+
getLabelElement: this.configs.getLabelElement,
|
|
257
|
+
lastPanoramaLongitude: this.lastPanoramaLongitude
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
_reactDom["default"].render( /*#__PURE__*/React.createElement(_components["default"], props), this.container);
|
|
261
|
+
}
|
|
262
|
+
}]);
|
|
263
|
+
|
|
264
|
+
return TopviewFloorplanPluginController;
|
|
265
|
+
}();
|
|
266
|
+
|
|
267
|
+
exports.TopviewFloorplanPluginController = TopviewFloorplanPluginController;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FivePlugin } from '@realsee/five';
|
|
2
|
+
import { TopviewFloorplanPluginParameterType, TopviewFloorplanPluginReturnType } from './Controller';
|
|
3
|
+
export declare const TopviewFloorplanPlugin: FivePlugin<TopviewFloorplanPluginParameterType, TopviewFloorplanPluginReturnType>;
|
|
4
|
+
export default TopviewFloorplanPlugin;
|
|
5
|
+
export type { TopviewFloorplanPluginReturnType, TopviewFloorplanPluginParameterType } from './Controller';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.TopviewFloorplanPlugin = void 0;
|
|
7
|
+
|
|
8
|
+
var _Controller = require("./Controller");
|
|
9
|
+
|
|
10
|
+
var TopviewFloorplanPlugin = function TopviewFloorplanPlugin(five, params) {
|
|
11
|
+
return new _Controller.TopviewFloorplanPluginController(five, params);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.TopviewFloorplanPlugin = TopviewFloorplanPlugin;
|
|
15
|
+
var _default = TopviewFloorplanPlugin;
|
|
16
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pluginStyle: Partial<CSSStyleDeclaration>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.pluginStyle = void 0;
|
|
7
|
+
var pluginStyle = {
|
|
8
|
+
position: 'absolute',
|
|
9
|
+
left: '50%',
|
|
10
|
+
top: '50%',
|
|
11
|
+
transform: 'translate(-50%, -50%)',
|
|
12
|
+
pointerEvents: 'none'
|
|
13
|
+
};
|
|
14
|
+
exports.pluginStyle = pluginStyle;
|