@skzz/components-gis 0.1.4 → 0.1.6

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.
Files changed (53) hide show
  1. package/dist/assets/twinPreviewWorker-DvpSZYqE.js +3 -0
  2. package/dist/assets/twinTextureMipWorker-BWoFEUdX.js +3 -0
  3. package/dist/color-DVYdxZow.js +359 -0
  4. package/dist/esm-BXiGX6xE.js +86 -0
  5. package/dist/index.css +1 -1
  6. package/dist/index.d.ts +72 -6
  7. package/dist/index.es.js +1164 -9665
  8. package/dist/index.umd.js +209 -5
  9. package/dist/interpolation-Ctw2-y9G.js +211 -0
  10. package/dist/layerStack-CbiVJONn.js +181 -0
  11. package/dist/pako.esm-D6zcBi67.js +1455 -0
  12. package/dist/query-DgSNPfJM.js +239 -0
  13. package/dist/queryPoint-BOi_hkig.js +189 -0
  14. package/dist/tw2Parser-Dxs5xGvB.js +115 -0
  15. package/dist/zz-3dtiles-BzDYB-tW.js +75 -0
  16. package/dist/zz-gltf-BDHxqQjs.js +70 -0
  17. package/dist/zz-layer/zz-layer-shp-zzts/shpZztsBounds.d.ts +19 -0
  18. package/dist/zz-layer/zz-layer-shp-zzts/shpZztsCacheUtils.d.ts +53 -0
  19. package/dist/zz-layer/zz-layer-shp-zzts/shpZztsGeometry.d.ts +27 -0
  20. package/dist/zz-layer/zz-layer-shp-zzts/shpZztsGeometryWorker.d.ts +1 -0
  21. package/dist/zz-layer/zz-layer-shp-zzts/shpZztsPreviewBudget.d.ts +78 -0
  22. package/dist/zz-layer/zz-layer-shp-zzts/shpZztsRenderer.d.ts +281 -16
  23. package/dist/zz-layer/zz-layer-shp-zzts/shpZztsViewState.d.ts +20 -0
  24. package/dist/zz-layer/zz-layer-zzts/zztsRasterCacheUtils.d.ts +35 -0
  25. package/dist/zz-layer/zz-layer-zzts/zztsRasterPreviewPolling.d.ts +10 -0
  26. package/dist/zz-layer/zz-layer-zzts3dv2/entityGridV2.d.ts +277 -0
  27. package/dist/zz-layer/zz-layer-zzts3dv2/index.vue.d.ts +1 -0
  28. package/dist/zz-layer/zz-layer-zzts3dv2/tw2Parser.d.ts +7 -0
  29. package/dist/zz-layer/zz-layer-zzts3dv2/twinAdaptiveMesh.d.ts +3 -0
  30. package/dist/zz-layer/zz-layer-zzts3dv2/twinCoarseLod.d.ts +4 -0
  31. package/dist/zz-layer/zz-layer-zzts3dv2/twinEnvironmentLighting.d.ts +16 -0
  32. package/dist/zz-layer/zz-layer-zzts3dv2/twinImagePixels.d.ts +6 -0
  33. package/dist/zz-layer/zz-layer-zzts3dv2/twinPagedIndex.d.ts +8 -0
  34. package/dist/zz-layer/zz-layer-zzts3dv2/twinParsePool.d.ts +10 -0
  35. package/dist/zz-layer/zz-layer-zzts3dv2/twinPreviewWorker.d.ts +1 -0
  36. package/dist/zz-layer/zz-layer-zzts3dv2/twinRegionalIndex.d.ts +23 -0
  37. package/dist/zz-layer/zz-layer-zzts3dv2/twinResourceBatch.d.ts +34 -0
  38. package/dist/zz-layer/zz-layer-zzts3dv2/twinTextureAppearance.d.ts +89 -0
  39. package/dist/zz-layer/zz-layer-zzts3dv2/twinTextureMipWorker.d.ts +1 -0
  40. package/dist/zz-layer/zz-layer-zzts3dv2/twinVisualRuntime.d.ts +107 -0
  41. package/dist/zz-layer-geojson-CtTpn_f9.js +867 -0
  42. package/dist/zz-layer-mvt-R1-GwSIW.js +609 -0
  43. package/dist/zz-layer-shp-zzts-Dr3Gxeba.js +1881 -0
  44. package/dist/zz-layer-zzts3d-CsIWse3P.js +835 -0
  45. package/dist/zz-layer-zzts3d-grid-CTHFZBpo.js +314 -0
  46. package/dist/zz-layer-zzts3d-las-D3w01aGe.js +561 -0
  47. package/dist/zz-layer-zzts3d-point-BjaTPTqj.js +752 -0
  48. package/dist/zz-layer-zzts3dtype-BRl3mCk9.js +493 -0
  49. package/dist/zz-layer-zzts3dv2-DFXCOaMe.js +4019 -0
  50. package/dist/zz-terrain-excavation-A2NXSQ5P.js +502 -0
  51. package/dist/zz-viewer/index.vue.d.ts +2 -2
  52. package/dist/zzts3dLayerSignature-DzrPeJTd.js +44 -0
  53. package/package.json +5 -4
@@ -1,3 +1,280 @@
1
+ import { TwinTextureCache } from './twinTextureAppearance';
2
+ import { TwinParsePool } from './twinParsePool.js';
3
+ import { TwinViewportRequestBudget } from './twinResourceBatch.js';
4
+ import { TwinEnvironmentLighting } from './twinEnvironmentLighting.js';
5
+ export class EntityGridV2Layer {
6
+ constructor(id: any, isStatic?: boolean, level?: null, color?: string, opacity?: number, options?: {});
7
+ id: any;
8
+ viewer: any;
9
+ dataLayerId: any;
10
+ isStatic: boolean;
11
+ fixedLevel: any;
12
+ currentNewLevel: import('vue').Ref<number, number>;
13
+ color: string;
14
+ opacity: number;
15
+ layerOpacity: any;
16
+ serviceName: any;
17
+ dictCode: any;
18
+ enableServiceColor: boolean;
19
+ modelColorUrl: any;
20
+ modelColorCache: Map<any, any>;
21
+ displayRange: {
22
+ west: number;
23
+ south: number;
24
+ east: number;
25
+ north: number;
26
+ } | null;
27
+ lodCalculationRange: {
28
+ west: number;
29
+ south: number;
30
+ east: number;
31
+ north: number;
32
+ } | null;
33
+ stackIndex: any;
34
+ subStackIndex: any;
35
+ groupKey: any;
36
+ previewMode: boolean;
37
+ previewVersion: any;
38
+ previewManifest: any;
39
+ previewBuffer: any;
40
+ previewColorMap: any;
41
+ previewHiddenEntityIds: Set<any>;
42
+ hiddenColors: Set<any>;
43
+ previewDefaultColor: string;
44
+ previewEntityLimit: number;
45
+ previewMaxInflatedBytes: number;
46
+ previewColorGroupLimit: number;
47
+ onPreviewError: any;
48
+ onEmptyFallback: any;
49
+ viewModeFailed: boolean;
50
+ viewConfirmed: boolean;
51
+ blockCache: Map<any, any>;
52
+ currentViewKeys: Set<any>;
53
+ viewColorMap: Map<any, any>;
54
+ lastTilesCount: number;
55
+ emptyFallbackNotified: boolean;
56
+ levels_add: any;
57
+ destroyed: boolean;
58
+ handlers: {
59
+ (): void;
60
+ cancelTimer(): void;
61
+ onMoveStart(): void;
62
+ onMoveEnd(): void;
63
+ } | null;
64
+ requestController: AbortController | null;
65
+ requestVersion: number;
66
+ loadedTiles: Map<any, any>;
67
+ emptyTiles: Set<any>;
68
+ shardDataCache: Map<any, any>;
69
+ _hiddenRebuildPending: boolean;
70
+ _hiddenRebuildQueued: boolean;
71
+ capsuleManifest: any;
72
+ pagesById: Map<any, any>;
73
+ materialsById: Map<any, any>;
74
+ textureCache: TwinTextureCache | null;
75
+ revision: any;
76
+ requestedRevision: any;
77
+ _manifestGeneration: number;
78
+ _indexCache: Map<any, any>;
79
+ _indexGeneration: number;
80
+ resourceBatchEnabled: boolean;
81
+ styleMode: any;
82
+ visualOptions: any;
83
+ byteBudget: any;
84
+ blockQueue: any;
85
+ parsePool: TwinParsePool;
86
+ visualChoices: Map<any, any>;
87
+ visualGeneration: number;
88
+ _geometrySequence: number;
89
+ _appearanceReady: boolean;
90
+ _appearancePromise: any;
91
+ _tileStateVersion: number;
92
+ init(): Promise<void>;
93
+ loadPreviewSnapshot(): Promise<void>;
94
+ isServiceColorEnabled(): boolean;
95
+ /**
96
+ * 按实体 id(tw_code)分批(800/批)查询服务配色索引,结果写入缓存。
97
+ * 返回 id -> color(css) 的 Map;未启用服务配色或无命中时返回空 Map。
98
+ */
99
+ loadModelColorsByIds(modelIds: any[] | undefined, signal: any, batchSize?: number, requestBudget?: null): Promise<Map<any, any>>;
100
+ addPreviewEntities(entities: any, manifest: any): void;
101
+ flyToPreviewBounds(boundingSpheres: any): void;
102
+ getBoundingSphere(): any;
103
+ /** Preview callers opt in; normal multi-layer maps keep their existing camera behavior. */
104
+ zoomTo(options?: {}): boolean;
105
+ /**
106
+ * calTiles 响应处理:服务端已保证 ≤20 格网(超过逐级降层,降到 12 仍超返回空=不渲染)。
107
+ * 每格网 1 个 getTwinCapsuleBlock 请求(并行,浏览器缓存 immutable 块);
108
+ * 命中缓存块免请求;新实体增量配色;同集跳过重建。
109
+ * 整轮 404 只清理当前视口;只有 204 明确确认无新格式产物才允许兼容回退。
110
+ */
111
+ handleViewportGrids(tiles: any, lodLevel: any, signal: any): Promise<void>;
112
+ _manifestError: Error | null | undefined;
113
+ /**
114
+ * 拉单个块(gzip 存储态 TW2,端点 immutable 长缓存,浏览器跨会话命中)。
115
+ * 返回 {status: ok|miss|unsupported|error|abort, block?}:204=胶囊无新产物,404=当前格网无产物。
116
+ */
117
+ fetchCapsuleBlock(layerId: any, lod: any, geosot: any, signal: any): Promise<{
118
+ status: string;
119
+ block?: undefined;
120
+ } | {
121
+ status: string;
122
+ block: {
123
+ geosot: any;
124
+ lod: any;
125
+ entities: any;
126
+ sphere: any;
127
+ };
128
+ }>;
129
+ /**
130
+ * 读取胶囊 manifest(TW2 v2)。204/失败返回 null,调用方继续按 v1 渲染。
131
+ * 只请求一次;重入库换 tileVersion 时由图层重建重新获取。
132
+ */
133
+ ensureAppearance(): Promise<any>;
134
+ _legacyManifestConfirmed: boolean | undefined;
135
+ _manifestRequestPending: boolean | undefined;
136
+ getVisualDiagnostics(): {
137
+ revision: any;
138
+ generation: number;
139
+ loadedBlocks: number;
140
+ selectedBlocks: number;
141
+ choices: any;
142
+ requests: {
143
+ active: any;
144
+ pending: any;
145
+ };
146
+ geometry: {
147
+ active: any;
148
+ pending: any;
149
+ transactions: any;
150
+ };
151
+ textures: {
152
+ residentPages: number;
153
+ pendingPages: number;
154
+ demandActive: number;
155
+ demandPending: number;
156
+ suspended: boolean;
157
+ };
158
+ budget: any;
159
+ budgetFailure: {
160
+ stage: string;
161
+ kind: any;
162
+ requestedBytes: any;
163
+ blockKey: any;
164
+ budget: any;
165
+ } | null;
166
+ lastPlan: {
167
+ blocks: never[];
168
+ overBudget: boolean;
169
+ error: any;
170
+ adaptive?: undefined;
171
+ } | {
172
+ blocks: any;
173
+ overBudget: boolean;
174
+ adaptive: boolean;
175
+ error?: undefined;
176
+ } | null;
177
+ requestBudget: TwinViewportRequestBudget | null;
178
+ error: string | null;
179
+ };
180
+ _visualCamera(): {
181
+ position: any[];
182
+ height: any;
183
+ fovy: any;
184
+ orthographicHeight: number;
185
+ visible: (projection: any) => boolean;
186
+ };
187
+ _fetchVisualBlock(metadata: any, signal: any, transport?: null): Promise<any>;
188
+ _waitVisualReady(primitives: any, signal: any): Promise<void>;
189
+ _clearIndexPages(): void;
190
+ _fetchResourceBatch(kind: any, resources: any, signal: any, requestBudget: any): Promise<any>;
191
+ _fetchIndexPages(descriptors: any, signal: any, requestBudget: any): Promise<void>;
192
+ _visibleManifest(camera: any, requestBudget: any): Promise<any>;
193
+ _indexController: AbortController | undefined;
194
+ updateVisualViewport(force?: boolean): Promise<void>;
195
+ lastRequestBudget: TwinViewportRequestBudget | null | undefined;
196
+ lastVisualPlan: {
197
+ blocks: never[];
198
+ overBudget: boolean;
199
+ error: any;
200
+ adaptive?: undefined;
201
+ } | {
202
+ blocks: any;
203
+ overBudget: boolean;
204
+ adaptive: boolean;
205
+ error?: undefined;
206
+ } | undefined;
207
+ _visualBudgetFailure: {
208
+ stage: string;
209
+ kind: any;
210
+ requestedBytes: any;
211
+ blockKey: any;
212
+ budget: any;
213
+ } | null | undefined;
214
+ _applyVisualStyles(): void;
215
+ _entityColor(serviceColor: any): any;
216
+ _coarseStyle(sourceEntityIds?: any[]): {
217
+ serviceColor: null;
218
+ color: any;
219
+ mode: any;
220
+ hidden: boolean;
221
+ };
222
+ _coarsePageRequiresDetail(blocks: any, signal: any): Promise<boolean>;
223
+ _isEntityHidden(id: any, colorValue: any): boolean;
224
+ _styleMode(serviceColor: any, colorValue: any): any;
225
+ /**
226
+ * 挂载本轮视口块。首挂(当前无图元)逐块构建逐块上屏(先到先画);
227
+ * 视口变化/换层则全部构建完成后同帧换挂(旧画面保持显示,无空白期)。
228
+ */
229
+ applyViewBlocks(blocks: any): Promise<void>;
230
+ initHandler(): void;
231
+ _cameraMoving: boolean | undefined;
232
+ getViewportInfo(): void;
233
+ getEntityData(bbox: any, newLevel: any, signal: any): Promise<void>;
234
+ renderTiles(tiles: any, level: any): void;
235
+ /** 本轮所有格网均无 TW2 产物且当前无任何图元时,通知上层回退旧渲染链路。 */
236
+ maybeNotifyEmptyFallback(): void;
237
+ loadTile(tile: any, level: any, requestVersion: any, signal: any): Promise<void>;
238
+ addShardToMap(tile: any, shard: any, data: any, lod: any): Promise<any[]>;
239
+ /** 分片解析数据入缓存(图例显隐免请求重建用),同分片按索引去重覆盖 */
240
+ _cacheShardData(tile: any, shard: any, lod: any, entities: any): void;
241
+ /**
242
+ * TW2 v2:按“纹理页 + alpha 语义 + 面朝向”分组,而不是 materialId。
243
+ * 同一张 R 页被多个材质引用时仍合成一个 Primitive(真实 229 材质 / 64 页 → 65 Primitive);
244
+ * 组内逐实体 GeometryInstance,业务色/烘焙色/styleMode 走 batch table。
245
+ */
246
+ _collectTexturedGroups(entities: any, colorMap: any, aggregate?: boolean): Map<any, any>;
247
+ _geometryBudgetError(kind: any, requestedBytes: any, blockKey: any): Error & {
248
+ details: {
249
+ stage: string;
250
+ kind: any;
251
+ requestedBytes: any;
252
+ blockKey: any;
253
+ budget: any;
254
+ };
255
+ };
256
+ _buildTexturedGroups(tile: any, shard: any, entities: any, colorMap: any, defer: any, preparedGroups?: null): any[];
257
+ environmentLighting: TwinEnvironmentLighting | null | undefined;
258
+ _materialKey(info: any): string;
259
+ /**
260
+ * 按颜色分组构建一个分片的图元。
261
+ * defer=false:直接挂场景并写入 loadedTiles(原路径);
262
+ * defer=true :只构建不挂场景,由双缓冲重建统一同帧换挂。
263
+ */
264
+ _buildShardGroups(tile: any, shard: any, entities: any, colorMap: any, defer: any): any[];
265
+ /**
266
+ * 图例显隐变化:复用已加载分片的解析数据双缓冲重建——
267
+ * 全程不发 calTiles/manifest/shard 请求;新图元在旧图元保持显示期间构建,就绪后同帧换挂,画面无空白期。
268
+ */
269
+ _rebuildForHiddenColors(): Promise<void>;
270
+ _finishHiddenRebuild(): void;
271
+ removeTile(geoSot: any): void;
272
+ removeTilesOnly(): void;
273
+ clearAllTiles(): void;
274
+ updateOptions(options?: {}): void;
275
+ getCurrentLevel(): number;
276
+ remove(): void;
277
+ }
1
278
  export function initEntity(options: any): Promise<any>;
2
279
  export function initEntityStatic(options: any): Promise<any>;
3
280
  export function removeEntity(id: any): void;
@@ -1,4 +1,5 @@
1
1
  declare const _default: import('vue').DefineComponent<{}, {
2
+ $emit: (event: "ready" | "empty-fallback", ...args: any[]) => void;
2
3
  groupKey: string;
3
4
  stackIndex: number;
4
5
  subStackIndex: number;
@@ -0,0 +1,7 @@
1
+ export function parseTw2(buffer: any, expectedLod: any, maxBytes?: number, maxEntities?: number): {
2
+ id: bigint;
3
+ positions: Float64Array<ArrayBuffer>;
4
+ indices: Uint32Array<ArrayBuffer>;
5
+ }[];
6
+ export const TW2_MAX_BYTES: number;
7
+ export const TW2_MAX_ENTITIES: 200000;
@@ -0,0 +1,3 @@
1
+ /** Keep every entity and material boundary; close views continue to use the source mesh.
2
+ * Meshoptimizer's error is an approximation, so use a conservative sub-pixel target. */
3
+ export function simplifyTwinEntities(entities: any, pixelsPerMeter: any, maxErrorPixels?: number): Promise<any>;
@@ -0,0 +1,4 @@
1
+ /** TCM1 keeps business identity separate from the coarse display identity. */
2
+ export function validateTwinCoarseCoverage(manifest: any): Map<any, any>;
3
+ /** A merged mesh can carry a service style only when every member has that style. */
4
+ export function uniformTwinCoarseStyle(ids: any, resolve: any): any;
@@ -0,0 +1,16 @@
1
+ export function twinEnvironmentCenter(Cesium: any, manifest: any, fallback: any): any;
2
+ /** Scene-derived IBL for TW2 primitives. One probe is shared by a layer's materials. */
3
+ export class TwinEnvironmentLighting {
4
+ constructor(Cesium: any, scene: any, position: any);
5
+ Cesium: any;
6
+ scene: any;
7
+ destroyed: boolean;
8
+ frameNumber: number;
9
+ framesUpdated: number;
10
+ manager: any;
11
+ referenceFrame: any;
12
+ update(frameState: any): void;
13
+ get pending(): any;
14
+ apply(uniforms: any, frameState: any): void;
15
+ destroy(): void;
16
+ }
@@ -0,0 +1,6 @@
1
+ /** PNG channels before browser premultiplication: transparent RGB is required by OPAQUE. */
2
+ export function decodeTwinPng(data: any, expectedWidth: any, expectedHeight: any): {
3
+ width: number | undefined;
4
+ height: number | undefined;
5
+ pixels: Uint8Array<ArrayBuffer>;
6
+ } | null;
@@ -0,0 +1,8 @@
1
+ export function validateTwinIndexPages(manifest: any): void;
2
+ /** Every selected page contains complete per-entity LOD coverage. A wide view fails before loading oversized metadata. */
3
+ export function loadVisibleTwinIndex(manifest: any, camera: any, { cache, fetchPage, releasePage, signal }: {
4
+ cache: any;
5
+ fetchPage: any;
6
+ releasePage: any;
7
+ signal: any;
8
+ }): Promise<any>;
@@ -0,0 +1,10 @@
1
+ /** Two transient workers bound parallel inflation and terminate immediately on cancellation. */
2
+ export class TwinParsePool {
3
+ constructor(queue: any);
4
+ queue: any;
5
+ ownsQueue: boolean;
6
+ workers: Set<any>;
7
+ controller: AbortController;
8
+ parse(buffer: any, lod: any, signal: any, maxBytes?: number, maxEntities?: number, adaptivePixelsPerMeter?: number): any;
9
+ destroy(): void;
10
+ }
@@ -0,0 +1,23 @@
1
+ export function validateTwinRegionalIndex(manifest: any): {
2
+ nodes: Map<any, any>;
3
+ pages: Map<any, any>;
4
+ root: any;
5
+ hierarchyPages: any;
6
+ } | {
7
+ nodes: Map<any, any>;
8
+ pages: Map<any, any>;
9
+ root: any;
10
+ };
11
+ /** Refine a complete visible cut only when every replacement fits the shared view budget. */
12
+ export function loadTwinRegionalPlan(manifest: any, camera: any, previous: any, options: any, { cache, fetchPage, releasePage, signal, retainHierarchyPages }: {
13
+ cache: any;
14
+ fetchPage: any;
15
+ releasePage: any;
16
+ signal: any;
17
+ retainHierarchyPages?: boolean | undefined;
18
+ }): Promise<{
19
+ regional: boolean;
20
+ blocks: any[];
21
+ choices: Map<any, any>;
22
+ overBudget: boolean;
23
+ }>;
@@ -0,0 +1,34 @@
1
+ export function packTwinResourceBatches(resources: any, maximumBytes?: number, maximumEntries?: number): any[][];
2
+ /** TRB1 carries named original file bytes. Reject mixed versions, extras, omissions and truncation. */
3
+ export function parseTwinResourceBatch(buffer: any, revision: any, expected: any): Map<any, any>;
4
+ export const TWIN_BATCH_BYTES: number;
5
+ /** Per-view HTTP admission; never truncate a complete geometry plan to fit a request count. */
6
+ export class TwinViewportRequestBudget {
7
+ constructor(maximum?: number, manifestRequests?: number);
8
+ maximum: number;
9
+ counts: {
10
+ manifest: number;
11
+ };
12
+ total: number;
13
+ take(kind: any): void;
14
+ }
15
+ /** Lazy transport batches share one fetch among their blocks; parsing/building remains bounded downstream. */
16
+ export class TwinBlockBatchLoader {
17
+ constructor(blocks: any, { revision, fetchBatch, reserve, release }: {
18
+ revision: any;
19
+ fetchBatch: any;
20
+ reserve?: (() => boolean) | undefined;
21
+ release?: (() => void) | undefined;
22
+ });
23
+ groups: Map<any, any>;
24
+ jobs: Map<any, any>;
25
+ reservations: Set<any>;
26
+ disposed: boolean;
27
+ revision: any;
28
+ fetchBatch: any;
29
+ reserve: () => boolean;
30
+ release: () => void;
31
+ read(id: any): Promise<any>;
32
+ releaseGroup(index: any): void;
33
+ dispose(): void;
34
+ }
@@ -0,0 +1,89 @@
1
+ import { TwinRequestQueue } from './twinVisualRuntime.js';
2
+ export function samplerFor(Cesium: any, page: any, mip?: boolean, maximumAnisotropy?: number): any;
3
+ export function createTwinAppearance(Cesium: any, options?: {}): any;
4
+ /** Appearance.renderState is read-only. Replace the appearance only when its pass changes. */
5
+ export function withTwinTranslucency(Cesium: any, appearance: any, translucent: any): any;
6
+ export function buildInstanceAttributes(Cesium: any, options: any): {
7
+ color: any;
8
+ fallbackColor: any;
9
+ styleMode: any;
10
+ show: any;
11
+ };
12
+ export function compactEntityGeometry(entity: any, subMeshes: any): {
13
+ positions: Float64Array<ArrayBuffer>;
14
+ uvs: Float32Array<ArrayBuffer>;
15
+ uv1: Float32Array<ArrayBuffer>;
16
+ normals: Float32Array<ArrayBuffer>;
17
+ tangents: Float32Array<ArrayBuffer>;
18
+ colors: Uint8Array<ArrayBuffer>;
19
+ indices: Uint32Array<any>;
20
+ };
21
+ export function compactWholeEntity(entity: any): {
22
+ positions: Float64Array<ArrayBuffer>;
23
+ uvs: Float32Array<ArrayBuffer>;
24
+ uv1: Float32Array<ArrayBuffer>;
25
+ normals: Float32Array<ArrayBuffer>;
26
+ tangents: Float32Array<ArrayBuffer>;
27
+ colors: Uint8Array<ArrayBuffer>;
28
+ indices: Uint32Array<any>;
29
+ };
30
+ /** Keep GPU high/low coordinates near zero; a translation preserves ECEF directions. */
31
+ export function rebaseTwinGeometry(geometry: any, origin: any, inPlace?: boolean): any;
32
+ /** Viewer-shared GPU limits; each cache pins pages only while live primitives borrow them. */
33
+ export class TwinTextureCache {
34
+ constructor(viewer: any, layerId: any, options?: {});
35
+ viewer: any;
36
+ layerId: any;
37
+ revision: any;
38
+ owner: string;
39
+ budget: any;
40
+ textures: Map<any, any>;
41
+ pending: Map<any, any>;
42
+ waiters: Map<any, any>;
43
+ jobs: Map<any, any>;
44
+ idleListeners: Set<any>;
45
+ idleTimer: any;
46
+ coordinator: any;
47
+ queue: any;
48
+ controller: AbortController;
49
+ destroyed: boolean;
50
+ suspensions: any;
51
+ suspended: boolean;
52
+ resumeListeners: Set<any>;
53
+ demandQueue: TwinRequestQueue;
54
+ schedule: (work: any, options: any) => Promise<any>;
55
+ maximumAnisotropy: any;
56
+ get pageCount(): number;
57
+ pauseEnhancements(): Promise<void>;
58
+ resumeEnhancements(): void;
59
+ whenIdle(callback: any): () => boolean;
60
+ notifyIdle(): void;
61
+ variantKey(pageId: any, page: any, pixels: any): string;
62
+ borrowPage(key: any, texture: any, variant: any): {
63
+ texture: any;
64
+ variant: any;
65
+ key: any;
66
+ release: () => void;
67
+ } | null;
68
+ /** Borrow a resident fallback synchronously, including while enhancements are paused. */
69
+ acquireResidentPage(pageId: any, page: any, projectedPixels?: number): {
70
+ texture: any;
71
+ variant: any;
72
+ key: any;
73
+ release: () => void;
74
+ } | null;
75
+ acquirePage(pageId: any, page: any, options?: {}): Promise<{
76
+ texture: any;
77
+ variant: any;
78
+ key: any;
79
+ release: () => void;
80
+ } | null>;
81
+ _acquireExactPage(pageId: any, page: any, options?: {}): Promise<{
82
+ texture: any;
83
+ variant: any;
84
+ key: any;
85
+ release: () => void;
86
+ } | null>;
87
+ loadPage(pageId: any, page: any, options?: {}): any;
88
+ destroy(): void;
89
+ }
@@ -0,0 +1,107 @@
1
+ /** Bounded scheduling, shared byte accounting and pure TW2 index selection. */
2
+ export function abortError(): Error & {
3
+ name: string;
4
+ };
5
+ export function allowsTwinLegacyManifest({ revision, requestedRevision, requiresV3, status }: {
6
+ revision: any;
7
+ requestedRevision: any;
8
+ requiresV3: any;
9
+ status: any;
10
+ }): boolean;
11
+ /** Use the immutable ECEF index for camera framing without loading or scaling the source model. */
12
+ export function twinIndexBounds(manifest: any): number[] | null;
13
+ export function estimateTwinGeometryGroupBytes(items: any): any;
14
+ /** Attach a bounded batch before yielding; the shared queue holds construction until ready. */
15
+ export function streamTwinGeometryGroups(groups: any, { build, attach, ready, signal, run, estimate, maxBatchBytes, maxBatchGroups, availableBytes }: {
16
+ build: any;
17
+ attach: any;
18
+ ready: any;
19
+ signal: any;
20
+ run?: ((job: any) => any) | undefined;
21
+ estimate: any;
22
+ maxBatchBytes?: number | undefined;
23
+ maxBatchGroups?: number | undefined;
24
+ availableBytes?: (() => number) | undefined;
25
+ }): Promise<void>;
26
+ export function getTwinQueues(viewer: any): any;
27
+ export function getTwinBudget(viewer: any, options?: {}): any;
28
+ export function entityBytes(entities: any): any;
29
+ export function blockProjection(block: any, camera: any): {
30
+ center: number[];
31
+ radius: number;
32
+ distance: number;
33
+ pixelsPerMeter: number;
34
+ sse: number;
35
+ projectedPixels: number;
36
+ };
37
+ /** A coverageKey is producer-declared equal coverage, never inferred from cell centers. */
38
+ export function selectTwinBlocks(manifest: any, camera: any, previous?: Map<any, any>, options?: {}): {
39
+ blocks: any[];
40
+ choices: Map<any, any>;
41
+ overBudget: boolean;
42
+ };
43
+ /** Stream a complete untextured view when the source LODs do not fit the normal plan.
44
+ * The larger limits bound the amount read, not the simultaneously resident geometry.
45
+ * Actual construction remains subject to the shared CPU/GPU byte budget. */
46
+ export function selectTwinAdaptiveBlocks(manifest: any, camera: any, previous: any, options?: {}): {
47
+ blocks: any[];
48
+ choices: Map<any, any>;
49
+ overBudget: boolean;
50
+ } | null;
51
+ export function chooseTextureVariant(page: any, projectedPixels?: number): any;
52
+ export function validateTwinManifest(manifest: any): any;
53
+ /** Filter RGB in its declared domain; alpha always remains linear coverage. */
54
+ export function buildTwinMipChain(pixels: any, width: any, height: any, colorSpace?: string): Uint8Array<ArrayBuffer>[];
55
+ export function textureByteLength(width: any, height: any, mip?: boolean): number;
56
+ export class TwinRequestQueue {
57
+ constructor(concurrency?: number, maxPending?: number);
58
+ concurrency: number;
59
+ maxPending: number;
60
+ active: number;
61
+ pending: any[];
62
+ closed: boolean;
63
+ capacityWaiters: Set<any>;
64
+ run(work: any, { signal, priority }?: {
65
+ priority?: number | undefined;
66
+ }): Promise<any>;
67
+ pump(): void;
68
+ notifyCapacity(): void;
69
+ waitForCapacity(signal: any): Promise<any>;
70
+ runWithBackpressure(work: any, options?: {}): Promise<any>;
71
+ destroy(): void;
72
+ }
73
+ export class TwinByteBudget {
74
+ constructor({ cpuBytes, gpuBytes }?: {
75
+ cpuBytes?: number | undefined;
76
+ gpuBytes?: number | undefined;
77
+ });
78
+ limits: {
79
+ cpu: number;
80
+ gpu: number;
81
+ };
82
+ entries: Map<any, any>;
83
+ clock: number;
84
+ used(kind: any): number;
85
+ reserve(key: any, kind: any, bytes: any, dispose: any, refs?: number): boolean;
86
+ touch(key: any): void;
87
+ acquire(key: any): boolean;
88
+ release(key: any): void;
89
+ remove(key: any): void;
90
+ snapshot(): {
91
+ cpuBytes: number;
92
+ gpuBytes: number;
93
+ resources: number;
94
+ limits: {
95
+ cpu: number;
96
+ gpu: number;
97
+ };
98
+ categories: {
99
+ geometryCpu: number;
100
+ geometryGpu: number;
101
+ blockCpu: number;
102
+ textureCpu: number;
103
+ textureGpu: number;
104
+ other: number;
105
+ };
106
+ };
107
+ }