@labelbee/lb-annotation 1.14.0-alpha.2 → 1.14.0-alpha.3
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/dist/_virtual/MathUtilsWorker.js +8 -1
- package/dist/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +35 -2
- package/dist/_virtual/filterBoxWorker.js +8 -1
- package/dist/_virtual/highlightWorker.js +8 -1
- package/dist/assets/attributeIcon/icon_canvasEdit0.svg.js +5 -1
- package/dist/assets/attributeIcon/icon_canvasEdit1.svg.js +5 -1
- package/dist/assets/attributeIcon/icon_canvasEdit2.svg.js +5 -1
- package/dist/assets/attributeIcon/icon_canvasEdit3.svg.js +5 -1
- package/dist/assets/attributeIcon/icon_canvasEdit4.svg.js +5 -1
- package/dist/assets/attributeIcon/icon_canvasEdit5.svg.js +5 -1
- package/dist/assets/attributeIcon/icon_canvasEdit6.svg.js +5 -1
- package/dist/assets/attributeIcon/icon_canvasEdit7.svg.js +5 -1
- package/dist/assets/attributeIcon/icon_canvasEdit8.svg.js +5 -1
- package/dist/assets/attributeIcon/icon_canvasEdit_miss.svg.js +5 -1
- package/dist/assets/attributeIcon/icon_cuboidFAB.svg.js +5 -5
- package/dist/assets/attributeIcon/icon_cuboidLeft.svg.js +5 -7
- package/dist/assets/attributeIcon/icon_cuboidMore.svg.js +5 -5
- package/dist/assets/attributeIcon/icon_cuboidRight.svg.js +5 -5
- package/dist/assets/attributeIcon/icon_cuboidTop.svg.js +5 -12
- package/dist/assets/attributeIcon/icon_editFEN.svg.js +5 -1
- package/dist/assets/attributeIcon/icon_editHUANG.svg.js +5 -1
- package/dist/assets/attributeIcon/icon_editLAN.svg.js +5 -1
- package/dist/assets/attributeIcon/icon_editLV.svg.js +5 -1
- package/dist/assets/attributeIcon/icon_editQING.svg.js +5 -1
- package/dist/constant/annotation.js +127 -1
- package/dist/constant/annotationTask.js +30 -1
- package/dist/constant/defaultConfig.js +266 -1
- package/dist/constant/keyCode.js +38 -1
- package/dist/constant/style.js +98 -1
- package/dist/constant/tool.js +236 -1
- package/dist/core/index.js +150 -1
- package/dist/core/pointCloud/OrbitControls.js +665 -1
- package/dist/core/pointCloud/PCDLoader.js +260 -2
- package/dist/core/pointCloud/annotation.js +215 -1
- package/dist/core/pointCloud/cache.js +53 -1
- package/dist/core/pointCloud/index.js +991 -5
- package/dist/core/pointCloud/matrix.js +138 -1
- package/dist/core/pointCloud/segmentation.js +144 -0
- package/dist/core/pointCloud/selector/Sse3dLassoSelector.js +26 -0
- package/dist/core/pointCloud/selector/Sse3dSelector.js +16 -0
- package/dist/core/scheduler.js +233 -1
- package/dist/core/toolOperation/LineToolOperation.js +1434 -1
- package/dist/core/toolOperation/ScribbleTool.js +292 -1
- package/dist/core/toolOperation/TextToolOperation.js +131 -1
- package/dist/core/toolOperation/ViewOperation.js +556 -1
- package/dist/core/toolOperation/basicToolOperation.js +881 -1
- package/dist/core/toolOperation/checkOperation.js +208 -1
- package/dist/core/toolOperation/cuboidOperation.js +754 -1
- package/dist/core/toolOperation/cuboidToggleButtonClass.js +152 -7
- package/dist/core/toolOperation/eventListener.js +37 -1
- package/dist/core/toolOperation/measureOperation.js +41 -1
- package/dist/core/toolOperation/pointCloud2dOperation.js +365 -1
- package/dist/core/toolOperation/pointOperation.js +696 -1
- package/dist/core/toolOperation/polygonOperation.js +1251 -1
- package/dist/core/toolOperation/rectOperation.js +1233 -1
- package/dist/core/toolOperation/segmentByRect.js +174 -1
- package/dist/core/toolOperation/tagOperation.js +201 -3
- package/dist/core/toolOperation/textAttributeClass.js +182 -16
- package/dist/index.js +185 -1
- package/dist/locales/constants.js +24 -1
- package/dist/locales/en_US/message.js +25 -1
- package/dist/locales/index.js +19 -1
- package/dist/locales/zh_CN/message.js +25 -1
- package/dist/newCore/CanvasScheduler.js +35 -1
- package/dist/types/core/pointCloud/segmentation.d.ts +0 -0
- package/dist/types/core/pointCloud/selector/Sse3dLassoSelector.d.ts +0 -0
- package/dist/types/core/pointCloud/selector/Sse3dSelector.d.ts +0 -0
- package/dist/utils/ActionsHistory.js +84 -1
- package/dist/utils/ImgUtils.js +23 -1
- package/dist/utils/MathUtils.js +385 -2
- package/dist/utils/VectorUtils.js +25 -1
- package/dist/utils/tool/AttributeUtils.js +218 -1
- package/dist/utils/tool/AxisUtils.js +340 -1
- package/dist/utils/tool/CanvasUtils.js +62 -1
- package/dist/utils/tool/CommonToolUtils.js +174 -1
- package/dist/utils/tool/CuboidUtils.js +704 -1
- package/dist/utils/tool/DblClickEventListener.js +102 -1
- package/dist/utils/tool/DrawUtils.js +492 -3
- package/dist/utils/tool/EnhanceCommonToolUtils.js +53 -1
- package/dist/utils/tool/ImgPosUtils.js +58 -1
- package/dist/utils/tool/LineToolUtils.js +261 -1
- package/dist/utils/tool/MarkerUtils.js +56 -1
- package/dist/utils/tool/PolygonUtils.js +460 -1
- package/dist/utils/tool/RectUtils.js +155 -1
- package/dist/utils/tool/RenderDomClass.js +57 -7
- package/dist/utils/tool/RenderDomUtils.js +21 -4
- package/dist/utils/tool/StyleUtils.js +31 -1
- package/dist/utils/tool/TagUtils.js +129 -1
- package/dist/utils/tool/UnitUtils.js +12 -1
- package/dist/utils/tool/ZoomUtils.js +72 -1
- package/dist/utils/tool/polygonTool.js +133 -1
- package/dist/utils/uuid.js +26 -1
- package/es/_virtual/MathUtilsWorker.js +6 -1
- package/es/_virtual/_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js +12 -0
- package/es/_virtual/_rollup-plugin-web-worker-loader__helper__auto__isNodeJS.js +7 -0
- package/es/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +31 -2
- package/es/_virtual/_rollup-plugin-web-worker-loader__helper__node__WorkerClass.js +11 -0
- package/es/_virtual/_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js +18 -0
- package/es/_virtual/filterBoxWorker.js +6 -1
- package/es/_virtual/highlightWorker.js +6 -1
- package/es/assets/attributeIcon/icon_canvasEdit0.svg.js +3 -1
- package/es/assets/attributeIcon/icon_canvasEdit1.svg.js +3 -1
- package/es/assets/attributeIcon/icon_canvasEdit2.svg.js +3 -1
- package/es/assets/attributeIcon/icon_canvasEdit3.svg.js +3 -1
- package/es/assets/attributeIcon/icon_canvasEdit4.svg.js +3 -1
- package/es/assets/attributeIcon/icon_canvasEdit5.svg.js +3 -1
- package/es/assets/attributeIcon/icon_canvasEdit6.svg.js +3 -1
- package/es/assets/attributeIcon/icon_canvasEdit7.svg.js +3 -1
- package/es/assets/attributeIcon/icon_canvasEdit8.svg.js +3 -1
- package/es/assets/attributeIcon/icon_canvasEdit_miss.svg.js +3 -1
- package/es/assets/attributeIcon/icon_cuboidFAB.svg.js +3 -5
- package/es/assets/attributeIcon/icon_cuboidLeft.svg.js +3 -7
- package/es/assets/attributeIcon/icon_cuboidMore.svg.js +3 -5
- package/es/assets/attributeIcon/icon_cuboidRight.svg.js +3 -5
- package/es/assets/attributeIcon/icon_cuboidTop.svg.js +3 -12
- package/es/assets/attributeIcon/icon_editFEN.svg.js +3 -1
- package/es/assets/attributeIcon/icon_editHUANG.svg.js +3 -1
- package/es/assets/attributeIcon/icon_editLAN.svg.js +3 -1
- package/es/assets/attributeIcon/icon_editLV.svg.js +3 -1
- package/es/assets/attributeIcon/icon_editQING.svg.js +3 -1
- package/es/constant/annotation.js +113 -1
- package/es/constant/annotationTask.js +25 -1
- package/es/constant/defaultConfig.js +260 -1
- package/es/constant/keyCode.js +36 -1
- package/es/constant/style.js +74 -1
- package/es/constant/tool.js +220 -1
- package/es/core/index.js +148 -1
- package/es/core/pointCloud/OrbitControls.js +661 -1
- package/es/core/pointCloud/PCDLoader.js +256 -2
- package/es/core/pointCloud/annotation.js +211 -1
- package/es/core/pointCloud/cache.js +49 -1
- package/es/core/pointCloud/index.js +962 -5
- package/es/core/pointCloud/matrix.js +109 -1
- package/es/core/pointCloud/segmentation.js +120 -0
- package/es/core/pointCloud/selector/Sse3dLassoSelector.js +24 -0
- package/es/core/pointCloud/selector/Sse3dSelector.js +14 -0
- package/es/core/scheduler.js +228 -1
- package/es/core/toolOperation/LineToolOperation.js +1421 -1
- package/es/core/toolOperation/ScribbleTool.js +290 -1
- package/es/core/toolOperation/TextToolOperation.js +129 -1
- package/es/core/toolOperation/ViewOperation.js +549 -1
- package/es/core/toolOperation/basicToolOperation.js +877 -1
- package/es/core/toolOperation/checkOperation.js +206 -1
- package/es/core/toolOperation/cuboidOperation.js +752 -1
- package/es/core/toolOperation/cuboidToggleButtonClass.js +150 -7
- package/es/core/toolOperation/eventListener.js +35 -1
- package/es/core/toolOperation/measureOperation.js +39 -1
- package/es/core/toolOperation/pointCloud2dOperation.js +359 -1
- package/es/core/toolOperation/pointOperation.js +690 -1
- package/es/core/toolOperation/polygonOperation.js +1245 -1
- package/es/core/toolOperation/rectOperation.js +1228 -1
- package/es/core/toolOperation/scribbleTool2.js +249 -0
- package/es/core/toolOperation/segmentByRect.js +172 -1
- package/es/core/toolOperation/tagOperation.js +199 -3
- package/es/core/toolOperation/textAttributeClass.js +180 -16
- package/es/index.js +46 -1
- package/es/locales/constants.js +22 -1
- package/es/locales/en_US/message.js +23 -1
- package/es/locales/index.js +17 -1
- package/es/locales/zh_CN/message.js +23 -1
- package/es/newCore/CanvasScheduler.js +31 -1
- package/es/utils/ActionsHistory.js +78 -1
- package/es/utils/ImgUtils.js +21 -1
- package/es/utils/MathUtils.js +380 -2
- package/es/utils/VectorUtils.js +23 -1
- package/es/utils/tool/AttributeUtils.js +212 -1
- package/es/utils/tool/AxisUtils.js +335 -1
- package/es/utils/tool/CanvasUtils.js +60 -1
- package/es/utils/tool/CommonToolUtils.js +172 -1
- package/es/utils/tool/CuboidUtils.js +680 -1
- package/es/utils/tool/DblClickEventListener.js +100 -1
- package/es/utils/tool/DrawUtils.js +490 -3
- package/es/utils/tool/EnhanceCommonToolUtils.js +48 -1
- package/es/utils/tool/ImgPosUtils.js +56 -1
- package/es/utils/tool/LineToolUtils.js +255 -1
- package/es/utils/tool/MarkerUtils.js +54 -1
- package/es/utils/tool/PolygonUtils.js +458 -1
- package/es/utils/tool/RectUtils.js +153 -1
- package/es/utils/tool/RenderDomClass.js +55 -7
- package/es/utils/tool/RenderDomUtils.js +19 -4
- package/es/utils/tool/StyleUtils.js +29 -1
- package/es/utils/tool/TagUtils.js +127 -1
- package/es/utils/tool/UnitUtils.js +10 -1
- package/es/utils/tool/ZoomUtils.js +70 -1
- package/es/utils/tool/polygonTool.js +126 -1
- package/es/utils/uuid.js +24 -1
- package/package.json +7 -5
package/es/constant/tool.js
CHANGED
|
@@ -1 +1,220 @@
|
|
|
1
|
-
const
|
|
1
|
+
const editStepWidth = 320;
|
|
2
|
+
var EPointCloudName;
|
|
3
|
+
(function(EPointCloudName2) {
|
|
4
|
+
EPointCloudName2["PointCloud"] = "pointCloudTool";
|
|
5
|
+
})(EPointCloudName || (EPointCloudName = {}));
|
|
6
|
+
var EVideoToolName;
|
|
7
|
+
(function(EVideoToolName2) {
|
|
8
|
+
EVideoToolName2["VideoTextTool"] = "videoTextTool";
|
|
9
|
+
EVideoToolName2["VideoTagTool"] = "videoTagTool";
|
|
10
|
+
EVideoToolName2["VideoClipTool"] = "videoClipTool";
|
|
11
|
+
})(EVideoToolName || (EVideoToolName = {}));
|
|
12
|
+
var EToolType;
|
|
13
|
+
(function(EToolType2) {
|
|
14
|
+
EToolType2[EToolType2["Rect"] = 0] = "Rect";
|
|
15
|
+
EToolType2[EToolType2["Tag"] = 1] = "Tag";
|
|
16
|
+
})(EToolType || (EToolType = {}));
|
|
17
|
+
var EToolName;
|
|
18
|
+
(function(EToolName2) {
|
|
19
|
+
EToolName2["Rect"] = "rectTool";
|
|
20
|
+
EToolName2["Tag"] = "tagTool";
|
|
21
|
+
EToolName2["Point"] = "pointTool";
|
|
22
|
+
EToolName2["PointMarker"] = "pointMarkerTool";
|
|
23
|
+
EToolName2["Segmentation"] = "segmentationTool";
|
|
24
|
+
EToolName2["Filter"] = "filterTool";
|
|
25
|
+
EToolName2["Text"] = "textTool";
|
|
26
|
+
EToolName2["Polygon"] = "polygonTool";
|
|
27
|
+
EToolName2["Line"] = "lineTool";
|
|
28
|
+
EToolName2["LineMarker"] = "lineMarkerTool";
|
|
29
|
+
EToolName2["Empty"] = "emptyTool";
|
|
30
|
+
EToolName2["FolderTag"] = "folderTagTool";
|
|
31
|
+
EToolName2["RectTrack"] = "rectTrackTool";
|
|
32
|
+
EToolName2["ScribbleTool"] = "scribbleTool";
|
|
33
|
+
EToolName2["Face"] = "faceTool";
|
|
34
|
+
EToolName2["ClientAttribute"] = "clientAttributeTool";
|
|
35
|
+
EToolName2["OCRRelation"] = "OCRRelationTool";
|
|
36
|
+
EToolName2["SegmentByRect"] = "segmentByRectTool";
|
|
37
|
+
EToolName2["Cuboid"] = "cuboidTool";
|
|
38
|
+
EToolName2["PointCloudPolygon"] = "pointCloudPolygon";
|
|
39
|
+
})(EToolName || (EToolName = {}));
|
|
40
|
+
var ECheckModel;
|
|
41
|
+
(function(ECheckModel2) {
|
|
42
|
+
ECheckModel2["Check"] = "check";
|
|
43
|
+
})(ECheckModel || (ECheckModel = {}));
|
|
44
|
+
var ERectPattern;
|
|
45
|
+
(function(ERectPattern2) {
|
|
46
|
+
ERectPattern2[ERectPattern2["nothing"] = 0] = "nothing";
|
|
47
|
+
ERectPattern2[ERectPattern2["RectBG"] = 1] = "RectBG";
|
|
48
|
+
ERectPattern2[ERectPattern2["showOrder"] = 2] = "showOrder";
|
|
49
|
+
})(ERectPattern || (ERectPattern = {}));
|
|
50
|
+
const TOOL_NAME = {
|
|
51
|
+
[EToolName.Rect]: "\u62C9\u6846",
|
|
52
|
+
[EToolName.Tag]: "\u6807\u7B7E",
|
|
53
|
+
[EToolName.Point]: "\u6807\u70B9",
|
|
54
|
+
[EToolName.PointMarker]: "\u5217\u8868\u6807\u70B9",
|
|
55
|
+
[EToolName.Segmentation]: "\u524D\u666F\u5206\u5272",
|
|
56
|
+
[EToolName.Filter]: "\u7B5B\u9009",
|
|
57
|
+
[EToolName.Text]: "\u6587\u672C",
|
|
58
|
+
[EToolName.Polygon]: "\u591A\u8FB9\u5F62",
|
|
59
|
+
[EToolName.Line]: "\u7EBF\u6761",
|
|
60
|
+
[EToolName.LineMarker]: "\u5217\u8868\u7EBF\u6761",
|
|
61
|
+
[EToolName.FolderTag]: "\u6587\u4EF6\u5939\u6807\u7B7E",
|
|
62
|
+
[EToolName.RectTrack]: "\u62C9\u6846\u8DDF\u8E2A",
|
|
63
|
+
[EToolName.Face]: "\u4EBA\u8138106\u5DE5\u5177",
|
|
64
|
+
[EToolName.ClientAttribute]: "\u5BA2\u6237\u7AEF\u5C5E\u6027\u5DE5\u5177",
|
|
65
|
+
[EToolName.OCRRelation]: "OCR\u5173\u8054\u5173\u7CFB\u5DE5\u5177",
|
|
66
|
+
[EToolName.SegmentByRect]: "\u7B97\u6CD5\u5206\u5272\u8F85\u52A9\u5DE5\u5177",
|
|
67
|
+
[EVideoToolName.VideoTextTool]: "\u89C6\u9891\u6587\u672C",
|
|
68
|
+
[EVideoToolName.VideoTagTool]: "\u89C6\u9891\u6807\u7B7E",
|
|
69
|
+
[EVideoToolName.VideoClipTool]: "\u89C6\u9891\u622A\u53D6",
|
|
70
|
+
[EPointCloudName.PointCloud]: "\u70B9\u4E91",
|
|
71
|
+
[EToolName.Cuboid]: "\u7ACB\u4F53\u6846"
|
|
72
|
+
};
|
|
73
|
+
const TOOL_NAME_EN = {
|
|
74
|
+
[EToolName.Rect]: "Rect",
|
|
75
|
+
[EToolName.Tag]: "Tag",
|
|
76
|
+
[EToolName.Point]: "Point",
|
|
77
|
+
[EToolName.PointMarker]: "PointMarker",
|
|
78
|
+
[EToolName.Segmentation]: "Segmentation",
|
|
79
|
+
[EToolName.Filter]: "Filter",
|
|
80
|
+
[EToolName.Text]: "Text",
|
|
81
|
+
[EToolName.Polygon]: "Polygon",
|
|
82
|
+
[EToolName.Line]: "Line",
|
|
83
|
+
[EToolName.LineMarker]: "LineMarker",
|
|
84
|
+
[EToolName.FolderTag]: "FolderTag",
|
|
85
|
+
[EToolName.RectTrack]: "RectTrack",
|
|
86
|
+
[EToolName.Face]: "Face",
|
|
87
|
+
[EToolName.ClientAttribute]: "ClientAttribute",
|
|
88
|
+
[EToolName.OCRRelation]: "OCRRelation",
|
|
89
|
+
[EToolName.SegmentByRect]: "SegmentByRect",
|
|
90
|
+
[EVideoToolName.VideoTextTool]: "VideoTextTool",
|
|
91
|
+
[EVideoToolName.VideoTagTool]: "VideoTagTool",
|
|
92
|
+
[EVideoToolName.VideoClipTool]: "VideoClipTool",
|
|
93
|
+
[EPointCloudName.PointCloud]: "PointCloud",
|
|
94
|
+
[EToolName.Cuboid]: "Cuboid"
|
|
95
|
+
};
|
|
96
|
+
var EDependPattern;
|
|
97
|
+
(function(EDependPattern2) {
|
|
98
|
+
EDependPattern2[EDependPattern2["noDepend"] = 1] = "noDepend";
|
|
99
|
+
EDependPattern2[EDependPattern2["dependOrigin"] = 2] = "dependOrigin";
|
|
100
|
+
EDependPattern2[EDependPattern2["dependShape"] = 3] = "dependShape";
|
|
101
|
+
EDependPattern2[EDependPattern2["dependLine"] = 4] = "dependLine";
|
|
102
|
+
EDependPattern2[EDependPattern2["dependPolygon"] = 5] = "dependPolygon";
|
|
103
|
+
EDependPattern2[EDependPattern2["dependPreShape"] = 101] = "dependPreShape";
|
|
104
|
+
EDependPattern2[EDependPattern2["dependPreLine"] = 102] = "dependPreLine";
|
|
105
|
+
EDependPattern2[EDependPattern2["dependPrePolygon"] = 103] = "dependPrePolygon";
|
|
106
|
+
})(EDependPattern || (EDependPattern = {}));
|
|
107
|
+
var EFilterToolOperation;
|
|
108
|
+
(function(EFilterToolOperation2) {
|
|
109
|
+
EFilterToolOperation2["lc"] = "leftClick";
|
|
110
|
+
EFilterToolOperation2["rc"] = "rightClick";
|
|
111
|
+
EFilterToolOperation2["clc"] = "ctrlLeftClick";
|
|
112
|
+
EFilterToolOperation2["crc"] = "ctrlRightClick";
|
|
113
|
+
})(EFilterToolOperation || (EFilterToolOperation = {}));
|
|
114
|
+
const OPERATION_LIST = {
|
|
115
|
+
leftClick: "\u9F20\u6807\u5DE6\u952E",
|
|
116
|
+
rightClick: "\u9F20\u6807\u53F3\u952E",
|
|
117
|
+
ctrlLeftClick: "ctrl + \u9F20\u6807\u5DE6\u952E",
|
|
118
|
+
ctrlRightClick: "ctrl + \u9F20\u6807\u53F3\u952E"
|
|
119
|
+
};
|
|
120
|
+
var EAnnotationMode;
|
|
121
|
+
(function(EAnnotationMode2) {
|
|
122
|
+
EAnnotationMode2[EAnnotationMode2["Normal"] = 1] = "Normal";
|
|
123
|
+
EAnnotationMode2[EAnnotationMode2["Modify"] = 2] = "Modify";
|
|
124
|
+
})(EAnnotationMode || (EAnnotationMode = {}));
|
|
125
|
+
var ELineTypes;
|
|
126
|
+
(function(ELineTypes2) {
|
|
127
|
+
ELineTypes2[ELineTypes2["Line"] = 0] = "Line";
|
|
128
|
+
ELineTypes2[ELineTypes2["Curve"] = 1] = "Curve";
|
|
129
|
+
})(ELineTypes || (ELineTypes = {}));
|
|
130
|
+
var ELineColor;
|
|
131
|
+
(function(ELineColor2) {
|
|
132
|
+
ELineColor2[ELineColor2["SingleColor"] = 0] = "SingleColor";
|
|
133
|
+
ELineColor2[ELineColor2["MultiColor"] = 1] = "MultiColor";
|
|
134
|
+
})(ELineColor || (ELineColor = {}));
|
|
135
|
+
var ESelectedType;
|
|
136
|
+
(function(ESelectedType2) {
|
|
137
|
+
ESelectedType2[ESelectedType2["Form"] = 1] = "Form";
|
|
138
|
+
ESelectedType2[ESelectedType2["Json"] = 2] = "Json";
|
|
139
|
+
})(ESelectedType || (ESelectedType = {}));
|
|
140
|
+
var EDragTarget;
|
|
141
|
+
(function(EDragTarget2) {
|
|
142
|
+
EDragTarget2[EDragTarget2["Point"] = 0] = "Point";
|
|
143
|
+
EDragTarget2[EDragTarget2["Line"] = 1] = "Line";
|
|
144
|
+
EDragTarget2[EDragTarget2["Plane"] = 2] = "Plane";
|
|
145
|
+
})(EDragTarget || (EDragTarget = {}));
|
|
146
|
+
var EDrawPointPattern;
|
|
147
|
+
(function(EDrawPointPattern2) {
|
|
148
|
+
EDrawPointPattern2[EDrawPointPattern2["None"] = 0] = "None";
|
|
149
|
+
EDrawPointPattern2[EDrawPointPattern2["Drawing"] = 1] = "Drawing";
|
|
150
|
+
EDrawPointPattern2[EDrawPointPattern2["Edit"] = 2] = "Edit";
|
|
151
|
+
})(EDrawPointPattern || (EDrawPointPattern = {}));
|
|
152
|
+
var EPageOperator;
|
|
153
|
+
(function(EPageOperator2) {
|
|
154
|
+
EPageOperator2[EPageOperator2["Backward"] = 0] = "Backward";
|
|
155
|
+
EPageOperator2[EPageOperator2["Forward"] = 1] = "Forward";
|
|
156
|
+
EPageOperator2[EPageOperator2["JumpSkip"] = 2] = "JumpSkip";
|
|
157
|
+
EPageOperator2[EPageOperator2["None"] = 3] = "None";
|
|
158
|
+
})(EPageOperator || (EPageOperator = {}));
|
|
159
|
+
var EAuditStatus;
|
|
160
|
+
(function(EAuditStatus2) {
|
|
161
|
+
EAuditStatus2[EAuditStatus2["Wait"] = 0] = "Wait";
|
|
162
|
+
EAuditStatus2[EAuditStatus2["Pass"] = 1] = "Pass";
|
|
163
|
+
EAuditStatus2[EAuditStatus2["Fail"] = 2] = "Fail";
|
|
164
|
+
EAuditStatus2[EAuditStatus2["Loading"] = 3] = "Loading";
|
|
165
|
+
})(EAuditStatus || (EAuditStatus = {}));
|
|
166
|
+
var ETextType;
|
|
167
|
+
(function(ETextType2) {
|
|
168
|
+
ETextType2[ETextType2["AnyString"] = 0] = "AnyString";
|
|
169
|
+
ETextType2[ETextType2["Order"] = 1] = "Order";
|
|
170
|
+
ETextType2[ETextType2["EnglishOnly"] = 2] = "EnglishOnly";
|
|
171
|
+
ETextType2[ETextType2["NumberOnly"] = 3] = "NumberOnly";
|
|
172
|
+
ETextType2[ETextType2["CustomFormat"] = 4] = "CustomFormat";
|
|
173
|
+
})(ETextType || (ETextType = {}));
|
|
174
|
+
const TEXT_TYPE = {
|
|
175
|
+
0: "\u4EFB\u610F\u5B57\u7B26",
|
|
176
|
+
1: "\u5E8F\u53F7",
|
|
177
|
+
2: "\u4EC5\u82F1\u6587",
|
|
178
|
+
3: "\u4EC5\u6570\u5B57"
|
|
179
|
+
};
|
|
180
|
+
const TEXT_ATTRIBUTE_MAX_LENGTH = 1e3;
|
|
181
|
+
const TEXT_ATTRIBUTE_LINE_HEIGHT = 16;
|
|
182
|
+
const DEFAULT_TEXT_MAX_WIDTH = 300;
|
|
183
|
+
const DEFAULT_FONT = "normal normal 500 14px Arial";
|
|
184
|
+
var EThumbnailOption;
|
|
185
|
+
(function(EThumbnailOption2) {
|
|
186
|
+
EThumbnailOption2[EThumbnailOption2["ImgList"] = 1e3] = "ImgList";
|
|
187
|
+
EThumbnailOption2[EThumbnailOption2["TrackPrediction"] = 1001] = "TrackPrediction";
|
|
188
|
+
EThumbnailOption2[EThumbnailOption2["ImgSearch"] = 1002] = "ImgSearch";
|
|
189
|
+
})(EThumbnailOption || (EThumbnailOption = {}));
|
|
190
|
+
const CLIENT_TOOL_HEAD_TYPE = {
|
|
191
|
+
[EPointCloudName.PointCloud]: "sensebeepc",
|
|
192
|
+
[EToolName.ClientAttribute]: "sensebeepc-EnumAttributeTool",
|
|
193
|
+
[EToolName.Face]: "sensebeepc-FacePointsLabellingTool",
|
|
194
|
+
[EToolName.OCRRelation]: "sensebeepc-OCRRelationTool"
|
|
195
|
+
};
|
|
196
|
+
const CLIENT_TOOL_NAME = {
|
|
197
|
+
[EPointCloudName.PointCloud]: "\u70B9\u4E91\u5BA2\u6237\u7AEF",
|
|
198
|
+
[EToolName.ClientAttribute]: "\u5BA2\u6237\u7AEF\u5C5E\u6027\u5DE5\u5177",
|
|
199
|
+
[EToolName.Face]: "\u4EBA\u8138106\u70B9\u5DE5\u5177",
|
|
200
|
+
[EToolName.OCRRelation]: "OCR\u5173\u8054\u5173\u7CFB\u5DE5\u5177"
|
|
201
|
+
};
|
|
202
|
+
const SEGMENT_NUMBER = 16;
|
|
203
|
+
const edgeAdsorptionScope = 10;
|
|
204
|
+
var EPolygonPattern;
|
|
205
|
+
(function(EPolygonPattern2) {
|
|
206
|
+
EPolygonPattern2[EPolygonPattern2["Normal"] = 0] = "Normal";
|
|
207
|
+
EPolygonPattern2[EPolygonPattern2["Rect"] = 1] = "Rect";
|
|
208
|
+
})(EPolygonPattern || (EPolygonPattern = {}));
|
|
209
|
+
var EScribblePattern;
|
|
210
|
+
(function(EScribblePattern2) {
|
|
211
|
+
EScribblePattern2[EScribblePattern2["Scribble"] = 1] = "Scribble";
|
|
212
|
+
EScribblePattern2[EScribblePattern2["Erase"] = 2] = "Erase";
|
|
213
|
+
})(EScribblePattern || (EScribblePattern = {}));
|
|
214
|
+
var EOperationMode;
|
|
215
|
+
(function(EOperationMode2) {
|
|
216
|
+
EOperationMode2[EOperationMode2["General"] = 1] = "General";
|
|
217
|
+
EOperationMode2[EOperationMode2["MultiMove"] = 2] = "MultiMove";
|
|
218
|
+
})(EOperationMode || (EOperationMode = {}));
|
|
219
|
+
|
|
220
|
+
export { CLIENT_TOOL_HEAD_TYPE, CLIENT_TOOL_NAME, DEFAULT_FONT, DEFAULT_TEXT_MAX_WIDTH, EAnnotationMode, EAuditStatus, ECheckModel, EDependPattern, EDragTarget, EDrawPointPattern, EFilterToolOperation, ELineColor, ELineTypes, EOperationMode, EPageOperator, EPointCloudName, EPolygonPattern, ERectPattern, EScribblePattern, ESelectedType, ETextType, EThumbnailOption, EToolName, EToolType, EVideoToolName, OPERATION_LIST, SEGMENT_NUMBER, TEXT_ATTRIBUTE_LINE_HEIGHT, TEXT_ATTRIBUTE_MAX_LENGTH, TEXT_TYPE, TOOL_NAME, TOOL_NAME_EN, edgeAdsorptionScope, editStepWidth };
|
package/es/core/index.js
CHANGED
|
@@ -1 +1,148 @@
|
|
|
1
|
-
import{ELang
|
|
1
|
+
import { ELang } from '../constant/annotation.js';
|
|
2
|
+
import { getConfig, styleDefaultConfig } from '../constant/defaultConfig.js';
|
|
3
|
+
import { HybridToolUtils, ToolScheduler } from './scheduler.js';
|
|
4
|
+
|
|
5
|
+
var __async = (__this, __arguments, generator) => {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
var fulfilled = (value) => {
|
|
8
|
+
try {
|
|
9
|
+
step(generator.next(value));
|
|
10
|
+
} catch (e) {
|
|
11
|
+
reject(e);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
var rejected = (value) => {
|
|
15
|
+
try {
|
|
16
|
+
step(generator.throw(value));
|
|
17
|
+
} catch (e) {
|
|
18
|
+
reject(e);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
22
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
const loadImage = (imgSrc) => {
|
|
26
|
+
return new Promise((resolve, reject) => {
|
|
27
|
+
const img = document.createElement("img");
|
|
28
|
+
img.crossOrigin = "Anonymous";
|
|
29
|
+
img.onerror = (e) => {
|
|
30
|
+
console.error(e);
|
|
31
|
+
reject(img);
|
|
32
|
+
};
|
|
33
|
+
img.src = imgSrc;
|
|
34
|
+
img.onload = () => {
|
|
35
|
+
resolve(img);
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
class AnnotationEngine {
|
|
40
|
+
constructor(props) {
|
|
41
|
+
this.setImgSrc = (imgSrc) => __async(this, null, function* () {
|
|
42
|
+
const imgNode = yield loadImage(imgSrc);
|
|
43
|
+
if (!imgNode) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
this.setImgNode(imgNode);
|
|
47
|
+
});
|
|
48
|
+
var _a, _b;
|
|
49
|
+
this.container = props.container;
|
|
50
|
+
this.size = props.size;
|
|
51
|
+
this.toolName = props.toolName;
|
|
52
|
+
this.imgNode = props.imgNode;
|
|
53
|
+
this.config = (_a = props.config) != null ? _a : JSON.stringify(getConfig(HybridToolUtils.getTopToolName(props.toolName)));
|
|
54
|
+
this.style = (_b = props.style) != null ? _b : styleDefaultConfig;
|
|
55
|
+
this.toolScheduler = new ToolScheduler(props);
|
|
56
|
+
this.i18nLanguage = "cn";
|
|
57
|
+
this._initToolOperation();
|
|
58
|
+
}
|
|
59
|
+
setToolName(toolName, config) {
|
|
60
|
+
this.toolName = toolName;
|
|
61
|
+
const defaultConfig = config || JSON.stringify(getConfig(HybridToolUtils.getTopToolName(toolName)));
|
|
62
|
+
this.config = defaultConfig;
|
|
63
|
+
this._initToolOperation();
|
|
64
|
+
}
|
|
65
|
+
setImgNode(imgNode, basicImgInfo) {
|
|
66
|
+
this.toolScheduler.setImgNode(imgNode, basicImgInfo);
|
|
67
|
+
this.imgNode = imgNode;
|
|
68
|
+
}
|
|
69
|
+
setImgAttribute(imgAttribute) {
|
|
70
|
+
this.toolScheduler.setImgAttribute(imgAttribute);
|
|
71
|
+
}
|
|
72
|
+
setSize(size) {
|
|
73
|
+
this.size = size;
|
|
74
|
+
this.toolScheduler.setSize(size);
|
|
75
|
+
}
|
|
76
|
+
setStyle(style) {
|
|
77
|
+
this.style = style;
|
|
78
|
+
}
|
|
79
|
+
_initToolOperation() {
|
|
80
|
+
this.toolScheduler.destroyAllLayer();
|
|
81
|
+
let toolList = [];
|
|
82
|
+
const config = {hiddenImg: true};
|
|
83
|
+
if (HybridToolUtils.isSingleTool(this.toolName)) {
|
|
84
|
+
toolList = [this.toolName];
|
|
85
|
+
Object.assign(config, {hiddenImg: false});
|
|
86
|
+
} else {
|
|
87
|
+
toolList = this.toolName;
|
|
88
|
+
}
|
|
89
|
+
if (toolList.length > 1) {
|
|
90
|
+
this.toolScheduler.createOperation(void 0, this.imgNode);
|
|
91
|
+
}
|
|
92
|
+
toolList.forEach((toolName, i) => {
|
|
93
|
+
const toolInstance = this.toolScheduler.createOperation(toolName, void 0, config);
|
|
94
|
+
if (i === toolList.length - 1) {
|
|
95
|
+
this.toolInstance = toolInstance;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
this.setLang(this.i18nLanguage);
|
|
99
|
+
}
|
|
100
|
+
setBasicInfo(dependToolName, basicResult) {
|
|
101
|
+
this.dependToolName = dependToolName;
|
|
102
|
+
this.basicResult = basicResult;
|
|
103
|
+
this.toolInstance.setDependName(dependToolName);
|
|
104
|
+
this.toolInstance.setBasicResult(basicResult);
|
|
105
|
+
this.toolInstance.renderBasicCanvas();
|
|
106
|
+
}
|
|
107
|
+
clearBasicResult() {
|
|
108
|
+
this.setBasicInfo();
|
|
109
|
+
}
|
|
110
|
+
forbidOperation() {
|
|
111
|
+
this.toolInstance.setForbidOperation(true);
|
|
112
|
+
}
|
|
113
|
+
launchOperation() {
|
|
114
|
+
this.toolInstance.setForbidOperation(false);
|
|
115
|
+
}
|
|
116
|
+
setLang(i18nLanguage) {
|
|
117
|
+
this.i18nLanguage = i18nLanguage;
|
|
118
|
+
switch (i18nLanguage) {
|
|
119
|
+
case "cn":
|
|
120
|
+
this.toolInstance.setLang(ELang.Zh);
|
|
121
|
+
break;
|
|
122
|
+
case "en":
|
|
123
|
+
this.toolInstance.setLang(ELang.US);
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
setDataInjectionAtCreation(dataInjectionAtCreation) {
|
|
128
|
+
this.toolInstance.setDataInjectionAtCreation(dataInjectionAtCreation);
|
|
129
|
+
}
|
|
130
|
+
setRenderEnhance(renderEnhance) {
|
|
131
|
+
this.toolInstance.setRenderEnhance(renderEnhance);
|
|
132
|
+
}
|
|
133
|
+
switchLastTwoCanvas() {
|
|
134
|
+
const newInstance = this.toolScheduler.switchLastTwoCanvas();
|
|
135
|
+
if (newInstance) {
|
|
136
|
+
this.toolInstance = newInstance;
|
|
137
|
+
return newInstance;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
get firstToolInstance() {
|
|
141
|
+
return this.toolScheduler.getFirstToolOperation();
|
|
142
|
+
}
|
|
143
|
+
setCustomRenderStyle(customRenderStyle) {
|
|
144
|
+
this.toolInstance.setCustomRenderStyle(customRenderStyle);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export { AnnotationEngine as default };
|