pub struct SpatialNode {
pub id: EntityId,
pub node_type: SpatialNodeType,
pub name: String,
pub entity_type: String,
pub elevation: Option<f32>,
pub children: Vec<SpatialNode>,
pub has_geometry: bool,
}Expand description
Node in the spatial hierarchy tree
Represents an entry in the IFC spatial structure hierarchy. The tree typically follows: Project → Site → Building → Storey → Elements
Fields§
§id: EntityIdEntity ID
node_type: SpatialNodeTypeType of spatial node
name: StringDisplay name
entity_type: StringIFC entity type name (e.g., “IfcWall”)
elevation: Option<f32>Elevation (for storeys)
children: Vec<SpatialNode>Child nodes
has_geometry: boolWhether this entity has geometry
Implementations§
Source§impl SpatialNode
impl SpatialNode
Sourcepub fn new(
id: EntityId,
node_type: SpatialNodeType,
name: impl Into<String>,
entity_type: impl Into<String>,
) -> Self
pub fn new( id: EntityId, node_type: SpatialNodeType, name: impl Into<String>, entity_type: impl Into<String>, ) -> Self
Create a new spatial node
Sourcepub fn with_elevation(self, elevation: f32) -> Self
pub fn with_elevation(self, elevation: f32) -> Self
Set elevation
Sourcepub fn with_geometry(self, has_geometry: bool) -> Self
pub fn with_geometry(self, has_geometry: bool) -> Self
Set has_geometry flag
Sourcepub fn add_child(&mut self, child: SpatialNode)
pub fn add_child(&mut self, child: SpatialNode)
Add a child node
Sourcepub fn element_count(&self) -> usize
pub fn element_count(&self) -> usize
Get total element count (recursive)
Sourcepub fn find(&self, id: EntityId) -> Option<&SpatialNode>
pub fn find(&self, id: EntityId) -> Option<&SpatialNode>
Find a node by ID (recursive)
Sourcepub fn find_mut(&mut self, id: EntityId) -> Option<&mut SpatialNode>
pub fn find_mut(&mut self, id: EntityId) -> Option<&mut SpatialNode>
Find a node by ID (mutable, recursive)
Sourcepub fn iter(&self) -> SpatialNodeIter<'_> ⓘ
pub fn iter(&self) -> SpatialNodeIter<'_> ⓘ
Iterate all nodes (depth-first)
Sourcepub fn element_ids(&self) -> Vec<EntityId>
pub fn element_ids(&self) -> Vec<EntityId>
Get all element IDs in this subtree
Trait Implementations§
Source§impl Clone for SpatialNode
impl Clone for SpatialNode
Source§fn clone(&self) -> SpatialNode
fn clone(&self) -> SpatialNode
Returns a duplicate of the value. Read more
1.0.0 · 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 SpatialNode
impl Debug for SpatialNode
Source§impl<'de> Deserialize<'de> for SpatialNode
impl<'de> Deserialize<'de> for SpatialNode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SpatialNode
impl PartialEq for SpatialNode
Source§impl Serialize for SpatialNode
impl Serialize for SpatialNode
impl StructuralPartialEq for SpatialNode
Auto Trait Implementations§
impl Freeze for SpatialNode
impl RefUnwindSafe for SpatialNode
impl Send for SpatialNode
impl Sync for SpatialNode
impl Unpin for SpatialNode
impl UnsafeUnpin for SpatialNode
impl UnwindSafe for SpatialNode
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