| 794 | } |
| 795 | |
| 796 | std::map<std::string, IfcUtil::IfcBaseEntity*> mapping::get_layers(IfcUtil::IfcBaseEntity* inst) { |
| 797 | auto prod = inst->as<IfcSchema::IfcProduct>(); |
| 798 | std::map<std::string, IfcUtil::IfcBaseEntity*> layers; |
| 799 | if (prod->Representation()) { |
| 800 | aggregate_of_instance::ptr r = IfcParse::traverse(prod->Representation()); |
| 801 | IfcSchema::IfcRepresentation::list::ptr representations = r->as<IfcSchema::IfcRepresentation>(); |
| 802 | for (IfcSchema::IfcRepresentation::list::it it = representations->begin(); it != representations->end(); ++it) { |
| 803 | IfcSchema::IfcPresentationLayerAssignment::list::ptr a = (*it)->LayerAssignments(); |
| 804 | for (IfcSchema::IfcPresentationLayerAssignment::list::it jt = a->begin(); jt != a->end(); ++jt) { |
| 805 | layers[(*jt)->Name()] = *jt; |
| 806 | } |
| 807 | } |
| 808 | } |
| 809 | return layers; |
| 810 | } |
| 811 | |
| 812 | void mapping::initialize_units_() { |
| 813 | // Set default units, set length to meters, angles to undefined |