Ejemplo n.º 1
0
    protected override void OnMouseDown(GetPointMouseEventArgs e)
    {
      base.OnMouseDown(e);
      var picker = new PickContext();
      picker.View = e.Viewport.ParentView;

      picker.PickStyle = PickStyle.PointPick;

      var xform = e.Viewport.GetPickTransform(e.WindowPoint);
      picker.SetPickTransform(xform);

      foreach (var cp in m_conduit_points)
      {
        double depth;
        double distance;
        if (picker.PickFrustumTest(cp.Point, out depth, out distance))
          cp.Color = System.Drawing.Color.Red;
        else
          cp.Color = System.Drawing.Color.White;
      }
    }
Ejemplo n.º 2
0
 /// <summary>Default calls the MouseDown event.</summary>
 /// <param name="e">Current argument for the event.</param>
 protected virtual void OnMouseDown(GetPointMouseEventArgs e)
 {
   if (MouseDown != null)
     MouseDown(this, e);
 }
Ejemplo n.º 3
0
 /// <summary>Calls the <see cref="MouseMove"/> event and can/should be called by overriding implementation.</summary>
 /// <param name="e">Current argument for the event.</param>
 protected virtual void OnMouseMove(GetPointMouseEventArgs e)
 {
   if (MouseMove != null)
     MouseMove(this, e);
 }
Ejemplo n.º 4
0
 private static void CustomMouseCallback(IntPtr pRhinoViewport, uint flags, Point3d point, System.Drawing.Point viewWndPoint, int move)
 {
   if (null == m_active_gp)
     return;
   try
   {
     GetPointMouseEventArgs e = new GetPointMouseEventArgs(m_active_gp, pRhinoViewport, flags, point, viewWndPoint);
     bool callMove = (move != 0);
     if (callMove)
       m_active_gp.OnMouseMove(e);
     else
       m_active_gp.OnMouseDown(e);
   }
   catch (Exception ex)
   {
     Runtime.HostUtils.ExceptionReport(ex);
   }
 }
Ejemplo n.º 5
0
 private void Getter_MouseMove(object sender, GetPointMouseEventArgs e)
 {
     _plane = AlignX(_original, e.Point);
 }
Ejemplo n.º 6
0
 private void LocalMouseMove(object sender, GetPointMouseEventArgs e)
 {
     _plane = AlignY(_original, e.Point);
 }
Ejemplo n.º 7
0
 private void LocalMouseMove(object sender, GetPointMouseEventArgs e)
 {
     _plane = e.Viewport.ConstructionPlane();
     _plane.Origin = e.Point;
 }