Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Jul 19, 2023
1 parent e2e07da commit 2747f51
Show file tree
Hide file tree
Showing 32 changed files with 412 additions and 111 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
**/Makefile
**/cmake_install.cmake
_deps
**/.cache/

# Rust compile target directory:
**/target
Expand Down
56 changes: 37 additions & 19 deletions crates/re_log_types/src/data_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1140,12 +1140,14 @@ impl DataTable {
for (c1, c2) in cells1.0.iter().zip(&cells2.0) {
if c1 != c2 {
anyhow::ensure!(
c1.total_size_bytes() == c2.total_size_bytes(),
"Found discrepancy in row #{ri}, cells' sizes don't match! {} ({}) vs. {} ({}) bytes",
c1.total_size_bytes(),
c1.component_name(),
c2.total_size_bytes(),
c2.component_name(),
c1.datatype() == c2.datatype(),
"Found discrepancy in row #{ri}, cells' datatypes don't match!\n{}",
similar_asserts::SimpleDiff::from_str(
&format!("{:?}", c1.datatype()),
&format!("{:?}", c2.datatype()),
"cell1",
"cell2"
)
);

let arr1 = c1.as_arrow_ref();
Expand Down Expand Up @@ -1192,19 +1194,35 @@ impl DataTable {
}
}

anyhow::ensure!(
timepoint1 == timepoint2
&& entity_path1 == entity_path2
&& num_instances1 == num_instances2
&& cells1 == cells2,
"Found discrepancy in row #{ri}:\n{}",
similar_asserts::SimpleDiff::from_str(
&row1.to_string(),
&row2.to_string(),
"row1",
"row2"
),
);
let mut size_mismatches = vec![];
for (c1, c2) in cells1.0.iter().zip(&cells2.0) {
if c1.total_size_bytes() != c2.total_size_bytes() {
size_mismatches.push(format!(
"Found discrepancy in row #{ri}, cells' sizes don't match! {} ({}) vs. {} ({}) bytes",
c1.total_size_bytes(),
c1.component_name(),
c2.total_size_bytes(),
c2.component_name(),
));
}
}

eprintln!("{}", size_mismatches.join("\n"));

// anyhow::ensure!(
// timepoint1 == timepoint2
// && entity_path1 == entity_path2
// && num_instances1 == num_instances2
// && cells1 == cells2,
// "Found discrepancy in row #{ri}:\n{}\n{}",
// similar_asserts::SimpleDiff::from_str(
// &row1.to_string(),
// &row2.to_string(),
// "row1",
// "row2"
// ),
// size_mismatches.join("\n"),
// );
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/re_types/source_hash.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is a sha256 hash for all direct and indirect dependencies of this crate's build script.
# It can be safely removed at anytime to force the build script to run again.
# Check out build.rs to see how it's computed.
ba58a7d123c5fa81f04a58a6325ef65029d93f330d571176101db87596a9c0cf
8d80b56e7704b2bb83c08e4c1d6859865a924008aff94ead683bdc60b763aab6
60 changes: 58 additions & 2 deletions crates/re_types/src/archetypes/transform3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,64 @@
#![allow(clippy::too_many_lines)]
#![allow(clippy::unnecessary_cast)]

/// A 3D transform
#[derive(Clone, Debug)]
/// A 3D transform.
///
/// ## Example
///
/// ```ignore
/// use rerun::{
/// experimental::{
/// archetypes::Transform3D,
/// datatypes::{
/// Angle, Mat3x3, RotationAxisAngle, Scale3D, TranslationAndMat3x3,
/// TranslationRotationScale3D,
/// },
/// },
/// MsgSender, RecordingStreamBuilder,
/// };
/// use std::f32::consts::PI;
///
/// fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let (rec_stream, storage) = RecordingStreamBuilder::new("transform").memory()?;
///
/// let arrow = rerun::components::Arrow3D {
/// origin: rerun::components::Vec3D::from([0.0, 0.0, 0.0]),
/// vector: rerun::components::Vec3D::from([0.0, 1.0, 0.0]),
/// };
///
/// MsgSender::new("base")
/// .with_component(&[arrow])?
/// .send(&rec_stream)?;
///
/// MsgSender::from_archetype(
/// "base/translated",
/// &Transform3D::new(TranslationAndMat3x3::new([1.0, 0.0, 0.0], Mat3x3::IDENTITY)),
/// )?
/// .send(&rec_stream)?;
///
/// MsgSender::new("base/translated")
/// .with_component(&[arrow])?
/// .send(&rec_stream)?;
///
/// MsgSender::from_archetype(
/// "base/rotated_scaled",
/// &Transform3D::new(TranslationRotationScale3D {
/// rotation: Some(RotationAxisAngle::new([0.0, 0.0, 1.0], Angle::Radians(PI / 4.)).into()),
/// scale: Some(Scale3D::from(2.0)),
/// ..Default::default()
/// }),
/// )?
/// .send(&rec_stream)?;
///
/// MsgSender::new("base/rotated_scaled")
/// .with_component(&[arrow])?
/// .send(&rec_stream)?;
///
/// rerun::native_viewer::show(storage.take())?;
/// Ok(())
/// }
/// ```
#[derive(Clone, Debug, PartialEq)]
pub struct Transform3D {
/// The transform
pub transform: crate::components::Transform3D,
Expand Down
36 changes: 18 additions & 18 deletions crates/re_types/src/components/fuzzy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2566,7 +2566,7 @@ impl crate::Loggable for AffixFuzzer14 {
metadata: [].into(),
},
],
None,
Some(vec![0i32, 1i32, 2i32, 3i32, 4i32]),
UnionMode::Dense,
)
}
Expand Down Expand Up @@ -2798,7 +2798,7 @@ impl crate::Loggable for AffixFuzzer15 {
metadata: [].into(),
},
],
None,
Some(vec![0i32, 1i32, 2i32, 3i32, 4i32]),
UnionMode::Dense,
)
}
Expand Down Expand Up @@ -3030,7 +3030,7 @@ impl crate::Loggable for AffixFuzzer16 {
metadata: [].into(),
},
],
None,
Some(vec![0i32, 1i32, 2i32, 3i32, 4i32]),
UnionMode::Dense,
),
is_nullable: false,
Expand Down Expand Up @@ -3217,7 +3217,7 @@ impl crate::Loggable for AffixFuzzer16 {
metadata: [].into(),
},
],
None,
Some(vec![0i32, 1i32, 2i32, 3i32, 4i32]),
UnionMode::Dense,
),
is_nullable: false,
Expand Down Expand Up @@ -3477,7 +3477,7 @@ impl crate::Loggable for AffixFuzzer17 {
metadata: [].into(),
},
],
None,
Some(vec![0i32, 1i32, 2i32, 3i32, 4i32]),
UnionMode::Dense,
),
is_nullable: true,
Expand Down Expand Up @@ -3666,7 +3666,7 @@ impl crate::Loggable for AffixFuzzer17 {
metadata: [].into(),
},
],
None,
Some(vec![0i32, 1i32, 2i32, 3i32, 4i32]),
UnionMode::Dense,
),
is_nullable: true,
Expand Down Expand Up @@ -3932,7 +3932,7 @@ impl crate::Loggable for AffixFuzzer18 {
metadata: [].into(),
},
],
None,
Some(vec![0i32, 1i32, 2i32, 3i32, 4i32]),
UnionMode::Dense,
),
is_nullable: false,
Expand Down Expand Up @@ -4063,7 +4063,7 @@ impl crate::Loggable for AffixFuzzer18 {
metadata: [].into(),
},
],
None,
Some(vec![0i32, 1i32, 2i32, 3i32, 4i32]),
UnionMode::Dense,
),
is_nullable: false,
Expand Down Expand Up @@ -4197,7 +4197,7 @@ impl crate::Loggable for AffixFuzzer18 {
metadata: [].into(),
},
],
None,
Some(vec![0i32, 1i32, 2i32, 3i32, 4i32]),
UnionMode::Dense,
),
is_nullable: true,
Expand All @@ -4207,7 +4207,7 @@ impl crate::Loggable for AffixFuzzer18 {
metadata: [].into(),
},
],
None,
Some(vec![0i32, 1i32, 2i32, 3i32]),
UnionMode::Dense,
),
is_nullable: true,
Expand Down Expand Up @@ -4304,7 +4304,7 @@ impl crate::Loggable for AffixFuzzer18 {

) , 3usize) , is_nullable : false , metadata : [] . into () , }

,] , None , UnionMode :: Dense) , is_nullable : false , metadata : [] . into () , }
,] , Some (vec ! [0i32 , 1i32 , 2i32 , 3i32 , 4i32 ,]) , UnionMode :: Dense) , is_nullable : false , metadata : [] . into () , }

, Field { name : "many_required" . to_owned () , data_type : DataType :: List (Box :: new (Field { name : "item" . to_owned () , data_type : DataType :: Union (vec ! [Field { name : "_null_markers" . to_owned () , data_type : DataType :: Null , is_nullable : true , metadata : [] . into () , }

Expand Down Expand Up @@ -4346,7 +4346,7 @@ impl crate::Loggable for AffixFuzzer18 {

) , 3usize) , is_nullable : false , metadata : [] . into () , }

,] , None , UnionMode :: Dense) , is_nullable : false , metadata : [] . into () , }
,] , Some (vec ! [0i32 , 1i32 , 2i32 , 3i32 , 4i32 ,]) , UnionMode :: Dense) , is_nullable : false , metadata : [] . into () , }

)) , is_nullable : false , metadata : [] . into () , }

Expand Down Expand Up @@ -4390,11 +4390,11 @@ impl crate::Loggable for AffixFuzzer18 {

) , 3usize) , is_nullable : false , metadata : [] . into () , }

,] , None , UnionMode :: Dense) , is_nullable : true , metadata : [] . into () , }
,] , Some (vec ! [0i32 , 1i32 , 2i32 , 3i32 , 4i32 ,]) , UnionMode :: Dense) , is_nullable : true , metadata : [] . into () , }

)) , is_nullable : false , metadata : [] . into () , }

,] , None , UnionMode :: Dense) , is_nullable : true , metadata : [] . into () , }
,] , Some (vec ! [0i32 , 1i32 , 2i32 , 3i32 ,]) , UnionMode :: Dense) , is_nullable : true , metadata : [] . into () , }

))) , None) . to_logical_type () . clone () }

Expand Down Expand Up @@ -4644,7 +4644,7 @@ impl crate::Loggable for AffixFuzzer19 {
metadata: [].into(),
},
],
None,
Some(vec![0i32, 1i32, 2i32, 3i32, 4i32]),
UnionMode::Dense,
),
is_nullable: false,
Expand Down Expand Up @@ -4775,7 +4775,7 @@ impl crate::Loggable for AffixFuzzer19 {
metadata: [].into(),
},
],
None,
Some(vec![0i32, 1i32, 2i32, 3i32, 4i32]),
UnionMode::Dense,
),
is_nullable: false,
Expand Down Expand Up @@ -4909,7 +4909,7 @@ impl crate::Loggable for AffixFuzzer19 {
metadata: [].into(),
},
],
None,
Some(vec![0i32, 1i32, 2i32, 3i32, 4i32]),
UnionMode::Dense,
),
is_nullable: true,
Expand All @@ -4919,7 +4919,7 @@ impl crate::Loggable for AffixFuzzer19 {
metadata: [].into(),
},
],
None,
Some(vec![0i32, 1i32, 2i32, 3i32]),
UnionMode::Dense,
),
is_nullable: true,
Expand Down
1 change: 1 addition & 0 deletions crates/re_types/src/components/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ mod point2d_ext;
mod radius;
mod radius_ext;
mod transform3d;
mod transform3d_ext;

pub use self::class_id::ClassId;
pub use self::color::Color;
Expand Down
Loading

0 comments on commit 2747f51

Please sign in to comment.