vdraw — Allows drawing of lines and polygons (optionally with per vertex normals) in the MGED graphics display. It is used to build a named list of drawing commands for MGED, send the list to the MGED display, modify the list, or delete all or part of the list.
Allows drawing of lines and polygons (optionally with per vertex normals) in the MGED graphics display. It is used to build a named list of drawing commands for MGED, send the list to the MGED display, modify the list, or delete all or part of the list. All vertices in the vdraw command are in millimeters. The MGED drawing commands are represented by integers in the vdraw command. The MGED drawing commands and the integers that vdraw uses for them are:
Table 1. Drawing Commands
MGED Drawing Command | Vdraw integer | MGED Action |
---|---|---|
RT_VLIST_LINE_MOVE | 0 | Begin a new line at this point |
RT_VLIST_LINE_DRAW | 1 | Draw line from previous point to this point |
RT_VLIST_POLY_START | 2 | Start polygon (argument is surface normal) |
RT_VLIST_POLY_MOVE | 3 | move to first polygon vertex |
RT_VLIST_POLY_DRAW | 4 | Subsequent polygon vertices |
RT_VLIST_POLY_END | 5 | Last polygon vertex (should be same as first) |
RT_VLIST_POLY_VERTNORM | 6 | Vertex normal (for shading interpolation) |
The vdraw commands are as follows:
open -- with no arguments, this returns 1 if there is a open list; 0 otherwise. If an argument is supplied, a command list is opened with the provided name.
write-- with arguments of i c x y z, the MGED drawing command #c is placed in the ith position of the command list with the vertex as ( x y z).
-- with arguments of next c x y z, the command is placed at the end of the list.
insert -- with arguments of i c x y z, the MGED drawing command #c is inserted just before the ith position of the command list.
delete -- with an integer argument of i, the ith command is deleted.
-- with an argument of "last," the last command on the list is deleted.
-- with an argument of "all," all the commands on the list are deleted.
params -- with an argument of color rrggbb, the color of all objects on this list is set. The rrggbb is a hex number representing the color, "ffffff" is white, "ff0000" is red, "00ff00" is green, etc.
-- with a single string argument, the name of the current list is changed.
read -- with an integer argument of i, the ith command is returned.
-- with an argument of "color," the current color is returned.
-- with an argument of "length," the number of commands in the current list is returned.
-- with an argument of "name," the name of the current command list is returned.
send -- send the current command list to the MGED display manager.
vlist -- with an argument of "list," return a list of the names of all existing command lists.
-- with an argument of delete list_name, delete the specified command list.
All textual arguments may be abbreviated by their first letter.
The eight examples show the use of the vdraw command with four different commands and various arguments to build a list of commands to draw a square.
Example 4. Draw a line from the previous point to a specified point.
mged>
vdraw write next 1 100 0 0
Draws a line from the origin to (100 0 0).
Example 5. Draw a line from the previous point to a specified point.
mged>
vdraw write next 1 100 100 0
Draws a line from the previous point to (100 100 0).
Example 6. Draw a line from the previous point to a specified point.
mged>
vdraw write next 1 0 100 0
Draws a line from the previous point to (0 100 0).
Example 7. Draw a line from the previous point to the origin.
mged>
vdraw write next 1 0 0 0
Draws a line from the previous point to the origin.
Example 8. Send the command list to the display manager.
mged>
vdraw send
Draws the square in the MGED display.
Reports of bugs or problems should be submitted via electronic
mail to <devs@brlcad.org>