@realsee/dnalogel 2.0.0-alpha.3 → 2.0.0-alpha.6
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/CHANGELOG.md +16 -0
- package/TERMS.txt +56 -0
- package/dist/dnalogel.cjs.js +2 -2
- package/dist/dnalogel.es.js +697 -62
- package/dist/dnalogel.umd.js +2 -2
- package/dist/style.css +1 -1
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +29 -0
- package/docs/assets/icons.css +1043 -0
- package/docs/assets/icons.png +0 -0
- package/docs/assets/icons@2x.png +0 -0
- package/docs/assets/main.js +52 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1413 -0
- package/docs/assets/widgets.png +0 -0
- package/docs/assets/widgets@2x.png +0 -0
- package/docs/classes/ModelRoomLabelController.html +20 -0
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -0
- package/docs/enums/ModelFloorplanErrorType.html +1 -0
- package/docs/index.html +10 -0
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -0
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -0
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -0
- package/docs/interfaces/ModelFloorplanParameterType.html +1 -0
- package/docs/interfaces/ModelFloorplanViewEvent.html +5 -0
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -0
- package/docs/interfaces/PanoCompassPluginData.html +1 -0
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -0
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +11 -0
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -0
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -0
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -0
- package/docs/interfaces/RoomLabel.html +13 -0
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +1 -0
- package/docs/modules.html +26 -0
- package/libs/CSS3DRenderPlugin/index.js +1 -1
- package/libs/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
- package/libs/PanoCompassPlugin/Assets/roomInfoIcon.js +1 -0
- package/libs/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
- package/libs/PanoCompassPlugin/getRoomInfoInstance.js +48 -0
- package/libs/PanoCompassPlugin/index.d.ts +29 -3
- package/libs/PanoCompassPlugin/index.js +106 -36
- package/libs/PanoRulerPlugin/index.d.ts +31 -0
- package/libs/PanoRulerPlugin/index.js +398 -0
- package/libs/PanoRulerPlugin/style.d.ts +2 -0
- package/libs/PanoRulerPlugin/style.js +88 -0
- package/libs/PanoRulerPlugin/typings.d.ts +21 -0
- package/libs/PanoRulerPlugin/typings.js +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte +3 -3
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte.map +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -0
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +3 -1
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +2 -0
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +4 -3
- package/libs/floorplan/constant.d.ts +5 -0
- package/libs/floorplan/constant.js +6 -0
- package/libs/floorplan/typings/floorplanServerData.d.ts +4 -0
- package/libs/index.d.ts +4 -1
- package/libs/index.js +4 -1
- package/libs/shared-utils/getPxmm.d.ts +6 -1
- package/libs/shared-utils/getPxmm.js +26 -12
- package/package.json +4 -2
package/libs/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export type { PanoCursorRaycasterPluginExportType } from './PanoCursorRaycasterP
|
|
|
4
4
|
export { default as PanoCursorRaycasterPlugin } from './PanoCursorRaycasterPlugin';
|
|
5
5
|
export type { ModelRoomLabelController, ModelRoomLabelPluginData, RoomLabel, ModelRoomLabelPluginReturnType, ModelRoomLabelPluginParameters, } from './ModelRoomLabelPlugin';
|
|
6
6
|
export { default as ModelRoomLabelPlugin } from './ModelRoomLabelPlugin';
|
|
7
|
+
export * from './floorplan/constant';
|
|
7
8
|
export type { TopviewFloorplanPluginReturnType, TopviewFloorplanPluginParameterType, } from './floorplan/TopviewFloorplanPlugin';
|
|
8
9
|
export { default as TopviewFloorplanPlugin } from './floorplan/TopviewFloorplanPlugin';
|
|
9
10
|
export type { PanoFloorplanRadarPluginReturnType, PanoFloorplanRadarPluginParameterType, } from './floorplan/PanoFloorplanRadarPlugin';
|
|
@@ -15,5 +16,7 @@ export { default as ModelChassisCompassPlugin } from './ModelChassisCompassPlugi
|
|
|
15
16
|
export type { ModelEntryDoorGuidePluginParameterType, ModelEntryDoorGuidePluginData, ModelEntryDoorGuidePluginExportType, } from './ModelEntryDoorGuidePlugin';
|
|
16
17
|
export { default as ModelEntryDoorGuidePlugin } from './ModelEntryDoorGuidePlugin';
|
|
17
18
|
export { default as CameraMovementPlugin } from './CameraMovementPlugin';
|
|
19
|
+
export type { PanoRulerPluginParameterType, PanoRulerPluginExportType, PanoRulerPluginOptions, } from './PanoRulerPlugin';
|
|
20
|
+
export { default as PanoRulerPlugin } from './PanoRulerPlugin';
|
|
18
21
|
export type { PanoCompassPluginParameterType, PanoCompassPluginExportType, PanoCompassPluginData, } from './PanoCompassPlugin';
|
|
19
|
-
export { default as
|
|
22
|
+
export { default as PanoCompassPlugin } from './PanoCompassPlugin';
|
package/libs/index.js
CHANGED
|
@@ -2,10 +2,13 @@ export { default as ModelViewPlugin } from './ModelViewPlugin';
|
|
|
2
2
|
export { default as CSS3DRenderPlugin } from './CSS3DRenderPlugin';
|
|
3
3
|
export { default as PanoCursorRaycasterPlugin } from './PanoCursorRaycasterPlugin';
|
|
4
4
|
export { default as ModelRoomLabelPlugin } from './ModelRoomLabelPlugin';
|
|
5
|
+
// floorplan
|
|
6
|
+
export * from './floorplan/constant';
|
|
5
7
|
export { default as TopviewFloorplanPlugin } from './floorplan/TopviewFloorplanPlugin';
|
|
6
8
|
export { default as PanoFloorplanRadarPlugin } from './floorplan/PanoFloorplanRadarPlugin';
|
|
7
9
|
export { default as ModelFloorplanPlugin } from './floorplan/ModelFloorplanPlugin';
|
|
8
10
|
export { default as ModelChassisCompassPlugin } from './ModelChassisCompassPlugin';
|
|
9
11
|
export { default as ModelEntryDoorGuidePlugin } from './ModelEntryDoorGuidePlugin';
|
|
10
12
|
export { default as CameraMovementPlugin } from './CameraMovementPlugin';
|
|
11
|
-
export { default as
|
|
13
|
+
export { default as PanoRulerPlugin } from './PanoRulerPlugin';
|
|
14
|
+
export { default as PanoCompassPlugin } from './PanoCompassPlugin';
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { Five } from '@realsee/five';
|
|
2
|
+
import { FLOOR_PLAN_ATTACHED_TO } from '../floorplan/constant';
|
|
3
|
+
interface GetPxmmOption {
|
|
4
|
+
attachedTo: FLOOR_PLAN_ATTACHED_TO;
|
|
5
|
+
}
|
|
2
6
|
/**
|
|
3
7
|
* 获取「在俯视图」状态下,模型 mm 与屏幕像素 px 的对应关系,即每 mm 对应多少 px
|
|
4
8
|
* @param five five
|
|
5
9
|
*/
|
|
6
|
-
export default function getPxmm(five: Five, container: Element): number;
|
|
10
|
+
export default function getPxmm(five: Five, container: Element, floorIndex: number, options?: GetPxmmOption): number;
|
|
11
|
+
export {};
|
|
@@ -1,20 +1,34 @@
|
|
|
1
|
+
import { FLOOR_PLAN_ATTACHED_TO } from '../floorplan/constant';
|
|
1
2
|
import * as THREE from 'three';
|
|
2
3
|
/**
|
|
3
4
|
* 获取「在俯视图」状态下,模型 mm 与屏幕像素 px 的对应关系,即每 mm 对应多少 px
|
|
4
5
|
* @param five five
|
|
5
6
|
*/
|
|
6
|
-
export default function getPxmm(five, container) {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
export default function getPxmm(five, container, floorIndex, options) {
|
|
8
|
+
const maxFloorIndex = Math.max(...five.work.observers.map((ob) => ob.floorIndex));
|
|
9
|
+
function getFloorY(floorIndex) {
|
|
10
|
+
return floorIndex > maxFloorIndex
|
|
11
|
+
? five.model.bounding.max.y
|
|
12
|
+
: Math.max(...five.work.observers
|
|
13
|
+
.filter((ob) => ob.floorIndex === floorIndex)
|
|
14
|
+
.map((ob) => ob.standingPosition.y));
|
|
15
|
+
}
|
|
16
|
+
function getY() {
|
|
17
|
+
const currentFloorY = getFloorY(floorIndex);
|
|
18
|
+
const nextFloorY = getFloorY(floorIndex + 1);
|
|
19
|
+
const attachedTo = options?.attachedTo || FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER;
|
|
20
|
+
if (attachedTo === FLOOR_PLAN_ATTACHED_TO.BOUNDING_CENTER)
|
|
21
|
+
return (five.model.bounding.max.y + five.model.bounding.min.y) / 2;
|
|
22
|
+
else if (attachedTo === FLOOR_PLAN_ATTACHED_TO.CEILING)
|
|
23
|
+
return nextFloorY;
|
|
24
|
+
else
|
|
25
|
+
return currentFloorY;
|
|
26
|
+
}
|
|
27
|
+
const y = getY();
|
|
28
|
+
const originPosition = new THREE.Vector3(0, y, 0);
|
|
29
|
+
const originPositionXUnit = new THREE.Vector3(1, y, 0);
|
|
30
|
+
const mouse = originPosition.clone().project(five.camera);
|
|
31
|
+
const xUnitMouse = originPositionXUnit.clone().project(five.camera);
|
|
18
32
|
const pxmm = Math.abs((xUnitMouse.x - mouse.x) / 1000) * (container.getBoundingClientRect().width / 2);
|
|
19
33
|
return pxmm;
|
|
20
34
|
}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"author": "REALSEE-DEVELOPER",
|
|
6
6
|
"repository": "https://github.com/realsee-developer/dnalogel.git",
|
|
7
7
|
"private": false,
|
|
8
|
-
"version": "2.0.0-alpha.
|
|
8
|
+
"version": "2.0.0-alpha.6",
|
|
9
9
|
"license": "SEE LICENSE IN TERMS.txt",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build:dev": "yarn tsb && vite build --watch",
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
20
|
"libs",
|
|
21
|
-
"dist"
|
|
21
|
+
"dist",
|
|
22
|
+
"docs",
|
|
23
|
+
"TERMS.txt"
|
|
22
24
|
],
|
|
23
25
|
"devDependencies": {
|
|
24
26
|
"@babel/core": "^7.17.5",
|