private SimpleBuildingElementType GetTypeFromHierarchy(IfcTypeProduct type) { return (GetTypeFromHierarchy(type, Root)); }
public SimpleBuildingElementType(IfcTypeProduct type) { _type = type; Init(); }
private static SimpleBuildingElementType GetTypeFromHierarchy(IfcTypeProduct type, SimpleGroup group) { SimpleBuildingElementType simpleType = group._buildingElementTypes.Where(t => t.IfcType == type).FirstOrDefault(); if (simpleType != null) return simpleType; foreach (var subGroup in group._children) { simpleType = GetTypeFromHierarchy(type, subGroup); if (simpleType != null) return simpleType; } return null; }
void RelationChanged(object sender, PropertyChangedEventArgs e) { //this would mean major change and it is necessary to recompute everything if (e.PropertyName == "RelatingType" || e.PropertyName == "RelatedObjects") { IfcRelDefinesByType rel = sender as IfcRelDefinesByType; IfcTypeProduct type = rel.RelatingType as IfcTypeProduct; if (type == null) return; _type = type; Init(); OnPropertyChanged("Name"); OnPropertyChanged("Elements"); OnPropertyChanged("ElementsCarbonData"); OnPropertyChanged("CarbonData"); } }