From 6291c69616ab0f326b34e1a1fe1074597e9d1d18 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Tue, 23 Apr 2024 13:06:09 +0200 Subject: [PATCH] self-review --- .../src/visualizer_system.rs | 10 +++------- .../src/line_visualizer_system.rs | 8 +++----- .../src/point_visualizer_system.rs | 18 ++++++++++-------- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/crates/re_space_view_text_log/src/visualizer_system.rs b/crates/re_space_view_text_log/src/visualizer_system.rs index 58c1ebcd39a6..c9cb50dffd7c 100644 --- a/crates/re_space_view_text_log/src/visualizer_system.rs +++ b/crates/re_space_view_text_log/src/visualizer_system.rs @@ -51,18 +51,14 @@ impl VisualizerSystem for TextLogSystem { view_query: &ViewQuery<'_>, _view_ctx: &ViewContextCollection, ) -> Result, SpaceViewSystemExecutionError> { - let store = ctx.recording_store(); - let query_caches2 = ctx.recording().query_caches2(); let resolver = ctx.recording().resolver(); - - // We want everything, for all times: let query = re_data_store::RangeQuery::new(view_query.timeline, TimeRange::EVERYTHING); for data_result in view_query.iter_visible_data_results(ctx, Self::identifier()) { re_tracing::profile_scope!("primary", &data_result.entity_path.to_string()); - let results = query_caches2.range( - store, + let results = ctx.recording().query_caches2().range( + ctx.recording_store(), &query, &data_result.entity_path, [Text::name(), TextLogLevel::name(), Color::name()], @@ -116,7 +112,7 @@ impl VisualizerSystem for TextLogSystem { } { - // Sort by currently selected tiemeline + // Sort by currently selected timeline re_tracing::profile_scope!("sort"); self.entries.sort_by_key(|e| e.time); } diff --git a/crates/re_space_view_time_series/src/line_visualizer_system.rs b/crates/re_space_view_time_series/src/line_visualizer_system.rs index b51a249ec290..83008a3f169e 100644 --- a/crates/re_space_view_time_series/src/line_visualizer_system.rs +++ b/crates/re_space_view_time_series/src/line_visualizer_system.rs @@ -155,8 +155,6 @@ fn load_series( ) -> Result<(), QueryError> { re_tracing::profile_function!(); - let store = ctx.recording_store(); - let query_caches2 = ctx.recording().query_caches2(); let resolver = ctx.recording().resolver(); let annotation_info = annotations @@ -197,8 +195,8 @@ fn load_series( let entity_path = &data_result.entity_path; let query = re_data_store::RangeQuery::new(query.timeline, time_range); - let results = query_caches2.range( - store, + let results = ctx.recording().query_caches2().range( + ctx.recording_store(), &query, entity_path, [Scalar::name(), Color::name(), StrokeWidth::name()], @@ -333,7 +331,7 @@ fn load_series( data_result, time_per_pixel, points, - store, + ctx.recording_store(), query, series_name, all_series, diff --git a/crates/re_space_view_time_series/src/point_visualizer_system.rs b/crates/re_space_view_time_series/src/point_visualizer_system.rs index a97df8c415bf..5aba1e13589c 100644 --- a/crates/re_space_view_time_series/src/point_visualizer_system.rs +++ b/crates/re_space_view_time_series/src/point_visualizer_system.rs @@ -3,7 +3,7 @@ use itertools::Itertools as _; use re_query_cache2::{PromiseResult, QueryError}; use re_types::{ archetypes::{self, SeriesPoint}, - components::{Color, MarkerShape, MarkerSize, Name, Scalar, StrokeWidth}, + components::{Color, MarkerShape, MarkerSize, Name, Scalar}, Archetype as _, ComponentNameSet, Loggable, }; use re_viewer_context::{ @@ -43,7 +43,6 @@ impl VisualizerSystem for SeriesPointSystem { .map(ToOwned::to_owned) .collect::(); query_info.queried.append(&mut series_point_queried); - query_info.queried.insert(StrokeWidth::name()); query_info.indicators = std::iter::once(SeriesPoint::indicator().name()).collect(); query_info } @@ -100,8 +99,6 @@ impl SeriesPointSystem { ) -> Result<(), QueryError> { re_tracing::profile_function!(); - let store = ctx.recording_store(); - let query_caches2 = ctx.recording().query_caches2(); let resolver = ctx.recording().resolver(); let (plot_bounds, time_per_pixel) = determine_plot_bounds_and_time_per_pixel(ctx, query); @@ -152,11 +149,16 @@ impl SeriesPointSystem { let entity_path = &data_result.entity_path; let query = re_data_store::RangeQuery::new(query.timeline, time_range); - let results = query_caches2.range( - store, + let results = ctx.recording().query_caches2().range( + ctx.recording_store(), &query, entity_path, - [Scalar::name(), Color::name(), StrokeWidth::name()], + [ + Scalar::name(), + Color::name(), + MarkerSize::name(), + MarkerShape::name(), + ], ); let all_scalars = results @@ -323,7 +325,7 @@ impl SeriesPointSystem { data_result, time_per_pixel, points, - store, + ctx.recording_store(), query, series_name, &mut self.all_series,