@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,643 @@
|
|
|
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"] = exports.MODEL_FLOORPLAN_PLUGIN_NAME = void 0;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _components = _interopRequireDefault(require("./components"));
|
|
13
|
+
|
|
14
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
15
|
+
|
|
16
|
+
var _to = _interopRequireDefault(require("../../../shared-utils/to"));
|
|
17
|
+
|
|
18
|
+
var _formatData = _interopRequireDefault(require("../utils/formatData"));
|
|
19
|
+
|
|
20
|
+
var _equal = _interopRequireDefault(require("../../../shared-utils/equal"));
|
|
21
|
+
|
|
22
|
+
var _getPxmm = _interopRequireDefault(require("../../../shared-utils/getPxmm"));
|
|
23
|
+
|
|
24
|
+
var _correctFiveState = _interopRequireWildcard(require("./utils/correctFiveState"));
|
|
25
|
+
|
|
26
|
+
var _changeModelCanvansOpacity = _interopRequireDefault(require("../../../shared-utils/changeModelCanvansOpacity"));
|
|
27
|
+
|
|
28
|
+
var _controller = require("./controller.style");
|
|
29
|
+
|
|
30
|
+
var _filter = require("../../../shared-utils/filter");
|
|
31
|
+
|
|
32
|
+
var _five2 = require("@realsee/five");
|
|
33
|
+
|
|
34
|
+
var _constant = require("./utils/constant");
|
|
35
|
+
|
|
36
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
37
|
+
|
|
38
|
+
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); }
|
|
39
|
+
|
|
40
|
+
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; }
|
|
41
|
+
|
|
42
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
43
|
+
|
|
44
|
+
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."); }
|
|
45
|
+
|
|
46
|
+
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); }
|
|
47
|
+
|
|
48
|
+
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; }
|
|
49
|
+
|
|
50
|
+
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; }
|
|
51
|
+
|
|
52
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
53
|
+
|
|
54
|
+
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); } }
|
|
55
|
+
|
|
56
|
+
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); }); }; }
|
|
57
|
+
|
|
58
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
59
|
+
|
|
60
|
+
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); } }
|
|
61
|
+
|
|
62
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
63
|
+
|
|
64
|
+
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; }
|
|
65
|
+
|
|
66
|
+
var MODEL_FLOORPLAN_PLUGIN_NAME = 'modelFloorplanPlugin';
|
|
67
|
+
exports.MODEL_FLOORPLAN_PLUGIN_NAME = MODEL_FLOORPLAN_PLUGIN_NAME;
|
|
68
|
+
|
|
69
|
+
var ModelFloorplanPluginController = /*#__PURE__*/function () {
|
|
70
|
+
/** 展示状态 */
|
|
71
|
+
|
|
72
|
+
/** 户型图大小 */
|
|
73
|
+
function ModelFloorplanPluginController(_five, params) {
|
|
74
|
+
var _this = this,
|
|
75
|
+
_params$scale;
|
|
76
|
+
|
|
77
|
+
_classCallCheck(this, ModelFloorplanPluginController);
|
|
78
|
+
|
|
79
|
+
_defineProperty(this, "name", MODEL_FLOORPLAN_PLUGIN_NAME);
|
|
80
|
+
|
|
81
|
+
_defineProperty(this, "visible", false);
|
|
82
|
+
|
|
83
|
+
_defineProperty(this, "size", {
|
|
84
|
+
width: 0,
|
|
85
|
+
height: 0
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
_defineProperty(this, "pxmm", 0);
|
|
89
|
+
|
|
90
|
+
_defineProperty(this, "panoIndex", 0);
|
|
91
|
+
|
|
92
|
+
_defineProperty(this, "floorIndex", 0);
|
|
93
|
+
|
|
94
|
+
_defineProperty(this, "configs", {});
|
|
95
|
+
|
|
96
|
+
_defineProperty(this, "lastPanoramaLongitude", 0);
|
|
97
|
+
|
|
98
|
+
_defineProperty(this, "container", document.createElement('div'));
|
|
99
|
+
|
|
100
|
+
_defineProperty(this, "dispose", function () {
|
|
101
|
+
var _this$container;
|
|
102
|
+
|
|
103
|
+
var five = _this.five;
|
|
104
|
+
|
|
105
|
+
_this.hide();
|
|
106
|
+
|
|
107
|
+
_this.container && _reactDom["default"].unmountComponentAtNode(_this.container);
|
|
108
|
+
(_this$container = _this.container) === null || _this$container === void 0 ? void 0 : _this$container.remove();
|
|
109
|
+
five.off('modelLoaded', _this.handleModelLoaded);
|
|
110
|
+
five.off('modeChange', _this.handleModeChange);
|
|
111
|
+
five.off('panGesture', _this.handlePanGesture);
|
|
112
|
+
five.off('panoArrived', _this.handlePanoArrived);
|
|
113
|
+
five.off('wantsChangeMode', _this.handleWantsChangeMode);
|
|
114
|
+
five.off('wantsInteriaPan', _this.handleWantsInteriaPan);
|
|
115
|
+
five.off('wantsTapGesture', _this.handleWantsTapGesture);
|
|
116
|
+
five.off('modelShownFloorChange', _this.onModelShownFloorChange);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
_defineProperty(this, "updateSize", function () {
|
|
120
|
+
if (!_this.floorplanData) return;
|
|
121
|
+
if (!(0, _correctFiveState.checkShowState)(_this.five, _this.showState)) return;
|
|
122
|
+
if (!_this.container || !_this.wrapper) return; // 计算户型图展示大小
|
|
123
|
+
|
|
124
|
+
var _this$floorplanData$b = _this.floorplanData.bounding,
|
|
125
|
+
min = _this$floorplanData$b.min,
|
|
126
|
+
max = _this$floorplanData$b.max;
|
|
127
|
+
var width = max.x - min.x;
|
|
128
|
+
var height = max.y - min.y; // 每毫米对应的 px 值
|
|
129
|
+
|
|
130
|
+
var pxmm = (0, _getPxmm["default"])(_this.five, _this.wrapper);
|
|
131
|
+
|
|
132
|
+
var _width = Math.ceil(width * pxmm);
|
|
133
|
+
|
|
134
|
+
var _height = Math.ceil(height * pxmm);
|
|
135
|
+
|
|
136
|
+
if (_this.size.width === _width && _this.size.height === _height) return;
|
|
137
|
+
_this.pxmm = pxmm;
|
|
138
|
+
_this.size = {
|
|
139
|
+
width: _width,
|
|
140
|
+
height: _height
|
|
141
|
+
};
|
|
142
|
+
_this.container.style.width = _width + 'px';
|
|
143
|
+
_this.container.style.height = _height + 'px';
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
_defineProperty(this, "show", /*#__PURE__*/function () {
|
|
147
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(opts) {
|
|
148
|
+
var _this$five$model;
|
|
149
|
+
|
|
150
|
+
var _this$showRejection, sameWithLastOpts, showPromise;
|
|
151
|
+
|
|
152
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
153
|
+
while (1) {
|
|
154
|
+
switch (_context2.prev = _context2.next) {
|
|
155
|
+
case 0:
|
|
156
|
+
if (!(!_this.showPromise && _this.visible)) {
|
|
157
|
+
_context2.next = 2;
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return _context2.abrupt("return", true);
|
|
162
|
+
|
|
163
|
+
case 2:
|
|
164
|
+
if ((_this$five$model = _this.five.model) !== null && _this$five$model !== void 0 && _this$five$model.loaded) {
|
|
165
|
+
_context2.next = 4;
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
throw new Error(_constant.FloorplanErrorType.ModelNotLoaded);
|
|
170
|
+
|
|
171
|
+
case 4:
|
|
172
|
+
if (_this.floorplanData) {
|
|
173
|
+
_context2.next = 6;
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
throw new Error(_constant.FloorplanErrorType.DataNotLoaded);
|
|
178
|
+
|
|
179
|
+
case 6:
|
|
180
|
+
_this.visible = true;
|
|
181
|
+
|
|
182
|
+
if (!_this.showPromise) {
|
|
183
|
+
_context2.next = 12;
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
sameWithLastOpts = (0, _equal["default"])(opts, _this.ModelFloorplanPluginsShowOpts, {
|
|
188
|
+
deep: false
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
if (!(!!_this.showPromise && sameWithLastOpts)) {
|
|
192
|
+
_context2.next = 11;
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return _context2.abrupt("return", _this.showPromise);
|
|
197
|
+
|
|
198
|
+
case 11:
|
|
199
|
+
if (!!_this.showPromise && !sameWithLastOpts) (_this$showRejection = _this.showRejection) === null || _this$showRejection === void 0 ? void 0 : _this$showRejection.call(_this, _constant.FloorplanErrorType.DifferentShowParams);
|
|
200
|
+
|
|
201
|
+
case 12:
|
|
202
|
+
_this.ModelFloorplanPluginsShowOpts = opts;
|
|
203
|
+
showPromise = new Promise( /*#__PURE__*/function () {
|
|
204
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(resolve, reject) {
|
|
205
|
+
var _opts$modelOpacity;
|
|
206
|
+
|
|
207
|
+
var hasRejected, _yield$to, _yield$to2, correctError, modelOpacity, renderDuration;
|
|
208
|
+
|
|
209
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
210
|
+
while (1) {
|
|
211
|
+
switch (_context.prev = _context.next) {
|
|
212
|
+
case 0:
|
|
213
|
+
hasRejected = false;
|
|
214
|
+
|
|
215
|
+
_this.showRejection = function (errorMsg) {
|
|
216
|
+
hasRejected = true;
|
|
217
|
+
reject(errorMsg ? new Error(errorMsg) : new Error(_constant.FloorplanErrorType.UnknowError));
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
_context.next = 4;
|
|
221
|
+
return (0, _to["default"])((0, _correctFiveState["default"])(_this.five, _this.showState, opts === null || opts === void 0 ? void 0 : opts.userAction));
|
|
222
|
+
|
|
223
|
+
case 4:
|
|
224
|
+
_yield$to = _context.sent;
|
|
225
|
+
_yield$to2 = _slicedToArray(_yield$to, 1);
|
|
226
|
+
correctError = _yield$to2[0];
|
|
227
|
+
|
|
228
|
+
if (!correctError) {
|
|
229
|
+
_context.next = 9;
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return _context.abrupt("return", reject(correctError));
|
|
234
|
+
|
|
235
|
+
case 9:
|
|
236
|
+
if (!hasRejected) {
|
|
237
|
+
_context.next = 11;
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
return _context.abrupt("return", reject(new Error(_constant.FloorplanErrorType.UnknowError)));
|
|
242
|
+
|
|
243
|
+
case 11:
|
|
244
|
+
if (_this.visible) {
|
|
245
|
+
_context.next = 13;
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return _context.abrupt("return", reject(new Error(_constant.FloorplanErrorType.UnknowError)));
|
|
250
|
+
|
|
251
|
+
case 13:
|
|
252
|
+
// 更新户型图状态
|
|
253
|
+
_this.visible = true; // 更新户型图大小
|
|
254
|
+
|
|
255
|
+
_this.updateSize(); // 高亮当前楼层,有两个目的
|
|
256
|
+
// 1. 点击模型时,可以跳转到当前楼层的点位上
|
|
257
|
+
// 2. 当前楼层比较小时,户型图也比较小,如果展示全部楼层,会展示户型图外有一圈模型
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
if (opts !== null && opts !== void 0 && opts.floorIndex) _this.floorIndex = opts.floorIndex;
|
|
261
|
+
|
|
262
|
+
_this.five.model.show(_this.floorIndex); // 模型消失, 渲染户型图
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
modelOpacity = (_opts$modelOpacity = opts === null || opts === void 0 ? void 0 : opts.modelOpacity) !== null && _opts$modelOpacity !== void 0 ? _opts$modelOpacity : 0.01;
|
|
266
|
+
renderDuration = opts !== null && opts !== void 0 && opts.immediatily ? 0 : _constant.SHOW_ANIME_DURATION;
|
|
267
|
+
(0, _changeModelCanvansOpacity["default"])(_this.five, modelOpacity, renderDuration);
|
|
268
|
+
|
|
269
|
+
_this.render(renderDuration); // 展示之后的事件监听
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
_this.five.on('wantsGesture', _this.handleWantsGesture);
|
|
273
|
+
|
|
274
|
+
_this.five.on('wantsTapGesture', _this.handleWantsTapGesture);
|
|
275
|
+
|
|
276
|
+
return _context.abrupt("return", resolve(true));
|
|
277
|
+
|
|
278
|
+
case 24:
|
|
279
|
+
case "end":
|
|
280
|
+
return _context.stop();
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}, _callee);
|
|
284
|
+
}));
|
|
285
|
+
|
|
286
|
+
return function (_x2, _x3) {
|
|
287
|
+
return _ref2.apply(this, arguments);
|
|
288
|
+
};
|
|
289
|
+
}()).then(function () {
|
|
290
|
+
var _opts$userAction;
|
|
291
|
+
|
|
292
|
+
_this.hooks.emit('showAnimationEnded', {
|
|
293
|
+
auto: !!(opts !== null && opts !== void 0 && opts.isAutoShow),
|
|
294
|
+
userAction: (_opts$userAction = opts === null || opts === void 0 ? void 0 : opts.userAction) !== null && _opts$userAction !== void 0 ? _opts$userAction : true
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
return true;
|
|
298
|
+
})["catch"](function (error) {
|
|
299
|
+
// 自动展示的报错内部处理
|
|
300
|
+
if (opts !== null && opts !== void 0 && opts.isAutoShow) return false;
|
|
301
|
+
if (!(error instanceof Error)) return false; // 非自动展示的报错继续向外抛出
|
|
302
|
+
|
|
303
|
+
throw error;
|
|
304
|
+
})["finally"](function () {
|
|
305
|
+
_this.showPromise = void 0;
|
|
306
|
+
_this.showRejection = void 0;
|
|
307
|
+
});
|
|
308
|
+
_this.showPromise = showPromise;
|
|
309
|
+
return _context2.abrupt("return", showPromise);
|
|
310
|
+
|
|
311
|
+
case 16:
|
|
312
|
+
case "end":
|
|
313
|
+
return _context2.stop();
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}, _callee2);
|
|
317
|
+
}));
|
|
318
|
+
|
|
319
|
+
return function (_x) {
|
|
320
|
+
return _ref.apply(this, arguments);
|
|
321
|
+
};
|
|
322
|
+
}());
|
|
323
|
+
|
|
324
|
+
_defineProperty(this, "hide", function (options) {
|
|
325
|
+
var _this$showRejection2, _options$userAction;
|
|
326
|
+
|
|
327
|
+
if (_this.size.width === 0) return true;
|
|
328
|
+
if (_this.visible === false) return true;
|
|
329
|
+
var isAutoHide = !!(options !== null && options !== void 0 && options.isAutoHide);
|
|
330
|
+
|
|
331
|
+
_this.five.off('wantsGesture', _this.handleWantsGesture);
|
|
332
|
+
|
|
333
|
+
_this.five.off('wantsTapGesture', _this.handleWantsTapGesture);
|
|
334
|
+
|
|
335
|
+
_this.visible = false;
|
|
336
|
+
(_this$showRejection2 = _this.showRejection) === null || _this$showRejection2 === void 0 ? void 0 : _this$showRejection2.call(_this, _constant.FloorplanErrorType.BreakOffByHide);
|
|
337
|
+
(0, _changeModelCanvansOpacity["default"])(_this.five, 1, 0);
|
|
338
|
+
|
|
339
|
+
_this.render();
|
|
340
|
+
|
|
341
|
+
_this.hooks.emit('hide', {
|
|
342
|
+
auto: isAutoHide,
|
|
343
|
+
userAction: (_options$userAction = options === null || options === void 0 ? void 0 : options.userAction) !== null && _options$userAction !== void 0 ? _options$userAction : true
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
return true;
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
_defineProperty(this, "onModelShownFloorChange", function (shownFloor) {
|
|
350
|
+
if (shownFloor === null) return;
|
|
351
|
+
_this.floorIndex = shownFloor;
|
|
352
|
+
|
|
353
|
+
_this.render();
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
_defineProperty(this, "handleModelLoaded", function () {
|
|
357
|
+
if (_this.wrapper) return;
|
|
358
|
+
if (!_this.selector) return;
|
|
359
|
+
var wrapper = _this.selector instanceof Element ? _this.selector : document.querySelector(_this.selector);
|
|
360
|
+
if (!wrapper) throw new Error('不正确的父容器选择器');
|
|
361
|
+
_this.wrapper = wrapper;
|
|
362
|
+
wrapper.append(_this.container);
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
_defineProperty(this, "handleClick", function () {
|
|
366
|
+
if (!_this.visible) return;
|
|
367
|
+
|
|
368
|
+
var prevented = _this.hooks.emit('click');
|
|
369
|
+
|
|
370
|
+
if (prevented) return false;
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
_defineProperty(this, "handleWantsTapGesture", function () {
|
|
374
|
+
return _this.handleClick();
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
_defineProperty(this, "handleWantsChangeMode", function (mode) {
|
|
378
|
+
if (mode !== 'Panorama') {
|
|
379
|
+
_this.lastPanoramaLongitude = _this.five.getCurrentState().longitude;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
if (mode !== 'Floorplan') _this.hide();
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
_defineProperty(this, "handleModeChange", function (mode) {
|
|
386
|
+
if (mode === 'Floorplan') {
|
|
387
|
+
_this.five.on('panGesture', _this.handlePanGesture);
|
|
388
|
+
} else {
|
|
389
|
+
_this.hide();
|
|
390
|
+
|
|
391
|
+
_this.five.off('panGesture', _this.handlePanGesture);
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
_defineProperty(this, "handlePanoArrived", function (index) {
|
|
396
|
+
var _this$five;
|
|
397
|
+
|
|
398
|
+
if (!((_this$five = _this.five) !== null && _this$five !== void 0 && _this$five.work)) return;
|
|
399
|
+
_this.panoIndex = index;
|
|
400
|
+
_this.floorIndex = _this.five.work.observers[index].floorIndex;
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
_defineProperty(this, "handleWantsInteriaPan", function () {
|
|
404
|
+
if (_this.visible) return false;
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
_defineProperty(this, "handleWantsGesture", function (type, pointers) {
|
|
408
|
+
if (!_this.visible) return;
|
|
409
|
+
if (pointers.length > 1) return false;
|
|
410
|
+
if (type === 'mouseWheel') return false;
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
_defineProperty(this, "handlePanGesture", /*#__PURE__*/function () {
|
|
414
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(_ref3, isFinal) {
|
|
415
|
+
var latitude, longitude, latitudeHide, longitudeHide, canHide, latitudeVisible, longitudeVisible, handleInteriaPan;
|
|
416
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
417
|
+
while (1) {
|
|
418
|
+
switch (_context4.prev = _context4.next) {
|
|
419
|
+
case 0:
|
|
420
|
+
latitude = _ref3.latitude, longitude = _ref3.longitude;
|
|
421
|
+
|
|
422
|
+
if (!(_this.configs.autoShowEnable === false)) {
|
|
423
|
+
_context4.next = 3;
|
|
424
|
+
break;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
return _context4.abrupt("return");
|
|
428
|
+
|
|
429
|
+
case 3:
|
|
430
|
+
if (!(isFinal && _this.visible)) {
|
|
431
|
+
_context4.next = 5;
|
|
432
|
+
break;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
return _context4.abrupt("return", _this.five.setState(_this.showState, true));
|
|
436
|
+
|
|
437
|
+
case 5:
|
|
438
|
+
// 满足消失的条件:
|
|
439
|
+
// 水平旋转角大于正负 5 度 || 俯仰角度大于 5 度
|
|
440
|
+
latitudeHide = Math.abs(latitude - Math.PI / 2) > 5 * Math.PI / 180;
|
|
441
|
+
longitudeHide = longitude > 5 * (Math.PI / 180) && longitude < 355 * (Math.PI / 180);
|
|
442
|
+
canHide = latitudeHide || longitudeHide;
|
|
443
|
+
|
|
444
|
+
if (!(_this.visible && canHide)) {
|
|
445
|
+
_context4.next = 10;
|
|
446
|
+
break;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
return _context4.abrupt("return", _this.hide({
|
|
450
|
+
isAutoHide: true
|
|
451
|
+
}));
|
|
452
|
+
|
|
453
|
+
case 10:
|
|
454
|
+
if (!(_this.five.camera.fov / _constant.FIVE_CAMERA_DEFAULT_FOV < 0.8)) {
|
|
455
|
+
_context4.next = 12;
|
|
456
|
+
break;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
return _context4.abrupt("return");
|
|
460
|
+
|
|
461
|
+
case 12:
|
|
462
|
+
// 户型图展示条件:
|
|
463
|
+
// 水平旋转角正负 30 度 && 俯仰角度小于 10 度
|
|
464
|
+
latitudeVisible = Math.abs(latitude - Math.PI / 2) < 10 * Math.PI / 180;
|
|
465
|
+
longitudeVisible = longitude < 30 * (Math.PI / 180) || longitude > 330 * (Math.PI / 180);
|
|
466
|
+
|
|
467
|
+
if (!(isFinal && !_this.visible && latitudeVisible && longitudeVisible)) {
|
|
468
|
+
_context4.next = 18;
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// 当手指离开时需要等惯性结束之后在进行判断
|
|
473
|
+
handleInteriaPan = /*#__PURE__*/function () {
|
|
474
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(any, isFinal) {
|
|
475
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
476
|
+
while (1) {
|
|
477
|
+
switch (_context3.prev = _context3.next) {
|
|
478
|
+
case 0:
|
|
479
|
+
if (isFinal) {
|
|
480
|
+
_context3.next = 2;
|
|
481
|
+
break;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
return _context3.abrupt("return");
|
|
485
|
+
|
|
486
|
+
case 2:
|
|
487
|
+
_this.five.off('interiaPan', handleInteriaPan);
|
|
488
|
+
|
|
489
|
+
_context3.next = 5;
|
|
490
|
+
return _this.show({
|
|
491
|
+
isAutoShow: true
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
case 5:
|
|
495
|
+
case "end":
|
|
496
|
+
return _context3.stop();
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}, _callee3);
|
|
500
|
+
}));
|
|
501
|
+
|
|
502
|
+
return function handleInteriaPan(_x6, _x7) {
|
|
503
|
+
return _ref5.apply(this, arguments);
|
|
504
|
+
};
|
|
505
|
+
}();
|
|
506
|
+
|
|
507
|
+
_this.five.on('interiaPan', handleInteriaPan);
|
|
508
|
+
|
|
509
|
+
return _context4.abrupt("return");
|
|
510
|
+
|
|
511
|
+
case 18:
|
|
512
|
+
case "end":
|
|
513
|
+
return _context4.stop();
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}, _callee4);
|
|
517
|
+
}));
|
|
518
|
+
|
|
519
|
+
return function (_x4, _x5) {
|
|
520
|
+
return _ref4.apply(this, arguments);
|
|
521
|
+
};
|
|
522
|
+
}());
|
|
523
|
+
|
|
524
|
+
this.five = _five;
|
|
525
|
+
this.hooks = new _five2.Subscribe();
|
|
526
|
+
this.selector = params.selector;
|
|
527
|
+
this.configs = (0, _filter.omit)(params, ['selector']);
|
|
528
|
+
this.showState = {
|
|
529
|
+
longitude: 0,
|
|
530
|
+
latitude: Math.PI / 2,
|
|
531
|
+
fov: _constant.FIVE_CAMERA_DEFAULT_FOV / ((_params$scale = params === null || params === void 0 ? void 0 : params.scale) !== null && _params$scale !== void 0 ? _params$scale : 1)
|
|
532
|
+
}; // 设置 container 样式
|
|
533
|
+
|
|
534
|
+
this.container.classList.add('floorplan-plugin');
|
|
535
|
+
Object.assign(this.container.style, _controller.pluginStyle); // 如果初始化的时候模型已经加载完毕了,就不用再等 modelLoaded
|
|
536
|
+
|
|
537
|
+
this.five.model.loaded ? this.handleModelLoaded() : _five.once('modelLoaded', this.handleModelLoaded);
|
|
538
|
+
|
|
539
|
+
_five.once('dispose', this.dispose);
|
|
540
|
+
|
|
541
|
+
_five.on('modeChange', this.handleModeChange);
|
|
542
|
+
|
|
543
|
+
_five.on('panGesture', this.handlePanGesture);
|
|
544
|
+
|
|
545
|
+
_five.on('panoArrived', this.handlePanoArrived);
|
|
546
|
+
|
|
547
|
+
_five.on('wantsChangeMode', this.handleWantsChangeMode);
|
|
548
|
+
|
|
549
|
+
_five.on('wantsInteriaPan', this.handleWantsInteriaPan);
|
|
550
|
+
|
|
551
|
+
_five.on('modelShownFloorChange', this.onModelShownFloorChange);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
_createClass(ModelFloorplanPluginController, [{
|
|
555
|
+
key: "load",
|
|
556
|
+
value:
|
|
557
|
+
/** 加载户型图数据 */
|
|
558
|
+
function () {
|
|
559
|
+
var _load = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(data) {
|
|
560
|
+
var copyData;
|
|
561
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
562
|
+
while (1) {
|
|
563
|
+
switch (_context5.prev = _context5.next) {
|
|
564
|
+
case 0:
|
|
565
|
+
copyData = JSON.parse(JSON.stringify(data));
|
|
566
|
+
_context5.next = 3;
|
|
567
|
+
return (0, _formatData["default"])(copyData);
|
|
568
|
+
|
|
569
|
+
case 3:
|
|
570
|
+
this.floorplanData = _context5.sent;
|
|
571
|
+
this.render();
|
|
572
|
+
|
|
573
|
+
case 5:
|
|
574
|
+
case "end":
|
|
575
|
+
return _context5.stop();
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}, _callee5, this);
|
|
579
|
+
}));
|
|
580
|
+
|
|
581
|
+
function load(_x8) {
|
|
582
|
+
return _load.apply(this, arguments);
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
return load;
|
|
586
|
+
}()
|
|
587
|
+
/** 把插件的渲染DOM插入到对应的容器中去 */
|
|
588
|
+
|
|
589
|
+
}, {
|
|
590
|
+
key: "appendTo",
|
|
591
|
+
value: function appendTo(wrapper) {
|
|
592
|
+
this.wrapper = wrapper;
|
|
593
|
+
wrapper.appendChild(this.container);
|
|
594
|
+
return this;
|
|
595
|
+
}
|
|
596
|
+
/** 更新户型图大小 */
|
|
597
|
+
|
|
598
|
+
}, {
|
|
599
|
+
key: "changeFloor",
|
|
600
|
+
value:
|
|
601
|
+
/** 更改户型图楼层 */
|
|
602
|
+
function changeFloor(floorIndex) {
|
|
603
|
+
this.five.model.show(floorIndex);
|
|
604
|
+
this.floorIndex = floorIndex;
|
|
605
|
+
this.render();
|
|
606
|
+
}
|
|
607
|
+
}, {
|
|
608
|
+
key: "changeConfigs",
|
|
609
|
+
value: function changeConfigs(params) {
|
|
610
|
+
Object.assign(this.configs, params);
|
|
611
|
+
if (!this.container) return;
|
|
612
|
+
this.render();
|
|
613
|
+
}
|
|
614
|
+
/** 模型楼层高亮改变时,自动进行楼层切换 */
|
|
615
|
+
|
|
616
|
+
}, {
|
|
617
|
+
key: "render",
|
|
618
|
+
value: function render(duration) {
|
|
619
|
+
if (!this.container) return;
|
|
620
|
+
if (this.size.width === 0) return;
|
|
621
|
+
var props = {
|
|
622
|
+
five: this.five,
|
|
623
|
+
pxmm: this.pxmm,
|
|
624
|
+
visible: this.visible,
|
|
625
|
+
duration: duration !== null && duration !== void 0 ? duration : 0,
|
|
626
|
+
panoIndex: this.panoIndex,
|
|
627
|
+
floorIndex: this.floorIndex,
|
|
628
|
+
floorplanData: this.floorplanData,
|
|
629
|
+
onRoomHeightClick: this.handleClick,
|
|
630
|
+
cameraImage: this.configs.cameraImage,
|
|
631
|
+
hoverEnable: this.configs.hoverEnable,
|
|
632
|
+
getLabelElement: this.configs.getLabelElement,
|
|
633
|
+
lastPanoramaLongitude: this.lastPanoramaLongitude
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
_reactDom["default"].render( /*#__PURE__*/React.createElement(_components["default"], props), this.container);
|
|
637
|
+
}
|
|
638
|
+
}]);
|
|
639
|
+
|
|
640
|
+
return ModelFloorplanPluginController;
|
|
641
|
+
}();
|
|
642
|
+
|
|
643
|
+
exports["default"] = ModelFloorplanPluginController;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Five } from '@realsee/five';
|
|
3
|
+
import { FloorplanData } from '../../typings/floorplanData';
|
|
4
|
+
export default function Camera(props: {
|
|
5
|
+
five: Five;
|
|
6
|
+
panoIndex: number;
|
|
7
|
+
floorIndex: number;
|
|
8
|
+
lastPanoramaLongitude: number;
|
|
9
|
+
floorplanData: FloorplanData;
|
|
10
|
+
cameraImage?: {
|
|
11
|
+
style: React.CSSProperties;
|
|
12
|
+
};
|
|
13
|
+
}): JSX.Element;
|