pub struct SemanticObject { /* private fields */ }Expand description
Represents a distinct semantically annotated object.
The source index is also the object’s semantic id, matching Habitat-Sim’s
SemanticObject::semanticID().
Implementations§
Source§impl SemanticObject
impl SemanticObject
Sourcepub fn id(&self, scene: &SemanticScene) -> String
pub fn id(&self, scene: &SemanticScene) -> String
Returns the Habitat-Sim-style object id.
If the object has a parent region, the form is
<level_id>_<region_id>_<object_id>. Otherwise, the form is
_<object_id>.
Sourcepub const fn semantic_id(&self) -> i32
pub const fn semantic_id(&self) -> i32
Returns the unique semantic id corresponding to this object.
Sourcepub const fn region_index(&self) -> Option<usize>
pub const fn region_index(&self) -> Option<usize>
Returns the index of this object’s parent region in SemanticScene::regions.
Sourcepub const fn category_index(&self) -> Option<usize>
pub const fn category_index(&self) -> Option<usize>
Returns the index of this object’s category in SemanticScene::categories.
Trait Implementations§
Source§impl Clone for SemanticObject
impl Clone for SemanticObject
Source§fn clone(&self) -> SemanticObject
fn clone(&self) -> SemanticObject
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SemanticObject
impl Debug for SemanticObject
Source§impl Display for SemanticObject
impl Display for SemanticObject
Source§impl PartialEq for SemanticObject
impl PartialEq for SemanticObject
Source§fn eq(&self, other: &SemanticObject) -> bool
fn eq(&self, other: &SemanticObject) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SemanticObject
Auto Trait Implementations§
impl Freeze for SemanticObject
impl RefUnwindSafe for SemanticObject
impl Send for SemanticObject
impl Sync for SemanticObject
impl Unpin for SemanticObject
impl UnsafeUnpin for SemanticObject
impl UnwindSafe for SemanticObject
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more