[C++] Dragging a grip without calling NewObject()?


I need to move a grip indirectly through an MFC slider. I’ve followed @dale’s SampleMoveGrips to do this.
The problem is that it calls CRhinoObjectGrips::NewObject() for every event of the slider being dragged, while CRhinoObjectGrips::Draw() is never called.

I’d like to have this mechanism:

  • Slider being dragged: CRhinoObjectGrips::Draw() is called every time. No CRhinoObjectGrips::NewObject(), no data added to Rhino’s undo stack.
  • Slider dropped: CRhinoObjectGrips::NewObject() is called once. This final configuration is stored in Rhino’s undo stack.

My reasons to do this are memory related: handling pretty big meshes through custom grips, I cannot store undo data when dragging UI controls except once dropped. Also, triggering CRhinoObjectGrips::Draw() would be great.

Any idea on this? There’s CRhinoGripObject::DragGrips() but it calls CRhinoGripObject::MoveGrips() which does what I referred in the above sample.

I know display conduits might be a solution but I want to know if it’s possible through grips (because of their tremendous capabilities like selecting grips, transforms, etc).

Thank you very much,

Hi @Pablo_Garcia-Amorena,

Take a look at the CRhinoXformObjectList class, as it will handle all of the grip updating and dynamic feedback for you.

cmdTestPablo.cpp (3.9 KB)

– Dale

Thank you @dale, very helpful!