View3D Callbacks


Defined Callbacks

The following callbacks are defined by the View3D widget class.
NameStructureReason
XmNdoubleClickCallbackXintView3DCallbackStructXintCR_DOUBLE_CLICK
XmNdrawHookCallbackXintView3DHookCallbackStructXintCR_HOOK_DRAW
XmNeditVectorCallbackXintView3DCallbackStructXintCR_EDIT_VECTOR_START XintCR_EDIT_VECTOR XintCR_EDIT_VECTOR_END
XmNhelpCallbackXintView3DHelpCallbackStructXintCR_HELP_FRONT XintCR_HELP_BACK XintCR_HELP_COLOR XiintCR_HELP_LIGHT XintCR_HELP_GLOBAL
XmNpickCallbackXintView3DCallbackStructXintCR_PICK
XmNpickHookCallbackXintView3DHookCallbackStructXintCR_HOOK_PICK
XmNremoveCallbackXintView3DRemoveCallbackStructXintCR_REMOVE
XmNrotationCallbackXintView3DOrientationCallbackStructXintCR_ROTATE_START XintCR_ROTATE XintCR_ROTATE_END
XmNselectCallbackXintView3DCallbackStructXintCR_SELECT
XmNselectHookCallbackXintView3DHookCallbackStructXintCR_HOOK_SELECT
XmNtranslationCallbackXintView3DOrientationCallbackStructXintCR_TRANSLATE_START XintCR_TRANSLATE XintCR_TRANSLATE_END
XmNzoomCallbackXintView3DOrientationCallbackStructXintCR_ZOOM_START XintCR_ZOOM XintCR_ZOOM_END


XintView3DCallbackStruct

The table below lists the members of the structure, XintView3DCallbackStruct, returned in the callback list specified by resources
XmNpickCallback or XmNselectCallback.

Data TypeMemberDescription
intreasonIndicates why the callback was invoked.
XEvent *eventPoints to the event that triggered the callback.
XintView3DObject *objectObject that was picked or selected.
XintView3DPickDatapick_dataData associated with the point that was picked. (Set only if reason is XintCR_PICK)
intsideXintSIDE_TOP, XintSIDE_BOTTOM or XintSIDE_UNKNOWN.
XintView3DEditVectorDataedit_vector_dataStructure containing information about the new location of the vertex being edited.

Structure XintView3DPickData is defined as follows:

    typedef struct {
                    XintVector3  point;          /* point that was picked */
                    XintVector3  normal;         /* Normal at intersection */
                    XintVector3 *vertex;         /* Closest vertex picked */
                    int          index;          /* Vertex index */
    } XintView3DPickData;

Structure XintView3DEditVectorData is defined as follows:

    typedef struct {
                    XintVector3  point;/* new value of vertex being edited*/
    } XintView3DEditVectorData;


XintView3DHelpCallbackStruct

The table below lists the members of structure, XintView3DHelpCallbackStruct, returned in the callback list specified by the resource
XmNremoveCallback.

Data TypeMemberDescription
intreasonIndicates why the callback was invoked.
XEvent *eventPoints to the event that triggered the callback.

The callback reason can be used to determine on which menu the help was requested.


XintView3DHookCallbackStruct

The following ordered table lists the members of the callback structure, XintView3DHookCallbackStruct, returned to each procedure in the callback list specified by the resources
XmNdrawHookCallback, XmNpickHookCallback, and XmNselectHookCallback.

Data TypeMemberDescription
intreasonIndicates why the callback was invoked.
XEvent *eventPointer to the XEvent that triggered the callback.
XintRayLeg3rayInformation for the ray doing the selection and picking.
XintRealdistanceDistance of intersection between the ray and the objects.
BooleanhitTrue if ray intersects objects.
Booleando_view3dTrue if using the View3D picking and selection algorithms.


XintView3DOrientationCallbackStruct

The following ordered table lists the members of the callback structure, XintView3DOrientationCallbackStruct, returned in the callback list specified by the resources
XmNrotationCallback, XmNtranslationCallback, and XmNzoomCallback.

Data TypeMemberDescription
intreasonIndicates why the callback was invoked.
XEvent *eventPointer to the XEvent that triggered the callback.
XintRealazimuthCurrent azimuth of the display (Rotation).
XintRealdipCurrent dip of the display (Rotation).
XintRealtwistCurrent twist of the display (Rotation).
XintRealzoomCurrent zoom of the display (Zoom).
XintRealx_offsetCurrent X offset of the display (Translation).
XintRealy_offsetCurrent Y offset of the display (Translation).


XintView3DRemoveCallbackStruct

The table below lists the members of the structure, XintView3DRemoveCallbackStruct, returned in the callback list specified by the resource
XmNremoveCallback.

Data TypeMemberDescription
intreasonIndicates why the callback was invoked.
XEvent *eventPoints to the event that triggered the callback.
XintView3DObject **object_listList of objects being removed from the View3D widget display list.
intcountNumber of objects being removed.
BooleandoitSet to False to prevent the objects from being deleted.