Skip to content

Commit

Permalink
fix: Fixed 3D view highlightColor issue
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyang committed Oct 25, 2024
1 parent 50ab2c1 commit a279f06
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion packages/lb-annotation/src/core/pointCloud/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ export class PointCloud extends EventListener {
this.updateMaterialColor(grandson, color);
});
});
this.render();
}

private updateMaterialColor(child: THREE.Object3D<THREE.Event>, color: THREE.ColorRepresentation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ const PointCloud3D: React.FC<IA2MapStateProps> = ({ currentData, config, highlig
ptCtx.mainViewInstance?.updateCameraZoom(zoom);
}
// when create new box, need to wait for a moment to init box.
setTimeout(() => {
ptCtx.mainViewInstance?.setHighlightColor(selectedId);
}, 100);
ptCtx.mainViewInstance?.setHighlightColor(selectedId);
ptCtx.mainViewInstance?.render();

}, [selectedBox?.info?.id]);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ const PointCloudListener: React.FC<IProps> = ({
if (ptCtx.mainViewInstance && ptCtx.selectedPointCloudBox) {
ptCtx.mainViewInstance.generateBox(ptCtx.selectedPointCloudBox);
ptCtx.mainViewInstance.setHighlightColor(selectBox.id);
ptCtx.mainViewInstance.render();
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ export const synchronizeTopView = (

// Control the 3D view data to create box
mainViewInstance.generateBox(newBoxParams);
mainViewInstance.setHighlightColor(newBoxParams.id);
mainViewInstance.render();

const { pointCloud2dOperation, pointCloudInstance } = topViewInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ const useUpdatePointCloudColor = (setResourceLoading: any, config: any) => {
mainViewInstance.generateBoxes(pointCloudBoxList);
if (newSelectedBox) {
mainViewInstance.setHighlightColor(newSelectedBox.id);
mainViewInstance.render();
}
}

Expand Down

0 comments on commit a279f06

Please sign in to comment.