/// <summary>
        /// Processes IfcSpatialStructureElement handle.
        /// </summary>
        /// <param name="ifcSpatialStructureElement">The IfcSpatialStructureElement handle.</param>
        /// <returns>The IFCSpatialStructureElement object.</returns>
        public static IFCSpatialStructureElement ProcessIFCSpatialStructureElement(IFCAnyHandle ifcSpatialStructureElement)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcSpatialStructureElement))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcSpatialStructureElement);
                return(null);
            }

            IFCEntity spatialStructureElement;

            if (IFCImportFile.TheFile.EntityMap.TryGetValue(ifcSpatialStructureElement.StepId, out spatialStructureElement))
            {
                return(spatialStructureElement as IFCSpatialStructureElement);
            }

            if (IFCAnyHandleUtil.IsSubTypeOf(ifcSpatialStructureElement, IFCEntityType.IfcSpace))
            {
                return(IFCSpace.ProcessIFCSpace(ifcSpatialStructureElement));
            }
            else if (IFCAnyHandleUtil.IsSubTypeOf(ifcSpatialStructureElement, IFCEntityType.IfcBuildingStorey))
            {
                return(IFCBuildingStorey.ProcessIFCBuildingStorey(ifcSpatialStructureElement));
            }
            else if (IFCAnyHandleUtil.IsSubTypeOf(ifcSpatialStructureElement, IFCEntityType.IfcSite))
            {
                return(IFCSite.ProcessIFCSite(ifcSpatialStructureElement));
            }
            else if (IFCAnyHandleUtil.IsSubTypeOf(ifcSpatialStructureElement, IFCEntityType.IfcBuilding))
            {
                return(IFCBuilding.ProcessIFCBuilding(ifcSpatialStructureElement));
            }

            return(new IFCSpatialStructureElement(ifcSpatialStructureElement));
        }
예제 #2
0
        /// <summary>
        /// Processes an IfcBuilding object.
        /// </summary>
        /// <param name="ifcBuilding">The IfcBuilding handle.</param>
        /// <returns>The IFCBuilding object.</returns>
        public static IFCBuilding ProcessIFCBuilding(IFCAnyHandle ifcBuilding)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcBuilding))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcBuilding);
                return(null);
            }

            IFCEntity building;

            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcBuilding.StepId, out building))
            {
                building = new IFCBuilding(ifcBuilding);
            }
            return(building as IFCBuilding);
        }
예제 #3
0
        /// <summary>
        /// Get the reference elevation of this object, located in the containing IFCBuilding.
        /// </summary>
        /// <returns>The value of the reference elevation.</returns>
        /// <remarks>This is intended for use for IFCBuildingStoreys.</remarks>
        protected double GetReferenceElevation()
        {
            if (Decomposes == null)
            {
                return(0.0);
            }

            IFCBuilding building = Decomposes as IFCBuilding;

            if (building != null)
            {
                return(building.ElevationOfRefHeight);
            }

            return(Decomposes.GetReferenceElevation());
        }
예제 #4
0
      /// <summary>
      /// Processes an IfcBuilding object.
      /// </summary>
      /// <param name="ifcBuilding">The IfcBuilding handle.</param>
      /// <returns>The IFCBuilding object.</returns>
      public static IFCBuilding ProcessIFCBuilding(IFCAnyHandle ifcBuilding)
      {
         if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcBuilding))
         {
            Importer.TheLog.LogNullError(IFCEntityType.IfcBuilding);
            return null;
         }

         IFCEntity building;
         if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcBuilding.StepId, out building))
            building = new IFCBuilding(ifcBuilding);
         return (building as IFCBuilding);
      }