Rhino C++ API
8.13
|
#include <rhinoSdkGrips.h>
Public Member Functions | |
CRhinoObjectGrips (CRhinoGripObject::GRIP_TYPE grips_type) | |
virtual | ~CRhinoObjectGrips () |
virtual CRhinoObject * | DeleteGrips (ON_SimpleArray< int > &deleted_grips) |
virtual void | Draw (CRhinoDrawGripsSettings &dgs) |
int | GetCaptives (ON_SimpleArray< CRhinoObject * > &captives, bool bWithGripsOn=true) const |
virtual int | GetGripStatus (ON_SimpleArray< CRhinoGripStatus > &grip_status) const |
virtual int | GetNeighborGrips (int grip_index, ON_SimpleArray< CRhinoGripObject * > &neighbor_grips, bool bWrap) const |
virtual bool | HasGripsSelected (bool bCheckAllGrips=false) const |
bool | IsCustom (ON_UUID custom_grips_id) const |
virtual const ON_MorphControl * | MorphControl () const |
virtual CRhinoGripObject * | NeighborGrip (int grip_index, int dr, int ds, int dt, bool bWrap) const |
virtual CRhinoLight * | NewLightObject (bool bCopy) |
virtual CRhinoObject * | NewObject () |
virtual const ON_NurbsCage * | NurbsCage () const |
virtual CRhinoGripObject * | NurbsCageGrip (int cv_i, int cv_j, int cv_k) const |
virtual const ON_NurbsCurve * | NurbsCurve () const |
virtual CRhinoGripObject * | NurbsCurveGrip (int cv_i) const |
virtual const ON_NurbsSurface * | NurbsSurface () const |
virtual CRhinoGripObject * | NurbsSurfaceGrip (int cv_i, int cv_j) const |
virtual void | Reset () |
virtual void | ResetMeshes () |
virtual void | SelectGrips (bool bSelect=true, bool bSynchHighlight=true, bool bPersistentSelect=true) |
bool | SetGripStatus (const ON_SimpleArray< CRhinoGripStatus > &grip_status) |
virtual void | UpdateMesh (ON::mesh_type mesh_type_hint) |
virtual void | UpdateWidgetGeometry () |
Static Public Member Functions | |
static bool | IsCustom (const class CRhinoObjectGrips *grips, ON_UUID custom_grips_id) |
Public Attributes | |
const CRhinoGripObject::GRIP_TYPE | m__grips_type |
Type of grips. More... | |
bool | m_bGripsMoved |
bool | m_bNewLocation |
ON_UuidList | m_captive_object_id |
ON_SimpleArray< CRhinoGripDirections > | m_grip_directions |
Optional list of grip directions. More... | |
ON_SimpleArray< CRhinoGripObject * > | m_grip_list |
List of all the grips. More... | |
ON_UUID | m_grips_id |
CRhinoObject * | m_owner_object |
CRhinoObject owner of the grips. More... | |
Static Public Attributes | |
static const ON_UUID | CustomCurveEditPointGripsId |
static const ON_UUID | CustomSubDEditPointGripsId |
CRhinoObjectGrips::CRhinoObjectGrips | ( | CRhinoGripObject::GRIP_TYPE | grips_type | ) |
|
virtual |
|
virtual |
Description: Rhino calls DeleteGrips() when some of the object's grips are deleted. If the object supports grip deletion, like meshes, then DeleteGrips() should create a new object by deleting the indicated grips. Returns: Pointer to the new object if successful. Rhino will take care of adding this object to the document.
|
virtual |
Description: The default draws the grips. Override if you need to draw dynamic stuff and then call CRhinoObjectGrips::Draw() to draw the grips themselves. Parameters: dgs - [in]
int CRhinoObjectGrips::GetCaptives | ( | ON_SimpleArray< CRhinoObject * > & | captives, |
bool | bWithGripsOn = true |
||
) | const |
Description: Uses the m_captive_object_id[] list to get pointers to captive objects that are in the document. Parameters: captives -[out] Captives are appened to this array. bWithGripsOn - [in] If true, only captives with grips on are appended Returns: Number of objects appended to captives[].
|
virtual |
Description: Appends the status of the grips to the grip_status[] array. Parameters: grip_status - [out] Returns: Number of visible grips.
|
virtual |
Description: Get all adjacent grips. Parameters: grip_index - [in] index of grip where the search begins neighbor_grips - [out] neighbors are appended to this array bWrap - [in] If true and object is "closed", the search will wrap.
Returns: number of grips appended to neighbor_grips[] array.
|
virtual |
Description: Query the selection state of an object's grips. Parameters: bCheckAllGrips - [in] If false, HasGripsSelected() will return true if any grips are selected. If true, HasGripsSelected() will return true if all grips are selected.
Returns: True if all grips are selected or at least one grip is selected and bCheckAllGrips is false.
|
static |
Parameters: grips - [in] custom_grips_id - [in]
Returns: True if grips are custom grips with the specified custom grips id.
bool CRhinoObjectGrips::IsCustom | ( | ON_UUID | custom_grips_id | ) | const |
Parameters: custom_grips_id - [in] Returns: True if this are custom grips with the specified custom grips id.
|
virtual |
Description: If the grips control a morph control, this returns a pointer to that morph controle. You can look at but you must NEVER change this cage. Returns: A pointer to a morph control or NULL.
|
virtual |
Description: Get neighbors. Parameters: grip_index - [in] index of grip where the search begins dr - [in 1 = next grip in the first parameter direction -1 = prev grip in the first parameter direction ds - [in] 1 = next grip in the second parameter direction -1 = prev grip in the second parameter direction dt - [in] 1 = next grip in the third parameter direction -1 = prev grip in the third parameter direction bWrap - [in] If true and object is "closed", the search will wrap.
Returns: Pointer to the desired neighbor or NULL if there is no neighbor
|
virtual |
Description: Rhino calls NewLightObject() when it wants a new light that is calculated from the current grip locations. This happens once at the end of a grip drag. Parameters: bCopy - [in] If true, the light object the grips are on is left in place and a new light is added to the light table. If false, the light object is replaced. Returns: Pointer to the new light if successful. The new light is in the light table.
|
virtual |
Description: If the grips control just one object, then override NewObject(). When NewObject() is called, return an new object calculated from the current grip locations.
This happens once at the end of a grip drag. Returns: NULL or a new object whose shape is calculated from the current grip locations. This object should not be added to the document. Remarks: This function is not used for lights.
|
virtual |
Description: If the grips control a NURBS cage, this returns a pointer to that cage. You can look at but you must NEVER change this cage. Returns: A pointer to a NURBS cage or NULL.
|
virtual |
Description: If the grips are control points of a NURBS cage, then this gets the index of the grip that controls the (i,j,k)-th cv. Parameters: cv_i - [in] cv_j - [in] cv_k - [in] Returns: A grip controlling a NURBS cage CV or NULL.
|
virtual |
Description: If the grips control a NURBS curve, this returns a pointer to that curve. You can look at but you must NEVER change this curve. Returns: A pointer to a NURBS curve or NULL.
|
virtual |
Description: If the grips are control points of a NURBS curve, then this gets the index of the grip that controls the i-th cv. Parameters: cv_i - [in] Returns: A grip controlling a NURBS curve CV or NULL.
|
virtual |
Description: If the grips control a NURBS surface, this returns a pointer to that surface. You can look at but you must NEVER change this surface. Returns: A pointer to a NURBS surface or NULL.
|
virtual |
Description: If the grips are control points of a NURBS surface, then this gets the index of the grip that controls the (i,j)-th cv. Parameters: cv_i - [in] cv_j - [in] Returns: A grip controlling a NURBS surface CV or NULL.
|
virtual |
End custom grips interface Begin all grips virtual function interface All types of grips (built-in and custom) override the following functions. Description: Resets location of all grips to original spots and cleans up stuff that was created by dynamic dragging. This is required when dragging is canceled or in the Copy command when grips are "copied". This function should not destroy the current grips and make new ones because the grips may be in a list someplace (like in the copy command).
The default CRhinoObjectGrips::Reset() takes care of the grip location issues. The override should clean up dynamic workspace stuff and can call CRhinoObjectGrips::Reset() to handle resetting grip locations.
|
virtual |
Description: Just before Rhino turns off object grips, it calls this function. If you have modified any object display information, you must override this function and restore the display information to its original state.
Remarks: This function is poorly named. It harkens back to a simpler time in the late 1990s.
|
virtual |
Description: If an object has grips turned on, SelectGrips() can be used to change the selection state of the object's grips. Parameters: bSelect - [in] true to select, false to unselect bSynchHighlight - [in] if true, highlight state is synchronized with selection state. bPersistentSelect - [in] if true, grips are persitently selected. See Also: CRhinoObject::HasGripsSelected
bool CRhinoObjectGrips::SetGripStatus | ( | const ON_SimpleArray< CRhinoGripStatus > & | grip_status | ) |
End all grips virtual function interface Description: Set grip status. This is useful in commands that replace and copy objects. Parameters: grip_status - [in] Returns: True if status was restored.
|
virtual |
Description: Just before Rhino draws an object with grips on, it calls UpdateMesh() to update display information that will be used in the near future.
If "m_bNewLocation" is true, update your dynamic display information and then set m_bNewLocation to false. If "m_bNewLocation" is false, do nothing.
Parameters: mesh_type_hint - [in] Ideally, design your override so it can ignore this parameter. At best, treat the parameter as a hint for what will occur in the near future.
ON::mesh_type::analysis_mesh The grips parent object is currently in some sort of visual analsis mode (false color curvature, draft, edges, ...) and at some point in the near future the grips parent object and any dynamic display information will be shown. ON::mesh_type::render_mesh At some point in the near future the grips parent object and any dynamic display information will be used in a "shaded" viewport setting. It's common for there to be several viewports in both shaded and wireframe contexts. ON::mesh_type::any_type At some point in the near future the grips parent object and any dynamic display information will be used in a "wireframe" viewport setting. It's common for there to be several viewports in both shaded and wireframe contexts.
Remarks: This function is poorly named and the parameter is not all that useful. Both harken back to a simpler time in the late 1990s.
|
virtual |
Description: Updates the widget geometry based on e.g. grip dragging. Notes: Does not do drawing. See also: CRhinoObjectGrips::Draw()
|
static |
Begin custom grips interface NOTE: Custom grips ids do not have to appear here. They can be hidden in implementation files.
The ids here are for core Rhino grips, like edit points, and are provided so it is easy for 3rd party plug-ins to determine what type of core Rhino grips are enabled. CustomCurveEditPointGripsId makes a grip at every curve Greville point. The EditPtOn command applied to a SubD enables these grips.
|
static |
CustomSubDEditPointGripsId makes a grip for every subd surface point. The EditPtOn command applied to a SubD enables these grips.
const CRhinoGripObject::GRIP_TYPE CRhinoObjectGrips::m__grips_type |
Type of grips.
bool CRhinoObjectGrips::m_bGripsMoved |
If m_bGripsMoved is true if some of the grips have ever been moved CRhinoGripObject::NewLocation() sets m_bGripsMoved=true Nothting else should ever change the value of m_bGripsMoved.
bool CRhinoObjectGrips::m_bNewLocation |
Returns: True if grips are currently begin dragged. true if some of the grips have been moved. CRhinoGripObject::NewLocation() sets m_bNewLocation=true Derived classes can set m_bNewLocation to false after updating temporary display information.
ON_UuidList CRhinoObjectGrips::m_captive_object_id |
Optional list of captive object ids. Use when these object grips deform more than just the owner of these gripss.
ON_SimpleArray<CRhinoGripDirections> CRhinoObjectGrips::m_grip_directions |
Optional list of grip directions.
ON_SimpleArray<CRhinoGripObject*> CRhinoObjectGrips::m_grip_list |
List of all the grips.
ON_UUID CRhinoObjectGrips::m_grips_id |
This id is for distinguishing between different types of custom grips.
CRhinoObject* CRhinoObjectGrips::m_owner_object |
CRhinoObject owner of the grips.