@realsee/dnalogel 2.0.0-alpha.35 → 2.0.0-alpha.38
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/ItemLabelPlugin/index.js +21 -41
- package/dist/ModelItemLabelPlugin/index.js +16 -36
- package/dist/ModelViewPlugin/Plugin.d.ts +4 -4
- package/dist/ModelViewPlugin/index.js +2 -3
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +0 -4
- package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +0 -3
- package/dist/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/{NewMainBtnController.d.ts → mobileMainBtnController.d.ts} +1 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +0 -3
- package/dist/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +2 -0
- package/dist/PanoMeasurePlugin/index.js +298 -331
- package/dist/PanoMeasurePlugin/typings/data.d.ts +5 -0
- package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +6 -1
- package/dist/PanoRulerProPlugin/Controller.d.ts +15 -0
- package/dist/PanoRulerProPlugin/index.d.ts +8 -0
- package/dist/PanoRulerProPlugin/index.js +1006 -0
- package/dist/PanoRulerProPlugin/typings.d.ts +46 -0
- package/dist/base/BasePlugin.d.ts +100 -0
- package/dist/base/BasePluginWithData.d.ts +34 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +71 -78
- package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
- package/dist/floorplan/ModelFloorplanPlugin/index.js +1064 -567
- package/dist/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +23 -14
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +489 -129
- package/dist/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +50 -58
- package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -3
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +1031 -443
- package/dist/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
- package/{libs/floorplan/ModelFloorplanPlugin → dist/floorplan}/utils/constant.d.ts +10 -3
- package/{libs/floorplan/ModelFloorplanPlugin → dist/floorplan}/utils/correctFiveState.d.ts +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +3173 -1633
- package/dist/index.js +3194 -1653
- package/dist/index.umd.js +3090 -1549
- package/dist/shared-utils/five/changeMode.d.ts +4 -1
- package/dist/shared-utils/getPxmm.d.ts +8 -0
- package/dist/shared-utils/logger.d.ts +16 -0
- package/docs/assets/search.js +1 -1
- package/docs/classes/Magnifier.html +4 -4
- package/docs/classes/ModelRoomLabelController.html +4 -4
- package/docs/enums/CameraMovementEffect.html +2 -2
- package/docs/enums/DIRECTION.html +1 -1
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/Rotation.html +2 -2
- package/docs/index.html +2 -2
- package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
- package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
- package/docs/interfaces/FloorplanBounding.html +4 -4
- package/docs/interfaces/FloorplanData.html +2 -2
- package/docs/interfaces/FloorplanEntrance.html +7 -7
- package/docs/interfaces/FloorplanExtraObject.html +3 -3
- package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
- package/docs/interfaces/FloorplanFloorData.html +2 -2
- package/docs/interfaces/FloorplanImagePosition.html +2 -2
- package/docs/interfaces/FloorplanObserver.html +2 -2
- package/docs/interfaces/FloorplanOutlineItem.html +2 -2
- package/docs/interfaces/FloorplanPosition.html +2 -2
- package/docs/interfaces/FloorplanRoomItem.html +6 -6
- package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
- package/docs/interfaces/FloorplanServerBounding.html +4 -4
- package/docs/interfaces/FloorplanServerComputedData.html +1 -1
- package/docs/interfaces/FloorplanServerData.html +2 -2
- package/docs/interfaces/FloorplanServerEntrance.html +7 -7
- package/docs/interfaces/FloorplanServerFloorData.html +2 -2
- package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
- package/docs/interfaces/FloorplanServerObserver.html +2 -2
- package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
- package/docs/interfaces/FloorplanServerPosition.html +2 -2
- package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
- package/docs/interfaces/ItemLabelPluginData.html +1 -1
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ItemLabelPluginParametersType.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/ModelItemLabelPluginData.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/ModelViewPluginExportType.html +1 -1
- package/docs/interfaces/OpenParameter.html +2 -2
- package/docs/interfaces/PanoCompassPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
- package/docs/interfaces/PanoMeasureParameterType.html +1 -1
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginExportType.html +1 -0
- package/docs/interfaces/PanoRulerProPluginOptions.html +1 -0
- package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -0
- package/docs/interfaces/PanoRulerProPluginState.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
- package/docs/interfaces/Point.html +1 -1
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/Room.html +1 -1
- package/docs/interfaces/RoomInfo.html +1 -1
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/RoomRules.html +1 -1
- package/docs/interfaces/Rooms.html +1 -1
- package/docs/modules.html +19 -27
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +21 -41
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +16 -36
- package/libs/ModelViewPlugin/Plugin.d.ts +4 -4
- package/libs/ModelViewPlugin/Plugin.js +2 -3
- package/libs/PanoMeasurePlugin/Controller/index.js +4 -2
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +2 -2
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +0 -4
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +66 -55
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +0 -3
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +51 -73
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +7 -4
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +10 -12
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +2 -2
- package/libs/PanoMeasurePlugin/Modules/UIController/{NewMainBtnController.d.ts → mobileMainBtnController.d.ts} +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/{NewMainBtnController.js → mobileMainBtnController.js} +4 -4
- package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +0 -3
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +7 -24
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +1 -2
- package/libs/PanoMeasurePlugin/typings/data.d.ts +5 -0
- package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +6 -1
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +55 -7
- package/libs/PanoRulerProPlugin/Controller.d.ts +15 -0
- package/libs/PanoRulerProPlugin/Controller.js +110 -0
- package/libs/PanoRulerProPlugin/RulerItem.js +314 -0
- package/libs/PanoRulerProPlugin/RulerItems.js +377 -0
- package/libs/PanoRulerProPlugin/index.d.ts +8 -0
- package/libs/PanoRulerProPlugin/index.js +8 -0
- package/libs/PanoRulerProPlugin/typings.d.ts +46 -0
- package/libs/{floorplan/ModelFloorplanPlugin/typings/events.type.js → PanoRulerProPlugin/typings.js} +0 -0
- package/libs/base/BasePlugin.d.ts +100 -0
- package/libs/base/BasePlugin.js +31 -0
- package/libs/base/BasePluginWithData.d.ts +34 -0
- package/libs/base/BasePluginWithData.js +4 -0
- package/libs/floorplan/Components/Compass.js +11 -11
- package/libs/floorplan/Components/CurrentFloor.js +24 -11
- package/libs/floorplan/Components/Main.js +21 -15
- package/libs/floorplan/Components/RoomHighlight/Room.js +44 -5
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +29 -12
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +164 -15
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +68 -24
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +1 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +11 -9
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +2 -2
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +71 -78
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +439 -272
- package/libs/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
- package/libs/floorplan/ModelFloorplanPlugin/index.js +2 -2
- package/libs/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
- package/libs/floorplan/ModelFloorplanPlugin/typing.js +1 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +5 -5
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +114 -53
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +23 -14
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +162 -52
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +2 -2
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +1 -0
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +50 -58
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +320 -174
- package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -3
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +2 -2
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
- package/libs/floorplan/TopviewFloorplanPlugin/typing.js +1 -0
- package/{dist/floorplan/ModelFloorplanPlugin → libs/floorplan}/utils/constant.d.ts +10 -3
- package/libs/floorplan/{ModelFloorplanPlugin/utils → utils}/constant.js +9 -2
- package/{dist/floorplan/ModelFloorplanPlugin → libs/floorplan}/utils/correctFiveState.d.ts +2 -1
- package/libs/floorplan/{ModelFloorplanPlugin/utils → utils}/correctFiveState.js +16 -16
- package/libs/index.d.ts +1 -0
- package/libs/index.js +2 -0
- package/libs/shared-utils/five/changeMode.d.ts +4 -1
- package/libs/shared-utils/five/changeMode.js +34 -13
- package/libs/shared-utils/getPxmm.d.ts +8 -0
- package/libs/shared-utils/getPxmm.js +25 -20
- package/libs/shared-utils/logger.d.ts +16 -0
- package/libs/shared-utils/logger.js +47 -0
- package/package.json +2 -2
- package/dist/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +0 -23
- package/docs/classes/PanoFloorplanRadarPluginController.html +0 -3
- package/docs/enums/ModelFloorplanErrorType.html +0 -1
- package/docs/interfaces/ModelFloorplanParameterType.html +0 -1
- package/docs/interfaces/ModelFloorplanViewEvent.html +0 -5
- package/docs/interfaces/PanoFloorplanRadarPluginControllerParameter.html +0 -1
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +0 -19
- package/libs/ModelSimulationPlugin/index.d.ts +0 -33
- package/libs/ModelSimulationPlugin/index.js +0 -166
- package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +0 -2
- package/libs/ModelSimulationPlugin/shaders/fragment.js +0 -96
- package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +0 -2
- package/libs/ModelSimulationPlugin/shaders/vertex.js +0 -23
- package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.d.ts +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.js +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +0 -120
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +0 -106
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +0 -463
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +0 -375
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +0 -171
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +0 -265
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +0 -301
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.js +0 -219
- package/libs/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +0 -23
- package/libs/shared-utils/five/useFivePlugin.d.ts +0 -1
- package/libs/shared-utils/five/useFivePlugin.js +0 -8
- package/libs/shared-utils/useDebounce.d.ts +0 -8
- package/libs/shared-utils/useDebounce.js +0 -22
- package/libs/shared-utils/useThrottle.d.ts +0 -8
- package/libs/shared-utils/useThrottle.js +0 -25
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
/* generated by Svelte v3.47.0 */
|
|
2
|
+
import {
|
|
3
|
+
SvelteComponent,
|
|
4
|
+
check_outros,
|
|
5
|
+
create_component,
|
|
6
|
+
destroy_component,
|
|
7
|
+
destroy_each,
|
|
8
|
+
detach,
|
|
9
|
+
element,
|
|
10
|
+
group_outros,
|
|
11
|
+
init,
|
|
12
|
+
insert,
|
|
13
|
+
mount_component,
|
|
14
|
+
safe_not_equal,
|
|
15
|
+
transition_in,
|
|
16
|
+
transition_out
|
|
17
|
+
} from "svelte/internal";
|
|
18
|
+
|
|
19
|
+
import { Five } from '@realsee/five';
|
|
20
|
+
import { nextFrame } from '../shared-utils/animationFrame';
|
|
21
|
+
import equal from '../shared-utils/equal';
|
|
22
|
+
import { intersectionOfLine } from '../shared-utils/math/planimetry';
|
|
23
|
+
import throttle from '../shared-utils/throttle';
|
|
24
|
+
import { onDestroy, onMount } from 'svelte';
|
|
25
|
+
import { Vector3 } from 'three';
|
|
26
|
+
import RulerItem from './RulerItem';
|
|
27
|
+
|
|
28
|
+
function get_each_context(ctx, list, i) {
|
|
29
|
+
const child_ctx = ctx.slice();
|
|
30
|
+
child_ctx[16] = list[i];
|
|
31
|
+
return child_ctx;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// (206:2) {#each rulerItemProp as itemData}
|
|
35
|
+
function create_each_block(ctx) {
|
|
36
|
+
let ruleritem;
|
|
37
|
+
let current;
|
|
38
|
+
|
|
39
|
+
ruleritem = new RulerItem({
|
|
40
|
+
props: { rulerItemProp: /*itemData*/ ctx[16] }
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
c() {
|
|
45
|
+
create_component(ruleritem.$$.fragment);
|
|
46
|
+
},
|
|
47
|
+
m(target, anchor) {
|
|
48
|
+
mount_component(ruleritem, target, anchor);
|
|
49
|
+
current = true;
|
|
50
|
+
},
|
|
51
|
+
p(ctx, dirty) {
|
|
52
|
+
const ruleritem_changes = {};
|
|
53
|
+
if (dirty & /*rulerItemProp*/ 1) ruleritem_changes.rulerItemProp = /*itemData*/ ctx[16];
|
|
54
|
+
ruleritem.$set(ruleritem_changes);
|
|
55
|
+
},
|
|
56
|
+
i(local) {
|
|
57
|
+
if (current) return;
|
|
58
|
+
transition_in(ruleritem.$$.fragment, local);
|
|
59
|
+
current = true;
|
|
60
|
+
},
|
|
61
|
+
o(local) {
|
|
62
|
+
transition_out(ruleritem.$$.fragment, local);
|
|
63
|
+
current = false;
|
|
64
|
+
},
|
|
65
|
+
d(detaching) {
|
|
66
|
+
destroy_component(ruleritem, detaching);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function create_fragment(ctx) {
|
|
72
|
+
let div;
|
|
73
|
+
let current;
|
|
74
|
+
let each_value = /*rulerItemProp*/ ctx[0];
|
|
75
|
+
let each_blocks = [];
|
|
76
|
+
|
|
77
|
+
for (let i = 0; i < each_value.length; i += 1) {
|
|
78
|
+
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const out = i => transition_out(each_blocks[i], 1, 1, () => {
|
|
82
|
+
each_blocks[i] = null;
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
c() {
|
|
87
|
+
div = element("div");
|
|
88
|
+
|
|
89
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
90
|
+
each_blocks[i].c();
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
m(target, anchor) {
|
|
94
|
+
insert(target, div, anchor);
|
|
95
|
+
|
|
96
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
97
|
+
each_blocks[i].m(div, null);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
current = true;
|
|
101
|
+
},
|
|
102
|
+
p(ctx, [dirty]) {
|
|
103
|
+
if (dirty & /*rulerItemProp*/ 1) {
|
|
104
|
+
each_value = /*rulerItemProp*/ ctx[0];
|
|
105
|
+
let i;
|
|
106
|
+
|
|
107
|
+
for (i = 0; i < each_value.length; i += 1) {
|
|
108
|
+
const child_ctx = get_each_context(ctx, each_value, i);
|
|
109
|
+
|
|
110
|
+
if (each_blocks[i]) {
|
|
111
|
+
each_blocks[i].p(child_ctx, dirty);
|
|
112
|
+
transition_in(each_blocks[i], 1);
|
|
113
|
+
} else {
|
|
114
|
+
each_blocks[i] = create_each_block(child_ctx);
|
|
115
|
+
each_blocks[i].c();
|
|
116
|
+
transition_in(each_blocks[i], 1);
|
|
117
|
+
each_blocks[i].m(div, null);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
group_outros();
|
|
122
|
+
|
|
123
|
+
for (i = each_value.length; i < each_blocks.length; i += 1) {
|
|
124
|
+
out(i);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
check_outros();
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
i(local) {
|
|
131
|
+
if (current) return;
|
|
132
|
+
|
|
133
|
+
for (let i = 0; i < each_value.length; i += 1) {
|
|
134
|
+
transition_in(each_blocks[i]);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
current = true;
|
|
138
|
+
},
|
|
139
|
+
o(local) {
|
|
140
|
+
each_blocks = each_blocks.filter(Boolean);
|
|
141
|
+
|
|
142
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
143
|
+
transition_out(each_blocks[i]);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
current = false;
|
|
147
|
+
},
|
|
148
|
+
d(detaching) {
|
|
149
|
+
if (detaching) detach(div);
|
|
150
|
+
destroy_each(each_blocks, detaching);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function instance($$self, $$props, $$invalidate) {
|
|
156
|
+
var _a, _b, _c, _d;
|
|
157
|
+
let { five } = $$props;
|
|
158
|
+
let { rulerDatas } = $$props;
|
|
159
|
+
let { options } = $$props;
|
|
160
|
+
let rulerItemProp = [];
|
|
161
|
+
|
|
162
|
+
const canvasWidth = ((_b = (_a = five.getElement()) === null || _a === void 0
|
|
163
|
+
? void 0
|
|
164
|
+
: _a.parentElement) === null || _b === void 0
|
|
165
|
+
? void 0
|
|
166
|
+
: _b.clientWidth) || 0;
|
|
167
|
+
|
|
168
|
+
const canvasHeight = ((_d = (_c = five.getElement()) === null || _c === void 0
|
|
169
|
+
? void 0
|
|
170
|
+
: _c.parentElement) === null || _d === void 0
|
|
171
|
+
? void 0
|
|
172
|
+
: _d.clientHeight) || 0;
|
|
173
|
+
|
|
174
|
+
const getRuleScreenIntr = (startPoint, endPoint) => {
|
|
175
|
+
const screenLines = [
|
|
176
|
+
[{ x: 0, y: 0 }, { x: canvasWidth, y: 0 }],
|
|
177
|
+
[{ x: 0, y: 0 }, { x: 0, y: canvasHeight }],
|
|
178
|
+
[{ x: canvasWidth, y: 0 }, { x: canvasWidth, y: canvasHeight }],
|
|
179
|
+
[{ x: 0, y: canvasHeight }, { x: canvasWidth, y: canvasHeight }]
|
|
180
|
+
];
|
|
181
|
+
|
|
182
|
+
const intr = [];
|
|
183
|
+
|
|
184
|
+
for (let i = 0; i < screenLines.length; i++) {
|
|
185
|
+
const result = intersectionOfLine([startPoint, endPoint], [screenLines[i][0], screenLines[i][1]], true);
|
|
186
|
+
if (result) intr.push(result);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (intr.length === 0) return false; else {
|
|
190
|
+
return intr;
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const getPosition = (start, end) => {
|
|
195
|
+
const startPoint = start.clone().project(five.camera);
|
|
196
|
+
const startLeft = (startPoint.x + 1) / 2 * canvasWidth;
|
|
197
|
+
const startTop = (-startPoint.y + 1) / 2 * canvasHeight;
|
|
198
|
+
const endPoint = end.clone().project(five.camera);
|
|
199
|
+
const endLeft = (endPoint.x + 1) / 2 * canvasWidth;
|
|
200
|
+
const endTop = (-endPoint.y + 1) / 2 * canvasHeight;
|
|
201
|
+
const distance = Math.sqrt(Math.pow(endLeft - startLeft, 2) + Math.pow(endTop - startTop, 2));
|
|
202
|
+
|
|
203
|
+
return {
|
|
204
|
+
startLeft,
|
|
205
|
+
startTop,
|
|
206
|
+
endLeft,
|
|
207
|
+
endTop,
|
|
208
|
+
distance
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
const getPositionAndVisible = (start, end, visibleOrigin) => {
|
|
213
|
+
const cameraPosition = five.camera.position;
|
|
214
|
+
const cameraDirection = five.camera.getWorldDirection(new Vector3());
|
|
215
|
+
const startAngle = start.clone().sub(cameraPosition).normalize().angleTo(cameraDirection);
|
|
216
|
+
const endAngle = end.clone().sub(cameraPosition).normalize().angleTo(cameraDirection);
|
|
217
|
+
const ruleLength = start.distanceTo(end);
|
|
218
|
+
const midPoint = end.clone().sub(end.clone().sub(start).divide(new Vector3(2, 2, 2)));
|
|
219
|
+
const disFromCameraToMid = midPoint.distanceTo(cameraPosition);
|
|
220
|
+
const { startLeft, startTop, endLeft, endTop, distance } = getPosition(start, end);
|
|
221
|
+
const rad = Math.PI / 2 - Math.atan2(endLeft - startLeft, startTop - endTop);
|
|
222
|
+
const deg = -(rad / Math.PI) * 180;
|
|
223
|
+
let visible = true;
|
|
224
|
+
if (!visibleOrigin) visible = false;
|
|
225
|
+
|
|
226
|
+
// 只显示拐点相连的线
|
|
227
|
+
if (!equal(start, visibleOrigin) && !equal(end, visibleOrigin)) {
|
|
228
|
+
visible = false;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// 线小于0.3m隐藏
|
|
232
|
+
if (ruleLength < 0.3) {
|
|
233
|
+
visible = false;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
if (startAngle > Math.PI / 2) {
|
|
237
|
+
visible = false;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (endAngle > Math.PI / 2) {
|
|
241
|
+
visible = false;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (disFromCameraToMid / ruleLength > 8) {
|
|
245
|
+
visible = false;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
let labelOffset = 50;
|
|
249
|
+
let visibleLength = distance;
|
|
250
|
+
const intr = getRuleScreenIntr({ x: ~~startLeft, y: ~~startTop }, { x: ~~endLeft, y: ~~endTop });
|
|
251
|
+
|
|
252
|
+
if (intr && intr.length === 1) {
|
|
253
|
+
if (equal(start, visibleOrigin)) {
|
|
254
|
+
visibleLength = Math.sqrt(Math.pow(intr[0].x - startLeft, 2) + Math.pow(intr[0].y - startTop, 2));
|
|
255
|
+
labelOffset = visibleLength / distance * 50;
|
|
256
|
+
} else if (equal(end, visibleOrigin)) {
|
|
257
|
+
visibleLength = Math.sqrt(Math.pow(intr[0].x - endLeft, 2) + Math.pow(intr[0].y - endTop, 2));
|
|
258
|
+
labelOffset = 100 - visibleLength / distance * 50;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (intr && intr.length === 2) {
|
|
263
|
+
const middlePoint = {
|
|
264
|
+
x: (intr[0].x + intr[1].x) / 2,
|
|
265
|
+
y: (intr[0].y + intr[1].y) / 2
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
const distanceFromStart = Math.sqrt(Math.pow(middlePoint.x - startLeft, 2) + Math.pow(middlePoint.y - startTop, 2));
|
|
269
|
+
labelOffset = distanceFromStart / distance * 100;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
return {
|
|
273
|
+
startLeft,
|
|
274
|
+
startTop,
|
|
275
|
+
distance,
|
|
276
|
+
deg,
|
|
277
|
+
visible,
|
|
278
|
+
labelOffset,
|
|
279
|
+
ruleLength
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
const updatePanoRulerData = () => {
|
|
284
|
+
const panoIndex = five.panoIndex;
|
|
285
|
+
const rulerData = rulerDatas.find(data => data.panoIndex === panoIndex);
|
|
286
|
+
if (!rulerData) return $$invalidate(0, rulerItemProp = []);
|
|
287
|
+
|
|
288
|
+
// 非全景模式下隐藏所有标尺
|
|
289
|
+
if (five.currentMode !== Five.Mode.Panorama) return $$invalidate(0, rulerItemProp = []);
|
|
290
|
+
|
|
291
|
+
const cameraPosition = five.camera.position;
|
|
292
|
+
const cameraDirection = five.camera.getWorldDirection(new Vector3());
|
|
293
|
+
const startPoints = rulerData.lines.map(v => new Vector3(v.start[0], -v.start[1], -v.start[2]));
|
|
294
|
+
const endPoints = rulerData.lines.map(v => new Vector3(v.end[0], -v.end[1], -v.end[2]));
|
|
295
|
+
|
|
296
|
+
// 可以看到的角度最小的拐点
|
|
297
|
+
const [visibleOrigin] = startPoints.concat(endPoints).sort((pointA, pointB) => {
|
|
298
|
+
const angleA = pointA.clone().setY(0).sub(cameraPosition).normalize().angleTo(cameraDirection.clone().setY(0));
|
|
299
|
+
const angleB = pointB.clone().setY(0).sub(cameraPosition).normalize().angleTo(cameraDirection.clone().setY(0));
|
|
300
|
+
return angleA - angleB;
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
const data = rulerData.lines.map(line => {
|
|
304
|
+
var _a, _b;
|
|
305
|
+
const start = line.start;
|
|
306
|
+
const end = line.end;
|
|
307
|
+
const { startLeft, startTop, distance, deg, visible, labelOffset, ruleLength } = getPositionAndVisible(new Vector3(start[0], -start[1], -start[2]), new Vector3(end[0], -end[1], -end[2]), visibleOrigin);
|
|
308
|
+
const children = [];
|
|
309
|
+
|
|
310
|
+
if (line.children && ((_a = line.children) === null || _a === void 0
|
|
311
|
+
? void 0
|
|
312
|
+
: _a.length) > 0) {
|
|
313
|
+
(_b = line.children) === null || _b === void 0
|
|
314
|
+
? void 0
|
|
315
|
+
: _b.forEach(l => {
|
|
316
|
+
const start = l.start;
|
|
317
|
+
const end = l.end;
|
|
318
|
+
const { distance } = getPosition(new Vector3(start[0], -start[1], -start[2]), new Vector3(end[0], -end[1], -end[2]));
|
|
319
|
+
children.push({ width: distance, state: l.state });
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return {
|
|
324
|
+
width: distance,
|
|
325
|
+
left: startLeft,
|
|
326
|
+
top: startTop,
|
|
327
|
+
rotateDeg: deg,
|
|
328
|
+
state: line.state,
|
|
329
|
+
children,
|
|
330
|
+
labelOffset,
|
|
331
|
+
visible,
|
|
332
|
+
labelElement: options.distanceText(ruleLength)
|
|
333
|
+
};
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
$$invalidate(0, rulerItemProp = data);
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
const nextFrameFreshRule = () => nextFrame(updatePanoRulerData);
|
|
340
|
+
const throttleFreshRule = throttle(updatePanoRulerData, 80);
|
|
341
|
+
|
|
342
|
+
onMount(() => {
|
|
343
|
+
updatePanoRulerData();
|
|
344
|
+
five.on('panoArrived', updatePanoRulerData);
|
|
345
|
+
five.on('modeChange', updatePanoRulerData);
|
|
346
|
+
five.on('cameraDirectionUpdate', nextFrameFreshRule);
|
|
347
|
+
five.on('movingToPano', nextFrameFreshRule);
|
|
348
|
+
five.on('mouseWheel', () => throttleFreshRule());
|
|
349
|
+
five.on('pinchGesture', () => throttleFreshRule());
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
onDestroy(() => {
|
|
353
|
+
five.off('panoArrived', updatePanoRulerData);
|
|
354
|
+
five.off('modeChange', updatePanoRulerData);
|
|
355
|
+
five.off('cameraDirectionUpdate', nextFrameFreshRule);
|
|
356
|
+
five.off('movingToPano', nextFrameFreshRule);
|
|
357
|
+
five.off('mouseWheel', () => throttleFreshRule());
|
|
358
|
+
five.off('pinchGesture', () => throttleFreshRule());
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
$$self.$$set = $$props => {
|
|
362
|
+
if ('five' in $$props) $$invalidate(1, five = $$props.five);
|
|
363
|
+
if ('rulerDatas' in $$props) $$invalidate(2, rulerDatas = $$props.rulerDatas);
|
|
364
|
+
if ('options' in $$props) $$invalidate(3, options = $$props.options);
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
return [rulerItemProp, five, rulerDatas, options];
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
class Component extends SvelteComponent {
|
|
371
|
+
constructor(options) {
|
|
372
|
+
super();
|
|
373
|
+
init(this, options, instance, create_fragment, safe_not_equal, { five: 1, rulerDatas: 2, options: 3 });
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export default Component;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FivePlugin } from '@realsee/five';
|
|
2
|
+
import type { PanoRulerProPluginParameterType, PanoRulerProPluginExportType } from './typings';
|
|
3
|
+
/**
|
|
4
|
+
* 全景标尺插件
|
|
5
|
+
*/
|
|
6
|
+
export declare const PanoRulerProPlugin: FivePlugin<PanoRulerProPluginParameterType, PanoRulerProPluginExportType>;
|
|
7
|
+
export default PanoRulerProPlugin;
|
|
8
|
+
export type { PanoRulerProPluginParameterType, PanoRulerProPluginExportType, PanoRulerProPluginOptions, PanoRulerProPluginState, } from './typings';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export declare type PanoRulerProPluginDatas = {
|
|
2
|
+
data: PanoRulerProPluginData[];
|
|
3
|
+
version: number;
|
|
4
|
+
};
|
|
5
|
+
export interface PanoRulerProPluginData {
|
|
6
|
+
panoIndex: number;
|
|
7
|
+
roomName: string;
|
|
8
|
+
lines: Line[];
|
|
9
|
+
}
|
|
10
|
+
interface Line {
|
|
11
|
+
start: number[];
|
|
12
|
+
end: number[];
|
|
13
|
+
state: boolean;
|
|
14
|
+
children?: Line[];
|
|
15
|
+
}
|
|
16
|
+
export interface PanoRulerProPluginOptions {
|
|
17
|
+
distanceText?: (distance: number) => string;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface PanoRulerProPluginState {
|
|
21
|
+
enabled: boolean;
|
|
22
|
+
loaded: boolean;
|
|
23
|
+
options: PanoRulerProPluginOptions;
|
|
24
|
+
}
|
|
25
|
+
export interface PanoRulerProPluginParameterType {
|
|
26
|
+
data?: PanoRulerProPluginDatas;
|
|
27
|
+
options?: PanoRulerProPluginOptions;
|
|
28
|
+
}
|
|
29
|
+
export interface PanoRulerProPluginExportType {
|
|
30
|
+
enable: () => void;
|
|
31
|
+
disable: () => void;
|
|
32
|
+
load: (serverData: PanoRulerProPluginDatas) => void;
|
|
33
|
+
state: PanoRulerProPluginState;
|
|
34
|
+
}
|
|
35
|
+
export interface RulerItemProp {
|
|
36
|
+
width: number;
|
|
37
|
+
left: number;
|
|
38
|
+
top: number;
|
|
39
|
+
rotateDeg: number;
|
|
40
|
+
state: boolean;
|
|
41
|
+
children: any[];
|
|
42
|
+
labelOffset: number;
|
|
43
|
+
labelElement: string;
|
|
44
|
+
visible: boolean;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
package/libs/{floorplan/ModelFloorplanPlugin/typings/events.type.js → PanoRulerProPlugin/typings.js}
RENAMED
|
File without changes
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Five, Subscribe } from '@realsee/five';
|
|
2
|
+
/**
|
|
3
|
+
* 基本属性字段
|
|
4
|
+
*/
|
|
5
|
+
interface State {
|
|
6
|
+
/**
|
|
7
|
+
* 插件是否启用
|
|
8
|
+
*/
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* 插件UI是否展示
|
|
12
|
+
*/
|
|
13
|
+
visible?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 插件的配置项
|
|
16
|
+
*/
|
|
17
|
+
config?: unknown;
|
|
18
|
+
}
|
|
19
|
+
interface BaseOptions {
|
|
20
|
+
/** 是否是用户行为 */
|
|
21
|
+
userAction?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 插件基本事件
|
|
25
|
+
*/
|
|
26
|
+
declare type EventMap<PluginState> = {
|
|
27
|
+
/**
|
|
28
|
+
* 插件被销毁
|
|
29
|
+
*/
|
|
30
|
+
dispose: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* 插件状态变化
|
|
33
|
+
* @param params.state 最新的State
|
|
34
|
+
* @param params.prevState 上一个State
|
|
35
|
+
* @param params.userAction 是否是用户触发
|
|
36
|
+
*/
|
|
37
|
+
stateChange: (params: {
|
|
38
|
+
state: PluginState;
|
|
39
|
+
prevState?: PluginState;
|
|
40
|
+
userAction: boolean;
|
|
41
|
+
}) => void;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* plugin 的基本控制器
|
|
45
|
+
*/
|
|
46
|
+
declare abstract class Controller<PluginState extends State, PluginEventMap extends EventMap<PluginState>> {
|
|
47
|
+
five: Five;
|
|
48
|
+
/**
|
|
49
|
+
* 插件事件钩子
|
|
50
|
+
*/
|
|
51
|
+
hooks: Subscribe<PluginEventMap>;
|
|
52
|
+
/**
|
|
53
|
+
* 当前状态
|
|
54
|
+
* @description
|
|
55
|
+
* ```text
|
|
56
|
+
* 可以通过 plugin.state 和 plugin.setState 来获取和设置。
|
|
57
|
+
* 通过 state 设置后,plugin 会通过合适的动画运动来达到设置的效果。
|
|
58
|
+
* 来迎合一些通过数据驱动的场景。
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
abstract state: PluginState;
|
|
62
|
+
constructor(five: Five);
|
|
63
|
+
/**
|
|
64
|
+
* 获取当前的插件状态,如果当初插件内存在需要通过动画变更的 state 值,则通过此方法可以得到中间状态
|
|
65
|
+
*/
|
|
66
|
+
getCurrentState(): PluginState;
|
|
67
|
+
/**
|
|
68
|
+
* 插件自身DOM添加到父容器
|
|
69
|
+
* @param wrapper
|
|
70
|
+
*/
|
|
71
|
+
appendTo?(wrapper: Element): void;
|
|
72
|
+
/**
|
|
73
|
+
* 展示UI
|
|
74
|
+
*/
|
|
75
|
+
show?(options?: BaseOptions): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* 隐藏UI
|
|
78
|
+
*/
|
|
79
|
+
hide?(options?: BaseOptions): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* 启用插件,让插件能够响应交互
|
|
82
|
+
*/
|
|
83
|
+
abstract enable(options?: BaseOptions): void;
|
|
84
|
+
/**
|
|
85
|
+
* 禁用插件,让插件停止响应交互
|
|
86
|
+
*/
|
|
87
|
+
abstract disable(options?: BaseOptions): void;
|
|
88
|
+
/**
|
|
89
|
+
* 插件进行销毁
|
|
90
|
+
*/
|
|
91
|
+
abstract dispose(): void;
|
|
92
|
+
/**
|
|
93
|
+
* 设置state
|
|
94
|
+
* @param state 插件的目标状态
|
|
95
|
+
* @param options 配置项
|
|
96
|
+
*/
|
|
97
|
+
abstract setState(state: Partial<PluginState>, options?: BaseOptions): void;
|
|
98
|
+
}
|
|
99
|
+
export type { State, EventMap, BaseOptions };
|
|
100
|
+
export { Controller };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Subscribe } from '@realsee/five';
|
|
2
|
+
/**
|
|
3
|
+
* plugin 的基本控制器
|
|
4
|
+
*/
|
|
5
|
+
class Controller {
|
|
6
|
+
constructor(five) {
|
|
7
|
+
Object.defineProperty(this, "five", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
configurable: true,
|
|
10
|
+
writable: true,
|
|
11
|
+
value: void 0
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* 插件事件钩子
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(this, "hooks", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true,
|
|
20
|
+
value: new Subscribe()
|
|
21
|
+
});
|
|
22
|
+
this.five = five;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 获取当前的插件状态,如果当初插件内存在需要通过动画变更的 state 值,则通过此方法可以得到中间状态
|
|
26
|
+
*/
|
|
27
|
+
getCurrentState() {
|
|
28
|
+
return this.state;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export { Controller };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as BasePlugin from './BasePlugin';
|
|
2
|
+
declare type State = BasePlugin.State;
|
|
3
|
+
interface EventMap<PluginState, PluginData> extends BasePlugin.EventMap<PluginState> {
|
|
4
|
+
/** 数据变更 */
|
|
5
|
+
dataChange: (data: PluginData, prevData?: PluginData) => void;
|
|
6
|
+
/** 数据加载完成 */
|
|
7
|
+
dataLoaded: (data: PluginData) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 插件的基础数据
|
|
11
|
+
*/
|
|
12
|
+
interface ServerData {
|
|
13
|
+
/**
|
|
14
|
+
* 数据版本
|
|
15
|
+
*/
|
|
16
|
+
version: number;
|
|
17
|
+
/**
|
|
18
|
+
* 数据
|
|
19
|
+
*/
|
|
20
|
+
data?: unknown;
|
|
21
|
+
}
|
|
22
|
+
declare abstract class Controller<PluginState extends State, PluginEventMap extends EventMap<PluginState, PluginData>, PluginServerData extends ServerData, PluginData> extends BasePlugin.Controller<PluginState, PluginEventMap> {
|
|
23
|
+
protected abstract data?: PluginData;
|
|
24
|
+
/**
|
|
25
|
+
* 加载插件依赖数据
|
|
26
|
+
* @param serverData 插件数据
|
|
27
|
+
* @param state 插件 State
|
|
28
|
+
*/
|
|
29
|
+
abstract load(serverData: PluginServerData, state?: PluginState, userAction?: boolean): Promise<void>;
|
|
30
|
+
/** 把原始数据转化为插件数据 */
|
|
31
|
+
protected abstract formatData?(serverData: PluginServerData): Promise<PluginData>;
|
|
32
|
+
}
|
|
33
|
+
export type { State, EventMap, ServerData };
|
|
34
|
+
export { Controller };
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
import { COMPASS_IMAGE } from '../Assets/compass';
|
|
21
21
|
|
|
22
22
|
function add_css(target) {
|
|
23
|
-
append_styles(target, "svelte-
|
|
23
|
+
append_styles(target, "svelte-p7yk9v", ".floorplan-plugin__compass.svelte-p7yk9v{position:absolute;left:50%;top:-46px;width:231px;height:41px;will-change:opacity;transform-origin:center 184px}.floorplan-plugin__compass-image.svelte-p7yk9v{width:100%;height:100%;position:absolute;left:0;top:0;opacity:0.1;background-repeat:no-repeat;background-size:100% 100%}.floorplan-plugin__compass-text.svelte-p7yk9v{position:absolute;left:50%;top:15px;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:10px;color:#fff}");
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
// (14:0) {#if
|
|
26
|
+
// (14:0) {#if canCompassShow}
|
|
27
27
|
function create_if_block(ctx) {
|
|
28
28
|
let div1;
|
|
29
29
|
let div0;
|
|
@@ -38,11 +38,11 @@ function create_if_block(ctx) {
|
|
|
38
38
|
t0 = space();
|
|
39
39
|
span = element("span");
|
|
40
40
|
t1 = text(/*northDesc*/ ctx[0]);
|
|
41
|
-
attr(div0, "class", "floorplan-plugin__compass-image svelte-
|
|
41
|
+
attr(div0, "class", "floorplan-plugin__compass-image svelte-p7yk9v");
|
|
42
42
|
set_style(div0, "background-image", `url(${COMPASS_IMAGE})`);
|
|
43
|
-
attr(span, "class", "floorplan-plugin__compass-text svelte-
|
|
44
|
-
attr(div1, "class", "floorplan-plugin__compass svelte-
|
|
45
|
-
set_style(div1, "transform", /*compassTransformStyle*/ ctx[
|
|
43
|
+
attr(span, "class", "floorplan-plugin__compass-text svelte-p7yk9v");
|
|
44
|
+
attr(div1, "class", "floorplan-plugin__compass svelte-p7yk9v");
|
|
45
|
+
set_style(div1, "transform", /*compassTransformStyle*/ ctx[2], false);
|
|
46
46
|
},
|
|
47
47
|
m(target, anchor) {
|
|
48
48
|
insert(target, div1, anchor);
|
|
@@ -62,7 +62,7 @@ function create_if_block(ctx) {
|
|
|
62
62
|
|
|
63
63
|
function create_fragment(ctx) {
|
|
64
64
|
let if_block_anchor;
|
|
65
|
-
let if_block = /*
|
|
65
|
+
let if_block = /*canCompassShow*/ ctx[1] && create_if_block(ctx);
|
|
66
66
|
|
|
67
67
|
return {
|
|
68
68
|
c() {
|
|
@@ -74,7 +74,7 @@ function create_fragment(ctx) {
|
|
|
74
74
|
insert(target, if_block_anchor, anchor);
|
|
75
75
|
},
|
|
76
76
|
p(ctx, [dirty]) {
|
|
77
|
-
if (/*
|
|
77
|
+
if (/*canCompassShow*/ ctx[1]) if_block.p(ctx, dirty);
|
|
78
78
|
},
|
|
79
79
|
i: noop,
|
|
80
80
|
o: noop,
|
|
@@ -98,16 +98,16 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
98
98
|
? void 0
|
|
99
99
|
: _a.northRad;
|
|
100
100
|
|
|
101
|
-
const
|
|
101
|
+
const canCompassShow = typeof northRad === 'number';
|
|
102
|
+
const rotate = !northRad ? 0 : rad2Deg(northRad);
|
|
102
103
|
const compassTransformStyle = `translateX(-50%) translateZ(10px) rotate(${-rotate + 90}deg)`;
|
|
103
|
-
const canShowCompass = typeof northRad === 'number';
|
|
104
104
|
|
|
105
105
|
$$self.$$set = $$props => {
|
|
106
106
|
if ('floorplanData' in $$props) $$invalidate(3, floorplanData = $$props.floorplanData);
|
|
107
107
|
if ('northDesc' in $$props) $$invalidate(0, northDesc = $$props.northDesc);
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
-
return [northDesc,
|
|
110
|
+
return [northDesc, canCompassShow, compassTransformStyle, floorplanData];
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
class Component extends SvelteComponent {
|