@metagl/sdk-render 1.0.7 → 1.0.9
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/README.md +13 -0
- package/README_EN.md +13 -0
- package/amd/lacdt.render.amd.js +53 -50
- package/cjs/lacdt.render.cjs.js +53 -50
- package/cjs/lacdt.render.d.ts +504 -95
- package/esm/lacdt.render.d.ts +504 -95
- package/esm/lacdt.render.js +53 -51
- package/lacdt.render.d.ts +504 -95
- package/lacdt.render.js +53 -50
- package/package.json +1 -1
package/esm/lacdt.render.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Cesium from 'cesium';
|
|
2
|
-
import { Cartesian3, Color, Viewer, PostProcessStage, Cartesian4, Rectangle, Cesium3DTileset, ClippingPolygonCollection } from 'cesium';
|
|
2
|
+
import { Cartesian3, Color, Viewer, PostProcessStage, Cartesian4, Rectangle, Primitive, Cesium3DTileset, ClippingPolygonCollection } from 'cesium';
|
|
3
3
|
import { Render as Render$1 } from '@/system/RenderCore';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -104,6 +104,15 @@ declare class LightingSystem implements RenderSystem {
|
|
|
104
104
|
destroy(): void;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
/**
|
|
108
|
+
* 检测 Viewer 运行环境
|
|
109
|
+
*
|
|
110
|
+
* 判断依据:DC V5.0.0 移除了原生 cesiumWidget,改为自身的 widgetContainer。
|
|
111
|
+
* 保留 cesiumWidget → 'cesium'(原生或其他兼容封装)
|
|
112
|
+
* 缺少 cesiumWidget → 'dc'(DC.Viewer 或同类框架)
|
|
113
|
+
*/
|
|
114
|
+
type ViewerEnv = 'cesium' | 'dc';
|
|
115
|
+
|
|
107
116
|
/**
|
|
108
117
|
* 阴影系统配置
|
|
109
118
|
*/
|
|
@@ -128,6 +137,9 @@ declare class ShadowSystem implements RenderSystem {
|
|
|
128
137
|
private config;
|
|
129
138
|
private isEnabled;
|
|
130
139
|
private originalSettings?;
|
|
140
|
+
private viewerEnv;
|
|
141
|
+
private shadowFrameListener?;
|
|
142
|
+
private originalGlobeShadows?;
|
|
131
143
|
/**
|
|
132
144
|
* 默认配置 - 从 EnvironmentDefaults 统一管理
|
|
133
145
|
*/
|
|
@@ -137,7 +149,7 @@ declare class ShadowSystem implements RenderSystem {
|
|
|
137
149
|
* @param viewer - Cesium Viewer 实例
|
|
138
150
|
* @param config - 阴影系统配置
|
|
139
151
|
*/
|
|
140
|
-
constructor(viewer: Viewer, config?: ShadowConfig);
|
|
152
|
+
constructor(viewer: Viewer, config?: ShadowConfig, viewerEnv?: ViewerEnv);
|
|
141
153
|
/**
|
|
142
154
|
* 初始化
|
|
143
155
|
*/
|
|
@@ -150,6 +162,26 @@ declare class ShadowSystem implements RenderSystem {
|
|
|
150
162
|
* 启用阴影系统
|
|
151
163
|
*/
|
|
152
164
|
enable(): void;
|
|
165
|
+
/**
|
|
166
|
+
* DC 环境专用启用逻辑
|
|
167
|
+
*
|
|
168
|
+
* 问题根因:DC 初始化时 globe.shadows = RECEIVE_ONLY(地形接收阴影)。
|
|
169
|
+
* DC 环境下阴影相机视锥投影计算异常,深度比较全部失效,
|
|
170
|
+
* 导致视锥覆盖的整片地形全部变黑(图二中的巨型黑色矩形)。
|
|
171
|
+
*
|
|
172
|
+
* 修复:禁用地形阴影接收(globe.shadows = DISABLED),地形不参与阴影系统。
|
|
173
|
+
* 3D tileset 阴影独立配置(tileset.shadows),不受影响。
|
|
174
|
+
*/
|
|
175
|
+
private enableDCMode;
|
|
176
|
+
/**
|
|
177
|
+
* DC 环境专用:保持 needsUpdate,确保 tileset 阴影每帧正常更新
|
|
178
|
+
* 不覆盖 _outOfView:Cesium 的高度/太阳角物理判断必须保留
|
|
179
|
+
*/
|
|
180
|
+
private registerDCWorkaround;
|
|
181
|
+
/**
|
|
182
|
+
* 移除 DC 监听器(disable / destroy 时调用)
|
|
183
|
+
*/
|
|
184
|
+
private removeDCWorkaround;
|
|
153
185
|
/**
|
|
154
186
|
* 禁用阴影系统
|
|
155
187
|
*/
|
|
@@ -326,7 +358,9 @@ declare class AtmosphereScatteringSystem implements RenderSystem {
|
|
|
326
358
|
private config;
|
|
327
359
|
private isEnabled;
|
|
328
360
|
private stage?;
|
|
329
|
-
private
|
|
361
|
+
private defaultShowGroundAtmosphere;
|
|
362
|
+
private defaultSkyBrightnessShift;
|
|
363
|
+
private skyAtmosphereListener?;
|
|
330
364
|
/** 大气 Stage 添加到 postProcessStages 后触发,供外部(RenderCore)做顺序修正 */
|
|
331
365
|
onInitialized?: () => void;
|
|
332
366
|
/**
|
|
@@ -338,6 +372,13 @@ declare class AtmosphereScatteringSystem implements RenderSystem {
|
|
|
338
372
|
* 动态计算基于相机位置的椭球体半径,考虑纬度影响
|
|
339
373
|
*/
|
|
340
374
|
private getRealPlanetRadius;
|
|
375
|
+
/**
|
|
376
|
+
* 根据相机高度动态调节 skyAtmosphere.brightnessShift
|
|
377
|
+
* 低空(< 100km,卡门线以下):-1.0(完全暗淡),自定义大气主导,城市/宏观城市无光晕圈
|
|
378
|
+
* 100km → 500km :线性从 -1.0 → 0.0 平滑过渡(进入轨道空间)
|
|
379
|
+
* 高空(> 500km) :0.0(正常亮度),Cesium 内置光晕完全接管
|
|
380
|
+
*/
|
|
381
|
+
private updateSkyAtmosphereIntensity;
|
|
341
382
|
/**
|
|
342
383
|
* 构造函数
|
|
343
384
|
*/
|
|
@@ -942,148 +983,252 @@ declare class CameraListenerSystem {
|
|
|
942
983
|
}
|
|
943
984
|
|
|
944
985
|
/**
|
|
945
|
-
*
|
|
986
|
+
* 水体配置接口
|
|
946
987
|
*/
|
|
947
988
|
interface WaterConfig {
|
|
948
|
-
/**
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
989
|
+
/** 水体基础颜色 RGBA */
|
|
990
|
+
baseWaterColor?: {
|
|
991
|
+
r: number;
|
|
992
|
+
g: number;
|
|
993
|
+
b: number;
|
|
994
|
+
a: number;
|
|
995
|
+
};
|
|
996
|
+
/** 波纹频率 */
|
|
997
|
+
frequency?: number;
|
|
998
|
+
/** 动画速度 */
|
|
999
|
+
animationSpeed?: number;
|
|
1000
|
+
/** 振幅 */
|
|
1001
|
+
amplitude?: number;
|
|
1002
|
+
/** 高光强度 */
|
|
1003
|
+
specularIntensity?: number;
|
|
1004
|
+
/** 法线贴图路径 */
|
|
1005
|
+
normalMap?: string;
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* 水体加载进度
|
|
1009
|
+
*/
|
|
1010
|
+
interface WaterLoadProgress {
|
|
1011
|
+
/** 总实体数 */
|
|
1012
|
+
total: number;
|
|
1013
|
+
/** 已加载数 */
|
|
1014
|
+
loaded: number;
|
|
1015
|
+
/** 百分比 */
|
|
1016
|
+
percentage: number;
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* 水体加载选项
|
|
1020
|
+
*/
|
|
1021
|
+
interface WaterLoadOptions {
|
|
1022
|
+
/** 每批处理数量,默认 10 */
|
|
1023
|
+
batchSize?: number;
|
|
1024
|
+
/** 进度回调 */
|
|
1025
|
+
onProgress?: (progress: WaterLoadProgress) => void;
|
|
1026
|
+
/** 取消信号 */
|
|
1027
|
+
signal?: AbortSignal;
|
|
970
1028
|
}
|
|
1029
|
+
/**
|
|
1030
|
+
* 水体加载状态
|
|
1031
|
+
*/
|
|
1032
|
+
interface WaterLoadState {
|
|
1033
|
+
/** 是否正在加载 */
|
|
1034
|
+
isLoading: boolean;
|
|
1035
|
+
/** 当前加载的图层ID */
|
|
1036
|
+
currentLayer?: string;
|
|
1037
|
+
/** 加载进度 */
|
|
1038
|
+
progress?: WaterLoadProgress;
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* 水体图层项
|
|
1042
|
+
*/
|
|
1043
|
+
interface WaterLayerItem {
|
|
1044
|
+
id: string;
|
|
1045
|
+
name: string;
|
|
1046
|
+
url?: string;
|
|
1047
|
+
source?: 'url' | 'file';
|
|
1048
|
+
primitive: any;
|
|
1049
|
+
visible: boolean;
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
* 水体系统类
|
|
1053
|
+
* 负责管理场景中的水体效果,支持 GeoJSON 数据加载
|
|
1054
|
+
*/
|
|
1055
|
+
/**
|
|
1056
|
+
* 水体事件类型
|
|
1057
|
+
*/
|
|
1058
|
+
type WaterEventType = 'waterLayer:add' | 'waterLayer:remove' | 'waterLayer:visible';
|
|
971
1059
|
/**
|
|
972
1060
|
* 水体系统类
|
|
973
|
-
*
|
|
1061
|
+
* 负责管理场景中的水体效果,支持 GeoJSON 数据加载
|
|
974
1062
|
*/
|
|
975
1063
|
declare class WaterSystem implements RenderSystem {
|
|
976
1064
|
private viewer;
|
|
977
1065
|
private config;
|
|
978
|
-
private
|
|
979
|
-
private
|
|
980
|
-
private
|
|
981
|
-
|
|
982
|
-
private
|
|
983
|
-
|
|
984
|
-
private
|
|
985
|
-
|
|
1066
|
+
private waterLayers;
|
|
1067
|
+
private enabled;
|
|
1068
|
+
private eventListeners;
|
|
1069
|
+
/** 共享材质实例 */
|
|
1070
|
+
private _sharedWaterMaterial;
|
|
1071
|
+
/** 地形高度是否已初始化 */
|
|
1072
|
+
private _terrainHeightsReady;
|
|
1073
|
+
/** 地形高度初始化 Promise */
|
|
1074
|
+
private _terrainHeightsPromise;
|
|
1075
|
+
/** 加载状态 */
|
|
1076
|
+
private _loadState;
|
|
1077
|
+
/** 取消控制器 */
|
|
1078
|
+
private _abortController;
|
|
986
1079
|
constructor(viewer: Viewer, config?: WaterConfig);
|
|
987
1080
|
/**
|
|
988
|
-
*
|
|
1081
|
+
* 初始化事件系统
|
|
1082
|
+
*/
|
|
1083
|
+
private initializeEvents;
|
|
1084
|
+
/**
|
|
1085
|
+
* 添加事件监听
|
|
1086
|
+
*/
|
|
1087
|
+
on(event: WaterEventType, callback: (layer?: WaterLayerItem, data?: any) => void): void;
|
|
1088
|
+
/**
|
|
1089
|
+
* 移除事件监听
|
|
1090
|
+
*/
|
|
1091
|
+
off(event: WaterEventType, callback: Function): void;
|
|
1092
|
+
/**
|
|
1093
|
+
* 触发事件
|
|
1094
|
+
*/
|
|
1095
|
+
private emitEvent;
|
|
1096
|
+
/**
|
|
1097
|
+
* 初始化系统
|
|
989
1098
|
*/
|
|
990
1099
|
initialize(): void;
|
|
991
1100
|
/**
|
|
992
|
-
*
|
|
1101
|
+
* 启用系统(不自动创建水面,水面通过 loadWaterFromUrl/loadWaterFromFile 添加)
|
|
1102
|
+
* 水图层始终使用贴地模式
|
|
1103
|
+
*
|
|
1104
|
+
* 优化:地形高度初始化改为后台异步执行,enable() 立即返回
|
|
993
1105
|
*/
|
|
994
|
-
|
|
1106
|
+
enable(): Promise<void>;
|
|
995
1107
|
/**
|
|
996
|
-
*
|
|
1108
|
+
* 异步初始化地形高度数据
|
|
1109
|
+
* 在后台执行,不阻塞主线程
|
|
997
1110
|
*/
|
|
998
|
-
private
|
|
1111
|
+
private initializeTerrainHeightsAsync;
|
|
999
1112
|
/**
|
|
1000
|
-
*
|
|
1113
|
+
* 等待地形初始化完成
|
|
1114
|
+
* 在加载水图层前调用,确保地形数据已准备好
|
|
1001
1115
|
*/
|
|
1002
|
-
|
|
1116
|
+
waitForTerrainReady(): Promise<void>;
|
|
1003
1117
|
/**
|
|
1004
|
-
*
|
|
1118
|
+
* 检查地形是否已初始化
|
|
1005
1119
|
*/
|
|
1006
|
-
|
|
1120
|
+
isTerrainReady(): boolean;
|
|
1007
1121
|
/**
|
|
1008
|
-
*
|
|
1122
|
+
* 禁用系统
|
|
1009
1123
|
*/
|
|
1010
|
-
|
|
1124
|
+
disable(): void;
|
|
1011
1125
|
/**
|
|
1012
|
-
*
|
|
1126
|
+
* 更新配置(更新所有已加载水图层的外观参数)
|
|
1013
1127
|
*/
|
|
1014
|
-
|
|
1128
|
+
update(config: Partial<WaterConfig>): void;
|
|
1015
1129
|
/**
|
|
1016
|
-
*
|
|
1130
|
+
* 实时更新水图层效果(无需重新加载)
|
|
1131
|
+
* 直接修改已存在水图元的材质参数
|
|
1017
1132
|
*/
|
|
1018
|
-
|
|
1133
|
+
updateWaterLayerEffect(config: Partial<WaterConfig>): void;
|
|
1019
1134
|
/**
|
|
1020
|
-
*
|
|
1135
|
+
* 获取系统状态
|
|
1021
1136
|
*/
|
|
1022
|
-
|
|
1137
|
+
getStatus(): boolean;
|
|
1023
1138
|
/**
|
|
1024
|
-
*
|
|
1139
|
+
* 获取当前配置
|
|
1025
1140
|
*/
|
|
1026
|
-
|
|
1141
|
+
getConfig(): WaterConfig;
|
|
1027
1142
|
/**
|
|
1028
|
-
*
|
|
1143
|
+
* 从 URL 加载水体数据(优化版本,支持进度回调)
|
|
1144
|
+
* @param url GeoJSON 数据地址
|
|
1145
|
+
* @param name 水图层名称
|
|
1146
|
+
* @param options 加载选项(包含进度回调)
|
|
1147
|
+
* @returns 水图层ID
|
|
1029
1148
|
*/
|
|
1030
|
-
|
|
1149
|
+
loadWaterFromUrl(url: string, name?: string, options?: WaterLoadOptions): Promise<string>;
|
|
1031
1150
|
/**
|
|
1032
|
-
*
|
|
1151
|
+
* 从文件加载水体数据(优化版本,支持进度回调)
|
|
1152
|
+
* @param file GeoJSON 文件
|
|
1153
|
+
* @param name 水图层名称
|
|
1154
|
+
* @param options 加载选项(包含进度回调)
|
|
1155
|
+
* @returns 水图层ID
|
|
1033
1156
|
*/
|
|
1034
|
-
|
|
1157
|
+
loadWaterFromFile(file: File, name?: string, options?: WaterLoadOptions): Promise<string>;
|
|
1035
1158
|
/**
|
|
1036
|
-
*
|
|
1159
|
+
* 异步分批创建水体图元
|
|
1160
|
+
* 使用 requestIdleCallback 分批处理,避免阻塞主线程
|
|
1037
1161
|
*/
|
|
1038
|
-
private
|
|
1162
|
+
private createWaterPrimitivesAsync;
|
|
1039
1163
|
/**
|
|
1040
|
-
*
|
|
1164
|
+
* 从 GeoJSON 数据源创建水体图元(同步版本,保留向后兼容)
|
|
1165
|
+
* @deprecated 建议使用 createWaterPrimitivesAsync 异步版本
|
|
1041
1166
|
*/
|
|
1042
|
-
private
|
|
1167
|
+
private createWaterPrimitivesFromDataSource;
|
|
1043
1168
|
/**
|
|
1044
|
-
*
|
|
1169
|
+
* 获取或创建共享材质实例
|
|
1045
1170
|
*/
|
|
1046
|
-
|
|
1047
|
-
private stopAllAnimations;
|
|
1048
|
-
private removeAllWaterPrimitives;
|
|
1049
|
-
private isWaterPrimitive;
|
|
1050
|
-
private clearAllReferences;
|
|
1051
|
-
private triggerGarbageCollection;
|
|
1052
|
-
private verifyShutdown;
|
|
1171
|
+
private getOrCreateSharedMaterial;
|
|
1053
1172
|
/**
|
|
1054
|
-
*
|
|
1173
|
+
* 使用共享材质创建水体图元
|
|
1055
1174
|
*/
|
|
1056
|
-
|
|
1175
|
+
private createWaterPrimitiveWithSharedMaterial;
|
|
1057
1176
|
/**
|
|
1058
|
-
*
|
|
1177
|
+
* 创建水体图元(保留向后兼容)
|
|
1178
|
+
* @deprecated 建议使用 createWaterPrimitiveWithSharedMaterial
|
|
1059
1179
|
*/
|
|
1060
|
-
private
|
|
1180
|
+
private createWaterPrimitive;
|
|
1061
1181
|
/**
|
|
1062
|
-
*
|
|
1182
|
+
* 创建图元集合
|
|
1063
1183
|
*/
|
|
1064
|
-
|
|
1184
|
+
private createPrimitiveCollection;
|
|
1065
1185
|
/**
|
|
1066
|
-
*
|
|
1186
|
+
* 让出主线程的工具方法
|
|
1187
|
+
* 使用 requestIdleCallback 或 setTimeout 作为 fallback
|
|
1067
1188
|
*/
|
|
1068
|
-
|
|
1189
|
+
private yieldToMain;
|
|
1069
1190
|
/**
|
|
1070
|
-
*
|
|
1191
|
+
* 获取加载状态
|
|
1071
1192
|
*/
|
|
1072
|
-
|
|
1193
|
+
getLoadState(): WaterLoadState;
|
|
1073
1194
|
/**
|
|
1074
|
-
*
|
|
1195
|
+
* 取消当前加载
|
|
1075
1196
|
*/
|
|
1076
|
-
|
|
1197
|
+
cancelLoad(): void;
|
|
1198
|
+
/**
|
|
1199
|
+
* 创建取消控制器
|
|
1200
|
+
*/
|
|
1201
|
+
createAbortController(): AbortController;
|
|
1202
|
+
/**
|
|
1203
|
+
* 更新加载状态
|
|
1204
|
+
*/
|
|
1205
|
+
private updateLoadState;
|
|
1206
|
+
/**
|
|
1207
|
+
* 移除指定水图层
|
|
1208
|
+
*/
|
|
1209
|
+
removeWaterLayer(layerId: string): boolean;
|
|
1210
|
+
/**
|
|
1211
|
+
* 清除所有用户添加的水图层
|
|
1212
|
+
*/
|
|
1213
|
+
clearAllWaterLayers(): void;
|
|
1077
1214
|
/**
|
|
1078
|
-
*
|
|
1215
|
+
* 获取所有水图层
|
|
1079
1216
|
*/
|
|
1080
|
-
|
|
1217
|
+
getWaterLayers(): WaterLayerItem[];
|
|
1081
1218
|
/**
|
|
1082
|
-
*
|
|
1219
|
+
* 获取指定水图层
|
|
1083
1220
|
*/
|
|
1084
|
-
|
|
1221
|
+
getWaterLayer(layerId: string): WaterLayerItem | undefined;
|
|
1085
1222
|
/**
|
|
1086
|
-
*
|
|
1223
|
+
* 设置水图层可见性
|
|
1224
|
+
*/
|
|
1225
|
+
setWaterLayerVisible(layerId: string, visible: boolean): boolean;
|
|
1226
|
+
/**
|
|
1227
|
+
* 生成唯一ID
|
|
1228
|
+
*/
|
|
1229
|
+
private generateId;
|
|
1230
|
+
/**
|
|
1231
|
+
* 销毁系统
|
|
1087
1232
|
*/
|
|
1088
1233
|
destroy(): void;
|
|
1089
1234
|
}
|
|
@@ -1138,6 +1283,8 @@ declare class LayerSystem implements RenderSystem {
|
|
|
1138
1283
|
private layers;
|
|
1139
1284
|
private entities;
|
|
1140
1285
|
private eventListeners;
|
|
1286
|
+
private savedTerrainProvider;
|
|
1287
|
+
private defaultTerrainProvider;
|
|
1141
1288
|
constructor(render: Render);
|
|
1142
1289
|
initialize(): void;
|
|
1143
1290
|
enable(): void;
|
|
@@ -1148,6 +1295,7 @@ declare class LayerSystem implements RenderSystem {
|
|
|
1148
1295
|
saveConfig?(): void;
|
|
1149
1296
|
/**
|
|
1150
1297
|
* 加载地球已有的图层
|
|
1298
|
+
* 预设四个固定图层:影像地图、影像注记、矢量地图、高程
|
|
1151
1299
|
*/
|
|
1152
1300
|
loadExistingLayers(): void;
|
|
1153
1301
|
/**
|
|
@@ -1158,6 +1306,11 @@ declare class LayerSystem implements RenderSystem {
|
|
|
1158
1306
|
* 递归加载子实体
|
|
1159
1307
|
*/
|
|
1160
1308
|
private loadChildEntities;
|
|
1309
|
+
/**
|
|
1310
|
+
* 异步加载高程图层
|
|
1311
|
+
* @param layer 高程图层配置
|
|
1312
|
+
*/
|
|
1313
|
+
private loadTerrainLayer;
|
|
1161
1314
|
/**
|
|
1162
1315
|
* 获取所有实体和图元对象
|
|
1163
1316
|
*/
|
|
@@ -1236,8 +1389,21 @@ declare class LayerSystem implements RenderSystem {
|
|
|
1236
1389
|
private removeFromCesium;
|
|
1237
1390
|
/**
|
|
1238
1391
|
* 设置图层可见性
|
|
1392
|
+
* 支持底图互斥:当勾选矢量地图时,自动取消勾选影像地图和影像注记,反之亦然
|
|
1393
|
+
* 支持高程图层可见性切换
|
|
1239
1394
|
*/
|
|
1240
1395
|
setLayerVisible(layerId: string, visible: boolean): boolean;
|
|
1396
|
+
/**
|
|
1397
|
+
* 设置高程图层可见性
|
|
1398
|
+
* @param visible 是否可见
|
|
1399
|
+
*/
|
|
1400
|
+
private setTerrainLayerVisible;
|
|
1401
|
+
/**
|
|
1402
|
+
* 处理底图互斥逻辑
|
|
1403
|
+
* 当勾选矢量地图时,取消勾选影像地图和影像注记
|
|
1404
|
+
* 当勾选影像地图或影像注记时,取消勾选矢量地图
|
|
1405
|
+
*/
|
|
1406
|
+
private handleBaseMapMutex;
|
|
1241
1407
|
/**
|
|
1242
1408
|
* 设置图层可见性(内部方法)
|
|
1243
1409
|
*/
|
|
@@ -2316,6 +2482,7 @@ declare class Render {
|
|
|
2316
2482
|
engine: any;
|
|
2317
2483
|
viewer: Viewer;
|
|
2318
2484
|
config: RenderConfig;
|
|
2485
|
+
viewerEnv: ViewerEnv;
|
|
2319
2486
|
private lightingSystem;
|
|
2320
2487
|
private shadowSystem;
|
|
2321
2488
|
private volumetricCloudsSystem;
|
|
@@ -2980,7 +3147,7 @@ declare class FogControl extends BaseControlPanel {
|
|
|
2980
3147
|
/**
|
|
2981
3148
|
* 初始化事件监听
|
|
2982
3149
|
*/
|
|
2983
|
-
initEventListeners(
|
|
3150
|
+
initEventListeners(_container: HTMLElement): void;
|
|
2984
3151
|
/**
|
|
2985
3152
|
* 更新距离雾配置
|
|
2986
3153
|
*/
|
|
@@ -3031,11 +3198,11 @@ declare class WaterControl {
|
|
|
3031
3198
|
*/
|
|
3032
3199
|
createPanel(container: HTMLElement): void;
|
|
3033
3200
|
/**
|
|
3034
|
-
*
|
|
3201
|
+
* 创建面板内容(不包含区域设置,区域通过 GeoJSON 文件指定)
|
|
3035
3202
|
*/
|
|
3036
3203
|
private createPanelContent;
|
|
3037
3204
|
/**
|
|
3038
|
-
*
|
|
3205
|
+
* 初始化事件监听器(不包含区域设置,区域通过 GeoJSON 文件指定)
|
|
3039
3206
|
*/
|
|
3040
3207
|
initEventListeners(container: HTMLElement): void;
|
|
3041
3208
|
/**
|
|
@@ -3047,13 +3214,199 @@ declare class WaterControl {
|
|
|
3047
3214
|
*/
|
|
3048
3215
|
applyDefaultPresets(): void;
|
|
3049
3216
|
/**
|
|
3050
|
-
*
|
|
3217
|
+
* RGBA 对象转十六进制
|
|
3051
3218
|
*/
|
|
3052
|
-
private
|
|
3219
|
+
private rgbaToHex;
|
|
3053
3220
|
/**
|
|
3054
|
-
* 十六进制颜色转
|
|
3221
|
+
* 十六进制颜色转 RGBA 对象
|
|
3055
3222
|
*/
|
|
3056
|
-
private
|
|
3223
|
+
private hexToRgba;
|
|
3224
|
+
}
|
|
3225
|
+
|
|
3226
|
+
/**
|
|
3227
|
+
* 海洋数据项接口
|
|
3228
|
+
*/
|
|
3229
|
+
interface SeaLayerItem {
|
|
3230
|
+
id: string;
|
|
3231
|
+
name: string;
|
|
3232
|
+
url?: string;
|
|
3233
|
+
source?: 'url' | 'file';
|
|
3234
|
+
primitive: Primitive | null;
|
|
3235
|
+
visible: boolean;
|
|
3236
|
+
}
|
|
3237
|
+
/**
|
|
3238
|
+
* 海洋系统配置接口
|
|
3239
|
+
*/
|
|
3240
|
+
interface SeaConfig {
|
|
3241
|
+
/** 是否启用海洋系统 */
|
|
3242
|
+
enabled: boolean;
|
|
3243
|
+
/** 海洋颜色 */
|
|
3244
|
+
color?: Color;
|
|
3245
|
+
/** 海洋透明度 */
|
|
3246
|
+
opacity?: number;
|
|
3247
|
+
/** 海洋反射强度 */
|
|
3248
|
+
specularIntensity?: number;
|
|
3249
|
+
/** 海洋波动振幅 */
|
|
3250
|
+
amplitude?: number;
|
|
3251
|
+
/** 海洋波动频率 */
|
|
3252
|
+
frequency?: number;
|
|
3253
|
+
/** 海洋动画速度 */
|
|
3254
|
+
animationSpeed?: number;
|
|
3255
|
+
/** 法线纹理路径 */
|
|
3256
|
+
normalMapUrl?: string;
|
|
3257
|
+
/** 海洋数据路径 */
|
|
3258
|
+
dataUrl?: string;
|
|
3259
|
+
}
|
|
3260
|
+
/**
|
|
3261
|
+
* 海洋系统类
|
|
3262
|
+
* 负责管理场景中的海洋效果
|
|
3263
|
+
* 参考 RenderSeaPolygon 实现
|
|
3264
|
+
*/
|
|
3265
|
+
declare class SeaSystem implements RenderSystem {
|
|
3266
|
+
private viewer;
|
|
3267
|
+
private config;
|
|
3268
|
+
private seaPrimitive;
|
|
3269
|
+
private isInitialized;
|
|
3270
|
+
private isEnabled;
|
|
3271
|
+
private morphCompleteListener;
|
|
3272
|
+
private postRenderListener;
|
|
3273
|
+
constructor(viewer: Viewer, config?: SeaConfig);
|
|
3274
|
+
/**
|
|
3275
|
+
* 初始化海洋系统
|
|
3276
|
+
*/
|
|
3277
|
+
initialize(): void;
|
|
3278
|
+
/**
|
|
3279
|
+
* 创建海洋几何
|
|
3280
|
+
*/
|
|
3281
|
+
private createSeaGeometry;
|
|
3282
|
+
/**
|
|
3283
|
+
* 加载海洋数据
|
|
3284
|
+
*/
|
|
3285
|
+
private loadSeaData;
|
|
3286
|
+
/**
|
|
3287
|
+
* 从GeoJSON获取层级结构
|
|
3288
|
+
*/
|
|
3289
|
+
private getHierarchies;
|
|
3290
|
+
/**
|
|
3291
|
+
* 从几何体获取层级结构
|
|
3292
|
+
*/
|
|
3293
|
+
private getHierarchiesFromGeometry;
|
|
3294
|
+
/**
|
|
3295
|
+
* 从坐标数组获取层级结构
|
|
3296
|
+
*/
|
|
3297
|
+
private getHierarchy;
|
|
3298
|
+
/**
|
|
3299
|
+
* 绘制海洋
|
|
3300
|
+
*/
|
|
3301
|
+
private drawSea;
|
|
3302
|
+
/**
|
|
3303
|
+
* 创建水体材质
|
|
3304
|
+
*/
|
|
3305
|
+
private createWaterMaterial;
|
|
3306
|
+
/**
|
|
3307
|
+
* 创建调试用的海洋
|
|
3308
|
+
*/
|
|
3309
|
+
private createDebugSea;
|
|
3310
|
+
/**
|
|
3311
|
+
* 配置海洋样式
|
|
3312
|
+
*/
|
|
3313
|
+
private setupSeaStyling;
|
|
3314
|
+
/**
|
|
3315
|
+
* 设置事件监听器
|
|
3316
|
+
*/
|
|
3317
|
+
private setupEventListeners;
|
|
3318
|
+
/**
|
|
3319
|
+
* 更新海洋动画
|
|
3320
|
+
*/
|
|
3321
|
+
private updateSeaAnimation;
|
|
3322
|
+
/**
|
|
3323
|
+
* 启用海洋系统
|
|
3324
|
+
*/
|
|
3325
|
+
enable(): void;
|
|
3326
|
+
/**
|
|
3327
|
+
* 重新创建海洋图元
|
|
3328
|
+
*/
|
|
3329
|
+
private recreateSeaPrimitives;
|
|
3330
|
+
/**
|
|
3331
|
+
* 禁用海洋系统
|
|
3332
|
+
*/
|
|
3333
|
+
disable(): void;
|
|
3334
|
+
/**
|
|
3335
|
+
* 销毁海洋图元
|
|
3336
|
+
*/
|
|
3337
|
+
private destroySeaPrimitives;
|
|
3338
|
+
/**
|
|
3339
|
+
* 更新海洋配置
|
|
3340
|
+
*/
|
|
3341
|
+
update(config: Partial<SeaConfig>): void;
|
|
3342
|
+
/**
|
|
3343
|
+
* 更新海洋样式
|
|
3344
|
+
*/
|
|
3345
|
+
private updateSeaStyle;
|
|
3346
|
+
/**
|
|
3347
|
+
* 获取系统状态
|
|
3348
|
+
*/
|
|
3349
|
+
getStatus(): boolean;
|
|
3350
|
+
/**
|
|
3351
|
+
* 获取当前配置
|
|
3352
|
+
*/
|
|
3353
|
+
getConfig(): SeaConfig;
|
|
3354
|
+
/**
|
|
3355
|
+
* 保存配置
|
|
3356
|
+
*/
|
|
3357
|
+
saveConfig(): SeaConfig;
|
|
3358
|
+
/**
|
|
3359
|
+
* 获取系统状态信息(调试用)
|
|
3360
|
+
*/
|
|
3361
|
+
getDebugInfo(): any;
|
|
3362
|
+
/**
|
|
3363
|
+
* 销毁海洋系统
|
|
3364
|
+
*/
|
|
3365
|
+
destroy(): void;
|
|
3366
|
+
/** 用户添加的海图层 */
|
|
3367
|
+
private seaLayers;
|
|
3368
|
+
/**
|
|
3369
|
+
* 从 URL 加载海洋数据
|
|
3370
|
+
* @param url GeoJSON 数据地址
|
|
3371
|
+
* @param name 海图层名称
|
|
3372
|
+
* @returns 海图层ID
|
|
3373
|
+
*/
|
|
3374
|
+
loadSeaFromUrl(url: string, name?: string): Promise<string>;
|
|
3375
|
+
/**
|
|
3376
|
+
* 从文件加载海洋数据
|
|
3377
|
+
* @param file GeoJSON 文件
|
|
3378
|
+
* @param name 海图层名称
|
|
3379
|
+
* @returns 海图层ID
|
|
3380
|
+
*/
|
|
3381
|
+
loadSeaFromFile(file: File, name?: string): Promise<string>;
|
|
3382
|
+
/**
|
|
3383
|
+
* 从层级结构创建海洋图元
|
|
3384
|
+
*/
|
|
3385
|
+
private createSeaPrimitivesFromHierarchies;
|
|
3386
|
+
/**
|
|
3387
|
+
* 获取所有用户添加的海图层
|
|
3388
|
+
*/
|
|
3389
|
+
getSeaLayers(): SeaLayerItem[];
|
|
3390
|
+
/**
|
|
3391
|
+
* 获取指定海图层
|
|
3392
|
+
*/
|
|
3393
|
+
getSeaLayer(layerId: string): SeaLayerItem | undefined;
|
|
3394
|
+
/**
|
|
3395
|
+
* 设置海图层可见性
|
|
3396
|
+
*/
|
|
3397
|
+
setSeaLayerVisible(layerId: string, visible: boolean): boolean;
|
|
3398
|
+
/**
|
|
3399
|
+
* 移除指定海图层
|
|
3400
|
+
*/
|
|
3401
|
+
removeSeaLayer(layerId: string): boolean;
|
|
3402
|
+
/**
|
|
3403
|
+
* 清除所有用户添加的海图层
|
|
3404
|
+
*/
|
|
3405
|
+
clearAllSeaLayers(): void;
|
|
3406
|
+
/**
|
|
3407
|
+
* 获取脚本基础URL
|
|
3408
|
+
*/
|
|
3409
|
+
private getScriptBaseUrl;
|
|
3057
3410
|
}
|
|
3058
3411
|
|
|
3059
3412
|
/**
|
|
@@ -3492,6 +3845,8 @@ interface SidebarManagerState {
|
|
|
3492
3845
|
*/
|
|
3493
3846
|
declare class LayerControl extends PanelBase {
|
|
3494
3847
|
private layerSystem;
|
|
3848
|
+
private waterSystem;
|
|
3849
|
+
private render;
|
|
3495
3850
|
private folders;
|
|
3496
3851
|
private searchTerm;
|
|
3497
3852
|
private entityExpandedMap;
|
|
@@ -3556,6 +3911,18 @@ declare class LayerControl extends PanelBase {
|
|
|
3556
3911
|
* 过滤实体和图元对象
|
|
3557
3912
|
*/
|
|
3558
3913
|
private filterEntities;
|
|
3914
|
+
/**
|
|
3915
|
+
* 过滤水图层
|
|
3916
|
+
*/
|
|
3917
|
+
private filterWaterLayers;
|
|
3918
|
+
/**
|
|
3919
|
+
* 渲染水图层文件夹
|
|
3920
|
+
*/
|
|
3921
|
+
private renderWaterFolder;
|
|
3922
|
+
/**
|
|
3923
|
+
* 渲染水图层列表
|
|
3924
|
+
*/
|
|
3925
|
+
private renderWaterLayerList;
|
|
3559
3926
|
/**
|
|
3560
3927
|
* 渲染实体和图元列表(支持递归)
|
|
3561
3928
|
*/
|
|
@@ -3580,6 +3947,22 @@ declare class LayerControl extends PanelBase {
|
|
|
3580
3947
|
* 显示添加图层对话框
|
|
3581
3948
|
*/
|
|
3582
3949
|
private showAddLayerDialog;
|
|
3950
|
+
/**
|
|
3951
|
+
* 添加对话框样式
|
|
3952
|
+
*/
|
|
3953
|
+
private addDialogStyles;
|
|
3954
|
+
/**
|
|
3955
|
+
* 绑定对话框事件
|
|
3956
|
+
*/
|
|
3957
|
+
private bindDialogEvents;
|
|
3958
|
+
/**
|
|
3959
|
+
* 处理水图层添加
|
|
3960
|
+
*/
|
|
3961
|
+
private handleWaterLayerAdd;
|
|
3962
|
+
/**
|
|
3963
|
+
* 关闭对话框
|
|
3964
|
+
*/
|
|
3965
|
+
private closeDialog;
|
|
3583
3966
|
/**
|
|
3584
3967
|
* 显示添加目录对话框
|
|
3585
3968
|
*/
|
|
@@ -3596,6 +3979,30 @@ declare class LayerControl extends PanelBase {
|
|
|
3596
3979
|
* 切换实体展开/收起状态
|
|
3597
3980
|
*/
|
|
3598
3981
|
private toggleEntityExpanded;
|
|
3982
|
+
/**
|
|
3983
|
+
* 显示水图层效果编辑对话框
|
|
3984
|
+
*/
|
|
3985
|
+
private showWaterEffectDialog;
|
|
3986
|
+
/**
|
|
3987
|
+
* 添加水效果对话框样式
|
|
3988
|
+
*/
|
|
3989
|
+
private addWaterEffectDialogStyles;
|
|
3990
|
+
/**
|
|
3991
|
+
* 绑定水效果对话框事件
|
|
3992
|
+
*/
|
|
3993
|
+
private bindWaterEffectDialogEvents;
|
|
3994
|
+
/**
|
|
3995
|
+
* 关闭水效果编辑对话框
|
|
3996
|
+
*/
|
|
3997
|
+
private closeWaterEffectDialog;
|
|
3998
|
+
/**
|
|
3999
|
+
* RGBA 对象转十六进制
|
|
4000
|
+
*/
|
|
4001
|
+
private rgbaToHex;
|
|
4002
|
+
/**
|
|
4003
|
+
* 十六进制颜色转 RGBA 对象
|
|
4004
|
+
*/
|
|
4005
|
+
private hexToRgba;
|
|
3599
4006
|
/**
|
|
3600
4007
|
* 刷新面板
|
|
3601
4008
|
*/
|
|
@@ -4353,6 +4760,8 @@ declare const render: {
|
|
|
4353
4760
|
CameraUrlManager: typeof CameraUrlManager;
|
|
4354
4761
|
/** 下雨天气系统 */
|
|
4355
4762
|
RainSystem: typeof RainSystem;
|
|
4763
|
+
/** 海洋系统 */
|
|
4764
|
+
SeaSystem: typeof SeaSystem;
|
|
4356
4765
|
};
|
|
4357
4766
|
|
|
4358
|
-
export { AtmosphereControl, type AtmosphereScatteringConfig, AtmosphereScatteringSystem, BuildingControl, BuildingSystem, CameraListener, type CameraListenerConfig, CameraListenerSystem, type CameraListenerSystemConfig, type CameraParams, CameraUrlManager, type CameraUrlManagerConfig, type DirectionalLightConfig, type DistanceFogConfig, DistanceFogSystem, EnvironmentControl, FogControl, type HeightFogConfig, HeightFogSystem, LayerControl, LayerSystem, LightingControl, LightingSystem, PlottingControl, type PostProcessingConfig, PostProcessingControl, PostProcessingSystem, type RainBounds, type RainConfig, RainSystem, Render, type RenderConfig, RenderControl, type ShadowConfig, ShadowControl, ShadowSystem, SidebarControl, TilesetManager, TilesetSearchControl, ToolboxControl, ToolboxSystem, VolumetricCloudControl, type VolumetricCloudsConfig, VolumetricCloudsSystem, type WaterConfig, WaterControl, WaterSystem, defaultRainConfig, render };
|
|
4767
|
+
export { AtmosphereControl, type AtmosphereScatteringConfig, AtmosphereScatteringSystem, BuildingControl, BuildingSystem, CameraListener, type CameraListenerConfig, CameraListenerSystem, type CameraListenerSystemConfig, type CameraParams, CameraUrlManager, type CameraUrlManagerConfig, type DirectionalLightConfig, type DistanceFogConfig, DistanceFogSystem, EnvironmentControl, FogControl, type HeightFogConfig, HeightFogSystem, LayerControl, LayerSystem, LightingControl, LightingSystem, PlottingControl, type PostProcessingConfig, PostProcessingControl, PostProcessingSystem, type RainBounds, type RainConfig, RainSystem, Render, type RenderConfig, RenderControl, type SeaConfig, SeaSystem, type ShadowConfig, ShadowControl, ShadowSystem, SidebarControl, TilesetManager, TilesetSearchControl, ToolboxControl, ToolboxSystem, VolumetricCloudControl, type VolumetricCloudsConfig, VolumetricCloudsSystem, type WaterConfig, WaterControl, WaterSystem, defaultRainConfig, render };
|