-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add box in top view and show in 3D view
- Loading branch information
Showing
11 changed files
with
429 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,3 +74,5 @@ export { | |
AnnotationEngine, | ||
PointCloud, | ||
}; | ||
|
||
export * from './newCore'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Canvas Schduler | ||
* @Author: Laoluo luozefeng@sensetime.com | ||
* @Date: 2022-06-22 14:59:33 | ||
* @LastEditors: Laoluo luozefeng@sensetime.com | ||
* @LastEditTime: 2022-06-27 16:57:59 | ||
*/ | ||
interface ICanvasBasicOperation { | ||
createCanvas(id: string, options?: { size?: { width: number; height: number } }): HTMLCanvasElement; | ||
createCanvas(canvas: HTMLCanvasElement): HTMLCanvasElement; | ||
destroyCanvas(id: string): HTMLElement | null; | ||
} | ||
|
||
interface ICavnasSchdulerProps { | ||
container: HTMLElement; | ||
} | ||
|
||
class CanvasSchduler implements ICanvasBasicOperation { | ||
private container: HTMLElement; | ||
|
||
constructor(props: ICavnasSchdulerProps) { | ||
this.container = props.container; | ||
} | ||
|
||
public createCanvas(id: string | HTMLCanvasElement, options?: { size?: { width: number; height: number } }) { | ||
if (typeof id !== 'string') { | ||
this.container.appendChild(id); | ||
id.style.position = 'absolute'; | ||
id.style.left = '0'; | ||
id.style.top = '0'; | ||
return id; | ||
} | ||
|
||
const canvas = document.createElement('canvas'); | ||
canvas.id = id; | ||
if (options && options.size) { | ||
canvas.width = options.size.width; | ||
canvas.height = options.size.height; | ||
} | ||
|
||
this.container.appendChild(canvas); | ||
|
||
return canvas; | ||
} | ||
|
||
public destroyCanvas(id: string) { | ||
const dom = document.getElementById(id); | ||
if (dom) { | ||
this.container.removeChild(dom); | ||
} | ||
return dom; | ||
} | ||
} | ||
|
||
export { CanvasSchduler }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* @Author: Laoluo luozefeng@sensetime.com | ||
* @Date: 2022-06-22 14:58:48 | ||
* @LastEditors: Laoluo luozefeng@sensetime.com | ||
* @LastEditTime: 2022-06-22 15:29:37 | ||
*/ | ||
|
||
export * from './CanvasSchduler'; |
Oops, something went wrong.