bruce-cesium 7.1.9 → 7.2.1
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/dist/bruce-cesium.es5.js +679 -300
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +678 -297
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/entity-render-engine-model3d.js +2 -2
- package/dist/lib/rendering/entity-render-engine-model3d.js.map +1 -1
- package/dist/lib/rendering/render-managers/common/historic-utils.js +471 -0
- package/dist/lib/rendering/render-managers/common/historic-utils.js.map +1 -0
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +14 -124
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +16 -13
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/other/assembly-render-manager.js +1 -1
- package/dist/lib/rendering/render-managers/other/assembly-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js +31 -109
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js +23 -7
- package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-google-photos-render-manager.js +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-google-photos-render-manager.js.map +1 -1
- package/dist/lib/rendering/tileset-render-engine.js +1 -1
- package/dist/lib/rendering/tileset-render-engine.js.map +1 -1
- package/dist/lib/rendering/tileset-styler.js +28 -24
- package/dist/lib/rendering/tileset-styler.js.map +1 -1
- package/dist/lib/utils/view-utils.js +100 -15
- package/dist/lib/utils/view-utils.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/common/historic-utils.d.ts +159 -0
- package/dist/types/rendering/render-managers/entities/entities-ids-render-manager.d.ts +1 -0
- package/dist/types/rendering/render-managers/entities/entities-render-manager.d.ts +5 -0
- package/dist/types/rendering/render-managers/tilesets/tileset-cad-render-manager.d.ts +1 -0
- package/dist/types/rendering/render-managers/tilesets/tileset-entities-render-manager.d.ts +2 -0
- package/dist/types/rendering/tileset-styler.d.ts +2 -0
- package/dist/types/utils/view-utils.d.ts +30 -7
- package/package.json +2 -2
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import * as Cesium from "cesium";
|
|
2
|
+
import { BruceApi, Entity, EntityHistoricData, IDictionary } from "bruce-models";
|
|
3
|
+
/**
|
|
4
|
+
* How often a historic refresh is worth running, and which Entities it should ask about first.
|
|
5
|
+
*
|
|
6
|
+
* A handful of tracked vehicles can afford to re-read on almost every clock tick. Thousands of
|
|
7
|
+
* parcels cannot, and refreshing them that often was never buying anything since the answer barely
|
|
8
|
+
* changes between ticks.
|
|
9
|
+
*/
|
|
10
|
+
export declare namespace HistoricFetchOrder {
|
|
11
|
+
const MIN_INTERVAL_MS = 250;
|
|
12
|
+
const MAX_INTERVAL_MS = 10000;
|
|
13
|
+
const SMALL_SET = 30;
|
|
14
|
+
const LARGE_SET = 5000;
|
|
15
|
+
/**
|
|
16
|
+
* Returns how long to wait between historic refreshes for a set of this size.
|
|
17
|
+
*/
|
|
18
|
+
function IntervalFor(entityCount: number, minMs?: number, maxMs?: number): number;
|
|
19
|
+
/**
|
|
20
|
+
* Returns the Entities grouped into bands by distance from the camera, nearest band first.
|
|
21
|
+
*
|
|
22
|
+
* Bands rather than a true sort, so a small camera move does not reshuffle the whole queue and
|
|
23
|
+
* restart it. What the user is looking at resolves first either way.
|
|
24
|
+
*/
|
|
25
|
+
function ByCameraDistance(params: {
|
|
26
|
+
viewer: Cesium.Viewer;
|
|
27
|
+
entities: Entity.IEntity[];
|
|
28
|
+
bands?: number[];
|
|
29
|
+
}): Entity.IEntity[][];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Decides what slice of history is worth fetching for the clock as it is currently moving.
|
|
33
|
+
*/
|
|
34
|
+
export declare namespace HistoricFetchPlan {
|
|
35
|
+
interface ITrajectory {
|
|
36
|
+
direction: -1 | 0 | 1;
|
|
37
|
+
ratePerSecondMs: number;
|
|
38
|
+
}
|
|
39
|
+
interface IRange {
|
|
40
|
+
start: number;
|
|
41
|
+
stop: number;
|
|
42
|
+
}
|
|
43
|
+
interface IPlan {
|
|
44
|
+
detail: IRange | null;
|
|
45
|
+
coarse: (IRange & {
|
|
46
|
+
sample: number;
|
|
47
|
+
}) | null;
|
|
48
|
+
}
|
|
49
|
+
const DEFAULT_LEAD_SECONDS = 10;
|
|
50
|
+
const DEFAULT_MIN_DETAIL_MS: number;
|
|
51
|
+
const DEFAULT_MAX_DETAIL_MS: number;
|
|
52
|
+
const DEFAULT_SAMPLE = 200;
|
|
53
|
+
function DetailSpanFor(trajectory: ITrajectory, leadSeconds: number, minMs: number, maxMs: number): number;
|
|
54
|
+
/**
|
|
55
|
+
* Returns the detail window and the coarse pass for the clock as it stands.
|
|
56
|
+
*/
|
|
57
|
+
function Plan(params: {
|
|
58
|
+
currentTime: number;
|
|
59
|
+
windowStart: number;
|
|
60
|
+
windowStop: number;
|
|
61
|
+
trajectory: ITrajectory;
|
|
62
|
+
leadSeconds?: number;
|
|
63
|
+
minDetailMs?: number;
|
|
64
|
+
maxDetailMs?: number;
|
|
65
|
+
sample?: number;
|
|
66
|
+
}): IPlan;
|
|
67
|
+
/**
|
|
68
|
+
* Tracks which way the clock is moving and how fast, from the times it is observed at.
|
|
69
|
+
* Playback and a user dragging the timeline both look the same here, which is the point.
|
|
70
|
+
*/
|
|
71
|
+
class TrajectoryTracker {
|
|
72
|
+
private smoothing;
|
|
73
|
+
private lastTime;
|
|
74
|
+
private lastObservedAt;
|
|
75
|
+
private direction;
|
|
76
|
+
private ratePerSecondMs;
|
|
77
|
+
constructor(smoothing?: number);
|
|
78
|
+
/**
|
|
79
|
+
* Records where the clock is now. observedAt is the wall clock, in milliseconds.
|
|
80
|
+
*/
|
|
81
|
+
Observe(sceneTime: number, observedAt: number): void;
|
|
82
|
+
Get(): ITrajectory;
|
|
83
|
+
Reset(): void;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Tracks which time ranges of historic data have already been requested, and the records they
|
|
88
|
+
* returned, so moving the clock only fetches the part that is genuinely new.
|
|
89
|
+
*
|
|
90
|
+
* Coverage is tracked by the ranges that were asked for, not by the timestamps that came back. A
|
|
91
|
+
* window holding no records is still covered, otherwise an empty stretch is re-requested forever.
|
|
92
|
+
*/
|
|
93
|
+
export declare class HistoricRangeCache {
|
|
94
|
+
private mergeToleranceMs;
|
|
95
|
+
private held;
|
|
96
|
+
private heldCoarse;
|
|
97
|
+
private records;
|
|
98
|
+
constructor(mergeToleranceMs?: number);
|
|
99
|
+
/**
|
|
100
|
+
* Returns the parts of the window that have not been requested yet.
|
|
101
|
+
*/
|
|
102
|
+
MissingRanges(start: number, stop: number): {
|
|
103
|
+
start: number;
|
|
104
|
+
stop: number;
|
|
105
|
+
}[];
|
|
106
|
+
/**
|
|
107
|
+
* Marks a range as requested and merges the records it returned into what is already held.
|
|
108
|
+
*/
|
|
109
|
+
Absorb(start: number, stop: number, recordsByIds: IDictionary<EntityHistoricData.IData[]>, coarse?: boolean): void;
|
|
110
|
+
GetRecords(): IDictionary<EntityHistoricData.IData[]>;
|
|
111
|
+
/**
|
|
112
|
+
* Returns whether the window is already covered in full.
|
|
113
|
+
*/
|
|
114
|
+
Covers(start: number, stop: number): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Returns whether a sampled pass already describes the window.
|
|
117
|
+
*/
|
|
118
|
+
CoversCoarse(start: number, stop: number): boolean;
|
|
119
|
+
Clear(): void;
|
|
120
|
+
private mergeAdjacent;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Pulls historic records for the visible clock range: what to ask for, in what order, and what has
|
|
124
|
+
* already been asked for.
|
|
125
|
+
*/
|
|
126
|
+
export declare class HistoricGatherer {
|
|
127
|
+
private params;
|
|
128
|
+
static readonly LIVE_TAIL_MS = 15000;
|
|
129
|
+
private cache;
|
|
130
|
+
private trajectory;
|
|
131
|
+
private inFlight;
|
|
132
|
+
private disposed;
|
|
133
|
+
constructor(params: {
|
|
134
|
+
viewer: Cesium.Viewer;
|
|
135
|
+
getApi: () => BruceApi.Api;
|
|
136
|
+
getAttrKey: () => string;
|
|
137
|
+
sample?: number;
|
|
138
|
+
onRecords?: (recordsByIds: IDictionary<EntityHistoricData.IData[]>) => void;
|
|
139
|
+
paddingMs?: number;
|
|
140
|
+
liveTailMs?: number;
|
|
141
|
+
});
|
|
142
|
+
get Records(): IDictionary<EntityHistoricData.IData[]>;
|
|
143
|
+
Clear(): void;
|
|
144
|
+
Dispose(): void;
|
|
145
|
+
/**
|
|
146
|
+
* Returns how long to wait between refreshes for a set of this size.
|
|
147
|
+
*/
|
|
148
|
+
IntervalFor(entityCount: number): number;
|
|
149
|
+
/**
|
|
150
|
+
* Fetches whatever the current clock range needs that is not already held.
|
|
151
|
+
* Returns whether anything was requested, alongside every record held for these Entities.
|
|
152
|
+
*/
|
|
153
|
+
Gather(entities: Entity.IEntity[]): Promise<{
|
|
154
|
+
fetched: boolean;
|
|
155
|
+
recordsByIds: IDictionary<EntityHistoricData.IData[]>;
|
|
156
|
+
}>;
|
|
157
|
+
private holdTo;
|
|
158
|
+
private request;
|
|
159
|
+
}
|
|
@@ -25,6 +25,7 @@ export declare namespace EntitiesIdsRenderManager {
|
|
|
25
25
|
get ZoomControl(): ZoomControl.IItem[];
|
|
26
26
|
private viewerDateTimeChangeRemoval;
|
|
27
27
|
private entitiesHistoric;
|
|
28
|
+
private historicGatherer;
|
|
28
29
|
private renderQueueActive;
|
|
29
30
|
private renderQueue;
|
|
30
31
|
private renderQueueForceFlags;
|
|
@@ -38,6 +38,7 @@ export declare namespace EntitiesRenderManager {
|
|
|
38
38
|
private clustering;
|
|
39
39
|
private sources;
|
|
40
40
|
private reRenderState;
|
|
41
|
+
private historicGatherer;
|
|
41
42
|
private useGeojson;
|
|
42
43
|
private zoomControl;
|
|
43
44
|
private scenario;
|
|
@@ -104,6 +105,10 @@ export declare namespace EntitiesRenderManager {
|
|
|
104
105
|
*/
|
|
105
106
|
private renderAsIndividualsChain;
|
|
106
107
|
private renderAsIndividuals;
|
|
108
|
+
/**
|
|
109
|
+
* Returns the historic records to interpolate between, fetching only what is not already held.
|
|
110
|
+
*/
|
|
111
|
+
private gatherHistoric;
|
|
107
112
|
private doRenderAsIndividuals;
|
|
108
113
|
get HandoffKey(): string | null;
|
|
109
114
|
static GetHandoffKey(item: MenuItem.Item.IEntities): string | null;
|
|
@@ -49,6 +49,7 @@ export declare namespace TilesetCadRenderManager {
|
|
|
49
49
|
private viewerDateTimeChangeRemoval;
|
|
50
50
|
private historicPossesInitialLoaded;
|
|
51
51
|
private historicAnimation;
|
|
52
|
+
private historicGatherer;
|
|
52
53
|
private historicPossesLoadingProm;
|
|
53
54
|
private featureQueue;
|
|
54
55
|
private featureQueueStates;
|
|
@@ -63,6 +63,8 @@ export declare namespace TilesetEntitiesRenderManager {
|
|
|
63
63
|
private doDispose;
|
|
64
64
|
private onCTilesetLoad;
|
|
65
65
|
get HandoffKey(): string | null;
|
|
66
|
+
static IsHistoric(item: MenuItem.Item.IEntitiesTileset): boolean;
|
|
67
|
+
static NeedsStyler(item: MenuItem.Item.IEntitiesTileset): boolean;
|
|
66
68
|
static GetHandoffKey(item: MenuItem.Item.IEntitiesTileset): string | null;
|
|
67
69
|
PrepareHandoff(): RenderManager.IHandoffPayload | null;
|
|
68
70
|
AdoptHandoff(payload: RenderManager.IHandoffPayload): void;
|
|
@@ -29,6 +29,7 @@ export declare class TilesetStyler {
|
|
|
29
29
|
private scenario;
|
|
30
30
|
private expandSources;
|
|
31
31
|
private historic;
|
|
32
|
+
private applyStyles;
|
|
32
33
|
private entityGatherer;
|
|
33
34
|
private reRenderState;
|
|
34
35
|
private shouldUpdateRegoStates;
|
|
@@ -52,6 +53,7 @@ export declare class TilesetStyler {
|
|
|
52
53
|
menuItemId?: string;
|
|
53
54
|
scenario?: number | string;
|
|
54
55
|
historic?: boolean;
|
|
56
|
+
applyStyles?: boolean;
|
|
55
57
|
}): void;
|
|
56
58
|
/**
|
|
57
59
|
* Updates style mapping and fallback style.
|
|
@@ -7,9 +7,11 @@ export declare const CESIUM_TIMELINE_LIVE_PADDING_KEY = "_nextspace_timeline_liv
|
|
|
7
7
|
export declare const CESIUM_TIMELINE_INTERVAL_KEY = "_nextspace_timeline_interval";
|
|
8
8
|
export declare const CESIUM_MODEL_SPACE_KEY = "_nextspace_model_space";
|
|
9
9
|
export declare const DEFAULT_LIVE_PADDING_SECONDS: number;
|
|
10
|
-
export declare const DEFAULT_BRIGHTNESS_SHIFT = 0
|
|
11
|
-
export declare const DEFAULT_LIGHT_INTENSITY =
|
|
10
|
+
export declare const DEFAULT_BRIGHTNESS_SHIFT = 0;
|
|
11
|
+
export declare const DEFAULT_LIGHT_INTENSITY = 2;
|
|
12
12
|
export declare const LIGHTING_SETTINGS_VERSION = 2;
|
|
13
|
+
export declare const LIGHT_INTENSITY_COMPENSATION = 1.2;
|
|
14
|
+
export declare const MAX_COMPENSATED_LIGHT_INTENSITY = 3;
|
|
13
15
|
export declare namespace ViewUtils {
|
|
14
16
|
function GatherLegacyMapTiles(params: {
|
|
15
17
|
viewer: Cesium.Viewer;
|
|
@@ -103,19 +105,40 @@ export declare namespace ViewUtils {
|
|
|
103
105
|
* @param shift -1 to 1, where 0 or less leaves CesiumJS's own defaults alone.
|
|
104
106
|
*/
|
|
105
107
|
function ApplyDefaultBrightness(viewer: Cesium.Viewer, shift?: number): void;
|
|
108
|
+
/**
|
|
109
|
+
* Options applied to the environment based lighting of every tileset and model this library creates.
|
|
110
|
+
* Null leaves CesiumJS's own defaults in place.
|
|
111
|
+
* @param options eg { enabled: false } to switch the lighting off, or { saturation: 0 } to keep the
|
|
112
|
+
* lift without the ground bounce tinting untextured geometry.
|
|
113
|
+
*/
|
|
114
|
+
function SetDefaultEnvironmentMapOptions(options: any): void;
|
|
115
|
+
/**
|
|
116
|
+
* Whether the host app's CesiumJS is a build that shades models darker than the ones these bookmarks were set up against.
|
|
117
|
+
* DynamicEnvironmentMapManager arrived with that change, so its presence marks
|
|
118
|
+
*/
|
|
119
|
+
function GetDefaultEnvironmentMapOptions(engineShadesDarker?: boolean): any;
|
|
120
|
+
/**
|
|
121
|
+
* The lighting options every tileset and model this library creates is built with.
|
|
122
|
+
* Spread into the construction options, since both are read once when a primitive is made.
|
|
123
|
+
*/
|
|
124
|
+
function DefaultLightingProps(engineShadesDarker?: boolean): any;
|
|
125
|
+
/**
|
|
126
|
+
* ImageBasedLighting applied to every tileset and model this library creates. Null, the default,
|
|
127
|
+
* leaves CesiumJS's own in place.
|
|
128
|
+
* @param imageBasedLighting a Cesium.ImageBasedLighting, shared across primitives.
|
|
129
|
+
*/
|
|
130
|
+
function SetDefaultImageBasedLighting(imageBasedLighting: any): void;
|
|
131
|
+
function GetDefaultImageBasedLighting(): any;
|
|
132
|
+
function EngineShadesModelsDarker(): boolean;
|
|
106
133
|
/**
|
|
107
134
|
* Resolves the sun colour and intensity to apply for a bookmark's lighting settings.
|
|
108
135
|
* @param lighting the bookmark's lighting settings, or null when it carries none.
|
|
109
136
|
* @returns the colour and intensity to put on the scene light.
|
|
110
137
|
*/
|
|
111
|
-
function ResolveLightSettings(lighting: any): {
|
|
138
|
+
function ResolveLightSettings(lighting: any, engineShadesDarker?: boolean): {
|
|
112
139
|
color: Cesium.Color;
|
|
113
140
|
intensity: number;
|
|
114
141
|
};
|
|
115
|
-
/**
|
|
116
|
-
* Options handed to every tileset and model this library creates.
|
|
117
|
-
*/
|
|
118
|
-
function DefaultEnvironmentMapOptions(): any;
|
|
119
142
|
function SetGlobeDetails(params: {
|
|
120
143
|
viewer: Cesium.Viewer;
|
|
121
144
|
hidden?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bruce-cesium",
|
|
3
|
-
"version": "7.1
|
|
3
|
+
"version": "7.2.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"main": "dist/bruce-cesium.umd.js",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"typescript": "^5.0.4"
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"bruce-models": "^7.1.
|
|
86
|
+
"bruce-models": "^7.1.75",
|
|
87
87
|
"tslib": "^2.4.1"
|
|
88
88
|
}
|
|
89
89
|
}
|