ifc_lite_geometry/router/voids/
representation.rs1use crate::GeometryRouter;
6use ifc_lite_core::{EntityDecoder, IfcType};
7
8impl GeometryRouter {
9 pub fn opening_requires_subtraction(&self, id:u32, decoder:&mut EntityDecoder<'_>)->bool {
14 let reference_only=(|| {
15 let opening=decoder.decode_by_id(id).ok()?;
16 if !opening.ifc_type.is_subtype_of(IfcType::IfcOpeningElement) {return None;}
17 let pds=decoder.decode_by_id(opening.get_ref(6)?).ok()?;
18 if pds.ifc_type!=IfcType::IfcProductDefinitionShape {return None;}
19 let representations=pds.get_list(2)?;
20 if representations.is_empty() || representations.len()>64 {return None;}
21 let mut reference=false;
22 for value in representations {
23 let representation=decoder.decode_by_id(value.as_entity_ref()?).ok()?;
24 if representation.ifc_type!=IfcType::IfcShapeRepresentation {return None;}
25 match crate::router::effective_element_rep_type(&opening,&representation) {
26 Some("Reference")=>reference=true,
27 Some("BoundingBox")=>{},
28 _=>return None,
29 }
30 }
31 Some(reference)
32 })();
33 reference_only!=Some(true)
34 }
35}