Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CVAT 3D - Milestone-4 #2891

Merged
merged 28 commits into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5e71fbf
CVAT 3D Annotation - Added initial cuboid placement in all views
Mar 1, 2021
92da287
Fixed MACOS issue for upload of zip files
Mar 1, 2021
c98cad1
Merge branch 'develop' of https://github.com/openvinotoolkit/cvat int…
Mar 1, 2021
c7ba5aa
Fixed camera axis centre issue
Mar 1, 2021
dfe22f4
Fixed ESLint import issues
Mar 1, 2021
8aec49d
Merge branch 'develop' of https://github.com/openvinotoolkit/cvat int…
Mar 15, 2021
7f48c11
Merge branch 'develop' of https://github.com/openvinotoolkit/cvat int…
Mar 16, 2021
4daf516
Merge branch 'develop' of https://github.com/openvinotoolkit/cvat int…
Mar 16, 2021
3902822
Fixed context image fit issue and resizing possible on entire grey li…
Mar 16, 2021
cd70249
Fixed the multiple interection point issue
Mar 16, 2021
7ba93ad
Fixed Naming convention as per SOW
Mar 17, 2021
55ba179
Merge branch 'develop' of https://github.com/openvinotoolkit/cvat int…
Mar 17, 2021
c065389
Trigger notification
Mar 17, 2021
e7ffe23
Reverted code to test cypress tests
Mar 17, 2021
3e2732b
Fixed review comments
Mar 17, 2021
e1eedcc
Included tooltip and added actions for keys and UIOJKL buttons
Mar 18, 2021
85aae86
Merge branch 'develop' of https://github.com/openvinotoolkit/cvat int…
Mar 18, 2021
ebcea6a
Fixed minor issues and review changes
Mar 19, 2021
44fb534
Merge branch 'develop' of https://github.com/openvinotoolkit/cvat int…
Mar 19, 2021
567546a
Merged dev code, updated changelog and minor fixes
Mar 19, 2021
ea43164
Merge branch 'develop' of https://github.com/openvinotoolkit/cvat int…
Mar 19, 2021
85dfc0d
Merged Latest develop code
Mar 22, 2021
103ebfa
Fixed camera positioning issue in Top View
Mar 23, 2021
c8d5cf6
Merged latest develop code
Mar 23, 2021
0060ebf
Merge branch 'develop' of https://github.com/openvinotoolkit/cvat int…
Mar 23, 2021
1463c0d
Merge branch 'develop' of https://github.com/openvinotoolkit/cvat int…
Mar 23, 2021
b71c183
Reverted kubernetes auto-corrected code
Mar 23, 2021
e53501f
Reverted kubernetes code
Mar 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
CVAT 3D Annotation - Added initial cuboid placement in all views
  • Loading branch information
cdp committed Mar 1, 2021
commit 5e71fbf04c84aff36e832541c2036e92adc5a21c
19 changes: 18 additions & 1 deletion cvat-canvas3d/src/typescript/canvas3d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

import pjson from '../../package.json';
import { Canvas3dController, Canvas3dControllerImpl } from './canvas3dController';
import { Canvas3dModel, Canvas3dModelImpl, Mode } from './canvas3dModel';
import {
Canvas3dModel, Canvas3dModelImpl, Mode, DrawData,
} from './canvas3dModel';
import { Canvas3dView, Canvas3dViewImpl, ViewsDOM } from './canvas3dView';
import { Master } from './master';

Expand All @@ -17,6 +19,9 @@ interface Canvas3d {
mode(): Mode;
render(): void;
keyControls(keys: KeyboardEvent): void;
mouseControls(type: string, event: MouseEvent): void;
manasars marked this conversation as resolved.
Show resolved Hide resolved
draw(drawData: DrawData): void;
cancel(): void;
}

class Canvas3dImpl implements Canvas3d {
Expand All @@ -38,10 +43,18 @@ class Canvas3dImpl implements Canvas3d {
this.view.keyControls(keys);
}

public mouseControls(type: string, event: MouseEvent): void {
this.view.mouseControls(type, event);
}

public render(): void {
this.view.render();
}

public draw(drawData: DrawData): void {
this.model.draw(drawData);
}

public setup(frameData: any): void {
this.model.setup(frameData);
}
Expand All @@ -53,6 +66,10 @@ class Canvas3dImpl implements Canvas3d {
public isAbleToChangeFrame(): boolean {
return this.model.isAbleToChangeFrame();
}

public cancel(): void {
this.model.cancel();
}
}

export { Canvas3dImpl as Canvas3d, Canvas3dVersion };
6 changes: 6 additions & 0 deletions cvat-canvas3d/src/typescript/canvas3dController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
// SPDX-License-Identifier: MIT

import { Canvas3dModel, Mode } from './canvas3dModel';
import { DrawData } from '../../../cvat-canvas/src/typescript/canvasModel';
bsekachev marked this conversation as resolved.
Show resolved Hide resolved

export interface Canvas3dController {
readonly drawData: DrawData;
mode: Mode;
}

Expand All @@ -22,4 +24,8 @@ export class Canvas3dControllerImpl implements Canvas3dController {
public get mode(): Mode {
return this.model.mode;
}

public get drawData(): DrawData {
return this.model.data.drawData;
}
}
24 changes: 24 additions & 0 deletions cvat-canvas3d/src/typescript/canvas3dModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ export enum FrameZoom {
MAX = 10,
}

export enum ViewType {
PERSPECTIVE = 'perspective',
TOP = 'top',
SIDE = 'side',
FRONT = 'front',
}

export enum UpdateReasons {
IMAGE_CHANGED = 'image_changed',
OBJECTS_UPDATED = 'objects_updated',
Expand All @@ -39,6 +46,7 @@ export enum UpdateReasons {
export enum Mode {
IDLE = 'idle',
DRAG = 'drag',
CREATE = 'create',
bsekachev marked this conversation as resolved.
Show resolved Hide resolved
RESIZE = 'resize',
DRAW = 'draw',
EDIT = 'edit',
Expand All @@ -61,6 +69,8 @@ export interface Canvas3dModel {
data: Canvas3dDataModel;
setup(frameData: any): void;
isAbleToChangeFrame(): boolean;
draw(drawData: DrawData): void;
cancel(): void;
}

export class Canvas3dModelImpl extends MasterImpl implements Canvas3dModel {
Expand Down Expand Up @@ -133,4 +143,18 @@ export class Canvas3dModelImpl extends MasterImpl implements Canvas3dModel {

return !isUnable;
}

public draw(drawData: DrawData): void {
if (drawData.enabled && this.data.drawData.enabled) {
throw new Error('Drawing has been already started');
}
this.data.drawData.enabled = drawData.enabled;
this.data.mode = Mode.DRAW;

this.notify(UpdateReasons.DRAW);
}

public cancel(): void {
this.notify(UpdateReasons.CANCEL);
}
}
Loading