- 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:
Thomas Krijnen
2011-08-24 12:21:07 +00:00
parent 0b45066736
commit 2561f94acb
36 changed files with 986 additions and 197 deletions
+9
View File
@@ -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,