Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor naming of SpaceViewClass and changed TextSpaceView name to "Text Log" #4386

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions crates/re_space_view_bar_chart/src/space_view_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use re_log_types::EntityPath;
use re_space_view::controls;
use re_types::datatypes::TensorBuffer;
use re_viewer_context::{
auto_color, SpaceViewClass, SpaceViewClassName, SpaceViewClassRegistryError, SpaceViewId,
auto_color, SpaceViewClass, SpaceViewClassRegistryError, SpaceViewId,
SpaceViewSystemExecutionError, ViewContextCollection, ViewPartCollection, ViewQuery,
ViewerContext,
};
Expand All @@ -17,9 +17,7 @@ pub struct BarChartSpaceView;
impl SpaceViewClass for BarChartSpaceView {
type State = ();

fn name(&self) -> SpaceViewClassName {
"Bar Chart".into()
}
const NAME: &'static str = "Bar Chart";

fn icon(&self) -> &'static re_ui::Icon {
&re_ui::icons::SPACE_VIEW_HISTOGRAM
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_bar_chart/src/view_part_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ pub struct BarChartViewPartSystem {
}

impl NamedViewSystem for BarChartViewPartSystem {
fn name() -> re_viewer_context::ViewSystemName {
"BarChartView".into()
}
const NAME: &'static str = "BarChartView";
}

impl ViewPartSystem for BarChartViewPartSystem {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use re_types::{archetypes::AnnotationContext, Archetype, ComponentNameSet};
use re_viewer_context::{AnnotationMap, NamedViewSystem, ViewContextSystem, ViewSystemName};
use re_viewer_context::{AnnotationMap, NamedViewSystem, ViewContextSystem};

#[derive(Default)]
pub struct AnnotationSceneContext(pub AnnotationMap);

impl NamedViewSystem for AnnotationSceneContext {
fn name() -> ViewSystemName {
"AnnotationSceneContext".into()
}
const NAME: &'static str = "AnnotationSceneContext";
}

impl ViewContextSystem for AnnotationSceneContext {
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_spatial/src/contexts/depth_offsets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ pub struct EntityDepthOffsets {
}

impl NamedViewSystem for EntityDepthOffsets {
fn name() -> re_viewer_context::ViewSystemName {
"EntityDepthOffsets".into()
}
const NAME: &'static str = "EntityDepthOffsets";
}

impl ViewContextSystem for EntityDepthOffsets {
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_spatial/src/contexts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ pub struct PrimitiveCounter {
}

impl NamedViewSystem for PrimitiveCounter {
fn name() -> re_viewer_context::ViewSystemName {
"PrimitiveCounter".into()
}
const NAME: &'static str = "PrimitiveCounter";
}

impl ViewContextSystem for PrimitiveCounter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ use re_viewer_context::{NamedViewSystem, ViewContextSystem};
pub struct NonInteractiveEntities(pub IntSet<EntityPathHash>);

impl NamedViewSystem for NonInteractiveEntities {
fn name() -> re_viewer_context::ViewSystemName {
"NonInteractiveEntities".into()
}
const NAME: &'static str = "NonInteractiveEntities";
}

impl ViewContextSystem for NonInteractiveEntities {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ pub struct SharedRenderBuilders {
}

impl NamedViewSystem for SharedRenderBuilders {
fn name() -> re_viewer_context::ViewSystemName {
"SharedRenderBuilders".into()
}
const NAME: &'static str = "SharedRenderBuilders";
}

impl SharedRenderBuilders {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ pub struct TransformContext {
}

impl NamedViewSystem for TransformContext {
fn name() -> re_viewer_context::ViewSystemName {
"TransformContext".into()
}
const NAME: &'static str = "TransformContext";
}

impl Default for TransformContext {
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_spatial/src/parts/arrows3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ impl Arrows3DPart {
}

impl NamedViewSystem for Arrows3DPart {
fn name() -> re_viewer_context::ViewSystemName {
"Arrows3D".into()
}
const NAME: &'static str = "Arrows3D";
}

impl ViewPartSystem for Arrows3DPart {
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_spatial/src/parts/assets3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ impl Asset3DPart {
}

impl NamedViewSystem for Asset3DPart {
fn name() -> re_viewer_context::ViewSystemName {
"Asset3D".into()
}
const NAME: &'static str = "Asset3D";
}

impl ViewPartSystem for Asset3DPart {
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_spatial/src/parts/boxes2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ impl Boxes2DPart {
}

impl NamedViewSystem for Boxes2DPart {
fn name() -> re_viewer_context::ViewSystemName {
"Boxes2D".into()
}
const NAME: &'static str = "Boxes2D";
}

impl ViewPartSystem for Boxes2DPart {
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_spatial/src/parts/boxes3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ impl Boxes3DPart {
}

impl NamedViewSystem for Boxes3DPart {
fn name() -> re_viewer_context::ViewSystemName {
"Boxes3D".into()
}
const NAME: &'static str = "Boxes3D";
}

impl ViewPartSystem for Boxes3DPart {
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_spatial/src/parts/cameras.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ impl Default for CamerasPart {
}

impl NamedViewSystem for CamerasPart {
fn name() -> re_viewer_context::ViewSystemName {
"Cameras".into()
}
const NAME: &'static str = "Cameras";
}

impl CamerasPart {
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_spatial/src/parts/images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,9 +638,7 @@ impl ImagesPart {
}

impl NamedViewSystem for ImagesPart {
fn name() -> re_viewer_context::ViewSystemName {
"Images".into()
}
const NAME: &'static str = "Images";
}

impl ViewPartSystem for ImagesPart {
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_spatial/src/parts/lines2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,7 @@ impl Lines2DPart {
}

impl NamedViewSystem for Lines2DPart {
fn name() -> re_viewer_context::ViewSystemName {
"Lines2D".into()
}
const NAME: &'static str = "Lines2D";
}

impl ViewPartSystem for Lines2DPart {
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_spatial/src/parts/lines3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ impl Lines3DPart {
}

impl NamedViewSystem for Lines3DPart {
fn name() -> re_viewer_context::ViewSystemName {
"Lines3D".into()
}
const NAME: &'static str = "Lines3D";
}

impl ViewPartSystem for Lines3DPart {
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_spatial/src/parts/meshes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ impl Mesh3DPart {
}

impl NamedViewSystem for Mesh3DPart {
fn name() -> re_viewer_context::ViewSystemName {
"Mesh3D".into()
}
const NAME: &'static str = "Mesh3D";
}

impl ViewPartSystem for Mesh3DPart {
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_spatial/src/parts/points2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ impl Points2DPart {
}

impl NamedViewSystem for Points2DPart {
fn name() -> re_viewer_context::ViewSystemName {
"Points2D".into()
}
const NAME: &'static str = "Points2D";
}

impl ViewPartSystem for Points2DPart {
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_spatial/src/parts/points3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,7 @@ impl Points3DPart {
}

impl NamedViewSystem for Points3DPart {
fn name() -> re_viewer_context::ViewSystemName {
"Points3D".into()
}
const NAME: &'static str = "Points3D";
}

impl ViewPartSystem for Points3DPart {
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_spatial/src/parts/transform3d_arrows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ impl Default for Transform3DArrowsPart {
}

impl NamedViewSystem for Transform3DArrowsPart {
fn name() -> re_viewer_context::ViewSystemName {
"Transform3DArrows".into()
}
const NAME: &'static str = "Transform3DArrows";
}

impl ViewPartSystem for Transform3DArrowsPart {
Expand Down
8 changes: 1 addition & 7 deletions crates/re_space_view_spatial/src/space_view_2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,10 @@ use crate::{
#[derive(Default)]
pub struct SpatialSpaceView2D;

impl SpatialSpaceView2D {
pub const NAME: &'static str = "2D";
}

impl SpaceViewClass for SpatialSpaceView2D {
type State = SpatialSpaceViewState;

fn name(&self) -> re_viewer_context::SpaceViewClassName {
Self::NAME.into()
}
const NAME: &'static str = "2D";

fn icon(&self) -> &'static re_ui::Icon {
&re_ui::icons::SPACE_VIEW_2D
Expand Down
8 changes: 1 addition & 7 deletions crates/re_space_view_spatial/src/space_view_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,10 @@ use crate::{
#[derive(Default)]
pub struct SpatialSpaceView3D;

impl SpatialSpaceView3D {
pub const NAME: &'static str = "3D";
}

impl SpaceViewClass for SpatialSpaceView3D {
type State = SpatialSpaceViewState;

fn name(&self) -> re_viewer_context::SpaceViewClassName {
Self::NAME.into()
}
const NAME: &'static str = "3D";

fn icon(&self) -> &'static re_ui::Icon {
&re_ui::icons::SPACE_VIEW_3D
Expand Down
6 changes: 2 additions & 4 deletions crates/re_space_view_tensor/src/space_view_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use re_types::{
tensor_data::{DecodedTensor, TensorDataMeaning},
};
use re_viewer_context::{
gpu_bridge, gpu_bridge::colormap_dropdown_button_ui, SpaceViewClass, SpaceViewClassName,
gpu_bridge, gpu_bridge::colormap_dropdown_button_ui, SpaceViewClass,
SpaceViewClassRegistryError, SpaceViewId, SpaceViewState, SpaceViewSystemExecutionError,
TensorStatsCache, ViewContextCollection, ViewPartCollection, ViewQuery, ViewerContext,
};
Expand Down Expand Up @@ -136,9 +136,7 @@ impl PerTensorState {
impl SpaceViewClass for TensorSpaceView {
type State = ViewTensorState;

fn name(&self) -> SpaceViewClassName {
"Tensor".into()
}
const NAME: &'static str = "Tensor";

fn icon(&self) -> &'static re_ui::Icon {
&re_ui::icons::SPACE_VIEW_TENSOR
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_tensor/src/view_part_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ pub struct TensorSystem {
}

impl NamedViewSystem for TensorSystem {
fn name() -> re_viewer_context::ViewSystemName {
"Tensor".into()
}
const NAME: &'static str = "Tensor";
}

impl ViewPartSystem for TensorSystem {
Expand Down
10 changes: 4 additions & 6 deletions crates/re_space_view_text_document/src/space_view_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use egui::Label;

use re_viewer_context::external::re_data_store::EntityProperties;
use re_viewer_context::{
external::re_log_types::EntityPath, SpaceViewClass, SpaceViewClassName,
SpaceViewClassRegistryError, SpaceViewId, SpaceViewState, SpaceViewSystemExecutionError,
ViewContextCollection, ViewPartCollection, ViewQuery, ViewerContext,
external::re_log_types::EntityPath, SpaceViewClass, SpaceViewClassRegistryError, SpaceViewId,
SpaceViewState, SpaceViewSystemExecutionError, ViewContextCollection, ViewPartCollection,
ViewQuery, ViewerContext,
};

use crate::view_part_system::TextDocumentEntry;
Expand Down Expand Up @@ -49,9 +49,7 @@ pub struct TextDocumentSpaceView;
impl SpaceViewClass for TextDocumentSpaceView {
type State = TextDocumentSpaceViewState;

fn name(&self) -> SpaceViewClassName {
"Text Document".into()
}
const NAME: &'static str = "Text Document";

fn icon(&self) -> &'static re_ui::Icon {
&re_ui::icons::SPACE_VIEW_TEXTBOX
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_text_document/src/view_part_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ pub struct TextDocumentSystem {
}

impl NamedViewSystem for TextDocumentSystem {
fn name() -> re_viewer_context::ViewSystemName {
"TextDocument".into()
}
const NAME: &'static str = "TextDocument";
}

impl ViewPartSystem for TextDocumentSystem {
Expand Down
6 changes: 2 additions & 4 deletions crates/re_space_view_text_log/src/space_view_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use re_data_ui::item_ui;
use re_log_types::{EntityPath, TimePoint, Timeline};
use re_types::components::TextLogLevel;
use re_viewer_context::{
level_to_rich_text, AutoSpawnHeuristic, PerSystemEntities, SpaceViewClass, SpaceViewClassName,
level_to_rich_text, AutoSpawnHeuristic, PerSystemEntities, SpaceViewClass,
SpaceViewClassRegistryError, SpaceViewId, SpaceViewState, SpaceViewSystemExecutionError,
ViewContextCollection, ViewPartCollection, ViewQuery, ViewerContext,
};
Expand Down Expand Up @@ -42,9 +42,7 @@ pub struct TextSpaceView;
impl SpaceViewClass for TextSpaceView {
type State = TextSpaceViewState;

fn name(&self) -> SpaceViewClassName {
"TextLog".into()
}
const NAME: &'static str = "Text Log";

fn icon(&self) -> &'static re_ui::Icon {
&re_ui::icons::SPACE_VIEW_TEXTBOX
Expand Down
4 changes: 1 addition & 3 deletions crates/re_space_view_text_log/src/view_part_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ pub struct TextLogSystem {
}

impl NamedViewSystem for TextLogSystem {
fn name() -> re_viewer_context::ViewSystemName {
"TextLog".into()
}
const NAME: &'static str = "TextLog";
}

impl ViewPartSystem for TextLogSystem {
Expand Down
10 changes: 2 additions & 8 deletions crates/re_space_view_time_series/src/space_view_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use re_viewer_context::external::re_data_store::{
EditableAutoValue, EntityProperties, LegendCorner,
};
use re_viewer_context::{
SpaceViewClass, SpaceViewClassName, SpaceViewClassRegistryError, SpaceViewId, SpaceViewState,
SpaceViewClass, SpaceViewClassRegistryError, SpaceViewId, SpaceViewState,
SpaceViewSystemExecutionError, ViewContextCollection, ViewPartCollection, ViewQuery,
ViewerContext,
};
Expand All @@ -34,16 +34,10 @@ impl SpaceViewState for TimeSeriesSpaceViewState {
#[derive(Default)]
pub struct TimeSeriesSpaceView;

impl TimeSeriesSpaceView {
pub const NAME: &'static str = "Time Series";
}

impl SpaceViewClass for TimeSeriesSpaceView {
type State = TimeSeriesSpaceViewState;

fn name(&self) -> SpaceViewClassName {
Self::NAME.into()
}
const NAME: &'static str = "Time Series";

fn icon(&self) -> &'static re_ui::Icon {
&re_ui::icons::SPACE_VIEW_CHART
Expand Down
Loading
Loading