Ejemplo n.º 1
0
        /// <summary>
        /// Processes IfcRoot attributes.
        /// </summary>
        /// <param name="ifcRoot">The IfcRoot handle.</param>
        protected override void Process(IFCAnyHandle ifcRoot)
        {
            base.Process(ifcRoot);

            GlobalId = IFCImportHandleUtil.GetRequiredStringAttribute(ifcRoot, "GlobalId", false);
            if (Importer.TheCache.CreatedGUIDs.Contains(GlobalId))
            {
                Importer.TheLog.LogWarning(Id, "Duplicate GUID: " + GlobalId, false);
            }
            else
            {
                Importer.TheCache.CreatedGUIDs.Add(GlobalId);
            }

            m_Name = IFCAnyHandleUtil.GetStringAttribute(ifcRoot, "Name");
            if (string.IsNullOrWhiteSpace(m_Name) && CreateNameIfNull())
            {
                m_Name = ifcRoot.TypeName;
            }
            m_Description = IFCAnyHandleUtil.GetStringAttribute(ifcRoot, "Description");

            IFCAnyHandle ownerHistoryHandle = IFCAnyHandleUtil.GetInstanceAttribute(ifcRoot, "OwnerHistory");

            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ownerHistoryHandle))
            {
                if (IFCImportFile.TheFile.SchemaVersion < IFCSchemaVersion.IFC4)
                {
                    Importer.TheLog.LogWarning(Id, "Missing IfcOwnerHistory, ignoring.", true);
                }
            }
            else
            {
                m_OwnerHistory = IFCOwnerHistory.ProcessIFCOwnerHistory(ownerHistoryHandle);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Cleans out the IFCEntity to save memory.
 /// </summary>
 public virtual void CleanEntity()
 {
     GlobalId = null;
     m_Name = null;
     m_Description = null;
     m_OwnerHistory = null;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Cleans out the IFCEntity to save memory.
 /// </summary>
 public virtual void CleanEntity()
 {
     GlobalId       = null;
     m_Name         = null;
     m_Description  = null;
     m_OwnerHistory = null;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Returns an IFCOwnerHistory object for an IfcOwnerHistory handle.
        /// </summary>
        /// <param name="ifcOwnerHistory">The IfcOwnerHistory handle.</param>
        /// <returns></returns>
        public static IFCOwnerHistory ProcessIFCOwnerHistory(IFCAnyHandle ifcOwnerHistory)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcOwnerHistory))
            {
                throw new ArgumentNullException("ifcOwnerHistory");
            }

            IFCEntity ownerHistory;

            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcOwnerHistory.StepId, out ownerHistory))
            {
                ownerHistory = new IFCOwnerHistory(ifcOwnerHistory);
            }
            return(ownerHistory as IFCOwnerHistory);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Processes IfcRoot attributes.
        /// </summary>
        /// <param name="ifcRoot">The IfcRoot handle.</param>
        protected override void Process(IFCAnyHandle ifcRoot)
        {
            base.Process(ifcRoot);

            GlobalId = IFCImportHandleUtil.GetRequiredStringAttribute(ifcRoot, "GlobalId", false);
            if (Importer.TheCache.CreatedGUIDs.Contains(GlobalId))
                IFCImportFile.TheLog.LogWarning(Id, "Duplicate GUID: " + GlobalId, false);
            else
                Importer.TheCache.CreatedGUIDs.Add(GlobalId);

            m_Name = IFCAnyHandleUtil.GetStringAttribute(ifcRoot, "Name");
            m_Description = IFCAnyHandleUtil.GetStringAttribute(ifcRoot, "Description");
            
            IFCAnyHandle ownerHistoryHandle = IFCAnyHandleUtil.GetInstanceAttribute(ifcRoot, "OwnerHistory");
            m_OwnerHistory = IFCOwnerHistory.ProcessIFCOwnerHistory(ownerHistoryHandle);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Processes IfcRoot attributes.
        /// </summary>
        /// <param name="ifcRoot">The IfcRoot handle.</param>
        protected override void Process(IFCAnyHandle ifcRoot)
        {
            base.Process(ifcRoot);

            GlobalId = IFCImportHandleUtil.GetRequiredStringAttribute(ifcRoot, "GlobalId", false);
            if (Importer.TheCache.CreatedGUIDs.Contains(GlobalId))
            {
                IFCImportFile.TheLog.LogWarning(Id, "Duplicate GUID: " + GlobalId, false);
            }
            else
            {
                Importer.TheCache.CreatedGUIDs.Add(GlobalId);
            }

            m_Name        = IFCAnyHandleUtil.GetStringAttribute(ifcRoot, "Name");
            m_Description = IFCAnyHandleUtil.GetStringAttribute(ifcRoot, "Description");

            IFCAnyHandle ownerHistoryHandle = IFCAnyHandleUtil.GetInstanceAttribute(ifcRoot, "OwnerHistory");

            m_OwnerHistory = IFCOwnerHistory.ProcessIFCOwnerHistory(ownerHistoryHandle);
        }
        /// <summary>
        /// Returns an IFCOwnerHistory object for an IfcOwnerHistory handle.
        /// </summary>
        /// <param name="ifcOwnerHistory">The IfcOwnerHistory handle.</param>
        /// <returns></returns>
        public static IFCOwnerHistory ProcessIFCOwnerHistory(IFCAnyHandle ifcOwnerHistory)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcOwnerHistory))
                throw new ArgumentNullException("ifcOwnerHistory");

            IFCEntity ownerHistory;
            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcOwnerHistory.StepId, out ownerHistory))
                ownerHistory = new IFCOwnerHistory(ifcOwnerHistory);
            return (ownerHistory as IFCOwnerHistory); 
        }