ifcparse refactoring (#190)

Unify attribute containers, provide latebound attribute access on IfcBaseEntity, more basic tests on Travis
This commit is contained in:
Thomas Krijnen
2017-06-05 17:26:58 +02:00
committed by GitHub
parent 9a43658716
commit 5e0da9725a
49 changed files with 9228 additions and 9416 deletions
+5 -15
View File
@@ -241,7 +241,7 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
};
%inline %{
boost::variant<IfcGeom::Element<double>*, IfcGeom::Representation::Representation*> create_shape(IfcGeom::IteratorSettings& settings, IfcParse::IfcLateBoundEntity* instance, IfcParse::IfcLateBoundEntity* representation = 0) {
boost::variant<IfcGeom::Element<double>*, IfcGeom::Representation::Representation*> create_shape(IfcGeom::IteratorSettings& settings, IfcUtil::IfcBaseClass* instance, IfcUtil::IfcBaseClass* representation = 0) {
IfcParse::IfcFile* file = instance->entity->file;
IfcSchema::IfcProject::list::ptr projects = file->entitiesByType<IfcSchema::IfcProject>();
if (projects->size() != 1) {
@@ -395,32 +395,22 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
return boost::variant<IfcGeom::Element<double>*, IfcGeom::Representation::Representation*>();
}
IfcParse::IfcLateBoundEntity* serialise(const std::string& s, bool advanced=true) {
IfcUtil::IfcBaseClass* serialise(const std::string& s, bool advanced=true) {
std::stringstream stream(s);
BRepTools_ShapeSet shapes;
shapes.Read(stream);
const TopoDS_Shape& shp = shapes.Shape(shapes.NbShapes());
const IfcUtil::IfcBaseClass* e = IfcGeom::serialise(shp, advanced);
if (e) {
return new IfcParse::IfcLateBoundEntity(e->entity);
} else {
return 0;
}
return IfcGeom::serialise(shp, advanced);
}
IfcParse::IfcLateBoundEntity* tesselate(const std::string& s, double d) {
IfcUtil::IfcBaseClass* tesselate(const std::string& s, double d) {
std::stringstream stream(s);
BRepTools_ShapeSet shapes;
shapes.Read(stream);
const TopoDS_Shape& shp = shapes.Shape(shapes.NbShapes());
const IfcUtil::IfcBaseClass* e = IfcGeom::tesselate(shp, d);
if (e) {
return new IfcParse::IfcLateBoundEntity(e->entity);
} else {
return 0;
}
return IfcGeom::tesselate(shp, d);
}
%}