// Mode engages
        public override void OnEngage()
        {
            base.OnEngage();

            // Nothing highlighted
            highlighted = null;
            hx          = -1;
            hy          = -1;

            // Custom presentation to hide the grid
            CustomPresentation p = new CustomPresentation();

            p.AddLayer(new PresentLayer(RendererLayer.Background, BlendingMode.Mask, General.Settings.BackgroundAlpha));
            p.AddLayer(new PresentLayer(RendererLayer.Surface, BlendingMode.Mask));
            p.AddLayer(new PresentLayer(RendererLayer.Overlay, BlendingMode.Alpha, 1f, true));
            p.AddLayer(new PresentLayer(RendererLayer.Things, BlendingMode.Alpha, 1.0f));
            p.AddLayer(new PresentLayer(RendererLayer.Geometry, BlendingMode.Alpha, 1f, true));
            renderer.SetPresentation(p);

            // Make the blockmap
            RectangleF area = MapSet.CreateArea(General.Map.Map.Vertices);

            area     = MapSet.IncreaseArea(area, General.Map.Map.Things);
            blockmap = new BlockMap <BlockEntry>(area);
            blockmap.AddLinedefsSet(General.Map.Map.Linedefs);
            blockmap.AddSectorsSet(General.Map.Map.Sectors);
            blockmap.AddThingsSet(General.Map.Map.Things);
        }
Example #2
0
        /// <summary>
        /// Create a blockmap containing linedefs. This is used to speed up determining the closest line
        /// to the mouse cursor
        /// </summary>
        private void CreateBlockmap()
        {
            RectangleF area = MapSet.CreateArea(General.Map.Map.Vertices);

            blockmap = new BlockMap <BlockEntry>(area);
            blockmap.AddLinedefsSet(General.Map.Map.Linedefs);
        }
        // This starts checking
        private void StartChecking()
        {
            if (running)
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;

            // Make blockmap
            RectangleF area = MapSet.CreateArea(General.Map.Map.Vertices);

            area     = MapSet.IncreaseArea(area, General.Map.Map.Things);
            blockmap = new BlockMap <BlockEntry>(area);
            blockmap.AddLinedefsSet(General.Map.Map.Linedefs);
            blockmap.AddSectorsSet(General.Map.Map.Sectors);
            blockmap.AddThingsSet(General.Map.Map.Things);
            blockmap.AddVerticesSet(General.Map.Map.Vertices);             //mxd

            //mxd. Open the results panel
            if (!resultspanel.Visible)
            {
                this.MinimumSize     = new Size();
                this.MaximumSize     = new Size();
                this.Size            = initialsize;
                resultspanel.Size    = new Size(resultspanel.Width, this.ClientSize.Height - resultspanel.Top);
                resultspanel.Visible = true;
            }
            progress.Value = 0;
            results.Items.Clear();
            results.Enabled = true;
            resultslist     = new List <ErrorResult>();        //mxd
            ClearSelectedResult();
            buttoncheck.Text = "Abort Analysis";
            General.Interface.RedrawDisplay();

            // Start checking
            running               = true;
            checksthread          = new Thread(RunChecks);
            checksthread.Name     = "Error Checking Management";
            checksthread.Priority = ThreadPriority.Normal;
            checksthread.Start();

            Cursor.Current = Cursors.Default;
        }