示例#1
0
 protected void SectionGraphics()
 {
     SecGraphics.FillColor(0, 0, SecCanvWidth, SecCanvHeight, SecBackColor);
     DiagramGraphics.FillColor(0, 0, DiagramCanvWidth, DiagramCanvHeight, DsgnBackColor);
     SetRecSecGraphicLayout(SecCanvWidth, SecCanvHeight, 0, sectionChart);
     sectionChart.XTick = 0.2f * SecCanvWidth;
     sectionChart.YTick = 0.2f * SecCanvWidth;
     sectionChart.DrawGrid(SecGraphics);
     sectionChart.DrawTickMark(SecGraphics);
     DrawRecSection(SecGraphics);
     DrawRebar(SecGraphics, sectionChart);
     DrawAxis(SecGraphics, sectionChart);
 }
示例#2
0
        //Draw 2D Grids and Tickmarks
        protected void DrawDiagramGraphics()
        {
            float[]        resultantMoment = new float[] { };
            float[]        axialForce      = new float[] { };
            List <float[]> data            = ColumnInter.BiaxialTableatAngle;
            List <float>   bendingx        = data[0].ToList();
            List <float>   bendingy        = data[1].ToList();
            List <float>   axial           = data[2].ToList();

            resultantMoment = new float[bendingx.Count];
            axialForce      = new float[bendingx.Count];
            for (int i = 0; i < bendingx.Count; i++)
            {
                resultantMoment[i] = (float)Math.Sqrt((bendingx[i] * bendingx[i]) + (bendingy[i] * bendingy[i]));
            }
            axialForce = axial.ToArray();
            List <float> sort = axialForce.ToList();

            sort = sort.OrderBy(o => o).ToList();
            float minForce = sort.First();
            float maxForce = sort.Last();

            sort = resultantMoment.ToList();
            sort = sort.OrderBy(o => o).ToList();
            float minBending = sort.First();
            float maxBending = sort.Last();

            sort.Clear();
            float[] scaleLimits = new float[] { minBending, maxBending, minForce, maxForce };
            DiagramGraphics.DrwColor     = "black";
            DiagramGraphics.FillColorOpt = "black";
            PointF pt1 = new PointF(0, 0);
            PointF pt2 = new PointF(DiagramCanvWidth, DiagramCanvHeight);

            DiagramGraphics.FillColor(pt1, pt2);
            //Why is this not working
            ///
            ///await DiagramGraphics.ClearAsync(0, 0, DiagramCanvWidth, DiagramCanvHeight);
            ///
            SetGraphicLayout(DiagramCanvWidth, DiagramCanvHeight, 0, diagramChart, scaleLimits);
            diagramChart.XTick = (maxBending - minBending) / 10;
            diagramChart.YTick = (maxForce - minForce) / 10;
            diagramChart.DrawGrid(DiagramGraphics);
            SetGraphicLayout(DiagramCanvWidth, DiagramCanvHeight, 0, diagramChart, scaleLimits);
            diagramChart.XTick = (maxBending - minBending) / 10;
            diagramChart.YTick = (maxForce - minForce) / 10;
            diagramChart.DrawTickMark(DiagramGraphics);
        }