public DebugForm(DockBase pane)
        {
            InitializeComponent();
            property.SelectedObject = pane;
            var infoArray = new DockBaseNeigh.DireInfo[] { pane.Neigh.Top, pane.Neigh.Bottom, pane.Neigh.Left, pane.Neigh.Right };
            var strArray = new string[] { "Top", "Bottom", "Left", "Right" };
            var view = new TreeView { Dock = DockStyle.Fill };
            for (int i = 0; i < infoArray.Length; i++)
            {
                var node = new TreeNode(strArray[i]);
                var outers = new TreeNode("outers");
                var inners = new TreeNode("inner");
                foreach (var control in infoArray[i].Inners)
                    inners.Nodes.Add(control.Location + ":" + control.Size);
                foreach (var control2 in infoArray[i].Outers)
                    outers.Nodes.Add(control2.Location + ":" + control2.Size);
                node.Nodes.Add(inners);
                node.Nodes.Add(outers);

                view.Nodes.Add(node);
            }
            splitContainer1.Panel2.Controls.Add(view);
            Text = String.Format("{0}[{1}]", pane.GetType().Name, pane.Bounds.ToString());
            Show();
        }
Example #2
0
        void ModuleProgramInit()
        {
            wicoThrusters  = new WicoThrusters(this, wicoBlockMaster);
            wicoGyros      = new WicoGyros(this, wicoBlockMaster);
            wicoGasTanks   = new GasTanks(this, wicoBlockMaster);
            wicoGasGens    = new GasGens(this);
            wicoConnectors = new Connectors(this);
            wicoCameras    = new Cameras(this);
            wicoAntennas   = new Antennas(this);
            wicoSensors    = new Sensors(this, wicoBlockMaster);
            wicoPower      = new PowerProduction(this, wicoBlockMaster);
            wicoTimers     = new Timers(this, wicoBlockMaster);
            //            navRemote = new NavRemote(this);
            navCommon = new NavCommon(this);
            _sensors  = new Sensors(this, wicoBlockMaster);
            _drills   = new Drills(this, wicoBlockMaster);
            _displays = new Displays(this, wicoBlockMaster, wicoElapsedTime);
            Echo("_displays");
            _cargoCheck = new CargoCheck(this, wicoBlockMaster, _displays);
            Echo("_cargoCheck");
            _dock = new DockBase(this);
            Echo("_dock");
//            _scanBase = new ScanBase(this, _wicoControl);
            _asteroids = new Asteroids(this, _wicoControl, wicoIGC, _displays);
            _scanMode  = new ScansMode(this, _wicoControl, wicoBlockMaster, wicoIGC, wicoCameras, _asteroids);
            _ores      = new Ores(this, wicoBlockMaster, _wicoControl, wicoIGC, _asteroids, _displays);

            Echo("_ores");

            _miner = new Miner(this, _wicoControl, wicoBlockMaster, wicoElapsedTime, wicoIGC
                               , _scanMode, _asteroids, wicoThrusters, wicoConnectors, wicoSensors
                               , wicoCameras, _drills, wicoAntennas, wicoGasTanks, wicoGyros, wicoPower
                               , wicoTimers, navCommon, _ores, _dock
                               , _displays
                               );
            Echo("_miner");
            //                spaceDock = new SpaceDock(this, _wicoControl, wicoBlockMaster, wicoThrusters, wicoConnectors,
            //                    wicoAntennas, wicoGasTanks, wicoGyros, wicoPower, wicoTimers, wicoIGC, wicoBases, navCommon, _cargoCheck);
            //wicoOrbitalLaunch = new OrbitalModes(this);
            //            wicoNavigation = new Navigation(this, wicoBlockMaster.GetMainController());

            /// DEBUG
            // wicoIGC.SetDebug(true);
//        _wicoControl.SetDebug(true);
            // wicoElapsedTime.SetDebug(true);
        }
        internal void InitializeLayout()
        {
            VehicleDetails          = new ComputerVehicleDetails(this, DetailedEntity, VehicleViewQuickActionSelected);
            VehicleDetails.Dock     = Pos.Fill;
            tabcontrol_details      = new TabControl(this);
            tabcontrol_details.Dock = Pos.Fill;

            arrestsContainer = new DockBase(this);
            arrestsContainer.Hide();

            trafficCitationContainer = new DockBase(this);
            trafficCitationContainer.Hide();

            var details = tabcontrol_details.AddPage("Details", VehicleDetails);

            details.UserData = Page.VEHICLE_DETAILS;
            details.Clicked += PageTabClicked;


            AddArrestReportsTab();
            AddTrafficCitationsTab();
        }
        internal void InitializeLayout()
        {
            Function.LogDebug("Creating ComputerPedView");

            pedView                 = new ComputerPedView(this, DetailedEntity, PedViewQuickActionSelected);
            pedView.Dock            = Pos.Fill;
            tabcontrol_details      = new TabControl(this);
            tabcontrol_details.Dock = Pos.Fill;

            arrestsContainer = new DockBase(this);
            arrestsContainer.Hide();

            trafficCitationContainer = new DockBase(this);
            trafficCitationContainer.Hide();

            var details = tabcontrol_details.AddPage("Details", pedView);

            details.UserData = Page.PED_DETAILS;
            details.Clicked += PageTabClicked;

            AddArrestReportsTab();
            AddTrafficCitationsTab();
        }
Example #5
0
        public override void InitializeLayout()
        {
            base.InitializeLayout();
            this.Position           = this.GetLaunchPosition();
            pedView                 = new ComputerPedView(this, Entity, PedViewQuickActionSelected);
            pedView.Dock            = Pos.Fill;
            tabcontrol_details      = new TabControl(this);
            tabcontrol_details.Dock = Pos.Fill;

            arrestsContainer = new DockBase(this);
            arrestsContainer.Hide();

            trafficCitationContainer = new DockBase(this);
            trafficCitationContainer.Hide();

            var details = tabcontrol_details.AddPage("Details", pedView);

            details.UserData = Page.PED_DETAILS;
            details.Clicked += PageTabClicked;


            AddArrestReportsTab();
            AddTrafficCitationsTab();
        }
        public UnitTestHarnessControls(ControlBase parent) : base(parent)
        {
            Dock = Dock.Fill;

            DockBase dock = new DockBase(this);

            dock.Dock = Dock.Fill;

            m_List = new CollapsibleList(this);

            dock.LeftDock.TabControl.AddPage("Unit tests", m_List);
            dock.LeftDock.Width = 150;

            m_TextOutput = new ListBox(this);
            m_TextOutput.AlternateColor = false;

            dock.BottomDock.TabControl.AddPage("Output", m_TextOutput);
            dock.BottomDock.Height = 200;

            m_StatusBar      = new StatusBar(this);
            m_StatusBar.Dock = Dock.Bottom;

            m_DebugCheck               = new LabeledCheckBox(m_StatusBar);
            m_DebugCheck.Text          = "Debug outlines";
            m_DebugCheck.CheckChanged += DebugCheckChanged;

            m_IncScale = new Button(m_StatusBar);
            m_IncScale.HorizontalAlignment = HorizontalAlignment.Left;
            m_IncScale.VerticalAlignment   = VerticalAlignment.Stretch;
            m_IncScale.Width       = 30;
            m_IncScale.Margin      = new Margin(0, 0, 8, 0);
            m_IncScale.TextPadding = new Padding(5, 0, 5, 0);
            m_IncScale.Text        = "+";
            m_IncScale.Clicked    += (sender, arguments) => { m_UIScale.Value = Math.Min(m_UIScale.Value + 0.25f, 3.0f); };

            m_UIScale = new TextBoxNumeric(m_StatusBar);
            m_UIScale.VerticalAlignment = VerticalAlignment.Stretch;
            m_UIScale.Width             = 70;
            m_UIScale.Value             = GetCanvas().Scale;
            m_UIScale.TextChanged      += (sender, arguments) => { GetCanvas().Scale = m_UIScale.Value; };

            m_DecScale = new Button(m_StatusBar);
            m_DecScale.HorizontalAlignment = HorizontalAlignment.Left;
            m_DecScale.VerticalAlignment   = VerticalAlignment.Stretch;
            m_DecScale.Width       = 30;
            m_DecScale.Margin      = new Margin(4, 0, 0, 0);
            m_DecScale.TextPadding = new Padding(5, 0, 5, 0);
            m_DecScale.Text        = "-";
            m_DecScale.Clicked    += (sender, arguments) => { m_UIScale.Value = Math.Max(m_UIScale.Value - 0.25f, 1.0f); };

            m_UIScaleText = new Label(m_StatusBar);
            m_UIScaleText.VerticalAlignment = VerticalAlignment.Stretch;
            m_UIScaleText.Alignment         = Alignment.Left | Alignment.CenterV;
            m_UIScaleText.Text = "Scale:";

            m_Center      = new DockLayout(dock);
            m_Center.Dock = Dock.Fill;

            List <Type> tests = typeof(UnitTestHarnessControls).Assembly.GetTypes().Where(t => t.IsDefined(typeof(UnitTestAttribute), false)).ToList();

            tests.Sort((t1, t2) =>
            {
                object[] a1s = t1.GetCustomAttributes(typeof(UnitTestAttribute), false);
                object[] a2s = t2.GetCustomAttributes(typeof(UnitTestAttribute), false);
                if (a1s.Length > 0 && a2s.Length > 0)
                {
                    UnitTestAttribute a1 = a1s[0] as UnitTestAttribute;
                    UnitTestAttribute a2 = a2s[0] as UnitTestAttribute;
                    if (a1.Order == a2.Order)
                    {
                        if (a1.Category == a2.Category)
                        {
                            return(String.Compare(a1.Name != null ? a1.Name : t1.Name, a2.Name != null ? a2.Name : t2.Name, StringComparison.OrdinalIgnoreCase));
                        }
                        else
                        {
                            return(String.Compare(a1.Category, a2.Category, StringComparison.OrdinalIgnoreCase));
                        }
                    }
                    return(a1.Order - a2.Order);
                }

                return(0);
            });

            foreach (Type type in tests)
            {
                object[] attribs = type.GetCustomAttributes(typeof(UnitTestAttribute), false);
                if (attribs.Length > 0)
                {
                    UnitTestAttribute attrib = attribs[0] as UnitTestAttribute;
                    if (attrib != null)
                    {
                        CollapsibleCategory cat = m_List.FindChildByName(attrib.Category) as CollapsibleCategory;
                        if (cat == null)
                        {
                            cat = m_List.Add(attrib.Category, attrib.Category);
                        }
                        GUnit test = Activator.CreateInstance(type, m_Center) as GUnit;
                        RegisterUnitTest(attrib.Name != null ? attrib.Name : type.Name, cat, test);
                    }
                }
            }

            m_StatusBar.SendToBack();
            PrintText("Unit Test started!");
        }
Example #7
0
        private void InitializeUI()
        {
            settings     = NavMeshGenerationSettings.Default;
            areaSettings = new AreaIdGenerationSettings();

            DockBase dock = new DockBase(gwenCanvas);

            dock.Dock = Pos.Fill;
            dock.SetSize(Width, Height);
            dock.RightDock.Width   = 280;
            dock.BottomDock.Height = 150;

            statusBar = new StatusBar(gwenCanvas);

            Label genTime = new Label(statusBar);

            genTime.Name = "GenTime";
            genTime.Text = "Generation Time: 0ms";
            genTime.Dock = Pos.Left;

            LabeledCheckBox catchCheckBox = new LabeledCheckBox(statusBar);

            catchCheckBox.Text          = "Intercept and log exceptions";
            catchCheckBox.Dock          = Pos.Right;
            catchCheckBox.CheckChanged += (s, e) => interceptExceptions = catchCheckBox.IsChecked;
            catchCheckBox.IsChecked     = true;

            Base genBase = new Base(dock);

            dock.RightDock.TabControl.AddPage("NavMesh Generation", genBase);

            Button generateButton = new Button(genBase);

            generateButton.Text     = "Generate!";
            generateButton.Height   = 30;
            generateButton.Dock     = Pos.Top;
            generateButton.Pressed += (s, e) => GenerateNavMesh();

            GroupBox displaySettings = new GroupBox(genBase);

            displaySettings.Text   = "Display";
            displaySettings.Dock   = Pos.Top;
            displaySettings.Height = 60;

            Base levelCheckBase = new Base(displaySettings);

            levelCheckBase.Dock = Pos.Top;

            Label levelCheckLabel = new Label(levelCheckBase);

            levelCheckLabel.Text = "Level";
            levelCheckLabel.Dock = Pos.Left;

            CheckBox levelCheckBox = new CheckBox(levelCheckBase);

            levelCheckBox.Dock       = Pos.Right;
            levelCheckBox.Checked   += (s, e) => displayLevel = true;
            levelCheckBox.UnChecked += (s, e) => displayLevel = false;
            levelCheckBox.IsChecked  = true;

            levelCheckBase.SizeToChildren();

            Base displayModeBase = new Base(displaySettings);

            displayModeBase.Dock    = Pos.Top;
            displayModeBase.Padding = new Padding(0, 4, 0, 0);

            Label displayModeLabel = new Label(displayModeBase);

            displayModeLabel.Text    = "Generation Step";
            displayModeLabel.Dock    = Pos.Left;
            displayModeLabel.Padding = new Padding(0, 0, 4, 0);

            ComboBox displayModes = new ComboBox(displayModeBase);

            displayModes.Dock = Pos.Top;
            displayModes.AddItem("None", "", DisplayMode.None);
            displayModes.AddItem("Heightfield", "", DisplayMode.Heightfield);
            displayModes.AddItem("Compact Heightfield", "", DisplayMode.CompactHeightfield);
            displayModes.AddItem("Distance Field", "", DisplayMode.DistanceField);
            displayModes.AddItem("Regions", "", DisplayMode.Regions);
            displayModes.AddItem("Contours", "", DisplayMode.Contours);
            displayModes.AddItem("Polygon Mesh", "", DisplayMode.PolyMesh);
            displayModes.AddItem("Polygon Mesh Detail", "", DisplayMode.PolyMeshDetail);
            displayModes.AddItem("Pathfinding", "", DisplayMode.Pathfinding);
            displayModes.AddItem("Crowd", "", DisplayMode.Crowd);
            displayModes.ItemSelected += (s, e) => displayMode = (DisplayMode)e.SelectedItem.UserData;

            displayModes.SelectByUserData(DisplayMode.PolyMeshDetail);

            displayModeBase.SizeToChildren();
            displayModeBase.Height += 4;             //accounts for the padding, GWEN.NET should do this

            const int leftMax  = 125;
            const int rightMax = 20;

            GroupBox rsSettings = new GroupBox(genBase);

            rsSettings.Text   = "Rasterization";
            rsSettings.Dock   = Pos.Top;
            rsSettings.Height = 90;

            var   levelTris = level.GetTriangles();
            BBox3 bounds    = TriangleEnumerable.FromTriangle(levelTris, 0, levelTris.Length).GetBoundingBox();

            Base maxTriSlope    = CreateSliderOption(rsSettings, "Max Tri Slope:", 0.0001f, 3.14f, 3.14f, "N2", leftMax, rightMax, v => areaSettings.MaxTriSlope = v);
            Base minLevelHeight = CreateSliderOption(rsSettings, "Min Height:", bounds.Min.Y, bounds.Max.Y, bounds.Min.Y, "N0", leftMax, rightMax, v => areaSettings.MinLevelHeight = v);
            Base maxLevelHeight = CreateSliderOption(rsSettings, "Max Height:", bounds.Min.Y, bounds.Max.Y, bounds.Max.Y, "N0", leftMax, rightMax, v => areaSettings.MaxLevelHeight = v);

            GroupBox hfSettings = new GroupBox(genBase);

            hfSettings.Text   = "Heightfield";
            hfSettings.Dock   = Pos.Top;
            hfSettings.Height = 112;

            Base cellSizeSetting   = CreateSliderOption(hfSettings, "Cell Size:", 0.1f, 2.0f, 0.3f, "N2", leftMax, rightMax, v => settings.CellSize = v);
            Base cellHeightSetting = CreateSliderOption(hfSettings, "Cell Height:", 0.1f, 2f, 0.2f, "N2", leftMax, rightMax, v => settings.CellHeight = v);
            Base maxSlopeSetting   = CreateSliderOption(hfSettings, "Max Climb:", 0.1f, 5.0f, 0.9f, "N0", leftMax, rightMax, v => settings.MaxClimb = v);
            Base maxHeightSetting  = CreateSliderOption(hfSettings, "Max Height:", 0.1f, 5.0f, 2.0f, "N0", leftMax, rightMax, v => settings.AgentHeight = v);

            GroupBox chfSettings = new GroupBox(genBase);

            chfSettings.Text   = "CompactHeightfield";
            chfSettings.Dock   = Pos.Top;
            chfSettings.Height = 38;

            Base erodeRadius = CreateSliderOption(chfSettings, "Erode Radius:", 0.0f, 5.0f, 0.6f, "N1", leftMax, rightMax, v => settings.AgentRadius = v);

            GroupBox regionSettings = new GroupBox(genBase);

            regionSettings.Text   = "Region";
            regionSettings.Dock   = Pos.Top;
            regionSettings.Height = 65;

            Base minRegionSize = CreateSliderOption(regionSettings, "Min Region Size:", 0f, 150f, 8f, "N0", leftMax, rightMax, v => settings.MinRegionSize = (int)Math.Round(v));
            Base mrgRegionSize = CreateSliderOption(regionSettings, "Merged Region Size:", 0f, 150f, 20f, "N0", leftMax, rightMax, v => settings.MergedRegionSize = (int)Math.Round(v));

            GroupBox navMeshSettings = new GroupBox(genBase);

            navMeshSettings.Text   = "NavMesh";
            navMeshSettings.Dock   = Pos.Top;
            navMeshSettings.Height = 90;

            Base maxEdgeLength = CreateSliderOption(navMeshSettings, "Max Edge Length:", 0f, 50f, 12f, "N0", leftMax, rightMax, v => settings.MaxEdgeLength = (int)Math.Round(v));
            Base maxEdgeErr    = CreateSliderOption(navMeshSettings, "Max Edge Error:", 0f, 3f, 1.8f, "N1", leftMax, rightMax, v => settings.MaxEdgeError = v);
            Base vertsPerPoly  = CreateSliderOption(navMeshSettings, "Verts Per Poly:", 3f, 12f, 6f, "N0", leftMax, rightMax, v => settings.VertsPerPoly = (int)Math.Round(v));

            GroupBox navMeshDetailSettings = new GroupBox(genBase);

            navMeshDetailSettings.Text   = "NavMeshDetail";
            navMeshDetailSettings.Dock   = Pos.Top;
            navMeshDetailSettings.Height = 65;

            Base sampleDistance = CreateSliderOption(navMeshDetailSettings, "Sample Distance:", 0f, 16f, 6f, "N0", leftMax, rightMax, v => settings.SampleDistance = (int)Math.Round(v));
            Base maxSampleError = CreateSliderOption(navMeshDetailSettings, "Max Sample Error:", 0f, 16f, 1f, "N0", leftMax, rightMax, v => settings.MaxSampleError = (int)Math.Round(v));

            Base logBase = new Base(dock);

            dock.BottomDock.TabControl.AddPage("Log", logBase);

            ListBox logBox = new ListBox(logBase);

            logBox.Dock             = Pos.Fill;
            logBox.AllowMultiSelect = false;
            logBox.EnableScroll(true, true);
            Console.SetOut(new GwenTextWriter(logBox));
        }
Example #8
0
        private void InitializeUI()
        {
            settings     = NavMeshGenerationSettings.Default;
            areaSettings = new AreaIdGenerationSettings();

            DockBase dock = new DockBase(gwenCanvas);

            dock.Dock = Pos.Fill;
            dock.SetSize(Width, Height);
            dock.RightDock.Width   = 280;
            dock.BottomDock.Height = 150;

            statusBar = new StatusBar(gwenCanvas);

            Label genTime = new Label(statusBar);

            genTime.Name = "GenTime";
            genTime.Text = "Generation Time: 0ms";
            genTime.Dock = Pos.Left;

            LabeledCheckBox catchCheckBox = new LabeledCheckBox(statusBar);

            catchCheckBox.Text          = "Intercept and log exceptions";
            catchCheckBox.Dock          = Pos.Right;
            catchCheckBox.CheckChanged += (s, e) => interceptExceptions = catchCheckBox.IsChecked;
            catchCheckBox.IsChecked     = true;

            Base genBase = new Base(dock);

            dock.RightDock.TabControl.AddPage("NavMesh Generation", genBase);

            Button generateButton = new Button(genBase);

            generateButton.Text      = "Generate!";
            generateButton.Height    = 30;
            generateButton.Dock      = Pos.Top;
            generateButton.Released += (s, e) => GenerateNavMesh();

            Base clientBase = new Base(dock);

            dock.RightDock.TabControl.AddPage("Game Loading", clientBase);

            TextBox clientInput = new TextBox(clientBase);

            clientInput.Text   = @"C:\Dark Age of Camelot1118L";
            clientInput.Height = 30;
            clientInput.Dock   = Pos.Top;

            Button clientButton = new Button(clientBase);

            clientButton.Text      = "Load!";
            clientButton.Height    = 30;
            clientButton.Dock      = Pos.Top;
            clientButton.Released += (s, e) => LoadClient(clientInput.Text);

            GroupBox displaySettings = new GroupBox(genBase);

            displaySettings.Text   = "Display";
            displaySettings.Dock   = Pos.Top;
            displaySettings.Height = 85;

            Base levelCheckBase = new Base(displaySettings);

            levelCheckBase.Dock = Pos.Top;

            Label levelCheckLabel = new Label(levelCheckBase);

            levelCheckLabel.Text = "Level";
            levelCheckLabel.Dock = Pos.Left;

            CheckBox levelCheckBox = new CheckBox(levelCheckBase);

            levelCheckBox.Dock       = Pos.Right;
            levelCheckBox.Checked   += (s, e) => displayLevel = true;
            levelCheckBox.UnChecked += (s, e) => displayLevel = false;
            levelCheckBox.IsChecked  = true;

            levelCheckBase.SizeToChildren();

            Base displayModeBase = new Base(displaySettings);

            displayModeBase.Dock    = Pos.Top;
            displayModeBase.Padding = new Padding(0, 4, 0, 0);

            Label displayModeLabel = new Label(displayModeBase);

            displayModeLabel.Text    = "Generation Step";
            displayModeLabel.Dock    = Pos.Left;
            displayModeLabel.Padding = new Padding(0, 0, 4, 0);

            ComboBox displayModes = new ComboBox(displayModeBase);

            displayModes.Dock = Pos.Top;
            displayModes.AddItem("None", "", DisplayMode.None);
            displayModes.AddItem("Heightfield", "", DisplayMode.Heightfield);
            displayModes.AddItem("Compact Heightfield", "", DisplayMode.CompactHeightfield);
            displayModes.AddItem("Distance Field", "", DisplayMode.DistanceField);
            displayModes.AddItem("Regions", "", DisplayMode.Regions);
            displayModes.AddItem("Contours", "", DisplayMode.Contours);
            displayModes.AddItem("Polygon Mesh", "", DisplayMode.PolyMesh);
            displayModes.AddItem("Polygon Mesh Detail", "", DisplayMode.PolyMeshDetail);
            displayModes.AddItem("NavMesh", "", DisplayMode.NavMesh);
            displayModes.AddItem("Pathfinding", "", DisplayMode.Pathfinding);
            displayModes.ItemSelected += (s, e) => displayMode = (DisplayMode)e.SelectedItem.UserData;

            displayModes.SelectByUserData(DisplayMode.PolyMeshDetail);
            displayModeBase.SizeToChildren();
            displayModeBase.Height += 4;             //accounts for the padding, GWEN.NET should do this


            Base ZoneSelectBase = new Base(displaySettings);

            ZoneSelectBase.Dock    = Pos.Top;
            ZoneSelectBase.Padding = new Padding(0, 4, 0, 0);

            Label ZoneSelect = new Label(ZoneSelectBase);

            ZoneSelect.Text    = "Select Zone";
            ZoneSelect.Dock    = Pos.Left;
            ZoneSelect.Padding = new Padding(0, 0, 4, 0);

            _levelDisplay      = new ComboBox(ZoneSelectBase);
            _levelDisplay.Dock = Pos.Top;
            _levelDisplay.AddItem("--- None ---", "", -1);
            _levelDisplay.SelectByUserData(-1);

            ZoneSelectBase.SizeToChildren();
            ZoneSelectBase.Height += 4;             //accounts for the padding, GWEN.NET should do this


            const int leftMax  = 125;
            const int rightMax = 20;

            GroupBox areaSetting = new GroupBox(genBase);

            areaSetting.Text   = "Area";
            areaSetting.Dock   = Pos.Top;
            areaSetting.Height = 90;

            var   levelTris = new [] { new Triangle3(new Vector3(0, 0, 0), new Vector3(0, 0, 0), new Vector3(0, 0, 0)) };
            BBox3 bounds    = TriangleEnumerable.FromTriangle(levelTris, 0, levelTris.Length).GetBoundingBox();

            Base maxTriSlope    = CreateSliderOption(areaSetting, "Max Tri Slope:", 0.0001f, 3.14f, 3.14f, "N2", leftMax, rightMax, v => areaSettings.MaxTriSlope = v);
            Base minLevelHeight = CreateSliderOption(areaSetting, "Min Height:", bounds.Min.Y, bounds.Max.Y, bounds.Min.Y, "N0", leftMax, rightMax, v => areaSettings.MinLevelHeight = v);
            Base maxLevelHeight = CreateSliderOption(areaSetting, "Max Height:", bounds.Min.Y, bounds.Max.Y, bounds.Max.Y, "N0", leftMax, rightMax, v => areaSettings.MaxLevelHeight = v);

            _levelDisplay.ItemSelected += (s, e) => {
                _levelId = (int)e.SelectedItem.UserData;
                areaSetting.RemoveChild(minLevelHeight, true);
                areaSetting.RemoveChild(maxLevelHeight, true);
                bounds = _level != null ? _level.BoundingBox
                                        : TriangleEnumerable.FromTriangle(new [] { new Triangle3 {
                                                                                       A = new Vector3(0, 0, 0), B = new Vector3(0, 0, 0), C = new Vector3(0, 0, 0)
                                                                                   } }, 0, 1).GetBoundingBox();
                minLevelHeight = CreateSliderOption(areaSetting, "Min Height:", bounds.Min.Y, bounds.Max.Y, bounds.Min.Y, "N0", leftMax, rightMax, v => areaSettings.MinLevelHeight = v);
                maxLevelHeight = CreateSliderOption(areaSetting, "Max Height:", bounds.Min.Y, bounds.Max.Y, bounds.Max.Y, "N0", leftMax, rightMax, v => areaSettings.MaxLevelHeight = v);
            };

            GroupBox rsSettings = new GroupBox(genBase);

            rsSettings.Text   = "Rasterization";
            rsSettings.Dock   = Pos.Top;
            rsSettings.Height = 90;

            Base cellSizeSetting   = CreateSliderOption(rsSettings, "Cell Size:", 0.001f, 2.0f, 0.125f, "N3", leftMax, rightMax, v => settings.CellSize = v);
            Base cellHeightSetting = CreateSliderOption(rsSettings, "Cell Height:", 0.001f, 2f, 0.063f, "N3", leftMax, rightMax, v => settings.CellHeight = v);

            GroupBox agentSettings = new GroupBox(genBase);

            agentSettings.Text   = "Agent";
            agentSettings.Dock   = Pos.Top;
            agentSettings.Height = 115;

            Base maxSlopeSetting  = CreateSliderOption(agentSettings, "Max Climb:", 0.001f, 5.0f, 1.500f, "N3", leftMax, rightMax, v => settings.MaxClimb = v);
            Base maxHeightSetting = CreateSliderOption(agentSettings, "Height:", 0.001f, 2.0f, 0.250f, "N3", leftMax, rightMax, v => { settings.AgentHeight = v; agentCylinder.Height = v; });
            Base erodeRadius      = CreateSliderOption(agentSettings, "Radius:", 0.001f, 1.0f, 0.125f, "N3", leftMax, rightMax, v => { settings.AgentRadius = v; agentCylinder.Radius = v; });
            Base addRemoveAgent   = CreateAddRemoveButton(agentSettings, "Count", leftMax, rightMax, 0, MAX_AGENTS, () => { numActiveAgents++; GenerateCrowd(); }, () => { numActiveAgents--; GenerateCrowd(); });

            GroupBox regionSettings = new GroupBox(genBase);

            regionSettings.Text   = "Region";
            regionSettings.Dock   = Pos.Top;
            regionSettings.Height = 65;

            Base minRegionSize = CreateSliderOption(regionSettings, "Min Region Size:", 0f, 150f, 8f, "N0", leftMax, rightMax, v => settings.MinRegionSize = (int)Math.Round(v));
            Base mrgRegionSize = CreateSliderOption(regionSettings, "Merged Region Size:", 0f, 150f, 20f, "N0", leftMax, rightMax, v => settings.MergedRegionSize = (int)Math.Round(v));

            GroupBox navMeshSettings = new GroupBox(genBase);

            navMeshSettings.Text   = "NavMesh";
            navMeshSettings.Dock   = Pos.Top;
            navMeshSettings.Height = 90;

            Base maxEdgeLength = CreateSliderOption(navMeshSettings, "Max Edge Length:", 0f, 50f, 12f, "N0", leftMax, rightMax, v => settings.MaxEdgeLength = (int)Math.Round(v));
            Base maxEdgeErr    = CreateSliderOption(navMeshSettings, "Max Edge Error:", 0f, 3f, 1.8f, "N1", leftMax, rightMax, v => settings.MaxEdgeError = v);
            Base vertsPerPoly  = CreateSliderOption(navMeshSettings, "Verts Per Poly:", 3f, 12f, 6f, "N0", leftMax, rightMax, v => settings.VertsPerPoly = (int)Math.Round(v));

            GroupBox navMeshDetailSettings = new GroupBox(genBase);

            navMeshDetailSettings.Text   = "NavMeshDetail";
            navMeshDetailSettings.Dock   = Pos.Top;
            navMeshDetailSettings.Height = 65;

            Base sampleDistance = CreateSliderOption(navMeshDetailSettings, "Sample Distance:", 0f, 16f, 6f, "N0", leftMax, rightMax, v => settings.SampleDistance = (int)Math.Round(v));
            Base maxSampleError = CreateSliderOption(navMeshDetailSettings, "Max Sample Error:", 0f, 16f, 1f, "N0", leftMax, rightMax, v => settings.MaxSampleError = (int)Math.Round(v));

            Base logBase = new Base(dock);

            dock.BottomDock.TabControl.AddPage("Log", logBase);

            ListBox logBox = new ListBox(logBase);

            logBox.Dock             = Pos.Fill;
            logBox.AllowMultiSelect = false;
            logBox.EnableScroll(true, true);
            Console.SetOut(new GwenTextWriter(logBox));
        }