Keep the satellites layer's Cesium objects in its rendering part

The point collection and its dots, the baked orbit rings, the tracked
entity, the frame number, the focus publish and the pick decoding now
live in rendering.js, behind small helpers that take ECEF positions and
render-contract colours. The catalog, controls, ingestion, lifecycle,
orbits, policy, records, state, testing and tracking parts no longer
import Cesium or touch the viewer, scene or primitives, and leave the
allow-list. Point styles are [r, g, b, a] colours, converted once per
style; geodetic conversions use the geo helpers; the per-frame tick runs
through the frame port. What the layer draws and how it follows is
unchanged.
This commit is contained in:
Sameh Khamis committed 2026-11-07 03:53:05 -08:00
1 parent d928c30337
commit 4fd1a850f1
19 files changed
+646 -281

No files matched your search

+19 -14
View File
@@ -1,5 +1,5 @@
import * as Cesium from 'cesium';
import { satelliteClassColor } from '../../data/satelliteClass.js';
import { hexColor } from '../../render/color.js';
/**
* Satellite Orbits — Real-time positions via CelesTrak TLE + SGP4 propagation.
@@ -7,7 +7,7 @@ import { satelliteClassColor } from '../../data/satelliteClass.js';
* Loads six CelesTrak groups (~840 sats): stations, visual, GPS, GLONASS,
* Galileo, and the geosynchronous belt. Optional dense mode (setParams
* catalog:'dense') adds the Starlink shell as points-only extras.
* Renders positions via PointPrimitiveCollection, orbital paths as polylines.
* Renders positions as points, orbital paths as polylines.
* Click any satellite to track it with camera follow + orbital path.
*
* ISS gets special treatment: larger point, persistent host label, path shown by default.
@@ -71,11 +71,14 @@ export const DENSE_CREATE_CHUNK = 1500;
* High orbits (MEO nav / GEO belt) scale this up so the ring stays in frame.
*/
export const TRACK_VIEW_FROM_LEO = new Cesium.Cartesian3(
-450000,
-450000,
350000,
);
export const TRACK_VIEW_FROM_LEO = Object.freeze({
x: -450000,
y: -450000,
z: 350000,
});
/** The tracked satellite's orbit ring. */
export const TRACKED_ORBIT_COLOR = Object.freeze([1, 1, 0, 1]);
export const HIGH_ORBIT_ALTITUDE_M = 2000000;
@@ -90,14 +93,16 @@ export const TRACK_VIEW_FROM_HIGH_SCALE = 4;
* Colors come from `satelliteClass.js` so the dot, the class label on the
* card, and the legend swatch on the layer row can never disagree. Only
* pixelSize/outline live here — those encode per-group prominence, not class.
* Converted once at module load; per-point color is a plain primitive
* attribute, so classification costs nothing per frame.
* Colours are the render contract's `[r, g, b, a]` (0..1); the rendering
* part turns each style into the renderer's own colours once.
*/
const POINT_OUTLINE = Cesium.Color.WHITE.withAlpha(0.3);
const POINT_OUTLINE = Object.freeze([1, 1, 1, 0.3]);
const _classColor = (group) =>
Cesium.Color.fromCssColorString(satelliteClassColor(group));
const rgba = (hex, alpha = 1) => Object.freeze(hexColor(hex, alpha));
const _classColor = (group, alpha = 1) =>
rgba(satelliteClassColor(group), alpha);
export const POINT_STYLES = {
// The ISS keeps its own long-standing red hero styling rather than the
@@ -106,7 +111,7 @@ export const POINT_STYLES = {
// Its card still reads "STATION · ISS", so the class stays legible.
iss: {
pixelSize: 12,
color: Cesium.Color.fromCssColorString('#ff4444'),
color: rgba('#ff4444'),
outlineColor: POINT_OUTLINE,
outlineWidth: 2,
},
@@ -151,7 +156,7 @@ export const POINT_STYLES = {
// Dense-mode extras (Starlink): dim, small, points-only.
dense: {
pixelSize: 3,
color: _classColor('dense').withAlpha(0.9),
color: _classColor('dense', 0.9),
outlineColor: POINT_OUTLINE,
outlineWidth: 0,
},