@labelbee/lb-annotation 1.13.0-alpha.5 → 1.13.0-alpha.7
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/core/pointCloud/index.js +2 -2
- package/dist/types/constant/tool.d.ts +1 -1
- package/dist/types/core/pointCloud/index.d.ts +4 -2
- package/dist/types/core/pointCloud/segmentation.d.ts +0 -0
- package/dist/types/core/scheduler.d.ts +1 -1
- package/dist/types/core/toolOperation/ViewOperation.d.ts +1 -1
- package/dist/types/core/toolOperation/segmentByRect.d.ts +1 -1
- package/dist/types/utils/tool/CommonToolUtils.d.ts +1 -1
- package/es/assets/attributeIcon/icon_cuboidFAB.svg.js +3 -0
- package/es/assets/attributeIcon/icon_cuboidLeft.svg.js +3 -0
- package/es/assets/attributeIcon/icon_cuboidMore.svg.js +3 -0
- package/es/assets/attributeIcon/icon_cuboidRight.svg.js +3 -0
- package/es/assets/attributeIcon/icon_cuboidTop.svg.js +3 -0
- package/es/core/pointCloud/index.js +2 -2
- package/es/core/pointCloud/segmentation.js +50 -0
- package/es/core/toolOperation/cuboidOperation.js +733 -0
- package/es/core/toolOperation/cuboidToggleButtonClass.js +174 -0
- package/es/core/toolOperation/scribbleTool2.js +249 -0
- package/es/utils/tool/CuboidUtils.js +663 -0
- package/package.json +2 -2
- package/es/core/toolOperation/MultipleSelect.js +0 -73
- package/es/core/toolOperation/Selection.js +0 -98
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import CommonToolUtils from '../../utils/tool/CommonToolUtils.js';
|
|
3
|
-
|
|
4
|
-
class Selection {
|
|
5
|
-
constructor(toolInstance) {
|
|
6
|
-
if (!toolInstance) {
|
|
7
|
-
console.error("MultipleSelect is require an tool instance");
|
|
8
|
-
}
|
|
9
|
-
this._selectedIDs = [];
|
|
10
|
-
this.toolInstance = toolInstance;
|
|
11
|
-
}
|
|
12
|
-
get selectedIDs() {
|
|
13
|
-
return this._selectedIDs;
|
|
14
|
-
}
|
|
15
|
-
set selectedIDs(selectedIDs) {
|
|
16
|
-
this._selectedIDs = selectedIDs;
|
|
17
|
-
this.toolInstance.render();
|
|
18
|
-
}
|
|
19
|
-
get visibleDataList() {
|
|
20
|
-
const {dataList, attributeLockList, basicResult} = this.toolInstance;
|
|
21
|
-
const [showingDataList] = CommonToolUtils.getRenderResultList(dataList, CommonToolUtils.getSourceID(basicResult), attributeLockList);
|
|
22
|
-
return showingDataList;
|
|
23
|
-
}
|
|
24
|
-
get dataList() {
|
|
25
|
-
return this.toolInstance.dataList;
|
|
26
|
-
}
|
|
27
|
-
updateSelectedIDs(selectedID) {
|
|
28
|
-
if (this.selectedIDs.includes(selectedID)) {
|
|
29
|
-
this.selectedIDs = this.selectedIDs.filter((id) => id !== selectedID);
|
|
30
|
-
} else {
|
|
31
|
-
this.selectedIDs = [...this.selectedIDs, selectedID];
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
updateSelectedGraphProps(updateList) {
|
|
35
|
-
const updatedDataList = _.cloneDeep(this.dataList).map((i) => {
|
|
36
|
-
const updatedData = updateList.find((s) => s.id === i.id);
|
|
37
|
-
if (updatedData) {
|
|
38
|
-
return _.merge(i, updatedData);
|
|
39
|
-
}
|
|
40
|
-
return i;
|
|
41
|
-
});
|
|
42
|
-
this.setResultAndRender(updatedDataList);
|
|
43
|
-
}
|
|
44
|
-
selectAll() {
|
|
45
|
-
this.selectedIDs = this.visibleDataList.map((i) => i.id);
|
|
46
|
-
this.toolInstance.render();
|
|
47
|
-
}
|
|
48
|
-
toStashDataList() {
|
|
49
|
-
if (this.selectedIDs.length > 0) {
|
|
50
|
-
this.stashDataList = _.cloneDeep(this.dataList.filter((i) => this.selectedIDs.includes(i.id)));
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
toUnStashDataList() {
|
|
54
|
-
if (this.stashDataList) {
|
|
55
|
-
const _stashDataList = this.stashDataList;
|
|
56
|
-
this.stashDataList = [];
|
|
57
|
-
return _stashDataList;
|
|
58
|
-
}
|
|
59
|
-
return void 0;
|
|
60
|
-
}
|
|
61
|
-
mergeStashData() {
|
|
62
|
-
const stashList = this.toUnStashDataList();
|
|
63
|
-
const mergedDataList = _(this.dataList).keyBy("id").merge(_.keyBy(stashList, "id")).values().value();
|
|
64
|
-
this.setResultAndRender(mergedDataList);
|
|
65
|
-
}
|
|
66
|
-
setResultAndRender(dataList) {
|
|
67
|
-
}
|
|
68
|
-
isSelectedID(id) {
|
|
69
|
-
return this.selectedIDs.includes(id);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export { Selection as default };
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import CommonToolUtils from '../../utils/tool/CommonToolUtils.js';
|
|
3
|
-
|
|
4
|
-
class Selection {
|
|
5
|
-
constructor(toolInstance) {
|
|
6
|
-
if (!toolInstance) {
|
|
7
|
-
console.error("MultipleSelect is require a tool instance");
|
|
8
|
-
}
|
|
9
|
-
this._selectedIDs = [];
|
|
10
|
-
this.toolInstance = toolInstance;
|
|
11
|
-
}
|
|
12
|
-
get selectedIDs() {
|
|
13
|
-
return this._selectedIDs;
|
|
14
|
-
}
|
|
15
|
-
get selectedID() {
|
|
16
|
-
return this._selectedIDs.length === 1 ? this._selectedIDs[0] : void 0;
|
|
17
|
-
}
|
|
18
|
-
get visibleDataList() {
|
|
19
|
-
const {dataList, attributeLockList, basicResult} = this.toolInstance;
|
|
20
|
-
const [showingDataList] = CommonToolUtils.getRenderResultList(dataList, CommonToolUtils.getSourceID(basicResult), attributeLockList);
|
|
21
|
-
return showingDataList;
|
|
22
|
-
}
|
|
23
|
-
get dataList() {
|
|
24
|
-
return this.toolInstance.dataList;
|
|
25
|
-
}
|
|
26
|
-
set selectedIDs(selectedIDs) {
|
|
27
|
-
var _a;
|
|
28
|
-
(_a = this.toolInstance._textAttributeInstance) == null ? void 0 : _a.selectedIDsChanged(this.selectedIDs, selectedIDs);
|
|
29
|
-
this._selectedIDs = selectedIDs;
|
|
30
|
-
this.toolInstance.render();
|
|
31
|
-
}
|
|
32
|
-
updateSelectedIDs(selectedID) {
|
|
33
|
-
if (!selectedID) {
|
|
34
|
-
this._selectedIDs = [];
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (this.selectedIDs.includes(selectedID)) {
|
|
38
|
-
this.selectedIDs = this.selectedIDs.filter((id) => id !== selectedID);
|
|
39
|
-
} else {
|
|
40
|
-
this.selectedIDs = [...this.selectedIDs, selectedID];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
setSelectedIDs(id, isAppend = false) {
|
|
44
|
-
if (isAppend) {
|
|
45
|
-
this.updateSelectedIDs(id);
|
|
46
|
-
} else {
|
|
47
|
-
this.selectedIDs = id ? [id] : [];
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
selectAll() {
|
|
51
|
-
this.selectedIDs = this.visibleDataList.map((i) => i.id);
|
|
52
|
-
this.toolInstance.render();
|
|
53
|
-
}
|
|
54
|
-
toStashDataList() {
|
|
55
|
-
if (this.selectedIDs.length > 0) {
|
|
56
|
-
this.stashDataList = _.cloneDeep(this.dataList.filter((i) => this.selectedIDs.includes(i.id)));
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
toUnStashDataList() {
|
|
60
|
-
if (this.stashDataList) {
|
|
61
|
-
const _stashDataList = this.stashDataList;
|
|
62
|
-
this.stashDataList = void 0;
|
|
63
|
-
return _stashDataList;
|
|
64
|
-
}
|
|
65
|
-
return void 0;
|
|
66
|
-
}
|
|
67
|
-
mergeStashData(setDataList) {
|
|
68
|
-
const stashList = this.toUnStashDataList();
|
|
69
|
-
if (!stashList) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
const mergedDataList = _(this.dataList).keyBy("id").merge(_.keyBy(stashList, "id")).values().value();
|
|
73
|
-
setDataList(mergedDataList);
|
|
74
|
-
this.toolInstance.render();
|
|
75
|
-
}
|
|
76
|
-
isIdSelected(id) {
|
|
77
|
-
return this.selectedIDs.includes(id);
|
|
78
|
-
}
|
|
79
|
-
triggerKeyboardEvent(e, setDataList) {
|
|
80
|
-
if (e.ctrlKey) {
|
|
81
|
-
if (e.key === "v") {
|
|
82
|
-
this.mergeStashData(setDataList);
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
if (e.key === "a") {
|
|
86
|
-
this.selectAll();
|
|
87
|
-
return true;
|
|
88
|
-
}
|
|
89
|
-
if (e.key === "c") {
|
|
90
|
-
this.toStashDataList();
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export { Selection as default };
|