pub struct SemanticScene<ObjectCategory, RegionCategory> { /* private fields */ }Expand description
Scene containing semantically annotated levels, regions, and objects.
A scene owns its levels, levels own their regions, and regions own their objects. Category payloads are dataset-specific generic types.
Implementations§
Source§impl<ObjectCategory, RegionCategory> SemanticScene<ObjectCategory, RegionCategory>
impl<ObjectCategory, RegionCategory> SemanticScene<ObjectCategory, RegionCategory>
Sourcepub fn from_parts(
name: impl Into<String>,
label: impl Into<String>,
counts: HashMap<&'static str, usize>,
aabb: Option<Aabb>,
levels: Vec<SemanticLevel<ObjectCategory, RegionCategory>>,
) -> Self
pub fn from_parts( name: impl Into<String>, label: impl Into<String>, counts: HashMap<&'static str, usize>, aabb: Option<Aabb>, levels: Vec<SemanticLevel<ObjectCategory, RegionCategory>>, ) -> Self
Creates a scene from its nested model parts.
The levels vector owns the full nested scene graph: levels contain
regions, and regions contain objects. counts stores descriptor header
counts by their dataset-specific names.
Sourcepub const fn aabb(&self) -> Option<&Aabb>
pub const fn aabb(&self) -> Option<&Aabb>
Returns the scene axis-aligned bounding box.
This is optional because a malformed or partially built scene may not have a parsed header.
Sourcepub fn levels(&self) -> &[SemanticLevel<ObjectCategory, RegionCategory>]
pub fn levels(&self) -> &[SemanticLevel<ObjectCategory, RegionCategory>]
Returns all levels in the scene.
Sourcepub fn regions(
&self,
) -> impl Iterator<Item = &SemanticRegion<ObjectCategory, RegionCategory>>
pub fn regions( &self, ) -> impl Iterator<Item = &SemanticRegion<ObjectCategory, RegionCategory>>
Returns all regions in the scene.
Sourcepub fn objects(&self) -> impl Iterator<Item = &SemanticObject<ObjectCategory>>
pub fn objects(&self) -> impl Iterator<Item = &SemanticObject<ObjectCategory>>
Returns all semantic objects in the scene.
Source§impl SemanticScene<(), ()>
impl SemanticScene<(), ()>
Sourcepub fn load<D: Dataset>(
path: impl AsRef<Path>,
options: D::Options,
) -> Result<SemanticScene<D::ObjectCategory, D::RegionCategory>, D::Error>
pub fn load<D: Dataset>( path: impl AsRef<Path>, options: D::Options, ) -> Result<SemanticScene<D::ObjectCategory, D::RegionCategory>, D::Error>
Loads a scene from a path using a dataset implementation.
§Errors
Returns I/O errors from opening the file or dataset-specific parse and validation failures.
Sourcepub fn from_reader<D: Dataset, R: BufRead>(
reader: R,
options: D::Options,
) -> Result<SemanticScene<D::ObjectCategory, D::RegionCategory>, D::Error>
pub fn from_reader<D: Dataset, R: BufRead>( reader: R, options: D::Options, ) -> Result<SemanticScene<D::ObjectCategory, D::RegionCategory>, D::Error>
Loads a scene from any buffered reader using a dataset implementation.
§Errors
Returns dataset-specific I/O, parse, and validation failures.
Sourcepub fn from_str<D: Dataset>(
input: &str,
options: D::Options,
) -> Result<SemanticScene<D::ObjectCategory, D::RegionCategory>, D::Error>
pub fn from_str<D: Dataset>( input: &str, options: D::Options, ) -> Result<SemanticScene<D::ObjectCategory, D::RegionCategory>, D::Error>
Loads a scene from an in-memory string using a dataset implementation.
§Errors
Returns dataset-specific parse and validation failures.
Trait Implementations§
Source§impl<ObjectCategory: Clone, RegionCategory: Clone> Clone for SemanticScene<ObjectCategory, RegionCategory>
impl<ObjectCategory: Clone, RegionCategory: Clone> Clone for SemanticScene<ObjectCategory, RegionCategory>
Source§fn clone(&self) -> SemanticScene<ObjectCategory, RegionCategory>
fn clone(&self) -> SemanticScene<ObjectCategory, RegionCategory>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more