MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / get_layers

Method get_layers

src/ifcgeom/mapping/mapping.cpp:796–810  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

794}
795
796std::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
812void mapping::initialize_units_() {
813 // Set default units, set length to meters, angles to undefined

Callers 3

descendFunction · 0.45
matchMethod · 0.45
patchMethod · 0.45

Calls 3

NameMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected