Example #1
0
        /// <summary>
        /// Create an IFCManifoldSolidBrep object from a handle of type IfcManifoldSolidBrep.
        /// </summary>
        /// <param name="ifcManifoldSolidBrep">The IFC handle.</param>
        /// <returns>The IFCManifoldSolidBrep object.</returns>
        public static IFCManifoldSolidBrep ProcessIFCManifoldSolidBrep(IFCAnyHandle ifcManifoldSolidBrep)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcManifoldSolidBrep))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcManifoldSolidBrep);
                return(null);
            }

            if (IFCAnyHandleUtil.IsSubTypeOf(ifcManifoldSolidBrep, IFCEntityType.IfcFacetedBrep))
            {
                return(IFCFacetedBrep.ProcessIFCFacetedBrep(ifcManifoldSolidBrep));
            }

            if (IFCImportFile.TheFile.SchemaVersion > IFCSchemaVersion.IFC2x3 && IFCAnyHandleUtil.IsSubTypeOf(ifcManifoldSolidBrep, IFCEntityType.IfcAdvancedBrep))
            {
                Importer.TheLog.LogUnhandledSubTypeError(ifcManifoldSolidBrep, IFCEntityType.IfcManifoldSolidBrep, false);
                return(null);
            }

            IFCEntity manifoldSolidBrep;

            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcManifoldSolidBrep.StepId, out manifoldSolidBrep))
            {
                manifoldSolidBrep = new IFCManifoldSolidBrep(ifcManifoldSolidBrep);
            }
            return(manifoldSolidBrep as IFCManifoldSolidBrep);
        }
        /// <summary>
        /// Create an IFCFacetedBrep object from a handle of type IfcFacetedBrep.
        /// </summary>
        /// <param name="ifcFacetedBrep">The IFC handle.</param>
        /// <returns>The IFCFacetedBrep object.</returns>
        public static IFCFacetedBrep ProcessIFCFacetedBrep(IFCAnyHandle ifcFacetedBrep)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcFacetedBrep))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcFacetedBrep);
                return(null);
            }

            IFCEntity facetedBrep;

            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcFacetedBrep.StepId, out facetedBrep))
            {
                facetedBrep = new IFCFacetedBrep(ifcFacetedBrep);
            }
            return(facetedBrep as IFCFacetedBrep);
        }
        /// <summary>
        /// Create an IFCFacetedBrep object from a handle of type IfcFacetedBrep.
        /// </summary>
        /// <param name="ifcFacetedBrep">The IFC handle.</param>
        /// <returns>The IFCFacetedBrep object.</returns>
        public static IFCFacetedBrep ProcessIFCFacetedBrep(IFCAnyHandle ifcFacetedBrep)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcFacetedBrep))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcFacetedBrep);
                return null;
            }

            IFCEntity facetedBrep;
            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcFacetedBrep.StepId, out facetedBrep))
                facetedBrep = new IFCFacetedBrep(ifcFacetedBrep);
            return (facetedBrep as IFCFacetedBrep);
        }