Differentiate slab types when option --use-element-types is used.

This commit is contained in:
Tristan Zimpfer
2017-04-26 10:28:38 +02:00
parent 1d8f6addf8
commit 78b904dfeb
3 changed files with 21 additions and 7 deletions
+19 -6
View File
@@ -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<real_t>* 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() {
+1
View File
@@ -198,6 +198,7 @@ private:
COLLADABU::NativeString filename;
COLLADASW::StreamWriter stream;
ColladaScene scene;
std::string differentiateSlabTypes(const IfcGeom::TriangulationElement<real_t>* 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,
+1 -1
View File
@@ -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;