Skip to content

Commit 416ea6a

Browse files
committed
Clean up TODOs to reference #4377
1 parent a5db40b commit 416ea6a

8 files changed

+23
-18
lines changed

crates/re_viewer/src/ui/selection_history_ui.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,7 @@ fn item_to_string(blueprint: &ViewportBlueprint<'_>, item: &Item) -> String {
177177
}
178178
}
179179
Item::InstancePath(_, entity_path) => entity_path.to_string(),
180-
Item::DataBlueprintGroup(_sid, _qid, entity_path) => {
181-
// TODO(jleibs): How do we access the query in this context?
182-
entity_path.to_string()
183-
}
180+
Item::DataBlueprintGroup(_sid, _qid, entity_path) => entity_path.to_string(),
184181
Item::ComponentPath(path) => {
185182
format!("{} {}", path.entity_path, path.component_name.short_name(),)
186183
}

crates/re_viewer/src/ui/selection_panel.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ fn list_existing_data_blueprints(
308308
entity_path: &EntityPath,
309309
blueprint: &ViewportBlueprint<'_>,
310310
) {
311-
let space_views_with_path = blueprint.space_views_containing_entity_path(entity_path);
311+
let space_views_with_path = blueprint.space_views_containing_entity_path(ctx, entity_path);
312312

313313
if space_views_with_path.is_empty() {
314314
ui.weak("(Not shown in any Space View)");

crates/re_viewport/src/space_view.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl SpaceViewBlueprint {
161161

162162
let query_result = ctx.lookup_query_result(self.query_id()).clone();
163163

164-
// TODO(jleibs): Use PerSystemDataResults?
164+
// TODO(#4377): Use PerSystemDataResults
165165
let mut per_system_entities = PerSystemEntities::default();
166166
{
167167
re_tracing::profile_scope!("per_system_data_results");

crates/re_viewport/src/space_view_entity_picker.rs

+2
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ fn add_entities_line_ui(
177177
_space_view: &mut SpaceViewBlueprint,
178178
_entities_add_info: &IntMap<EntityPath, EntityAddInfo>,
179179
) {
180+
// TODO(#4377): Reformulate this in terms of modifying query expressions
180181
ui.label("Not implemented");
181182
/*
182183
ui.horizontal(|ui| {
@@ -322,6 +323,7 @@ fn create_entity_add_info(
322323
let heuristic_context_per_entity = heuristic_context_per_entity.get(entity_path).copied().unwrap_or_default();
323324
let can_add: CanAddToSpaceView =
324325
if is_entity_processed_by_class(ctx, space_view.class_name(), entity_path, heuristic_context_per_entity, &ctx.current_query()) {
326+
// TODO(#4377): Reformulate this in terms of modifying query expressions
325327
CanAddToSpaceView::No {
326328
reason: "Not implemented".to_owned(),
327329
}

crates/re_viewport/src/space_view_heuristics.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ pub fn all_possible_space_views(
104104
entities_used_by_any_part_system_of_class
105105
.iter()
106106
.filter_map(|(class_name, _entities_used_by_any_part_system)| {
107+
// TODO(#4377): The need to run a query-per-candidate for all possible candidates
108+
// is way too expensive. This needs to be optimized significantly.
107109
let candidate_query = DataQueryBlueprint::new(
108110
*class_name,
109111
std::iter::once(&EntityPathExpr::Recursive(candidate_space_path.clone())),
@@ -238,7 +240,7 @@ pub fn default_created_space_views(
238240
continue;
239241
};
240242

241-
// TODO(jleibs): Can spawn heuristics consume the query_result directly?
243+
// TODO(#4377): Can spawn heuristics consume the query_result directly?
242244
let mut per_system_entities = PerSystemEntities::default();
243245
{
244246
re_tracing::profile_scope!("per_system_data_results");

crates/re_viewport/src/space_view_highlights.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub fn highlights_for_space_view(
4141
Item::ComponentPath(_) | Item::SpaceView(_) => {}
4242

4343
Item::DataBlueprintGroup(_space_view_id, _query_id, _entity_path) => {
44-
// TODO(jleibs): Fix DataBlueprintGroup
44+
// TODO(#4377): Fix DataBlueprintGroup
4545
/*
4646
if *group_space_view_id == space_view_id {
4747
if let Some(space_view) = space_views.get(group_space_view_id) {
@@ -118,7 +118,7 @@ pub fn highlights_for_space_view(
118118
Item::ComponentPath(_) | Item::SpaceView(_) => {}
119119

120120
Item::DataBlueprintGroup(_space_view_id, _query_id, _entity_path) => {
121-
// TODO(jleibs): Fix DataBlueprintGroup
121+
// TODO(#4377): Fix DataBlueprintGroup
122122
/*
123123
// Unlike for selected objects/data we are more picky for data blueprints with our hover highlights
124124
// since they are truly local to a space view.

crates/re_viewport/src/viewport_blueprint.rs

+11-7
Original file line numberDiff line numberDiff line change
@@ -227,21 +227,26 @@ impl<'a> ViewportBlueprint<'a> {
227227
}
228228

229229
#[allow(clippy::unused_self)]
230-
pub fn space_views_containing_entity_path(&self, _path: &EntityPath) -> Vec<SpaceViewId> {
231-
// TODO(jleibs): Need to search for entity path in query-results
232-
/*
230+
pub fn space_views_containing_entity_path(
231+
&self,
232+
ctx: &ViewerContext<'_>,
233+
path: &EntityPath,
234+
) -> Vec<SpaceViewId> {
233235
self.space_views
234236
.iter()
235237
.filter_map(|(space_view_id, space_view)| {
236-
if space_view.contents.contains_entity(path) {
238+
let query_result = ctx.lookup_query_result(space_view.query_id());
239+
if query_result
240+
.tree
241+
.lookup_result_by_path_and_group(path, false)
242+
.is_some()
243+
{
237244
Some(*space_view_id)
238245
} else {
239246
None
240247
}
241248
})
242249
.collect()
243-
*/
244-
vec![]
245250
}
246251

247252
/// Compares the before and after snapshots and sends any necessary deltas to the store.
@@ -424,7 +429,6 @@ pub fn sync_space_view(
424429

425430
add_delta_from_single_component(deltas, &space_view.entity_path(), &timepoint, component);
426431

427-
// TODO(jleibs): Query-removal logic
428432
for query in &space_view.queries {
429433
add_delta_from_single_component(
430434
deltas,

crates/re_viewport/src/viewport_blueprint_ui.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ impl ViewportBlueprint<'_> {
311311
let response =
312312
remove_button_ui(re_ui, ui, "Remove Entity from the Space View");
313313
if response.clicked() {
314-
// TODO(jleibs): Fix removal
314+
// TODO(#4377): Fix entity removal
315315
//space_view.contents.remove_entity(entity_path);
316316
space_view.entities_determined_by_user = true;
317317
}
@@ -374,7 +374,7 @@ impl ViewportBlueprint<'_> {
374374
});
375375

376376
if remove_group {
377-
// TODO(jleibs): Fix removal
377+
// TODO(#4377): Fix group removal
378378
/*
379379
if let Some(group_handle) = space_view
380380
.contents

0 commit comments

Comments
 (0)