mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Differentiate slab types when option --use-element-types is used.
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user