bruce-cesium 6.9.7 → 6.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bruce-cesium.es5.js +501 -39
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +499 -37
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/internal/image-utils.js +35 -0
- package/dist/lib/internal/image-utils.js.map +1 -0
- package/dist/lib/internal/series-segment.js +3 -0
- package/dist/lib/internal/series-segment.js.map +1 -0
- package/dist/lib/rendering/entity-render-engine-polygon.js +146 -35
- package/dist/lib/rendering/entity-render-engine-polygon.js.map +1 -1
- package/dist/lib/rendering/entity-render-engine.js +1 -0
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/rendering/menu-item-manager.js +46 -1
- package/dist/lib/rendering/menu-item-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +3 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/texture-frame-series-animator.js +281 -0
- package/dist/lib/rendering/texture-frame-series-animator.js.map +1 -0
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/internal/image-utils.d.ts +10 -0
- package/dist/types/internal/series-segment.d.ts +10 -0
- package/dist/types/rendering/entity-render-engine-polygon.d.ts +4 -0
- package/dist/types/rendering/entity-render-engine.d.ts +2 -0
- package/dist/types/rendering/menu-item-manager.d.ts +19 -0
- package/dist/types/rendering/render-managers/entities/entities-render-manager.d.ts +3 -0
- package/dist/types/rendering/texture-frame-series-animator.d.ts +93 -0
- package/package.json +2 -2
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TextureFrameSeriesAnimator = void 0;
|
|
4
|
+
const bruce_models_1 = require("bruce-models");
|
|
5
|
+
const Cesium = require("cesium");
|
|
6
|
+
const image_utils_1 = require("../internal/image-utils");
|
|
7
|
+
var TextureFrameSeriesAnimator;
|
|
8
|
+
(function (TextureFrameSeriesAnimator) {
|
|
9
|
+
/**
|
|
10
|
+
* Detects whether a ClientFile's `Data.generation` metadata describes a frame archive rather than a single static image,
|
|
11
|
+
* so a caller can decide whether to construct an Animator or fall back to the existing static-texture path.
|
|
12
|
+
* @param data ClientFile.Data (the `IFile.Data` field), as returned by ClientFile.Get().
|
|
13
|
+
*/
|
|
14
|
+
function IsFrameArchiveMetadata(data) {
|
|
15
|
+
return Boolean(data && data.generation && Array.isArray(data.generation.Frames) && data.generation.Frames.length > 0);
|
|
16
|
+
}
|
|
17
|
+
TextureFrameSeriesAnimator.IsFrameArchiveMetadata = IsFrameArchiveMetadata;
|
|
18
|
+
const DEFAULT_CROSSFADE_MS = 900;
|
|
19
|
+
const DEFAULT_LOW_COLOR = { red: 255, green: 255, blue: 255, alpha: 0.12 };
|
|
20
|
+
const DEFAULT_HIGH_COLOR = { red: 21, green: 96, blue: 196, alpha: 0.92 };
|
|
21
|
+
class Animator {
|
|
22
|
+
constructor(options) {
|
|
23
|
+
var _a;
|
|
24
|
+
this.removeOnTick = null;
|
|
25
|
+
this.removeCrossfadeTick = null;
|
|
26
|
+
this.disposed = false;
|
|
27
|
+
this.currentFrameIndex = -1;
|
|
28
|
+
// Single-in-flight fetch queue: only one Range GET outstanding at a time, and the NEXT one
|
|
29
|
+
// is chosen right before sending, this is what makes reprioritizing mid-scrub take effect
|
|
30
|
+
// immediately instead of draining a backlog of stale requests first.
|
|
31
|
+
this.inFlightIndex = -1;
|
|
32
|
+
this.pendingIndex = -1;
|
|
33
|
+
this.displayedPixels = null;
|
|
34
|
+
this.fadeFromPixels = null;
|
|
35
|
+
this.fadeToIndex = -1;
|
|
36
|
+
this.fadeToDims = null;
|
|
37
|
+
this.fadeStartMs = null;
|
|
38
|
+
// Two-canvas pool: Cesium compares image references each frame, so alternating between
|
|
39
|
+
// pool[0]/pool[1] gives a new object reference whenever we actually present a new frame,
|
|
40
|
+
// forcing Cesium to re-upload the texture only when something changed.
|
|
41
|
+
this.pool = [document.createElement("canvas"), document.createElement("canvas")];
|
|
42
|
+
this.poolIdx = 0;
|
|
43
|
+
if (!options.entity.polygon) {
|
|
44
|
+
throw new Error("TextureFrameSeriesAnimator requires an entity with polygon graphics.");
|
|
45
|
+
}
|
|
46
|
+
if (!options.frames || options.frames.length === 0) {
|
|
47
|
+
throw new Error("TextureFrameSeriesAnimator requires at least one frame.");
|
|
48
|
+
}
|
|
49
|
+
this.viewer = options.viewer;
|
|
50
|
+
this.entity = options.entity;
|
|
51
|
+
this.archiveUrl = options.archiveUrl;
|
|
52
|
+
this.frames = options.frames;
|
|
53
|
+
this.crossfadeMs = (_a = options.crossfadeMs) !== null && _a !== void 0 ? _a : DEFAULT_CROSSFADE_MS;
|
|
54
|
+
const mask = options.textureColorMask;
|
|
55
|
+
this.lowColor = (mask && bruce_models_1.Color.ColorFromStr(mask.minColor)) || DEFAULT_LOW_COLOR;
|
|
56
|
+
this.highColor = (mask && bruce_models_1.Color.ColorFromStr(mask.maxColor)) || DEFAULT_HIGH_COLOR;
|
|
57
|
+
this.frameDates = this.frames.map((f) => Cesium.JulianDate.fromIso8601(f.Timestamp));
|
|
58
|
+
this.frameCache = new Array(this.frames.length).fill(null);
|
|
59
|
+
this.frameDims = new Array(this.frames.length).fill(null);
|
|
60
|
+
this.originalMaterial = options.entity.polygon.material;
|
|
61
|
+
this.imageProperty = new Cesium.CallbackProperty(() => this.pool[this.poolIdx], false);
|
|
62
|
+
options.entity.polygon.material = new Cesium.ImageMaterialProperty({ image: this.imageProperty, transparent: true });
|
|
63
|
+
this.removeCrossfadeTick = this.viewer.scene.postUpdate.addEventListener(() => this.tickCrossfade());
|
|
64
|
+
this.removeOnTick = this.viewer.clock.onTick.addEventListener((clock) => this.onClockTick(clock.currentTime));
|
|
65
|
+
this.onClockTick(this.viewer.clock.currentTime);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Explicit teardown: stops driving the entity's material, abandons any in-flight/pending fetch (results are simply ignored when they land),
|
|
69
|
+
* and restores whatever material the entity had before construction. Never called automatically.
|
|
70
|
+
*/
|
|
71
|
+
Dispose() {
|
|
72
|
+
if (this.disposed) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this.disposed = true;
|
|
76
|
+
if (this.removeOnTick) {
|
|
77
|
+
this.removeOnTick();
|
|
78
|
+
this.removeOnTick = null;
|
|
79
|
+
}
|
|
80
|
+
if (this.removeCrossfadeTick) {
|
|
81
|
+
this.removeCrossfadeTick();
|
|
82
|
+
this.removeCrossfadeTick = null;
|
|
83
|
+
}
|
|
84
|
+
if (this.entity && this.entity.polygon) {
|
|
85
|
+
this.entity.polygon.material = this.originalMaterial;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
IsDisposed() {
|
|
89
|
+
return this.disposed;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The archive URL this instance was constructed with,
|
|
93
|
+
* lets a caller re-rendering the same entity tell whether an existing instance is already correct, without reaching into private state.
|
|
94
|
+
*/
|
|
95
|
+
GetArchiveUrl() {
|
|
96
|
+
return this.archiveUrl;
|
|
97
|
+
}
|
|
98
|
+
onClockTick(currentTime) {
|
|
99
|
+
if (this.disposed) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
this.swapToFrame(this.findFrameIndex(currentTime));
|
|
103
|
+
}
|
|
104
|
+
// Binary-search the frame whose timestamp is <= currentTime.
|
|
105
|
+
findFrameIndex(currentTime) {
|
|
106
|
+
const dates = this.frameDates;
|
|
107
|
+
let lo = 0;
|
|
108
|
+
let hi = dates.length - 1;
|
|
109
|
+
if (Cesium.JulianDate.lessThanOrEquals(currentTime, dates[0])) {
|
|
110
|
+
return 0;
|
|
111
|
+
}
|
|
112
|
+
if (Cesium.JulianDate.greaterThanOrEquals(currentTime, dates[hi])) {
|
|
113
|
+
return hi;
|
|
114
|
+
}
|
|
115
|
+
while (lo < hi) {
|
|
116
|
+
const mid = (lo + hi + 1) >> 1;
|
|
117
|
+
if (Cesium.JulianDate.lessThanOrEquals(dates[mid], currentTime)) {
|
|
118
|
+
lo = mid;
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
hi = mid - 1;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return lo;
|
|
125
|
+
}
|
|
126
|
+
// Called with the discrete target frame (never a fractional/interpolated index).
|
|
127
|
+
// Scrubbing rapidly just retargets what's fetched next.
|
|
128
|
+
swapToFrame(idx) {
|
|
129
|
+
if (idx === this.currentFrameIndex) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
this.currentFrameIndex = idx;
|
|
133
|
+
if (this.frameCache[idx]) {
|
|
134
|
+
this.beginCrossfadeTo(idx);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
this.ensureFrame(idx);
|
|
138
|
+
}
|
|
139
|
+
ensureFrame(idx) {
|
|
140
|
+
if (this.frameCache[idx]) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (this.inFlightIndex === idx) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
this.pendingIndex = idx;
|
|
147
|
+
this.pumpFetchQueue();
|
|
148
|
+
}
|
|
149
|
+
// Nearest still-uncached frame to wherever the viewer CURRENTLY is.
|
|
150
|
+
nearestUncachedFrame() {
|
|
151
|
+
const n = this.frameCache.length;
|
|
152
|
+
if (this.currentFrameIndex < 0) {
|
|
153
|
+
return this.frameCache[0] ? -1 : 0;
|
|
154
|
+
}
|
|
155
|
+
for (let d = 0; d < n; d++) {
|
|
156
|
+
const forward = this.currentFrameIndex + d;
|
|
157
|
+
if (forward < n && !this.frameCache[forward]) {
|
|
158
|
+
return forward;
|
|
159
|
+
}
|
|
160
|
+
const backward = this.currentFrameIndex - d;
|
|
161
|
+
if (backward >= 0 && !this.frameCache[backward]) {
|
|
162
|
+
return backward;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return -1;
|
|
166
|
+
}
|
|
167
|
+
pumpFetchQueue() {
|
|
168
|
+
if (this.disposed || this.inFlightIndex !== -1) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
let next = -1;
|
|
172
|
+
if (this.pendingIndex !== -1) {
|
|
173
|
+
next = this.pendingIndex;
|
|
174
|
+
this.pendingIndex = -1;
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
next = this.nearestUncachedFrame();
|
|
178
|
+
}
|
|
179
|
+
if (next === -1) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
this.inFlightIndex = next;
|
|
183
|
+
this.fetchAndTint(next)
|
|
184
|
+
.catch(() => {
|
|
185
|
+
// Eating it.
|
|
186
|
+
})
|
|
187
|
+
.finally(() => {
|
|
188
|
+
this.inFlightIndex = -1;
|
|
189
|
+
if (!this.disposed) {
|
|
190
|
+
this.pumpFetchQueue();
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
async fetchAndTint(idx) {
|
|
195
|
+
const entry = this.frames[idx];
|
|
196
|
+
const start = entry.ByteOffset;
|
|
197
|
+
const end = entry.ByteOffset + entry.ByteLength - 1;
|
|
198
|
+
const response = await fetch(this.archiveUrl, { headers: { Range: `bytes=${start}-${end}` } });
|
|
199
|
+
const buffer = await response.arrayBuffer();
|
|
200
|
+
if (this.disposed) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const decoded = await this.decodeAndTint(buffer);
|
|
204
|
+
if (this.disposed) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
this.frameCache[idx] = decoded.pixels;
|
|
208
|
+
this.frameDims[idx] = { width: decoded.width, height: decoded.height };
|
|
209
|
+
if (idx === this.currentFrameIndex) {
|
|
210
|
+
this.beginCrossfadeTo(idx);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Decodes one frame's raw PNG bytes (as returned by a Range GET) and applies the grayscale color mask.
|
|
215
|
+
*/
|
|
216
|
+
async decodeAndTint(buffer) {
|
|
217
|
+
const blob = new Blob([buffer], { type: "image/png" });
|
|
218
|
+
const objectUrl = URL.createObjectURL(blob);
|
|
219
|
+
let image;
|
|
220
|
+
try {
|
|
221
|
+
image = await (0, image_utils_1.loadImage)(objectUrl);
|
|
222
|
+
}
|
|
223
|
+
finally {
|
|
224
|
+
URL.revokeObjectURL(objectUrl);
|
|
225
|
+
}
|
|
226
|
+
const canvas = document.createElement("canvas");
|
|
227
|
+
canvas.width = image.width;
|
|
228
|
+
canvas.height = image.height;
|
|
229
|
+
const ctx = canvas.getContext("2d");
|
|
230
|
+
ctx.drawImage(image, 0, 0);
|
|
231
|
+
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
|
232
|
+
(0, image_utils_1.ApplyGrayscaleColorMask)(imageData, this.lowColor, this.highColor);
|
|
233
|
+
return { pixels: imageData.data, width: canvas.width, height: canvas.height };
|
|
234
|
+
}
|
|
235
|
+
beginCrossfadeTo(idx) {
|
|
236
|
+
const to = this.frameCache[idx];
|
|
237
|
+
this.fadeFromPixels = this.displayedPixels === null ? new Uint8ClampedArray(to.length) : this.displayedPixels;
|
|
238
|
+
this.fadeToIndex = idx;
|
|
239
|
+
this.fadeToDims = this.frameDims[idx];
|
|
240
|
+
this.fadeStartMs = Now();
|
|
241
|
+
}
|
|
242
|
+
tickCrossfade() {
|
|
243
|
+
if (this.disposed || this.fadeStartMs === null) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
const t = Math.min(1, (Now() - this.fadeStartMs) / this.crossfadeMs);
|
|
247
|
+
const eased = easeInOutQuad(t);
|
|
248
|
+
const from = this.fadeFromPixels;
|
|
249
|
+
const to = this.frameCache[this.fadeToIndex];
|
|
250
|
+
const n = Math.min(from.length, to.length);
|
|
251
|
+
const blended = new Uint8ClampedArray(to.length);
|
|
252
|
+
for (let i = 0; i < n; i++) {
|
|
253
|
+
blended[i] = from[i] + (to[i] - from[i]) * eased;
|
|
254
|
+
}
|
|
255
|
+
this.presentPixels(blended, this.fadeToDims);
|
|
256
|
+
if (t >= 1) {
|
|
257
|
+
this.fadeStartMs = null;
|
|
258
|
+
this.fadeFromPixels = null;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
presentPixels(pixels, dims) {
|
|
262
|
+
this.poolIdx = 1 - this.poolIdx;
|
|
263
|
+
const target = this.pool[this.poolIdx];
|
|
264
|
+
target.width = dims.width;
|
|
265
|
+
target.height = dims.height;
|
|
266
|
+
const ctx = target.getContext("2d");
|
|
267
|
+
const imgData = ctx.createImageData(dims.width, dims.height);
|
|
268
|
+
imgData.data.set(pixels);
|
|
269
|
+
ctx.putImageData(imgData, 0, 0);
|
|
270
|
+
this.displayedPixels = pixels;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
TextureFrameSeriesAnimator.Animator = Animator;
|
|
274
|
+
function easeInOutQuad(t) {
|
|
275
|
+
return t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2;
|
|
276
|
+
}
|
|
277
|
+
function Now() {
|
|
278
|
+
return typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
279
|
+
}
|
|
280
|
+
})(TextureFrameSeriesAnimator = exports.TextureFrameSeriesAnimator || (exports.TextureFrameSeriesAnimator = {}));
|
|
281
|
+
//# sourceMappingURL=texture-frame-series-animator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture-frame-series-animator.js","sourceRoot":"","sources":["../../../src/rendering/texture-frame-series-animator.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,iCAAiC;AACjC,yDAA6E;AAE7E,IAAiB,0BAA0B,CA+V1C;AA/VD,WAAiB,0BAA0B;IAoBvC;;;;OAIG;IACH,SAAgB,sBAAsB,CAAC,IAAS;QAC5C,OAAO,OAAO,CA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AAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACzB,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAChC,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC;QAClC,CAAC;KACJ;IAxSY,mCAAQ,WAwSpB,CAAA;IAED,SAAS,aAAa,CAAC,CAAS;QAC5B,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC;IAED,SAAS,GAAG;QACR,OAAO,OAAO,WAAW,KAAK,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IAC/E,CAAC;AACL,CAAC,EA/VgB,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QA+V1C"}
|
|
@@ -60,7 +60,7 @@ export * from "./widgets/widget-info-view";
|
|
|
60
60
|
export * from "./widgets/widget-left-panel";
|
|
61
61
|
export * from "./widgets/widget-nav-compass";
|
|
62
62
|
export * from "./widgets/widget-view-bar";
|
|
63
|
-
export declare const VERSION = "6.9.
|
|
63
|
+
export declare const VERSION = "6.9.9";
|
|
64
64
|
/**
|
|
65
65
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
66
66
|
* This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Color } from "bruce-models";
|
|
2
|
+
/**
|
|
3
|
+
* Remaps a (assumed grayscale, server-rendered black-to-white) image's pixels into a gradient between minColor/maxColor,
|
|
4
|
+
* preserving source alpha blended with the mask's own alpha.
|
|
5
|
+
* @param imageData
|
|
6
|
+
* @param minColor
|
|
7
|
+
* @param maxColor
|
|
8
|
+
*/
|
|
9
|
+
export declare function ApplyGrayscaleColorMask(imageData: ImageData, minColor: Color.IColor, maxColor: Color.IColor): void;
|
|
10
|
+
export declare function loadImage(src: string): Promise<HTMLImageElement>;
|
|
@@ -2,6 +2,7 @@ import { BruceApi, Entity, EntityTag, IDictionary, Style, ZoomControl } from "br
|
|
|
2
2
|
import * as Cesium from "cesium";
|
|
3
3
|
import { EntityRenderEngine } from "./entity-render-engine";
|
|
4
4
|
import { VisualsRegister } from "./visuals-register";
|
|
5
|
+
import { ISeriesSegment } from "../internal/series-segment";
|
|
5
6
|
export declare namespace EntityRenderEnginePolygon {
|
|
6
7
|
interface IParams {
|
|
7
8
|
rendered?: EntityRenderEngine.ICesiumEntityExt;
|
|
@@ -12,10 +13,13 @@ export declare namespace EntityRenderEnginePolygon {
|
|
|
12
13
|
viewer: Cesium.Viewer;
|
|
13
14
|
maxDistance?: number;
|
|
14
15
|
minDistance?: number;
|
|
16
|
+
menuItemId?: string;
|
|
17
|
+
onSeriesDiscovered?: (segment: ISeriesSegment) => void;
|
|
15
18
|
}
|
|
16
19
|
interface IGroupParams {
|
|
17
20
|
apiGetter: BruceApi.IGetter;
|
|
18
21
|
menuItemId: string;
|
|
22
|
+
onSeriesDiscovered?: (segment: ISeriesSegment) => void;
|
|
19
23
|
entities: Entity.IEntity[];
|
|
20
24
|
zoomItems: IDictionary<ZoomControl.IItem>;
|
|
21
25
|
visualRegister: VisualsRegister.Register;
|
|
@@ -5,6 +5,7 @@ import { EntityRenderEnginePoint } from "./entity-render-engine-point";
|
|
|
5
5
|
import { EntityRenderEngineModel3d } from "./entity-render-engine-model3d";
|
|
6
6
|
import { EntityRenderEnginePolyline } from "./entity-render-engine-polyline";
|
|
7
7
|
import { EntityRenderEnginePolygon } from "./entity-render-engine-polygon";
|
|
8
|
+
import { ISeriesSegment } from "../internal/series-segment";
|
|
8
9
|
export declare function isStyleChanged(rego: VisualsRegister.IVisualRego, zoomItem: ZoomControl.IItem): boolean;
|
|
9
10
|
export declare function isOutlineChanged(rego: VisualsRegister.IVisualRego, entity: Entity.IEntity): boolean;
|
|
10
11
|
/**
|
|
@@ -74,6 +75,7 @@ export declare namespace EntityRenderEngine {
|
|
|
74
75
|
viewer: Cesium.Viewer;
|
|
75
76
|
visualRegister: VisualsRegister.Register;
|
|
76
77
|
menuItemId: string;
|
|
78
|
+
onSeriesDiscovered?: (segment: ISeriesSegment) => void;
|
|
77
79
|
zoomControl: ZoomControl.IItem[];
|
|
78
80
|
entities: Entity.IEntity[];
|
|
79
81
|
entitiesHistoric?: IDictionary<EntityHistoricData.IData[]>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiGetters, BruceApi, BruceEvent, Entity, MenuItem } from "bruce-models";
|
|
2
2
|
import * as Cesium from "cesium";
|
|
3
|
+
import * as SeriesSegmentTypes from "../internal/series-segment";
|
|
3
4
|
import { RenderManager } from "./render-managers/render-manager";
|
|
4
5
|
import { VisualsRegister } from "./visuals-register";
|
|
5
6
|
import { CesiumViewMonitor } from "../viewer/cesium-view-monitor";
|
|
@@ -19,6 +20,8 @@ export declare namespace MenuItemManager {
|
|
|
19
20
|
itemId: string;
|
|
20
21
|
isEnabling: boolean;
|
|
21
22
|
}
|
|
23
|
+
export import ISeriesSegment = SeriesSegmentTypes.ISeriesSegment;
|
|
24
|
+
export import ISeriesUpdate = SeriesSegmentTypes.ISeriesUpdate;
|
|
22
25
|
class Manager {
|
|
23
26
|
private getters;
|
|
24
27
|
get Getters(): ApiGetters;
|
|
@@ -30,6 +33,22 @@ export declare namespace MenuItemManager {
|
|
|
30
33
|
get VisualsRegister(): VisualsRegister.Register;
|
|
31
34
|
private onUpdate;
|
|
32
35
|
get OnUpdate(): BruceEvent<IMenuItemUpdate>;
|
|
36
|
+
private seriesSegments;
|
|
37
|
+
private onSeriesUpdated;
|
|
38
|
+
get OnSeriesUpdated(): BruceEvent<ISeriesUpdate>;
|
|
39
|
+
/**
|
|
40
|
+
* Currently known series segments for a menu item (empty array if none discovered yet).
|
|
41
|
+
*/
|
|
42
|
+
GetSeriesSegments(itemId: string): ISeriesSegment[];
|
|
43
|
+
/**
|
|
44
|
+
* @param itemId
|
|
45
|
+
* @param segment
|
|
46
|
+
*/
|
|
47
|
+
RecordSeriesSegment(itemId: string, segment: ISeriesSegment): void;
|
|
48
|
+
/**
|
|
49
|
+
* Clears any series segments recorded for a menu item, eg when it's disabled/removed.
|
|
50
|
+
*/
|
|
51
|
+
ClearSeriesSegments(itemId: string): void;
|
|
33
52
|
private sharedGetters;
|
|
34
53
|
private sharedMonitor;
|
|
35
54
|
private tilesetInitQueue;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BruceApi, Entity, MenuItem, ZoomControl } from "bruce-models";
|
|
2
2
|
import * as Cesium from "cesium";
|
|
3
|
+
import { ISeriesSegment } from "../../../internal/series-segment";
|
|
3
4
|
import { CesiumViewMonitor } from "../../../viewer/cesium-view-monitor";
|
|
4
5
|
import { VisualsRegister } from "../../visuals-register";
|
|
5
6
|
import { SharedGetters } from "../common/shared-getters";
|
|
@@ -26,6 +27,7 @@ export declare namespace EntitiesRenderManager {
|
|
|
26
27
|
private feedPendingUpdateIds;
|
|
27
28
|
private feedUpdateThrottleTimer;
|
|
28
29
|
private visualsManager;
|
|
30
|
+
private onSeriesDiscovered?;
|
|
29
31
|
private entityCheckQueue;
|
|
30
32
|
private entityCheckQueueIds;
|
|
31
33
|
private entityCheckRemoval;
|
|
@@ -48,6 +50,7 @@ export declare namespace EntitiesRenderManager {
|
|
|
48
50
|
monitor: CesiumViewMonitor.Monitor;
|
|
49
51
|
item: MenuItem.Item.IEntities;
|
|
50
52
|
sharedGetters: SharedGetters.Cache;
|
|
53
|
+
onSeriesDiscovered?: (segment: ISeriesSegment) => void;
|
|
51
54
|
});
|
|
52
55
|
Init(params?: {
|
|
53
56
|
item: MenuItem.Item.IEntities;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Style } from "bruce-models";
|
|
2
|
+
import * as Cesium from "cesium";
|
|
3
|
+
export declare namespace TextureFrameSeriesAnimator {
|
|
4
|
+
/**
|
|
5
|
+
* One frame's location within the archive's blob file (matches ERDDAPTextureBuilder.FrameEntry).
|
|
6
|
+
*/
|
|
7
|
+
interface IFrameEntry {
|
|
8
|
+
Timestamp: string;
|
|
9
|
+
ByteOffset: number;
|
|
10
|
+
ByteLength: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Shape of ClientFile.Data.generation for a frame-archive texture (as opposed to a single static image).
|
|
14
|
+
*/
|
|
15
|
+
interface IFrameArchiveMetadata {
|
|
16
|
+
Frames: IFrameEntry[];
|
|
17
|
+
ValueMin?: number;
|
|
18
|
+
ValueMax?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Detects whether a ClientFile's `Data.generation` metadata describes a frame archive rather than a single static image,
|
|
22
|
+
* so a caller can decide whether to construct an Animator or fall back to the existing static-texture path.
|
|
23
|
+
* @param data ClientFile.Data (the `IFile.Data` field), as returned by ClientFile.Get().
|
|
24
|
+
*/
|
|
25
|
+
function IsFrameArchiveMetadata(data: any): data is {
|
|
26
|
+
generation: IFrameArchiveMetadata;
|
|
27
|
+
};
|
|
28
|
+
interface IOptions {
|
|
29
|
+
viewer: Cesium.Viewer;
|
|
30
|
+
entity: Cesium.Entity;
|
|
31
|
+
archiveUrl: string;
|
|
32
|
+
frames: IFrameEntry[];
|
|
33
|
+
textureColorMask?: Style.ITextureColorMask;
|
|
34
|
+
crossfadeMs?: number;
|
|
35
|
+
}
|
|
36
|
+
class Animator {
|
|
37
|
+
private readonly viewer;
|
|
38
|
+
private readonly entity;
|
|
39
|
+
private readonly archiveUrl;
|
|
40
|
+
private readonly frames;
|
|
41
|
+
private readonly frameDates;
|
|
42
|
+
private readonly crossfadeMs;
|
|
43
|
+
private readonly lowColor;
|
|
44
|
+
private readonly highColor;
|
|
45
|
+
private readonly originalMaterial;
|
|
46
|
+
private removeOnTick;
|
|
47
|
+
private removeCrossfadeTick;
|
|
48
|
+
private disposed;
|
|
49
|
+
private frameCache;
|
|
50
|
+
private frameDims;
|
|
51
|
+
private currentFrameIndex;
|
|
52
|
+
private inFlightIndex;
|
|
53
|
+
private pendingIndex;
|
|
54
|
+
private displayedPixels;
|
|
55
|
+
private fadeFromPixels;
|
|
56
|
+
private fadeToIndex;
|
|
57
|
+
private fadeToDims;
|
|
58
|
+
private fadeStartMs;
|
|
59
|
+
private readonly pool;
|
|
60
|
+
private poolIdx;
|
|
61
|
+
private readonly imageProperty;
|
|
62
|
+
constructor(options: IOptions);
|
|
63
|
+
/**
|
|
64
|
+
* Explicit teardown: stops driving the entity's material, abandons any in-flight/pending fetch (results are simply ignored when they land),
|
|
65
|
+
* and restores whatever material the entity had before construction. Never called automatically.
|
|
66
|
+
*/
|
|
67
|
+
Dispose(): void;
|
|
68
|
+
IsDisposed(): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* The archive URL this instance was constructed with,
|
|
71
|
+
* lets a caller re-rendering the same entity tell whether an existing instance is already correct, without reaching into private state.
|
|
72
|
+
*/
|
|
73
|
+
GetArchiveUrl(): string;
|
|
74
|
+
private onClockTick;
|
|
75
|
+
private findFrameIndex;
|
|
76
|
+
private swapToFrame;
|
|
77
|
+
private ensureFrame;
|
|
78
|
+
private nearestUncachedFrame;
|
|
79
|
+
private pumpFetchQueue;
|
|
80
|
+
private fetchAndTint;
|
|
81
|
+
/**
|
|
82
|
+
* Decodes one frame's raw PNG bytes (as returned by a Range GET) and applies the grayscale color mask.
|
|
83
|
+
*/
|
|
84
|
+
protected decodeAndTint(buffer: ArrayBuffer): Promise<{
|
|
85
|
+
pixels: Uint8ClampedArray;
|
|
86
|
+
width: number;
|
|
87
|
+
height: number;
|
|
88
|
+
}>;
|
|
89
|
+
private beginCrossfadeTo;
|
|
90
|
+
private tickCrossfade;
|
|
91
|
+
private presentPixels;
|
|
92
|
+
}
|
|
93
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bruce-cesium",
|
|
3
|
-
"version": "6.9.
|
|
3
|
+
"version": "6.9.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"main": "dist/bruce-cesium.umd.js",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"bruce-cesium": "^6.8.5",
|
|
84
|
-
"bruce-models": "^7.1.
|
|
84
|
+
"bruce-models": "^7.1.66",
|
|
85
85
|
"tslib": "^2.4.1"
|
|
86
86
|
}
|
|
87
87
|
}
|