/// <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();
        }
Beispiel #2
0
        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();
        }