mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Merge branch 'master' into v0.6.0
This commit is contained in:
@@ -1931,10 +1931,22 @@ IfcFile::type_iterator IfcFile::types_incl_super_end() const {
|
||||
return bytype.end();
|
||||
}
|
||||
|
||||
namespace {
|
||||
struct id_instance_pair_sorter {
|
||||
bool operator()(const IfcParse::IfcFile::entity_by_id_t::value_type& a, const IfcParse::IfcFile::entity_by_id_t::value_type& b) const {
|
||||
return a.first < b.first;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
std::ostream& operator<< (std::ostream& os, const IfcParse::IfcFile& f) {
|
||||
f.header().write(os);
|
||||
|
||||
for ( IfcFile::entity_by_id_t::const_iterator it = f.begin(); it != f.end(); ++ it ) {
|
||||
typedef std::vector<std::pair<unsigned int, IfcUtil::IfcBaseClass*> > vector_t;
|
||||
vector_t sorted(f.begin(), f.end());
|
||||
std::sort(sorted.begin(), sorted.end(), id_instance_pair_sorter());
|
||||
|
||||
for (vector_t::const_iterator it = sorted.begin(); it != sorted.end(); ++ it) {
|
||||
const IfcUtil::IfcBaseClass* e = it->second;
|
||||
if (e->declaration().as_entity()) {
|
||||
os << e->data().toString(true) << ";" << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user