Example #1
0
        private void RemoveLine(MarkupLine line)
        {
            foreach (var intersect in GetExistIntersects(line).ToArray())
            {
                if (intersect.Pair.GetOther(line) is MarkupRegularLine regularLine)
                {
                    regularLine.RemoveRules(line);
                }

                LineIntersects.Remove(intersect.Pair);
            }
            foreach (var filler in GetLineFillers(line).ToArray())
            {
                FillersList.Remove(filler);
            }

            if (CrosswalksDictionary.ContainsKey(line))
            {
                CrosswalksDictionary.Remove(line);
            }
            else
            {
                foreach (var crosswalk in GetLinesIsBorder(line))
                {
                    crosswalk.RemoveBorder(line);
                }
            }

            LinesDictionary.Remove(line.PointPair.Hash);
        }
Example #2
0
        public void Update(MarkupLine line, bool recalculate = false)
        {
            line.Update(true);

            foreach (var intersect in GetExistIntersects(line).ToArray())
            {
                LineIntersects.Remove(intersect.Pair);
                intersect.Pair.GetOther(line).Update();
            }

            foreach (var filler in GetLineFillers(line))
            {
                filler.Update();
            }

            foreach (var crosswalk in GetLinesIsBorder(line))
            {
                crosswalk.Update();
            }

            if (recalculate)
            {
                RecalculateDashes();
            }
        }
Example #3
0
        public MarkupLinesIntersect GetIntersect(MarkupLinePair linePair)
        {
            if (!LineIntersects.TryGetValue(linePair, out MarkupLinesIntersect intersect))
            {
                intersect = MarkupLinesIntersect.Calculate(linePair);
                LineIntersects.Add(linePair, intersect);
            }

            return(intersect);
        }
Example #4
0
 public void RecalculateDashes()
 {
     LineIntersects.Clear();
     foreach (var line in Lines)
     {
         line.RecalculateDashes();
     }
     foreach (var filler in Fillers)
     {
         filler.RecalculateDashes();
     }
     NeedRecalculateBatches = true;
 }
Example #5
0
        private void RemoveLine(MarkupLine line)
        {
            foreach (var intersect in GetExistIntersects(line).ToArray())
            {
                intersect.Pair.GetOther(line).RemoveRules(line);
                LineIntersects.Remove(intersect.Pair);
            }
            foreach (var filler in GetLineFillers(line).ToArray())
            {
                FillersList.Remove(filler);
            }

            LinesDictionary.Remove(line.PointPair.Hash);
        }