public void Copy(Shape shape) { Points.Clear(); foreach (Point point in shape.Points) { Points.Add(point); } Edges.Clear(); foreach (Edge edge in shape.Edges) { Edges.Add(edge); } }
public Model(Material material, Shape shape) { Material = material; Shape = shape; BoundaryConditions = new Dictionary<Edge, BoundaryCondition>(); foreach(Edge edge in Shape.Edges) { BoundaryConditions.Add(edge, new BoundaryCondition(BoundaryConditionsType.Kinematic, new Vector(3))); } PointConditions = new Dictionary<Point, BoundaryCondition>(); foreach (Point point in Shape.Points) { PointConditions.Add(point, new BoundaryCondition(BoundaryConditionsType.Kinematic, new Vector(3))); } }
private void drawShape(DrawingVisual visual, Shape shape) { using (DrawingContext dc = visual.RenderOpen()) { for (int i = 0; i < shape.Points.Count; i++) { int prevIndex = i - 1; if (prevIndex < 0) { prevIndex = shape.Points.Count - 1; } System.Windows.Point firstPoint = ConvertPoint(shape.Points[prevIndex]); System.Windows.Point secondPoint = ConvertPoint(shape.Points[i]); dc.DrawLine(drawingPen, firstPoint, secondPoint); } } }
public void DrawShape(Shape shape) { DrawingVisual visual = new DrawingVisual(); drawShape(visual, shape); this.AddVisual(visual, shape); }
public void RemoveShape(Shape shape) { Visual visual = visuals[shape]; visuals.Remove(shape); DeleteVisual(visual); }
public void AddVisual(Visual visual, Shape shape) { visuals.Add(shape, visual); AddVisualChild(visual); AddLogicalChild(visual); }
public SolidMechanicsModel2D(Shape shape) : base(shape) { }
protected Mesh1D(Shape shape) { initMeshElements(); }
public Model(Shape shape):this(new Material(), shape) { }
public SolidMechanicsModel(Shape shape) { Model = new Model(shape); }
protected abstract BoundaryMeshSettings getDefaultBoundaryMeshSettings(Shape shape);
protected Mesh2D(Shape shape) { initMeshElements(); BoundaryMeshSettings = new BoundaryMeshSettings(shape); isSettingsSetted = false; }
public BoundaryMeshSettings(Shape shape) { Shape = shape; Settings = new List<BoundaryMesh>(); }
protected override BoundaryMeshSettings getDefaultBoundaryMeshSettings(Shape shape) { BoundaryMeshSettings settings = new BoundaryMeshSettings(shape); for(int i = 0; i < shape.Edges.Count;i++) { if (i % 2 == 0) { settings.Settings.Add(new BoundaryMesh(shape.Edges[i], _countHeightElements)); } else { settings.Settings.Add(new BoundaryMesh(shape.Edges[i], _countWidthElements)); } } return settings; }