private void Btn_DrawLine_Click(object sender, RoutedEventArgs e) { // GeometryEngine.Remove("Supports"); // var traingle = new GTriangle(GeometryEngine.GCanvas, new Point(60, 60), 20); l = new GLine(GeometryEngine.GCanvas, new Point(60, 60), new Point(100, 200)); c = new GCircle(GeometryEngine.GCanvas, new Point(200, 200), 50); c.Fill = Brushes.Green; hinged = new Hinged(GeometryEngine.GCanvas, new Point(500, 500)); hinged.Fill = Brushes.Transparent; hinged.Stroke = Brushes.Red; hinged.StrokeThickness = 2; roller = new Roller(GeometryEngine.GCanvas, new Point(160, 60)); roller.Fill = Brushes.Transparent; roller.StrokeThickness = 2; //var rectangle = new GRectangle(GeometryEngine.GCanvas, 30, 15, new Point(140, 60+15)); fixd = new Fixed(GeometryEngine.GCanvas, new Point(100, 60), 20); fixd.Fill = Brushes.Orange; fixd.StrokeThickness = 2; arrow = new Arrow(GeometryEngine.GCanvas, new Point(220, 60), 20); arrow.Stroke = Brushes.Yellow; arrow.StrokeThickness = 4; arrowLoad = new ArrowLoad(GeometryEngine.GCanvas, new Point(100, 120), new Point(200, 120), 20); arrowLoad.Stroke = Brushes.Blue; arrowLoad.StrokeThickness = 2; gText = new GText(GeometryEngine.GCanvas, new Point(500, 500), "Hello Text!"); gText.Text = "Hello Text!"; gText.Render(); //arrow.Rotate(45); //render on Screen //GeometryEngine.RenderAll(); // GeometryEngine.Render(new List<GShape>() { roller, hinged, fixd }); GeometryEngine.Shapes["Beams"].Add(c); GeometryEngine.Shapes["Beams"].Add(arrow); GeometryEngine.Shapes["Supports"].Add(arrowLoad); GeometryEngine.Shapes["Supports"].Add(roller); GeometryEngine.Shapes["Supports"].Add(fixd); GeometryEngine.Shapes["Supports"].Add(l); GeometryEngine.Shapes["Supports"].Add(hinged); // GeometryEngine.Shapes["Supports"].Add(gText); // GeometryEngine.Render("Beams"); // GeometryEngine.Render("Supports"); l.Stroke = Brushes.Red; l.StrokeThickness = 4; GeometryEngine.RenderAll(); }
private void Btn_Ok_Click(object sender, RoutedEventArgs e) { if (GeometryEditorVM.GeometryEditor.GridData.Count < 1) { return; } DrawingHelper.GLineList.Clear(); List <double> GComSpanValues = new List <double>(); GComSpanValues.Clear(); GComSpanValues.Add(0); double cumulativeSpans = 0; for (int i = 0; i < GeometryEditorVM.GeometryEditor.NumberOfSpans; i++) { cumulativeSpans += GeometryEditorVM.GeometryEditor.GridData[i].Span; GComSpanValues.Add(cumulativeSpans); } if (GeometryEditorVM.GeometryEditor.NumberOfSpans < 1) { return; } GeometryEngine.RemoveAll(); for (int i = 0; i < GeometryEditorVM.GeometryEditor.NumberOfSpans; i++) { GeometryEngine.Shapes["Beams"].Add(new GLine(GeometryEngine.GCanvas, new Point(GComSpanValues[i] * 20, 130) , new Point(GComSpanValues[i + 1] * 20, 130))); // GeometryEngine.Shapes["Beams"].ForEach(d => { d.Scale = 10;d.New(); }); //new Hinged(GeometryEngine.GCanvas, new Point(GComSpanValues[i] * 20, 100)); } for (int i = 0; i < GeometryEditorVM.GeometryEditor.RestraintsCollection.Count; i++) { switch (GeometryEditorVM.GeometryEditor.RestraintsCollection[i].SelectedRestraint) { case Restraints.Fixed: //Revise GeometryEngine.Shapes["Supports"].Add( new Fixed(GeometryEngine.GCanvas, new Point(GComSpanValues[i] * 20, 130), 20)); break; case Restraints.Hinged: GeometryEngine.Shapes["Supports"].Add( new Hinged(GeometryEngine.GCanvas, new Point(GComSpanValues[i] * 20, 130))); break; case Restraints.Roller: GeometryEngine.Shapes["Supports"].Add( new Roller(GeometryEngine.GCanvas, new Point(GComSpanValues[i] * 20, 130))); break; case Restraints.NoRestraints: break; default: break; } } GeometryEngine.RenderAll(); GeometryEngine.Shapes["Supports"].ForEach(d => d.SetScale(0.75)); //GeometryEngine.Shapes.Add("li", new List<GShape>()); Add List in Real Time this.Close(); }