Add Übernahme-Trog
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
@@ -12,10 +11,8 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
|
||||
public bool Orientation { get; set; }
|
||||
public Brush? Highlight { get; set; }
|
||||
|
||||
private Line? _outer1;
|
||||
private Line? _outer2;
|
||||
private Line? _inner1;
|
||||
private Line? _inner2;
|
||||
private Polyline? _outer;
|
||||
private Polyline? _inner;
|
||||
|
||||
public Pipe(INode start, INode end, bool orientation = false, bool twoWay = false) {
|
||||
Start = start;
|
||||
@@ -31,43 +28,28 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
|
||||
var y2 = Orientation ? End.CenterY : Start.CenterY;
|
||||
var x3 = End.CenterX;
|
||||
var y3 = End.CenterY;
|
||||
_outer1 = new Line() {
|
||||
X1 = x1, Y1 = y1, X2 = x2, Y2 = y2,
|
||||
_outer = new Polyline() {
|
||||
Points = [new(x1, y1), new(x2, y2), new(x3, y3)],
|
||||
StrokeThickness = 10,
|
||||
Stroke = Brushes.Black,
|
||||
StrokeStartLineCap = PenLineCap.Round,
|
||||
StrokeEndLineCap = PenLineCap.Round,
|
||||
StrokeLineJoin = PenLineJoin.Round,
|
||||
};
|
||||
_inner1 = new Line() {
|
||||
X1 = x1, Y1 = y1, X2 = x2, Y2 = y2,
|
||||
_inner = new Polyline() {
|
||||
Points = [new(x1, y1), new(x2, y2), new(x3, y3)],
|
||||
StrokeThickness = 6,
|
||||
Stroke = Brushes.DarkGray,
|
||||
StrokeStartLineCap = PenLineCap.Round,
|
||||
StrokeEndLineCap = PenLineCap.Round,
|
||||
StrokeLineJoin = PenLineJoin.Round,
|
||||
};
|
||||
_outer2 = new Line() {
|
||||
X1 = x2, Y1 = y2, X2 = x3, Y2 = y3,
|
||||
StrokeThickness = 10,
|
||||
Stroke = Brushes.Black,
|
||||
StrokeStartLineCap = PenLineCap.Round,
|
||||
StrokeEndLineCap = PenLineCap.Round,
|
||||
};
|
||||
_inner2 = new Line() {
|
||||
X1 = x2, Y1 = y2, X2 = x3, Y2 = y3,
|
||||
StrokeThickness = 6,
|
||||
Stroke = Brushes.DarkGray,
|
||||
StrokeStartLineCap = PenLineCap.Round,
|
||||
StrokeEndLineCap = PenLineCap.Round,
|
||||
};
|
||||
canvas.Children.Add(_outer1);
|
||||
canvas.Children.Add(_outer2);
|
||||
canvas.Children.Add(_inner1);
|
||||
canvas.Children.Add(_inner2);
|
||||
canvas.Children.Add(_outer);
|
||||
canvas.Children.Add(_inner);
|
||||
}
|
||||
|
||||
public void Update() {
|
||||
_inner1?.Stroke = Highlight ?? Brushes.DarkGray;
|
||||
_inner2?.Stroke = Highlight ?? Brushes.DarkGray;
|
||||
_inner?.Stroke = Highlight ?? Brushes.DarkGray;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user