Skip to content

Commit

Permalink
feat: PointCloud keyboard event: switchToNextBox
Browse files Browse the repository at this point in the history
  • Loading branch information
lijingchi committed Aug 3, 2022
1 parent d0fa1c1 commit d00774e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ import StyleUtils from '@/utils/tool/StyleUtils';
import PolygonOperation from './polygonOperation';

class PointCloud2dOperation extends PolygonOperation {
/**
* remove default keydown event
*/
public onKeyDown = () => {};

public getLineColor() {
return 'rgba(0, 255, 255, 0.5)';
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { useContext, useEffect } from 'react';
import { PointCloudContext, useRotate } from './PointCloudContext';
import { cTool } from '@labelbee/lb-annotation';
import { PointCloudContext, useNextOne, useRotate } from './PointCloudContext';
import { cTool, cAnnotation } from '@labelbee/lb-annotation';
import { message } from 'antd';
const { ESortDirection } = cAnnotation;

const { EPolygonPattern } = cTool;

const PointCloudListener = () => {
const ptCtx = useContext(PointCloudContext);
const { updateRotate } = useRotate();
const { switchToNextPolygon } = useNextOne();

useEffect(() => {
const { topViewInstance, mainViewInstance } = ptCtx;
Expand Down Expand Up @@ -72,6 +74,14 @@ const PointCloudListener = () => {
ptCtx.setPointCloudValid(!ptCtx.valid);
break;

case 'z':
switchToNextPolygon(ESortDirection.ascend);
break;

case 'c':
switchToNextPolygon(ESortDirection.descend);
break;

default: {
return;
}
Expand Down

0 comments on commit d00774e

Please sign in to comment.