[C++ SDK] Custom grip shapes


(Menno Deij - van Rijswijk) #1

Hi,

I’m quite new to the C++ SDK, but coming from RhinoCommon it feels familiar, only with way more possibilities. What I currently have implemented is custom grips for a surface object. I can select them, drag them, and after dragging the geometry is updated. In the
CRhinoGripObjects::Draw routine I can override and draw additional stuff in the scene. Also, I can selectively show or not show certain grips. This works very nicely and goes a long way towards what I’d like to achieve.

The grips themselves, however, are the default square shapes, as seen everywhere in Rhino. I am wondering if it would be possible to draw my own shape. For example a circle, a diamond or some other grip shape.

If that is possible, please let me know which functions to override on either my derived CRhinoGripObjects or CRhinoGripObject class.

Thanks!


#2

Could these things be resources, i.e. cursors or icons? (Just posing a possibility while you’re waiting for an authoritative answer.)


(Menno Deij - van Rijswijk) #3

I don’t know if they can be resources or that I can draw them my self somehow using draw instructions.


#4

Poor choice of wording on my part. I was suggesting that maybe they ARE cursors or icons in Rhino code and might be accessible as such.


(Steve Baer) #5

They are definitely not cursors or other types of resources and are drawn with our standard display code. I haven’t figured out if there is a way to customize this look yet.


(Menno Deij - van Rijswijk) #6

There is a test command that makes the shapes circular (“testToggleRoundPoint” or something along that line). That seems to suggest it is possible?


(Steve Baer) #7

Not really. TestToggleRoundPoints just turns on AA for points in OpenGL. Typical OpenGL drivers make points round when AA is enabled for them.


(Menno Deij - van Rijswijk) #8

Ah, I had no idea that was what it did.