C++ serialization support for most nested types, transform3d roundtrip test#2937
Merged
C++ serialization support for most nested types, transform3d roundtrip test#2937
Conversation
80aa047 to
85a5fca
Compare
3 tasks
teh-cmc
approved these changes
Aug 9, 2023
9ac33f0 to
088e540
Compare
Wumpf
added a commit
that referenced
this pull request
Aug 9, 2023
### What * depends on #2937 * part of #2919 * fixes #2791 Roundtrip test is part of #2937 Does not yet work in viewer because of #2871 C++ extensions now get additional includes copied into the generated header Extensions circle around making use of the `Transform3D` archetype easy. Note that the willingness of a c++ compiler to convert arrays and floats to bool causes us quite a lot of extra overloads (luckily the added unit tests catches these and there are warnings emitted). The amount of overloads introduced leaves a bit of a bad taste, but the expectation is that this is rather special to `Transform3D`. Some of the provided overloads may be generated in the future if a pattern emerges. A bunch of code example added to demonstrate what it looks like now to use Transform3D: ```cpp // translation only rr_stream.log("translated", rr::artchetypes::Transform3D({1.0f, 0.0f, 0.0f})); // translation/rotation/uniform-scale rr_stream.log( "rotated_scaled", rr::archetypes::Transform3D( rrd::RotationAxisAngle({0.0f, 0.0f, 1.0f}, rrd::Angle::radians(pi / 4.0f)), 2.0f ) ); // 3x3 matrix rec_stream.log( "translation_and_mat3x3/rotation", rr::archetypes::Transform3D({ {1.0f, 4.0f, 7.0f}, {2.0f, 5.0f, 8.0f}, {3.0f, 6.0f, 9.0f}, }) ); ``` ### Checklist * [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/2940) (if applicable) - [PR Build Summary](https://build.rerun.io/pr/2940) - [Docs preview](https://rerun.io/preview/pr%3Aandreas%2Fcpp%2Ftransform3d/docs) - [Examples preview](https://rerun.io/preview/pr%3Aandreas%2Fcpp%2Ftransform3d/examples)
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.
Part of:
Transform3D+DisconnectedTransformmigration to archetypes #2791What
Major facelift of the C++ codegen as it got restructured to support more support more nested kind of serialization and moved away entirely from using the arrow type registry at all (this happened originally due to c&p from Rust without understanding the details; this change makes a lot of the code a lot simpler!)
In order to test the new nested serialization this also enables the transform 3d roundtrip test which required adding some extensions on various datatypes to make the test code readable.
These are not the transform related final extensions. More is under way in a future PR to make transform usable.
The resulting transforms can't yet be loaded in the viewer due to #2871
The only remaining cases that don't produce (presumably until tested) correct serialization now are:
(they are not particularly hard to solve, just left out of this PR)
Checklist