コード例 #1
0
        /// <summary>
        /// Processes an IfcPresentationLayerAssignment entity handle.
        /// </summary>
        /// <param name="ifcPresentationLayerAssignment">The IfcPresentationLayerAssignment handle.</param>
        /// <returns>The IFCPresentationLayerAssignment object.</returns>
        public static IFCPresentationLayerAssignment ProcessIFCPresentationLayerAssignment(IFCAnyHandle ifcPresentationLayerAssignment)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcPresentationLayerAssignment))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcPresentationLayerAssignment);
                return(null);
            }

            IFCEntity presentationLayerAssignment;

            if (IFCImportFile.TheFile.EntityMap.TryGetValue(ifcPresentationLayerAssignment.StepId, out presentationLayerAssignment))
            {
                return(presentationLayerAssignment as IFCPresentationLayerAssignment);
            }

            if (IFCAnyHandleUtil.IsSubTypeOf(ifcPresentationLayerAssignment, IFCEntityType.IfcPresentationLayerWithStyle))
            {
                return(IFCPresentationLayerWithStyle.ProcessIFCPresentationLayerWithStyle(ifcPresentationLayerAssignment));
            }

            return(new IFCPresentationLayerAssignment(ifcPresentationLayerAssignment));
        }
コード例 #2
0
        /// <summary>
        /// Does a top-level check to see if this entity is equivalent to otherEntity.
        /// </summary>
        /// <param name="otherEntity">The other IFCEntity.</param>
        /// <returns>True if they are equivalent, false if they aren't, null if not enough information.</returns>
        /// <remarks>This isn't intended to be an exhaustive check, and isn't implemented for all types.  This is intended
        /// to be used by derived classes.</remarks>
        public override bool?MaybeEquivalentTo(IFCEntity otherEntity)
        {
            bool?maybeEquivalentTo = base.MaybeEquivalentTo(otherEntity);

            if (maybeEquivalentTo.HasValue)
            {
                return(maybeEquivalentTo.Value);
            }

            if (!(otherEntity is IFCPresentationLayerWithStyle))
            {
                return(false);
            }

            IFCPresentationLayerWithStyle other = otherEntity as IFCPresentationLayerWithStyle;

            if (!IFCEntity.AreIFCEntityListsEquivalent(LayerStyles, other.LayerStyles))
            {
                return(false);
            }

            return(null);
        }