The HandleBox module is used to manipulate a rectilinear box oriented to the world coordinate system containing six clipping planes. The polybox may also be used for picking purposes.
The PolyBox module is used to construct polygons in the plane of the graphics screen which can be used for clipping and picking purposes.
The WorkPlane module is used to draw planar rectangular grids arbitrarily oriented in space to use as a reference for geometry construction. The work plane may be optionally used as a clipping plane.
The following functions are associated with a HandleBox object.
*vis_HandleBoxBegin - create an instance of a HandleBox object vis_HandleBoxEnd - destroy an instance of a HandleBox object vis_HandleBoxError - return HandleBox object error flag
vis_HandleBoxGetClipPlanes - get clipping plane equations vis_HandleBoxSetExtent - set handlebox extent GetExtent - get handlebox extent vis_HandleBoxGetBox - get eight corners of handlebox vis_HandleBoxSetObject - set pointers to attribute objects. GetObject - get pointers to attribute objects. vis_HandleBoxSetParami - set handlebox display parameters GetParami - get handlebox display parameters
vis_HandleBoxTestHit - test for handle hit vis_HandleBoxGetHit - get internal hit status vis_HandleBoxInitHit - initialize internal hit status vis_HandleBoxCurrentDrag - get current drag status vis_HandleBoxDrag - drag the handlebox vis_HandleBoxDraw - draw the handlebox
The handlebox is primarily meant to be used as 3 sets of parallel clipping planes. The user may either activate an internal call to the vgl_DrawFunClipPlane function for each plane or query for the current clipping plane equations using vis_HandleBoxGetClipPlanes and manage the clipping plane interface to the graphics subsystem externally.
The function vis_HandleBoxGetBox may be used to return the world coordinates of the eight corners of the handlebox. This array of world coordinates may be passed directly to the Space object function vis_SpaceBoxGroup to query for all element entities lying in the box or vis_SpaceBoxNodeGroup to query for all node entities lying in the box. Selected faces or edges of the box may be passed to vis_SpacePlaneGroup or vis_SpaceLineGroup to select elements intersecting the respective face or edge.
*vis_HandleBoxBegin - create an instance of a HandleBox object
vis_HandleBox *vis_HandleBoxBegin ()
None
Destroy an instance of a HandleBox object using
void vis_HandleBoxEnd (vis_HandleBox *handlebox)
Return the current value of a HandleBox object error flag using
Vint vis_HandleBoxError (vis_HandleBox *handlebox)
vis_HandleBoxSetObject - set pointers to attribute objects
void vis_HandleBoxSetObject (vis_HandleBox *handlebox, Vint objecttype, Vobject *object)
handlebox Pointer to HandleBox object. objecttype The name of the object type to be set. =VIS_COLORMAP ColorMap object =VGL_DRAWFUN DrawFun object =VIS_VISCONTEXT VisContext object object Pointer to the object to be set.
None
vis_HandleBoxGetClipPlanes - get clipping plane equations
void vis_HandleBoxGetClipPlanes (vis_HandleBox *handlebox, Vfloat eqn[6][4])
handlebox Pointer to HandleBox object.
eqn Plane equations.
vis_HandleBoxSetExtent - set handlebox extent
void vis_HandleBoxSetExtent (vis_HandleBox *handlebox, Vfloat extent[2][3])
handlebox Pointer to HandleBox object. extent Extent
None
Get current extent as an output argument using
void vis_HandleBoxGetExtent (vis_HandleBox *handlebox, Vfloat extent[2][3])
vis_HandleBoxGetBox - get eight corners of handlebox
void vis_HandleBoxGetBox (vis_HandleBox *handlebox, Vfloat box[8][3])
handlebox Pointer to HandleBox object.
box Array of coordinate locations of handlebox corners
vis_HandleBoxSetParami - set handlebox display parameters
void vis_HandleBoxSetParami (vis_HandleBox *handlebox, Vint type, Vint param)
handlebox Pointer to HandleBox object. type Type of display parameter to set =HANDLEBOX_PIXTOL Pixel tolerance for handles =HANDLEBOX_CLIPPLANE Call ClipPlane drawing function param Specifies the integer value that ptype will be set to. =VIS_OFF Turn parameter off =VIS_ON Turn parameter on
None
The parameter HANDLEBOX_CLIPPLANE toggles the calling of the ClipPlane drawing function internally for each of the 6 faces. By default HANDLEBOX_CLIPPLANE is set to SYS_ON.
vis_HandleBoxTestHit - test for handle hit
void vis_HandleBoxTestHit (vis_HandleBox *handlebox, Vint ix, Vint iy, Vint *hit)
handlebox Pointer to HandleBox object ix Horizontal device coordinate iy Vertical device coordinate
hit Hit flag
vis_HandleBoxGetHit - get internal hit status
void vis_HandleBoxGetHit (vis_HandleBox *handlebox, Vint *corner, Vint *idir)
handlebox Pointer to HandleBox object
corner Corner idir Direction
vis_HandleBoxInitHit - initialize internal hit status
void vis_HandleBoxInitHit (vis_HandleBox *handlebox)
handlebox Pointer to HandleBox object
None
vis_HandleBoxCurrentDrag - get current drag status
void vis_HandleBoxCurrentDrag (vis_HandleBox *handlebox, Vint *action, Vint *drag)
handlebox Pointer to HandleBox object
action Current drag action drag Current drag stage
vis_HandleBoxDrag - drag the handlebox
void vis_HandleBoxDrag (vis_HandleBox *handlebox, Vint action, Vint drag, Vint ix, Vint iy)
handlebox Pointer to HandleBox object
action Drag action =VIS_ACTION_TRANSLATE Translate handlebox drag Drag stage =VIS_DRAG_INIT Dragger initialization =VIS_DRAG_MOVE Dragger movement =VIS_DRAG_TERM Dragger termination ix Horizontal device coordinate iy Vertical device coordinate
vis_HandleBoxDraw - draw the handlebox
void vis_HandleBoxDraw (vis_HandleBox *handlebox)
handlebox Pointer to HandleBox object
None
The following functions are associated with a PolyBox object.
*vis_PolyBoxBegin - create an instance of a PolyBox object vis_PolyBoxEnd - destroy an instance of a PolyBox object vis_PolyBoxError - return PolyBox object error flag
vis_PolyBoxGetClipPlanes - get clipping plane equations vis_PolyBoxInitPoly - initialize polybox polygon to none vis_PolyBoxSetPoly - set polybox polygon GetPoly - get polybox polygon vis_PolyBoxGetTri - get polygon triangulation vis_PolyBoxGetPenta - get polygon extrusion pentahedra vis_PolyBoxSetObject - set pointers to attribute objects. GetObject - get pointers to attribute objects. vis_PolyBoxSetParami - set polybox display parameters GetParami - get polybox display parameters
vis_PolyBoxTestHit - test for handle hit vis_PolyBoxGetHit - get internal hit status vis_PolyBoxInitHit - initialize internal hit status vis_PolyBoxCurrentDrag - get current drag status vis_PolyBoxDrag - drag the polybox vis_PolyBoxDraw - draw the polybox
The function vis_PolyBoxSetParami may be used to toggle various aspects of the polybox display. Each of the polygon corner points is a selectable handle. Use vis_PolyBoxTestHit to check for handle hits at a given screen location. Use vis_PolyBoxGetHit to get details of the picked handles. Use vis_PolyBoxInitHit to clear the picked handles.
The vis_PolyBoxDraw function is used to draw the polybox. Any picked handles detected with vis_PolyBoxTestHit will be highlighted. The picked handles may be used with the vis_PolyBoxDrag function to interactively move the corners of the polybox.
The polybox is primarily meant to be used as a graphics screen oriented picking device. The function vis_PolyBoxGetTri may be used to return the triangulation of the corners of the polybox. The function vis_PolyBoxGetPenta may be used to get the extruded pentahedra which form the volume the the polybox extruded from the near to the far graphics system z clipping planes. This array of world coordinates and pentahedra connectivity may be passed directly to the Space object functions vis_SpaceBoxGroup and/or vis_SpaceBoxNodeGroup to query for all element and/or node entities lying in the extruded volume.
*vis_PolyBoxBegin - create an instance of a PolyBox object
vis_PolyBox *vis_PolyBoxBegin ()
None
Destroy an instance of a PolyBox object using
void vis_PolyBoxEnd (vis_PolyBox *polybox)
Return the current value of a PolyBox object error flag using
Vint vis_PolyBoxError (vis_PolyBox *polybox)
vis_PolyBoxSetObject - set pointers to attribute objects
void vis_PolyBoxSetObject (vis_PolyBox *polybox, Vint objecttype, Vobject *object)
polybox Pointer to PolyBox object. objecttype The name of the object type to be set. =VIS_COLORMAP ColorMap object =VGL_DRAWFUN DrawFun object =VIS_VISCONTEXT VisContext object object Pointer to the object to be set.
None
vis_PolyBoxGetClipPlanes - get clipping plane equations
void vis_PolyBoxGetClipPlanes (vis_PolyBox *polybox, Vfloat eqn[6][4])
polybox Pointer to PolyBox object.
eqn Plane equations.
vis_PolyBoxInitPoly - initialize polybox polygon to none
void vis_PolyBoxInitPoly (vis_PolyBox *polybox,
polybox Pointer to PolyBox object.
None
vis_PolyBoxSetPoly - set polybox polygon
void vis_PolyBoxSetPoly (vis_PolyBox *polybox, Vint npts, Vfloat pts[][2])
polybox Pointer to PolyBox object. npts Number of points in polygon pts Pixel coordinates of points
None
Get defined polygon as an output argument using
void vis_PolyBoxGetPoly (vis_PolyBox *polybox, Vint *npts, Vfloat pts[][2])
vis_PolyBoxGetTri - get polygon triangulation
void vis_PolyBoxGetTri (vis_PolyBox *polybox, Vint *ntri, Vint tri[][3])
polybox Pointer to PolyBox object.
ntri Number of triangles tri Connectivity of triangles
vis_PolyBoxGetPenta - get polygon extrusion pentahedra
void vis_PolyBoxGetTri (vis_PolyBox *polybox, Vint *npts, Vfloat pts[][3]) Vint *npenta, Vint penta[][6])
polybox Pointer to PolyBox object.
npts Number of points pts Point world coordinates npenta Number of pentahedra penta Pentahedra connectivity
vis_PolyBoxSetParami - set polybox display parameters
void vis_PolyBoxSetParami (vis_PolyBox *polybox, Vint type, Vint param)
polybox Pointer to PolyBox object. type Type of display parameter to set =POLYBOX_PIXTOL Pixel tolerance for handles param Specifies the integer value that ptype will be set to. =VIS_OFF Turn parameter off =VIS_ON Turn parameter on
None
vis_PolyBoxTestHit - test for handle hit
void vis_PolyBoxTestHit (vis_PolyBox *polybox, Vint ix, Vint iy, Vint *hit)
polybox Pointer to PolyBox object ix Horizontal device coordinate iy Vertical device coordinate
hit Hit flag
vis_PolyBoxGetHit - get internal hit status
void vis_PolyBoxGetHit (vis_PolyBox *polybox, Vint *corner)
polybox Pointer to PolyBox object
corner Corner
vis_PolyBoxInitHit - initialize internal hit status
void vis_PolyBoxInitHit (vis_PolyBox *polybox)
polybox Pointer to PolyBox object.
None
vis_PolyBoxCurrentDrag - get current drag status
void vis_PolyBoxCurrentDrag (vis_PolyBox *polybox, Vint *action, Vint *drag)
polybox Pointer to PolyBox object.
action Current drag action drag Current drag stage
vis_PolyBoxDrag - drag the polybox
void vis_PolyBoxDrag (vis_PolyBox *polybox, Vint action, Vint drag, Vint ix, Vint iy)
polybox Pointer to PolyBox object
action Drag action =POLYBOX_ACTION_CORNER Place polygon corner =POLYBOX_ACTION_MOVECORNER Move polygon corner =POLYBOX_ACTION_LINE Stretch line from placed corner. =POLYBOX_ACTION_TRANSLATE Translate polygon drag Drag stage =VIS_DRAG_INIT Dragger initialization =VIS_DRAG_MOVE Dragger movement =VIS_DRAG_TERM Dragger termination ix Horizontal device coordinate iy Vertical device coordinate
vis_PolyBoxDraw - draw the polybox
void vis_PolyBoxDraw (vis_PolyBox *polybox)
polybox Pointer to PolyBox object
None
The WorkPlane object employs a local 2D coordinate system embedded in 3D space called the workplane to constrain the selection of points within a 2D plane. The workplane can be positioned arbitrarily in 3D space. The orientation of the workplane is defined by a pair of 3D vectors which specify the x-axis and y-axis of the local coordinate system of the workplane.
Grid points and/or grid lines may be drawn within the workplane to serve as visual references when selecting points. A snap option is also available which restricts the selection of points to grid points only. A set of pickable handles for translating and rotating the plane may be displayed and queried. The workplane may also be used as a clipping and picking plane.
The following functions are associated with a WorkPlane object.
*vis_WorkPlaneBegin - create an instance of a WorkPlane object vis_WorkPlaneEnd - destroy an instance of a WorkPlane object vis_WorkPlaneError - return WorkPlane object error flag
vis_WorkPlaneGetClipPlane - get clipping plane equation vis_WorkPlaneSetDimensions - set workplane height, width, spacing GetDimensions - get workplane height, width, spacing vis_WorkPlaneGetPlane - get four corners of workplane vis_WorkPlaneSetObject - set pointers to attribute objects. GetObject - get pointers to attribute objects. vis_WorkPlaneSetOriginPlane - set workplane origin and plane GetOriginPlane - get workplane origin and plane vis_WorkPlaneSetParami - set workplane display parameters GetParami - get workplane display parameters
vis_WorkPlaneTestHit - test for handle hit vis_WorkPlaneGetHit - get internal hit status vis_WorkPlaneInitHit - initialize internal hit status vis_WorkPlaneCurrentDrag - get current drag status vis_WorkPlaneDrag - drag the workplane vis_WorkPlaneDraw - draw the workplane vis_WorkPlaneGridPoint - get a grid point vis_WorkPlaneNumGrid - get number of grid points
The workplane may be optionally used as a clipping plane. The user may either activate an internal call to the vgl_DrawFunClipPlane function or query for the current clipping plane equation using vis_WorkPlaneGetClipPlane and manage the clipping plane interface to the graphics subsystem externally.
The function vis_WorkPlaneGetPlane may be used to return the world coordinates of the corners of the workplane. This array of world coordinates may be passed directly to the Space object function vis_SpacePlaneGroup to query for all element entities lying on the plane.
*vis_WorkPlaneBegin - create an instance of a WorkPlane object
vis_WorkPlane *vis_WorkPlaneBegin ()
None
Destroy an instance of a WorkPlane object using
void vis_WorkPlaneEnd (vis_WorkPlane *workplane)
Return the current value of a WorkPlane object error flag using
Vint vis_WorkPlaneError (vis_WorkPlane *workplane)
vis_WorkPlaneSetObject - set pointers to attribute objects
void vis_WorkPlaneSetObject (vis_WorkPlane *workplane, Vint objecttype, Vobject *object)
workplane Pointer to WorkPlane object. objecttype The name of the object type to be set. =VIS_COLORMAP ColorMap object =VGL_DRAWFUN DrawFun object =VIS_TRANSMAP TransMap object =VIS_VISCONTEXT VisContext object object Pointer to the object to be set.
None
vis_WorkPlaneGetClipPlane - get clipping plane equation
void vis_WorkPlaneGetClipPlane (vis_WorkPlane *workplane, Vfloat eqn[4])
workplane Pointer to WorkPlane object.
eqn Plane equation.
vis_WorkPlaneSetDimensions - set workplane height, width, spacing
void vis_WorkPlaneSetDimensions (vis_WorkPlane *workplane, Vfloat xspace, Vfloat yspace, Vfloat negwidth, Vfloat poswidth, Vfloat negheight, Vfloat posheight)
workplane Pointer to WorkPlane object. xspace Grid x spacing yspace Grid y spacing negwidth Negative width poswidth Positive width negheight Negative height posheight Positive height
None
Get defined dimensions as output arguments using
void vis_WorkPlaneGetDimensions (vis_WorkPlane *workplane, Vfloat *xspace, Vfloat *yspace, Vfloat *negwidth, Vfloat *poswidth, Vfloat *negheight, Vfloat *posheight)
vis_WorkPlaneGetPlane - get four corners of workplane
void vis_WorkPlaneGetPlane (vis_WorkPlane *workplane, Vfloat pln[4][3])
workplane Pointer to WorkPlane object.
pln Array of coordinate locations of workplane corners
vis_WorkPlaneSetOriginPlane - set workplane origin and plane
void vis_WorkPlaneSetOriginPlane (vis_WorkPlane *workplane, Vfloat origin[3], Vfloat right[3], Vfloat up[3])
workplane Pointer to WorkPlane object origin Point at which the workplane origin will be located right Vector in direction of workplane local x' axis. up Vector in direction of workplane local y' axis.
None
Get origin, right and up as output arguments using
void vis_WorkPlaneGetOriginPlane (vis_WorkPlane *workplane, Vfloat origin[3], Vfloat right[3], Vfloat up[3])
vis_WorkPlaneSetParami - set workplane display parameters
void vis_WorkPlaneSetParami (vis_WorkPlane *workplane, Vint type, Vint param)
workplane Pointer to WorkPlane object. type Type of display parameter to set =WORKPLANE_AXES Draw workplane axes =WORKPLANE_GRID Draw workplane grid =WORKPLANE_GRID_LINE Draw grid as lines =WORKPLANE_GRID_POINT Draw grid as points =WORKPLANE_GRID_SNAP Snap to grid location =WORKPLANE_ORIGIN Draw workplane origin =WORKPLANE_OUTLINE Draw workplane outline param Specifies the integer value that ptype will be set to. =VIS_OFF Turn parameter off =VIS_ON Turn parameter on
None
The parameter WORKPLANE_GRID specifies that a grid will be drawn for the workplane. By default WORKPLANE_GRID is set to VIS_OFF.
The parameter WORKPLANE_GRID_LINE specifies that grid lines will be drawn for the workplane. By default WORKPLANE_GRID_LINE is set to VIS_OFF.
The parameter WORKPLANE_GRID_POINT specifies that grid points will be drawn for the workplane. By default WORKPLANE_GRID_POINT is set to VIS_OFF.
The parameter WORKPLANE_GRID_SNAP specifies that a point selected from the workplane will snap to the closest grid point. By default WORKPLANE_GRID_SNAP is set to VIS_OFF.
The parameter WORKPLANE_GRID_X_SPACE specifies in world coordinates the x spacing between grid points or lines. By default WORKPLANE_GRID_X_SPACE is set to 1.0.
The parameter WORKPLANE_ORIGIN specifies that the origin will be drawn for the workplane. By default WORKPLANE_ORIGIN is set to VIS_ON.
The parameter WORKPLANE_OUTLINE specifies that the outline of the workplane will be drawn. By default WORKPLANE_OUTLINE is set to VIS_ON.
vis_WorkPlaneTestHit - test for handle hit
void vis_WorkPlaneTestHit (vis_WorkPlane *workplane, Vint ix, Vint iy, Vint *hit, Vfloat pt[3])
workplane Pointer to WorkPlane object ix Horizontal device coordinate iy Vertical device coordinate
hit Hit flag pt Returned point on workplane in world coordinates
vis_WorkPlaneGetHit - get internal hit status
void vis_WorkPlaneGetHit (vis_WorkPlane *workplane, Vint *igrid, Vint *jgrid, Vint *thand)
workplane Pointer to WorkPlane object
igrid Horizontal grid point jgrid Vertical grid point thand Manipulation handle
vis_WorkPlaneInitHit - initialize internal hit status
void vis_WorkPlaneInitHit (vis_WorkPlane *workplane)
workplane Pointer to WorkPlane object
None
vis_WorkPlaneCurrentDrag - get current drag status
void vis_WorkPlaneCurrentDrag (vis_WorkPlane *workplane, Vint *action, Vint *drag)
workplane Pointer to WorkPlane object
action Current drag action drag Current drag stage
vis_WorkPlaneDrag - drag the workplane
void vis_WorkPlaneDrag (vis_WorkPlane *workplane, Vint action, Vint drag, Vint ix, Vint iy)
workplane Pointer to WorkPlane object
action Drag action =VIS_ACTION_TRANSLATE Translate workplane =VIS_ACTION_ROTATE Rotate workplane drag Drag stage =VIS_DRAG_INIT Dragger initialization =VIS_DRAG_MOVE Dragger movement =VIS_DRAG_TERM Dragger termination ix Horizontal device coordinate iy Vertical device coordinate
vis_WorkPlaneDraw - draw the workplane
void vis_WorkPlaneDraw (vis_WorkPlane *workplane)
workplane Pointer to WorkPlane object
None
vis_WorkPlaneGridPoint - get a grid point from a workplane
void vis_WorkPlaneGridPoint (vis_WorkPlane *workplane, Vint i, Vint j, Vfloat pt[3])
i I index for the grid point j J index for the grid point
pt Returned grid point in world coordinates at i,j
vis_WorkPlaneNumGrid - get the number of grid points for a workplane
void vis_WorkPlaneNumGrid (vis_WorkPlane *workplane, Vint *numi, Vint *numj)
workplane Pointer to WorkPlane object
numi Number of grid points in the local x' direction. numj Number of grid points in the local y' direction.