Skip to content

Commit 2f53b52

Browse files
authored
Transform resolution is no longer a store subscriber (#11427)
1 parent f4f787f commit 2f53b52

24 files changed

+885
-737
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9903,6 +9903,7 @@ dependencies = [
99039903
"ndarray",
99049904
"nohash-hasher",
99059905
"ordered-float 4.6.0",
9906+
"parking_lot",
99069907
"re_byte_size",
99079908
"re_chunk_store",
99089909
"re_component_ui",
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
use std::sync::OnceLock;
2+
3+
use nohash_hasher::IntSet;
4+
use re_types::{Archetype as _, Component as _, ComponentType, archetypes, components};
5+
6+
/// Lists all Rerun components types that are relevant for the transform cache.
7+
pub struct TransformComponentTypeInfo {
8+
/// All components of [`archetypes::Transform3D`]
9+
pub transform: IntSet<ComponentType>,
10+
11+
/// All components of [`archetypes::InstancePoses3D`]
12+
pub pose: IntSet<ComponentType>,
13+
14+
/// All components related to pinholes (i.e. [`components::PinholeProjection`] and [`components::ViewCoordinates`]).
15+
pub pinhole: IntSet<ComponentType>,
16+
}
17+
18+
impl Default for TransformComponentTypeInfo {
19+
fn default() -> Self {
20+
Self {
21+
transform: archetypes::Transform3D::all_components()
22+
.iter()
23+
.filter_map(|descr| descr.component_type)
24+
.collect(),
25+
pose: archetypes::InstancePoses3D::all_components()
26+
.iter()
27+
.filter_map(|descr| descr.component_type)
28+
.collect(),
29+
pinhole: [
30+
components::PinholeProjection::name(),
31+
components::ViewCoordinates::name(),
32+
]
33+
.into_iter()
34+
.collect(),
35+
}
36+
}
37+
}
38+
39+
impl TransformComponentTypeInfo {
40+
/// Retrieves global cached instance.
41+
pub fn get() -> &'static Self {
42+
static ONCE: OnceLock<TransformComponentTypeInfo> = OnceLock::new();
43+
ONCE.get_or_init(Default::default)
44+
}
45+
}

crates/store/re_tf/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
//! Rerun spatial transform processing
22
3-
mod transform_cache;
3+
mod component_type_info;
4+
mod transform_resolution_cache;
45
mod transform_tree;
56

6-
pub use transform_cache::{
7+
pub use transform_resolution_cache::{
78
CachedTransformsForTimeline, PoseTransformArchetypeMap, ResolvedPinholeProjection,
8-
TransformCacheStoreSubscriber, query_view_coordinates,
9-
query_view_coordinates_at_closest_ancestor,
9+
TransformResolutionCache, query_view_coordinates, query_view_coordinates_at_closest_ancestor,
1010
};
1111
pub use transform_tree::{TransformInfo, TransformTree, TwoDInThreeDTransformInfo};
1212

0 commit comments

Comments
 (0)