mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 07:09:22 +00:00
[IfcConvert] Added Output objects in the XML file
This commit is contained in:
committed by
Dion Moult
parent
29ecba293b
commit
b14de15a68
@@ -439,16 +439,44 @@ void format_tasks(IfcSchema::IfcTask* task, ptree& node) {
|
|||||||
IfcSchema::IfcObjectDefinition::list::ptr objects = operation->RelatedObjects();
|
IfcSchema::IfcObjectDefinition::list::ptr objects = operation->RelatedObjects();
|
||||||
for (IfcSchema::IfcObjectDefinition::list::it it2 = objects->begin(); it2 != objects->end(); ++it2)
|
for (IfcSchema::IfcObjectDefinition::list::it it2 = objects->begin(); it2 != objects->end(); ++it2)
|
||||||
{
|
{
|
||||||
IfcSchema::IfcObjectDefinition* object = (*it2);
|
IfcSchema::IfcObjectDefinition* object = *it2;
|
||||||
ptree nobject;
|
ptree nobject;
|
||||||
nobject.put("<xmlattr>.id", object->GlobalId());
|
nobject.put("<xmlattr>.id", object->GlobalId());
|
||||||
nobject.put("<xmlattr>.Type", object->declaration().name());
|
if (object->declaration().is(IfcSchema::IfcProduct::Class()))
|
||||||
ntask->add_child("OperatesOn", nobject);
|
{
|
||||||
|
ntask->add_child("Input", nobject);
|
||||||
|
}
|
||||||
|
else if (object->declaration().is(IfcSchema::IfcResource::Class()))
|
||||||
|
{
|
||||||
|
ntask->add_child("Resource", nobject);
|
||||||
|
}
|
||||||
|
else if (object->declaration().is(IfcSchema::IfcControl::Class()))
|
||||||
|
{
|
||||||
|
ntask->add_child("Control", nobject);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nobject.put("<xmlattr>.Type", object->declaration().name());
|
||||||
|
ntask->add_child("OperatesOn", nobject);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
IfcSchema::IfcRelAssigns::list::ptr assignments = task->HasAssignments();
|
||||||
|
for (IfcSchema::IfcRelAssigns::list::it i = assignments->begin(); i != assignments->end(); ++i)
|
||||||
|
{
|
||||||
|
IfcSchema::IfcRelAssigns* assignment = *i;
|
||||||
|
if (assignment->declaration().is(IfcSchema::IfcRelAssignsToProduct::Class())) {
|
||||||
|
IfcSchema::IfcRelAssignsToProduct* assign_to_product = assignment->as<IfcSchema::IfcRelAssignsToProduct>();
|
||||||
|
IfcSchema::IfcProduct* product = assign_to_product->RelatingProduct()->as<IfcSchema::IfcProduct>();
|
||||||
|
ptree nobject;
|
||||||
|
nobject.put("<xmlattr>.id", product->GlobalId());
|
||||||
|
ntask->add_child("Output", nobject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef SCHEMA_IfcObjectDefinition_HAS_IsNestedBy
|
#ifdef SCHEMA_IfcObjectDefinition_HAS_IsNestedBy
|
||||||
IfcSchema::IfcRelNests::list::ptr nested_by = task->IsNestedBy();
|
IfcSchema::IfcRelNests::list::ptr nested_by = task->IsNestedBy();
|
||||||
for (IfcSchema::IfcRelNests::list::it it = nested_by->begin(); it != nested_by->end(); ++it)
|
for (IfcSchema::IfcRelNests::list::it it = nested_by->begin(); it != nested_by->end(); ++it)
|
||||||
|
|||||||
Reference in New Issue
Block a user