-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathopening_collector.cpp
More file actions
31 lines (27 loc) · 920 Bytes
/
opening_collector.cpp
File metadata and controls
31 lines (27 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "opening_collector.h"
void opening_collector::init(IfcParse::IfcFile * f) {
auto rels = f->instances_by_type("IfcRelVoidsElement");
if (!rels) {
return;
}
for (auto& rel : *rels) {
auto be = (IfcUtil::IfcBaseEntity*) ((IfcUtil::IfcBaseEntity*)rel)->get_value<IfcUtil::IfcBaseClass*>("RelatingBuildingElement");
auto op = (IfcUtil::IfcBaseEntity*) ((IfcUtil::IfcBaseEntity*)rel)->get_value<IfcUtil::IfcBaseClass*>("RelatedOpeningElement");
opening_to_elem.insert({ op, be });
}
}
opening_collector::opening_collector(IfcParse::IfcFile * f) {
init(f);
}
opening_collector::opening_collector(const std::vector<IfcParse::IfcFile*>& fs) {
for (auto f : fs) {
init(f);
}
}
void opening_collector::operator()(shape_callback_item* item) {
auto opit = opening_to_elem.find(item->src);
if (opit != opening_to_elem.end()) {
list.push_back(item);
map.insert({ opit->second, list.back() });
}
}