@realsee/dnalogel 4.0.0-webgpu.14 → 4.0.0-webgpu.16
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 +18 -0
- package/TERMS.txt +24 -87
- package/dist/floorplan.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +34 -32
- package/dist/index.js.map +1 -1
- package/dist/internal/{BasePlugin-CPJ1ahrJ.js → BasePlugin-89hE8Cux.js} +2 -2
- package/dist/internal/{BasePlugin-CPJ1ahrJ.js.map → BasePlugin-89hE8Cux.js.map} +1 -1
- package/dist/internal/BasePluginWithData-BLOUilj_.js +7 -0
- package/dist/internal/{BasePluginWithData-Uq1cY5sC.js.map → BasePluginWithData-BLOUilj_.js.map} +1 -1
- package/dist/internal/{pano-measure-BEUknZ_O.js → Controller-B-10xO2H.js} +56 -42
- package/dist/internal/Controller-B-10xO2H.js.map +1 -0
- package/dist/internal/{measure-CTsB8Z-c.js → Controller-Bt2czarX.js} +10 -7
- package/dist/internal/Controller-Bt2czarX.js.map +1 -0
- package/dist/internal/{Controller-B9xMQukV.js → Controller-CTQsxSIv.js} +2 -2
- package/dist/internal/{Controller-B9xMQukV.js.map → Controller-CTQsxSIv.js.map} +1 -1
- package/dist/internal/{PointHelper-Bgbt0S7b.js → PointHelper-grrf8vu1.js} +23 -8
- package/dist/internal/PointHelper-grrf8vu1.js.map +1 -0
- package/dist/internal/{Rectangle-Dyjp88lU.js → Rectangle-CrP2ewnA.js} +3 -3
- package/dist/internal/{Rectangle-Dyjp88lU.js.map → Rectangle-CrP2ewnA.js.map} +1 -1
- package/dist/internal/{Work-nlQCCreU.js → Work-BeXbgDwp.js} +4 -4
- package/dist/internal/{Work-nlQCCreU.js.map → Work-BeXbgDwp.js.map} +1 -1
- package/dist/internal/{area-maker-DwPBgIH_.js → area-maker-CPQF8Zvc.js} +2 -2
- package/dist/internal/{area-maker-DwPBgIH_.js.map → area-maker-CPQF8Zvc.js.map} +1 -1
- package/dist/internal/{controller-B3u-PyQb.js → controller-18q1jMVV.js} +16 -16
- package/dist/internal/{controller-B3u-PyQb.js.map → controller-18q1jMVV.js.map} +1 -1
- package/dist/internal/{cruise-XCsWQQtZ.js → cruise-CVIrFchH.js} +2 -2
- package/dist/internal/{cruise-XCsWQQtZ.js.map → cruise-CVIrFchH.js.map} +1 -1
- package/dist/internal/{current-pano-image-Yt0ptdOO.js → current-pano-image-BaYriyS_.js} +2 -2
- package/dist/internal/{current-pano-image-Yt0ptdOO.js.map → current-pano-image-BaYriyS_.js.map} +1 -1
- package/dist/internal/edgeSnap-8fdFCcXB.js +469 -0
- package/dist/internal/edgeSnap-8fdFCcXB.js.map +1 -0
- package/dist/internal/{floorplan-Bnk3Jg8m.js → floorplan-CofR5nkn.js} +2 -2
- package/dist/internal/{floorplan-Bnk3Jg8m.js.map → floorplan-CofR5nkn.js.map} +1 -1
- package/dist/internal/measure-BEPx6Dxe.js +7 -0
- package/dist/internal/measure-BEPx6Dxe.js.map +1 -0
- package/dist/internal/measure-v2-sRY76hly.js +83 -0
- package/dist/internal/measure-v2-sRY76hly.js.map +1 -0
- package/dist/internal/{model-maker-tbF87kJz.js → model-maker-ggAsocXZ.js} +2 -2
- package/dist/internal/{model-maker-tbF87kJz.js.map → model-maker-ggAsocXZ.js.map} +1 -1
- package/dist/internal/object3d-helper-DFamC2FE.js +7 -0
- package/dist/internal/{object3d-helper-BgYvVhp2.js.map → object3d-helper-DFamC2FE.js.map} +1 -1
- package/dist/internal/{pano-compass-BwxmzCPI.js → pano-compass-DGHhaCBJ.js} +2 -2
- package/dist/internal/{pano-compass-BwxmzCPI.js.map → pano-compass-DGHhaCBJ.js.map} +1 -1
- package/dist/internal/{pano-door-label-Bwvaf5xx.js → pano-door-label-CWY7Kxkk.js} +2 -2
- package/dist/internal/{pano-door-label-Bwvaf5xx.js.map → pano-door-label-CWY7Kxkk.js.map} +1 -1
- package/dist/internal/pano-measure-CQ_ZZzz5.js +9 -0
- package/dist/internal/pano-measure-CQ_ZZzz5.js.map +1 -0
- package/dist/internal/pano-measure-v2-CzOdP5Yv.js +301 -0
- package/dist/internal/pano-measure-v2-CzOdP5Yv.js.map +1 -0
- package/dist/internal/{pano-tag-CaRrmqmS.js → pano-tag-C6g7mXhw.js} +2 -2
- package/dist/internal/{pano-tag-CaRrmqmS.js.map → pano-tag-C6g7mXhw.js.map} +1 -1
- package/dist/internal/{pano-video-DLjuDeQV.js → pano-video-DTbKV54W.js} +2 -2
- package/dist/internal/{pano-video-DLjuDeQV.js.map → pano-video-DTbKV54W.js.map} +1 -1
- package/dist/internal/{pipeline-Dg9R3h54.js → pipeline-CkYhFOhG.js} +2 -2
- package/dist/internal/{pipeline-Dg9R3h54.js.map → pipeline-CkYhFOhG.js.map} +1 -1
- package/dist/internal/{sculpt-CMFBenui.js → sculpt-rEvaT1IE.js} +3 -3
- package/dist/internal/{sculpt-CMFBenui.js.map → sculpt-rEvaT1IE.js.map} +1 -1
- package/dist/plugins/area-maker.js +1 -1
- package/dist/plugins/cruise.js +2 -2
- package/dist/plugins/current-pano-image.js +1 -1
- package/dist/plugins/guide-line.js +1 -1
- package/dist/plugins/measure-v2.d.ts +2 -0
- package/dist/plugins/measure-v2.js +3 -0
- package/dist/plugins/measure.js +3 -1
- package/dist/plugins/model-maker.js +1 -1
- package/dist/plugins/object3d-helper.js +2 -2
- package/dist/plugins/pano-compass.js +1 -1
- package/dist/plugins/pano-door-label.js +1 -1
- package/dist/plugins/pano-measure-v2.d.ts +2 -0
- package/dist/plugins/pano-measure-v2.js +1 -0
- package/dist/plugins/pano-measure.js +1 -1
- package/dist/plugins/pano-tag.js +2 -2
- package/dist/plugins/pano-video.js +1 -1
- package/dist/plugins/pipeline.js +1 -1
- package/dist/plugins/sculpt.js +2 -2
- package/dist/types/MeasurePlugin/Controller.d.ts +1 -0
- package/dist/types/MeasurePluginV2/Controller.d.ts +49 -0
- package/dist/types/MeasurePluginV2/Magnifier.d.ts +29 -0
- package/dist/types/MeasurePluginV2/PointHelper.d.ts +22 -0
- package/dist/types/MeasurePluginV2/PointOverlay.d.ts +88 -0
- package/dist/types/MeasurePluginV2/PointSelector.d.ts +51 -0
- package/dist/types/MeasurePluginV2/edgeSnap.d.ts +53 -0
- package/dist/types/MeasurePluginV2/index.d.ts +28 -0
- package/dist/types/PanoMeasurePlugin/Controller/BaseController.d.ts +1 -0
- package/dist/types/PanoMeasurePlugin/Controller/EditController.d.ts +4 -2
- package/dist/types/PanoMeasurePlugin/Controller/MixedController.d.ts +3 -1
- package/dist/types/PanoMeasurePlugin/Controller/WatchController.d.ts +4 -0
- package/dist/types/PanoMeasurePlugin/Controller/index.d.ts +9 -3
- package/dist/types/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +5 -5
- package/dist/types/PanoMeasurePluginV2/Controller.d.ts +32 -0
- package/dist/types/PanoMeasurePluginV2/PointSelector.d.ts +32 -0
- package/dist/types/PanoMeasurePluginV2/PreviewLine.d.ts +6 -0
- package/dist/types/PanoMeasurePluginV2/controllers.d.ts +44 -0
- package/dist/types/PanoMeasurePluginV2/index.d.ts +8 -0
- package/dist/types/public/index.d.ts +4 -0
- package/dist/types/public/plugins/measure-v2.d.ts +5 -0
- package/dist/types/public/plugins/pano-measure-v2.d.ts +2 -0
- package/dist/types/shared-utils/three/Magnifier.d.ts +21 -0
- package/dist/types/shared-utils/three/PointSelector/index.d.ts +16 -7
- package/dist/utils.js +1 -1
- package/package.json +9 -1
- package/LICENSE-UPDATE.txt +0 -5
- package/dist/internal/BasePluginWithData-Uq1cY5sC.js +0 -7
- package/dist/internal/PointHelper-Bgbt0S7b.js.map +0 -1
- package/dist/internal/measure-CTsB8Z-c.js.map +0 -1
- package/dist/internal/object3d-helper-BgYvVhp2.js +0 -7
- package/dist/internal/pano-measure-BEUknZ_O.js.map +0 -1
|
@@ -35,6 +35,7 @@ export declare class MeasureController extends Subscribe<MeasurePluginEventMap>
|
|
|
35
35
|
private publishInteraction;
|
|
36
36
|
get pointSelector(): PointSelector;
|
|
37
37
|
private _pointSelector;
|
|
38
|
+
protected createPointSelector(): PointSelector;
|
|
38
39
|
private get fiveDomEvents();
|
|
39
40
|
private _fiveDomEvents;
|
|
40
41
|
private get cursor();
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Five } from '@realsee/five-webgpu';
|
|
2
|
+
import { MeasurePointSelector } from './PointSelector.js';
|
|
3
|
+
import { MeasureController } from '../MeasurePlugin/Controller.js';
|
|
4
|
+
import { MeasurePluginConfig } from '../MeasurePlugin/index.js';
|
|
5
|
+
import { MeasureMagnifier } from './Magnifier.js';
|
|
6
|
+
import { EdgeSnapOptions } from './edgeSnap.js';
|
|
7
|
+
/**
|
|
8
|
+
* 量尺插件 V2:把放大镜和场景里的小光标换成带「红 / 绿 / 蓝坐标轴 + 红色截面框」的版本。
|
|
9
|
+
*
|
|
10
|
+
* 复用 MeasureController 的测量流程,通过工厂创建独立的 V2 选点器,并替换两个渲染组件:
|
|
11
|
+
* - pointSelectorHelper.magnifier → MeasureMagnifier(多画一层叠加层)
|
|
12
|
+
* - pointSelectorHelper.pointHelper → MeasurePointHelperV2(同样的红 / 绿 / 蓝 + 截面框)
|
|
13
|
+
*
|
|
14
|
+
* 两个替换件都沿用原实例的全部参数(宽高、缩放、autoFixPCPosition、dragEnabled、挂载容器),
|
|
15
|
+
* 所以放大镜出现的位置、跟随方式、是否吃鼠标事件都和原插件一致,不会挡住在原本能选中的点位。
|
|
16
|
+
*/
|
|
17
|
+
/** V2 配置:在原 MeasurePlugin 配置上增加模型边缘吸附 */
|
|
18
|
+
export type MeasurePluginV2Config = MeasurePluginConfig & {
|
|
19
|
+
/**
|
|
20
|
+
* @description 模型边缘吸附(试验能力):落点靠近模型边线时自动吸到边上。
|
|
21
|
+
* 传 `false` 可关闭;不传默认开启。
|
|
22
|
+
*/
|
|
23
|
+
edgeSnap?: boolean | EdgeSnapOptions;
|
|
24
|
+
};
|
|
25
|
+
export declare class MeasureControllerV2 extends MeasureController {
|
|
26
|
+
/** 最近一次查询到的候选边数量,示例页 / 调试用 */
|
|
27
|
+
lastEdgeSnapEdgeCount: number;
|
|
28
|
+
private v2Five;
|
|
29
|
+
private v2Magnifier?;
|
|
30
|
+
private v2Attached;
|
|
31
|
+
private readonly edgeSnapOptions;
|
|
32
|
+
private readonly edgeSnapCache;
|
|
33
|
+
constructor(five: Five, config?: MeasurePluginV2Config);
|
|
34
|
+
get edgeSnapEnabled(): boolean;
|
|
35
|
+
/** 运行时开关模型边缘吸附(不需要重开测量) */
|
|
36
|
+
setEdgeSnapEnabled(enabled: boolean): void;
|
|
37
|
+
/** V2 的放大镜实例;需要临时关掉叠加层做对比时,可以 magnifier.setOverlayEnabled(false) */
|
|
38
|
+
get magnifier(): MeasureMagnifier;
|
|
39
|
+
protected createPointSelector(): MeasurePointSelector;
|
|
40
|
+
get pointSelector(): MeasurePointSelector;
|
|
41
|
+
private attachOverlayRenderers;
|
|
42
|
+
private attachMagnifier;
|
|
43
|
+
private attachPointHelper;
|
|
44
|
+
/**
|
|
45
|
+
* 模型边缘吸附:每次选点器计算吸附前,按当前落点取附近的模型边界线。
|
|
46
|
+
* 真正的吸附判断(3D 距离 / 屏幕距离)仍在 PointSelector 里,这里只负责供线。
|
|
47
|
+
*/
|
|
48
|
+
private attachEdgeSnap;
|
|
49
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Five } from '@realsee/five-webgpu';
|
|
2
|
+
import { PointIntersection } from '../shared-utils/index.js';
|
|
3
|
+
import { Magnifier, MagnifierParameter } from '../shared-utils/three/Magnifier.js';
|
|
4
|
+
export interface MeasureMagnifierOptions extends MagnifierParameter {
|
|
5
|
+
/** 是否绘制坐标轴 / 平面框叠加层,默认 true(关掉后行为与现状 Magnifier 完全一致) */
|
|
6
|
+
overlayEnabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 量尺 V2 用的放大镜。
|
|
10
|
+
*
|
|
11
|
+
* 完全复用 Magnifier 的「读像素 + 放大」逻辑,只在像素绘制完成后往同一个 2D canvas 上叠加坐标轴与落点平面框。
|
|
12
|
+
* 这里不重写 render():V1 的 Magnifier 是异步读回像素的,用 afterRender 回调才能保证叠加层和当前这帧像素严格对应。
|
|
13
|
+
*/
|
|
14
|
+
export declare class MeasureMagnifier extends Magnifier {
|
|
15
|
+
/** 父类把 five 存成了 private,这里自己留一份 */
|
|
16
|
+
private readonly overlayFive;
|
|
17
|
+
/** 父类把 context 存成了 private;getContext('2d') 拿到的是同一个实例 */
|
|
18
|
+
private overlayContext;
|
|
19
|
+
/** 由 PointSelector 的 intersectionUpdate 事件注入 */
|
|
20
|
+
private overlayIntersection;
|
|
21
|
+
private overlayEnabled;
|
|
22
|
+
constructor(five: Five, options?: MeasureMagnifierOptions);
|
|
23
|
+
/** 每次交点更新时调用;传 null 表示当前没有命中任何模型 */
|
|
24
|
+
setIntersection(intersection: PointIntersection | null): void;
|
|
25
|
+
/** 开关叠加层,用于灰度 / 排查问题 */
|
|
26
|
+
setOverlayEnabled(enabled: boolean): void;
|
|
27
|
+
private renderOverlay;
|
|
28
|
+
private getOverlayContext;
|
|
29
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Five } from '@realsee/five-webgpu';
|
|
2
|
+
import { Intersection } from '../typings/typings.js';
|
|
3
|
+
import { PointHelper2 } from '../shared-utils/three/PointSelector/utils/PointHelper2.js';
|
|
4
|
+
/**
|
|
5
|
+
* 场景里的小光标(选点处那团白圈 + 法线管)的 V2 版本。
|
|
6
|
+
*
|
|
7
|
+
* 完全继承 PointHelper2,只做两件事:
|
|
8
|
+
* 1. 把那根浅蓝色的法线管换成绿色(PRD 里绿色 = Z 轴);
|
|
9
|
+
* 2. 按和放大镜同一套平面坐标系(buildPlaneFrame)补上红色 X、蓝色 Y 和红色截面框。
|
|
10
|
+
*
|
|
11
|
+
* 选点算法(射线、吸附、打点)全都在 PointSelector 里,这里只负责画,不参与任何选点判断。
|
|
12
|
+
*/
|
|
13
|
+
export declare class MeasurePointHelperV2 extends PointHelper2 {
|
|
14
|
+
/** 只放 V2 新增的红 / 蓝轴和截面框,拿不到法线时整体隐藏 */
|
|
15
|
+
private readonly overlayGroup;
|
|
16
|
+
constructor(five: Five);
|
|
17
|
+
updateWithIntersect(intersect: Intersection): void;
|
|
18
|
+
/** 不挂载 cssBallMesh,避免蓝色小球盖住绿色 Z 轴端点 */
|
|
19
|
+
show(): void;
|
|
20
|
+
hide(): void;
|
|
21
|
+
private paintAxisMesh;
|
|
22
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { PointIntersection } from '../shared-utils/index.js';
|
|
2
|
+
import * as THREE from 'three/webgpu';
|
|
3
|
+
/**
|
|
4
|
+
* 放大镜内的叠加绘制:坐标轴(PRD M1)+ 落点平面框(PRD M2)
|
|
5
|
+
*
|
|
6
|
+
* 为什么画在 2D canvas 上而不是往场景里加 THREE 物体:
|
|
7
|
+
* 放大镜并不是「再渲染一遍场景」,而是用 five.getPixels() 读一小块像素,翻转后 putImageData 到 2D canvas 上。
|
|
8
|
+
* 所以场景里加什么物体都不会出现在放大镜里,只有 putImageData 之后在 2D context 上画的才会出现。
|
|
9
|
+
*/
|
|
10
|
+
/** PRD 五、视觉与设计规范 */
|
|
11
|
+
export declare const OVERLAY_STYLE: {
|
|
12
|
+
/** M1-2 X 轴颜色 */
|
|
13
|
+
readonly axisXColor: "#EC4A4E";
|
|
14
|
+
/** M1-2 Y 轴颜色 */
|
|
15
|
+
readonly axisYColor: "#1677FF";
|
|
16
|
+
/** M1-2 Z 轴颜色 */
|
|
17
|
+
readonly axisZColor: "#065C08";
|
|
18
|
+
/** M1-5 线条宽度 */
|
|
19
|
+
readonly axisLineWidth: 1.5;
|
|
20
|
+
/** 轴线不透明度 */
|
|
21
|
+
readonly axisOpacity: 0.9;
|
|
22
|
+
/** M1-4 轴线长度 = 放大镜半径 × 0.9 */
|
|
23
|
+
readonly axisLengthRadiusScale: 0.9;
|
|
24
|
+
/** Z 轴端点(朝外的一端)绿色圆点半径 = 放大镜半径 × 该系数 */
|
|
25
|
+
readonly axisTipDotRadiusScale: 0.03;
|
|
26
|
+
/** M2 平面框边框颜色 */
|
|
27
|
+
readonly planeBorderColor: "#FF4D4F";
|
|
28
|
+
/** M2-3 边框宽度 */
|
|
29
|
+
readonly planeBorderWidth: 1.5;
|
|
30
|
+
/** M2-3 边框不透明度 */
|
|
31
|
+
readonly planeBorderOpacity: 0.9;
|
|
32
|
+
/** M2-2 轴对齐面框边长 = 放大镜半径 × 1.2 */
|
|
33
|
+
readonly planeSideRadiusScale: 1.2;
|
|
34
|
+
/** M2 轴对齐判定:表面法线与最近世界轴的夹角小于该值即视为墙 / 地 / 顶 */
|
|
35
|
+
readonly axisSnapAngle: 15;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* 放大镜把渲染目标上的一块矩形区域拉伸到了 canvas 上,这里描述这块区域以及映射关系。
|
|
39
|
+
* 字段取值与 Magnifier.render() 内部完全一致,父类改动时需要同步。
|
|
40
|
+
*/
|
|
41
|
+
export interface MagnifierViewport {
|
|
42
|
+
camera: THREE.Camera;
|
|
43
|
+
/** 渲染目标尺寸,与 Magnifier.render() 里 getSize() 的结果一致 */
|
|
44
|
+
renderSize: THREE.Vector2;
|
|
45
|
+
/** 读取区域左边缘在渲染目标像素坐标系中的横坐标 */
|
|
46
|
+
readLeft: number;
|
|
47
|
+
/** 读取区域下边缘的纵坐标(渲染目标像素坐标系 y 轴向上,与 Magnifier.render() 里的同名量一致) */
|
|
48
|
+
readTop: number;
|
|
49
|
+
/** 读取区域的高度(渲染目标像素) */
|
|
50
|
+
readPixelsHeight: number;
|
|
51
|
+
/** 一个渲染像素在放大镜 canvas 上重复的倍数 */
|
|
52
|
+
pixelRadio: number;
|
|
53
|
+
/** 放大镜 canvas 的宽高(设备像素) */
|
|
54
|
+
canvasWidth: number;
|
|
55
|
+
canvasHeight: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 求交点的世界坐标系法线。
|
|
59
|
+
* 点云等拿不到 face 的情况返回 null(此时只画坐标轴,不画平面框)。
|
|
60
|
+
*
|
|
61
|
+
* 注意:这里不能再乘模型的法线矩阵。THREE.Mesh.raycast 在生成相交结果时已经把面法线
|
|
62
|
+
* 用 normalMatrix 变换到世界坐标系了;PointSelector 吸附到平面时合成的 Face3 更是直接写入
|
|
63
|
+
* 世界坐标系的平面法线。再乘一次会让法线偏离真实表面法线,红色平面框也就不再贴合选点所在面。
|
|
64
|
+
*/
|
|
65
|
+
export declare function getWorldNormal(intersection: PointIntersection): THREE.Vector3 | null;
|
|
66
|
+
export interface PlaneFrame {
|
|
67
|
+
/** 平面法线,也就是绿色 Z 轴的方向(朝表面外侧) */
|
|
68
|
+
normal: THREE.Vector3;
|
|
69
|
+
/** 平面内的水平方向 = 红色 X 轴 */
|
|
70
|
+
xAxis: THREE.Vector3;
|
|
71
|
+
/** 平面内最接近竖直的方向 = 蓝色 Y 轴 */
|
|
72
|
+
yAxis: THREE.Vector3;
|
|
73
|
+
/** 轴对齐面吸附到的世界轴下标(0=X / 1=Y / 2=Z),斜面为 -1 */
|
|
74
|
+
alignedAxisIndex: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 由表面法线构造落点所在平面的坐标系。
|
|
78
|
+
* 绿色 Z 轴 = 法线;蓝色 Y 轴取平面内最接近「世界向上」的方向;红色 X 轴 = 剩下的那条平面内方向。
|
|
79
|
+
* 平面接近水平(地板 / 天花板)时平面内没有竖直方向,退化为用世界 Z 当蓝色轴。
|
|
80
|
+
*
|
|
81
|
+
* 放大镜里的叠加层和场景里的小光标共用这一份坐标系,保证两处看到的红 / 绿 / 蓝完全一致。
|
|
82
|
+
*/
|
|
83
|
+
export declare function buildPlaneFrame(normal: THREE.Vector3): PlaneFrame;
|
|
84
|
+
/**
|
|
85
|
+
* 绘制落点叠加层。
|
|
86
|
+
* 调用时机:Magnifier.render() 里 putImageData 之后。
|
|
87
|
+
*/
|
|
88
|
+
export declare function drawMeasureOverlay(context: CanvasRenderingContext2D, viewport: MagnifierViewport, intersection: PointIntersection): void;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { PointSelector, PointIntersection } from '../shared-utils/three/PointSelector/index.js';
|
|
2
|
+
import * as THREE from 'three/webgpu';
|
|
3
|
+
/** V2 snapping only. The original PointSelector keeps its existing algorithm. */
|
|
4
|
+
export declare class MeasurePointSelector extends PointSelector {
|
|
5
|
+
/**
|
|
6
|
+
* @description 动态吸附线提供器:每次选点更新、吸附计算前调用,返回本次参与吸附的线段,不会写回 adhereLine。
|
|
7
|
+
* 适合按光标位置实时从模型提取的边线。返回的线按有限线段处理(clampToLine),
|
|
8
|
+
* 与 adhereLine 里的无限轴线(如量尺的 XYZ 轴)区分开。
|
|
9
|
+
*/
|
|
10
|
+
adhereLineProvider: ((params: {
|
|
11
|
+
intersection: PointIntersection;
|
|
12
|
+
pointSelector: PointSelector;
|
|
13
|
+
}) => THREE.Line3[]) | null;
|
|
14
|
+
/**
|
|
15
|
+
* @description 动态吸附线的屏幕吸附半径(像素)
|
|
16
|
+
* 动态线按「光标到线段投影的屏幕距离」取最近的一条,而不是按 3D 距离排序后让远边覆盖近边
|
|
17
|
+
*/
|
|
18
|
+
dynamicAdhereScreenRadius: number;
|
|
19
|
+
/**
|
|
20
|
+
* @description 已吸附后保持吸附的屏幕半径(像素),略大于进入半径,避免在阈值边界来回跳动
|
|
21
|
+
*/
|
|
22
|
+
dynamicAdhereKeepScreenRadius: number;
|
|
23
|
+
/**
|
|
24
|
+
* @description 动态吸附线允许的最大 3D 距离(米),用于排除画面深处或明显不在落点附近的边
|
|
25
|
+
*/
|
|
26
|
+
dynamicAdhereMaxDistance: number;
|
|
27
|
+
/**
|
|
28
|
+
* 上一次吸住的动态线。候选线集合会随查询球心移动而变化,
|
|
29
|
+
* 把吸住的边单独留住,光标在保持半径内时优先继续用它,避免在相邻边之间来回跳。
|
|
30
|
+
*/
|
|
31
|
+
private dynamicAdhereLine;
|
|
32
|
+
protected get mouseNdcPosition(): {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
};
|
|
36
|
+
refresh(): void;
|
|
37
|
+
private readonly onFocusLost;
|
|
38
|
+
enable(): void;
|
|
39
|
+
disable(): void;
|
|
40
|
+
clearDynamicAdhereLine(): void;
|
|
41
|
+
protected updatePointSelectorHelperIntersect: (intersect?: PointIntersection | null) => void;
|
|
42
|
+
/**
|
|
43
|
+
* @description 在动态吸附线(模型边)中选出屏幕上离光标最近的一条。
|
|
44
|
+
*
|
|
45
|
+
* 三个要点:
|
|
46
|
+
* 1. 用射线与线段的最近点求落点,避免透视投影下屏幕比例回推 3D 点造成的偏差;
|
|
47
|
+
* 2. 光标贴着已吸住的边时直接锁定,不让相邻边参与评分,消除来回跳;
|
|
48
|
+
* 3. 需要换边时按「屏幕距离 + 深度惩罚」择优,避免吸到屏幕上重叠、但实际更远的边。
|
|
49
|
+
*/
|
|
50
|
+
private getBestDynamicAdhereResult;
|
|
51
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as THREE from 'three/webgpu';
|
|
2
|
+
/**
|
|
3
|
+
* 模型边缘吸附。
|
|
4
|
+
*
|
|
5
|
+
* 选点器本身已经支持吸附到 `THREE.Line3`,five 的 Model 也提供了 `getEdgesBySphere()`,
|
|
6
|
+
* 这里只做两件事:
|
|
7
|
+
* 1. 把光标附近的模型边界线取出来、按离落点的距离排序并限量;
|
|
8
|
+
* 2. 缓存查询结果,避免每次 mousemove 都重走一遍 BVH。
|
|
9
|
+
*
|
|
10
|
+
* 取出来的线交给 `PointSelector.adhereLineProvider`,由选点器完成真正的吸附。
|
|
11
|
+
*/
|
|
12
|
+
export interface EdgeSnapOptions {
|
|
13
|
+
/** 是否启用。V2 默认 true;原测量插件不接入此能力 */
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
/** 查询球半径(米),只在这个范围内找模型边线,默认 0.3 */
|
|
16
|
+
radius?: number;
|
|
17
|
+
/** 面片夹角阈值(度),越小越只保留硬边,默认 30 */
|
|
18
|
+
threshold?: number;
|
|
19
|
+
/** 单次最多参与吸附的边数,默认 240 */
|
|
20
|
+
maxEdges?: number;
|
|
21
|
+
/** 光标移动超过该距离(米)才重新查询,默认 0.12 */
|
|
22
|
+
cacheStep?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface ResolvedEdgeSnapOptions extends Required<EdgeSnapOptions> {
|
|
25
|
+
}
|
|
26
|
+
export declare const DEFAULT_EDGE_SNAP_OPTIONS: ResolvedEdgeSnapOptions;
|
|
27
|
+
export declare function resolveEdgeSnapOptions(options?: boolean | EdgeSnapOptions): ResolvedEdgeSnapOptions;
|
|
28
|
+
/** 只依赖 getEdgesBySphere,避免把 dnalogel 绑死在某个 five 版本上 */
|
|
29
|
+
type EdgeSource = {
|
|
30
|
+
getEdgesBySphere?: (sphere: THREE.Sphere, threshold?: number) => THREE.Line3[];
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* 取落点附近的模型边界线,按离落点从近到远排序,最多 maxEdges 条。
|
|
34
|
+
* five 的 getEdgesBySphere 返回的是世界坐标线段,可以直接交给 PointSelector。
|
|
35
|
+
*
|
|
36
|
+
* 注意:getEdgesBySphere 是按「三角形与球相交」筛选的,大三角形的边可能落在球外很远,
|
|
37
|
+
* 所以这里再按「点到线段」的真实距离过滤一次,避免把远处的边也当成候选。
|
|
38
|
+
*/
|
|
39
|
+
export declare function collectNearbyEdges(model: EdgeSource | null | undefined, point: THREE.Vector3, options: ResolvedEdgeSnapOptions): THREE.Line3[];
|
|
40
|
+
/**
|
|
41
|
+
* `getEdgesBySphere` 每次都要遍历可见瓦片、合几何、重建邻接关系,开销不低;
|
|
42
|
+
* 光标在 cacheStep 范围内移动时复用上一次结果,足够贴近“附近有哪些边”的事实。
|
|
43
|
+
*/
|
|
44
|
+
export declare class EdgeSnapCache {
|
|
45
|
+
private center;
|
|
46
|
+
private edges;
|
|
47
|
+
private valid;
|
|
48
|
+
query(model: EdgeSource | null | undefined, point: THREE.Vector3, options: ResolvedEdgeSnapOptions): THREE.Line3[];
|
|
49
|
+
clear(): void;
|
|
50
|
+
/** 最近一次查询到的边数,调试 / 示例页展示用 */
|
|
51
|
+
get size(): number;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Five } from '@realsee/five-webgpu';
|
|
2
|
+
import { MeasureControllerV2 } from './Controller.js';
|
|
3
|
+
/**
|
|
4
|
+
* 量尺插件 V2 —— 点位选择可视化(对应 PRD《量尺点位选择器优化》)
|
|
5
|
+
*
|
|
6
|
+
* 与 MeasurePlugin 的关系:V2 是试点 fork,完全继承 MeasurePlugin 的控制器,
|
|
7
|
+
* 新吸附算法、放大镜叠加层和场景光标仅在 V2 中生效,原插件继续使用原选点器。
|
|
8
|
+
*
|
|
9
|
+
* 使用方式(Console / 编辑器等接入方):
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { MeasurePluginV2 } from '@realsee/dnalogel/plugins/measure-v2'
|
|
12
|
+
* const measure = MeasurePluginV2(five, { unit: 'm' })
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export { MeasureControllerV2 } from './Controller.js';
|
|
16
|
+
export type { MeasurePluginV2Config } from './Controller.js';
|
|
17
|
+
export { MeasureMagnifier } from './Magnifier.js';
|
|
18
|
+
export type { MeasureMagnifierOptions } from './Magnifier.js';
|
|
19
|
+
export { drawMeasureOverlay, getWorldNormal, OVERLAY_STYLE } from './PointOverlay.js';
|
|
20
|
+
export type { MagnifierViewport } from './PointOverlay.js';
|
|
21
|
+
export { collectNearbyEdges, EdgeSnapCache, DEFAULT_EDGE_SNAP_OPTIONS } from './edgeSnap.js';
|
|
22
|
+
export type { EdgeSnapOptions, ResolvedEdgeSnapOptions } from './edgeSnap.js';
|
|
23
|
+
export { validatePolygon } from '../MeasurePlugin/index.js';
|
|
24
|
+
export type { MeasureEndReason, MeasurePluginConfig, MeasurePluginEventMap, MeasureInteractionState } from '../MeasurePlugin/index.js';
|
|
25
|
+
export type MeasureControllerV2Interface = InstanceType<typeof MeasureControllerV2>;
|
|
26
|
+
export type MeasurePluginV2ParamsInterface = ConstructorParameters<typeof MeasureControllerV2>[1];
|
|
27
|
+
export declare const MeasurePluginV2: (five: Five, config?: MeasurePluginV2ParamsInterface) => MeasureControllerV2;
|
|
28
|
+
export default MeasurePluginV2;
|
|
@@ -47,6 +47,7 @@ export default class BaseController {
|
|
|
47
47
|
protected get currentMeasureType(): MeasureType;
|
|
48
48
|
private getMeasureType;
|
|
49
49
|
constructor(params: ControllerParams);
|
|
50
|
+
protected createPreviewLine(): Line;
|
|
50
51
|
updateDistanceUI: () => void;
|
|
51
52
|
updateAreaUI: () => void;
|
|
52
53
|
protected removeLine(line: Line): void;
|
|
@@ -2,6 +2,7 @@ import { default as Line } from '../Model/line.js';
|
|
|
2
2
|
import { default as BaseController, ControllerParams } from './BaseController.js';
|
|
3
3
|
import { Polyline } from '../Model/polyline.js';
|
|
4
4
|
import { default as Area } from '../Model/area.js';
|
|
5
|
+
import { PointSelector } from '../../shared-utils/three/PointSelector/index.js';
|
|
5
6
|
export default class EditController extends BaseController {
|
|
6
7
|
type: string;
|
|
7
8
|
polyline: Polyline;
|
|
@@ -10,11 +11,12 @@ export default class EditController extends BaseController {
|
|
|
10
11
|
private fiveElement?;
|
|
11
12
|
/** 上一个端点位置 */
|
|
12
13
|
private lastPoint;
|
|
13
|
-
|
|
14
|
+
protected pointSelector: PointSelector;
|
|
14
15
|
private deleteDom;
|
|
15
16
|
/** 根据 intersection 更新放大镜和吸附点 */
|
|
16
17
|
private onIntersectionUpdate;
|
|
17
18
|
constructor(params: ControllerParams);
|
|
19
|
+
protected createPointSelector(_params: ControllerParams): PointSelector;
|
|
18
20
|
dispose(): void;
|
|
19
21
|
getEditingLines(): Line[];
|
|
20
22
|
/** 撤销编辑 */
|
|
@@ -43,7 +45,7 @@ export default class EditController extends BaseController {
|
|
|
43
45
|
/** 移动全景时更新 distanceItem 在屏幕上的位置 */
|
|
44
46
|
private onCameraUpdate;
|
|
45
47
|
/** 更新虚线 */
|
|
46
|
-
|
|
48
|
+
protected updateDashed: () => void;
|
|
47
49
|
private wantsTapGesture;
|
|
48
50
|
private chooseLine;
|
|
49
51
|
private chooseArea;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ControllerParams, default as BaseController } from './BaseController.js';
|
|
2
2
|
import { default as Line } from '../Model/line.js';
|
|
3
3
|
import { Polyline } from '../Model/polyline.js';
|
|
4
|
+
import { default as RangePieceController } from '../Modules/rangePiece/index.js';
|
|
4
5
|
export type State = 'watching' | 'editing';
|
|
5
6
|
export default class MixedController extends BaseController {
|
|
6
7
|
state: State;
|
|
@@ -10,9 +11,10 @@ export default class MixedController extends BaseController {
|
|
|
10
11
|
private mobileNowPoint;
|
|
11
12
|
private highlightedLines;
|
|
12
13
|
private deleteDom;
|
|
13
|
-
|
|
14
|
+
protected rangePieceController: RangePieceController;
|
|
14
15
|
private disposers;
|
|
15
16
|
constructor(params: ControllerParams);
|
|
17
|
+
protected createRangePieceController(params: ControllerParams): RangePieceController;
|
|
16
18
|
dispose(): void;
|
|
17
19
|
highlightLine(line: Line): void;
|
|
18
20
|
clearHighlightLines(): void;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { default as Line } from '../Model/line.js';
|
|
2
|
+
import { Intersection } from '@realsee/five-webgpu';
|
|
2
3
|
import { default as BaseController, ControllerParams } from './BaseController.js';
|
|
4
|
+
import { Vector2 } from 'three/webgpu';
|
|
3
5
|
export default class WatchController extends BaseController {
|
|
4
6
|
type: string;
|
|
5
7
|
private deleteDom;
|
|
@@ -20,6 +22,8 @@ export default class WatchController extends BaseController {
|
|
|
20
22
|
private unHighlightLines;
|
|
21
23
|
private onPanStart;
|
|
22
24
|
private onPanEnd;
|
|
25
|
+
protected onPointEditEnd(): void;
|
|
26
|
+
protected resolveIntersection(intersection: Intersection, _mouse: Vector2): Intersection;
|
|
23
27
|
private onPan;
|
|
24
28
|
private onIntersectionUpdate;
|
|
25
29
|
private wantsPanGesture;
|
|
@@ -3,14 +3,16 @@ import { EditParameter, MeasureType, OpenParameter, MeasurePluginData, MeasurePl
|
|
|
3
3
|
import { PanoMeasurePluginEvent } from '../typings/event.type.js';
|
|
4
4
|
import { UserDistanceItem } from '../utils/dom/distanceItem.js';
|
|
5
5
|
import { Polyline } from '../Model/polyline.js';
|
|
6
|
+
import { ControllerParams } from './BaseController.js';
|
|
6
7
|
import { default as EditController } from './EditController.js';
|
|
7
8
|
import { default as ViewController } from './ViewController.js';
|
|
8
9
|
import { default as WatchController } from './WatchController.js';
|
|
9
10
|
import { default as MixedController } from './MixedController.js';
|
|
11
|
+
import { Model } from '../Model/index.js';
|
|
10
12
|
import { Five } from '@realsee/five-webgpu';
|
|
11
13
|
import { UIControllerParams } from '../Modules/UIController/index.js';
|
|
12
14
|
import { GuideControllerParams } from '../Modules/GuideController.js';
|
|
13
|
-
import { Magnifier } from '../../shared-utils/index.js';
|
|
15
|
+
import { Magnifier, MagnifierParameter } from '../../shared-utils/index.js';
|
|
14
16
|
import { default as Area } from '../Model/area.js';
|
|
15
17
|
import { PointSelectorConfig } from '../../shared-utils/three/PointSelector/index.js';
|
|
16
18
|
import * as BasePlugin from '../../base/BasePlugin.js';
|
|
@@ -23,6 +25,7 @@ export interface PanoMeasureParameterType extends Partial<Config> {
|
|
|
23
25
|
useGuideController?: boolean | GuideControllerParams;
|
|
24
26
|
userDistanceItemCreator?: () => UserDistanceItem;
|
|
25
27
|
}
|
|
28
|
+
export type ModeControllerConstructor = new (params: ControllerParams) => WatchController | EditController | MixedController | ViewController;
|
|
26
29
|
export default class PanoMeasureController extends BasePlugin.Controller<BasePlugin.State, BasePlugin.EventMap<BasePlugin.State> & PanoMeasurePluginEvent> {
|
|
27
30
|
state: BasePlugin.State;
|
|
28
31
|
hasOpen: boolean;
|
|
@@ -32,7 +35,7 @@ export default class PanoMeasureController extends BasePlugin.Controller<BasePlu
|
|
|
32
35
|
allowMeasureType: Array<MeasureType>;
|
|
33
36
|
/** 当前的测量类型 */
|
|
34
37
|
currentMeasureType: MeasureType | null;
|
|
35
|
-
|
|
38
|
+
protected model: Model;
|
|
36
39
|
private group;
|
|
37
40
|
private config;
|
|
38
41
|
private isMobile;
|
|
@@ -42,6 +45,9 @@ export default class PanoMeasureController extends BasePlugin.Controller<BasePlu
|
|
|
42
45
|
private container;
|
|
43
46
|
private shortcutKeyController?;
|
|
44
47
|
constructor(five: Five, params: PanoMeasureParameterType);
|
|
48
|
+
protected createMagnifier(five: Five, options: MagnifierParameter): Magnifier;
|
|
49
|
+
protected createModeController(params: ControllerParams, Controller: ModeControllerConstructor): MixedController | EditController | ViewController | WatchController;
|
|
50
|
+
protected resetUIController(): void;
|
|
45
51
|
appendTo(parent: HTMLElement): void;
|
|
46
52
|
clear(): void;
|
|
47
53
|
dispose(): void;
|
|
@@ -100,5 +106,5 @@ export default class PanoMeasureController extends BasePlugin.Controller<BasePlu
|
|
|
100
106
|
changeConfigs(config: Config): void;
|
|
101
107
|
/** 设置线段的文本 */
|
|
102
108
|
setCustomText(lineID: string, text: string): void;
|
|
103
|
-
|
|
109
|
+
protected createControllerParams(): ControllerParams;
|
|
104
110
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Five } from '@realsee/five-webgpu';
|
|
1
|
+
import { Five, Intersection, IntersectMeshInterface } from '@realsee/five-webgpu';
|
|
2
2
|
import { Group } from 'three/webgpu';
|
|
3
3
|
import { Model } from '../../Model/index.js';
|
|
4
4
|
import { PanoMeasurePluginEvent } from '../../typings/event.type.js';
|
|
@@ -22,21 +22,21 @@ export default class RangePieceController {
|
|
|
22
22
|
private hook;
|
|
23
23
|
private content;
|
|
24
24
|
private intersectMesh;
|
|
25
|
-
|
|
25
|
+
protected centerMouseXY: any;
|
|
26
26
|
private raycaster;
|
|
27
27
|
private pieceStyl;
|
|
28
28
|
constructor(params: RangePieceControllerParams);
|
|
29
29
|
dispose(): void;
|
|
30
|
-
|
|
30
|
+
protected onCameraDirectionUpdate: () => void;
|
|
31
31
|
private onWillChangeState;
|
|
32
32
|
/** 计算目标中心点经纬度 */
|
|
33
33
|
private computedCenterMouseXY;
|
|
34
34
|
/** 计算目标中心点intersection */
|
|
35
|
-
|
|
35
|
+
protected getIntersection(): Intersection;
|
|
36
36
|
private pieceChange;
|
|
37
37
|
private calculateSize;
|
|
38
38
|
/** 点击按钮时圆片动画 */
|
|
39
39
|
private dotAnimation;
|
|
40
40
|
private changePieceStyl;
|
|
41
|
-
|
|
41
|
+
protected updateMouseGroup(intersection: Intersection, mesh?: IntersectMeshInterface): Group<import('three').Object3DEventMap>;
|
|
42
42
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Five } from '@realsee/five-webgpu';
|
|
2
|
+
import { default as PanoMeasureController, ModeControllerConstructor, PanoMeasureParameterType } from '../PanoMeasurePlugin/Controller/index.js';
|
|
3
|
+
import { default as EditController } from '../PanoMeasurePlugin/Controller/EditController.js';
|
|
4
|
+
import { default as MixedController } from '../PanoMeasurePlugin/Controller/MixedController.js';
|
|
5
|
+
import { default as WatchController } from '../PanoMeasurePlugin/Controller/WatchController.js';
|
|
6
|
+
import { ControllerParams } from '../PanoMeasurePlugin/Controller/BaseController.js';
|
|
7
|
+
import { PanoMagnifier } from './PointSelector.js';
|
|
8
|
+
import { EdgeSnapOptions } from '../MeasurePluginV2/edgeSnap.js';
|
|
9
|
+
import { MagnifierParameter } from '../shared-utils/index.js';
|
|
10
|
+
export type PanoMeasurePluginV2Config = PanoMeasureParameterType & {
|
|
11
|
+
edgeSnap?: boolean | EdgeSnapOptions;
|
|
12
|
+
};
|
|
13
|
+
/** Reuses panorama modes, events, models and serialization; only V2 picking changes. */
|
|
14
|
+
export declare class PanoMeasureControllerV2 extends PanoMeasureController {
|
|
15
|
+
private readonly edgeSnapOptions;
|
|
16
|
+
private mobileStyle?;
|
|
17
|
+
private readonly mixedSavedPolylineIDs;
|
|
18
|
+
constructor(five: Five, params?: PanoMeasurePluginV2Config);
|
|
19
|
+
get pointSelector(): import('./PointSelector.js').PanoPointSelector;
|
|
20
|
+
get lastEdgeSnapEdgeCount(): number;
|
|
21
|
+
get edgeSnapEnabled(): boolean;
|
|
22
|
+
setEdgeSnapEnabled(enabled: boolean): void;
|
|
23
|
+
clear(): void;
|
|
24
|
+
load(data: Parameters<PanoMeasureController['load']>[0]): void;
|
|
25
|
+
save(config?: Parameters<PanoMeasureController['save']>[0]): this;
|
|
26
|
+
removePolylineByID(id: string): void;
|
|
27
|
+
removePolyline(polyline: Parameters<PanoMeasureController['removePolyline']>[0]): void;
|
|
28
|
+
dispose(): void;
|
|
29
|
+
protected createControllerParams(): ControllerParams;
|
|
30
|
+
protected createMagnifier(five: Five, options: MagnifierParameter): PanoMagnifier;
|
|
31
|
+
protected createModeController(params: ControllerParams, Controller: ModeControllerConstructor): MixedController | EditController | import('../PanoMeasurePlugin/Controller/ViewController.js').default | WatchController;
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Five } from '@realsee/five-webgpu';
|
|
2
|
+
import { MeasurePointSelector } from '../MeasurePluginV2/PointSelector.js';
|
|
3
|
+
import { MeasureMagnifier } from '../MeasurePluginV2/Magnifier.js';
|
|
4
|
+
import { ResolvedEdgeSnapOptions } from '../MeasurePluginV2/edgeSnap.js';
|
|
5
|
+
import { PointIntersection, PointSelectorConfig } from '../shared-utils/three/PointSelector/index.js';
|
|
6
|
+
/** The panorama entry uses the same snapping engine as spatial measurement V2. */
|
|
7
|
+
declare class PanoMagnifier extends MeasureMagnifier {
|
|
8
|
+
appendTo(element: Element): this;
|
|
9
|
+
}
|
|
10
|
+
export { PanoMagnifier };
|
|
11
|
+
export declare class PanoPointSelector extends MeasurePointSelector {
|
|
12
|
+
private readonly sharedMagnifier?;
|
|
13
|
+
private readonly refreshManualInput?;
|
|
14
|
+
private readonly edgeCache;
|
|
15
|
+
private suppliedNdc?;
|
|
16
|
+
private overlayMagnifier?;
|
|
17
|
+
lastEdgeSnapEdgeCount: number;
|
|
18
|
+
private readonly onModifiersChanged;
|
|
19
|
+
private readonly onWindowBlur;
|
|
20
|
+
constructor(five: Five, config: PointSelectorConfig, edgeOptions: ResolvedEdgeSnapOptions, sharedMagnifier?: MeasureMagnifier, refreshManualInput?: () => void);
|
|
21
|
+
protected get mouseNdcPosition(): {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
};
|
|
25
|
+
/** Resolve fixed-center and endpoint-drag input without installing another pointer listener. */
|
|
26
|
+
resolveIntersection<T extends PointIntersection>(intersection: T | null, ndc: {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
}): T & PointIntersection;
|
|
30
|
+
resetSnap(): void;
|
|
31
|
+
dispose(): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Vector3 } from 'three/webgpu';
|
|
2
|
+
import { default as Line } from '../PanoMeasurePlugin/Model/line.js';
|
|
3
|
+
/** WebGPU caches attribute bindings. Keep the preview buffers alive while endpoints move. */
|
|
4
|
+
export declare class PanoPreviewLine extends Line {
|
|
5
|
+
setPoints(start: Vector3, end: Vector3): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Intersection, IntersectMeshInterface } from '@realsee/five-webgpu';
|
|
2
|
+
import { Vector2 } from 'three/webgpu';
|
|
3
|
+
import { default as EditController } from '../PanoMeasurePlugin/Controller/EditController.js';
|
|
4
|
+
import { default as MixedController } from '../PanoMeasurePlugin/Controller/MixedController.js';
|
|
5
|
+
import { default as WatchController } from '../PanoMeasurePlugin/Controller/WatchController.js';
|
|
6
|
+
import { PanoPreviewLine } from './PreviewLine.js';
|
|
7
|
+
import { default as RangePieceController } from '../PanoMeasurePlugin/Modules/rangePiece/index.js';
|
|
8
|
+
import { ControllerParams } from '../PanoMeasurePlugin/Controller/BaseController.js';
|
|
9
|
+
import { ResolvedEdgeSnapOptions } from '../MeasurePluginV2/edgeSnap.js';
|
|
10
|
+
import { PanoPointSelector } from './PointSelector.js';
|
|
11
|
+
export interface PanoControllerParamsV2 extends ControllerParams {
|
|
12
|
+
edgeSnapOptions: ResolvedEdgeSnapOptions;
|
|
13
|
+
}
|
|
14
|
+
export declare class PanoEditControllerV2 extends EditController {
|
|
15
|
+
protected createPreviewLine(): PanoPreviewLine;
|
|
16
|
+
private readonly updateLivePreview;
|
|
17
|
+
constructor(params: PanoControllerParamsV2);
|
|
18
|
+
dispose(): void;
|
|
19
|
+
get selector(): PanoPointSelector;
|
|
20
|
+
protected createPointSelector(params: ControllerParams): PanoPointSelector;
|
|
21
|
+
}
|
|
22
|
+
declare class PanoRangePieceV2 extends RangePieceController {
|
|
23
|
+
refresh(): void;
|
|
24
|
+
readonly selector: PanoPointSelector;
|
|
25
|
+
constructor(params: PanoControllerParamsV2);
|
|
26
|
+
protected getIntersection(): Intersection & import('../shared-utils/index.js').PointIntersection;
|
|
27
|
+
protected updateMouseGroup(intersection: Intersection, mesh?: IntersectMeshInterface): import('three').Group<import('three').Object3DEventMap>;
|
|
28
|
+
dispose(): void;
|
|
29
|
+
}
|
|
30
|
+
export declare class PanoMixedControllerV2 extends MixedController {
|
|
31
|
+
refreshPoint(): void;
|
|
32
|
+
protected createPreviewLine(): PanoPreviewLine;
|
|
33
|
+
constructor(params: PanoControllerParamsV2);
|
|
34
|
+
get selector(): PanoPointSelector;
|
|
35
|
+
protected createRangePieceController(params: ControllerParams): PanoRangePieceV2;
|
|
36
|
+
}
|
|
37
|
+
export declare class PanoWatchControllerV2 extends WatchController {
|
|
38
|
+
readonly selector: PanoPointSelector;
|
|
39
|
+
constructor(params: PanoControllerParamsV2);
|
|
40
|
+
protected resolveIntersection(intersection: Intersection, mouse: Vector2): Intersection;
|
|
41
|
+
protected onPointEditEnd(): void;
|
|
42
|
+
dispose(): void;
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Five } from '@realsee/five-webgpu';
|
|
2
|
+
import { PanoMeasureControllerV2, PanoMeasurePluginV2Config } from './Controller.js';
|
|
3
|
+
export { PanoMeasureControllerV2 };
|
|
4
|
+
export type { PanoMeasurePluginV2Config };
|
|
5
|
+
export type { MeasurePluginData as PanoMeasurePluginV2Data, MeasurePluginServerData as PanoMeasurePluginV2ServerData } from '../PanoMeasurePlugin/typings/data.js';
|
|
6
|
+
export type PanoMeasurePluginV2Instance = PanoMeasureControllerV2;
|
|
7
|
+
export declare const PanoMeasurePluginV2: (five: Five, params?: PanoMeasurePluginV2Config) => PanoMeasureControllerV2;
|
|
8
|
+
export default PanoMeasurePluginV2;
|
|
@@ -91,3 +91,7 @@ export { PaintBrush } from './components.js';
|
|
|
91
91
|
export { ModelFloorplanPlugin, MapviewFloorplanPlugin, TopviewFloorplanPlugin, PanoFloorplanRadarPlugin, FloorplanGuidePlugin } from './floorplan.js';
|
|
92
92
|
import * as Util from '../shared-utils/index.js';
|
|
93
93
|
export { Util };
|
|
94
|
+
export { MeasurePluginV2 } from './plugins/measure-v2.js';
|
|
95
|
+
export type { MeasurePluginV2Instance, MeasurePluginV2Config } from './plugins/measure-v2.js';
|
|
96
|
+
export { PanoMeasurePluginV2 } from './plugins/pano-measure-v2.js';
|
|
97
|
+
export type { PanoMeasurePluginV2Config, PanoMeasurePluginV2Instance } from './plugins/pano-measure-v2.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MeasurePluginV2 } from '../../MeasurePluginV2/index.js';
|
|
2
|
+
export { MeasurePluginV2, MeasureControllerV2, MeasureMagnifier, DEFAULT_EDGE_SNAP_OPTIONS, collectNearbyEdges, EdgeSnapCache } from '../../MeasurePluginV2/index.js';
|
|
3
|
+
export type { MeasurePluginV2Config, MeasureControllerV2Interface, MeasurePluginV2ParamsInterface, MeasureMagnifierOptions, EdgeSnapOptions, ResolvedEdgeSnapOptions } from '../../MeasurePluginV2/index.js';
|
|
4
|
+
export type { MeasureEndReason, MeasurePluginEventMap, MeasureInteractionState } from '../../MeasurePlugin/index.js';
|
|
5
|
+
export type MeasurePluginV2Instance = ReturnType<typeof MeasurePluginV2>;
|