bruce-cesium 7.6.0 → 7.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/bruce-cesium.es5.js +2057 -348
  2. package/dist/bruce-cesium.es5.js.map +1 -1
  3. package/dist/bruce-cesium.umd.js +2050 -345
  4. package/dist/bruce-cesium.umd.js.map +1 -1
  5. package/dist/lib/bruce-cesium.js +2 -1
  6. package/dist/lib/bruce-cesium.js.map +1 -1
  7. package/dist/lib/rendering/cesium-animated-property.js +63 -107
  8. package/dist/lib/rendering/cesium-animated-property.js.map +1 -1
  9. package/dist/lib/rendering/entity-gatherer.js +11 -3
  10. package/dist/lib/rendering/entity-gatherer.js.map +1 -1
  11. package/dist/lib/rendering/menu-item-manager.js +83 -10
  12. package/dist/lib/rendering/menu-item-manager.js.map +1 -1
  13. package/dist/lib/rendering/relation-render-engine.js +24 -5
  14. package/dist/lib/rendering/relation-render-engine.js.map +1 -1
  15. package/dist/lib/rendering/render-managers/common/entity-label-group.js +13 -9
  16. package/dist/lib/rendering/render-managers/common/entity-label-group.js.map +1 -1
  17. package/dist/lib/rendering/render-managers/common/entity-label.js +94 -12
  18. package/dist/lib/rendering/render-managers/common/entity-label.js.map +1 -1
  19. package/dist/lib/rendering/render-managers/common/entity-rerender-maintain-state.js +44 -5
  20. package/dist/lib/rendering/render-managers/common/entity-rerender-maintain-state.js.map +1 -1
  21. package/dist/lib/rendering/render-managers/common/entity-simulation.js +483 -0
  22. package/dist/lib/rendering/render-managers/common/entity-simulation.js.map +1 -0
  23. package/dist/lib/rendering/render-managers/common/historic-trail.js +123 -0
  24. package/dist/lib/rendering/render-managers/common/historic-trail.js.map +1 -0
  25. package/dist/lib/rendering/render-managers/common/historic-utils.js +17 -6
  26. package/dist/lib/rendering/render-managers/common/historic-utils.js.map +1 -1
  27. package/dist/lib/rendering/render-managers/entities/entities-datalab-render-manager.js +3 -2
  28. package/dist/lib/rendering/render-managers/entities/entities-datalab-render-manager.js.map +1 -1
  29. package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +10 -2
  30. package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js.map +1 -1
  31. package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js +3 -2
  32. package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js.map +1 -1
  33. package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +18 -5
  34. package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
  35. package/dist/lib/rendering/render-managers/entities/entity-render-manager.js +1 -1
  36. package/dist/lib/rendering/render-managers/entities/entity-render-manager.js.map +1 -1
  37. package/dist/lib/rendering/render-managers/other/assembly-render-manager.js +745 -106
  38. package/dist/lib/rendering/render-managers/other/assembly-render-manager.js.map +1 -1
  39. package/dist/lib/rendering/render-managers/other/legacy-relations-render-manager.js +23 -1
  40. package/dist/lib/rendering/render-managers/other/legacy-relations-render-manager.js.map +1 -1
  41. package/dist/lib/rendering/render-managers/other/relations-render-manager.js +23 -1
  42. package/dist/lib/rendering/render-managers/other/relations-render-manager.js.map +1 -1
  43. package/dist/lib/rendering/render-managers/render-manager.js.map +1 -1
  44. package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js +2 -0
  45. package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js.map +1 -1
  46. package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js +130 -40
  47. package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js.map +1 -1
  48. package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js +3 -0
  49. package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js.map +1 -1
  50. package/dist/lib/rendering/tileset-styler.js +1 -1
  51. package/dist/lib/rendering/tileset-styler.js.map +1 -1
  52. package/dist/lib/rendering/visual-register-culler.js +2 -0
  53. package/dist/lib/rendering/visual-register-culler.js.map +1 -1
  54. package/dist/lib/rendering/visuals-register.js +89 -20
  55. package/dist/lib/rendering/visuals-register.js.map +1 -1
  56. package/dist/lib/utils/entity-utils.js +43 -2
  57. package/dist/lib/utils/entity-utils.js.map +1 -1
  58. package/dist/lib/widgets/widget-info-view.js +20 -7
  59. package/dist/lib/widgets/widget-info-view.js.map +1 -1
  60. package/dist/types/bruce-cesium.d.ts +2 -1
  61. package/dist/types/rendering/cesium-animated-property.d.ts +8 -6
  62. package/dist/types/rendering/entity-gatherer.d.ts +6 -1
  63. package/dist/types/rendering/menu-item-manager.d.ts +33 -1
  64. package/dist/types/rendering/relation-render-engine.d.ts +10 -0
  65. package/dist/types/rendering/render-managers/common/entity-label-group.d.ts +3 -2
  66. package/dist/types/rendering/render-managers/common/entity-label.d.ts +5 -0
  67. package/dist/types/rendering/render-managers/common/entity-rerender-maintain-state.d.ts +20 -0
  68. package/dist/types/rendering/render-managers/common/entity-simulation.d.ts +126 -0
  69. package/dist/types/rendering/render-managers/common/historic-trail.d.ts +30 -0
  70. package/dist/types/rendering/render-managers/common/historic-utils.d.ts +4 -0
  71. package/dist/types/rendering/render-managers/entities/entities-datalab-render-manager.d.ts +2 -0
  72. package/dist/types/rendering/render-managers/entities/entities-ids-render-manager.d.ts +2 -0
  73. package/dist/types/rendering/render-managers/entities/entities-loaded-render-manager.d.ts +2 -0
  74. package/dist/types/rendering/render-managers/entities/entities-render-manager.d.ts +2 -0
  75. package/dist/types/rendering/render-managers/entities/entity-render-manager.d.ts +2 -0
  76. package/dist/types/rendering/render-managers/other/assembly-render-manager.d.ts +79 -2
  77. package/dist/types/rendering/render-managers/other/legacy-relations-render-manager.d.ts +5 -0
  78. package/dist/types/rendering/render-managers/other/relations-render-manager.d.ts +5 -0
  79. package/dist/types/rendering/render-managers/render-manager.d.ts +4 -0
  80. package/dist/types/rendering/render-managers/tilesets/tileset-arb-render-manager.d.ts +3 -0
  81. package/dist/types/rendering/render-managers/tilesets/tileset-cad-render-manager.d.ts +11 -1
  82. package/dist/types/rendering/render-managers/tilesets/tileset-entities-render-manager.d.ts +3 -0
  83. package/dist/types/rendering/tileset-styler.d.ts +2 -0
  84. package/dist/types/rendering/visuals-register.d.ts +13 -0
  85. package/dist/types/utils/entity-utils.d.ts +6 -0
  86. package/dist/types/widgets/widget-info-view.d.ts +1 -0
  87. package/package.json +2 -2
@@ -1,4 +1,5 @@
1
1
  import { BruceApi, Entity, EntityRelation, IDictionary, Style } from "bruce-models";
2
+ import { EntitySimulation } from "./render-managers/common/entity-simulation";
2
3
  import { VisualsRegister } from "./visuals-register";
3
4
  import * as Cesium from "cesium";
4
5
  export declare namespace RelationRenderEngine {
@@ -9,12 +10,21 @@ export declare namespace RelationRenderEngine {
9
10
  _dispose: () => void;
10
11
  }
11
12
  function GetRenderGroupId(relation: EntityRelation.IRelation): string;
13
+ /**
14
+ * Removes and returns a menu item's drawn relations that end at, or carry data from, any of these Entities.
15
+ */
16
+ function TakeRelationsTouching(params: {
17
+ visualRegister: VisualsRegister.Register;
18
+ menuItemId: string;
19
+ entityIds: string[];
20
+ }): EntityRelation.IRelation[];
12
21
  function Render(params: {
13
22
  apiGetter: BruceApi.IGetter;
14
23
  viewer: Cesium.Viewer;
15
24
  visualRegister: VisualsRegister.Register;
16
25
  menuItemId: string;
17
26
  relations: EntityRelation.IRelation[];
27
+ simulation?: EntitySimulation.Store;
18
28
  }): Promise<IDictionary<ICesiumEntityExt>>;
19
29
  namespace Parabola {
20
30
  interface IParabola {
@@ -1,5 +1,6 @@
1
1
  import { BruceApi, Calculator, DataLab, Entity } from "bruce-models";
2
2
  import { EntityLabel } from "./entity-label";
3
+ import { EntitySimulation } from "./entity-simulation";
3
4
  import type { VisualsRegister } from "../../visuals-register";
4
5
  export declare namespace EntityLabelGroup {
5
6
  interface IOptions extends Omit<EntityLabel.IOptions, "text" | "icon" | "iconUrl" | "iconClass" | "iconColor" | "iconBackground" | "iconPriority" | "iconStatus" | "iconScale" | "iconPhoto" | "photo"> {
@@ -73,8 +74,8 @@ export declare namespace EntityLabelGroup {
73
74
  * Returns if we need to resolve Entity data to create the label data.
74
75
  */
75
76
  function NeedsEntityData(options?: IOptions): boolean;
76
- function Hydrate(items: IItem[], api?: BruceApi.Api, signal?: AbortSignal): Promise<IItem[]>;
77
- function Loader(source: TSource, api?: BruceApi.Api, signal?: AbortSignal, hydrate?: boolean): Promise<(offset: number, limit: number, signal: AbortSignal) => Promise<IPage>>;
77
+ function Hydrate(items: IItem[], api?: BruceApi.Api, signal?: AbortSignal, simulation?: EntitySimulation.Store): Promise<IItem[]>;
78
+ function Loader(source: TSource, api?: BruceApi.Api, signal?: AbortSignal, hydrate?: boolean, simulation?: EntitySimulation.Store): Promise<(offset: number, limit: number, signal: AbortSignal) => Promise<IPage>>;
78
79
  class Manager {
79
80
  private register;
80
81
  private changed;
@@ -91,6 +91,7 @@ export declare namespace EntityLabel {
91
91
  iconRadius?: number;
92
92
  modelBox?: IModelBoxFrame;
93
93
  boxBlend?: number;
94
+ follows?: boolean;
94
95
  id: string;
95
96
  text?: string;
96
97
  clusterBounds?: {
@@ -215,6 +216,7 @@ export declare namespace EntityLabel {
215
216
  selected: () => boolean;
216
217
  hovered: () => boolean;
217
218
  near: () => boolean;
219
+ motion?: () => Cesium.Matrix4 | null;
218
220
  }
219
221
  export class ModelBoxes {
220
222
  private entries;
@@ -229,6 +231,8 @@ export declare namespace EntityLabel {
229
231
  private looks;
230
232
  private memberLooks;
231
233
  Set(id: string, corners: Cesium.Cartesian3[], entityId: string, inputs: IModelBoxEntry): void;
234
+ private forget;
235
+ private follow;
232
236
  Frame(id: string): IModelBoxFrame;
233
237
  Hull(id: string): TPoint[];
234
238
  Request(id: string, request: IModelBoxRequest): void;
@@ -299,6 +303,7 @@ export declare namespace EntityLabel {
299
303
  * Recalling will be ignored.
300
304
  */
301
305
  Dispose(): void;
306
+ Reload(): void;
302
307
  Configure(options?: IOptions, groupId?: string): void;
303
308
  /**
304
309
  * Creates cesium entity for the label if one does not exist.
@@ -1,9 +1,29 @@
1
1
  import { Entity, IDictionary } from "bruce-models";
2
+ import { EntitySimulation } from "./entity-simulation";
3
+ /**
4
+ * The instant and historic key a manager reads its Entities at, or null to read them as they are now.
5
+ */
6
+ export type TPointInTime = () => {
7
+ timeMs: number;
8
+ attrKey?: string;
9
+ } | null;
2
10
  /**
3
11
  * Tracks per-entity rerender state for unsaved blob maintenance and stale API response suppression.
4
12
  */
5
13
  export declare class EntityReRenderMaintainState {
14
+ private simulation?;
15
+ private pointInTime?;
6
16
  private maintainedEntitiesById;
17
+ constructor(simulation?: EntitySimulation.Store, pointInTime?: TPointInTime);
18
+ private atPoint;
19
+ /**
20
+ * Whether a simulated stand-in replaces this Entity, so nothing from the API may replace what is drawn.
21
+ */
22
+ isSimulated(entityId: string): boolean;
23
+ /**
24
+ * Swaps any simulated Entity in a set the API returned for its stand-in, or lays its patch over it.
25
+ */
26
+ withSimulated(entities: Entity.IEntity[]): Entity.IEntity[];
7
27
  private apiRevisionByEntityId;
8
28
  private skipApiRunByEntityId;
9
29
  private checkRunId;
@@ -0,0 +1,126 @@
1
+ import * as Cesium from "cesium";
2
+ import { BruceEvent, Entity, EntityHistoricData, IDictionary } from "bruce-models";
3
+ /**
4
+ * Entity data a caller asserts instead of what the API says, held for every menu item until it is cleared.
5
+ */
6
+ export declare namespace EntitySimulation {
7
+ /**
8
+ * The set used when a caller does not name one.
9
+ */
10
+ const DEFAULT_SET = "default";
11
+ /**
12
+ * The store for a viewer, made on first use and shared by everything drawing into that scene.
13
+ */
14
+ function Get(viewer: Cesium.Viewer): Store | null;
15
+ interface IChange {
16
+ entityIds: string[];
17
+ entities: boolean;
18
+ records: boolean;
19
+ set: string | null;
20
+ }
21
+ /**
22
+ * Returns base with patch laid over it: objects merge key by key, anything else replaces.
23
+ * @param whole names keys at the top level, or under Bruce, whose value is replaced rather than merged.
24
+ */
25
+ function Overlay<T>(base: T, patch: any, whole?: Set<string>): T;
26
+ class Store {
27
+ private sets;
28
+ private onChanged;
29
+ /**
30
+ * Triggered after anything is simulated or cleared, naming the Entities affected.
31
+ */
32
+ get OnChanged(): BruceEvent<IChange>;
33
+ /**
34
+ * Whether anything at all is simulated, so a caller can skip the work when nothing is.
35
+ */
36
+ get IsEmpty(): boolean;
37
+ /**
38
+ * The names of the sets holding anything, oldest first.
39
+ */
40
+ GetSets(): string[];
41
+ /**
42
+ * The time each set's records span, oldest set first, for sets holding any records.
43
+ */
44
+ GetSetRanges(): {
45
+ set: string;
46
+ startMs: number;
47
+ endMs: number;
48
+ entityIds: string[];
49
+ }[];
50
+ private setFor;
51
+ /**
52
+ * Replaces the stand-in for each Entity given, within a set.
53
+ */
54
+ SetEntities(entities: Entity.IEntity[], set?: string): void;
55
+ /**
56
+ * Replaces the patch for each Entity given, within a set. A patch names only the data it changes.
57
+ */
58
+ SetPatches(patches: Entity.IEntity[], set?: string): void;
59
+ private setBlobs;
60
+ /**
61
+ * Adds records to each Entity's simulated history within a set, replacing any at the same instant.
62
+ */
63
+ SetRecords(records: EntityHistoricData.IData[], set?: string): void;
64
+ /**
65
+ * Forgets what is simulated for these Entities, or for every Entity when none are named.
66
+ * @param params.set the set to clear. By default every set.
67
+ * @param params.entities clear the stand-ins and patches. Default true.
68
+ * @param params.records clear the historic records. Default true.
69
+ */
70
+ Clear(params?: {
71
+ set?: string;
72
+ entityIds?: string[];
73
+ entities?: boolean;
74
+ records?: boolean;
75
+ }): void;
76
+ /**
77
+ * The Entity's stand-in, with any patches laid over it, or null when nothing stands in for it.
78
+ */
79
+ GetEntity(entityId: string): Entity.IEntity | null;
80
+ /**
81
+ * Whether a stand-in replaces this Entity, so the API need not be asked for it.
82
+ */
83
+ HasEntity(entityId: string): boolean;
84
+ /**
85
+ * Whether a stand-in or a patch changes this Entity.
86
+ */
87
+ HasBlob(entityId: string): boolean;
88
+ /**
89
+ * Returns an Entity with its simulated patches laid over it. The input is never changed.
90
+ */
91
+ Overlay(entity: Entity.IEntity): Entity.IEntity;
92
+ /**
93
+ * The Entity as simulated: its stand-in if there is one, otherwise what was read with patches laid over it.
94
+ * @param entityId the Entity.
95
+ * @param read what the API gave for it, if it was asked.
96
+ */
97
+ Resolve(entityId: string, read?: Entity.IEntity): Entity.IEntity | null;
98
+ /**
99
+ * Every Entity with a simulated stand-in or patch.
100
+ */
101
+ GetEntityIds(): string[];
102
+ /**
103
+ * Every Entity with simulated history.
104
+ */
105
+ GetRecordEntityIds(): string[];
106
+ /**
107
+ * An Entity's simulated history for a historic key, oldest first, every set's record at an instant merged.
108
+ */
109
+ GetRecords(entityId: string, attrKey?: string): EntityHistoricData.IData[];
110
+ /**
111
+ * Each value an Entity's simulated history names, with the instant from which it is the simulation's.
112
+ */
113
+ private ownedFrom;
114
+ /**
115
+ * An Entity as it stands at an instant, with each value its simulated records have named by then laid over it.
116
+ * @param entity the Entity as read for that instant, from the API or a simulated stand-in.
117
+ * @param timeMs the instant in milliseconds.
118
+ * @param attrKey the historic attribute key being followed, or null for any.
119
+ */
120
+ ApplyAt(entity: Entity.IEntity, timeMs: number, attrKey?: string): Entity.IEntity;
121
+ /**
122
+ * API records with the simulated ones joined in, for the named Entities or every simulated one.
123
+ */
124
+ MergeRecords(recordsByIds: IDictionary<EntityHistoricData.IData[]>, attrKey?: string, entityIds?: string[]): IDictionary<EntityHistoricData.IData[]>;
125
+ }
126
+ }
@@ -0,0 +1,30 @@
1
+ import * as Cesium from "cesium";
2
+ /**
3
+ * The line drawn through where a moving thing has been, from its history, as a whole path or a fading trail.
4
+ */
5
+ export declare namespace HistoricTrail {
6
+ interface IParams {
7
+ viewer: Cesium.Viewer;
8
+ color: Cesium.Color;
9
+ width: number;
10
+ clampToGround: boolean;
11
+ getSeries: () => Cesium.Cartesian3[];
12
+ trailSeconds?: number;
13
+ positionAt?: (timeMs: number) => Cesium.Cartesian3 | null;
14
+ }
15
+ /**
16
+ * The trail length a menu item asks for in its historicTrackSeconds, or null for the whole path.
17
+ */
18
+ function GetTrailSeconds(item: object | null | undefined): number | null;
19
+ class Trail {
20
+ private viewer;
21
+ private entities;
22
+ private memoTime;
23
+ private memo;
24
+ constructor(params: IParams);
25
+ private add;
26
+ private sample;
27
+ private slice;
28
+ Dispose(): void;
29
+ }
30
+ }
@@ -1,6 +1,7 @@
1
1
  import * as Cesium from "cesium";
2
2
  import { Bounds, BruceApi, Entity, EntityHistoricData, IDictionary } from "bruce-models";
3
3
  import { CesiumViewMonitor } from "../../../viewer/cesium-view-monitor";
4
+ import { EntitySimulation } from "./entity-simulation";
4
5
  /**
5
6
  * How often a historic refresh is worth running, and which Entities it should ask about first.
6
7
  */
@@ -177,6 +178,8 @@ export declare class HistoricGatherer {
177
178
  onRecords?: (recordsByIds: IDictionary<EntityHistoricData.IData[]>) => void;
178
179
  paddingMs?: number;
179
180
  liveTailMs?: number;
181
+ simulation?: EntitySimulation.Store;
182
+ simulatedOnly?: boolean;
180
183
  });
181
184
  get Records(): IDictionary<EntityHistoricData.IData[]>;
182
185
  Clear(): void;
@@ -193,6 +196,7 @@ export declare class HistoricGatherer {
193
196
  fetched: boolean;
194
197
  recordsByIds: IDictionary<EntityHistoricData.IData[]>;
195
198
  }>;
199
+ private withSimulated;
196
200
  private holdTo;
197
201
  private request;
198
202
  }
@@ -3,6 +3,7 @@ import * as Cesium from "cesium";
3
3
  import { VisualsRegister } from "../../visuals-register";
4
4
  import { RenderManager } from "../render-manager";
5
5
  import { CesiumViewMonitor } from "../../../viewer/cesium-view-monitor";
6
+ import { EntitySimulation } from "../common/entity-simulation";
6
7
  export declare namespace DataLabRenderManager {
7
8
  class Manager implements RenderManager.IManager, RenderManager.IHandoffCapableManager, RenderManager.IHandoffReceiver {
8
9
  private viewer;
@@ -31,6 +32,7 @@ export declare namespace DataLabRenderManager {
31
32
  apiGetter: BruceApi.IGetter;
32
33
  monitor: CesiumViewMonitor.Monitor;
33
34
  visualsRegister: VisualsRegister.Register;
35
+ simulation?: EntitySimulation.Store;
34
36
  });
35
37
  Init(params?: {
36
38
  item?: MenuItem.Item.IDataLab;
@@ -4,6 +4,7 @@ import { CesiumViewMonitor } from "../../../viewer/cesium-view-monitor";
4
4
  import { VisualsRegister } from "../../visuals-register";
5
5
  import { RenderManager } from "../render-manager";
6
6
  import { SharedHistoricGetters } from "../common/shared-getters-historic";
7
+ import { EntitySimulation } from "../common/entity-simulation";
7
8
  /**
8
9
  * Render manager for rendering an array of entity ids.
9
10
  * This will render them in batches to avoid overloading the viewer.
@@ -40,6 +41,7 @@ export declare namespace EntitiesIdsRenderManager {
40
41
  monitor: CesiumViewMonitor.Monitor;
41
42
  item: MenuItem.Item.IEntityIds;
42
43
  sharedHistoric?: SharedHistoricGetters.Cache;
44
+ simulation?: EntitySimulation.Store;
43
45
  });
44
46
  Init(params?: {
45
47
  item?: MenuItem.Item.IEntityIds;
@@ -3,6 +3,7 @@ import * as Cesium from "cesium";
3
3
  import { CesiumViewMonitor } from "../../../viewer/cesium-view-monitor";
4
4
  import { VisualsRegister } from "../../visuals-register";
5
5
  import { RenderManager } from "../render-manager";
6
+ import { EntitySimulation } from "../common/entity-simulation";
6
7
  /**
7
8
  * Render manager for a group of pre-loaded entities.
8
9
  * The entities may or may not have records.
@@ -30,6 +31,7 @@ export declare namespace EntitiesLoadedRenderManager {
30
31
  apiGetter: BruceApi.IGetter;
31
32
  monitor: CesiumViewMonitor.Monitor;
32
33
  item: MenuItem.Item.IEntitiesLoaded;
34
+ simulation?: EntitySimulation.Store;
33
35
  });
34
36
  /**
35
37
  * Adds entities to menu item and queues the render for them.
@@ -3,6 +3,7 @@ import * as Cesium from "cesium";
3
3
  import { ISeriesSegment } from "../../../internal/series-segment";
4
4
  import { CesiumViewMonitor } from "../../../viewer/cesium-view-monitor";
5
5
  import { VisualsRegister } from "../../visuals-register";
6
+ import { EntitySimulation } from "../common/entity-simulation";
6
7
  import { SharedGetters } from "../common/shared-getters";
7
8
  import { RenderManager } from "../render-manager";
8
9
  /**
@@ -52,6 +53,7 @@ export declare namespace EntitiesRenderManager {
52
53
  item: MenuItem.Item.IEntities;
53
54
  sharedGetters: SharedGetters.Cache;
54
55
  onSeriesDiscovered?: (segment: ISeriesSegment) => void;
56
+ simulation?: EntitySimulation.Store;
55
57
  });
56
58
  Init(params?: {
57
59
  item: MenuItem.Item.IEntities;
@@ -3,6 +3,7 @@ import * as Cesium from "cesium";
3
3
  import { CesiumViewMonitor } from "../../../viewer/cesium-view-monitor";
4
4
  import { VisualsRegister } from "../../visuals-register";
5
5
  import { RenderManager } from "../render-manager";
6
+ import { EntitySimulation } from "../common/entity-simulation";
6
7
  /**
7
8
  * Manager for rendering a single Bruce entity.
8
9
  */
@@ -25,6 +26,7 @@ export declare namespace EntityRenderManager {
25
26
  apiGetter: BruceApi.IGetter;
26
27
  monitor: CesiumViewMonitor.Monitor;
27
28
  item: MenuItem.Item.IEntity;
29
+ simulation?: EntitySimulation.Store;
28
30
  });
29
31
  Init(): void;
30
32
  Dispose(): void;
@@ -2,6 +2,7 @@ import { ApiGetters, BruceEvent, Entity, MenuItem } from "bruce-models";
2
2
  import { RenderManager } from "../render-manager";
3
3
  import { VisualsRegister } from "../../visuals-register";
4
4
  import * as Cesium from "cesium";
5
+ import { EntitySimulation } from "../common/entity-simulation";
5
6
  interface IHierarchyNode {
6
7
  entityId: string;
7
8
  name: string;
@@ -30,11 +31,52 @@ export declare namespace AssemblyRenderManager {
30
31
  private hierarchyNodeByEntityId;
31
32
  private modelSpace;
32
33
  get ModelSpace(): boolean;
34
+ /**
35
+ * Every node of the Assembly read so far, so a caller can work out motion in the Assembly's own terms.
36
+ * @param timeMs the scene time for each node's current pose. Default: the clock's.
37
+ * @returns per node its pose within its parent from the API (local) and as drawn at the time (current).
38
+ */
39
+ GetNodes(timeMs?: number): {
40
+ entityId: string;
41
+ name: string;
42
+ parentId: string | null;
43
+ local: number[][] | null;
44
+ current: number[][] | null;
45
+ entity: Entity.IEntity | null;
46
+ }[];
47
+ /**
48
+ * The root's world frame at a time, history and simulation included, eg. to follow or frame the Assembly.
49
+ * @param timeMs the scene time. Default: the clock's.
50
+ * @returns null until the root has been read.
51
+ */
52
+ GetRootFrame(timeMs?: number): Cesium.Matrix4 | null;
53
+ /**
54
+ * A part's world frame at a time as its records and its parents place it, size included.
55
+ * @param entityId the part.
56
+ * @param timeMs the scene time. Default: the clock's.
57
+ * @returns null until the root and the part have been read.
58
+ */
59
+ GetPartFrame(entityId: string, timeMs?: number): Cesium.Matrix4 | null;
33
60
  private rootId;
34
61
  private rootPos3d;
35
62
  private rootHeading;
63
+ private rootPitch;
64
+ private rootRoll;
65
+ private rootSeries;
66
+ private rootAttitude;
67
+ private pose;
36
68
  private children;
37
- private trackEntity;
69
+ private localPositions;
70
+ private groundOffsets;
71
+ private jointSeries;
72
+ private animatedIds;
73
+ private trail;
74
+ private simulation;
75
+ private simulationRemoval;
76
+ readonly FollowsSimulation = true;
77
+ private apiEntities;
78
+ private regather;
79
+ private followingClock;
38
80
  private viewerDateTimeChangeRemoval;
39
81
  private historicGatherer;
40
82
  private historicAnimation;
@@ -44,6 +86,7 @@ export declare namespace AssemblyRenderManager {
44
86
  getters: ApiGetters;
45
87
  item: MenuItem.Item.IAssembly;
46
88
  modelSpace?: boolean;
89
+ simulation?: EntitySimulation.Store;
47
90
  });
48
91
  /**
49
92
  * Returns whether this Assembly's root moves over time.
@@ -71,13 +114,47 @@ export declare namespace AssemblyRenderManager {
71
114
  */
72
115
  static ChildPositionFrom(rootPos3d: Cesium.Cartesian3, headingDegrees: number, offset: Cesium.Cartesian3): Cesium.Cartesian3;
73
116
  /**
74
- * Moves the whole Assembly to a new root position, without refetching any of its children.
117
+ * Moves where the root sits outside its history, without refetching children; recorded poses still win.
75
118
  * @param params
76
119
  */
77
120
  ApplyRootPosition(params: {
78
121
  pos3d: Cesium.Cartesian3;
79
122
  heading?: number;
123
+ pitch?: number;
124
+ roll?: number;
80
125
  }): void;
126
+ private repose;
127
+ private absorbNode;
128
+ private withSimulation;
129
+ private onSimulationChanged;
130
+ private simulatedNodeIds;
131
+ private canMove;
132
+ private bindPlacement;
133
+ private static uniformScale;
134
+ private static cloneOrUndefined;
135
+ private placementAt;
136
+ private rootAt;
137
+ private rootPositionAt;
138
+ private absorbRootRecords;
139
+ private absorbRootAttitude;
140
+ private composeWorld;
141
+ private measureGroundOffset;
142
+ private motionAt;
143
+ private localAt;
144
+ private absorbJointRecords;
145
+ private refreshAnimated;
146
+ private hasAnimatedAncestry;
147
+ private historicEntityIds;
148
+ /**
149
+ * Builds a matrix from the row-major rows that Bruce/AssemblyPosition and AssemblyWorldPosition use.
150
+ * @param rows
151
+ */
152
+ static MatrixFromRows(rows: number[][] | any): Cesium.Matrix4;
153
+ /**
154
+ * The inverse of MatrixFromRows.
155
+ * @param matrix
156
+ */
157
+ static RowsFromMatrix(matrix: Cesium.Matrix4): number[][];
81
158
  Init(): void;
82
159
  /**
83
160
  * Processes given entity IDs and renders them in the viewer.
@@ -2,6 +2,7 @@ import { BruceApi, MenuItem } from "bruce-models";
2
2
  import { RenderManager } from "../render-manager";
3
3
  import { VisualsRegister } from "../../visuals-register";
4
4
  import * as Cesium from "cesium";
5
+ import { EntitySimulation } from "../common/entity-simulation";
5
6
  /**
6
7
  * Deprecated relations render manager.
7
8
  * This follows original navigator logic that renders both up/downstream relationships and ALL relationship types.
@@ -14,12 +15,16 @@ export declare namespace LegacyRelationsRenderManager {
14
15
  private item;
15
16
  private register;
16
17
  private viewer;
18
+ private simulation;
19
+ private simulationRemoval;
20
+ readonly FollowsSimulation = true;
17
21
  private drawnIds;
18
22
  constructor(params: {
19
23
  apiGetter: BruceApi.IGetter;
20
24
  item: MenuItem.Item.ILegacyRelationships;
21
25
  register: VisualsRegister.Register;
22
26
  viewer: Cesium.Viewer;
27
+ simulation?: EntitySimulation.Store;
23
28
  });
24
29
  /**
25
30
  * Starts rendering the menu item.
@@ -2,6 +2,7 @@ import { BruceApi, MenuItem } from "bruce-models";
2
2
  import { RenderManager } from "../render-manager";
3
3
  import { VisualsRegister } from "../../visuals-register";
4
4
  import * as Cesium from "cesium";
5
+ import { EntitySimulation } from "../common/entity-simulation";
5
6
  export declare namespace RelationsRenderManager {
6
7
  class Manager implements RenderManager.IManager {
7
8
  private disposed;
@@ -10,11 +11,15 @@ export declare namespace RelationsRenderManager {
10
11
  private item;
11
12
  private register;
12
13
  private viewer;
14
+ private simulation;
15
+ private simulationRemoval;
16
+ readonly FollowsSimulation = true;
13
17
  constructor(params: {
14
18
  apiGetter: BruceApi.IGetter;
15
19
  item: MenuItem.Item.IRelationships;
16
20
  register: VisualsRegister.Register;
17
21
  viewer: Cesium.Viewer;
22
+ simulation?: EntitySimulation.Store;
18
23
  });
19
24
  /**
20
25
  * Starts rendering the menu item.
@@ -15,6 +15,10 @@ export declare namespace RenderManager {
15
15
  force?: boolean;
16
16
  maintain?: true;
17
17
  }): Promise<void>;
18
+ /**
19
+ * Set when the manager follows the shared simulation store itself, so the menu item manager need not.
20
+ */
21
+ FollowsSimulation?: boolean;
18
22
  }
19
23
  /**
20
24
  * Free-form bag of already-loaded resources a manager hands off to its replacement.
@@ -4,6 +4,7 @@ import { XGridsRenderEngine } from "../../xgrids-render-engine";
4
4
  import { TilesetRenderEngine } from "../../tileset-render-engine";
5
5
  import { VisualsRegister } from "../../visuals-register";
6
6
  import { RenderManager } from "../render-manager";
7
+ import { EntitySimulation } from "../common/entity-simulation";
7
8
  export declare namespace TilesetArbRenderManager {
8
9
  interface IInitQueueParams {
9
10
  owner: object;
@@ -28,6 +29,7 @@ export declare namespace TilesetArbRenderManager {
28
29
  }
29
30
  class Manager implements RenderManager.IManager {
30
31
  private viewer;
32
+ private simulation;
31
33
  private getters;
32
34
  private item;
33
35
  private disposed;
@@ -58,6 +60,7 @@ export declare namespace TilesetArbRenderManager {
58
60
  item: MenuItem.Item.IArbTileset;
59
61
  getters: ApiGetters;
60
62
  register: VisualsRegister.Register;
63
+ simulation?: EntitySimulation.Store;
61
64
  });
62
65
  Init(): void;
63
66
  /**
@@ -5,6 +5,7 @@ import { TilesetRenderEngine } from "../../tileset-render-engine";
5
5
  import { VisualsRegister } from '../../visuals-register';
6
6
  import { RenderManager } from "../render-manager";
7
7
  import { TilesetArbRenderManager } from "./tileset-arb-render-manager";
8
+ import { EntitySimulation } from "../common/entity-simulation";
8
9
  interface IModelTreeNode {
9
10
  entityId: string;
10
11
  typeId: string;
@@ -19,6 +20,9 @@ interface IModelTreeNode {
19
20
  export declare namespace TilesetCadRenderManager {
20
21
  class Manager implements RenderManager.IManager, RenderManager.IHandoffCapableManager, RenderManager.IHandoffReceiver {
21
22
  private viewer;
23
+ private simulation;
24
+ private simulationRemoval;
25
+ private restCoords;
22
26
  private getters;
23
27
  private item;
24
28
  private disposed;
@@ -51,7 +55,7 @@ export declare namespace TilesetCadRenderManager {
51
55
  private viewerDateTimeChangeRemoval;
52
56
  private historicAnimation;
53
57
  private historicGatherer;
54
- private trackEntity;
58
+ private trail;
55
59
  private historicPossesLoadingProm;
56
60
  private featureQueue;
57
61
  private featureQueueStates;
@@ -66,6 +70,7 @@ export declare namespace TilesetCadRenderManager {
66
70
  item: MenuItem.Item.ICadTileset;
67
71
  modelSpace?: boolean;
68
72
  initQueue?: TilesetArbRenderManager.IInitQueue;
73
+ simulation?: EntitySimulation.Store;
69
74
  });
70
75
  Init(): void;
71
76
  private onCTilesetLoad;
@@ -204,6 +209,11 @@ export declare namespace TilesetCadRenderManager {
204
209
  * @param tileset
205
210
  */
206
211
  private viewerDateTimeSub;
212
+ private followSimulation;
213
+ private regatherRoot;
214
+ private atClock;
215
+ private applyRootRest;
216
+ private simulatedRootCoords;
207
217
  private viewerDateTimeDispose;
208
218
  /**
209
219
  * Updates the Tileset with latest coordinates.
@@ -5,10 +5,12 @@ import { VisualsRegister } from "../../visuals-register";
5
5
  import { RenderManager } from "../render-manager";
6
6
  import { TilesetArbRenderManager } from "./tileset-arb-render-manager";
7
7
  import { CesiumViewMonitor } from "../../../viewer/cesium-view-monitor";
8
+ import { EntitySimulation } from "../common/entity-simulation";
8
9
  export declare namespace TilesetEntitiesRenderManager {
9
10
  class Manager implements RenderManager.IManager, RenderManager.IHandoffCapableManager, RenderManager.IHandoffReceiver {
10
11
  private initCounter;
11
12
  private viewer;
13
+ private simulation;
12
14
  private getters;
13
15
  private item;
14
16
  private disposed;
@@ -42,6 +44,7 @@ export declare namespace TilesetEntitiesRenderManager {
42
44
  item: MenuItem.Item.IEntitiesTileset;
43
45
  initQueue?: TilesetArbRenderManager.IInitQueue;
44
46
  monitor?: CesiumViewMonitor.Monitor;
47
+ simulation?: EntitySimulation.Store;
45
48
  });
46
49
  Init(params?: {
47
50
  item: MenuItem.Item.IEntitiesTileset;
@@ -1,5 +1,6 @@
1
1
  import { BruceApi, BruceEvent, Entity, Style } from "bruce-models";
2
2
  import * as Cesium from "cesium";
3
+ import { EntitySimulation } from "./render-managers/common/entity-simulation";
3
4
  import { VisualsRegister } from "./visuals-register";
4
5
  import { CesiumViewMonitor } from "../viewer/cesium-view-monitor";
5
6
  /**
@@ -80,6 +81,7 @@ export declare class TilesetStyler {
80
81
  historic?: boolean;
81
82
  applyStyles?: boolean;
82
83
  monitor?: CesiumViewMonitor.Monitor;
84
+ simulation?: EntitySimulation.Store;
83
85
  }): void;
84
86
  /**
85
87
  * Updates style mapping and fallback style.