In my plugin, there would be several curves created initially. Those curves are really close to the faces of a mesh object.
For some reason, these curves need to be edited by user in my plugin. So I would like to do custom curve snapping function(curves snap to mesh) during user editing those curves.
In this picture, once I do MouseDown on a point on curve, this message shows, 1 curve edit point added to selection.
If I start to drag the point, this message shows as command prompt, Drag objects, tap Alt to make a duplicate, press and hold Alt to temporarily toggle osnaps.
Once I release the point, the message, Drag objects, tap Alt to make a duplicate, press and hold Alt to temporarily toggle osnaps, shows as history message.
Here is my question:
Those 3 actions above seem to be triggered by mouse event, could you tell me where can I find it in C++ SDK? and how to use it to reach my goal?
Without thinking too hard about this, you can probably this with a custom CRhinoGetPoint class. To capture the Alt key, you might need a Windows keyboard hook. You could also just call GetKeyState in a CRhinoGetPoint::OnMouseMove override.
I found that once I call CRhinoGetPoint class, there is always a Pick a point, waiting for an input.
But I need this function only when user is editing the curve’s edit point.
Here is my further question: Is it possible to add a toggle to my custom class and the toggle trigger is the curve edit point is selected?
I’m new to Rhino C++ plugin development.
Could you give me simple sample if the answer of my question is Yes?
Thank you for considering my request.
I referenced your sample of CRhinoMouseCallback Class and made my custom MouseCallback class.
In my custom OnMouseDown function, I get the selected edit point of the curve by GetGrips() and IsSelected().
In my custom OnMouseMove function, if there is a grip object be selected, that means the edit point is dragged. So I keep doing DragCount += 1; .
In my custom OnMouseUp function, I check if a grip object be selected and DragCount > 5.
If true, I will create my new curve with my new edit point(after custom snapping) and delete the old one.