@realsee/dnalogel 2.0.0-alpha.12 → 2.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CSS3DRenderPlugin/index.js +17 -14
- package/dist/CameraMovementPlugin/index.js +40 -15
- package/dist/ModelChassisCompassPlugin/index.js +32 -6
- package/dist/ModelEntryDoorGuidePlugin/index.js +48 -18
- package/dist/ModelItemLabelPlugin/index.js +18 -17
- package/dist/ModelRoomLabelPlugin/index.js +67 -26
- package/dist/PanoCompassPlugin/index.js +311 -164
- package/dist/PanoCursorRaycasterPlugin/index.js +5 -3
- package/dist/PanoMeasurePlugin/index.js +1337 -583
- package/dist/PanoRulerPlugin/index.js +32 -5
- package/dist/PanoSpatialTagPlugin/index.js +64 -29
- package/dist/floorplan/ModelFloorplanPlugin/index.js +586 -362
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +164 -72
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +311 -153
- package/dist/index.es.js +2663 -1341
- package/dist/index.js +2667 -1345
- package/dist/index.umd.js +2667 -1345
- package/docs/assets/main.js +1 -1
- package/docs/classes/ModelRoomLabelController.html +6 -6
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ModelFloorplanErrorType.html +1 -1
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
- package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +1 -1
- package/docs/modules.html +12 -12
- package/libs/CSS3DRenderPlugin/index.js +16 -13
- package/libs/CameraMovementPlugin/index.js +24 -15
- package/libs/ModelChassisCompassPlugin/index.js +14 -5
- package/libs/ModelEntryDoorGuidePlugin/index.js +24 -12
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +12 -10
- package/libs/ModelItemLabelPlugin/index.js +5 -3
- package/libs/ModelItemLabelPlugin/utils/parseData.js +1 -4
- package/libs/ModelRoomLabelPlugin/Controller.js +64 -23
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +3 -3
- package/libs/PanoCompassPlugin/index.js +225 -128
- package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +68 -13
- package/libs/PanoMeasurePlugin/Controller/EditController.js +267 -154
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +234 -152
- package/libs/PanoMeasurePlugin/Controller/index.js +131 -47
- package/libs/PanoMeasurePlugin/Model/index.js +30 -5
- package/libs/PanoMeasurePlugin/Model/line.js +60 -10
- package/libs/PanoMeasurePlugin/Model/point.js +24 -4
- package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +59 -14
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +60 -10
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +83 -37
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +61 -30
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +3 -2
- package/libs/PanoMeasurePlugin/utils/line.js +8 -7
- package/libs/PanoRulerPlugin/index.js +16 -5
- package/libs/PanoSpatialTagPlugin/index.js +11 -9
- package/libs/floorplan/Components/BaseImage.js +10 -5
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +3 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +5 -6
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +7 -2
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +3 -1
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +456 -273
- package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +33 -22
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +3 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +97 -36
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +231 -108
- package/libs/floorplan/utils/formatData.js +43 -28
- package/libs/floorplan/utils/formatPosition.js +1 -1
- package/libs/shared-utils/Subscribe.js +8 -1
- package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
- package/libs/shared-utils/createCanvasTextTexture.js +6 -5
- package/libs/shared-utils/five/changeMode.js +23 -12
- package/libs/shared-utils/getPxmm.js +1 -1
- package/libs/shared-utils/math/evenNumber.js +1 -1
- package/libs/shared-utils/three/loadFbxObj.js +20 -9
- package/libs/shared-utils/three/loadTexture.js +17 -6
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
- package/libs/shared-utils/tinyEJSrender.js +36 -6
- package/libs/shared-utils/to.js +21 -10
- package/libs/shared-utils/useDebounce.js +1 -1
- package/libs/shared-utils/useThrottle.js +2 -1
- package/package.json +1 -1
- package/CHANGELOG.md +0 -41
|
@@ -6,6 +6,31 @@ var internal = require('svelte/internal');
|
|
|
6
6
|
var svelte = require('svelte');
|
|
7
7
|
var three = require('three');
|
|
8
8
|
|
|
9
|
+
/*! *****************************************************************************
|
|
10
|
+
Copyright (c) Microsoft Corporation.
|
|
11
|
+
|
|
12
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
13
|
+
purpose with or without fee is hereby granted.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
16
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
17
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
18
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
19
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
20
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
21
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
22
|
+
***************************************************************************** */
|
|
23
|
+
|
|
24
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
25
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
26
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
27
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
28
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
29
|
+
function step(result) { result.done ? resolve(result.value) : adopt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G5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==';
|
|
10
35
|
|
|
11
36
|
/**
|
|
@@ -422,7 +447,7 @@ function add_css$3(target) {
|
|
|
422
447
|
internal.append_styles(target, "svelte-126ja8e", ".floorplan-plugin__base-image.svelte-126ja8e{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}");
|
|
423
448
|
}
|
|
424
449
|
|
|
425
|
-
// (
|
|
450
|
+
// (13:22)
|
|
426
451
|
function create_if_block_1(ctx) {
|
|
427
452
|
let normalimage;
|
|
428
453
|
let current;
|
|
@@ -456,7 +481,7 @@ function create_if_block_1(ctx) {
|
|
|
456
481
|
};
|
|
457
482
|
}
|
|
458
483
|
|
|
459
|
-
// (
|
|
484
|
+
// (11:2) {#if svgContent}
|
|
460
485
|
function create_if_block$2(ctx) {
|
|
461
486
|
let svgimage;
|
|
462
487
|
let current;
|
|
@@ -584,6 +609,7 @@ function create_fragment$4(ctx) {
|
|
|
584
609
|
function instance$4($$self, $$props, $$invalidate) {
|
|
585
610
|
let imageData;
|
|
586
611
|
let svgContent;
|
|
612
|
+
var _a, _b;
|
|
587
613
|
let { floorIndex } = $$props;
|
|
588
614
|
let { floorplanData } = $$props;
|
|
589
615
|
|
|
@@ -597,12 +623,16 @@ function instance$4($$self, $$props, $$invalidate) {
|
|
|
597
623
|
$$invalidate(1, imageData = floorplanData.outlines[floorIndex]);
|
|
598
624
|
}
|
|
599
625
|
|
|
600
|
-
if ($$self.$$.dirty & /*floorplanData, floorIndex*/
|
|
601
|
-
$$invalidate(0, svgContent = floorplanData.outlines
|
|
626
|
+
if ($$self.$$.dirty & /*floorplanData, _a, floorIndex, _b*/ 60) {
|
|
627
|
+
$$invalidate(0, svgContent = $$invalidate(5, _b = $$invalidate(4, _a = floorplanData.outlines) === null || _a === void 0
|
|
628
|
+
? void 0
|
|
629
|
+
: _a[floorIndex]) === null || _b === void 0
|
|
630
|
+
? void 0
|
|
631
|
+
: _b.svgContent);
|
|
602
632
|
}
|
|
603
633
|
};
|
|
604
634
|
|
|
605
|
-
return [svgContent, imageData, floorIndex, floorplanData];
|
|
635
|
+
return [svgContent, imageData, floorIndex, floorplanData, _a, _b];
|
|
606
636
|
}
|
|
607
637
|
|
|
608
638
|
class BaseImage extends internal.SvelteComponent {
|
|
@@ -623,7 +653,7 @@ function pathD(points, options = {}) {
|
|
|
623
653
|
d += 'M' + point;
|
|
624
654
|
return d;
|
|
625
655
|
}
|
|
626
|
-
if (needA
|
|
656
|
+
if (needA === null || needA === void 0 ? void 0 : needA[index]) {
|
|
627
657
|
d += 'A' + needA[index] + ',' + point;
|
|
628
658
|
return d;
|
|
629
659
|
}
|
|
@@ -895,7 +925,9 @@ function instance$2($$self, $$props, $$invalidate) {
|
|
|
895
925
|
const { observers: floorplan_observers } = floorplanData;
|
|
896
926
|
|
|
897
927
|
const handleClick = function (e) {
|
|
898
|
-
if (onRoomHeightClick
|
|
928
|
+
if ((onRoomHeightClick === null || onRoomHeightClick === void 0
|
|
929
|
+
? void 0
|
|
930
|
+
: onRoomHeightClick(e)) === false) return;
|
|
899
931
|
|
|
900
932
|
// 因为 mouse.offsetX 的兼容性问题,手动计算 mouse offsetX offsetY
|
|
901
933
|
const boundingClientRect = highlightContainerDom.getBoundingClientRect();
|
|
@@ -1169,7 +1201,9 @@ function instance$1($$self, $$props, $$invalidate) {
|
|
|
1169
1201
|
|
|
1170
1202
|
$$self.$$.update = () => {
|
|
1171
1203
|
if ($$self.$$.dirty & /*extraObjects, floorIndex*/ 132) {
|
|
1172
|
-
$$invalidate(5, currentFloorExtraObjects = extraObjects
|
|
1204
|
+
$$invalidate(5, currentFloorExtraObjects = extraObjects === null || extraObjects === void 0
|
|
1205
|
+
? void 0
|
|
1206
|
+
: extraObjects.filter(object => object.floorIndex === floorIndex));
|
|
1173
1207
|
}
|
|
1174
1208
|
};
|
|
1175
1209
|
|
|
@@ -1485,22 +1519,26 @@ class Main extends internal.SvelteComponent {
|
|
|
1485
1519
|
|
|
1486
1520
|
const FLOORPLAN_EXTRA_OBJECT_IMAGE = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC';
|
|
1487
1521
|
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
const
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1522
|
+
function formatOutlines(outlines) {
|
|
1523
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1524
|
+
const headers = new Headers({ 'Content-Type': 'text/plain' });
|
|
1525
|
+
const getOutlineItem = function (item) {
|
|
1526
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1527
|
+
const outlineItem = {
|
|
1528
|
+
index: item.index,
|
|
1529
|
+
url: item.url,
|
|
1530
|
+
svgUrl: item.svg_url,
|
|
1531
|
+
};
|
|
1532
|
+
if (item.svg_url) {
|
|
1533
|
+
const svgContent = yield fetch(item.svg_url, { headers }).then((res) => res.text());
|
|
1534
|
+
outlineItem.svgContent = svgContent;
|
|
1535
|
+
}
|
|
1536
|
+
return outlineItem;
|
|
1537
|
+
});
|
|
1495
1538
|
};
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
}
|
|
1500
|
-
return outlineItem;
|
|
1501
|
-
};
|
|
1502
|
-
const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
|
|
1503
|
-
return svgOutlineItems;
|
|
1539
|
+
const svgOutlineItems = yield Promise.all(outlines.map(getOutlineItem));
|
|
1540
|
+
return svgOutlineItems;
|
|
1541
|
+
});
|
|
1504
1542
|
}
|
|
1505
1543
|
function formatRoom(data) {
|
|
1506
1544
|
const floorplanRoomItem = {
|
|
@@ -1546,19 +1584,21 @@ function formatFloorplanEntrance(data) {
|
|
|
1546
1584
|
};
|
|
1547
1585
|
return floorplanEntrance;
|
|
1548
1586
|
}
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1587
|
+
function formatData(data) {
|
|
1588
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1589
|
+
const outlines = yield formatOutlines(data.outlines);
|
|
1590
|
+
const bounding = data.computed_data.bounding;
|
|
1591
|
+
const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
|
|
1592
|
+
const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
|
|
1593
|
+
const floorplanData = {
|
|
1594
|
+
outlines,
|
|
1595
|
+
entrance,
|
|
1596
|
+
bounding,
|
|
1597
|
+
floorDatas,
|
|
1598
|
+
observers: data.computed_data.observers.map(formateFloorplanObserver),
|
|
1599
|
+
};
|
|
1600
|
+
return floorplanData;
|
|
1601
|
+
});
|
|
1562
1602
|
}
|
|
1563
1603
|
function formatExtraObjects(data, five, floorplanData) {
|
|
1564
1604
|
const extraObjects = data.map((object) => {
|
|
@@ -1579,47 +1619,98 @@ function formatExtraObjects(data, five, floorplanData) {
|
|
|
1579
1619
|
}
|
|
1580
1620
|
|
|
1581
1621
|
class PanoFloorplanRadarPluginController {
|
|
1582
|
-
app;
|
|
1583
|
-
five;
|
|
1584
|
-
wrapperSelector = '';
|
|
1585
|
-
data;
|
|
1586
|
-
wrapper = null;
|
|
1587
|
-
extraObjects;
|
|
1588
|
-
originExtraObjects;
|
|
1589
|
-
configs = {};
|
|
1590
1622
|
constructor(five, params) {
|
|
1623
|
+
Object.defineProperty(this, "app", {
|
|
1624
|
+
enumerable: true,
|
|
1625
|
+
configurable: true,
|
|
1626
|
+
writable: true,
|
|
1627
|
+
value: void 0
|
|
1628
|
+
});
|
|
1629
|
+
Object.defineProperty(this, "five", {
|
|
1630
|
+
enumerable: true,
|
|
1631
|
+
configurable: true,
|
|
1632
|
+
writable: true,
|
|
1633
|
+
value: void 0
|
|
1634
|
+
});
|
|
1635
|
+
Object.defineProperty(this, "wrapperSelector", {
|
|
1636
|
+
enumerable: true,
|
|
1637
|
+
configurable: true,
|
|
1638
|
+
writable: true,
|
|
1639
|
+
value: ''
|
|
1640
|
+
});
|
|
1641
|
+
Object.defineProperty(this, "data", {
|
|
1642
|
+
enumerable: true,
|
|
1643
|
+
configurable: true,
|
|
1644
|
+
writable: true,
|
|
1645
|
+
value: void 0
|
|
1646
|
+
});
|
|
1647
|
+
Object.defineProperty(this, "wrapper", {
|
|
1648
|
+
enumerable: true,
|
|
1649
|
+
configurable: true,
|
|
1650
|
+
writable: true,
|
|
1651
|
+
value: null
|
|
1652
|
+
});
|
|
1653
|
+
Object.defineProperty(this, "extraObjects", {
|
|
1654
|
+
enumerable: true,
|
|
1655
|
+
configurable: true,
|
|
1656
|
+
writable: true,
|
|
1657
|
+
value: void 0
|
|
1658
|
+
});
|
|
1659
|
+
Object.defineProperty(this, "originExtraObjects", {
|
|
1660
|
+
enumerable: true,
|
|
1661
|
+
configurable: true,
|
|
1662
|
+
writable: true,
|
|
1663
|
+
value: void 0
|
|
1664
|
+
});
|
|
1665
|
+
Object.defineProperty(this, "configs", {
|
|
1666
|
+
enumerable: true,
|
|
1667
|
+
configurable: true,
|
|
1668
|
+
writable: true,
|
|
1669
|
+
value: {}
|
|
1670
|
+
});
|
|
1671
|
+
Object.defineProperty(this, "dispose", {
|
|
1672
|
+
enumerable: true,
|
|
1673
|
+
configurable: true,
|
|
1674
|
+
writable: true,
|
|
1675
|
+
value: () => {
|
|
1676
|
+
var _a;
|
|
1677
|
+
(_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
|
|
1678
|
+
}
|
|
1679
|
+
});
|
|
1680
|
+
Object.defineProperty(this, "load", {
|
|
1681
|
+
enumerable: true,
|
|
1682
|
+
configurable: true,
|
|
1683
|
+
writable: true,
|
|
1684
|
+
value: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
1685
|
+
const copyData = JSON.parse(JSON.stringify(data));
|
|
1686
|
+
const floorplanData = yield formatData(copyData);
|
|
1687
|
+
this.data = floorplanData;
|
|
1688
|
+
// const loadImage = async () => {
|
|
1689
|
+
// const floorIndex = this.five.work.observers[this.five.getCurrentState().panoIndex].floorIndex
|
|
1690
|
+
// // 当有 svgString 时,没有加载过程
|
|
1691
|
+
// if (floorplanData.outlines[floorIndex]?.svgContent) return
|
|
1692
|
+
// // 如果当前楼层图片不存在,不存在加载过程
|
|
1693
|
+
// const nowFloorImageSrc = floorplanData.outlines[floorIndex]?.url
|
|
1694
|
+
// if (!nowFloorImageSrc) return
|
|
1695
|
+
// // 图片加载完成时再 render
|
|
1696
|
+
// await new Promise<void>((resolve) => {
|
|
1697
|
+
// const nowFloorImage = new Image()
|
|
1698
|
+
// nowFloorImage.src = nowFloorImageSrc
|
|
1699
|
+
// nowFloorImage.onload = () => resolve()
|
|
1700
|
+
// })
|
|
1701
|
+
// }
|
|
1702
|
+
// await loadImage()
|
|
1703
|
+
this.render();
|
|
1704
|
+
})
|
|
1705
|
+
});
|
|
1591
1706
|
this.five = five;
|
|
1592
|
-
params
|
|
1593
|
-
if (typeof params
|
|
1707
|
+
(params === null || params === void 0 ? void 0 : params.configs) && Object.assign(this.configs, params.configs);
|
|
1708
|
+
if (typeof (params === null || params === void 0 ? void 0 : params.wrapper) === 'string')
|
|
1594
1709
|
this.wrapperSelector = params.wrapper;
|
|
1595
|
-
else if (params
|
|
1710
|
+
else if ((params === null || params === void 0 ? void 0 : params.wrapper) instanceof Element)
|
|
1596
1711
|
this.wrapper = params.wrapper;
|
|
1597
1712
|
five.once('dispose', this.dispose);
|
|
1598
1713
|
}
|
|
1599
|
-
dispose = () => {
|
|
1600
|
-
this.app?.$destroy();
|
|
1601
|
-
};
|
|
1602
|
-
load = async (data) => {
|
|
1603
|
-
const copyData = JSON.parse(JSON.stringify(data));
|
|
1604
|
-
const floorplanData = await formatData(copyData);
|
|
1605
|
-
this.data = floorplanData;
|
|
1606
|
-
// const loadImage = async () => {
|
|
1607
|
-
// const floorIndex = this.five.work.observers[this.five.getCurrentState().panoIndex].floorIndex
|
|
1608
|
-
// // 当有 svgString 时,没有加载过程
|
|
1609
|
-
// if (floorplanData.outlines[floorIndex]?.svgContent) return
|
|
1610
|
-
// // 如果当前楼层图片不存在,不存在加载过程
|
|
1611
|
-
// const nowFloorImageSrc = floorplanData.outlines[floorIndex]?.url
|
|
1612
|
-
// if (!nowFloorImageSrc) return
|
|
1613
|
-
// // 图片加载完成时再 render
|
|
1614
|
-
// await new Promise<void>((resolve) => {
|
|
1615
|
-
// const nowFloorImage = new Image()
|
|
1616
|
-
// nowFloorImage.src = nowFloorImageSrc
|
|
1617
|
-
// nowFloorImage.onload = () => resolve()
|
|
1618
|
-
// })
|
|
1619
|
-
// }
|
|
1620
|
-
// await loadImage()
|
|
1621
|
-
this.render();
|
|
1622
|
-
};
|
|
1623
1714
|
/** 把插件的渲染DOM插入到对应的容器中去 */
|
|
1624
1715
|
appendTo(wrapper) {
|
|
1625
1716
|
this.wrapper = wrapper;
|
|
@@ -1637,6 +1728,7 @@ class PanoFloorplanRadarPluginController {
|
|
|
1637
1728
|
this.render();
|
|
1638
1729
|
}
|
|
1639
1730
|
render() {
|
|
1731
|
+
var _a;
|
|
1640
1732
|
// 处理 wrapper
|
|
1641
1733
|
if (!this.wrapper) {
|
|
1642
1734
|
const _wrapper = document.querySelector(this.wrapperSelector);
|
|
@@ -1652,7 +1744,7 @@ class PanoFloorplanRadarPluginController {
|
|
|
1652
1744
|
floorplanData: this.data,
|
|
1653
1745
|
extraObjects: this.extraObjects,
|
|
1654
1746
|
cameraImageUrl: this.configs.cameraImageUrl,
|
|
1655
|
-
hoverEnable: this.configs.hoverEnable
|
|
1747
|
+
hoverEnable: (_a = this.configs.hoverEnable) !== null && _a !== void 0 ? _a : false,
|
|
1656
1748
|
};
|
|
1657
1749
|
if (!this.app) {
|
|
1658
1750
|
this.app = new Main({
|