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;
      }
    }
示例#2
0
    private List<ObjRef> ssget_point(RhinoDoc doc, RhinoView view, Point3d point)
    {
      var world_to_screen = view.ActiveViewport.GetTransform(CoordinateSystem.World, CoordinateSystem.Screen);
      point.Transform(world_to_screen);

      var pick_context = new PickContext();
      pick_context.View = view;
      pick_context.PickStyle = PickStyle.PointPick;
      pick_context.PickGroupsEnabled = true;

      var xform = view.ActiveViewport.GetPickTransform(Convert.ToInt32(point.X), Convert.ToInt32(point.Y));
      pick_context.SetPickTransform(xform);
      double depth, distance;

      foreach (var rhino_object in doc.Objects)
      {
        //rhino_object.OnPicked(pick_context, )
      }
      if (pick_context.PickFrustumTest(point, out depth, out distance))
        pick_context.UpdateClippingPlanes();
      return null;
    }