public virtual void DeletePolygon(Polygon polygon) { if (Polygons.Contains(polygon)) { Polygons.Remove(polygon); } }
public void AddPolygon(Polygon p2) { if (!Polygons.Contains(p2)) { Polygons.Add(p2); } }
public void RemovePolygon(Polygon polygon) { foreach (Corner corner in new List <Corner>(polygon.Corners)) { RemoveCorner(corner); } if (Polygons.Contains(polygon)) { // This should not happen, removing last corner should remove polygon System.Diagnostics.Trace.TraceError("polygon should have been removed"); } }
public void Render(DirectBitmap bitmap, Graphics g) { foreach (var polygon in MainForm.Polygons) { if (!Polygons.Contains(polygon)) { polygon.Render(bitmap, MainForm.ColorFill, MainForm.BumpMapping); } else { polygon.Render(bitmap, MarkedColor, MainForm.ColorFill, MainForm.BumpMapping); } } }