@realsee/dnalogel 3.75.1 → 3.76.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/Sculpt/index.d.ts +11 -2
- package/dist/index.cjs.js +4 -4
- package/dist/index.js +5 -3
- package/dist/index.umd.js +4 -4
- package/dist/shared-utils/three/PointSelector/index.d.ts +5 -1
- package/libs/Sculpt/index.d.ts +11 -2
- package/libs/Sculpt/utils/Modules/Global.js +2 -1
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/index.d.ts +5 -1
- package/libs/shared-utils/three/PointSelector/index.js +5 -4
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Five } from '@realsee/five';
|
|
2
2
|
import { PointSelectorHelper, type PointIntersection, type PointSelectorHelperConfig } from './utils/PointSelectorHelper';
|
|
3
|
-
import type { Vector3 } from 'three';
|
|
3
|
+
import type { Intersection, Vector3 } from 'three';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { Subscribe } from '../../Subscribe';
|
|
6
6
|
import type { LiteralString } from '../../../typings/utils.type';
|
|
@@ -39,6 +39,10 @@ interface Config {
|
|
|
39
39
|
* @default false
|
|
40
40
|
*/
|
|
41
41
|
skipPanorama: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* five 6.7.0 特性,可配置是否自定义拾取点过滤函数
|
|
44
|
+
*/
|
|
45
|
+
hitFilter: (intersect: Intersection) => boolean;
|
|
42
46
|
}
|
|
43
47
|
export type PointSelectorConfig = Partial<Config>;
|
|
44
48
|
type EventMap = {
|
package/libs/Sculpt/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export interface SculptConfig {
|
|
|
32
32
|
/**
|
|
33
33
|
* @description 放大镜配置
|
|
34
34
|
* 设置为 null 或 false 可禁用放大镜功能
|
|
35
|
-
* @default { width: 190, height: 190, scale: 2, dragEnabled: true }
|
|
35
|
+
* @default *{ width: 190, height: 190, scale: 2, dragEnabled: true }*
|
|
36
36
|
*/
|
|
37
37
|
magnifier?: MagnifierParameter | null | false;
|
|
38
38
|
/**
|
|
@@ -41,6 +41,11 @@ export interface SculptConfig {
|
|
|
41
41
|
* @default false
|
|
42
42
|
*/
|
|
43
43
|
hideCursorCircle?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* @description 是否自定义拾取点过滤函数
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
hitFilter?: (intersect: THREE.Intersection) => boolean;
|
|
44
49
|
}
|
|
45
50
|
interface Data {
|
|
46
51
|
items: Array<BuiltInData>;
|
|
@@ -236,7 +241,11 @@ export declare const SculptPlugin: (five: Five, themeOrParams?: Partial<{
|
|
|
236
241
|
polyline: Partial<import("./typings").LineMeshStyle>;
|
|
237
242
|
polygon: Partial<import("./typings").AreaStyle>;
|
|
238
243
|
prism: Partial<import("./typings").PrismStyle>;
|
|
239
|
-
rectangle: Partial<import("./typings").RectangleStyle>;
|
|
244
|
+
rectangle: Partial<import("./typings").RectangleStyle>; /**
|
|
245
|
+
* @description prism 检测到自相交时的回调
|
|
246
|
+
* @param item Prism 实例
|
|
247
|
+
* @param point 尝试添加但被拒绝的点坐标
|
|
248
|
+
*/
|
|
240
249
|
circle: Partial<import("./typings").CircleStyle>;
|
|
241
250
|
cylinder: Partial<import("./typings").CircleStyle>;
|
|
242
251
|
box: Partial<import("./typings").BoxStyle>;
|
|
@@ -43,7 +43,8 @@ class D {
|
|
|
43
43
|
let i = e === null || e === !1 ? { magnifier: null } : { magnifierParams: e };
|
|
44
44
|
return (s = this.config) != null && s.hideCursorCircle && (i = f(h({}, i), { pointHelper: null })), this._pointSelector = new a(this.five, {
|
|
45
45
|
mode: "cursor",
|
|
46
|
-
helper: i
|
|
46
|
+
helper: i,
|
|
47
|
+
hitFilter: this.config.hitFilter
|
|
47
48
|
}), this._pointSelector;
|
|
48
49
|
}
|
|
49
50
|
get fiveDomEvents() {
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.76.0",
|
|
4
4
|
[
|
|
5
5
|
"background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')",
|
|
6
6
|
"background-repeat: no-repeat",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Five } from '@realsee/five';
|
|
2
2
|
import { PointSelectorHelper, type PointIntersection, type PointSelectorHelperConfig } from './utils/PointSelectorHelper';
|
|
3
|
-
import type { Vector3 } from 'three';
|
|
3
|
+
import type { Intersection, Vector3 } from 'three';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { Subscribe } from '../../Subscribe';
|
|
6
6
|
import type { LiteralString } from '../../../typings/utils.type';
|
|
@@ -39,6 +39,10 @@ interface Config {
|
|
|
39
39
|
* @default false
|
|
40
40
|
*/
|
|
41
41
|
skipPanorama: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* five 6.7.0 特性,可配置是否自定义拾取点过滤函数
|
|
44
|
+
*/
|
|
45
|
+
hitFilter: (intersect: Intersection) => boolean;
|
|
42
46
|
}
|
|
43
47
|
export type PointSelectorConfig = Partial<Config>;
|
|
44
48
|
type EventMap = {
|
|
@@ -18,8 +18,8 @@ import { Subscribe as j } from "../../Subscribe.js";
|
|
|
18
18
|
import { getIntersectByRaycaster as A, getVirtualIntersectByRaycaster as G } from "../../five/getPosition.js";
|
|
19
19
|
import { getRaycasterByNdcPosition as W } from "../../five/getRaycasterByNdcPosition.js";
|
|
20
20
|
import { CURSOR_NOT_ALLOW_URL as V } from "./utils/contents.js";
|
|
21
|
-
import { rayOnLine as
|
|
22
|
-
import { THREERaycaster as
|
|
21
|
+
import { rayOnLine as g } from "../../../Sculpt/utils/three/rayOnLine.js";
|
|
22
|
+
import { THREERaycaster as z } from "../core/Raycaster.js";
|
|
23
23
|
const _ = new o.Vector3(), w = () => !1;
|
|
24
24
|
class se extends j {
|
|
25
25
|
constructor(e, t) {
|
|
@@ -182,6 +182,7 @@ class se extends j {
|
|
|
182
182
|
i(this, "updateByNdcPosition", (e) => {
|
|
183
183
|
var c, u, d;
|
|
184
184
|
const t = W(this.five, e);
|
|
185
|
+
this.config.hitFilter && (t.hitFilter = this.config.hitFilter);
|
|
185
186
|
let s = A(this.five, t);
|
|
186
187
|
if (s) {
|
|
187
188
|
if (this.plane && this.planeMode === "vertical" && (s = T(P({}, s), {
|
|
@@ -251,8 +252,8 @@ class se extends j {
|
|
|
251
252
|
if (a.distanceTo(e.point) < this.adhereRadius)
|
|
252
253
|
(!this.plane || this.plane.distanceToPoint(a) < 0.01) && (a = (d = (u = this.plane) == null ? void 0 : u.projectPoint(a, new o.Vector3())) != null ? d : a, t.point = a.clone(), t.adhereLine = r.clone(), t.isAdsorbed = !0);
|
|
253
254
|
else {
|
|
254
|
-
const p =
|
|
255
|
-
raycaster: new
|
|
255
|
+
const p = g({
|
|
256
|
+
raycaster: new z(this.five.camera.position, e.point.clone().sub(this.five.camera.position).normalize()),
|
|
256
257
|
line: r,
|
|
257
258
|
clampToLine: !1
|
|
258
259
|
}), v = p.clone().project(this.five.camera);
|