*vis_AxisBegin - create an instance of an Axis object vis_AxisEnd - destroy an instance of an Axis object vis_AxisError - return Axis object error flag
vis_AxisSetObject - set pointers to attribute objects. vis_AxisSetParami - set axis display parameters vis_AxisSetPlane - set axis orientation
vis_AxisPath - draw axis along path vis_AxisPlane - draw axis grid lines in plane vis_AxisProjection - draw axis grid lines along projection
Each axis visualization entity is composed of up to three separately drawn parts - the path, plane and projection, drawn using vis_AxisPath, vis_AxisPlane and vis_AxisProjection respectively. The terms path, plane and projection simply refer to the 3 orthogonal directions of the axis orientation direction cosine matrix. This orientation matrix is defined in a manner similar to that used for defining orientations in the Font module. The path is the primary axis direction. When the path component of the axis is drawn, the axis itself as well as titles, labels and intermediate tic marks are generated. The extension of the grid lines, which pass through the labelled points of the axis, into orthogonal planes is done by drawing the plane and projection components. For example, for a conventional XY graph, two axes and their associated plane components are required to generate the X and Y axes and the intersecting grid lines in the XY plane. A three dimensional XYZ graph would require three axes and the grid lines corresponding to the plane and projection components for each axis. Axis visualization entities are not subject to isosurface clipping.
By default all axis titles and numeric labels are drawn using a stroked font. The use of a stroked font as opposed to a raster font for drawing titles and labels may be toggled on or off using vis_AxisSetParami with the parameter AXIS_STROKEFONT.
*vis_AxisBegin - create an instance of a Axis object
vis_Axis *vis_AxisBegin ()
None
Destroy an instance of a Axis object using
void vis_AxisEnd (vis_Axis *axis)
Return the current value of a Axis object error flag using
Vint vis_AxisError (vis_Axis *axis)
vis_AxisSetObject - set pointers to attribute objects
void vis_AxisSetObject (vis_Axis *axis, Vint objecttype, Vobject *object)
axis Pointer to Axis object. objecttype The name of the object type to be set. =VGL_DRAWFUN DrawFun object =VIS_VISCONTEXT VisContext object =VIS_LEVELS Levels object =VIS_COLORMAP ColorMap object =VIS_TRANSMAP TransMap object object Pointer to the object to be set.
None
vis_AxisSetParami - set axis display parameters
void vis_AxisSetParami (vis_Axis *axis, Vint ptype, Vint iparam)
axis Pointer to Axis object. ptype Type of display parameter to set =AXIS_FIRSTLABEL Draw first axis label =AXIS_FIRSTGRID Draw first grid line on the axis plane and projection =AXIS_LABELUSELEVELS Toggle Levels labels. =AXIS_LASTGRID Draw last grid line on the axis plane and projection =AXIS_PLANEEND Draw axis at end of axis plane =AXIS_ROTATELABEL Rotate label + or - 90 degrees =AXIS_SENSE Set left handedness of axis =AXIS_SHORTGRID Specify short grid lines on the axis plane and projection =AXIS_STROKEFONT Toggle use of stroked font labels. iparam Specifies the integer value that ptype will be set to. =VIS_OFF Turn parameter off =VIS_ON Turn parameter on =AXIS_ROTATELABEL_NONE Do not rotate label =AXIS_ROTATELABEL_PLUS90 Rotate label +90 degrees =AXIS_ROTATELABEL_MINUS90 Rotate label -90 degrees
None
The labels may be drawn using the text labels contained in the Levels attribute object by enabling the AXIS_LABELUSELEVELS parameter. By default AXIS_LABELUSELEVELS is set to off.
Specify the drawing of the first grid line on axis plane and projections. This grid line normally coincides in space with the axes of orthogonal axes. By default AXIS_FIRSTGRID is set to off.
Specify the drawing of the last grid line on axis plane and projections. By default AXIS_LASTGRID is set to on.
Specify the drawing of an axis at the end of the axis plane. If this parameter is enabled it is a good idea to disable AXIS_LASTGRID when drawing the plane and projection or orthogonal axes. By default AXIS_PLANEEND is set to off.
Set rotation of axis labels using AXIS_ROTATELABEL. The label may be rotated by +90. degrees using AXIS_ROTATELABEL_PLUS90. and by -90. degrees using AXIS_ROTATELABEL_MINUS90. By default AXIS_ROTATELABEL is set to XIS_ROTATELABEL_NONE.
Set axis sense. By default AXIS_SENSE is set to off.
Set short grid line flag. If this flag is enabled short grid lines are drawn on the axis plane and projection. Plane fill, if specified, is always drawn to fill the entire plane. By default AXIS_SHORTGRID is set to off.
Toggle the use of a stroked font as opposed to a raster font for drawing titles and labels. By default AXIS_STROKEFONT is set to VIS_ON.
vis_AxisSetPlane - set axis orientation
void vis_AxisSetPlane (vis_Axis *axis, Vfloat path[3], Vfloat plane[3])
axis Pointer to Axis object. path Vector in direction of axis path. plane Vector in direction of axis plane.
None
Get path and plane as output arguments using
void vis_AxisGetPlane (vis_Axis *axis, Vfloat path[3], Vfloat plane[3])
vis_AxisPath - draw axis path
void vis_AxisPath (vis_Axis *axis, Vfloat x[3], Vfloat length, Vchar title[], Vchar subtitle[])
axis Pointer to Axis object. x Origin of axis length Length of axis along path title Axis title subtitle Axis subtitle
None
vis_AxisPlane - draw grid lines and plane fill in plane
void vis_AxisPlane (vis_Axis *axis, Vfloat x[3], Vfloat length, Vfloat lengthy, Vchar title[], Vchar subtitle[])
axis Pointer to Axis object. x Origin of axis length Length of axis along path lengthy Length of grid lines along plane title Axis title subtitle Axis subtitle
None
vis_AxisProjection - draw grid lines along projection
void vis_AxisProjection (vis_Axis *axis, Vfloat x[3], Vfloat length, Vfloat lengthz, Vchar title[], Vchar subtitle[])
axis Pointer to Axis object. x Origin of axis length Length of axis along path lengthz Length of grid lines along projection title Axis title subtitle Axis subtitle
None
A Billboard object allows you to insert items (text, lines, points, polygons, etc.) and spacing information in a manner similar to a typewriter, in which one adds a series of text, from the top down, separated by spaces and newlines. A Billboard object will automatically adjust its width and height so that it encloses the items contained in it.
The Billboard object employs a 2D coordinate system based on a the size of a text box. The dimensions of the text box are defined in the visualization context TextBox. A single character (e.g., 'a') will have the width and height of one text box. The dimensions of geometric items (e.g., lines, polygons, rectangles, etc.) are specified in terms of a text box. Therefore, the string "abcd" and a line of length 4.0 will have the same length. Positive x and y is to the right and up, respectively.
The placement of items within the billboard is performed using a current (x, y) position stored in the Billboard object. Initially, the current position is at the top left of the billboard. When an item is added, it is placed at the current position within the billboard. The current position is then automatically incremented in x, depending on the item. For example, adding the text string "stress" will increment the current x position by six units; adding a line of width 2.5 will increment the current x position by 2.5 units. Adding spaces and incrementing the current y position must be done explicitly.
Billboard visualization entities are not subject to isosurface clipping.
The functions associated with a Billboard object are the following.
*vis_BillboardBegin - create an instance of an Billboard object vis_BillboardEnd - destroy an instance of an Billboard object vis_BillboardError - return Billboard object error flag
vis_BillboardSetObject - set pointers to attribute objects. vis_BillboardSetParami - set display parameters vis_BillboardSetItemParami - set item parameters vis_BillboardSetItemParamfv - set item parameters
vis_BillboardErase - erase all items vis_BillboardLineItem - add a line item vis_BillboardPointItem - add a point item vis_BillboardPolygonItem - add a polygon item vis_BillboardRectangleItem - add a rectangle item vis_BillboardRuleItem - add a rule item vis_BillboardTextItem - add a text string vis_BillboardTitleItem - add a title item
vis_BillboardNewLine - increment current y position vis_BillboardSpace - increment current x position
vis_BillboardDraw - draws the contents of a billboard
A Billboard object requires a VisContext object for the billboard background and border colors and transparency. It is also used to define the size of a text box used for positioning items.
If a TransMap attribute object is not set then transparency is ignored.
A Billboard object uses the following VisContext components.
Figure 9-2 illustrates a simple billboard that could be used to display summary information about a specific finite element. The billboard is always drawn screen oriented (perpendicular to the viewer) and anchored at a 3D world coordinate. This allows it to be anchored in 3D to the entity which it describes.
*vis_BillboardBegin - create an instance of a Billboard object
vis_Billboard *vis_BillboardBegin ()
None
Destroy an instance of a Billboard object using
void vis_BillboardEnd (vis_Billboard *billboard)
Return the current value of a Billboard object error flag using
Vint vis_BillboardError (vis_Billboard *billboard)
vis_BillboardSetObject - set pointers to attribute objects
void vis_BillboardSetObject (vis_Billboard *billboard, Vint objecttype, Vobject *object)
billboard Pointer to Billboard object. objecttype The name of the object type to be set. =VGL_DRAWFUN DrawFun object =VIS_VISCONTEXT VisContext object =VIS_COLORMAP ColorMap object =VIS_TRANSMAP TransMap object object Pointer to the object to be set.
None
vis_BillboardSetParami - set display parameters
void vis_BillboardSetParami (vis_Billboard *billboard, Vint ptype, Vint iparam)
billboard Pointer to Billboard object. ptype Type of display parameter to set =BILLBOARD_BEVEL Draw billboard with bevels =BILLBOARD_OFFSET_VECTOR Draw billboard with location vector iparam Specifies the integer value that ptype will be set to. =VIS_OFF Turn parameter off =VIS_ON Turn parameter on
None
Specify the drawing of an arrow from the billboard position to its anchor point. The vector is drawn only if the billboard has a nonzero offset from the anchor point specified by the DeviceOffset visualization context. By default BILLBOARD_OFFSET_VECTOR is set to off.
vis_BillboardSetItemParami - set item integer parameters
void vis_BillboardSetItemParami (vis_Billboard *billboard, Vint ptype, Vint iparam)
billboard Pointer to Billboard object. ptype Type of current item display parameter to set =BILLBOARD_COLOR Set the item color =BILLBOARD_POINT_SIZE Set the point size for point items =BILLBOARD_LINE_WIDTH Set the line width for line, rule, and polyline items =BILLBOARD_LINE_STYLE Set the line style for line, rule, and polyline items =BILLBOARD_RULE_BEVEL Draw rule with bevels =BILLBOARD_SHADOW_COLOR Set the shadow color for beveled rules. =BILLBOARD_TRANSPARENCY Set the item transparency iparam Specifies the integer value that ptype will be set to. =VIS_OFF Turn parameter off =VIS_ON Turn parameter on =VIS_SOLID Solid line style =VIS_DASHDASH Dashed line style =VIS_DOTDOT Dotted line style =VIS_DOTDASH Dotted/dashed line style
None
Specify the point size used to draw a point item. By default BILLBOARD_POINT_SIZE is set to one.
Specify the line width used to draw line, rule, and polyline items. By default BILLBOARD_LINE_WIDTH is set to one.
Specify the line style used to draw line, rule, and polyline items. By default BILLBOARD_LINE_STYLE is set to VIS_SOLID.
Specify the rule style used to draw a rule item. By default BILLBOARD_RULE_STYLE is set to BILLBOARD_RULE_STYLE_NONE.
Specify the transparency used to draw items. The transparency value is an index for a transparency map object. By default BILLBOARD_TRANSPARENCY is set to one.
vis_BillboardSetItemParamfv - set item float vector parameters
void vis_BillboardSetItemParamfv (vis_Billboard *billboard, Vint ptype, Vfloat fparam[])
billboard Pointer to Billboard object ptype Type of parameter to set =BILLBOARD_OFFSET Offset of an item fparam Specifies the float values that ptype will be set to.
None
vis_BillboardErase - erase all items
void vis_BillboardErase (vis_Billboard *billboard)
billboard Pointer to Billboard object
None
vis_BillboardLineItem - add a line item
void vis_BillboardLineItem (vis_Billboard *billboard, Vfloat length)
billboard Pointer to Billboard object length Length of the line
None
vis_BillboardPointItem - add a point item
void vis_BillboardPointItem (vis_Billboard *billboard)
billboard Pointer to Billboard object
None
vis_BillboardPolygonItem - add a polygon item
void vis_BillboardPolygonItem (vis_Billboard *billboard, Vint npts, Vfloat pts[][2], Vint fill)
billboard Pointer to Billboard object npts Number of points defining the polygon pts Points defining the polygon fill Flag specifying a filled polygon
None
vis_BillboardRectangleItem - add a rectangle item
void vis_BillboardRectangleItem (vis_Billboard *billboard, Vfloat width, Vfloat height, Vint solid)
billboard Pointer to Billboard object width Width of the rectangle height Height of the rectangle solid Flag specifying a solid rectangle
None
vis_BillboardRuleItem - add a rule item
void vis_BillboardRuleItem (vis_Billboard *billboard)
billboard Pointer to Billboard object
None
vis_BillboardTextItem - add a text item
void vis_BillboardTextItem (vis_Billboard *billboard, Vchar *text) void vis_BillboardTextItemtv (vis_Billboard *billboard, Vtchar *text)
billboard Pointer to Billboard object text Text string
None
vis_BillboardTitleItem - add a title item
void vis_BillboardTitleItem (vis_Billboard *billboard, Vchar *title) void vis_BillboardTitleItemtv (vis_Billboard *billboard, Vtchar *title)
billboard Pointer to Billboard object title Title string
None
vis_BillboardNewLine - increment the current y position
void vis_BillboardNewLine (vis_Billboard *billboard, Vfloat nlines)
billboard Pointer to Billboard object nlines Number of lines to increment
None
vis_BillboardSpace - increment the current x position
void vis_BillboardSpace (vis_Billboard *billboard, Vfloat nspaces)
billboard Pointer to Billboard object nspaces Number of spaces to increment
None
vis_BillboardDraw - display the contents of a billboard
void vis_BillboardDraw (vis_Billboard *billboard, Vfloat x[3])
billboard Pointer to Billboard object x World coordinate anchor point
None
The Dimension object employs a local coordinate system embedded in 3D space called the dimension plane to define the placement of the dimensioning lines and text. The orientation of the dimension plane is defined by a pair of 3D vectors. The x',y',z' axes of local coordinate system define the "horizontal", "vertical" and "indepth" directions of the dimensioning annotation.
There are two basic types of dimensioning annotation, linear dimensions and leader lines. A linear dimension is used to label the straight line distance between two points. It consists of two extension lines, a dimension line, a label and in some cases a leader line. The extension lines are lines drawn from the two points which define a straight line feature to the position of the dimension line and label. The dimension line is drawn perpendicular to the extension lines and defines the straight line distance between the two points. A linear dimension can be oriented to be horizontal, vertical, in depth or aligned with the angle of a feature.
A leader line is used to dimension specific features (e.g., holes) and consists of a line pointing to the feature and a label. A special type of leader termed a radius leader line can be used to dimension the radius of a circular feature.
The following functions are associated with a Dimension object.
*vis_DimensionBegin - create an instance of a Dimension object vis_DimensionEnd - destroy an instance of a Dimension object vis_DimensionError - return Dimension object error flag
vis_DimensionSetObject - set pointers to attribute objects. vis_DimensionSetParamf - set float display parameters vis_DimensionSetParami - set integer display parameters vis_DimensionSetPlane - set dimension orientation
vis_DimensionAngular - draw angular dimension vis_DimensionLeader - draw leader line vis_DimensionLinear - draw linear dimension vis_DimensionRadius - draw radius leader line
All linear dimension annotation drawn using vis_DimensionLinear uses two points to define the feature to be dimensioned and a single point for positioning the dimensioning label. The dimension line is drawn through the label point parallel to an axis of the local coordinate system (horizontal, vertical or depth axis) or parallel to the line between the feature points. Extension lines are drawn from the feature points to the dimension line. The extension lines are constructed to be perpendicular to the dimension line. The label may be drawn horizontally or aligned to the dimension line. The dimension label is positioned along the dimension line in different ways depending upon user options and whether it is located inside or outside of the extension lines. The user may specify that the label be automatically placed by calling vis_DimensionSetParami with the DIMENSION_LABEL_AUTO parameter enabled. In this case the label is centered exactly between the extension lines if its original input location is between the extension lines and it is positioned at a user specified offset from an extension line if its original input location is outside the extension lines. If the automatic placement option is not enabled the label is placed exactly at the original input location. The use of a stroked font as opposed to a raster font for drawing labels may be toggled on or off using the parameter DIMENSION_STROKEFONT. Figure 9-3a illustrates a linear dimension annotation aligned (drawn parallel) to the line between the feature points and centered between the extension lines.
*vis_DimensionBegin - create an instance of a Dimension object
vis_Dimension *vis_DimensionBegin ()
None
Destroy an instance of a Dimension object using
void vis_DimensionEnd (vis_Dimension *dimension)
Return the current value of a Dimension object error flag using
Vint vis_DimensionError (vis_Dimension *dimension)
vis_DimensionSetObject - set pointers to attribute objects
void vis_DimensionSetObject (vis_Dimension *dimension, Vint objecttype, Vobject *object)
dimension Pointer to Dimension 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_DimensionSetParamf - set dimension display parameters
void vis_DimensionSetParamf (vis_Dimension *dimension, Vint ptype, Vfloat fparam)
dimension Pointer to Dimension object. ptype Type of display parameter to set =DIMENSION_ANGLE Angle of leader lines =DIMENSION_GAP Extension line gap =DIMENSION_LABEL_ANGLE Angle of label =DIMENSION_OFFSET Length of horizontal leader fparam Specifies the float value that ptype will be set to.
None
The parameter DIMENSION_GAP specifies gap of extension lines from feature locations in world coordinates. By default DIMENSION_GAP is set to 0.0.
The parameter DIMENSION_LABEL_ANGLE specifies an additional angle of rotation to be applied to labels. By default DIMENSION_LABEL_ANGLE is set to 0.0.
The parameter DIMENSION_OFFSET specifies the length of certain segments of leader lines and dimension lines. If DIMENSION_LABEL_AUTO is enabled using vis_DimensionSetParami then the length of the horizontal segment of a leader line drawn using vis_DimensionLeader or vis_DimensionRadius is constrained to be DIMENSION_OFFSET. Any leader lines outside extension lines drawn using vis_DimensionLinear or vis_DimensionAngular are constrained to be of length DIMENSION_OFFSET. By default DIMENSION_OFFSET is set to 1.0.
vis_DimensionSetParami - set dimension display parameters
void vis_DimensionSetParami (vis_Dimension *dimension, Vint ptype, Vint iparam)
dimension Pointer to Dimension object. ptype Type of display parameter to set =DIMENSION_ANGLE_LOCK Constrain angle of leader lines =DIMENSION_CENTER_MARK Mark center point of radius leader =DIMENSION_EXTENSIONLINES Toggle drawing of extension lines =DIMENSION_LABEL_ALIGN Label alignment =DIMENSION_LABEL_AUTO Place label at specified offset =DIMENSION_LABEL_POSITION Anchor label at specified position =DIMENSION_INSIDE Place dimension lines on inside of extension lines =DIMENSION_LINEAR_ALIGN Linear dimension alignment =DIMENSION_NOHEAD_FIRST No head on first arrow =DIMENSION_NOHEAD_SECOND No head on second arrow =DIMENSION_STROKEFONT Toggle use of stroked font labels. fparam Specifies the float value that ptype will be set to. iparam Specifies the integer value that ptype will be set to. =VIS_OFF Turn parameter off =VIS_ON Turn parameter on =DIMENSION_HORIZONTAL Orient horizontally =DIMENSION_VERTICAL Orient vertically =DIMENSION_INDEPTH Orient in depth =DIMENSION_ALIGNED Align in line =DIMENSION_ORTHOGONAL Align orthogonally =VIS_CENTER Anchor label at label center =VIS_RIGHT Anchor label at label right =VIS_LEFT Anchor label at label left
None
The parameter DIMENSION_CENTER_MARK indicates whether the center mark of radius leader lines are to be drawn with a cross. By default DIMENSION_CENTER_MARK is set to VIS_ON.
The parameter DIMENSION_EXTENSIONLINES toggles the drawing of linear dimension extension lines. By default DIMENSION_EXTENSIONLINES is set to VIS_ON.
The parameter DIMENSION_LABEL_ALIGN specifies the alignment of the label. DIMENSION_HORIZONTAL will orient the label parallel to the local x' axis, DIMENSION_ALIGNED will orient the label parallel with the dimension line, and DIMENSION_ORTHOGONAL will orient the label at a right angle with the dimension line. By default DIMENSION_LABEL_ALIGN is set to DIMENSION_HORIZONTAL.
The parameter DIMENSION_LABEL_AUTO specifies the automatic placement of labels. Normally, labels are placed at the location specified when defining a dimension. If DIMENSION_LABEL_AUTO is enabled then labels are placed at an offset from the dimensioning lines. The offset is specified using vis_DimensionSetParamf with the parameter DIMENSION_OFFSET. If the label is between the extension lines it is centered. All labels placed drawing leaders with vis_DimensionLeader and vis_DimensionRadius are constrained to be a horizontal distance DIMENSION_OFFSET from the angled leader line. By default DIMENSION_LABEL_AUTO is set to VIS_ON.
The parameter DIMENSION_LABEL_POSITION specifies the position on the label that linear dimension labels will be anchored. A position of VIS_LEFT will anchor the label at its left extent. A position of VIS_RIGHT will anchor the label at its right extent. By default DIMENSION_LABEL_POSITION is set to VIS_CENTER.
The parameter DIMENSION_LINEAR_ALIGN specifies the orientation of linear dimensions with respect to the local coordinate system. DIMENSION_VERTICAL will orient the dimension line parallel to the local y' axis; DIMENSION_HORIZONTAL will orient it parallel to the local x' axis; DIMENSION_INDEPTH will orient it parallel to the local z' axis; DIMENSION_ALIGNED will orient it parallel with the line between the two feature delineation points. By default DIMENSION_LINEAR_ALIGN is set to DIMENSION_HORIZONTAL.
The parameter DIMENSION_INSIDE specifies that linear dimension lines will be drawn on the inside of the extension lines. By default DIMENSION_INSIDE is set to VIS_ON.
The parameters DIMENSION_NOHEAD_FIRST and DIMENSION_NOHEAD_SECOND are designed to control the drawing of arrow heads on linear dimension lines. By default DIMENSION_NOHEAD_FIRST and DIMENSION_NOHEAD_SECOND are set to VIS_OFF. Note that all arrow heads are disabled if the visualization context VIS_VECTORNOHEAD flag is enabled.
Toggle the use of a stroked font as opposed to a raster font for drawing labels. By default DIMENSION_STROKEFONT is set to VIS_ON.
vis_DimensionSetPlane - set dimension plane
void vis_DimensionSetPlane (vis_Dimension *dimension, Vfloat right[3], Vfloat up[3])
dimension Pointer to Dimension object right Vector in direction of dimension local x' axis. up Vector in direction of dimension local y' axis.
None
Get right and up as output arguments using
void vis_DimensionGetPlane (vis_Dimension *dimension, Vfloat right[3], Vfloat up[3])
vis_DimensionAngular - draw angular dimension
void vis_DimensionAngular (vis_Dimension *dimension, Vfloat x1[3], Vfloat x2[3], Vfloat xcenter[3], Vfloat xlabel[3], Vchar *label)
dimension Pointer to Dimension object. x1 First feature location x2 Second feature location xcenter Center of circle xlabel Dimension line location label Label
None
The position of xlabel relative to the extension lines determines where the label is drawn: to the left, right or in the center of the extension lines. If xlabel is to the left or right of the extension lines and DIMENSION_LABEL_AUTO is on then label will be drawn a fixed distance to the left or right from the extension lines, otherwise the label will be drawn at xlabel. If xlabel is inside the extension lines then label will be drawn centered.
vis_DimensionLeader - draw a leader dimension
void vis_DimensionLeader (vis_Dimension *dimension, Vfloat x[3], Vfloat xlabel[3], Vchar *label)
dimension Pointer to Dimension object. x Feature location xlabel Label location label Label
None
vis_DimensionLinear - draw a linear dimension
void vis_DimensionLinear (vis_Dimension *dimension, Vfloat x1[3], Vfloat x2[3], Vfloat xlabel[3], Vchar *label)
dimension Pointer to Dimension object. x1 First feature location x2 Second feature location xlabel Dimension line location label Label
None
If xlabel is to the left or right of the extension lines and DIMENSION_LABEL_AUTO is on then label will be drawn a fixed distance to the left or right from the extension lines, otherwise the label will be drawn at xlabel. If xlabel is inside the extension lines then label will be drawn centered.
If DIMENSION_LINEAR_ALIGN is set to DIMENSION_HORIZONTAL then the dimension line will be drawn passing through the point xlabel parallel to the dimension plane x' axis; if it is set to DIMENSION_VERTICAL it will be drawn parallel to the y' axis; if it is set to DIMENSION_INDEPTH it will be drawn parallel to the z' axis; if it is set to DIMENSION_ALIGNED then it will be drawn parallel to the two feature delineation points x1 and x2.
vis_DimensionRadius - draw a circle radius leader line dimension
void vis_DimensionRadius (vis_Dimension *dimension, Vfloat x[3], Vfloat xcenter[3], Vfloat xlabel[3], Vchar *label)
dimension Pointer to Dimension object. x Feature location xcenter Center of circle xlabel Label location label Label
None
*vis_FontBegin - create an instance of a Font object vis_FontEnd - destroy an instance of a Font object vis_FontError - return Font object error flag
vis_FontSetObject - set pointers to attribute objects. vis_FontSetParam - set font display parameters vis_FontSetPlane - set font orientation
vis_FontLoad - load font description
vis_FontText - draw stroked text
vis_FontLength - calculate text string length
Figure 9-4 illustrates a number of font styles.
*vis_FontBegin - create an instance of a Font object
vis_Font *vis_FontBegin ()
None
Destroy an instance of a Font object using
void vis_FontEnd (vis_Font *font)
Return the current value of a Font object error flag using
Vint vis_FontError (vis_Font *font)
vis_FontSetObject - set pointers to attribute objects
void vis_FontSetObject (vis_Font *font, Vint objecttype, Vobject *object)
font Pointer to Font object. objecttype The name of the object type to be set. =VGL_DRAWFUN DrawFun object =VIS_VISCONTEXT VisContext object =VIS_COLORMAP ColorMap object =VIS_TRANSMAP TransMap object object Pointer to the object to be set.
None
vis_FontSetParam - set font display parameters
void vis_FontSetParamf (vis_Font *font, Vint ptype, Vfloat fparam) void vis_FontSetParami (vis_Font *font, Vint ptype, Vint iparam)
font Pointer to Font object. ptype Type of display parameter to set =FONT_ANGLE Set text string rotation angle =FONT_DIRECTION Set text string direction =FONT_EXPANSION Set text string expansion factor =FONT_EXTRUSION Set text string extrusion distance =FONT_SLANT Set font character slant =FONT_SPACING Set font character spacing fparam Specifies the float value that ptype will be set to. iparam Specifies the integer value that ptype will be set to. =VIS_LEFT Direction to left =VIS_RIGHT Direction to right =VIS_TOP Direction to top =VIS_BOTTOM Direction to bottom
None
Set text string direction relative to font path. By default FONT_DIRECTION is set to VIS_RIGHT.
Set font expansion factor. The expansion factor scales the width of each character such that the character height to width aspect ratio is changed. An expansion factor less then unity contracts the width of a character, a factor greater than unity increases the width. The expansion factor also applies to the amount of space between characters. By default FONT_EXPANSION is set to 1.
Set the distance that stroked text characters are to be extruded. The extrusion distance is normal to the font plane. Font extrusion results in a shaded 3D text string. By default FONT_EXTRUSION is set to 0.
Set the slant of stroked text characters. A slant of unity results in characters italicized at a 45 degree angle. A slant of zero results in no slant. By default FONT_SLANT is set to 0.
Set the spacing of stroked text characters. The character spacing inserts additional space between characters within a text string without changing the character size. By default FONT_SPACING is set to 0.
vis_FontSetPlane - set font orientation
void vis_FontSetPlane (vis_Font *font, Vfloat path[3], Vfloat plane[3])
font Pointer to Font object. path Vector in direction of font path. plane Vector in direction of font plane.
None
Get path and plane as output arguments using
void vis_FontGetPlane (vis_Font *font, Vfloat path[3], Vfloat plane[3])
vis_FontLoad - read a font description file
void vis_FontLoad (vis_Font *font, Vint ifont)
font Pointer to Font object. ifont Stroked font type to load =FONT_STANDARD Default fixed width font =FONT_GREEK Greek letters =FONT_ITALICS Italics =FONT_ROMAN1 Roman =FONT_ROMAN2 Roman =FONT_BOLDSCRIPT Bold script =FONT_FILLROMAN1 Outlined roman =FONT_FILLROMAN2 Outlined roman =FONT_GOTHIC Gothic =FONT_SCRIPT Script =FONT_UNCIAL Interesting
None
vis_FontText - draw font text string
void vis_FontText (vis_Font *font, Vfloat x[3], const Vchar text[])
font Pointer to Font object. x Anchor point of text string text Text string
None
vis_FontLength - compute length of text string
void vis_FontLength (vis_Font *font, const Vchar text[], Vfloat *length)
font Pointer to Font object. text Text string
length Length of text string
*vis_GlyphBegin - create an instance of a Glyph object vis_GlyphEnd - destroy an instance of a Glyph object vis_GlyphError - return Glyph object error flag
vis_GlyphSetObject - set pointers to attribute objects. vis_GlyphSetOrientTriad - set glyph orientation vis_GlyphSetOrientZ - set glyph orientation in z direction vis_GlyphSetOrientXY - set glyph orientation in x,y directions
vis_GlyphArrow2D - draw 2D arrow vis_GlyphArrow2D3D - draw mixed 2D, 3D arrow vis_GlyphArrow3D - draw 3D arrow vis_GlyphBox - draw box vis_GlyphCircle - draw circle vis_GlyphCone - draw cone vis_GlyphConicalFrustum - draw conical frustum vis_GlyphCylinder - draw cylinder vis_GlyphDisk - draw disk vis_GlyphEllipsoid - draw ellipsoid vis_GlyphRectangle - draw rectangle vis_GlyphSphere - draw sphere vis_GlyphTriaxis - draw triaxis
The following convention for the direction cosine matrices of a local coordinate system is used. Given that x',y' and z' are three orthonormal vectors indicating the direction of the local coordinate axes in the global coordinate system (x,y,z), then the direction cosine matrix, tm for this local coordinate system is defined as:
where y'x, for example, is the global x coordinate of the y' unit vector.tm[0][0] = x'x tm[0][1] = x'y tm[0][2] = x'z tm[1][0] = y'x tm[1][1] = y'y tm[1][2] = y'z tm[2][0] = z'x tm[2][1] = z'y tm[2][2] = z'z
*vis_GlyphBegin - create an instance of a Glyph object
vis_Glyph *vis_GlyphBegin ()
None
Destroy an instance of a Glyph object using
void vis_GlyphEnd (vis_Glyph *glyph)
Return the current value of a Glyph object error flag using
Vint vis_GlyphError (vis_Glyph *glyph)
vis_GlyphSetObject - set pointers to attribute objects
void vis_GlyphSetObject (vis_Glyph *glyph, Vint objecttype, Vobject *object)
glyph Pointer to Glyph object. objecttype The name of the object type to be set. =VGL_DRAWFUN DrawFun object =VIS_VISCONTEXT VisContext object =VIS_COLORMAP ColorMap object =VIS_TRANSMAP TransMap object object Pointer to the object to be set.
None
vis_GlyphSetOrientTriad - set glyph orientation to global axes
void vis_GlyphSetOrientTriad (vis_Glyph *glyph, Vfloat tm[3][3])
glyph Pointer to Glyph object. tm Direction cosine matrix of glyph orientation.
None
Get tm as an output argument using
void vis_GlyphGetOrientTriad (vis_Glyph *glyph, Vfloat tm[3][3])
vis_GlyphSetOrientZ - set glyph orientation in z direction
void vis_GlyphSetOrientZ (vis_Glyph *glyph, Vfloat vz[3])
glyph Pointer to Glyph object. vz Vector of local z axis.
None
vis_GlyphSetOrientXY - set glyph orientation in x,y directions
void vis_GlyphSetOrientXY (vis_Glyph *glyph, Vfloat vx[3], Vfloat vy[3])
glyph Pointer to Glyph object. vx Vector of local x axis. vy Vector defining the half plane of the local y axis.
None
vis_GlyphArrow2D vis_GlyphArrow2D3D vis_GlyphArrow3D - draw arrows
void vis_GlyphArrow2D (vis_Glyph *glyph, Vfloat x[3], Vfloat l, Vfloat r, Vfloat h, Vfloat off, Vint head, Vint tail, Vint fill, Vint push, Vint cap) void vis_GlyphArrow2D3D (vis_Glyph *glyph, Vfloat x[3], Vfloat l, Vfloat r, Vfloat h, Vfloat off, Vint head, Vint tail, Vint fill, Vint push, Vint cap) void vis_GlyphArrow3D (vis_Glyph *glyph, Vfloat x[3], Vfloat l, Vfloat r, Vfloat h, Vfloat off, Vint head, Vint tail, Vint fill, Vint push, Vint cap)
glyph Pointer to Glyph object. x Coordinate location of tip of arrow. l Length of arrow r Radius of head of arrow h Height of head of arrow off Offset of arrow tip from x along z axis head Number of arrow heads. tail Arrow tail flag =VIS_OFF Do not display tail =VIS_ON Display tail fill Arrow head fill flag =VIS_OFF Do not fill arrow head =VIS_ON Fill arrow head push Arrow head push flag =VIS_OFF Do not draw arrow head in push style =VIS_ON Draw arrow head in push style cap Arrow head cap flag =VIS_OFF Do not cap arrow head =VIS_ON Cap arrow head
None
If an offset, off, is specified then the anchor point is moved a distance off along the shaft of the arrow from the arrow tip. Double headed arrows may be generated by setting head = 2. Arrows are oriented along the z axis of the orientation triad. If the push flag is set, the arrow head is drawn to appear to "push" the vector tail.
vis_GlyphBox - draw a box
void vis_GlyphBox(vis_Glyph *glyph, Vfloat x[3], Vfloat sx, Vfloat sy, Vfloat sz, Vint fill)
glyph Pointer to Glyph object. x Coordinate location of centroid of box sx Length in x direction sy Length in y direction sz Length in z direction fill Fill flag =VIS_OFF Do not fill =VIS_ON Fill box
None
vis_GlyphCircle - draw a circle in a plane
void vis_GlyphCircle (vis_Glyph *glyph, Vfloat x[3], Vfloat r, Vfloat off, Vint fill)
glyph Pointer to Glyph object. x Coordinate location of centroid of circle r Radius of circle off Offset of circle center along z axis. fill Fill flag =VIS_OFF Do not fill =VIS_ON Fill
None
vis_GlyphCone - draw a cone
void vis_GlyphCone (vis_Glyph *glyph, Vfloat x[3], Vfloat r, Vfloat h, Vfloat off, Vint fill)
glyph Pointer to Glyph object. x Coordinate location of base of cone r Radius of base of cone h Height of cone off Offset of cone base along z axis. fill Fill flag =VIS_OFF Do not fill =VIS_ON Fill
None
vis_GlyphConicalFrustum - draw a conical frustum
void vis_GlyphConicalFrustum (vis_Glyph *glyph, Vfloat x[3], Vfloat r1, Vfloat r2, Vfloat h, Vfloat off, Vint fill)
glyph Pointer to Glyph object. x Coordinate location of base of conical frustum r1 Radius of base of conical frustum r2 Radius of top of conical frustum h Height of conical frustum off Offset of base of conical frustum along z axis. fill Fill flag =VIS_OFF Do not fill =VIS_ON Fill
None
vis_GlyphCylinder - draw a cylinder
void vis_GlyphCylinder (vis_Glyph *glyph, Vfloat x[3], Vfloat r, Vfloat h, Vfloat off, Vint fill)
glyph Pointer to Glyph object. x Coordinate location of base of cylinder r Radius of cylinder h Height of cylinder off Offset of cylinder base along z axis. fill Fill flag =VIS_OFF Do not fill =VIS_ON Fill
None
vis_GlyphDisk - draw disk
void vis_GlyphDisk (vis_Glyph *glyph, Vfloat x[3], Vfloat r, Vfloat h, Vfloat off, Vint fill)
glyph Pointer to Glyph object. x Coordinate location of base of disk r Radius of disk h Height of disk off Offset of disk base along z axis. fill Fill flag =VIS_OFF Do not fill =VIS_ON Fill
None
vis_GlyphEllipsoid - draw an ellipsoid
void vis_GlyphEllipsoid (vis_Glyph *glyph, Vfloat x[3], Vfloat sx, Vfloat sy, Vfloat sz)
glyph Pointer to Glyph object. x Coordinate location of centroid of ellipse sx Length in x direction sy Length in y direction sz Length in z direction
None
vis_GlyphRectangle - draw a rectangle
void vis_GlyphRectangle (vis_Glyph *glyph, Vfloat x[3], Vfloat w, Vfloat h, Vfloat off, Vint fill)
glyph Pointer to Glyph object. x Coordinate location of center of rectangle w Width of rectangle h Height of rectangle off Offset of rectangle along z axis. fill Fill flag =VIS_OFF Do not fill =VIS_ON Fill
None
vis_GlyphSphere - draw a sphere
void vis_GlyphSphere (vis_Glyph *glyph, Vfloat x[3], Vfloat r, Vint fill)
glyph Pointer to Glyph object. x Coordinate location of center of sphere r Radius of sphere fill Fill flag =VIS_OFF Do not fill =VIS_ON Fill
None
vis_GlyphTriaxis - draw triaxis
void vis_GlyphTriaxis(vis_Glyph *glyph, Vfloat x[3], Vfloat sx, Vfloat sy, Vfloat sz, Vfloat off)
glyph Pointer to Glyph object. x Coordinate location of center of triaxis sx Axis length in x direction sy Axis length in y direction sz Axis length in z direction off Offset of triaxis along z axis.
None
*vis_TessBegin - create an instance of a Tess object vis_TessEnd - destroy an instance of a Tess object vis_TessError - return Tess object error flag
vis_TessGetInteger - get integer tesselation information vis_TessSetObject - set pointers to attribute objects. vis_TessSetParamd - set double precision display parameters vis_TessSetParami - set integer display parameters
vis_TessDef - define a new tesselation vis_TessSetArc - set an arc vis_TessSetLine - set a line vis_TessSetNormal - set normal to tesselation plane vis_TessSetPoint - set a point
vis_TessDraw - draw resulting tesselation vis_TessWrite - write input geometry to file vis_TessRead - read input geometry from file
Arcs are tesselated into segments whose size can be defined either in world or in device coordinates. The size type is set in the VisContext object using VisContextSetSizeType.
All input points, lines and arcs are tested for intersection. The intersection tolerance is specified using vis_TessSetParamd with parameter TESS_INTERTOL. Lines and arcs are divided and points are inserted where intersections occur. Coincident points are merged. Unconnected points are tested for intersection with lines and arcs. All points are included in the final tessellation.
All point locations are 3D world coordinates. All intersection and tesselation calculations are performed in a plane specified by a normal vector input using vis_TessSetNormal. By default the normal is a vector pointing in the positive z-coordinate direction.
The function vis_TessDraw performs the actual tesselation of the input geometry. This operation is subject to failure if the input geometry is not closed or there are very small features. Use vis_TessGetInteger to query for tesselation information to see if a subsequent vis_TessDraw operation was successful. The function vis_TessWrite is provided to write a complete description of the defined input geometry to a file. The primary use of this file is to encapsulate cases in which the Tess module fails in some respect. This output file can then be made available to Visual Kinematics for failure diagnosis of Tess tesselation algorithms.
*vis_TessBegin - create an instance of a Tess object
vis_Tess *vis_TessBegin ()
None
Destroy an instance of a Tess object using
void vis_TessEnd (vis_Tess *tess)
Return the current value of a Tess object error flag using
Vint vis_TessError (vis_Tess *tess)
vis_TessGetInteger - get integer tesselation information
void vis_TessGetInteger (vis_Tess *tess, Vint type, Vint iparam[])
tess Pointer to Tess object. type Type of integer information to query =TESS_NUMUNREC Number of unrecovered edges =TESS_NUMDRAWTRI Number of triangles drawn =TESS_NUMDRAWEDGE Number of edges drawn
iparam Returned integer information
vis_TessSetObject - set pointers to attribute objects
void vis_TessSetObject (vis_Tess *tess, Vint objecttype, Vobject *object)
tess Pointer to Tess object. objecttype The name of the object type to be set. =VGL_DRAWFUN DrawFun object =VIS_VISCONTEXT VisContext object =VIS_COLORMAP ColorMap object =VIS_TRANSMAP TransMap object object Pointer to the object to be set.
None
vis_TessSetParamd - set tesselation double precision parameters.
void vis_TessSetParamd (vis_Tess *tess, Vint type, Vdouble paramd)
tess Pointer to Tess object. type Parameter type =TESS_INTERTOL Tolerance for curve intersection paramd Parameter value
None
Use TESS_INTERTOL to specify the tolerance used to compute intersections of lines and arcs. Defaults to 2.e-7.
vis_TessSetParami - set tesselation integer parameters.
void vis_TessSetParami (vis_Tess *tess, Vint type, Vint parami)
tess Pointer to Tess object. type Parameter type =TESS_EDGE Type of edge to be drawn parami Parameter value =TESS_EDGE_ALL Display all generated edges =TESS_EDGE_BOUND Display all tesselated boundaries =TESS_EDGE_INPUT Display the input curves =TESS_EDGE_DANGLING Display dangling edges only =TESS_EDGE_OUTLINE Display only the region's outline
None
The parameter TESS_EDGE controls which edges are displayed if the Edge parameter in VisContext is turned on. TESS_EDGE_ALL displays all generated edges; TESS_EDGE_BOUND displays all geometry-related edges. These include the original line segments, as well as the tesselation of arcs. TESS_EDGE_OUTLINE displays edges that are present in only a single polygon and delineate the region of interest from empty space; and TESS_EDGE_INPUT displays the original input curves. In this case, arcs are displayed as two segments, as arcs are defined through three points. TESS_EDGE_DANGLING draws only those edges which are not on or in the interior of a closed loop of line segments. By Default TESS_EDGE is set to TESS_EDGE_OUTLINE.
vis_TessDef - clear object and set new initial parameters
void vis_TessDef (vis_Tess *tess, Vint npts, Vint nlines)
tess Pointer to Tess object. npts Initial value for number of points nlines Initial value for number of lines and arcs
None
vis_TessSetArc - input an arc
void vis_TessSetArc(vis_Tess *tess, Vint id, Vint ix[3])
tess Pointer to Tess object. id Arc id ix Array with 3 points defining the arc
None
vis_TessSetLine - input a straight line
void vis_TessSetLine (vis_Tess *tess, Vint id, Vint ix[2])
tess Pointer to Tess object. id Line id ix Array with the line's two end points.
None
vis_TessSetNormal - set normal to tesselation plane
void vis_TessSetNormal (vis_Tess *tess, Vfloat v[3]) void vis_TessSetNormaldv (vis_Tess *tess, Vdouble v[3])
tess Pointer to Tess object. v Normal vector to tesselation plane
None
vis_TessSetPoint - draw a cone
void vis_TessSetPoint (vis_Tess *tess, Vint id, Vfloat x[3]) void vis_TessSetPointdv (vis_Tess *tess, Vint id, Vdouble x[3])
tess Pointer to Tess object. id Point id x Point coordinates.
None
vis_TessDraw - draw a tesselation
void vis_TessDraw (vis_Tess *tess)
tess Pointer to Tess object.
None
vis_TessRead - read input geometry from file
void vis_TessRead (vis_Tess *tess, Vint type, const Vchar *path)
tess Pointer to Tess object. type File type =SYS_ASCII ASCII format =SYS_BINARY Binary format path File path
None
vis_TessWrite - write input geometry to file
void vis_TessWrite (vis_Tess *tess, Vint type, const Vchar *path)
tess Pointer to Tess object. type File type =SYS_ASCII ASCII format =SYS_BINARY Binary format path File path
None
*vis_TriadBegin - create an instance of a Triad object vis_TriadEnd - destroy an instance of a Triad object vis_TriadError - return Triad object error flag
vis_TriadDraw - draw a coordinate system triad vis_TriadSetObject - set pointers to attribute objects. GetObject - get pointers to attribute objects. vis_TriadSetParami - set display parameters
Coordinate systems are drawn given an origin and orientation relative to the world coordinate system. The orientation is specified by a direction cosine matrix which defines a local x',y',z' rectangular system in world coordinate space. The coordinate system to be drawn by Triad is aligned to the x',y',z' system. A Cartesian system is a rectangular coordinate system characterized by coordinates x',y',z'. A cylindrical system is characterized by coordinates r,theta,z' where theta is the angle about the z' axis (positive x' toward positive y'). An alternate definition of a cylindrical system is available in which theta is the angle about the z' axis (positive y' toward positive x'). A spherical system is characterized by coordinates r,theta,phi where theta is the angle about the z' axis (positive x' toward positive y') and phi is the angle about the x' axis (positive y' toward positive z'). An alternate definition of a spherical system is available (for specific support of NASTRAN spherical coordinate systems) in which theta is the angle about the negative x' axis (positive z' toward positive y') and phi is the angle about the z' axis (positive x' toward positive y'). A toroidal system is characterized by the radius of the torus and coordinates r,theta,phi where theta is the angle about the z' axis (positive x' toward positive y') and phi is the angle about the x' axis (positive y' toward positive z').
The triad display is parameterized in part by the parameters set using vis_TriadSetParami. The basic triad icon consists of three orthogonal vectors showing the orientation axes of the coordinate system. The axes are labeled with X,Y,Z, R,T,Z or R,T,P depending upon whether the coordinate system is Cartesian, cylindrical, spherical or toroidal.
The radius and angle conventions of cylindrical, spherical and toroidal systems may be displayed by setting the parameter TRIAD_DETAIL on. If detail is on, then the orientation axes are labeled as X,Y,Z regardless of coordinate system type. In addition a portion of a filled box, cylinder or sphere may be drawn in the first octant of the triad if TRIAD_SHAPE is set on.
The use of a stroked font as opposed to a raster font for drawing labels may be toggled on or off using the parameter TRIAD_STROKEFONT. The display of labels may be toggled on or off using the parameter TRIAD_LABELS.
The result of drawing triads in various styles are illustrated in Figures 9-5.
The VisContext attribute object is required for all drawing. The following VisContext components are used.
*vis_TriadBegin - create an instance of a Triad object
vis_Triad *vis_TriadBegin ()
None
Destroy an instance of a Triad object using
void vis_TriadEnd (vis_Triad *triad)
Return the current value of a Triad object error flag using
Vint vis_TriadError (vis_Triad *triad)
vis_TriadDraw - draw a coordinate system triad
void vis_TriadDraw (vis_Triad *triad, Vint type, Vfloat x[3], Vfloat tm[3][3])
triad Pointer to Triad object. type Coordinate system type. =SYS_CARTESIAN Cartesian system =SYS_CYLINDRICAL Cylindrical system =SYS_CYLINDRICAL_ALT Cylindrical alternate system =SYS_SPHERICAL Spherical system =SYS_SPHERICAL_ALT Spherical alternate system =SYS_TOROIDAL Toroidal system x Origin of triad icon. tm Direction cosine matrix of triad orientation.
None
vis_TriadSetObject - set pointers to attribute objects
void vis_TriadSetObject (vis_Triad *triad, Vint objecttype, Vobject *object)
triad Pointer to Triad object. objecttype The name of the object type to be set. =VGL_DRAWFUN DrawFun object =VIS_COLORMAP ColorMap object =VIS_TRANSMAP TransMap object =VIS_VISCONTEXT VisContext object object Pointer to the object to be set.
None
Get object as an output argument using
void vis_TriadGetObject (vis_Triad *triad, Vint objecttype, Vobject **object)
vis_TriadSetParami - set display parameters
void vis_TriadSetParami (vis_Triad *triad, Vint type, Vint iparam)
triad Pointer to Triad object. type Type of display parameter to set =TRIAD_DETAIL Toggle display of detail showing radius and angle conventions. =TRIAD_LABELS Toggle display of all labels. =TRIAD_SHAPE Toggle display of filled shape =TRIAD_STROKEFONT Toggle use of stroked font labels. iparam Specifies the integer value that type will be set to. =VIS_ON Enable =VIS_OFF Disable
None
Toggle the display of all labels. By default TRIAD_LABELS is set to VIS_ON.
Toggle the display of coordinate system shape. The shape consists of a portion of a filled box, cylinder, sphere or torus drawn in the first octant of the triad for Cartesian, cylindrical, spherical or toroidal systems respectively. An additional condition for shape drawing is TRIAD_DETAIL must be on. By default TRIAD_SHAPE is set to VIS_OFF.
Toggle the use of a stroked font as opposed to a raster font for drawing labels. By default TRIAD_STROKEFONT is set to VIS_OFF.