Skip to content

Commit

Permalink
no need to track time range anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Apr 19, 2024
1 parent cbf3314 commit 8a3356c
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 123 deletions.
30 changes: 15 additions & 15 deletions crates/re_space_view_spatial/src/visualizers/arrows2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,14 @@ impl VisualizerSystem for Arrows2DVisualizer {

let resolver = ctx.recording().resolver();

let vectors = match results.get_dense::<Vector2D>(resolver, _query) {
let vectors = match results.get_dense::<Vector2D>(resolver) {
Some(Ok(vectors)) => vectors,
Some(err @ Err(_)) => err?,
_ => return Ok(()),
};

let num_vectors = vectors
.range_indexed(_query.range())
.range_indexed()
.map(|(_, vectors)| vectors.len())
.sum::<usize>();
if num_vectors == 0 {
Expand All @@ -285,21 +285,21 @@ impl VisualizerSystem for Arrows2DVisualizer {
line_builder.reserve_strips(num_vectors)?;
line_builder.reserve_vertices(num_vectors * 2)?;

let origins = results.get_or_empty_dense(resolver, _query)?;
let colors = results.get_or_empty_dense(resolver, _query)?;
let radii = results.get_or_empty_dense(resolver, _query)?;
let labels = results.get_or_empty_dense(resolver, _query)?;
let class_ids = results.get_or_empty_dense(resolver, _query)?;
let keypoint_ids = results.get_or_empty_dense(resolver, _query)?;
let origins = results.get_or_empty_dense(resolver)?;
let colors = results.get_or_empty_dense(resolver)?;
let radii = results.get_or_empty_dense(resolver)?;
let labels = results.get_or_empty_dense(resolver)?;
let class_ids = results.get_or_empty_dense(resolver)?;
let keypoint_ids = results.get_or_empty_dense(resolver)?;

let data = range_zip_1x6(
vectors.range_indexed(_query.range()),
origins.range_indexed(_query.range()),
colors.range_indexed(_query.range()),
radii.range_indexed(_query.range()),
labels.range_indexed(_query.range()),
class_ids.range_indexed(_query.range()),
keypoint_ids.range_indexed(_query.range()),
vectors.range_indexed(),
origins.range_indexed(),
colors.range_indexed(),
radii.range_indexed(),
labels.range_indexed(),
class_ids.range_indexed(),
keypoint_ids.range_indexed(),
)
.map(
|(
Expand Down
30 changes: 15 additions & 15 deletions crates/re_space_view_spatial/src/visualizers/arrows3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,14 @@ impl VisualizerSystem for Arrows3DVisualizer {

let resolver = ctx.recording().resolver();

let vectors = match results.get_dense::<Vector3D>(resolver, _query) {
let vectors = match results.get_dense::<Vector3D>(resolver) {
Some(Ok(vectors)) => vectors,
Some(err @ Err(_)) => err?,
_ => return Ok(()),
};

let num_vectors = vectors
.range_indexed(_query.range())
.range_indexed()
.map(|(_, vectors)| vectors.len())
.sum::<usize>();
if num_vectors == 0 {
Expand All @@ -288,21 +288,21 @@ impl VisualizerSystem for Arrows3DVisualizer {
line_builder.reserve_strips(num_vectors)?;
line_builder.reserve_vertices(num_vectors * 2)?;

let origins = results.get_or_empty_dense(resolver, _query)?;
let colors = results.get_or_empty_dense(resolver, _query)?;
let radii = results.get_or_empty_dense(resolver, _query)?;
let labels = results.get_or_empty_dense(resolver, _query)?;
let class_ids = results.get_or_empty_dense(resolver, _query)?;
let keypoint_ids = results.get_or_empty_dense(resolver, _query)?;
let origins = results.get_or_empty_dense(resolver)?;
let colors = results.get_or_empty_dense(resolver)?;
let radii = results.get_or_empty_dense(resolver)?;
let labels = results.get_or_empty_dense(resolver)?;
let class_ids = results.get_or_empty_dense(resolver)?;
let keypoint_ids = results.get_or_empty_dense(resolver)?;

let data = range_zip_1x6(
vectors.range_indexed(_query.range()),
origins.range_indexed(_query.range()),
colors.range_indexed(_query.range()),
radii.range_indexed(_query.range()),
labels.range_indexed(_query.range()),
class_ids.range_indexed(_query.range()),
keypoint_ids.range_indexed(_query.range()),
vectors.range_indexed(),
origins.range_indexed(),
colors.range_indexed(),
radii.range_indexed(),
labels.range_indexed(),
class_ids.range_indexed(),
keypoint_ids.range_indexed(),
)
.map(
|(
Expand Down
30 changes: 15 additions & 15 deletions crates/re_space_view_spatial/src/visualizers/boxes2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@ impl VisualizerSystem for Boxes2DVisualizer {

let resolver = ctx.recording().resolver();

let half_sizes = match results.get_dense::<HalfSizes2D>(resolver, _query) {
let half_sizes = match results.get_dense::<HalfSizes2D>(resolver) {
Some(Ok(vectors)) => vectors,
Some(err @ Err(_)) => err?,
_ => return Ok(()),
};

let num_boxes = half_sizes
.range_indexed(_query.range())
.range_indexed()
.map(|(_, vectors)| vectors.len())
.sum::<usize>();
if num_boxes == 0 {
Expand All @@ -283,21 +283,21 @@ impl VisualizerSystem for Boxes2DVisualizer {
line_builder.reserve_strips(num_boxes * 4)?;
line_builder.reserve_vertices(num_boxes * 4 * 2)?;

let centers = results.get_or_empty_dense(resolver, _query)?;
let colors = results.get_or_empty_dense(resolver, _query)?;
let radii = results.get_or_empty_dense(resolver, _query)?;
let labels = results.get_or_empty_dense(resolver, _query)?;
let class_ids = results.get_or_empty_dense(resolver, _query)?;
let keypoint_ids = results.get_or_empty_dense(resolver, _query)?;
let centers = results.get_or_empty_dense(resolver)?;
let colors = results.get_or_empty_dense(resolver)?;
let radii = results.get_or_empty_dense(resolver)?;
let labels = results.get_or_empty_dense(resolver)?;
let class_ids = results.get_or_empty_dense(resolver)?;
let keypoint_ids = results.get_or_empty_dense(resolver)?;

let data = range_zip_1x6(
half_sizes.range_indexed(_query.range()),
centers.range_indexed(_query.range()),
colors.range_indexed(_query.range()),
radii.range_indexed(_query.range()),
labels.range_indexed(_query.range()),
class_ids.range_indexed(_query.range()),
keypoint_ids.range_indexed(_query.range()),
half_sizes.range_indexed(),
centers.range_indexed(),
colors.range_indexed(),
radii.range_indexed(),
labels.range_indexed(),
class_ids.range_indexed(),
keypoint_ids.range_indexed(),
)
.map(
|(
Expand Down
34 changes: 17 additions & 17 deletions crates/re_space_view_spatial/src/visualizers/boxes3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,14 @@ impl VisualizerSystem for Boxes3DVisualizer {

let resolver = ctx.recording().resolver();

let half_sizes = match results.get_dense::<HalfSizes3D>(resolver, _query) {
let half_sizes = match results.get_dense::<HalfSizes3D>(resolver) {
Some(Ok(vectors)) => vectors,
Some(err @ Err(_)) => err?,
_ => return Ok(()),
};

let num_boxes = half_sizes
.range_indexed(_query.range())
.range_indexed()
.map(|(_, vectors)| vectors.len())
.sum::<usize>();
if num_boxes == 0 {
Expand All @@ -275,23 +275,23 @@ impl VisualizerSystem for Boxes3DVisualizer {
line_builder.reserve_strips(num_boxes * 12)?;
line_builder.reserve_vertices(num_boxes * 12 * 2)?;

let centers = results.get_or_empty_dense(resolver, _query)?;
let rotations = results.get_or_empty_dense(resolver, _query)?;
let colors = results.get_or_empty_dense(resolver, _query)?;
let radii = results.get_or_empty_dense(resolver, _query)?;
let labels = results.get_or_empty_dense(resolver, _query)?;
let class_ids = results.get_or_empty_dense(resolver, _query)?;
let keypoint_ids = results.get_or_empty_dense(resolver, _query)?;
let centers = results.get_or_empty_dense(resolver)?;
let rotations = results.get_or_empty_dense(resolver)?;
let colors = results.get_or_empty_dense(resolver)?;
let radii = results.get_or_empty_dense(resolver)?;
let labels = results.get_or_empty_dense(resolver)?;
let class_ids = results.get_or_empty_dense(resolver)?;
let keypoint_ids = results.get_or_empty_dense(resolver)?;

let data = range_zip_1x7(
half_sizes.range_indexed(_query.range()),
centers.range_indexed(_query.range()),
rotations.range_indexed(_query.range()),
colors.range_indexed(_query.range()),
radii.range_indexed(_query.range()),
labels.range_indexed(_query.range()),
class_ids.range_indexed(_query.range()),
keypoint_ids.range_indexed(_query.range()),
half_sizes.range_indexed(),
centers.range_indexed(),
rotations.range_indexed(),
colors.range_indexed(),
radii.range_indexed(),
labels.range_indexed(),
class_ids.range_indexed(),
keypoint_ids.range_indexed(),
)
.map(
|(
Expand Down
28 changes: 14 additions & 14 deletions crates/re_space_view_spatial/src/visualizers/lines2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,14 @@ impl VisualizerSystem for Lines2DVisualizer {

let resolver = ctx.recording().resolver();

let strips = match results.get_dense::<LineStrip2D>(resolver, _query) {
let strips = match results.get_dense::<LineStrip2D>(resolver) {
Some(Ok(strips)) => strips,
Some(err @ Err(_)) => err?,
_ => return Ok(()),
};

let num_strips = strips
.range_indexed(_query.range())
.range_indexed()
.map(|(_, strips)| strips.len())
.sum::<usize>();
if num_strips == 0 {
Expand All @@ -270,24 +270,24 @@ impl VisualizerSystem for Lines2DVisualizer {
line_builder.reserve_strips(num_strips)?;

let num_vertices = strips
.range_indexed(_query.range())
.range_indexed()
.map(|(_, strips)| strips.iter().map(|strip| strip.0.len()).sum::<usize>())
.sum::<usize>();
line_builder.reserve_vertices(num_vertices)?;

let colors = results.get_or_empty_dense(resolver, _query)?;
let radii = results.get_or_empty_dense(resolver, _query)?;
let labels = results.get_or_empty_dense(resolver, _query)?;
let class_ids = results.get_or_empty_dense(resolver, _query)?;
let keypoint_ids = results.get_or_empty_dense(resolver, _query)?;
let colors = results.get_or_empty_dense(resolver)?;
let radii = results.get_or_empty_dense(resolver)?;
let labels = results.get_or_empty_dense(resolver)?;
let class_ids = results.get_or_empty_dense(resolver)?;
let keypoint_ids = results.get_or_empty_dense(resolver)?;

let data = range_zip_1x5(
strips.range_indexed(_query.range()),
colors.range_indexed(_query.range()),
radii.range_indexed(_query.range()),
labels.range_indexed(_query.range()),
class_ids.range_indexed(_query.range()),
keypoint_ids.range_indexed(_query.range()),
strips.range_indexed(),
colors.range_indexed(),
radii.range_indexed(),
labels.range_indexed(),
class_ids.range_indexed(),
keypoint_ids.range_indexed(),
)
.map(
|(_index, strips, colors, radii, labels, class_ids, keypoint_ids)| {
Expand Down
28 changes: 14 additions & 14 deletions crates/re_space_view_spatial/src/visualizers/lines3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,14 @@ impl VisualizerSystem for Lines3DVisualizer {

let resolver = ctx.recording().resolver();

let strips = match results.get_dense::<LineStrip3D>(resolver, _query) {
let strips = match results.get_dense::<LineStrip3D>(resolver) {
Some(Ok(strips)) => strips,
Some(err @ Err(_)) => err?,
_ => return Ok(()),
};

let num_strips = strips
.range_indexed(_query.range())
.range_indexed()
.map(|(_, strips)| strips.len())
.sum::<usize>();
if num_strips == 0 {
Expand All @@ -279,24 +279,24 @@ impl VisualizerSystem for Lines3DVisualizer {
line_builder.reserve_strips(num_strips)?;

let num_vertices = strips
.range_indexed(_query.range())
.range_indexed()
.map(|(_, strips)| strips.iter().map(|strip| strip.0.len()).sum::<usize>())
.sum::<usize>();
line_builder.reserve_vertices(num_vertices)?;

let colors = results.get_or_empty_dense(resolver, _query)?;
let radii = results.get_or_empty_dense(resolver, _query)?;
let labels = results.get_or_empty_dense(resolver, _query)?;
let class_ids = results.get_or_empty_dense(resolver, _query)?;
let keypoint_ids = results.get_or_empty_dense(resolver, _query)?;
let colors = results.get_or_empty_dense(resolver)?;
let radii = results.get_or_empty_dense(resolver)?;
let labels = results.get_or_empty_dense(resolver)?;
let class_ids = results.get_or_empty_dense(resolver)?;
let keypoint_ids = results.get_or_empty_dense(resolver)?;

let data = range_zip_1x5(
strips.range_indexed(_query.range()),
colors.range_indexed(_query.range()),
radii.range_indexed(_query.range()),
labels.range_indexed(_query.range()),
class_ids.range_indexed(_query.range()),
keypoint_ids.range_indexed(_query.range()),
strips.range_indexed(),
colors.range_indexed(),
radii.range_indexed(),
labels.range_indexed(),
class_ids.range_indexed(),
keypoint_ids.range_indexed(),
)
.map(
|(_index, strips, colors, radii, labels, class_ids, keypoint_ids)| {
Expand Down
Loading

0 comments on commit 8a3356c

Please sign in to comment.