@meteo-render/mars3d 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/dist/index.cjs +7 -0
- package/dist/index.mjs +7 -0
- package/dist/index.umd.js +7 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/raster-mars3d/cesiumRasterPlaneRenderer.d.ts +28 -0
- package/dist/types/raster-mars3d/cesiumRasterTextureAdapter.d.ts +14 -0
- package/dist/types/raster-mars3d/index.d.ts +6 -0
- package/dist/types/raster-mars3d/mars3dRasterImageryProvider.d.ts +30 -0
- package/dist/types/raster-mars3d/mars3dRasterPlaneLayer.d.ts +3 -0
- package/dist/types/raster-mars3d/rasterPlaneCesiumTypes.d.ts +95 -0
- package/dist/types/raster-mars3d/rasterPlaneGeometry.d.ts +5 -0
- package/dist/types/raster-mars3d/rasterPlaneGridChunks.d.ts +4 -0
- package/dist/types/raster-mars3d/rasterPlaneMaterial.d.ts +21 -0
- package/dist/types/raster-mars3d/rasterPlaneTypes.d.ts +33 -0
- package/dist/types/raster-mars3d/types.d.ts +30 -0
- package/dist/types/volume-mars3d/createMars3dVolumeScene.d.ts +3 -0
- package/dist/types/volume-mars3d/index.d.ts +2 -0
- package/dist/types/volume-mars3d/mars3dCanvasCompensation.d.ts +22 -0
- package/dist/types/volume-mars3d/mars3dRaymarchShader.d.ts +1 -0
- package/dist/types/volume-mars3d/mars3dVolumeLayer.d.ts +2 -0
- package/dist/types/volume-mars3d/mars3dVolumeRenderer.d.ts +56 -0
- package/dist/types/volume-mars3d/volumeMars3dTypes.d.ts +85 -0
- package/dist/types/volume-mars3d-native/index.d.ts +4 -0
- package/dist/types/volume-mars3d-native/liveUpdateScheduler.d.ts +10 -0
- package/dist/types/volume-mars3d-native/mars3dNativeSliceLayer.d.ts +2 -0
- package/dist/types/volume-mars3d-native/mars3dNativeSliceRenderer.d.ts +56 -0
- package/dist/types/volume-mars3d-native/mars3dNativeVolumeLayer.d.ts +2 -0
- package/dist/types/volume-mars3d-native/mars3dNativeVolumeRenderer.d.ts +34 -0
- package/dist/types/volume-mars3d-native/nativeAxisSliceRenderer.d.ts +40 -0
- package/dist/types/volume-mars3d-native/nativeSliceAtlas.d.ts +50 -0
- package/dist/types/volume-mars3d-native/nativeSliceRuntimeTypes.d.ts +17 -0
- package/dist/types/volume-mars3d-native/nativeTypes.d.ts +174 -0
- package/dist/types/volume-mars3d-native/nativeVoxelProvider.d.ts +6 -0
- package/dist/types/volume-mars3d-native/nativeVoxelShader.d.ts +2 -0
- package/dist/types/volume-mars3d-native/voxelData.d.ts +9 -0
- package/package.json +60 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IMars3dCesiumRuntime, IMars3dMapLike } from './rasterPlaneCesiumTypes';
|
|
2
|
+
import type { IMars3dRasterPlaneLayerOptions, IMars3dRasterPlaneLayerUpdate } from './rasterPlaneTypes';
|
|
3
|
+
/** 在 Cesium 场景中管理长期存在的实高栅格 Primitive。 */
|
|
4
|
+
export declare class CesiumRasterPlaneRenderer {
|
|
5
|
+
private readonly Cesium;
|
|
6
|
+
private readonly map;
|
|
7
|
+
private readonly state;
|
|
8
|
+
private readonly textureAdapter;
|
|
9
|
+
private entries;
|
|
10
|
+
private currentHeight;
|
|
11
|
+
private shown;
|
|
12
|
+
private destroyed;
|
|
13
|
+
constructor(Cesium: IMars3dCesiumRuntime, map: IMars3dMapLike, options: IMars3dRasterPlaneLayerOptions);
|
|
14
|
+
get height(): number;
|
|
15
|
+
setShow(show: boolean): void;
|
|
16
|
+
update(options: IMars3dRasterPlaneLayerUpdate): void;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
private applyInitialState;
|
|
19
|
+
private createEntry;
|
|
20
|
+
private createEntries;
|
|
21
|
+
private addEntries;
|
|
22
|
+
private replaceEntries;
|
|
23
|
+
private rebuildGeometry;
|
|
24
|
+
private destroyEntry;
|
|
25
|
+
private destroyDetachedEntries;
|
|
26
|
+
private removePrimitive;
|
|
27
|
+
private assertAlive;
|
|
28
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ICesiumMaterialLike, ICesiumSceneLike, ICesiumTextureLike, IMars3dCesiumRuntime } from './rasterPlaneCesiumTypes';
|
|
2
|
+
/** 隔离 Cesium 浮点纹理与内部 WebGL Context 的版本耦合。 */
|
|
3
|
+
export declare class CesiumRasterTextureAdapter {
|
|
4
|
+
readonly maximumTextureSize: number;
|
|
5
|
+
private readonly Cesium;
|
|
6
|
+
private readonly context;
|
|
7
|
+
private readonly sampler;
|
|
8
|
+
constructor(Cesium: IMars3dCesiumRuntime, scene: ICesiumSceneLike);
|
|
9
|
+
createTexture(values: Float32Array<ArrayBufferLike>, width: number, height: number, pixelFormat: number): ICesiumTextureLike;
|
|
10
|
+
updateMaterial(material: ICesiumMaterialLike): void;
|
|
11
|
+
private getContext;
|
|
12
|
+
private queryMaximumTextureSize;
|
|
13
|
+
private validateRuntime;
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Mars3dRasterImageryProvider, createMars3dRasterImageryProvider } from './mars3dRasterImageryProvider';
|
|
2
|
+
export type { CesiumEventLike, CesiumGeographicTilingSchemeLike, CesiumRectangleLike, CesiumRequestLike, CesiumRuntime, Mars3dRasterImageryProviderOptions } from './types';
|
|
3
|
+
export { createMars3dRasterPlaneLayer } from './mars3dRasterPlaneLayer';
|
|
4
|
+
export type { IMars3dRasterPlaneLayer, IMars3dRasterPlaneLayerOptions, IMars3dRasterPlaneLayerUpdate, IMars3dRuntime } from './rasterPlaneTypes';
|
|
5
|
+
export { WebgpuRasterTileRenderer, createGridFromParams, loadMicaps4Grid, loadRasterGrid, loadTifGrid, normalizeColorStops, parseMicaps4Text, parseRasterColor, queryRasterValue, queryRasterValues, validateRasterGrid } from '@meteo-render/raster';
|
|
6
|
+
export type { GeographicRasterTileRequest, RasterClipMode, RasterClipOptions, RasterColorMode, RasterColorRange, RasterColorStop, RasterColorStopInput, RasterGrid, RasterLoadOptions, RasterParams, RasterQueryResult, RasterSampleMode, RasterSource, WebgpuRasterTileRendererOptions } from '@meteo-render/raster';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { WebgpuRasterTileRenderer } from '@meteo-render/raster';
|
|
2
|
+
import type { CesiumEventLike, CesiumGeographicTilingSchemeLike, CesiumRectangleLike, CesiumRequestLike, CesiumRuntime, Mars3dRasterImageryProviderOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* 为 Mars3D/Cesium 提供透明 WebGPU 栅格瓦片。
|
|
5
|
+
* 该对象只实现 ImageryProvider 协议,不持有 Mars3D 地图实例。
|
|
6
|
+
*/
|
|
7
|
+
export declare class Mars3dRasterImageryProvider {
|
|
8
|
+
readonly tileWidth: number;
|
|
9
|
+
readonly tileHeight: number;
|
|
10
|
+
readonly minimumLevel: number;
|
|
11
|
+
readonly maximumLevel: number | undefined;
|
|
12
|
+
readonly tilingScheme: CesiumGeographicTilingSchemeLike;
|
|
13
|
+
readonly rectangle: CesiumRectangleLike;
|
|
14
|
+
readonly errorEvent: CesiumEventLike;
|
|
15
|
+
readonly credit: unknown;
|
|
16
|
+
readonly hasAlphaChannel = true;
|
|
17
|
+
readonly ready = true;
|
|
18
|
+
readonly readyPromise: Promise<boolean>;
|
|
19
|
+
private readonly tileRenderer;
|
|
20
|
+
private destroyed;
|
|
21
|
+
constructor(Cesium: CesiumRuntime, options: Mars3dRasterImageryProviderOptions);
|
|
22
|
+
requestImage(x: number, y: number, level: number, request?: CesiumRequestLike): Promise<HTMLCanvasElement> | undefined;
|
|
23
|
+
getTileCredits(): unknown[] | undefined;
|
|
24
|
+
pickFeatures(): undefined;
|
|
25
|
+
destroy(): void;
|
|
26
|
+
get renderer(): WebgpuRasterTileRenderer;
|
|
27
|
+
private validateOptions;
|
|
28
|
+
}
|
|
29
|
+
/** 创建可交给 Mars3D BaseTileLayer 的 Cesium ImageryProvider。 */
|
|
30
|
+
export declare const createMars3dRasterImageryProvider: (Cesium: CesiumRuntime, options: Mars3dRasterImageryProviderOptions) => Mars3dRasterImageryProvider;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IMars3dBaseLayerLike } from './rasterPlaneCesiumTypes';
|
|
2
|
+
import type { IMars3dRasterPlaneLayer, IMars3dRasterPlaneLayerOptions, IMars3dRuntime } from './rasterPlaneTypes';
|
|
3
|
+
export declare const createMars3dRasterPlaneLayer: (mars3d: IMars3dRuntime, options: IMars3dRasterPlaneLayerOptions) => IMars3dRasterPlaneLayer & IMars3dBaseLayerLike;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export interface ICesiumRectangleLike {
|
|
2
|
+
west: number;
|
|
3
|
+
south: number;
|
|
4
|
+
east: number;
|
|
5
|
+
north: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ICesiumTextureLike {
|
|
8
|
+
destroy(): void;
|
|
9
|
+
isDestroyed(): boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ICesiumMaterialLike {
|
|
12
|
+
uniforms: Record<string, unknown>;
|
|
13
|
+
update(context: ICesiumContextLike): void;
|
|
14
|
+
destroy(): void;
|
|
15
|
+
isDestroyed(): boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface ICesiumPrimitiveLike {
|
|
18
|
+
show: boolean;
|
|
19
|
+
destroy(): void;
|
|
20
|
+
isDestroyed(): boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface ICesiumPrimitiveCollectionLike {
|
|
23
|
+
add<T>(primitive: T): T;
|
|
24
|
+
remove(primitive: unknown): boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface ICesiumContextLike {
|
|
27
|
+
readonly _gl: WebGLRenderingContext | WebGL2RenderingContext;
|
|
28
|
+
}
|
|
29
|
+
export interface ICesiumSceneLike {
|
|
30
|
+
readonly canvas: HTMLCanvasElement;
|
|
31
|
+
readonly primitives: ICesiumPrimitiveCollectionLike;
|
|
32
|
+
readonly context?: ICesiumContextLike;
|
|
33
|
+
readonly _context?: ICesiumContextLike;
|
|
34
|
+
requestRender(): void;
|
|
35
|
+
}
|
|
36
|
+
export interface IMars3dMapLike {
|
|
37
|
+
readonly scene: ICesiumSceneLike;
|
|
38
|
+
}
|
|
39
|
+
export interface IMars3dBaseLayerLike {
|
|
40
|
+
readonly _map?: IMars3dMapLike;
|
|
41
|
+
readonly options: Record<string, unknown>;
|
|
42
|
+
show: boolean;
|
|
43
|
+
destroy(noDel?: boolean): void;
|
|
44
|
+
}
|
|
45
|
+
interface ICesiumTextureConstructorOptions {
|
|
46
|
+
context: ICesiumContextLike;
|
|
47
|
+
source: {
|
|
48
|
+
arrayBufferView: Float32Array<ArrayBufferLike>;
|
|
49
|
+
};
|
|
50
|
+
width: number;
|
|
51
|
+
height: number;
|
|
52
|
+
pixelFormat: number;
|
|
53
|
+
pixelDatatype: number;
|
|
54
|
+
sampler: unknown;
|
|
55
|
+
flipY: boolean;
|
|
56
|
+
}
|
|
57
|
+
interface ICesiumMaterialConstructor {
|
|
58
|
+
new (options: unknown): ICesiumMaterialLike;
|
|
59
|
+
readonly DefaultImageId: string;
|
|
60
|
+
}
|
|
61
|
+
export interface IMars3dCesiumRuntime {
|
|
62
|
+
readonly Math: {
|
|
63
|
+
toRadians(value: number): number;
|
|
64
|
+
};
|
|
65
|
+
readonly Rectangle: {
|
|
66
|
+
fromDegrees(west: number, south: number, east: number, north: number): ICesiumRectangleLike;
|
|
67
|
+
};
|
|
68
|
+
readonly RectangleGeometry: new (options: unknown) => unknown;
|
|
69
|
+
readonly GeometryInstance: new (options: unknown) => unknown;
|
|
70
|
+
readonly Material: ICesiumMaterialConstructor;
|
|
71
|
+
readonly EllipsoidSurfaceAppearance: {
|
|
72
|
+
new (options: unknown): unknown;
|
|
73
|
+
readonly VERTEX_FORMAT: unknown;
|
|
74
|
+
};
|
|
75
|
+
readonly Primitive: new (options: unknown) => ICesiumPrimitiveLike;
|
|
76
|
+
readonly Texture?: new (options: ICesiumTextureConstructorOptions) => ICesiumTextureLike;
|
|
77
|
+
readonly Sampler?: new (options: unknown) => unknown;
|
|
78
|
+
readonly PixelFormat?: {
|
|
79
|
+
readonly RED: number;
|
|
80
|
+
readonly RGBA: number;
|
|
81
|
+
};
|
|
82
|
+
readonly PixelDatatype?: {
|
|
83
|
+
readonly FLOAT: number;
|
|
84
|
+
};
|
|
85
|
+
readonly TextureMinificationFilter?: {
|
|
86
|
+
readonly NEAREST: number;
|
|
87
|
+
};
|
|
88
|
+
readonly TextureMagnificationFilter?: {
|
|
89
|
+
readonly NEAREST: number;
|
|
90
|
+
};
|
|
91
|
+
readonly TextureWrap?: {
|
|
92
|
+
readonly CLAMP_TO_EDGE: number;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RasterGrid } from '@meteo-render/raster';
|
|
2
|
+
import type { ICesiumMaterialLike, ICesiumPrimitiveLike, IMars3dCesiumRuntime } from './rasterPlaneCesiumTypes';
|
|
3
|
+
export declare const createRasterPlanePrimitive: (Cesium: IMars3dCesiumRuntime, grid: RasterGrid, height: number, material: ICesiumMaterialLike, show: boolean) => ICesiumPrimitiveLike;
|
|
4
|
+
export declare const gridBoundsEqual: (left: RasterGrid, right: RasterGrid) => boolean;
|
|
5
|
+
export declare const validateHeight: (height: number) => void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RasterGrid } from '@meteo-render/raster';
|
|
2
|
+
/** 按数据索引稳定分块,相邻分块共享边界样本以保持插值连续。 */
|
|
3
|
+
export declare const createRasterPlaneGridChunks: (grid: RasterGrid, maximumTextureSize: number) => RasterGrid[];
|
|
4
|
+
export declare const gridChunkLayoutEqual: (left: readonly RasterGrid[], right: readonly RasterGrid[]) => boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { RasterRenderState } from '@meteo-render/raster';
|
|
2
|
+
import type { RasterGrid } from '@meteo-render/raster';
|
|
3
|
+
import type { CesiumRasterTextureAdapter } from './cesiumRasterTextureAdapter';
|
|
4
|
+
import type { ICesiumMaterialLike, IMars3dCesiumRuntime } from './rasterPlaneCesiumTypes';
|
|
5
|
+
/** 管理 Cesium Material 使用的标量栅格纹理和色标纹理。 */
|
|
6
|
+
export declare class RasterPlaneMaterial {
|
|
7
|
+
readonly material: ICesiumMaterialLike;
|
|
8
|
+
readonly maximumTextureSize: number;
|
|
9
|
+
private readonly Cesium;
|
|
10
|
+
private readonly textureAdapter;
|
|
11
|
+
private destroyed;
|
|
12
|
+
constructor(Cesium: IMars3dCesiumRuntime, textureAdapter: CesiumRasterTextureAdapter, state: RasterRenderState, grid?: import("@meteo-render/rendering").GridData | null);
|
|
13
|
+
updateGrid(state: RasterRenderState, grid?: import("@meteo-render/rendering").GridData | null): void;
|
|
14
|
+
updateColorStops(state: RasterRenderState, grid?: RasterGrid | null): void;
|
|
15
|
+
updateUniforms(state: RasterRenderState, grid?: RasterGrid | null): void;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
private createTexture;
|
|
18
|
+
private replaceTexture;
|
|
19
|
+
private validateTextureSize;
|
|
20
|
+
private assertAlive;
|
|
21
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { RasterColorMode, RasterColorRange, RasterColorStopInput, RasterGrid, RasterSampleMode } from '@meteo-render/raster';
|
|
2
|
+
import type { IMars3dBaseLayerLike, IMars3dCesiumRuntime } from './rasterPlaneCesiumTypes';
|
|
3
|
+
export interface IMars3dRasterPlaneLayerOptions {
|
|
4
|
+
grid: RasterGrid;
|
|
5
|
+
height: number;
|
|
6
|
+
colorStops: RasterColorStopInput[];
|
|
7
|
+
colorRange?: RasterColorRange;
|
|
8
|
+
colorMode?: RasterColorMode;
|
|
9
|
+
sampleMode?: RasterSampleMode;
|
|
10
|
+
opacity?: number;
|
|
11
|
+
name?: string;
|
|
12
|
+
show?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface IMars3dRasterPlaneLayerUpdate {
|
|
15
|
+
grid?: RasterGrid;
|
|
16
|
+
height?: number;
|
|
17
|
+
colorStops?: RasterColorStopInput[];
|
|
18
|
+
colorRange?: RasterColorRange | null;
|
|
19
|
+
colorMode?: RasterColorMode;
|
|
20
|
+
sampleMode?: RasterSampleMode;
|
|
21
|
+
opacity?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface IMars3dRasterPlaneLayer {
|
|
24
|
+
readonly height: number;
|
|
25
|
+
update(options: IMars3dRasterPlaneLayerUpdate): void;
|
|
26
|
+
destroy(noDel?: boolean): void;
|
|
27
|
+
}
|
|
28
|
+
export interface IMars3dRuntime {
|
|
29
|
+
readonly Cesium: IMars3dCesiumRuntime;
|
|
30
|
+
readonly layer: {
|
|
31
|
+
readonly BaseLayer: new (options?: unknown) => IMars3dBaseLayerLike;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { WebgpuRasterTileRendererOptions } from '@meteo-render/raster';
|
|
2
|
+
export type CesiumRectangleLike = object;
|
|
3
|
+
export interface CesiumEventLike {
|
|
4
|
+
raiseEvent(...arguments_: unknown[]): void;
|
|
5
|
+
}
|
|
6
|
+
export interface CesiumGeographicTilingSchemeLike {
|
|
7
|
+
readonly rectangle: CesiumRectangleLike;
|
|
8
|
+
}
|
|
9
|
+
export interface CesiumRequestLike {
|
|
10
|
+
readonly cancelled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface CesiumRuntime {
|
|
13
|
+
readonly Event: new () => CesiumEventLike;
|
|
14
|
+
readonly GeographicTilingScheme: new (options?: {
|
|
15
|
+
ellipsoid?: unknown;
|
|
16
|
+
}) => CesiumGeographicTilingSchemeLike;
|
|
17
|
+
readonly Rectangle: {
|
|
18
|
+
fromDegrees(west: number, south: number, east: number, north: number): CesiumRectangleLike;
|
|
19
|
+
};
|
|
20
|
+
readonly Credit?: new (text: string) => unknown;
|
|
21
|
+
}
|
|
22
|
+
export interface Mars3dRasterImageryProviderOptions extends WebgpuRasterTileRendererOptions {
|
|
23
|
+
tileWidth?: number;
|
|
24
|
+
tileHeight?: number;
|
|
25
|
+
minimumLevel?: number;
|
|
26
|
+
maximumLevel?: number;
|
|
27
|
+
rectangle?: CesiumRectangleLike;
|
|
28
|
+
ellipsoid?: unknown;
|
|
29
|
+
credit?: string | unknown;
|
|
30
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type Mars3dWorldPoint = readonly [number, number, number];
|
|
2
|
+
export interface IMars3dProjectionCamera {
|
|
3
|
+
position: Mars3dWorldPoint;
|
|
4
|
+
direction: Mars3dWorldPoint;
|
|
5
|
+
up: Mars3dWorldPoint;
|
|
6
|
+
fovYRadians: number;
|
|
7
|
+
anchorDistance: number;
|
|
8
|
+
}
|
|
9
|
+
export interface IMars3dScreenPoint {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
}
|
|
13
|
+
export interface IMars3dCompensationFrame {
|
|
14
|
+
worldAnchors: readonly [Mars3dWorldPoint, Mars3dWorldPoint, Mars3dWorldPoint];
|
|
15
|
+
screenAnchors: readonly IMars3dScreenPoint[];
|
|
16
|
+
}
|
|
17
|
+
/** 在已提交相机前方创建稳定的视锥平面锚点。 */
|
|
18
|
+
export declare const createMars3dCompensationFrame: (camera: IMars3dProjectionCamera, width: number, height: number) => IMars3dCompensationFrame | null;
|
|
19
|
+
/** 把固定 ECEF 锚点投影到当前 Canvas 像素坐标。 */
|
|
20
|
+
export declare const projectMars3dCompensationAnchors: (camera: IMars3dProjectionCamera, anchors: readonly Mars3dWorldPoint[], width: number, height: number) => readonly IMars3dScreenPoint[] | null;
|
|
21
|
+
/** 计算把上一张已完成体积帧映射到当前地图帧的二维仿射变换。 */
|
|
22
|
+
export declare const createMars3dCanvasCompensationTransform: (displayed: readonly IMars3dScreenPoint[], current: readonly IMars3dScreenPoint[]) => string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const mars3dVolumeRaymarchSource: string;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { IMars3dVolumeBaseLayerLike, IMars3dVolumeLayer, IMars3dVolumeLayerOptions, IMars3dVolumeRuntime } from './volumeMars3dTypes';
|
|
2
|
+
export declare const createMars3dVolumeLayer: (mars3d: IMars3dVolumeRuntime, options: IMars3dVolumeLayerOptions) => IMars3dVolumeLayer & IMars3dVolumeBaseLayerLike;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { IVolumeRouteProfile } from '@meteo-render/volume';
|
|
2
|
+
import type { IVolumeSource } from '@meteo-render/volume';
|
|
3
|
+
import type { IVolumeLockedSlice, VolumeSliceAxis } from '@meteo-render/volume';
|
|
4
|
+
import type { IMars3dVolumeLayerOptions, IMars3dVolumeLayerUpdate, IMars3dVolumeMapLike } from './volumeMars3dTypes';
|
|
5
|
+
/** 在 Mars3D Canvas 上方管理透明 WebGPU 画布、Cesium 相机同步和体积场景生命周期。 */
|
|
6
|
+
export declare class Mars3dVolumeRenderer {
|
|
7
|
+
readonly readyPromise: Promise<void>;
|
|
8
|
+
private readonly map;
|
|
9
|
+
private readonly canvas;
|
|
10
|
+
private readonly onError;
|
|
11
|
+
private readonly cameraFrameCompensation;
|
|
12
|
+
private scene;
|
|
13
|
+
private source;
|
|
14
|
+
private layout;
|
|
15
|
+
private frameRequest;
|
|
16
|
+
private cameraEndTimer;
|
|
17
|
+
private framesRemaining;
|
|
18
|
+
private shown;
|
|
19
|
+
private destroyed;
|
|
20
|
+
private cameraMoving;
|
|
21
|
+
private cameraSignature;
|
|
22
|
+
private pendingCompensationFrame;
|
|
23
|
+
private displayedCompensationFrame;
|
|
24
|
+
constructor(map: IMars3dVolumeMapLike, options: IMars3dVolumeLayerOptions);
|
|
25
|
+
get statistics(): import("@meteo-render/volume").IVolumeSceneStatistics | null;
|
|
26
|
+
get lockedSlices(): readonly IVolumeLockedSlice[];
|
|
27
|
+
setShow(show: boolean): void;
|
|
28
|
+
update(options: IMars3dVolumeLayerUpdate): void;
|
|
29
|
+
setTimeIndex(timeIndex: number): void;
|
|
30
|
+
setRouteProfiles(profiles: readonly IVolumeRouteProfile[]): void;
|
|
31
|
+
updateSlice(id: string, position: number): void;
|
|
32
|
+
removeSlice(id: string): void;
|
|
33
|
+
clearLockedSlices(): void;
|
|
34
|
+
lockSlice(axis: VolumeSliceAxis, position: number): IVolumeLockedSlice;
|
|
35
|
+
setSource(source: IVolumeSource): void;
|
|
36
|
+
destroy(): void;
|
|
37
|
+
private finishCameraInteraction;
|
|
38
|
+
private readonly handlePreRender;
|
|
39
|
+
private readonly handleResize;
|
|
40
|
+
private initialize;
|
|
41
|
+
private syncCamera;
|
|
42
|
+
private bindFrameAvailableCallback;
|
|
43
|
+
private createProjectionCamera;
|
|
44
|
+
private createCurrentCompensationFrame;
|
|
45
|
+
private applyCameraFrameCompensation;
|
|
46
|
+
private clearCameraFrameCompensation;
|
|
47
|
+
private requestFrames;
|
|
48
|
+
private requestFramesImmediately;
|
|
49
|
+
private readonly renderFrame;
|
|
50
|
+
private createCanvas;
|
|
51
|
+
private createCameraSignature;
|
|
52
|
+
private scheduleCameraMoveEnd;
|
|
53
|
+
private beginCameraInteraction;
|
|
54
|
+
private requireScene;
|
|
55
|
+
private assertAlive;
|
|
56
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { IVolumeRouteProfile } from '@meteo-render/volume';
|
|
2
|
+
import type { IVolumeSource } from '@meteo-render/volume';
|
|
3
|
+
import type { IVolumeLockedSlice, VolumeSliceAxis } from '@meteo-render/volume';
|
|
4
|
+
import type { IVolumeChunkOptions, IVolumeSceneStatistics, IVolumeSceneUpdate, IVolumeSliceInteractionOptions, VolumeQualityPreset, VolumeRenderMode } from '@meteo-render/volume';
|
|
5
|
+
import type { IVolumeOpacityStop, VolumeColorMode, VolumeColorStopInput } from '@meteo-render/volume';
|
|
6
|
+
export interface IMars3dVolumeLayerOptions {
|
|
7
|
+
source: IVolumeSource;
|
|
8
|
+
colorStops: readonly VolumeColorStopInput[];
|
|
9
|
+
opacityStops: readonly IVolumeOpacityStop[];
|
|
10
|
+
timeIndex?: number;
|
|
11
|
+
mode?: VolumeRenderMode;
|
|
12
|
+
quality?: VolumeQualityPreset;
|
|
13
|
+
opacity?: number;
|
|
14
|
+
densityScale?: number;
|
|
15
|
+
verticalScale?: number;
|
|
16
|
+
colorMode?: VolumeColorMode;
|
|
17
|
+
pixelRatioCap?: number;
|
|
18
|
+
renderScale?: number;
|
|
19
|
+
interactionRenderScale?: number;
|
|
20
|
+
interactionStepScale?: number;
|
|
21
|
+
cameraFrameCompensation?: boolean;
|
|
22
|
+
chunk?: IVolumeChunkOptions;
|
|
23
|
+
sliceInteraction?: IVolumeSliceInteractionOptions;
|
|
24
|
+
name?: string;
|
|
25
|
+
show?: boolean;
|
|
26
|
+
onError?: (error: Error) => void;
|
|
27
|
+
}
|
|
28
|
+
export interface IMars3dVolumeLayerUpdate extends Pick<IVolumeSceneUpdate, 'mode' | 'quality' | 'opacity' | 'densityScale' | 'verticalScale' | 'colorStops' | 'opacityStops' | 'colorMode' | 'pixelRatioCap' | 'renderScale' | 'interactionRenderScale' | 'interactionStepScale'> {
|
|
29
|
+
}
|
|
30
|
+
export interface IMars3dVolumeLayer {
|
|
31
|
+
readonly readyPromise: Promise<void>;
|
|
32
|
+
readonly statistics: IVolumeSceneStatistics | null;
|
|
33
|
+
readonly lockedSlices: readonly IVolumeLockedSlice[];
|
|
34
|
+
update(options: IMars3dVolumeLayerUpdate): void;
|
|
35
|
+
setSource(source: IVolumeSource): void;
|
|
36
|
+
setTimeIndex(timeIndex: number): void;
|
|
37
|
+
setRouteProfiles(profiles: readonly IVolumeRouteProfile[]): void;
|
|
38
|
+
lockSlice(axis: VolumeSliceAxis, position: number): IVolumeLockedSlice;
|
|
39
|
+
updateSlice(id: string, position: number): void;
|
|
40
|
+
removeSlice(id: string): void;
|
|
41
|
+
clearLockedSlices(): void;
|
|
42
|
+
destroy(noDel?: boolean): void;
|
|
43
|
+
}
|
|
44
|
+
export interface ICesiumEventLike {
|
|
45
|
+
addEventListener(listener: () => void): void;
|
|
46
|
+
removeEventListener(listener: () => void): void;
|
|
47
|
+
}
|
|
48
|
+
export interface ICesiumCartesianLike {
|
|
49
|
+
readonly x: number;
|
|
50
|
+
readonly y: number;
|
|
51
|
+
readonly z: number;
|
|
52
|
+
}
|
|
53
|
+
export interface ICesiumCameraLike {
|
|
54
|
+
readonly positionWC: ICesiumCartesianLike;
|
|
55
|
+
readonly directionWC: ICesiumCartesianLike;
|
|
56
|
+
readonly upWC: ICesiumCartesianLike;
|
|
57
|
+
readonly positionCartographic: {
|
|
58
|
+
readonly height: number;
|
|
59
|
+
};
|
|
60
|
+
readonly frustum: {
|
|
61
|
+
readonly fovy?: number;
|
|
62
|
+
readonly fov?: number;
|
|
63
|
+
readonly near: number;
|
|
64
|
+
readonly far: number;
|
|
65
|
+
};
|
|
66
|
+
readonly changed: ICesiumEventLike;
|
|
67
|
+
}
|
|
68
|
+
export interface ICesiumVolumeSceneLike {
|
|
69
|
+
readonly canvas: HTMLCanvasElement;
|
|
70
|
+
readonly camera: ICesiumCameraLike;
|
|
71
|
+
readonly preRender: ICesiumEventLike;
|
|
72
|
+
}
|
|
73
|
+
export interface IMars3dVolumeMapLike {
|
|
74
|
+
readonly scene: ICesiumVolumeSceneLike;
|
|
75
|
+
}
|
|
76
|
+
export interface IMars3dVolumeBaseLayerLike {
|
|
77
|
+
readonly _map?: IMars3dVolumeMapLike;
|
|
78
|
+
show: boolean;
|
|
79
|
+
destroy(noDel?: boolean): void;
|
|
80
|
+
}
|
|
81
|
+
export interface IMars3dVolumeRuntime {
|
|
82
|
+
readonly layer: {
|
|
83
|
+
readonly BaseLayer: new (options?: unknown) => IMars3dVolumeBaseLayerLike;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createMars3dNativeVolumeLayer } from './mars3dNativeVolumeLayer';
|
|
2
|
+
export { createMars3dNativeSliceVolumeLayer } from './mars3dNativeSliceLayer';
|
|
3
|
+
export { createNativeAxisSliceImage, createNativeSliceAtlas, createNativeSliceAtlasLayout, nativeAxisPositionToIndex } from './nativeSliceAtlas';
|
|
4
|
+
export type { IMars3dNativeSliceVolumeLayer, IMars3dNativeVolumeLayer, IMars3dNativeVolumeLayerOptions, IMars3dNativeVolumeLayerUpdate, IMars3dNativeRuntime, ICesiumNativeRuntime, INativeVolumeStatistics } from './nativeTypes';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class LiveUpdateScheduler {
|
|
2
|
+
private readonly callback;
|
|
3
|
+
private readonly intervalMilliseconds;
|
|
4
|
+
private timer;
|
|
5
|
+
private lastRunAt;
|
|
6
|
+
constructor(callback: () => void, intervalMilliseconds: number);
|
|
7
|
+
schedule(): void;
|
|
8
|
+
cancel(): void;
|
|
9
|
+
private run;
|
|
10
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { ICesiumNativeRuntime, IMars3dNativeBaseLayerLike, IMars3dNativeRuntime, IMars3dNativeSliceVolumeLayer, IMars3dNativeVolumeLayerOptions } from './nativeTypes';
|
|
2
|
+
export declare const createMars3dNativeSliceVolumeLayer: (mars3d: IMars3dNativeRuntime, cesium: ICesiumNativeRuntime, options: IMars3dNativeVolumeLayerOptions) => IMars3dNativeSliceVolumeLayer & IMars3dNativeBaseLayerLike;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { IVolumeSource } from '@meteo-render/volume';
|
|
2
|
+
import type { IVolumeLockedSlice, VolumeSliceAxis } from '@meteo-render/volume';
|
|
3
|
+
import type { INativeSliceCesiumRuntime } from './nativeSliceRuntimeTypes';
|
|
4
|
+
import type { IMars3dNativeMapLike, IMars3dNativeVolumeLayerOptions, IMars3dNativeVolumeLayerUpdate, INativeVolumeStatistics } from './nativeTypes';
|
|
5
|
+
export declare class Mars3dNativeSliceRenderer {
|
|
6
|
+
readonly readyPromise: Promise<void>;
|
|
7
|
+
private readonly map;
|
|
8
|
+
private readonly cesium;
|
|
9
|
+
private readonly onError;
|
|
10
|
+
private readonly axisRenderer;
|
|
11
|
+
private readonly geometryRebuildScheduler;
|
|
12
|
+
private readonly sliceState;
|
|
13
|
+
private readonly unsubscribeSlices;
|
|
14
|
+
private primitive;
|
|
15
|
+
private pendingPrimitive;
|
|
16
|
+
private pendingSwapCleanup;
|
|
17
|
+
private material;
|
|
18
|
+
private source;
|
|
19
|
+
private timeIndex;
|
|
20
|
+
private quality;
|
|
21
|
+
private opacity;
|
|
22
|
+
private densityScale;
|
|
23
|
+
private verticalScale;
|
|
24
|
+
private colorStops;
|
|
25
|
+
private opacityStops;
|
|
26
|
+
private colorMode;
|
|
27
|
+
private shown;
|
|
28
|
+
private destroyed;
|
|
29
|
+
private loadController;
|
|
30
|
+
private atlasCanvas;
|
|
31
|
+
private atlasLayers;
|
|
32
|
+
private nativeData;
|
|
33
|
+
constructor(map: IMars3dNativeMapLike, cesium: INativeSliceCesiumRuntime, options: IMars3dNativeVolumeLayerOptions);
|
|
34
|
+
get statistics(): INativeVolumeStatistics | null;
|
|
35
|
+
get lockedSlices(): readonly IVolumeLockedSlice[];
|
|
36
|
+
lockSlice(axis: VolumeSliceAxis, position: number): IVolumeLockedSlice;
|
|
37
|
+
updateSlice(id: string, position: number): void;
|
|
38
|
+
removeSlice(id: string): void;
|
|
39
|
+
clearLockedSlices(): void;
|
|
40
|
+
setShow(show: boolean): void;
|
|
41
|
+
update(options: IMars3dNativeVolumeLayerUpdate): void;
|
|
42
|
+
setSource(source: IVolumeSource): Promise<void>;
|
|
43
|
+
setTimeIndex(timeIndex: number): Promise<void>;
|
|
44
|
+
destroy(): void;
|
|
45
|
+
private rebuildAtlasAndPrimitive;
|
|
46
|
+
private replacePrimitive;
|
|
47
|
+
private createRectangle;
|
|
48
|
+
private getLayerTextureBounds;
|
|
49
|
+
private getLayerHeight;
|
|
50
|
+
private createMaterialColor;
|
|
51
|
+
private updateMaterialOpacity;
|
|
52
|
+
private scheduleGeometryRebuild;
|
|
53
|
+
private syncAxisSlices;
|
|
54
|
+
private cancelPendingSwap;
|
|
55
|
+
private assertAlive;
|
|
56
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { ICesiumNativeRuntime, IMars3dNativeBaseLayerLike, IMars3dNativeRuntime, IMars3dNativeVolumeLayer, IMars3dNativeVolumeLayerOptions } from './nativeTypes';
|
|
2
|
+
export declare const createMars3dNativeVolumeLayer: (mars3d: IMars3dNativeRuntime, cesium: ICesiumNativeRuntime, options: IMars3dNativeVolumeLayerOptions) => IMars3dNativeVolumeLayer & IMars3dNativeBaseLayerLike;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { IVolumeSource } from '@meteo-render/volume';
|
|
2
|
+
import type { ICesiumNativeRuntime, IMars3dNativeMapLike, IMars3dNativeVolumeLayerOptions, IMars3dNativeVolumeLayerUpdate, INativeVolumeStatistics } from './nativeTypes';
|
|
3
|
+
export declare class Mars3dNativeVolumeRenderer {
|
|
4
|
+
readonly readyPromise: Promise<void>;
|
|
5
|
+
private readonly map;
|
|
6
|
+
private readonly cesium;
|
|
7
|
+
private readonly onError;
|
|
8
|
+
private primitive;
|
|
9
|
+
private source;
|
|
10
|
+
private timeIndex;
|
|
11
|
+
private quality;
|
|
12
|
+
private opacity;
|
|
13
|
+
private densityScale;
|
|
14
|
+
private verticalScale;
|
|
15
|
+
private colorStops;
|
|
16
|
+
private opacityStops;
|
|
17
|
+
private colorMode;
|
|
18
|
+
private shown;
|
|
19
|
+
private destroyed;
|
|
20
|
+
private loadController;
|
|
21
|
+
constructor(map: IMars3dNativeMapLike, cesium: ICesiumNativeRuntime, options: IMars3dNativeVolumeLayerOptions);
|
|
22
|
+
get statistics(): INativeVolumeStatistics | null;
|
|
23
|
+
setShow(show: boolean): void;
|
|
24
|
+
update(options: IMars3dNativeVolumeLayerUpdate): void;
|
|
25
|
+
setSource(source: IVolumeSource): Promise<void>;
|
|
26
|
+
setTimeIndex(timeIndex: number): Promise<void>;
|
|
27
|
+
destroy(): void;
|
|
28
|
+
private replacePrimitive;
|
|
29
|
+
private createCustomShader;
|
|
30
|
+
private replaceCustomShader;
|
|
31
|
+
private updateShaderUniforms;
|
|
32
|
+
private updateBounds;
|
|
33
|
+
private assertAlive;
|
|
34
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { IVolumeSource } from '@meteo-render/volume';
|
|
2
|
+
import type { IVolumeLockedSlice } from '@meteo-render/volume';
|
|
3
|
+
import type { IVolumeOpacityStop, VolumeColorMode, VolumeColorStopInput } from '@meteo-render/volume';
|
|
4
|
+
import type { INativeSliceCesiumRuntime } from './nativeSliceRuntimeTypes';
|
|
5
|
+
import type { IMars3dNativeMapLike } from './nativeTypes';
|
|
6
|
+
import type { INativeVoxelData } from './voxelData';
|
|
7
|
+
interface INativeAxisSliceRenderState {
|
|
8
|
+
slices: readonly IVolumeLockedSlice[];
|
|
9
|
+
source: IVolumeSource;
|
|
10
|
+
data: INativeVoxelData;
|
|
11
|
+
colorStops: readonly VolumeColorStopInput[];
|
|
12
|
+
opacityStops: readonly IVolumeOpacityStop[];
|
|
13
|
+
colorMode: VolumeColorMode;
|
|
14
|
+
verticalScale: number;
|
|
15
|
+
}
|
|
16
|
+
export declare class NativeAxisSliceRenderer {
|
|
17
|
+
private readonly map;
|
|
18
|
+
private readonly cesium;
|
|
19
|
+
private readonly entries;
|
|
20
|
+
private readonly pending;
|
|
21
|
+
private readonly dirtySliceIds;
|
|
22
|
+
private readonly rebuildScheduler;
|
|
23
|
+
private state;
|
|
24
|
+
private shown;
|
|
25
|
+
private destroyed;
|
|
26
|
+
constructor(map: IMars3dNativeMapLike, cesium: INativeSliceCesiumRuntime);
|
|
27
|
+
sync(state: INativeAxisSliceRenderState, immediate?: boolean): void;
|
|
28
|
+
setShow(show: boolean): void;
|
|
29
|
+
destroy(): void;
|
|
30
|
+
private rebuild;
|
|
31
|
+
private replace;
|
|
32
|
+
private createAltitudeGeometry;
|
|
33
|
+
private createWallGeometry;
|
|
34
|
+
private getAxis;
|
|
35
|
+
private createColor;
|
|
36
|
+
private createRenderState;
|
|
37
|
+
private removePending;
|
|
38
|
+
private remove;
|
|
39
|
+
}
|
|
40
|
+
export {};
|