IfcParse: get entities by type string

This commit is contained in:
Thomas Krijnen
2012-07-19 00:14:01 +00:00
parent 1d4a999381
commit 6ced646413
2 changed files with 9 additions and 0 deletions
+5
View File
@@ -812,6 +812,11 @@ IfcEntities Ifc::EntitiesByType(Ifc2x3::Type::Enum t) {
MapEntitiesByType::const_iterator it = bytype.find(t);
return (it == bytype.end()) ? IfcEntities() : it->second;
}
IfcEntities Ifc::EntitiesByType(const std::string& t) {
std::string ty = t;
for (std::string::iterator p = ty.begin(); p != ty.end(); ++p ) *p = toupper(*p);
return EntitiesByType(Ifc2x3::Type::FromString(ty));
}
IfcEntities Ifc::EntitiesByReference(int t) {
MapEntitiesByRef::const_iterator it = byref.find(t);
return (it == byref.end()) ? IfcEntities() : it->second;
+4
View File
@@ -257,6 +257,10 @@ public:
/// NOTE: This also returns subtypes of the requested type, for example:
/// IfcWall will also return IfcWallStandardCase entities
static IfcEntities EntitiesByType(Ifc2x3::Type::Enum t);
/// Returns all entities in the file that match the positional argument.
/// NOTE: This also returns subtypes of the requested type, for example:
/// IfcWall will also return IfcWallStandardCase entities
static IfcEntities EntitiesByType(const std::string& t);
/// Returns all entities in the file that reference the id
static IfcEntities EntitiesByReference(int id);
/// Returns the entity with the specified id