use of org.bimserver.models.ifc2x3tc1.IfcSpatialStructureElement in project BIMserver by opensourceBIM.
the class IfcUtils method getDecompositionAndContainmentRecursive.
public static Set<IfcProduct> getDecompositionAndContainmentRecursive(Set<IfcProduct> result, IfcObjectDefinition parent) {
for (IfcRelDecomposes ifcRelDecomposes : parent.getIsDecomposedBy()) {
for (IfcObjectDefinition ifcObjectDefinition : ifcRelDecomposes.getRelatedObjects()) {
if (ifcObjectDefinition instanceof IfcProduct) {
result.add((IfcProduct) ifcObjectDefinition);
}
getDecompositionAndContainmentRecursive(result, ifcObjectDefinition);
}
}
if (parent instanceof IfcSpatialStructureElement) {
IfcSpatialStructureElement ifcSpatialStructureElement = (IfcSpatialStructureElement) parent;
for (IfcRelContainedInSpatialStructure ifcRelContainedInSpatialStructure : ifcSpatialStructureElement.getContainsElements()) {
for (IfcProduct ifcProduct : ifcRelContainedInSpatialStructure.getRelatedElements()) {
result.add(ifcProduct);
getDecompositionAndContainmentRecursive(result, ifcProduct);
}
}
}
return result;
}
use of org.bimserver.models.ifc2x3tc1.IfcSpatialStructureElement in project BIMserver by opensourceBIM.
the class RichIfcModel method addContains.
public void addContains(IfcSpatialStructureElement parent, IfcProduct... children) throws IfcModelInterfaceException {
IfcRelContainedInSpatialStructure rel = this.create(IfcRelContainedInSpatialStructure.class);
rel.setRelatingStructure(parent);
for (IfcProduct child : children) {
rel.getRelatedElements().add(child);
}
}
Aggregations