#include <c4d_objectdata.h>
Class holding the information for object handles.
The handle system has been changed in such a way that handles must travel with the mouse.
The system tries to help automate the placement of the handles. It calculates the correct handle positions and constrains the handle.
The values of HandleInfo are typically set in ObjectData::GetHandle by the user.
Here is the internal code of the ObjectData::DetectHandle and ObjectData::MoveHandle methods:
{
for (i=0; i<GetHandleCount(op); i++)
{
GetHandle(op,i, info);
continue ;
{
ret = i;
break ;
}
}
return ret;
}
{
return true ;
}
Here is code from the DoubleCircle SDK example that shows the implementation of the automated handle interface functions:
{
return 1;
}
{
if (!data)
return ;
}
{
if (!data)
return ;
}
◆ HandleInfo()
◆ ~HandleInfo()
◆ CalculateNewPosition()
Calculates a handle position for the given mouse position.
Parameters
[in] bd The editor's view. The caller owns the pointed view.
[in] mg The global matrix of the handle's parent object.
[in] mouse_pos The mouse coordinates for which to calculate the handle position.
Returns The new handle position.
◆ position
◆ direction
The normal used for the handle travel. For linear handle constraints it is the line on which a handle can travel. For planar and radial constraints it is the normal of the plane/disc. Otherwise it is not needed.
◆ center
The handle constraint center, for radial and spherical handle constraints.
◆ radius
The handle constraint radius, for radial and spherical handle constraints.
◆ type
Vector position
The handle position.
Definition: c4d_objectdata.h:144
virtual Bool MoveHandle(BaseObject *op, BaseObject *undo, const Vector &mouse_pos, Int32 hit_id, QUALIFIER qualifier, BaseDraw *bd)
QUALIFIER
Definition: ge_prepass.h:4992
const Matrix & GetMl(void) const
Definition: c4d_baseobject.h:441
const CAST * GetNodeData(Int32 index=0) const
Definition: c4d_baselist.h:1884
const BaseContainer * GetDataInstance() const
Definition: c4d_baselist.h:2283
Definition: c4d_baseobject.h:224
Bool PointInRange(const Vector &p, Int32 x, Int32 y, Float range=10.0_f) const
Definition: c4d_basedraw.h:1684
Definition: c4d_objectdata.h:168
maxon::Float Float
Definition: ge_sys_math.h:64
Matrix GetMg() const
Definition: c4d_baseobject.h:482
Float GetFloat(Int32 id, Float preset=0.0) const
Definition: c4d_basecontainer.h:335
Definition: c4d_basedraw.h:747
@ PRIM_PLANE
Definition: osplineprimitive.h:6
Vector CalculateNewPosition(BaseDraw *bd, const Matrix &mg, const Vector &mouse_pos) const
virtual Int32 DetectHandle(BaseObject *op, BaseDraw *bd, Int32 x, Int32 y, QUALIFIER qualifier)
HANDLECONSTRAINTTYPE type
The handle constraint type: HANDLECONSTRAINTTYPE.
Definition: c4d_objectdata.h:148
#define NOTOK
Definition: ge_sys_math.h:265
@ LINEAR
Linear handle constraint.
maxon::Int32 Int32
Definition: ge_sys_math.h:58
Matrix GetUpMg() const
Definition: c4d_baseobject.h:507
void SetFloat(Int32 id, Float r)
Definition: c4d_basecontainer.h:533
maxon::Vec3< maxon::Float64, 1 > Vector
Definition: ge_math.h:145
maxon::Bool Bool
Definition: ge_sys_math.h:53
Definition: c4d_objectdata.h:121
X ClampValue(X value, X lowerLimit, X upperLimit)
Clips a value against a lower and upper limit. The new value is returned.
Definition: apibasemath.h:221
Int32 GetInt32(Int32 id, Int32 preset=0) const
Definition: c4d_basecontainer.h:303
Definition: c4d_basecontainer.h:46
@ INVALID
Invalid handle constraint type, used to temporarily ignore handles (e.g. in the Camera Object with th...
Vector direction
The normal used for the handle travel. For linear handle constraints it is the line on which a handle...
Definition: c4d_objectdata.h:145