@realsee/dnalogel 3.44.5 → 3.45.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 +3 -0
- package/dist/Sculpt/Meshes/Area.d.ts +1 -1
- package/dist/Sculpt/Meshes/Box.d.ts +1 -1
- package/dist/Sculpt/Meshes/Circle.d.ts +1 -1
- package/dist/Sculpt/Meshes/CircleWithEdge.d.ts +1 -1
- package/dist/Sculpt/Meshes/Line.d.ts +2 -1
- package/dist/Sculpt/Meshes/LineWithDots.d.ts +1 -1
- package/dist/Sculpt/Meshes/Point.d.ts +1 -1
- package/dist/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
- package/dist/Sculpt/Meshes/Prism.d.ts +1 -1
- package/dist/Sculpt/Meshes/RectangleWithEdge.d.ts +3 -4
- package/dist/Sculpt/Objects/Line/Editor.d.ts +22 -0
- package/dist/Sculpt/Objects/Line/index.d.ts +33 -0
- package/dist/Sculpt/Objects/Point/index.d.ts +1 -1
- package/dist/Sculpt/Objects/Polygon/Editor.d.ts +2 -2
- package/dist/Sculpt/Objects/Polygon/index.d.ts +3 -2
- package/dist/Sculpt/Objects/Polyline/Editor.d.ts +3 -17
- package/dist/Sculpt/Objects/Polyline/index.d.ts +7 -6
- package/dist/Sculpt/index.d.ts +5 -0
- package/dist/Sculpt/typings/index.d.ts +11 -6
- package/dist/Sculpt/{utils/color.d.ts → typings/style.d.ts} +7 -0
- package/dist/Sculpt/typings/utils.type.d.ts +2 -0
- package/dist/Sculpt/utils/three/ColoredMesh.d.ts +1 -1
- package/dist/Sculpt/utils/three/rayOnLine.d.ts +3 -5
- package/dist/index.cjs.js +56 -56
- package/dist/index.js +4272 -4171
- package/dist/index.umd.js +45 -45
- package/dist/shared-utils/Utils/WorkUtil.d.ts +6 -6
- package/libs/ModelMakerPlugin/Controller.js +1 -1
- package/libs/ModelMakerPlugin/index.js +1 -1
- package/libs/PanoMeasurePlugin/Components/Controller0.js +1 -1
- package/libs/PanoMeasurePlugin/Components/Controller1.js +1 -1
- package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -1
- package/libs/PanoMeasurePlugin/Controller/index.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +1 -1
- package/libs/PanoMeasurePlugin/index.js +1 -1
- package/libs/Sculpt/Meshes/Area.d.ts +1 -1
- package/libs/Sculpt/Meshes/Box.d.ts +1 -1
- package/libs/Sculpt/Meshes/Box.js +10 -10
- package/libs/Sculpt/Meshes/Circle.d.ts +1 -1
- package/libs/Sculpt/Meshes/Circle.js +1 -1
- package/libs/Sculpt/Meshes/CircleWithEdge.d.ts +1 -1
- package/libs/Sculpt/Meshes/Cylinder.js +1 -1
- package/libs/Sculpt/Meshes/Line.d.ts +2 -1
- package/libs/Sculpt/Meshes/Line.js +55 -47
- package/libs/Sculpt/Meshes/LineWithDots.d.ts +1 -1
- package/libs/Sculpt/Meshes/LineWithDots.js +26 -26
- package/libs/Sculpt/Meshes/Point.d.ts +1 -1
- package/libs/Sculpt/Meshes/Point.js +1 -1
- package/libs/Sculpt/Meshes/Polygon.js +1 -1
- package/libs/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
- package/libs/Sculpt/Meshes/Prism.d.ts +1 -1
- package/libs/Sculpt/Meshes/RectangleWithEdge.d.ts +3 -4
- package/libs/Sculpt/Objects/Box/index.js +41 -43
- package/libs/Sculpt/Objects/Cylinder/index.js +35 -37
- package/libs/Sculpt/Objects/Line/Editor.d.ts +22 -0
- package/libs/Sculpt/Objects/Line/Editor.js +61 -0
- package/libs/Sculpt/Objects/Line/index.d.ts +33 -0
- package/libs/Sculpt/Objects/Line/index.js +107 -0
- package/libs/Sculpt/Objects/Point/index.d.ts +1 -1
- package/libs/Sculpt/Objects/Polygon/Editor.d.ts +2 -2
- package/libs/Sculpt/Objects/Polygon/Editor.js +5 -5
- package/libs/Sculpt/Objects/Polygon/index.d.ts +3 -2
- package/libs/Sculpt/Objects/Polygon/index.js +80 -80
- package/libs/Sculpt/Objects/Polyline/Editor.d.ts +3 -17
- package/libs/Sculpt/Objects/Polyline/Editor.js +10 -48
- package/libs/Sculpt/Objects/Polyline/index.d.ts +7 -6
- package/libs/Sculpt/Objects/Polyline/index.js +63 -58
- package/libs/Sculpt/Objects/Prism/index.js +56 -58
- package/libs/Sculpt/index.d.ts +5 -0
- package/libs/Sculpt/index.js +58 -48
- package/libs/Sculpt/typings/index.d.ts +11 -6
- package/libs/Sculpt/{utils/color.d.ts → typings/style.d.ts} +7 -0
- package/libs/Sculpt/typings/utils.type.d.ts +2 -0
- package/libs/Sculpt/utils/three/ColoredMesh.d.ts +1 -1
- package/libs/Sculpt/utils/three/ColoredMesh.js +1 -1
- package/libs/Sculpt/utils/three/rayOnLine.d.ts +3 -5
- package/libs/Sculpt/utils/three/rayOnLine.js +15 -14
- package/libs/base/BasePlugin.js +1 -1
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +3 -2
- package/libs/index.js +128 -126
- package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +1 -1
- package/libs/shared-utils/Object3DHelper/Controller/ScaleController.js +23 -23
- package/libs/shared-utils/Utils/WorkUtil.d.ts +6 -6
- package/libs/shared-utils/Utils/WorkUtil.js +8 -7
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.js +15 -15
- package/package.json +1 -1
- package/dist/Sculpt/typings/SimplifyDeep.d.ts +0 -3
- package/libs/Sculpt/typings/SimplifyDeep.d.ts +0 -3
- /package/libs/Sculpt/{utils/color.js → typings/style.js} +0 -0
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
var
|
|
1
|
+
var E = Object.defineProperty, v = Object.defineProperties;
|
|
2
2
|
var C = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
3
|
+
var u = Object.getOwnPropertySymbols;
|
|
4
4
|
var H = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var b = (o, e, t) => e in o ? E(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, c = (o, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
|
-
H.call(e, t) &&
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
O.call(e, t) &&
|
|
7
|
+
H.call(e, t) && b(o, t, e[t]);
|
|
8
|
+
if (u)
|
|
9
|
+
for (var t of u(e))
|
|
10
|
+
O.call(e, t) && b(o, t, e[t]);
|
|
11
11
|
return o;
|
|
12
|
-
}, M = (o, e) =>
|
|
13
|
-
var d = (o, e, t) => (
|
|
14
|
-
var
|
|
15
|
-
var
|
|
12
|
+
}, M = (o, e) => v(o, C(e));
|
|
13
|
+
var d = (o, e, t) => (b(o, typeof e != "symbol" ? e + "" : e, t), t);
|
|
14
|
+
var p = (o, e, t) => new Promise((n, i) => {
|
|
15
|
+
var a = (s) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
i(
|
|
17
|
+
r(t.next(s));
|
|
18
|
+
} catch (h) {
|
|
19
|
+
i(h);
|
|
20
20
|
}
|
|
21
21
|
}, m = (s) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
i(
|
|
23
|
+
r(t.throw(s));
|
|
24
|
+
} catch (h) {
|
|
25
|
+
i(h);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, r = (s) => s.done ? n(s.value) : Promise.resolve(s.value).then(a, m);
|
|
28
|
+
r((t = t.apply(o, e)).next());
|
|
29
29
|
});
|
|
30
30
|
import { hotkeys as L } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
31
31
|
import { BaseObject as W } from "../Base/index.js";
|
|
@@ -36,11 +36,10 @@ import { createRectangle as R } from "../Rectangle/index.js";
|
|
|
36
36
|
import { LineMesh as T } from "../../Meshes/Line.js";
|
|
37
37
|
import { getNormal as U } from "../../../shared-utils/three/getNormal.js";
|
|
38
38
|
import { rayOnLine as k } from "../../utils/three/rayOnLine.js";
|
|
39
|
-
import {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
super(t, r);
|
|
39
|
+
import { vector3ToArray as B } from "../../../shared-utils/three/vector3ToArray.js";
|
|
40
|
+
class X extends W {
|
|
41
|
+
constructor(t, n) {
|
|
42
|
+
super(t, n);
|
|
44
43
|
d(this, "type", "Box");
|
|
45
44
|
d(this, "boxMesh");
|
|
46
45
|
this.editor = new N(this), t && (this.boxMesh = new w(c(c({}, t.style), t)), this.add(this.boxMesh)), L("esc", () => {
|
|
@@ -49,8 +48,8 @@ class Z extends W {
|
|
|
49
48
|
}
|
|
50
49
|
get data() {
|
|
51
50
|
return M(c({}, this.baseData), {
|
|
52
|
-
points:
|
|
53
|
-
heightPoint:
|
|
51
|
+
points: B(this.applyObjectMatrixWorld(this.boxMesh.bottomPlane.points)),
|
|
52
|
+
heightPoint: B(this.applyObjectMatrixWorld(this.boxMesh.heightPoint)),
|
|
54
53
|
style: {
|
|
55
54
|
color: this.boxMesh.color.getHex(),
|
|
56
55
|
lineWidth: this.boxMesh.lineWidth,
|
|
@@ -67,41 +66,40 @@ class Z extends W {
|
|
|
67
66
|
(t = this.boxMesh) == null || t.unhighlight();
|
|
68
67
|
}
|
|
69
68
|
create(t) {
|
|
70
|
-
return
|
|
71
|
-
this.removeChildren(), this.boxMesh = new w(t), this.add(this.boxMesh), yield
|
|
69
|
+
return p(this, null, function* () {
|
|
70
|
+
this.removeChildren(), this.boxMesh = new w(t), this.add(this.boxMesh), yield z(this.boxMesh, this.pointSelector), this.editor.enable();
|
|
72
71
|
});
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
|
-
function
|
|
76
|
-
return
|
|
77
|
-
return yield R(o.bottomPlane, e), new Promise((t,
|
|
74
|
+
function z(o, e) {
|
|
75
|
+
return p(this, null, function* () {
|
|
76
|
+
return yield R(o.bottomPlane, e), new Promise((t, n) => {
|
|
78
77
|
const i = o.parent;
|
|
79
78
|
if (!i) {
|
|
80
|
-
|
|
79
|
+
n(new Error("No container"));
|
|
81
80
|
return;
|
|
82
81
|
}
|
|
83
|
-
const
|
|
84
|
-
|
|
82
|
+
const a = new T(), m = U(o.bottomPlane.points).normalize(), r = o.bottomPlane.builtPoints.at(-1), s = r.clone().add(m.clone().multiplyScalar(10)), h = r.clone().sub(m.clone().multiplyScalar(10));
|
|
83
|
+
a.setPoints([s, h]), i.add(a), e.enable();
|
|
85
84
|
const f = (l) => {
|
|
86
85
|
g(), t();
|
|
87
86
|
}, x = (l) => {
|
|
88
87
|
if (!(l != null && l.raycaster))
|
|
89
88
|
return;
|
|
90
|
-
const
|
|
91
|
-
cameraPosition: z.modules.five.camera.position,
|
|
89
|
+
const P = k({
|
|
92
90
|
raycaster: l.raycaster,
|
|
93
|
-
line: new j.Line3(s,
|
|
91
|
+
line: new j.Line3(s, h)
|
|
94
92
|
});
|
|
95
|
-
|
|
93
|
+
P && o.setPoints({ heightPoint: P });
|
|
96
94
|
}, g = () => {
|
|
97
|
-
e.off("select", f), e.off("intersectionUpdate", x), e.off("disable",
|
|
98
|
-
},
|
|
99
|
-
g(), i == null || i.remove(o),
|
|
95
|
+
e.off("select", f), e.off("intersectionUpdate", x), e.off("disable", y), e.disable(), i == null || i.remove(a);
|
|
96
|
+
}, y = () => {
|
|
97
|
+
g(), i == null || i.remove(o), n(new Error("Cancelled"));
|
|
100
98
|
};
|
|
101
|
-
e.on("select", f), e.on("intersectionUpdate", x), e.on("disable",
|
|
99
|
+
e.on("select", f), e.on("intersectionUpdate", x), e.on("disable", y);
|
|
102
100
|
});
|
|
103
101
|
});
|
|
104
102
|
}
|
|
105
103
|
export {
|
|
106
|
-
|
|
104
|
+
X as Box
|
|
107
105
|
};
|
|
@@ -2,7 +2,7 @@ var L = Object.defineProperty, j = Object.defineProperties;
|
|
|
2
2
|
var T = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var g = Object.getOwnPropertySymbols;
|
|
4
4
|
var A = Object.prototype.hasOwnProperty, U = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var p = (n, t, e) => t in n ? L(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e,
|
|
5
|
+
var p = (n, t, e) => t in n ? L(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, d = (n, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
7
|
A.call(t, e) && p(n, e, t[e]);
|
|
8
8
|
if (g)
|
|
@@ -11,42 +11,41 @@ var p = (n, t, e) => t in n ? L(n, t, { enumerable: !0, configurable: !0, writab
|
|
|
11
11
|
return n;
|
|
12
12
|
}, M = (n, t) => j(n, T(t));
|
|
13
13
|
var y = (n, t, e) => (p(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
|
-
var
|
|
14
|
+
var b = (n, t, e) => new Promise((r, s) => {
|
|
15
15
|
var c = (o) => {
|
|
16
16
|
try {
|
|
17
17
|
i(e.next(o));
|
|
18
18
|
} catch (a) {
|
|
19
19
|
s(a);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, h = (o) => {
|
|
22
22
|
try {
|
|
23
23
|
i(e.throw(o));
|
|
24
24
|
} catch (a) {
|
|
25
25
|
s(a);
|
|
26
26
|
}
|
|
27
|
-
}, i = (o) => o.done ? r(o.value) : Promise.resolve(o.value).then(c,
|
|
27
|
+
}, i = (o) => o.done ? r(o.value) : Promise.resolve(o.value).then(c, h);
|
|
28
28
|
i((e = e.apply(n, t)).next());
|
|
29
29
|
});
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import {
|
|
38
|
-
|
|
39
|
-
class Z extends D {
|
|
30
|
+
import { CylinderMesh as O } from "../../Meshes/Cylinder.js";
|
|
31
|
+
import { LineMesh as W } from "../../Meshes/Line.js";
|
|
32
|
+
import { rayOnLine as z } from "../../utils/three/rayOnLine.js";
|
|
33
|
+
import { BaseObject as B } from "../Base/index.js";
|
|
34
|
+
import { createCircle as D } from "../Circle/index.js";
|
|
35
|
+
import * as f from "three";
|
|
36
|
+
import { CylinderEditor as F } from "./Editor.js";
|
|
37
|
+
import { vector3ToArray as v } from "../../../shared-utils/three/vector3ToArray.js";
|
|
38
|
+
class X extends B {
|
|
40
39
|
constructor(e, r) {
|
|
41
40
|
super(e, r);
|
|
42
41
|
y(this, "type", "Cylinder");
|
|
43
42
|
y(this, "cylinderMesh");
|
|
44
|
-
this.editor = new
|
|
43
|
+
this.editor = new F(this), e && (this.cylinderMesh = new O(d(d({}, e.style), e)), this.add(this.cylinderMesh));
|
|
45
44
|
}
|
|
46
45
|
get data() {
|
|
47
|
-
return M(
|
|
48
|
-
bottomCenter:
|
|
49
|
-
topCenter:
|
|
46
|
+
return M(d({}, this.baseData), {
|
|
47
|
+
bottomCenter: v(this.applyObjectMatrixWorld(this.cylinderMesh.bottomCenter)),
|
|
48
|
+
topCenter: v(this.applyObjectMatrixWorld(this.cylinderMesh.topCenter)),
|
|
50
49
|
radius: this.cylinderMesh.radius,
|
|
51
50
|
style: {
|
|
52
51
|
color: this.cylinderMesh.color.getHex()
|
|
@@ -62,39 +61,38 @@ class Z extends D {
|
|
|
62
61
|
(e = this.cylinderMesh) == null || e.unhighlight();
|
|
63
62
|
}
|
|
64
63
|
create(e) {
|
|
65
|
-
return
|
|
66
|
-
this.cylinderMesh = new
|
|
64
|
+
return b(this, null, function* () {
|
|
65
|
+
this.cylinderMesh = new O(e), this.add(this.cylinderMesh), yield N(this.cylinderMesh, this.pointSelector), this.editor.enable();
|
|
67
66
|
});
|
|
68
67
|
}
|
|
69
68
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
69
|
+
function N(n, t) {
|
|
70
|
+
return b(this, null, function* () {
|
|
72
71
|
const e = n.parent;
|
|
73
|
-
yield
|
|
74
|
-
const r = new
|
|
72
|
+
yield D(n.bottomCircle, t);
|
|
73
|
+
const r = new W();
|
|
75
74
|
r.name = "LineHelper", e.add(r);
|
|
76
|
-
const s = t.position.point, c = n.normal.clone().normalize(),
|
|
77
|
-
return r.setPoints([
|
|
75
|
+
const s = t.position.point, c = n.normal.clone().normalize(), h = s.clone().add(c.clone().multiplyScalar(10)), i = s.clone().sub(c.clone().multiplyScalar(10));
|
|
76
|
+
return r.setPoints([h, i]), t.enable(), new Promise((o, a) => {
|
|
78
77
|
const C = (l) => {
|
|
79
|
-
|
|
78
|
+
w(), o();
|
|
80
79
|
}, u = (l) => {
|
|
81
80
|
if (!(l != null && l.raycaster))
|
|
82
81
|
return;
|
|
83
|
-
const
|
|
84
|
-
cameraPosition: W.modules.five.camera.position,
|
|
82
|
+
const m = z({
|
|
85
83
|
raycaster: l.raycaster,
|
|
86
|
-
line: new
|
|
87
|
-
}), x = new
|
|
88
|
-
|
|
89
|
-
}, P = () => {
|
|
90
|
-
t.off("select", C), t.off("intersectionUpdate", u), t.off("disable", w), e.remove(r), t.disable();
|
|
84
|
+
line: new f.Line3(h, i)
|
|
85
|
+
}), x = new f.Plane().setFromNormalAndCoplanarPoint(n.normal, n.bottomCenter).projectPoint(m, new f.Vector3()), E = m.clone().sub(x), H = n.bottomCenter.clone().add(E);
|
|
86
|
+
m && n.setTopCenter(H);
|
|
91
87
|
}, w = () => {
|
|
92
|
-
|
|
88
|
+
t.off("select", C), t.off("intersectionUpdate", u), t.off("disable", P), e.remove(r), t.disable();
|
|
89
|
+
}, P = () => {
|
|
90
|
+
w(), e.remove(n), a(new Error("Cancelled"));
|
|
93
91
|
};
|
|
94
|
-
t.on("select", C), t.on("intersectionUpdate", u), t.on("disable",
|
|
92
|
+
t.on("select", C), t.on("intersectionUpdate", u), t.on("disable", P);
|
|
95
93
|
});
|
|
96
94
|
});
|
|
97
95
|
}
|
|
98
96
|
export {
|
|
99
|
-
|
|
97
|
+
X as Cylinder
|
|
100
98
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseEditor } from '../Base/Editor';
|
|
2
|
+
import type { FiveDomEvent } from '../../../shared-utils/five/FiveDomEvents';
|
|
3
|
+
import type { Line } from '.';
|
|
4
|
+
import type * as THREE from 'three';
|
|
5
|
+
import { PointMesh } from '../../Meshes/Point';
|
|
6
|
+
export declare abstract class LineEditorAbstract<OriginObject extends THREE.Object3D = THREE.Object3D> extends BaseEditor<OriginObject> {
|
|
7
|
+
protected draggingPoints: PointMesh[];
|
|
8
|
+
protected get pointMeshes(): PointMesh[];
|
|
9
|
+
abstract get points(): THREE.Vector3[];
|
|
10
|
+
get pointHandles(): PointMesh[];
|
|
11
|
+
constructor(originObject: OriginObject);
|
|
12
|
+
enable(): void;
|
|
13
|
+
disable(): void;
|
|
14
|
+
protected onDragstart: (event: FiveDomEvent) => void;
|
|
15
|
+
protected onDragend: (event: FiveDomEvent) => void;
|
|
16
|
+
protected abstract onDrag(event: FiveDomEvent): void;
|
|
17
|
+
}
|
|
18
|
+
export declare class LineEditor extends LineEditorAbstract<Line> {
|
|
19
|
+
get points(): THREE.Vector3[];
|
|
20
|
+
constructor(originObject: Line);
|
|
21
|
+
protected onDrag: (event: FiveDomEvent) => void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var g = Object.defineProperty;
|
|
2
|
+
var d = (s, e, t) => e in s ? g(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var n = (s, e, t) => (d(s, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { BaseEditor as p } from "../Base/Editor.js";
|
|
5
|
+
import { Sculpt as o } from "../../index.js";
|
|
6
|
+
import { PointMesh as a } from "../../Meshes/Point.js";
|
|
7
|
+
import { getIntersectByRaycaster as h } from "../../../shared-utils/five/getPosition.js";
|
|
8
|
+
import "three";
|
|
9
|
+
import "hammerjs";
|
|
10
|
+
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
11
|
+
import "@realsee/five/line";
|
|
12
|
+
import "../../../shared-utils/three/THREESphere.js";
|
|
13
|
+
import "animejs";
|
|
14
|
+
import { notNil as l } from "../../../shared-utils/isNil.js";
|
|
15
|
+
import "../../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
16
|
+
class m extends p {
|
|
17
|
+
constructor(t) {
|
|
18
|
+
super(t);
|
|
19
|
+
n(this, "draggingPoints", []);
|
|
20
|
+
n(this, "onDragstart", (t) => {
|
|
21
|
+
const i = t.target;
|
|
22
|
+
this.draggingPoints = this.pointMeshes.filter((r) => r.position.equals(i.position));
|
|
23
|
+
});
|
|
24
|
+
n(this, "onDragend", (t) => {
|
|
25
|
+
this.draggingPoints = [];
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
get pointMeshes() {
|
|
29
|
+
return this.children.filter((t) => t instanceof a);
|
|
30
|
+
}
|
|
31
|
+
get pointHandles() {
|
|
32
|
+
return this.children;
|
|
33
|
+
}
|
|
34
|
+
enable() {
|
|
35
|
+
super.enable(), this.points.filter(l).forEach((t) => {
|
|
36
|
+
const i = new a();
|
|
37
|
+
i.visible = !1, i.position.copy(t), i.draggable = !0, o.modules.fiveDomEvents.addEventListener(i, "drag", this.onDrag), o.modules.fiveDomEvents.addEventListener(i, "dragstart", this.onDragstart), o.modules.fiveDomEvents.addEventListener(i, "dragend", this.onDragend), this.add(i);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
disable() {
|
|
41
|
+
super.disable(), this.removeChildren();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
class B extends m {
|
|
45
|
+
constructor(t) {
|
|
46
|
+
super(t);
|
|
47
|
+
n(this, "onDrag", (t) => {
|
|
48
|
+
if (!this.draggingPoints || this.draggingPoints.length === 0)
|
|
49
|
+
return;
|
|
50
|
+
const i = h(o.modules.five, t.raycaster, { virtualPoint: !0 });
|
|
51
|
+
this.draggingPoints.forEach((r) => r.position.copy(i.point)), this.originObject.lineMesh.setPoints(this.pointMeshes.map((r) => r.position));
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
get points() {
|
|
55
|
+
return this.originObject.lineMesh.points;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
B as LineEditor,
|
|
60
|
+
m as LineEditorAbstract
|
|
61
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LineMesh, type LineData, type LineMeshStyle } from '../../Meshes/Line';
|
|
2
|
+
import { BaseObject, type BaseImportData, type BaseObjectConfig } from '../Base';
|
|
3
|
+
import type { PointSelector } from '../../../shared-utils/three/PointSelector';
|
|
4
|
+
import type { LiteralString } from '../../../typings/utils.type';
|
|
5
|
+
import type { LimitPlaneConfig } from '../../typings/style';
|
|
6
|
+
import { LineWithDotsMesh } from '../../Meshes/LineWithDots';
|
|
7
|
+
export interface LineImportData extends BaseImportData, LineData {
|
|
8
|
+
type: LiteralString<'Line'>;
|
|
9
|
+
style?: Partial<LineMeshStyle>;
|
|
10
|
+
}
|
|
11
|
+
export declare class Line extends BaseObject<LineImportData> {
|
|
12
|
+
readonly type = "Line";
|
|
13
|
+
lineMesh: LineWithDotsMesh;
|
|
14
|
+
get data(): {
|
|
15
|
+
points: [number, number, number][];
|
|
16
|
+
style: {
|
|
17
|
+
lineColor: number;
|
|
18
|
+
lineWidth: number;
|
|
19
|
+
dashed: boolean;
|
|
20
|
+
};
|
|
21
|
+
id: string;
|
|
22
|
+
type: string;
|
|
23
|
+
};
|
|
24
|
+
constructor(data?: LineImportData, config?: Partial<BaseObjectConfig>);
|
|
25
|
+
highlight(): void;
|
|
26
|
+
unhighlight(): void;
|
|
27
|
+
create(params?: Partial<LineMeshStyle & LimitPlaneConfig>): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @description 绘制线段
|
|
31
|
+
* @param config.limit 限制折线绘制的平面; `xoz` 限制在水平面; `y` 限制垂直面; `none` 不限制;默认 `none`
|
|
32
|
+
*/
|
|
33
|
+
export declare function createLine(lineMesh: LineMesh, pointSelector: PointSelector, config?: Partial<LimitPlaneConfig>): Promise<void>;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
var j = Object.defineProperty, O = Object.defineProperties;
|
|
2
|
+
var T = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var b = Object.getOwnPropertySymbols;
|
|
4
|
+
var V = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var y = (i, t, e) => t in i ? j(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, u = (i, t) => {
|
|
6
|
+
for (var e in t || (t = {}))
|
|
7
|
+
V.call(t, e) && y(i, e, t[e]);
|
|
8
|
+
if (b)
|
|
9
|
+
for (var e of b(t))
|
|
10
|
+
A.call(t, e) && y(i, e, t[e]);
|
|
11
|
+
return i;
|
|
12
|
+
}, C = (i, t) => O(i, T(t));
|
|
13
|
+
var P = (i, t, e) => (y(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
|
+
var W = (i, t, e) => new Promise((n, a) => {
|
|
15
|
+
var h = (o) => {
|
|
16
|
+
try {
|
|
17
|
+
d(e.next(o));
|
|
18
|
+
} catch (f) {
|
|
19
|
+
a(f);
|
|
20
|
+
}
|
|
21
|
+
}, m = (o) => {
|
|
22
|
+
try {
|
|
23
|
+
d(e.throw(o));
|
|
24
|
+
} catch (f) {
|
|
25
|
+
a(f);
|
|
26
|
+
}
|
|
27
|
+
}, d = (o) => o.done ? n(o.value) : Promise.resolve(o.value).then(h, m);
|
|
28
|
+
d((e = e.apply(i, t)).next());
|
|
29
|
+
});
|
|
30
|
+
import { hotkeys as D } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
31
|
+
import { LineMesh as x } from "../../Meshes/Line.js";
|
|
32
|
+
import { BaseObject as U } from "../Base/index.js";
|
|
33
|
+
import * as c from "three";
|
|
34
|
+
import { LineEditor as k } from "./Editor.js";
|
|
35
|
+
import { vector3ToArray as z } from "../../../shared-utils/three/vector3ToArray.js";
|
|
36
|
+
import { LineWithDotsMesh as E } from "../../Meshes/LineWithDots.js";
|
|
37
|
+
import { rayOnLine as B } from "../../utils/three/rayOnLine.js";
|
|
38
|
+
const F = new c.Vector3();
|
|
39
|
+
class Q extends U {
|
|
40
|
+
constructor(e, n) {
|
|
41
|
+
super(e, n);
|
|
42
|
+
P(this, "type", "Line");
|
|
43
|
+
P(this, "lineMesh");
|
|
44
|
+
e && (this.lineMesh = new E(u(u({}, e.style), e)), this.add(this.lineMesh)), this.editor = new k(this), D("esc", () => {
|
|
45
|
+
this.stopCreating();
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
get data() {
|
|
49
|
+
return C(u({}, this.baseData), {
|
|
50
|
+
points: z(this.applyObjectMatrixWorld(this.lineMesh.points)),
|
|
51
|
+
style: {
|
|
52
|
+
lineColor: new c.Color(this.lineMesh.color).getHex(),
|
|
53
|
+
lineWidth: this.lineMesh.lineWidth,
|
|
54
|
+
dashed: this.lineMesh.dashed
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
highlight() {
|
|
59
|
+
var e;
|
|
60
|
+
(e = this.lineMesh) == null || e.highlight();
|
|
61
|
+
}
|
|
62
|
+
unhighlight() {
|
|
63
|
+
var e;
|
|
64
|
+
(e = this.lineMesh) == null || e.unhighlight();
|
|
65
|
+
}
|
|
66
|
+
create(e) {
|
|
67
|
+
return W(this, null, function* () {
|
|
68
|
+
this.removeChildren();
|
|
69
|
+
const n = new E(e);
|
|
70
|
+
this.lineMesh = n, this.add(this.lineMesh), yield H(n, this.pointSelector, e), this.editor.enable();
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function H(i, t, e) {
|
|
75
|
+
var d;
|
|
76
|
+
const n = i.parent;
|
|
77
|
+
if (!n)
|
|
78
|
+
return;
|
|
79
|
+
const a = (d = e == null ? void 0 : e.limit) != null ? d : "none", h = new x(i.style);
|
|
80
|
+
n.add(h);
|
|
81
|
+
const m = new x({ dashed: !0, lineColor: i.color, lineWidth: i.lineWidth });
|
|
82
|
+
return n.add(m), t.enable(), new Promise((o, f) => {
|
|
83
|
+
const s = [];
|
|
84
|
+
let r, p;
|
|
85
|
+
const g = (l) => {
|
|
86
|
+
const w = s.length === 0 ? l.point : r.clone();
|
|
87
|
+
s.push(w), i.setPoints(s), s.length === 2 && (M(), o());
|
|
88
|
+
}, L = (l) => {
|
|
89
|
+
if (!(s != null && s.length) || !l)
|
|
90
|
+
return;
|
|
91
|
+
const w = s.at(-1).clone();
|
|
92
|
+
a === "none" ? (r = l.point, h.setPoints([w, r])) : a === "xoz" ? (p = p != null ? p : new c.Plane().setFromNormalAndCoplanarPoint(new c.Vector3(0, 1, 0), s[0]), r = p.projectPoint(l.point, F), h.setPoints([w, r]), m.setPoints([r, l.point])) : a === "y" && (r = B({
|
|
93
|
+
raycaster: l.raycaster,
|
|
94
|
+
line: new c.Line3(s[0].clone(), new c.Vector3(0, 1, 0).add(s[0])),
|
|
95
|
+
clampToLine: !1
|
|
96
|
+
}), h.setPoints([w, r]));
|
|
97
|
+
}, M = () => {
|
|
98
|
+
t.off("select", g), t.off("intersectionUpdate", L), t.off("disable", v), t.disable(), n == null || n.remove(h, m);
|
|
99
|
+
}, v = () => {
|
|
100
|
+
M(), s.length !== 2 && (n == null || n.remove(i)), f(new Error("Cancelled"));
|
|
101
|
+
};
|
|
102
|
+
t.on("select", g), t.on("intersectionUpdate", L), t.on("disable", v);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
Q as Line
|
|
107
|
+
};
|
|
@@ -30,6 +30,6 @@ export declare class Point extends BaseObject<PointImportData> {
|
|
|
30
30
|
/**
|
|
31
31
|
* @description: 创建点
|
|
32
32
|
*/
|
|
33
|
-
create(params?: PointStyle): Promise<void>;
|
|
33
|
+
create(params?: Partial<PointStyle>): Promise<void>;
|
|
34
34
|
}
|
|
35
35
|
export declare function createPoint(pointMesh: PointMesh, pointSelector: PointSelector): Promise<void>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Polygon } from '.';
|
|
2
2
|
import type { FiveDomEvent } from '../../../shared-utils/five/FiveDomEvents';
|
|
3
|
-
import { LineEditor } from '../Polyline/Editor';
|
|
4
3
|
import * as THREE from 'three';
|
|
5
|
-
|
|
4
|
+
import { LineEditorAbstract } from '../Line/Editor';
|
|
5
|
+
export declare class PolygonEditor extends LineEditorAbstract<Polygon> {
|
|
6
6
|
get points(): THREE.Vector3[];
|
|
7
7
|
constructor(originObject: Polygon);
|
|
8
8
|
protected onDrag: (event: FiveDomEvent) => void;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
var a = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var s = (o, i, t) => (
|
|
4
|
-
import { Sculpt as
|
|
2
|
+
var c = (o, i, t) => i in o ? a(o, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[i] = t;
|
|
3
|
+
var s = (o, i, t) => (c(o, typeof i != "symbol" ? i + "" : i, t), t);
|
|
4
|
+
import { Sculpt as g } from "../../index.js";
|
|
5
5
|
import { getIntersectByRaycaster as p } from "../../../shared-utils/five/getPosition.js";
|
|
6
|
-
import {
|
|
6
|
+
import { LineEditorAbstract as h } from "../Line/Editor.js";
|
|
7
7
|
class f extends h {
|
|
8
8
|
constructor(t) {
|
|
9
9
|
super(t);
|
|
10
10
|
s(this, "onDrag", (t) => {
|
|
11
11
|
if (!this.draggingPoints || this.draggingPoints.length === 0)
|
|
12
12
|
return;
|
|
13
|
-
const e = p(
|
|
13
|
+
const e = p(g.modules.five, t.raycaster, { virtualPoint: !0 }), n = this.originObject.areaMesh.projectPoint(e.point);
|
|
14
14
|
this.draggingPoints.forEach((r) => r.position.copy(n)), this.originObject.areaMesh.setPoints(this.pointMeshes.map((r) => r.position));
|
|
15
15
|
});
|
|
16
16
|
}
|
|
@@ -3,6 +3,7 @@ import { AreaMesh, type AreaStyle } from '../../Meshes/Area';
|
|
|
3
3
|
import type { PointSelector } from '../../../shared-utils/three/PointSelector';
|
|
4
4
|
import type { LiteralString } from '../../../typings/utils.type';
|
|
5
5
|
import type { PolygonData, PolygonStyle } from '../../Meshes/Polygon';
|
|
6
|
+
import type { LimitPlaneConfig } from '../../typings/style';
|
|
6
7
|
export interface PolygonImportData extends BaseImportData, PolygonData {
|
|
7
8
|
type: LiteralString<'Polygon'>;
|
|
8
9
|
style?: Partial<AreaStyle>;
|
|
@@ -23,6 +24,6 @@ export declare class Polygon extends BaseObject<PolygonImportData> {
|
|
|
23
24
|
constructor(data?: PolygonImportData, config?: Partial<BaseObjectConfig>);
|
|
24
25
|
highlight(): void;
|
|
25
26
|
unhighlight(): void;
|
|
26
|
-
create(params?: Partial<PolygonStyle>): Promise<void>;
|
|
27
|
+
create(params?: Partial<PolygonStyle & LimitPlaneConfig>): Promise<void>;
|
|
27
28
|
}
|
|
28
|
-
export declare function createPolygon(areaMesh: AreaMesh, pointSelector: PointSelector): Promise<void>;
|
|
29
|
+
export declare function createPolygon(areaMesh: AreaMesh, pointSelector: PointSelector, config?: Partial<LimitPlaneConfig>): Promise<void>;
|