Work on serializers

This commit is contained in:
Thomas Krijnen
2017-12-20 12:40:15 +01:00
parent 830a03ffcd
commit d46dfb6061
9 changed files with 146 additions and 129 deletions
+7 -7
View File
@@ -90,7 +90,7 @@ namespace IfcGeom {
std::string _context;
std::string _unique_id;
Transformation<P> _transformation;
IfcUtil::IfcBaseClass* product_;
IfcUtil::IfcBaseEntity* product_;
std::vector<const IfcGeom::Element<P>*> _parents;
public:
@@ -101,9 +101,9 @@ namespace IfcGeom {
// Use the id to compare, or the elevation is the elements are IfcBuildingStoreys and the elevation is set
friend bool operator < (const Element<P> & element1, const Element<P> & element2) {
if (element1.type() == "IfcBuildingStorey" && element2.type() == "IfcBuildingStorey") {
size_t attr_index = product_->declaration().as_entity->attribute_index("Elevation");
Argument* elev_attr1 = storey1->data().getArgument(attr_index);
Argument* elev_attr2 = storey2->data().getArgument(attr_index);
size_t attr_index = element1.product()->declaration().attribute_index("Elevation");
Argument* elev_attr1 = element1.product()->data().getArgument(attr_index);
Argument* elev_attr2 = element2.product()->data().getArgument(attr_index);
if (!elev_attr1->isNull() && !elev_attr2->isNull()) {
double elev1 = *elev_attr1;
@@ -124,12 +124,12 @@ namespace IfcGeom {
const std::string& context() const { return _context; }
const std::string& unique_id() const { return _unique_id; }
const Transformation<P>& transformation() const { return _transformation; }
IfcUtil::IfcBaseClass* product() const { return product_; }
IfcUtil::IfcBaseEntity* product() const { return product_; }
const std::vector<const IfcGeom::Element<P>*> parents() const { return _parents; }
void SetParents(std::vector<const IfcGeom::Element<P>*> newparents) { _parents = newparents; }
Element(const ElementSettings& settings, int id, int parent_id, const std::string& name, const std::string& type,
const std::string& guid, const std::string& context, const gp_Trsf& trsf, IfcUtil::IfcBaseClass* product)
const std::string& guid, const std::string& context, const gp_Trsf& trsf, IfcUtil::IfcBaseEntity* product)
: _id(id), _parent_id(parent_id), _name(name), _type(type), _guid(guid), _context(context), _transformation(settings, trsf)
, product_(product)
{
@@ -167,7 +167,7 @@ namespace IfcGeom {
const Representation::BRep& geometry() const { return *_geometry; }
BRepElement(int id, int parent_id, const std::string& name, const std::string& type, const std::string& guid,
const std::string& context, const gp_Trsf& trsf, const boost::shared_ptr<Representation::BRep>& geometry,
IfcUtil::IfcBaseClass* product)
IfcUtil::IfcBaseEntity* product)
: Element<P>(geometry->settings() ,id, parent_id, name, type, guid, context, trsf, product)
, _geometry(geometry)
{}