@realsee/dnalogel 2.0.0-alpha.35 → 2.0.0-alpha.36
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/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/base/BasePlugin.d.ts +100 -0
- package/dist/base/BasePluginWithData.d.ts +34 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +70 -78
- package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
- package/dist/floorplan/ModelFloorplanPlugin/index.js +1059 -569
- 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.es.js +2184 -1411
- package/dist/index.js +2188 -1415
- package/dist/index.umd.js +2142 -1369
- package/dist/shared-utils/five/changeMode.d.ts +4 -1
- package/dist/shared-utils/getPxmm.d.ts +8 -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/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 +17 -27
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +21 -41
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +16 -36
- 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/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 +70 -78
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +434 -274
- 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/{typings/events.type.js → typing.js} +0 -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/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/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
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import { Group } from 'three';
|
|
2
|
-
export
|
|
2
|
+
export interface MouseGroupParameter {
|
|
3
|
+
isMobile?: boolean;
|
|
4
|
+
useNormalVector?: boolean;
|
|
5
|
+
ballColor?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function getMouseGroup(params: MouseGroupParameter): Group;
|
|
@@ -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,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 };
|
|
@@ -1,66 +1,45 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { BaseOptions } from '../../base/BasePlugin';
|
|
2
|
+
import type { Five } from '@realsee/five';
|
|
3
|
+
import type { ShowState } from '../utils/correctFiveState';
|
|
3
4
|
import type { FloorplanServerData } from '../typings/floorplanServerData';
|
|
4
|
-
import type {
|
|
5
|
-
import
|
|
6
|
-
export
|
|
7
|
-
northDesc?: string;
|
|
8
|
-
selector?: string | Element;
|
|
9
|
-
scale?: number;
|
|
10
|
-
modelOpacity?: number;
|
|
11
|
-
autoShowEnable?: boolean;
|
|
12
|
-
hoverEnable?: boolean;
|
|
13
|
-
compassEnable?: boolean;
|
|
14
|
-
ruleLabelsEnable?: boolean;
|
|
15
|
-
roomLabelsEnable?: boolean;
|
|
16
|
-
cameraImageUrl?: string;
|
|
17
|
-
attachedTo?: FLOOR_PLAN_ATTACHED_TO;
|
|
18
|
-
getLabelElement?: (room: FloorplanRoomItem) => Element | null;
|
|
19
|
-
}
|
|
20
|
-
export declare type ModelFloorplanPluginsConfigs = Omit<ModelFloorplanParameterType, 'selector' | 'scale'>;
|
|
21
|
-
export interface ModelFloorplanPluginsShowOpts {
|
|
22
|
-
floorIndex?: number;
|
|
23
|
-
isAutoShow?: boolean;
|
|
24
|
-
modelOpacity?: number;
|
|
25
|
-
immediately?: boolean;
|
|
26
|
-
userAction?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export declare const MODEL_FLOORPLAN_PLUGIN_NAME = "modelFloorplanPlugin";
|
|
29
|
-
export default class ModelFloorplanPluginController {
|
|
5
|
+
import type { State, EventMap, ShowOptions, HideOptions, Parameters, PluginData, PluginServerData } from './typing';
|
|
6
|
+
import * as BasePlugin from '../../base/BasePluginWithData';
|
|
7
|
+
export declare class Controller extends BasePlugin.Controller<State, EventMap, PluginServerData, PluginData> {
|
|
30
8
|
name: string;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
width: number;
|
|
38
|
-
height: number;
|
|
39
|
-
};
|
|
9
|
+
state: State;
|
|
10
|
+
protected data?: PluginData;
|
|
11
|
+
/** 展示户型图时,需要正确的状态 */
|
|
12
|
+
protected showState: ShowState;
|
|
13
|
+
/** show 动画的公共 Promise */
|
|
14
|
+
protected showPromise?: Promise<void>;
|
|
40
15
|
private app?;
|
|
41
|
-
private pxmm;
|
|
42
|
-
private five;
|
|
43
16
|
private panoIndex;
|
|
44
17
|
private floorIndex;
|
|
45
|
-
private configs;
|
|
46
|
-
private lastPanoramaLongitude;
|
|
47
18
|
private selector?;
|
|
48
|
-
|
|
19
|
+
/** 公共 Promise 的 reject 方法 */
|
|
20
|
+
private showRejection?;
|
|
21
|
+
/** 户型图父容器 */
|
|
49
22
|
private wrapper?;
|
|
23
|
+
/** 户型图主容器 */
|
|
50
24
|
private container;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
private
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
25
|
+
/** 展示户型图图前,Five 的 Panorama Longitude */
|
|
26
|
+
private lastPanoramaLongitude;
|
|
27
|
+
/** 户型图大小 */
|
|
28
|
+
private size;
|
|
29
|
+
/** 是否已经执行过事件监听 */
|
|
30
|
+
private hasAddedEventListener;
|
|
31
|
+
/** 上一次隐藏是否是用户调用了 hide 导致的 */
|
|
32
|
+
private isHiddenByHideFunc;
|
|
33
|
+
constructor(five: Five, params?: Parameters);
|
|
34
|
+
load(serverData: PluginServerData | FloorplanServerData, state?: Partial<State>, userAction?: boolean): Promise<void>;
|
|
60
35
|
/** 把插件的渲染DOM插入到对应的容器中去 */
|
|
61
36
|
appendTo(wrapper: Element): this;
|
|
62
|
-
/**
|
|
63
|
-
|
|
37
|
+
/** 启用插件 */
|
|
38
|
+
enable(options?: BaseOptions): void;
|
|
39
|
+
/** 禁用插件 */
|
|
40
|
+
disable(options?: BaseOptions): void;
|
|
41
|
+
/** 销毁插件 */
|
|
42
|
+
dispose: () => void;
|
|
64
43
|
/** 展示户型图
|
|
65
44
|
* 1. show 函数大部分情况下需要耗时
|
|
66
45
|
* 2. 如果当前已经在展示中,将不会触发任何事件
|
|
@@ -71,35 +50,48 @@ export default class ModelFloorplanPluginController {
|
|
|
71
50
|
* @param opts.modelOpacity 模型透明度
|
|
72
51
|
* @param opts.immediately 是否立即展示
|
|
73
52
|
* @param opts.isAutoShow 是否是自动展示
|
|
53
|
+
* @param opts.userAction 是否是用户行为
|
|
74
54
|
*/
|
|
75
|
-
show: (
|
|
55
|
+
show: (options?: Omit<Partial<ShowOptions>, 'isAutoShow'>) => Promise<void>;
|
|
76
56
|
/** 隐藏户型图 */
|
|
77
|
-
hide: (options?:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
private
|
|
86
|
-
private
|
|
57
|
+
hide: (options?: Partial<HideOptions>) => Promise<void>;
|
|
58
|
+
/** 更改插件 State */
|
|
59
|
+
setState(state: Partial<State>, options?: BaseOptions): void;
|
|
60
|
+
/** 更新户型图大小 */
|
|
61
|
+
updateSize: () => void;
|
|
62
|
+
protected formatData(serverData: PluginServerData): Promise<PluginData>;
|
|
63
|
+
private _disable;
|
|
64
|
+
private _enable;
|
|
65
|
+
private _show;
|
|
66
|
+
private _hide;
|
|
67
|
+
private updateState;
|
|
68
|
+
/** 如果用户是通过 selector 设置父容器,需要在 modelLoaded 之后把 container 自动放到父容器里
|
|
69
|
+
*
|
|
70
|
+
* - TODO: 等 selector 功能下掉之后删除这个逻辑
|
|
71
|
+
*/
|
|
72
|
+
private initContainer;
|
|
87
73
|
private handleClick;
|
|
88
|
-
private
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
74
|
+
private addEventListener;
|
|
75
|
+
private removeEventListener;
|
|
76
|
+
/** modelLoaded 之后自动执行 append container 操作 */
|
|
77
|
+
private onFiveModelLoaded;
|
|
78
|
+
/** 更改模型时,自动隐藏户型图 */
|
|
79
|
+
private onFiveModeChange;
|
|
80
|
+
/** 惯性结束后,判断能否自动展示户型图 */
|
|
81
|
+
private onFiveInteriaPan;
|
|
93
82
|
/** panoIndex 改变时,更新 floorIndex */
|
|
94
|
-
private
|
|
95
|
-
/**
|
|
96
|
-
private
|
|
83
|
+
private onFivePanoArrived;
|
|
84
|
+
/** cameraUpdate 时判断户型图是否应该自动隐藏 */
|
|
85
|
+
private onFiveCameraUpdate;
|
|
97
86
|
/** 在户型图展示时阻止多指操作, 阻止鼠标放大 */
|
|
98
|
-
private
|
|
99
|
-
/**
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
87
|
+
private onFiveWantsGesture;
|
|
88
|
+
/** 户型图展示中,转动三维模型,结束时应该自动修复模型状态 */
|
|
89
|
+
private onFiveWantsPanGesture;
|
|
90
|
+
/** 阻止点击分间走点 */
|
|
91
|
+
private onFiveWantsTapGesture;
|
|
92
|
+
/** 从 Panorama 切换到其他模态时,记录当前的相机水平视角 */
|
|
93
|
+
private onFiveWantsChangeMode;
|
|
94
|
+
/** 模型楼层高亮改变时,自动进行楼层切换 */
|
|
95
|
+
private onModelShownFloorChange;
|
|
104
96
|
private render;
|
|
105
97
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import type { Parameters } from './typing';
|
|
1
2
|
import type { FivePlugin } from '@realsee/five';
|
|
2
|
-
import
|
|
3
|
-
export declare const ModelFloorplanPlugin: FivePlugin<
|
|
3
|
+
import { Controller } from './Controller';
|
|
4
|
+
export declare const ModelFloorplanPlugin: FivePlugin<undefined | Parameters, Controller>;
|
|
5
|
+
export declare type ModelFloorplanPluginParameterType = Parameters | undefined;
|
|
6
|
+
export declare type ModelFloorplanPluginReturnType = InstanceType<typeof Controller>;
|
|
4
7
|
export default ModelFloorplanPlugin;
|
|
5
|
-
export declare type ModelFloorplanPluginReturnType = FloorplanPluginController;
|
|
6
|
-
export type { ModelFloorplanViewEvent } from './typings/events.type';
|
|
7
|
-
export type { FloorplanErrorType as ModelFloorplanErrorType } from './utils/constant';
|
|
8
|
-
export type { ModelFloorplanPluginsConfigs, ModelFloorplanParameterType } from './Controller';
|
|
9
|
-
export type { FloorplanEventHandlers as ModelFloorplanEventHandlers } from './typings/events.type';
|