BRL-CAD
#include "common.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <signal.h>
#include "tcl.h"
#include "bu/cmd.h"
#include "bn.h"
#include "vmath.h"
#include "mater.h"
#include "nmg.h"
#include "./ged_private.h"
Include dependency graph for vdraw.c:

Go to the source code of this file.

Macros

#define REV_BU_LIST_FOR(p, structure, hp)
 

Functions

int vdraw_insert (void *data, int argc, const char *argv[])
 
int vdraw_delete (void *data, int argc, const char *argv[])
 
int ged_vdraw (struct ged *gedp, int argc, const char *argv[])
 

Detailed Description

Edit vector lists and display them as pseudosolids.

OPEN COMMAND vdraw open - with no argument, asks if there is an open vlist (1 yes, 0 no)

name - opens the specified vlist returns 1 if creating new vlist 0 if opening an existing vlist

EDITING COMMANDS - no return value

vdraw write i c x y z - write params into i-th vector next c x y z - write params to end of vector list

vdraw insert i c x y z - insert params in front of i-th vector

vdraw delete i - delete i-th vector last - delete last vector on list all - delete all vectors on list

PARAMETER SETTING COMMAND - no return value vdraw params color - set the current color with 6 hex digits representing rrggbb name - change the name of the current vlist

QUERY COMMAND vdraw read i - returns contents of i-th vector "c x y z" color - return the current color in hex length - return number of vectors in list name - return name of current vlist

DISPLAY COMMAND - vdraw send - send the current vlist to the display returns 0 on success, -1 if the name conflicts with an existing true solid

CURVE COMMANDS vdraw vlist list - return list of all existing vlists delete name - delete the named vlist

All textual arguments can be replaced by their first letter. (e.g. "vdraw d a" instead of "vdraw delete all"

In the above listing: "i" refers to an integer "c" is an integer representing one of the following bn_vlist commands:

BN_VLIST_LINE_MOVE 0 / begin new line / BN_VLIST_LINE_DRAW 1 / draw line / BN_VLIST_POLY_START 2 / pt[] has surface normal / BN_VLIST_POLY_MOVE 3 / move to first poly vertex / BN_VLIST_POLY_DRAW 4 / subsequent poly vertex / BN_VLIST_POLY_END 5 / last vert (repeats 1st), draw poly / BN_VLIST_POLY_VERTNORM 6 / per-vertex normal, for interpolation /

"x y z" refer to floating point values which represent a point or normal vector. For commands 0, 1, 3, 4, and 5, they represent a point, while for commands 2 and 6 they represent normal vectors

Example Use - vdraw open rays vdraw delete all foreach partition $ray { ...stuff... vdraw write next 0 $inpt vdraw write next 1 $outpt } vdraw send

Definition in file vdraw.c.

Macro Definition Documentation

#define REV_BU_LIST_FOR (   p,
  structure,
  hp 
)
Value:
(p)=BU_LIST_LAST(structure, hp); \
(p)=BU_LIST_PLAST(structure, p)
#define BU_LIST_LAST(structure, hp)
Definition: list.h:306
#define BU_LIST_PLAST(structure, p)
Definition: list.h:424
#define BU_LIST_NOT_HEAD(p, hp)
Definition: list.h:324

Definition at line 115 of file vdraw.c.

Referenced by vdraw_delete().

Function Documentation

int vdraw_insert ( void *  data,
int  argc,
const char *  argv[] 
)

Definition at line 240 of file vdraw.c.

References BN_VLIST_CHUNK, BU_LIST_FOR, BU_LIST_INSERT, BU_LIST_IS_HEAD, BU_LIST_LAST, BU_LIST_PLAST, bu_vls_printf(), bn_vlist::cmd, ged_drawable::gd_currVHead, GED_ERROR, ged::ged_gdp, GED_HELP, GED_OK, ged::ged_result_str, bn_vlist::l, bn_vlist::nused, bn_vlist::pt, RT_GET_VLIST, usage(), and vd_curve::vdc_vhd.

Here is the call graph for this function:

int vdraw_delete ( void *  data,
int  argc,
const char *  argv[] 
)

Definition at line 332 of file vdraw.c.

References BN_VLIST_CHUNK, BU_LIST_FOR, BU_LIST_NOT_HEAD, BU_LIST_PNEXT, bu_vls_printf(), bn_vlist::cmd, ged_drawable::gd_currVHead, GED_ERROR, ged::ged_gdp, GED_HELP, GED_OK, ged::ged_result_str, bn_vlist::nused, bn_vlist::pt, REV_BU_LIST_FOR, usage(), and vd_curve::vdc_vhd.

Here is the call graph for this function:

int ged_vdraw ( struct ged gedp,
int  argc,
const char *  argv[] 
)

Vector drawing utility.

Definition at line 774 of file vdraw.c.