First-class indicator components for Rust#3251
Merged
Conversation
8723a21 to
1ac4f7f
Compare
a7be46d to
2b6c1dd
Compare
23a1093 to
c31710a
Compare
Contributor
Size changes
|
Wumpf
approved these changes
Sep 11, 2023
Member
Wumpf
left a comment
There was a problem hiding this comment.
neat!
plz check if the custom space view sample still works
Comment on lines
+50
to
+64
| use re_types::Archetype; | ||
| let indicator = <re_types::archetypes::Image as Archetype>::Indicator::new_list(1); | ||
| let indicator_cell = DataCell::from_arrow( | ||
| re_types::archetypes::Image::indicator_component(), | ||
| indicator.to_arrow(), | ||
| ); | ||
|
|
||
| // Assume an image (there are so many image extensions): | ||
| // TODO(#3159): include the `ImageIndicator` component. | ||
| let tensor = re_types::components::TensorData( | ||
| re_types::datatypes::TensorData::from_image_file(file_path)?, | ||
| ); | ||
| Ok(DataCell::try_from_native(std::iter::once(&tensor))?) | ||
| Ok(vec![ | ||
| indicator_cell, | ||
| DataCell::try_from_native(std::iter::once(&tensor))?, | ||
| ]) |
Member
There was a problem hiding this comment.
why doesn't this log an archetype instead of manually doing components?
Contributor
Author
There was a problem hiding this comment.
The file loading path seems to bypass recording streams altogether, manually crafting tables instead.
examples/rust/custom_space_view/src/color_coordinates_view_part_system.rs
Outdated
Show resolved
Hide resolved
Wumpf
reviewed
Sep 11, 2023
Member
Wumpf
left a comment
There was a problem hiding this comment.
(commenting on files I missed earlier)
Just a lot of renaming all around. * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/3262) (if applicable) - [PR Build Summary](https://build.rerun.io/pr/3262) - [Docs preview](https://rerun.io/preview/fadea691f065a580e7dec805140bc47b8c8d8c90/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/fadea691f065a580e7dec805140bc47b8c8d8c90/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://ref.rerun.io/dev/bench/) - [Wasm size tracking](https://ref.rerun.io/dev/sizes/) --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com> Co-authored-by: Andreas Reich <andreas@rerun.io>
6f82637 to
e0505a8
Compare
bb0bce0 to
944d3df
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements & exposes first-class indicator components, effectively completing the "custom user data" story for Rust.
In the end, indicator components are neither materialized in the IDL nor in the generated code, as both alternatives proved to be dead-ends (void data really doesn't fit well into our traits and overall model).
Rather, they are materialized as a single
GenericIndicatorComponent<Archetype>which directly implementsComponentListinstead ofComponent, giving it the necessary leeway to bypass all the iterator machinery.Loading from files now automatically inject indicators:
$ rerun ~/Downloads/image0.jpegcustom_datanow injects custom user-defined indicators:Fixes #3252
Part of #3260
What
Checklist