/// <summary> /// Constructor for the path map generator GUI. Takes the subfield list which is /// created by the split function in the main form. /// </summary> /// <param name="fields">List of subfields</param> public PathMapGenerator(List<Field> fields) { InitializeComponent(); rend = new Renderer(FieldView); wallsRend = new PolygonRenderable(Color.Brown, true); objectsRend = new PolygonRenderable(Color.Blue, true); regionsRend = new PolygonRenderable(Color.Yellow, 0.5f, true); fieldsRend = new PolygonRenderable(Color.Gray); pointRend = new PointRenderable(); pointRend.Show = false; lines = new List<PathRenderable>(); rend.AddRenderable(wallsRend); rend.AddRenderable(objectsRend); rend.AddRenderable(regionsRend); rend.AddRenderable(fieldsRend); rend.AddRenderable(pointRend); originalTool = rend.Tool; polyTool = new ClickTool(); polyTool.clicked += new EventHandler<ClickedEventArgs>(FieldViewClick); rend.Tool = polyTool; complete = false; PRMs = new List<PRMAlgorithm>(); rend.OnFormShown(); this.fields = fields; f = fields[0]; count = 1; LoadNext(); }
/// <summary> /// Activates the tool, and turns off all others /// </summary> /// <param name="toolToActivate"></param> public void DeactivateAllToolsExcept(IRenderTool toolToActivate) { foreach (IRenderTool tool in tools) { tool.IsActive = false; } ActivateTool(toolToActivate); }
/// <summary> /// This adds a tool object to the list of items to render by the renderable, and optionally activates it /// </summary> /// <param name="tool"></param> /// <param name="activate"></param> public void AddTool(IRenderTool tool, bool activate) { tools.Add(tool); if (activate) { this.ActivateTool(tool); } }
public void DisableTool(IRenderTool tool) { if (!disabledTools.Contains(tool)) { enabledTools.Remove(tool); disabledTools.Add(tool); BuildContextMenu(); } }
public void Initialize(List <IRenderTool> toolList, IRenderTool activeTool) { foreach (IRenderTool tool in toolList) { disabledTools.Add(tool); } if (activeTool != null) { EnableTool(activeTool); } BuildContextMenu(); }
/// <summary> /// Changes toolToDeactivate to deactivated /// </summary> /// <param name="toolToDeactivate"></param> public void DeactivateTool(IRenderTool toolToDeactivate) { foreach (IRenderTool tool in tools) { if (tool == toolToDeactivate) { tool.IsActive = false; if (toolChanged != null) { toolChanged(this, new ToolChangedArgs(tool, false)); } } } control.Cursor = Cursors.Default; }
/// <summary> /// Changes toolToActivate to active /// </summary> /// <param name="toolToActivate"></param> public void ActivateTool(IRenderTool toolToActivate) { foreach (IRenderTool tool in tools) { if (tool == toolToActivate) { tool.IsActive = true; if (toolChanged != null) { toolChanged(this, new ToolChangedArgs(tool, true)); } } //control.Cursor = tool.Cursor; } }
public void Initialize(List<IRenderTool> toolList, IRenderTool activeTool) { foreach (IRenderTool tool in toolList) { disabledTools.Add(tool); } if (activeTool!=null) EnableTool(activeTool); BuildContextMenu(); }
public void EnableTool(IRenderTool tool) { if (!enabledTools.Contains(tool)) { enabledTools.Add(tool); disabledTools.Remove(tool); BuildContextMenu(); } }
public void AddConflict(IRenderTool tool) { conflicts.Add(tool); }
public void AddTools(Renderer renderer,IRenderTool tool) { renderer.AddTool(tool); }
public void RemoveTools(Renderer renderer, IRenderTool tool) { renderer.RemoveTool(tool); }
public ToolChangedArgs(IRenderTool tool, bool active) { this.changedTool = tool; this.active = active; }
/// <summary> /// Changes toolToDeactivate to deactivated /// </summary> /// <param name="toolToDeactivate"></param> public void DeactivateTool(IRenderTool toolToDeactivate) { foreach (IRenderTool tool in tools) { if (tool == toolToDeactivate) { tool.IsActive = false; if (toolChanged != null) toolChanged(this, new ToolChangedArgs(tool, false)); } } control.Cursor = Cursors.Default; }
/// <summary> /// This adds a tool object to the list of items to render by the renderable, and optionally activates it /// </summary> /// <param name="tool"></param> /// <param name="activate"></param> public void AddTool(IRenderTool tool, bool activate) { tools.Add(tool); if (activate) this.ActivateTool(tool); }
/// <summary> /// Changes toolToActivate to active /// </summary> /// <param name="toolToActivate"></param> public void ActivateTool(IRenderTool toolToActivate) { foreach (IRenderTool tool in tools) { if (tool == toolToActivate) { tool.IsActive = true; if (toolChanged != null) toolChanged(this, new ToolChangedArgs(tool, true)); } //control.Cursor = tool.Cursor; } }
public EnableModeArgs(IRenderTool t, string m) { tool = t; mode = m; }
/// <summary> /// This adds a tool object to the list of items to render by the renderable. /// </summary> /// <param name="renderable"></param> public void AddTool(IRenderTool tool) { tools.Add(tool); }
public void RemoveTool(IRenderTool tool) { tools.Remove(tool); }
public ToolEnabledArgs(IRenderTool tool) { toolEnabled = tool; }
public ToolDisabledArgs(IRenderTool tool) { toolDisabled = tool; }
/// <summary> /// Activates the tool, and turns off all others /// </summary> /// <param name="toolToActivate"></param> public void DeactivateAllToolsExcept(IRenderTool toolToActivate) { foreach (IRenderTool tool in tools) tool.IsActive = false; ActivateTool(toolToActivate); }
public MainGUI() { InitializeComponent(); rend = new Renderer(FieldView); ocgridRend = new OccupancyGridRenderable("Grid SLAM Map", Color.Red); firstPointRend = new PointRenderable(); firstPointRend.Show = false; newPolyRend = new PathRenderable(); wallsRend = new PolygonRenderable(Color.Brown, true); objectsRend = new PolygonRenderable(Color.Blue, true); regionsRend = new PolygonRenderable(Color.Yellow, 0.5f, true); fieldsRend = new PolygonRenderable(Color.Gray); selectedPolyRend = new PolygonRenderable(Color.Black); selectedPolyRend.LineThickness = 2F; rend.AddRenderable(ocgridRend); rend.AddRenderable(firstPointRend); rend.AddRenderable(newPolyRend); rend.AddRenderable(wallsRend); rend.AddRenderable(objectsRend); rend.AddRenderable(regionsRend); rend.AddRenderable(fieldsRend); rend.AddRenderable(selectedPolyRend); mainField = new Field("main"); subFields = new Dictionary<string, Polygon>(); selectedPoly = new List<Polygon>(); originalTool = rend.Tool; polyTool = new ClickTool(); polyTool.clicked += new EventHandler<ClickedEventArgs>(FieldViewClick); newPoly = new Polygon(); accRobot = false; ocgridShow = true; Ctrl_press.Hide(); }
public void AddTools(Renderer renderer, IRenderTool tool) { renderer.AddTool(tool); }