Exemplo n.º 1
0
 protected override void OnMouseMove(MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         bool locked1 = CanvasViewport.settings.GetValue("locked1", false);
         if (!locked1)
         {
             var vec = new Rhino.Geometry.Vector2d(e.X - RightMouseDownLocation.X, e.Y - RightMouseDownLocation.Y);
             if (vec.Length > 10)
             {
                 RightMouseDownLocation = System.Drawing.Point.Empty;
             }
             base.OnMouseMove(e);
         }
     }
     else
     {
         bool locked2 = CanvasViewport.settings.GetValue("locked2", false);
         if (!locked2)
         {
             RightMouseDownLocation = System.Drawing.Point.Empty;
             base.OnMouseMove(e);
         }
     }
 }
Exemplo n.º 2
0
 protected override void OnMouseUp(MouseEventArgs e)
 {
     base.OnMouseUp(e);
     if (e.Button == MouseButtons.Right)
     {
         var vec = new Rhino.Geometry.Vector2d(e.X - RightMouseDownLocation.X, e.Y - RightMouseDownLocation.Y);
         if (vec.Length < 10)
         {
             ShowContextMenu(e.Location);
         }
     }
     RightMouseDownLocation = System.Drawing.Point.Empty;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Returns a Windows Point from a Rhino.Geometry.Vector2d
 /// </summary>
 /// <param name="input">Rhinocommon Vector2d</param>
 /// <returns>System Windows Vector</returns>
 public static Sw.Vector ToWindowsVector(this Rg.Vector2d input)
 {
     return(new Sw.Vector(input.X, input.Y));
 }