private void LoadGraphics() { var bottomleft = new PolarGraphicCoordinate(Coord1.Target, Width, Coord1.PerpendicularNegative().AngleDegree); var topleft = new PolarGraphicCoordinate(Coord1.Target, Width, Coord1.PerpendicularPositive().AngleDegree); var topright = new PolarGraphicCoordinate(Coord2.Origin, Width, Coord2.PerpendicularPositive().AngleDegree); var bottomright = new PolarGraphicCoordinate(Coord2.Origin, Width, Coord2.PerpendicularNegative().AngleDegree); _square = new Square(bottomleft.Target, topleft.Target, topright.Target, bottomright.Target, Color); }
public Segment(PolarGraphicCoordinate polargraphiccoordinate, Color color, double width, uint priority) { this.Origin = polargraphiccoordinate.Origin; this.Target = polargraphiccoordinate.Target; this.Color = color; this.Width = width; this.Priority = priority; LoadGraphics(); }
public SegmentJunction(PolarGraphicCoordinate coord1, PolarGraphicCoordinate coord2, Color color, double width, uint priority) { this.Coord1 = coord1; this.Coord2 = coord2; this.Color = color; this.Width = width; this.Priority = priority; LoadGraphics(); }
private void LoadGraphics() { PolarGraphicCoordinate pgc = new PolarGraphicCoordinate(Origin, Target); var topleft = new PolarGraphicCoordinate(Origin, Width, pgc.PerpendicularPositive().AngleDegree); var bottomleft = new PolarGraphicCoordinate(Origin, Width, pgc.PerpendicularNegative().AngleDegree); var topright = new PolarGraphicCoordinate(Target, Width, pgc.PerpendicularPositive().AngleDegree); var bottomright = new PolarGraphicCoordinate(Target, Width, pgc.PerpendicularNegative().AngleDegree); var y = topleft.Target.Y - bottomleft.Target.Y; var y0 = topleft.Target.Y - topright.Target.Y; var y2 = topright.Target.Y - bottomleft.Target.Y; var y3 = topright.Target.Y - bottomright.Target.Y; var y4 = bottomleft.Target.Y - bottomright.Target.Y; _square = new Square(bottomleft.Target, topleft.Target, topright.Target, bottomright.Target, Color); }