vis-core 0.33.4 → 0.33.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.
- package/README.md +58 -0
- package/dist/index.d.ts +553 -396
- package/dist/index.js +3 -3
- package/dist/io.d.ts +24 -0
- package/dist/io.js +1 -0
- package/dist/jsonFetch-BQr9Uqag.js +1 -0
- package/package.json +18 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,36 +1,80 @@
|
|
|
1
1
|
import { AmbientLightObject } from 'gl-draw';
|
|
2
|
+
import { ArcObject } from 'gl-draw';
|
|
3
|
+
import { ArcPathOptions } from 'gl-draw';
|
|
4
|
+
import { ArcPoint } from 'gl-draw';
|
|
5
|
+
import { ArcSpherePathOptions } from 'gl-draw';
|
|
2
6
|
import { BaseObject } from 'gl-draw';
|
|
7
|
+
import { baseObjectBounce } from 'gl-draw';
|
|
8
|
+
import { baseObjectBounceIn } from 'gl-draw';
|
|
9
|
+
import { baseObjectFadeIn } from 'gl-draw';
|
|
10
|
+
import { baseObjectFadeOut } from 'gl-draw';
|
|
11
|
+
import { BufferGeometry } from 'three';
|
|
12
|
+
import { ColorRepresentation } from 'three';
|
|
3
13
|
import { default as default_2 } from 'gl-draw';
|
|
4
14
|
import { DirectionalLightObject } from 'gl-draw';
|
|
5
15
|
import { EventEmitter } from 'events';
|
|
6
16
|
import { ExtrudePolygonObject } from 'gl-draw';
|
|
7
17
|
import { FeatureCollection } from 'geojson';
|
|
8
18
|
import { GeoJsonProperties } from 'geojson';
|
|
19
|
+
import { GeometryDefinition } from 'gl-draw';
|
|
9
20
|
import { GeoProjection } from 'd3-geo';
|
|
10
21
|
import { GroupObject } from 'gl-draw';
|
|
11
22
|
import { HemisphereLightObject } from 'gl-draw';
|
|
23
|
+
import { IUniform } from 'three';
|
|
12
24
|
import { Lead } from 'gl-draw';
|
|
13
25
|
import { LineObject } from 'gl-draw';
|
|
14
26
|
import { Listener } from 'events';
|
|
27
|
+
import { Matrix4 } from 'three';
|
|
28
|
+
import { Mesh } from 'three';
|
|
15
29
|
import { MeshLineMaterial } from 'gl-draw';
|
|
16
30
|
import { MeshObject } from 'gl-draw';
|
|
31
|
+
import { ModelObject } from 'gl-draw';
|
|
17
32
|
import { MultiPolygon } from 'geojson';
|
|
18
33
|
import { NodeObject } from 'gl-draw';
|
|
34
|
+
import { Object3D } from 'three';
|
|
19
35
|
import { Pencil } from 'gl-draw';
|
|
20
|
-
import { PickFunctionsItem } from 'gl-draw';
|
|
21
36
|
import { PointLightObject } from 'gl-draw';
|
|
22
37
|
import { Polygon } from 'geojson';
|
|
23
38
|
import { Position } from 'geojson';
|
|
24
39
|
import { ProjectionOptions } from 'gl-draw';
|
|
25
40
|
import { RectAreaLightObject } from 'gl-draw';
|
|
41
|
+
import { remapSnapshotAnimationTracks } from 'gl-draw';
|
|
42
|
+
import { ResourceRegistry } from 'gl-draw';
|
|
26
43
|
import { RestoreBaseObjectOptions } from 'gl-draw';
|
|
44
|
+
import { ReusableObjectResources } from 'gl-draw';
|
|
27
45
|
import { SceneSnapshot } from 'gl-draw';
|
|
46
|
+
import { ShaderMaterial } from 'three';
|
|
47
|
+
import { sinusoidalInOut } from 'gl-draw';
|
|
28
48
|
import { SpotLightObject } from 'gl-draw';
|
|
29
49
|
import { SpriteObject } from 'gl-draw';
|
|
50
|
+
import { StructureResources } from 'gl-draw';
|
|
51
|
+
import { Texture } from 'three';
|
|
30
52
|
import * as THREE from 'three';
|
|
53
|
+
import { timeOut } from 'gl-draw';
|
|
54
|
+
import { TubeObject } from 'gl-draw';
|
|
31
55
|
import { default as TWEEN } from 'three/examples/jsm/libs/tween.module.js';
|
|
32
|
-
import { Tween } from 'three/examples/jsm/libs/tween.module.js';
|
|
33
|
-
import {
|
|
56
|
+
import { Tween as Tween_2 } from 'three/examples/jsm/libs/tween.module.js';
|
|
57
|
+
import { TweenOptions } from 'gl-draw';
|
|
58
|
+
import { Vector2 } from 'three';
|
|
59
|
+
import { Vector3 } from 'three';
|
|
60
|
+
import { Vector3Tuple } from 'three';
|
|
61
|
+
|
|
62
|
+
export declare const adcodeAll: AdcodeRecords;
|
|
63
|
+
|
|
64
|
+
/** Stable administrative-region data shared by generated records and extensions. */
|
|
65
|
+
export declare interface AdcodeInfo {
|
|
66
|
+
adcode: number;
|
|
67
|
+
lng: number;
|
|
68
|
+
lat: number;
|
|
69
|
+
name: string;
|
|
70
|
+
level: string;
|
|
71
|
+
parent: number;
|
|
72
|
+
c: number[];
|
|
73
|
+
b: number[];
|
|
74
|
+
en_name?: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export declare type AdcodeRecords = Record<string, AdcodeInfo>;
|
|
34
78
|
|
|
35
79
|
declare class AmbientLight extends AmbientLightObject {
|
|
36
80
|
constructor(...options: ConstructorParameters<typeof AmbientLightObject>);
|
|
@@ -39,88 +83,31 @@ declare class AmbientLight extends AmbientLightObject {
|
|
|
39
83
|
export declare namespace animationUtils {
|
|
40
84
|
export {
|
|
41
85
|
timeOut,
|
|
42
|
-
TweenOptions,
|
|
43
86
|
sinusoidalInOut,
|
|
44
87
|
baseObjectFadeIn,
|
|
45
88
|
baseObjectFadeOut,
|
|
46
89
|
baseObjectBounceIn,
|
|
47
|
-
baseObjectBounce
|
|
90
|
+
baseObjectBounce,
|
|
91
|
+
TweenOptions
|
|
48
92
|
}
|
|
49
93
|
}
|
|
50
94
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
options: Options_5;
|
|
54
|
-
constructor(options: Options_5);
|
|
55
|
-
create(): Promise<void>;
|
|
56
|
-
/** Internal/local-space curve used for rendering, editor handles and snapshots. */
|
|
57
|
-
getCurve(): ArcCurve;
|
|
58
|
-
/** Set four world-space Bézier controls; persisted coordinates remain local. */
|
|
59
|
-
setControlPoints(points: readonly [ArcPoint, ArcPoint, ArcPoint, ArcPoint]): void;
|
|
60
|
-
/** Set a world-space path without changing this object or its parent transforms. */
|
|
61
|
-
setPath(from: ArcPoint, to: ArcPoint, options: ArcPathOptions): void;
|
|
62
|
-
/** Exact radial lift above the short great circle; preserves every object transform. */
|
|
63
|
-
setSpherePath(from: ArcPoint, to: ArcPoint, options: ArcSpherePathOptions): void;
|
|
64
|
-
private worldToLocalMatrix;
|
|
65
|
-
private validatedNodes;
|
|
66
|
-
private setWorldControls;
|
|
67
|
-
private getPickPathOptions;
|
|
68
|
-
private syncPickPathOptions;
|
|
69
|
-
private updatePickTargetGeometry;
|
|
70
|
-
pickTube: Tube | null;
|
|
71
|
-
private pickTargetVersion;
|
|
72
|
-
private pickBindings;
|
|
73
|
-
addPickTarget(radius?: number, show?: boolean): Promise<Tube | undefined>;
|
|
74
|
-
/** Restored picking children are adopted instead of allocating a duplicate tube. */
|
|
75
|
-
rebuildFromScene(): Promise<void>;
|
|
76
|
-
dispose(): void;
|
|
77
|
-
protected createPointerBinding(type: PickFunctionsItem['type'], cb: PickFunctionsItem['cb']): () => void;
|
|
78
|
-
setColor(color: string): void;
|
|
79
|
-
animateIn({ duration, delay, repeat, onComplete, onRepeat, }?: {
|
|
80
|
-
duration?: number;
|
|
81
|
-
delay?: number;
|
|
82
|
-
repeat?: number;
|
|
83
|
-
onComplete?: (...args: any[]) => void;
|
|
84
|
-
onRepeat?: (count: number) => void;
|
|
85
|
-
}): void;
|
|
86
|
-
render(): void;
|
|
87
|
-
}
|
|
95
|
+
/** Merge a privately prepared clipboard subtree; existing equal rows remain shared. */
|
|
96
|
+
export declare function appendObjectDocument(before: VisSceneDocument, sceneId: string, snapshot: any, parentUuid: string, materialAdditions?: readonly MaterialAsset[]): VisSceneDocument;
|
|
88
97
|
|
|
89
|
-
declare
|
|
98
|
+
export declare function appendScenesDocument(before: VisSceneDocument, scenes: readonly SceneViewportDocument[], materials?: readonly MaterialAsset[], prefabs?: readonly PrefabAsset[]): VisSceneDocument;
|
|
90
99
|
|
|
91
|
-
export
|
|
92
|
-
/** Maximum displacement from the endpoint segment along `up`, in world units. */
|
|
93
|
-
height: number;
|
|
94
|
-
/** World-space lift direction; normalized internally. Defaults to positive Z. */
|
|
95
|
-
up?: ArcPoint;
|
|
96
|
-
setPointWidth?: (progress: number) => number;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export declare type ArcPoint = THREE.Vector3 | readonly number[];
|
|
100
|
+
export { ArcPathOptions }
|
|
100
101
|
|
|
101
|
-
|
|
102
|
-
declare interface ArcSpherePath {
|
|
103
|
-
matrix: number[];
|
|
104
|
-
angle: number;
|
|
105
|
-
radius: number;
|
|
106
|
-
height: number;
|
|
107
|
-
}
|
|
102
|
+
export { ArcPoint }
|
|
108
103
|
|
|
109
|
-
export
|
|
110
|
-
/** World-space sphere center. Both endpoints must lie on the same sphere. */
|
|
111
|
-
center: ArcPoint;
|
|
112
|
-
/** Maximum distance above the sphere surface, in world units. Zero follows its surface. */
|
|
113
|
-
height: number;
|
|
114
|
-
/** World-space circle-plane normal for coincident or antipodal endpoints. */
|
|
115
|
-
normal?: ArcPoint;
|
|
116
|
-
setPointWidth?: (progress: number) => number;
|
|
117
|
-
}
|
|
104
|
+
export { ArcSpherePathOptions }
|
|
118
105
|
|
|
119
106
|
declare class Area extends GroupObject {
|
|
120
107
|
objectType: string;
|
|
121
|
-
options:
|
|
108
|
+
options: Options_8;
|
|
122
109
|
area: ExtrudePolygonObject[];
|
|
123
|
-
constructor(options:
|
|
110
|
+
constructor(options: Options_8);
|
|
124
111
|
create(): Promise<void>;
|
|
125
112
|
rebuildFromScene(): void;
|
|
126
113
|
}
|
|
@@ -137,7 +124,9 @@ export declare function assertSupportedSceneDocument(value: unknown): void;
|
|
|
137
124
|
|
|
138
125
|
export declare type Base = Base_2;
|
|
139
126
|
|
|
140
|
-
declare
|
|
127
|
+
declare type Base_2 = Base_3;
|
|
128
|
+
|
|
129
|
+
declare class Base_3 extends Camera {
|
|
141
130
|
static VisName: string;
|
|
142
131
|
runtimePolicy: {
|
|
143
132
|
observeParentScale: boolean;
|
|
@@ -152,13 +141,13 @@ declare class Base_2 extends Camera {
|
|
|
152
141
|
sceneResources: default_2['sceneResources'];
|
|
153
142
|
tier0: boolean;
|
|
154
143
|
roomEnvMap?: THREE.Texture;
|
|
155
|
-
private roomEnvTarget?;
|
|
156
144
|
private roomEnvLease?;
|
|
157
145
|
visName: string;
|
|
158
146
|
private detectRes?;
|
|
159
147
|
private ownsPencil;
|
|
160
148
|
private renderingSuspensions;
|
|
161
|
-
|
|
149
|
+
/** Internal: 在运行时创建前也可暂停,保证整个初始化过程不提交中间帧。 */
|
|
150
|
+
suspendRendering(): () => void;
|
|
162
151
|
private acquireRenderingSuspensions;
|
|
163
152
|
publicDir: Record<string, string>;
|
|
164
153
|
private prefabAssets;
|
|
@@ -166,7 +155,8 @@ declare class Base_2 extends Camera {
|
|
|
166
155
|
private prefabOperations;
|
|
167
156
|
/** Inspect SDK-enabled definitions without creating scene objects or resources. */
|
|
168
157
|
getPrefabLibrary(): PrefabAsset[];
|
|
169
|
-
|
|
158
|
+
/** Internal: Update definitions for future instances without rebuilding live content. */
|
|
159
|
+
setPrefabLibrary(assets?: readonly PrefabAsset[], materials?: MaterialAsset[]): void;
|
|
170
160
|
instantiatePrefab(keyOrAssetId: string, options?: InstantiatePrefabOptions): Promise<BaseObject>;
|
|
171
161
|
private cancelPrefabOperations;
|
|
172
162
|
constructor(options: BaseOptions);
|
|
@@ -181,12 +171,14 @@ declare class Base_2 extends Camera {
|
|
|
181
171
|
private resolveRendererDepthBufferOptions;
|
|
182
172
|
private showDetectRes;
|
|
183
173
|
setOptions(options: Record<string, any>): void;
|
|
184
|
-
|
|
174
|
+
/** Internal: Scene documents are loaded through SceneManager. */
|
|
175
|
+
fromJSON(jsonOrUrl: Record<string, any> | string, hooksE?: Record<string, any>, restoreOptions?: RestoreBaseObjectOptions): Promise<void>;
|
|
185
176
|
private runtimeInitialization?;
|
|
186
177
|
private disposed;
|
|
187
178
|
private readonly handleObjectIdentityChanged;
|
|
188
179
|
private readonly handleMaterialIdentityChanged;
|
|
189
|
-
|
|
180
|
+
/** Internal: 平台旧模板生成也复用这一步;不创建场景内容、不显示。 */
|
|
181
|
+
initializeRuntime(): Promise<void>;
|
|
190
182
|
/** 子类扩展点:运行环境只初始化一次,适合建立投影和绑定控制器事件。 */
|
|
191
183
|
protected onRuntimeReady(): Promise<void>;
|
|
192
184
|
/** 子类扩展点:恢复场景引用和运行时派生状态,不生成地图几何或移动相机。 */
|
|
@@ -267,46 +259,6 @@ declare class Base_2 extends Camera {
|
|
|
267
259
|
dispose(): void;
|
|
268
260
|
}
|
|
269
261
|
|
|
270
|
-
declare const baseObjectBounce: (obj: BaseObject, up: string | undefined, to: number) => {
|
|
271
|
-
start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
|
|
272
|
-
duration?: number | undefined;
|
|
273
|
-
repeat?: number | undefined;
|
|
274
|
-
repeatResolve?: number | undefined;
|
|
275
|
-
repeatDelay?: number | undefined;
|
|
276
|
-
}) => Promise<void>;
|
|
277
|
-
stop: () => void;
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
declare const baseObjectBounceIn: (obj: BaseObject, up?: string) => {
|
|
281
|
-
start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
|
|
282
|
-
duration?: number | undefined;
|
|
283
|
-
repeat?: number | undefined;
|
|
284
|
-
repeatResolve?: number | undefined;
|
|
285
|
-
repeatDelay?: number | undefined;
|
|
286
|
-
}) => Promise<void>;
|
|
287
|
-
stop: () => void;
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
declare const baseObjectFadeIn: (obj: BaseObject) => {
|
|
291
|
-
start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
|
|
292
|
-
duration?: number | undefined;
|
|
293
|
-
repeat?: number | undefined;
|
|
294
|
-
repeatResolve?: number | undefined;
|
|
295
|
-
repeatDelay?: number | undefined;
|
|
296
|
-
}) => Promise<void>;
|
|
297
|
-
stop: () => void;
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
declare const baseObjectFadeOut: (obj: BaseObject) => {
|
|
301
|
-
start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
|
|
302
|
-
duration?: number | undefined;
|
|
303
|
-
repeat?: number | undefined;
|
|
304
|
-
repeatResolve?: number | undefined;
|
|
305
|
-
repeatDelay?: number | undefined;
|
|
306
|
-
}) => Promise<void>;
|
|
307
|
-
stop: () => void;
|
|
308
|
-
};
|
|
309
|
-
|
|
310
262
|
declare interface BaseOptions {
|
|
311
263
|
container: HTMLElement;
|
|
312
264
|
assetsPrefix?: string;
|
|
@@ -338,6 +290,9 @@ export declare interface BindMaterialAssetOptions {
|
|
|
338
290
|
alias?: string;
|
|
339
291
|
}
|
|
340
292
|
|
|
293
|
+
/** Bind explicit slots; no render graph is exported to discover the changed rows. */
|
|
294
|
+
export declare function bindMaterialSlots(document: VisSceneDocument, sceneId: string, assignments: readonly MaterialSlotAssignment[], optionReplacements?: ReadonlyMap<string, ReadonlyMap<string, string>>, optionAssetId?: string): VisSceneDocument;
|
|
295
|
+
|
|
341
296
|
declare class Box extends MeshObject {
|
|
342
297
|
objectType: string;
|
|
343
298
|
create(): void;
|
|
@@ -345,8 +300,8 @@ declare class Box extends MeshObject {
|
|
|
345
300
|
|
|
346
301
|
declare class Building extends GroupObject {
|
|
347
302
|
objectType: string;
|
|
348
|
-
options:
|
|
349
|
-
constructor(options:
|
|
303
|
+
options: Options_6;
|
|
304
|
+
constructor(options: Options_6);
|
|
350
305
|
create(): Promise<void>;
|
|
351
306
|
rebuildFromScene(): void;
|
|
352
307
|
private gradientMaterials;
|
|
@@ -462,8 +417,8 @@ declare interface CityOptions {
|
|
|
462
417
|
|
|
463
418
|
declare class CityPlane extends MeshObject {
|
|
464
419
|
objectType: string;
|
|
465
|
-
options:
|
|
466
|
-
constructor(options:
|
|
420
|
+
options: Options_10;
|
|
421
|
+
constructor(options: Options_10);
|
|
467
422
|
plane: THREE.PlaneGeometry;
|
|
468
423
|
water?: Water;
|
|
469
424
|
create(): Promise<void>;
|
|
@@ -482,11 +437,17 @@ export declare function cloneSceneMaterials(document: VisSceneDocument, sourceId
|
|
|
482
437
|
/** Rebind internal targets while preserving links to scenes outside the copied set. */
|
|
483
438
|
export declare function cloneSceneWithIds(scene: SceneViewportDocument, ids: Map<string, string>): SceneViewportDocument;
|
|
484
439
|
|
|
440
|
+
/** Reuse only definitions with equal dependency payloads, never a UUID-only cache hit. */
|
|
441
|
+
export declare function collectSceneResourceReuse(target: any, candidates: readonly SceneResourceCandidate[]): Required<ReusableObjectResources>;
|
|
442
|
+
|
|
443
|
+
/** Configuration and alias values are additional conservative resource roots. */
|
|
444
|
+
export declare function collectStructureResources(graph: Record<string, any>, roots: readonly Record<string, any>[], additionalReferences?: readonly unknown[]): StructureResources;
|
|
445
|
+
|
|
485
446
|
declare class ContinentsBg extends GroupObject {
|
|
486
447
|
objectType: string;
|
|
487
|
-
options:
|
|
488
|
-
mapArr:
|
|
489
|
-
constructor(options:
|
|
448
|
+
options: Options_5;
|
|
449
|
+
mapArr: PlaneMap_2[];
|
|
450
|
+
constructor(options: Options_5);
|
|
490
451
|
create(): Promise<void>;
|
|
491
452
|
getLocationPosition(location: [number, number], name?: string, height?: number): [number, number, number] | undefined;
|
|
492
453
|
private calculatePosition;
|
|
@@ -495,9 +456,22 @@ declare class ContinentsBg extends GroupObject {
|
|
|
495
456
|
dispose(): void;
|
|
496
457
|
}
|
|
497
458
|
|
|
459
|
+
/** Copy only the copied branches; source nodes and existing resource rows keep
|
|
460
|
+
* their identity, including when several copies share one procedural geometry. */
|
|
461
|
+
export declare function copyNativeGeometries(document: VisSceneDocument, sceneId: string, pairs: readonly {
|
|
462
|
+
sourceUuid: string;
|
|
463
|
+
copyUuid: string;
|
|
464
|
+
}[], lead: BaseObject['lead']): VisSceneDocument;
|
|
465
|
+
|
|
466
|
+
/** The clipboard already owns its subtree. Capture the exact geometry shown in
|
|
467
|
+
* the editor so procedural create() cannot silently replace it after paste. */
|
|
468
|
+
export declare function copySnapshotGeometries(snapshot: any, source: BaseObject): void;
|
|
469
|
+
|
|
498
470
|
/** Explicit creation persists even with no aliases or object users. */
|
|
499
471
|
export declare function createMaterialAsset<T extends VisSceneDocument>(document: T, options: CreateMaterialAssetOptions): T;
|
|
500
472
|
|
|
473
|
+
export declare function createMaterialAssetDocument(document: VisSceneDocument, options: CreateMaterialAssetOptions): VisSceneDocument;
|
|
474
|
+
|
|
501
475
|
export declare interface CreateMaterialAssetOptions {
|
|
502
476
|
id: string;
|
|
503
477
|
name: string;
|
|
@@ -519,15 +493,29 @@ export declare function createRuntimeSceneDocument(document: VisSceneDocument):
|
|
|
519
493
|
/** Convert authored asset aliases to the native catalog expected by graph restoration. */
|
|
520
494
|
export declare function createRuntimeSceneGraph(scene: SceneViewportDocument, options?: {
|
|
521
495
|
omitPrefabPreviews?: boolean;
|
|
522
|
-
|
|
496
|
+
/** Internal: Transfer an exclusively owned scene graph instead of copying it. */
|
|
497
|
+
consumeInput?: boolean;
|
|
523
498
|
}): Record<string, any>;
|
|
524
499
|
|
|
500
|
+
/** Scan each Vis candidate once, including constructor-only material bindings. */
|
|
501
|
+
export declare function createSceneResourceReuseSession(candidates?: readonly SceneResourceCandidate[]): {
|
|
502
|
+
add: (candidate: SceneResourceCandidate) => void;
|
|
503
|
+
collect: (target: any, options?: {
|
|
504
|
+
environment?: () => any;
|
|
505
|
+
}) => Required<ReusableObjectResources>;
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
/** Reuse renderer indexes while retaining material asset aliases and prefab dependencies. */
|
|
509
|
+
export declare function createStructureResourceCollector(graph: Record<string, any>): (roots: readonly Record<string, any>[], additionalReferences?: readonly unknown[]) => StructureResources;
|
|
510
|
+
|
|
525
511
|
declare class DirectionalLight extends DirectionalLightObject {
|
|
526
512
|
constructor(...options: ConstructorParameters<typeof DirectionalLightObject>);
|
|
527
513
|
update(delta: number, elapsed: number): void;
|
|
528
514
|
render(): void;
|
|
529
515
|
}
|
|
530
516
|
|
|
517
|
+
export declare function duplicateMaterialAssetDocument(document: VisSceneDocument, id: string, newId: string, mode: 'asset' | 'object' | 'scene', sceneId: string, objectId?: string, slot?: number): VisSceneDocument;
|
|
518
|
+
|
|
531
519
|
/** One-click copy and apply; preserve the source's user-visible scope. */
|
|
532
520
|
export declare function duplicateMaterialForObject<T extends VisSceneDocument>(document: T, options: Omit<BindMaterialAssetOptions, 'alias'> & {
|
|
533
521
|
objectId: string;
|
|
@@ -535,33 +523,52 @@ export declare function duplicateMaterialForObject<T extends VisSceneDocument>(d
|
|
|
535
523
|
name?: string;
|
|
536
524
|
}): T;
|
|
537
525
|
|
|
526
|
+
/** Duplicate object identities and their rig bindings, while borrowing immutable content resources. */
|
|
527
|
+
export declare function duplicateObjectsDocument(before: VisSceneDocument, sceneId: string, targets: readonly {
|
|
528
|
+
uuid: string;
|
|
529
|
+
parentUuid: string;
|
|
530
|
+
matrix?: number[];
|
|
531
|
+
matrixAutoUpdate?: boolean;
|
|
532
|
+
}[]): {
|
|
533
|
+
document: VisSceneDocument;
|
|
534
|
+
uuids: string[];
|
|
535
|
+
};
|
|
536
|
+
|
|
537
|
+
/** Duplicate only the selected page and its own material assets. */
|
|
538
|
+
export declare function duplicateSceneDocument(before: VisSceneDocument, sceneId: string, id: string, name?: string): {
|
|
539
|
+
document: VisSceneDocument;
|
|
540
|
+
id: string;
|
|
541
|
+
};
|
|
542
|
+
|
|
538
543
|
export declare type Earth = Earth_2;
|
|
539
544
|
|
|
540
|
-
declare
|
|
545
|
+
declare type Earth_2 = Earth_3;
|
|
546
|
+
|
|
547
|
+
declare class Earth_3 extends Base_3 {
|
|
541
548
|
static VisName: string;
|
|
542
549
|
leftTruck: boolean;
|
|
543
550
|
options: Required<EarthOptions>;
|
|
544
|
-
map:
|
|
551
|
+
map: PlaneMap_2;
|
|
545
552
|
sphere?: BaseObject;
|
|
546
|
-
secondaryMap?:
|
|
553
|
+
secondaryMap?: PlaneMap_2;
|
|
547
554
|
get mapArea(): ExtrudePolygonObject[];
|
|
548
555
|
setOptions(options: EarthOptions): void;
|
|
549
556
|
protected applyControlOptions(controls: SceneControlsOptions): void;
|
|
550
557
|
protected get objectTypes(): {
|
|
551
|
-
Earth:
|
|
558
|
+
Earth: Earth_4;
|
|
552
559
|
SphereShadow: SphereShadow;
|
|
553
|
-
Countries: typeof
|
|
554
|
-
PlaneMap: typeof
|
|
560
|
+
Countries: typeof PlaneMap_2;
|
|
561
|
+
PlaneMap: typeof PlaneMap_2;
|
|
555
562
|
Point: Point;
|
|
556
|
-
Arc:
|
|
557
|
-
Model:
|
|
563
|
+
Arc: ArcObject;
|
|
564
|
+
Model: ModelObject;
|
|
558
565
|
Plane: Plane;
|
|
559
566
|
PlaneShadow: PlaneShadow;
|
|
560
567
|
Sphere: Sphere;
|
|
561
568
|
Sprite: Sprite;
|
|
562
569
|
Box: Box;
|
|
563
570
|
Circle: Circle;
|
|
564
|
-
Tube:
|
|
571
|
+
Tube: TubeObject;
|
|
565
572
|
Ring: Ring;
|
|
566
573
|
AmbientLight: AmbientLight;
|
|
567
574
|
DirectionalLight: DirectionalLight;
|
|
@@ -604,7 +611,7 @@ declare class Earth_2 extends Base_2 {
|
|
|
604
611
|
protected onSceneRestored(): Promise<void>;
|
|
605
612
|
}
|
|
606
613
|
|
|
607
|
-
declare class
|
|
614
|
+
declare class Earth_4 extends Sphere {
|
|
608
615
|
objectType: string;
|
|
609
616
|
options: Required<Options_2>;
|
|
610
617
|
constructor(options: Options_2);
|
|
@@ -627,6 +634,58 @@ declare interface EarthSceneBindings {
|
|
|
627
634
|
secondaryMap?: string;
|
|
628
635
|
}
|
|
629
636
|
|
|
637
|
+
export declare const editorEarthObjects: {
|
|
638
|
+
Earth: typeof Earth_4;
|
|
639
|
+
SphereShadow: typeof SphereShadow;
|
|
640
|
+
Countries: typeof PlaneMap_2;
|
|
641
|
+
PlaneMap: typeof PlaneMap_2;
|
|
642
|
+
Point: Point;
|
|
643
|
+
Arc: ArcObject;
|
|
644
|
+
Model: ModelObject;
|
|
645
|
+
Plane: Plane;
|
|
646
|
+
PlaneShadow: PlaneShadow;
|
|
647
|
+
Sphere: Sphere;
|
|
648
|
+
Sprite: Sprite;
|
|
649
|
+
Box: Box;
|
|
650
|
+
Circle: Circle;
|
|
651
|
+
Tube: TubeObject;
|
|
652
|
+
Ring: Ring;
|
|
653
|
+
AmbientLight: AmbientLight;
|
|
654
|
+
DirectionalLight: DirectionalLight;
|
|
655
|
+
PointLight: PointLight;
|
|
656
|
+
SpotLight: SpotLight;
|
|
657
|
+
HemisphereLight: HemisphereLight;
|
|
658
|
+
RectAreaLight: RectAreaLight;
|
|
659
|
+
Node: NodeObject;
|
|
660
|
+
ExtrudePolygon: ExtrudePolygonObject;
|
|
661
|
+
Line: LineObject;
|
|
662
|
+
Group: GroupObject;
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
export declare const editorObjects: {
|
|
666
|
+
Point: typeof Point;
|
|
667
|
+
Arc: typeof ArcObject;
|
|
668
|
+
Model: typeof ModelObject;
|
|
669
|
+
Plane: typeof Plane;
|
|
670
|
+
PlaneShadow: typeof PlaneShadow;
|
|
671
|
+
Sphere: typeof Sphere;
|
|
672
|
+
Sprite: typeof Sprite;
|
|
673
|
+
Box: typeof Box;
|
|
674
|
+
Circle: typeof Circle;
|
|
675
|
+
Tube: typeof TubeObject;
|
|
676
|
+
Ring: typeof Ring;
|
|
677
|
+
AmbientLight: typeof Lights.AmbientLight;
|
|
678
|
+
DirectionalLight: typeof Lights.DirectionalLight;
|
|
679
|
+
PointLight: typeof Lights.PointLight;
|
|
680
|
+
SpotLight: typeof Lights.SpotLight;
|
|
681
|
+
HemisphereLight: typeof Lights.HemisphereLight;
|
|
682
|
+
RectAreaLight: typeof Lights.RectAreaLight;
|
|
683
|
+
Node: typeof NodeObject;
|
|
684
|
+
ExtrudePolygon: typeof ExtrudePolygonObject;
|
|
685
|
+
Line: typeof LineObject;
|
|
686
|
+
Group: typeof GroupObject;
|
|
687
|
+
};
|
|
688
|
+
|
|
630
689
|
export declare type EmptySceneDefinition = Omit<SceneViewportDocument, 'scene'>;
|
|
631
690
|
|
|
632
691
|
declare class Event_2 {
|
|
@@ -640,26 +699,26 @@ declare class Event_2 {
|
|
|
640
699
|
dispose(): void;
|
|
641
700
|
}
|
|
642
701
|
|
|
643
|
-
|
|
702
|
+
/** Internal: Consume an exclusively owned import copy; pooled slots still get independent payloads. */
|
|
703
|
+
export declare function expandOwnedSceneDocumentResources<T extends VisSceneDocument>(expanded: T): T;
|
|
644
704
|
|
|
645
705
|
/** Expand at the editor import boundary so independently edited scenes own their data. */
|
|
646
706
|
export declare function expandSceneDocumentResources<T extends VisSceneDocument>(document: T): T;
|
|
647
707
|
|
|
708
|
+
/** Expand renderer pools, including snapshots retained as prefab baselines. */
|
|
709
|
+
export declare function expandStructureSnapshot<T extends Record<string, any>>(input: T): T;
|
|
710
|
+
|
|
648
711
|
/** Extract only this material's dependencies, without mutating the scene snapshot. */
|
|
649
712
|
export declare function extractMaterialDefinition(scene: SceneViewportDocument, materialUuid: string): Record<string, any>;
|
|
650
713
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
level: string;
|
|
657
|
-
parent: number;
|
|
658
|
-
c: number[];
|
|
659
|
-
b: number[];
|
|
660
|
-
} | undefined;
|
|
714
|
+
/** Extract current object resources without treating prefab baseline metadata as
|
|
715
|
+
* dependencies of the live object. Baselines remain in the copied metadata. */
|
|
716
|
+
export declare function extractObjectResourceGraph(graph: any, object: any): any;
|
|
717
|
+
|
|
718
|
+
export declare const findAdcodeInfo: (adcode: number) => AdcodeInfo | undefined;
|
|
661
719
|
|
|
662
720
|
declare type GeoJSON_2 = FeatureCollection<Polygon | MultiPolygon>;
|
|
721
|
+
export { GeoJSON_2 as GeoJSON }
|
|
663
722
|
|
|
664
723
|
declare type GeoJSON_3 = FeatureCollection<Polygon | MultiPolygon>;
|
|
665
724
|
|
|
@@ -678,9 +737,32 @@ export declare function getSceneDocument(document: VisSceneDocument, sceneId?: s
|
|
|
678
737
|
resolveResources?: boolean;
|
|
679
738
|
}): SceneViewportDocument;
|
|
680
739
|
|
|
740
|
+
/** An identity group shell keeps selected sibling objects and their transforms untouched. */
|
|
741
|
+
export declare function groupObjectsDocument(before: VisSceneDocument, sceneId: string, ids: readonly string[], options?: GroupObjectsDocumentOptions): {
|
|
742
|
+
document: VisSceneDocument;
|
|
743
|
+
uuid: string;
|
|
744
|
+
};
|
|
745
|
+
|
|
746
|
+
export declare interface GroupObjectsDocumentOptions {
|
|
747
|
+
/** Display name; hosts may supply their localized default. */
|
|
748
|
+
name?: string;
|
|
749
|
+
/** Authored BaseObject user data, separate from generated constructor metadata. */
|
|
750
|
+
userData?: Record<string, any>;
|
|
751
|
+
}
|
|
752
|
+
|
|
681
753
|
declare class HemisphereLight extends HemisphereLightObject {
|
|
682
754
|
}
|
|
683
755
|
|
|
756
|
+
declare type IdentityPath = (string | number)[];
|
|
757
|
+
|
|
758
|
+
export declare function indexedSceneObject(root: any, uuid: string): {
|
|
759
|
+
node: any;
|
|
760
|
+
path: readonly number[];
|
|
761
|
+
} | undefined;
|
|
762
|
+
|
|
763
|
+
/** Property-only immutable copies retain exactly the same UUID paths. */
|
|
764
|
+
export declare function inheritSceneObjectIndex(previous: any, next: any): void;
|
|
765
|
+
|
|
684
766
|
export declare interface InstantiatePrefabOptions {
|
|
685
767
|
/** Parent in the destination scene. Defaults to the scene root. */
|
|
686
768
|
target?: BaseObject;
|
|
@@ -688,6 +770,15 @@ export declare interface InstantiatePrefabOptions {
|
|
|
688
770
|
cloneMaterial?: boolean;
|
|
689
771
|
}
|
|
690
772
|
|
|
773
|
+
export declare function invalidateSceneObjectIndex(root: object | undefined): void;
|
|
774
|
+
|
|
775
|
+
export declare const isLocalSceneObjectField: (field: string) => boolean;
|
|
776
|
+
|
|
777
|
+
/** Editor integration: avoid applying an explicit host update twice. */
|
|
778
|
+
export declare function isObjectStateUpdateInProgress(object: BaseObject): boolean;
|
|
779
|
+
|
|
780
|
+
export declare const isSceneCameraField: (key: string) => boolean;
|
|
781
|
+
|
|
691
782
|
/**
|
|
692
783
|
* 新场景文档以完整场景快照作为恢复基线。
|
|
693
784
|
* 未带标记的 JSON 属于旧格式,仍由编辑器的兼容流程处理。
|
|
@@ -696,44 +787,50 @@ export declare function isSceneDocument(value: unknown): value is SceneDocumentM
|
|
|
696
787
|
|
|
697
788
|
export declare function isSceneManifest(value: unknown): value is VisSceneManifest;
|
|
698
789
|
|
|
790
|
+
export declare const isSceneObjectPropertyField: (field: string) => boolean;
|
|
791
|
+
|
|
792
|
+
declare namespace Lights {
|
|
793
|
+
export {
|
|
794
|
+
AmbientLight,
|
|
795
|
+
DirectionalLight,
|
|
796
|
+
PointLight,
|
|
797
|
+
SpotLight,
|
|
798
|
+
HemisphereLight,
|
|
799
|
+
RectAreaLight
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
|
|
699
803
|
/** Copy once and redirect every user in this scene, including its SceneResources aliases. */
|
|
700
804
|
export declare function makeMaterialSceneLocal<T extends VisSceneDocument>(document: T, assetId: string, sceneId: string, newAssetId: string): T;
|
|
701
805
|
|
|
702
806
|
declare type Map_2 = Map_3;
|
|
703
807
|
export { Map_2 as Map }
|
|
704
808
|
|
|
705
|
-
declare
|
|
809
|
+
declare type Map_3 = Map_4;
|
|
810
|
+
|
|
811
|
+
declare class Map_4 extends Base_3 {
|
|
706
812
|
static VisName: string;
|
|
707
813
|
options: Required<MapCityOptions>;
|
|
708
814
|
/** 当前唯一主地图的运行时状态。 */
|
|
709
815
|
mapObj: {
|
|
710
|
-
map:
|
|
816
|
+
map: PlaneMap_2;
|
|
711
817
|
mapInfo: NonNullable<ReturnType<typeof findAdcodeInfo>>;
|
|
712
818
|
z: number;
|
|
713
819
|
cX: number;
|
|
714
820
|
cY: number;
|
|
715
821
|
depth: number;
|
|
716
822
|
} | undefined;
|
|
717
|
-
get map():
|
|
718
|
-
get mapInfo():
|
|
719
|
-
adcode: number;
|
|
720
|
-
lng: number;
|
|
721
|
-
lat: number;
|
|
722
|
-
name: string;
|
|
723
|
-
level: string;
|
|
724
|
-
parent: number;
|
|
725
|
-
c: number[];
|
|
726
|
-
b: number[];
|
|
727
|
-
} | undefined;
|
|
823
|
+
get map(): PlaneMap_2 | undefined;
|
|
824
|
+
get mapInfo(): AdcodeInfo | undefined;
|
|
728
825
|
get mapArea(): ExtrudePolygonObject[] | undefined;
|
|
729
826
|
get mapLine(): LineObject[] | undefined;
|
|
730
827
|
/** 当前已恢复或生成的主地图区域;空场景为 undefined。 */
|
|
731
828
|
get adcode(): number | undefined;
|
|
732
|
-
activePlaneMap:
|
|
829
|
+
activePlaneMap: PlaneMap_2 | null;
|
|
733
830
|
/** 宿主大屏图表等遮挡形成的运行时安全区;不写入场景 options。 */
|
|
734
831
|
private safeAreaInsets?;
|
|
735
832
|
private safeAreaRefitPending;
|
|
736
|
-
parentBg:
|
|
833
|
+
parentBg: PlaneMap_2[];
|
|
737
834
|
continentsBg?: ContinentsBg;
|
|
738
835
|
group: GroupObject;
|
|
739
836
|
projection: GeoProjection;
|
|
@@ -754,7 +851,7 @@ declare class Map_3 extends Base_2 {
|
|
|
754
851
|
private _getProjectionRotate;
|
|
755
852
|
private _getSplitPolygons;
|
|
756
853
|
protected get objectTypes(): {
|
|
757
|
-
PlaneMap: typeof
|
|
854
|
+
PlaneMap: typeof PlaneMap_2;
|
|
758
855
|
ContinentsBg: typeof ContinentsBg;
|
|
759
856
|
Mountain: Mountain;
|
|
760
857
|
CityPlane: CityPlane;
|
|
@@ -762,15 +859,15 @@ declare class Map_3 extends Base_2 {
|
|
|
762
859
|
Building: Building;
|
|
763
860
|
Road: Road;
|
|
764
861
|
Point: Point;
|
|
765
|
-
Arc:
|
|
766
|
-
Model:
|
|
862
|
+
Arc: ArcObject;
|
|
863
|
+
Model: ModelObject;
|
|
767
864
|
Plane: Plane;
|
|
768
865
|
PlaneShadow: PlaneShadow;
|
|
769
866
|
Sphere: Sphere;
|
|
770
867
|
Sprite: Sprite;
|
|
771
868
|
Box: Box;
|
|
772
869
|
Circle: Circle;
|
|
773
|
-
Tube:
|
|
870
|
+
Tube: TubeObject;
|
|
774
871
|
Ring: Ring;
|
|
775
872
|
AmbientLight: AmbientLight;
|
|
776
873
|
DirectionalLight: DirectionalLight;
|
|
@@ -786,8 +883,12 @@ declare class Map_3 extends Base_2 {
|
|
|
786
883
|
protected get defaultCameraUp(): THREE.Vector3;
|
|
787
884
|
protected onRuntimeReady(): Promise<void>;
|
|
788
885
|
protected prepareInitialCamera(): Promise<void>;
|
|
886
|
+
private mapBoundaryMatrix?;
|
|
887
|
+
private mapBoundaryEnabled?;
|
|
888
|
+
private refreshMapBoundary;
|
|
789
889
|
private updateMapBoundary;
|
|
790
|
-
|
|
890
|
+
/** Internal: 新生成区域的收尾;完整快照还原由 onSceneRestored 派生标签。 */
|
|
891
|
+
finalizeRegionGeometry(): Promise<void>;
|
|
791
892
|
private prepareCityVis;
|
|
792
893
|
private preloadCityVis;
|
|
793
894
|
/** Keep at most two cities ahead in the loader; all Lead writes stay ordered. */
|
|
@@ -836,7 +937,12 @@ declare class Map_3 extends Base_2 {
|
|
|
836
937
|
private _loadGeojsonFromConfig;
|
|
837
938
|
private _loadBaseGeojson;
|
|
838
939
|
private getGeojson;
|
|
839
|
-
|
|
940
|
+
/** Internal: 生成地图层;导航必须通过 SceneManager。 */
|
|
941
|
+
buildRegion({ adcode, depth, extrudelineBloom, }: {
|
|
942
|
+
adcode: number;
|
|
943
|
+
depth?: number;
|
|
944
|
+
extrudelineBloom?: boolean;
|
|
945
|
+
}): Promise<void>;
|
|
840
946
|
/** 流式读取实际世界坐标,不复制或持有地图几何。 */
|
|
841
947
|
private cameraFitPoints;
|
|
842
948
|
private cameraForPose;
|
|
@@ -863,22 +969,13 @@ declare class Map_3 extends Base_2 {
|
|
|
863
969
|
depth: number;
|
|
864
970
|
adcode: number;
|
|
865
971
|
extrudelineBloom?: boolean;
|
|
866
|
-
}): Promise<
|
|
972
|
+
}): Promise<PlaneMap_2>;
|
|
867
973
|
private getEffectiveSafeAreaPadding;
|
|
868
974
|
/** undefined 表示沿用设计师构图;对象(包括全 0)表示宿主覆盖。 */
|
|
869
975
|
getSafeAreaInsets(): MapSafeAreaInsets | undefined;
|
|
870
976
|
setSafeAreaInsets(insets?: Partial<MapSafeAreaInsets>, options?: MapSafeAreaOptions): Promise<void>;
|
|
871
977
|
refitSafeAreaIfNeeded(options?: MapSafeAreaOptions): Promise<boolean>;
|
|
872
|
-
findAdcodeInfo(adcode: number):
|
|
873
|
-
adcode: number;
|
|
874
|
-
lng: number;
|
|
875
|
-
lat: number;
|
|
876
|
-
name: string;
|
|
877
|
-
level: string;
|
|
878
|
-
parent: number;
|
|
879
|
-
c: number[];
|
|
880
|
-
b: number[];
|
|
881
|
-
} | undefined;
|
|
978
|
+
findAdcodeInfo(adcode: number): AdcodeInfo | undefined;
|
|
882
979
|
/**
|
|
883
980
|
* 根据目标 adcode 更新 options 中依赖 adcode 的字段
|
|
884
981
|
*/
|
|
@@ -902,7 +999,8 @@ declare class Map_3 extends Base_2 {
|
|
|
902
999
|
* Apply the region behavior authored on each object.
|
|
903
1000
|
*/
|
|
904
1001
|
private applyRegionObjectState;
|
|
905
|
-
|
|
1002
|
+
/** Internal: 仅由 SceneManager 在隔离页面调用,成功后才对外提交。 */
|
|
1003
|
+
rebuildRegion(targetAdcode: number, switchKey?: string): Promise<void>;
|
|
906
1004
|
private rebuildRegionGeometry;
|
|
907
1005
|
/** 候选区域提交后的相机过渡,不参与场景序列化。 */
|
|
908
1006
|
playRegionEnterTransition({ duration, sourceCamera, preparedCamera, onPrepared, }: MapRegionEnterTransitionOptions): Promise<void>;
|
|
@@ -911,6 +1009,19 @@ declare class Map_3 extends Base_2 {
|
|
|
911
1009
|
private setRegionTexture;
|
|
912
1010
|
applyRegionTextureRules(adcode: number): Promise<void>;
|
|
913
1011
|
protected onDispose(): void;
|
|
1012
|
+
private static mapCameraContext;
|
|
1013
|
+
private static labelsContext;
|
|
1014
|
+
private static cityLayersContext;
|
|
1015
|
+
private static backgroundsContext;
|
|
1016
|
+
private static regionOverlaysContext;
|
|
1017
|
+
private static regionTexturesContext;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
export declare interface MapAnchor {
|
|
1021
|
+
longitude: number;
|
|
1022
|
+
latitude: number;
|
|
1023
|
+
/** Must match mapCRS; this API does not convert WGS84/GCJ02/BD09. */
|
|
1024
|
+
crs: string;
|
|
914
1025
|
}
|
|
915
1026
|
|
|
916
1027
|
declare interface MapAssetSources {
|
|
@@ -987,6 +1098,7 @@ declare interface MapOptions extends BaseOptions {
|
|
|
987
1098
|
polarAngle?: number;
|
|
988
1099
|
azimuthAngle?: number;
|
|
989
1100
|
worldPacificCentre?: boolean;
|
|
1101
|
+
/** 同时限制平移范围、最近缩放距离,以及穿透地图和翻转到背面的视角。默认 true。 */
|
|
990
1102
|
mapBoundary?: boolean;
|
|
991
1103
|
mergeSide?: boolean;
|
|
992
1104
|
/** switchMapRegion 时重建城市建筑、道路、河流等数据层。 */
|
|
@@ -1004,6 +1116,16 @@ declare interface MapOptions extends BaseOptions {
|
|
|
1004
1116
|
assetSources?: MapAssetSources;
|
|
1005
1117
|
}
|
|
1006
1118
|
|
|
1119
|
+
export declare interface MapPlacementOptions {
|
|
1120
|
+
mapCRS: string;
|
|
1121
|
+
/** Explicit ground meshes only. Exclude the model, roofs, helpers and hidden surfaces. */
|
|
1122
|
+
surfaces: Object3D[];
|
|
1123
|
+
/** Model's physical height; optional if already in map units. Z is model/map up. */
|
|
1124
|
+
heightMeters?: number;
|
|
1125
|
+
/** Clearance in map units along map Z. */
|
|
1126
|
+
clearance?: number;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1007
1129
|
export declare interface MapRegionBackInteraction {
|
|
1008
1130
|
trigger: 'click' | 'clickOutside';
|
|
1009
1131
|
objectId: string;
|
|
@@ -1015,7 +1137,8 @@ export declare interface MapRegionBackInteraction {
|
|
|
1015
1137
|
|
|
1016
1138
|
declare interface MapRegionEnterTransitionOptions extends SceneEnterTransitionOptions {
|
|
1017
1139
|
sourceCamera?: [number, number, number, number, number, number];
|
|
1018
|
-
|
|
1140
|
+
/** 场景管理器已完成地图和宿主准备后的最终姿态。 */
|
|
1141
|
+
preparedCamera?: [number, number, number, number, number, number];
|
|
1019
1142
|
}
|
|
1020
1143
|
|
|
1021
1144
|
export declare type MapRegionSceneResolver = (document: VisSceneDocument, adcode: number) => string | SceneViewportDocument | null | undefined | Promise<string | SceneViewportDocument | null | undefined>;
|
|
@@ -1089,10 +1212,28 @@ export declare interface MaterialDefinitionScope {
|
|
|
1089
1212
|
readonly properties: readonly string[];
|
|
1090
1213
|
}
|
|
1091
1214
|
|
|
1215
|
+
/** Copy-on-write operations for committed documents; callers own validation and transactions.
|
|
1216
|
+
* The normalization-aware project APIs use the same implementation after preparing their inputs.
|
|
1217
|
+
*/
|
|
1218
|
+
export declare const materialDocumentOperations: Readonly<{
|
|
1219
|
+
materialize: typeof materializeChangedAssets;
|
|
1220
|
+
create: typeof createMaterialAssetDocument;
|
|
1221
|
+
replace: typeof replaceMaterialAssetDocument;
|
|
1222
|
+
registerSceneMaterials: typeof registerSceneMaterials;
|
|
1223
|
+
bindSlots: typeof bindMaterialSlots;
|
|
1224
|
+
duplicate: typeof duplicateMaterialAssetDocument;
|
|
1225
|
+
promote: typeof promoteMaterialAssetDocument;
|
|
1226
|
+
remove: typeof removeMaterialAssetDocument;
|
|
1227
|
+
}>;
|
|
1228
|
+
|
|
1092
1229
|
/** One explicit mapping from an asset's authored resource UUIDs to runtime resource UUIDs. */
|
|
1093
1230
|
export declare function materializeAssetDefinition(asset: MaterialAsset, materialUuid?: string): Record<string, any>;
|
|
1094
1231
|
|
|
1095
|
-
|
|
1232
|
+
/** Project only changed assets. Object trees and unrelated resource payloads stay borrowed. */
|
|
1233
|
+
export declare function materializeChangedAssets(document: VisSceneDocument, assets: readonly MaterialAsset[], sceneIds?: ReadonlySet<string>): VisSceneDocument;
|
|
1234
|
+
|
|
1235
|
+
/** Internal: Materialize an exclusively owned document while preserving owned geometry tables. */
|
|
1236
|
+
export declare function materializeOwnedProjectMaterials<T extends VisSceneDocument>(document: T): T;
|
|
1096
1237
|
|
|
1097
1238
|
/** Mutate a detached working snapshot owned exclusively by the caller. */
|
|
1098
1239
|
export declare function materializeOwnedSceneMaterials<T extends SceneViewportDocument>(scene: T, library?: MaterialAsset[]): T;
|
|
@@ -1120,6 +1261,12 @@ export declare type MaterialScope = {
|
|
|
1120
1261
|
sceneId: string;
|
|
1121
1262
|
};
|
|
1122
1263
|
|
|
1264
|
+
export declare type MaterialSlotAssignment = {
|
|
1265
|
+
uuid: string;
|
|
1266
|
+
slot: number;
|
|
1267
|
+
assetId: string;
|
|
1268
|
+
};
|
|
1269
|
+
|
|
1123
1270
|
export declare interface MaterialUsage {
|
|
1124
1271
|
assetId: string;
|
|
1125
1272
|
sceneId: string;
|
|
@@ -1130,6 +1277,11 @@ export declare interface MaterialUsage {
|
|
|
1130
1277
|
alias?: string;
|
|
1131
1278
|
}
|
|
1132
1279
|
|
|
1280
|
+
declare type MatrixState = {
|
|
1281
|
+
matrix: number[];
|
|
1282
|
+
matrixAutoUpdate?: boolean;
|
|
1283
|
+
};
|
|
1284
|
+
|
|
1133
1285
|
/** Save author edits without promoting page-local region textures into a shared definition. */
|
|
1134
1286
|
export declare function mergeAuthoredMaterialDefinition(savedDefinition: Record<string, any>, runtimeDefinition: Record<string, any>, options?: {
|
|
1135
1287
|
editedProperties?: string[];
|
|
@@ -1141,76 +1293,11 @@ export declare function mergeProjectMaterials(target: VisSceneDocument, incoming
|
|
|
1141
1293
|
idMap: Map<string, string>;
|
|
1142
1294
|
};
|
|
1143
1295
|
|
|
1144
|
-
declare class Model extends GroupObject {
|
|
1145
|
-
options: Options_7;
|
|
1146
|
-
mixer: THREE.AnimationMixer | null;
|
|
1147
|
-
clips: THREE.AnimationClip[];
|
|
1148
|
-
actions: THREE.AnimationAction[];
|
|
1149
|
-
actionStates: Record<string, boolean>;
|
|
1150
|
-
objectType: string;
|
|
1151
|
-
constructor(options: Options_7);
|
|
1152
|
-
create(): Promise<void>;
|
|
1153
|
-
render(): void;
|
|
1154
|
-
/**
|
|
1155
|
-
* Set animation clips for the model
|
|
1156
|
-
* @param clips Array of animation clips from GLTF
|
|
1157
|
-
*/
|
|
1158
|
-
setClips(clips: THREE.AnimationClip[]): void;
|
|
1159
|
-
/**
|
|
1160
|
-
* Play all animation clips
|
|
1161
|
-
*/
|
|
1162
|
-
playAllClips(): void;
|
|
1163
|
-
/**
|
|
1164
|
-
* Play a specific animation clip by name
|
|
1165
|
-
* @param clipName Name of the animation clip to play
|
|
1166
|
-
*/
|
|
1167
|
-
playClip(clipName: string): void;
|
|
1168
|
-
/**
|
|
1169
|
-
* Stop a specific animation clip by name
|
|
1170
|
-
* @param clipName Name of the animation clip to stop
|
|
1171
|
-
*/
|
|
1172
|
-
stopClip(clipName: string): void;
|
|
1173
|
-
/**
|
|
1174
|
-
* Stop all animation clips
|
|
1175
|
-
*/
|
|
1176
|
-
stopAllClips(): void;
|
|
1177
|
-
/**
|
|
1178
|
-
* Set the playback speed for all animations
|
|
1179
|
-
* @param speed Playback speed (1.0 = normal speed)
|
|
1180
|
-
*/
|
|
1181
|
-
setPlaybackSpeed(speed: number): void;
|
|
1182
|
-
/**
|
|
1183
|
-
* Get the current playback speed
|
|
1184
|
-
*/
|
|
1185
|
-
getPlaybackSpeed(): number;
|
|
1186
|
-
/**
|
|
1187
|
-
* Check if a specific animation is playing
|
|
1188
|
-
* @param clipName Name of the animation clip
|
|
1189
|
-
*/
|
|
1190
|
-
isPlaying(clipName: string): boolean;
|
|
1191
|
-
/**
|
|
1192
|
-
* Get all available animation clip names
|
|
1193
|
-
*/
|
|
1194
|
-
getClipNames(): string[];
|
|
1195
|
-
rebuildFromScene(): Promise<void>;
|
|
1196
|
-
instantiate(ops?: Parameters<GroupObject['instantiate']>[0]): Promise<this>;
|
|
1197
|
-
/**
|
|
1198
|
-
* Update animations - should be called in render loop
|
|
1199
|
-
* @param deltaTime Time elapsed since last frame
|
|
1200
|
-
*/
|
|
1201
|
-
update(deltaTime: number): void;
|
|
1202
|
-
/**
|
|
1203
|
-
* Dispose of resources including animation mixer
|
|
1204
|
-
*/
|
|
1205
|
-
dispose(): void;
|
|
1206
|
-
private syncPlayingClipNames;
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
1296
|
declare class Mountain extends GroupObject {
|
|
1210
1297
|
objectType: string;
|
|
1211
|
-
options: Required<Omit<
|
|
1298
|
+
options: Required<Omit<Options_9, 'bbox'>> & Pick<Options_9, 'bbox'>;
|
|
1212
1299
|
extrudePolygon: ExtrudePolygonObject;
|
|
1213
|
-
constructor(options:
|
|
1300
|
+
constructor(options: Options_9);
|
|
1214
1301
|
geojson2Meta(geojson: GeoJSON_4): {
|
|
1215
1302
|
coords: Position[][];
|
|
1216
1303
|
properties: GeoJsonProperties;
|
|
@@ -1220,11 +1307,24 @@ declare class Mountain extends GroupObject {
|
|
|
1220
1307
|
rebuildFromScene(): void;
|
|
1221
1308
|
}
|
|
1222
1309
|
|
|
1223
|
-
|
|
1310
|
+
/** Reparent/reorder roots with caller-computed local matrices, without copying their descendants. */
|
|
1311
|
+
export declare function moveObjectsDocument(before: VisSceneDocument, sceneId: string, ids: readonly string[], parentUuid: string, order: readonly string[], matrices: ReadonlyMap<string, MatrixState>): VisSceneDocument;
|
|
1312
|
+
|
|
1313
|
+
/** Keep saved texture/image identities stable across runtime namespace and revision changes. */
|
|
1314
|
+
export declare function normalizeMaterialDefinition<T extends Record<string, any>>(input: T): T;
|
|
1315
|
+
|
|
1316
|
+
/** Internal: Normalize an exclusively owned import copy without copying its geometry payloads. */
|
|
1317
|
+
export declare function normalizeOwnedProjectMaterials<T extends VisSceneDocument>(document: T): T;
|
|
1224
1318
|
|
|
1225
1319
|
/** Bind serialized runtime materials and alias catalogs to authored assets. */
|
|
1226
1320
|
export declare function normalizeProjectMaterials<T extends VisSceneDocument>(document: T): T;
|
|
1227
1321
|
|
|
1322
|
+
/** Paths belong to an immutable serialized object tree, never to live Three.js objects. */
|
|
1323
|
+
declare type ObjectIndex = Map<string, {
|
|
1324
|
+
path: readonly number[];
|
|
1325
|
+
lengths: readonly number[];
|
|
1326
|
+
}>;
|
|
1327
|
+
|
|
1228
1328
|
declare interface Options {
|
|
1229
1329
|
/** @deprecated Legacy generation scope, read only when importing old snapshots. */
|
|
1230
1330
|
uuid?: string;
|
|
@@ -1264,44 +1364,6 @@ declare interface Options {
|
|
|
1264
1364
|
}
|
|
1265
1365
|
|
|
1266
1366
|
declare interface Options_10 {
|
|
1267
|
-
uuid?: string;
|
|
1268
|
-
jsonUrl: string;
|
|
1269
|
-
projection: {
|
|
1270
|
-
center: [number, number];
|
|
1271
|
-
scale: number;
|
|
1272
|
-
};
|
|
1273
|
-
cacheKey?: string;
|
|
1274
|
-
meters?: number;
|
|
1275
|
-
grey?: boolean;
|
|
1276
|
-
material?: MeshLineMaterial;
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
|
-
declare interface Options_11 {
|
|
1280
|
-
uuid?: string;
|
|
1281
|
-
jsonUrl: string;
|
|
1282
|
-
projection: {
|
|
1283
|
-
center: [number, number];
|
|
1284
|
-
scale: number;
|
|
1285
|
-
};
|
|
1286
|
-
material: THREE.Material;
|
|
1287
|
-
type: string;
|
|
1288
|
-
cacheKey?: string;
|
|
1289
|
-
oArr?: number[];
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
declare interface Options_12 {
|
|
1293
|
-
geojson: GeoJSON_4;
|
|
1294
|
-
projection: {
|
|
1295
|
-
center: [number, number];
|
|
1296
|
-
scale: number;
|
|
1297
|
-
rotate?: [number, number];
|
|
1298
|
-
projectionType?: 'mercator' | 'equirectangular' | 'winkel3';
|
|
1299
|
-
};
|
|
1300
|
-
depth?: number;
|
|
1301
|
-
bbox?: number[];
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
declare interface Options_13 {
|
|
1305
1367
|
width: number;
|
|
1306
1368
|
height: number;
|
|
1307
1369
|
material?: THREE.Material;
|
|
@@ -1322,37 +1384,7 @@ declare interface Options_4 {
|
|
|
1322
1384
|
sprite?: boolean;
|
|
1323
1385
|
}
|
|
1324
1386
|
|
|
1325
|
-
declare interface Options_5
|
|
1326
|
-
from: number[];
|
|
1327
|
-
to: number[];
|
|
1328
|
-
control1?: number[];
|
|
1329
|
-
control2?: number[];
|
|
1330
|
-
spherePath?: ArcSpherePath;
|
|
1331
|
-
radius?: number;
|
|
1332
|
-
globe?: boolean;
|
|
1333
|
-
color?: string;
|
|
1334
|
-
lineWidth?: number;
|
|
1335
|
-
offsetLoop?: boolean;
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
|
-
declare interface Options_6 {
|
|
1339
|
-
path?: THREE.Curve<THREE.Vector3>;
|
|
1340
|
-
radius?: number;
|
|
1341
|
-
multiplyScalar?: number;
|
|
1342
|
-
/** Compact saved inputs for an Arc's derived picking geometry. */
|
|
1343
|
-
arcControlPoints?: number[][];
|
|
1344
|
-
arcSpherePath?: ArcSpherePath;
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
declare interface Options_7 {
|
|
1348
|
-
src?: string;
|
|
1349
|
-
autoPlay?: boolean;
|
|
1350
|
-
playbackSpeed?: number;
|
|
1351
|
-
serializedClips?: SerializedClip[];
|
|
1352
|
-
playingClipNames?: string[];
|
|
1353
|
-
}
|
|
1354
|
-
|
|
1355
|
-
declare interface Options_8 {
|
|
1387
|
+
declare interface Options_5 {
|
|
1356
1388
|
materialOptions: {
|
|
1357
1389
|
topMat: THREE.Material;
|
|
1358
1390
|
sideMat: THREE.Material;
|
|
@@ -1364,7 +1396,7 @@ declare interface Options_8 {
|
|
|
1364
1396
|
geojsonSource: string;
|
|
1365
1397
|
}
|
|
1366
1398
|
|
|
1367
|
-
declare interface
|
|
1399
|
+
declare interface Options_6 {
|
|
1368
1400
|
uuid?: string;
|
|
1369
1401
|
jsonUrl: string;
|
|
1370
1402
|
projection: {
|
|
@@ -1380,20 +1412,80 @@ declare interface Options_9 {
|
|
|
1380
1412
|
materialOptions?: Record<string, THREE.Material>;
|
|
1381
1413
|
}
|
|
1382
1414
|
|
|
1415
|
+
declare interface Options_7 {
|
|
1416
|
+
uuid?: string;
|
|
1417
|
+
jsonUrl: string;
|
|
1418
|
+
projection: {
|
|
1419
|
+
center: [number, number];
|
|
1420
|
+
scale: number;
|
|
1421
|
+
};
|
|
1422
|
+
cacheKey?: string;
|
|
1423
|
+
meters?: number;
|
|
1424
|
+
grey?: boolean;
|
|
1425
|
+
material?: MeshLineMaterial;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
declare interface Options_8 {
|
|
1429
|
+
uuid?: string;
|
|
1430
|
+
jsonUrl: string;
|
|
1431
|
+
projection: {
|
|
1432
|
+
center: [number, number];
|
|
1433
|
+
scale: number;
|
|
1434
|
+
};
|
|
1435
|
+
material: THREE.Material;
|
|
1436
|
+
type: string;
|
|
1437
|
+
cacheKey?: string;
|
|
1438
|
+
oArr?: number[];
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
declare interface Options_9 {
|
|
1442
|
+
geojson: GeoJSON_4;
|
|
1443
|
+
projection: {
|
|
1444
|
+
center: [number, number];
|
|
1445
|
+
scale: number;
|
|
1446
|
+
rotate?: [number, number];
|
|
1447
|
+
projectionType?: 'mercator' | 'equirectangular' | 'winkel3';
|
|
1448
|
+
};
|
|
1449
|
+
depth?: number;
|
|
1450
|
+
bbox?: number[];
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1383
1453
|
/** Pack an export copy only; preserve the editor's independent scene snapshots. */
|
|
1384
1454
|
export declare function packSceneDocumentResources<T extends VisSceneDocument>(document: T): T;
|
|
1385
1455
|
|
|
1456
|
+
/** Clone each affected ancestor/children array once, without visiting other subtrees. */
|
|
1457
|
+
export declare function patchIndexedSceneObjects(root: any, updates: ReadonlyMap<string, {
|
|
1458
|
+
state: Record<string, any>;
|
|
1459
|
+
unset?: string[];
|
|
1460
|
+
}>): any;
|
|
1461
|
+
|
|
1462
|
+
/** Validate only authored scalar fields; the committed baseline already owns the unchanged graph/resources. */
|
|
1463
|
+
export declare function patchSceneObjectPropertiesDocument(document: VisSceneDocument, sceneId: string, patches: readonly SceneObjectPropertyPatch[]): VisSceneDocument;
|
|
1464
|
+
|
|
1386
1465
|
export declare function patchSceneStructureDocument(document: VisSceneDocument, sceneId: string, patch: SceneStructurePatch): VisSceneDocument;
|
|
1387
1466
|
|
|
1388
1467
|
/** Validate every affected scene and both catalogs before exposing any saved state. */
|
|
1389
1468
|
export declare function patchSceneStructureTransactionDocument(document: VisSceneDocument, transaction: SceneStructureTransaction): VisSceneDocument;
|
|
1390
1469
|
|
|
1470
|
+
/** Own only the small viewport payload and copy the camera's ancestor path. */
|
|
1471
|
+
export declare function patchSceneViewportDocument(document: VisSceneDocument, sceneId: string, patch: SceneViewportPatch): VisSceneDocument;
|
|
1472
|
+
|
|
1473
|
+
export declare interface PlanarMap {
|
|
1474
|
+
object3d: Object3D;
|
|
1475
|
+
options: {
|
|
1476
|
+
projection?: ProjectionOptions;
|
|
1477
|
+
conic?: boolean;
|
|
1478
|
+
};
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1391
1481
|
declare class Plane extends MeshObject {
|
|
1392
1482
|
objectType: string;
|
|
1393
1483
|
create(): void;
|
|
1394
1484
|
}
|
|
1395
1485
|
|
|
1396
|
-
declare
|
|
1486
|
+
export declare type PlaneMap = PlaneMap_2;
|
|
1487
|
+
|
|
1488
|
+
declare class PlaneMap_2 extends GroupObject {
|
|
1397
1489
|
objectType: string;
|
|
1398
1490
|
options: Required<Omit<Options, 'bbox' | 'extrudeLineGeojson' | 'uuid'>> & Pick<Options, 'bbox' | 'extrudeLineGeojson' | 'uuid'>;
|
|
1399
1491
|
isActive: boolean;
|
|
@@ -1462,6 +1554,20 @@ declare class PlaneShadow extends MeshObject {
|
|
|
1462
1554
|
create(): Promise<void>;
|
|
1463
1555
|
}
|
|
1464
1556
|
|
|
1557
|
+
/** Read-only plan. Aligns the model bounds center in XY and lowest vertex to actual ground.
|
|
1558
|
+
* Apply the returned local matrix to a detached candidate, serialize, then import/replace once.
|
|
1559
|
+
*/
|
|
1560
|
+
export declare function planPlacement(model: Object3D, map: PlanarMap, anchor: MapAnchor, options: MapPlacementOptions): {
|
|
1561
|
+
localMatrix: Matrix4;
|
|
1562
|
+
worldMatrix: Matrix4;
|
|
1563
|
+
groundPoint: Vector3Tuple;
|
|
1564
|
+
groundObjectUuid: string;
|
|
1565
|
+
mapPosition: number[];
|
|
1566
|
+
scaleBasis: "local spherical approximation";
|
|
1567
|
+
xUnitsPerMeter: number;
|
|
1568
|
+
yUnitsPerMeter: number;
|
|
1569
|
+
};
|
|
1570
|
+
|
|
1465
1571
|
declare class Point extends BaseObject {
|
|
1466
1572
|
objectType: string;
|
|
1467
1573
|
options: Options_4;
|
|
@@ -1497,12 +1603,28 @@ export declare interface PreparedSceneStructure {
|
|
|
1497
1603
|
|
|
1498
1604
|
declare const preparedSceneStructure: unique symbol;
|
|
1499
1605
|
|
|
1606
|
+
export declare function prepareGeometryBinding(before: VisSceneDocument, sceneId: string, uuid: string, input: GeometryDefinition | null, override: boolean): VisSceneDocument;
|
|
1607
|
+
|
|
1608
|
+
/** Change one binding; a conflicting borrowed UUID must not overwrite its other users. */
|
|
1609
|
+
export declare function prepareGeometryEdit(before: VisSceneDocument, sceneId: string, uuid: string, input: GeometryDefinition | null): VisSceneDocument;
|
|
1610
|
+
|
|
1611
|
+
/** Uses the same projection and Y sign as PlaneMap geometry, then its world matrix. */
|
|
1612
|
+
export declare function projectLocation(map: PlanarMap, anchor: MapAnchor, mapCRS: string): {
|
|
1613
|
+
local: Vector3;
|
|
1614
|
+
world: Vector3;
|
|
1615
|
+
xUnitsPerMeter: number;
|
|
1616
|
+
yUnitsPerMeter: number;
|
|
1617
|
+
scaleBasis: "local spherical approximation";
|
|
1618
|
+
};
|
|
1619
|
+
|
|
1620
|
+
export declare function promoteMaterialAssetDocument(document: VisSceneDocument, id: string): VisSceneDocument;
|
|
1621
|
+
|
|
1500
1622
|
export declare function promoteMaterialToProject<T extends VisSceneDocument>(document: T, assetId: string): T;
|
|
1501
1623
|
|
|
1502
1624
|
declare class RectAreaLight extends RectAreaLightObject {
|
|
1503
1625
|
}
|
|
1504
1626
|
|
|
1505
|
-
declare interface RegionTextureRule {
|
|
1627
|
+
export declare interface RegionTextureRule {
|
|
1506
1628
|
/** 材质 UUID,或显式材质角色,例如 plane#topMat。 */
|
|
1507
1629
|
material: string;
|
|
1508
1630
|
/** THREE.Material 上的纹理属性,例如 map、emissiveMap。 */
|
|
@@ -1517,6 +1639,15 @@ declare interface RegionTextureRule {
|
|
|
1517
1639
|
levels?: string[];
|
|
1518
1640
|
}
|
|
1519
1641
|
|
|
1642
|
+
/** Register imported definitions without normalizing or copying the existing project. */
|
|
1643
|
+
export declare function registerSceneMaterials(document: VisSceneDocument, sceneId: string, onlyIds?: ReadonlySet<string>): VisSceneDocument;
|
|
1644
|
+
|
|
1645
|
+
/** Imported data is owned separately; scanning occupied IDs never copies current graphs. */
|
|
1646
|
+
export declare function remapImportedMaterials(before: VisSceneDocument, incoming: VisSceneDocument): VisSceneDocument;
|
|
1647
|
+
|
|
1648
|
+
/** Detached authored snapshots keep their copy links and relinquish source-asset resource identities. */
|
|
1649
|
+
export declare function remapOwnedSnapshotIdentity(snapshot: any, rootUuid?: string, sharedResourceIds?: ReadonlyMap<string, string>): any;
|
|
1650
|
+
|
|
1520
1651
|
export declare interface RemappedSceneDocument {
|
|
1521
1652
|
entrySceneId: string;
|
|
1522
1653
|
scenes: SceneViewportDocument[];
|
|
@@ -1538,8 +1669,31 @@ export declare function remapProjectMaterialIds<T extends VisSceneDocument>(docu
|
|
|
1538
1669
|
*/
|
|
1539
1670
|
export declare function remapSceneDocumentIds(document: VisSceneDocument, createSceneId: (scene: SceneViewportDocument, index: number) => string): RemappedSceneDocument;
|
|
1540
1671
|
|
|
1672
|
+
export declare const remapSceneMaterialReferencesCopy: <T>(scene: T, previous: string, next: string) => T;
|
|
1673
|
+
|
|
1674
|
+
export declare const remapSceneObjectReferencesCopy: <T>(scene: T, previous: string, next: string) => T;
|
|
1675
|
+
|
|
1676
|
+
export { remapSnapshotAnimationTracks }
|
|
1677
|
+
|
|
1678
|
+
/** Copy an authored snapshot with fresh native and authored reference identities. */
|
|
1679
|
+
export declare function remapSnapshotIdentity(input: any, rootUuid?: string, sharedResourceIds?: ReadonlyMap<string, string>): any;
|
|
1680
|
+
|
|
1681
|
+
export declare function removeMaterialAssetDocument(document: VisSceneDocument, id: string): VisSceneDocument;
|
|
1682
|
+
|
|
1683
|
+
/** Remove selected roots and prune only the authored rules that referred to them. */
|
|
1684
|
+
export declare function removeObjectsDocument(before: VisSceneDocument, sceneId: string, ids: readonly string[]): VisSceneDocument;
|
|
1685
|
+
|
|
1541
1686
|
export declare function removeProjectMaterial<T extends VisSceneDocument>(document: T, assetId: string): T;
|
|
1542
1687
|
|
|
1688
|
+
export declare function removeSceneDocument(before: VisSceneDocument, sceneId: string): VisSceneDocument;
|
|
1689
|
+
|
|
1690
|
+
export declare function replaceMaterialAssetDocument(document: VisSceneDocument, asset: MaterialAsset): VisSceneDocument;
|
|
1691
|
+
|
|
1692
|
+
export declare const RESOURCE_SOURCE = "_resourceSource";
|
|
1693
|
+
|
|
1694
|
+
/** Stable UUID for an asset's resource instance; content revisions do not change identity. */
|
|
1695
|
+
export declare function resourceInstanceUuid(assetId: string, kind: string, sourceUuid: string): string;
|
|
1696
|
+
|
|
1543
1697
|
declare class Ring extends MeshObject {
|
|
1544
1698
|
objectType: string;
|
|
1545
1699
|
create(): void;
|
|
@@ -1547,8 +1701,8 @@ declare class Ring extends MeshObject {
|
|
|
1547
1701
|
|
|
1548
1702
|
declare class Road extends GroupObject {
|
|
1549
1703
|
objectType: string;
|
|
1550
|
-
options:
|
|
1551
|
-
constructor(options:
|
|
1704
|
+
options: Options_7;
|
|
1705
|
+
constructor(options: Options_7);
|
|
1552
1706
|
linePrimary: LineObject[];
|
|
1553
1707
|
lineSecondary: LineObject[];
|
|
1554
1708
|
create(): Promise<void>;
|
|
@@ -1663,6 +1817,11 @@ export declare class SceneManager extends Event_2 {
|
|
|
1663
1817
|
private assertGeneration;
|
|
1664
1818
|
private debugInteraction;
|
|
1665
1819
|
private enablePickDebug;
|
|
1820
|
+
private retireScenes;
|
|
1821
|
+
private discardSceneCandidates;
|
|
1822
|
+
/** Notifications cannot invalidate a transaction that has already committed. */
|
|
1823
|
+
private notifySceneObservers;
|
|
1824
|
+
private finishNavigation;
|
|
1666
1825
|
private disposeInactiveScenes;
|
|
1667
1826
|
/** Retire inactive pages after the host accepts navigation; failures never undo the active page. */
|
|
1668
1827
|
trimInactiveScenes(): unknown[];
|
|
@@ -1719,9 +1878,9 @@ export declare class SceneManager extends Event_2 {
|
|
|
1719
1878
|
/** A newly hydrated empty Base seed acquires its own camera/default options once. */
|
|
1720
1879
|
prepareSceneInitialization(sceneId: string, definition: SceneViewportDocument): PreparedSceneStructure;
|
|
1721
1880
|
/** Collection edits keep cached pages until their enclosing history transaction accepts. */
|
|
1722
|
-
activateSceneForTransaction(sceneId: string, hooks?: Record<string, any>, signal?: AbortSignal): Promise<
|
|
1881
|
+
activateSceneForTransaction(sceneId: string, hooks?: Record<string, any>, signal?: AbortSignal): Promise<Base_3>;
|
|
1723
1882
|
/** Retire exactly the detached page; never invalidate other loaded pages or pending resources. */
|
|
1724
|
-
retireSceneForTransaction(sceneId: string, expected:
|
|
1883
|
+
retireSceneForTransaction(sceneId: string, expected: Base_3): void;
|
|
1725
1884
|
private ownPreparedStructure;
|
|
1726
1885
|
private requirePreparedStructure;
|
|
1727
1886
|
/**
|
|
@@ -1733,32 +1892,34 @@ export declare class SceneManager extends Event_2 {
|
|
|
1733
1892
|
commitSceneStructure(prepared: PreparedSceneStructure): void;
|
|
1734
1893
|
/** Commit scalar material history without accepting or copying caller object graphs. */
|
|
1735
1894
|
patchMaterialDefinitions(assets: MaterialAsset[], scenes: Pick<SceneViewportDocument, 'id'>[], scope?: MaterialDefinitionScope): void;
|
|
1736
|
-
load(documentOrUrl: VisSceneDocument | VisSceneManifest | string, hooks?: Record<string, any>): Promise<
|
|
1895
|
+
load(documentOrUrl: VisSceneDocument | VisSceneManifest | string, hooks?: Record<string, any>): Promise<Base_3>;
|
|
1737
1896
|
/**
|
|
1738
1897
|
* 创建一个没有快照输入的运行时页面,并在可选构建步骤完成后将其导出为
|
|
1739
1898
|
* 标准单场景文档。主要供编辑器新建和旧模板迁移使用。
|
|
1740
1899
|
*/
|
|
1741
|
-
createEmptyScene(definition: EmptySceneDefinition, build?: (scene:
|
|
1900
|
+
createEmptyScene(definition: EmptySceneDefinition, build?: (scene: Base_3) => void | Promise<void>, materialLibrary?: MaterialAsset[]): Promise<Base_3>;
|
|
1742
1901
|
/**
|
|
1743
1902
|
* 以指定地图模板和行政区直接启动,不先加载文档配置的入口场景。
|
|
1744
1903
|
* 适用于宿主按路由或业务参数决定初始省、市、区的场景。
|
|
1745
1904
|
*/
|
|
1746
|
-
loadMapRegion(documentOrUrl: VisSceneDocument | VisSceneManifest | string, sceneId: string, adcode: number, hooks?: Record<string, any>): Promise<
|
|
1747
|
-
loadMapRegion(documentOrUrl: VisSceneDocument | VisSceneManifest | string, adcode: number, resolveScene: MapRegionSceneResolver, hooks?: Record<string, any>): Promise<
|
|
1905
|
+
loadMapRegion(documentOrUrl: VisSceneDocument | VisSceneManifest | string, sceneId: string, adcode: number, hooks?: Record<string, any>): Promise<Map_4>;
|
|
1906
|
+
loadMapRegion(documentOrUrl: VisSceneDocument | VisSceneManifest | string, adcode: number, resolveScene: MapRegionSceneResolver, hooks?: Record<string, any>): Promise<Map_4>;
|
|
1748
1907
|
private loadDocument;
|
|
1749
1908
|
private getSceneMetadata;
|
|
1750
1909
|
private resolveManifestSource;
|
|
1751
1910
|
private resolveBundleImages;
|
|
1752
1911
|
private loadSceneDefinition;
|
|
1753
1912
|
private createRuntimeSceneDocument;
|
|
1754
|
-
|
|
1913
|
+
private definitionLoadingContext;
|
|
1914
|
+
switchScene(sceneId: string, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Base_3 | null>;
|
|
1755
1915
|
/**
|
|
1756
1916
|
* 恢复并缓存一个非活动场景,不改变当前场景、导航历史或相机。
|
|
1917
|
+
* 缓存至少保留当前页和本次预加载页;后续导航恢复配置的缓存上限。
|
|
1757
1918
|
*/
|
|
1758
|
-
preloadScene(sceneId: string, hooks?: Record<string, any>): Promise<
|
|
1919
|
+
preloadScene(sceneId: string, hooks?: Record<string, any>): Promise<Base_3>;
|
|
1759
1920
|
/** 编辑器事务:在独立页面上修改参数并重建快照,成功后一起提交文档和实例。 */
|
|
1760
|
-
editScene(sceneId: string, edit: (scene:
|
|
1761
|
-
back(hooks?: Record<string, any>): Promise<
|
|
1921
|
+
editScene(sceneId: string, edit: (scene: Base_3, definition: SceneViewportDocument) => Promise<SceneViewportDocument>, hooks?: Record<string, any>): Promise<Base_3>;
|
|
1922
|
+
back(hooks?: Record<string, any>): Promise<Base_3 | null>;
|
|
1762
1923
|
/**
|
|
1763
1924
|
* 切到目标地图场景,并按 adcode 重建其中的地图。sceneId 不同时,语义等价于
|
|
1764
1925
|
* switchScene(sceneId) 后 switchMapRegion(adcode),但候选场景只在两步都成功后提交,
|
|
@@ -1766,17 +1927,17 @@ export declare class SceneManager extends Event_2 {
|
|
|
1766
1927
|
* 始终从文档基线构建隔离页面,避免对缓存实例反复施加缩放/删除修正。
|
|
1767
1928
|
* 旧页面在构建期间保持完整;只有所有资源、几何和交互就绪才提交导航。
|
|
1768
1929
|
*/
|
|
1769
|
-
switchMapRegion(sceneId: string, adcode: number, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<
|
|
1930
|
+
switchMapRegion(sceneId: string, adcode: number, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Map_4 | null>;
|
|
1770
1931
|
/** 场景切换与区域切换共享一条返回历史。 */
|
|
1771
|
-
backMapRegion(hooks?: Record<string, any>): Promise<
|
|
1932
|
+
backMapRegion(hooks?: Record<string, any>): Promise<Base_3 | null>;
|
|
1772
1933
|
getCurrentSceneId(): string;
|
|
1773
1934
|
getCurrentScene<T extends SceneType>(type: T): SceneTypeMap[T] | null;
|
|
1774
|
-
getCurrentScene():
|
|
1935
|
+
getCurrentScene(): Base_3 | null;
|
|
1775
1936
|
private getCurrentSceneByType;
|
|
1776
1937
|
getScene<T extends SceneType>(sceneId: string, type: T): SceneTypeMap[T] | undefined;
|
|
1777
|
-
getScene(sceneId: string):
|
|
1938
|
+
getScene(sceneId: string): Base_3 | undefined;
|
|
1778
1939
|
getSceneByName<T extends SceneType>(name: string, type: T): SceneTypeMap[T] | undefined;
|
|
1779
|
-
getSceneByName(name: string):
|
|
1940
|
+
getSceneByName(name: string): Base_3 | undefined;
|
|
1780
1941
|
private getSceneByType;
|
|
1781
1942
|
/** Inspect saved definitions without creating or pinning runtime materials. */
|
|
1782
1943
|
getMaterialLibrary(): MaterialAsset[];
|
|
@@ -1788,7 +1949,7 @@ export declare class SceneManager extends Event_2 {
|
|
|
1788
1949
|
* Reacquire Base/Object handles after this call: replaced pages are disposed.
|
|
1789
1950
|
* Current runtime geometry, options, active page and camera are preserved.
|
|
1790
1951
|
*/
|
|
1791
|
-
updateMaterial(assetId: string, patch: Partial<Pick<MaterialAsset, 'name' | 'material' | 'locked'>>): Promise<
|
|
1952
|
+
updateMaterial(assetId: string, patch: Partial<Pick<MaterialAsset, 'name' | 'material' | 'locked'>>): Promise<Base_3 | null>;
|
|
1792
1953
|
/** Immutable borrowed snapshot for coordinated COW editing; write through patch APIs. */
|
|
1793
1954
|
getDocumentSnapshot(): Readonly<VisSceneDocument> | undefined;
|
|
1794
1955
|
getDocument(): VisSceneDocument | undefined;
|
|
@@ -1807,12 +1968,12 @@ export declare interface SceneManagerBehaviorOptions {
|
|
|
1807
1968
|
/** 输出射线命中和场景交互诊断,仅用于开发排查。 */
|
|
1808
1969
|
debugInteractions?: boolean;
|
|
1809
1970
|
/** 创建场景后、恢复 JSON 前调用。 */
|
|
1810
|
-
prepareScene?: (scene:
|
|
1971
|
+
prepareScene?: (scene: Base_3) => void;
|
|
1811
1972
|
/** 场景与最终相机就绪后、提交和首帧绘制前等待宿主准备。失败时保留原场景。 */
|
|
1812
|
-
beforeSceneDisplay?: (scene:
|
|
1973
|
+
beforeSceneDisplay?: (scene: Base_3, context: SceneDisplayContext) => void | Promise<void>;
|
|
1813
1974
|
/** 是否保留非活动场景实例;编辑器可关闭以限制 GPU/内存占用。 */
|
|
1814
1975
|
cacheScenes?: boolean;
|
|
1815
|
-
/** Pages retained after navigation, including the active page; oldest inactive pages retire first. */
|
|
1976
|
+
/** Pages retained after navigation (default 8), including the active page; oldest inactive pages retire first. */
|
|
1816
1977
|
maxCachedScenes?: number;
|
|
1817
1978
|
/** 自定义分包场景读取器;可从 IndexedDB 等非 HTTP 存储按需读取。 */
|
|
1818
1979
|
loadScene?: (entry: SceneManifestEntry) => Promise<SceneViewportDocument>;
|
|
@@ -1837,6 +1998,8 @@ export declare interface SceneManifestEntry extends Omit<SceneViewportDocument,
|
|
|
1837
1998
|
/** Dependency closure for a selected scene; preserve unused aliases as document uses. */
|
|
1838
1999
|
export declare function sceneMaterialLibrary(scene: SceneViewportDocument, library?: MaterialAsset[], prefabs?: VisSceneDocument['prefabLibrary']): MaterialAsset[];
|
|
1839
2000
|
|
|
2001
|
+
export declare function sceneObjectIndex(root: any): ObjectIndex;
|
|
2002
|
+
|
|
1840
2003
|
export declare interface SceneObjectPatch {
|
|
1841
2004
|
uuid: string;
|
|
1842
2005
|
state: {
|
|
@@ -1850,7 +2013,9 @@ export declare interface SceneObjectPatch {
|
|
|
1850
2013
|
unset?: ('matrix' | 'matrixAutoUpdate' | 'pivot' | 'name' | 'visible' | 'layers')[];
|
|
1851
2014
|
}
|
|
1852
2015
|
|
|
1853
|
-
declare
|
|
2016
|
+
export declare const sceneObjectPropertyDefaults: Readonly<Record<string, any>>;
|
|
2017
|
+
|
|
2018
|
+
export declare interface SceneObjectPropertyPatch {
|
|
1854
2019
|
uuid: string;
|
|
1855
2020
|
state: Record<string, any>;
|
|
1856
2021
|
unset?: readonly string[];
|
|
@@ -1860,6 +2025,12 @@ declare type ScenePropertyField = typeof scenePropertyFields[number];
|
|
|
1860
2025
|
|
|
1861
2026
|
export declare const scenePropertyFields: readonly ["color", "groundColor", "intensity", "distance", "decay", "angle", "penumbra", "width", "height", "castShadow", "receiveShadow", "frustumCulled", "renderOrder", "up", "center", "shadow", "near", "far", "fov", "aspect", "zoom", "left", "right", "top", "bottom", "focus", "filmGauge", "filmOffset", "view", "backgroundBlurriness", "backgroundIntensity", "environmentIntensity", "backgroundRotation", "environmentRotation"];
|
|
1862
2027
|
|
|
2028
|
+
export declare interface SceneResourceCandidate {
|
|
2029
|
+
vis: any;
|
|
2030
|
+
graph: any;
|
|
2031
|
+
root?: any;
|
|
2032
|
+
}
|
|
2033
|
+
|
|
1863
2034
|
export declare type SceneStructureGraphKey = 'materialAliases' | 'shapes' | '_sharedOptionsPool' | '_texDataPool';
|
|
1864
2035
|
|
|
1865
2036
|
/** Metadata is part of an owned structure transaction, never a scalar runtime patch. */
|
|
@@ -1951,9 +2122,9 @@ export declare interface SceneTransitionOptions {
|
|
|
1951
2122
|
export declare type SceneType = keyof SceneTypeMap;
|
|
1952
2123
|
|
|
1953
2124
|
export declare interface SceneTypeMap {
|
|
1954
|
-
base:
|
|
1955
|
-
earth:
|
|
1956
|
-
map:
|
|
2125
|
+
base: Base_3;
|
|
2126
|
+
earth: Earth_3;
|
|
2127
|
+
map: Map_4;
|
|
1957
2128
|
}
|
|
1958
2129
|
|
|
1959
2130
|
export declare interface SceneViewportDocument {
|
|
@@ -1986,18 +2157,6 @@ export declare interface SceneViewportPatch {
|
|
|
1986
2157
|
|
|
1987
2158
|
export declare function selectSceneDocument(document: VisSceneDocument, sceneId: string): VisSceneDocument;
|
|
1988
2159
|
|
|
1989
|
-
declare type SerializedClip = ReturnType<(typeof THREE.AnimationClip)['toJSON']>;
|
|
1990
|
-
|
|
1991
|
-
declare const sinusoidalInOut: ({ owner, onUpdate, onComplete, onCancel, backwards, }?: TweenOptions) => {
|
|
1992
|
-
start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
|
|
1993
|
-
duration?: number | undefined;
|
|
1994
|
-
repeat?: number | undefined;
|
|
1995
|
-
repeatResolve?: number | undefined;
|
|
1996
|
-
repeatDelay?: number | undefined;
|
|
1997
|
-
}) => Promise<void>;
|
|
1998
|
-
stop: () => void;
|
|
1999
|
-
};
|
|
2000
|
-
|
|
2001
2160
|
declare class Sphere extends MeshObject {
|
|
2002
2161
|
radius: number;
|
|
2003
2162
|
options: any;
|
|
@@ -2006,26 +2165,6 @@ declare class Sphere extends MeshObject {
|
|
|
2006
2165
|
create(): void;
|
|
2007
2166
|
}
|
|
2008
2167
|
|
|
2009
|
-
/** Exact radial lift above the short great circle, expressed in object-local space. */
|
|
2010
|
-
declare class SphereArcCurve extends THREE.Curve<THREE.Vector3> {
|
|
2011
|
-
readonly type = "SphereArcCurve";
|
|
2012
|
-
readonly data: ArcSpherePath;
|
|
2013
|
-
readonly matrix: THREE.Matrix4;
|
|
2014
|
-
constructor(path: ArcSpherePath);
|
|
2015
|
-
get v0(): THREE.Vector3;
|
|
2016
|
-
get v3(): THREE.Vector3;
|
|
2017
|
-
getPoint(t: number, target?: THREE.Vector3): THREE.Vector3;
|
|
2018
|
-
getTangent(t: number, target?: THREE.Vector3): THREE.Vector3;
|
|
2019
|
-
clone(): this;
|
|
2020
|
-
copy(source: THREE.Curve<THREE.Vector3>): this;
|
|
2021
|
-
toJSON(): SphereArcCurveJSON;
|
|
2022
|
-
fromJSON(json: THREE.CurveJSON): this;
|
|
2023
|
-
}
|
|
2024
|
-
|
|
2025
|
-
declare interface SphereArcCurveJSON extends THREE.CurveJSON {
|
|
2026
|
-
spherePath: ArcSpherePath;
|
|
2027
|
-
}
|
|
2028
|
-
|
|
2029
2168
|
declare class SphereShadow extends MeshObject {
|
|
2030
2169
|
objectType: string;
|
|
2031
2170
|
options: Required<Options_3>;
|
|
@@ -2067,6 +2206,8 @@ declare class Sprite extends SpriteObject {
|
|
|
2067
2206
|
|
|
2068
2207
|
export declare function stripMaterialAssetBinding<T extends Record<string, any>>(material: T): T;
|
|
2069
2208
|
|
|
2209
|
+
export { StructureResources }
|
|
2210
|
+
|
|
2070
2211
|
export declare interface SwitchSceneOptions {
|
|
2071
2212
|
/** 返回历史时不再记录当前场景。 */
|
|
2072
2213
|
recordHistory?: boolean;
|
|
@@ -2076,30 +2217,16 @@ export declare interface SwitchSceneOptions {
|
|
|
2076
2217
|
|
|
2077
2218
|
export { THREE }
|
|
2078
2219
|
|
|
2079
|
-
declare const timeOut: (ms: number) => Promise<any>;
|
|
2080
|
-
|
|
2081
|
-
declare class Tube extends MeshObject {
|
|
2082
|
-
objectType: string;
|
|
2083
|
-
options: Options_6;
|
|
2084
|
-
constructor(options: Options_6);
|
|
2085
|
-
create(): void;
|
|
2086
|
-
}
|
|
2087
|
-
|
|
2088
2220
|
export { TWEEN }
|
|
2089
2221
|
|
|
2090
|
-
export
|
|
2091
|
-
|
|
2092
|
-
declare interface TweenOptions {
|
|
2093
|
-
owner?: Pick<Pencil, 'animations'>;
|
|
2094
|
-
onUpdate?: (value: number) => void;
|
|
2095
|
-
onComplete?: () => void;
|
|
2096
|
-
onCancel?: () => void;
|
|
2097
|
-
backwards?: boolean;
|
|
2098
|
-
}
|
|
2222
|
+
export declare type Tween<T extends Record<string, any>> = Tween_2<T>;
|
|
2099
2223
|
|
|
2100
2224
|
export declare function updateProjectMaterial<T extends VisSceneDocument>(document: T, assetId: string, patch: Partial<Pick<MaterialAsset, 'name' | 'material' | 'locked'>>): T;
|
|
2101
2225
|
|
|
2102
|
-
export declare const VERSION = "0.33.
|
|
2226
|
+
export declare const VERSION = "0.33.6";
|
|
2227
|
+
|
|
2228
|
+
/** Enumerate authored reference fields only; never inspect arbitrary userdata or resource payloads. */
|
|
2229
|
+
export declare function visitSceneIdentityReferences(scene: any, objectIdentity: boolean, visit: (path: IdentityPath, value: any, track?: boolean, key?: boolean) => void): void;
|
|
2103
2230
|
|
|
2104
2231
|
export declare interface VisSceneDocument extends SceneDocumentMarker {
|
|
2105
2232
|
entrySceneId: string;
|
|
@@ -2134,4 +2261,34 @@ export declare interface VisSceneManifest {
|
|
|
2134
2261
|
s?: string;
|
|
2135
2262
|
}
|
|
2136
2263
|
|
|
2264
|
+
declare class Water extends Mesh<BufferGeometry, ShaderMaterial> {
|
|
2265
|
+
static WaterShader: WaterShader;
|
|
2266
|
+
isWater: true;
|
|
2267
|
+
constructor(geometry: BufferGeometry, options: WaterOptions);
|
|
2268
|
+
dispose(): void;
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
declare interface WaterOptions {
|
|
2272
|
+
resources?: ResourceRegistry;
|
|
2273
|
+
color?: ColorRepresentation;
|
|
2274
|
+
textureWidth?: number;
|
|
2275
|
+
textureHeight?: number;
|
|
2276
|
+
clipBias?: number;
|
|
2277
|
+
flowDirection?: Vector2;
|
|
2278
|
+
flowSpeed?: number;
|
|
2279
|
+
reflectivity?: number;
|
|
2280
|
+
scale?: number;
|
|
2281
|
+
shader?: WaterShader;
|
|
2282
|
+
flowMap?: Texture;
|
|
2283
|
+
normalMap0: Texture;
|
|
2284
|
+
normalMap1: Texture;
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
declare interface WaterShader {
|
|
2288
|
+
name: string;
|
|
2289
|
+
uniforms: Record<string, IUniform>;
|
|
2290
|
+
vertexShader: string;
|
|
2291
|
+
fragmentShader: string;
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2137
2294
|
export { }
|