@labelbee/lb-annotation 1.13.0 → 1.14.0-alpha.0
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/assets/attributeIcon/icon_cuboidFAB.svg.js +5 -0
- package/dist/assets/attributeIcon/icon_cuboidLeft.svg.js +7 -0
- package/dist/assets/attributeIcon/icon_cuboidMore.svg.js +5 -0
- package/dist/assets/attributeIcon/icon_cuboidRight.svg.js +5 -0
- package/dist/assets/attributeIcon/icon_cuboidTop.svg.js +12 -0
- package/dist/constant/annotation.js +1 -1
- package/dist/constant/tool.js +1 -1
- package/dist/core/pointCloud/annotation.js +1 -1
- package/dist/core/pointCloud/index.js +2 -2
- package/dist/core/scheduler.js +1 -1
- package/dist/core/toolOperation/ViewOperation.js +1 -1
- package/dist/core/toolOperation/basicToolOperation.js +1 -1
- package/dist/core/toolOperation/cuboidOperation.js +1 -0
- package/dist/core/toolOperation/cuboidToggleButtonClass.js +31 -0
- package/dist/types/constant/annotation.d.ts +45 -1
- package/dist/types/constant/tool.d.ts +6 -1
- package/dist/types/core/index.d.ts +1 -2
- package/dist/types/core/pointCloud/annotation.d.ts +11 -1
- package/dist/types/core/pointCloud/index.d.ts +11 -1
- package/dist/types/core/pointCloud/matrix.d.ts +1 -0
- package/dist/types/core/pointCloud/segmentation.d.ts +0 -0
- package/dist/types/core/scheduler.d.ts +7 -2
- package/dist/types/core/toolOperation/ViewOperation.d.ts +3 -2
- package/dist/types/core/toolOperation/basicToolOperation.d.ts +11 -1
- package/dist/types/core/toolOperation/cuboidOperation.d.ts +155 -0
- package/dist/types/core/toolOperation/cuboidToggleButtonClass.d.ts +38 -0
- package/dist/types/utils/MathUtils.d.ts +1 -1
- package/dist/types/utils/tool/AttributeUtils.d.ts +7 -0
- package/dist/types/utils/tool/AxisUtils.d.ts +50 -1
- package/dist/types/utils/tool/CuboidUtils.d.ts +267 -0
- package/dist/types/utils/tool/DrawUtils.d.ts +12 -0
- package/dist/types/utils/tool/EnhanceCommonToolUtils.d.ts +4 -2
- package/dist/types/utils/tool/PolygonUtils.d.ts +5 -2
- package/dist/utils/MathUtils.js +2 -2
- package/dist/utils/tool/AttributeUtils.js +1 -1
- package/dist/utils/tool/AxisUtils.js +1 -1
- package/dist/utils/tool/CuboidUtils.js +1 -0
- package/dist/utils/tool/DrawUtils.js +3 -3
- package/dist/utils/tool/EnhanceCommonToolUtils.js +1 -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__node__WorkerClass.js +11 -0
- package/es/_virtual/_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js +18 -0
- package/es/assets/attributeIcon/icon_cuboidFAB.svg.js +5 -0
- package/es/assets/attributeIcon/icon_cuboidLeft.svg.js +7 -0
- package/es/assets/attributeIcon/icon_cuboidMore.svg.js +5 -0
- package/es/assets/attributeIcon/icon_cuboidRight.svg.js +5 -0
- package/es/assets/attributeIcon/icon_cuboidTop.svg.js +12 -0
- package/es/constant/annotation.js +1 -1
- package/es/constant/tool.js +1 -1
- package/es/core/pointCloud/annotation.js +1 -1
- package/es/core/pointCloud/index.js +2 -2
- package/es/core/pointCloud/segmentation.js +50 -0
- package/es/core/scheduler.js +1 -1
- package/es/core/toolOperation/ViewOperation.js +1 -1
- package/es/core/toolOperation/basicToolOperation.js +1 -1
- package/es/core/toolOperation/cuboidOperation.js +1 -0
- package/es/core/toolOperation/cuboidToggleButtonClass.js +31 -0
- package/es/core/toolOperation/scribbleTool2.js +249 -0
- package/es/utils/MathUtils.js +2 -2
- package/es/utils/tool/AttributeUtils.js +1 -1
- package/es/utils/tool/AxisUtils.js +1 -1
- package/es/utils/tool/CuboidUtils.js +1 -0
- package/es/utils/tool/DrawUtils.js +3 -3
- package/es/utils/tool/EnhanceCommonToolUtils.js +1 -1
- package/package.json +3 -3
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AnnotationEngine 标注引擎 - 各类标注工具管理
|
|
3
3
|
*/
|
|
4
|
-
import { EToolName } from '@/constant/tool';
|
|
4
|
+
import { EToolName, THybridToolName } from '@/constant/tool';
|
|
5
5
|
import { IPolygonData } from '@/types/tool/polygon';
|
|
6
|
-
import { THybridToolName } from './scheduler';
|
|
7
6
|
interface IProps {
|
|
8
7
|
container: HTMLElement;
|
|
9
8
|
size: ISize;
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
* @author Ron <ron.f.luo@gmail.com>
|
|
5
5
|
*/
|
|
6
6
|
import { IPointCloudBox, IPointCloudConfig } from '@labelbee/lb-utils';
|
|
7
|
+
import { EToolName, THybridToolName } from '@/constant/tool';
|
|
7
8
|
import { CanvasScheduler } from '@/newCore';
|
|
8
9
|
import { IPolygonData } from '@/types/tool/polygon';
|
|
9
10
|
import { PointCloud } from '.';
|
|
10
11
|
import PointCloud2dOperation, { IPointCloud2dOperationProps } from '../toolOperation/pointCloud2dOperation';
|
|
12
|
+
import { ToolScheduler } from '../scheduler';
|
|
11
13
|
interface IPointCloudAnnotationOperation {
|
|
12
14
|
updateData: (pcdPath: string, result: string) => void;
|
|
13
15
|
}
|
|
@@ -18,13 +20,16 @@ interface IPointCloudAnnotationProps {
|
|
|
18
20
|
polygonOperationProps?: IPointCloud2dOperationProps;
|
|
19
21
|
config: IPointCloudConfig;
|
|
20
22
|
checkMode?: boolean;
|
|
23
|
+
toolName: THybridToolName;
|
|
21
24
|
}
|
|
22
25
|
export declare class PointCloudAnnotation implements IPointCloudAnnotationOperation {
|
|
23
26
|
pointCloudInstance: PointCloud;
|
|
24
27
|
pointCloud2dOperation: PointCloud2dOperation;
|
|
25
28
|
canvasScheduler: CanvasScheduler;
|
|
29
|
+
toolScheduler: ToolScheduler;
|
|
30
|
+
toolInstance: any;
|
|
26
31
|
config: IPointCloudConfig;
|
|
27
|
-
constructor({ size, container, pcdPath, polygonOperationProps, config, checkMode }: IPointCloudAnnotationProps);
|
|
32
|
+
constructor({ size, container, pcdPath, polygonOperationProps, config, checkMode, toolName, }: IPointCloudAnnotationProps);
|
|
28
33
|
updateConfig(config: IPointCloudConfig): void;
|
|
29
34
|
/**
|
|
30
35
|
* Get default boundary by size.
|
|
@@ -55,6 +60,11 @@ export declare class PointCloudAnnotation implements IPointCloudAnnotationOperat
|
|
|
55
60
|
updateData(pcdPath: string, result: string, config?: {
|
|
56
61
|
radius?: number;
|
|
57
62
|
}): void;
|
|
63
|
+
/**
|
|
64
|
+
* switch to chosen canvas。
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
switchToCanvas(toolName: EToolName): any;
|
|
58
68
|
/**
|
|
59
69
|
* Init All Position
|
|
60
70
|
* 1. PointCloud camera change to topView
|
|
@@ -182,11 +182,20 @@ export declare class PointCloud {
|
|
|
182
182
|
generateBoxArrow: ({ width }: IPointCloudBox) => THREE.ArrowHelper;
|
|
183
183
|
generateBoxTrackID: (boxParams: IPointCloudBox) => THREE.Sprite | undefined;
|
|
184
184
|
getTextCanvas(text: string): HTMLCanvasElement;
|
|
185
|
-
|
|
185
|
+
/**
|
|
186
|
+
* Filter road points and noise in all directions
|
|
187
|
+
* 1. The first 5% of the z-axis is used as the road coordinate
|
|
188
|
+
* 2. Filter out points 10cm above the road surface.
|
|
189
|
+
* 3. Filter out the first 0.5% of noise points in other directions
|
|
190
|
+
*/
|
|
191
|
+
filterNoise(pointList: I3DSpaceCoord[]): I3DSpaceCoord[];
|
|
192
|
+
getFittedCoordinates(polygon: IPolygonPoint[], innerPointList: ICoordinate[]): import("@labelbee/lb-utils/dist/types/types/common").ICoordinate[];
|
|
193
|
+
getSensesPointZAxisInPolygon(polygon: IPolygonPoint[], zScope?: [number, number], intelligentFit?: boolean): {
|
|
186
194
|
maxZ: number;
|
|
187
195
|
minZ: number;
|
|
188
196
|
count: number;
|
|
189
197
|
zCount: number;
|
|
198
|
+
fittedCoordinates: ICoordinate[];
|
|
190
199
|
};
|
|
191
200
|
/**
|
|
192
201
|
* ViewPort - Transformation
|
|
@@ -316,6 +325,7 @@ export declare class PointCloud {
|
|
|
316
325
|
[k: string]: string;
|
|
317
326
|
} | undefined;
|
|
318
327
|
count?: number | undefined;
|
|
328
|
+
newPointList?: import("@labelbee/lb-utils/dist/types/types/common").ICoordinate[] | undefined;
|
|
319
329
|
};
|
|
320
330
|
} | undefined;
|
|
321
331
|
/**
|
|
@@ -44,6 +44,7 @@ export declare function getCuboidFromPointCloudBox(boxParams: IPointCloudBox): {
|
|
|
44
44
|
[k: string]: string;
|
|
45
45
|
} | undefined;
|
|
46
46
|
count?: number | undefined;
|
|
47
|
+
newPointList?: import("@labelbee/lb-utils/dist/types/types/common").ICoordinate[] | undefined;
|
|
47
48
|
width: number;
|
|
48
49
|
height: number;
|
|
49
50
|
depth: number;
|
|
File without changes
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
* @createDate 2022-07-27
|
|
4
4
|
* @author Ron <ron.f.luo@gmail.com>
|
|
5
5
|
*/
|
|
6
|
-
import { EToolName } from '@/constant/tool';
|
|
6
|
+
import { EToolName, THybridToolName } from '@/constant/tool';
|
|
7
7
|
import { RectOperation } from './toolOperation/rectOperation';
|
|
8
8
|
import PolygonOperation from './toolOperation/polygonOperation';
|
|
9
9
|
import SegmentByRect from './toolOperation/segmentByRect';
|
|
10
|
-
export type THybridToolName = EToolName | Array<EToolName>;
|
|
11
10
|
interface IToolSchedulerOperation {
|
|
12
11
|
}
|
|
13
12
|
interface IToolSchedulerProps {
|
|
@@ -27,6 +26,7 @@ export declare class ToolScheduler implements IToolSchedulerOperation {
|
|
|
27
26
|
private container;
|
|
28
27
|
private toolOperationList;
|
|
29
28
|
private toolOperationDom;
|
|
29
|
+
private toolOperationNameList;
|
|
30
30
|
private size;
|
|
31
31
|
private config;
|
|
32
32
|
private style;
|
|
@@ -66,6 +66,11 @@ export declare class ToolScheduler implements IToolSchedulerOperation {
|
|
|
66
66
|
* @returns
|
|
67
67
|
*/
|
|
68
68
|
getFirstToolOperation(): RectOperation | PolygonOperation | SegmentByRect;
|
|
69
|
+
/**
|
|
70
|
+
* switch to canvas by given toolName
|
|
71
|
+
* TODO: change operationList to operationMap
|
|
72
|
+
*/
|
|
73
|
+
switchToCanvas(toolName: EToolName): RectOperation | PolygonOperation | undefined;
|
|
69
74
|
destroyAllLayer(): void;
|
|
70
75
|
init(): void;
|
|
71
76
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 查看模式 - 支持简单数据注入查看
|
|
3
3
|
*/
|
|
4
|
-
import { TAnnotationViewData, TAnnotationViewLine, TAnnotationViewPolygon, TAnnotationViewBox3d, IBasicStyle } from '@labelbee/lb-utils';
|
|
4
|
+
import { TAnnotationViewData, TAnnotationViewLine, TAnnotationViewPolygon, TAnnotationViewBox3d, IBasicStyle, TAnnotationViewCuboid } from '@labelbee/lb-utils';
|
|
5
5
|
import { BasicToolOperation, IBasicToolOperationProps } from './basicToolOperation';
|
|
6
6
|
type IViewOperationProps = {
|
|
7
7
|
style: IBasicStyle;
|
|
@@ -80,8 +80,8 @@ export default class ViewOperation extends BasicToolOperation {
|
|
|
80
80
|
getRenderStyle(annotation: TAnnotationViewData): {
|
|
81
81
|
style: {
|
|
82
82
|
radius: any;
|
|
83
|
-
thickness: any;
|
|
84
83
|
fill: any;
|
|
84
|
+
thickness: any;
|
|
85
85
|
stroke: any;
|
|
86
86
|
};
|
|
87
87
|
fontStyle: {
|
|
@@ -95,6 +95,7 @@ export default class ViewOperation extends BasicToolOperation {
|
|
|
95
95
|
};
|
|
96
96
|
renderLine(annotation: TAnnotationViewLine): void;
|
|
97
97
|
renderPolygon(annotation: TAnnotationViewPolygon): void;
|
|
98
|
+
renderSingleCuboid(annotation: TAnnotationViewCuboid): void;
|
|
98
99
|
renderBox3d(annotation: TAnnotationViewBox3d): void;
|
|
99
100
|
render(): void;
|
|
100
101
|
}
|
|
@@ -143,6 +143,16 @@ declare class BasicToolOperation extends EventListener {
|
|
|
143
143
|
setForbidOperation(forbidOperation: boolean): void;
|
|
144
144
|
setForbidCursorLine(forbidCursorLine: boolean): void;
|
|
145
145
|
setIsHidden(isHidden: boolean): void;
|
|
146
|
+
setDefaultAttribute(attribute: string): void;
|
|
147
|
+
getCoordinateInOrigin(e: MouseEvent): {
|
|
148
|
+
x: number;
|
|
149
|
+
y: number;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Get the textIconSvg by attribute.
|
|
153
|
+
* @param attribute
|
|
154
|
+
*/
|
|
155
|
+
getTextIconSvg(attribute?: string): any;
|
|
146
156
|
/**
|
|
147
157
|
* 用于外界直接控制序号的是否展示
|
|
148
158
|
* @param isShowOrder
|
|
@@ -244,7 +254,7 @@ declare class BasicToolOperation extends EventListener {
|
|
|
244
254
|
* @returns
|
|
245
255
|
*/
|
|
246
256
|
updateRotate(): false | undefined;
|
|
247
|
-
/**
|
|
257
|
+
/** Get the current property color */
|
|
248
258
|
getColor(attribute?: string, config?: any): any;
|
|
249
259
|
getLineColor(attribute?: string): any;
|
|
250
260
|
clearInvalidPage(): void;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { ECuboidDirection } from '@/constant/annotation';
|
|
2
|
+
import type { ICuboid, ICuboidConfig, IDrawingCuboid } from '@/types/tool/cuboid';
|
|
3
|
+
import { BasicToolOperation } from './basicToolOperation';
|
|
4
|
+
import type { IBasicToolOperationProps } from './basicToolOperation';
|
|
5
|
+
type ICuboidOperationProps = IBasicToolOperationProps;
|
|
6
|
+
/**
|
|
7
|
+
* Just use for the drawing.
|
|
8
|
+
*/
|
|
9
|
+
declare enum EDrawingStatus {
|
|
10
|
+
Ready = 1,
|
|
11
|
+
FirstPoint = 2,
|
|
12
|
+
Cuboid = 3
|
|
13
|
+
}
|
|
14
|
+
declare class CuboidOperation extends BasicToolOperation {
|
|
15
|
+
private toggleButtonInstance?;
|
|
16
|
+
drawingCuboid?: IDrawingCuboid;
|
|
17
|
+
/**
|
|
18
|
+
* The coordinates of the first click, used for creating a cuboid.
|
|
19
|
+
*/
|
|
20
|
+
firstClickCoord?: ICoordinate;
|
|
21
|
+
drawingStatus: EDrawingStatus;
|
|
22
|
+
cuboidList: ICuboid[];
|
|
23
|
+
selectedID?: string;
|
|
24
|
+
config: ICuboidConfig;
|
|
25
|
+
hoverID: string;
|
|
26
|
+
private dragInfo?;
|
|
27
|
+
private highlightInfo?;
|
|
28
|
+
private _textAttributeInstance?;
|
|
29
|
+
constructor(props: ICuboidOperationProps);
|
|
30
|
+
destroy(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Get the showing cuboidList which is needed to be shown.
|
|
33
|
+
*
|
|
34
|
+
* Filter Condition: (It is not enabled currently)
|
|
35
|
+
* 1. basicResult
|
|
36
|
+
* 2. attributeLockList
|
|
37
|
+
*/
|
|
38
|
+
get currentShowList(): ICuboid[];
|
|
39
|
+
get selectedCuboid(): ICuboid | undefined;
|
|
40
|
+
get dataList(): ICuboid[];
|
|
41
|
+
get isNeedCheckCuboidSize(): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the mouse is in the hover range.
|
|
44
|
+
* @param e
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
getIsHoverSelectedCuboid(e: MouseEvent): boolean | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Forbidden to draw a cuboid if the backPlane is front than the frontPlane.
|
|
50
|
+
* @param e
|
|
51
|
+
* @param cuboid
|
|
52
|
+
* @returns
|
|
53
|
+
*/
|
|
54
|
+
isForbiddenMove(e: MouseEvent, cuboid: ICuboid | IDrawingCuboid): boolean;
|
|
55
|
+
getHoverData: (e: MouseEvent) => {
|
|
56
|
+
hoverID: string;
|
|
57
|
+
hoverCuboid: ICuboid | undefined;
|
|
58
|
+
} | {
|
|
59
|
+
hoverID?: undefined;
|
|
60
|
+
hoverCuboid?: undefined;
|
|
61
|
+
};
|
|
62
|
+
updateSelectedCuboid(newCuboid: ICuboid): void;
|
|
63
|
+
getColorToRender(attribute: string, valid: boolean): {
|
|
64
|
+
strokeColor: any;
|
|
65
|
+
toolColor: any;
|
|
66
|
+
fillColor: any;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Get Selected Data.
|
|
70
|
+
*
|
|
71
|
+
* Exclusive: TextAttributeInstance.
|
|
72
|
+
* @param attribute
|
|
73
|
+
* @param valid
|
|
74
|
+
* @returns
|
|
75
|
+
*/
|
|
76
|
+
getCurrentSelectedData(): {
|
|
77
|
+
width: number;
|
|
78
|
+
textAttribute: string;
|
|
79
|
+
color: any;
|
|
80
|
+
} | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Update text Input.
|
|
83
|
+
*
|
|
84
|
+
* Exclusive: TextAttributeInstance.
|
|
85
|
+
* @param attribute
|
|
86
|
+
* @param valid
|
|
87
|
+
* @returns
|
|
88
|
+
*/
|
|
89
|
+
updateSelectedTextAttribute(newTextAttribute?: string): void;
|
|
90
|
+
setResult(cuboidList: ICuboid[]): void;
|
|
91
|
+
/**
|
|
92
|
+
* 获取当前页面标注结果
|
|
93
|
+
*/
|
|
94
|
+
get currentPageResult(): ICuboid[];
|
|
95
|
+
clearResult(): void;
|
|
96
|
+
exportData(): any[];
|
|
97
|
+
setSelectedID(newID?: string): void;
|
|
98
|
+
setSelectedIDAndRender(newID?: string): void;
|
|
99
|
+
setCuboidValidAndRender(id: string): void;
|
|
100
|
+
onRightDblClick(e: MouseEvent): void;
|
|
101
|
+
setCuboidList(cuboidList: ICuboid[], isUpload?: boolean): void;
|
|
102
|
+
deleteCuboid(id: string): void;
|
|
103
|
+
onKeyDown(e: KeyboardEvent): void;
|
|
104
|
+
onKeyUp(e: KeyboardEvent): void;
|
|
105
|
+
onMouseDown(e: MouseEvent): void;
|
|
106
|
+
onMouseUp(e: MouseEvent): boolean | void;
|
|
107
|
+
onMouseMove(e: MouseEvent): boolean | void;
|
|
108
|
+
drawingFrontPlanesMove(e: MouseEvent): true | undefined;
|
|
109
|
+
drawingBackPlaneMove(e: MouseEvent): void;
|
|
110
|
+
onDragMove(e: MouseEvent): void;
|
|
111
|
+
/**
|
|
112
|
+
* onMouseMove in hover.
|
|
113
|
+
*
|
|
114
|
+
* Highlight the position of hover.
|
|
115
|
+
* @param e
|
|
116
|
+
*/
|
|
117
|
+
onHoverMove(e: MouseEvent): void;
|
|
118
|
+
createNewDrawingCuboid(e: MouseEvent, basicSourceID: string): void;
|
|
119
|
+
/**
|
|
120
|
+
* Change Status
|
|
121
|
+
* From drawing frontPlane to backPlane
|
|
122
|
+
*/
|
|
123
|
+
closeNewDrawingFrontPlane(): void;
|
|
124
|
+
closeAndCreateNewCuboid(): void;
|
|
125
|
+
clearDrawingStatus(): void;
|
|
126
|
+
rightMouseUp(e: MouseEvent): void;
|
|
127
|
+
/**
|
|
128
|
+
* TODO - Need to optimize.
|
|
129
|
+
* @param cuboid
|
|
130
|
+
*/
|
|
131
|
+
renderSingleCuboid(cuboid: ICuboid | IDrawingCuboid): void;
|
|
132
|
+
setDefaultAttribute(defaultAttribute?: string): void;
|
|
133
|
+
renderToggleButton(): void;
|
|
134
|
+
renderTextAttribute(): void;
|
|
135
|
+
renderDrawing(): void;
|
|
136
|
+
renderStatic(): void;
|
|
137
|
+
renderSelected(): void;
|
|
138
|
+
updateMouseOperation(type: 'in' | 'out'): void;
|
|
139
|
+
toggleDirection(direction: ECuboidDirection): void;
|
|
140
|
+
/**
|
|
141
|
+
* Notice: Hover is under selectedCuboid.
|
|
142
|
+
*/
|
|
143
|
+
renderHover(): void;
|
|
144
|
+
renderCuboid(): void;
|
|
145
|
+
render(): void;
|
|
146
|
+
undo(): void;
|
|
147
|
+
redo(): void;
|
|
148
|
+
/**
|
|
149
|
+
* Sidebar Callback Function
|
|
150
|
+
* @param v
|
|
151
|
+
* @returns
|
|
152
|
+
*/
|
|
153
|
+
textChange: (v: string) => void;
|
|
154
|
+
}
|
|
155
|
+
export default CuboidOperation;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ECuboidDirection } from '@/constant/annotation';
|
|
2
|
+
interface IBaseInfo {
|
|
3
|
+
cuboidButtonMove: (type: 'in' | 'out') => void;
|
|
4
|
+
toggleDirection: (direction: ECuboidDirection) => void;
|
|
5
|
+
}
|
|
6
|
+
interface ITextAttributeProps {
|
|
7
|
+
container: HTMLElement;
|
|
8
|
+
}
|
|
9
|
+
export default class CuboidToggleButtonClass {
|
|
10
|
+
private container;
|
|
11
|
+
private direction;
|
|
12
|
+
private _cuboidButtonDOM?;
|
|
13
|
+
private _cuboidFABDOM?;
|
|
14
|
+
private isFrontSide;
|
|
15
|
+
private _cuboidMoreDOM?;
|
|
16
|
+
private _cuboidMoreListDOM?;
|
|
17
|
+
private cuboidButtonMove;
|
|
18
|
+
private onToggleDirection;
|
|
19
|
+
constructor(props: ITextAttributeProps & IBaseInfo);
|
|
20
|
+
appendToContainer(): void;
|
|
21
|
+
initCuboidButtonDOM(): HTMLDivElement;
|
|
22
|
+
initcuboidFABDOM(icon: any): HTMLDivElement;
|
|
23
|
+
initcuboidMoreDOM(icon: any): HTMLDivElement;
|
|
24
|
+
initcuboidMoreListDOM(): HTMLDivElement;
|
|
25
|
+
/**
|
|
26
|
+
* Update current button (top)
|
|
27
|
+
* @param position
|
|
28
|
+
*/
|
|
29
|
+
update(position: {
|
|
30
|
+
left: number;
|
|
31
|
+
top: number;
|
|
32
|
+
color: string;
|
|
33
|
+
width?: number;
|
|
34
|
+
}): void;
|
|
35
|
+
clearCuboidButtonDOM(): void;
|
|
36
|
+
clearCuboidMoreListDOM(): void;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -49,7 +49,7 @@ export default class MathUtils {
|
|
|
49
49
|
* @param {boolean} ignoreRatio
|
|
50
50
|
* @returns
|
|
51
51
|
*/
|
|
52
|
-
static getFootOfPerpendicular: (pt: ICoordinate, begin: ICoordinate, end: ICoordinate, useAxisRange?: boolean) => any;
|
|
52
|
+
static getFootOfPerpendicular: (pt: ICoordinate, begin: ICoordinate, end: ICoordinate, useAxisRange?: boolean, allowOverRange?: boolean) => any;
|
|
53
53
|
/**
|
|
54
54
|
* 获取当前文本的背景面积
|
|
55
55
|
* @param canvas
|
|
@@ -77,6 +77,13 @@ export default class AttributeUtils {
|
|
|
77
77
|
*/
|
|
78
78
|
static changeTextAttributeInLog(toolLog: any[][], toolList: any[]): any[][];
|
|
79
79
|
static getTextIconSvg(attribute: string | undefined, attributeList: IInputList[], attributeConfigurable: boolean | undefined, baseIcon: any): any;
|
|
80
|
+
static generateIconAttribute({ fill, width, height, xmlns, xlink, }: {
|
|
81
|
+
fill?: string;
|
|
82
|
+
width?: number;
|
|
83
|
+
height?: number;
|
|
84
|
+
xmlns?: string;
|
|
85
|
+
xlink?: string;
|
|
86
|
+
}): string;
|
|
80
87
|
/**
|
|
81
88
|
* 根据keycode返回attribute, 没有匹配到时为undefined
|
|
82
89
|
* @param keyCode
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EToolName, ELineTypes } from '@/constant/tool';
|
|
2
|
+
import type { ICuboid, IDrawingCuboid, IPlanePoints } from '@/types/tool/cuboid';
|
|
2
3
|
import { IPolygonPoint, IPolygonData, IPolygonConfig } from '../../types/tool/polygon';
|
|
3
4
|
export default class AxisUtils {
|
|
4
5
|
/**
|
|
@@ -66,6 +67,9 @@ export default class AxisUtils {
|
|
|
66
67
|
x: number;
|
|
67
68
|
y: number;
|
|
68
69
|
})[];
|
|
70
|
+
static changePlanePointByZoom(planePoints: IPlanePoints, zoom: number, currentPos?: ICoordinate): IPlanePoints;
|
|
71
|
+
static changeCuboidByZoom(cuboid: ICuboid | IDrawingCuboid, zoom: number, currentPos?: ICoordinate): ICuboid | IDrawingCuboid;
|
|
72
|
+
static transformPlain2PointList({ tl, tr, br, bl }: IPlanePoints): any[];
|
|
69
73
|
/**
|
|
70
74
|
* 扩大点的热区范围
|
|
71
75
|
* @param axis
|
|
@@ -97,7 +101,52 @@ export default class AxisUtils {
|
|
|
97
101
|
* @param {number} [scope=3]
|
|
98
102
|
* @returns {number}
|
|
99
103
|
*/
|
|
100
|
-
static returnClosePointIndex(checkPoint: IPolygonPoint, polygonPoints: IPolygonPoint[], scope?: number): number;
|
|
104
|
+
static returnClosePointIndex(checkPoint: IPolygonPoint | ICoordinate, polygonPoints: IPolygonPoint[] | ICoordinate[], scope?: number): number;
|
|
105
|
+
/**
|
|
106
|
+
* Judge the mousePoint is in the hoverRange of cuboid.
|
|
107
|
+
* @param checkPoint
|
|
108
|
+
* @param cuboid
|
|
109
|
+
* @param options
|
|
110
|
+
* @returns
|
|
111
|
+
*/
|
|
112
|
+
static isCloseCuboid(checkPoint: ICoordinate, cuboid: ICuboid, options?: Partial<{
|
|
113
|
+
scope: number;
|
|
114
|
+
zoom: number;
|
|
115
|
+
}>): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Judge the mousePoint is in the hoverRange of cuboidList.
|
|
118
|
+
* @param checkPoint
|
|
119
|
+
* @param cuboid
|
|
120
|
+
* @param options
|
|
121
|
+
* @returns
|
|
122
|
+
*/
|
|
123
|
+
static isCloseCuboidList(checkPoint: ICoordinate, cuboidList: ICuboid[], options?: Partial<{
|
|
124
|
+
scope: number;
|
|
125
|
+
zoom: number;
|
|
126
|
+
}>): boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Point > Line
|
|
129
|
+
* @param checkPoint
|
|
130
|
+
* @param cuboid
|
|
131
|
+
* @param scope
|
|
132
|
+
*/
|
|
133
|
+
static returnClosePointOrLineInCuboid(checkPoint: ICoordinate, cuboid: ICuboid, options?: Partial<{
|
|
134
|
+
scope: number;
|
|
135
|
+
zoom: number;
|
|
136
|
+
}>): {
|
|
137
|
+
type: string;
|
|
138
|
+
points: ({
|
|
139
|
+
x: number;
|
|
140
|
+
y: number;
|
|
141
|
+
specialPoint?: boolean | undefined;
|
|
142
|
+
specialEdge?: boolean | undefined;
|
|
143
|
+
} | {
|
|
144
|
+
x: number;
|
|
145
|
+
y: number;
|
|
146
|
+
})[];
|
|
147
|
+
originCuboid: ICuboid;
|
|
148
|
+
positions: import("@/types/tool/cuboid").ICuboidPosition[];
|
|
149
|
+
}[] | undefined;
|
|
101
150
|
/**
|
|
102
151
|
* 对比两个点是否在一范围内
|
|
103
152
|
*
|