Fixes for inverse attributes

This commit is contained in:
Thomas Krijnen
2014-06-03 18:50:29 +02:00
parent fe172672e9
commit e4f141b107
4 changed files with 216 additions and 201 deletions
+4 -2
View File
@@ -88,12 +88,14 @@ class RuntimeTypingImplementation:
for name, type in mapping.schema.entities.items():
if type.inverse:
for attr in type.inverse.elements:
print (attr)
related_entity = mapping.schema.entities[attr.entity]
related_attrs = [a['name'] for a in mapping.get_assignable_arguments(related_entity, include_derived=True)]
inverse_implementations.append(templates.inverse_implementation % {
'type' : name,
'name' : attr.name,
'related_type' : attr.entity,
'index' : [i for i, a in enumerate(mapping.schema.entities[attr.entity].attributes) if a.name == attr.attribute][0]
'index' : related_attrs.index(attr.attribute)
})
self.str = templates.rt_implementation % {
+70 -70
View File
@@ -4049,10 +4049,10 @@ void InitDescriptorMap() {
}
void InitInverseMap() {
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcActor, "IsActingUpon"), std::make_pair(Type::IfcRelAssignsToActor, 0)));
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::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, 0)));
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, "ValuesReferenced"), std::make_pair(Type::IfcReferencesValueDocument, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcAppliedValue, "ValueOfComponents"), std::make_pair(Type::IfcAppliedValueRelationship, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcAppliedValue, "IsComponentIn"), std::make_pair(Type::IfcAppliedValueRelationship, 1)));
@@ -4069,70 +4069,70 @@ void InitInverseMap() {
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcConstraint, "PropertiesForConstraint"), std::make_pair(Type::IfcPropertyConstraintRelationship, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcConstraint, "Aggregates"), std::make_pair(Type::IfcConstraintAggregationRelationship, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcConstraint, "IsAggregatedIn"), std::make_pair(Type::IfcConstraintAggregationRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcControl, "Controls"), std::make_pair(Type::IfcRelAssignsToControl, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcCovering, "CoversSpaces"), std::make_pair(Type::IfcRelCoversSpaces, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcCovering, "Covers"), std::make_pair(Type::IfcRelCoversBldgElements, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDimensionCurve, "AnnotatedBySymbols"), std::make_pair(Type::IfcTerminatorSymbol, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDistributionControlElement, "AssignedToFlowElement"), std::make_pair(Type::IfcRelFlowControlElements, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDistributionFlowElement, "HasControlElements"), std::make_pair(Type::IfcRelFlowControlElements, 1)));
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::IfcCovering, "CoversSpaces"), std::make_pair(Type::IfcRelCoversSpaces, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcCovering, "Covers"), std::make_pair(Type::IfcRelCoversBldgElements, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDimensionCurve, "AnnotatedBySymbols"), std::make_pair(Type::IfcTerminatorSymbol, 3)));
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::IfcDistributionFlowElement, "HasControlElements"), std::make_pair(Type::IfcRelFlowControlElements, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDocumentInformation, "IsPointedTo"), std::make_pair(Type::IfcDocumentInformationRelationship, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDocumentInformation, "IsPointer"), std::make_pair(Type::IfcDocumentInformationRelationship, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDocumentReference, "ReferenceToDocument"), std::make_pair(Type::IfcDocumentInformation, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDraughtingCallout, "IsRelatedFromCallout"), std::make_pair(Type::IfcDraughtingCalloutRelationship, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDraughtingCallout, "IsRelatedToCallout"), std::make_pair(Type::IfcDraughtingCalloutRelationship, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "HasStructuralMember"), std::make_pair(Type::IfcRelConnectsStructuralElement, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "FillsVoids"), std::make_pair(Type::IfcRelFillsElement, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "ConnectedTo"), std::make_pair(Type::IfcRelConnectsElements, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "HasCoverings"), std::make_pair(Type::IfcRelCoversBldgElements, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "HasProjections"), std::make_pair(Type::IfcRelProjectsElement, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "ReferencedInStructures"), std::make_pair(Type::IfcRelReferencedInSpatialStructure, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "HasPorts"), std::make_pair(Type::IfcRelConnectsPortToElement, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "HasOpenings"), std::make_pair(Type::IfcRelVoidsElement, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "IsConnectionRealization"), std::make_pair(Type::IfcRelConnectsWithRealizingElements, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "ProvidesBoundaries"), std::make_pair(Type::IfcRelSpaceBoundary, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "ConnectedFrom"), std::make_pair(Type::IfcRelConnectsElements, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "ContainedInStructure"), std::make_pair(Type::IfcRelContainedInSpatialStructure, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcFeatureElementAddition, "ProjectsElements"), std::make_pair(Type::IfcRelProjectsElement, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcFeatureElementSubtraction, "VoidsElements"), std::make_pair(Type::IfcRelVoidsElement, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGeometricRepresentationContext, "HasSubContexts"), std::make_pair(Type::IfcGeometricRepresentationSubContext, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGrid, "ContainedInStructure"), std::make_pair(Type::IfcRelContainedInSpatialStructure, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGridAxis, "PartOfW"), std::make_pair(Type::IfcGrid, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGridAxis, "PartOfV"), std::make_pair(Type::IfcGrid, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGridAxis, "PartOfU"), std::make_pair(Type::IfcGrid, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "HasStructuralMember"), std::make_pair(Type::IfcRelConnectsStructuralElement, 4)));
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, "HasCoverings"), std::make_pair(Type::IfcRelCoversBldgElements, 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, "HasPorts"), std::make_pair(Type::IfcRelConnectsPortToElement, 5)));
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::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, 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::IfcLibraryReference, "ReferenceIntoLibrary"), std::make_pair(Type::IfcLibraryInformation, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcMaterial, "HasRepresentation"), std::make_pair(Type::IfcMaterialDefinitionRepresentation, 0)));
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, "ClassifiedAs"), std::make_pair(Type::IfcMaterialClassificationRelationship, 1)));
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::IfcObject, "IsDefinedBy"), std::make_pair(Type::IfcRelDefines, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "HasAssignments"), std::make_pair(Type::IfcRelAssigns, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "IsDecomposedBy"), std::make_pair(Type::IfcRelDecomposes, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "Decomposes"), std::make_pair(Type::IfcRelDecomposes, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "HasAssociations"), std::make_pair(Type::IfcRelAssociates, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectPlacement, "PlacesObject"), std::make_pair(Type::IfcProduct, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObject, "IsDefinedBy"), std::make_pair(Type::IfcRelDefines, 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, "IsDecomposedBy"), std::make_pair(Type::IfcRelDecomposes, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "Decomposes"), std::make_pair(Type::IfcRelDecomposes, 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, 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, "PartOfComplex"), std::make_pair(Type::IfcPhysicalComplexQuantity, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPort, "ContainedIn"), std::make_pair(Type::IfcRelConnectsPortToElement, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPort, "ConnectedFrom"), std::make_pair(Type::IfcRelConnectsPorts, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPort, "ConnectedTo"), std::make_pair(Type::IfcRelConnectsPorts, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProcess, "OperatesOn"), std::make_pair(Type::IfcRelAssignsToProcess, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProcess, "IsSuccessorFrom"), std::make_pair(Type::IfcRelSequence, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProcess, "IsPredecessorTo"), std::make_pair(Type::IfcRelSequence, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProduct, "ReferencedBy"), std::make_pair(Type::IfcRelAssignsToProduct, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProductDefinitionShape, "ShapeOfProduct"), std::make_pair(Type::IfcProduct, 1)));
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, "OperatesOn"), std::make_pair(Type::IfcRelAssignsToProcess, 6)));
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, "IsPredecessorTo"), std::make_pair(Type::IfcRelSequence, 4)));
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::IfcProperty, "PropertyForDependance"), std::make_pair(Type::IfcPropertyDependencyRelationship, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProperty, "PropertyDependsOn"), std::make_pair(Type::IfcPropertyDependencyRelationship, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProperty, "PartOfComplex"), std::make_pair(Type::IfcComplexProperty, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertyDefinition, "HasAssociations"), std::make_pair(Type::IfcRelAssociates, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertySetDefinition, "PropertyDefinitionOf"), std::make_pair(Type::IfcRelDefinesByProperties, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertySetDefinition, "DefinesType"), std::make_pair(Type::IfcTypeObject, 1)));
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::IfcPropertyDefinition, "HasAssociations"), std::make_pair(Type::IfcRelAssociates, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertySetDefinition, "PropertyDefinitionOf"), std::make_pair(Type::IfcRelDefinesByProperties, 5)));
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::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)));
@@ -4140,30 +4140,30 @@ void InitInverseMap() {
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcRepresentationItem, "LayerAssignments"), 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, "MapUsage"), std::make_pair(Type::IfcMappedItem, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcResource, "ResourceOf"), std::make_pair(Type::IfcRelAssignsToResource, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcScheduleTimeControl, "ScheduleTimeControlAssigned"), std::make_pair(Type::IfcRelAssignsTasks, 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::IfcScheduleTimeControl, "ScheduleTimeControlAssigned"), std::make_pair(Type::IfcRelAssignsTasks, 7)));
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, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpace, "BoundedBy"), std::make_pair(Type::IfcRelSpaceBoundary, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpaceProgram, "HasInteractionReqsFrom"), std::make_pair(Type::IfcRelInteractionRequirements, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpaceProgram, "HasInteractionReqsTo"), std::make_pair(Type::IfcRelInteractionRequirements, 4)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpatialStructureElement, "ReferencesElements"), std::make_pair(Type::IfcRelReferencedInSpatialStructure, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpatialStructureElement, "ServicedBySystems"), std::make_pair(Type::IfcRelServicesBuildings, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpatialStructureElement, "ContainsElements"), std::make_pair(Type::IfcRelContainedInSpatialStructure, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralActivity, "AssignedToStructuralItem"), std::make_pair(Type::IfcRelConnectsStructuralActivity, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralConnection, "ConnectsStructuralMembers"), std::make_pair(Type::IfcRelConnectsStructuralMember, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralItem, "AssignedStructuralActivity"), std::make_pair(Type::IfcRelConnectsStructuralActivity, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralLoadGroup, "SourceOfResultGroup"), std::make_pair(Type::IfcStructuralResultGroup, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralLoadGroup, "LoadGroupFor"), std::make_pair(Type::IfcStructuralAnalysisModel, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralMember, "ReferencesElement"), std::make_pair(Type::IfcRelConnectsStructuralElement, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralMember, "ConnectedBy"), std::make_pair(Type::IfcRelConnectsStructuralMember, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralReaction, "Causes"), std::make_pair(Type::IfcStructuralAction, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralResultGroup, "ResultGroupFor"), std::make_pair(Type::IfcStructuralAnalysisModel, 3)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSystem, "ServicesBuildings"), std::make_pair(Type::IfcRelServicesBuildings, 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::IfcSpaceProgram, "HasInteractionReqsFrom"), std::make_pair(Type::IfcRelInteractionRequirements, 7)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpaceProgram, "HasInteractionReqsTo"), std::make_pair(Type::IfcRelInteractionRequirements, 8)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpatialStructureElement, "ReferencesElements"), std::make_pair(Type::IfcRelReferencedInSpatialStructure, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpatialStructureElement, "ServicedBySystems"), std::make_pair(Type::IfcRelServicesBuildings, 5)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpatialStructureElement, "ContainsElements"), std::make_pair(Type::IfcRelContainedInSpatialStructure, 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, "ReferencesElement"), std::make_pair(Type::IfcRelConnectsStructuralElement, 5)));
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::IfcStructuralReaction, "Causes"), std::make_pair(Type::IfcStructuralAction, 10)));
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::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::IfcTextureCoordinate, "AnnotatedSurface"), std::make_pair(Type::IfcAnnotationSurface, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcTimeSeries, "DocumentedBy"), std::make_pair(Type::IfcTimeSeriesReferenceRelationship, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcTypeObject, "ObjectTypeOf"), std::make_pair(Type::IfcRelDefinesByType, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcTypeObject, "ObjectTypeOf"), std::make_pair(Type::IfcRelDefinesByType, 5)));
}
int Type::GetAttributeIndex(Enum t, const std::string& a) {
@@ -4215,7 +4215,7 @@ std::pair<Type::Enum, unsigned> Type::GetInverseAttribute(Enum t, const std::str
while (true) {
it = inverse_map.find(key);
if (it != inverse_map.end()) return it->second;
if ((key.first = Parent(key.first)) == -1) break;
if ((key.first = Parent(key.first)) == -1) break;
}
throw IfcException("Attribute not found");
}
+133 -128
View File
@@ -4703,122 +4703,122 @@ void InitDescriptorMap() {
}
void InitInverseMap() {
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcActor, "IsActingUpon"), std::make_pair(Type::IfcRelAssignsToActor, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcActorRole, "HasExternalReference"), std::make_pair(Type::IfcExternalReferenceRelationship, 1)));
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, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcAppliedValue, "HasExternalReference"), std::make_pair(Type::IfcExternalReferenceRelationship, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcApproval, "HasExternalReferences"), std::make_pair(Type::IfcExternalReferenceRelationship, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcApproval, "ApprovedObjects"), std::make_pair(Type::IfcRelAssociatesApproval, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcApproval, "ApprovedResources"), std::make_pair(Type::IfcResourceApprovalRelationship, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcApproval, "IsRelatedWith"), std::make_pair(Type::IfcApprovalRelationship, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcApproval, "Relates"), std::make_pair(Type::IfcApprovalRelationship, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcBuildingElement, "HasCoverings"), std::make_pair(Type::IfcRelCoversBldgElements, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcClassification, "ClassificationForObjects"), std::make_pair(Type::IfcRelAssociatesClassification, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcClassification, "HasReferences"), std::make_pair(Type::IfcClassificationReference, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcClassificationReference, "ClassificationRefForObjects"), std::make_pair(Type::IfcRelAssociatesClassification, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcClassificationReference, "HasReferences"), std::make_pair(Type::IfcClassificationReference, 0)));
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, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcConstraint, "PropertiesForConstraint"), std::make_pair(Type::IfcResourceConstraintRelationship, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcContext, "IsDefinedBy"), std::make_pair(Type::IfcRelDefinesByProperties, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcContext, "Declares"), std::make_pair(Type::IfcRelDeclares, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcContextDependentUnit, "HasExternalReference"), std::make_pair(Type::IfcExternalReferenceRelationship, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcControl, "Controls"), std::make_pair(Type::IfcRelAssignsToControl, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcConversionBasedUnit, "HasExternalReference"), std::make_pair(Type::IfcExternalReferenceRelationship, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcCovering, "CoversSpaces"), std::make_pair(Type::IfcRelCoversSpaces, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcCovering, "CoversElements"), std::make_pair(Type::IfcRelCoversBldgElements, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDistributionControlElement, "AssignedToFlowElement"), std::make_pair(Type::IfcRelFlowControlElements, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDistributionElement, "HasPorts"), std::make_pair(Type::IfcRelConnectsPortToElement, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDistributionFlowElement, "HasControlElements"), std::make_pair(Type::IfcRelFlowControlElements, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDocumentInformation, "DocumentInfoForObjects"), std::make_pair(Type::IfcRelAssociatesDocument, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDocumentInformation, "HasDocumentReferences"), std::make_pair(Type::IfcDocumentReference, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDocumentInformation, "IsPointedTo"), std::make_pair(Type::IfcDocumentInformationRelationship, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDocumentInformation, "IsPointer"), std::make_pair(Type::IfcDocumentInformationRelationship, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcDocumentReference, "DocumentRefForObjects"), std::make_pair(Type::IfcRelAssociatesDocument, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "FillsVoids"), std::make_pair(Type::IfcRelFillsElement, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "ConnectedTo"), std::make_pair(Type::IfcRelConnectsElements, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "IsInterferedByElements"), std::make_pair(Type::IfcRelInterferesElements, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "InterferesElements"), std::make_pair(Type::IfcRelInterferesElements, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "HasProjections"), std::make_pair(Type::IfcRelProjectsElement, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "ReferencedInStructures"), std::make_pair(Type::IfcRelReferencedInSpatialStructure, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "HasOpenings"), std::make_pair(Type::IfcRelVoidsElement, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "IsConnectionRealization"), std::make_pair(Type::IfcRelConnectsWithRealizingElements, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "ProvidesBoundaries"), std::make_pair(Type::IfcRelSpaceBoundary, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "ConnectedFrom"), std::make_pair(Type::IfcRelConnectsElements, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcElement, "ContainedInStructure"), std::make_pair(Type::IfcRelContainedInSpatialStructure, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcExternalReference, "ExternalReferenceForResources"), std::make_pair(Type::IfcExternalReferenceRelationship, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcExternalSpatialElement, "BoundedBy"), std::make_pair(Type::IfcRelSpaceBoundary, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcFace, "HasTextureMaps"), std::make_pair(Type::IfcTextureMap, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcFeatureElementAddition, "ProjectsElements"), std::make_pair(Type::IfcRelProjectsElement, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcFeatureElementSubtraction, "VoidsElements"), std::make_pair(Type::IfcRelVoidsElement, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGeometricRepresentationContext, "HasSubContexts"), std::make_pair(Type::IfcGeometricRepresentationSubContext, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGrid, "ContainedInStructure"), std::make_pair(Type::IfcRelContainedInSpatialStructure, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGridAxis, "PartOfW"), std::make_pair(Type::IfcGrid, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGridAxis, "PartOfV"), std::make_pair(Type::IfcGrid, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcGridAxis, "PartOfU"), std::make_pair(Type::IfcGrid, 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, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcLibraryInformation, "LibraryInfoForObjects"), std::make_pair(Type::IfcRelAssociatesLibrary, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcLibraryInformation, "HasLibraryReferences"), std::make_pair(Type::IfcLibraryReference, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcLibraryReference, "LibraryRefForObjects"), std::make_pair(Type::IfcRelAssociatesLibrary, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcMaterial, "HasRepresentation"), std::make_pair(Type::IfcMaterialDefinitionRepresentation, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcMaterial, "IsRelatedWith"), std::make_pair(Type::IfcMaterialRelationship, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcMaterial, "RelatesTo"), std::make_pair(Type::IfcMaterialRelationship, 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, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcMaterialDefinition, "HasExternalReferences"), std::make_pair(Type::IfcExternalReferenceRelationship, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcMaterialDefinition, "HasProperties"), std::make_pair(Type::IfcMaterialProperties, 0)));
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, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObject, "IsDeclaredBy"), std::make_pair(Type::IfcRelDefinesByObject, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObject, "Declares"), std::make_pair(Type::IfcRelDefinesByObject, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObject, "IsTypedBy"), std::make_pair(Type::IfcRelDefinesByType, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObject, "IsDefinedBy"), std::make_pair(Type::IfcRelDefinesByProperties, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "HasAssignments"), std::make_pair(Type::IfcRelAssigns, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "Nests"), std::make_pair(Type::IfcRelNests, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "IsNestedBy"), std::make_pair(Type::IfcRelNests, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "HasContext"), std::make_pair(Type::IfcRelDeclares, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "IsDecomposedBy"), std::make_pair(Type::IfcRelAggregates, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "Decomposes"), std::make_pair(Type::IfcRelAggregates, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectDefinition, "HasAssociations"), std::make_pair(Type::IfcRelAssociates, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcObjectPlacement, "PlacesObject"), std::make_pair(Type::IfcProduct, 0)));
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, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcOrganization, "IsRelatedBy"), std::make_pair(Type::IfcOrganizationRelationship, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcOrganization, "Relates"), std::make_pair(Type::IfcOrganizationRelationship, 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, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPhysicalQuantity, "PartOfComplex"), std::make_pair(Type::IfcPhysicalComplexQuantity, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPort, "ContainedIn"), std::make_pair(Type::IfcRelConnectsPortToElement, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPort, "ConnectedFrom"), std::make_pair(Type::IfcRelConnectsPorts, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPort, "ConnectedTo"), std::make_pair(Type::IfcRelConnectsPorts, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProcess, "IsPredecessorTo"), std::make_pair(Type::IfcRelSequence, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProcess, "IsSuccessorFrom"), std::make_pair(Type::IfcRelSequence, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProcess, "OperatesOn"), std::make_pair(Type::IfcRelAssignsToProcess, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProduct, "ReferencedBy"), std::make_pair(Type::IfcRelAssignsToProduct, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProductDefinitionShape, "ShapeOfProduct"), std::make_pair(Type::IfcProduct, 1)));
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, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProfileDef, "HasProperties"), std::make_pair(Type::IfcProfileProperties, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProperty, "PartOfPset"), std::make_pair(Type::IfcPropertySet, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProperty, "PropertyForDependance"), std::make_pair(Type::IfcPropertyDependencyRelationship, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProperty, "PropertyDependsOn"), std::make_pair(Type::IfcPropertyDependencyRelationship, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcProperty, "PartOfComplex"), std::make_pair(Type::IfcComplexProperty, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertyAbstraction, "HasExternalReferences"), std::make_pair(Type::IfcExternalReferenceRelationship, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertyDefinition, "HasContext"), std::make_pair(Type::IfcRelDeclares, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertyDefinition, "HasAssociations"), std::make_pair(Type::IfcRelAssociates, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertySetDefinition, "DefinesType"), std::make_pair(Type::IfcTypeObject, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertySetDefinition, "IsDefinedBy"), std::make_pair(Type::IfcRelDefinesByTemplate, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertySetDefinition, "DefinesOccurrence"), std::make_pair(Type::IfcRelDefinesByProperties, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertySetTemplate, "Defines"), std::make_pair(Type::IfcRelDefinesByTemplate, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertyTemplate, "PartOfComplexTemplate"), std::make_pair(Type::IfcComplexPropertyTemplate, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcPropertyTemplate, "PartOfPsetTemplate"), std::make_pair(Type::IfcPropertySetTemplate, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcRelSpaceBoundary1stLevel, "InnerBoundaries"), std::make_pair(Type::IfcRelSpaceBoundary1stLevel, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcRelSpaceBoundary2ndLevel, "Corresponds"), std::make_pair(Type::IfcRelSpaceBoundary2ndLevel, 0)));
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)));
@@ -4827,31 +4827,31 @@ void InitInverseMap() {
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, 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, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpace, "BoundedBy"), std::make_pair(Type::IfcRelSpaceBoundary, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpatialElement, "ContainsElements"), std::make_pair(Type::IfcRelContainedInSpatialStructure, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpatialElement, "ServicedBySystems"), std::make_pair(Type::IfcRelServicesBuildings, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcSpatialElement, "ReferencesElements"), std::make_pair(Type::IfcRelReferencedInSpatialStructure, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralActivity, "AssignedToStructuralItem"), std::make_pair(Type::IfcRelConnectsStructuralActivity, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralConnection, "ConnectsStructuralMembers"), std::make_pair(Type::IfcRelConnectsStructuralMember, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralItem, "AssignedStructuralActivity"), std::make_pair(Type::IfcRelConnectsStructuralActivity, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralLoadGroup, "SourceOfResultGroup"), std::make_pair(Type::IfcStructuralResultGroup, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralLoadGroup, "LoadGroupFor"), std::make_pair(Type::IfcStructuralAnalysisModel, 2)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralMember, "ConnectedBy"), std::make_pair(Type::IfcRelConnectsStructuralMember, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcStructuralResultGroup, "ResultGroupFor"), std::make_pair(Type::IfcStructuralAnalysisModel, 3)));
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, 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, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcTimeSeries, "HasExternalReference"), std::make_pair(Type::IfcExternalReferenceRelationship, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcTypeObject, "Types"), std::make_pair(Type::IfcRelDefinesByType, 1)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcTypeProcess, "OperatesOn"), std::make_pair(Type::IfcRelAssignsToProcess, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcTypeProduct, "ReferencedBy"), std::make_pair(Type::IfcRelAssignsToProduct, 0)));
inverse_map.insert(std::make_pair(std::make_pair(Type::IfcTypeResource, "ResourceOf"), std::make_pair(Type::IfcRelAssignsToResource, 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)));
}
int Type::GetAttributeIndex(Enum t, const std::string& a) {
@@ -4897,10 +4897,15 @@ 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;
it = inverse_map.find(std::make_pair(t, a));
if (it == inverse_map.end()) throw IfcException("Attribute not found");
else return it->second;
std::pair<Type::Enum, std::string> key = std::make_pair(t, a);
while (true) {
it = inverse_map.find(key);
if (it != inverse_map.end()) return it->second;
if ((key.first = Parent(key.first)) == -1) break;
}
throw IfcException("Attribute not found");
}
Type::Enum Type::GetAttributeEnumerationClass(Enum t, unsigned char a) {
+9 -1
View File
@@ -145,7 +145,15 @@ std::string IfcParse::IfcUntypedEntity::toString() {
}
IfcEntities IfcParse::IfcUntypedEntity::get_inverse(const std::string& a) {
std::pair<IfcSchema::Type::Enum, unsigned> inv = IfcSchema::Type::GetInverseAttribute(_type, a);
return entity->getInverse(inv.first);
IfcEntities invs = entity->getInverse(inv.first);
IfcEntities filtered(new IfcEntityList());
for (auto it = invs->begin(); it != invs->end(); ++it) {
try {
const int id = *(*it)->entity->getArgument(inv.second);
if (id == this->entity->id()) { filtered->push(*it); }
} catch (...) {}
}
return filtered;
}
bool IfcParse::IfcUntypedEntity::is_valid() {
const unsigned arg_count = getArgumentCount();