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 15 commits
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
5 changes: 5 additions & 0 deletions cvat-canvas3d/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions cvat-canvas3d/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"webpack-dev-server": "^3.11.0"
},
"dependencies": {
"three": "^0.125.0",
"camera-controls": "^1.25.3"
"@types/three": "^0.125.3",
"camera-controls": "^1.25.3",
"three": "^0.125.0"
}
}
23 changes: 21 additions & 2 deletions 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, ViewType, MouseInteraction,
} 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,12 @@ class Canvas3dImpl implements Canvas3d {
public isAbleToChangeFrame(): boolean {
return this.model.isAbleToChangeFrame();
}

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

export { Canvas3dImpl as Canvas3d, Canvas3dVersion };
export {
Canvas3dImpl as Canvas3d, Canvas3dVersion, ViewType, MouseInteraction,
};
7 changes: 6 additions & 1 deletion cvat-canvas3d/src/typescript/canvas3dController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
//
// SPDX-License-Identifier: MIT

import { Canvas3dModel, Mode } from './canvas3dModel';
import { Canvas3dModel, Mode, DrawData } from './canvas3dModel';

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

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

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

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

export enum MouseInteraction {
CLICK = 'click',
DOUBLE_CLICK = 'dblclick',
HOVER = 'hover',
}

export enum UpdateReasons {
IMAGE_CHANGED = 'image_changed',
OBJECTS_UPDATED = 'objects_updated',
Expand Down Expand Up @@ -61,6 +74,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 +148,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