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