Extend Python's dir() function on entity instances with attribute and inverse attribute names of entities

This commit is contained in:
Thomas Krijnen
2015-02-27 13:41:33 +00:00
parent d41dbc386e
commit 9bbbc6e7d9
9 changed files with 413 additions and 292 deletions
+188 -158
View File
@@ -41,10 +41,15 @@ using namespace IfcParse;
using namespace IfcWrite;
using namespace IfcUtil;
std::map<Type::Enum,IfcEntityDescriptor*> entity_descriptor_map;
std::map<Type::Enum,IfcEnumerationDescriptor*> enumeration_descriptor_map;
std::map<std::pair<Type::Enum, std::string>, std::pair<Type::Enum, int> > inverse_map;
std::map<Type::Enum,std::set<int> > derived_map;
typedef std::map<Type::Enum,IfcEntityDescriptor*> entity_descriptor_map_t;
typedef std::map<Type::Enum,IfcEnumerationDescriptor*> enumeration_descriptor_map_t;
typedef std::map<std::pair<Type::Enum, std::string>, std::pair<Type::Enum, int> > inverse_map_t;
typedef std::map<Type::Enum,std::set<int> > derived_map_t;
entity_descriptor_map_t entity_descriptor_map;
enumeration_descriptor_map_t enumeration_descriptor_map;
inverse_map_t inverse_map;
derived_map_t derived_map;
void InitDescriptorMap() {
IfcEntityDescriptor* current;
@@ -4708,155 +4713,155 @@ void InitDescriptorMap() {
}
void InitInverseMap() {
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcActor, "IsActingUpon"), std::make_pair(Type::IfcRelAssignsToActor, 6)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcActorRole, "HasExternalReference"), std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcAddress, "OfPerson"), std::make_pair(Type::IfcPerson, 7)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcAddress, "OfOrganization"), std::make_pair(Type::IfcOrganization, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcAnnotation, "ContainedInStructure"), std::make_pair(Type::IfcRelContainedInSpatialStructure, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcAppliedValue, "HasExternalReference"), std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcApproval, "HasExternalReferences"), std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcApproval, "ApprovedObjects"), std::make_pair(Type::IfcRelAssociatesApproval, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcApproval, "ApprovedResources"), std::make_pair(Type::IfcResourceApprovalRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcApproval, "IsRelatedWith"), std::make_pair(Type::IfcApprovalRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcApproval, "Relates"), std::make_pair(Type::IfcApprovalRelationship, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcBuildingElement, "HasCoverings"), std::make_pair(Type::IfcRelCoversBldgElements, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcClassification, "ClassificationForObjects"), std::make_pair(Type::IfcRelAssociatesClassification, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcClassification, "HasReferences"), std::make_pair(Type::IfcClassificationReference, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcClassificationReference, "ClassificationRefForObjects"), std::make_pair(Type::IfcRelAssociatesClassification, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcClassificationReference, "HasReferences"), std::make_pair(Type::IfcClassificationReference, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcCompositeCurveSegment, "UsingCurves"), std::make_pair(Type::IfcCompositeCurve, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcConstraint, "HasExternalReferences"), std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcConstraint, "PropertiesForConstraint"), std::make_pair(Type::IfcResourceConstraintRelationship, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcContext, "IsDefinedBy"), std::make_pair(Type::IfcRelDefinesByProperties, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcContext, "Declares"), std::make_pair(Type::IfcRelDeclares, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcContextDependentUnit, "HasExternalReference"), std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcControl, "Controls"), std::make_pair(Type::IfcRelAssignsToControl, 6)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcConversionBasedUnit, "HasExternalReference"), std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcCovering, "CoversSpaces"), std::make_pair(Type::IfcRelCoversSpaces, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcCovering, "CoversElements"), std::make_pair(Type::IfcRelCoversBldgElements, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDistributionControlElement, "AssignedToFlowElement"), std::make_pair(Type::IfcRelFlowControlElements, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDistributionElement, "HasPorts"), std::make_pair(Type::IfcRelConnectsPortToElement, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDistributionFlowElement, "HasControlElements"), std::make_pair(Type::IfcRelFlowControlElements, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDocumentInformation, "DocumentInfoForObjects"), std::make_pair(Type::IfcRelAssociatesDocument, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDocumentInformation, "HasDocumentReferences"), std::make_pair(Type::IfcDocumentReference, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDocumentInformation, "IsPointedTo"), std::make_pair(Type::IfcDocumentInformationRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDocumentInformation, "IsPointer"), std::make_pair(Type::IfcDocumentInformationRelationship, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDocumentReference, "DocumentRefForObjects"), std::make_pair(Type::IfcRelAssociatesDocument, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "FillsVoids"), std::make_pair(Type::IfcRelFillsElement, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "ConnectedTo"), std::make_pair(Type::IfcRelConnectsElements, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "IsInterferedByElements"), std::make_pair(Type::IfcRelInterferesElements, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "InterferesElements"), std::make_pair(Type::IfcRelInterferesElements, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "HasProjections"), std::make_pair(Type::IfcRelProjectsElement, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "ReferencedInStructures"), std::make_pair(Type::IfcRelReferencedInSpatialStructure, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "HasOpenings"), std::make_pair(Type::IfcRelVoidsElement, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "IsConnectionRealization"), std::make_pair(Type::IfcRelConnectsWithRealizingElements, 7)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "ProvidesBoundaries"), std::make_pair(Type::IfcRelSpaceBoundary, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "ConnectedFrom"), std::make_pair(Type::IfcRelConnectsElements, 6)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "ContainedInStructure"), std::make_pair(Type::IfcRelContainedInSpatialStructure, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcExternalReference, "ExternalReferenceForResources"), std::make_pair(Type::IfcExternalReferenceRelationship, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcExternalSpatialElement, "BoundedBy"), std::make_pair(Type::IfcRelSpaceBoundary, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcFace, "HasTextureMaps"), std::make_pair(Type::IfcTextureMap, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcFeatureElementAddition, "ProjectsElements"), std::make_pair(Type::IfcRelProjectsElement, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcFeatureElementSubtraction, "VoidsElements"), std::make_pair(Type::IfcRelVoidsElement, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGeometricRepresentationContext, "HasSubContexts"), std::make_pair(Type::IfcGeometricRepresentationSubContext, 6)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGrid, "ContainedInStructure"), std::make_pair(Type::IfcRelContainedInSpatialStructure, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGridAxis, "PartOfW"), std::make_pair(Type::IfcGrid, 9)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGridAxis, "PartOfV"), std::make_pair(Type::IfcGrid, 8)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGridAxis, "PartOfU"), std::make_pair(Type::IfcGrid, 7)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGridAxis, "HasIntersections"), std::make_pair(Type::IfcVirtualGridIntersection, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGroup, "IsGroupedBy"), std::make_pair(Type::IfcRelAssignsToGroup, 6)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcLibraryInformation, "LibraryInfoForObjects"), std::make_pair(Type::IfcRelAssociatesLibrary, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcLibraryInformation, "HasLibraryReferences"), std::make_pair(Type::IfcLibraryReference, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcLibraryReference, "LibraryRefForObjects"), std::make_pair(Type::IfcRelAssociatesLibrary, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcMaterial, "HasRepresentation"), std::make_pair(Type::IfcMaterialDefinitionRepresentation, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcMaterial, "IsRelatedWith"), std::make_pair(Type::IfcMaterialRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcMaterial, "RelatesTo"), std::make_pair(Type::IfcMaterialRelationship, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcMaterialConstituent, "ToMaterialConstituentSet"), std::make_pair(Type::IfcMaterialConstituentSet, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcMaterialDefinition, "AssociatedTo"), std::make_pair(Type::IfcRelAssociatesMaterial, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcMaterialDefinition, "HasExternalReferences"), std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcMaterialDefinition, "HasProperties"), std::make_pair(Type::IfcMaterialProperties, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcMaterialLayer, "ToMaterialLayerSet"), std::make_pair(Type::IfcMaterialLayerSet, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcMaterialProfile, "ToMaterialProfileSet"), std::make_pair(Type::IfcMaterialProfileSet, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcMaterialUsageDefinition, "AssociatedTo"), std::make_pair(Type::IfcRelAssociatesMaterial, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObject, "IsDeclaredBy"), std::make_pair(Type::IfcRelDefinesByObject, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObject, "Declares"), std::make_pair(Type::IfcRelDefinesByObject, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObject, "IsTypedBy"), std::make_pair(Type::IfcRelDefinesByType, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObject, "IsDefinedBy"), std::make_pair(Type::IfcRelDefinesByProperties, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "HasAssignments"), std::make_pair(Type::IfcRelAssigns, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "Nests"), std::make_pair(Type::IfcRelNests, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "IsNestedBy"), std::make_pair(Type::IfcRelNests, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "HasContext"), std::make_pair(Type::IfcRelDeclares, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "IsDecomposedBy"), std::make_pair(Type::IfcRelAggregates, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "Decomposes"), std::make_pair(Type::IfcRelAggregates, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "HasAssociations"), std::make_pair(Type::IfcRelAssociates, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectPlacement, "PlacesObject"), std::make_pair(Type::IfcProduct, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectPlacement, "ReferencedByPlacements"), std::make_pair(Type::IfcLocalPlacement, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcOpeningElement, "HasFillings"), std::make_pair(Type::IfcRelFillsElement, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcOrganization, "IsRelatedBy"), std::make_pair(Type::IfcOrganizationRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcOrganization, "Relates"), std::make_pair(Type::IfcOrganizationRelationship, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcOrganization, "Engages"), std::make_pair(Type::IfcPersonAndOrganization, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPerson, "EngagedIn"), std::make_pair(Type::IfcPersonAndOrganization, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPhysicalQuantity, "HasExternalReferences"), std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPhysicalQuantity, "PartOfComplex"), std::make_pair(Type::IfcPhysicalComplexQuantity, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPort, "ContainedIn"), std::make_pair(Type::IfcRelConnectsPortToElement, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPort, "ConnectedFrom"), std::make_pair(Type::IfcRelConnectsPorts, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPort, "ConnectedTo"), std::make_pair(Type::IfcRelConnectsPorts, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProcess, "IsPredecessorTo"), std::make_pair(Type::IfcRelSequence, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProcess, "IsSuccessorFrom"), std::make_pair(Type::IfcRelSequence, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProcess, "OperatesOn"), std::make_pair(Type::IfcRelAssignsToProcess, 6)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProduct, "ReferencedBy"), std::make_pair(Type::IfcRelAssignsToProduct, 6)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProductDefinitionShape, "ShapeOfProduct"), std::make_pair(Type::IfcProduct, 6)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProductDefinitionShape, "HasShapeAspects"), std::make_pair(Type::IfcShapeAspect, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProfileDef, "HasExternalReference"), std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProfileDef, "HasProperties"), std::make_pair(Type::IfcProfileProperties, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProperty, "PartOfPset"), std::make_pair(Type::IfcPropertySet, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProperty, "PropertyForDependance"), std::make_pair(Type::IfcPropertyDependencyRelationship, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProperty, "PropertyDependsOn"), std::make_pair(Type::IfcPropertyDependencyRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProperty, "PartOfComplex"), std::make_pair(Type::IfcComplexProperty, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertyAbstraction, "HasExternalReferences"), std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertyDefinition, "HasContext"), std::make_pair(Type::IfcRelDeclares, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertyDefinition, "HasAssociations"), std::make_pair(Type::IfcRelAssociates, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertySetDefinition, "DefinesType"), std::make_pair(Type::IfcTypeObject, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertySetDefinition, "IsDefinedBy"), std::make_pair(Type::IfcRelDefinesByTemplate, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertySetDefinition, "DefinesOccurrence"), std::make_pair(Type::IfcRelDefinesByProperties, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertySetTemplate, "Defines"), std::make_pair(Type::IfcRelDefinesByTemplate, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertyTemplate, "PartOfComplexTemplate"), std::make_pair(Type::IfcComplexPropertyTemplate, 6)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertyTemplate, "PartOfPsetTemplate"), std::make_pair(Type::IfcPropertySetTemplate, 6)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcRelSpaceBoundary1stLevel, "InnerBoundaries"), std::make_pair(Type::IfcRelSpaceBoundary1stLevel, 9)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcRelSpaceBoundary2ndLevel, "Corresponds"), std::make_pair(Type::IfcRelSpaceBoundary2ndLevel, 10)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcRepresentation, "RepresentationMap"), std::make_pair(Type::IfcRepresentationMap, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcRepresentation, "LayerAssignments"), std::make_pair(Type::IfcPresentationLayerAssignment, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcRepresentation, "OfProductRepresentation"), std::make_pair(Type::IfcProductRepresentation, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcRepresentationContext, "RepresentationsInContext"), std::make_pair(Type::IfcRepresentation, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcRepresentationItem, "LayerAssignment"), std::make_pair(Type::IfcPresentationLayerAssignment, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcRepresentationItem, "StyledByItem"), std::make_pair(Type::IfcStyledItem, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcRepresentationMap, "HasShapeAspects"), std::make_pair(Type::IfcShapeAspect, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcRepresentationMap, "MapUsage"), std::make_pair(Type::IfcMappedItem, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcResource, "ResourceOf"), std::make_pair(Type::IfcRelAssignsToResource, 6)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcShapeModel, "OfShapeAspect"), std::make_pair(Type::IfcShapeAspect, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpace, "HasCoverings"), std::make_pair(Type::IfcRelCoversSpaces, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpace, "BoundedBy"), std::make_pair(Type::IfcRelSpaceBoundary, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpatialElement, "ContainsElements"), std::make_pair(Type::IfcRelContainedInSpatialStructure, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpatialElement, "ServicedBySystems"), std::make_pair(Type::IfcRelServicesBuildings, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpatialElement, "ReferencesElements"), std::make_pair(Type::IfcRelReferencedInSpatialStructure, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralActivity, "AssignedToStructuralItem"), std::make_pair(Type::IfcRelConnectsStructuralActivity, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralConnection, "ConnectsStructuralMembers"), std::make_pair(Type::IfcRelConnectsStructuralMember, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralItem, "AssignedStructuralActivity"), std::make_pair(Type::IfcRelConnectsStructuralActivity, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralLoadGroup, "SourceOfResultGroup"), std::make_pair(Type::IfcStructuralResultGroup, 6)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralLoadGroup, "LoadGroupFor"), std::make_pair(Type::IfcStructuralAnalysisModel, 7)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralMember, "ConnectedBy"), std::make_pair(Type::IfcRelConnectsStructuralMember, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralResultGroup, "ResultGroupFor"), std::make_pair(Type::IfcStructuralAnalysisModel, 8)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSurfaceTexture, "IsMappedBy"), std::make_pair(Type::IfcTextureCoordinate, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSurfaceTexture, "UsedInStyles"), std::make_pair(Type::IfcSurfaceStyleWithTextures, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSystem, "ServicesBuildings"), std::make_pair(Type::IfcRelServicesBuildings, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcTableRow, "OfTable"), std::make_pair(Type::IfcTable, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcTessellatedFaceSet, "HasColours"), std::make_pair(Type::IfcIndexedColourMap, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcTessellatedFaceSet, "HasTextures"), std::make_pair(Type::IfcIndexedTextureMap, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcTimeSeries, "HasExternalReference"), std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcTypeObject, "Types"), std::make_pair(Type::IfcRelDefinesByType, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcTypeProcess, "OperatesOn"), std::make_pair(Type::IfcRelAssignsToProcess, 6)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcTypeProduct, "ReferencedBy"), std::make_pair(Type::IfcRelAssignsToProduct, 6)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcTypeResource, "ResourceOf"), std::make_pair(Type::IfcRelAssignsToResource, 6)));
inverse_map[Type::IfcActor].insert(std::make_pair("IsActingUpon", std::make_pair(Type::IfcRelAssignsToActor, 6)));
inverse_map[Type::IfcActorRole].insert(std::make_pair("HasExternalReference", std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map[Type::IfcAddress].insert(std::make_pair("OfPerson", std::make_pair(Type::IfcPerson, 7)));
inverse_map[Type::IfcAddress].insert(std::make_pair("OfOrganization", std::make_pair(Type::IfcOrganization, 4)));
inverse_map[Type::IfcAnnotation].insert(std::make_pair("ContainedInStructure", std::make_pair(Type::IfcRelContainedInSpatialStructure, 4)));
inverse_map[Type::IfcAppliedValue].insert(std::make_pair("HasExternalReference", std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map[Type::IfcApproval].insert(std::make_pair("HasExternalReferences", std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map[Type::IfcApproval].insert(std::make_pair("ApprovedObjects", std::make_pair(Type::IfcRelAssociatesApproval, 5)));
inverse_map[Type::IfcApproval].insert(std::make_pair("ApprovedResources", std::make_pair(Type::IfcResourceApprovalRelationship, 3)));
inverse_map[Type::IfcApproval].insert(std::make_pair("IsRelatedWith", std::make_pair(Type::IfcApprovalRelationship, 3)));
inverse_map[Type::IfcApproval].insert(std::make_pair("Relates", std::make_pair(Type::IfcApprovalRelationship, 2)));
inverse_map[Type::IfcBuildingElement].insert(std::make_pair("HasCoverings", std::make_pair(Type::IfcRelCoversBldgElements, 4)));
inverse_map[Type::IfcClassification].insert(std::make_pair("ClassificationForObjects", std::make_pair(Type::IfcRelAssociatesClassification, 5)));
inverse_map[Type::IfcClassification].insert(std::make_pair("HasReferences", std::make_pair(Type::IfcClassificationReference, 3)));
inverse_map[Type::IfcClassificationReference].insert(std::make_pair("ClassificationRefForObjects", std::make_pair(Type::IfcRelAssociatesClassification, 5)));
inverse_map[Type::IfcClassificationReference].insert(std::make_pair("HasReferences", std::make_pair(Type::IfcClassificationReference, 3)));
inverse_map[Type::IfcCompositeCurveSegment].insert(std::make_pair("UsingCurves", std::make_pair(Type::IfcCompositeCurve, 0)));
inverse_map[Type::IfcConstraint].insert(std::make_pair("HasExternalReferences", std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map[Type::IfcConstraint].insert(std::make_pair("PropertiesForConstraint", std::make_pair(Type::IfcResourceConstraintRelationship, 2)));
inverse_map[Type::IfcContext].insert(std::make_pair("IsDefinedBy", std::make_pair(Type::IfcRelDefinesByProperties, 4)));
inverse_map[Type::IfcContext].insert(std::make_pair("Declares", std::make_pair(Type::IfcRelDeclares, 4)));
inverse_map[Type::IfcContextDependentUnit].insert(std::make_pair("HasExternalReference", std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map[Type::IfcControl].insert(std::make_pair("Controls", std::make_pair(Type::IfcRelAssignsToControl, 6)));
inverse_map[Type::IfcConversionBasedUnit].insert(std::make_pair("HasExternalReference", std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map[Type::IfcCovering].insert(std::make_pair("CoversSpaces", std::make_pair(Type::IfcRelCoversSpaces, 5)));
inverse_map[Type::IfcCovering].insert(std::make_pair("CoversElements", std::make_pair(Type::IfcRelCoversBldgElements, 5)));
inverse_map[Type::IfcDistributionControlElement].insert(std::make_pair("AssignedToFlowElement", std::make_pair(Type::IfcRelFlowControlElements, 4)));
inverse_map[Type::IfcDistributionElement].insert(std::make_pair("HasPorts", std::make_pair(Type::IfcRelConnectsPortToElement, 5)));
inverse_map[Type::IfcDistributionFlowElement].insert(std::make_pair("HasControlElements", std::make_pair(Type::IfcRelFlowControlElements, 5)));
inverse_map[Type::IfcDocumentInformation].insert(std::make_pair("DocumentInfoForObjects", std::make_pair(Type::IfcRelAssociatesDocument, 5)));
inverse_map[Type::IfcDocumentInformation].insert(std::make_pair("HasDocumentReferences", std::make_pair(Type::IfcDocumentReference, 4)));
inverse_map[Type::IfcDocumentInformation].insert(std::make_pair("IsPointedTo", std::make_pair(Type::IfcDocumentInformationRelationship, 3)));
inverse_map[Type::IfcDocumentInformation].insert(std::make_pair("IsPointer", std::make_pair(Type::IfcDocumentInformationRelationship, 2)));
inverse_map[Type::IfcDocumentReference].insert(std::make_pair("DocumentRefForObjects", std::make_pair(Type::IfcRelAssociatesDocument, 5)));
inverse_map[Type::IfcElement].insert(std::make_pair("FillsVoids", std::make_pair(Type::IfcRelFillsElement, 5)));
inverse_map[Type::IfcElement].insert(std::make_pair("ConnectedTo", std::make_pair(Type::IfcRelConnectsElements, 5)));
inverse_map[Type::IfcElement].insert(std::make_pair("IsInterferedByElements", std::make_pair(Type::IfcRelInterferesElements, 5)));
inverse_map[Type::IfcElement].insert(std::make_pair("InterferesElements", std::make_pair(Type::IfcRelInterferesElements, 4)));
inverse_map[Type::IfcElement].insert(std::make_pair("HasProjections", std::make_pair(Type::IfcRelProjectsElement, 4)));
inverse_map[Type::IfcElement].insert(std::make_pair("ReferencedInStructures", std::make_pair(Type::IfcRelReferencedInSpatialStructure, 4)));
inverse_map[Type::IfcElement].insert(std::make_pair("HasOpenings", std::make_pair(Type::IfcRelVoidsElement, 4)));
inverse_map[Type::IfcElement].insert(std::make_pair("IsConnectionRealization", std::make_pair(Type::IfcRelConnectsWithRealizingElements, 7)));
inverse_map[Type::IfcElement].insert(std::make_pair("ProvidesBoundaries", std::make_pair(Type::IfcRelSpaceBoundary, 5)));
inverse_map[Type::IfcElement].insert(std::make_pair("ConnectedFrom", std::make_pair(Type::IfcRelConnectsElements, 6)));
inverse_map[Type::IfcElement].insert(std::make_pair("ContainedInStructure", std::make_pair(Type::IfcRelContainedInSpatialStructure, 4)));
inverse_map[Type::IfcExternalReference].insert(std::make_pair("ExternalReferenceForResources", std::make_pair(Type::IfcExternalReferenceRelationship, 2)));
inverse_map[Type::IfcExternalSpatialElement].insert(std::make_pair("BoundedBy", std::make_pair(Type::IfcRelSpaceBoundary, 4)));
inverse_map[Type::IfcFace].insert(std::make_pair("HasTextureMaps", std::make_pair(Type::IfcTextureMap, 2)));
inverse_map[Type::IfcFeatureElementAddition].insert(std::make_pair("ProjectsElements", std::make_pair(Type::IfcRelProjectsElement, 5)));
inverse_map[Type::IfcFeatureElementSubtraction].insert(std::make_pair("VoidsElements", std::make_pair(Type::IfcRelVoidsElement, 5)));
inverse_map[Type::IfcGeometricRepresentationContext].insert(std::make_pair("HasSubContexts", std::make_pair(Type::IfcGeometricRepresentationSubContext, 6)));
inverse_map[Type::IfcGrid].insert(std::make_pair("ContainedInStructure", std::make_pair(Type::IfcRelContainedInSpatialStructure, 4)));
inverse_map[Type::IfcGridAxis].insert(std::make_pair("PartOfW", std::make_pair(Type::IfcGrid, 9)));
inverse_map[Type::IfcGridAxis].insert(std::make_pair("PartOfV", std::make_pair(Type::IfcGrid, 8)));
inverse_map[Type::IfcGridAxis].insert(std::make_pair("PartOfU", std::make_pair(Type::IfcGrid, 7)));
inverse_map[Type::IfcGridAxis].insert(std::make_pair("HasIntersections", std::make_pair(Type::IfcVirtualGridIntersection, 0)));
inverse_map[Type::IfcGroup].insert(std::make_pair("IsGroupedBy", std::make_pair(Type::IfcRelAssignsToGroup, 6)));
inverse_map[Type::IfcLibraryInformation].insert(std::make_pair("LibraryInfoForObjects", std::make_pair(Type::IfcRelAssociatesLibrary, 5)));
inverse_map[Type::IfcLibraryInformation].insert(std::make_pair("HasLibraryReferences", std::make_pair(Type::IfcLibraryReference, 5)));
inverse_map[Type::IfcLibraryReference].insert(std::make_pair("LibraryRefForObjects", std::make_pair(Type::IfcRelAssociatesLibrary, 5)));
inverse_map[Type::IfcMaterial].insert(std::make_pair("HasRepresentation", std::make_pair(Type::IfcMaterialDefinitionRepresentation, 3)));
inverse_map[Type::IfcMaterial].insert(std::make_pair("IsRelatedWith", std::make_pair(Type::IfcMaterialRelationship, 3)));
inverse_map[Type::IfcMaterial].insert(std::make_pair("RelatesTo", std::make_pair(Type::IfcMaterialRelationship, 2)));
inverse_map[Type::IfcMaterialConstituent].insert(std::make_pair("ToMaterialConstituentSet", std::make_pair(Type::IfcMaterialConstituentSet, 2)));
inverse_map[Type::IfcMaterialDefinition].insert(std::make_pair("AssociatedTo", std::make_pair(Type::IfcRelAssociatesMaterial, 5)));
inverse_map[Type::IfcMaterialDefinition].insert(std::make_pair("HasExternalReferences", std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map[Type::IfcMaterialDefinition].insert(std::make_pair("HasProperties", std::make_pair(Type::IfcMaterialProperties, 3)));
inverse_map[Type::IfcMaterialLayer].insert(std::make_pair("ToMaterialLayerSet", std::make_pair(Type::IfcMaterialLayerSet, 0)));
inverse_map[Type::IfcMaterialProfile].insert(std::make_pair("ToMaterialProfileSet", std::make_pair(Type::IfcMaterialProfileSet, 2)));
inverse_map[Type::IfcMaterialUsageDefinition].insert(std::make_pair("AssociatedTo", std::make_pair(Type::IfcRelAssociatesMaterial, 5)));
inverse_map[Type::IfcObject].insert(std::make_pair("IsDeclaredBy", std::make_pair(Type::IfcRelDefinesByObject, 4)));
inverse_map[Type::IfcObject].insert(std::make_pair("Declares", std::make_pair(Type::IfcRelDefinesByObject, 5)));
inverse_map[Type::IfcObject].insert(std::make_pair("IsTypedBy", std::make_pair(Type::IfcRelDefinesByType, 4)));
inverse_map[Type::IfcObject].insert(std::make_pair("IsDefinedBy", std::make_pair(Type::IfcRelDefinesByProperties, 4)));
inverse_map[Type::IfcObjectDefinition].insert(std::make_pair("HasAssignments", std::make_pair(Type::IfcRelAssigns, 4)));
inverse_map[Type::IfcObjectDefinition].insert(std::make_pair("Nests", std::make_pair(Type::IfcRelNests, 5)));
inverse_map[Type::IfcObjectDefinition].insert(std::make_pair("IsNestedBy", std::make_pair(Type::IfcRelNests, 4)));
inverse_map[Type::IfcObjectDefinition].insert(std::make_pair("HasContext", std::make_pair(Type::IfcRelDeclares, 5)));
inverse_map[Type::IfcObjectDefinition].insert(std::make_pair("IsDecomposedBy", std::make_pair(Type::IfcRelAggregates, 4)));
inverse_map[Type::IfcObjectDefinition].insert(std::make_pair("Decomposes", std::make_pair(Type::IfcRelAggregates, 5)));
inverse_map[Type::IfcObjectDefinition].insert(std::make_pair("HasAssociations", std::make_pair(Type::IfcRelAssociates, 4)));
inverse_map[Type::IfcObjectPlacement].insert(std::make_pair("PlacesObject", std::make_pair(Type::IfcProduct, 5)));
inverse_map[Type::IfcObjectPlacement].insert(std::make_pair("ReferencedByPlacements", std::make_pair(Type::IfcLocalPlacement, 0)));
inverse_map[Type::IfcOpeningElement].insert(std::make_pair("HasFillings", std::make_pair(Type::IfcRelFillsElement, 4)));
inverse_map[Type::IfcOrganization].insert(std::make_pair("IsRelatedBy", std::make_pair(Type::IfcOrganizationRelationship, 3)));
inverse_map[Type::IfcOrganization].insert(std::make_pair("Relates", std::make_pair(Type::IfcOrganizationRelationship, 2)));
inverse_map[Type::IfcOrganization].insert(std::make_pair("Engages", std::make_pair(Type::IfcPersonAndOrganization, 1)));
inverse_map[Type::IfcPerson].insert(std::make_pair("EngagedIn", std::make_pair(Type::IfcPersonAndOrganization, 0)));
inverse_map[Type::IfcPhysicalQuantity].insert(std::make_pair("HasExternalReferences", std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map[Type::IfcPhysicalQuantity].insert(std::make_pair("PartOfComplex", std::make_pair(Type::IfcPhysicalComplexQuantity, 2)));
inverse_map[Type::IfcPort].insert(std::make_pair("ContainedIn", std::make_pair(Type::IfcRelConnectsPortToElement, 4)));
inverse_map[Type::IfcPort].insert(std::make_pair("ConnectedFrom", std::make_pair(Type::IfcRelConnectsPorts, 5)));
inverse_map[Type::IfcPort].insert(std::make_pair("ConnectedTo", std::make_pair(Type::IfcRelConnectsPorts, 4)));
inverse_map[Type::IfcProcess].insert(std::make_pair("IsPredecessorTo", std::make_pair(Type::IfcRelSequence, 4)));
inverse_map[Type::IfcProcess].insert(std::make_pair("IsSuccessorFrom", std::make_pair(Type::IfcRelSequence, 5)));
inverse_map[Type::IfcProcess].insert(std::make_pair("OperatesOn", std::make_pair(Type::IfcRelAssignsToProcess, 6)));
inverse_map[Type::IfcProduct].insert(std::make_pair("ReferencedBy", std::make_pair(Type::IfcRelAssignsToProduct, 6)));
inverse_map[Type::IfcProductDefinitionShape].insert(std::make_pair("ShapeOfProduct", std::make_pair(Type::IfcProduct, 6)));
inverse_map[Type::IfcProductDefinitionShape].insert(std::make_pair("HasShapeAspects", std::make_pair(Type::IfcShapeAspect, 4)));
inverse_map[Type::IfcProfileDef].insert(std::make_pair("HasExternalReference", std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map[Type::IfcProfileDef].insert(std::make_pair("HasProperties", std::make_pair(Type::IfcProfileProperties, 3)));
inverse_map[Type::IfcProperty].insert(std::make_pair("PartOfPset", std::make_pair(Type::IfcPropertySet, 4)));
inverse_map[Type::IfcProperty].insert(std::make_pair("PropertyForDependance", std::make_pair(Type::IfcPropertyDependencyRelationship, 2)));
inverse_map[Type::IfcProperty].insert(std::make_pair("PropertyDependsOn", std::make_pair(Type::IfcPropertyDependencyRelationship, 3)));
inverse_map[Type::IfcProperty].insert(std::make_pair("PartOfComplex", std::make_pair(Type::IfcComplexProperty, 3)));
inverse_map[Type::IfcPropertyAbstraction].insert(std::make_pair("HasExternalReferences", std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map[Type::IfcPropertyDefinition].insert(std::make_pair("HasContext", std::make_pair(Type::IfcRelDeclares, 5)));
inverse_map[Type::IfcPropertyDefinition].insert(std::make_pair("HasAssociations", std::make_pair(Type::IfcRelAssociates, 4)));
inverse_map[Type::IfcPropertySetDefinition].insert(std::make_pair("DefinesType", std::make_pair(Type::IfcTypeObject, 5)));
inverse_map[Type::IfcPropertySetDefinition].insert(std::make_pair("IsDefinedBy", std::make_pair(Type::IfcRelDefinesByTemplate, 4)));
inverse_map[Type::IfcPropertySetDefinition].insert(std::make_pair("DefinesOccurrence", std::make_pair(Type::IfcRelDefinesByProperties, 5)));
inverse_map[Type::IfcPropertySetTemplate].insert(std::make_pair("Defines", std::make_pair(Type::IfcRelDefinesByTemplate, 5)));
inverse_map[Type::IfcPropertyTemplate].insert(std::make_pair("PartOfComplexTemplate", std::make_pair(Type::IfcComplexPropertyTemplate, 6)));
inverse_map[Type::IfcPropertyTemplate].insert(std::make_pair("PartOfPsetTemplate", std::make_pair(Type::IfcPropertySetTemplate, 6)));
inverse_map[Type::IfcRelSpaceBoundary1stLevel].insert(std::make_pair("InnerBoundaries", std::make_pair(Type::IfcRelSpaceBoundary1stLevel, 9)));
inverse_map[Type::IfcRelSpaceBoundary2ndLevel].insert(std::make_pair("Corresponds", std::make_pair(Type::IfcRelSpaceBoundary2ndLevel, 10)));
inverse_map[Type::IfcRepresentation].insert(std::make_pair("RepresentationMap", std::make_pair(Type::IfcRepresentationMap, 1)));
inverse_map[Type::IfcRepresentation].insert(std::make_pair("LayerAssignments", std::make_pair(Type::IfcPresentationLayerAssignment, 2)));
inverse_map[Type::IfcRepresentation].insert(std::make_pair("OfProductRepresentation", std::make_pair(Type::IfcProductRepresentation, 2)));
inverse_map[Type::IfcRepresentationContext].insert(std::make_pair("RepresentationsInContext", std::make_pair(Type::IfcRepresentation, 0)));
inverse_map[Type::IfcRepresentationItem].insert(std::make_pair("LayerAssignment", std::make_pair(Type::IfcPresentationLayerAssignment, 2)));
inverse_map[Type::IfcRepresentationItem].insert(std::make_pair("StyledByItem", std::make_pair(Type::IfcStyledItem, 0)));
inverse_map[Type::IfcRepresentationMap].insert(std::make_pair("HasShapeAspects", std::make_pair(Type::IfcShapeAspect, 4)));
inverse_map[Type::IfcRepresentationMap].insert(std::make_pair("MapUsage", std::make_pair(Type::IfcMappedItem, 0)));
inverse_map[Type::IfcResource].insert(std::make_pair("ResourceOf", std::make_pair(Type::IfcRelAssignsToResource, 6)));
inverse_map[Type::IfcShapeModel].insert(std::make_pair("OfShapeAspect", std::make_pair(Type::IfcShapeAspect, 0)));
inverse_map[Type::IfcSpace].insert(std::make_pair("HasCoverings", std::make_pair(Type::IfcRelCoversSpaces, 4)));
inverse_map[Type::IfcSpace].insert(std::make_pair("BoundedBy", std::make_pair(Type::IfcRelSpaceBoundary, 4)));
inverse_map[Type::IfcSpatialElement].insert(std::make_pair("ContainsElements", std::make_pair(Type::IfcRelContainedInSpatialStructure, 5)));
inverse_map[Type::IfcSpatialElement].insert(std::make_pair("ServicedBySystems", std::make_pair(Type::IfcRelServicesBuildings, 5)));
inverse_map[Type::IfcSpatialElement].insert(std::make_pair("ReferencesElements", std::make_pair(Type::IfcRelReferencedInSpatialStructure, 5)));
inverse_map[Type::IfcStructuralActivity].insert(std::make_pair("AssignedToStructuralItem", std::make_pair(Type::IfcRelConnectsStructuralActivity, 5)));
inverse_map[Type::IfcStructuralConnection].insert(std::make_pair("ConnectsStructuralMembers", std::make_pair(Type::IfcRelConnectsStructuralMember, 5)));
inverse_map[Type::IfcStructuralItem].insert(std::make_pair("AssignedStructuralActivity", std::make_pair(Type::IfcRelConnectsStructuralActivity, 4)));
inverse_map[Type::IfcStructuralLoadGroup].insert(std::make_pair("SourceOfResultGroup", std::make_pair(Type::IfcStructuralResultGroup, 6)));
inverse_map[Type::IfcStructuralLoadGroup].insert(std::make_pair("LoadGroupFor", std::make_pair(Type::IfcStructuralAnalysisModel, 7)));
inverse_map[Type::IfcStructuralMember].insert(std::make_pair("ConnectedBy", std::make_pair(Type::IfcRelConnectsStructuralMember, 4)));
inverse_map[Type::IfcStructuralResultGroup].insert(std::make_pair("ResultGroupFor", std::make_pair(Type::IfcStructuralAnalysisModel, 8)));
inverse_map[Type::IfcSurfaceTexture].insert(std::make_pair("IsMappedBy", std::make_pair(Type::IfcTextureCoordinate, 0)));
inverse_map[Type::IfcSurfaceTexture].insert(std::make_pair("UsedInStyles", std::make_pair(Type::IfcSurfaceStyleWithTextures, 0)));
inverse_map[Type::IfcSystem].insert(std::make_pair("ServicesBuildings", std::make_pair(Type::IfcRelServicesBuildings, 4)));
inverse_map[Type::IfcTableRow].insert(std::make_pair("OfTable", std::make_pair(Type::IfcTable, 1)));
inverse_map[Type::IfcTessellatedFaceSet].insert(std::make_pair("HasColours", std::make_pair(Type::IfcIndexedColourMap, 0)));
inverse_map[Type::IfcTessellatedFaceSet].insert(std::make_pair("HasTextures", std::make_pair(Type::IfcIndexedTextureMap, 1)));
inverse_map[Type::IfcTimeSeries].insert(std::make_pair("HasExternalReference", std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
inverse_map[Type::IfcTypeObject].insert(std::make_pair("Types", std::make_pair(Type::IfcRelDefinesByType, 5)));
inverse_map[Type::IfcTypeProcess].insert(std::make_pair("OperatesOn", std::make_pair(Type::IfcRelAssignsToProcess, 6)));
inverse_map[Type::IfcTypeProduct].insert(std::make_pair("ReferencedBy", std::make_pair(Type::IfcRelAssignsToProduct, 6)));
inverse_map[Type::IfcTypeResource].insert(std::make_pair("ResourceOf", std::make_pair(Type::IfcRelAssignsToResource, 6)));
}
void InitDerivedMap() {
@@ -4923,16 +4928,41 @@ std::pair<const char*, int> Type::GetEnumerationIndex(Enum t, const std::string&
std::pair<Type::Enum, unsigned> Type::GetInverseAttribute(Enum t, const std::string& a) {
if (inverse_map.empty()) ::InitInverseMap();
std::map<std::pair<Type::Enum, std::string>, std::pair<Type::Enum, int> >::const_iterator it;
std::pair<Type::Enum, std::string> key = std::make_pair(t, a);
inverse_map_t::const_iterator it;
inverse_map_t::mapped_type::const_iterator jt;
while (true) {
it = inverse_map.find(key);
if (it != inverse_map.end()) return it->second;
if ((key.first = Parent(key.first)) == -1) break;
it = inverse_map.find(t);
if (it != inverse_map.end()) {
jt = it->second.find(a);
if (jt != it->second.end()) {
return jt->second;
}
}
if ((t = Parent(t)) == -1) break;
}
throw IfcException("Attribute not found");
}
std::set<std::string> Type::GetInverseAttributeNames(Enum t) {
if (inverse_map.empty()) ::InitInverseMap();
inverse_map_t::const_iterator it;
inverse_map_t::mapped_type::const_iterator jt;
std::set<std::string> return_value;
while (true) {
it = inverse_map.find(t);
if (it != inverse_map.end()) {
for (jt = it->second.begin(); jt != it->second.end(); ++jt) {
return_value.insert(jt->first);
}
}
if ((t = Parent(t)) == -1) break;
}
return return_value;
}
void Type::PopulateDerivedFields(IfcWrite::IfcWritableEntity* e) {
std::map<Type::Enum, std::set<int> >::const_iterator i = derived_map.find(e->type());
if (i != derived_map.end()) {