From 1d8f6addf80feb3dde8310268bcafd63faec2e3a Mon Sep 17 00:00:00 2001 From: Balleux Benjamin Date: Tue, 25 Apr 2017 16:27:14 +0200 Subject: [PATCH] Get the information on the IfcSlab (floor or roof..) and put it in the element name. To be cleaned --- src/ifcconvert/ColladaSerializer.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ifcconvert/ColladaSerializer.cpp b/src/ifcconvert/ColladaSerializer.cpp index 5a555e40fa..b6d5809c23 100644 --- a/src/ifcconvert/ColladaSerializer.cpp +++ b/src/ifcconvert/ColladaSerializer.cpp @@ -341,9 +341,20 @@ void ColladaSerializer::ColladaExporter::startDocument(const std::string& unit_n void ColladaSerializer::ColladaExporter::write(const IfcGeom::TriangulationElement* o) { const IfcGeom::Representation::Triangulation& mesh = o->geometry(); + + std::string slabSuffix = ""; + if (o->type() == "IfcSlab") + { + IfcSlab* slab = (IfcSlab*)o->product(); + std::cout << "before if \n"; + if (slab->PredefinedType() == IfcSlabTypeEnum::IfcSlabTypeEnum::IfcSlabType_ROOF) slabSuffix = " Roof"; + else if (slab->PredefinedType() == IfcSlabTypeEnum::IfcSlabTypeEnum::IfcSlabType_FLOOR) slabSuffix = " Floor"; + std::cout << "after if \n"; + } + const std::string name = serializer->settings().get(SerializerSettings::USE_ELEMENT_GUIDS) ? o->guid() : (serializer->settings().get(SerializerSettings::USE_ELEMENT_NAMES) ? - o->name() : (serializer->settings().get(SerializerSettings::USE_ELEMENT_TYPES) ? o->type() : o->unique_id())); + o->name() : (serializer->settings().get(SerializerSettings::USE_ELEMENT_TYPES) ? o->type() + slabSuffix : o->unique_id())); const std::string representation_id = "representation-" + boost::lexical_cast(o->geometry().id()); std::vector material_references; foreach(const IfcGeom::Material& material, mesh.materials()) {