Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getters for aabb min and max #44

Merged
merged 5 commits into from
Jul 18, 2023
Merged

Conversation

rosaliedewinther
Copy link
Contributor

Adds getters for aabb information. These fields should always be present as seen here https://github.com/AcademySoftwareFoundation/openvdb/blob/master/openvdb/openvdb/Grid.cc#L380

src/data_structure.rs Outdated Show resolved Hide resolved
src/data_structure.rs Outdated Show resolved Hide resolved
src/data_structure.rs Outdated Show resolved Hide resolved
Comment on lines 46 to 50
match self.grid_descriptor.meta_data.0["file_bbox_max"] {
MetadataValue::Vec3i(v) => Ok(v),
_ => Err(MetadataError::FieldNotPresent("file_bbox_max".to_string())),
}
}
Copy link
Member

@MarijnS95 MarijnS95 Jul 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there more occurrences of this pattern, which could be reworked behind a single (private) helper function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only somewhat similar pattern is https://github.com/Traverse-Research/vdb-rs/pull/43/files but we are keeping that out of the library

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a pattern that could present itself in the near future again, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm this will get pretty messy as we are actively working around the type system.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added all fields from https://github.com/AcademySoftwareFoundation/openvdb/blob/master/openvdb/openvdb/Grid.cc#L387 maybe in a followup PR we can make a more generic way of accessing these metadata values.

@rosaliedewinther rosaliedewinther merged commit 926596c into main Jul 18, 2023
@rosaliedewinther rosaliedewinther deleted the aabb_data_getters branch July 18, 2023 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants