-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHypercubeNeo.ts
More file actions
40 lines (36 loc) · 1.36 KB
/
HypercubeNeo.ts
File metadata and controls
40 lines (36 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { NeoEngineProxy } from './core/NeoEngineProxy';
import { CanvasAdapterNeo, RenderOptions } from './io/CanvasAdapterNeo';
import { WebGpuRendererNeo } from './io/WebGpuRendererNeo';
/**
* HypercubeNeo: The parallel fork of the main facade for Neo engines.
* Provides a clean entry point for orchestration and visualization
* without modifying the legacy 'src' folder.
*/
export class HypercubeNeo {
private static gpuRenderers: Map<HTMLCanvasElement, WebGpuRendererNeo> = new Map();
/**
* Higher-level visualization helper.
* Automatically handles multi-chunk data assembly and colormapping.
* Switches between CPU and GPU native rendering based on the engine mode.
*/
static autoRender(
neo: NeoEngineProxy,
canvas: HTMLCanvasElement,
options: RenderOptions
): void {
const isGpu = (neo.vGrid as any).config.mode === 'gpu';
if (isGpu) {
let renderer = this.gpuRenderers.get(canvas);
if (!renderer) {
renderer = new WebGpuRendererNeo(canvas);
this.gpuRenderers.set(canvas, renderer);
}
renderer.render(neo, options as any);
} else {
CanvasAdapterNeo.render(neo, canvas, options);
}
}
/**
* Future: Add stats collection or other Neo-specific high-level features here.
*/
}