Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developer:sdksamples:customgripselection [2015/09/14]
127.0.0.1 external edit
developer:sdksamples:customgripselection [2016/02/04] (current)
sandy
Line 1: Line 1:
 ====== Custom Picking of Grip Objects ====== ====== Custom Picking of Grip Objects ======
 > **Developer:​** //​[[developer:​cplusplusplugins|C++]]//​ > **Developer:​** //​[[developer:​cplusplusplugins|C++]]//​
-> **Summary:​** //Discusses how to write a custom grip object picker.//+> **Summary:​** //Discusses how to write a custom grip object picker//
  
 ===== Question ===== ===== Question =====
-I have just spent considerable ​amount of time trying to get the following to work:+I have just spent considerable time trying to get the following to work:
  
   - Derive a class from **CRhinoGetObject**.   - Derive a class from **CRhinoGetObject**.
   - Override **CRhinoGetObject::​CustomGeometryFilter**.   - Override **CRhinoGetObject::​CustomGeometryFilter**.
  
-What I want is that only grips at the boundary of a mesh are selectable. I have methods to do thisI just need to get a pointer to a grip object inside **CRhinoGetObject::​CustomGeometryFilter**. ​What I have found is that if I do+I want only grips at the boundary of a mesh to be selectable. I have methods to do thisI just need to get a pointer to a grip object inside **CRhinoGetObject::​CustomGeometryFilter**. ​If I do:
  
 <code c++> <code c++>
Line 16: Line 16:
 </​code>​ </​code>​
  
-then my **CRhinoGetObject::​CustomGeometryFilter** override is not even called anymore. ​On the other hand, if I do not specify a **CRhinoGetObject::​SetGeometryFilter** up front, the function is called but I don't get any grip object from the geometry parameter of **CRhinoGetObject::​CustomGeometryFilter**.+my **CRhinoGetObject::​CustomGeometryFilter** override is not even called anymore. ​If I do not specify a **CRhinoGetObject::​SetGeometryFilter** up front, the function is called but I don't get any grip object from the geometry parameter of **CRhinoGetObject::​CustomGeometryFilter**.
  
 Is there a way around this problem? Is there a way around this problem?
  
 ===== Answer ===== ===== Answer =====
-In order to pick grip objectsusing **CRhinoGetObject**you must set the **CRhinoGetObject::​grip_object** geometry filter. If not, then Rhino will ignore grips in an effort to improve picking performance.+To pick grip objects using **CRhinoGetObject** you must set the **CRhinoGetObject::​grip_object** geometry filter. If not, then Rhino will ignore grips in an effort to improve picking performance.
  
 Also, if you want your **CRhinoGetObject::​CustomGeometryFilter** override to be called, make sure to call **CRhinoGetObject::​EnableSubObjectSelect** to disable subobject picking. For example: Also, if you want your **CRhinoGetObject::​CustomGeometryFilter** override to be called, make sure to call **CRhinoGetObject::​EnableSubObjectSelect** to disable subobject picking. For example:
Line 36: Line 36:
 </​code>​ </​code>​
  
-Regarding ​the picking of grips at the boundary of a mesh, here is a sample class that you can use.+For the picking of grips at the boundary of a mesh, here is a sample class that you can use.
  
 <code c++> <code c++>
developer/sdksamples/customgripselection.txt ยท Last modified: 2016/02/04 by sandy