pub struct SemanticRegion<ObjectCategory, RegionCategory> { /* private fields */ }Expand description
Represents a semantic region, typically a room in a level of a house.
MP3D descriptors provide an AABB but not polyloop geometry. Polyloop-related accessors return empty slices unless a dataset supplies that geometry.
Implementations§
Source§impl<ObjectCategory, RegionCategory> SemanticRegion<ObjectCategory, RegionCategory>
impl<ObjectCategory, RegionCategory> SemanticRegion<ObjectCategory, RegionCategory>
Sourcepub fn new(
index: i32,
category: RegionCategory,
position: Vec3,
aabb: Aabb,
objects: Vec<SemanticObject<ObjectCategory>>,
) -> Self
pub fn new( index: i32, category: RegionCategory, position: Vec3, aabb: Aabb, objects: Vec<SemanticObject<ObjectCategory>>, ) -> Self
Creates a semantic region.
index is the original descriptor index for this region.
Sourcepub const fn category(&self) -> &RegionCategory
pub const fn category(&self) -> &RegionCategory
Returns the semantic category of the region.
Sourcepub fn objects(&self) -> &[SemanticObject<ObjectCategory>]
pub fn objects(&self) -> &[SemanticObject<ObjectCategory>]
Returns objects contained by this region.
Sourcepub fn contains(&self, point: Vec3) -> bool
pub fn contains(&self, point: Vec3) -> bool
Tests whether this region contains the point.
For MP3D-loaded scenes this uses the region AABB. Future descriptor loaders with polyloop geometry can provide tighter containment.
Sourcepub fn poly_loop_points(&self) -> &[Vec2]
pub fn poly_loop_points(&self) -> &[Vec2]
Returns points making up the region’s floor-parallel polyloop.
Sourcepub fn volume_edges(&self) -> &[Vec<Vec3>]
pub fn volume_edges(&self) -> &[Vec<Vec3>]
Returns bounding volume edges for visualization.
Sourcepub const fn floor_height(&self) -> f64
pub const fn floor_height(&self) -> f64
Returns the floor height above the x-z plane.
Sourcepub const fn extrusion_height(&self) -> f64
pub const fn extrusion_height(&self) -> f64
Returns the extrusion height above the floor.
Trait Implementations§
Source§impl<ObjectCategory: Clone, RegionCategory: Clone> Clone for SemanticRegion<ObjectCategory, RegionCategory>
impl<ObjectCategory: Clone, RegionCategory: Clone> Clone for SemanticRegion<ObjectCategory, RegionCategory>
Source§fn clone(&self) -> SemanticRegion<ObjectCategory, RegionCategory>
fn clone(&self) -> SemanticRegion<ObjectCategory, RegionCategory>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<ObjectCategory: Debug, RegionCategory: Debug> Debug for SemanticRegion<ObjectCategory, RegionCategory>
impl<ObjectCategory: Debug, RegionCategory: Debug> Debug for SemanticRegion<ObjectCategory, RegionCategory>
Source§impl<OC, RC: Display> Display for SemanticRegion<OC, RC>
impl<OC, RC: Display> Display for SemanticRegion<OC, RC>
Source§impl<ObjectCategory: PartialEq, RegionCategory: PartialEq> PartialEq for SemanticRegion<ObjectCategory, RegionCategory>
impl<ObjectCategory: PartialEq, RegionCategory: PartialEq> PartialEq for SemanticRegion<ObjectCategory, RegionCategory>
Source§fn eq(&self, other: &SemanticRegion<ObjectCategory, RegionCategory>) -> bool
fn eq(&self, other: &SemanticRegion<ObjectCategory, RegionCategory>) -> bool
self and other values to be equal, and is used by ==.