Exemplo n.º 1
0
        public void SelectPartition(Coordinates c)
        {
            if (this.Partition != null)
            {
                this.Partition.selected = SelectionType.NotSelected;
                this.Partition          = null;
            }

            this.tmpPolyCoords = new List <Coordinates>();

            HitTestResult htr = this.Display.HitTest(c, this.PartitionFilter);

            if (htr.Hit)
            {
                ArbiterLanePartition tmpPartition = (ArbiterLanePartition)htr.DisplayObject;

                if (tmpPartition.Lane.RelativelyInside(c))
                {
                    this.Partition          = (ArbiterLanePartition)htr.DisplayObject;
                    this.Partition.selected = SelectionType.SingleSelected;
                    this.Mode = SparseToolboxMode.None;
                    this.ResetButtons();

                    if (this.Partition.SparsePolygon == null)
                    {
                        this.Partition.SetDefaultSparsePolygon();
                    }
                }
            }

            this.Display.Invalidate();
        }
Exemplo n.º 2
0
 public SparsePartitionToolbox(Editor editor, RoadDisplay display)
 {
     InitializeComponent();
     this.Mode    = SparseToolboxMode.None;
     this.Editor  = editor;
     this.Display = display;
 }
Exemplo n.º 3
0
 private void sparsetoolboxWrapPolygonButton_Click(object sender, EventArgs e)
 {
     if (this.sparsetoolboxWrapPolygonButton.CheckState == CheckState.Checked)
     {
         this.sparseToolboxSelectPartition.CheckState = CheckState.Unchecked;
         this.Mode = SparseToolboxMode.Polygon;
     }
     else
     {
         this.Mode = SparseToolboxMode.None;
     }
 }