コード例 #1
0
        public ISteelCompressionMember GetCompressionMember(ISection Shape, double L_ex, double L_ey, double L_ez, double F_y, double E, bool IsRolledShape = true)
        {
            string DEFAULT_EXCEPTION_STRING = "Selected shape is not supported. Select a different shape.";
            ISteelCompressionMember col = null;
            CalcLog log = new CalcLog();
            SteelMaterial Material = new SteelMaterial(F_y, E);

            if (Shape is ISectionI)
            {
                ISectionI IShape = Shape as ISectionI;
                SteelSectionI SectionI = new SteelSectionI(IShape, Material);
                IShapeFactory IShapeFactory = new IShapeFactory();
                return IShapeFactory.GetIshape(SectionI, IsRolledShape, L_ex, L_ey, L_ez, log);
 
            }


            else if (Shape is ISectionChannel)
            {
                ISectionChannel ChannelShape = Shape as ISectionChannel;
                SteelChannelSection ChannelSection = new SteelChannelSection(ChannelShape, Material);
                throw new Exception(DEFAULT_EXCEPTION_STRING);
 
            }


            else if (Shape is ISectionPipe)
            {
                ISectionPipe SectionPipe = Shape as ISectionPipe;
                SteelPipeSection PipeSection = new SteelPipeSection(SectionPipe, Material);
                ChsShapeFactory ChsFactory = new ChsShapeFactory();
                return ChsFactory.GetChsShape(PipeSection, L_ex, L_ey, L_ez, log);
 
            }

            else if (Shape is ISectionTube)
            {
                ISectionTube TubeShape = Shape as ISectionTube;
                SteelRhsSection RectHSS_Section = new SteelRhsSection(TubeShape, Material);
                RhsShapeFactory RhsFactory = new RhsShapeFactory();
                return RhsFactory.GetRhsShape(RectHSS_Section, L_ex, L_ey, L_ez, log);
 
            }


            else if (Shape is ISectionBox)
            {
                ISectionBox BoxShape = Shape as ISectionBox;
                SteelBoxSection BoxSection = new SteelBoxSection(BoxShape, Material);

                RhsShapeFactory RhsFactory = new RhsShapeFactory();
                return RhsFactory.GetRhsShape(BoxSection, L_ex, L_ey, L_ez, log);
 
            }

            else if (Shape is ISectionTee)
            {
                ISectionTee TeeShape = Shape as ISectionTee;
                SteelTeeSection TeeSection = new SteelTeeSection(TeeShape, Material);
                throw new Exception(DEFAULT_EXCEPTION_STRING);
            }
            else
            {
                throw new Exception(DEFAULT_EXCEPTION_STRING);
            }


        }
コード例 #2
0
        public ISteelCompressionMember GetCompressionMember(ISection Shape, double L_ex, double L_ey, double L_ez, double F_y, double E, bool IsRolledShape = true)
        {
            string DEFAULT_EXCEPTION_STRING = "Selected shape is not supported. Select a different shape.";
            ISteelCompressionMember col     = null;
            CalcLog       log      = new CalcLog();
            SteelMaterial Material = new SteelMaterial(F_y, E);

            if (Shape is ISectionI)
            {
                ISectionI     IShape        = Shape as ISectionI;
                SteelSectionI SectionI      = new SteelSectionI(IShape, Material);
                IShapeFactory IShapeFactory = new IShapeFactory();
                return(IShapeFactory.GetIshape(SectionI, IsRolledShape, L_ex, L_ey, L_ez, log));
            }


            else if (Shape is ISectionChannel)
            {
                ISectionChannel     ChannelShape   = Shape as ISectionChannel;
                SteelChannelSection ChannelSection = new SteelChannelSection(ChannelShape, Material);
                throw new Exception(DEFAULT_EXCEPTION_STRING);
            }


            else if (Shape is ISectionPipe)
            {
                ISectionPipe     SectionPipe = Shape as ISectionPipe;
                SteelPipeSection PipeSection = new SteelPipeSection(SectionPipe, Material);
                ChsShapeFactory  ChsFactory  = new ChsShapeFactory();
                return(ChsFactory.GetChsShape(PipeSection, L_ex, L_ey, L_ez, log));
            }

            else if (Shape is ISectionTube)
            {
                ISectionTube    TubeShape       = Shape as ISectionTube;
                SteelRhsSection RectHSS_Section = new SteelRhsSection(TubeShape, Material);
                RhsShapeFactory RhsFactory      = new RhsShapeFactory();
                return(RhsFactory.GetRhsShape(RectHSS_Section, L_ex, L_ey, L_ez, log));
            }


            else if (Shape is ISectionBox)
            {
                ISectionBox     BoxShape   = Shape as ISectionBox;
                SteelBoxSection BoxSection = new SteelBoxSection(BoxShape, Material);

                RhsShapeFactory RhsFactory = new RhsShapeFactory();
                return(RhsFactory.GetRhsShape(BoxSection, L_ex, L_ey, L_ez, log));
            }

            else if (Shape is ISectionTee)
            {
                ISectionTee     TeeShape   = Shape as ISectionTee;
                SteelTeeSection TeeSection = new SteelTeeSection(TeeShape, Material);
                throw new Exception(DEFAULT_EXCEPTION_STRING);
            }
            else
            {
                throw new Exception(DEFAULT_EXCEPTION_STRING);
            }
        }