Example #1
0
        public override void OnPrimaryMouseClicked(Event e)
        {
            if (!IsHoverPoint)
            {
                return;
            }

            if (!IsSelectPoint)
            {
                base.OnPrimaryMouseClicked(e);
            }
            else
            {
                var pointPair = new MarkupPointPair(SelectPoint, HoverPoint);

                if (Tool.Markup.TryGetLine(pointPair, out MarkupLine line))
                {
                    Tool.DeleteItem(line, () =>
                    {
                        Tool.Markup.RemoveLine(line);
                        Panel.UpdatePanel();
                    });
                }
                else
                {
                    var newCrosswalkLine = Tool.Markup.AddLine(pointPair, NodeMarkupTool.GetStyle(CrosswalkStyle.CrosswalkType.Zebra)) as MarkupCrosswalkLine;
                    Panel.EditCrosswalk(newCrosswalkLine?.Crosswalk);
                }

                SelectPoint = null;
                SetTarget();
            }
        }
Example #2
0
        public override void OnPrimaryMouseClicked(Event e)
        {
            if (!IsHoverPoint)
            {
                return;
            }

            if (!IsSelectPoint)
            {
                base.OnPrimaryMouseClicked(e);
            }
            else
            {
                var pointPair = new MarkupPointPair(SelectPoint, HoverPoint);

                if (Tool.Markup.TryGetLine(pointPair, out MarkupLine line))
                {
                    Tool.DeleteItem(line, () =>
                    {
                        Tool.Markup.RemoveLine(line);
                        Panel.UpdatePanel();
                    });
                }
                else
                {
                    var lineType = pointPair.IsStopLine ? NodeMarkupTool.GetStyle(StopLineStyle.StopLineType.Solid) : NodeMarkupTool.GetStyle(RegularLineStyle.RegularLineType.Dashed);
                    var newLine  = Tool.Markup.AddLine(pointPair, lineType);
                    Panel.EditLine(newLine);
                }

                SelectPoint = null;
                SetTarget();
            }
        }
Example #3
0
 public override void OnPrimaryMouseClicked(Event e)
 {
     if (IsHover)
     {
         if (Contour.Add(Hover))
         {
             var filler = new MarkupFiller(Contour, NodeMarkupTool.GetStyle(FillerStyle.FillerType.Stripe));
             Tool.Markup.AddFiller(filler);
             Panel.EditFiller(filler);
             Tool.SetDefaultMode();
             return;
         }
         DisableByAlt = false;
         GetFillerPoints();
     }
 }