From c4e769d5cfb2788e5671c8ca82751cbf3e3e0ce0 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Thu, 4 Jun 2020 19:24:23 +0300 Subject: [PATCH] Context menu options for cuboids (#1554) --- cvat-ui/src/assets/reset-perspective.svg | 4 ++ .../objects-side-bar/object-item.tsx | 39 +++++++++++++- .../objects-side-bar/object-item.tsx | 51 +++++++++++++++++++ cvat-ui/src/icons.tsx | 4 ++ cvat-ui/src/utils/math.ts | 8 +++ 5 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 cvat-ui/src/assets/reset-perspective.svg diff --git a/cvat-ui/src/assets/reset-perspective.svg b/cvat-ui/src/assets/reset-perspective.svg new file mode 100644 index 00000000..2c7c0b83 --- /dev/null +++ b/cvat-ui/src/assets/reset-perspective.svg @@ -0,0 +1,4 @@ + + + + diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/object-item.tsx b/cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/object-item.tsx index 1a5b54cb..88a4b83f 100644 --- a/cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/object-item.tsx +++ b/cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/object-item.tsx @@ -29,6 +29,7 @@ import { NextIcon, BackgroundIcon, ForegroundIcon, + ResetPerspectiveIcon, } from 'icons'; import { ObjectType, ShapeType } from 'reducers/interfaces'; import { clamp } from 'utils/math'; @@ -38,6 +39,7 @@ function ItemMenu( serverID: number | undefined, locked: boolean, objectType: ObjectType, + shapeType: ShapeType, copyShortcut: string, pasteShortcut: string, propagateShortcut: string, @@ -50,6 +52,8 @@ function ItemMenu( createURL: (() => void), toBackground: (() => void), toForeground: (() => void), + switchCuboidOrientation: (() => void), + resetCuboidPerspective: (() => void), ): JSX.Element { return ( @@ -72,7 +76,22 @@ function ItemMenu( - { objectType !== ObjectType.TAG && ( + {shapeType === ShapeType.CUBOID && ( + + + + )} + {shapeType === ShapeType.CUBOID && ( + + + + )} + {objectType !== ObjectType.TAG && (