示例#1
0
        internal static bool IfcTaperedSweptAreaProfiles(IfcProfileDef StartArea, IfcProfileDef EndArea)
        {
            // local variables
            bool Result = false;


            if (StartArea is IfcParameterizedProfileDef)
            {
                if (EndArea is IfcDerivedProfileDef)
                {
                    var end = EndArea as IfcDerivedProfileDef;
                    Result = end != null && StartArea == end.ParentProfile;
                }
                else
                {
                    Result = StartArea.GetType() == EndArea.GetType();
                }
            }
            else
            {
                if (EndArea is IfcDerivedProfileDef)
                {
                    var end = EndArea as IfcDerivedProfileDef;
                    Result = end != null && StartArea == end.ParentProfile;
                }
                else
                {
                    Result = false;
                }
            }
            return(Result);
        }
示例#2
0
        internal static bool IfcTaperedSweptAreaProfiles(IfcProfileDef StartArea, IfcProfileDef EndArea)
        {
            // local variables
            bool Result = false;


            if (INTYPEOF(StartArea, "IFC4.IFCPARAMETERIZEDPROFILEDEF"))
            {
                if (INTYPEOF(EndArea, "IFC4.IFCDERIVEDPROFILEDEF"))
                {
                    var end = EndArea as IIfcDerivedProfileDef;
                    // todo: handle null case?
                    Result = StartArea == end.ParentProfile;
                }
                else
                {
                    Result = (StartArea.GetType() == EndArea.GetType());
                }
            }
            else
            {
                if (INTYPEOF(EndArea, "IFC4.IFCDERIVEDPROFILEDEF"))
                {
                    var end = EndArea as IIfcDerivedProfileDef;
                    // todo: handle null case?
                    Result = StartArea == end.ParentProfile;
                }
                else
                {
                    Result = false;
                }
            }
            return(Result);
        }
        /// <summary>
        /// returns a Hash for the geometric behaviour of this object
        /// </summary>
        /// <param name="solid"></param>
        /// <returns></returns>
        public static int GetGeometryHashCode(this IfcProfileDef profile)
        {
            if (profile is IfcRectangleProfileDef)
            {
                if (profile is IfcRectangleHollowProfileDef)
                {
                    return(((IfcRectangleHollowProfileDef)profile).GetGeometryHashCode());
                }
                else
                {
                    return(((IfcRectangleProfileDef)profile).GetGeometryHashCode());
                }
            }
            else if (profile is IfcArbitraryClosedProfileDef)
            {
                return(((IfcArbitraryClosedProfileDef)profile).GetGeometryHashCode());
            }
            else if (profile is IfcCircleProfileDef)
            {
                return(((IfcCircleProfileDef)profile).GetGeometryHashCode());
            }
            else if (profile is IfcCircleHollowProfileDef)
            {
                return(((IfcCircleHollowProfileDef)profile).GetGeometryHashCode());
            }
            else if (profile is IfcLShapeProfileDef)
            {
                return(((IfcLShapeProfileDef)profile).GetGeometryHashCode());
            }
            else if (profile is IfcIShapeProfileDef)
            {
                return(((IfcIShapeProfileDef)profile).GetGeometryHashCode());
            }
            else if (profile is IfcUShapeProfileDef)
            {
                return(((IfcUShapeProfileDef)profile).GetGeometryHashCode());
            }
            else if (profile is IfcDerivedProfileDef)
            {
                return(((IfcDerivedProfileDef)profile).GetGeometryHashCode());
            }
            else
            {
                return(profile.GetHashCode());

                throw new XbimGeometryException("Unsupported solid geometry type " + profile.GetType().Name);
            }
        }