diff --git a/Cargo.lock b/Cargo.lock index de684947a684..c3767eabd3c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1777,7 +1777,7 @@ checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" [[package]] name = "ecolor" version = "0.28.1" -source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66" +source = "git+https://github.com/emilk/egui.git?rev=66076101e12eee01dec374285521b0bed4ecc40a#66076101e12eee01dec374285521b0bed4ecc40a" dependencies = [ "bytemuck", "emath", @@ -1787,7 +1787,7 @@ dependencies = [ [[package]] name = "eframe" version = "0.28.1" -source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66" +source = "git+https://github.com/emilk/egui.git?rev=66076101e12eee01dec374285521b0bed4ecc40a#66076101e12eee01dec374285521b0bed4ecc40a" dependencies = [ "ahash", "bytemuck", @@ -1824,7 +1824,7 @@ dependencies = [ [[package]] name = "egui" version = "0.28.1" -source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66" +source = "git+https://github.com/emilk/egui.git?rev=66076101e12eee01dec374285521b0bed4ecc40a#66076101e12eee01dec374285521b0bed4ecc40a" dependencies = [ "accesskit", "ahash", @@ -1841,7 +1841,7 @@ dependencies = [ [[package]] name = "egui-wgpu" version = "0.28.1" -source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66" +source = "git+https://github.com/emilk/egui.git?rev=66076101e12eee01dec374285521b0bed4ecc40a#66076101e12eee01dec374285521b0bed4ecc40a" dependencies = [ "ahash", "bytemuck", @@ -1860,7 +1860,7 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.28.1" -source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66" +source = "git+https://github.com/emilk/egui.git?rev=66076101e12eee01dec374285521b0bed4ecc40a#66076101e12eee01dec374285521b0bed4ecc40a" dependencies = [ "accesskit_winit", "ahash", @@ -1879,30 +1879,28 @@ dependencies = [ [[package]] name = "egui_commonmark" version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe88871b75bd43c52a2b44ce5b53160506e7976e239112c56728496d019cc60d" +source = "git+https://github.com/rerun-io/egui_commonmark?rev=7a9dc755bfa351a3796274cb8ca87129b051c084#7a9dc755bfa351a3796274cb8ca87129b051c084" dependencies = [ "egui", "egui_commonmark_backend", "egui_extras", - "pulldown-cmark 0.11.0", + "pulldown-cmark 0.12.1", ] [[package]] name = "egui_commonmark_backend" version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "148edd9546feba319b16d5a5e551cda46095031ec1e6665e5871eef9ee692967" +source = "git+https://github.com/rerun-io/egui_commonmark?rev=7a9dc755bfa351a3796274cb8ca87129b051c084#7a9dc755bfa351a3796274cb8ca87129b051c084" dependencies = [ "egui", "egui_extras", - "pulldown-cmark 0.11.0", + "pulldown-cmark 0.12.1", ] [[package]] name = "egui_extras" version = "0.28.1" -source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66" +source = "git+https://github.com/emilk/egui.git?rev=66076101e12eee01dec374285521b0bed4ecc40a#66076101e12eee01dec374285521b0bed4ecc40a" dependencies = [ "ahash", "egui", @@ -1918,13 +1916,13 @@ dependencies = [ [[package]] name = "egui_glow" version = "0.28.1" -source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66" +source = "git+https://github.com/emilk/egui.git?rev=66076101e12eee01dec374285521b0bed4ecc40a#66076101e12eee01dec374285521b0bed4ecc40a" dependencies = [ "ahash", "bytemuck", "egui", "egui-winit", - "glow", + "glow 0.14.0", "log", "memoffset 0.9.0", "puffin", @@ -1947,7 +1945,7 @@ dependencies = [ [[package]] name = "egui_table" version = "0.28.1" -source = "git+https://github.com/rerun-io/egui_table.git?rev=0f594701d528c4a9553521cb941de1886549dc70#0f594701d528c4a9553521cb941de1886549dc70" +source = "git+https://github.com/rerun-io/egui_table.git?rev=c76473b244f03a7c67fbbbff9def6fc86c1ca4ea#c76473b244f03a7c67fbbbff9def6fc86c1ca4ea" dependencies = [ "egui", "serde", @@ -1991,7 +1989,7 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "emath" version = "0.28.1" -source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66" +source = "git+https://github.com/emilk/egui.git?rev=66076101e12eee01dec374285521b0bed4ecc40a#66076101e12eee01dec374285521b0bed4ecc40a" dependencies = [ "bytemuck", "serde", @@ -2092,7 +2090,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.28.1" -source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66" +source = "git+https://github.com/emilk/egui.git?rev=66076101e12eee01dec374285521b0bed4ecc40a#66076101e12eee01dec374285521b0bed4ecc40a" dependencies = [ "ab_glyph", "ahash", @@ -2111,7 +2109,7 @@ dependencies = [ [[package]] name = "epaint_default_fonts" version = "0.28.1" -source = "git+https://github.com/emilk/egui.git?rev=6b7f4312373a301a4cdf7d99a0d546acd34bcd66#6b7f4312373a301a4cdf7d99a0d546acd34bcd66" +source = "git+https://github.com/emilk/egui.git?rev=66076101e12eee01dec374285521b0bed4ecc40a#66076101e12eee01dec374285521b0bed4ecc40a" [[package]] name = "equivalent" @@ -2550,6 +2548,18 @@ dependencies = [ "web-sys", ] +[[package]] +name = "glow" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f865cbd94bd355b89611211e49508da98a1fce0ad755c1e8448fb96711b24528" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "gltf" version = "1.4.1" @@ -4515,9 +4525,9 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8746739f11d39ce5ad5c2520a9b75285310dbfe78c541ccf832d38615765aec0" +checksum = "666f0f59e259aea2d72e6012290c09877a780935cc3c18b1ceded41f3890d59c" dependencies = [ "bitflags 2.6.0", "memchr", @@ -7984,7 +7994,7 @@ dependencies = [ "block", "cfg_aliases 0.1.1", "core-graphics-types", - "glow", + "glow 0.13.1", "glutin_wgl_sys", "gpu-alloc", "gpu-allocator", diff --git a/Cargo.toml b/Cargo.toml index 8c7411d4e004..66e2f4e619a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -514,12 +514,12 @@ missing_errors_doc = "allow" # As a last resport, patch with a commit to our own repository. # ALWAYS document what PR the commit hash is part of, or when it was merged into the upstream trunk. -ecolor = { git = "https://github.com/emilk/egui.git", rev = "6b7f4312373a301a4cdf7d99a0d546acd34bcd66" } # egui master 2024-09-06 -eframe = { git = "https://github.com/emilk/egui.git", rev = "6b7f4312373a301a4cdf7d99a0d546acd34bcd66" } # egui master 2024-09-06 -egui = { git = "https://github.com/emilk/egui.git", rev = "6b7f4312373a301a4cdf7d99a0d546acd34bcd66" } # egui master 2024-09-06 -egui_extras = { git = "https://github.com/emilk/egui.git", rev = "6b7f4312373a301a4cdf7d99a0d546acd34bcd66" } # egui master 2024-09-06 -egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "6b7f4312373a301a4cdf7d99a0d546acd34bcd66" } # egui master 2024-09-06 -emath = { git = "https://github.com/emilk/egui.git", rev = "6b7f4312373a301a4cdf7d99a0d546acd34bcd66" } # egui master 2024-09-06 +ecolor = { git = "https://github.com/emilk/egui.git", rev = "66076101e12eee01dec374285521b0bed4ecc40a" } # egui master 2024-09-06 +eframe = { git = "https://github.com/emilk/egui.git", rev = "66076101e12eee01dec374285521b0bed4ecc40a" } # egui master 2024-09-06 +egui = { git = "https://github.com/emilk/egui.git", rev = "66076101e12eee01dec374285521b0bed4ecc40a" } # egui master 2024-09-06 +egui_extras = { git = "https://github.com/emilk/egui.git", rev = "66076101e12eee01dec374285521b0bed4ecc40a" } # egui master 2024-09-06 +egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "66076101e12eee01dec374285521b0bed4ecc40a" } # egui master 2024-09-06 +emath = { git = "https://github.com/emilk/egui.git", rev = "66076101e12eee01dec374285521b0bed4ecc40a" } # egui master 2024-09-06 # Useful while developing: # ecolor = { path = "../../egui/crates/ecolor" } @@ -535,7 +535,7 @@ emath = { git = "https://github.com/emilk/egui.git", rev = "6b7f4312373a301a4cdf egui_tiles = { git = "https://github.com/rerun-io/egui_tiles", rev = "b2f5e232524deed983bcad01c05f27d0e8b89d98" } # https://github.com/rerun-io/egui_tiles/pull/78 2024-08-28 # egui_tiles = { path = "../egui_tiles" } -# egui_commonmark = { git = "https://github.com/rerun-io/egui_commonmark", rev = "63d5c8933445b9ea9088c4a50b71f4ede1f3c247" } # https://github.com/lampsitter/egui_commonmark/pull/51 +egui_commonmark = { git = "https://github.com/rerun-io/egui_commonmark", rev = "7a9dc755bfa351a3796274cb8ca87129b051c084" } # https://github.com/lampsitter/egui_commonmark/pull/65 # commit on `rerun-io/mp4` `main` branch # https://github.com/rerun-io/mp4/commit/ef529032547d7f97161e95c58bd76856cb116349 diff --git a/crates/build/re_types_builder/src/codegen/cpp/mod.rs b/crates/build/re_types_builder/src/codegen/cpp/mod.rs index 34afd7661d46..9159666cb90d 100644 --- a/crates/build/re_types_builder/src/codegen/cpp/mod.rs +++ b/crates/build/re_types_builder/src/codegen/cpp/mod.rs @@ -1505,7 +1505,13 @@ fn to_arrow_method( ( true, quote! { - return Loggable<#forwarded_type>::to_arrow(&instances->#field_name, num_instances); + if (num_instances == 0) { + return Loggable<#forwarded_type>::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error(ErrorCode::UnexpectedNullArgument, "Passed array instances is null when num_elements > 0."); + } else { + return Loggable<#forwarded_type>::to_arrow(&instances->#field_name, num_instances); + } }, ) } else { diff --git a/crates/store/re_types/definitions/rerun/archetypes/asset_video.fbs b/crates/store/re_types/definitions/rerun/archetypes/asset_video.fbs index 82ceaa816e5e..870078030b48 100644 --- a/crates/store/re_types/definitions/rerun/archetypes/asset_video.fbs +++ b/crates/store/re_types/definitions/rerun/archetypes/asset_video.fbs @@ -12,6 +12,7 @@ namespace rerun.archetypes; /// \example archetypes/video_manual_frames title="Demonstrates manual use of video frame references" image="https://static.rerun.io/video_manual_frames/320a44e1e06b8b3a3161ecbbeae3e04d1ccb9589/1200w.png" // TODO(#7420): update screenshot for manual frames example table AssetVideo ( + "attr.docs.unreleased", "attr.rerun.experimental" ) { // --- Required --- diff --git a/crates/store/re_types/definitions/rerun/archetypes/video_frame_reference.fbs b/crates/store/re_types/definitions/rerun/archetypes/video_frame_reference.fbs index ecb348d37e28..606386b946ec 100644 --- a/crates/store/re_types/definitions/rerun/archetypes/video_frame_reference.fbs +++ b/crates/store/re_types/definitions/rerun/archetypes/video_frame_reference.fbs @@ -9,6 +9,7 @@ namespace rerun.archetypes; /// \example archetypes/video_manual_frames title="Demonstrates manual use of video frame references" image="https://static.rerun.io/video_manual_frames/320a44e1e06b8b3a3161ecbbeae3e04d1ccb9589/1200w.png" // TODO(#7420): update screenshot for manual frames example table VideoFrameReference ( + "attr.docs.unreleased", "attr.rerun.experimental" ){ // --- Required --- diff --git a/crates/store/re_types/definitions/rerun/components/entity_path.fbs b/crates/store/re_types/definitions/rerun/components/entity_path.fbs index 3868835b0995..ed6b102d88c1 100644 --- a/crates/store/re_types/definitions/rerun/components/entity_path.fbs +++ b/crates/store/re_types/definitions/rerun/components/entity_path.fbs @@ -2,6 +2,7 @@ namespace rerun.components; /// A path to an entity, usually to reference some data that is part of the target entity. table EntityPath ( + "attr.docs.unreleased", "attr.arrow.transparent", "attr.python.aliases": "str", "attr.python.array_aliases": "str, Sequence[str]", diff --git a/crates/store/re_types/definitions/rerun/components/video_timestamp.fbs b/crates/store/re_types/definitions/rerun/components/video_timestamp.fbs index b17d4411daf9..3932061e05a8 100644 --- a/crates/store/re_types/definitions/rerun/components/video_timestamp.fbs +++ b/crates/store/re_types/definitions/rerun/components/video_timestamp.fbs @@ -3,6 +3,7 @@ namespace rerun.components; /// Timestamp inside a [archetypes.AssetVideo]. struct VideoTimestamp ( + "attr.docs.unreleased", "attr.rust.derive": "Copy, PartialEq, Eq, Default", "attr.rust.repr": "transparent", "attr.rerun.experimental" diff --git a/crates/store/re_types/definitions/rerun/datatypes/video_timestamp.fbs b/crates/store/re_types/definitions/rerun/datatypes/video_timestamp.fbs index 2c29b7d882d1..cf8b30d2add4 100644 --- a/crates/store/re_types/definitions/rerun/datatypes/video_timestamp.fbs +++ b/crates/store/re_types/definitions/rerun/datatypes/video_timestamp.fbs @@ -1,7 +1,9 @@ namespace rerun.datatypes; /// Specifies how to interpret the `video_time` field of a [datatypes.VideoTimestamp]. -enum VideoTimeMode: ubyte{ +enum VideoTimeMode: ubyte ( + "attr.docs.unreleased" +) { /// Invalid value. Won't show up in generated types. Invalid = 0, @@ -13,6 +15,7 @@ enum VideoTimeMode: ubyte{ /// Timestamp inside a [archetypes.AssetVideo]. struct VideoTimestamp ( + "attr.docs.unreleased", "attr.rust.derive": "Copy, PartialEq, Eq", "attr.rerun.experimental" ) { diff --git a/crates/store/re_types/src/components/media_type_ext.rs b/crates/store/re_types/src/components/media_type_ext.rs index d000b3b38f15..dc3173aa2ec7 100644 --- a/crates/store/re_types/src/components/media_type_ext.rs +++ b/crates/store/re_types/src/components/media_type_ext.rs @@ -223,6 +223,11 @@ impl MediaType { } } } + + /// Returns `true` if this is an image media type. + pub fn is_image(&self) -> bool { + self.as_str().starts_with("image/") + } } impl std::fmt::Display for MediaType { diff --git a/crates/viewer/re_component_ui/src/datatype_uis/enum_combobox.rs b/crates/viewer/re_component_ui/src/datatype_uis/enum_combobox.rs index 318079ab9d96..e0e634512ec7 100644 --- a/crates/viewer/re_component_ui/src/datatype_uis/enum_combobox.rs +++ b/crates/viewer/re_component_ui/src/datatype_uis/enum_combobox.rs @@ -40,10 +40,7 @@ fn edit_view_enum_impl( }); combobox_response.response = combobox_response.response.on_hover_ui(|ui| { - ui.markdown_ui( - ui.id().with(prev_selected_value), - prev_selected_value.docstring_md(), - ); + ui.markdown_ui(prev_selected_value.docstring_md()); }); response_with_changes_of_inner(combobox_response) @@ -59,6 +56,6 @@ fn variant_ui( ) -> egui::Response { ui.selectable_value(current_value, variant, variant.to_string()) .on_hover_ui(|ui| { - ui.markdown_ui(ui.id().with(variant), variant.docstring_md()); + ui.markdown_ui(variant.docstring_md()); }) } diff --git a/crates/viewer/re_data_ui/src/component_name.rs b/crates/viewer/re_data_ui/src/component_name.rs index 4bd735cc4330..7e771facb081 100644 --- a/crates/viewer/re_data_ui/src/component_name.rs +++ b/crates/viewer/re_data_ui/src/component_name.rs @@ -31,9 +31,9 @@ impl DataUi for ComponentName { .map(|info| info.docstring_md) { if ui_layout.is_selection_panel() { - ui.markdown_ui(egui::Id::new((self, "full")), markdown); + ui.markdown_ui(markdown); } else if let Some(first_line) = markdown.lines().next() { - ui.markdown_ui(egui::Id::new((self, "first_line")), first_line); + ui.markdown_ui(first_line); } } diff --git a/crates/viewer/re_space_view/src/view_property_ui.rs b/crates/viewer/re_space_view/src/view_property_ui.rs index 89ee31df2e59..1d976fda61d6 100644 --- a/crates/viewer/re_space_view/src/view_property_ui.rs +++ b/crates/viewer/re_space_view/src/view_property_ui.rs @@ -72,7 +72,6 @@ fn view_property_ui_impl( ui, field.component_name, reflection.display_name, - name, field, &blueprint_path, component_results.component_row_id(&field.component_name), @@ -90,7 +89,6 @@ fn view_property_ui_impl( ui, field.component_name, display_name, - name, field, &blueprint_path, component_results.component_row_id(&field.component_name), @@ -119,7 +117,6 @@ fn view_property_component_ui( ui: &mut egui::Ui, component_name: ComponentName, root_item_display_name: &str, - archetype_name: ArchetypeName, field: &ArchetypeFieldReflection, blueprint_path: &re_log_types::EntityPath, row_id: Option, @@ -173,8 +170,7 @@ fn view_property_component_ui( }; list_item_response.on_hover_ui(|ui| { - let id = egui::Id::new((archetype_name, field.display_name)); - ui.markdown_ui(id, field.docstring_md); + ui.markdown_ui(field.docstring_md); }); } diff --git a/crates/viewer/re_space_view_dataframe/Cargo.toml b/crates/viewer/re_space_view_dataframe/Cargo.toml index a92540e3bb41..9394d9ebcaa7 100644 --- a/crates/viewer/re_space_view_dataframe/Cargo.toml +++ b/crates/viewer/re_space_view_dataframe/Cargo.toml @@ -36,7 +36,7 @@ re_viewport_blueprint.workspace = true anyhow.workspace = true egui_extras.workspace = true -egui_table = { git = "https://github.com/rerun-io/egui_table.git", rev = "0f594701d528c4a9553521cb941de1886549dc70" } # main as of 2024-09-09 +egui_table = { git = "https://github.com/rerun-io/egui_table.git", rev = "c76473b244f03a7c67fbbbff9def6fc86c1ca4ea" } # main as of 2024-09-13 egui.workspace = true itertools.workspace = true thiserror.workspace = true diff --git a/crates/viewer/re_space_view_dataframe/src/dataframe_ui.rs b/crates/viewer/re_space_view_dataframe/src/dataframe_ui.rs index 0ded69c81d30..245fd91cbd27 100644 --- a/crates/viewer/re_space_view_dataframe/src/dataframe_ui.rs +++ b/crates/viewer/re_space_view_dataframe/src/dataframe_ui.rs @@ -173,6 +173,10 @@ impl DataframeTableDelegate<'_> { } impl<'a> egui_table::TableDelegate for DataframeTableDelegate<'a> { + fn default_row_height(&self) -> f32 { + re_ui::DesignTokens::table_line_height() + } + fn prepare(&mut self, info: &egui_table::PrefetchInfo) { re_tracing::profile_function!(); @@ -337,7 +341,6 @@ fn dataframe_ui_impl(ctx: &ViewerContext<'_>, ui: &mut egui::Ui, query_handle: & egui_table::HeaderRow::new(re_ui::DesignTokens::table_header_height()), ]) .num_rows(num_rows) - .row_height(re_ui::DesignTokens::table_line_height()) .show(ui, &mut table_delegate); }); } diff --git a/crates/viewer/re_space_view_spatial/src/view_3d.rs b/crates/viewer/re_space_view_spatial/src/view_3d.rs index 699b81714367..3262effa2760 100644 --- a/crates/viewer/re_space_view_spatial/src/view_3d.rs +++ b/crates/viewer/re_space_view_spatial/src/view_3d.rs @@ -388,10 +388,7 @@ impl SpaceViewClass for SpatialSpaceView3D { "Scene up is unspecified".to_owned() }; ui.label(up_description).on_hover_ui(|ui| { - ui.markdown_ui( - egui::Id::new("view_coordinates_tooltip"), - "Set with `rerun.ViewCoordinates`.", - ); + ui.markdown_ui("Set with `rerun.ViewCoordinates`."); }); if let Some(eye) = &state.state_3d.view_eye { diff --git a/crates/viewer/re_space_view_spatial/src/visualizers/encoded_image.rs b/crates/viewer/re_space_view_spatial/src/visualizers/encoded_image.rs index 8fd9ca18028c..7ed8349be4a5 100644 --- a/crates/viewer/re_space_view_spatial/src/visualizers/encoded_image.rs +++ b/crates/viewer/re_space_view_spatial/src/visualizers/encoded_image.rs @@ -1,6 +1,6 @@ use itertools::Itertools as _; -use re_space_view::HybridResults; +use re_space_view::{diff_component_filter, HybridResults}; use re_types::{ archetypes::EncodedImage, components::{Blob, DrawOrder, MediaType, Opacity}, @@ -10,7 +10,7 @@ use re_viewer_context::{ ApplicableEntities, IdentifiedViewSystem, ImageDecodeCache, QueryContext, SpaceViewSystemExecutionError, TypedComponentFallbackProvider, ViewContext, ViewContextCollection, ViewQuery, VisualizableEntities, VisualizableFilterContext, - VisualizerQueryInfo, VisualizerSystem, + VisualizerAdditionalApplicabilityFilter, VisualizerQueryInfo, VisualizerSystem, }; use crate::{ @@ -42,11 +42,32 @@ impl IdentifiedViewSystem for EncodedImageVisualizer { } } +struct ImageMediaTypeFilter; + +impl VisualizerAdditionalApplicabilityFilter for ImageMediaTypeFilter { + /// Marks entities only as applicable for `EncodedImage` if they have an image media type. + /// + /// Otherwise the image encoder might be suggested for other blobs like video. + fn update_applicability(&mut self, event: &re_chunk_store::ChunkStoreEvent) -> bool { + diff_component_filter(event, |media_type: &re_types::components::MediaType| { + media_type.is_image() + }) || diff_component_filter(event, |image: &re_types::components::Blob| { + MediaType::guess_from_data(&image.0).map_or(false, |media| media.is_image()) + }) + } +} + impl VisualizerSystem for EncodedImageVisualizer { fn visualizer_query_info(&self) -> VisualizerQueryInfo { VisualizerQueryInfo::from_archetype::() } + fn applicability_filter( + &self, + ) -> Option> { + Some(Box::new(ImageMediaTypeFilter)) + } + fn filter_visualizable_entities( &self, entities: ApplicableEntities, diff --git a/crates/viewer/re_space_view_text_document/src/space_view_class.rs b/crates/viewer/re_space_view_text_document/src/space_view_class.rs index f72e1fe03261..082925329ce9 100644 --- a/crates/viewer/re_space_view_text_document/src/space_view_class.rs +++ b/crates/viewer/re_space_view_text_document/src/space_view_class.rs @@ -157,7 +157,7 @@ Displays text from a text component, as raw text or markdown." .or_insert(egui::FontId::proportional(32.0)) .size = 24.0; - egui_commonmark::CommonMarkViewer::new("markdown_viewer") + egui_commonmark::CommonMarkViewer::new() .max_image_width(Some(ui.available_width().floor() as _)) .show(ui, &mut state.commonmark_cache, body); return; diff --git a/crates/viewer/re_time_panel/benches/bench_density_graph.rs b/crates/viewer/re_time_panel/benches/bench_density_graph.rs index a80c5da91ec0..017689dafef7 100644 --- a/crates/viewer/re_time_panel/benches/bench_density_graph.rs +++ b/crates/viewer/re_time_panel/benches/bench_density_graph.rs @@ -18,49 +18,51 @@ use re_time_panel::__bench::{ }; fn run(b: &mut Bencher<'_, WallTime>, config: DensityGraphBuilderConfig, entry: ChunkEntry) { - egui::__run_test_ui(|ui| { - let row_rect = ui.max_rect(); - assert!(row_rect.width() > 100.0 && row_rect.height() > 100.0); - - let mut db = EntityDb::with_store_config( - StoreId::from_string(StoreKind::Recording, "test".into()), - ChunkStoreConfig::COMPACTION_DISABLED, - ); - let entity_path = re_log_types::EntityPath::parse_strict("/data").unwrap(); - let timeline = re_log_types::Timeline::log_time(); - - add_data( - &mut db, - &entity_path, - entry.num_chunks, - entry.num_rows_per_chunk, - entry.sorted, - entry.time_start_ms, - timeline, - ) - .unwrap(); - - let item = TimePanelItem { - entity_path, - component_name: None, - }; - - let time_range = db - .time_range_for(&timeline) - .unwrap_or(ResolvedTimeRange::EMPTY); - let time_ranges_ui = - TimeRangesUi::new(row_rect.x_range(), time_range.into(), &[time_range]); - - b.iter(|| { - black_box(build_density_graph( - ui, - &time_ranges_ui, - row_rect, - &db, - &item, + egui::__run_test_ctx(|ctx| { + egui::CentralPanel::default().show(ctx, |ui| { + let row_rect = ui.max_rect(); + assert!(row_rect.width() > 100.0 && row_rect.height() > 100.0); + + let mut db = EntityDb::with_store_config( + StoreId::from_string(StoreKind::Recording, "test".into()), + ChunkStoreConfig::COMPACTION_DISABLED, + ); + let entity_path = re_log_types::EntityPath::parse_strict("/data").unwrap(); + let timeline = re_log_types::Timeline::log_time(); + + add_data( + &mut db, + &entity_path, + entry.num_chunks, + entry.num_rows_per_chunk, + entry.sorted, + entry.time_start_ms, timeline, - config, - )); + ) + .unwrap(); + + let item = TimePanelItem { + entity_path, + component_name: None, + }; + + let time_range = db + .time_range_for(&timeline) + .unwrap_or(ResolvedTimeRange::EMPTY); + let time_ranges_ui = + TimeRangesUi::new(row_rect.x_range(), time_range.into(), &[time_range]); + + b.iter(|| { + black_box(build_density_graph( + ui, + &time_ranges_ui, + row_rect, + &db, + &item, + timeline, + config, + )); + }); }); }); } diff --git a/crates/viewer/re_time_panel/src/time_control_ui.rs b/crates/viewer/re_time_panel/src/time_control_ui.rs index 69525e5664d5..3729c62852ef 100644 --- a/crates/viewer/re_time_panel/src/time_control_ui.rs +++ b/crates/viewer/re_time_panel/src/time_control_ui.rs @@ -44,7 +44,6 @@ impl TimeControlUi { .on_hover_ui(|ui| { list_item::list_item_scope(ui, "tooltip", |ui| { ui.markdown_ui( - egui::Id::new("timeline_selector_tooltip"), r" Select timeline. diff --git a/crates/viewer/re_ui/src/lib.rs b/crates/viewer/re_ui/src/lib.rs index 53ef07b727d3..efb27a0a1c59 100644 --- a/crates/viewer/re_ui/src/lib.rs +++ b/crates/viewer/re_ui/src/lib.rs @@ -91,7 +91,7 @@ pub fn apply_style_and_install_loaders(egui_ctx: &egui::Context) { ); egui_ctx.options_mut(|o| { - o.follow_system_theme = false; + o.theme_preference = egui::ThemePreference::Dark; o.fallback_theme = egui::Theme::Dark; }); diff --git a/crates/viewer/re_ui/src/section_collapsing_header.rs b/crates/viewer/re_ui/src/section_collapsing_header.rs index 9f59c2342e83..8c23857da8f4 100644 --- a/crates/viewer/re_ui/src/section_collapsing_header.rs +++ b/crates/viewer/re_ui/src/section_collapsing_header.rs @@ -56,7 +56,7 @@ impl<'a> SectionCollapsingHeader<'a> { #[inline] pub fn help_markdown(mut self, help: &'a str) -> Self { self.help = Some(Box::new(move |ui| { - ui.markdown_ui(egui::Id::new(help), help); + ui.markdown_ui(help); })); self } diff --git a/crates/viewer/re_ui/src/ui_ext.rs b/crates/viewer/re_ui/src/ui_ext.rs index 31707859ce19..00de8eacd1a2 100644 --- a/crates/viewer/re_ui/src/ui_ext.rs +++ b/crates/viewer/re_ui/src/ui_ext.rs @@ -934,7 +934,7 @@ pub trait UiExt { } /// Show some markdown - fn markdown_ui(&mut self, id: egui::Id, markdown: &str) { + fn markdown_ui(&mut self, markdown: &str) { use parking_lot::Mutex; use std::sync::Arc; @@ -946,7 +946,7 @@ pub trait UiExt { .clone() }); - egui_commonmark::CommonMarkViewer::new(id).show(ui, &mut commonmark_cache.lock(), markdown); + egui_commonmark::CommonMarkViewer::new().show(ui, &mut commonmark_cache.lock(), markdown); } /// A drop-down menu with a list of options. diff --git a/crates/viewer/re_viewer/src/app.rs b/crates/viewer/re_viewer/src/app.rs index 7cd35e91dd5b..fae36b6cf3d9 100644 --- a/crates/viewer/re_viewer/src/app.rs +++ b/crates/viewer/re_viewer/src/app.rs @@ -897,6 +897,14 @@ impl App { .frame(DesignTokens::top_panel_frame()) .show_animated_inside(ui, self.egui_debug_panel_open, |ui| { egui::ScrollArea::vertical().show(ui, |ui| { + if ui + .button("request_discard") + .on_hover_text("Request a second layout pass. Just for testing.") + .clicked() + { + ui.ctx().request_discard(); + } + egui::CollapsingHeader::new("egui settings") .default_open(false) .show(ui, |ui| { diff --git a/crates/viewer/re_viewer/src/app_state.rs b/crates/viewer/re_viewer/src/app_state.rs index 4028996d82a0..0e95e539b6f1 100644 --- a/crates/viewer/re_viewer/src/app_state.rs +++ b/crates/viewer/re_viewer/src/app_state.rs @@ -272,6 +272,10 @@ impl AppState { focused_item, }; + // We move the time at the very start of the frame, + // so that we always show the latest data when we're in "follow" mode. + move_time(&ctx, recording, rx); + // Update the viewport. May spawn new views and handle queued requests (like screenshots). viewport.on_frame_start(&ctx); @@ -466,41 +470,6 @@ impl AppState { // Process deferred layout operations and apply updates back to blueprint viewport.update_and_sync_tile_tree_to_blueprint(&ctx); - { - // We move the time at the very end of the frame, - // so we have one frame to see the first data before we move the time. - let dt = ui.ctx().input(|i| i.stable_dt); - - // Are we still connected to the data source for the current store? - let more_data_is_coming = if let Some(store_source) = &recording.data_source { - rx.sources().iter().any(|s| s.as_ref() == store_source) - } else { - false - }; - - let recording_needs_repaint = ctx.rec_cfg.time_ctrl.write().update( - recording.times_per_timeline(), - dt, - more_data_is_coming, - ); - - let blueprint_needs_repaint = if ctx.app_options.inspect_blueprint_timeline { - ctx.blueprint_cfg.time_ctrl.write().update( - ctx.store_context.blueprint.times_per_timeline(), - dt, - more_data_is_coming, - ) - } else { - re_viewer_context::NeedsRepaint::No - }; - - if recording_needs_repaint == re_viewer_context::NeedsRepaint::Yes - || blueprint_needs_repaint == re_viewer_context::NeedsRepaint::Yes - { - ui.ctx().request_repaint(); - } - } - if WATERMARK { ui.ctx().paint_watermark(); } @@ -537,6 +506,39 @@ impl AppState { } } +fn move_time(ctx: &ViewerContext<'_>, recording: &EntityDb, rx: &ReceiveSet) { + let dt = ctx.egui_ctx.input(|i| i.stable_dt); + + // Are we still connected to the data source for the current store? + let more_data_is_coming = if let Some(store_source) = &recording.data_source { + rx.sources().iter().any(|s| s.as_ref() == store_source) + } else { + false + }; + + let recording_needs_repaint = ctx.rec_cfg.time_ctrl.write().update( + recording.times_per_timeline(), + dt, + more_data_is_coming, + ); + + let blueprint_needs_repaint = if ctx.app_options.inspect_blueprint_timeline { + ctx.blueprint_cfg.time_ctrl.write().update( + ctx.store_context.blueprint.times_per_timeline(), + dt, + more_data_is_coming, + ) + } else { + re_viewer_context::NeedsRepaint::No + }; + + if recording_needs_repaint == re_viewer_context::NeedsRepaint::Yes + || blueprint_needs_repaint == re_viewer_context::NeedsRepaint::Yes + { + ctx.egui_ctx.request_repaint(); + } +} + fn recording_config_entry<'cfgs>( configs: &'cfgs mut HashMap, id: StoreId, diff --git a/crates/viewer/re_viewer/src/reflection/mod.rs b/crates/viewer/re_viewer/src/reflection/mod.rs index 666d9d36560a..9680d58f73f2 100644 --- a/crates/viewer/re_viewer/src/reflection/mod.rs +++ b/crates/viewer/re_viewer/src/reflection/mod.rs @@ -667,7 +667,7 @@ fn generate_component_reflection() -> Result::name(), ComponentReflection { - docstring_md: "Timestamp inside a [`archetypes.AssetVideo`](https://rerun.io/docs/reference/types/archetypes/asset_video).\n\nāš \u{fe0f} **This type is experimental and may be removed in future versions**", + docstring_md: "Timestamp inside a [`archetypes.AssetVideo`](https://rerun.io/docs/reference/types/archetypes/asset_video?speculative-link).\n\nāš \u{fe0f} **This type is experimental and may be removed in future versions**", placeholder: Some(VideoTimestamp::default().to_arrow()?), }, ), @@ -1456,7 +1456,7 @@ fn generate_archetype_reflection() -> ArchetypeReflectionMap { is_required : true, }, ArchetypeFieldReflection { component_name : "rerun.components.EntityPath".into(), display_name : "Video reference", docstring_md : - "Optional reference to an entity with a [`archetypes.AssetVideo`](https://rerun.io/docs/reference/types/archetypes/asset_video).\n\nIf none is specified, the video is assumed to be at the same entity.\nNote that blueprint overrides on the referenced video will be ignored regardless,\nas this is always interpreted as a reference to the data store.\n\nFor a series of video frame references, it is recommended to specify this path only once\nat the beginning of the series and then rely on latest-at query semantics to\nkeep the video reference active.\n\nāš \u{fe0f} **This type is experimental and may be removed in future versions**", + "Optional reference to an entity with a [`archetypes.AssetVideo`](https://rerun.io/docs/reference/types/archetypes/asset_video?speculative-link).\n\nIf none is specified, the video is assumed to be at the same entity.\nNote that blueprint overrides on the referenced video will be ignored regardless,\nas this is always interpreted as a reference to the data store.\n\nFor a series of video frame references, it is recommended to specify this path only once\nat the beginning of the series and then rely on latest-at query semantics to\nkeep the video reference active.\n\nāš \u{fe0f} **This type is experimental and may be removed in future versions**", is_required : false, }, ], }, diff --git a/crates/viewer/re_viewer_context/src/space_view/space_view_class_placeholder.rs b/crates/viewer/re_viewer_context/src/space_view/space_view_class_placeholder.rs index efc9671be03a..3aa10c059ac7 100644 --- a/crates/viewer/re_viewer_context/src/space_view/space_view_class_placeholder.rs +++ b/crates/viewer/re_viewer_context/src/space_view/space_view_class_placeholder.rs @@ -54,10 +54,7 @@ impl SpaceViewClass for SpaceViewClassPlaceholder { _query: &ViewQuery<'_>, _system_output: SystemExecutionOutput, ) -> Result<(), SpaceViewSystemExecutionError> { - ui.markdown_ui( - egui::Id::new(self.display_name()), - &self.help_markdown(ctx.egui_ctx), - ); + ui.markdown_ui(&self.help_markdown(ctx.egui_ctx)); Ok(()) } diff --git a/crates/viewer/re_viewer_context/src/test_context.rs b/crates/viewer/re_viewer_context/src/test_context.rs index e87a4ee04041..5c982a97104d 100644 --- a/crates/viewer/re_viewer_context/src/test_context.rs +++ b/crates/viewer/re_viewer_context/src/test_context.rs @@ -51,48 +51,50 @@ impl TestContext { } pub fn run(&self, mut func: impl FnMut(&ViewerContext<'_>, &mut egui::Ui)) { - egui::__run_test_ui(|ui| { - re_ui::apply_style_and_install_loaders(ui.ctx()); - let blueprint_query = LatestAtQuery::latest(self.active_timeline); - let (command_sender, _) = command_channel(); - let component_ui_registry = ComponentUiRegistry::new(Box::new( - |_ctx, _ui, _ui_layout, _query, _db, _entity_path, _row_id, _component| {}, - )); + egui::__run_test_ctx(|ctx| { + egui::CentralPanel::default().show(ctx, |ui| { + re_ui::apply_style_and_install_loaders(ui.ctx()); + let blueprint_query = LatestAtQuery::latest(self.active_timeline); + let (command_sender, _) = command_channel(); + let component_ui_registry = ComponentUiRegistry::new(Box::new( + |_ctx, _ui, _ui_layout, _query, _db, _entity_path, _row_id, _component| {}, + )); - let store_context = StoreContext { - app_id: "rerun_test".into(), - blueprint: &self.blueprint_store, - default_blueprint: None, - recording: &self.recording_store, - bundle: &Default::default(), - hub: &Default::default(), - }; + let store_context = StoreContext { + app_id: "rerun_test".into(), + blueprint: &self.blueprint_store, + default_blueprint: None, + recording: &self.recording_store, + bundle: &Default::default(), + hub: &Default::default(), + }; - let rec_cfg = RecordingConfig::default(); - rec_cfg.time_ctrl.write().set_timeline(self.active_timeline); + let rec_cfg = RecordingConfig::default(); + rec_cfg.time_ctrl.write().set_timeline(self.active_timeline); - let egui_context = ui.ctx().clone(); - let ctx = ViewerContext { - app_options: &Default::default(), - cache: &Default::default(), - reflection: &Default::default(), - component_ui_registry: &component_ui_registry, - space_view_class_registry: &self.space_view_class_registry, - store_context: &store_context, - applicable_entities_per_visualizer: &Default::default(), - indicated_entities_per_visualizer: &Default::default(), - query_results: &Default::default(), - rec_cfg: &rec_cfg, - blueprint_cfg: &Default::default(), - selection_state: &self.selection_state, - blueprint_query: &blueprint_query, - egui_ctx: &egui_context, - render_ctx: None, - command_sender: &command_sender, - focused_item: &None, - }; + let egui_context = ui.ctx().clone(); + let ctx = ViewerContext { + app_options: &Default::default(), + cache: &Default::default(), + reflection: &Default::default(), + component_ui_registry: &component_ui_registry, + space_view_class_registry: &self.space_view_class_registry, + store_context: &store_context, + applicable_entities_per_visualizer: &Default::default(), + indicated_entities_per_visualizer: &Default::default(), + query_results: &Default::default(), + rec_cfg: &rec_cfg, + blueprint_cfg: &Default::default(), + selection_state: &self.selection_state, + blueprint_query: &blueprint_query, + egui_ctx: &egui_context, + render_ctx: None, + command_sender: &command_sender, + focused_item: &None, + }; - func(&ctx, ui); + func(&ctx, ui); + }); }); } } diff --git a/crates/viewer/re_viewport/src/viewport.rs b/crates/viewer/re_viewport/src/viewport.rs index 1c92b78d3bf5..9df0370492af 100644 --- a/crates/viewer/re_viewport/src/viewport.rs +++ b/crates/viewer/re_viewport/src/viewport.rs @@ -100,7 +100,7 @@ impl<'a> Viewport<'a> { let Viewport { blueprint, .. } = self; let is_zero_sized_viewport = ui.available_size().min_elem() <= 0.0; - if is_zero_sized_viewport { + if is_zero_sized_viewport || !ui.is_visible() { return; } @@ -488,7 +488,7 @@ impl<'a, 'b> egui_tiles::Behavior for TabViewer<'a, 'b> { }; let is_zero_sized_viewport = ui.available_size().min_elem() <= 0.0; - if is_zero_sized_viewport { + if is_zero_sized_viewport || !ui.is_visible() { return Default::default(); } @@ -499,8 +499,7 @@ impl<'a, 'b> egui_tiles::Behavior for TabViewer<'a, 'b> { return Default::default(); }; - let (query, system_output) = - self.executed_systems_per_space_view.remove(view_id).unwrap_or_else(|| { + let (query, system_output) = self.executed_systems_per_space_view.remove(view_id).unwrap_or_else(|| { // The space view's systems haven't been executed. // This may indicate that the egui_tiles tree is not in sync // with the blueprint tree. @@ -509,34 +508,34 @@ impl<'a, 'b> egui_tiles::Behavior for TabViewer<'a, 'b> { if cfg!(debug_assertions) { re_log::warn_once!( - "Visualizers for space view {:?} haven't been executed prior to display. This should never happen, please report a bug.", - space_view_blueprint.display_name_or_default() - ); + "Visualizers for space view {:?} haven't been executed prior to display. This should never happen, please report a bug.", + space_view_blueprint.display_name_or_default() + ); } - { - let ctx: &'a ViewerContext<'_> = self.ctx; - let view = space_view_blueprint; - re_tracing::profile_function!(view.class_identifier().as_str()); - let query_result = ctx.lookup_query_result(view.id); + let ctx: &'a ViewerContext<'_> = self.ctx; + let view = space_view_blueprint; + re_tracing::profile_scope!("late-system-execute", view.class_identifier().as_str()); - let mut per_visualizer_data_results = re_viewer_context::PerSystemDataResults::default(); - { - re_tracing::profile_scope!("per_system_data_results"); - - query_result.tree.visit(&mut |node| { - for system in &node.data_result.visualizers { - per_visualizer_data_results - .entry(*system) - .or_default() - .push(&node.data_result); - } - true - }); - } + let query_result = ctx.lookup_query_result(view.id); + + let mut per_visualizer_data_results = re_viewer_context::PerSystemDataResults::default(); - execute_systems_for_space_view(ctx, view, latest_at, self.view_states) + { + re_tracing::profile_scope!("per_system_data_results"); + + query_result.tree.visit(&mut |node| { + for system in &node.data_result.visualizers { + per_visualizer_data_results + .entry(*system) + .or_default() + .push(&node.data_result); + } + true + }); } + + execute_systems_for_space_view(ctx, view, latest_at, self.view_states) }); let class = space_view_blueprint.class(self.ctx.space_view_class_registry); @@ -659,7 +658,7 @@ impl<'a, 'b> egui_tiles::Behavior for TabViewer<'a, 'b> { &mut self, tiles: &egui_tiles::Tiles, ui: &mut egui::Ui, - tile_id: egui_tiles::TileId, + _tile_id: egui_tiles::TileId, tabs: &egui_tiles::Tabs, _scroll_offset: &mut f32, ) { @@ -703,7 +702,7 @@ impl<'a, 'b> egui_tiles::Behavior for TabViewer<'a, 'b> { .class(self.ctx.space_view_class_registry) .help_markdown(self.ctx.egui_ctx); ui.help_hover_button().on_hover_ui(|ui| { - ui.markdown_ui(ui.id().with(tile_id), &help_markdown); + ui.markdown_ui(&help_markdown); }); } diff --git a/deny.toml b/deny.toml index 31505b137cd2..d99c623c3e5d 100644 --- a/deny.toml +++ b/deny.toml @@ -29,7 +29,7 @@ all-features = true [advisories] version = 2 ignore = [ - "RUSTSEC-2023-0081", # TODO(#5998): unmaintained crate "safemem" pulled in by "cargo-run-wasm" + "RUSTSEC-2023-0086", # TODO(#3741): Waiting for https://github.com/apache/arrow-rs/pull/6401 ] diff --git a/docs/content/reference/types/archetypes/asset_video.md b/docs/content/reference/types/archetypes/asset_video.md index ab885a1f30c0..1ea3ac4780dc 100644 --- a/docs/content/reference/types/archetypes/asset_video.md +++ b/docs/content/reference/types/archetypes/asset_video.md @@ -12,7 +12,7 @@ NOTE: Videos can only be viewed in the Rerun web viewer. Only MP4 containers with a limited number of codecs are currently supported, and not in all browsers. Follow for updates on the native support. -In order to display a video, you need to log a [`archetypes.VideoFrameReference`](https://rerun.io/docs/reference/types/archetypes/video_frame_reference) for each frame. +In order to display a video, you need to log a [`archetypes.VideoFrameReference`](https://rerun.io/docs/reference/types/archetypes/video_frame_reference?speculative-link) for each frame. ## Components @@ -21,9 +21,9 @@ In order to display a video, you need to log a [`archetypes.VideoFrameReference` **Recommended**: [`MediaType`](../components/media_type.md) ## API reference links - * šŸŒŠ [C++ API docs for `AssetVideo`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1archetypes_1_1AssetVideo.html) - * šŸ [Python API docs for `AssetVideo`](https://ref.rerun.io/docs/python/stable/common/archetypes#rerun.archetypes.AssetVideo) - * šŸ¦€ [Rust API docs for `AssetVideo`](https://docs.rs/rerun/latest/rerun/archetypes/struct.AssetVideo.html) + * šŸŒŠ [C++ API docs for `AssetVideo`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1archetypes_1_1AssetVideo.html?speculative-link) + * šŸ [Python API docs for `AssetVideo`](https://ref.rerun.io/docs/python/stable/common/archetypes?speculative-link#rerun.archetypes.AssetVideo) + * šŸ¦€ [Rust API docs for `AssetVideo`](https://docs.rs/rerun/latest/rerun/archetypes/struct.AssetVideo.html?speculative-link) ## Examples diff --git a/docs/content/reference/types/archetypes/video_frame_reference.md b/docs/content/reference/types/archetypes/video_frame_reference.md index 05863b929207..535ba5019308 100644 --- a/docs/content/reference/types/archetypes/video_frame_reference.md +++ b/docs/content/reference/types/archetypes/video_frame_reference.md @@ -8,7 +8,7 @@ title: "VideoFrameReference" References a single video frame. -Used to display individual video frames from a [`archetypes.AssetVideo`](https://rerun.io/docs/reference/types/archetypes/asset_video). +Used to display individual video frames from a [`archetypes.AssetVideo`](https://rerun.io/docs/reference/types/archetypes/asset_video?speculative-link). To show an entire video, a fideo frame reference for each frame of the video should be logged. ## Components @@ -18,9 +18,9 @@ To show an entire video, a fideo frame reference for each frame of the video sho **Optional**: [`EntityPath`](../components/entity_path.md) ## API reference links - * šŸŒŠ [C++ API docs for `VideoFrameReference`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1archetypes_1_1VideoFrameReference.html) - * šŸ [Python API docs for `VideoFrameReference`](https://ref.rerun.io/docs/python/stable/common/archetypes#rerun.archetypes.VideoFrameReference) - * šŸ¦€ [Rust API docs for `VideoFrameReference`](https://docs.rs/rerun/latest/rerun/archetypes/struct.VideoFrameReference.html) + * šŸŒŠ [C++ API docs for `VideoFrameReference`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1archetypes_1_1VideoFrameReference.html?speculative-link) + * šŸ [Python API docs for `VideoFrameReference`](https://ref.rerun.io/docs/python/stable/common/archetypes?speculative-link#rerun.archetypes.VideoFrameReference) + * šŸ¦€ [Rust API docs for `VideoFrameReference`](https://docs.rs/rerun/latest/rerun/archetypes/struct.VideoFrameReference.html?speculative-link) ## Examples diff --git a/docs/content/reference/types/components.md b/docs/content/reference/types/components.md index 1139ef975b74..772ccf32b4bc 100644 --- a/docs/content/reference/types/components.md +++ b/docs/content/reference/types/components.md @@ -73,6 +73,6 @@ on [Entities and Components](../../concepts/entity-component.md). * [`TriangleIndices`](components/triangle_indices.md): The three indices of a triangle in a triangle mesh. * [`Vector2D`](components/vector2d.md): A vector in 2D space. * [`Vector3D`](components/vector3d.md): A vector in 3D space. -* [`VideoTimestamp`](components/video_timestamp.md): Timestamp inside a [`archetypes.AssetVideo`](https://rerun.io/docs/reference/types/archetypes/asset_video). +* [`VideoTimestamp`](components/video_timestamp.md): Timestamp inside a [`archetypes.AssetVideo`](https://rerun.io/docs/reference/types/archetypes/asset_video?speculative-link). * [`ViewCoordinates`](components/view_coordinates.md): How we interpret the coordinate system of an entity/space. diff --git a/docs/content/reference/types/components/blob.md b/docs/content/reference/types/components/blob.md index 03472aafaa5f..9930a1787115 100644 --- a/docs/content/reference/types/components/blob.md +++ b/docs/content/reference/types/components/blob.md @@ -18,5 +18,5 @@ A binary blob of data. ## Used by * [`Asset3D`](../archetypes/asset3d.md) -* [`AssetVideo`](../archetypes/asset_video.md) +* [`AssetVideo`](../archetypes/asset_video.md?speculative-link) * [`EncodedImage`](../archetypes/encoded_image.md) diff --git a/docs/content/reference/types/components/entity_path.md b/docs/content/reference/types/components/entity_path.md index 93cbe3bfecf4..55fdf8ef4fef 100644 --- a/docs/content/reference/types/components/entity_path.md +++ b/docs/content/reference/types/components/entity_path.md @@ -10,11 +10,11 @@ A path to an entity, usually to reference some data that is part of the target e * value: [`EntityPath`](../datatypes/entity_path.md) ## API reference links - * šŸŒŠ [C++ API docs for `EntityPath`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1EntityPath.html) - * šŸ [Python API docs for `EntityPath`](https://ref.rerun.io/docs/python/stable/common/components#rerun.components.EntityPath) - * šŸ¦€ [Rust API docs for `EntityPath`](https://docs.rs/rerun/latest/rerun/components/struct.EntityPath.html) + * šŸŒŠ [C++ API docs for `EntityPath`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1EntityPath.html?speculative-link) + * šŸ [Python API docs for `EntityPath`](https://ref.rerun.io/docs/python/stable/common/components?speculative-link#rerun.components.EntityPath) + * šŸ¦€ [Rust API docs for `EntityPath`](https://docs.rs/rerun/latest/rerun/components/struct.EntityPath.html?speculative-link) ## Used by -* [`VideoFrameReference`](../archetypes/video_frame_reference.md) +* [`VideoFrameReference`](../archetypes/video_frame_reference.md?speculative-link) diff --git a/docs/content/reference/types/components/media_type.md b/docs/content/reference/types/components/media_type.md index 0671991d622a..687fe9521288 100644 --- a/docs/content/reference/types/components/media_type.md +++ b/docs/content/reference/types/components/media_type.md @@ -21,6 +21,6 @@ consulted at . ## Used by * [`Asset3D`](../archetypes/asset3d.md) -* [`AssetVideo`](../archetypes/asset_video.md) +* [`AssetVideo`](../archetypes/asset_video.md?speculative-link) * [`EncodedImage`](../archetypes/encoded_image.md) * [`TextDocument`](../archetypes/text_document.md) diff --git a/docs/content/reference/types/components/video_timestamp.md b/docs/content/reference/types/components/video_timestamp.md index 10ee10394b8f..7c940f7a61d8 100644 --- a/docs/content/reference/types/components/video_timestamp.md +++ b/docs/content/reference/types/components/video_timestamp.md @@ -6,18 +6,18 @@ title: "VideoTimestamp" āš ļø **This is an experimental API! It is not fully supported, and is likely to change significantly in future versions.** -Timestamp inside a [`archetypes.AssetVideo`](https://rerun.io/docs/reference/types/archetypes/asset_video). +Timestamp inside a [`archetypes.AssetVideo`](https://rerun.io/docs/reference/types/archetypes/asset_video?speculative-link). ## Fields * timestamp: [`VideoTimestamp`](../datatypes/video_timestamp.md) ## API reference links - * šŸŒŠ [C++ API docs for `VideoTimestamp`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1VideoTimestamp.html) - * šŸ [Python API docs for `VideoTimestamp`](https://ref.rerun.io/docs/python/stable/common/components#rerun.components.VideoTimestamp) - * šŸ¦€ [Rust API docs for `VideoTimestamp`](https://docs.rs/rerun/latest/rerun/components/struct.VideoTimestamp.html) + * šŸŒŠ [C++ API docs for `VideoTimestamp`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1VideoTimestamp.html?speculative-link) + * šŸ [Python API docs for `VideoTimestamp`](https://ref.rerun.io/docs/python/stable/common/components?speculative-link#rerun.components.VideoTimestamp) + * šŸ¦€ [Rust API docs for `VideoTimestamp`](https://docs.rs/rerun/latest/rerun/components/struct.VideoTimestamp.html?speculative-link) ## Used by -* [`VideoFrameReference`](../archetypes/video_frame_reference.md) +* [`VideoFrameReference`](../archetypes/video_frame_reference.md?speculative-link) diff --git a/docs/content/reference/types/datatypes.md b/docs/content/reference/types/datatypes.md index cd9a53251034..b34728a8a35c 100644 --- a/docs/content/reference/types/datatypes.md +++ b/docs/content/reference/types/datatypes.md @@ -49,8 +49,8 @@ Data types are the lowest layer of the data model hierarchy. They are re-usable * [`Vec2D`](datatypes/vec2d.md): A vector in 2D space. * [`Vec3D`](datatypes/vec3d.md): A vector in 3D space. * [`Vec4D`](datatypes/vec4d.md): A vector in 4D space. -* [`VideoTimeMode`](datatypes/video_time_mode.md): Specifies how to interpret the `video_time` field of a [`datatypes.VideoTimestamp`](https://rerun.io/docs/reference/types/datatypes/video_timestamp). -* [`VideoTimestamp`](datatypes/video_timestamp.md): Timestamp inside a [`archetypes.AssetVideo`](https://rerun.io/docs/reference/types/archetypes/asset_video). +* [`VideoTimeMode`](datatypes/video_time_mode.md): Specifies how to interpret the `video_time` field of a [`datatypes.VideoTimestamp`](https://rerun.io/docs/reference/types/datatypes/video_timestamp?speculative-link). +* [`VideoTimestamp`](datatypes/video_timestamp.md): Timestamp inside a [`archetypes.AssetVideo`](https://rerun.io/docs/reference/types/archetypes/asset_video?speculative-link). * [`ViewCoordinates`](datatypes/view_coordinates.md): How we interpret the coordinate system of an entity/space. * [`VisibleTimeRange`](datatypes/visible_time_range.md): Visible time range bounds for a specific timeline. diff --git a/docs/content/reference/types/datatypes/entity_path.md b/docs/content/reference/types/datatypes/entity_path.md index 5e7a14c35223..14306137c330 100644 --- a/docs/content/reference/types/datatypes/entity_path.md +++ b/docs/content/reference/types/datatypes/entity_path.md @@ -17,4 +17,4 @@ A path to an entity in the `ChunkStore`. ## Used by -* [`EntityPath`](../components/entity_path.md) +* [`EntityPath`](../components/entity_path.md?speculative-link) diff --git a/docs/content/reference/types/datatypes/video_time_mode.md b/docs/content/reference/types/datatypes/video_time_mode.md index 247661b972d4..a81f4e99a619 100644 --- a/docs/content/reference/types/datatypes/video_time_mode.md +++ b/docs/content/reference/types/datatypes/video_time_mode.md @@ -3,18 +3,18 @@ title: "VideoTimeMode" --- -Specifies how to interpret the `video_time` field of a [`datatypes.VideoTimestamp`](https://rerun.io/docs/reference/types/datatypes/video_timestamp). +Specifies how to interpret the `video_time` field of a [`datatypes.VideoTimestamp`](https://rerun.io/docs/reference/types/datatypes/video_timestamp?speculative-link). ## Variants * Nanoseconds ## API reference links - * šŸŒŠ [C++ API docs for `VideoTimeMode`](https://ref.rerun.io/docs/cpp/stable/namespacererun_1_1datatypes.html) - * šŸ [Python API docs for `VideoTimeMode`](https://ref.rerun.io/docs/python/stable/common/datatypes#rerun.datatypes.VideoTimeMode) - * šŸ¦€ [Rust API docs for `VideoTimeMode`](https://docs.rs/rerun/latest/rerun/datatypes/enum.VideoTimeMode.html) + * šŸŒŠ [C++ API docs for `VideoTimeMode`](https://ref.rerun.io/docs/cpp/stable/namespacererun_1_1datatypes.html?speculative-link) + * šŸ [Python API docs for `VideoTimeMode`](https://ref.rerun.io/docs/python/stable/common/datatypes?speculative-link#rerun.datatypes.VideoTimeMode) + * šŸ¦€ [Rust API docs for `VideoTimeMode`](https://docs.rs/rerun/latest/rerun/datatypes/enum.VideoTimeMode.html?speculative-link) ## Used by -* [`VideoTimestamp`](../datatypes/video_timestamp.md) +* [`VideoTimestamp`](../datatypes/video_timestamp.md?speculative-link) diff --git a/docs/content/reference/types/datatypes/video_timestamp.md b/docs/content/reference/types/datatypes/video_timestamp.md index ea04f86bb75c..e427bbef5471 100644 --- a/docs/content/reference/types/datatypes/video_timestamp.md +++ b/docs/content/reference/types/datatypes/video_timestamp.md @@ -6,7 +6,7 @@ title: "VideoTimestamp" āš ļø **This is an experimental API! It is not fully supported, and is likely to change significantly in future versions.** -Timestamp inside a [`archetypes.AssetVideo`](https://rerun.io/docs/reference/types/archetypes/asset_video). +Timestamp inside a [`archetypes.AssetVideo`](https://rerun.io/docs/reference/types/archetypes/asset_video?speculative-link). ## Fields @@ -14,11 +14,11 @@ Timestamp inside a [`archetypes.AssetVideo`](https://rerun.io/docs/reference/typ * time_mode: [`VideoTimeMode`](../datatypes/video_time_mode.md) ## API reference links - * šŸŒŠ [C++ API docs for `VideoTimestamp`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1datatypes_1_1VideoTimestamp.html) - * šŸ [Python API docs for `VideoTimestamp`](https://ref.rerun.io/docs/python/stable/common/datatypes#rerun.datatypes.VideoTimestamp) - * šŸ¦€ [Rust API docs for `VideoTimestamp`](https://docs.rs/rerun/latest/rerun/datatypes/struct.VideoTimestamp.html) + * šŸŒŠ [C++ API docs for `VideoTimestamp`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1datatypes_1_1VideoTimestamp.html?speculative-link) + * šŸ [Python API docs for `VideoTimestamp`](https://ref.rerun.io/docs/python/stable/common/datatypes?speculative-link#rerun.datatypes.VideoTimestamp) + * šŸ¦€ [Rust API docs for `VideoTimestamp`](https://docs.rs/rerun/latest/rerun/datatypes/struct.VideoTimestamp.html?speculative-link) ## Used by -* [`VideoTimestamp`](../components/video_timestamp.md) +* [`VideoTimestamp`](../components/video_timestamp.md?speculative-link) diff --git a/rerun_cpp/src/rerun/blueprint/components/active_tab.hpp b/rerun_cpp/src/rerun/blueprint/components/active_tab.hpp index 7d0918f1a394..5c87e1387f77 100644 --- a/rerun_cpp/src/rerun/blueprint/components/active_tab.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/active_tab.hpp @@ -60,7 +60,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::ActiveTab* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->tab, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->tab, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/auto_layout.hpp b/rerun_cpp/src/rerun/blueprint/components/auto_layout.hpp index 5d82808947b9..63dadb519879 100644 --- a/rerun_cpp/src/rerun/blueprint/components/auto_layout.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/auto_layout.hpp @@ -55,10 +55,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::AutoLayout* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->auto_layout, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->auto_layout, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/auto_space_views.hpp b/rerun_cpp/src/rerun/blueprint/components/auto_space_views.hpp index 4783a44579de..8c21f02cfb79 100644 --- a/rerun_cpp/src/rerun/blueprint/components/auto_space_views.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/auto_space_views.hpp @@ -56,10 +56,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::AutoSpaceViews* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->auto_space_views, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->auto_space_views, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/column_share.hpp b/rerun_cpp/src/rerun/blueprint/components/column_share.hpp index 6f88c69deb1b..5c6481ede3bc 100644 --- a/rerun_cpp/src/rerun/blueprint/components/column_share.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/column_share.hpp @@ -56,7 +56,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::ColumnShare* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->share, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->share, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/grid_columns.hpp b/rerun_cpp/src/rerun/blueprint/components/grid_columns.hpp index 6f89d19ebdd2..56f665202424 100644 --- a/rerun_cpp/src/rerun/blueprint/components/grid_columns.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/grid_columns.hpp @@ -56,7 +56,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::GridColumns* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->columns, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->columns, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/included_content.hpp b/rerun_cpp/src/rerun/blueprint/components/included_content.hpp index 2ba86cf13728..4db112c1e04b 100644 --- a/rerun_cpp/src/rerun/blueprint/components/included_content.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/included_content.hpp @@ -63,10 +63,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::IncludedContent* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->contents, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->contents, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/included_space_view.hpp b/rerun_cpp/src/rerun/blueprint/components/included_space_view.hpp index af3d68b5cb99..79b70385d118 100644 --- a/rerun_cpp/src/rerun/blueprint/components/included_space_view.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/included_space_view.hpp @@ -58,10 +58,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::IncludedSpaceView* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->space_view_id, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->space_view_id, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/interactive.hpp b/rerun_cpp/src/rerun/blueprint/components/interactive.hpp index 586bd20d8a9e..7099896fda60 100644 --- a/rerun_cpp/src/rerun/blueprint/components/interactive.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/interactive.hpp @@ -57,10 +57,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::Interactive* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->interactive, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->interactive, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/lock_range_during_zoom.hpp b/rerun_cpp/src/rerun/blueprint/components/lock_range_during_zoom.hpp index 98488ead5167..0e50536cffb9 100644 --- a/rerun_cpp/src/rerun/blueprint/components/lock_range_during_zoom.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/lock_range_during_zoom.hpp @@ -59,10 +59,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::LockRangeDuringZoom* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->lock_range, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->lock_range, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/query_expression.hpp b/rerun_cpp/src/rerun/blueprint/components/query_expression.hpp index b9748daf1993..5d8fb74e9d5a 100644 --- a/rerun_cpp/src/rerun/blueprint/components/query_expression.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/query_expression.hpp @@ -66,7 +66,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::QueryExpression* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->filter, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->filter, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/root_container.hpp b/rerun_cpp/src/rerun/blueprint/components/root_container.hpp index 2bed9d0c67e2..46b73b8636fc 100644 --- a/rerun_cpp/src/rerun/blueprint/components/root_container.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/root_container.hpp @@ -57,7 +57,16 @@ namespace rerun { static Result> to_arrow( const blueprint::components::RootContainer* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->id, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow(&instances->id, num_instances); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/row_share.hpp b/rerun_cpp/src/rerun/blueprint/components/row_share.hpp index 2ed34a35cdab..7abe4c2cdb61 100644 --- a/rerun_cpp/src/rerun/blueprint/components/row_share.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/row_share.hpp @@ -56,7 +56,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::RowShare* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->share, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->share, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/space_view_class.hpp b/rerun_cpp/src/rerun/blueprint/components/space_view_class.hpp index c6bcaeff027d..b830031bab71 100644 --- a/rerun_cpp/src/rerun/blueprint/components/space_view_class.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/space_view_class.hpp @@ -57,7 +57,16 @@ namespace rerun { static Result> to_arrow( const blueprint::components::SpaceViewClass* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->value, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow(&instances->value, num_instances); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/space_view_maximized.hpp b/rerun_cpp/src/rerun/blueprint/components/space_view_maximized.hpp index be83c07d352a..d1fe8b056437 100644 --- a/rerun_cpp/src/rerun/blueprint/components/space_view_maximized.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/space_view_maximized.hpp @@ -58,10 +58,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::SpaceViewMaximized* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->space_view_id, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->space_view_id, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/space_view_origin.hpp b/rerun_cpp/src/rerun/blueprint/components/space_view_origin.hpp index 04f975326066..9eb20d62b9d9 100644 --- a/rerun_cpp/src/rerun/blueprint/components/space_view_origin.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/space_view_origin.hpp @@ -59,10 +59,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::SpaceViewOrigin* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->value, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->value, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/tensor_dimension_index_slider.hpp b/rerun_cpp/src/rerun/blueprint/components/tensor_dimension_index_slider.hpp index 66f9657aed6f..74569335fa8f 100644 --- a/rerun_cpp/src/rerun/blueprint/components/tensor_dimension_index_slider.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/tensor_dimension_index_slider.hpp @@ -65,10 +65,22 @@ namespace rerun { static Result> to_arrow( const blueprint::components::TensorDimensionIndexSlider* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->selection, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow( + nullptr, + 0 + ); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->selection, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/timeline_name.hpp b/rerun_cpp/src/rerun/blueprint/components/timeline_name.hpp index 7b068de8a301..f64d42c264c4 100644 --- a/rerun_cpp/src/rerun/blueprint/components/timeline_name.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/timeline_name.hpp @@ -57,7 +57,16 @@ namespace rerun { static Result> to_arrow( const blueprint::components::TimelineName* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->value, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow(&instances->value, num_instances); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/viewer_recommendation_hash.hpp b/rerun_cpp/src/rerun/blueprint/components/viewer_recommendation_hash.hpp index 9c0f5de7c290..b603df7ecb8b 100644 --- a/rerun_cpp/src/rerun/blueprint/components/viewer_recommendation_hash.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/viewer_recommendation_hash.hpp @@ -59,7 +59,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::ViewerRecommendationHash* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->value, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->value, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/visible.hpp b/rerun_cpp/src/rerun/blueprint/components/visible.hpp index 5cfe80fddd7b..5867ec3af69b 100644 --- a/rerun_cpp/src/rerun/blueprint/components/visible.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/visible.hpp @@ -55,7 +55,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::Visible* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->visible, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->visible, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/visible_time_range.hpp b/rerun_cpp/src/rerun/blueprint/components/visible_time_range.hpp index 84fae0373fe2..25b6afac2940 100644 --- a/rerun_cpp/src/rerun/blueprint/components/visible_time_range.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/visible_time_range.hpp @@ -54,10 +54,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::VisibleTimeRange* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->value, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->value, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/visual_bounds2d.hpp b/rerun_cpp/src/rerun/blueprint/components/visual_bounds2d.hpp index 56bb18dc9e71..49c9a0680131 100644 --- a/rerun_cpp/src/rerun/blueprint/components/visual_bounds2d.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/visual_bounds2d.hpp @@ -51,10 +51,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::VisualBounds2D* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->range2d, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->range2d, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/blueprint/components/visualizer_overrides.hpp b/rerun_cpp/src/rerun/blueprint/components/visualizer_overrides.hpp index 353bed2a627b..9d6a81f14331 100644 --- a/rerun_cpp/src/rerun/blueprint/components/visualizer_overrides.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/visualizer_overrides.hpp @@ -96,10 +96,19 @@ namespace rerun { static Result> to_arrow( const blueprint::components::VisualizerOverrides* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->visualizers, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->visualizers, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/albedo_factor.hpp b/rerun_cpp/src/rerun/components/albedo_factor.hpp index 0e0d0247b9a6..af1116c22319 100644 --- a/rerun_cpp/src/rerun/components/albedo_factor.hpp +++ b/rerun_cpp/src/rerun/components/albedo_factor.hpp @@ -55,10 +55,19 @@ namespace rerun { static Result> to_arrow( const components::AlbedoFactor* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->albedo_factor, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->albedo_factor, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/axis_length.hpp b/rerun_cpp/src/rerun/components/axis_length.hpp index 52de619ced7e..e9f17469ee26 100644 --- a/rerun_cpp/src/rerun/components/axis_length.hpp +++ b/rerun_cpp/src/rerun/components/axis_length.hpp @@ -55,7 +55,19 @@ namespace rerun { static Result> to_arrow( const components::AxisLength* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->length, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->length, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/blob.hpp b/rerun_cpp/src/rerun/components/blob.hpp index a662aee8a405..b732967cca9f 100644 --- a/rerun_cpp/src/rerun/components/blob.hpp +++ b/rerun_cpp/src/rerun/components/blob.hpp @@ -57,7 +57,16 @@ namespace rerun { static Result> to_arrow( const components::Blob* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->data, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow(&instances->data, num_instances); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/class_id.hpp b/rerun_cpp/src/rerun/components/class_id.hpp index 0fec72ecc831..14d61fd75b80 100644 --- a/rerun_cpp/src/rerun/components/class_id.hpp +++ b/rerun_cpp/src/rerun/components/class_id.hpp @@ -55,7 +55,16 @@ namespace rerun { static Result> to_arrow( const components::ClassId* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->id, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow(&instances->id, num_instances); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/clear_is_recursive.hpp b/rerun_cpp/src/rerun/components/clear_is_recursive.hpp index 9eadea654ea7..a0cd7f6f6ce6 100644 --- a/rerun_cpp/src/rerun/components/clear_is_recursive.hpp +++ b/rerun_cpp/src/rerun/components/clear_is_recursive.hpp @@ -56,7 +56,19 @@ namespace rerun { static Result> to_arrow( const components::ClearIsRecursive* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->recursive, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->recursive, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/color.hpp b/rerun_cpp/src/rerun/components/color.hpp index a255ee1e15b0..b7085d2bcc18 100644 --- a/rerun_cpp/src/rerun/components/color.hpp +++ b/rerun_cpp/src/rerun/components/color.hpp @@ -80,7 +80,19 @@ namespace rerun { static Result> to_arrow( const components::Color* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->rgba, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->rgba, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/depth_meter.hpp b/rerun_cpp/src/rerun/components/depth_meter.hpp index 3e4a95a00f3a..4d57b50d44a4 100644 --- a/rerun_cpp/src/rerun/components/depth_meter.hpp +++ b/rerun_cpp/src/rerun/components/depth_meter.hpp @@ -62,7 +62,19 @@ namespace rerun { static Result> to_arrow( const components::DepthMeter* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->value, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->value, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/disconnected_space.hpp b/rerun_cpp/src/rerun/components/disconnected_space.hpp index bbc3bad2a498..75a8ecabdeb3 100644 --- a/rerun_cpp/src/rerun/components/disconnected_space.hpp +++ b/rerun_cpp/src/rerun/components/disconnected_space.hpp @@ -66,10 +66,19 @@ namespace rerun { static Result> to_arrow( const components::DisconnectedSpace* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->is_disconnected, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->is_disconnected, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/draw_order.hpp b/rerun_cpp/src/rerun/components/draw_order.hpp index 558ca8250d86..e56046ff2da5 100644 --- a/rerun_cpp/src/rerun/components/draw_order.hpp +++ b/rerun_cpp/src/rerun/components/draw_order.hpp @@ -60,7 +60,19 @@ namespace rerun { static Result> to_arrow( const components::DrawOrder* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->value, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->value, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/entity_path.hpp b/rerun_cpp/src/rerun/components/entity_path.hpp index 50baae8c7c94..c5c5063beb1d 100644 --- a/rerun_cpp/src/rerun/components/entity_path.hpp +++ b/rerun_cpp/src/rerun/components/entity_path.hpp @@ -64,10 +64,19 @@ namespace rerun { static Result> to_arrow( const components::EntityPath* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->value, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->value, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/fill_ratio.hpp b/rerun_cpp/src/rerun/components/fill_ratio.hpp index 62956caed844..24d9078845a2 100644 --- a/rerun_cpp/src/rerun/components/fill_ratio.hpp +++ b/rerun_cpp/src/rerun/components/fill_ratio.hpp @@ -60,7 +60,19 @@ namespace rerun { static Result> to_arrow( const components::FillRatio* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->value, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->value, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/gamma_correction.hpp b/rerun_cpp/src/rerun/components/gamma_correction.hpp index ccd1bcd4941d..3123ea303249 100644 --- a/rerun_cpp/src/rerun/components/gamma_correction.hpp +++ b/rerun_cpp/src/rerun/components/gamma_correction.hpp @@ -61,7 +61,19 @@ namespace rerun { static Result> to_arrow( const components::GammaCorrection* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->gamma, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->gamma, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/half_size2d.hpp b/rerun_cpp/src/rerun/components/half_size2d.hpp index 9a52620bb8e8..16df41d81562 100644 --- a/rerun_cpp/src/rerun/components/half_size2d.hpp +++ b/rerun_cpp/src/rerun/components/half_size2d.hpp @@ -75,7 +75,16 @@ namespace rerun { static Result> to_arrow( const components::HalfSize2D* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->xy, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow(&instances->xy, num_instances); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/half_size3d.hpp b/rerun_cpp/src/rerun/components/half_size3d.hpp index c3de9d21dc8b..d6778e5d8005 100644 --- a/rerun_cpp/src/rerun/components/half_size3d.hpp +++ b/rerun_cpp/src/rerun/components/half_size3d.hpp @@ -79,7 +79,16 @@ namespace rerun { static Result> to_arrow( const components::HalfSize3D* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->xyz, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow(&instances->xyz, num_instances); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/image_buffer.hpp b/rerun_cpp/src/rerun/components/image_buffer.hpp index 829265c5b99b..c8aab4e71d42 100644 --- a/rerun_cpp/src/rerun/components/image_buffer.hpp +++ b/rerun_cpp/src/rerun/components/image_buffer.hpp @@ -67,7 +67,19 @@ namespace rerun { static Result> to_arrow( const components::ImageBuffer* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->buffer, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->buffer, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/image_format.hpp b/rerun_cpp/src/rerun/components/image_format.hpp index c14926b0e5ca..c9670f65578b 100644 --- a/rerun_cpp/src/rerun/components/image_format.hpp +++ b/rerun_cpp/src/rerun/components/image_format.hpp @@ -65,10 +65,19 @@ namespace rerun { static Result> to_arrow( const components::ImageFormat* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->image_format, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->image_format, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/image_plane_distance.hpp b/rerun_cpp/src/rerun/components/image_plane_distance.hpp index 3c39aa4e531c..898bdcb93085 100644 --- a/rerun_cpp/src/rerun/components/image_plane_distance.hpp +++ b/rerun_cpp/src/rerun/components/image_plane_distance.hpp @@ -58,10 +58,19 @@ namespace rerun { static Result> to_arrow( const components::ImagePlaneDistance* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->image_from_camera, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->image_from_camera, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/keypoint_id.hpp b/rerun_cpp/src/rerun/components/keypoint_id.hpp index ba039b945c72..e2071bb4995d 100644 --- a/rerun_cpp/src/rerun/components/keypoint_id.hpp +++ b/rerun_cpp/src/rerun/components/keypoint_id.hpp @@ -55,7 +55,19 @@ namespace rerun { static Result> to_arrow( const components::KeypointId* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->id, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->id, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/marker_size.hpp b/rerun_cpp/src/rerun/components/marker_size.hpp index a3e3208c97b8..2946c031a6ef 100644 --- a/rerun_cpp/src/rerun/components/marker_size.hpp +++ b/rerun_cpp/src/rerun/components/marker_size.hpp @@ -55,7 +55,19 @@ namespace rerun { static Result> to_arrow( const components::MarkerSize* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->value, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->value, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/media_type.hpp b/rerun_cpp/src/rerun/components/media_type.hpp index 9d8358e40e36..df9ea1a5aeeb 100644 --- a/rerun_cpp/src/rerun/components/media_type.hpp +++ b/rerun_cpp/src/rerun/components/media_type.hpp @@ -141,7 +141,16 @@ namespace rerun { static Result> to_arrow( const components::MediaType* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->value, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow(&instances->value, num_instances); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/name.hpp b/rerun_cpp/src/rerun/components/name.hpp index 1089ac72770a..b8ea1e7eccb9 100644 --- a/rerun_cpp/src/rerun/components/name.hpp +++ b/rerun_cpp/src/rerun/components/name.hpp @@ -67,7 +67,16 @@ namespace rerun { static Result> to_arrow( const components::Name* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->value, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow(&instances->value, num_instances); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/opacity.hpp b/rerun_cpp/src/rerun/components/opacity.hpp index 058c4b89a772..3f72c4b2395f 100644 --- a/rerun_cpp/src/rerun/components/opacity.hpp +++ b/rerun_cpp/src/rerun/components/opacity.hpp @@ -58,10 +58,19 @@ namespace rerun { static Result> to_arrow( const components::Opacity* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->opacity, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->opacity, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/pinhole_projection.hpp b/rerun_cpp/src/rerun/components/pinhole_projection.hpp index dfd745b91e10..cea686b99527 100644 --- a/rerun_cpp/src/rerun/components/pinhole_projection.hpp +++ b/rerun_cpp/src/rerun/components/pinhole_projection.hpp @@ -75,10 +75,19 @@ namespace rerun { static Result> to_arrow( const components::PinholeProjection* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->image_from_camera, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->image_from_camera, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/pose_rotation_axis_angle.hpp b/rerun_cpp/src/rerun/components/pose_rotation_axis_angle.hpp index 4db5139144ce..06bbe488f4f3 100644 --- a/rerun_cpp/src/rerun/components/pose_rotation_axis_angle.hpp +++ b/rerun_cpp/src/rerun/components/pose_rotation_axis_angle.hpp @@ -51,10 +51,19 @@ namespace rerun { static Result> to_arrow( const components::PoseRotationAxisAngle* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->rotation, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->rotation, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/pose_rotation_quat.hpp b/rerun_cpp/src/rerun/components/pose_rotation_quat.hpp index b7836ba1085a..48aff2a99f5b 100644 --- a/rerun_cpp/src/rerun/components/pose_rotation_quat.hpp +++ b/rerun_cpp/src/rerun/components/pose_rotation_quat.hpp @@ -51,10 +51,19 @@ namespace rerun { static Result> to_arrow( const components::PoseRotationQuat* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->quaternion, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->quaternion, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/pose_scale3d.hpp b/rerun_cpp/src/rerun/components/pose_scale3d.hpp index 0c722d1e68ac..088f5b998dd2 100644 --- a/rerun_cpp/src/rerun/components/pose_scale3d.hpp +++ b/rerun_cpp/src/rerun/components/pose_scale3d.hpp @@ -83,7 +83,19 @@ namespace rerun { static Result> to_arrow( const components::PoseScale3D* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->scale, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->scale, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/pose_transform_mat3x3.hpp b/rerun_cpp/src/rerun/components/pose_transform_mat3x3.hpp index a0fa052ca176..2c3af97ccd90 100644 --- a/rerun_cpp/src/rerun/components/pose_transform_mat3x3.hpp +++ b/rerun_cpp/src/rerun/components/pose_transform_mat3x3.hpp @@ -68,7 +68,19 @@ namespace rerun { static Result> to_arrow( const components::PoseTransformMat3x3* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->matrix, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->matrix, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/pose_translation3d.hpp b/rerun_cpp/src/rerun/components/pose_translation3d.hpp index abc672962605..850a23c985c2 100644 --- a/rerun_cpp/src/rerun/components/pose_translation3d.hpp +++ b/rerun_cpp/src/rerun/components/pose_translation3d.hpp @@ -77,7 +77,19 @@ namespace rerun { static Result> to_arrow( const components::PoseTranslation3D* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->vector, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->vector, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/position2d.hpp b/rerun_cpp/src/rerun/components/position2d.hpp index edd67e73522d..cda1a4e3395e 100644 --- a/rerun_cpp/src/rerun/components/position2d.hpp +++ b/rerun_cpp/src/rerun/components/position2d.hpp @@ -70,7 +70,16 @@ namespace rerun { static Result> to_arrow( const components::Position2D* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->xy, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow(&instances->xy, num_instances); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/position3d.hpp b/rerun_cpp/src/rerun/components/position3d.hpp index c743ee7d0422..82fdc168e1c0 100644 --- a/rerun_cpp/src/rerun/components/position3d.hpp +++ b/rerun_cpp/src/rerun/components/position3d.hpp @@ -74,7 +74,16 @@ namespace rerun { static Result> to_arrow( const components::Position3D* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->xyz, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow(&instances->xyz, num_instances); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/radius.hpp b/rerun_cpp/src/rerun/components/radius.hpp index 839fd9347438..42536e15f55f 100644 --- a/rerun_cpp/src/rerun/components/radius.hpp +++ b/rerun_cpp/src/rerun/components/radius.hpp @@ -79,7 +79,19 @@ namespace rerun { static Result> to_arrow( const components::Radius* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->value, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->value, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/range1d.hpp b/rerun_cpp/src/rerun/components/range1d.hpp index 8a47d91e3f78..ac812a344958 100644 --- a/rerun_cpp/src/rerun/components/range1d.hpp +++ b/rerun_cpp/src/rerun/components/range1d.hpp @@ -56,7 +56,19 @@ namespace rerun { static Result> to_arrow( const components::Range1D* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->range, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->range, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/resolution.hpp b/rerun_cpp/src/rerun/components/resolution.hpp index 5868bdf3740c..3dabe73adbe6 100644 --- a/rerun_cpp/src/rerun/components/resolution.hpp +++ b/rerun_cpp/src/rerun/components/resolution.hpp @@ -71,10 +71,19 @@ namespace rerun { static Result> to_arrow( const components::Resolution* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->resolution, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->resolution, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/rotation_axis_angle.hpp b/rerun_cpp/src/rerun/components/rotation_axis_angle.hpp index 09159176dfb0..753d45fe78f1 100644 --- a/rerun_cpp/src/rerun/components/rotation_axis_angle.hpp +++ b/rerun_cpp/src/rerun/components/rotation_axis_angle.hpp @@ -50,10 +50,19 @@ namespace rerun { static Result> to_arrow( const components::RotationAxisAngle* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->rotation, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->rotation, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/rotation_quat.hpp b/rerun_cpp/src/rerun/components/rotation_quat.hpp index 4bdfc6d06ac6..1b83cdb2109b 100644 --- a/rerun_cpp/src/rerun/components/rotation_quat.hpp +++ b/rerun_cpp/src/rerun/components/rotation_quat.hpp @@ -51,10 +51,19 @@ namespace rerun { static Result> to_arrow( const components::RotationQuat* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->quaternion, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->quaternion, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/scalar.hpp b/rerun_cpp/src/rerun/components/scalar.hpp index 9c811333c69c..80a9435de007 100644 --- a/rerun_cpp/src/rerun/components/scalar.hpp +++ b/rerun_cpp/src/rerun/components/scalar.hpp @@ -57,7 +57,19 @@ namespace rerun { static Result> to_arrow( const components::Scalar* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->value, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->value, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/scale3d.hpp b/rerun_cpp/src/rerun/components/scale3d.hpp index 122926857a8b..7da6ac516830 100644 --- a/rerun_cpp/src/rerun/components/scale3d.hpp +++ b/rerun_cpp/src/rerun/components/scale3d.hpp @@ -83,7 +83,19 @@ namespace rerun { static Result> to_arrow( const components::Scale3D* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->scale, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->scale, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/show_labels.hpp b/rerun_cpp/src/rerun/components/show_labels.hpp index da55b9eb3443..22f3aae5b76f 100644 --- a/rerun_cpp/src/rerun/components/show_labels.hpp +++ b/rerun_cpp/src/rerun/components/show_labels.hpp @@ -60,10 +60,19 @@ namespace rerun { static Result> to_arrow( const components::ShowLabels* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->show_labels, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->show_labels, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/stroke_width.hpp b/rerun_cpp/src/rerun/components/stroke_width.hpp index c78a515da1c9..408ddd99e690 100644 --- a/rerun_cpp/src/rerun/components/stroke_width.hpp +++ b/rerun_cpp/src/rerun/components/stroke_width.hpp @@ -55,7 +55,19 @@ namespace rerun { static Result> to_arrow( const components::StrokeWidth* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->width, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->width, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/tensor_data.hpp b/rerun_cpp/src/rerun/components/tensor_data.hpp index 847795913595..b9da04ac2f3b 100644 --- a/rerun_cpp/src/rerun/components/tensor_data.hpp +++ b/rerun_cpp/src/rerun/components/tensor_data.hpp @@ -78,10 +78,19 @@ namespace rerun { static Result> to_arrow( const components::TensorData* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->data, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->data, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/tensor_dimension_index_selection.hpp b/rerun_cpp/src/rerun/components/tensor_dimension_index_selection.hpp index a916c671abad..1c973d9c4e81 100644 --- a/rerun_cpp/src/rerun/components/tensor_dimension_index_selection.hpp +++ b/rerun_cpp/src/rerun/components/tensor_dimension_index_selection.hpp @@ -54,10 +54,22 @@ namespace rerun { static Result> to_arrow( const components::TensorDimensionIndexSelection* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->selection, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow( + nullptr, + 0 + ); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->selection, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/tensor_height_dimension.hpp b/rerun_cpp/src/rerun/components/tensor_height_dimension.hpp index 8aa547703ec4..0e6adfb46bb8 100644 --- a/rerun_cpp/src/rerun/components/tensor_height_dimension.hpp +++ b/rerun_cpp/src/rerun/components/tensor_height_dimension.hpp @@ -52,10 +52,19 @@ namespace rerun { static Result> to_arrow( const components::TensorHeightDimension* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->dimension, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->dimension, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/tensor_width_dimension.hpp b/rerun_cpp/src/rerun/components/tensor_width_dimension.hpp index d57d3712f713..edac02c66bcc 100644 --- a/rerun_cpp/src/rerun/components/tensor_width_dimension.hpp +++ b/rerun_cpp/src/rerun/components/tensor_width_dimension.hpp @@ -52,10 +52,19 @@ namespace rerun { static Result> to_arrow( const components::TensorWidthDimension* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->dimension, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->dimension, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/texcoord2d.hpp b/rerun_cpp/src/rerun/components/texcoord2d.hpp index 7951f45fde39..9a9af5dc31de 100644 --- a/rerun_cpp/src/rerun/components/texcoord2d.hpp +++ b/rerun_cpp/src/rerun/components/texcoord2d.hpp @@ -85,7 +85,16 @@ namespace rerun { static Result> to_arrow( const components::Texcoord2D* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->uv, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow(&instances->uv, num_instances); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/text.hpp b/rerun_cpp/src/rerun/components/text.hpp index 288ba81214ba..858c37b66b7e 100644 --- a/rerun_cpp/src/rerun/components/text.hpp +++ b/rerun_cpp/src/rerun/components/text.hpp @@ -67,7 +67,16 @@ namespace rerun { static Result> to_arrow( const components::Text* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->value, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow(&instances->value, num_instances); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/text_log_level.hpp b/rerun_cpp/src/rerun/components/text_log_level.hpp index e5ab158ca370..1123afb90ac1 100644 --- a/rerun_cpp/src/rerun/components/text_log_level.hpp +++ b/rerun_cpp/src/rerun/components/text_log_level.hpp @@ -94,7 +94,16 @@ namespace rerun { static Result> to_arrow( const components::TextLogLevel* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->value, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow(&instances->value, num_instances); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/transform_mat3x3.hpp b/rerun_cpp/src/rerun/components/transform_mat3x3.hpp index c4905f932e0f..fc0e02077746 100644 --- a/rerun_cpp/src/rerun/components/transform_mat3x3.hpp +++ b/rerun_cpp/src/rerun/components/transform_mat3x3.hpp @@ -68,7 +68,19 @@ namespace rerun { static Result> to_arrow( const components::TransformMat3x3* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->matrix, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->matrix, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/translation3d.hpp b/rerun_cpp/src/rerun/components/translation3d.hpp index cefbf7b8c240..a5453be2ba3b 100644 --- a/rerun_cpp/src/rerun/components/translation3d.hpp +++ b/rerun_cpp/src/rerun/components/translation3d.hpp @@ -77,7 +77,19 @@ namespace rerun { static Result> to_arrow( const components::Translation3D* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->vector, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->vector, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/triangle_indices.hpp b/rerun_cpp/src/rerun/components/triangle_indices.hpp index 9e9cc52b9f7f..149c841ac90c 100644 --- a/rerun_cpp/src/rerun/components/triangle_indices.hpp +++ b/rerun_cpp/src/rerun/components/triangle_indices.hpp @@ -66,7 +66,19 @@ namespace rerun { static Result> to_arrow( const components::TriangleIndices* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->indices, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->indices, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/vector2d.hpp b/rerun_cpp/src/rerun/components/vector2d.hpp index d9fb7404b6a8..6d56a04ecf2e 100644 --- a/rerun_cpp/src/rerun/components/vector2d.hpp +++ b/rerun_cpp/src/rerun/components/vector2d.hpp @@ -73,7 +73,19 @@ namespace rerun { static Result> to_arrow( const components::Vector2D* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->vector, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->vector, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/vector3d.hpp b/rerun_cpp/src/rerun/components/vector3d.hpp index 6655d29cdba1..2b910c3fa9ef 100644 --- a/rerun_cpp/src/rerun/components/vector3d.hpp +++ b/rerun_cpp/src/rerun/components/vector3d.hpp @@ -77,7 +77,19 @@ namespace rerun { static Result> to_arrow( const components::Vector3D* instances, size_t num_instances ) { - return Loggable::to_arrow(&instances->vector, num_instances); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->vector, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/video_timestamp.hpp b/rerun_cpp/src/rerun/components/video_timestamp.hpp index ae5e840b13be..7b1aec47796f 100644 --- a/rerun_cpp/src/rerun/components/video_timestamp.hpp +++ b/rerun_cpp/src/rerun/components/video_timestamp.hpp @@ -85,10 +85,19 @@ namespace rerun { static Result> to_arrow( const components::VideoTimestamp* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->timestamp, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->timestamp, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/src/rerun/components/view_coordinates.hpp b/rerun_cpp/src/rerun/components/view_coordinates.hpp index 4c60e278f9f4..849fe074cbe9 100644 --- a/rerun_cpp/src/rerun/components/view_coordinates.hpp +++ b/rerun_cpp/src/rerun/components/view_coordinates.hpp @@ -262,10 +262,19 @@ namespace rerun { static Result> to_arrow( const components::ViewCoordinates* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->coordinates, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->coordinates, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/tests/generated/components/affix_fuzzer1.hpp b/rerun_cpp/tests/generated/components/affix_fuzzer1.hpp index 8f336d0e9bb2..06e7ac3608ed 100644 --- a/rerun_cpp/tests/generated/components/affix_fuzzer1.hpp +++ b/rerun_cpp/tests/generated/components/affix_fuzzer1.hpp @@ -49,10 +49,19 @@ namespace rerun { static Result> to_arrow( const components::AffixFuzzer1* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->single_required, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->single_required, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/tests/generated/components/affix_fuzzer14.hpp b/rerun_cpp/tests/generated/components/affix_fuzzer14.hpp index 8ad9836cee1a..fcaa9bb8e367 100644 --- a/rerun_cpp/tests/generated/components/affix_fuzzer14.hpp +++ b/rerun_cpp/tests/generated/components/affix_fuzzer14.hpp @@ -49,10 +49,19 @@ namespace rerun { static Result> to_arrow( const components::AffixFuzzer14* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->single_required_union, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->single_required_union, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/tests/generated/components/affix_fuzzer19.hpp b/rerun_cpp/tests/generated/components/affix_fuzzer19.hpp index 35de185aa288..1f064b08b5f2 100644 --- a/rerun_cpp/tests/generated/components/affix_fuzzer19.hpp +++ b/rerun_cpp/tests/generated/components/affix_fuzzer19.hpp @@ -61,10 +61,19 @@ namespace rerun { static Result> to_arrow( const components::AffixFuzzer19* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->just_a_table_nothing_shady, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->just_a_table_nothing_shady, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/tests/generated/components/affix_fuzzer2.hpp b/rerun_cpp/tests/generated/components/affix_fuzzer2.hpp index 35cf9fdd7376..a21eab739348 100644 --- a/rerun_cpp/tests/generated/components/affix_fuzzer2.hpp +++ b/rerun_cpp/tests/generated/components/affix_fuzzer2.hpp @@ -49,10 +49,19 @@ namespace rerun { static Result> to_arrow( const components::AffixFuzzer2* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->single_required, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->single_required, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/tests/generated/components/affix_fuzzer20.hpp b/rerun_cpp/tests/generated/components/affix_fuzzer20.hpp index 9dc141d7b6c5..2a2a483b8dd1 100644 --- a/rerun_cpp/tests/generated/components/affix_fuzzer20.hpp +++ b/rerun_cpp/tests/generated/components/affix_fuzzer20.hpp @@ -49,10 +49,19 @@ namespace rerun { static Result> to_arrow( const components::AffixFuzzer20* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->nested_transparent, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->nested_transparent, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/tests/generated/components/affix_fuzzer21.hpp b/rerun_cpp/tests/generated/components/affix_fuzzer21.hpp index b3636dc9554b..5a2320b05373 100644 --- a/rerun_cpp/tests/generated/components/affix_fuzzer21.hpp +++ b/rerun_cpp/tests/generated/components/affix_fuzzer21.hpp @@ -49,10 +49,19 @@ namespace rerun { static Result> to_arrow( const components::AffixFuzzer21* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->nested_halves, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->nested_halves, + num_instances + ); + } } }; } // namespace rerun diff --git a/rerun_cpp/tests/generated/components/affix_fuzzer3.hpp b/rerun_cpp/tests/generated/components/affix_fuzzer3.hpp index f15590e62887..14630e8f2bae 100644 --- a/rerun_cpp/tests/generated/components/affix_fuzzer3.hpp +++ b/rerun_cpp/tests/generated/components/affix_fuzzer3.hpp @@ -49,10 +49,19 @@ namespace rerun { static Result> to_arrow( const components::AffixFuzzer3* instances, size_t num_instances ) { - return Loggable::to_arrow( - &instances->single_required, - num_instances - ); + if (num_instances == 0) { + return Loggable::to_arrow(nullptr, 0); + } else if (instances == nullptr) { + return rerun::Error( + ErrorCode::UnexpectedNullArgument, + "Passed array instances is null when num_elements> 0." + ); + } else { + return Loggable::to_arrow( + &instances->single_required, + num_instances + ); + } } }; } // namespace rerun