protected void DrawIsoFoot() { DimensionLine dim = new DimensionLine(); DiagramGraphics = new DovDrawings(diagramContext); diagramChart = new ChartStyle(); float footW = 0.4f * DiagramCanvWidth; float footH = 0.4f * DiagramCanvHeight; diagramChart.ChartArea = new RectangleF(0, 0, footW, footH); float startX = 0; float startY = 0; DiagramGraphics.Clear(startX, startY, footW, footH); float limit = (footingData.Width > footingData.Length ? footingData.Width : footingData.Length); float xMax = 0.5f * limit; float xMin = -0.5f * limit; float yMax = 0.5f * limit; float yMin = -0.5f * limit; SetGraphicLayout(footW, footH, startX, startY, diagramChart, new float[] { xMin, xMax, yMin, yMax }); PointF fPt1 = new PointF(-0.5f * footingData.Width, 0.5f * footingData.Length); PointF fPt2 = new PointF(0.5f * footingData.Width, -0.5f * footingData.Length); fPt1 = diagramChart.Point2D(fPt1); fPt2 = diagramChart.Point2D(fPt2); DiagramGraphics.FillColorOpt = "lightslategrey"; DiagramGraphics.FillColor(fPt1, fPt2); DiagramGraphics.DrwColor = "dimgrey"; DiagramGraphics.DrawRec(fPt1, fPt2); SetGraphicLayout(footW, footH, startX, startY, diagramChart, new float[] { xMin, xMax, yMin, yMax }); PointF cPt1 = new PointF(footingData.ColLocX - 0.5f * footingData.Width + footingData.ColumnWidth * 0.5f, footingData.ColLocY - footingData.Length * 0.5f - 0.5f * footingData.ColumnLength); PointF cPt2 = new PointF(footingData.ColLocX - 0.5f * footingData.Width - footingData.ColumnWidth * 0.5f, footingData.ColLocY - footingData.Length * 0.5f + 0.5f * footingData.ColumnLength); PointF center = new PointF(footingData.ColLocX - 0.5f * footingData.Width, footingData.ColLocY - footingData.Length * 0.5f); cPt1 = diagramChart.Point2D(cPt1); cPt2 = diagramChart.Point2D(cPt2); center = diagramChart.Point2D(center); DiagramGraphics.FillColorOpt = "darkslategrey"; DiagramGraphics.FillColor(cPt1, cPt2); DiagramGraphics.DrwColor = "dimgrey"; DiagramGraphics.DrawRec(cPt1, cPt2); DiagramGraphics.DrwColor = "cadetblue"; dim.Graphic = DiagramGraphics; dim.DimLoc = DimensionLine.DimensionLocation.end; dim.DrawAdjDimLine(fPt1, fPt2, string.Format("W={0}", footingData.Width)); dim.DimDir = DimensionLine.DimensionDirection.right; DiagramGraphics.TextBase = TextBaseline.Bottom; dim.DrawOppoDimLine(fPt1, fPt2, string.Format("L={0}", footingData.Length)); dim.DimDir = DimensionLine.DimensionDirection.right; dim.DrawOppoDimLine(fPt1, center, string.Format("y={0}", footingData.ColLocY)); dim.DimLoc = DimensionLine.DimensionLocation.start; dim.DrawAdjDimLine(fPt1, center, string.Format("x={0}", footingData.ColLocX)); }
protected void DrawRecSecStress() { float compStress = (float)Math.Round(BeamDsgnRslt.CompStress, 3); float concForce = (float)Math.Round(BeamDsgnRslt.ConcForce, 3); float rebarCompForce = (float)Math.Round(BeamDsgnRslt.RebarCompForce, 3); float rebarTensForce = (float)Math.Round(BeamDsgnRslt.RebarTesnsileForce, 3); float txtOffset = 5; float txtHeight = 10; string font = "pt Verenda"; font = txtHeight + font; Symbols arrow = new Symbols(); IDictionary <string, float> maxValue = new Dictionary <string, float>(); maxValue["compStress"] = compStress; maxValue["concForce"] = concForce; maxValue["rebarCompForce"] = rebarCompForce; maxValue["rebarTensForce"] = rebarTensForce; var order = from o in maxValue orderby o.Value descending select o; float maximumForce = order.First().Value; maxValue = order.ToDictionary(o => o.Key, o => o.Value); float prevValue = 0; bool start = true; foreach (KeyValuePair <string, float> value in order) { if (start) { prevValue = value.Value; start = false; continue; } maxValue[value.Key] = value.Value + Math.Abs((prevValue - value.Value)) * 0.7f; prevValue = value.Value; } float lamda = 0.8f; float h = secRec.Height; float c = (float)Math.Round(BeamDsgnRslt.NeutralAxisY, 3); float d = (float)Math.Round(BeamDsgnRslt.TensEffDepth, 3); float dComp = (float)Math.Round(BeamDsgnRslt.CompEffDepth, 3); designChart.XMin = 0; designChart.XMax = maximumForce; designChart.YMin = 0; designChart.YMax = secRec.Height + txtHeight + txtOffset; DsgnGraphics.DrwColor = "magenta"; DsgnGraphics.LineThickness = 2; PointF pt0 = designChart.Point2D(new PointF(0, 0)); PointF pt1 = designChart.Point2D(new PointF(0, h)); DsgnGraphics.DrawLine(pt0, pt1); //Compression Stress PointF pt2 = designChart.Point2D(new PointF(maxValue["compStress"], h)); DsgnGraphics.DrawLine(pt1, pt2); PointF pt3 = designChart.Point2D(new PointF(maxValue["compStress"], h - c * lamda)); DsgnGraphics.DrawLine(pt2, pt3); PointF pt4 = designChart.Point2D(new PointF(0, h - c * lamda)); DsgnGraphics.DrawLine(pt3, pt4); DsgnGraphics.FillColorOpt = "slategray"; DsgnGraphics.FillColor(pt4, pt2); // Rebar compression Reinforcement if (dComp > 0) { PointF pt5 = designChart.Point2D(new PointF(0, h - dComp)); PointF pt6 = designChart.Point2D(new PointF(maxValue["rebarCompForce"], h - dComp)); DsgnGraphics.DrawLine(pt5, pt6); DsgnGraphics.DrwColor = "royalblue"; DsgnGraphics.LineThickness = 1; arrow.Graphic = DsgnGraphics; arrow.DrawArrow(pt5, 5, 20, 180); //Rebar Comp Force DsgnGraphics.TextFont = font; DsgnGraphics.TextBase = TextBaseline.Bottom; DsgnGraphics.TextAlignment = TextAlign.Right; DsgnGraphics.DrwColor = "magenta"; DsgnGraphics.DrawText(string.Format("{0}kN", rebarCompForce), pt6); } //Draw Tensile Force PointF pt9 = designChart.Point2D(new PointF(0, h - d)); PointF pt10 = designChart.Point2D(new PointF(maxValue["rebarTensForce"], h - d)); DsgnGraphics.DrawLine(pt9, pt10); //Concrete Force PointF pt7 = designChart.Point2D(new PointF(0, h - c * 0.5f * lamda)); PointF pt8 = designChart.Point2D(new PointF(maxValue["concForce"], h - c * 0.5f * lamda)); DsgnGraphics.DrawLine(pt7, pt8); DsgnGraphics.DrwColor = "royalblue"; DsgnGraphics.LineThickness = 1; arrow.Graphic = DsgnGraphics; //Compression Stress arrow.DrawArrow(pt1, 5, 20, 180); arrow.DrawArrow(pt4, 5, 20, 180); //Rebar Compression Force //Rebar Tension Force arrow.DrawArrow(pt10, 5, 20, 0); //Concrete Force arrow.DrawArrow(pt7, 5, 20, 180); // Draw Text DsgnGraphics.TextFont = font; DsgnGraphics.TextBase = TextBaseline.Bottom; DsgnGraphics.TextAlignment = TextAlign.Right; DsgnGraphics.DrwColor = "yellow"; DsgnGraphics.FillColorOpt = "yellow"; //compression Stress DsgnGraphics.DrawText(string.Format("{0}kN/m", compStress), pt2); //Conc Comp Force DsgnGraphics.DrawText(string.Format("{0}kN", concForce), pt8); //Rebar Tensile Force DsgnGraphics.DrawText(string.Format("{0}kN", rebarTensForce), pt10); //Draw Dimension Line DimensionLine dim = new DimensionLine(); /// DsgnGraphics.TextBase = TextBaseline.Bottom; DsgnGraphics.TextAlignment = TextAlign.Center; DsgnGraphics.LineThickness = 1; DsgnGraphics.DrwColor = "hotpink"; dim.Graphic = DsgnGraphics; dim.DimDir = DimensionLine.DimensionDirection.right; dim.DrawDimLineAligned(pt0, pt1, h.ToString()); float v = (float)Math.Round(d - c * lamda, 1); dim.DimDir = DimensionLine.DimensionDirection.left; dim.DimLoc = DimensionLine.DimensionLocation.end; DsgnGraphics.TextBase = TextBaseline.Top; dim.DrawOppoDimLine(pt9, pt3, v.ToString()); }
protected void DrawRecSecStrain() { float dsgnStrW = 0.3f * DsgnCanvWidth; float tensStr = (float)Math.Round(BeamDsgnRslt.TensStrainY, 6); float compStr = (float)Math.Round(BeamDsgnRslt.CompStrain, 6); float h = secRec.Height; float c = BeamDsgnRslt.NeutralAxisY; float d = BeamDsgnRslt.TensEffDepth; float dComp = BeamDsgnRslt.CompEffDepth; float txtWidth = 30.56f; float txtOffset = 5; float txtHeight = 10; float cb = h - c; designChart.XMin = 0; designChart.XMax = BeamDsgnRslt.CompStrain + BeamDsgnRslt.TensStrainY + (txtWidth * (compStr + tensStr) / dsgnStrW); designChart.YMin = 0; designChart.YMax = h + txtHeight; DsgnGraphics.DrwColor = "red"; DsgnGraphics.LineThickness = 2; PointF pt0 = designChart.Point2D(new PointF(0, h - d)); PointF pt1 = designChart.Point2D(new PointF(tensStr, h - d)); PointF pt2 = designChart.Point2D(new PointF(tensStr, h)); PointF pt3 = designChart.Point2D(new PointF(tensStr + compStr, h)); PointF pt4 = designChart.Point2D(new PointF(tensStr, cb)); PointF pt5 = designChart.Point2D(new PointF(0, h - d)); PointF pt6 = designChart.Point2D(new PointF(tensStr, 0)); DsgnGraphics.DrawPolyLine(new[] { pt0, pt1, pt2, pt3, pt4, pt5 }); DsgnGraphics.DrawLine(pt1, pt6); if (dComp > 0) { float stcomp = (compStr * (c - dComp)) / c; PointF pt7 = designChart.Point2D(new PointF(tensStr, h - dComp)); PointF pt8 = designChart.Point2D(new PointF(tensStr + stcomp, h - dComp)); DsgnGraphics.DrawLine(pt7, pt8); } //Draw texts string font = "pt Verenda"; font = txtHeight + font; string txtTensStr = Math.Round(tensStr, 6).ToString(); string txtCompStr = Math.Round(compStr, 5).ToString(); DsgnGraphics.TextFont = font; DsgnGraphics.TextBase = TextBaseline.Bottom; DsgnGraphics.TextAlignment = TextAlign.Right; PointF txtpt = designChart.Point2D(new PointF(tensStr + compStr, h + txtOffset)); DsgnGraphics.DrawText(compStr.ToString(), txtpt); txtpt = designChart.Point2D(new PointF(tensStr, h - d - txtOffset)); DsgnGraphics.TextBase = TextBaseline.Top; DsgnGraphics.DrawText(tensStr.ToString(), txtpt); DimensionLine dim = new DimensionLine(); /// DsgnGraphics.TextBase = TextBaseline.Top; DsgnGraphics.TextAlignment = TextAlign.Center; DsgnGraphics.LineThickness = 1; DsgnGraphics.DrwColor = "hotpink"; dim.Graphic = DsgnGraphics; dim.DimDir = DimensionLine.DimensionDirection.left; dim.DrawDimLineAligned(pt1, pt4, Math.Round(cb, 1).ToString()); DsgnGraphics.TextBase = TextBaseline.Bottom; dim.DimDir = DimensionLine.DimensionDirection.right; dim.DrawDimLineAligned(pt4, pt2, Math.Round(c, 1).ToString()); dim.DrawOppoDimLine(pt0, pt2, Math.Round(d, 1).ToString()); }
protected void IsoFootDetailOnPlan() { DimensionLine dim = new DimensionLine(); DetailingGraphics = new DovDrawings(detailingContext); detailingChart = new ChartStyle(); float footW = DetailingCanvWidth; float footH = 0.6f * DetailingCanvHeight; detailingChart.ChartArea = new RectangleF(0, 0, footW, footH); float startX = 0; float startY = 0; DetailingGraphics.Clear(startX, startY, footW, footH); float limit = (footingData.Width > footingData.Length ? footingData.Width : footingData.Length); float xMax = 0.5f * limit; float xMin = -0.5f * limit; float yMax = 0.5f * limit; float yMin = -0.5f * limit; SetGraphicLayout(footW, footH, startX, startY, detailingChart, new float[] { xMin, xMax, yMin, yMax }); PointF fPt1 = new PointF(-0.5f * footingData.Width, 0.5f * footingData.Length); PointF fPt2 = new PointF(0.5f * footingData.Width, -0.5f * footingData.Length); fPt1 = detailingChart.Point2D(fPt1); fPt2 = detailingChart.Point2D(fPt2); DetailingGraphics.FillColorOpt = "lightslategrey"; DetailingGraphics.FillColor(fPt1, fPt2); DetailingGraphics.DrwColor = "dimgrey"; DetailingGraphics.DrawRec(fPt1, fPt2); SetGraphicLayout(footW, footH, startX, startY, detailingChart, new float[] { xMin, xMax, yMin, yMax }); PointF cPt1 = new PointF(footingData.ColLocX - 0.5f * footingData.Width + footingData.ColumnWidth * 0.5f, footingData.ColLocY - footingData.Length * 0.5f - 0.5f * footingData.ColumnLength); PointF cPt2 = new PointF(footingData.ColLocX - 0.5f * footingData.Width - footingData.ColumnWidth * 0.5f, footingData.ColLocY - footingData.Length * 0.5f + 0.5f * footingData.ColumnLength); PointF center = new PointF(footingData.ColLocX - 0.5f * footingData.Width, footingData.ColLocY - footingData.Length * 0.5f); cPt1 = detailingChart.Point2D(cPt1); cPt2 = detailingChart.Point2D(cPt2); center = detailingChart.Point2D(center); DetailingGraphics.FillColorOpt = "darkslategrey"; DetailingGraphics.FillColor(cPt1, cPt2); DetailingGraphics.DrwColor = "dimgrey"; DetailingGraphics.DrawRec(cPt1, cPt2); DetailingGraphics.DrwColor = "cadetblue"; dim.Graphic = DetailingGraphics; dim.DimLoc = DimensionLine.DimensionLocation.end; dim.DrawAdjDimLine(fPt1, fPt2, string.Format("W={0}", footingData.Width)); dim.DimDir = DimensionLine.DimensionDirection.right; DetailingGraphics.TextBase = TextBaseline.Bottom; dim.DrawOppoDimLine(fPt1, fPt2, string.Format("L={0}", footingData.Length)); fPt1 = new PointF(-0.5f * footingData.Width, -0.5f * footingData.Length); fPt1 = detailingChart.Point2D(fPt1); dim.DrawOppoDimLine(fPt1, center, string.Format("y={0}", footingData.ColLocY)); ////dim.DimLoc = DimensionLine.DimensionLocation.end; //await dim.DrawAdjDimLine(fPt1, center, string.Format("x={0}", footingData.ColLocX)); // drawing reinforcement // horizontal float thick = footingData.Thickness; float w = footingData.Width; float l = footingData.Length; float c = footingData.Cover * 0.1f; float dia = footingData.Dia; float barArea = (float)Math.PI * dia * dia / 4; int nbar = (int)Math.Ceiling(fDesign.Asy / barArea); int barSpacing = 1000 / nbar; barSpacing = barSpacing.RoundDown(); float x = footingData.ColLocX - 0.5f * w + 0.5f * footingData.ColumnWidth + thick - 2 * c; float y1 = -(0.5f * l - c); float y2 = (0.5f * l - c); PointF pt1 = new PointF(x, y1); PointF pt2 = new PointF(x, y2); PointF pt3 = new PointF(pt1.X - thick + 2 * c, pt1.Y); PointF pt4 = new PointF(pt2.X - thick + 2 * c, pt2.Y); pt1 = detailingChart.Point2D(pt1); pt2 = detailingChart.Point2D(pt2); pt3 = detailingChart.Point2D(pt3); pt4 = detailingChart.Point2D(pt4); DetailingGraphics.DrwColor = "red"; DetailingGraphics.DrawLine(pt1, pt2); string spacing = string.Format("{0} c/c {1} mm", dia, barSpacing); DetailingGraphics.TextAlignment = TextAlign.Center; DetailingGraphics.TextBase = TextBaseline.Hanging; DetailingGraphics.FillColorOpt = "yellow"; dim.DrawTextAtAngleMid(pt1, pt2, spacing); DetailingGraphics.DrawLine(pt1, pt3); DetailingGraphics.DrawLine(pt2, pt4); //vertical float y3 = footingData.ColLocY - 0.5f * l + 0.5f * footingData.ColumnLength + thick - 2 * c; float x1 = -(0.5f * w - c); float x2 = (0.5f * w - c); nbar = (int)Math.Ceiling(fDesign.Asx / barArea); barSpacing = 1000 / nbar; barSpacing = barSpacing.RoundDown(); pt1 = new PointF(x1, y3); pt2 = new PointF(x2, y3); pt3 = new PointF(pt1.X, pt1.Y - thick + 2 * c); pt4 = new PointF(pt2.X, pt2.Y - thick + 2 * c); pt1 = detailingChart.Point2D(pt1); pt2 = detailingChart.Point2D(pt2); pt3 = detailingChart.Point2D(pt3); pt4 = detailingChart.Point2D(pt4); DetailingGraphics.DrawLine(pt1, pt2); spacing = string.Format("{0} c/c {1} mm", dia, barSpacing); DetailingGraphics.TextAlignment = TextAlign.Center; DetailingGraphics.TextBase = TextBaseline.Bottom; dim.DrawTextAtAngleMid(pt1, pt2, spacing); DetailingGraphics.DrawLine(pt1, pt3); DetailingGraphics.DrawLine(pt2, pt4); }
public void DrawIsolatedFooting() { FootingGraphics.Clear(-50, -50, footingCanvWidth + 50, footingCanvHeight + 50); FootingGraphics.DrwColor = "dimgray"; FootingGraphics.FillColorOpt = "gray"; FootingGraphics.LineThickness = 2; footingChart.ChartArea = new RectangleF(0, 0, footingCanvWidth, footingCanvHeight); DimensionLine dimLine = new DimensionLine(); dimLine.DimDir = DimensionLine.DimensionDirection.left; dimLine.Graphic = FootingGraphics; float limit = (footingData.Width > footingData.Length ? footingData.Width : footingData.Length); float xMax = limit * 0.5f; float xMin = -limit * 0.5f; float yMax = limit * 0.5f; float yMin = -limit * 0.5f; float zMax = 1.2f * footingData.Thickness; float zMin = -1.2f * footingData.Thickness; float[] scaleLimits = new float[] { xMin, xMax, yMin, yMax, zMin, zMax }; //float[] scaleLimits = new float[] { -5, 5, -4, 4,-6, 6 }; SetGraphicLayout(footingCanvWidth, footingCanvHeight, 0, footingChart, scaleLimits); Matrix3 m = new Matrix3(); m = Matrix3.AzimuthElevation(footingChart.Elevation, footingChart.Azimuth); Point3[] pts = FootingCoordinate(footingData.Width, footingData.Length, footingData.Thickness); PointF[] pta = new PointF[4]; for (int i = 0; i < pts.Length; i++) { pts[i].Transform(m, footingChart); } int[] i0, i1; i0 = new int[4] { 1, 2, 7, 6 }; i1 = new int[4] { 2, 3, 4, 7 }; float elevation = footingChart.Elevation; float azimuth = footingChart.Azimuth; if (elevation >= 0) { if (azimuth >= -180 && azimuth < -90) { i0 = new int[4] { 4, 5, 6, 3 }; i1 = new int[4] { 5, 0, 7, 6 }; } else if (azimuth >= -90 && azimuth < 0) { i0 = new int[4] { 0, 7, 2, 1 }; i1 = new int[4] { 5, 0, 7, 6 }; } else if (azimuth >= 0 && azimuth < 90) { i0 = new int[4] { 0, 7, 2, 1 }; i1 = new int[4] { 1, 4, 3, 2 }; } else if (azimuth >= 90 && azimuth <= 180) { i0 = new int[4] { 4, 5, 6, 3 }; i1 = new int[4] { 1, 4, 3, 2 }; } } else if (elevation < 0) { if (azimuth >= -180 && azimuth < -90) { i0 = new int[4] { 1, 4, 3, 2 }; i1 = new int[4] { 1, 0, 7, 2 }; } else if (azimuth >= -90 && azimuth < 0) { i0 = new int[4] { 4, 5, 6, 3 }; i1 = new int[4] { 1, 4, 3, 2 }; } else if (azimuth >= 0 && azimuth < 90) { i0 = new int[4] { 5, 0, 7, 6 }; i1 = new int[4] { 4, 5, 6, 3 }; } else if (azimuth >= 90 && azimuth <= 180) { i0 = new int[4] { 5, 0, 7, 6 }; i1 = new int[4] { 1, 0, 7, 2 }; } } pta[0] = new PointF(pts[i0[0]].X, pts[i0[0]].Y); pta[1] = new PointF(pts[i0[1]].X, pts[i0[1]].Y); pta[2] = new PointF(pts[i0[2]].X, pts[i0[2]].Y); pta[3] = new PointF(pts[i0[3]].X, pts[i0[3]].Y); FootingGraphics.DrwColor = "dimgray"; FootingGraphics.FillColorOpt = "gray"; FootingGraphics.FillPolygone(pta); dimLine.DrawDimLineAligned(pta[0], pta[3], string.Format("W={0}", footingData.Width)); pta[0] = new PointF(pts[i1[0]].X, pts[i1[0]].Y); pta[1] = new PointF(pts[i1[1]].X, pts[i1[1]].Y); pta[2] = new PointF(pts[i1[2]].X, pts[i1[2]].Y); pta[3] = new PointF(pts[i1[3]].X, pts[i1[3]].Y); FootingGraphics.DrwColor = "dimgray"; FootingGraphics.FillColorOpt = "gray"; FootingGraphics.FillPolygone(pta); dimLine.DrawDimLineAligned(pta[0], pta[1], string.Format("L={0}", footingData.Length)); dimLine.DrawDimLineAligned(pta[1], pta[2], footingData.Thickness.ToString()); pta[0] = new PointF(pts[2].X, pts[2].Y); pta[1] = new PointF(pts[3].X, pts[3].Y); pta[2] = new PointF(pts[6].X, pts[6].Y); pta[3] = new PointF(pts[7].X, pts[7].Y); FootingGraphics.DrwColor = "dimgray"; FootingGraphics.FillColorOpt = "gray"; FootingGraphics.FillPolygone(pta); //Problem Around Here including the column graphics doesnt work well DrawColumn(); SetGraphicLayout(footingCanvWidth, footingCanvHeight, 0, footingChart, scaleLimits); Point3 pto = FootingCoordinate(footingData.Width, footingData.Length, footingData.Thickness)[0]; float x = footingData.ColLocX - (footingData.Width * 0.5f); float y = footingData.ColLocY - (footingData.Length * 0.5f); Point3 ptd = new Point3(pto.X, pto.Y + footingData.ColLocY, 0, 1); Point3 ptc = new Point3(pto.X + footingData.ColLocX, pto.Y, 0, 1); Point3 ptn = new Point3(x, y, 0, 1); ptd.Transform(m, footingChart); ptc.Transform(m, footingChart); ptn.Transform(m, footingChart); FootingGraphics.DrwColor = "white"; FootingGraphics.FillColorOpt = "yellow"; FootingGraphics.TextFont = "10 arial"; FootingGraphics.LineThickness = 0.5f; FootingGraphics.DrawLine(new PointF(ptd.X, ptd.Y), new PointF(ptn.X, ptn.Y)); FootingGraphics.DrawLine(new PointF(ptc.X, ptc.Y), new PointF(ptn.X, ptn.Y)); PointF ptt = new PointF(0.5f * (ptc.X + ptn.X), 0.5f * (ptc.Y + ptn.Y)); float ang = CalcAngle(new PointF(ptc.X, ptc.Y), new PointF(ptn.X, ptn.Y)); dimLine.DrawTextAtAngle(ptt, ang, string.Format("x={0}", footingData.ColLocX)); PointF ptm = new PointF(0.5f * (ptd.X + ptn.X), 0.5f * (ptd.Y + ptn.Y)); ang = CalcAngle(new PointF(ptd.X, ptd.Y), new PointF(ptn.X, ptn.Y)); dimLine.DrawTextAtAngle(ptm, ang, string.Format("y={0}", footingData.ColLocY)); FootingGraphics.DrwColor = "green"; Symbols symb = new Symbols(); symb.Graphic = FootingGraphics; //Loading Assignment Point3 loadPt = ColumnCoordinate(x, y, footingData.ColumnWidth, footingData.ColumnLength, footingData.Thickness)[0]; loadPt = new Point3(loadPt.X + 0.5f * footingData.ColumnWidth, loadPt.Y + footingData.ColumnLength * 0.5f, footingData.Thickness, 1); Point3 axialPt = new Point3(loadPt.X, loadPt.Y, loadPt.Z + 40, 1); Point3 mxPt = new Point3(loadPt.X + 80, loadPt.Y, loadPt.Z, 1); Point3 mxmPt = new Point3(loadPt.X + 40, loadPt.Y, loadPt.Z, 1); Point3 myPt = new Point3(loadPt.X, loadPt.Y - 80, loadPt.Z, 1); Point3 mymPt = new Point3(loadPt.X, loadPt.Y - 40, loadPt.Z, 1); loadPt.Transform(m, footingChart); axialPt.Transform(m, footingChart); mxPt.Transform(m, footingChart); myPt.Transform(m, footingChart); mxmPt.Transform(m, footingChart); mymPt.Transform(m, footingChart); FootingGraphics.DrawLine(loadPt.X, loadPt.Y, axialPt.X, axialPt.Y); FootingGraphics.DrawLine(loadPt.X, loadPt.Y, mxPt.X, mxPt.Y); FootingGraphics.DrawLine(loadPt.X, loadPt.Y, myPt.X, myPt.Y); PointF ptb = new PointF(loadPt.X, loadPt.Y); PointF pte = new PointF(axialPt.X, axialPt.Y); float angle = -CalcAngle(ptb, pte); if (footingData.Pn < 0) { symb.DrawArrow(new PointF(axialPt.X, axialPt.Y), 5, 10, -angle); } else { symb.DrawArrow(new PointF(loadPt.X, loadPt.Y), 5, 10, angle); } FootingGraphics.FillColorOpt = "black"; dimLine.DrawTextAtAngle(pte, -angle, string.Format("Pn={0}", footingData.Pn)); ptb = new PointF(loadPt.X, loadPt.Y); pte = new PointF(mxPt.X, mxPt.Y); angle = CalcAngle(ptb, pte); if (footingData.Mx < 0) { symb.DrawArrow(new PointF(mxPt.X, mxPt.Y), 5f, 10, angle); symb.DrawArrow(new PointF(mxmPt.X, mxmPt.Y), 5f, 10, angle); } else { angle += 180; symb.DrawArrow(new PointF(loadPt.X, loadPt.Y), 5f, 10, angle); symb.DrawArrow(new PointF(mxmPt.X, mxmPt.Y), 5f, 10, angle); } dimLine.DrawTextAtAngle(pte, angle, string.Format("Mx={0}", footingData.Mx)); ptb = new PointF(loadPt.X, loadPt.Y); pte = new PointF(myPt.X, myPt.Y); angle = -CalcAngle(ptb, pte); if (footingData.My < 0) { angle += 180; symb.DrawArrow(new PointF(myPt.X, myPt.Y), 5f, 10, angle); symb.DrawArrow(new PointF(mymPt.X, mymPt.Y), 5f, 10, angle); } else { symb.DrawArrow(new PointF(loadPt.X, loadPt.Y), 5f, 10, angle); symb.DrawArrow(new PointF(mymPt.X, mymPt.Y), 5f, 10, angle); } dimLine.DrawTextAtAngle(pte, angle, string.Format("My={0}", footingData.My)); }
protected void IsoFootDetailOnElev() { DimensionLine dim = new DimensionLine(); DetailingGraphics = new DovDrawings(detailingContext); detailingChart = new ChartStyle(); dim.Graphic = DetailingGraphics; float footW = DetailingCanvWidth; float footH = 0.4f * DetailingCanvHeight; detailingChart.ChartArea = new RectangleF(0, 0, footW, footH); float startX = 0; float startY = 0.6f * DetailingCanvHeight; DetailingGraphics.Clear(startX, startY, footW, footH); float limit = footingData.Width; float xMax = 0.5f * limit; float xMin = -0.5f * limit; float yMax = 0.5f * footingData.Thickness; float yMin = -2 * footingData.Thickness; SetGraphicLayout(footW, footH, startX, startY, detailingChart, new float[] { xMin, xMax, yMin, yMax }); float thick = footingData.Thickness; float w = footingData.Width; float l = footingData.Length; float c = footingData.Cover * 0.1f; float dia = footingData.Dia; float locX = footingData.ColLocX; float locY = footingData.ColLocY; float cw = footingData.ColumnWidth; float cl = footingData.ColumnLength; PointF fPt1 = new PointF(-0.5f * footingData.Width, 0f); PointF fPt2 = new PointF(0.5f * footingData.Width, -footingData.Thickness); fPt1 = detailingChart.Point2D(fPt1); fPt2 = detailingChart.Point2D(fPt2); DetailingGraphics.FillColorOpt = "lightslategrey"; DetailingGraphics.FillColor(fPt1, fPt2); DetailingGraphics.DrwColor = "dimgrey"; //await DetailingGraphics.DrawRecAsync(fPt1, fPt2); PointF pt1 = new PointF(-0.5f * w, 0f); PointF pt2 = new PointF(locX - 0.5f * w - 0.5f * cw, 0); PointF pt3 = new PointF(locX - 0.5f * w - 0.5f * cw, 0.5f * thick); PointF pt4 = new PointF(locX - 0.5f * w + 0.5f * cw, 0.5f * thick); PointF pt5 = new PointF(locX - 0.5f * w + 0.5f * cw, 0); PointF pt6 = new PointF(0.5f * w, 0); PointF pt7 = new PointF(0.5f * w, -thick); PointF pt8 = new PointF(-0.5f * w, -thick); PointF[] pts = new PointF[] { pt1, pt2, pt3, pt4, pt5, pt6, pt7, pt8 }; for (int i = 0; i < pts.Length; i++) { pts[i] = detailingChart.Point2D(pts[i]); } DetailingGraphics.FillPolygone(pts); dim.DrawDimLineAligned(pts[0], pts[7], thick.ToString()); dim.DrawDimLineAligned(pts[6], pts[7], w.ToString()); dim.DimDir = DimensionLine.DimensionDirection.right; DetailingGraphics.TextBase = TextBaseline.Bottom; dim.DrawDimLineAligned(pts[0], pts[1], (footingData.ColLocX - 0.5f * cw).ToString()); DetailingGraphics.DrwColor = "red"; pt1 = new PointF(-0.5f * w + c, -thick + c); pt2 = new PointF(0.5f * w - c, -thick + c); pt3 = new PointF(pt1.X, pt1.Y + thick - 2 * c); pt4 = new PointF(pt2.X, pt2.Y + thick - 2 * c); pt1 = detailingChart.Point2D(pt1); pt2 = detailingChart.Point2D(pt2); DetailingGraphics.DrawLine(pt1, pt2); pt3 = detailingChart.Point2D(pt3); pt4 = detailingChart.Point2D(pt4); DetailingGraphics.DrawLine(pt1, pt3); DetailingGraphics.DrawLine(pt2, pt4); //Drawing column bars pt5 = new PointF(locX - 0.5f * w - 0.5f * cw + c, -thick + c + 3 * dia * 0.1f); pt6 = new PointF(locX - 0.5f * w - 0.5f * cw + c, 0.5f * thick); pt7 = new PointF(locX - 0.5f * w + 0.5f * cw - c, -thick + c + 3 * dia * 0.1f); pt8 = new PointF(locX - 0.5f * w + 0.5f * cw - c, 0.5f * thick); //47 factor for development length PointF pt9 = new PointF(pt5.X - 47 * dia * 0.1f, pt5.Y); PointF pt10 = new PointF(pt7.X + 47 * dia * 0.1f, pt7.Y); pt9 = detailingChart.Point2D(pt9); pt10 = detailingChart.Point2D(pt10); pt5 = detailingChart.Point2D(pt5); pt6 = detailingChart.Point2D(pt6); pt7 = detailingChart.Point2D(pt7); pt8 = detailingChart.Point2D(pt8); DetailingGraphics.DrawLine(pt5, pt6); DetailingGraphics.DrawLine(pt7, pt8); DetailingGraphics.DrawLine(pt5, pt9); DetailingGraphics.DrawLine(pt7, pt10); pt1 = detailingChart.Point2D(new PointF(-0.5f * w + c, -2 * thick)); pt2 = detailingChart.Point2D(new PointF(0.5f * w - c, -2 * thick)); pt3 = detailingChart.Point2D(new PointF(-0.5f * w + c, -thick - 2 * c)); pt4 = detailingChart.Point2D(new PointF(0.5f * w - c, -thick - 2 * c)); DetailingGraphics.DrawLine(pt1, pt2); DetailingGraphics.DrwColor = "dimgrey"; dim.DimDir = DimensionLine.DimensionDirection.left; DetailingGraphics.TextBase = TextBaseline.Hanging; dim.DrawDimLineAligned(pt1, pt2, (w - 2 * c).ToString()); DetailingGraphics.DrwColor = "red"; DetailingGraphics.DrawLine(pt1, pt3); dim.DimDir = DimensionLine.DimensionDirection.right; DetailingGraphics.DrwColor = "dimgrey"; DetailingGraphics.TextBase = TextBaseline.Bottom; dim.DrawDimLineAligned(pt1, pt3, (thick - 2 * c).ToString()); DetailingGraphics.DrwColor = "red"; DetailingGraphics.DrawLine(pt2, pt4); float barArea = (float)Math.PI * dia * dia / 4; int nbar = (int)Math.Ceiling(fDesign.Asy / barArea); int barSpacing = 1000 / nbar; barSpacing = barSpacing.RoundDown() / 10; for (int i = (int)(2 * c); i < (w - 2 * c); i += barSpacing) { float start = -0.5f * (w - 2 * c); float y = -(thick - c - 1.5f * dia * 0.1f); float x = start + i; PointF pt = new PointF(x, y); pt = detailingChart.Point2D(pt); DetailingGraphics.DrawArc(pt.X, pt.Y, 1.5f * dia * 0.1f, 0, 2 * Math.PI); } }