Introduce splatted indicator components#3479
Conversation
|
I've went the extra mile in order to make indicators fully static and thus pretty much free in Rust because why not, that's very little extra effort. |
2fe3828 to
95f65b3
Compare
| } | ||
|
|
||
| // Only re-build if source-hash exists | ||
| if !Path::new(SOURCE_HASH_PATH).exists() { |
There was a problem hiding this comment.
Didn't this change already land in another PR?
There was a problem hiding this comment.
Yeah.. not sure how that still generates a diff :| will prob disappear once I rebase eh
| cpp_includes.insert_rerun("indicator_component.hpp"); | ||
|
|
||
| Method { | ||
| docs: "Creates an `AnonymousComponentBatch` out of the associated indicator component. \ |
There was a problem hiding this comment.
This isn't anonymous if it has an indicator, is it?
There was a problem hiding this comment.
Not sure what you mean. Anonymous is what the cpp SDK calls an erased ComponentBatch.
Are you saying you'd like this to return a non-erased ComponentBatch, or just that the Anonymous prefix sounds weird?
| return "rerun.archetypes." + type(self).__name__ | ||
| @classmethod | ||
| def archetype_name(cls) -> str: | ||
| return "rerun.archetypes." + cls.__name__ |
There was a problem hiding this comment.
Just a note: I ran into an issue earlier where subclassing an archetype causes this to have unexpected behavior. We can file as a separate issue though.
There was a problem hiding this comment.
This wasn't a classmethod until this PR, it was a plain one... that might be why you had a bad surprise earlier?
95f65b3 to
871eb8c
Compare
This implements splatted indicator components for all languages, which allows for nicer indicator-component-creation APIs, which in turn allows for some pretty sleek use cases as demo'd in the new
manual_indicatorexample.rr.Points3D.indicatorpossible #3432std::vector<rr::components::Position3D> positions = { {0.0, 0.0, 0.0}, {10.0, 0.0, 0.0}, {0.0, 10.0, 0.0}, }; std::vector<rr::components::Color> colors = { {255, 0, 0}, {0, 255, 0}, {0, 0, 255}, }; std::vector<rr::components::Radius> radii = {1.0}; rec.log_component_batches( "points_and_mesh", 3, rr::Points3D::indicator(), rr::Mesh3D::indicator(), positions, colors, radii );Checklist