@realsee/dnalogel 3.77.5 → 3.77.7
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 +17 -11
- package/dist/PanoTagPlugin/controller/Tag/BaseTag.d.ts +5 -1
- package/dist/PanoTagPlugin/controller/Tag/BoxTag.d.ts +119 -0
- package/dist/PanoTagPlugin/controller/Tag/MaskTag.d.ts +257 -0
- package/dist/PanoTagPlugin/controller/Tag/MaskTag.shaders.d.ts +10 -0
- package/dist/PanoTagPlugin/controller/Tag/PolygonTag.d.ts +112 -0
- package/dist/PanoTagPlugin/controller/TagRender.d.ts +1 -1
- package/dist/PanoTagPlugin/controller/index.d.ts +55 -2
- package/dist/PanoTagPlugin/typings/controller.d.ts +10 -0
- package/dist/PanoTagPlugin/typings/tag/Tag.d.ts +8 -3
- package/dist/PanoTagPlugin/typings/tag/Utils.d.ts +50 -1
- package/dist/PanoTagPlugin/utils/sculptDataToBoxPosition.d.ts +6 -0
- package/dist/PanoTagPlugin/utils/tag/tagCheck.d.ts +6 -0
- package/dist/PanoTagPlugin/utils/tagPosition.d.ts +12 -3
- package/dist/Sculpt/Meshes/Line.d.ts +4 -0
- package/dist/index.cjs.js +178 -95
- package/dist/index.js +11378 -9801
- package/dist/index.umd.js +173 -90
- package/dist/shared-utils/five/getFiveFromParentChain.d.ts +7 -0
- package/libs/AreaMakerPlugin/Controller.js +3 -2
- package/libs/AreaMakerPlugin/index.js +3 -2
- package/libs/AreaMakerPlugin/utils/Item.js +3 -2
- package/libs/CSS3DRenderPlugin/Controller.js +3 -2
- package/libs/CSS3DRenderPlugin/index.js +6 -5
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +39 -38
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +10 -9
- package/libs/CruisePlugin/BaseController.js +5 -4
- package/libs/CruisePlugin/Move.js +8 -2
- package/libs/CruisePlugin/Work.js +8 -2
- package/libs/CruisePlugin/index.js +12 -6
- package/libs/CurrentPanoImagePlugin/Controller.js +15 -14
- package/libs/CurrentPanoImagePlugin/index.js +4 -3
- package/libs/GuideLinePlugin/Controller.js +10 -4
- package/libs/GuideLinePlugin/GuideLineItem.js +8 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +8 -2
- package/libs/GuideLinePlugin/index.js +12 -6
- package/libs/MeasurePlugin/Controller.js +11 -10
- package/libs/MeasurePlugin/index.js +5 -4
- package/libs/MeasurePlugin/utils/MeasureMesh.js +3 -2
- package/libs/ModelChassisCompassPlugin/Plugin.js +4 -3
- package/libs/ModelChassisCompassPlugin/index.js +1 -0
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +6 -5
- package/libs/ModelEntryDoorGuidePlugin/index.js +1 -0
- package/libs/ModelMakerPlugin/Controller.js +3 -2
- package/libs/ModelMakerPlugin/index.js +3 -2
- package/libs/ModelMakerPlugin/item/baseItem.js +3 -2
- package/libs/ModelMakerPlugin/item/boxItem.js +3 -2
- package/libs/ModelMakerPlugin/item/polygonItem.js +3 -2
- package/libs/ModelMakerPlugin/item/prismItem.js +3 -2
- package/libs/ModelTVVideoPlugin/Plugin.js +4 -3
- package/libs/ModelTVVideoPlugin/index.js +3 -2
- package/libs/ModelViewPlugin/Plugin.js +20 -19
- package/libs/ModelViewPlugin/index.js +1 -0
- package/libs/Object3DHelperPlugin/Controller.js +3 -2
- package/libs/Object3DHelperPlugin/index.js +6 -5
- package/libs/PanoCompassPlugin/Controller.js +3 -2
- package/libs/PanoCompassPlugin/index.js +4 -3
- package/libs/PanoDoorLabelPlugin/Controller.js +24 -23
- package/libs/PanoDoorLabelPlugin/index.js +4 -3
- package/libs/PanoMeasurePlugin/Components/Controller0.js +3 -2
- package/libs/PanoMeasurePlugin/Components/Controller1.js +3 -2
- package/libs/PanoMeasurePlugin/Controller/EditController.js +3 -2
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +3 -2
- package/libs/PanoMeasurePlugin/Controller/index.js +3 -2
- package/libs/PanoMeasurePlugin/Model/area.js +3 -2
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +1 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +16 -15
- package/libs/PanoMeasurePlugin/index.js +14 -13
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +3 -2
- package/libs/PanoRulerProPlugin/Controller.js +3 -2
- package/libs/PanoRulerProPlugin/RulerItems.js +42 -41
- package/libs/PanoRulerProPlugin/index.js +4 -3
- package/libs/PanoSpatialTagPlugin/Plugin.js +34 -33
- package/libs/PanoSpatialTagPlugin/index.js +1 -0
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +3 -2
- package/libs/PanoTagPlugin/Components/Common/TagPopover/PopoverContent.js +3 -2
- package/libs/PanoTagPlugin/Components/Common/TagPopover/TagPopoverToolBar.js +3 -2
- package/libs/PanoTagPlugin/Components/Common/TagPopover/index.js +3 -2
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +3 -2
- package/libs/PanoTagPlugin/Components/Tag/index.js +3 -2
- package/libs/PanoTagPlugin/Components/TagContainer.js +3 -2
- package/libs/PanoTagPlugin/Components/TagItem.js +125 -124
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.d.ts +5 -1
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +321 -289
- package/libs/PanoTagPlugin/controller/Tag/BoxTag.d.ts +119 -0
- package/libs/PanoTagPlugin/controller/Tag/BoxTag.js +516 -0
- package/libs/PanoTagPlugin/controller/Tag/MaskTag.d.ts +257 -0
- package/libs/PanoTagPlugin/controller/Tag/MaskTag.js +816 -0
- package/libs/PanoTagPlugin/controller/Tag/MaskTag.shaders.d.ts +10 -0
- package/libs/PanoTagPlugin/controller/Tag/MaskTag.shaders.js +94 -0
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +3 -2
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +3 -2
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +3 -2
- package/libs/PanoTagPlugin/controller/Tag/PolygonTag.d.ts +112 -0
- package/libs/PanoTagPlugin/controller/Tag/PolygonTag.js +479 -0
- package/libs/PanoTagPlugin/controller/TagRender.d.ts +1 -1
- package/libs/PanoTagPlugin/controller/TagRender.js +3 -2
- package/libs/PanoTagPlugin/controller/TagUtil.js +22 -19
- package/libs/PanoTagPlugin/controller/index.d.ts +55 -2
- package/libs/PanoTagPlugin/controller/index.js +243 -129
- package/libs/PanoTagPlugin/index.js +17 -11
- package/libs/PanoTagPlugin/typings/controller.d.ts +10 -0
- package/libs/PanoTagPlugin/typings/tag/Tag.d.ts +8 -3
- package/libs/PanoTagPlugin/typings/tag/Utils.d.ts +50 -1
- package/libs/PanoTagPlugin/utils/addDebugPoints.js +27 -13
- package/libs/PanoTagPlugin/utils/index.js +29 -26
- package/libs/PanoTagPlugin/utils/sculptDataToBoxPosition.d.ts +6 -0
- package/libs/PanoTagPlugin/utils/sculptDataToBoxPosition.js +18 -0
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +3 -2
- package/libs/PanoTagPlugin/utils/tag/format.js +3 -2
- package/libs/PanoTagPlugin/utils/tag/tagCheck.d.ts +6 -0
- package/libs/PanoTagPlugin/utils/tag/tagCheck.js +26 -14
- package/libs/PanoTagPlugin/utils/tagPosition.d.ts +12 -3
- package/libs/PanoTagPlugin/utils/tagPosition.js +49 -16
- package/libs/PanoVideoPlugin/Controller.js +9 -8
- package/libs/PanoVideoPlugin/VideoMeshController.js +3 -2
- package/libs/PanoVideoPlugin/index.js +6 -5
- package/libs/PipelinePlugin/Controller.js +3 -2
- package/libs/PipelinePlugin/index.js +4 -3
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +3 -2
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +3 -2
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +1 -0
- package/libs/Sculpt/Meshes/Line.d.ts +4 -0
- package/libs/Sculpt/Meshes/Line.js +85 -76
- package/libs/Sculpt/Meshes/Point.js +28 -28
- package/libs/Sculpt/Meshes/Polygon.js +43 -43
- package/libs/Sculpt/index.js +1 -1
- package/libs/Sculpt/utils/Modules/Cursor.js +7 -7
- package/libs/base/BasePlugin.js +1 -1
- package/libs/floorplan/FloorplanGuidePlugin/Controller.js +3 -2
- package/libs/floorplan/FloorplanGuidePlugin/index.js +4 -3
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +3 -2
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +4 -3
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +3 -2
- package/libs/floorplan/ModelFloorplanPlugin/index.js +4 -3
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -2
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +4 -3
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +3 -2
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +4 -3
- package/libs/index.js +164 -158
- package/libs/shared-utils/five/getFiveFromParentChain.d.ts +7 -0
- package/libs/shared-utils/five/getFiveFromParentChain.js +15 -0
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/utils/PointHelper2.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mask 标签的 Shader 代码
|
|
3
|
+
* 参考 itemMask 插件实现
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Vertex Shader
|
|
7
|
+
*/
|
|
8
|
+
export declare const maskVertexShader = "\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n";
|
|
9
|
+
/** 多 style:mergedTexture 中每组 3 像素为 color(id)/tolerance+highlight/opacity,用 color 作 id 匹配 */
|
|
10
|
+
export declare const maskFragmentShaderMulti = "\n#define RESOLUTION 2048.0\n#define MAX_GROUPS 64\n#define STRICT_MATCH 0.5/255.0\n\nvarying vec2 vUv;\nuniform sampler2D map;\nuniform sampler2D mergedTexture;\nuniform float groupCount;\nuniform float textureWidth;\nuniform float pixelsPerGroup;\n\nfloat colorGap(vec3 a, vec3 b) {\n return abs(a.r - b.r) + abs(a.g - b.g) + abs(a.b - b.b);\n}\n\nvec4 readStyleColor(float groupIndex) {\n float px = groupIndex * pixelsPerGroup;\n float texX = (px + 0.5) / textureWidth;\n return texture2D(mergedTexture, vec2(texX, 0.5));\n}\n\nvec4 readStyleToleranceHighlight(float groupIndex) {\n float px = groupIndex * pixelsPerGroup + 1.0;\n float texX = (px + 0.5) / textureWidth;\n return texture2D(mergedTexture, vec2(texX, 0.5));\n}\n\nfloat readStyleOpacity(float groupIndex) {\n float px = groupIndex * pixelsPerGroup + 2.0;\n float texX = (px + 0.5) / textureWidth;\n return texture2D(mergedTexture, vec2(texX, 0.5)).r;\n}\n\nfloat detectEdge(sampler2D map, vec2 uv, vec3 matchColor, float tolerance) {\n vec4 centerColor = texture2D(map, uv);\n if (colorGap(centerColor.rgb, matchColor) >= tolerance) return 0.0;\n float step = 1.0 / RESOLUTION;\n vec4 u = texture2D(map, uv + vec2(0.0, -step));\n vec4 l = texture2D(map, uv + vec2(-step, 0.0));\n vec4 r = texture2D(map, uv + vec2(step, 0.0));\n vec4 d = texture2D(map, uv + vec2(0.0, step));\n bool edge = colorGap(u.rgb, matchColor) >= tolerance || colorGap(l.rgb, matchColor) >= tolerance\n || colorGap(r.rgb, matchColor) >= tolerance || colorGap(d.rgb, matchColor) >= tolerance;\n return edge ? 1.0 : 0.0;\n}\n\nvoid main() {\n vec4 image = texture2D(map, vUv);\n if (image.r == 0.0 && image.g == 0.0 && image.b == 0.0) discard;\n\n // WebGL 1.0 \u8981\u6C42\u5FAA\u73AF\u7EC8\u6B62\u6761\u4EF6\u5FC5\u987B\u662F\u7F16\u8BD1\u65F6\u5E38\u91CF\uFF0C\u6240\u4EE5\u7528 MAX_GROUPS\uFF0C\u5FAA\u73AF\u5185\u68C0\u67E5 groupCount\n for (float i = 0.0; i < float(MAX_GROUPS); i += 1.0) {\n if (i < groupCount) {\n vec4 styleColor = readStyleColor(i);\n vec3 colorRgb = styleColor.rgb;\n float tol = readStyleToleranceHighlight(i).r * 3.0;\n vec3 highlight = readStyleToleranceHighlight(i).gba;\n float opacity = readStyleOpacity(i);\n \n if (opacity > 0.0) {\n float gap = colorGap(image.rgb, colorRgb);\n if (gap > STRICT_MATCH) continue;\n float smoothRange = 0.01;\n float matchFactor = 1.0 - smoothstep(tol - smoothRange, tol + smoothRange, gap);\n if (matchFactor > 0.0) {\n float isEdge = detectEdge(map, vUv, colorRgb, tol);\n float alpha = mix(opacity, 1.0, isEdge);\n alpha *= max(matchFactor, 0.9);\n gl_FragColor = vec4(highlight, alpha);\n return;\n }\n }\n }\n }\n discard;\n}\n";
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
const e = (
|
|
2
|
+
/* glsl */
|
|
3
|
+
`
|
|
4
|
+
varying vec2 vUv;
|
|
5
|
+
void main() {
|
|
6
|
+
vUv = uv;
|
|
7
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
8
|
+
}
|
|
9
|
+
`
|
|
10
|
+
), t = (
|
|
11
|
+
/* glsl */
|
|
12
|
+
`
|
|
13
|
+
#define RESOLUTION 2048.0
|
|
14
|
+
#define MAX_GROUPS 64
|
|
15
|
+
#define STRICT_MATCH 0.5/255.0
|
|
16
|
+
|
|
17
|
+
varying vec2 vUv;
|
|
18
|
+
uniform sampler2D map;
|
|
19
|
+
uniform sampler2D mergedTexture;
|
|
20
|
+
uniform float groupCount;
|
|
21
|
+
uniform float textureWidth;
|
|
22
|
+
uniform float pixelsPerGroup;
|
|
23
|
+
|
|
24
|
+
float colorGap(vec3 a, vec3 b) {
|
|
25
|
+
return abs(a.r - b.r) + abs(a.g - b.g) + abs(a.b - b.b);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
vec4 readStyleColor(float groupIndex) {
|
|
29
|
+
float px = groupIndex * pixelsPerGroup;
|
|
30
|
+
float texX = (px + 0.5) / textureWidth;
|
|
31
|
+
return texture2D(mergedTexture, vec2(texX, 0.5));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
vec4 readStyleToleranceHighlight(float groupIndex) {
|
|
35
|
+
float px = groupIndex * pixelsPerGroup + 1.0;
|
|
36
|
+
float texX = (px + 0.5) / textureWidth;
|
|
37
|
+
return texture2D(mergedTexture, vec2(texX, 0.5));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
float readStyleOpacity(float groupIndex) {
|
|
41
|
+
float px = groupIndex * pixelsPerGroup + 2.0;
|
|
42
|
+
float texX = (px + 0.5) / textureWidth;
|
|
43
|
+
return texture2D(mergedTexture, vec2(texX, 0.5)).r;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
float detectEdge(sampler2D map, vec2 uv, vec3 matchColor, float tolerance) {
|
|
47
|
+
vec4 centerColor = texture2D(map, uv);
|
|
48
|
+
if (colorGap(centerColor.rgb, matchColor) >= tolerance) return 0.0;
|
|
49
|
+
float step = 1.0 / RESOLUTION;
|
|
50
|
+
vec4 u = texture2D(map, uv + vec2(0.0, -step));
|
|
51
|
+
vec4 l = texture2D(map, uv + vec2(-step, 0.0));
|
|
52
|
+
vec4 r = texture2D(map, uv + vec2(step, 0.0));
|
|
53
|
+
vec4 d = texture2D(map, uv + vec2(0.0, step));
|
|
54
|
+
bool edge = colorGap(u.rgb, matchColor) >= tolerance || colorGap(l.rgb, matchColor) >= tolerance
|
|
55
|
+
|| colorGap(r.rgb, matchColor) >= tolerance || colorGap(d.rgb, matchColor) >= tolerance;
|
|
56
|
+
return edge ? 1.0 : 0.0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
void main() {
|
|
60
|
+
vec4 image = texture2D(map, vUv);
|
|
61
|
+
if (image.r == 0.0 && image.g == 0.0 && image.b == 0.0) discard;
|
|
62
|
+
|
|
63
|
+
// WebGL 1.0 要求循环终止条件必须是编译时常量,所以用 MAX_GROUPS,循环内检查 groupCount
|
|
64
|
+
for (float i = 0.0; i < float(MAX_GROUPS); i += 1.0) {
|
|
65
|
+
if (i < groupCount) {
|
|
66
|
+
vec4 styleColor = readStyleColor(i);
|
|
67
|
+
vec3 colorRgb = styleColor.rgb;
|
|
68
|
+
float tol = readStyleToleranceHighlight(i).r * 3.0;
|
|
69
|
+
vec3 highlight = readStyleToleranceHighlight(i).gba;
|
|
70
|
+
float opacity = readStyleOpacity(i);
|
|
71
|
+
|
|
72
|
+
if (opacity > 0.0) {
|
|
73
|
+
float gap = colorGap(image.rgb, colorRgb);
|
|
74
|
+
if (gap > STRICT_MATCH) continue;
|
|
75
|
+
float smoothRange = 0.01;
|
|
76
|
+
float matchFactor = 1.0 - smoothstep(tol - smoothRange, tol + smoothRange, gap);
|
|
77
|
+
if (matchFactor > 0.0) {
|
|
78
|
+
float isEdge = detectEdge(map, vUv, colorRgb, tol);
|
|
79
|
+
float alpha = mix(opacity, 1.0, isEdge);
|
|
80
|
+
alpha *= max(matchFactor, 0.9);
|
|
81
|
+
gl_FragColor = vec4(highlight, alpha);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
discard;
|
|
88
|
+
}
|
|
89
|
+
`
|
|
90
|
+
);
|
|
91
|
+
export {
|
|
92
|
+
t as maskFragmentShaderMulti,
|
|
93
|
+
e as maskVertexShader
|
|
94
|
+
};
|
|
@@ -150,6 +150,7 @@ import "../../../shared-utils/three/IObject3D.js";
|
|
|
150
150
|
import "../../../Sculpt/utils/Meshes/getLengthHTML.js";
|
|
151
151
|
import "../../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
152
152
|
import "../../../shared-utils/util.js";
|
|
153
|
+
import "../../../shared-utils/five/getFiveFromParentChain.js";
|
|
153
154
|
import "../../../shared-utils/three/core/LineGeometry.js";
|
|
154
155
|
import "../../../shared-utils/three/core/LineMaterial.js";
|
|
155
156
|
import "../../../shared-utils/three/core/Line2.js";
|
|
@@ -203,7 +204,7 @@ import "../../../shared-utils/five/getFloorIndex.js";
|
|
|
203
204
|
import "../../../shared-utils/safeObj.js";
|
|
204
205
|
import "../../utils/Cache.js";
|
|
205
206
|
import "../../../shared-utils/promise/withResolvers.js";
|
|
206
|
-
class
|
|
207
|
+
class rr extends R {
|
|
207
208
|
constructor(t, e) {
|
|
208
209
|
super(t, e);
|
|
209
210
|
v(this, "loading", !1);
|
|
@@ -297,5 +298,5 @@ class or extends R {
|
|
|
297
298
|
}
|
|
298
299
|
}
|
|
299
300
|
export {
|
|
300
|
-
|
|
301
|
+
rr as ModelTag
|
|
301
302
|
};
|
|
@@ -150,6 +150,7 @@ import "../../../shared-utils/three/IObject3D.js";
|
|
|
150
150
|
import "../../../Sculpt/utils/Meshes/getLengthHTML.js";
|
|
151
151
|
import "../../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
152
152
|
import "../../../shared-utils/util.js";
|
|
153
|
+
import "../../../shared-utils/five/getFiveFromParentChain.js";
|
|
153
154
|
import "../../../shared-utils/three/core/LineGeometry.js";
|
|
154
155
|
import "../../../shared-utils/three/core/LineMaterial.js";
|
|
155
156
|
import "../../../shared-utils/three/core/Line2.js";
|
|
@@ -300,7 +301,7 @@ import "../../../Sculpt/Objects/Line/index.js";
|
|
|
300
301
|
import "../../../Sculpt/Editors/RectangleMeshEditor.js";
|
|
301
302
|
import "../../../Sculpt/utils/sortPositionsByCameraPosition.js";
|
|
302
303
|
const Z = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map();
|
|
303
|
-
class
|
|
304
|
+
class Yr extends B {
|
|
304
305
|
constructor(t, e) {
|
|
305
306
|
super(t, e);
|
|
306
307
|
y(this, "_floorIndex");
|
|
@@ -536,5 +537,5 @@ class Xr extends B {
|
|
|
536
537
|
}
|
|
537
538
|
}
|
|
538
539
|
export {
|
|
539
|
-
|
|
540
|
+
Yr as PlaneTag
|
|
540
541
|
};
|
|
@@ -59,6 +59,7 @@ import "../../../Sculpt/typings/style.js";
|
|
|
59
59
|
import "../../../shared-utils/three/IObject3D.js";
|
|
60
60
|
import "../../../Sculpt/utils/Meshes/getLengthHTML.js";
|
|
61
61
|
import "../../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
62
|
+
import "../../../shared-utils/five/getFiveFromParentChain.js";
|
|
62
63
|
import "../../../shared-utils/three/core/LineGeometry.js";
|
|
63
64
|
import "../../../shared-utils/three/core/LineMaterial.js";
|
|
64
65
|
import "../../../shared-utils/three/core/Line2.js";
|
|
@@ -89,7 +90,7 @@ import "../../../shared-utils/safeObj.js";
|
|
|
89
90
|
import "../../utils/Cache.js";
|
|
90
91
|
import "../../../shared-utils/promise/withResolvers.js";
|
|
91
92
|
const P = new r.Vector2();
|
|
92
|
-
class
|
|
93
|
+
class yi extends R {
|
|
93
94
|
constructor(t, e) {
|
|
94
95
|
var o, i, n, s, a;
|
|
95
96
|
super(t, e);
|
|
@@ -297,5 +298,5 @@ class _i extends R {
|
|
|
297
298
|
}
|
|
298
299
|
}
|
|
299
300
|
export {
|
|
300
|
-
|
|
301
|
+
yi as PointTag
|
|
301
302
|
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type PanoTagPluginController from '..';
|
|
2
|
+
import type { TagContentType, Tag as TagData, TagInstance, ArrayPosition, TagClickParams } from '../..';
|
|
3
|
+
import { BaseTag } from './BaseTag';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import type { PartialObjectDeep } from '../../../typings/typings';
|
|
6
|
+
import type { Tag } from '../..';
|
|
7
|
+
import { Polygon } from '../../../Sculpt/Objects/Polygon';
|
|
8
|
+
export type PolygonTagInterface<C extends TagContentType = TagContentType> = TagInstance<C, 'Polygon'>;
|
|
9
|
+
/**
|
|
10
|
+
* Polygon 类型的标签
|
|
11
|
+
* 使用 Sculpt Polygon 进行渲染
|
|
12
|
+
*/
|
|
13
|
+
export declare class PolygonTag<C extends TagContentType = TagContentType> extends BaseTag<C, 'Polygon'> {
|
|
14
|
+
polygonShape?: Polygon;
|
|
15
|
+
private tagStyle?;
|
|
16
|
+
private clickEventDispose?;
|
|
17
|
+
private domClickDispose?;
|
|
18
|
+
screenPosition: {
|
|
19
|
+
leftPx: number;
|
|
20
|
+
topPx: number;
|
|
21
|
+
scale: number;
|
|
22
|
+
} | null;
|
|
23
|
+
constructor(plugin: PanoTagPluginController, tagData: TagData);
|
|
24
|
+
/**
|
|
25
|
+
* 获取 Polygon 样式配置(合并用户配置和默认值)
|
|
26
|
+
*/
|
|
27
|
+
private getPolygonStyle;
|
|
28
|
+
/**
|
|
29
|
+
* 更新 Polygon 样式
|
|
30
|
+
*/
|
|
31
|
+
private updatePolygonStyle;
|
|
32
|
+
/**
|
|
33
|
+
* 更新标签数据
|
|
34
|
+
*/
|
|
35
|
+
set(tag: PartialObjectDeep<Tag<C, 'Polygon'>>, deepMerge?: boolean): void;
|
|
36
|
+
/**
|
|
37
|
+
* 获取多边形的所有角点(世界坐标)
|
|
38
|
+
*/
|
|
39
|
+
getCorners(): THREE.Vector3[];
|
|
40
|
+
getCenter(): ArrayPosition;
|
|
41
|
+
/**
|
|
42
|
+
* 计算多边形的法向量
|
|
43
|
+
* 使用前三个点来计算平面的法向量
|
|
44
|
+
*/
|
|
45
|
+
computeNormal(): THREE.Vector3 | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* 初始化 Sculpt Polygon
|
|
48
|
+
*/
|
|
49
|
+
private initializeSculptPolygon;
|
|
50
|
+
/**
|
|
51
|
+
* 设置点击事件
|
|
52
|
+
*/
|
|
53
|
+
private setupClickEvents;
|
|
54
|
+
/**
|
|
55
|
+
* 清理点击事件
|
|
56
|
+
*/
|
|
57
|
+
private cleanupClickEvents;
|
|
58
|
+
/**
|
|
59
|
+
* 更新 Sculpt Polygon 的数据
|
|
60
|
+
*/
|
|
61
|
+
private updateSculptPolygon;
|
|
62
|
+
/**
|
|
63
|
+
* 启用编辑器
|
|
64
|
+
* 用于编辑已存在的 Polygon
|
|
65
|
+
*/
|
|
66
|
+
editorEnable(): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* 禁用编辑器
|
|
69
|
+
*/
|
|
70
|
+
editorDisable(): void;
|
|
71
|
+
/**
|
|
72
|
+
* 同步 Sculpt Polygon 的数据到 PolygonPosition
|
|
73
|
+
*/
|
|
74
|
+
private syncPolygonPositionFromSculpt;
|
|
75
|
+
/**
|
|
76
|
+
* @description 点击事件处理
|
|
77
|
+
*/
|
|
78
|
+
onClick(params: Pick<TagClickParams, 'target'>): void;
|
|
79
|
+
/**
|
|
80
|
+
* @description 展开自己,收起其他标签
|
|
81
|
+
*/
|
|
82
|
+
unfoldAndFoldOthers(): void;
|
|
83
|
+
/**
|
|
84
|
+
* 展开标签详情
|
|
85
|
+
*/
|
|
86
|
+
unfold(): void;
|
|
87
|
+
/**
|
|
88
|
+
* 折叠标签详情
|
|
89
|
+
*/
|
|
90
|
+
fold(): void;
|
|
91
|
+
/**
|
|
92
|
+
* 设置展开/折叠状态
|
|
93
|
+
*/
|
|
94
|
+
setUnfold(unfolded: boolean): void;
|
|
95
|
+
/**
|
|
96
|
+
* 获取多边形的中心点
|
|
97
|
+
*/
|
|
98
|
+
private getPolygonCenter;
|
|
99
|
+
/**
|
|
100
|
+
* 更新屏幕位置(用于在 2D UI 中显示内容)
|
|
101
|
+
* 显示在 Polygon 最右侧的顶点位置
|
|
102
|
+
*/
|
|
103
|
+
updateScreenPosition(): void;
|
|
104
|
+
/**
|
|
105
|
+
* 应用可见性变化
|
|
106
|
+
*/
|
|
107
|
+
applyVisible(): void;
|
|
108
|
+
/**
|
|
109
|
+
* 销毁标签
|
|
110
|
+
*/
|
|
111
|
+
dispose(): void;
|
|
112
|
+
}
|