Skip to content

Commit

Permalink
Merge pull request #561 from Original-Recipe/feat-optimizeAttributeDi…
Browse files Browse the repository at this point in the history
…splay

fix: Fix 3D view not displaying all secondary attributes and IDs
  • Loading branch information
lihqi authored Sep 12, 2024
2 parents f676bc2 + bb44bf1 commit 0457f71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions packages/lb-annotation/src/core/pointCloud/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1465,12 +1465,14 @@ export class PointCloud extends EventListener {
if (!classInfo || !classInfo.subSelected) return; // If the type of the secondary attribute cannot be found, it will be returned directly

const { key: classKey, subSelected } = classInfo;
const subItem = subSelected.find((item: { value: string }) => item.value === boxParams.subAttribute?.[key]);
subSelected.forEach((item) => {
const subAttributeKey = boxParams.subAttribute?.[key];

if (subItem) {
if (resultStr) resultStr += '、';
resultStr += `${classKey}:${subItem.key}`;
}
if (subAttributeKey?.includes(item.value)) {
if (resultStr) resultStr += '、';
resultStr += `${classKey}:${item.key}`;
}
});
});

return resultStr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ export default class ViewOperation extends BasicToolOperation {
const { fontStyle } = this.getRenderStyle(annotation);
const polygon = annotation.annotation as IBasicPolygon;
const curPointCloudBox = this.pointCloudBoxList?.find((item: IPointCloudBox) => item.id === polygon.id);
const headerText = this.hiddenText ? '' : curPointCloudBox?.attribute;
const headerText = this.hiddenText ? '' : `${curPointCloudBox?.trackID} ${curPointCloudBox?.attribute}`;
const renderPolygon = AxisUtils.changePointListByZoom(polygon?.pointList ?? [], this.zoom, this.currentPos);

if (headerText) {
Expand Down

0 comments on commit 0457f71

Please sign in to comment.