Пример #1
0
        /// <summary>
        /// Compares two objects for geomtric equality
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b">object to compare with</param>
        /// <returns></returns>
        public static bool GeometricEquals(this IfcLShapeProfileDef a, IfcProfileDef b)
        {
            IfcLShapeProfileDef p = b as IfcLShapeProfileDef;

            if (p == null)
            {
                return(false);           //different types are not the same
            }
            return(a.Depth == p.Depth &&
                   a.Thickness == p.Thickness &&
                   a.Width == p.Width &&
                   a.Position.GeometricEquals(p.Position));
        }
Пример #2
0
        /// <summary>
        /// returns a Hash for the geometric behaviour of this object
        /// </summary>
        /// <param name="solid"></param>
        /// <returns></returns>
        public static int GetGeometryHashCode(this IfcLShapeProfileDef profile)
        {
            Func <double, int> f = profile.ModelOf.ModelFactors.GetGeometryDoubleHash;

            int hash = f(profile.Depth) ^
                       f(profile.Thickness) ^
                       profile.Position.GetGeometryHashCode();

            if (profile.Width.HasValue)
            {
                hash ^= f(profile.Width ?? 0);
            }
            return(hash);
        }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BlackBox.Aisc.EM11.NamedLProfile"/> class.
        /// </summary>
        /// <param name='name'>
        /// Name.
        /// </param>
        /// <param name='standard'>
        /// Standard.
        /// </param>
        /// <param name='width'>
        /// Width.
        /// </param>
        /// <param name='depth'>
        /// Depth.
        /// </param>
        /// <param name='thickness'>
        /// Thickness.
        /// </param>
        public BbNamedLProfile(string name, string standard, double width, double depth, double thickness)
        {
            Name = name;
            Stardard = standard;
            Width = width;
            Depth = depth;
            Thickness = thickness;

            _lShapeProfileDef = new IfcLShapeProfileDef
                                    {
                                        ProfileType = IfcProfileTypeEnum.AREA,
                                        ProfileName = Name,
                                        Position =  BbHeaderSetting.Setting3D.Position2D.IfcAxis2Placement2D,
                                        Width = Width,
                                        Depth = Depth,
                                        Thickness = thickness,
                                    };
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BlackBox.Aisc.EM11.NamedLProfile"/> class.
        /// </summary>
        /// <param name='name'>
        /// Name.
        /// </param>
        /// <param name='standard'>
        /// Standard.
        /// </param>
        /// <param name='width'>
        /// Width.
        /// </param>
        /// <param name='depth'>
        /// Depth.
        /// </param>
        /// <param name='thickness'>
        /// Thickness.
        /// </param>
        public BbNamedLProfile(string name, string standard, double width, double depth, double thickness)
        {
            Name      = name;
            Stardard  = standard;
            Width     = width;
            Depth     = depth;
            Thickness = thickness;

            _lShapeProfileDef = new IfcLShapeProfileDef
            {
                ProfileType = IfcProfileTypeEnum.AREA,
                ProfileName = Name,
                Position    = BbHeaderSetting.Setting3D.Position2D.IfcAxis2Placement2D,
                Width       = Width,
                Depth       = Depth,
                Thickness   = thickness,
            };
        }