@realsee/dnalogel 3.43.0 → 3.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/CSS3DRenderPlugin/utils/three/CSS3DObject.d.ts +4 -2
- package/dist/CSS3DRenderPlugin/utils/three/CSS3DRenderer.d.ts +2 -1
- package/dist/CSS3DRenderPlugin/utils/three/CSS3DSprite.d.ts +4 -0
- package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +6 -1
- package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Controller/index.d.ts +2 -0
- package/dist/Sculpt/Meshes/Line.d.ts +19 -1
- package/dist/Sculpt/utils/color.d.ts +1 -1
- package/dist/index.cjs.js +102 -68
- package/dist/index.js +7374 -7116
- package/dist/index.umd.js +106 -72
- package/dist/shared-utils/five/getPosition.d.ts +12 -4
- package/dist/shared-utils/five/initialCSS3DRender.d.ts +2 -0
- package/dist/shared-utils/math/deg2Rad.d.ts +1 -1
- package/dist/shared-utils/math/rad2Deg.d.ts +1 -1
- package/dist/shared-utils/positionToVector3.d.ts +6 -6
- package/{libs/shared-utils/three/PointSelector.d.ts → dist/shared-utils/three/PointSelector/index.d.ts} +23 -7
- package/dist/shared-utils/three/{PointHelper.d.ts → PointSelector/utils/PointHelper.d.ts} +11 -3
- package/dist/shared-utils/three/PointSelector/utils/PointHelper2.d.ts +30 -0
- package/dist/shared-utils/three/{PointSelectorHelper.d.ts → PointSelector/utils/PointSelectorHelper.d.ts} +9 -10
- package/dist/shared-utils/three/PointSelector/utils/typing.d.ts +8 -0
- package/dist/shared-utils/three/index.d.ts +2 -3
- package/libs/AreaMakerPlugin/Controller.js +5 -18
- package/libs/AreaMakerPlugin/index.js +4 -17
- package/libs/AreaMakerPlugin/utils/Item.js +13 -26
- package/libs/CSS3DRenderPlugin/Controller.js +9 -6
- package/libs/CSS3DRenderPlugin/index.js +12 -9
- package/libs/CSS3DRenderPlugin/utils/getAllCSS3DObject.js +6 -6
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.d.ts +4 -2
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +73 -56
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +11 -4
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRenderer.d.ts +2 -1
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRenderer.js +14 -14
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DSprite.d.ts +4 -0
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DSprite.js +13 -0
- package/libs/CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js +85 -0
- package/libs/CruisePlugin/BaseController.js +20 -33
- package/libs/CruisePlugin/Move.js +25 -23
- package/libs/CruisePlugin/Work.js +10 -8
- package/libs/CruisePlugin/index.js +23 -21
- package/libs/CurrentPanoImagePlugin/Controller.js +30 -43
- package/libs/CurrentPanoImagePlugin/index.js +5 -18
- package/libs/GuideLinePlugin/Controller.js +15 -13
- package/libs/GuideLinePlugin/GuideLineItem.js +19 -17
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +4 -5
- package/libs/GuideLinePlugin/GuideLineModeItem.js +21 -19
- package/libs/GuideLinePlugin/index.js +23 -21
- package/libs/ModelMakerPlugin/Controller.js +19 -30
- package/libs/ModelMakerPlugin/index.js +11 -22
- package/libs/ModelTVVideoPlugin/Plugin.js +13 -10
- package/libs/ModelTVVideoPlugin/index.js +12 -9
- package/libs/Object3DHelperPlugin/Controller.js +7 -5
- package/libs/Object3DHelperPlugin/index.js +23 -21
- package/libs/PanoCompassPlugin/Controller.js +18 -15
- package/libs/PanoCompassPlugin/index.js +21 -18
- package/libs/PanoDoorLabelPlugin/BaseController.js +24 -37
- package/libs/PanoDoorLabelPlugin/Controller.js +56 -69
- package/libs/PanoDoorLabelPlugin/index.js +5 -18
- package/libs/PanoMeasurePlugin/Components/Controller0.js +40 -47
- package/libs/PanoMeasurePlugin/Components/Controller1.js +72 -79
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +6 -1
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +53 -39
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Controller/EditController.js +177 -153
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +1 -1
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +60 -74
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Controller/index.js +59 -60
- package/libs/PanoMeasurePlugin/Model/area.js +30 -44
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +3 -16
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +42 -49
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +1 -1
- package/libs/PanoMeasurePlugin/index.js +35 -40
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +23 -36
- package/libs/PanoSpatialTagPlugin/Plugin.js +41 -38
- package/libs/PanoSpatialTagPlugin/index.js +10 -7
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +29 -43
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +55 -69
- package/libs/PanoTagPlugin/Components/Tag/index.js +9 -19
- package/libs/PanoTagPlugin/Components/TagContainer.js +42 -52
- package/libs/PanoTagPlugin/Components/TagItem.js +9 -19
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +23 -33
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +29 -39
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +11 -21
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +18 -28
- package/libs/PanoTagPlugin/controller/TagRender.js +18 -16
- package/libs/PanoTagPlugin/controller/TagUtil.js +12 -9
- package/libs/PanoTagPlugin/controller/index.js +27 -25
- package/libs/PanoTagPlugin/index.js +28 -26
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +43 -57
- package/libs/PanoVideoPlugin/Controller.js +52 -65
- package/libs/PanoVideoPlugin/VideoMeshController.js +11 -25
- package/libs/PanoVideoPlugin/index.js +8 -21
- package/libs/PipelinePlugin/Controller.js +44 -57
- package/libs/PipelinePlugin/index.js +5 -18
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +20 -34
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +16 -30
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +39 -53
- package/libs/Sculpt/Meshes/Box.js +3 -3
- package/libs/Sculpt/Meshes/Cylinder.js +14 -14
- package/libs/Sculpt/Meshes/Line.d.ts +19 -1
- package/libs/Sculpt/Meshes/Line.js +40 -41
- package/libs/Sculpt/Meshes/LineWithDots.js +5 -6
- package/libs/Sculpt/Meshes/Point.js +3 -3
- package/libs/Sculpt/Meshes/Polyline.js +3 -3
- package/libs/Sculpt/Meshes/Prism.js +11 -12
- package/libs/Sculpt/Meshes/Rectangle.js +3 -3
- package/libs/Sculpt/Objects/Point/Editor.js +10 -10
- package/libs/Sculpt/Objects/Polygon/Editor.js +6 -6
- package/libs/Sculpt/Objects/Polyline/Editor.js +4 -4
- package/libs/Sculpt/index.js +3 -3
- package/libs/Sculpt/utils/Modules/Global.js +1 -1
- package/libs/Sculpt/utils/color.d.ts +1 -1
- package/libs/Sculpt/utils/three/ColoredMesh.js +3 -3
- package/libs/base/BasePlugin.js +4 -4
- package/libs/floorplan/Components/Compass.js +29 -31
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +9 -22
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +6 -19
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +5 -18
- package/libs/floorplan/ModelFloorplanPlugin/index.js +5 -18
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +48 -61
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +5 -18
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +28 -41
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +5 -18
- package/libs/floorplan/index.js +3 -3
- package/libs/index.js +140 -137
- package/libs/shared-utils/five/getPosition.d.ts +12 -4
- package/libs/shared-utils/five/getPosition.js +23 -23
- package/libs/shared-utils/five/index.js +2 -2
- package/libs/shared-utils/five/initialCSS3DRender.d.ts +2 -0
- package/libs/shared-utils/five/initialCSS3DRender.js +17 -0
- package/libs/shared-utils/five/lookObject.js +3 -3
- package/libs/shared-utils/index.js +38 -40
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/math/deg2Rad.d.ts +1 -1
- package/libs/shared-utils/math/rad2Deg.d.ts +1 -1
- package/libs/shared-utils/positionToVector3.d.ts +6 -6
- package/{dist/shared-utils/three/PointSelector.d.ts → libs/shared-utils/three/PointSelector/index.d.ts} +23 -7
- package/libs/shared-utils/three/{PointSelector.js → PointSelector/index.js} +54 -45
- package/libs/shared-utils/three/{PointHelper.d.ts → PointSelector/utils/PointHelper.d.ts} +11 -3
- package/libs/shared-utils/three/PointSelector/utils/PointHelper.js +95 -0
- package/libs/shared-utils/three/PointSelector/utils/PointHelper2.d.ts +30 -0
- package/libs/shared-utils/three/PointSelector/utils/PointHelper2.js +153 -0
- package/libs/shared-utils/three/{PointSelectorHelper.d.ts → PointSelector/utils/PointSelectorHelper.d.ts} +9 -10
- package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.js +60 -0
- package/libs/{PanoMeasurePlugin/Modules/rangePiece → shared-utils/three/PointSelector/utils}/html.js +3 -4
- package/libs/shared-utils/three/PointSelector/utils/typing.d.ts +8 -0
- package/libs/shared-utils/three/index.d.ts +2 -3
- package/libs/shared-utils/three/index.js +3 -3
- package/package.json +3 -3
- package/dist/shared-utils/three/PointDomHelper.d.ts +0 -18
- package/libs/shared-utils/three/PointDomHelper.d.ts +0 -18
- package/libs/shared-utils/three/PointDomHelper.js +0 -62
- package/libs/shared-utils/three/PointHelper.js +0 -73
- package/libs/shared-utils/three/PointSelectorHelper.js +0 -52
- /package/dist/{PanoMeasurePlugin/Modules/rangePiece → shared-utils/three/PointSelector/utils}/html.d.ts +0 -0
- /package/libs/{PanoMeasurePlugin/Modules/rangePiece → shared-utils/three/PointSelector/utils}/html.d.ts +0 -0
|
@@ -1,15 +1,27 @@
|
|
|
1
|
-
import type { Five } from '@realsee/five';
|
|
2
|
-
import { PointSelectorHelper, type PointIntersection } from './PointSelectorHelper';
|
|
1
|
+
import type { Five, Mode as FiveMode } from '@realsee/five';
|
|
2
|
+
import { PointSelectorHelper, type PointIntersection, type PointSelectorHelperConfig } from './utils/PointSelectorHelper';
|
|
3
3
|
import type { Vector3 } from 'three';
|
|
4
|
-
import { Subscribe } from '
|
|
4
|
+
import { Subscribe } from '../../Subscribe';
|
|
5
|
+
export type { PointIntersection };
|
|
5
6
|
interface Config {
|
|
6
7
|
/**
|
|
7
8
|
* @description: 选点的两种模式, 'fixed' 为固定选点为屏幕中心点,拖动five画布来更新点,'cursor' 为跟随鼠标移动来更新点, 'auto' 则根据设备类型自动选择
|
|
8
9
|
* @default: 'auto'
|
|
9
10
|
*/
|
|
10
11
|
mode: 'fixed' | 'cursor' | 'auto';
|
|
11
|
-
|
|
12
|
+
/**
|
|
13
|
+
* @description 当鼠标位置没有模型时,是否生成一个虚拟点
|
|
14
|
+
* ```markdown
|
|
15
|
+
* true: 生成虚拟点
|
|
16
|
+
* false: 不生成虚拟点
|
|
17
|
+
* FiveMode[]: 指定的five mode下才生成虚拟点,推荐 ['Panorama']
|
|
18
|
+
* ```
|
|
19
|
+
* @default: true
|
|
20
|
+
*/
|
|
21
|
+
virtualPoint: boolean | FiveMode[];
|
|
22
|
+
helper: PointSelectorHelperConfig;
|
|
12
23
|
}
|
|
24
|
+
export type PointSelectorConfig = Partial<Config>;
|
|
13
25
|
type EventMap = {
|
|
14
26
|
/**
|
|
15
27
|
* @description: 与模型交点更新时触发,移出监听范围时为null
|
|
@@ -57,12 +69,17 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
57
69
|
private adherePointsRadius;
|
|
58
70
|
private lastFiveHelperVisible?;
|
|
59
71
|
private mousePosition;
|
|
72
|
+
private config;
|
|
60
73
|
private get mouseNdcPosition();
|
|
61
|
-
|
|
74
|
+
private get virtualPoint();
|
|
75
|
+
constructor(five: Five, config?: PointSelectorConfig);
|
|
62
76
|
enable(): void;
|
|
63
77
|
disable(): void;
|
|
64
78
|
dispose(): void;
|
|
65
|
-
setAdherePoints(points: Vector3[] | ((
|
|
79
|
+
setAdherePoints(points: Vector3[] | ((params: {
|
|
80
|
+
intersection: PointIntersection;
|
|
81
|
+
pointSelectorInstance: PointSelector;
|
|
82
|
+
}) => Vector3[]) | null, radius?: number): void;
|
|
66
83
|
/**
|
|
67
84
|
* @description: 主动触发一次选点
|
|
68
85
|
* @return: select 是否成功
|
|
@@ -104,4 +121,3 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
104
121
|
private renderScreenCenter;
|
|
105
122
|
private emitIntersectionUpdate;
|
|
106
123
|
}
|
|
107
|
-
export {};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var f = (
|
|
1
|
+
var P = Object.defineProperty, E = Object.defineProperties;
|
|
2
|
+
var S = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var p = Object.getOwnPropertySymbols;
|
|
4
|
+
var w = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var f = (n, s, e) => s in n ? P(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e, l = (n, s) => {
|
|
6
6
|
for (var e in s || (s = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var i = (
|
|
14
|
-
import { PointSelectorHelper as
|
|
15
|
-
import { isTouchDevice as y } from "
|
|
16
|
-
import
|
|
17
|
-
import { Subscribe as F } from "
|
|
18
|
-
import { getIntersectByNdcPosition as
|
|
19
|
-
const
|
|
20
|
-
class
|
|
7
|
+
w.call(s, e) && f(n, e, s[e]);
|
|
8
|
+
if (p)
|
|
9
|
+
for (var e of p(s))
|
|
10
|
+
C.call(s, e) && f(n, e, s[e]);
|
|
11
|
+
return n;
|
|
12
|
+
}, c = (n, s) => E(n, S(s));
|
|
13
|
+
var i = (n, s, e) => (f(n, typeof s != "symbol" ? s + "" : s, e), e);
|
|
14
|
+
import { PointSelectorHelper as b } from "./utils/PointSelectorHelper.js";
|
|
15
|
+
import { isTouchDevice as y } from "../../isTouchDevice.js";
|
|
16
|
+
import H from "hammerjs";
|
|
17
|
+
import { Subscribe as F } from "../../Subscribe.js";
|
|
18
|
+
import { getIntersectByNdcPosition as d } from "../../five/getPosition.js";
|
|
19
|
+
const h = () => !1;
|
|
20
|
+
class B extends F {
|
|
21
21
|
constructor(e, t) {
|
|
22
|
-
var
|
|
22
|
+
var a, u;
|
|
23
23
|
super();
|
|
24
24
|
/**
|
|
25
25
|
* @description: 不在 five canvas 上时为 true
|
|
@@ -40,6 +40,7 @@ class U extends F {
|
|
|
40
40
|
i(this, "adherePointsRadius", 0.1);
|
|
41
41
|
i(this, "lastFiveHelperVisible");
|
|
42
42
|
i(this, "mousePosition");
|
|
43
|
+
i(this, "config");
|
|
43
44
|
/**
|
|
44
45
|
* @description: 主动触发一次选点
|
|
45
46
|
* @return: select 是否成功
|
|
@@ -67,7 +68,7 @@ class U extends F {
|
|
|
67
68
|
clientY: e.center.y
|
|
68
69
|
}), !this.mouseNdcPosition)
|
|
69
70
|
return;
|
|
70
|
-
const t =
|
|
71
|
+
const t = d(this.five, this.mouseNdcPosition, { virtualPoint: this.virtualPoint });
|
|
71
72
|
t != null && t.face && this.select(t);
|
|
72
73
|
});
|
|
73
74
|
/**
|
|
@@ -80,7 +81,7 @@ class U extends F {
|
|
|
80
81
|
clientY: e.center.y
|
|
81
82
|
}), !this.mouseNdcPosition))
|
|
82
83
|
return;
|
|
83
|
-
const t =
|
|
84
|
+
const t = d(this.five, this.mouseNdcPosition, { virtualPoint: this.virtualPoint });
|
|
84
85
|
t != null && t.face && this.updatePointSelectorHelperIntersect(t);
|
|
85
86
|
});
|
|
86
87
|
/**
|
|
@@ -92,7 +93,7 @@ class U extends F {
|
|
|
92
93
|
clientY: e.center.y
|
|
93
94
|
}), !this.mouseNdcPosition)
|
|
94
95
|
return;
|
|
95
|
-
const t =
|
|
96
|
+
const t = d(this.five, this.mouseNdcPosition, { virtualPoint: this.virtualPoint });
|
|
96
97
|
t != null && t.face && (this.pressDown = !0, this.updatePointSelectorHelperIntersect(t));
|
|
97
98
|
});
|
|
98
99
|
/**
|
|
@@ -108,34 +109,37 @@ class U extends F {
|
|
|
108
109
|
* @description: 根据鼠标位置更新helper位置
|
|
109
110
|
*/
|
|
110
111
|
i(this, "updateByNdcPosition", (e) => {
|
|
111
|
-
const t =
|
|
112
|
+
const t = d(this.five, e, { virtualPoint: this.virtualPoint });
|
|
112
113
|
this.updatePointSelectorHelperIntersect(t);
|
|
113
114
|
});
|
|
114
115
|
/**
|
|
115
116
|
* @description: 更新 pointSelectorHelper 的焦点位置
|
|
116
117
|
*/
|
|
117
118
|
i(this, "updatePointSelectorHelperIntersect", (e) => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
if (!e) {
|
|
120
|
+
this.onLeave(), this.five.getElement().style.cursor = `url("data:image/svg+xml,%3Csvg width='12px' height='12px' viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cpath d='M6,12 C9.3137085,12 12,9.3137085 12,6 C12,2.6862915 9.3137085,0 6,0 C2.6862915,0 0,2.6862915 0,6 C0,9.3137085 2.6862915,12 6,12 Z' fill='%23FF5959'%3E%3C/path%3E%3Cg transform='translate(2, 2)' stroke='%23FFFFFF'%3E%3Ccircle cx='4' cy='4' r='4'%3E%3C/circle%3E%3Cline x1='1.07141075' y1='1.23997894' x2='6.64700843' y2='6.81557662'%3E%3C/line%3E%3C/g%3E%3C/g%3E%3C/svg%3E"), auto`;
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this.onEnter(), this.five.getElement().style.cursor = "";
|
|
124
|
+
const t = l({}, e);
|
|
125
|
+
let o = !1;
|
|
126
|
+
if (typeof this.adherePoints == "function" && typeof this.adherePointsRadius == "number") {
|
|
127
|
+
for (const r of this.adherePoints({ intersection: e, pointSelectorInstance: this }))
|
|
124
128
|
if (r.distanceTo(e.point) < this.adherePointsRadius) {
|
|
125
|
-
t.point = r.clone(),
|
|
129
|
+
t.point = r.clone(), o = !0;
|
|
126
130
|
break;
|
|
127
131
|
}
|
|
128
132
|
}
|
|
129
|
-
this.pointSelectorHelper.updateWithIntersect(t, { emitEvent: !1 }), this.emit("intersectionUpdate", t,
|
|
133
|
+
this.pointSelectorHelper.updateWithIntersect(t, { emitEvent: !1 }), this.emit("intersectionUpdate", t, o);
|
|
130
134
|
});
|
|
131
135
|
i(this, "mousePositionToNdcPosition", (e) => {
|
|
132
136
|
const t = this.five.getElement();
|
|
133
137
|
if (!t)
|
|
134
138
|
return null;
|
|
135
|
-
const { top:
|
|
139
|
+
const { top: o, left: r, width: a, height: u } = t.getBoundingClientRect(), { clientX: m, clientY: v } = e;
|
|
136
140
|
return {
|
|
137
|
-
x: (m -
|
|
138
|
-
y: 1 - (
|
|
141
|
+
x: (m - r) / a,
|
|
142
|
+
y: 1 - (v - o) / u
|
|
139
143
|
};
|
|
140
144
|
});
|
|
141
145
|
i(this, "onFiveWantsPanGesture", () => {
|
|
@@ -148,15 +152,15 @@ class U extends F {
|
|
|
148
152
|
i(this, "emitIntersectionUpdate", (e) => {
|
|
149
153
|
this.emit("intersectionUpdate", e);
|
|
150
154
|
});
|
|
151
|
-
this.five = e;
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
const
|
|
155
|
+
this.five = e, this.config = t != null ? t : {};
|
|
156
|
+
const o = (a = t == null ? void 0 : t.mode) != null ? a : "auto";
|
|
157
|
+
o === "auto" ? this.mode = y ? "fixed" : "cursor" : this.mode = o;
|
|
158
|
+
const r = {
|
|
155
159
|
autoFixPCPosition: this.mode === "cursor",
|
|
156
160
|
initialPosition: this.mode === "fixed" ? { left: "35%", top: "20%" } : void 0
|
|
157
161
|
};
|
|
158
|
-
this.pointSelectorHelper = new
|
|
159
|
-
magnifierParams:
|
|
162
|
+
this.pointSelectorHelper = new b(e, c(l({}, t == null ? void 0 : t.helper), {
|
|
163
|
+
magnifierParams: l(l({}, r), (u = t == null ? void 0 : t.helper) == null ? void 0 : u.magnifierParams)
|
|
160
164
|
})), this.pointSelectorHelper.hide();
|
|
161
165
|
}
|
|
162
166
|
get position() {
|
|
@@ -165,6 +169,11 @@ class U extends F {
|
|
|
165
169
|
get mouseNdcPosition() {
|
|
166
170
|
return this.mousePosition ? this.mousePositionToNdcPosition(this.mousePosition) : null;
|
|
167
171
|
}
|
|
172
|
+
get virtualPoint() {
|
|
173
|
+
var t;
|
|
174
|
+
const e = (t = this.config.virtualPoint) != null ? t : !0;
|
|
175
|
+
return typeof e == "boolean" ? e : Array.isArray(e) ? e.includes(this.five.state.mode) : !0;
|
|
176
|
+
}
|
|
168
177
|
enable() {
|
|
169
178
|
if (this.enabled)
|
|
170
179
|
return;
|
|
@@ -172,14 +181,14 @@ class U extends F {
|
|
|
172
181
|
const e = this.five.getElement();
|
|
173
182
|
if (!e)
|
|
174
183
|
throw new Error("five element not found");
|
|
175
|
-
this.hammer || (this.hammer = new
|
|
184
|
+
this.hammer || (this.hammer = new H(e)), this.mode === "cursor" ? (this.five.on("wantsPanGesture", this.onFiveWantsPanGesture), this.five.on("wantsMoveToPano", h), this.five.on("wantsChangeMode", h), this.five.on("wantsTapGesture", h), e.addEventListener("mousemove", this.updateByMousePosition), e.addEventListener("wheel", this.updateByMousePosition), e.addEventListener("mouseenter", this.onEnter), e.addEventListener("mouseout", this.onLeave), this.hammer.on("tap", this.onTap), this.hammer.on("pan", this.onPan), this.hammer.on("press", this.onPress), this.hammer.on("panend", this.onPanEnd)) : this.mode === "fixed" && (this.five.on("panoArrived", this.renderScreenCenter), this.five.on("panGesture", this.renderScreenCenter), this.five.on("interiaPan", this.renderScreenCenter), this.renderScreenCenter(), this.pointSelectorHelper.show()), this.pointSelectorHelper.hooks.on("intersectionUpdate", this.emitIntersectionUpdate), this.lastFiveHelperVisible = this.five.helperVisible, this.five.helperVisible = !1, this.emit("enable");
|
|
176
185
|
}
|
|
177
186
|
disable() {
|
|
178
187
|
if (!this.enabled)
|
|
179
188
|
return;
|
|
180
|
-
this.enabled = !1, this.pointSelectorHelper.disable();
|
|
189
|
+
this.enabled = !1, this.pointSelectorHelper.disable(), this.five.getElement().style.cursor = "";
|
|
181
190
|
const e = this.five.getElement();
|
|
182
|
-
this.five.off("wantsPanGesture", this.onFiveWantsPanGesture), this.five.off("wantsMoveToPano",
|
|
191
|
+
this.five.off("wantsPanGesture", this.onFiveWantsPanGesture), this.five.off("wantsMoveToPano", h), this.five.off("wantsChangeMode", h), this.five.off("wantsTapGesture", h), this.five.helperVisible = this.lastFiveHelperVisible, e == null || e.removeEventListener("mousemove", this.updateByMousePosition), e == null || e.removeEventListener("mouseenter", this.onEnter), e == null || e.removeEventListener("mouseout", this.onLeave), this.hammer.off("tap", this.onTap), this.hammer.off("pan", this.onPan), this.hammer.off("press", this.onPress), this.hammer.off("panend", this.onPanEnd), this.five.off("panoArrived", this.renderScreenCenter), this.five.off("panGesture", this.renderScreenCenter), this.five.off("interiaPan", this.renderScreenCenter), this.pointSelectorHelper.hooks.off("intersectionUpdate", this.emitIntersectionUpdate), this.emit("disable");
|
|
183
192
|
}
|
|
184
193
|
dispose() {
|
|
185
194
|
this.disable(), this.pointSelectorHelper.dispose();
|
|
@@ -189,5 +198,5 @@ class U extends F {
|
|
|
189
198
|
}
|
|
190
199
|
}
|
|
191
200
|
export {
|
|
192
|
-
|
|
201
|
+
B as PointSelector
|
|
193
202
|
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import type { Intersection } from '
|
|
2
|
+
import type { Intersection } from '../../../../typings/typings';
|
|
3
|
+
import type { PointHelperAbstract } from './typing';
|
|
4
|
+
import { CSS3DObjectPlus } from '../../../../CSS3DRenderPlugin/utils/three/CSS3DObject';
|
|
5
|
+
import type { Five } from '@realsee/five';
|
|
3
6
|
export interface MouseGroupParameter {
|
|
4
7
|
isMobile?: boolean;
|
|
5
8
|
useNormalVector?: boolean;
|
|
@@ -8,15 +11,20 @@ export interface MouseGroupParameter {
|
|
|
8
11
|
declare function createPlaneMesh(): THREE.Mesh<THREE.PlaneGeometry, THREE.MeshBasicMaterial>;
|
|
9
12
|
declare function createLineMesh(): THREE.Mesh<THREE.TubeGeometry, THREE.ShaderMaterial>;
|
|
10
13
|
declare function createBallMesh(): THREE.Mesh<THREE.SphereGeometry, THREE.MeshBasicMaterial>;
|
|
14
|
+
declare function createBorderMesh(): CSS3DObjectPlus<HTMLElement>;
|
|
11
15
|
type PlanMesh = ReturnType<typeof createPlaneMesh>;
|
|
12
16
|
type LineMesh = ReturnType<typeof createLineMesh>;
|
|
13
17
|
type BallMesh = ReturnType<typeof createBallMesh>;
|
|
14
|
-
|
|
18
|
+
type BorderMesh = ReturnType<typeof createBorderMesh>;
|
|
19
|
+
export declare class PointHelper extends THREE.Object3D implements PointHelperAbstract {
|
|
15
20
|
planeMesh: PlanMesh;
|
|
16
21
|
lineMesh: LineMesh;
|
|
17
22
|
ballMesh: BallMesh;
|
|
18
|
-
|
|
23
|
+
borderMesh: BorderMesh;
|
|
24
|
+
constructor(five: Five);
|
|
19
25
|
updateWithIntersect(intersect: Intersection): void;
|
|
26
|
+
show(): void;
|
|
27
|
+
hide(): void;
|
|
20
28
|
dispose(): void;
|
|
21
29
|
}
|
|
22
30
|
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var i = (r, n, e) => n in r ? a(r, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[n] = e;
|
|
3
|
+
var s = (r, n, e) => (i(r, typeof n != "symbol" ? n + "" : n, e), e);
|
|
4
|
+
import * as t from "three";
|
|
5
|
+
import { POINT_HELPER_TEXTURE_URL as l } from "../../Assets/index.js";
|
|
6
|
+
import { CSS3DObjectPlus as c } from "../../../../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
7
|
+
import { rangePieceImg as h } from "./html.js";
|
|
8
|
+
import { initialCSS3DRender as d } from "../../../five/initialCSS3DRender.js";
|
|
9
|
+
const p = `
|
|
10
|
+
varying vec2 vUv;
|
|
11
|
+
void main() {
|
|
12
|
+
vUv = uv;
|
|
13
|
+
vec4 mvPosition = modelViewMatrix * vec4(position, 1);
|
|
14
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
15
|
+
}
|
|
16
|
+
`, u = `
|
|
17
|
+
varying vec2 vUv;
|
|
18
|
+
void main() {
|
|
19
|
+
vec2 uv = vec2(vUv.x, vUv.y);
|
|
20
|
+
float a = 1.0;
|
|
21
|
+
float match = 1.0 - uv.x;
|
|
22
|
+
gl_FragColor = vec4(1.0,1.0,1.0,match);
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
function M() {
|
|
26
|
+
const r = new t.PlaneGeometry(0.4, 0.4), n = l, e = new t.TextureLoader().load(n);
|
|
27
|
+
e.encoding = t.sRGBEncoding, e.minFilter = t.LinearFilter;
|
|
28
|
+
const o = new t.MeshBasicMaterial({
|
|
29
|
+
map: e,
|
|
30
|
+
transparent: !0,
|
|
31
|
+
depthTest: !1
|
|
32
|
+
});
|
|
33
|
+
return new t.Mesh(r, o);
|
|
34
|
+
}
|
|
35
|
+
function m() {
|
|
36
|
+
const r = new t.CurvePath();
|
|
37
|
+
r.add(new t.LineCurve3(new t.Vector3(0, 0, 0), new t.Vector3(0, 0, 0.1)));
|
|
38
|
+
const n = new t.TubeGeometry(r, 8, 3e-3), e = new t.ShaderMaterial({
|
|
39
|
+
vertexShader: p,
|
|
40
|
+
fragmentShader: u,
|
|
41
|
+
depthTest: !1,
|
|
42
|
+
transparent: !0
|
|
43
|
+
});
|
|
44
|
+
return new t.Mesh(n, e);
|
|
45
|
+
}
|
|
46
|
+
function v() {
|
|
47
|
+
const r = new t.SphereGeometry(0.01, 20, 20), n = new t.MeshBasicMaterial({
|
|
48
|
+
color: 10349931,
|
|
49
|
+
depthTest: !1,
|
|
50
|
+
transparent: !0,
|
|
51
|
+
side: t.DoubleSide
|
|
52
|
+
}), e = new t.Mesh(r, n);
|
|
53
|
+
return e.position.set(0, 0, 0.1), e;
|
|
54
|
+
}
|
|
55
|
+
function w() {
|
|
56
|
+
const n = new c({
|
|
57
|
+
pointerEvents: "none",
|
|
58
|
+
cornerPoints: [
|
|
59
|
+
new t.Vector3(-0.2, 0.2, 0),
|
|
60
|
+
new t.Vector3(-0.2, -0.2, 0),
|
|
61
|
+
new t.Vector3(0.2, -0.2, 0),
|
|
62
|
+
new t.Vector3(0.2, 0.2, 0)
|
|
63
|
+
]
|
|
64
|
+
}), e = document.createElement("div");
|
|
65
|
+
return e.style.width = "100%", e.style.height = "100%", e.style.backgroundImage = `url(${h})`, e.style.backgroundSize = "100%", e.style.backgroundRepeat = "no-repeat", n.container.appendChild(e), n;
|
|
66
|
+
}
|
|
67
|
+
class x extends t.Object3D {
|
|
68
|
+
constructor(e) {
|
|
69
|
+
super();
|
|
70
|
+
s(this, "planeMesh");
|
|
71
|
+
s(this, "lineMesh");
|
|
72
|
+
s(this, "ballMesh");
|
|
73
|
+
s(this, "borderMesh");
|
|
74
|
+
this.planeMesh = M(), this.lineMesh = m(), this.ballMesh = v(), this.borderMesh = w(), this.add(this.planeMesh, this.lineMesh, this.ballMesh, this.borderMesh), d(e);
|
|
75
|
+
}
|
|
76
|
+
updateWithIntersect(e) {
|
|
77
|
+
if (!e.face)
|
|
78
|
+
return;
|
|
79
|
+
const o = new t.Vector3().addVectors(e.point, e.face.normal);
|
|
80
|
+
this.position.copy(e.point), this.lookAt(o);
|
|
81
|
+
}
|
|
82
|
+
show() {
|
|
83
|
+
this.visible = !0;
|
|
84
|
+
}
|
|
85
|
+
hide() {
|
|
86
|
+
this.visible = !1;
|
|
87
|
+
}
|
|
88
|
+
dispose() {
|
|
89
|
+
var e;
|
|
90
|
+
(e = this.planeMesh.material.map) == null || e.dispose();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
x as PointHelper
|
|
95
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import type { Intersection } from '../../../../typings/typings';
|
|
3
|
+
import type { Five } from '@realsee/five';
|
|
4
|
+
import type { PointHelperAbstract } from './typing';
|
|
5
|
+
import { ICSS3DSprite } from '../../../../CSS3DRenderPlugin/utils/three/CSS3DSprite';
|
|
6
|
+
export interface MouseGroupParameter {
|
|
7
|
+
isMobile?: boolean;
|
|
8
|
+
useNormalVector?: boolean;
|
|
9
|
+
ballColor?: number;
|
|
10
|
+
}
|
|
11
|
+
declare function createPlaneMesh(): THREE.Mesh<THREE.CircleGeometry, THREE.ShaderMaterial>;
|
|
12
|
+
declare function createCrossline(): THREE.Group;
|
|
13
|
+
declare function createLineMesh(length: number): THREE.Mesh<THREE.TubeGeometry, THREE.MeshBasicMaterial>;
|
|
14
|
+
declare function createRingMesh(): THREE.Mesh<THREE.RingGeometry, THREE.MeshBasicMaterial>;
|
|
15
|
+
declare function createBallMesh(): THREE.Mesh<THREE.SphereGeometry, THREE.MeshBasicMaterial>;
|
|
16
|
+
declare function createCSSBallMesh(): ICSS3DSprite;
|
|
17
|
+
export declare class PointHelper2 extends THREE.Object3D implements PointHelperAbstract {
|
|
18
|
+
planeMesh: ReturnType<typeof createPlaneMesh>;
|
|
19
|
+
ringMesh: ReturnType<typeof createRingMesh>;
|
|
20
|
+
crossline: ReturnType<typeof createCrossline>;
|
|
21
|
+
lineMesh: ReturnType<typeof createLineMesh>;
|
|
22
|
+
ballMesh: ReturnType<typeof createBallMesh>;
|
|
23
|
+
cssBallMesh: ReturnType<typeof createCSSBallMesh>;
|
|
24
|
+
constructor(five: Five);
|
|
25
|
+
updateWithIntersect(intersect: Intersection): void;
|
|
26
|
+
show(): void;
|
|
27
|
+
hide(): void;
|
|
28
|
+
dispose(): void;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
var M = Object.defineProperty, v = Object.defineProperties;
|
|
2
|
+
var p = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var d = Object.getOwnPropertySymbols;
|
|
4
|
+
var f = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var l = (s, e, r) => e in s ? M(s, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[e] = r, c = (s, e) => {
|
|
6
|
+
for (var r in e || (e = {}))
|
|
7
|
+
f.call(e, r) && l(s, r, e[r]);
|
|
8
|
+
if (d)
|
|
9
|
+
for (var r of d(e))
|
|
10
|
+
m.call(e, r) && l(s, r, e[r]);
|
|
11
|
+
return s;
|
|
12
|
+
}, h = (s, e) => v(s, p(e));
|
|
13
|
+
var o = (s, e, r) => (l(s, typeof e != "symbol" ? e + "" : e, r), r);
|
|
14
|
+
import * as t from "three";
|
|
15
|
+
import { initialCSS3DRender as A } from "../../../five/initialCSS3DRender.js";
|
|
16
|
+
import { LineMesh as u } from "../../../../Sculpt/Meshes/Line.js";
|
|
17
|
+
import { ICSS3DSprite as g } from "../../../../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
|
|
18
|
+
const w = (
|
|
19
|
+
/* glsl */
|
|
20
|
+
`
|
|
21
|
+
varying vec2 vUv;
|
|
22
|
+
varying float vRadius;
|
|
23
|
+
varying float vDistanceToCamera;
|
|
24
|
+
varying float vCenterDistanceToCamera;
|
|
25
|
+
void main() {
|
|
26
|
+
vUv = uv;
|
|
27
|
+
// 计算顶点到圆心的距离
|
|
28
|
+
vRadius = length(position.xy);
|
|
29
|
+
// 计算顶点到摄像机的距离
|
|
30
|
+
vec3 worldPosition = vec3(modelViewMatrix * vec4(position, 1.0));
|
|
31
|
+
vDistanceToCamera = distance(cameraPosition, worldPosition);
|
|
32
|
+
vCenterDistanceToCamera = distance(cameraPosition, vec3(0.0));
|
|
33
|
+
|
|
34
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1);
|
|
35
|
+
}
|
|
36
|
+
`
|
|
37
|
+
), y = (
|
|
38
|
+
/* glsl */
|
|
39
|
+
`
|
|
40
|
+
varying vec2 vUv;
|
|
41
|
+
varying float vRadius;
|
|
42
|
+
|
|
43
|
+
uniform float borderWidth;
|
|
44
|
+
uniform float radius;
|
|
45
|
+
|
|
46
|
+
void main() {
|
|
47
|
+
vec2 uv = vUv;
|
|
48
|
+
|
|
49
|
+
if (vRadius > radius - borderWidth && vRadius < radius) {
|
|
50
|
+
// 如果顶点在边框区域,则使用边框颜色
|
|
51
|
+
gl_FragColor = vec4(1.0, 1.0, 1.0, 0.3);
|
|
52
|
+
} else {
|
|
53
|
+
// 如果顶点在填充区域,则使用填充颜色
|
|
54
|
+
gl_FragColor = vec4(1.0, 1.0, 1.0, 0.2);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`
|
|
58
|
+
);
|
|
59
|
+
function P() {
|
|
60
|
+
const e = new t.CircleGeometry(0.2, 64), r = new t.ShaderMaterial({
|
|
61
|
+
uniforms: {
|
|
62
|
+
borderWidth: { value: 0.01 },
|
|
63
|
+
radius: { value: 0.2 }
|
|
64
|
+
},
|
|
65
|
+
vertexShader: w,
|
|
66
|
+
fragmentShader: y,
|
|
67
|
+
depthTest: !1,
|
|
68
|
+
transparent: !0,
|
|
69
|
+
blending: t.CustomBlending,
|
|
70
|
+
blendEquation: t.AddEquation,
|
|
71
|
+
blendSrc: t.DstColorFactor,
|
|
72
|
+
blendDst: t.SrcAlphaFactor,
|
|
73
|
+
blendDstAlpha: t.DstAlphaFactor
|
|
74
|
+
});
|
|
75
|
+
return new t.Mesh(e, r);
|
|
76
|
+
}
|
|
77
|
+
function b() {
|
|
78
|
+
const e = new t.Group(), r = {
|
|
79
|
+
lineWidth: 1,
|
|
80
|
+
lineColor: 3407837,
|
|
81
|
+
opacity: 0.7,
|
|
82
|
+
occlusionVisibility: !0
|
|
83
|
+
}, i = new u(h(c({ points: [{ x: -0.5 }, { x: 0.5 }] }, r), { lineColor: 3407837 })), a = new u(h(c({ points: [{ y: -0.5 }, { y: 0.5 }] }, r), { lineColor: 3407837 }));
|
|
84
|
+
return e.add(i, a), e;
|
|
85
|
+
}
|
|
86
|
+
function V(s) {
|
|
87
|
+
const e = new t.CurvePath();
|
|
88
|
+
e.add(new t.LineCurve3(new t.Vector3(0, 0, 0), new t.Vector3(0, 0, s)));
|
|
89
|
+
const r = new t.TubeGeometry(e, 32, 3e-3), i = new t.MeshBasicMaterial({
|
|
90
|
+
color: 10994687,
|
|
91
|
+
depthTest: !1,
|
|
92
|
+
transparent: !0
|
|
93
|
+
// 必须要开启透明度,要和PlaneMesh一起渲染
|
|
94
|
+
});
|
|
95
|
+
return new t.Mesh(r, i);
|
|
96
|
+
}
|
|
97
|
+
function C() {
|
|
98
|
+
const s = new t.RingGeometry(0.03, 0.035, 64), e = new t.MeshBasicMaterial({
|
|
99
|
+
color: 16777215,
|
|
100
|
+
depthTest: !1,
|
|
101
|
+
transparent: !0
|
|
102
|
+
// 必须要开启透明度,要和PlaneMesh一起渲染
|
|
103
|
+
});
|
|
104
|
+
return new t.Mesh(s, e);
|
|
105
|
+
}
|
|
106
|
+
function x() {
|
|
107
|
+
const s = new t.SphereGeometry(0.018, 32, 32), e = new t.MeshBasicMaterial({
|
|
108
|
+
color: 5085183,
|
|
109
|
+
depthTest: !1,
|
|
110
|
+
transparent: !0
|
|
111
|
+
// 必须要开启透明度,要和PlaneMesh一起渲染
|
|
112
|
+
});
|
|
113
|
+
return new t.Mesh(s, e);
|
|
114
|
+
}
|
|
115
|
+
function S() {
|
|
116
|
+
const s = document.createElement("img");
|
|
117
|
+
s.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAVCAMAAAB8FU7dAAAAw1BMVEUAAACDuuiAsu11q/x8r/+HxtKHxtKIx9J4ut6Hx9Jcn/uNwNlmmf+RuP9ppf9orel3ud2HxtJrpf9oremev/9ppP9orelQmP9ZoPWSuP92q/9cnv9prel4ut53qv9orelYoPWIxdJPmP+HxtGRuP9oo/+Suf9Qmf92q/+RuP+DsP9Pmv+FxdFtre2SyMiRuP9PmP+evv9ppf9cnv+rxf9orepZofV4ut52q/+Dsf+Esv+5y/93q/9aofbF0f93rP9qpf8IzZ1iAAAAL3RSTlMAEg4s3dK5nodgVQoF/Pf39vbt7evr39rV1NTOzs6srJ+fiIZ9fWlpW09ERCwcHMH8LhIAAADRSURBVBjTjdDHkoMwEIThBrzOm3POOQwSYCRhe/f9n2p75FD2zX/VXL5qOAjzkixLsFL6fOFF5PwpXUj/eEwx7Oh9Jq+FdV5MqZkXlU9K4KZsmqY02x/A8LSwv14o0ylJWkP087WVhDfcjmjj5b/E3+CEpDPdGY58C7tKfzSiiA9uB4dV/NIF7yVQ7AGuq0lOIzrvnLP2Et2aMzUqryge8FVX0Zjl5XkG3KsR593pM2zVEScjvbMU7IdGjF19IzZ43Ceyve4Ai5Jep93u9BJs3j/gXjHbRgy31AAAAABJRU5ErkJggg==";
|
|
118
|
+
const e = new g(s);
|
|
119
|
+
return s.style.pointerEvents = "none", e.scale.set(3e-3, 3e-3, 3e-3), e;
|
|
120
|
+
}
|
|
121
|
+
class E extends t.Object3D {
|
|
122
|
+
constructor(r) {
|
|
123
|
+
super();
|
|
124
|
+
o(this, "planeMesh");
|
|
125
|
+
o(this, "ringMesh");
|
|
126
|
+
o(this, "crossline");
|
|
127
|
+
o(this, "lineMesh");
|
|
128
|
+
o(this, "ballMesh");
|
|
129
|
+
o(this, "cssBallMesh");
|
|
130
|
+
const i = 0.18;
|
|
131
|
+
this.planeMesh = P(), this.ringMesh = C(), this.crossline = b(), this.lineMesh = V(i), this.ballMesh = x(), this.cssBallMesh = S(), this.ballMesh.position.setZ(i), this.cssBallMesh.position.setZ(i), this.planeMesh.renderOrder = 0, this.ringMesh.renderOrder = 1, this.crossline.renderOrder = 2, this.lineMesh.renderOrder = 3, this.ballMesh.renderOrder = 4, this.add(this.planeMesh, this.crossline, this.lineMesh, this.ballMesh, this.ringMesh, this.cssBallMesh), A(r);
|
|
132
|
+
}
|
|
133
|
+
updateWithIntersect(r) {
|
|
134
|
+
if (!r.face)
|
|
135
|
+
return;
|
|
136
|
+
const i = (() => {
|
|
137
|
+
const n = r.face.normal.clone().normalize();
|
|
138
|
+
return n.y > 0.99 ? new t.Vector3(0, 1, 0) : n.y < -0.99 ? new t.Vector3(0, -1, 0) : n.x > 0.99 ? new t.Vector3(1, 0, 0) : n.x < -0.99 ? new t.Vector3(-1, 0, 0) : n.z > 0.99 ? new t.Vector3(0, 0, 1) : n.z < -0.99 ? new t.Vector3(0, 0, -1) : n.y < 0.01 && n.y > -0.01 ? new t.Vector3(n.x, 0, n.z) : n;
|
|
139
|
+
})(), a = new t.Vector3().addVectors(r.point, i);
|
|
140
|
+
this.position.copy(r.point), this.lookAt(a);
|
|
141
|
+
}
|
|
142
|
+
show() {
|
|
143
|
+
this.visible = !0, this.add(this.cssBallMesh);
|
|
144
|
+
}
|
|
145
|
+
hide() {
|
|
146
|
+
this.visible = !1, this.remove(this.cssBallMesh);
|
|
147
|
+
}
|
|
148
|
+
dispose() {
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
export {
|
|
152
|
+
E as PointHelper2
|
|
153
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import type { Five } from '@realsee/five';
|
|
3
|
-
import { Magnifier
|
|
4
|
-
import type { Intersection } from '
|
|
5
|
-
import { Subscribe } from '
|
|
6
|
-
|
|
3
|
+
import { Magnifier } from '../..';
|
|
4
|
+
import type { Intersection } from '../../../../typings/typings';
|
|
5
|
+
import { Subscribe } from '../../../Subscribe';
|
|
6
|
+
import type { PointHelperAbstract } from './typing';
|
|
7
|
+
export interface PointSelectorHelperConfig {
|
|
7
8
|
magnifier?: Magnifier | null;
|
|
8
9
|
magnifierParams?: ConstructorParameters<typeof Magnifier>[1];
|
|
9
|
-
pointHelper?:
|
|
10
|
-
pointDomHelper?: PointDomHelper | null;
|
|
10
|
+
pointHelper?: PointHelperAbstract | 'default' | 'highlight' | null;
|
|
11
11
|
container?: Element;
|
|
12
12
|
}
|
|
13
13
|
type EventMap = {
|
|
@@ -26,17 +26,16 @@ export declare class PointSelectorHelper {
|
|
|
26
26
|
hooks: Subscribe<EventMap>;
|
|
27
27
|
position: PointIntersection | undefined;
|
|
28
28
|
magnifier: Magnifier | null;
|
|
29
|
-
|
|
30
|
-
private pointDomHelper;
|
|
29
|
+
pointHelper: PointHelperAbstract | null;
|
|
31
30
|
private state;
|
|
32
31
|
private group;
|
|
33
|
-
constructor(five: Five, options?:
|
|
32
|
+
constructor(five: Five, options?: PointSelectorHelperConfig);
|
|
34
33
|
show: () => void;
|
|
35
34
|
hide: () => void;
|
|
36
35
|
enable(): void;
|
|
37
36
|
disable(): void;
|
|
38
37
|
dispose(): void;
|
|
39
|
-
updateWithIntersect: (intersect
|
|
38
|
+
updateWithIntersect: (intersect?: Intersection, config?: {
|
|
40
39
|
emitEvent: boolean;
|
|
41
40
|
}) => void;
|
|
42
41
|
private abortUpdateMagnifier;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var f = (a, i, e) => i in a ? d(a, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[i] = e;
|
|
3
|
+
var t = (a, i, e) => (f(a, typeof i != "symbol" ? i + "" : i, e), e);
|
|
4
|
+
import * as m from "three";
|
|
5
|
+
import { Magnifier as p } from "../../Magnifier.js";
|
|
6
|
+
import { PointHelper as u } from "./PointHelper.js";
|
|
7
|
+
import { Subscribe as g } from "../../../Subscribe.js";
|
|
8
|
+
import { PointHelper2 as b } from "./PointHelper2.js";
|
|
9
|
+
import "../../THREESphere.js";
|
|
10
|
+
import "animejs";
|
|
11
|
+
class M {
|
|
12
|
+
constructor(i, e) {
|
|
13
|
+
t(this, "five");
|
|
14
|
+
t(this, "hooks", new g());
|
|
15
|
+
t(this, "position");
|
|
16
|
+
t(this, "magnifier", null);
|
|
17
|
+
t(this, "pointHelper", null);
|
|
18
|
+
t(this, "state", { enabled: !1, visible: !0 });
|
|
19
|
+
t(this, "group", new m.Group());
|
|
20
|
+
t(this, "show", () => {
|
|
21
|
+
var i, e;
|
|
22
|
+
this.state.visible || (this.state.visible = !0, (i = this.pointHelper) == null || i.show(), (e = this.magnifier) == null || e.enable(), this.five.needsRender = !0);
|
|
23
|
+
});
|
|
24
|
+
t(this, "hide", () => {
|
|
25
|
+
var i, e;
|
|
26
|
+
this.state.visible && (this.state.visible = !1, (i = this.pointHelper) == null || i.hide(), (e = this.magnifier) == null || e.disable(), this.five.needsRender = !0);
|
|
27
|
+
});
|
|
28
|
+
t(this, "updateWithIntersect", (i, e = { emitEvent: !0 }) => {
|
|
29
|
+
var s;
|
|
30
|
+
if (!i)
|
|
31
|
+
return;
|
|
32
|
+
this.abortUpdateMagnifier(), this.position = i, e.emitEvent && this.hooks.emit("intersectionUpdate", i), (s = this.pointHelper) == null || s.updateWithIntersect(i);
|
|
33
|
+
const r = () => {
|
|
34
|
+
var n;
|
|
35
|
+
return (n = this.magnifier) == null ? void 0 : n.renderWithPoint(i.point);
|
|
36
|
+
};
|
|
37
|
+
this.abortUpdateMagnifier = () => this.five.off("renderFrame", r), this.five.once("renderFrame", r), this.five.needsRender = !0;
|
|
38
|
+
});
|
|
39
|
+
t(this, "abortUpdateMagnifier", () => {
|
|
40
|
+
});
|
|
41
|
+
var s, n, h, l;
|
|
42
|
+
console.log(e), this.five = i, this.magnifier = (e == null ? void 0 : e.magnifier) !== void 0 ? e.magnifier : new p(i, (s = e == null ? void 0 : e.magnifierParams) != null ? s : { dragEnabled: !0 });
|
|
43
|
+
let r;
|
|
44
|
+
(e == null ? void 0 : e.pointHelper) === "default" || (e == null ? void 0 : e.pointHelper) === void 0 ? r = new u(i) : (e == null ? void 0 : e.pointHelper) === "highlight" ? r = new b(i) : r = e.pointHelper, this.pointHelper = r, this.group.name = "five-point-selector", this.five.scene.add(this.group), (l = this.magnifier) == null || l.appendTo((h = (n = e.container) != null ? n : i.getElement().parentElement) != null ? h : document.body);
|
|
45
|
+
}
|
|
46
|
+
enable() {
|
|
47
|
+
var i;
|
|
48
|
+
this.state.enabled || (this.state.enabled = !0, this.pointHelper && this.group.add(this.pointHelper), (i = this.magnifier) == null || i.enable(), this.five.needsRender = !0, this.hooks.emit("enabled"));
|
|
49
|
+
}
|
|
50
|
+
disable() {
|
|
51
|
+
var i;
|
|
52
|
+
this.state.enabled && (this.state.enabled = !1, this.pointHelper && (this.group.remove(this.pointHelper), this.pointHelper.hide()), (i = this.magnifier) == null || i.disable(), this.hooks.emit("disabled"));
|
|
53
|
+
}
|
|
54
|
+
dispose() {
|
|
55
|
+
this.hooks.off(), this.disable(), this.magnifier = null, this.pointHelper = null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
M as PointSelectorHelper
|
|
60
|
+
};
|