@labelbee/lb-annotation 1.5.5-alpha.3 → 1.5.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/index.js +5 -5
- package/dist/types/core/toolOperation/basicToolOperation.d.ts +11 -1
- package/dist/types/core/toolOperation/pointOperation.d.ts +4 -0
- package/dist/types/core/toolOperation/polygonOperation.d.ts +6 -0
- package/dist/types/locales/constants.d.ts +2 -1
- package/dist/types/utils/tool/CommonToolUtils.d.ts +1 -1
- package/dist/types/utils/tool/PolygonUtils.d.ts +3 -1
- package/es/index.js +9 -9
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CoordinateUtils } from '@/utils/tool/AxisUtils';
|
|
2
2
|
import { EToolName } from '@/constant/tool';
|
|
3
|
-
import { IPolygonConfig } from '@/types/tool/polygon';
|
|
3
|
+
import { IPolygonConfig, IPolygonData } from '@/types/tool/polygon';
|
|
4
4
|
import { EDragStatus, EGrowthMode, ELang } from '../../constant/annotation';
|
|
5
5
|
import ActionsHistory from '../../utils/ActionsHistory';
|
|
6
6
|
import DblClickEventListener from '../../utils/tool/DblClickEventListener';
|
|
@@ -19,6 +19,14 @@ interface IBasicToolOperationProps {
|
|
|
19
19
|
showDefaultCursor?: boolean;
|
|
20
20
|
forbidBasicResultRender?: boolean;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* 参考显示数据
|
|
24
|
+
*/
|
|
25
|
+
interface IReferenceData {
|
|
26
|
+
toolName: EToolName.Polygon | EToolName.Line | EToolName.LineMarker;
|
|
27
|
+
result: IPolygonData[] | ILinePoint[];
|
|
28
|
+
config: any;
|
|
29
|
+
}
|
|
22
30
|
declare class BasicToolOperation extends EventListener {
|
|
23
31
|
container: HTMLElement;
|
|
24
32
|
canvas: HTMLCanvasElement;
|
|
@@ -27,6 +35,7 @@ declare class BasicToolOperation extends EventListener {
|
|
|
27
35
|
basicImgInfo: any;
|
|
28
36
|
isImgError: boolean;
|
|
29
37
|
basicResult?: any;
|
|
38
|
+
referenceData?: IReferenceData;
|
|
30
39
|
dependToolName?: EToolName;
|
|
31
40
|
history: ActionsHistory;
|
|
32
41
|
size: ISize;
|
|
@@ -76,6 +85,7 @@ declare class BasicToolOperation extends EventListener {
|
|
|
76
85
|
get hasMarkerConfig(): any;
|
|
77
86
|
setZoom(zoom: number): void;
|
|
78
87
|
setCurrentPos(currentPos: ICoordinate): void;
|
|
88
|
+
setReferenceData(referenceData: IReferenceData): void;
|
|
79
89
|
/**
|
|
80
90
|
* 外界直接更改当前渲染位置
|
|
81
91
|
* @param zoom
|
|
@@ -104,6 +104,10 @@ declare class PointOperation extends BasicToolOperation {
|
|
|
104
104
|
*/
|
|
105
105
|
renderPoint(point: IPointUnit): void;
|
|
106
106
|
renderPointList(): void;
|
|
107
|
+
/**
|
|
108
|
+
* 顶层渲染图标
|
|
109
|
+
*/
|
|
110
|
+
renderTop(): void;
|
|
107
111
|
render(): void;
|
|
108
112
|
}
|
|
109
113
|
export default PointOperation;
|
|
@@ -111,6 +111,12 @@ declare class PolygonOperation extends BasicToolOperation {
|
|
|
111
111
|
onLeftDblClick(e: MouseEvent): void;
|
|
112
112
|
onRightDblClick(e: MouseEvent): void;
|
|
113
113
|
onMouseDown(e: MouseEvent): true | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* 判断是否在边界外
|
|
116
|
+
* @param selectedPointList
|
|
117
|
+
* @returns
|
|
118
|
+
*/
|
|
119
|
+
isPolygonOutSide(selectedPointList: IPolygonPoint[]): boolean;
|
|
114
120
|
onDragMove(e: MouseEvent): void;
|
|
115
121
|
onMouseMove(e: MouseEvent): void;
|
|
116
122
|
leftMouseUp(e: MouseEvent): void;
|
|
@@ -12,5 +12,6 @@ export declare enum EMessage {
|
|
|
12
12
|
MarkerFinish = "MarkerFinish",
|
|
13
13
|
LowerLimitPoint = "LowerLimitPoint",
|
|
14
14
|
NoRotateInDependence = "noRotateInDependence",
|
|
15
|
-
UnableToReannotation = "unableToReannotation"
|
|
15
|
+
UnableToReannotation = "unableToReannotation",
|
|
16
|
+
ForbiddenCreationOutsideBoundary = "ForbiddenCreationOutsideBoundary"
|
|
16
17
|
}
|
|
@@ -71,7 +71,7 @@ export default class CommonToolUtils {
|
|
|
71
71
|
* @param pointList
|
|
72
72
|
* @returns
|
|
73
73
|
*/
|
|
74
|
-
static findAllLine(pointList: IPolygonPoint[] | point[]): {
|
|
74
|
+
static findAllLine(pointList: IPolygonPoint[] | point[], isClose?: boolean): {
|
|
75
75
|
point1: IPolygonPoint | point;
|
|
76
76
|
point2: IPolygonPoint | point;
|
|
77
77
|
pointIndex: number;
|
|
@@ -37,7 +37,9 @@ export default class PolygonUtils {
|
|
|
37
37
|
* @param range
|
|
38
38
|
* @returns
|
|
39
39
|
*/
|
|
40
|
-
static getClosestPoint(coordinate: ICoordinate, polygonList: IPolygonData[], lineType?: ELineTypes, range?: number
|
|
40
|
+
static getClosestPoint(coordinate: ICoordinate, polygonList: IPolygonData[], lineType?: ELineTypes, range?: number, option?: {
|
|
41
|
+
isClose?: boolean;
|
|
42
|
+
}): {
|
|
41
43
|
dropFoot: ICoordinate;
|
|
42
44
|
closestEdgeIndex: number;
|
|
43
45
|
closestPolygonID: string;
|