// Render selection public override void PlotSelection(IRenderer2D renderer, FindReplaceObject[] selection) { foreach (FindReplaceObject o in selection) { if (o.Object is Linedef) { renderer.PlotLinedef(o.Linedef, General.Colors.Selection); } else if (o.Object is Sidedef) { renderer.PlotLinedef(o.Sidedef.Line, General.Colors.Selection); } else if (o.Object is Sector) { foreach (Sidedef sd in o.Sector.Sidedefs) { renderer.PlotLinedef(sd.Line, General.Colors.Selection); } } else if (o.Object is Thing) { renderer.RenderThing(o.Thing, General.Colors.Selection, General.Settings.ActiveThingsAlpha); } else if (o.Object is Vertex) { renderer.PlotVertex(o.Vertex, ColorCollection.SELECTION); } } }
// Rendering public override void PlotSelection(IRenderer2D renderer) { renderer.PlotLinedef(line1, General.Colors.Selection); renderer.PlotLinedef(line2, General.Colors.Selection); renderer.PlotVertex(line1.Start, ColorCollection.VERTICES); renderer.PlotVertex(line1.End, ColorCollection.VERTICES); renderer.PlotVertex(line2.Start, ColorCollection.VERTICES); renderer.PlotVertex(line2.End, ColorCollection.VERTICES); }
// This renders the associated sectors/linedefs with the indication color public void PlotAssociations(IRenderer2D renderer, Association asso) { // Tag must be above zero if (asso.tag <= 0) { return; } // Sectors? if (asso.type == UniversalType.SectorTag) { foreach (Sector s in General.Map.Map.Sectors) { if (s.Tag == asso.tag) { renderer.PlotSector(s, General.Colors.Indication); } } } // Linedefs? else if (asso.type == UniversalType.LinedefTag) { foreach (Linedef l in General.Map.Map.Linedefs) { if (l.Tag == asso.tag) { renderer.PlotLinedef(l, General.Colors.Indication); } } } else if (General.Map.Config.UDMF && asso.type == UniversalType.PortalTag) { foreach (Linedef l in General.Map.Map.Linedefs) { if (l.Fields.ContainsKey("portal") && l.Fields["portal"].Type == (int)UniversalType.PortalTag && Math.Abs((int)l.Fields["portal"].Value) == asso.tag) { renderer.PlotLinedef(l, General.Colors.Portals); } } foreach (Sector s in General.Map.Map.Sectors) { if ((s.Fields.ContainsKey("portalfloor") && s.Fields["portalfloor"].Type == (int)UniversalType.PortalTag && Math.Abs((int)s.Fields["portalfloor"].Value) == asso.tag) || (s.Fields.ContainsKey("portalceiling") && s.Fields["portalceiling"].Type == (int)UniversalType.PortalTag && Math.Abs((int)s.Fields["portalceiling"].Value) == asso.tag)) { renderer.PlotSector(s, General.Colors.Portals); } } } } // plotassociations
// This renders the associated sectors/linedefs with the indication color public static void PlotReverseAssociations(IRenderer2D renderer, Association asso, List <Line3D> eventlines) { // Tag must be above zero if (General.GetByIndex(asso.Tags, 0) < 1) { return; } // Doom style referencing to sectors? if (General.Map.Config.LineTagIndicatesSectors && (asso.Type == UniversalType.SectorTag)) { // Linedefs foreach (Linedef l in General.Map.Map.Linedefs) { // Any action on this line? if (l.Action <= 0 || !asso.Tags.Overlaps(l.Tags)) { continue; } renderer.PlotLinedef(l, General.Colors.Indication); if (General.Settings.GZShowEventLines) { eventlines.Add(new Line3D(l.GetCenterPoint(), asso.Center)); //mxd } } } // Linedefs foreach (Linedef l in General.Map.Map.Linedefs) { // Known action on this line? if ((l.Action > 0) && General.Map.Config.LinedefActions.ContainsKey(l.Action)) { LinedefActionInfo action = General.Map.Config.LinedefActions[l.Action]; if (((action.Args[0].Type == (int)asso.Type) && (asso.Tags.Contains(l.Args[0]))) || ((action.Args[1].Type == (int)asso.Type) && (asso.Tags.Contains(l.Args[1]))) || ((action.Args[2].Type == (int)asso.Type) && (asso.Tags.Contains(l.Args[2]))) || ((action.Args[3].Type == (int)asso.Type) && (asso.Tags.Contains(l.Args[3]))) || ((action.Args[4].Type == (int)asso.Type) && (asso.Tags.Contains(l.Args[4])))) { renderer.PlotLinedef(l, General.Colors.Indication); if (General.Settings.GZShowEventLines) { eventlines.Add(new Line3D(l.GetCenterPoint(), asso.Center)); //mxd } } } } }
// This renders the associated sectors/linedefs with the indication color public void PlotAssociations(IRenderer2D renderer, Association asso) { // Tag must be above zero if (asso.tag <= 0) { return; } // Sectors? if (asso.type == UniversalType.SectorTag) { foreach (Sector s in General.Map.Map.Sectors) { if (s.Tag == asso.tag) { renderer.PlotSector(s, General.Colors.Indication); } } } // Linedefs? else if (asso.type == UniversalType.LinedefTag) { foreach (Linedef l in General.Map.Map.Linedefs) { if (l.Tag == asso.tag) { renderer.PlotLinedef(l, General.Colors.Indication); } } } }
// Render selection public override void PlotSelection(IRenderer2D renderer, FindReplaceObject[] selection) { foreach (FindReplaceObject o in selection) { renderer.PlotLinedef(o.Sidedef.Line, General.Colors.Selection); } }
// Render selection public override void PlotSelection(IRenderer2D renderer, FindReplaceObject[] selection) { foreach (FindReplaceObject o in selection) { if (o.Object is Sector) { foreach (Sidedef sd in o.Sector.Sidedefs) { renderer.PlotLinedef(sd.Line, General.Colors.Selection); } } else if (o.Object is Sidedef) { renderer.PlotLinedef(o.Sidedef.Line, General.Colors.Selection); } } }
// Rendering public override void PlotSelection(IRenderer2D renderer) { renderer.PlotLinedef(line, General.Colors.Selection); renderer.PlotVertex(line.Start, ColorCollection.VERTICES); renderer.PlotVertex(line.End, ColorCollection.VERTICES); renderer.PlotVertex(vertex, ColorCollection.SELECTION); }
// Rendering public override void PlotSelection(IRenderer2D renderer) { foreach (Linedef l in lines) { renderer.PlotLinedef(l, General.Colors.Selection); renderer.PlotVertex(l.Start, ColorCollection.VERTICES); renderer.PlotVertex(l.End, ColorCollection.VERTICES); } }
/// <summary> /// Plots associated linedefs and sectors /// </summary> public void Plot() { foreach (Linedef ld in linedefs) { renderer.PlotLinedef(ld, General.Colors.Indication); } foreach (Sector s in sectors) { renderer.PlotSector(s, General.Colors.Indication); } }
// This renders the associated sectors/linedefs with the indication color public void PlotReverseAssociations(IRenderer2D renderer, Association asso) { // Tag must be above zero if (asso.tag <= 0) { return; } // Doom style referencing to sectors? if (General.Map.Config.LineTagIndicatesSectors && (asso.type == UniversalType.SectorTag)) { // Linedefs foreach (Linedef l in General.Map.Map.Linedefs) { // Any action on this line? if (l.Action > 0) { if (l.Tag == asso.tag) { renderer.PlotLinedef(l, General.Colors.Indication); } } } } else { // Linedefs foreach (Linedef l in General.Map.Map.Linedefs) { // Known action on this line? if ((l.Action > 0) && General.Map.Config.LinedefActions.ContainsKey(l.Action)) { LinedefActionInfo action = General.Map.Config.LinedefActions[l.Action]; if ((action.Args[0].Type == (int)asso.type) && (l.Args[0] == asso.tag)) { renderer.PlotLinedef(l, General.Colors.Indication); } if ((action.Args[1].Type == (int)asso.type) && (l.Args[1] == asso.tag)) { renderer.PlotLinedef(l, General.Colors.Indication); } if ((action.Args[2].Type == (int)asso.type) && (l.Args[2] == asso.tag)) { renderer.PlotLinedef(l, General.Colors.Indication); } if ((action.Args[3].Type == (int)asso.type) && (l.Args[3] == asso.tag)) { renderer.PlotLinedef(l, General.Colors.Indication); } if ((action.Args[4].Type == (int)asso.type) && (l.Args[4] == asso.tag)) { renderer.PlotLinedef(l, General.Colors.Indication); } } } } }
// This renders the associated sectors/linedefs with the indication color public static void PlotAssociations(IRenderer2D renderer, Association asso, List <Line3D> eventlines) { // Tag must be above zero if (General.GetByIndex(asso.Tags, 0) < 1) { return; } // Sectors? switch (asso.Type) { case UniversalType.SectorTag: { foreach (Sector s in General.Map.Map.Sectors) { if (!asso.Tags.Overlaps(s.Tags)) { continue; } renderer.PlotSector(s, General.Colors.Indication); if (!General.Settings.GZShowEventLines) { continue; } Vector2D end = (s.Labels.Count > 0 ? s.Labels[0].position : new Vector2D(s.BBox.X + s.BBox.Width / 2, s.BBox.Y + s.BBox.Height / 2)); eventlines.Add(new Line3D(asso.Center, end)); //mxd } break; } case UniversalType.LinedefTag: { foreach (Linedef l in General.Map.Map.Linedefs) { if (!asso.Tags.Overlaps(l.Tags)) { continue; } renderer.PlotLinedef(l, General.Colors.Indication); if (General.Settings.GZShowEventLines) { eventlines.Add(new Line3D(asso.Center, l.GetCenterPoint())); //mxd } } break; } } }
// Rendering public override void PlotSelection(IRenderer2D renderer) { renderer.PlotLinedef(line, General.Colors.Selection); renderer.PlotVertex(line.Start, EditorColor.VERTICES); renderer.PlotVertex(line.End, EditorColor.VERTICES); }