@realsee/dnalogel 3.75.1 → 3.76.0-alpha.1

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.
@@ -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 = {
@@ -1,7 +1,7 @@
1
- var s = Object.defineProperty;
2
- var i = (o, e, t) => e in o ? s(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var n = (o, e, t) => (i(o, typeof e != "symbol" ? e + "" : e, t), t);
4
- class u {
1
+ var o = Object.defineProperty;
2
+ var s = (r, e, t) => e in r ? o(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var n = (r, e, t) => (s(r, typeof e != "symbol" ? e + "" : e, t), t);
4
+ class l {
5
5
  constructor(e, t) {
6
6
  n(this, "five");
7
7
  n(this, "measureController");
@@ -16,18 +16,15 @@ class u {
16
16
  n(this, "onMouseDown", (e) => {
17
17
  e.button === 2 && (e.preventDefault(), this.measureController.save().changeMode("Watch"));
18
18
  });
19
- this.five = t, this.measureController = e;
20
- const r = this.five.getElement();
21
- r && (document.body.addEventListener("keydown", this.onKeyDown), r.addEventListener("mousedown", this.onMouseDown));
19
+ this.five = t, this.measureController = e, this.five.getElement() && document.body.addEventListener("keydown", this.onKeyDown);
22
20
  }
23
21
  dispose() {
24
- const e = this.five.getElement();
25
- e && (document.body.removeEventListener("keydown", this.onKeyDown), e.removeEventListener("mousedown", this.onMouseDown));
22
+ this.five.getElement() && document.body.removeEventListener("keydown", this.onKeyDown);
26
23
  }
27
24
  escape() {
28
25
  return this.measureController.getCurrentMode() === "Watch" ? this.measureController.disable() : this.measureController.save().changeMode("Watch");
29
26
  }
30
27
  }
31
28
  export {
32
- u as ShortcutKeyController
29
+ l as ShortcutKeyController
33
30
  };
@@ -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() {
@@ -1,7 +1,7 @@
1
1
  var e = Object.defineProperty;
2
2
  var s = (o, t, i) => t in o ? e(o, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : o[t] = i;
3
3
  var r = (o, t, i) => (s(o, typeof t != "symbol" ? t + "" : t, i), i);
4
- import { Subscribe as m } from "../shared-utils/Subscribe.js";
4
+ import { Subscribe as l } from "../shared-utils/Subscribe.js";
5
5
  import "../shared-utils/tag.js";
6
6
  import "three";
7
7
  import "../vendor/hammerjs/hammer.js";
@@ -15,7 +15,7 @@ import "../shared-utils/three/blink.js";
15
15
  import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
16
16
  import "../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
17
17
  import "../vendor/earcut/src/earcut.js";
18
- import { FiveUtil as l } from "../shared-utils/Utils/FiveUtil.js";
18
+ import { FiveUtil as m } from "../shared-utils/Utils/FiveUtil.js";
19
19
  import { DEFAULT_STATIC_PREFIX as p } from "../shared-utils/url/defaultUrls.js";
20
20
  import "../shared-utils/five/FivePuppet.js";
21
21
  let I = class {
@@ -23,7 +23,7 @@ let I = class {
23
23
  /**
24
24
  * @realsee/dnalogel 版本号
25
25
  */
26
- r(this, "VERSION", "3.75.1");
26
+ r(this, "VERSION", "3.76.0-alpha.1");
27
27
  r(this, "NAME");
28
28
  r(this, "five");
29
29
  r(this, "workUtil");
@@ -31,9 +31,9 @@ let I = class {
31
31
  /**
32
32
  * @description: 插件事件钩子
33
33
  */
34
- r(this, "hooks", new m());
34
+ r(this, "hooks", new l());
35
35
  r(this, "staticPrefix", p);
36
- this.five = t, this.fiveUtil = new l(t), this.workUtil = this.fiveUtil.workUtil, i != null && i.staticPrefix && (this.staticPrefix = i.staticPrefix);
36
+ this.five = t, this.fiveUtil = new m(t), this.workUtil = this.fiveUtil.workUtil, i != null && i.staticPrefix && (this.staticPrefix = i.staticPrefix);
37
37
  }
38
38
  set workCode(t) {
39
39
  this.workUtil.workCode = t, this.onWorkCodeChange();
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.75.1",
3
+ "%c %c@realsee/dnalogel %cv3.76.0-alpha.1",
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 z } from "../../../Sculpt/utils/three/rayOnLine.js";
22
- import { THREERaycaster as K } from "../core/Raycaster.js";
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 = z({
255
- raycaster: new K(this.five.camera.position, e.point.clone().sub(this.five.camera.position).normalize()),
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/dnalogel",
3
- "version": "3.75.1",
3
+ "version": "3.76.0-alpha.1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",