| 202 | |
| 203 | template <typename Schema> |
| 204 | typename Schema::IfcBuilding* IfcHierarchyHelper<Schema>::addBuilding(typename Schema::IfcSite* site, typename Schema::IfcOwnerHistory* owner_hist) { |
| 205 | if (!owner_hist) { |
| 206 | owner_hist = getSingle<typename Schema::IfcOwnerHistory>(); |
| 207 | } |
| 208 | if (!owner_hist) { |
| 209 | owner_hist = addOwnerHistory(); |
| 210 | } |
| 211 | if (!site) { |
| 212 | site = getSingle<typename Schema::IfcSite>(); |
| 213 | } |
| 214 | if (!site) { |
| 215 | site = addSite(0, owner_hist); |
| 216 | } |
| 217 | typename Schema::IfcBuilding* building = new typename Schema::IfcBuilding(IfcParse::IfcGlobalId(), |
| 218 | owner_hist, |
| 219 | boost::none, |
| 220 | boost::none, |
| 221 | boost::none, |
| 222 | addLocalPlacement(), |
| 223 | 0, |
| 224 | boost::none, |
| 225 | Schema::IfcElementCompositionEnum::IfcElementComposition_ELEMENT, |
| 226 | boost::none, |
| 227 | boost::none, |
| 228 | 0); |
| 229 | |
| 230 | addEntity(building); |
| 231 | addRelatedObject<typename Schema::IfcRelAggregates>(site, building, owner_hist); |
| 232 | relatePlacements(site, building); |
| 233 | |
| 234 | return building; |
| 235 | } |
| 236 | |
| 237 | template <typename Schema> |
| 238 | typename Schema::IfcBuildingStorey* IfcHierarchyHelper<Schema>::addBuildingStorey(typename Schema::IfcBuilding* building, |