mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
cpp changes for latebound schema manipulation from Python
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "IfcSchema.h"
|
||||
#include "../ifcparse/IfcBaseClass.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
@@ -62,6 +63,19 @@ IfcParse::schema_definition::~schema_definition() {
|
||||
}
|
||||
}
|
||||
|
||||
IfcUtil::IfcBaseClass* IfcParse::schema_definition::instantiate(IfcEntityInstanceData * data) const {
|
||||
if (factory_) {
|
||||
return (*factory_)(data);
|
||||
} else {
|
||||
return new IfcUtil::IfcLateBoundEntity(data->type(), data);
|
||||
}
|
||||
}
|
||||
|
||||
void IfcParse::register_schema(schema_definition* s) {
|
||||
schemas.insert({ s->name(), s });
|
||||
}
|
||||
|
||||
|
||||
#include "../ifcparse/Ifc2x3.h"
|
||||
#include "../ifcparse/Ifc4.h"
|
||||
#include "../ifcparse/Ifc4x1.h"
|
||||
|
||||
Reference in New Issue
Block a user