diff --git a/src/ifcconvert/ColladaSerializer.cpp b/src/ifcconvert/ColladaSerializer.cpp index b6d5809c23..98673ba243 100644 --- a/src/ifcconvert/ColladaSerializer.cpp +++ b/src/ifcconvert/ColladaSerializer.cpp @@ -345,11 +345,7 @@ void ColladaSerializer::ColladaExporter::write(const IfcGeom::TriangulationEleme 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"; + slabSuffix = differentiateSlabTypes(o); } const std::string name = serializer->settings().get(SerializerSettings::USE_ELEMENT_GUIDS) ? @@ -373,7 +369,24 @@ void ColladaSerializer::ColladaExporter::write(const IfcGeom::TriangulationEleme DeferredObject(name, representation_id, o->type(), o->transformation().matrix().data(), mesh.verts(), mesh.normals(), mesh.faces(), mesh.edges(), mesh.material_ids(), mesh.materials(), material_references, mesh.uvs())); deferreds.push_back(defered); - +} + +std::string ColladaSerializer::ColladaExporter::differentiateSlabTypes(const IfcGeom::TriangulationElement* o) { + IfcSlab* slab = (IfcSlab*)o->product(); + switch (slab->PredefinedType()){ + case (IfcSlabTypeEnum::IfcSlabTypeEnum::IfcSlabType_ROOF): + return "_Roof"; + break; + case (IfcSlabTypeEnum::IfcSlabTypeEnum::IfcSlabType_LANDING): + return "_Landing"; + break; + case (IfcSlabTypeEnum::IfcSlabTypeEnum::IfcSlabType_BASESLAB): + return "_BasesLab"; + break; + default: + return "_Unknown"; + break; + } } void ColladaSerializer::ColladaExporter::endDocument() { diff --git a/src/ifcconvert/ColladaSerializer.h b/src/ifcconvert/ColladaSerializer.h index 82473ec4d6..15bf6f84b8 100644 --- a/src/ifcconvert/ColladaSerializer.h +++ b/src/ifcconvert/ColladaSerializer.h @@ -198,6 +198,7 @@ private: COLLADABU::NativeString filename; COLLADASW::StreamWriter stream; ColladaScene scene; + std::string differentiateSlabTypes(const IfcGeom::TriangulationElement* o); public: /// @param double_precision Whether to use "double precision" (up to 16 decimals) or not (6 or 7 decimals). ColladaExporter(const std::string& scene_name, const std::string& fn, ColladaSerializer *_serializer, diff --git a/src/ifcconvert/IfcConvert.cpp b/src/ifcconvert/IfcConvert.cpp index ca0226852c..05bb2602b5 100644 --- a/src/ifcconvert/IfcConvert.cpp +++ b/src/ifcconvert/IfcConvert.cpp @@ -510,7 +510,7 @@ int main(int argc, char** argv) if (serializer->settings().get(SerializerSettings::USE_ELEMENT_HIERARCHY) && output_extension != ".dae") { - Logger::Error("--user-element-hierarchy can be used only with .dae output."); + Logger::Error("--use-element-hierarchy can be used only with .dae output."); write_log(); print_usage(); return EXIT_FAILURE;