示例#1
0
        /// <summary>
        /// Create an IFCEdge object from a handle of type IfcEdge
        /// </summary>
        /// <param name="ifcEdge">The IFC handle</param>
        /// <returns>The IfcEdge object</returns>
        public static IFCEdge ProcessIFCEdge(IFCAnyHandle ifcEdge)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcEdge))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcEdge);
                return(null);
            }

            if (IFCAnyHandleUtil.IsValidSubTypeOf(ifcEdge, IFCEntityType.IfcOrientedEdge))
            {
                return(IFCOrientedEdge.ProcessIFCOrientedEdge(ifcEdge));
            }
            if (IFCAnyHandleUtil.IsValidSubTypeOf(ifcEdge, IFCEntityType.IfcEdgeCurve))
            {
                return(IFCEdgeCurve.ProcessIFCEdgeCurve(ifcEdge));
            }

            IFCEntity edge;

            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcEdge.StepId, out edge))
            {
                edge = new IFCEdge(ifcEdge);
            }
            return(edge as IFCEdge);
        }
        /// <summary>
        /// Create an IFCEdgeCurve object from a handle of type IfcEdgeCurve
        /// </summary>
        /// <param name="ifcEdgeCurve">The IFC handle</param>
        /// <returns>The IFCEdgeCurve object</returns>
        public static IFCEdgeCurve ProcessIFCEdgeCurve(IFCAnyHandle ifcEdgeCurve)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcEdgeCurve))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcEdgeCurve);
                return null;
            }

            IFCEntity edge;
            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcEdgeCurve.StepId, out edge))
                edge = new IFCEdgeCurve(ifcEdgeCurve);
            return (edge as IFCEdgeCurve);
        }