Exemplo n.º 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);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create an IFCOrientedEdge object from a handle of type IfcOrientedEdge.
        /// </summary>
        /// <param name="ifcOrientedEdge">The IFC handle.</param>
        /// <returns>The IFCOrientedEdge object.</returns>
        public static IFCOrientedEdge ProcessIFCOrientedEdge(IFCAnyHandle ifcOrientedEdge)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcOrientedEdge))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcOrientedEdge);
                return(null);
            }

            IFCEntity orientedEdge;

            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcOrientedEdge.StepId, out orientedEdge))
            {
                orientedEdge = new IFCOrientedEdge(ifcOrientedEdge);
            }
            return(orientedEdge as IFCOrientedEdge);
        }
Exemplo n.º 3
0
        override protected void Process(IFCAnyHandle ifcEdgeLoop)
        {
            base.Process(ifcEdgeLoop);

            // TODO: checks that edgeList is closed and continuous
            IList <IFCAnyHandle> edgeList = IFCAnyHandleUtil.GetAggregateInstanceAttribute <List <IFCAnyHandle> >(ifcEdgeLoop, "EdgeList");

            if (edgeList == null)
            {
                Importer.TheLog.LogError(Id, "Cannot find the EdgeList of this loop", true);
            }
            IFCOrientedEdge orientedEdge = null;

            foreach (IFCAnyHandle edge in edgeList)
            {
                orientedEdge = IFCOrientedEdge.ProcessIFCOrientedEdge(edge);
                EdgeList.Add(orientedEdge);
            }
        }
        /// <summary>
        /// Create an IFCOrientedEdge object from a handle of type IfcOrientedEdge.
        /// </summary>
        /// <param name="ifcOrientedEdge">The IFC handle.</param>
        /// <returns>The IFCOrientedEdge object.</returns>
        public static IFCOrientedEdge ProcessIFCOrientedEdge(IFCAnyHandle ifcOrientedEdge)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcOrientedEdge))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcOrientedEdge);
                return null;
            }

            IFCEntity orientedEdge;
            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcOrientedEdge.StepId, out orientedEdge))
                orientedEdge = new IFCOrientedEdge(ifcOrientedEdge);
            return (orientedEdge as IFCOrientedEdge);
        }