public void DrawLine(Line l) { _2DCanvas.Data.Point P1 = MapPointToCanvas(l.P1);; _2DCanvas.Data.Point P2 = MapPointToCanvas(l.P2);; Canvas.AddObject(new _2DCanvas.Data.Line(P1, P2, l.Color)); }
public void DrawSurface(Surface s) { _2DCanvas.Data.Point[] vertices = new _2DCanvas.Data.Point[s.Vertices.Length]; _2DCanvas.Data.Line[] edges = new _2DCanvas.Data.Line[s.Edges.Length]; for (int idx = 0; idx < s.Vertices.Length; idx++) { vertices[idx] = MapPointToCanvas(s.Vertices[idx]); if (DrawVertices) { Canvas.AddObject(vertices[idx]); } } if (DrawEdges || FillSurfaces) { UInt32?edgeColor = DrawEdges ? (UInt32?)s.EdgeColor : null; UInt32?fillColor = FillSurfaces ? (UInt32?)s.FillColor : null; _2DCanvas.Data.Polygon polygon = new _2DCanvas.Data.Polygon(vertices, edgeColor, fillColor); Canvas.AddObject(polygon); } }
public void DrawPoint(Point p) { _2DCanvas.Data.Point canvasPoint = MapPointToCanvas(p); Canvas.AddObject(canvasPoint); }