private BlockMap <BlockEntry> CreateBlockmap(bool ignorecontrolsectors) { // Make blockmap RectangleF area = MapSet.CreateArea(General.Map.Map.Vertices); area = MapSet.IncreaseArea(area, new Vector2D(outerleft, outertop)); area = MapSet.IncreaseArea(area, new Vector2D(outerright, outerbottom)); area = AlignAreaToGrid(area); BlockMap <BlockEntry> blockmap = new BlockMap <BlockEntry>(area, (int)gridsize); if (ignorecontrolsectors) { foreach (Sector s in General.Map.Map.Sectors) { // Managed control sectors have the custom UDMF field "user_managed_3d_floor" set to true // So if the field is NOT set, add the sector to the blockmap if (s.Fields.GetValue("user_managed_3d_floor", false) == false) { blockmap.AddSector(s); } } } else { blockmap.AddSectorsSet(General.Map.Map.Sectors); } return(blockmap); }
// 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); }
private BlockMap <BlockEntry> CreateBlockmap(bool ignorecontrolsectors) { // Make blockmap RectangleF area = MapSet.CreateArea(General.Map.Map.Vertices); area = MapSet.IncreaseArea(area, new Vector2D(outerleft, outertop)); area = MapSet.IncreaseArea(area, new Vector2D(outerright, outerbottom)); area = AlignAreaToGrid(area); BlockMap <BlockEntry> blockmap = new BlockMap <BlockEntry>(area, (int)gridsize); if (ignorecontrolsectors) { foreach (Sector s in General.Map.Map.Sectors) { // Managed control sectors have the custom UDMF field "user_managed_3d_floor" set to true // So if the field is NOT set, add the sector to the blockmap bool managed = s.Fields.GetValue("user_managed_3d_floor", false); if (managed == false) { blockmap.AddSector(s); } else // When a tag was manually removed a control sector still might have the user_managed_3d_floor field, but not be { // recognized as a 3D floor control sector. In that case also add the sector to the blockmap bool orphaned = true; foreach (ThreeDFloor tdf in ((ThreeDFloorHelperMode)General.Editing.Mode).ThreeDFloors) { if (tdf.Sector == s) { orphaned = false; break; } } if (orphaned) { blockmap.AddSector(s); } } } } else { blockmap.AddSectorsSet(General.Map.Map.Sectors); } return(blockmap); }
// 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; }