1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use re_viewer_context::{
    ComponentFallbackProvider, IdentifiedViewSystem, SpaceViewSystemExecutionError, ViewContext,
    ViewContextCollection, ViewQuery, VisualizerQueryInfo, VisualizerSystem,
};

/// An empty system to accept all entities in the space view
#[derive(Default)]
pub struct EmptySystem {}

impl IdentifiedViewSystem for EmptySystem {
    fn identifier() -> re_viewer_context::ViewSystemIdentifier {
        "Empty".into()
    }
}

impl VisualizerSystem for EmptySystem {
    fn visualizer_query_info(&self) -> VisualizerQueryInfo {
        VisualizerQueryInfo::empty()
    }

    fn execute(
        &mut self,
        _ctx: &ViewContext<'_>,
        _query: &ViewQuery<'_>,
        _context_systems: &ViewContextCollection,
    ) -> Result<Vec<re_renderer::QueueableDrawData>, SpaceViewSystemExecutionError> {
        Ok(vec![])
    }

    fn as_any(&self) -> &dyn std::any::Any {
        self
    }

    fn fallback_provider(&self) -> &dyn re_viewer_context::ComponentFallbackProvider {
        self
    }
}

impl ComponentFallbackProvider for EmptySystem {
    fn try_provide_fallback(
        &self,
        _ctx: &re_viewer_context::QueryContext<'_>,
        _component: re_types_core::ComponentName,
    ) -> re_viewer_context::ComponentFallbackProviderResult {
        re_viewer_context::ComponentFallbackProviderResult::ComponentNotHandled
    }
}