1
0
mirror of https://github.com/openvinotoolkit/cvat.git synced 2022-03-09 18:58:10 +03:00
Files
cvat-image-labelling/cvat-canvas3d
Kirill Lakhov 14262fa951 Interaction handler keyboard handlers fix (#3881)
* initinal implementaion

* additional action, README and version changes

* update changelog

* remove excess reducer

* comment fixes

* changelog update

* canvas3d destroy call upd
2021-11-15 19:08:36 +03:00
..
2021-02-05 10:05:57 +03:00
2021-05-27 13:58:12 +03:00
2021-02-05 10:05:57 +03:00

Module CVAT-CANVAS-3D

Description

The CVAT module written in TypeScript language. It presents a canvas to viewing, drawing and editing of 3D annotations.

Versioning

If you make changes in this package, please do following:

  • After not important changes (typos, backward compatible bug fixes, refactoring) do: npm version patch
  • After changing API (backward compatible new features) do: npm version minor
  • After changing API (changes that break backward compatibility) do: npm version major

Commands

  • Building of the module from sources in the dist directory:
npm run build
npm run build -- --mode=development     # without a minification

API Methods

interface Canvas3d {
  html(): ViewsDOM;
  setup(frameData: any, objectStates: any[]): void;
  isAbleToChangeFrame(): boolean;
  mode(): Mode;
  render(): void;
  keyControls(keys: KeyboardEvent): void;
  draw(drawData: DrawData): void;
  cancel(): void;
  dragCanvas(enable: boolean): void;
  activate(clientID: number | null, attributeID?: number): void;
  configureShapes(shapeProperties: ShapeProperties): void;
  fitCanvas(): void;
  fit(): void;
  group(groupData: GroupData): void;
}

WEB

// Create an instance of a canvas
const canvas = new window.canvas.Canvas3d();

console.log('Version ', window.canvas.CanvasVersion);
console.log('Current mode is ', window.canvas.mode());

// Put canvas to a html container
const views = canvas.html();
htmlContainer.appendChild(views.perspective);
htmlContainer.appendChild(views.top);
htmlContainer.appendChild(views.side);
htmlContainer.appendChild(views.front);