mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-28 15:53:00 +00:00
- Fixed a bug regarding IfcUnitAssignment
- Separate IFC parsing library and geometry libraries [#3395025] - Added example for IfcParse usage without geometry or Open CASCADE functionality - Cleanup of vcproj Open CASCADE dependencies - Added function to query parent class type in IfcExpressParser.py
This commit is contained in:
@@ -381,6 +381,7 @@ namespace Type {
|
||||
typedef enum {
|
||||
%(enum)s
|
||||
} Enum;
|
||||
Enum Parent(Enum v);
|
||||
Enum FromString(const std::string& s);
|
||||
std::string ToString(Enum v);
|
||||
}
|
||||
@@ -450,6 +451,14 @@ for e in all_enumerations:
|
||||
print >>cpp_file, " throw;"
|
||||
print >>cpp_file, "}"
|
||||
|
||||
print >>cpp_file, "Type::Enum Type::Parent(Enum v){"
|
||||
print >>cpp_file, " if (v < 0 || v >= %d) return -1;"%len(all_enumerations)
|
||||
for e in entity_enumerations:
|
||||
if e not in parent_relations: continue
|
||||
print >>cpp_file, ' if(v==%s%s) { return %s; }'%(e," "*(maxlen-len(e)),parent_relations[e])
|
||||
print >>cpp_file, " return -1;"
|
||||
print >>cpp_file, "}"
|
||||
|
||||
for t in [T for T in types if isinstance(T.type,EnumType)]:
|
||||
print >>cpp_file, t
|
||||
for e in entities: print >>cpp_file, e,
|
||||
Reference in New Issue
Block a user