Fix #244 and provide instances by entity type without subtypes

This commit is contained in:
Thomas Krijnen
2017-08-16 21:46:39 +02:00
parent b019ff6aed
commit 490c35bf60
9 changed files with 138 additions and 15 deletions
+18
View File
@@ -42,6 +42,8 @@ private:
%ignore IfcParse::IfcSpfHeader::stream;
%ignore IfcParse::HeaderEntity::is;
%ignore IfcParse::IfcFile::type_iterator;
%ignore IfcUtil::IfcBaseClass::is;
%rename("by_id") entityById;
@@ -80,6 +82,22 @@ private:
return keys;
}
std::vector<std::string> types() const {
const size_t n = std::distance($self->types_begin(), $self->types_end());
std::vector<std::string> ts;
ts.reserve(n);
std::transform($self->types_begin(), $self->types_end(), std::back_inserter(ts), IfcSchema::Type::ToString);
return ts;
}
std::vector<std::string> types_with_super() const {
const size_t n = std::distance($self->types_incl_super_begin(), $self->types_incl_super_end());
std::vector<std::string> ts;
ts.reserve(n);
std::transform($self->types_incl_super_begin(), $self->types_incl_super_end(), std::back_inserter(ts), IfcSchema::Type::ToString);
return ts;
}
%pythoncode %{
if _newclass:
# Hide the getters with read-only property implementations