Skip to content

Commit

Permalink
Ellipsoids renamed to Ellipsoids3D (rerun-io#7019)
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc authored Aug 2, 2024
1 parent 4e948d6 commit 8c95f1e
Show file tree
Hide file tree
Showing 36 changed files with 145 additions and 145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace rerun.archetypes;
/// Some of its component are repeated here for convenience.
///
/// \example archetypes/ellipsoid_batch !api title="Batch of ellipsoids"
table Ellipsoids (
table Ellipsoids3D (
"attr.rust.derive": "PartialEq",
"attr.rust.new_pub_crate",
"attr.cpp.no_field_ctors",
Expand Down
2 changes: 1 addition & 1 deletion crates/store/re_types/src/archetypes/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::components::{HalfSize3D, LeafTranslation3D};

use super::Ellipsoids;
use super::Ellipsoids3D;

impl Ellipsoids {
/// Creates a new [`Ellipsoids`] for spheres with the given radii.
impl Ellipsoids3D {
/// Creates a new [`Ellipsoids3D`] for spheres with the given radii.
// Note: This is not a `Radius` component because the `Radius` component is for
// the on-screen sizes of lines and points.
#[inline]
Expand All @@ -12,7 +12,7 @@ impl Ellipsoids {
Self::new(radii.into_iter().map(HalfSize3D::splat))
}

/// Creates a new [`Ellipsoids`] for spheres with the given [`Self::centers`], and
/// Creates a new [`Ellipsoids3D`] for spheres with the given [`Self::centers`], and
/// [`Self::half_sizes`] all equal to the given radii.
// Note: This is not a `Radius` component because the `Radius` component is for
// the on-screen sizes of lines and points.
Expand All @@ -25,13 +25,13 @@ impl Ellipsoids {
Self::new(radii.into_iter().map(HalfSize3D::splat)).with_centers(centers)
}

/// Creates a new [`Ellipsoids`] with [`Self::half_sizes`].
/// Creates a new [`Ellipsoids3D`] with [`Self::half_sizes`].
#[inline]
pub fn from_half_sizes(half_sizes: impl IntoIterator<Item = impl Into<HalfSize3D>>) -> Self {
Self::new(half_sizes)
}

/// Creates a new [`Ellipsoids`] with [`Self::centers`] and [`Self::half_sizes`].
/// Creates a new [`Ellipsoids3D`] with [`Self::centers`] and [`Self::half_sizes`].
#[inline]
pub fn from_centers_and_half_sizes(
centers: impl IntoIterator<Item = impl Into<LeafTranslation3D>>,
Expand Down
6 changes: 3 additions & 3 deletions crates/store/re_types/src/archetypes/mod.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions crates/viewer/re_space_view_spatial/src/visualizers/ellipsoids.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use re_renderer::{
renderer::MeshInstance, LineDrawableBuilder, PickingLayerInstanceId, RenderContext,
};
use re_types::{
archetypes::Ellipsoids,
archetypes::Ellipsoids3D,
components::{ClassId, Color, FillMode, HalfSize3D, KeypointId, Radius, Text},
};
use re_viewer_context::{
Expand All @@ -28,9 +28,9 @@ use super::{

// ---

pub struct EllipsoidsVisualizer(SpatialViewVisualizerData);
pub struct Ellipsoids3DVisualizer(SpatialViewVisualizerData);

impl Default for EllipsoidsVisualizer {
impl Default for Ellipsoids3DVisualizer {
fn default() -> Self {
Self(SpatialViewVisualizerData::new(Some(
SpatialSpaceViewKind::ThreeD,
Expand All @@ -40,7 +40,7 @@ impl Default for EllipsoidsVisualizer {

// NOTE: Do not put profile scopes in these methods. They are called for all entities and all
// timestamps within a time range -- it's _a lot_.
impl EllipsoidsVisualizer {
impl Ellipsoids3DVisualizer {
#[allow(clippy::too_many_arguments)]
fn process_data<'a>(
&mut self,
Expand All @@ -49,7 +49,7 @@ impl EllipsoidsVisualizer {
mesh_instances: &mut Vec<MeshInstance>,
query: &ViewQuery<'_>,
ent_context: &SpatialSceneEntityContext<'_>,
data: impl Iterator<Item = EllipsoidsComponentData<'a>>,
data: impl Iterator<Item = Ellipsoids3DComponentData<'a>>,
render_ctx: &RenderContext,
) -> Result<(), SpaceViewSystemExecutionError> {
let entity_path = ctx.target_entity_path;
Expand Down Expand Up @@ -208,7 +208,7 @@ impl EllipsoidsVisualizer {

// ---

struct EllipsoidsComponentData<'a> {
struct Ellipsoids3DComponentData<'a> {
// Point of views
half_sizes: &'a [HalfSize3D],

Expand All @@ -222,15 +222,15 @@ struct EllipsoidsComponentData<'a> {
fill_mode: FillMode,
}

impl IdentifiedViewSystem for EllipsoidsVisualizer {
impl IdentifiedViewSystem for Ellipsoids3DVisualizer {
fn identifier() -> re_viewer_context::ViewSystemIdentifier {
"Ellipsoids".into()
"Ellipsoids3D".into()
}
}

impl VisualizerSystem for EllipsoidsVisualizer {
impl VisualizerSystem for Ellipsoids3DVisualizer {
fn visualizer_query_info(&self) -> VisualizerQueryInfo {
VisualizerQueryInfo::from_archetype::<Ellipsoids>()
VisualizerQueryInfo::from_archetype::<Ellipsoids3D>()
}

fn filter_visualizable_entities(
Expand Down Expand Up @@ -260,7 +260,7 @@ impl VisualizerSystem for EllipsoidsVisualizer {
// Collects solid (that is, triangles rather than wireframe) instances to be drawn.
let mut solid_instances: Vec<MeshInstance> = Vec::new();

super::entity_iterator::process_archetype::<Self, Ellipsoids, _>(
super::entity_iterator::process_archetype::<Self, Ellipsoids3D, _>(
ctx,
view_query,
context_systems,
Expand Down Expand Up @@ -315,7 +315,7 @@ impl VisualizerSystem for EllipsoidsVisualizer {
class_ids,
keypoint_ids,
)| {
EllipsoidsComponentData {
Ellipsoids3DComponentData {
half_sizes,
colors: colors.unwrap_or_default(),
line_radii: line_radii.unwrap_or_default(),
Expand Down Expand Up @@ -379,10 +379,10 @@ impl VisualizerSystem for EllipsoidsVisualizer {
}
}

impl TypedComponentFallbackProvider<Color> for EllipsoidsVisualizer {
impl TypedComponentFallbackProvider<Color> for Ellipsoids3DVisualizer {
fn fallback_for(&self, ctx: &QueryContext<'_>) -> Color {
auto_color_for_entity_path(ctx.target_entity_path)
}
}

re_viewer_context::impl_component_fallback_provider!(EllipsoidsVisualizer => [Color]);
re_viewer_context::impl_component_fallback_provider!(Ellipsoids3DVisualizer => [Color]);
2 changes: 1 addition & 1 deletion crates/viewer/re_space_view_spatial/src/visualizers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub fn register_3d_spatial_visualizers(
system_registry.register_visualizer::<points2d::Points2DVisualizer>()?;
system_registry.register_visualizer::<points3d::Points3DVisualizer>()?;
system_registry.register_visualizer::<segmentation_images::SegmentationImageVisualizer>()?;
system_registry.register_visualizer::<ellipsoids::EllipsoidsVisualizer>()?;
system_registry.register_visualizer::<ellipsoids::Ellipsoids3DVisualizer>()?;
system_registry.register_visualizer::<transform3d_arrows::AxisLengthDetector>()?;
system_registry.register_visualizer::<transform3d_arrows::Transform3DArrowsVisualizer>()?;
Ok(())
Expand Down
Loading

0 comments on commit 8c95f1e

Please sign in to comment.