public void PushLayer() { // Insert a new layer at the end of the list. This is like a stack in which the 'top' is the end of the list Edit2DGraphLayer oNewLayer = new Edit2DGraphLayer(); Edit2dGraphLayerList.Add(oNewLayer); MostRecentlySelectedLayer = oNewLayer; DrawShapes(); }
// --------------------------------------------------- public override void DrawShapes() { if (SubControl == 0) { this.Clear("#FFFFFF"); DrawGrid(); DrawAxis(); } for (int i = 0; i < Edit2dGraphLayerList.Count; i++) { Edit2DGraphLayer olayer = Edit2dGraphLayerList.GetFrom(i); DrawShapes_Layer(olayer, olayer == MostRecentlySelectedLayer, bShowHandles); } }
public Edge FindEdgeWithHoleGroupID(string HoleGroupID) { for (int i = 0; i < Edit2dGraphLayerList.Count; i++) { Edit2DGraphLayer oLayer = Edit2dGraphLayerList.GetFrom(i); for (int j = 0; j < oLayer.EdgeList.Count; j++) { Edge oEdge = oLayer.EdgeList.GetFrom(j); if (oEdge.HoleGroupID == HoleGroupID) { return(oEdge); } } } return(null); }
public void PopLayer() { // Remove the layer at the end of the list. this is like a stack where the 'top' is the end of the list if (Edit2dGraphLayerList.Count == 0) { return; } int ndx = Edit2dGraphLayerList.Count - 1; Edit2dGraphLayerList.RemoveAt(ndx); if (Edit2dGraphLayerList.Count == 0) { MostRecentlySelectedLayer = null; } else { MostRecentlySelectedLayer = Edit2dGraphLayerList.GetFrom(Edit2dGraphLayerList.Count - 1); } DrawShapes(); }