The actual event or message handling is not performed by the interaction modules but is left as the responsibility of the host application. The user therefore must manage all graphics input and call the associated IActor or Popup functions depending upon the "bindings" of input events and actions which the user has determined are appropriate for the host application.
*vgl_IActorBegin - create an instance of a IActor object vgl_IActorEnd - destroy an instance of a IActor object vgl_IActorError - return IActor object error flag
vgl_IActorClick - control clicker actions vgl_IActorDisplay - call display callback vgl_IActorDrag - control dragger actions vgl_IActorDrawBackground - draw drop background vgl_IActorDrawClipCenter - draw clip plane center icon vgl_IActorDrawRectangle - draw last drag rectangle vgl_IActorDrawRotCenter - draw triad at the center of rotation vgl_IActorDrawTrackBall - draw trackball vgl_IActorResize - resize function vgl_IActorFit - fit function vgl_IActorFitNearFar - fit near and far clipping planes function vgl_IActorFitTrackBall - fit trackball function vgl_IActorGetFloat - query float information vgl_IActorGetInteger - query integer information vgl_IActorProject - project a point to device coordinates vgl_IActorUnproject - unproject a point from device coordinates vgl_IActorSetFunction - set a call back function vgl_IActorSetObject - set attribute object GetObject - get attribute object vgl_IActorSetParamf - set display parameters vgl_IActorSetParamfv - set display parameters vgl_IActorSetParami - set display parameters vgl_IActorSpin - spin function vgl_IActorTransformInit - initialize modelview matrix vgl_IActorTransformView - specify modelview matrix
In addition to the utility functions, the IActor module supports the implementation of several user object manipulation actions. These actions may be categorized as either "clicker" or "dragger" actions. Clicker actions are meant to be performed when a button is pressed. Use the vgl_IActorClick function to implement clicker actions. Dragger actions are meant to be initiated when a button is depressed, then the cursor location is repeatedly queried and some action based upon the mouse movement and the mouse position is performed. The dragging action normally terminates when the button is released. Use the vgl_IActorDrag function to implement dragger actions. The IActor module allows all graphics input functions such as button, mouse movement and expose events to be managed by the user.
The IActor module provides for a display callback functions to be invoked under upon the completion of all clicker actions and the movement and termination stages of most dragger actions. The display callback function is set using vgl_IActorSetFunction
The actions currently available are are described as follows:
The IActor module supports the management of arbitrary clipping planes. A clipping plane is defined by a point in world coordinates and a normal vector at that point. Use vgl_IActorSetParamfv to specify the point and normal. The basic clipping plane interactions are to translate the clipping plane in the direction of the normal or in the plane of the clipping plane (perpendicular to the normal) and to rotate the clipping plane about a specified vector which lies in the plane of the clipping plane. All clip plane motions are performed using vgl_IActorDrag with one of five possible dragger actions.
IACTOR_CLIPPLANETRANSLATE IACTOR_CLIPPLANETRANSLATE_DEGEN IACTOR_CLIPPLANETRANSLATE_INPLANE IACTOR_CLIPPLANEROTATE IACTOR_CLIPPLANEROTATE_DEGENThe IActor module provides a function, vgl_IActorDrawClipCenter, to draw an icon representing the clip plane center and to detect the type of clip plane interaction to be performed. The type of clip plane interaction detected depends upon the mouse location on the clip plane icon. The appearance of the icon will change dependent upon the interaction which is detected by the function call. If a rotation action is detected, the components of the rotation vector are returned. Note that the use of the vgl_IActorDrawClipCenter is optional and is only provided as a convenience for drawing a clip plane icon and providing a reasonable means of detecting a dragger option for subsequent use with vgl_IActorDrag.
If the mouse is within the boundary of the center sphere, then the center of the clip plane is translated. If the mouse is within half the radius of the center sphere, then translation along the normal to the clip plane is detected. If normal translation is detected and the normal is nearly parallel to the viewing direction, then the icon on the right in Figure 10-1a is drawn. If the mouse is between half the radius and the full radius of the center sphere, then translation in the plane of the clip plane is detected and the icon in Figure 10-1b is drawn.
*vgl_IActorBegin - create an instance of a IActor object
vgl_IActor *vgl_IActorBegin ()
None
Destroy an instance of a IActor object using
void vgl_IActorEnd (vgl_IActor *iactor)
Return the current value of a IActor object error flag using
Vint vgl_IActorError (vgl_IActor *iactor)
vgl_IActorClick - control clicker actions
void vgl_IActorClick (vgl_IActor *iactor, Vint action, Vint px, Vint py)
iactor Pointer to IActor object. action Action type =IACTOR_CENTER Translate point to center of screen =IACTOR_ROTATERATE Rotate about screen x and y at a rate relative to mouse position. =IACTOR_SCALERATE Scale relative to mouse position. =IACTOR_SCALEBYFACTOR Scale about mouse position by a given factor. =IACTOR_TRANSLATERATE Translate in screen xy plane relative to mouse position. =IACTOR_NONE Take no action px Horizontal device coordinate. py Vertical device coordinate.
None
The action, IACTOR_SCALEBYFACTOR, scales about the mouse position by a factor which is set using the IACTOR_SCALEFACTOR parameter with function vgl_IActorSetParamf.
No check is made on the input values of px and py. The display callback is invoked after the specified action is complete. No cursor changes are performed.
vgl_IActorDisplay - call display callback
void vgl_IActorDisplay (vgl_IActor *iactor, Vobject *dummy)
iactor Pointer to IActor object. dummy Pointer to object which is ignored by this function
None
vgl_IActorDrag - control dragger actions
void vgl_IActorDrag (vgl_IActor *iactor, Vint action, Vint drag, Vint px, Vint py)
iactor Pointer to IActor object. action Action type =IACTOR_CLIPPLANETRANSLATE Translate normal to clipping plane =IACTOR_CLIPPLANETRANSLATE_DEGEN Translate normal to clipping plane =IACTOR_CLIPPLANETRANSLATE_INPLANE Translate in plane of clipping plane =IACTOR_CLIPPLANEROTATE Rotate clipping plane =IACTOR_CLIPPLANEROTATE_DEGEN Rotate clipping plane =IACTOR_DOLLY Translate in screen depth relative to mouse movement. =IACTOR_DOLLYCENTER Translate in screen depth about the center of the screen relative to mouse movement. =IACTOR_DOLLYRATE Translate in screen depth relative to mouse position. =IACTOR_FARPLANE Translate far clipping plane relative to mouse movement. =IACTOR_FRAME Translate and scale the viewport to a rectangular frame. =IACTOR_NEARPLANE Translate near clipping plane relative to mouse movement. =IACTOR_PAN Pan in screen xy plane relative to mouse movement. =IACTOR_ROTATE Rotate about screen x,y and z axes relative to mouse movement. =IACTOR_ROTATERATE Rotate about screen x and y at a rate relative to mouse position and about screen z relative to mouse movement. =IACTOR_SCALE Scale relative to mouse movement. =IACTOR_SCALECENTER Scale about screen center relative to mouse movement. =IACTOR_SCALERATE Scale relative to mouse position. =IACTOR_SQUIGGLE Translate and scale a rectangular extent. =IACTOR_TRACKBALL Simulate trackball manipulation =IACTOR_TRANSLATE Translate in screen xy plane relative to mouse movement. =IACTOR_TRANSLATERATE Translate in screen xy plane relative to mouse position. =IACTOR_WINDOW Translate and scale a rectangular window to the viewport. =IACTOR_ZOOM Zoom relative to mouse movement. =IACTOR_ZOOMCENTER Zoom about screen center relative to mouse movement. =IACTOR_NONE Take no action drag Drag stage =VGL_DRAG_INIT Dragger initialization =VGL_DRAG_MOVE Dragger movement =VGL_DRAG_TERM Dragger termination px Horizontal device coordinate. py Vertical device coordinate.
None
Note that for the IACTOR_FRAME, IACTOR_SQUIGGLE and IACTOR_WINDOW actions, if the px and py values passed at the VGL_DRAG_INIT stage are the same as the values passed at the VGL_DRAG_TERM stage, then no translation or scaling is performed.
vgl_IActorDrawBackground - draw drop background
void vgl_IActorDrawBackground (vgl_IActor *iactor, Vfloat cbot[3], Vfloat ctop[3])
iactor Pointer to IActor object. cbot Color of background at bottom of window ctop Color of background at top of window
None
vgl_IActorDrawClipCenter - draw clip plane center icon
void vgl_IActorDrawClipCenter (vgl_IActor *iactor, Vint action, Vint px, Vint py, Vint *xaction, Vfloat xrotvec[3])
iactor Pointer to IActor object. action Action type =IACTOR_CLIPPLANEDETECT Draw icon and detect clipping plane specific action. =IACTOR_CLIPPLANETRANSLATE Draw translate normal icon =IACTOR_CLIPPLANETRANSLATE_DEGEN Draw translate normal icon =IACTOR_CLIPPLANETRANSLATE_INPLANE Draw translate inplane icon =IACTOR_CLIPPLANEROTATE Draw rotate icon =IACTOR_CLIPPLANEROTATE_DEGEN Draw rotate icon =IACTOR_CLIPPLANEDATA Draw basic icon px Horizontal device coordinate. py Vertical device coordinate.
xaction Detected specific action type =IACTOR_NONE No specific action detected =IACTOR_CLIPPLANETRANSLATE =IACTOR_CLIPPLANETRANSLATE_DEGEN =IACTOR_CLIPPLANETRANSLATE_INPLANE =IACTOR_CLIPPLANEROTATE =IACTOR_CLIPPLANEROTATE_DEGEN xrotvec Detected rotation vector
The first category is clipping plane action detection using IACTOR_CLIPPLANEDETECT. In this case the clipping plane icon is drawn and the input device coordinates are used to detect a specific clipping plane action. If the input coordinates lie on the center sphere, a translation is detected. If the coordinates lie in the vicinity of the concentric circle, a rotation is detected. The detected action is returned in xaction and a rotation vector is return in xrotvec if a specific rotation action is detected. If the input coordinates lie outside of the icon, then IACTOR_NONE is returned. The icon is drawn with translation or rotation vectors drawn depending on the specific action detected.
The second category is a specific clipping plane action or no action using IACTOR_CLIPPLANETRANSLATE, IACTOR_CLIPPLANETRANSLATE_DEGEN, IACTOR_CLIPPLANETRANSLATE_INPLANE, IACTOR_CLIPPLANEROTATE, IACTOR_CLIPPLANEROTATE_DEGEN or IACTOR_CLIPPLANEDATA. In this case, the icon is drawn specific to the input action. The action IACTOR_CLIPPLANEDATA simply draws the basic icon with no rotation or translation vectors. The return values are undefined.
vgl_IActorDrawRectangle - draw last drag rectangle
void vgl_IActorDrawRectangle (vgl_IActor *iactor)
iactor Pointer to IActor object.
None
vgl_IActorDrawRotCenter - draw triad at the center of rotation
void vgl_IActorDrawRotCenter (vgl_IActor *iactor, Vint censiz)
iactor Pointer to IActor object. censiz Size of a triad axis in pixels
None
vgl_IActorDrawTrackBall - draw trackball
void vgl_IActorDrawTrackBall (vgl_IActor *iactor)
iactor Pointer to IActor object.
None
vgl_IActorResize - resize function
void vgl_IActorResize (vgl_IActor *iactor, Vobject *dummy)
iactor Pointer to IActor object. dummy Pointer to object which is ignored by this function
None
If a child window is to be resized in response to a resizing of its parent window then the desired size of the child window must be set using the ConfigureWindow drawing function prior to calling vgl_IActorResize.
vgl_IActorFit - fit function
void vgl_IActorFit (vgl_IActor *iactor, Vobject *dummy)
iactor Pointer to IActor object. dummy Pointer to object which is ignored by this function
None
If the fit type is IACTOR_FITTYPE_EXTENT or IACTOR_FITTYPE_RADIUS, the graphics subsystem is placed in VGL_EXTENT_DEVICE or VGL_EXTENT_FIT render mode and the display callback is invoked to compute the extent of the scene. The render mode is then set to VGL_RENDER.
If the fit type is IACTOR_FITTYPE_BOUNDBOX, then the user supplied bounding box is used which is set by calling vgl_IActorSetParamfv with IACTOR_BOUNDBOX. The render mode of the graphics subsystem is not changed.
A modelview matrix is computed and loaded which centers the scene in the viewing volume. Finally a polygon offset is computed and set so that line primitives appear clearly superimposed upon underlying polygon primitives.
Use the IACTOR_FITTYPE parameter to set the overall type of fit to be performed. The far clipping plane is adjusted depending upon the type of depth fitting selected. Use the IACTOR_FITZTYPE parameter to set the type of depth fit to be performed. Use vgl_IActorSetParami to set these parameters.
Use the IACTOR_FITZFACT parameter to adjust the padding used to place the far clipping plane and the IACTOR_FITZLENGTH parameter to specify a length to place the far clipping plane. Use vgl_IActorSetParamf to set these parameters.
Use the IACTOR_FITSHRINK parameter to shrink the fit model from the window margins. Use vgl_IActorSetParamf to set the shrink factor.
vgl_IActorFitNearFar - fit near and far clipping planes function
void vgl_IActorFitNearFar (vgl_IActor *iactor, Vobject *dummy)
iactor Pointer to IActor object. dummy Pointer to object which is ignored by this function
None
vgl_IActorFitTrackBall - fit trackball function
void vgl_IActorFitTrackBall (vgl_IActor *iactor, Vobject *dummy)
iactor Pointer to IActor object. dummy Pointer to object which is ignored by this function
None
vgl_IActorGetFloat - query float information
void vgl_IActorGetFloat (vgl_IActor *iactor, Vint type, Vfloat params[])
iactor Pointer to IActor object. type Type of parameter to return =IACTOR_ROTCENTER Coordinates of rotation center. =IACTOR_ROTCENTERDEVICE Device coordinates of rotation center
params Pointer to floating point return values
vgl_IActorGetInteger - query integer information
void vgl_IActorGetInteger (vgl_IActor *iactor, Vint type, Vint params[])
iactor Pointer to IActor object. type Type of parameter to return =IACTOR_DRAG Current Drag state
params Pointer to floating point return values
vgl_IActorProject - project a point to device coordinates
void vgl_IActorProject (vgl_IActor *iactor, Vfloat w[3], Vfloat d[3])
iactor Pointer to IActor object. w World coordinates
d Device coordinates
vgl_IActorUnproject - unproject a point from device coordinates
void vgl_IActorUnProject (vgl_IActor *iactor, Vfloat d[3], Vfloat w[3])
iactor Pointer to IActor object. d Device coordinates
w World coordinates
vgl_IActorSetFunction - set a callback function
void vgl_IActorSetFunction (vgl_IActor *iactor, Vint funtype, void (*function)(vgl_IActor*, Vobject*), Vobject *object)
iactor Pointer to IActor object. funtype Type of callback function to set =IACTOR_FUN_DISPLAY Display callback function Pointer to callback function object Pointer to the object to be returned as function argument
None
vgl_IActorSetObject - set attribute objects
void vgl_IActorSetObject (vgl_IActor *iactor, Vint objecttype, Vobject *object)
iactor Pointer to IActor object. objecttype The name of the object type to be set. =VGL_DRAWFUN DrawFun object object Pointer to the object to be set.
None
Get object as an output argument using
void vgl_IActorGetObject (vgl_IActor *iactor, Vint objecttype, Vobject **object)
vgl_IActorSetParamf - set floating display parameters
void vgl_IActorSetParamf (vgl_IActor *iactor, Vint type, Vfloat param)
iactor Pointer to IActor object. type Type of display parameter to set =IACTOR_FITSHRINK Fit shrink factor =IACTOR_FITZFACT Fit depth padding factor =IACTOR_FITZLENGTH Fit depth length =IACTOR_TRACKBALLRADIUS Trackball radius =IACTOR_DOLLYGAIN Gain of dolly actions =IACTOR_PLANEGAIN Gain of near and far plane actions =IACTOR_SCALEGAIN Gain of scale actions =IACTOR_SCALEFACTOR Scale factor param Specifies the float value that type will be set to.
None
Set fit shrink factor. The shrink factor is a value in the interval [0.,1.) which is used by vgl_IActorFit to determine the amount to shrink the object away from the viewport boundaries. A shrink factor of 0. results in no shrink. By default IACTOR_FITSHRINK is .1 .
Set depth padding factor using IACTOR_FITZFACT. The padding factor is used to set the far clipping plane so that the model comfortably fits in the center between the near and far clipping planes. The distance between the near and far clipping planes is the padding factor times the model extent in eye coordinates. Set IACTOR_FITZFACT to unity if the model extent is meant to be bounded exactly by the near and far clipping planes. The type of depth fitting is selected using function vgl_IActorSetParami with parameter IACTOR_FITZTYPE. Use a parameter value of IACTOR_FITZTYPE_FACT to enable depth padding factor fitting. By default IACTOR_FITZFACT is 100.
Set depth length using IACTOR_FITZLENGTH. The length is used to set the far clipping to be the depth length from the near clipping plane. The model is centered between the near and far planes. The type of depth fitting is selected using function vgl_IActorSetParami with parameter IACTOR_FITZTYPE. Use a parameter value of IACTOR_FITZTYPE_LENGTH to enable depth length fitting. By default IACTOR_FITZLENGTH is 1.
Set "gain" of scaling, near/far plane and dolly actions using IACTOR_SCALEGAIN, IACTOR_PLANEGAIN and IACTOR_DOLLYGAIN. The scale, plane and dolly gains are the incremental scale, plane and dolly factors applied per unit pixel moved. By default IACTOR_SCALEGAIN is .005 and IACTOR_PLANEGAIN and IACTOR_DOLLYGAIN are .001 .
Set scale factor used with the IACTOR_SCALEBYFACTOR clicker operation. By default IACTOR_SCALEFACTOR is 1.5 .
vgl_IActorSetParamfv - set floating display parameters
void vgl_IActorSetParamfv (vgl_IActor *iactor, Vint type, Vfloat param[])
iactor Pointer to IActor object. type Type of display parameter to set =IACTOR_BOUNDBOX Coordinates of bounding box =IACTOR_CLIPPLANECENTER Coordinates of clip plane center =IACTOR_CLIPPLANENORMAL Clip plane normal vector =IACTOR_CLIPPLANEROTVEC Clip plane rotation vector =IACTOR_COLOR_DRAG Color of squiggle. =IACTOR_COLOR_DRAGSTRIPE Color of squiggle stripe color =IACTOR_COLOR_XAXIS Color of x-axis =IACTOR_COLOR_YAXIS Color of y-axis =IACTOR_COLOR_ZAXIS Color of z-axis =IACTOR_ROTCENTER Coordinates of rotation center. =IACTOR_ROTCENTERDEVICE Device coordinates of rotation center =IACTOR_SPINMATRIX Modelview matrix modification used for each Spin operation. param Specifies the float values that type will be set to.
None
Set clipping plane center and normal using IACTOR_CLIPPLANECENTER and IACTOR_CLIPPLANENORMAL respectively. By default the center and normal are (0.,0.,0.). These values are changed by the vgl_IActorDrag function when a clipping plane action is performed. The current values may be queried using vgl_IActorGetFloat.
Set center of rotation. By default IACTOR_ROTCENTER is (0.,0.,0.). The center of rotation may be set in device coordinates using IACTOR_ROTCENTERDEVICE. The current rotation center may be queried in either global or device coordinates using vgl_IActorGetFloat.
Set colors of graphics associated with the squiggle drag operation. By default IACTOR_COLOR_DRAG is (1.,1.,1.) By default IACTOR_COLOR_DRAGSTRIPE is (1.,.2,.2)
Set colors of graphics associated with the rotation center and trackball icons. The x, y and z-axis colors affect the trackball circles in the xy, yz and zx planes respectively. By default IACTOR_COLOR_XAXIS is (1.,0.,0.), IACTOR_COLOR_YAXIS is (0.,1.,0.) and IACTOR_COLOR_ZAXIS is (0.,0.,1.).
Set the matrix which is used to increment the current modelview matrix for each time vgl_IActorSpin is called using IACTOR_SPINMATRIX.
vgl_IActorSetParami - set integer display parameters
void vgl_IActorSetParami (vgl_IActor *iactor, Vint type, Vint iparam)
iactor Pointer to IActor object. type Type of display parameter to set =IACTOR_CURSORS Display rotation, translation and scale cursors during display manipulation. =IACTOR_CLIPPLANEICONNORMAL Toggle drawing of clip plane icon normal vector =IACTOR_CLIPPLANEICONRADIUS Radius of clip plane icon in pixels =IACTOR_FITTYPE Fit type. =IACTOR_FITZTYPE Fit depth type. =IACTOR_FARADJUST Automatic far plane adjustment =IACTOR_LINEWIDTH_DRAG Linewidth of drag lines =IACTOR_NEARADJUST Automatic near plane adjustment =IACTOR_SMOOTHMOVE Smooth movement =IACTOR_SMOOTHSTEPS Number of smooth steps =IACTOR_INDPROJ Modify projection limits independently =IACTOR_USEPROJ Modify projection limits =IACTOR_USEFRONTBUFFER Toggle front buffer use =IACTOR_VERTDOLLY Dolly to vertical movements =IACTOR_VERTSCALE Scale to vertical movements =IACTOR_VERTZOOM Zoom to vertical movements iparam Specifies the integer value that type will be set to. =VGL_ON Enable =VGL_OFF Disable =IACTOR_FITTYPE_BOUNDBOX Model user supplied bounding box =IACTOR_FITTYPE_EXTENT Model projected extent =IACTOR_FITTYPE_RADIUS Model object radius =IACTOR_FITZTYPE_FACT Depth padding factor =IACTOR_FITZTYPE_LENGTH Depth length
None
Set fit type. A fit type of IACTOR_FITTYPE_EXTENT uses the projected extent of the model to fit to the window. The scaling of the model is then dependent upon its current orientation. A fit type of IACTOR_FITTYPE_RADIUS uses the radial distance of the object extent of the model to fit to the window. The scaling of the model is then independent of its current orientation. A fit type of IACTOR_FITTYPE_BOUNDBOX uses the projected bounding box supplied by the user using vgl_IActorSetParamfv with IACTOR_BOUNDBOX to fit to the window. The scaling of the model is then dependent upon its current orientation. By default IACTOR_FITTYPE is IACTOR_FITTYPE_EXTENT.
Set depth fit type. A depth fit type of IACTOR_FITZTYPE_FACT uses a depth padding factor supplied by the user using vgl_IActorSetParamf with IACTOR_FITZFACT to fit the near and far planes. A depth fit type of IACTOR_FITZTYPE_LENGTH uses a depth length supplied by the user using vgl_IActorSetParamf with IACTOR_FITZLENGTH to fit the near and far planes. By default IACTOR_FITZTYPE is IACTOR_FITZTYPE_FACT.
Use IACTOR_LINEWIDTH_DRAG to set the line width of lines drawn during the IACTOR_WINDOW, IACTOR_FRAME and IACTOR_SQUIGGLE drag operations. By default IACTOR_LINEWIDTH_DRAG is set to 2.
Use IACTOR_NEARADJUST and IACTOR_FARADJUST to enable the automatic adjustment of the near and far clipping planes when performing "dolly" drag operations. This automatic adjustment is designed to move the near and far clipping planes so that the model is not clipped. By default IACTOR_NEARADJUST and IACTOR_FARADJUST are set to VGL_OFF.
Use IACTOR_USEPROJ to enable the use of projection limit modifications rather than model view matrix modifications for IACTOR_CENTER click operations and IACTOR_WINDOW, IACTOR_FRAME and IACTOR_SQUIGGLE drag operations. By default IACTOR_USEPROJ is set to VGL_OFF.
Use IACTOR_INDPROJ to enable independent projection limit modifications IACTOR_WINDOW, IACTOR_FRAME and IACTOR_SQUIGGLE drag operations. If enabled the projection limits are modified independently without preserving aspect ratio. If disabled the projection limits are modified to preserve aspect ratio. By default IACTOR_INDPROJ is set to VGL_OFF.
Use IACTOR_USEFRONTBUFFER to toggle the use of the front buffer in squiggle and window graphics. By default IACTOR_USERFRONTBUFFER is set to VGL_ON.
Use IACTOR_SMOOTHMOVE to enable all projection modifications to be performed smoothly using a specified number of intermediate display callbacks. This option is available only for vgl_IActorFit, IACTOR_CENTER click operations and IACTOR_WINDOW, IACTOR_FRAME and IACTOR_SQUIGGLE drag operations with IACTOR_USEPROJ enabled. The number of intermediate display callbacks is specified using IACTOR_SMOOTHSTEPS. By default IACTOR_SMOOTHMOVE is set to VGL_OFF. By default IACTOR_SMOOTHSTEPS is set to 8.
Use IACTOR_VERTDOLLY, IACTOR_VERTSCALE and IACTOR_VERTZOOM to enable dolly, scaling and zooming to be sensitive to vertical mouse movements only. This option is available for all dolly, scale and zoom drag operations. By default IACTOR_VERTDOLLY, IACTOR_VERTSCALE and IACTOR_VERTZOOM are set to VGL_OFF.
Use IACTOR_CLIPPLANEICONNORMAL to toggle the display of the clip plane icon normal vector. By default IACTOR_CLIPPLANEICONNORMAL is set to VGL_OFF.
Use IACTOR_CLIPPLANEICONRADIUS to set the radius of the clip plane rotation icon in pixels. By default IACTOR_CLIPPLANEICONRADIUS is set to 50.
vgl_IActorSpin - spin function
void vgl_IActorSpin (vgl_IActor *iactor, Vobject *dummy)
iactor Pointer to IActor object. dummy Pointer to object which is ignored by this function
None
vgl_IActorTransformInit - initialize modelview matrix
void vgl_IActorTransformInit (vgl_IActor *iactor, Vint action)
iactor Pointer to IActor object. action Action type =IACTOR_ROTATE Initialize rotations =IACTOR_TRANSLATE Initialize translations =IACTOR_SCALE Initialize scale =IACTOR_TRANSFORMSNAP Snap rotations
None
The display callback function is invoked.
vgl_IActorTransformView - specify modelview matrix
void vgl_IActorTransformView (vgl_IActor *iactor, Vint action, Vfloat tm[4][4])
iactor Pointer to IActor object. action Action type =IACTOR_ROTATE Specify rotations =IACTOR_TRANSLATE Specify translations =IACTOR_SCALE Specify scale tm Modelview matrix
None
The display callback function is invoked.
*vgl_PopupBegin - create an instance of a Popup object vgl_PopupEnd - destroy an instance of a Popup object vgl_PopupError - return Popup object error flag
vgl_PopupAddItem - add a button item vgl_PopupAddLine - add a line separator vgl_PopupAddPopup - add a cascading popup menu vgl_PopupAddRadio - add a radio button item vgl_PopupAddToggle - add a toggle button item vgl_PopupDrag - control dragger actions vgl_PopupGetIndex - get user index of selected item vgl_PopupSetActive - set activity of an item GetActive - get activity of an item vgl_PopupSetFunction - set a call back function vgl_PopupSetObject - set attribute object GetObject - get attribute object vgl_PopupSetParamfv - set display parameters vgl_PopupSetRadio - set radio button value GetRadio - get radio button value vgl_PopupSetToggle - set toggle button value GetToggle - get toggle button value vgl_PopupTitle - define popup title
A popup menu visually consists of a title; button, radio box, toggle and cascading menu items; and line separators. The menu items are defined using vgl_PopupAddItem, vgl_PopupAddRadio, vgl_PopupAddToggle and vgl_PopupAddPopup. Line separators are defined using vgl_PopupAddLine. The menu title is defined using vgl_PopupTitle. The title always appears at the top of the popup menu with a line separator drawn immediately below it. All other menu items and line separators are added to the popup menu below the title in the order in which they are defined.
Each menu item, (except for cascading popup menus) is assigned a user defined index, a label and a callback function which is invoked when the item is selected. The index of the selected item is not passed directly to the callback but must be queried for using vgl_PopupGetIndex. The menu item index is used by many functions as a unique "name" for the associated menu item. Toggle items are drawn with a small square box to the left of the label indicating the value of the toggle. Radio box items are drawn with a small diamond box to the left of the label indicating which item in the array is enabled. Cascading menu items are drawn with a pointer icon to the right of the item label.
The activity (selectability) of menu items may be changed using vgl_PopupSetActive. An item with its activity disabled is drawn with a lightened appearance and may not be selected. An example of a popup menu illustrating some item types and an inactive radio box array appears in Figure 10-1.
*vgl_PopupBegin - create an instance of a Popup object
vgl_Popup *vgl_PopupBegin ()
None
Destroy an instance of a Popup object using
void vgl_PopupEnd (vgl_Popup *popup)
Return the current value of a Popup object error flag using
Vint vgl_PopupError (vgl_Popup *popup)
vgl_PopupAddItem - add a button item
void vgl_PopupAddItem (vgl_Popup *popup, Vint index, Vtchar *label, void (*function)(vgl_Popup*, Vobject*), Vobject *object)
popup Pointer to Popup object. index Identifier for menu item label Item label function Pointer to callback function object Pointer to the object to be returned as function argument
None
vgl_PopupAddLine - add a line separator
void vgl_PopupAddLine (vgl_Popup *popup)
popup Pointer to Popup object.
None
vgl_PopupAddPopup - add a cascading popup menu
void vgl_PopupAddPopup (vgl_Popup *popup, Vint index, Vtchar *label, vgl_Popup *caspopup)
popup Pointer to Popup object. index Identifier for menu item label Item label caspopup Pointer to cascading Popup object.
None
vgl_PopupAddRadio - add a radio button item
void vgl_PopupAddRadio (vgl_Popup *popup, Vint index, Vint subindex, Vtchar *label, void (*function)(vgl_Popup*, Vobject*), Vobject *object)
popup Pointer to Popup object. index Identifier for menu item subindex Subindex identifier for menu item label Item label function Pointer to callback function object Pointer to the object to be returned as function argument
None
If selected, the index is set as the current index, the item becomes the currently selected item in the radio button array and the specified callback function is invoked. Use vgl_PopupGetIndex to return the current index. Use vgl_PopupGetRadio to return the currently selected item in the radio box array given the index. The currently selected item in a radio box array may be set using vgl_PopupSetRadio.
vgl_PopupAddToggle - add a toggle button item
void vgl_PopupAddToggle (vgl_Popup *popup, Vint index, Vtchar *label, void (*function)(vgl_Popup*, Vobject*), Vobject *object)
popup Pointer to Popup object. index Identifier for menu item label Item label function Pointer to callback function object Pointer to the object to be returned as function argument
None
If selected, the index is set as the current index, the value of the item is toggled and the specified callback function is invoked. Use vgl_PopupGetIndex to return the current index. Use vgl_PopupGetToggle to return the current value of the toggle item given the index. The value of a toggle may be set using vgl_PopupSetToggle.
vgl_PopupDrag - control dragger actions
void vgl_PopupDrag (vgl_Popup *popup, Vint drag, Vint px, Vint py)
popup Pointer to Popup object. drag Drag stage =VGL_DRAG_INIT Dragger initialization =VGL_DRAG_MOVE Dragger movement =VGL_DRAG_TERM Dragger termination px Horizontal device coordinate. py Vertical device coordinate.
None
vgl_PopupGetIndex - get user index of selected item
void vgl_PopupGetIndex (vgl_Popup *popup, Vint *index)
popup Pointer to Popup object. index Index of current selected item
None
vgl_PopupSetActive - set activity of an item
void vgl_PopupSetActive (vgl_Popup *popup, Vint index, Vint flag)
popup Pointer to Popup object. index Identifier for menu item flag Flag to enable or disable menu item activity. =VGL_ON Enable =VGL_OFF Disable
None
Get flag as an output argument using
void vgl_PopupGetActive (vgl_Popup *popup, Vint index, Vint *flag)
vgl_PopupSetFunction - set a callback function
void vgl_PopupSetFunction (vgl_Popup *popup, Vint funtype, void (*function)(vgl_Popup*, Vobject*), Vobject *object)
popup Pointer to Popup object. funtype Type of callback function to set =POPUP_FUN_DISPLAY Display callback function Pointer to callback function object Pointer to the object to be returned as function argument
None
vgl_PopupSetObject - set attribute objects
void vgl_PopupSetObject (vgl_Popup *popup, Vint objecttype, Vobject *object)
popup Pointer to Popup object. objecttype The name of the object type to be set. =VGL_DRAWFUN DrawFun object object Pointer to the object to be set.
None
Get object as an output argument using
void vgl_PopupGetObject (vgl_Popup *popup, Vint objecttype, Vobject **object)
vgl_PopupSetParamfv - set display parameters
void vgl_PopupSetParamfv (vgl_Popup *popup, Vint type, Vfloat param[])
popup Pointer to Popup object. type Type of display parameter to set =POPUP_COLOR_BACKGROUND Set popup background RGB color. param Specifies the float values that type will be set to.
None
vgl_PopupSetRadio - set radio button value
void vgl_PopupSetRadio (vgl_Popup *popup, Vint index, Vint subindex)
popup Pointer to Popup object. index Identifier for menu item subindex Subindex identifier for menu item
None
Get subindex as an output argument using
void vgl_PopupGetRadio (vgl_Popup *popup, Vint index, Vint *subindex)
vgl_PopupSetToggle - set toggle button value
void vgl_PopupSetToggle (vgl_Popup *popup, Vint index, Vint flag)
popup Pointer to Popup object. index Identifier for menu item flag Flag to enable or disable toggle menu item. =VGL_ON Enable =VGL_OFF Disable
None
Get flag as an output argument using
void vgl_PopupGetToggle (vgl_Popup *popup, Vint index, Vint *flag)
vgl_PopupTitle - define popup title
void vgl_PopupTitle (vgl_Popup *popup, Vtchar *title)
popup Pointer to Popup object. title Popup menu title
None