private void DrawInternalForce(Frame f, float forceI, float forceJ, float scale) { float x1 = (float)f.NodeI.X; float y1 = (float)f.NodeI.Z; float x2 = (float)f.NodeJ.X; float y2 = (float)f.NodeJ.Z; float orientation = (float)f.Angle; float loadOrientation = orientation + (float)Math.PI / 2; float textAngle = orientation * 180 / (float)Math.PI + 90; int fillAlpha = (int)((1 - mFillTransparency) * 255); Color negativeColor = Color.FromArgb(fillAlpha, NegativeForceColor); Color positiveColor = Color.FromArgb(fillAlpha, PositiveForceColor); float loadx1 = x1 + (float)(forceI * scale * Math.Cos(loadOrientation)); float loady1 = y1 + (float)(forceI * scale * Math.Sin(loadOrientation)); float loadx2 = x2 + (float)(forceJ * scale * Math.Cos(loadOrientation)); float loady2 = y2 + (float)(forceJ * scale * Math.Sin(loadOrientation)); if ((Math.Abs(forceI - forceJ) < float.Epsilon) || (Math.Sign(forceI) * Math.Sign(forceJ) > 0)) { SimpleCAD.Polygon poly = new SimpleCAD.Polygon(new PointF[] { new PointF(x1, y1), new PointF(x2, y2), new PointF(loadx2, loady2), new PointF(loadx1, loady1) }); poly.OutlineStyle = new SimpleCAD.OutlineStyle(Color.Transparent); poly.FillStyle = new SimpleCAD.FillStyle(forceI < 0 ? negativeColor : positiveColor); Model.Add(poly); } else { float xmid = Math.Abs(forceI) / Math.Abs(forceI - forceJ) * (x2 - x1) + x1; float ymid = Math.Abs(forceI) / Math.Abs(forceI - forceJ) * (y2 - y1) + y1; SimpleCAD.Polygon polyI = new SimpleCAD.Polygon(new PointF[] { new PointF(x1, y1), new PointF(xmid, ymid), new PointF(loadx1, loady1) }); polyI.OutlineStyle = new SimpleCAD.OutlineStyle(Color.Transparent); polyI.FillStyle = new SimpleCAD.FillStyle(forceI < 0 ? negativeColor : positiveColor); Model.Add(polyI); SimpleCAD.Polygon polyJ = new SimpleCAD.Polygon(new PointF[] { new PointF(xmid, ymid), new PointF(x2, y2), new PointF(loadx2, loady2) }); polyJ.OutlineStyle = new SimpleCAD.OutlineStyle(Color.Transparent); polyJ.FillStyle = new SimpleCAD.FillStyle(forceJ < 0 ? negativeColor : positiveColor); Model.Add(polyJ); } SimpleCAD.Line line1 = new SimpleCAD.Line(x1, y1, loadx1, loady1); line1.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(line1); SimpleCAD.Line line2 = new SimpleCAD.Line(x2, y2, loadx2, loady2); line2.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(line2); SimpleCAD.Line line3 = new SimpleCAD.Line(loadx1, loady1, loadx2, loady2); line3.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(line3); SimpleCAD.Line line4 = new SimpleCAD.Line(x1, y1, x2, y2); line4.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(line4); SimpleCAD.Text textI = new SimpleCAD.Text(loadx1, loady1, forceI.ToString("0.0"), TextSize); textI.HorizontalAlignment = StringAlignment.Near; textI.VerticalAlignment = StringAlignment.Center; textI.Rotation = textAngle; textI.FontFamily = Font.Name; textI.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(textI); SimpleCAD.Text textJ = new SimpleCAD.Text(loadx2, loady2, forceJ.ToString("0.0"), TextSize); textJ.HorizontalAlignment = StringAlignment.Near; textJ.VerticalAlignment = StringAlignment.Center; textJ.Rotation = textAngle; textJ.FontFamily = Font.Name; textJ.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(textJ); }
private void DrawFormwork(bool shading) { // Dimensions float wi = mCurrentSection.SectionProperties.InnerWidth; float hi = mCurrentSection.SectionProperties.InnerHeight; float wo = mCurrentSection.SectionProperties.OuterWidth; float ho = mCurrentSection.SectionProperties.OuterHeight; float tw = mCurrentSection.SectionProperties.OuterWallThickness; float tf = mCurrentSection.SectionProperties.FoundationThickness; float ts = mCurrentSection.SectionProperties.SlabThickness; int iw = mCurrentSection.SectionProperties.InnerWalls; float twi = mCurrentSection.SectionProperties.InnerWallThickness; bool gusset = mCurrentSection.SectionProperties.HasSlabGussets; float gw = mCurrentSection.SectionProperties.SlabGussetWidth; float gh = mCurrentSection.SectionProperties.SlabGussetHeight; // Outer formwork PointF[] outerPoints = new PointF[4]; outerPoints[0] = new PointF(-wo / 2, 0); outerPoints[1] = new PointF(wo / 2, 0); outerPoints[2] = new PointF(wo / 2, ho); outerPoints[3] = new PointF(-wo / 2, ho); SimpleCAD.Polygon outer = new SimpleCAD.Polygon(outerPoints); outer.OutlineStyle = new SimpleCAD.OutlineStyle(FormWorkColor, LineThickness); if (shading) outer.FillStyle = new SimpleCAD.FillStyle(ShadingColor); Model.Add(outer); // Inner formwork PointF[] innerTyp = mCurrentSection.SectionProperties.HasSlabGussets ? new PointF[6] : new PointF[4]; innerTyp[0] = new PointF(-wi / 2, tf); innerTyp[1] = new PointF(wi / 2, tf); if (gusset) { innerTyp[2] = new PointF(wi / 2, tf + hi - gh); innerTyp[3] = new PointF(wi / 2 - gw, tf + hi); innerTyp[4] = new PointF(-wi / 2 + gw, tf + hi); innerTyp[5] = new PointF(-wi / 2, tf + hi - gh); } else { innerTyp[2] = new PointF(wi / 2, tf + hi); innerTyp[3] = new PointF(-wi / 2, tf + hi); } float dx = -iw * (wi + twi) / 2; for (int i = 0; i < iw + 1; i++) { PointF[] innersPoints = TranslatePointArray(innerTyp, dx, 0); SimpleCAD.Polygon inner = new SimpleCAD.Polygon(innersPoints); inner.OutlineStyle = new SimpleCAD.OutlineStyle(FormWorkColor, LineThickness); if (shading) inner.FillStyle = new SimpleCAD.FillStyle(BackColor); Model.Add(inner); dx += wi + twi; } }
private void DrawFrameLoads(AnalysisCase analysisCase) { float maxLoadSize = 10 * DimensionOffset; float textOffset = 0.5f * TextSize; float maxLoad = 0; foreach (Frame f in mCurrentSection.AnalysisModel.Frames) { foreach (FrameLoad load in f.Loads.FindAll((e) => e.AnalysisCase == analysisCase)) { if (load is FrameUniformLoad) { FrameUniformLoad uniformLoad = load as FrameUniformLoad; maxLoad = (float)Math.Max(maxLoad, Math.Max(Math.Abs(uniformLoad.FX), Math.Abs(uniformLoad.FZ))); } if (load is FrameTrapezoidalLoad) { FrameTrapezoidalLoad trapezoidalLoad = load as FrameTrapezoidalLoad; maxLoad = (float)Math.Max(maxLoad, Math.Max(Math.Abs(trapezoidalLoad.FXI), Math.Abs(trapezoidalLoad.FZI))); maxLoad = (float)Math.Max(maxLoad, Math.Max(Math.Abs(trapezoidalLoad.FXJ), Math.Abs(trapezoidalLoad.FZJ))); } } } foreach (Frame f in mCurrentSection.AnalysisModel.Frames) { float x1 = (float)f.NodeI.X; float y1 = (float)f.NodeI.Z; float x2 = (float)f.NodeJ.X; float y2 = (float)f.NodeJ.Z; float angle = (float)f.Angle * 180 / (float)Math.PI + 90; foreach (FrameLoad load in f.Loads.FindAll((e) => e.AnalysisCase == analysisCase)) { if (load is FrameUniformLoad) { FrameUniformLoad uniformLoad = load as FrameUniformLoad; float loadx1 = x1 - (float)uniformLoad.FX * maxLoadSize / maxLoad; float loady1 = y1 - (float)uniformLoad.FZ * maxLoadSize / maxLoad; float loadx2 = x2 - (float)uniformLoad.FX * maxLoadSize / maxLoad; float loady2 = y2 - (float)uniformLoad.FZ * maxLoadSize / maxLoad; SimpleCAD.Polygon poly = new SimpleCAD.Polygon(new PointF[] { new PointF(x1, y1), new PointF(x2, y2), new PointF(loadx2, loady2), new PointF(loadx1, loady1) }); poly.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); poly.FillStyle = new SimpleCAD.FillStyle(ShadingColor); Model.Add(poly); SimpleCAD.Text text = new SimpleCAD.Text(loadx1, loady1, uniformLoad.FX.ToString("0.0") + ", " + uniformLoad.FZ.ToString("0.0"), TextSize); text.HorizontalAlignment = StringAlignment.Near; text.VerticalAlignment = StringAlignment.Center; text.Rotation = angle; text.FontFamily = Font.Name; text.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(text); } if (load is FrameTrapezoidalLoad) { FrameTrapezoidalLoad trapezoidalLoad = load as FrameTrapezoidalLoad; float loadx1 = x1 - (float)trapezoidalLoad.FXI * maxLoadSize / maxLoad; float loady1 = y1 - (float)trapezoidalLoad.FZI * maxLoadSize / maxLoad; float loadx2 = x2 - (float)trapezoidalLoad.FXJ * maxLoadSize / maxLoad; float loady2 = y2 - (float)trapezoidalLoad.FZJ * maxLoadSize / maxLoad; SimpleCAD.Polygon poly = new SimpleCAD.Polygon(new PointF[] { new PointF(x1, y1), new PointF(x2, y2), new PointF(loadx2, loady2), new PointF(loadx1, loady1) }); poly.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); poly.FillStyle = new SimpleCAD.FillStyle(ShadingColor); Model.Add(poly); SimpleCAD.Text textI = new SimpleCAD.Text(loadx1, loady1, trapezoidalLoad.FXI.ToString("0.0") + ", " + trapezoidalLoad.FZI.ToString("0.0"), TextSize); textI.HorizontalAlignment = StringAlignment.Near; textI.VerticalAlignment = StringAlignment.Center; textI.Rotation = angle; textI.FontFamily = Font.Name; textI.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(textI); SimpleCAD.Text textJ = new SimpleCAD.Text(loadx2, loady2, trapezoidalLoad.FXJ.ToString("0.0") + ", " + trapezoidalLoad.FZJ.ToString("0.0"), TextSize); textJ.HorizontalAlignment = StringAlignment.Near; textJ.VerticalAlignment = StringAlignment.Center; textJ.Rotation = angle; textJ.FontFamily = Font.Name; textJ.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(textJ); } } } }
private void DrawEarthFillLoad() { float loadOffset = DimensionOffset; // Load scale float maxLoadSize = 2 * loadOffset; float maxLoad = Math.Max(mCurrentSection.SoilParameters.FillLoad, mCurrentSection.SoilParameters.SoilPressureBottom); // Dimensions float wi = mCurrentSection.SectionProperties.InnerWidth; float hi = mCurrentSection.SectionProperties.InnerHeight; float tw = mCurrentSection.SectionProperties.OuterWallThickness; float tf = mCurrentSection.SectionProperties.FoundationThickness; float ts = mCurrentSection.SectionProperties.SlabThickness; float w = mCurrentSection.SectionProperties.OuterWidth - tw; float h = hi + tf / 2 + ts / 2; // Earth fill float earthFillScale = mCurrentSection.SoilParameters.FillLoad / maxLoad * maxLoadSize; PointF[] earthFill = new PointF[4]; earthFill[0] = new PointF(-w / 2, h + loadOffset); earthFill[1] = new PointF(w / 2, h + loadOffset); earthFill[2] = new PointF(w / 2, h + loadOffset + earthFillScale); earthFill[3] = new PointF(-w / 2, h + loadOffset + earthFillScale); SimpleCAD.Polygon load = new SimpleCAD.Polygon(earthFill); load.OutlineStyle = new SimpleCAD.OutlineStyle(LoadColor); load.FillStyle = new SimpleCAD.FillStyle(LoadColor, ShadingColor, HatchStyle.LightVertical); Model.Add(load); float x = -w / 2; float y = h + loadOffset + earthFillScale + loadOffset / 2; string text = mCurrentSection.SoilParameters.FillLoad.ToString("EV = 0.00 kPa"); SimpleCAD.Text loadText = new SimpleCAD.Text(x, y, text, TextSize); loadText.HorizontalAlignment = StringAlignment.Near; loadText.VerticalAlignment = StringAlignment.Center; loadText.FontFamily = Font.Name; loadText.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(loadText); }
private void DrawSurchargeLoad() { float loadOffset = DimensionOffset; // Load scale float maxLoadSize = 2 * loadOffset; // Dimensions float wi = mCurrentSection.SectionProperties.InnerWidth; float hi = mCurrentSection.SectionProperties.InnerHeight; float tw = mCurrentSection.SectionProperties.OuterWallThickness; float tf = mCurrentSection.SectionProperties.FoundationThickness; float ts = mCurrentSection.SectionProperties.SlabThickness; float w = mCurrentSection.SectionProperties.OuterWidth - tw; float h = hi + tf / 2 + ts / 2; // Surcharge left PointF[] surchargeLeft = new PointF[4]; surchargeLeft[0] = new PointF(-w / 2 - loadOffset - maxLoadSize, 0); surchargeLeft[1] = new PointF(-w / 2 - loadOffset, 0); surchargeLeft[2] = new PointF(-w / 2 - loadOffset, h); surchargeLeft[3] = new PointF(-w / 2 - loadOffset - maxLoadSize, h); SimpleCAD.Polygon loadLeft = new SimpleCAD.Polygon(surchargeLeft); loadLeft.OutlineStyle = new SimpleCAD.OutlineStyle(LoadColor); loadLeft.FillStyle = new SimpleCAD.FillStyle(LoadColor, ShadingColor, HatchStyle.LightHorizontal); Model.Add(loadLeft); SimpleCAD.Text loadTextLeft = new SimpleCAD.Text(-w / 2 - loadOffset, h + loadOffset / 4, mCurrentSection.SoilParameters.SurchargeLoad.ToString("ES = 0.00 kPa"), TextSize); loadTextLeft.HorizontalAlignment = StringAlignment.Far; loadTextLeft.VerticalAlignment = StringAlignment.Near; loadTextLeft.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); loadTextLeft.FontFamily = Font.Name; Model.Add(loadTextLeft); // Surcharge right PointF[] surchargeRight = new PointF[4]; surchargeRight[0] = new PointF(w / 2 + loadOffset + maxLoadSize, 0); surchargeRight[1] = new PointF(w / 2 + loadOffset, 0); surchargeRight[2] = new PointF(w / 2 + loadOffset, h); surchargeRight[3] = new PointF(w / 2 + loadOffset + maxLoadSize, h); SimpleCAD.Polygon loadRight = new SimpleCAD.Polygon(surchargeRight); loadRight.OutlineStyle = new SimpleCAD.OutlineStyle(LoadColor); loadRight.FillStyle = new SimpleCAD.FillStyle(LoadColor, ShadingColor, HatchStyle.LightHorizontal); Model.Add(loadRight); SimpleCAD.Text loadTextRight = new SimpleCAD.Text(w / 2 + loadOffset, h + loadOffset / 4, mCurrentSection.SoilParameters.SurchargeLoad.ToString("ES = 0.00 kPa"), TextSize); loadTextRight.HorizontalAlignment = StringAlignment.Near; loadTextRight.VerticalAlignment = StringAlignment.Near; loadTextRight.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); loadTextRight.FontFamily = Font.Name; Model.Add(loadTextRight); }
private void DrawSoilPressureLoad() { float loadOffset = DimensionOffset; // Load scale float maxLoadSize = 2 * loadOffset; float maxLoad = Math.Max(mCurrentSection.SoilParameters.FillLoad, mCurrentSection.SoilParameters.SoilPressureBottom); // Dimensions float wi = mCurrentSection.SectionProperties.InnerWidth; float hi = mCurrentSection.SectionProperties.InnerHeight; float tw = mCurrentSection.SectionProperties.OuterWallThickness; float tf = mCurrentSection.SectionProperties.FoundationThickness; float ts = mCurrentSection.SectionProperties.SlabThickness; float w = mCurrentSection.SectionProperties.OuterWidth - tw; float h = hi + tf / 2 + ts / 2; // Earth pressure - left float earthPressureScale1 = mCurrentSection.SoilParameters.SoilPressureTop / maxLoad * maxLoadSize; float earthPressureScale2 = mCurrentSection.SoilParameters.SoilPressureBottom / maxLoad * maxLoadSize; PointF[] earthPressureLeft = new PointF[4]; earthPressureLeft[0] = new PointF(-w / 2 - loadOffset - earthPressureScale2, 0); earthPressureLeft[1] = new PointF(-w / 2 - loadOffset, 0); earthPressureLeft[2] = new PointF(-w / 2 - loadOffset, h); earthPressureLeft[3] = new PointF(-w / 2 - loadOffset - earthPressureScale1, h); SimpleCAD.Polygon loadLeft = new SimpleCAD.Polygon(earthPressureLeft); loadLeft.OutlineStyle = new SimpleCAD.OutlineStyle(LoadColor); loadLeft.FillStyle = new SimpleCAD.FillStyle(LoadColor, ShadingColor, HatchStyle.LightHorizontal); Model.Add(loadLeft); SimpleCAD.Text loadTextLeftTop = new SimpleCAD.Text(-w / 2 - loadOffset, h + loadOffset / 4, mCurrentSection.SoilParameters.SoilPressureTop.ToString("EH = 0.00 kPa"), TextSize); loadTextLeftTop.HorizontalAlignment = StringAlignment.Far; loadTextLeftTop.VerticalAlignment = StringAlignment.Near; loadTextLeftTop.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); loadTextLeftTop.FontFamily = Font.Name; Model.Add(loadTextLeftTop); SimpleCAD.Text loadTextLeftBottom = new SimpleCAD.Text(-w / 2 - loadOffset, -loadOffset / 4, mCurrentSection.SoilParameters.SoilPressureBottom.ToString("EH = 0.00 kPa"), TextSize); loadTextLeftBottom.HorizontalAlignment = StringAlignment.Far; loadTextLeftBottom.VerticalAlignment = StringAlignment.Far; loadTextLeftBottom.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); loadTextLeftBottom.FontFamily = Font.Name; Model.Add(loadTextLeftBottom); // Earth pressure - right PointF[] earthPressureRight = new PointF[4]; earthPressureRight[0] = new PointF(w / 2 + loadOffset + earthPressureScale2, 0); earthPressureRight[1] = new PointF(w / 2 + loadOffset, 0); earthPressureRight[2] = new PointF(w / 2 + loadOffset, h); earthPressureRight[3] = new PointF(w / 2 + loadOffset + earthPressureScale1, h); SimpleCAD.Polygon loadRight = new SimpleCAD.Polygon(earthPressureRight); loadRight.OutlineStyle = new SimpleCAD.OutlineStyle(LoadColor); loadRight.FillStyle = new SimpleCAD.FillStyle(LoadColor, ShadingColor, HatchStyle.LightHorizontal); Model.Add(loadRight); SimpleCAD.Text loadTextRightTop = new SimpleCAD.Text(w / 2 + loadOffset, h + loadOffset / 4, mCurrentSection.SoilParameters.SoilPressureTop.ToString("EH = 0.00 kPa"), TextSize); loadTextRightTop.HorizontalAlignment = StringAlignment.Near; loadTextRightTop.VerticalAlignment = StringAlignment.Near; loadTextRightTop.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); loadTextRightTop.FontFamily = Font.Name; Model.Add(loadTextRightTop); SimpleCAD.Text loadTextRightBottom = new SimpleCAD.Text(w / 2 + loadOffset, -loadOffset / 4, mCurrentSection.SoilParameters.SoilPressureBottom.ToString("EH = 0.00 kPa"), TextSize); loadTextRightBottom.HorizontalAlignment = StringAlignment.Near; loadTextRightBottom.VerticalAlignment = StringAlignment.Far; loadTextRightBottom.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); loadTextRightBottom.FontFamily = Font.Name; Model.Add(loadTextRightBottom); }
private void DrawRackingLoad() { float wo = mCurrentSection.SectionProperties.OuterWidth - mCurrentSection.SectionProperties.OuterWallThickness; float ho = mCurrentSection.SectionProperties.OuterHeight - mCurrentSection.SectionProperties.SlabThickness / 2 - mCurrentSection.SectionProperties.FoundationThickness / 2; float dx = ho / 10; float ix = -wo / 2; float iw = mCurrentSection.SectionProperties.InnerWalls; float dix = wo / (iw + 1); float supportSize = DimensionOffset; // Left SimpleCAD.Triangle leftSupport = new SimpleCAD.Triangle(-wo / 2, 0, -wo / 2 - supportSize / 2, -supportSize, -wo / 2 + supportSize / 2, -supportSize); leftSupport.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(leftSupport); // Right SimpleCAD.Triangle rightSupport = new SimpleCAD.Triangle(wo / 2, 0, wo / 2 - supportSize / 2, -supportSize, wo / 2 + supportSize / 2, -supportSize); rightSupport.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(rightSupport); // Deformed shape PointF[] deformed = new PointF[4]; deformed[0] = new PointF(-wo / 2, 0); deformed[1] = new PointF(wo / 2, 0); deformed[2] = new PointF(wo / 2 + dx, ho); deformed[3] = new PointF(-wo / 2 + dx, ho); SimpleCAD.Polygon deformedObj = new SimpleCAD.Polygon(deformed); deformedObj.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor, 3); Model.Add(deformedObj); for (int i = 0; i < iw; i++) { ix += dix; SimpleCAD.Line deformedWall = new SimpleCAD.Line(ix, 0, ix + dx, ho); deformedWall.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor, 3); Model.Add(deformedWall); } // Text float textOffset = DimensionOffset; float x = wo / 2 + dx + textOffset; float y = ho; string[] text = new string[]{ "Racking Parameters:", mCurrentSection.SoilParameters.PGA.ToString("PGA = 0.00 g"), mCurrentSection.SoilParameters.DepthToInvertLevel.ToString("z = 0.00 m"), mCurrentSection.SoilParameters.StressAtInvertLevel.ToString("σz = 0.00 kPa"), mCurrentSection.SoilParameters.StressReductionFactor.ToString("Rd = 0.00"), mCurrentSection.SoilParameters.MaximumShearStress.ToString("τ = 0.00 kPa"), mCurrentSection.SoilParameters.MaximumShearStrain.ToString("γ = 0.0000"), mCurrentSection.SoilParameters.FreeFieldDeformation.ToString("Δ = 0.0000 m")}; SimpleCAD.MultiLineText rackingParamsText = new SimpleCAD.MultiLineText(x, y, text, TextSize); rackingParamsText.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); rackingParamsText.FontFamily = Font.Name; Model.Add(rackingParamsText); }
private void DrawInternalForce(Frame f, float minForceI, float minForceJ, float maxForceI, float maxForceJ, float scale) { float x1 = (float)f.NodeI.X; float y1 = (float)f.NodeI.Z; float x2 = (float)f.NodeJ.X; float y2 = (float)f.NodeJ.Z; float orientation = (float)f.Angle; float loadOrientation = orientation + (float)Math.PI / 2; float textAngle = orientation * 180 / (float)Math.PI + 90; int fillAlpha = (int)((1 - mFillTransparency) * 255); Color negativeColor = Color.FromArgb(fillAlpha, NegativeForceColor); Color positiveColor = Color.FromArgb(fillAlpha, PositiveForceColor); Color envelopeColor = Color.FromArgb(fillAlpha, EnvelopeForceColor); float minLoadx1 = x1 + (float)(minForceI * scale * Math.Cos(loadOrientation)); float minLoady1 = y1 + (float)(minForceI * scale * Math.Sin(loadOrientation)); float minLoadx2 = x2 + (float)(minForceJ * scale * Math.Cos(loadOrientation)); float minLoady2 = y2 + (float)(minForceJ * scale * Math.Sin(loadOrientation)); float maxLoadx1 = x1 + (float)(maxForceI * scale * Math.Cos(loadOrientation)); float maxLoady1 = y1 + (float)(maxForceI * scale * Math.Sin(loadOrientation)); float maxLoadx2 = x2 + (float)(maxForceJ * scale * Math.Cos(loadOrientation)); float maxLoady2 = y2 + (float)(maxForceJ * scale * Math.Sin(loadOrientation)); SimpleCAD.Polygon range = new SimpleCAD.Polygon(new PointF[] { new PointF(minLoadx1, minLoady1), new PointF(minLoadx2, minLoady2), new PointF(maxLoadx2, maxLoady2), new PointF(maxLoadx1, maxLoady1) }); range.OutlineStyle = new SimpleCAD.OutlineStyle(Color.Transparent); range.FillStyle = new SimpleCAD.FillStyle(envelopeColor); Model.Add(range); if (minForceI < 0 && maxForceI < 0 && minForceI < 0 && minForceJ < 0) { SimpleCAD.Polygon poly = new SimpleCAD.Polygon(new PointF[] { new PointF(maxLoadx1, maxLoady1), new PointF(maxLoadx2, maxLoady2), new PointF(x2, y2), new PointF(x1, y1) }); poly.OutlineStyle = new SimpleCAD.OutlineStyle(Color.Transparent); poly.FillStyle = new SimpleCAD.FillStyle(negativeColor); Model.Add(poly); } else if (minForceI > 0 && maxForceI > 0 && minForceI > 0 && minForceJ > 0) { SimpleCAD.Polygon poly = new SimpleCAD.Polygon(new PointF[] { new PointF(minLoadx1, minLoady1), new PointF(minLoadx2, minLoady2), new PointF(x2, y2), new PointF(x1, y1) }); poly.OutlineStyle = new SimpleCAD.OutlineStyle(Color.Transparent); poly.FillStyle = new SimpleCAD.FillStyle(positiveColor); Model.Add(poly); } SimpleCAD.Line line1 = new SimpleCAD.Line(minLoadx1, minLoady1, minLoadx2, minLoady2); line1.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(line1); SimpleCAD.Line line2 = new SimpleCAD.Line(maxLoadx1, maxLoady1, maxLoadx2, maxLoady2); line2.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(line2); SimpleCAD.Line line3 = new SimpleCAD.Line(x1, y1, x2, y2); line3.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(line3); SimpleCAD.Line line4 = new SimpleCAD.Line(minLoadx1, minLoady1, x1, y1); line4.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(line4); SimpleCAD.Line line5 = new SimpleCAD.Line(minLoadx2, minLoady2, x2, y2); line5.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(line5); SimpleCAD.Line line6 = new SimpleCAD.Line(maxLoadx1, maxLoady1, x1, y1); line6.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(line6); SimpleCAD.Line line7 = new SimpleCAD.Line(maxLoadx2, maxLoady2, x2, y2); line7.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor); Model.Add(line7); }