Exemplo n.º 1
0
        /// <summary>
        /// Create an IFCLoop object from a handle of type IfcLoop.
        /// </summary>
        /// <param name="ifcLoop">The IFC handle.</param>
        /// <returns>The IFCLoop object.</returns>
        public static IFCLoop ProcessIFCLoop(IFCAnyHandle ifcLoop)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcLoop))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcLoop);
                return(null);
            }

            IFCEntity loop;

            if (IFCImportFile.TheFile.EntityMap.TryGetValue(ifcLoop.StepId, out loop))
            {
                return(loop as IFCLoop);
            }

            if (IFCImportFile.TheFile.SchemaVersion >= IFCSchemaVersion.IFC2x2 && IFCAnyHandleUtil.IsSubTypeOf(ifcLoop, IFCEntityType.IfcEdgeLoop))
            {
                return(IFCEdgeLoop.ProcessIFCEdgeLoop(ifcLoop));
            }

            if (IFCAnyHandleUtil.IsSubTypeOf(ifcLoop, IFCEntityType.IfcPolyLoop))
            {
                return(IFCPolyLoop.ProcessIFCPolyLoop(ifcLoop));
            }

            Importer.TheLog.LogUnhandledSubTypeError(ifcLoop, IFCEntityType.IfcLoop, false);
            return(null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create an IFCEdgeLoop object from a handle of type IfcEdgeLoop.
        /// </summary>
        /// <param name="ifcEdgeLoop">The IFC handle.</param>
        /// <returns>The IFCEdgeLoop object.</returns>
        public static IFCEdgeLoop ProcessIFCEdgeLoop(IFCAnyHandle ifcEdgeLoop)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcEdgeLoop))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcFace);
                return(null);
            }

            IFCEntity edgeLoop;

            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcEdgeLoop.StepId, out edgeLoop))
            {
                edgeLoop = new IFCEdgeLoop(ifcEdgeLoop);
            }
            return(edgeLoop as IFCEdgeLoop);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Create an IFCEdgeLoop object from a handle of type IfcEdgeLoop.
        /// </summary>
        /// <param name="ifcEdgeLoop">The IFC handle.</param>
        /// <returns>The IFCEdgeLoop object.</returns>
        public static IFCEdgeLoop ProcessIFCEdgeLoop(IFCAnyHandle ifcEdgeLoop)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcEdgeLoop))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcFace);
                return null;
            }

            IFCEntity edgeLoop;
            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcEdgeLoop.StepId, out edgeLoop))
                edgeLoop = new IFCEdgeLoop(ifcEdgeLoop);
            return (edgeLoop as IFCEdgeLoop);
        }