diff --git a/crates/re_space_view_spatial/src/visualizers/boxes2d.rs b/crates/re_space_view_spatial/src/visualizers/boxes2d.rs index 0f62d693a991..ab053fc12757 100644 --- a/crates/re_space_view_spatial/src/visualizers/boxes2d.rs +++ b/crates/re_space_view_spatial/src/visualizers/boxes2d.rs @@ -4,7 +4,7 @@ use re_query::range_zip_1x6; use re_renderer::{LineDrawableBuilder, PickingLayerInstanceId}; use re_types::{ archetypes::Boxes2D, - components::{ClassId, Color, DrawOrder, HalfSizes2D, KeypointId, Position2D, Radius, Text}, + components::{ClassId, Color, DrawOrder, HalfSize2D, KeypointId, Position2D, Radius, Text}, }; use re_viewer_context::{ auto_color_for_entity_path, ApplicableEntities, IdentifiedViewSystem, QueryContext, @@ -49,7 +49,7 @@ impl Boxes2DVisualizer { /// Otherwise, produces one label per center position passed. fn process_labels<'a>( entity_path: &'a EntityPath, - half_sizes: &'a [HalfSizes2D], + half_sizes: &'a [HalfSize2D], centers: impl Iterator + 'a, labels: &'a [Text], colors: &'a [egui::Color32], @@ -196,7 +196,7 @@ impl Boxes2DVisualizer { struct Boxes2DComponentData<'a> { // Point of views - half_sizes: &'a [HalfSizes2D], + half_sizes: &'a [HalfSize2D], // Clamped to edge centers: &'a [Position2D], @@ -249,7 +249,7 @@ impl VisualizerSystem for Boxes2DVisualizer { let resolver = ctx.recording().resolver(); - let half_sizes = match results.get_required_component_dense::(resolver) + let half_sizes = match results.get_required_component_dense::(resolver) { Some(vectors) => vectors?, _ => return Ok(()), diff --git a/crates/re_space_view_spatial/src/visualizers/boxes3d.rs b/crates/re_space_view_spatial/src/visualizers/boxes3d.rs index abe15cd09979..30ba94fe577a 100644 --- a/crates/re_space_view_spatial/src/visualizers/boxes3d.rs +++ b/crates/re_space_view_spatial/src/visualizers/boxes3d.rs @@ -3,7 +3,7 @@ use re_query::range_zip_1x7; use re_renderer::{LineDrawableBuilder, PickingLayerInstanceId}; use re_types::{ archetypes::Boxes3D, - components::{ClassId, Color, HalfSizes3D, KeypointId, Position3D, Radius, Rotation3D, Text}, + components::{ClassId, Color, HalfSize3D, KeypointId, Position3D, Radius, Rotation3D, Text}, }; use re_viewer_context::{ auto_color_for_entity_path, ApplicableEntities, IdentifiedViewSystem, QueryContext, @@ -146,7 +146,7 @@ impl Boxes3DVisualizer { struct Boxes3DComponentData<'a> { // Point of views - half_sizes: &'a [HalfSizes3D], + half_sizes: &'a [HalfSize3D], // Clamped to edge centers: &'a [Position3D], @@ -200,7 +200,7 @@ impl VisualizerSystem for Boxes3DVisualizer { let resolver = ctx.recording().resolver(); - let half_sizes = match results.get_required_component_dense::(resolver) + let half_sizes = match results.get_required_component_dense::(resolver) { Some(vectors) => vectors?, _ => return Ok(()), diff --git a/crates/re_types/.gitattributes b/crates/re_types/.gitattributes index 3daddec2d29d..310901b29d49 100644 --- a/crates/re_types/.gitattributes +++ b/crates/re_types/.gitattributes @@ -36,8 +36,8 @@ src/components/color.rs linguist-generated=true src/components/depth_meter.rs linguist-generated=true src/components/disconnected_space.rs linguist-generated=true src/components/draw_order.rs linguist-generated=true -src/components/half_sizes2d.rs linguist-generated=true -src/components/half_sizes3d.rs linguist-generated=true +src/components/half_size2d.rs linguist-generated=true +src/components/half_size3d.rs linguist-generated=true src/components/instance_key.rs linguist-generated=true src/components/keypoint_id.rs linguist-generated=true src/components/line_strip2d.rs linguist-generated=true diff --git a/crates/re_types/definitions/rerun/archetypes/boxes2d.fbs b/crates/re_types/definitions/rerun/archetypes/boxes2d.fbs index 042a259f9f61..9a7c80c587b1 100644 --- a/crates/re_types/definitions/rerun/archetypes/boxes2d.fbs +++ b/crates/re_types/definitions/rerun/archetypes/boxes2d.fbs @@ -22,7 +22,7 @@ table Boxes2D ( // --- Required --- /// All half-extents that make up the batch of boxes. - half_sizes: [rerun.components.HalfSizes2D] ("attr.rerun.component_required", order: 1000); + half_sizes: [rerun.components.HalfSize2D] ("attr.rerun.component_required", order: 1000); // --- Recommended --- diff --git a/crates/re_types/definitions/rerun/archetypes/boxes3d.fbs b/crates/re_types/definitions/rerun/archetypes/boxes3d.fbs index 2d20345f8d21..e60258b752bc 100644 --- a/crates/re_types/definitions/rerun/archetypes/boxes3d.fbs +++ b/crates/re_types/definitions/rerun/archetypes/boxes3d.fbs @@ -23,7 +23,7 @@ table Boxes3D ( // --- Required --- /// All half-extents that make up the batch of boxes. - half_sizes: [rerun.components.HalfSizes3D] ("attr.rerun.component_required", order: 1000); + half_sizes: [rerun.components.HalfSize3D] ("attr.rerun.component_required", order: 1000); // --- Recommended --- diff --git a/crates/re_types/definitions/rerun/components.fbs b/crates/re_types/definitions/rerun/components.fbs index 33d742c1315b..edeae9a586bf 100644 --- a/crates/re_types/definitions/rerun/components.fbs +++ b/crates/re_types/definitions/rerun/components.fbs @@ -11,8 +11,8 @@ include "./components/disconnected_space.fbs"; include "./components/draw_order.fbs"; include "./components/fill_ratio.fbs"; include "./components/gamma_correction.fbs"; -include "./components/half_sizes2d.fbs"; -include "./components/half_sizes3d.fbs"; +include "./components/half_size2d.fbs"; +include "./components/half_size3d.fbs"; include "./components/image_plane_distance.fbs"; include "./components/keypoint_id.fbs"; include "./components/line_strip2d.fbs"; diff --git a/crates/re_types/definitions/rerun/components/half_sizes2d.fbs b/crates/re_types/definitions/rerun/components/half_size2d.fbs similarity index 92% rename from crates/re_types/definitions/rerun/components/half_sizes2d.fbs rename to crates/re_types/definitions/rerun/components/half_size2d.fbs index 0377745690d4..ab860a54552a 100644 --- a/crates/re_types/definitions/rerun/components/half_sizes2d.fbs +++ b/crates/re_types/definitions/rerun/components/half_size2d.fbs @@ -15,7 +15,8 @@ namespace rerun.components; /// /// The box extends both in negative and positive direction along each axis. /// Negative sizes indicate that the box is flipped along the respective axis, but this has no effect on how it is displayed. -struct HalfSizes2D ( +struct HalfSize2D ( + "attr.docs.unreleased", "attr.rust.derive": "Copy, PartialEq" ) { xy: rerun.datatypes.Vec2D (order: 100); diff --git a/crates/re_types/definitions/rerun/components/half_sizes3d.fbs b/crates/re_types/definitions/rerun/components/half_size3d.fbs similarity index 92% rename from crates/re_types/definitions/rerun/components/half_sizes3d.fbs rename to crates/re_types/definitions/rerun/components/half_size3d.fbs index 17ce7bf97d45..90f04893a092 100644 --- a/crates/re_types/definitions/rerun/components/half_sizes3d.fbs +++ b/crates/re_types/definitions/rerun/components/half_size3d.fbs @@ -15,7 +15,8 @@ namespace rerun.components; /// /// The box extends both in negative and positive direction along each axis. /// Negative sizes indicate that the box is flipped along the respective axis, but this has no effect on how it is displayed. -struct HalfSizes3D ( +struct HalfSize3D ( + "attr.docs.unreleased", "attr.rust.derive": "Copy, PartialEq" ) { xyz: rerun.datatypes.Vec3D (order: 100); diff --git a/crates/re_types/src/archetypes/boxes2d.rs b/crates/re_types/src/archetypes/boxes2d.rs index db597c8996d5..231ec51119ba 100644 --- a/crates/re_types/src/archetypes/boxes2d.rs +++ b/crates/re_types/src/archetypes/boxes2d.rs @@ -51,7 +51,7 @@ use ::re_types_core::{DeserializationError, DeserializationResult}; #[derive(Clone, Debug, PartialEq)] pub struct Boxes2D { /// All half-extents that make up the batch of boxes. - pub half_sizes: Vec, + pub half_sizes: Vec, /// Optional center positions of the boxes. pub centers: Option>, @@ -95,7 +95,7 @@ impl ::re_types_core::SizeBytes for Boxes2D { #[inline] fn is_pod() -> bool { - >::is_pod() + >::is_pod() && >>::is_pod() && >>::is_pod() && >>::is_pod() @@ -106,7 +106,7 @@ impl ::re_types_core::SizeBytes for Boxes2D { } static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[ComponentName; 1usize]> = - once_cell::sync::Lazy::new(|| ["rerun.components.HalfSizes2D".into()]); + once_cell::sync::Lazy::new(|| ["rerun.components.HalfSize2D".into()]); static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { @@ -130,7 +130,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[ComponentName; 4usize]> = static ALL_COMPONENTS: once_cell::sync::Lazy<[ComponentName; 8usize]> = once_cell::sync::Lazy::new(|| { [ - "rerun.components.HalfSizes2D".into(), + "rerun.components.HalfSize2D".into(), "rerun.components.Position2D".into(), "rerun.components.Color".into(), "rerun.components.Boxes2DIndicator".into(), @@ -200,10 +200,10 @@ impl ::re_types_core::Archetype for Boxes2D { .collect(); let half_sizes = { let array = arrays_by_name - .get("rerun.components.HalfSizes2D") + .get("rerun.components.HalfSize2D") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Boxes2D#half_sizes")?; - ::from_arrow_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#half_sizes")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -327,7 +327,7 @@ impl Boxes2D { /// Create a new `Boxes2D`. #[inline] pub(crate) fn new( - half_sizes: impl IntoIterator>, + half_sizes: impl IntoIterator>, ) -> Self { Self { half_sizes: half_sizes.into_iter().map(Into::into).collect(), diff --git a/crates/re_types/src/archetypes/boxes2d_ext.rs b/crates/re_types/src/archetypes/boxes2d_ext.rs index e39a73ca51ca..5b8a1923ef9c 100644 --- a/crates/re_types/src/archetypes/boxes2d_ext.rs +++ b/crates/re_types/src/archetypes/boxes2d_ext.rs @@ -1,5 +1,5 @@ use crate::{ - components::{HalfSizes2D, Position2D}, + components::{HalfSize2D, Position2D}, datatypes::Vec2D, }; @@ -8,7 +8,7 @@ use super::Boxes2D; impl Boxes2D { /// Creates new [`Boxes2D`] with [`Self::half_sizes`] centered around the local origin. #[inline] - pub fn from_half_sizes(half_sizes: impl IntoIterator>) -> Self { + pub fn from_half_sizes(half_sizes: impl IntoIterator>) -> Self { Self::new(half_sizes) } @@ -16,7 +16,7 @@ impl Boxes2D { #[inline] pub fn from_centers_and_half_sizes( centers: impl IntoIterator>, - half_sizes: impl IntoIterator>, + half_sizes: impl IntoIterator>, ) -> Self { Self::new(half_sizes).with_centers(centers) } @@ -28,7 +28,7 @@ impl Boxes2D { pub fn from_sizes(sizes: impl IntoIterator>) -> Self { Self::new(sizes.into_iter().map(|wh| { let wh = wh.into(); - HalfSizes2D::new(wh.x() / 2.0, wh.y() / 2.0) + HalfSize2D::new(wh.x() / 2.0, wh.y() / 2.0) })) } diff --git a/crates/re_types/src/archetypes/boxes3d.rs b/crates/re_types/src/archetypes/boxes3d.rs index 83717e27740f..95466bdc529c 100644 --- a/crates/re_types/src/archetypes/boxes3d.rs +++ b/crates/re_types/src/archetypes/boxes3d.rs @@ -66,7 +66,7 @@ use ::re_types_core::{DeserializationError, DeserializationResult}; #[derive(Clone, Debug, PartialEq)] pub struct Boxes3D { /// All half-extents that make up the batch of boxes. - pub half_sizes: Vec, + pub half_sizes: Vec, /// Optional center positions of the boxes. pub centers: Option>, @@ -106,7 +106,7 @@ impl ::re_types_core::SizeBytes for Boxes3D { #[inline] fn is_pod() -> bool { - >::is_pod() + >::is_pod() && >>::is_pod() && >>::is_pod() && >>::is_pod() @@ -117,7 +117,7 @@ impl ::re_types_core::SizeBytes for Boxes3D { } static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[ComponentName; 1usize]> = - once_cell::sync::Lazy::new(|| ["rerun.components.HalfSizes3D".into()]); + once_cell::sync::Lazy::new(|| ["rerun.components.HalfSize3D".into()]); static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[ComponentName; 4usize]> = once_cell::sync::Lazy::new(|| { @@ -141,7 +141,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[ComponentName; 3usize]> = static ALL_COMPONENTS: once_cell::sync::Lazy<[ComponentName; 8usize]> = once_cell::sync::Lazy::new(|| { [ - "rerun.components.HalfSizes3D".into(), + "rerun.components.HalfSize3D".into(), "rerun.components.Position3D".into(), "rerun.components.Rotation3D".into(), "rerun.components.Color".into(), @@ -211,10 +211,10 @@ impl ::re_types_core::Archetype for Boxes3D { .collect(); let half_sizes = { let array = arrays_by_name - .get("rerun.components.HalfSizes3D") + .get("rerun.components.HalfSize3D") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Boxes3D#half_sizes")?; - ::from_arrow_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#half_sizes")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -341,7 +341,7 @@ impl Boxes3D { /// Create a new `Boxes3D`. #[inline] pub(crate) fn new( - half_sizes: impl IntoIterator>, + half_sizes: impl IntoIterator>, ) -> Self { Self { half_sizes: half_sizes.into_iter().map(Into::into).collect(), diff --git a/crates/re_types/src/archetypes/boxes3d_ext.rs b/crates/re_types/src/archetypes/boxes3d_ext.rs index c201037a496d..d0f53c5c7967 100644 --- a/crates/re_types/src/archetypes/boxes3d_ext.rs +++ b/crates/re_types/src/archetypes/boxes3d_ext.rs @@ -1,5 +1,5 @@ use crate::{ - components::{HalfSizes3D, Position3D}, + components::{HalfSize3D, Position3D}, datatypes::Vec3D, }; @@ -8,7 +8,7 @@ use super::Boxes3D; impl Boxes3D { /// Creates new [`Boxes3D`] with [`Self::half_sizes`] centered around the local origin. #[inline] - pub fn from_half_sizes(half_sizes: impl IntoIterator>) -> Self { + pub fn from_half_sizes(half_sizes: impl IntoIterator>) -> Self { Self::new(half_sizes) } @@ -16,7 +16,7 @@ impl Boxes3D { #[inline] pub fn from_centers_and_half_sizes( centers: impl IntoIterator>, - half_sizes: impl IntoIterator>, + half_sizes: impl IntoIterator>, ) -> Self { Self::new(half_sizes).with_centers(centers) } @@ -28,7 +28,7 @@ impl Boxes3D { pub fn from_sizes(sizes: impl IntoIterator>) -> Self { Self::new(sizes.into_iter().map(|size| { let wh = size.into(); - HalfSizes3D::new(wh.x() / 2.0, wh.y() / 2.0, wh.z() / 2.0) + HalfSize3D::new(wh.x() / 2.0, wh.y() / 2.0, wh.z() / 2.0) })) } diff --git a/crates/re_types/src/components/.gitattributes b/crates/re_types/src/components/.gitattributes index 0fb3b1bfb8e6..a578ca713d34 100644 --- a/crates/re_types/src/components/.gitattributes +++ b/crates/re_types/src/components/.gitattributes @@ -13,8 +13,8 @@ disconnected_space.rs linguist-generated=true draw_order.rs linguist-generated=true fill_ratio.rs linguist-generated=true gamma_correction.rs linguist-generated=true -half_sizes2d.rs linguist-generated=true -half_sizes3d.rs linguist-generated=true +half_size2d.rs linguist-generated=true +half_size3d.rs linguist-generated=true image_plane_distance.rs linguist-generated=true keypoint_id.rs linguist-generated=true line_strip2d.rs linguist-generated=true diff --git a/crates/re_types/src/components/half_sizes2d.rs b/crates/re_types/src/components/half_size2d.rs similarity index 92% rename from crates/re_types/src/components/half_sizes2d.rs rename to crates/re_types/src/components/half_size2d.rs index d2fc659762eb..9519d8424e6a 100644 --- a/crates/re_types/src/components/half_sizes2d.rs +++ b/crates/re_types/src/components/half_size2d.rs @@ -1,5 +1,5 @@ // DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/api.rs -// Based on "crates/re_types/definitions/rerun/components/half_sizes2d.fbs". +// Based on "crates/re_types/definitions/rerun/components/half_size2d.fbs". #![allow(trivial_numeric_casts)] #![allow(unused_imports)] @@ -29,9 +29,9 @@ use ::re_types_core::{DeserializationError, DeserializationResult}; /// The box extends both in negative and positive direction along each axis. /// Negative sizes indicate that the box is flipped along the respective axis, but this has no effect on how it is displayed. #[derive(Clone, Debug, Copy, PartialEq)] -pub struct HalfSizes2D(pub crate::datatypes::Vec2D); +pub struct HalfSize2D(pub crate::datatypes::Vec2D); -impl ::re_types_core::SizeBytes for HalfSizes2D { +impl ::re_types_core::SizeBytes for HalfSize2D { #[inline] fn heap_size_bytes(&self) -> u64 { self.0.heap_size_bytes() @@ -43,20 +43,20 @@ impl ::re_types_core::SizeBytes for HalfSizes2D { } } -impl> From for HalfSizes2D { +impl> From for HalfSize2D { fn from(v: T) -> Self { Self(v.into()) } } -impl std::borrow::Borrow for HalfSizes2D { +impl std::borrow::Borrow for HalfSize2D { #[inline] fn borrow(&self) -> &crate::datatypes::Vec2D { &self.0 } } -impl std::ops::Deref for HalfSizes2D { +impl std::ops::Deref for HalfSize2D { type Target = crate::datatypes::Vec2D; #[inline] @@ -65,21 +65,21 @@ impl std::ops::Deref for HalfSizes2D { } } -impl std::ops::DerefMut for HalfSizes2D { +impl std::ops::DerefMut for HalfSize2D { #[inline] fn deref_mut(&mut self) -> &mut crate::datatypes::Vec2D { &mut self.0 } } -::re_types_core::macros::impl_into_cow!(HalfSizes2D); +::re_types_core::macros::impl_into_cow!(HalfSize2D); -impl ::re_types_core::Loggable for HalfSizes2D { +impl ::re_types_core::Loggable for HalfSize2D { type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { - "rerun.components.HalfSizes2D".into() + "rerun.components.HalfSize2D".into() } #[allow(clippy::wildcard_imports)] @@ -163,7 +163,7 @@ impl ::re_types_core::Loggable for HalfSizes2D { let actual = arrow_data.data_type().clone(); DeserializationError::datatype_mismatch(expected, actual) }) - .with_context("rerun.components.HalfSizes2D#xy")?; + .with_context("rerun.components.HalfSize2D#xy")?; if arrow_data.is_empty() { Vec::new() } else { @@ -180,7 +180,7 @@ impl ::re_types_core::Loggable for HalfSizes2D { let actual = arrow_data_inner.data_type().clone(); DeserializationError::datatype_mismatch(expected, actual) }) - .with_context("rerun.components.HalfSizes2D#xy")? + .with_context("rerun.components.HalfSize2D#xy")? .into_iter() .map(|opt| opt.copied()) .collect::>() @@ -220,8 +220,8 @@ impl ::re_types_core::Loggable for HalfSizes2D { .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>() - .with_context("rerun.components.HalfSizes2D#xy") - .with_context("rerun.components.HalfSizes2D")?) + .with_context("rerun.components.HalfSize2D#xy") + .with_context("rerun.components.HalfSize2D")?) } #[allow(clippy::wildcard_imports)] @@ -250,7 +250,7 @@ impl ::re_types_core::Loggable for HalfSizes2D { let actual = arrow_data.data_type().clone(); DeserializationError::datatype_mismatch(expected, actual) }) - .with_context("rerun.components.HalfSizes2D#xy")?; + .with_context("rerun.components.HalfSize2D#xy")?; let arrow_data_inner = &**arrow_data.values(); bytemuck::cast_slice::<_, [_; 2usize]>( arrow_data_inner @@ -261,7 +261,7 @@ impl ::re_types_core::Loggable for HalfSizes2D { let actual = arrow_data_inner.data_type().clone(); DeserializationError::datatype_mismatch(expected, actual) }) - .with_context("rerun.components.HalfSizes2D#xy")? + .with_context("rerun.components.HalfSize2D#xy")? .values() .as_slice(), ) diff --git a/crates/re_types/src/components/half_sizes2d_ext.rs b/crates/re_types/src/components/half_size2d_ext.rs similarity index 83% rename from crates/re_types/src/components/half_sizes2d_ext.rs rename to crates/re_types/src/components/half_size2d_ext.rs index 9066fcac76ba..85167b50fdca 100644 --- a/crates/re_types/src/components/half_sizes2d_ext.rs +++ b/crates/re_types/src/components/half_size2d_ext.rs @@ -1,8 +1,8 @@ use crate::datatypes::Vec2D; -use super::HalfSizes2D; +use super::HalfSize2D; -impl HalfSizes2D { +impl HalfSize2D { /// Create a new half-extent from half-width and half-height. #[inline] pub const fn new(half_width: f32, half_height: f32) -> Self { @@ -39,25 +39,25 @@ impl HalfSizes2D { } #[cfg(feature = "glam")] -impl From for glam::Vec2 { +impl From for glam::Vec2 { #[inline] - fn from(extent: HalfSizes2D) -> Self { + fn from(extent: HalfSize2D) -> Self { Self::new(extent.x(), extent.y()) } } #[cfg(feature = "glam")] -impl From for glam::Vec3 { +impl From for glam::Vec3 { #[inline] - fn from(extent: HalfSizes2D) -> Self { + fn from(extent: HalfSize2D) -> Self { Self::new(extent.x(), extent.y(), 0.0) } } #[cfg(feature = "mint")] -impl From for mint::Vector2 { +impl From for mint::Vector2 { #[inline] - fn from(extent: HalfSizes2D) -> Self { + fn from(extent: HalfSize2D) -> Self { Self { x: extent.x(), y: extent.y(), @@ -65,7 +65,7 @@ impl From for mint::Vector2 { } } -impl Default for HalfSizes2D { +impl Default for HalfSize2D { #[inline] fn default() -> Self { Self(Vec2D::ONE) diff --git a/crates/re_types/src/components/half_sizes3d.rs b/crates/re_types/src/components/half_size3d.rs similarity index 92% rename from crates/re_types/src/components/half_sizes3d.rs rename to crates/re_types/src/components/half_size3d.rs index eb7492844b25..93a8fa09126f 100644 --- a/crates/re_types/src/components/half_sizes3d.rs +++ b/crates/re_types/src/components/half_size3d.rs @@ -1,5 +1,5 @@ // DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/api.rs -// Based on "crates/re_types/definitions/rerun/components/half_sizes3d.fbs". +// Based on "crates/re_types/definitions/rerun/components/half_size3d.fbs". #![allow(trivial_numeric_casts)] #![allow(unused_imports)] @@ -29,9 +29,9 @@ use ::re_types_core::{DeserializationError, DeserializationResult}; /// The box extends both in negative and positive direction along each axis. /// Negative sizes indicate that the box is flipped along the respective axis, but this has no effect on how it is displayed. #[derive(Clone, Debug, Copy, PartialEq)] -pub struct HalfSizes3D(pub crate::datatypes::Vec3D); +pub struct HalfSize3D(pub crate::datatypes::Vec3D); -impl ::re_types_core::SizeBytes for HalfSizes3D { +impl ::re_types_core::SizeBytes for HalfSize3D { #[inline] fn heap_size_bytes(&self) -> u64 { self.0.heap_size_bytes() @@ -43,20 +43,20 @@ impl ::re_types_core::SizeBytes for HalfSizes3D { } } -impl> From for HalfSizes3D { +impl> From for HalfSize3D { fn from(v: T) -> Self { Self(v.into()) } } -impl std::borrow::Borrow for HalfSizes3D { +impl std::borrow::Borrow for HalfSize3D { #[inline] fn borrow(&self) -> &crate::datatypes::Vec3D { &self.0 } } -impl std::ops::Deref for HalfSizes3D { +impl std::ops::Deref for HalfSize3D { type Target = crate::datatypes::Vec3D; #[inline] @@ -65,21 +65,21 @@ impl std::ops::Deref for HalfSizes3D { } } -impl std::ops::DerefMut for HalfSizes3D { +impl std::ops::DerefMut for HalfSize3D { #[inline] fn deref_mut(&mut self) -> &mut crate::datatypes::Vec3D { &mut self.0 } } -::re_types_core::macros::impl_into_cow!(HalfSizes3D); +::re_types_core::macros::impl_into_cow!(HalfSize3D); -impl ::re_types_core::Loggable for HalfSizes3D { +impl ::re_types_core::Loggable for HalfSize3D { type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { - "rerun.components.HalfSizes3D".into() + "rerun.components.HalfSize3D".into() } #[allow(clippy::wildcard_imports)] @@ -163,7 +163,7 @@ impl ::re_types_core::Loggable for HalfSizes3D { let actual = arrow_data.data_type().clone(); DeserializationError::datatype_mismatch(expected, actual) }) - .with_context("rerun.components.HalfSizes3D#xyz")?; + .with_context("rerun.components.HalfSize3D#xyz")?; if arrow_data.is_empty() { Vec::new() } else { @@ -180,7 +180,7 @@ impl ::re_types_core::Loggable for HalfSizes3D { let actual = arrow_data_inner.data_type().clone(); DeserializationError::datatype_mismatch(expected, actual) }) - .with_context("rerun.components.HalfSizes3D#xyz")? + .with_context("rerun.components.HalfSize3D#xyz")? .into_iter() .map(|opt| opt.copied()) .collect::>() @@ -220,8 +220,8 @@ impl ::re_types_core::Loggable for HalfSizes3D { .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>() - .with_context("rerun.components.HalfSizes3D#xyz") - .with_context("rerun.components.HalfSizes3D")?) + .with_context("rerun.components.HalfSize3D#xyz") + .with_context("rerun.components.HalfSize3D")?) } #[allow(clippy::wildcard_imports)] @@ -250,7 +250,7 @@ impl ::re_types_core::Loggable for HalfSizes3D { let actual = arrow_data.data_type().clone(); DeserializationError::datatype_mismatch(expected, actual) }) - .with_context("rerun.components.HalfSizes3D#xyz")?; + .with_context("rerun.components.HalfSize3D#xyz")?; let arrow_data_inner = &**arrow_data.values(); bytemuck::cast_slice::<_, [_; 3usize]>( arrow_data_inner @@ -261,7 +261,7 @@ impl ::re_types_core::Loggable for HalfSizes3D { let actual = arrow_data_inner.data_type().clone(); DeserializationError::datatype_mismatch(expected, actual) }) - .with_context("rerun.components.HalfSizes3D#xyz")? + .with_context("rerun.components.HalfSize3D#xyz")? .values() .as_slice(), ) diff --git a/crates/re_types/src/components/half_sizes3d_ext.rs b/crates/re_types/src/components/half_size3d_ext.rs similarity index 87% rename from crates/re_types/src/components/half_sizes3d_ext.rs rename to crates/re_types/src/components/half_size3d_ext.rs index 946cf3566bbd..b63c909bc98c 100644 --- a/crates/re_types/src/components/half_sizes3d_ext.rs +++ b/crates/re_types/src/components/half_size3d_ext.rs @@ -1,8 +1,8 @@ use crate::datatypes::Vec3D; -use super::HalfSizes3D; +use super::HalfSize3D; -impl HalfSizes3D { +impl HalfSize3D { /// Create a new half-extent from half-width, half-height, half-depth. #[inline] pub const fn new(half_width: f32, half_height: f32, half_depth: f32) -> Self { @@ -45,17 +45,17 @@ impl HalfSizes3D { } #[cfg(feature = "glam")] -impl From for glam::Vec3 { +impl From for glam::Vec3 { #[inline] - fn from(extent: HalfSizes3D) -> Self { + fn from(extent: HalfSize3D) -> Self { Self::new(extent.x(), extent.y(), extent.z()) } } #[cfg(feature = "mint")] -impl From for mint::Vector3 { +impl From for mint::Vector3 { #[inline] - fn from(extent: HalfSizes3D) -> Self { + fn from(extent: HalfSize3D) -> Self { Self { x: extent.x(), y: extent.y(), @@ -64,7 +64,7 @@ impl From for mint::Vector3 { } } -impl Default for HalfSizes3D { +impl Default for HalfSize3D { #[inline] fn default() -> Self { Self(Vec3D::ONE) diff --git a/crates/re_types/src/components/mod.rs b/crates/re_types/src/components/mod.rs index 5d50a35b56fc..a79c7efbb6bf 100644 --- a/crates/re_types/src/components/mod.rs +++ b/crates/re_types/src/components/mod.rs @@ -21,10 +21,10 @@ mod fill_ratio; mod fill_ratio_ext; mod gamma_correction; mod gamma_correction_ext; -mod half_sizes2d; -mod half_sizes2d_ext; -mod half_sizes3d; -mod half_sizes3d_ext; +mod half_size2d; +mod half_size2d_ext; +mod half_size3d; +mod half_size3d_ext; mod image_plane_distance; mod image_plane_distance_ext; mod keypoint_id; @@ -99,8 +99,8 @@ pub use self::disconnected_space::DisconnectedSpace; pub use self::draw_order::DrawOrder; pub use self::fill_ratio::FillRatio; pub use self::gamma_correction::GammaCorrection; -pub use self::half_sizes2d::HalfSizes2D; -pub use self::half_sizes3d::HalfSizes3D; +pub use self::half_size2d::HalfSize2D; +pub use self::half_size3d::HalfSize3D; pub use self::image_plane_distance::ImagePlaneDistance; pub use self::keypoint_id::KeypointId; pub use self::line_strip2d::LineStrip2D; diff --git a/crates/re_types/tests/box2d.rs b/crates/re_types/tests/box2d.rs index 4fe85c81e40a..7b3ba81ee680 100644 --- a/crates/re_types/tests/box2d.rs +++ b/crates/re_types/tests/box2d.rs @@ -6,8 +6,8 @@ use re_types::{archetypes::Boxes2D, components, Archetype as _, AsComponents as fn roundtrip() { let expected = Boxes2D { half_sizes: vec![ - components::HalfSizes2D::new(1.0, 2.0), // - components::HalfSizes2D::new(3.0, 4.0), + components::HalfSize2D::new(1.0, 2.0), // + components::HalfSize2D::new(3.0, 4.0), ], centers: Some(vec![ components::Position2D::new(1.0, 2.0), // diff --git a/crates/re_types/tests/box3d.rs b/crates/re_types/tests/box3d.rs index 01d3c5aa0b6d..8ed924766280 100644 --- a/crates/re_types/tests/box3d.rs +++ b/crates/re_types/tests/box3d.rs @@ -6,8 +6,8 @@ use re_types::{archetypes::Boxes3D, components, datatypes, Archetype as _, AsCom fn roundtrip() { let expected = Boxes3D { half_sizes: vec![ - components::HalfSizes3D::new(1.0, 2.0, 3.0), // - components::HalfSizes3D::new(4.0, 5.0, 6.0), + components::HalfSize3D::new(1.0, 2.0, 3.0), // + components::HalfSize3D::new(4.0, 5.0, 6.0), ], centers: Some(vec![ components::Position3D::new(1.0, 2.0, 3.0), // diff --git a/crates/re_types/tests/mint_conversions.rs b/crates/re_types/tests/mint_conversions.rs index 415ea4dec5a9..35fce8927f60 100644 --- a/crates/re_types/tests/mint_conversions.rs +++ b/crates/re_types/tests/mint_conversions.rs @@ -93,13 +93,13 @@ fn position3d() { #[cfg(feature = "mint")] fn half_sizes_2d() { { - let component: components::HalfSizes2D = [1.0, 2.0].into(); + let component: components::HalfSize2D = [1.0, 2.0].into(); let mint: mint::Vector2 = component.into(); assert_eq!(mint, [1.0, 2.0].into()); } { let mint: mint::Vector2 = [1.0, 2.0].into(); - let component: components::HalfSizes2D = mint.into(); + let component: components::HalfSize2D = mint.into(); assert_eq!(component.x(), 1.0); assert_eq!(component.y(), 2.0); } @@ -109,13 +109,13 @@ fn half_sizes_2d() { #[cfg(feature = "mint")] fn half_sizes_3d() { { - let component: components::HalfSizes3D = [1.0, 2.0, 3.0].into(); + let component: components::HalfSize3D = [1.0, 2.0, 3.0].into(); let mint: mint::Vector3 = component.into(); assert_eq!(mint, [1.0, 2.0, 3.0].into()); } { let mint: mint::Vector3 = [1.0, 2.0, 3.0].into(); - let component: components::HalfSizes3D = mint.into(); + let component: components::HalfSize3D = mint.into(); assert_eq!(component.x(), 1.0); assert_eq!(component.y(), 2.0); assert_eq!(component.z(), 3.0); diff --git a/crates/re_types_blueprint/.gitattributes b/crates/re_types_blueprint/.gitattributes index d0ecc4487f58..7f3f3a7a7b5d 100644 --- a/crates/re_types_blueprint/.gitattributes +++ b/crates/re_types_blueprint/.gitattributes @@ -33,8 +33,8 @@ src/components/color.rs linguist-generated=true src/components/depth_meter.rs linguist-generated=true src/components/disconnected_space.rs linguist-generated=true src/components/draw_order.rs linguist-generated=true -src/components/half_sizes2d.rs linguist-generated=true -src/components/half_sizes3d.rs linguist-generated=true +src/components/half_size2d.rs linguist-generated=true +src/components/half_size3d.rs linguist-generated=true src/components/instance_key.rs linguist-generated=true src/components/keypoint_id.rs linguist-generated=true src/components/line_strip2d.rs linguist-generated=true diff --git a/crates/re_types_core/.gitattributes b/crates/re_types_core/.gitattributes index d0ecc4487f58..7f3f3a7a7b5d 100644 --- a/crates/re_types_core/.gitattributes +++ b/crates/re_types_core/.gitattributes @@ -33,8 +33,8 @@ src/components/color.rs linguist-generated=true src/components/depth_meter.rs linguist-generated=true src/components/disconnected_space.rs linguist-generated=true src/components/draw_order.rs linguist-generated=true -src/components/half_sizes2d.rs linguist-generated=true -src/components/half_sizes3d.rs linguist-generated=true +src/components/half_size2d.rs linguist-generated=true +src/components/half_size3d.rs linguist-generated=true src/components/instance_key.rs linguist-generated=true src/components/keypoint_id.rs linguist-generated=true src/components/line_strip2d.rs linguist-generated=true diff --git a/crates/re_types_core/src/loggable.rs b/crates/re_types_core/src/loggable.rs index cb259847480d..8f4871fe5bfb 100644 --- a/crates/re_types_core/src/loggable.rs +++ b/crates/re_types_core/src/loggable.rs @@ -221,7 +221,7 @@ impl ComponentName { self.full_name().strip_prefix("rerun.components.") { // This code should be correct as long as this url passes our link checker: - // https://rerun.io/docs/reference/types/components/half_sizes2d + // https://rerun.io/docs/reference/types/components/line_strip2d let component_name_snake_case = re_case::to_snake_case(component_name_pascal_case); let base_url = "https://rerun.io/docs/reference/types/components"; diff --git a/crates/re_viewer/src/reflection/mod.rs b/crates/re_viewer/src/reflection/mod.rs index eb567a17a35e..61c06452df8b 100644 --- a/crates/re_viewer/src/reflection/mod.rs +++ b/crates/re_viewer/src/reflection/mod.rs @@ -308,17 +308,17 @@ fn generate_component_reflection() -> Result::name(), + ::name(), ComponentReflection { docstring_md: "Half-size (radius) of a 2D box.\n\nMeasured in its local coordinate system.\n\nThe box extends both in negative and positive direction along each axis.\nNegative sizes indicate that the box is flipped along the respective axis, but this has no effect on how it is displayed.", - placeholder: Some(HalfSizes2D::default().to_arrow()?), + placeholder: Some(HalfSize2D::default().to_arrow()?), }, ), ( - ::name(), + ::name(), ComponentReflection { docstring_md: "Half-size (radius) of a 3D box.\n\nMeasured in its local coordinate system.\n\nThe box extends both in negative and positive direction along each axis.\nNegative sizes indicate that the box is flipped along the respective axis, but this has no effect on how it is displayed.", - placeholder: Some(HalfSizes3D::default().to_arrow()?), + placeholder: Some(HalfSize3D::default().to_arrow()?), }, ), ( diff --git a/crates/rerun/src/sdk.rs b/crates/rerun/src/sdk.rs index 65d98e09b7ac..6ce29379ff10 100644 --- a/crates/rerun/src/sdk.rs +++ b/crates/rerun/src/sdk.rs @@ -24,7 +24,7 @@ mod prelude { // Also import any component or datatype that has a unique name: pub use re_chunk::ChunkTimeline; pub use re_types::components::{ - Color, HalfSizes2D, HalfSizes3D, LineStrip2D, LineStrip3D, Material, MediaType, + Color, HalfSize2D, HalfSize3D, LineStrip2D, LineStrip3D, Material, MediaType, OutOfTreeTransform3D, Position2D, Position3D, Radius, Text, TextLogLevel, TriangleIndices, Vector2D, Vector3D, }; diff --git a/docs/content/reference/migration/migration-0-17.md b/docs/content/reference/migration/migration-0-17.md new file mode 100644 index 000000000000..77b73a6ed942 --- /dev/null +++ b/docs/content/reference/migration/migration-0-17.md @@ -0,0 +1,11 @@ +--- +title: Migrating from 0.16 to 0.17 +order: 170 +--- + + +## Renamed components +* `HalfSizes2D` is now called `HalfSize2D` +* `HalfSizes3D` is now called `HalfSize3D` + +All our components now follow the singular. diff --git a/docs/content/reference/types/archetypes/boxes2d.md b/docs/content/reference/types/archetypes/boxes2d.md index 0fbb8ad55f33..720c0c568df5 100644 --- a/docs/content/reference/types/archetypes/boxes2d.md +++ b/docs/content/reference/types/archetypes/boxes2d.md @@ -7,7 +7,7 @@ title: "Boxes2D" ## Components -**Required**: [`HalfSizes2D`](../components/half_sizes2d.md) +**Required**: [`HalfSize2D`](../components/half_size2d.md) **Recommended**: [`Position2D`](../components/position2d.md), [`Color`](../components/color.md) diff --git a/docs/content/reference/types/archetypes/boxes3d.md b/docs/content/reference/types/archetypes/boxes3d.md index f33b44e2c252..a746600cf187 100644 --- a/docs/content/reference/types/archetypes/boxes3d.md +++ b/docs/content/reference/types/archetypes/boxes3d.md @@ -7,7 +7,7 @@ title: "Boxes3D" ## Components -**Required**: [`HalfSizes3D`](../components/half_sizes3d.md) +**Required**: [`HalfSize3D`](../components/half_size3d.md) **Recommended**: [`Position3D`](../components/position3d.md), [`Rotation3D`](../components/rotation3d.md), [`Color`](../components/color.md) diff --git a/docs/content/reference/types/components.md b/docs/content/reference/types/components.md index 23a5d53444a7..a2eba33b1efe 100644 --- a/docs/content/reference/types/components.md +++ b/docs/content/reference/types/components.md @@ -26,8 +26,8 @@ on [Entities and Components](../../concepts/entity-component.md). * [`DrawOrder`](components/draw_order.md): Draw order of 2D elements. Higher values are drawn on top of lower values. * [`FillRatio`](components/fill_ratio.md): How much a primitive fills out the available space. * [`GammaCorrection`](components/gamma_correction.md): A gamma correction value to be used with a scalar value or color. -* [`HalfSizes2D`](components/half_sizes2d.md): Half-size (radius) of a 2D box. -* [`HalfSizes3D`](components/half_sizes3d.md): Half-size (radius) of a 3D box. +* [`HalfSize2D`](components/half_size2d.md): Half-size (radius) of a 2D box. +* [`HalfSize3D`](components/half_size3d.md): Half-size (radius) of a 3D box. * [`ImagePlaneDistance`](components/image_plane_distance.md): The distance from the camera origin to the image plane when the projection is shown in a 3D viewer. * [`KeypointId`](components/keypoint_id.md): A 16-bit ID representing a type of semantic keypoint within a class. * [`LineStrip2D`](components/line_strip2d.md): A line strip in 2D space. diff --git a/docs/content/reference/types/components/.gitattributes b/docs/content/reference/types/components/.gitattributes index 3bdb431dd866..8ba9bb1a688d 100644 --- a/docs/content/reference/types/components/.gitattributes +++ b/docs/content/reference/types/components/.gitattributes @@ -14,8 +14,8 @@ disconnected_space.md linguist-generated=true draw_order.md linguist-generated=true fill_ratio.md linguist-generated=true gamma_correction.md linguist-generated=true -half_sizes2d.md linguist-generated=true -half_sizes3d.md linguist-generated=true +half_size2d.md linguist-generated=true +half_size3d.md linguist-generated=true image_plane_distance.md linguist-generated=true keypoint_id.md linguist-generated=true line_strip2d.md linguist-generated=true diff --git a/docs/content/reference/types/components/half_sizes2d.md b/docs/content/reference/types/components/half_size2d.md similarity index 53% rename from docs/content/reference/types/components/half_sizes2d.md rename to docs/content/reference/types/components/half_size2d.md index 82b1ab0683ad..c0666af76d82 100644 --- a/docs/content/reference/types/components/half_sizes2d.md +++ b/docs/content/reference/types/components/half_size2d.md @@ -1,5 +1,5 @@ --- -title: "HalfSizes2D" +title: "HalfSize2D" --- @@ -15,9 +15,9 @@ Negative sizes indicate that the box is flipped along the respective axis, but t * xy: [`Vec2D`](../datatypes/vec2d.md) ## API reference links - * 🌊 [C++ API docs for `HalfSizes2D`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1HalfSizes2D.html) - * 🐍 [Python API docs for `HalfSizes2D`](https://ref.rerun.io/docs/python/stable/common/components#rerun.components.HalfSizes2D) - * 🦀 [Rust API docs for `HalfSizes2D`](https://docs.rs/rerun/latest/rerun/components/struct.HalfSizes2D.html) + * 🌊 [C++ API docs for `HalfSize2D`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1HalfSize2D.html?speculative-link) + * 🐍 [Python API docs for `HalfSize2D`](https://ref.rerun.io/docs/python/stable/common/components?speculative-link#rerun.components.HalfSize2D) + * 🦀 [Rust API docs for `HalfSize2D`](https://docs.rs/rerun/latest/rerun/components/struct.HalfSize2D.html?speculative-link) ## Used by diff --git a/docs/content/reference/types/components/half_sizes3d.md b/docs/content/reference/types/components/half_size3d.md similarity index 54% rename from docs/content/reference/types/components/half_sizes3d.md rename to docs/content/reference/types/components/half_size3d.md index 071c1bb52da2..31279b32b118 100644 --- a/docs/content/reference/types/components/half_sizes3d.md +++ b/docs/content/reference/types/components/half_size3d.md @@ -1,5 +1,5 @@ --- -title: "HalfSizes3D" +title: "HalfSize3D" --- @@ -15,9 +15,9 @@ Negative sizes indicate that the box is flipped along the respective axis, but t * xyz: [`Vec3D`](../datatypes/vec3d.md) ## API reference links - * 🌊 [C++ API docs for `HalfSizes3D`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1HalfSizes3D.html) - * 🐍 [Python API docs for `HalfSizes3D`](https://ref.rerun.io/docs/python/stable/common/components#rerun.components.HalfSizes3D) - * 🦀 [Rust API docs for `HalfSizes3D`](https://docs.rs/rerun/latest/rerun/components/struct.HalfSizes3D.html) + * 🌊 [C++ API docs for `HalfSize3D`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1HalfSize3D.html?speculative-link) + * 🐍 [Python API docs for `HalfSize3D`](https://ref.rerun.io/docs/python/stable/common/components?speculative-link#rerun.components.HalfSize3D) + * 🦀 [Rust API docs for `HalfSize3D`](https://docs.rs/rerun/latest/rerun/components/struct.HalfSize3D.html?speculative-link) ## Used by diff --git a/docs/content/reference/types/datatypes/vec2d.md b/docs/content/reference/types/datatypes/vec2d.md index 165d5954c0fb..0bf752e1111f 100644 --- a/docs/content/reference/types/datatypes/vec2d.md +++ b/docs/content/reference/types/datatypes/vec2d.md @@ -17,7 +17,7 @@ A vector in 2D space. ## Used by -* [`HalfSizes2D`](../components/half_sizes2d.md) +* [`HalfSize2D`](../components/half_size2d.md?speculative-link) * [`LineStrip2D`](../components/line_strip2d.md) * [`Position2D`](../components/position2d.md) * [`Resolution`](../components/resolution.md) diff --git a/docs/content/reference/types/datatypes/vec3d.md b/docs/content/reference/types/datatypes/vec3d.md index 74de681c5b2c..f2ccfea93396 100644 --- a/docs/content/reference/types/datatypes/vec3d.md +++ b/docs/content/reference/types/datatypes/vec3d.md @@ -17,7 +17,7 @@ A vector in 3D space. ## Used by -* [`HalfSizes3D`](../components/half_sizes3d.md) +* [`HalfSize3D`](../components/half_size3d.md?speculative-link) * [`LineStrip3D`](../components/line_strip3d.md) * [`Position3D`](../components/position3d.md) * [`RotationAxisAngle`](../datatypes/rotation_axis_angle.md) diff --git a/examples/rust/objectron/src/main.rs b/examples/rust/objectron/src/main.rs index 18be9a07c6ac..ab5c3dab2739 100644 --- a/examples/rust/objectron/src/main.rs +++ b/examples/rust/objectron/src/main.rs @@ -99,7 +99,7 @@ fn log_baseline_objects( return None; } - let box_half_size: rerun::HalfSizes3D = + let box_half_size: rerun::HalfSize3D = (glam::Vec3::from_slice(&object.scale) * 0.5).into(); let transform = { let translation = glam::Vec3::from_slice(&object.translation); diff --git a/rerun_cpp/.gitattributes b/rerun_cpp/.gitattributes index 40c8a42770ad..c622bc39fd30 100644 --- a/rerun_cpp/.gitattributes +++ b/rerun_cpp/.gitattributes @@ -71,10 +71,10 @@ src/rerun/components/disconnected_space.cpp linguist-generated=true src/rerun/components/disconnected_space.hpp linguist-generated=true src/rerun/components/draw_order.cpp linguist-generated=true src/rerun/components/draw_order.hpp linguist-generated=true -src/rerun/components/half_sizes2d.cpp linguist-generated=true -src/rerun/components/half_sizes2d.hpp linguist-generated=true -src/rerun/components/half_sizes3d.cpp linguist-generated=true -src/rerun/components/half_sizes3d.hpp linguist-generated=true +src/rerun/components/half_size2d.cpp linguist-generated=true +src/rerun/components/half_size2d.hpp linguist-generated=true +src/rerun/components/half_size3d.cpp linguist-generated=true +src/rerun/components/half_size3d.hpp linguist-generated=true src/rerun/components/instance_key.cpp linguist-generated=true src/rerun/components/instance_key.hpp linguist-generated=true src/rerun/components/keypoint_id.cpp linguist-generated=true diff --git a/rerun_cpp/src/rerun.hpp b/rerun_cpp/src/rerun.hpp index 0befd674b11b..803682896285 100644 --- a/rerun_cpp/src/rerun.hpp +++ b/rerun_cpp/src/rerun.hpp @@ -30,8 +30,8 @@ namespace rerun { // Also import any component or datatype that has a unique name: using components::Color; - using components::HalfSizes2D; - using components::HalfSizes3D; + using components::HalfSize2D; + using components::HalfSize3D; using components::LineStrip2D; using components::LineStrip3D; using components::Material; diff --git a/rerun_cpp/src/rerun/archetypes/boxes2d.hpp b/rerun_cpp/src/rerun/archetypes/boxes2d.hpp index d4cb5a04e728..37caf292ccb0 100644 --- a/rerun_cpp/src/rerun/archetypes/boxes2d.hpp +++ b/rerun_cpp/src/rerun/archetypes/boxes2d.hpp @@ -8,7 +8,7 @@ #include "../components/class_id.hpp" #include "../components/color.hpp" #include "../components/draw_order.hpp" -#include "../components/half_sizes2d.hpp" +#include "../components/half_size2d.hpp" #include "../components/position2d.hpp" #include "../components/radius.hpp" #include "../components/text.hpp" @@ -41,7 +41,7 @@ namespace rerun::archetypes { /// ``` struct Boxes2D { /// All half-extents that make up the batch of boxes. - Collection half_sizes; + Collection half_sizes; /// Optional center positions of the boxes. std::optional> centers; @@ -80,7 +80,7 @@ namespace rerun::archetypes { // Extensions to generated type defined in 'boxes2d_ext.cpp' /// Creates new `Boxes2D` with `half_sizes` centered around the local origin. - static Boxes2D from_half_sizes(Collection half_sizes) { + static Boxes2D from_half_sizes(Collection half_sizes) { Boxes2D boxes; boxes.half_sizes = std::move(half_sizes); return boxes; @@ -89,7 +89,7 @@ namespace rerun::archetypes { /// Creates new `Boxes2D` with `centers` and `half_sizes`. static Boxes2D from_centers_and_half_sizes( Collection centers, - Collection half_sizes + Collection half_sizes ) { Boxes2D boxes; boxes.half_sizes = std::move(half_sizes); diff --git a/rerun_cpp/src/rerun/archetypes/boxes2d_ext.cpp b/rerun_cpp/src/rerun/archetypes/boxes2d_ext.cpp index c01646187b64..ffb17c506ce0 100644 --- a/rerun_cpp/src/rerun/archetypes/boxes2d_ext.cpp +++ b/rerun_cpp/src/rerun/archetypes/boxes2d_ext.cpp @@ -11,7 +11,7 @@ namespace rerun { // /// Creates new `Boxes2D` with `half_sizes` centered around the local origin. - static Boxes2D from_half_sizes(Collection half_sizes) { + static Boxes2D from_half_sizes(Collection half_sizes) { Boxes2D boxes; boxes.half_sizes = std::move(half_sizes); return boxes; @@ -20,7 +20,7 @@ namespace rerun { /// Creates new `Boxes2D` with `centers` and `half_sizes`. static Boxes2D from_centers_and_half_sizes( Collection centers, - Collection half_sizes + Collection half_sizes ) { Boxes2D boxes; boxes.half_sizes = std::move(half_sizes); @@ -59,7 +59,7 @@ namespace rerun { // #endif Boxes2D Boxes2D::from_sizes(const std::vector& sizes) { - std::vector half_sizes; + std::vector half_sizes; half_sizes.reserve(sizes.size()); for (const auto& size : sizes) { half_sizes.emplace_back(size.x() / 2.0f, size.y() / 2.0f); @@ -74,7 +74,7 @@ namespace rerun { ) { auto num_components = std::min(mins.size(), sizes.size()); - std::vector half_sizes; + std::vector half_sizes; std::vector centers; half_sizes.reserve(num_components); centers.reserve(num_components); diff --git a/rerun_cpp/src/rerun/archetypes/boxes3d.hpp b/rerun_cpp/src/rerun/archetypes/boxes3d.hpp index b2f493ec15b2..85d6559b1b21 100644 --- a/rerun_cpp/src/rerun/archetypes/boxes3d.hpp +++ b/rerun_cpp/src/rerun/archetypes/boxes3d.hpp @@ -7,7 +7,7 @@ #include "../compiler_utils.hpp" #include "../components/class_id.hpp" #include "../components/color.hpp" -#include "../components/half_sizes3d.hpp" +#include "../components/half_size3d.hpp" #include "../components/position3d.hpp" #include "../components/radius.hpp" #include "../components/rotation3d.hpp" @@ -60,7 +60,7 @@ namespace rerun::archetypes { /// ``` struct Boxes3D { /// All half-extents that make up the batch of boxes. - Collection half_sizes; + Collection half_sizes; /// Optional center positions of the boxes. std::optional> centers; @@ -95,7 +95,7 @@ namespace rerun::archetypes { // Extensions to generated type defined in 'boxes3d_ext.cpp' /// Creates new `Boxes3D` with `half_sizes` centered around the local origin. - static Boxes3D from_half_sizes(Collection half_sizes) { + static Boxes3D from_half_sizes(Collection half_sizes) { Boxes3D boxes; boxes.half_sizes = std::move(half_sizes); return boxes; @@ -104,7 +104,7 @@ namespace rerun::archetypes { /// Creates new `Boxes3D` with `centers` and `half_sizes`. static Boxes3D from_centers_and_half_sizes( Collection centers, - Collection half_sizes + Collection half_sizes ) { Boxes3D boxes; boxes.half_sizes = std::move(half_sizes); diff --git a/rerun_cpp/src/rerun/archetypes/boxes3d_ext.cpp b/rerun_cpp/src/rerun/archetypes/boxes3d_ext.cpp index 983cb10dc29e..6cdf8bb5ffb5 100644 --- a/rerun_cpp/src/rerun/archetypes/boxes3d_ext.cpp +++ b/rerun_cpp/src/rerun/archetypes/boxes3d_ext.cpp @@ -11,7 +11,7 @@ namespace rerun { // /// Creates new `Boxes3D` with `half_sizes` centered around the local origin. - static Boxes3D from_half_sizes(Collection half_sizes) { + static Boxes3D from_half_sizes(Collection half_sizes) { Boxes3D boxes; boxes.half_sizes = std::move(half_sizes); return boxes; @@ -20,7 +20,7 @@ namespace rerun { /// Creates new `Boxes3D` with `centers` and `half_sizes`. static Boxes3D from_centers_and_half_sizes( Collection centers, - Collection half_sizes + Collection half_sizes ) { Boxes3D boxes; boxes.half_sizes = std::move(half_sizes); @@ -62,7 +62,7 @@ namespace rerun { // #endif Boxes3D Boxes3D::from_sizes(const std::vector& sizes) { - std::vector half_sizes; + std::vector half_sizes; half_sizes.reserve(sizes.size()); for (const auto& size : sizes) { half_sizes.emplace_back(size.x() / 2.0f, size.y() / 2.0f, size.z() / 2.0f); @@ -77,7 +77,7 @@ namespace rerun { ) { auto num_components = std::min(mins.size(), sizes.size()); - std::vector half_sizes; + std::vector half_sizes; std::vector centers; half_sizes.reserve(num_components); centers.reserve(num_components); diff --git a/rerun_cpp/src/rerun/components.hpp b/rerun_cpp/src/rerun/components.hpp index 438447edf0bb..8b2ab8709673 100644 --- a/rerun_cpp/src/rerun/components.hpp +++ b/rerun_cpp/src/rerun/components.hpp @@ -15,8 +15,8 @@ #include "components/draw_order.hpp" #include "components/fill_ratio.hpp" #include "components/gamma_correction.hpp" -#include "components/half_sizes2d.hpp" -#include "components/half_sizes3d.hpp" +#include "components/half_size2d.hpp" +#include "components/half_size3d.hpp" #include "components/image_plane_distance.hpp" #include "components/keypoint_id.hpp" #include "components/line_strip2d.hpp" diff --git a/rerun_cpp/src/rerun/components/.gitattributes b/rerun_cpp/src/rerun/components/.gitattributes index 578a4de8d76c..a305f23e2084 100644 --- a/rerun_cpp/src/rerun/components/.gitattributes +++ b/rerun_cpp/src/rerun/components/.gitattributes @@ -22,8 +22,8 @@ draw_order.cpp linguist-generated=true draw_order.hpp linguist-generated=true fill_ratio.hpp linguist-generated=true gamma_correction.hpp linguist-generated=true -half_sizes2d.hpp linguist-generated=true -half_sizes3d.hpp linguist-generated=true +half_size2d.hpp linguist-generated=true +half_size3d.hpp linguist-generated=true image_plane_distance.hpp linguist-generated=true keypoint_id.hpp linguist-generated=true line_strip2d.cpp linguist-generated=true diff --git a/rerun_cpp/src/rerun/components/half_sizes2d.hpp b/rerun_cpp/src/rerun/components/half_size2d.hpp similarity index 70% rename from rerun_cpp/src/rerun/components/half_sizes2d.hpp rename to rerun_cpp/src/rerun/components/half_size2d.hpp index d41f0fe8f26b..a7caf0a20a84 100644 --- a/rerun_cpp/src/rerun/components/half_sizes2d.hpp +++ b/rerun_cpp/src/rerun/components/half_size2d.hpp @@ -1,5 +1,5 @@ // DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/cpp/mod.rs -// Based on "crates/re_types/definitions/rerun/components/half_sizes2d.fbs". +// Based on "crates/re_types/definitions/rerun/components/half_size2d.fbs". #pragma once @@ -17,14 +17,14 @@ namespace rerun::components { /// /// The box extends both in negative and positive direction along each axis. /// Negative sizes indicate that the box is flipped along the respective axis, but this has no effect on how it is displayed. - struct HalfSizes2D { + struct HalfSize2D { rerun::datatypes::Vec2D xy; public: - // Extensions to generated type defined in 'half_sizes2d_ext.cpp' + // Extensions to generated type defined in 'half_size2d_ext.cpp' - /// Construct HalfSizes2D from x/y values. - HalfSizes2D(float x, float y) : xy{x, y} {} + /// Construct HalfSize2D from x/y values. + HalfSize2D(float x, float y) : xy{x, y} {} float x() const { return xy.x(); @@ -35,18 +35,18 @@ namespace rerun::components { } public: - HalfSizes2D() = default; + HalfSize2D() = default; - HalfSizes2D(rerun::datatypes::Vec2D xy_) : xy(xy_) {} + HalfSize2D(rerun::datatypes::Vec2D xy_) : xy(xy_) {} - HalfSizes2D& operator=(rerun::datatypes::Vec2D xy_) { + HalfSize2D& operator=(rerun::datatypes::Vec2D xy_) { xy = xy_; return *this; } - HalfSizes2D(std::array xy_) : xy(xy_) {} + HalfSize2D(std::array xy_) : xy(xy_) {} - HalfSizes2D& operator=(std::array xy_) { + HalfSize2D& operator=(std::array xy_) { xy = xy_; return *this; } @@ -59,21 +59,21 @@ namespace rerun::components { } // namespace rerun::components namespace rerun { - static_assert(sizeof(rerun::datatypes::Vec2D) == sizeof(components::HalfSizes2D)); + static_assert(sizeof(rerun::datatypes::Vec2D) == sizeof(components::HalfSize2D)); /// \private template <> - struct Loggable { - static constexpr const char Name[] = "rerun.components.HalfSizes2D"; + struct Loggable { + static constexpr const char Name[] = "rerun.components.HalfSize2D"; /// Returns the arrow data type this type corresponds to. static const std::shared_ptr& arrow_datatype() { return Loggable::arrow_datatype(); } - /// Serializes an array of `rerun::components::HalfSizes2D` into an arrow array. + /// Serializes an array of `rerun::components::HalfSize2D` into an arrow array. static Result> to_arrow( - const components::HalfSizes2D* instances, size_t num_instances + const components::HalfSize2D* instances, size_t num_instances ) { return Loggable::to_arrow(&instances->xy, num_instances); } diff --git a/rerun_cpp/src/rerun/components/half_sizes2d_ext.cpp b/rerun_cpp/src/rerun/components/half_size2d_ext.cpp similarity index 70% rename from rerun_cpp/src/rerun/components/half_sizes2d_ext.cpp rename to rerun_cpp/src/rerun/components/half_size2d_ext.cpp index 2cd539c402fd..4a2b768d9c65 100644 --- a/rerun_cpp/src/rerun/components/half_sizes2d_ext.cpp +++ b/rerun_cpp/src/rerun/components/half_size2d_ext.cpp @@ -1,4 +1,4 @@ -#include "half_sizes2d.hpp" +#include "half_size2d.hpp" // Uncomment for better auto-complete while editing the extension. // #define EDIT_EXTENSION @@ -7,14 +7,14 @@ namespace rerun { namespace components { #ifdef EDIT_EXTENSION - struct HalfSizes2DExt { + struct HalfSize2DExt { float xy[2]; -#define HalfSizes2D HalfSizes2DExt +#define HalfSize2D HalfSize2DExt // - /// Construct HalfSizes2D from x/y values. - HalfSizes2D(float x, float y) : xy{x, y} {} + /// Construct HalfSize2D from x/y values. + HalfSize2D(float x, float y) : xy{x, y} {} float x() const { return xy.x(); diff --git a/rerun_cpp/src/rerun/components/half_sizes3d.hpp b/rerun_cpp/src/rerun/components/half_size3d.hpp similarity index 70% rename from rerun_cpp/src/rerun/components/half_sizes3d.hpp rename to rerun_cpp/src/rerun/components/half_size3d.hpp index 2a1a9f80f6e2..34eb1646a300 100644 --- a/rerun_cpp/src/rerun/components/half_sizes3d.hpp +++ b/rerun_cpp/src/rerun/components/half_size3d.hpp @@ -1,5 +1,5 @@ // DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/cpp/mod.rs -// Based on "crates/re_types/definitions/rerun/components/half_sizes3d.fbs". +// Based on "crates/re_types/definitions/rerun/components/half_size3d.fbs". #pragma once @@ -17,14 +17,14 @@ namespace rerun::components { /// /// The box extends both in negative and positive direction along each axis. /// Negative sizes indicate that the box is flipped along the respective axis, but this has no effect on how it is displayed. - struct HalfSizes3D { + struct HalfSize3D { rerun::datatypes::Vec3D xyz; public: - // Extensions to generated type defined in 'half_sizes3d_ext.cpp' + // Extensions to generated type defined in 'half_size3d_ext.cpp' - /// Construct HalfSizes3D from x/y/z values. - HalfSizes3D(float x, float y, float z) : xyz{x, y, z} {} + /// Construct HalfSize3D from x/y/z values. + HalfSize3D(float x, float y, float z) : xyz{x, y, z} {} float x() const { return xyz.x(); @@ -39,18 +39,18 @@ namespace rerun::components { } public: - HalfSizes3D() = default; + HalfSize3D() = default; - HalfSizes3D(rerun::datatypes::Vec3D xyz_) : xyz(xyz_) {} + HalfSize3D(rerun::datatypes::Vec3D xyz_) : xyz(xyz_) {} - HalfSizes3D& operator=(rerun::datatypes::Vec3D xyz_) { + HalfSize3D& operator=(rerun::datatypes::Vec3D xyz_) { xyz = xyz_; return *this; } - HalfSizes3D(std::array xyz_) : xyz(xyz_) {} + HalfSize3D(std::array xyz_) : xyz(xyz_) {} - HalfSizes3D& operator=(std::array xyz_) { + HalfSize3D& operator=(std::array xyz_) { xyz = xyz_; return *this; } @@ -63,21 +63,21 @@ namespace rerun::components { } // namespace rerun::components namespace rerun { - static_assert(sizeof(rerun::datatypes::Vec3D) == sizeof(components::HalfSizes3D)); + static_assert(sizeof(rerun::datatypes::Vec3D) == sizeof(components::HalfSize3D)); /// \private template <> - struct Loggable { - static constexpr const char Name[] = "rerun.components.HalfSizes3D"; + struct Loggable { + static constexpr const char Name[] = "rerun.components.HalfSize3D"; /// Returns the arrow data type this type corresponds to. static const std::shared_ptr& arrow_datatype() { return Loggable::arrow_datatype(); } - /// Serializes an array of `rerun::components::HalfSizes3D` into an arrow array. + /// Serializes an array of `rerun::components::HalfSize3D` into an arrow array. static Result> to_arrow( - const components::HalfSizes3D* instances, size_t num_instances + const components::HalfSize3D* instances, size_t num_instances ) { return Loggable::to_arrow(&instances->xyz, num_instances); } diff --git a/rerun_cpp/src/rerun/components/half_sizes3d_ext.cpp b/rerun_cpp/src/rerun/components/half_size3d_ext.cpp similarity index 72% rename from rerun_cpp/src/rerun/components/half_sizes3d_ext.cpp rename to rerun_cpp/src/rerun/components/half_size3d_ext.cpp index 475b3d5f18a2..51692d7f478d 100644 --- a/rerun_cpp/src/rerun/components/half_sizes3d_ext.cpp +++ b/rerun_cpp/src/rerun/components/half_size3d_ext.cpp @@ -1,4 +1,4 @@ -#include "half_sizes3d.hpp" +#include "half_size3d.hpp" // Uncomment for better auto-complete while editing the extension. // #define EDIT_EXTENSION @@ -7,14 +7,14 @@ namespace rerun { namespace components { #ifdef EDIT_EXTENSION - struct HalfSizes3DExt { + struct HalfSize3DExt { float xyz[3]; -#define HalfSizes3D HalfSizes3DExt +#define HalfSize3D HalfSize3DExt // - /// Construct HalfSizes3D from x/y/z values. - HalfSizes3D(float x, float y, float z) : xyz{x, y, z} {} + /// Construct HalfSize3D from x/y/z values. + HalfSize3D(float x, float y, float z) : xyz{x, y, z} {} float x() const { return xyz.x(); diff --git a/rerun_py/rerun_sdk/rerun/.gitattributes b/rerun_py/rerun_sdk/rerun/.gitattributes index 50e2def742fb..eed766c2db79 100644 --- a/rerun_py/rerun_sdk/rerun/.gitattributes +++ b/rerun_py/rerun_sdk/rerun/.gitattributes @@ -38,8 +38,8 @@ components/color.py linguist-generated=true components/depth_meter.py linguist-generated=true components/disconnected_space.py linguist-generated=true components/draw_order.py linguist-generated=true -components/half_sizes2d.py linguist-generated=true -components/half_sizes3d.py linguist-generated=true +components/half_size2d.py linguist-generated=true +components/half_size3d.py linguist-generated=true components/instance_key.py linguist-generated=true components/keypoint_id.py linguist-generated=true components/line_strip2d.py linguist-generated=true diff --git a/rerun_py/rerun_sdk/rerun/archetypes/boxes2d.py b/rerun_py/rerun_sdk/rerun/archetypes/boxes2d.py index 09af5d869226..6e98e9d29bd7 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/boxes2d.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/boxes2d.py @@ -64,9 +64,9 @@ def _clear(cls) -> Boxes2D: inst.__attrs_clear__() return inst - half_sizes: components.HalfSizes2DBatch = field( + half_sizes: components.HalfSize2DBatch = field( metadata={"component": "required"}, - converter=components.HalfSizes2DBatch._required, # type: ignore[misc] + converter=components.HalfSize2DBatch._required, # type: ignore[misc] ) # All half-extents that make up the batch of boxes. # diff --git a/rerun_py/rerun_sdk/rerun/archetypes/boxes3d.py b/rerun_py/rerun_sdk/rerun/archetypes/boxes3d.py index 3823585f7259..057d2eaeee26 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/boxes3d.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/boxes3d.py @@ -79,9 +79,9 @@ def _clear(cls) -> Boxes3D: inst.__attrs_clear__() return inst - half_sizes: components.HalfSizes3DBatch = field( + half_sizes: components.HalfSize3DBatch = field( metadata={"component": "required"}, - converter=components.HalfSizes3DBatch._required, # type: ignore[misc] + converter=components.HalfSize3DBatch._required, # type: ignore[misc] ) # All half-extents that make up the batch of boxes. # diff --git a/rerun_py/rerun_sdk/rerun/components/.gitattributes b/rerun_py/rerun_sdk/rerun/components/.gitattributes index 2dc52d251914..5269034574e4 100644 --- a/rerun_py/rerun_sdk/rerun/components/.gitattributes +++ b/rerun_py/rerun_sdk/rerun/components/.gitattributes @@ -15,8 +15,8 @@ disconnected_space.py linguist-generated=true draw_order.py linguist-generated=true fill_ratio.py linguist-generated=true gamma_correction.py linguist-generated=true -half_sizes2d.py linguist-generated=true -half_sizes3d.py linguist-generated=true +half_size2d.py linguist-generated=true +half_size3d.py linguist-generated=true image_plane_distance.py linguist-generated=true keypoint_id.py linguist-generated=true line_strip2d.py linguist-generated=true diff --git a/rerun_py/rerun_sdk/rerun/components/__init__.py b/rerun_py/rerun_sdk/rerun/components/__init__.py index 705d78d29215..6fbc3e1e5304 100644 --- a/rerun_py/rerun_sdk/rerun/components/__init__.py +++ b/rerun_py/rerun_sdk/rerun/components/__init__.py @@ -39,8 +39,8 @@ from .draw_order import DrawOrder, DrawOrderArrayLike, DrawOrderBatch, DrawOrderLike, DrawOrderType from .fill_ratio import FillRatio, FillRatioBatch, FillRatioType from .gamma_correction import GammaCorrection, GammaCorrectionBatch, GammaCorrectionType -from .half_sizes2d import HalfSizes2D, HalfSizes2DBatch, HalfSizes2DType -from .half_sizes3d import HalfSizes3D, HalfSizes3DBatch, HalfSizes3DType +from .half_size2d import HalfSize2D, HalfSize2DBatch, HalfSize2DType +from .half_size3d import HalfSize3D, HalfSize3DBatch, HalfSize3DType from .image_plane_distance import ImagePlaneDistance, ImagePlaneDistanceBatch, ImagePlaneDistanceType from .keypoint_id import KeypointId, KeypointIdBatch, KeypointIdType from .line_strip2d import LineStrip2D, LineStrip2DArrayLike, LineStrip2DBatch, LineStrip2DLike, LineStrip2DType @@ -147,12 +147,12 @@ "GammaCorrection", "GammaCorrectionBatch", "GammaCorrectionType", - "HalfSizes2D", - "HalfSizes2DBatch", - "HalfSizes2DType", - "HalfSizes3D", - "HalfSizes3DBatch", - "HalfSizes3DType", + "HalfSize2D", + "HalfSize2DBatch", + "HalfSize2DType", + "HalfSize3D", + "HalfSize3DBatch", + "HalfSize3DType", "ImagePlaneDistance", "ImagePlaneDistanceBatch", "ImagePlaneDistanceType", diff --git a/rerun_py/rerun_sdk/rerun/components/half_sizes2d.py b/rerun_py/rerun_sdk/rerun/components/half_size2d.py similarity index 56% rename from rerun_py/rerun_sdk/rerun/components/half_sizes2d.py rename to rerun_py/rerun_sdk/rerun/components/half_size2d.py index 3f9f4772774f..09155b68591a 100644 --- a/rerun_py/rerun_sdk/rerun/components/half_sizes2d.py +++ b/rerun_py/rerun_sdk/rerun/components/half_size2d.py @@ -1,7 +1,7 @@ # DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/python/mod.rs -# Based on "crates/re_types/definitions/rerun/components/half_sizes2d.fbs". +# Based on "crates/re_types/definitions/rerun/components/half_size2d.fbs". -# You can extend this class by creating a "HalfSizes2DExt" class in "half_sizes2d_ext.py". +# You can extend this class by creating a "HalfSize2DExt" class in "half_size2d_ext.py". from __future__ import annotations @@ -11,10 +11,10 @@ ComponentMixin, ) -__all__ = ["HalfSizes2D", "HalfSizes2DBatch", "HalfSizes2DType"] +__all__ = ["HalfSize2D", "HalfSize2DBatch", "HalfSize2DType"] -class HalfSizes2D(datatypes.Vec2D, ComponentMixin): +class HalfSize2D(datatypes.Vec2D, ComponentMixin): """ **Component**: Half-size (radius) of a 2D box. @@ -25,19 +25,19 @@ class HalfSizes2D(datatypes.Vec2D, ComponentMixin): """ _BATCH_TYPE = None - # You can define your own __init__ function as a member of HalfSizes2DExt in half_sizes2d_ext.py + # You can define your own __init__ function as a member of HalfSize2DExt in half_size2d_ext.py - # Note: there are no fields here because HalfSizes2D delegates to datatypes.Vec2D + # Note: there are no fields here because HalfSize2D delegates to datatypes.Vec2D pass -class HalfSizes2DType(datatypes.Vec2DType): - _TYPE_NAME: str = "rerun.components.HalfSizes2D" +class HalfSize2DType(datatypes.Vec2DType): + _TYPE_NAME: str = "rerun.components.HalfSize2D" -class HalfSizes2DBatch(datatypes.Vec2DBatch, ComponentBatchMixin): - _ARROW_TYPE = HalfSizes2DType() +class HalfSize2DBatch(datatypes.Vec2DBatch, ComponentBatchMixin): + _ARROW_TYPE = HalfSize2DType() # This is patched in late to avoid circular dependencies. -HalfSizes2D._BATCH_TYPE = HalfSizes2DBatch # type: ignore[assignment] +HalfSize2D._BATCH_TYPE = HalfSize2DBatch # type: ignore[assignment] diff --git a/rerun_py/rerun_sdk/rerun/components/half_sizes3d.py b/rerun_py/rerun_sdk/rerun/components/half_size3d.py similarity index 56% rename from rerun_py/rerun_sdk/rerun/components/half_sizes3d.py rename to rerun_py/rerun_sdk/rerun/components/half_size3d.py index d707906d5350..248032d9dc53 100644 --- a/rerun_py/rerun_sdk/rerun/components/half_sizes3d.py +++ b/rerun_py/rerun_sdk/rerun/components/half_size3d.py @@ -1,7 +1,7 @@ # DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/python/mod.rs -# Based on "crates/re_types/definitions/rerun/components/half_sizes3d.fbs". +# Based on "crates/re_types/definitions/rerun/components/half_size3d.fbs". -# You can extend this class by creating a "HalfSizes3DExt" class in "half_sizes3d_ext.py". +# You can extend this class by creating a "HalfSize3DExt" class in "half_size3d_ext.py". from __future__ import annotations @@ -11,10 +11,10 @@ ComponentMixin, ) -__all__ = ["HalfSizes3D", "HalfSizes3DBatch", "HalfSizes3DType"] +__all__ = ["HalfSize3D", "HalfSize3DBatch", "HalfSize3DType"] -class HalfSizes3D(datatypes.Vec3D, ComponentMixin): +class HalfSize3D(datatypes.Vec3D, ComponentMixin): """ **Component**: Half-size (radius) of a 3D box. @@ -25,19 +25,19 @@ class HalfSizes3D(datatypes.Vec3D, ComponentMixin): """ _BATCH_TYPE = None - # You can define your own __init__ function as a member of HalfSizes3DExt in half_sizes3d_ext.py + # You can define your own __init__ function as a member of HalfSize3DExt in half_size3d_ext.py - # Note: there are no fields here because HalfSizes3D delegates to datatypes.Vec3D + # Note: there are no fields here because HalfSize3D delegates to datatypes.Vec3D pass -class HalfSizes3DType(datatypes.Vec3DType): - _TYPE_NAME: str = "rerun.components.HalfSizes3D" +class HalfSize3DType(datatypes.Vec3DType): + _TYPE_NAME: str = "rerun.components.HalfSize3D" -class HalfSizes3DBatch(datatypes.Vec3DBatch, ComponentBatchMixin): - _ARROW_TYPE = HalfSizes3DType() +class HalfSize3DBatch(datatypes.Vec3DBatch, ComponentBatchMixin): + _ARROW_TYPE = HalfSize3DType() # This is patched in late to avoid circular dependencies. -HalfSizes3D._BATCH_TYPE = HalfSizes3DBatch # type: ignore[assignment] +HalfSize3D._BATCH_TYPE = HalfSize3DBatch # type: ignore[assignment] diff --git a/rerun_py/tests/unit/test_box2d.py b/rerun_py/tests/unit/test_box2d.py index 1c016ba33c0d..f9d60a6882f1 100644 --- a/rerun_py/tests/unit/test_box2d.py +++ b/rerun_py/tests/unit/test_box2d.py @@ -10,7 +10,7 @@ import torch from rerun.components import ( DrawOrderLike, - HalfSizes2DBatch, + HalfSize2DBatch, Position2DBatch, RadiusArrayLike, ) @@ -79,7 +79,7 @@ def test_boxes2d() -> None: ) print(f"{arch}\n") - assert arch.half_sizes == half_sizes_expected(half_sizes, HalfSizes2DBatch) + assert arch.half_sizes == half_sizes_expected(half_sizes, HalfSize2DBatch) assert arch.centers == centers_expected(centers, Position2DBatch) assert arch.colors == colors_expected(colors) assert arch.radii == radii_expected(radii) diff --git a/rerun_py/tests/unit/test_box3d.py b/rerun_py/tests/unit/test_box3d.py index 653de41dfc2b..a04fe0cebc8a 100644 --- a/rerun_py/tests/unit/test_box3d.py +++ b/rerun_py/tests/unit/test_box3d.py @@ -4,7 +4,7 @@ from typing import Optional, cast import rerun as rr -from rerun.components import HalfSizes3DBatch, Position3DBatch, RadiusArrayLike, Rotation3DBatch +from rerun.components import HalfSize3DBatch, Position3DBatch, RadiusArrayLike, Rotation3DBatch from rerun.datatypes import ClassIdArrayLike, Rgba32ArrayLike, Rotation3DArrayLike, Utf8ArrayLike from rerun.datatypes.vec3d import Vec3DArrayLike @@ -71,7 +71,7 @@ def test_boxes3d() -> None: ) print(f"{arch}\n") - assert arch.half_sizes == half_sizes_expected(half_sizes, HalfSizes3DBatch) + assert arch.half_sizes == half_sizes_expected(half_sizes, HalfSize3DBatch) assert arch.centers == centers_expected(centers, Position3DBatch) assert arch.rotations == expected_rotations(rotations, Rotation3DBatch) assert arch.colors == colors_expected(colors) diff --git a/tests/python/release_checklist/check_all_components_ui.py b/tests/python/release_checklist/check_all_components_ui.py index 202bbe22a07a..b4d6449ee9a7 100644 --- a/tests/python/release_checklist/check_all_components_ui.py +++ b/tests/python/release_checklist/check_all_components_ui.py @@ -106,8 +106,8 @@ def alternatives(self) -> list[Any] | None: "DrawOrderBatch": TestCase(100.0), "FillRatioBatch": TestCase(0.5), "GammaCorrectionBatch": TestCase(2.2), - "HalfSizes2DBatch": TestCase(batch=[(5.0, 10.0), (50, 30), (23, 45)]), - "HalfSizes3DBatch": TestCase(batch=[(5.0, 10.0, 20.0), (50, 30, 40), (23, 45, 67)]), + "HalfSize2DBatch": TestCase(batch=[(5.0, 10.0), (50, 30), (23, 45)]), + "HalfSize3DBatch": TestCase(batch=[(5.0, 10.0, 20.0), (50, 30, 40), (23, 45, 67)]), "ImagePlaneDistanceBatch": TestCase(batch=[100.0, 200.0, 300.0]), "KeypointIdBatch": TestCase(batch=[5, 6, 7]), "LineStrip2DBatch": TestCase(batch=[((0, 0), (1, 1), (2, 2)), ((3, 3), (4, 4), (5, 5)), ((6, 6), (7, 7), (8, 8))]), diff --git a/tests/rust/test_api/src/main.rs b/tests/rust/test_api/src/main.rs index 5d2007831a31..b5c7acfc895e 100644 --- a/tests/rust/test_api/src/main.rs +++ b/tests/rust/test_api/src/main.rs @@ -160,7 +160,7 @@ fn test_rects(rec: &RecordingStream) -> anyhow::Result<()> { use rerun::{ archetypes::{Boxes2D, Tensor}, - components::{Color, HalfSizes2D}, + components::{Color, HalfSize2D}, }; // Add an image @@ -194,7 +194,7 @@ fn test_rects(rec: &RecordingStream) -> anyhow::Result<()> { rec.log( "rects_test/rects", // TODO(#3381): Should be &Boxes2D::empty() - &Boxes2D::from_half_sizes(std::iter::empty::()), + &Boxes2D::from_half_sizes(std::iter::empty::()), )?; Ok(())