@labelbee/lb-annotation 1.5.2
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/README.md +143 -0
- package/dist/index.js +76 -0
- package/dist/types/constant/annotation.d.ts +63 -0
- package/dist/types/constant/annotationTask.d.ts +16 -0
- package/dist/types/constant/defaultConfig.d.ts +259 -0
- package/dist/types/constant/keyCode.d.ts +32 -0
- package/dist/types/constant/style.d.ts +43 -0
- package/dist/types/constant/tool.d.ts +161 -0
- package/dist/types/core/index.d.ts +74 -0
- package/dist/types/core/toolOperation/LineToolOperation.d.ts +419 -0
- package/dist/types/core/toolOperation/TextToolOperation.d.ts +41 -0
- package/dist/types/core/toolOperation/ViewOperation.d.ts +55 -0
- package/dist/types/core/toolOperation/basicToolOperation.d.ts +188 -0
- package/dist/types/core/toolOperation/checkOperation.d.ts +37 -0
- package/dist/types/core/toolOperation/eventListener.d.ts +33 -0
- package/dist/types/core/toolOperation/measureOperation.d.ts +8 -0
- package/dist/types/core/toolOperation/pointOperation.d.ts +85 -0
- package/dist/types/core/toolOperation/polygonOperation.d.ts +134 -0
- package/dist/types/core/toolOperation/rectOperation.d.ts +141 -0
- package/dist/types/core/toolOperation/tagOperation.d.ts +44 -0
- package/dist/types/core/toolOperation/textAttributeClass.d.ts +56 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/types/locales/constants.d.ts +15 -0
- package/dist/types/locales/en_US/message.d.ts +2 -0
- package/dist/types/locales/index.d.ts +4 -0
- package/dist/types/locales/zh_CN/message.d.ts +2 -0
- package/dist/types/utils/ActionsHistory.d.ts +32 -0
- package/dist/types/utils/EventBus.d.ts +40 -0
- package/dist/types/utils/ImgUtils.d.ts +3 -0
- package/dist/types/utils/MathUtils.d.ts +43 -0
- package/dist/types/utils/tool/AttributeUtils.d.ts +87 -0
- package/dist/types/utils/tool/AxisUtils.d.ts +189 -0
- package/dist/types/utils/tool/CanvasUtils.d.ts +40 -0
- package/dist/types/utils/tool/CommonToolUtils.d.ts +118 -0
- package/dist/types/utils/tool/DblClickEventListener.d.ts +47 -0
- package/dist/types/utils/tool/DrawUtils.d.ts +117 -0
- package/dist/types/utils/tool/ImgPosUtils.d.ts +34 -0
- package/dist/types/utils/tool/LineToolUtils.d.ts +105 -0
- package/dist/types/utils/tool/MarkerUtils.d.ts +9 -0
- package/dist/types/utils/tool/PolygonUtils.d.ts +60 -0
- package/dist/types/utils/tool/RectUtils.d.ts +69 -0
- package/dist/types/utils/tool/RenderDomUtils.d.ts +3 -0
- package/dist/types/utils/tool/StyleUtils.d.ts +9 -0
- package/dist/types/utils/tool/TagUtils.d.ts +54 -0
- package/dist/types/utils/tool/UnitUtils.d.ts +4 -0
- package/dist/types/utils/tool/ZoomUtils.d.ts +16 -0
- package/dist/types/utils/tool/polygonTool.d.ts +32 -0
- package/dist/types/utils/uuid.d.ts +1 -0
- package/es/index.js +76 -0
- package/package.json +96 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export declare const headerHeight = 61;
|
|
2
|
+
export declare const tipsHeight = 40;
|
|
3
|
+
export declare const footerHeight = 40;
|
|
4
|
+
export declare const sidebarWidth = 240;
|
|
5
|
+
/** 标注步骤的类型 */
|
|
6
|
+
export declare enum EStepType {
|
|
7
|
+
ANNOTATION = 1,
|
|
8
|
+
QUALITY_INSPECTION = 2,
|
|
9
|
+
PRE_ANNOTATION = 3,
|
|
10
|
+
MANUAL_CORRECTION = 4
|
|
11
|
+
}
|
|
12
|
+
/** 标注工具中最大获取的图片数 */
|
|
13
|
+
export declare const ANNOTATION_MAX_SIZE = 1000;
|
|
14
|
+
/** 翻页行为 */
|
|
15
|
+
export declare enum EPageOperator {
|
|
16
|
+
Backward = 0,
|
|
17
|
+
Forward = 1,
|
|
18
|
+
JumpSkip = 2,
|
|
19
|
+
None = 3
|
|
20
|
+
}
|
|
21
|
+
/** 拖拽状态 */
|
|
22
|
+
export declare enum EDragStatus {
|
|
23
|
+
Start = 0,
|
|
24
|
+
Stop = 1,
|
|
25
|
+
Wait = 2,
|
|
26
|
+
Move = 3
|
|
27
|
+
}
|
|
28
|
+
/** 拖拽的内容 */
|
|
29
|
+
export declare enum EDragTarget {
|
|
30
|
+
Point = 0,
|
|
31
|
+
Line = 1,
|
|
32
|
+
Plane = 2
|
|
33
|
+
}
|
|
34
|
+
/** 顺序 */
|
|
35
|
+
export declare enum ESortDirection {
|
|
36
|
+
ascend = 0,
|
|
37
|
+
descend = 1
|
|
38
|
+
}
|
|
39
|
+
/** 缩放的模式 */
|
|
40
|
+
export declare enum EGrowthMode {
|
|
41
|
+
Intelligence = 0,
|
|
42
|
+
Linear = 1
|
|
43
|
+
}
|
|
44
|
+
export declare enum ELang {
|
|
45
|
+
Zh = "zh_CN",
|
|
46
|
+
US = "en_US"
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 默认多边形文本偏移量
|
|
50
|
+
*/
|
|
51
|
+
export declare const DEFAULT_TEXT_OFFSET: {
|
|
52
|
+
offsetX: number;
|
|
53
|
+
offsetY: number;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* 默认文本阴影
|
|
57
|
+
*/
|
|
58
|
+
export declare const DEFAULT_TEXT_SHADOW: {
|
|
59
|
+
shadowColor: string;
|
|
60
|
+
shadowOffsetX: number;
|
|
61
|
+
shadowOffsetY: number;
|
|
62
|
+
shadowBlur: number;
|
|
63
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const ANNOTATION_TYPE: {
|
|
2
|
+
[a: number]: string;
|
|
3
|
+
};
|
|
4
|
+
export declare const ANNOTATION_STATUS: {
|
|
5
|
+
[a: number]: string;
|
|
6
|
+
};
|
|
7
|
+
/** 标注任务的状态 */
|
|
8
|
+
export declare enum EAnnotationStatus {
|
|
9
|
+
Upload = 0,
|
|
10
|
+
UploadRetry = 1,
|
|
11
|
+
UploadFail = 2,
|
|
12
|
+
Annotation = 3,
|
|
13
|
+
Terminated = 4,
|
|
14
|
+
Finish = 5,
|
|
15
|
+
Publish = 6
|
|
16
|
+
}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { EToolName } from './tool';
|
|
2
|
+
export declare const getConfig: (tool: EToolName) => {
|
|
3
|
+
showConfirm: boolean;
|
|
4
|
+
skipWhileNoDependencies: boolean;
|
|
5
|
+
drawOutsideTarget: boolean;
|
|
6
|
+
copyBackwardResult: boolean;
|
|
7
|
+
minWidth: number;
|
|
8
|
+
minHeight: number;
|
|
9
|
+
isShowOrder: boolean;
|
|
10
|
+
filterData: string[];
|
|
11
|
+
attributeConfigurable: boolean;
|
|
12
|
+
attributeList: never[];
|
|
13
|
+
textConfigurable: boolean;
|
|
14
|
+
textCheckType: number;
|
|
15
|
+
customFormat: string;
|
|
16
|
+
} | {
|
|
17
|
+
showConfirm: boolean;
|
|
18
|
+
skipWhileNoDependencies: boolean;
|
|
19
|
+
inputList: {
|
|
20
|
+
key: string;
|
|
21
|
+
value: string;
|
|
22
|
+
isMulti: boolean;
|
|
23
|
+
subSelected: ({
|
|
24
|
+
key: string;
|
|
25
|
+
value: string;
|
|
26
|
+
isMulti: boolean;
|
|
27
|
+
isDefault?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
key: string;
|
|
30
|
+
value: string;
|
|
31
|
+
isDefault: boolean;
|
|
32
|
+
isMulti?: undefined;
|
|
33
|
+
})[];
|
|
34
|
+
}[];
|
|
35
|
+
} | {
|
|
36
|
+
lineType: number;
|
|
37
|
+
lineColor: number;
|
|
38
|
+
edgeAdsorption: boolean;
|
|
39
|
+
outOfTarget: boolean;
|
|
40
|
+
copyBackwardResult: boolean;
|
|
41
|
+
isShowOrder: boolean;
|
|
42
|
+
attributeConfigurable: boolean;
|
|
43
|
+
attributeList: {
|
|
44
|
+
key: string;
|
|
45
|
+
value: string;
|
|
46
|
+
}[];
|
|
47
|
+
textConfigurable: boolean;
|
|
48
|
+
textCheckType: number;
|
|
49
|
+
customFormat: string;
|
|
50
|
+
showConfirm: boolean;
|
|
51
|
+
lowerLimitPointNum: number;
|
|
52
|
+
upperLimitPointNum: string;
|
|
53
|
+
preReferenceStep: number;
|
|
54
|
+
skipWhileNoDependencies: boolean;
|
|
55
|
+
filterData: string[];
|
|
56
|
+
} | {
|
|
57
|
+
showConfirm: boolean;
|
|
58
|
+
skipWhileNoDependencies: boolean;
|
|
59
|
+
enableTextRecognition: boolean;
|
|
60
|
+
recognitionMode: string;
|
|
61
|
+
configList: {
|
|
62
|
+
label: string;
|
|
63
|
+
key: string;
|
|
64
|
+
required: boolean;
|
|
65
|
+
default: string;
|
|
66
|
+
maxLength: number;
|
|
67
|
+
}[];
|
|
68
|
+
filterData: string[];
|
|
69
|
+
} | {
|
|
70
|
+
lineType: number;
|
|
71
|
+
lineColor: number;
|
|
72
|
+
lowerLimitPointNum: number;
|
|
73
|
+
edgeAdsorption: boolean;
|
|
74
|
+
drawOutsideTarget: boolean;
|
|
75
|
+
copyBackwardResult: boolean;
|
|
76
|
+
isShowOrder: boolean;
|
|
77
|
+
attributeConfigurable: boolean;
|
|
78
|
+
attributeList: never[];
|
|
79
|
+
textConfigurable: boolean;
|
|
80
|
+
textCheckType: number;
|
|
81
|
+
customFormat: string;
|
|
82
|
+
};
|
|
83
|
+
export declare const getStepList: (tool: EToolName) => {
|
|
84
|
+
step: number;
|
|
85
|
+
dataSourceStep: number;
|
|
86
|
+
tool: EToolName;
|
|
87
|
+
config: string;
|
|
88
|
+
}[];
|
|
89
|
+
export declare const styleDefaultConfig: {
|
|
90
|
+
toolColor: {
|
|
91
|
+
1: {
|
|
92
|
+
valid: {
|
|
93
|
+
stroke: string;
|
|
94
|
+
fill: string;
|
|
95
|
+
};
|
|
96
|
+
invalid: {
|
|
97
|
+
stroke: string;
|
|
98
|
+
fill: string;
|
|
99
|
+
};
|
|
100
|
+
validSelected: {
|
|
101
|
+
stroke: string;
|
|
102
|
+
fill: string;
|
|
103
|
+
};
|
|
104
|
+
invalidSelected: {
|
|
105
|
+
stroke: string;
|
|
106
|
+
fill: string;
|
|
107
|
+
};
|
|
108
|
+
validHover: {
|
|
109
|
+
stroke: string;
|
|
110
|
+
fill: string;
|
|
111
|
+
};
|
|
112
|
+
invalidHover: {
|
|
113
|
+
stroke: string;
|
|
114
|
+
fill: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
3: {
|
|
118
|
+
valid: {
|
|
119
|
+
stroke: string;
|
|
120
|
+
fill: string;
|
|
121
|
+
};
|
|
122
|
+
invalid: {
|
|
123
|
+
stroke: string;
|
|
124
|
+
fill: string;
|
|
125
|
+
};
|
|
126
|
+
validSelected: {
|
|
127
|
+
stroke: string;
|
|
128
|
+
fill: string;
|
|
129
|
+
};
|
|
130
|
+
invalidSelected: {
|
|
131
|
+
stroke: string;
|
|
132
|
+
fill: string;
|
|
133
|
+
};
|
|
134
|
+
validHover: {
|
|
135
|
+
stroke: string;
|
|
136
|
+
fill: string;
|
|
137
|
+
};
|
|
138
|
+
invalidHover: {
|
|
139
|
+
stroke: string;
|
|
140
|
+
fill: string;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
5: {
|
|
144
|
+
valid: {
|
|
145
|
+
stroke: string;
|
|
146
|
+
fill: string;
|
|
147
|
+
};
|
|
148
|
+
invalid: {
|
|
149
|
+
stroke: string;
|
|
150
|
+
fill: string;
|
|
151
|
+
};
|
|
152
|
+
validSelected: {
|
|
153
|
+
stroke: string;
|
|
154
|
+
fill: string;
|
|
155
|
+
};
|
|
156
|
+
invalidSelected: {
|
|
157
|
+
stroke: string;
|
|
158
|
+
fill: string;
|
|
159
|
+
};
|
|
160
|
+
validHover: {
|
|
161
|
+
stroke: string;
|
|
162
|
+
fill: string;
|
|
163
|
+
};
|
|
164
|
+
invalidHover: {
|
|
165
|
+
stroke: string;
|
|
166
|
+
fill: string;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
7: {
|
|
170
|
+
valid: {
|
|
171
|
+
stroke: string;
|
|
172
|
+
fill: string;
|
|
173
|
+
};
|
|
174
|
+
invalid: {
|
|
175
|
+
stroke: string;
|
|
176
|
+
fill: string;
|
|
177
|
+
};
|
|
178
|
+
validSelected: {
|
|
179
|
+
stroke: string;
|
|
180
|
+
fill: string;
|
|
181
|
+
};
|
|
182
|
+
invalidSelected: {
|
|
183
|
+
stroke: string;
|
|
184
|
+
fill: string;
|
|
185
|
+
};
|
|
186
|
+
validHover: {
|
|
187
|
+
stroke: string;
|
|
188
|
+
fill: string;
|
|
189
|
+
};
|
|
190
|
+
invalidHover: {
|
|
191
|
+
stroke: string;
|
|
192
|
+
fill: string;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
9: {
|
|
196
|
+
valid: {
|
|
197
|
+
stroke: string;
|
|
198
|
+
fill: string;
|
|
199
|
+
};
|
|
200
|
+
invalid: {
|
|
201
|
+
stroke: string;
|
|
202
|
+
fill: string;
|
|
203
|
+
};
|
|
204
|
+
validSelected: {
|
|
205
|
+
stroke: string;
|
|
206
|
+
fill: string;
|
|
207
|
+
};
|
|
208
|
+
invalidSelected: {
|
|
209
|
+
stroke: string;
|
|
210
|
+
fill: string;
|
|
211
|
+
};
|
|
212
|
+
validHover: {
|
|
213
|
+
stroke: string;
|
|
214
|
+
fill: string;
|
|
215
|
+
};
|
|
216
|
+
invalidHover: {
|
|
217
|
+
stroke: string;
|
|
218
|
+
fill: string;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
attributeColor: {
|
|
223
|
+
valid: {
|
|
224
|
+
stroke: string;
|
|
225
|
+
fill: string;
|
|
226
|
+
};
|
|
227
|
+
invalid: {
|
|
228
|
+
stroke: string;
|
|
229
|
+
fill: string;
|
|
230
|
+
};
|
|
231
|
+
validSelected: {
|
|
232
|
+
stroke: string;
|
|
233
|
+
fill: string;
|
|
234
|
+
};
|
|
235
|
+
invalidSelected: {
|
|
236
|
+
stroke: string;
|
|
237
|
+
fill: string;
|
|
238
|
+
};
|
|
239
|
+
validHover: {
|
|
240
|
+
stroke: string;
|
|
241
|
+
fill: string;
|
|
242
|
+
};
|
|
243
|
+
invalidHover: {
|
|
244
|
+
stroke: string;
|
|
245
|
+
fill: string;
|
|
246
|
+
};
|
|
247
|
+
}[];
|
|
248
|
+
lineColor: {
|
|
249
|
+
1: string;
|
|
250
|
+
3: string;
|
|
251
|
+
5: string;
|
|
252
|
+
7: string;
|
|
253
|
+
9: string;
|
|
254
|
+
};
|
|
255
|
+
attributeLineColor: string[];
|
|
256
|
+
color: number;
|
|
257
|
+
width: number;
|
|
258
|
+
opacity: number;
|
|
259
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare enum EKeyCode {
|
|
2
|
+
A = 65,
|
|
3
|
+
B = 66,
|
|
4
|
+
C = 67,
|
|
5
|
+
D = 68,
|
|
6
|
+
E = 69,
|
|
7
|
+
F = 70,
|
|
8
|
+
G = 71,
|
|
9
|
+
H = 72,
|
|
10
|
+
L = 76,
|
|
11
|
+
R = 82,
|
|
12
|
+
Z = 90,
|
|
13
|
+
W = 87,
|
|
14
|
+
X = 88,
|
|
15
|
+
Y = 89,
|
|
16
|
+
S = 83,
|
|
17
|
+
Q = 81,
|
|
18
|
+
Delete = 46,
|
|
19
|
+
F11 = 122,
|
|
20
|
+
Space = 32,
|
|
21
|
+
Esc = 27,
|
|
22
|
+
Left = 37,
|
|
23
|
+
Up = 38,
|
|
24
|
+
Right = 39,
|
|
25
|
+
Down = 40,
|
|
26
|
+
Enter = 13,
|
|
27
|
+
Ctrl = 17,
|
|
28
|
+
Alt = 18,
|
|
29
|
+
Shift = 16,
|
|
30
|
+
Tab = 9
|
|
31
|
+
}
|
|
32
|
+
export default EKeyCode;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import INVALID_ICON from '../assets/attributeIcon/icon_canvasEdit_miss.svg';
|
|
2
|
+
declare const NULL_ICON: any;
|
|
3
|
+
/** 全局的样式常量 */
|
|
4
|
+
export declare const HEADER_HEIGHT = 61;
|
|
5
|
+
/** 全局设置padding: 20px 16px 内置margin: 16px 总共78px */
|
|
6
|
+
export declare const TAB_HEIGHT = 80;
|
|
7
|
+
/** 搜索栏高度 使用Form表单 */
|
|
8
|
+
export declare const SEARCH_HEIGHT = 62;
|
|
9
|
+
/** 常规padding值 */
|
|
10
|
+
export declare const PADDING = 20;
|
|
11
|
+
/** table的size为default的每行高度 */
|
|
12
|
+
export declare const TABLE_ROW_HEIGHT = 55;
|
|
13
|
+
/** pagination的size为small的高度 + padding: 0 20px */
|
|
14
|
+
export declare const PAGINATION_HEIGHT = 55;
|
|
15
|
+
export declare const TIPS_HEIGHT = 40;
|
|
16
|
+
export declare const FOOTER_HEIGHT = 80;
|
|
17
|
+
export declare const SIDERBAR_WIDTH = 240;
|
|
18
|
+
export declare const EDIT_STEP_WIDTH = 320;
|
|
19
|
+
/** bee主色 - 蓝紫:rgba(102, 111, 255, 1) */
|
|
20
|
+
export declare const THEME_COLOR = "rgba(102, 111, 255, 1)";
|
|
21
|
+
export declare const COLORS_ARRAY: string[];
|
|
22
|
+
/** svg icon */
|
|
23
|
+
export declare const ICON_ARRAY: any[];
|
|
24
|
+
/** svg base icon */
|
|
25
|
+
export declare const BASE_ICON: {
|
|
26
|
+
[a: number]: any;
|
|
27
|
+
};
|
|
28
|
+
/** 无效色 - 红:rgba(255, 51, 51, 1) */
|
|
29
|
+
export declare const INVALID_COLOR = "rgba(255, 51, 51, 1)";
|
|
30
|
+
export declare const NULL_COLOR = "rgba(204, 204, 204, 1)";
|
|
31
|
+
export { NULL_ICON, INVALID_ICON };
|
|
32
|
+
/**
|
|
33
|
+
* @index0 粉:rgba(255, 51, 255, 1)
|
|
34
|
+
* @index1 蓝:rgba(51, 153, 255, 1)
|
|
35
|
+
* @index2 绿:rgba(51, 254, 51, 1)
|
|
36
|
+
* @index3 红:rgba(255, 51, 51, 1)
|
|
37
|
+
*/
|
|
38
|
+
export declare const FILTER_TOOL_COLOR: {
|
|
39
|
+
leftClick: string;
|
|
40
|
+
rightClick: string;
|
|
41
|
+
ctrlLeftClick: string;
|
|
42
|
+
ctrlRightClick: string;
|
|
43
|
+
};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
export declare const editStepWidth = 320;
|
|
2
|
+
export declare enum EPointCloudName {
|
|
3
|
+
/** 点云工具 */
|
|
4
|
+
PointCloud = "pointCloudTool"
|
|
5
|
+
}
|
|
6
|
+
export declare enum EVideoToolName {
|
|
7
|
+
/** 视频文本工具 */
|
|
8
|
+
VideoTextTool = "videoTextTool",
|
|
9
|
+
/** 视频标签工具 */
|
|
10
|
+
VideoTagTool = "videoTagTool",
|
|
11
|
+
/** 视频截取工具 */
|
|
12
|
+
VideoClipTool = "videoClipTool"
|
|
13
|
+
}
|
|
14
|
+
/** 新:工具type */
|
|
15
|
+
export declare enum EToolType {
|
|
16
|
+
Rect = 0,
|
|
17
|
+
Tag = 1
|
|
18
|
+
}
|
|
19
|
+
export declare enum EToolName {
|
|
20
|
+
/** 拉框工具 */
|
|
21
|
+
Rect = "rectTool",
|
|
22
|
+
/** 标签工具 */
|
|
23
|
+
Tag = "tagTool",
|
|
24
|
+
/** 标点工具 */
|
|
25
|
+
Point = "pointTool",
|
|
26
|
+
/** 列表标点工具 */
|
|
27
|
+
PointMarker = "pointMarkerTool",
|
|
28
|
+
/** 前景分割工具 */
|
|
29
|
+
Segmentation = "segmentationTool",
|
|
30
|
+
/** 筛选工具 */
|
|
31
|
+
Filter = "filterTool",
|
|
32
|
+
/** 文本工具 */
|
|
33
|
+
Text = "textTool",
|
|
34
|
+
/** 多边形工具 */
|
|
35
|
+
Polygon = "polygonTool",
|
|
36
|
+
/** 线条 */
|
|
37
|
+
Line = "lineTool",
|
|
38
|
+
/** 列表线条工具 */
|
|
39
|
+
LineMarker = "lineMarkerTool",
|
|
40
|
+
/** 空工具,表示当前没有选择的工具,没有实际的业务逻辑 */
|
|
41
|
+
Empty = "emptyTool",
|
|
42
|
+
/** 文件夹标签工具 */
|
|
43
|
+
FolderTag = "folderTagTool",
|
|
44
|
+
/** 拉框跟踪工具 */
|
|
45
|
+
RectTrack = "rectTrackTool",
|
|
46
|
+
/** 人脸106工具 */
|
|
47
|
+
Face = "faceTool",
|
|
48
|
+
/** 客户端属性工具 */
|
|
49
|
+
ClientAttribute = "clientAttributeTool",
|
|
50
|
+
/** OCR关联关系工具 */
|
|
51
|
+
OCRRelation = "OCRRelationTool"
|
|
52
|
+
}
|
|
53
|
+
export declare enum ECheckModel {
|
|
54
|
+
Check = "check"
|
|
55
|
+
}
|
|
56
|
+
export declare enum ERectPattern {
|
|
57
|
+
'nothing' = 0,
|
|
58
|
+
'RectBG' = 1,
|
|
59
|
+
'showOrder' = 2
|
|
60
|
+
}
|
|
61
|
+
export declare type ToolName = EToolName | EVideoToolName | EPointCloudName;
|
|
62
|
+
export declare const TOOL_NAME: {
|
|
63
|
+
[a: string]: string;
|
|
64
|
+
};
|
|
65
|
+
export declare enum EDependPattern {
|
|
66
|
+
'noDepend' = 1,
|
|
67
|
+
'dependOrigin' = 2,
|
|
68
|
+
'dependShape' = 3,
|
|
69
|
+
'dependLine' = 4,
|
|
70
|
+
'dependPolygon' = 5,
|
|
71
|
+
'dependPreShape' = 101,
|
|
72
|
+
'dependPreLine' = 102,
|
|
73
|
+
'dependPrePolygon' = 103
|
|
74
|
+
}
|
|
75
|
+
export declare enum EFilterToolOperation {
|
|
76
|
+
lc = "leftClick",
|
|
77
|
+
rc = "rightClick",
|
|
78
|
+
clc = "ctrlLeftClick",
|
|
79
|
+
crc = "ctrlRightClick"
|
|
80
|
+
}
|
|
81
|
+
export declare const OPERATION_LIST: {
|
|
82
|
+
leftClick: string;
|
|
83
|
+
rightClick: string;
|
|
84
|
+
ctrlLeftClick: string;
|
|
85
|
+
ctrlRightClick: string;
|
|
86
|
+
};
|
|
87
|
+
/** 标注模式 */
|
|
88
|
+
export declare enum EAnnotationMode {
|
|
89
|
+
/** 正常标注 */
|
|
90
|
+
Normal = 1,
|
|
91
|
+
/** 修改标注 */
|
|
92
|
+
Modify = 2
|
|
93
|
+
}
|
|
94
|
+
/** 线条类型 */
|
|
95
|
+
export declare enum ELineTypes {
|
|
96
|
+
Line = 0,
|
|
97
|
+
Curve = 1
|
|
98
|
+
}
|
|
99
|
+
/** 线条颜色 */
|
|
100
|
+
export declare enum ELineColor {
|
|
101
|
+
SingleColor = 0,
|
|
102
|
+
MultiColor = 1
|
|
103
|
+
}
|
|
104
|
+
export declare enum ESelectedType {
|
|
105
|
+
Form = 1,
|
|
106
|
+
Json = 2
|
|
107
|
+
}
|
|
108
|
+
export declare enum EDragTarget {
|
|
109
|
+
Point = 0,
|
|
110
|
+
Line = 1,
|
|
111
|
+
Plane = 2
|
|
112
|
+
}
|
|
113
|
+
export declare enum EDrawPointPattern {
|
|
114
|
+
None = 0,
|
|
115
|
+
Drawing = 1,
|
|
116
|
+
Edit = 2
|
|
117
|
+
}
|
|
118
|
+
export declare enum EPageOperator {
|
|
119
|
+
Backward = 0,
|
|
120
|
+
Forward = 1,
|
|
121
|
+
JumpSkip = 2,
|
|
122
|
+
None = 3
|
|
123
|
+
}
|
|
124
|
+
export declare enum EAuditStatus {
|
|
125
|
+
Wait = 0,
|
|
126
|
+
Pass = 1,
|
|
127
|
+
Fail = 2,
|
|
128
|
+
Loading = 3
|
|
129
|
+
}
|
|
130
|
+
export declare enum ETextType {
|
|
131
|
+
AnyString = 0,
|
|
132
|
+
Order = 1,
|
|
133
|
+
EnglishOnly = 2,
|
|
134
|
+
NumberOnly = 3,
|
|
135
|
+
CustomFormat = 4
|
|
136
|
+
}
|
|
137
|
+
export declare const TEXT_TYPE: {
|
|
138
|
+
0: string;
|
|
139
|
+
1: string;
|
|
140
|
+
2: string;
|
|
141
|
+
3: string;
|
|
142
|
+
};
|
|
143
|
+
/** 文本标注字数上限 */
|
|
144
|
+
export declare const TEXT_ATTRIBUTE_MAX_LENGTH = 1000;
|
|
145
|
+
/** 文本标注的文本高度 */
|
|
146
|
+
export declare const TEXT_ATTRIBUTE_LINE_HEIGHT = 16;
|
|
147
|
+
/** 缩略图下的模式 */
|
|
148
|
+
export declare enum EThumbnailOption {
|
|
149
|
+
ImgList = 1000,
|
|
150
|
+
TrackPrediction = 1001,
|
|
151
|
+
ImgSearch = 1002
|
|
152
|
+
}
|
|
153
|
+
export declare const CLIENT_TOOL_HEAD_TYPE: {
|
|
154
|
+
[a: string]: string;
|
|
155
|
+
};
|
|
156
|
+
export declare const CLIENT_TOOL_NAME: {
|
|
157
|
+
[a: string]: string;
|
|
158
|
+
};
|
|
159
|
+
/** 曲线分割点数 */
|
|
160
|
+
export declare const SEGMENT_NUMBER = 16;
|
|
161
|
+
export declare const edgeAdsorptionScope = 10;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AnnotationEngine 标注引擎 - 各类标注工具管理
|
|
3
|
+
*/
|
|
4
|
+
import { EToolName } from '@/constant/tool';
|
|
5
|
+
import { IPolygonData } from '@/types/tool/polygon';
|
|
6
|
+
interface IProps {
|
|
7
|
+
container: HTMLElement;
|
|
8
|
+
size: ISize;
|
|
9
|
+
toolName: EToolName;
|
|
10
|
+
imgNode?: HTMLImageElement;
|
|
11
|
+
config?: string;
|
|
12
|
+
style?: any;
|
|
13
|
+
}
|
|
14
|
+
export default class AnnotationEngine {
|
|
15
|
+
toolInstance: any;
|
|
16
|
+
toolName: EToolName;
|
|
17
|
+
private container;
|
|
18
|
+
private size;
|
|
19
|
+
private config;
|
|
20
|
+
private style;
|
|
21
|
+
private imgNode?;
|
|
22
|
+
private basicResult?;
|
|
23
|
+
private dependToolName?;
|
|
24
|
+
constructor(props: IProps);
|
|
25
|
+
/**
|
|
26
|
+
* 同步各种基础类型信息
|
|
27
|
+
* 1. imgNode (TODO,后续是否将 imgNode 放置在内部管理)
|
|
28
|
+
* 2. size
|
|
29
|
+
* 3. config
|
|
30
|
+
* 4. style
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* 设置当前工具类型
|
|
34
|
+
* @param toolName
|
|
35
|
+
* @param config
|
|
36
|
+
*/
|
|
37
|
+
setToolName(toolName: EToolName, config?: string): void;
|
|
38
|
+
setImgSrc: (imgSrc: string) => Promise<void>;
|
|
39
|
+
setImgNode(imgNode: HTMLImageElement, basicImgInfo?: Partial<{
|
|
40
|
+
valid: boolean;
|
|
41
|
+
rotate: number;
|
|
42
|
+
}>): void;
|
|
43
|
+
setSize(size: ISize): void;
|
|
44
|
+
setStyle(style: any): void;
|
|
45
|
+
/**
|
|
46
|
+
* 初始化工具实例
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
private _initToolOperation;
|
|
50
|
+
/**
|
|
51
|
+
* 设置当前依赖物体渲染
|
|
52
|
+
* @param dependToolName
|
|
53
|
+
* @param basicResult
|
|
54
|
+
*/
|
|
55
|
+
setBasicInfo(dependToolName?: EToolName, basicResult?: IRect | IPolygonData): void;
|
|
56
|
+
/**
|
|
57
|
+
* 清空当前依赖
|
|
58
|
+
*/
|
|
59
|
+
clearBasicResult(): void;
|
|
60
|
+
/**
|
|
61
|
+
* 禁止操作
|
|
62
|
+
*/
|
|
63
|
+
forbidOperation(): void;
|
|
64
|
+
/**
|
|
65
|
+
* 触发操作
|
|
66
|
+
*/
|
|
67
|
+
launchOperation(): void;
|
|
68
|
+
/**
|
|
69
|
+
* 快速将 i18n 定义的国际化版本对应到当前渲染实例内
|
|
70
|
+
* @param i18nLanguage
|
|
71
|
+
*/
|
|
72
|
+
setLang(i18nLanguage: 'en' | 'cn'): void;
|
|
73
|
+
}
|
|
74
|
+
export {};
|