#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:140
virtual Bool MoveHandle(BaseObject *op, BaseObject *undo, const Vector &mouse_pos, Int32 hit_id, QUALIFIER qualifier, BaseDraw *bd)
QUALIFIER
Definition: ge_prepass.h:4833
const Matrix & GetMl(void) const
Definition: c4d_baseobject.h:437
const CAST * GetNodeData(Int32 index=0) const
Definition: c4d_baselist.h:1840
const BaseContainer * GetDataInstance() const
Definition: c4d_baselist.h:2224
Definition: c4d_baseobject.h:220
Bool PointInRange(const Vector &p, Int32 x, Int32 y)
Definition: c4d_basedraw.h:1547
Definition: c4d_objectdata.h:164
maxon::Float Float
Definition: ge_sys_math.h:51
Definition: osplineprimitive.h:6
Matrix GetMg() const
Definition: c4d_baseobject.h:478
Float GetFloat(Int32 id, Float preset=0.0) const
Definition: c4d_basecontainer.h:331
Definition: c4d_basedraw.h:660
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:144
#define NOTOK
Definition: ge_sys_math.h:252
Linear handle constraint.
maxon::Int32 Int32
Definition: ge_sys_math.h:45
Matrix GetUpMg() const
Definition: c4d_baseobject.h:503
void SetFloat(Int32 id, Float r)
Definition: c4d_basecontainer.h:529
maxon::Vec3< maxon::Float64, 1 > Vector
Definition: ge_math.h:133
maxon::Bool Bool
Definition: ge_sys_math.h:40
Definition: c4d_objectdata.h:117
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:245
Int32 GetInt32(Int32 id, Int32 preset=0) const
Definition: c4d_basecontainer.h:299
Definition: c4d_basecontainer.h:42
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:141