Exemple #1
0
        // 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
Exemple #2
0
        // 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);
                    }
                }
            }
        }
 // Rendering
 public override void PlotSelection(IRenderer2D renderer)
 {
     renderer.PlotSector(sector, General.Colors.Selection);
     foreach (Vertex v in vertices)
     {
         renderer.PlotVertex(v, ColorCollection.SELECTION);
     }
 }
        /// <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);
            }
        }
Exemple #5
0
        // 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;
            }
            }
        }
Exemple #6
0
 // Rendering
 public override void PlotSelection(IRenderer2D renderer)
 {
     renderer.PlotSector(sector, General.Colors.Selection);
 }