Example #1
0
 internal string ExternalSystemName(IIfcRoot ifcObject)
 {
     if (ExternalReferenceMode == ExternalReferenceMode.IgnoreSystem ||
         ExternalReferenceMode == ExternalReferenceMode.IgnoreSystemAndEntityName)
     {
         return(null);
     }
     return(GetCreatingApplication(ifcObject));
 }
Example #2
0
 public string ExternalEntityName(IIfcRoot ifcObject)
 {
     if (
         ExternalReferenceMode == ExternalReferenceMode.IgnoreEntityName ||
         ExternalReferenceMode == ExternalReferenceMode.IgnoreSystemAndEntityName)
     {
         return(null);
     }
     return(ifcObject.GetType().Name);
 }
Example #3
0
 public string GetCreatingApplication(IIfcRoot ifcRootObject)
 {
     if (ifcRootObject.OwnerHistory.LastModifyingApplication != null)
     {
         return(ifcRootObject.OwnerHistory.LastModifyingApplication.ApplicationFullName);
     }
     if (ifcRootObject.OwnerHistory.OwningApplication != null)
     {
         return(ifcRootObject.OwnerHistory.OwningApplication.ApplicationFullName);
     }
     return(_creatingApplication);
 }
Example #4
0
        protected LoinItem(IIfcRoot root)
        {
            Id          = root.EntityLabel;
            Identifier  = Name = root.Name;
            Description = root.Description;
            UUID        = root.GlobalId;

            if (root is Xbim.Ifc4.Kernel.IfcDefinitionSelect def)
            {
                Name        = def.GetName(lang) ?? root.Name;
                Description = def.GetDescription(lang) ?? root.Description;
            }
        }
Example #5
0
        public string ExternalEntityIdentity(IIfcRoot ifcObject)
        {
            switch (EntityIdentifierMode)
            {
            case EntityIdentifierMode.IIfcEntityLabels:

                return(ifcObject.EntityLabel.ToString(CultureInfo.InvariantCulture));

            case EntityIdentifierMode.GloballyUniqueIds:
                return(ifcObject.GlobalId);

            default:
                return(null);
            }
        }
Example #6
0
        internal IfcValidationMessage Put(Qualifier modelQualifier, IIfcRoot ifcObject)
        {
            if (null == ifcObject.GlobalId)
            {
                return(IfcValidationMessage.ByResult(_nextIndex++, null, IfcReportDomain.Schema, ID_SOURCE, "Not set", ID_REASON));
            }

            List <IfcInstanceRef> refs;
            var @ref = new IfcInstanceRef {
                Qualifier = modelQualifier, InstanceHandle = new XbimInstanceHandle(ifcObject)
            };
            var ifcGuid = ifcObject.GlobalId.ToString();

            if (GuidStore.TryGetValue(ifcGuid, out refs))
            {
                refs.Add(@ref);
                return(IfcValidationMessage.ByResult(
                           _nextIndex++,
                           null,
                           IfcReportDomain.SchemaConstraint,
                           ID_SOURCE, "Not unique", ID_REASON, ifcObject.ExpressType.ExpressName,
                           ifcGuid));
            }
            else
            {
                GuidStore.Add(ifcGuid, new List <IfcInstanceRef>()
                {
                    @ref
                });
                return(IfcValidationMessage.ByResult(
                           _nextIndex++,
                           null,
                           IfcReportDomain.Passed, ID_SOURCE, "Set & unique", ID_REASON,
                           ifcGuid));
            }
        }